qlogicagent 2.16.6 → 2.16.7
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/agent.js +16 -16
- package/dist/cli.js +372 -373
- package/dist/index.js +371 -372
- package/dist/protocol.js +1 -1
- package/dist/types/cli/base-tool-bootstrap.d.ts +1 -0
- package/dist/types/cli/handlers/files-handler.d.ts +5 -0
- package/dist/types/cli/handlers/message-feedback-handler.d.ts +29 -0
- package/dist/types/cli/handlers/project-handler.d.ts +1 -0
- package/dist/types/cli/handlers/turn-baseline-handler.d.ts +8 -0
- package/dist/types/cli/handlers/turn-handler.d.ts +5 -0
- package/dist/types/cli/handlers/working-materials-handler.d.ts +9 -0
- package/dist/types/cli/idle-dream-coordinator.d.ts +6 -0
- package/dist/types/cli/mcp-bootstrap.d.ts +1 -0
- package/dist/types/cli/rpc-registry.d.ts +6 -0
- package/dist/types/cli/stdio-rpc-handler-hosts.d.ts +1 -0
- package/dist/types/cli/stdio-runtime-bootstrap.d.ts +1 -0
- package/dist/types/cli/tool-bootstrap-core-registration.d.ts +1 -0
- package/dist/types/cli/tool-bootstrap.d.ts +1 -0
- package/dist/types/protocol/methods.d.ts +24 -0
- package/dist/types/protocol/wire/agent-events.d.ts +2 -2
- package/dist/types/protocol/wire/gateway-rpc.d.ts +160 -0
- package/dist/types/protocol/wire/notification-payloads.d.ts +27 -0
- package/dist/types/runtime/infra/feedback-distillation-worker.d.ts +20 -0
- package/dist/types/runtime/infra/feedback-distillation.d.ts +30 -0
- package/dist/types/runtime/infra/feedback-event-store.d.ts +160 -0
- package/dist/types/runtime/infra/feedback-outbox.d.ts +26 -0
- package/dist/types/runtime/infra/feedback-redaction.d.ts +71 -0
- package/dist/types/runtime/infra/feedback-upload-client.d.ts +39 -0
- package/dist/types/runtime/infra/feedback-upload-worker.d.ts +11 -0
- package/dist/types/runtime/infra/turn-baseline-store.d.ts +102 -0
- package/dist/types/runtime/infra/turn-telemetry-store.d.ts +59 -0
- package/dist/types/runtime/infra/working-materials-store.d.ts +35 -0
- package/dist/types/runtime/ports/memory-provider.d.ts +6 -0
- package/dist/types/runtime/ports/tool-contracts.d.ts +1 -0
- package/dist/types/runtime/prompt/fresh-workspace-evidence.d.ts +14 -0
- package/dist/types/skills/mcp/mcp-manager.d.ts +11 -0
- package/dist/types/skills/memory/local-memory-provider.d.ts +3 -3
- package/dist/types/skills/memory/local-store-records.d.ts +18 -1
- package/dist/types/skills/memory/local-store.d.ts +8 -195
- package/dist/types/skills/memory/memory-consolidation.d.ts +14 -0
- package/dist/types/skills/memory/sqlite-memory-schema.d.ts +1 -1
- package/dist/types/skills/tools/skill-tool.d.ts +1 -1
- package/dist/vendor/hatch-pet/LICENSE.txt +201 -201
- package/dist/vendor/hatch-pet/NOTICE.md +25 -25
- package/dist/vendor/hatch-pet/references/animation-rows.md +29 -29
- package/dist/vendor/hatch-pet/references/codex-pet-contract.md +35 -35
- package/dist/vendor/hatch-pet/references/qa-rubric.md +66 -66
- package/dist/vendor/hatch-pet/scripts/compose_atlas.py +169 -169
- package/dist/vendor/hatch-pet/scripts/derive_running_left_from_running_right.py +150 -150
- package/dist/vendor/hatch-pet/scripts/extract_strip_frames.py +408 -408
- package/dist/vendor/hatch-pet/scripts/inspect_frames.py +256 -256
- package/dist/vendor/hatch-pet/scripts/make_contact_sheet.py +96 -96
- package/dist/vendor/hatch-pet/scripts/prepare_pet_run.py +834 -834
- package/dist/vendor/hatch-pet/scripts/render_animation_previews.py +78 -78
- package/dist/vendor/hatch-pet/scripts/validate_atlas.py +157 -157
- package/package.json +1 -1
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/** Lightweight attachment reference carried on records / atlas wire (no bytes, no extractedText). */
|
|
2
|
+
export interface MemoryAttachmentRef {
|
|
3
|
+
id: string;
|
|
4
|
+
kind: string;
|
|
5
|
+
filename: string;
|
|
6
|
+
mimeType: string;
|
|
7
|
+
size: number;
|
|
8
|
+
url: string;
|
|
9
|
+
}
|
|
1
10
|
export interface MemoryRecord {
|
|
2
11
|
id: string;
|
|
3
12
|
text: string;
|
|
@@ -15,6 +24,8 @@ export interface MemoryRecord {
|
|
|
15
24
|
accessCount: number;
|
|
16
25
|
lastAccessedAt: number;
|
|
17
26
|
isArchived: boolean;
|
|
27
|
+
/** Lightweight attachment refs (populated by the provider for atlas/detail). */
|
|
28
|
+
attachments?: MemoryAttachmentRef[];
|
|
18
29
|
}
|
|
19
30
|
export interface MemoryInsertInput {
|
|
20
31
|
text: string;
|
|
@@ -84,7 +95,7 @@ export interface MemoryAtlasResult {
|
|
|
84
95
|
endAt: number;
|
|
85
96
|
} | null;
|
|
86
97
|
}
|
|
87
|
-
export type MemorySourceKind = "manual" | "explicit" | "document" | "image" | "video" | "auto" | "turn" | "dream" | "agent";
|
|
98
|
+
export type MemorySourceKind = "manual" | "explicit" | "document" | "image" | "video" | "auto" | "turn" | "dream" | "agent" | "feedback";
|
|
88
99
|
export type MemoryClaimStatus = "active" | "superseded" | "conflicted" | "archived" | "pending_confirmation";
|
|
89
100
|
export type MemoryProposalStatus = "pending" | "accepted" | "merged" | "conflicted" | "rejected";
|
|
90
101
|
export interface MemoryObservationInput {
|
|
@@ -119,6 +130,12 @@ export interface MemoryProposalInput {
|
|
|
119
130
|
tags?: string[];
|
|
120
131
|
status?: MemoryProposalStatus;
|
|
121
132
|
relatedClaimIds?: string[];
|
|
133
|
+
/**
|
|
134
|
+
* Crash-safe dedup key for evidence-bearing sources (feedback distillation — §10). When set,
|
|
135
|
+
* proposeExtracted skips inserting a duplicate proposal for the same key. Left undefined by all
|
|
136
|
+
* existing callers (LLM extraction / dream / manual), so their behaviour is unchanged.
|
|
137
|
+
*/
|
|
138
|
+
idempotencyKey?: string;
|
|
122
139
|
}
|
|
123
140
|
export interface MemoryProposalRecord extends Omit<MemoryProposalInput, "value" | "validTime" | "tags" | "status" | "relatedClaimIds"> {
|
|
124
141
|
id: string;
|
|
@@ -12,36 +12,9 @@
|
|
|
12
12
|
* - memories_fts: FTS5 full-text index for keyword search
|
|
13
13
|
* - profiles: user profile KV (future)
|
|
14
14
|
*/
|
|
15
|
+
import type { MemoryAtlasResult, MemoryClaimInput, MemoryClaimRecord, MemoryClaimStatus, MemoryConflictRecord, MemoryInsertInput, MemoryObservationInput, MemoryProposalInput, MemoryProposalStatus, MemoryRecord, MemorySearchHit, MemoryUpdateInput, SqliteDatabase } from "./local-store-records.js";
|
|
15
16
|
export { resolveMemoryDbPath } from "./memory-db-path.js";
|
|
16
|
-
export
|
|
17
|
-
id: string;
|
|
18
|
-
text: string;
|
|
19
|
-
userId: string;
|
|
20
|
-
category: string;
|
|
21
|
-
importance: number;
|
|
22
|
-
confidence: number;
|
|
23
|
-
source: string;
|
|
24
|
-
sessionId: string;
|
|
25
|
-
eventDate: string;
|
|
26
|
-
tags: string[];
|
|
27
|
-
embedding: Float32Array | null;
|
|
28
|
-
createdAt: number;
|
|
29
|
-
updatedAt: number;
|
|
30
|
-
accessCount: number;
|
|
31
|
-
lastAccessedAt: number;
|
|
32
|
-
isArchived: boolean;
|
|
33
|
-
/** Lightweight attachment refs (populated by the provider for atlas/detail). */
|
|
34
|
-
attachments?: MemoryAttachmentRef[];
|
|
35
|
-
}
|
|
36
|
-
/** Lightweight attachment reference carried on records / atlas wire (no bytes, no extractedText). */
|
|
37
|
-
export interface MemoryAttachmentRef {
|
|
38
|
-
id: string;
|
|
39
|
-
kind: string;
|
|
40
|
-
filename: string;
|
|
41
|
-
mimeType: string;
|
|
42
|
-
size: number;
|
|
43
|
-
url: string;
|
|
44
|
-
}
|
|
17
|
+
export type { MemoryAtlasBucket, MemoryAtlasCluster, MemoryAtlasResult, MemoryAtlasWindowCursor, MemoryAttachmentRef, MemoryClaimInput, MemoryClaimRecord, MemoryClaimStatus, MemoryConflictRecord, MemoryInsertInput, MemoryObservationInput, MemoryObservationRecord, MemoryProposalInput, MemoryProposalRecord, MemoryProposalStatus, MemoryRecord, MemorySearchHit, MemorySourceKind, MemoryUpdateInput, SqliteDatabase, SqliteStatement, } from "./local-store-records.js";
|
|
45
18
|
/** Full attachment index row (DB-backed; file bytes live on disk under the attachments dir). */
|
|
46
19
|
export interface MemoryAttachmentRow {
|
|
47
20
|
id: string;
|
|
@@ -66,172 +39,6 @@ export interface MemoryAttachmentInsert {
|
|
|
66
39
|
extractedText?: string;
|
|
67
40
|
memoryId?: string;
|
|
68
41
|
}
|
|
69
|
-
export interface MemoryInsertInput {
|
|
70
|
-
text: string;
|
|
71
|
-
userId: string;
|
|
72
|
-
category?: string;
|
|
73
|
-
importance?: number;
|
|
74
|
-
confidence?: number;
|
|
75
|
-
source?: string;
|
|
76
|
-
sessionId?: string;
|
|
77
|
-
eventDate?: string;
|
|
78
|
-
tags?: string[];
|
|
79
|
-
embedding?: Float32Array;
|
|
80
|
-
}
|
|
81
|
-
export interface MemoryUpdateInput {
|
|
82
|
-
text?: string;
|
|
83
|
-
category?: string;
|
|
84
|
-
importance?: number;
|
|
85
|
-
source?: string;
|
|
86
|
-
eventDate?: string;
|
|
87
|
-
tags?: string[];
|
|
88
|
-
embedding?: Float32Array | null;
|
|
89
|
-
}
|
|
90
|
-
export interface MemorySearchHit {
|
|
91
|
-
id: string;
|
|
92
|
-
text: string;
|
|
93
|
-
score: number;
|
|
94
|
-
category: string;
|
|
95
|
-
importance: number;
|
|
96
|
-
metadata: Record<string, unknown>;
|
|
97
|
-
}
|
|
98
|
-
export interface MemoryAtlasBucket {
|
|
99
|
-
id: string;
|
|
100
|
-
startAt: number;
|
|
101
|
-
endAt: number;
|
|
102
|
-
count: number;
|
|
103
|
-
avgImportance: number;
|
|
104
|
-
avgConfidence: number;
|
|
105
|
-
topCategory: string;
|
|
106
|
-
}
|
|
107
|
-
export interface MemoryAtlasCluster {
|
|
108
|
-
id: string;
|
|
109
|
-
label: string;
|
|
110
|
-
kind: "source" | "category" | "tag";
|
|
111
|
-
count: number;
|
|
112
|
-
startAt: number;
|
|
113
|
-
endAt: number;
|
|
114
|
-
avgImportance: number;
|
|
115
|
-
avgConfidence: number;
|
|
116
|
-
topCategory: string;
|
|
117
|
-
}
|
|
118
|
-
export interface MemoryAtlasWindowCursor {
|
|
119
|
-
startAt: number;
|
|
120
|
-
endAt: number;
|
|
121
|
-
centerAt: number;
|
|
122
|
-
pageSize: number;
|
|
123
|
-
hasBefore: boolean;
|
|
124
|
-
hasAfter: boolean;
|
|
125
|
-
}
|
|
126
|
-
export interface MemoryAtlasResult {
|
|
127
|
-
totalCount: number;
|
|
128
|
-
records: MemoryRecord[];
|
|
129
|
-
buckets: MemoryAtlasBucket[];
|
|
130
|
-
clusters: MemoryAtlasCluster[];
|
|
131
|
-
windowCursor: MemoryAtlasWindowCursor | null;
|
|
132
|
-
timeRange: {
|
|
133
|
-
startAt: number;
|
|
134
|
-
endAt: number;
|
|
135
|
-
} | null;
|
|
136
|
-
}
|
|
137
|
-
export type MemorySourceKind = "manual" | "explicit" | "document" | "image" | "video" | "auto" | "turn" | "dream" | "agent";
|
|
138
|
-
export type MemoryClaimStatus = "active" | "superseded" | "conflicted" | "archived" | "pending_confirmation";
|
|
139
|
-
export type MemoryProposalStatus = "pending" | "accepted" | "merged" | "conflicted" | "rejected";
|
|
140
|
-
export interface MemoryObservationInput {
|
|
141
|
-
userId: string;
|
|
142
|
-
text: string;
|
|
143
|
-
source: string;
|
|
144
|
-
sourcePriority: number;
|
|
145
|
-
sessionId?: string;
|
|
146
|
-
evidenceType?: string;
|
|
147
|
-
payload?: Record<string, unknown>;
|
|
148
|
-
}
|
|
149
|
-
export interface MemoryObservationRecord extends Required<Omit<MemoryObservationInput, "payload" | "sessionId" | "evidenceType">> {
|
|
150
|
-
id: string;
|
|
151
|
-
sessionId: string;
|
|
152
|
-
evidenceType: string;
|
|
153
|
-
payload: Record<string, unknown>;
|
|
154
|
-
createdAt: number;
|
|
155
|
-
}
|
|
156
|
-
export interface MemoryProposalInput {
|
|
157
|
-
userId: string;
|
|
158
|
-
observationIds: string[];
|
|
159
|
-
text: string;
|
|
160
|
-
category: string;
|
|
161
|
-
importance: number;
|
|
162
|
-
confidence: number;
|
|
163
|
-
source: string;
|
|
164
|
-
sourcePriority: number;
|
|
165
|
-
entity: string;
|
|
166
|
-
predicate: string;
|
|
167
|
-
value: Record<string, unknown>;
|
|
168
|
-
validTime?: string;
|
|
169
|
-
tags?: string[];
|
|
170
|
-
status?: MemoryProposalStatus;
|
|
171
|
-
relatedClaimIds?: string[];
|
|
172
|
-
}
|
|
173
|
-
export interface MemoryProposalRecord extends Omit<MemoryProposalInput, "value" | "validTime" | "tags" | "status" | "relatedClaimIds"> {
|
|
174
|
-
id: string;
|
|
175
|
-
value: Record<string, unknown>;
|
|
176
|
-
validTime: string;
|
|
177
|
-
tags: string[];
|
|
178
|
-
status: MemoryProposalStatus;
|
|
179
|
-
relatedClaimIds: string[];
|
|
180
|
-
createdAt: number;
|
|
181
|
-
updatedAt: number;
|
|
182
|
-
}
|
|
183
|
-
export interface MemoryClaimInput {
|
|
184
|
-
userId: string;
|
|
185
|
-
memoryId?: string;
|
|
186
|
-
entity: string;
|
|
187
|
-
predicate: string;
|
|
188
|
-
value: Record<string, unknown>;
|
|
189
|
-
text: string;
|
|
190
|
-
category: string;
|
|
191
|
-
importance: number;
|
|
192
|
-
confidence: number;
|
|
193
|
-
source: string;
|
|
194
|
-
sourcePriority: number;
|
|
195
|
-
status: MemoryClaimStatus;
|
|
196
|
-
validTime?: string;
|
|
197
|
-
evidenceIds: string[];
|
|
198
|
-
supersedesClaimId?: string;
|
|
199
|
-
conflictGroupId?: string;
|
|
200
|
-
}
|
|
201
|
-
export interface MemoryClaimRecord extends Omit<MemoryClaimInput, "memoryId" | "value" | "validTime" | "supersedesClaimId" | "conflictGroupId"> {
|
|
202
|
-
id: string;
|
|
203
|
-
memoryId: string;
|
|
204
|
-
value: Record<string, unknown>;
|
|
205
|
-
validTime: string;
|
|
206
|
-
supersedesClaimId: string;
|
|
207
|
-
conflictGroupId: string;
|
|
208
|
-
createdAt: number;
|
|
209
|
-
updatedAt: number;
|
|
210
|
-
}
|
|
211
|
-
export interface MemoryConflictRecord {
|
|
212
|
-
id: string;
|
|
213
|
-
userId: string;
|
|
214
|
-
claimAId: string;
|
|
215
|
-
claimBId: string;
|
|
216
|
-
reason: string;
|
|
217
|
-
status: "open" | "resolved" | "dismissed";
|
|
218
|
-
createdAt: number;
|
|
219
|
-
updatedAt: number;
|
|
220
|
-
}
|
|
221
|
-
export interface SqliteDatabase {
|
|
222
|
-
exec(sql: string): void;
|
|
223
|
-
prepare(sql: string): SqliteStatement;
|
|
224
|
-
pragma(pragma: string): unknown;
|
|
225
|
-
close(): void;
|
|
226
|
-
}
|
|
227
|
-
export interface SqliteStatement {
|
|
228
|
-
run(...params: unknown[]): {
|
|
229
|
-
changes: number;
|
|
230
|
-
lastInsertRowid: number | bigint;
|
|
231
|
-
};
|
|
232
|
-
get(...params: unknown[]): unknown;
|
|
233
|
-
all(...params: unknown[]): unknown[];
|
|
234
|
-
}
|
|
235
42
|
export declare class LocalMemoryStore {
|
|
236
43
|
private db;
|
|
237
44
|
constructor(db: SqliteDatabase);
|
|
@@ -438,6 +245,12 @@ export declare class LocalMemoryStore {
|
|
|
438
245
|
enforceCapacityLimit(userId: string, maxCount?: number): number;
|
|
439
246
|
insertObservation(input: MemoryObservationInput): string;
|
|
440
247
|
insertProposal(input: MemoryProposalInput): string;
|
|
248
|
+
/**
|
|
249
|
+
* Look up an existing proposal by its idempotency key (feedback distillation — §10). Returns the
|
|
250
|
+
* proposal id if one already exists for this user + key, else null, letting proposeExtracted skip
|
|
251
|
+
* a duplicate crash-safely (the key survives a worker restart mid-sweep).
|
|
252
|
+
*/
|
|
253
|
+
findProposalByIdempotencyKey(userId: string, idempotencyKey: string): string | null;
|
|
441
254
|
updateProposalStatus(id: string, status: MemoryProposalStatus, relatedClaimIds?: string[]): boolean;
|
|
442
255
|
insertClaim(input: MemoryClaimInput): string;
|
|
443
256
|
listClaims(userId: string, statuses?: MemoryClaimStatus[]): MemoryClaimRecord[];
|
|
@@ -9,6 +9,20 @@ export interface ExtractedMemoryItem {
|
|
|
9
9
|
tags?: string[];
|
|
10
10
|
/** Ids of already-uploaded attachments to link to this memory on commit. */
|
|
11
11
|
attachmentIds?: string[];
|
|
12
|
+
/**
|
|
13
|
+
* Explicit confidence for evidence-bearing sources (feedback distillation — §10). When set,
|
|
14
|
+
* proposeExtracted uses it verbatim instead of the source-derived default. Other callers omit it.
|
|
15
|
+
*/
|
|
16
|
+
confidence?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Evidence trail for distillation-style sources. `refs` (e.g. feedbackIds + turn:<id>) is stored
|
|
19
|
+
* on the observation for audit; `idempotencyKey` makes the proposal insert crash-safe + dedup'd.
|
|
20
|
+
*/
|
|
21
|
+
evidence?: {
|
|
22
|
+
kind: string;
|
|
23
|
+
refs: string[];
|
|
24
|
+
idempotencyKey: string;
|
|
25
|
+
};
|
|
12
26
|
}
|
|
13
27
|
export interface MemoryConsolidationOptions {
|
|
14
28
|
source?: string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { SqliteDatabase } from "./local-store-records.js";
|
|
2
|
-
export declare const MEMORY_SCHEMA_SQL = "\nCREATE TABLE IF NOT EXISTS memories (\n id TEXT PRIMARY KEY,\n text TEXT NOT NULL,\n user_id TEXT NOT NULL,\n category TEXT NOT NULL DEFAULT 'general',\n importance REAL NOT NULL DEFAULT 0.5,\n confidence REAL NOT NULL DEFAULT 1.0,\n source TEXT NOT NULL DEFAULT 'agent',\n session_id TEXT NOT NULL DEFAULT '',\n event_date TEXT NOT NULL DEFAULT '',\n tags TEXT NOT NULL DEFAULT '[]',\n embedding BLOB,\n created_at INTEGER NOT NULL,\n updated_at INTEGER NOT NULL,\n access_count INTEGER NOT NULL DEFAULT 0,\n last_accessed_at INTEGER NOT NULL DEFAULT 0,\n is_archived INTEGER NOT NULL DEFAULT 0\n);\n\nCREATE INDEX IF NOT EXISTS idx_memories_user ON memories(user_id);\nCREATE INDEX IF NOT EXISTS idx_memories_user_category ON memories(user_id, category);\nCREATE INDEX IF NOT EXISTS idx_memories_user_importance ON memories(user_id, importance DESC);\nCREATE INDEX IF NOT EXISTS idx_memories_created ON memories(created_at DESC);\n\nCREATE TABLE IF NOT EXISTS memory_observations (\n id TEXT PRIMARY KEY,\n user_id TEXT NOT NULL,\n text TEXT NOT NULL,\n source TEXT NOT NULL,\n source_priority INTEGER NOT NULL DEFAULT 0,\n session_id TEXT NOT NULL DEFAULT '',\n evidence_type TEXT NOT NULL DEFAULT 'text',\n payload TEXT NOT NULL DEFAULT '{}',\n created_at INTEGER NOT NULL\n);\n\nCREATE INDEX IF NOT EXISTS idx_memory_observations_user_created ON memory_observations(user_id, created_at DESC);\nCREATE INDEX IF NOT EXISTS idx_memory_observations_source ON memory_observations(user_id, source);\n\nCREATE TABLE IF NOT EXISTS memory_proposals (\n id TEXT PRIMARY KEY,\n user_id TEXT NOT NULL,\n observation_ids TEXT NOT NULL DEFAULT '[]',\n text TEXT NOT NULL,\n category TEXT NOT NULL DEFAULT 'general',\n importance REAL NOT NULL DEFAULT 0.5,\n confidence REAL NOT NULL DEFAULT 0.5,\n source TEXT NOT NULL DEFAULT 'agent',\n source_priority INTEGER NOT NULL DEFAULT 0,\n entity TEXT NOT NULL DEFAULT '',\n predicate TEXT NOT NULL DEFAULT '',\n value_json TEXT NOT NULL DEFAULT '{}',\n valid_time TEXT NOT NULL DEFAULT '',\n tags TEXT NOT NULL DEFAULT '[]',\n status TEXT NOT NULL DEFAULT 'pending',\n related_claim_ids TEXT NOT NULL DEFAULT '[]',\n created_at INTEGER NOT NULL,\n updated_at INTEGER NOT NULL\n);\n\nCREATE INDEX IF NOT EXISTS idx_memory_proposals_user_status ON memory_proposals(user_id, status);\nCREATE INDEX IF NOT EXISTS idx_memory_proposals_fact ON memory_proposals(user_id, entity, predicate, valid_time);\n\nCREATE TABLE IF NOT EXISTS memory_claims (\n id TEXT PRIMARY KEY,\n memory_id TEXT NOT NULL DEFAULT '',\n user_id TEXT NOT NULL,\n entity TEXT NOT NULL DEFAULT '',\n predicate TEXT NOT NULL DEFAULT '',\n value_json TEXT NOT NULL DEFAULT '{}',\n text TEXT NOT NULL,\n category TEXT NOT NULL DEFAULT 'general',\n importance REAL NOT NULL DEFAULT 0.5,\n confidence REAL NOT NULL DEFAULT 0.5,\n source TEXT NOT NULL DEFAULT 'agent',\n source_priority INTEGER NOT NULL DEFAULT 0,\n status TEXT NOT NULL DEFAULT 'active',\n valid_time TEXT NOT NULL DEFAULT '',\n evidence_ids TEXT NOT NULL DEFAULT '[]',\n supersedes_claim_id TEXT NOT NULL DEFAULT '',\n conflict_group_id TEXT NOT NULL DEFAULT '',\n created_at INTEGER NOT NULL,\n updated_at INTEGER NOT NULL\n);\n\nCREATE INDEX IF NOT EXISTS idx_memory_claims_user_status ON memory_claims(user_id, status);\nCREATE INDEX IF NOT EXISTS idx_memory_claims_memory ON memory_claims(memory_id);\nCREATE INDEX IF NOT EXISTS idx_memory_claims_fact ON memory_claims(user_id, entity, predicate, valid_time);\n\nCREATE TABLE IF NOT EXISTS memory_conflicts (\n id TEXT PRIMARY KEY,\n user_id TEXT NOT NULL,\n claim_a_id TEXT NOT NULL,\n claim_b_id TEXT NOT NULL,\n reason TEXT NOT NULL,\n status TEXT NOT NULL DEFAULT 'open',\n created_at INTEGER NOT NULL,\n updated_at INTEGER NOT NULL\n);\n\nCREATE INDEX IF NOT EXISTS idx_memory_conflicts_user_status ON memory_conflicts(user_id, status);\n\nCREATE TABLE IF NOT EXISTS memory_attachments (\n id TEXT PRIMARY KEY,\n memory_id TEXT NOT NULL DEFAULT '',\n user_id TEXT NOT NULL,\n kind TEXT NOT NULL DEFAULT 'file',\n filename TEXT NOT NULL DEFAULT '',\n mime_type TEXT NOT NULL DEFAULT '',\n size INTEGER NOT NULL DEFAULT 0,\n rel_path TEXT NOT NULL,\n extracted_text TEXT NOT NULL DEFAULT '',\n created_at INTEGER NOT NULL\n);\n\nCREATE INDEX IF NOT EXISTS idx_memory_attachments_memory ON memory_attachments(memory_id);\nCREATE INDEX IF NOT EXISTS idx_memory_attachments_orphan ON memory_attachments(user_id, memory_id, created_at);\n\nCREATE VIRTUAL TABLE IF NOT EXISTS memories_fts USING fts5(\n id UNINDEXED,\n user_id UNINDEXED,\n text,\n category,\n tags,\n content=memories,\n content_rowid=rowid,\n tokenize='unicode61 remove_diacritics 2'\n);\n\nCREATE TRIGGER IF NOT EXISTS memories_ai AFTER INSERT ON memories BEGIN\n INSERT INTO memories_fts(rowid, id, user_id, text, category, tags)\n VALUES (new.rowid, new.id, new.user_id, new.text, new.category, new.tags);\nEND;\n\nCREATE TRIGGER IF NOT EXISTS memories_ad AFTER DELETE ON memories BEGIN\n INSERT INTO memories_fts(memories_fts, rowid, id, user_id, text, category, tags)\n VALUES ('delete', old.rowid, old.id, old.user_id, old.text, old.category, old.tags);\nEND;\n\nCREATE TRIGGER IF NOT EXISTS memories_au AFTER UPDATE ON memories BEGIN\n INSERT INTO memories_fts(memories_fts, rowid, id, user_id, text, category, tags)\n VALUES ('delete', old.rowid, old.id, old.user_id, old.text, old.category, old.tags);\n INSERT INTO memories_fts(rowid, id, user_id, text, category, tags)\n VALUES (new.rowid, new.id, new.user_id, new.text, new.category, new.tags);\nEND;\n";
|
|
2
|
+
export declare const MEMORY_SCHEMA_SQL = "\nCREATE TABLE IF NOT EXISTS memories (\n id TEXT PRIMARY KEY,\n text TEXT NOT NULL,\n user_id TEXT NOT NULL,\n category TEXT NOT NULL DEFAULT 'general',\n importance REAL NOT NULL DEFAULT 0.5,\n confidence REAL NOT NULL DEFAULT 1.0,\n source TEXT NOT NULL DEFAULT 'agent',\n session_id TEXT NOT NULL DEFAULT '',\n event_date TEXT NOT NULL DEFAULT '',\n tags TEXT NOT NULL DEFAULT '[]',\n embedding BLOB,\n created_at INTEGER NOT NULL,\n updated_at INTEGER NOT NULL,\n access_count INTEGER NOT NULL DEFAULT 0,\n last_accessed_at INTEGER NOT NULL DEFAULT 0,\n is_archived INTEGER NOT NULL DEFAULT 0\n);\n\nCREATE INDEX IF NOT EXISTS idx_memories_user ON memories(user_id);\nCREATE INDEX IF NOT EXISTS idx_memories_user_category ON memories(user_id, category);\nCREATE INDEX IF NOT EXISTS idx_memories_user_importance ON memories(user_id, importance DESC);\nCREATE INDEX IF NOT EXISTS idx_memories_created ON memories(created_at DESC);\n\nCREATE TABLE IF NOT EXISTS memory_observations (\n id TEXT PRIMARY KEY,\n user_id TEXT NOT NULL,\n text TEXT NOT NULL,\n source TEXT NOT NULL,\n source_priority INTEGER NOT NULL DEFAULT 0,\n session_id TEXT NOT NULL DEFAULT '',\n evidence_type TEXT NOT NULL DEFAULT 'text',\n payload TEXT NOT NULL DEFAULT '{}',\n created_at INTEGER NOT NULL\n);\n\nCREATE INDEX IF NOT EXISTS idx_memory_observations_user_created ON memory_observations(user_id, created_at DESC);\nCREATE INDEX IF NOT EXISTS idx_memory_observations_source ON memory_observations(user_id, source);\n\nCREATE TABLE IF NOT EXISTS memory_proposals (\n id TEXT PRIMARY KEY,\n user_id TEXT NOT NULL,\n observation_ids TEXT NOT NULL DEFAULT '[]',\n text TEXT NOT NULL,\n category TEXT NOT NULL DEFAULT 'general',\n importance REAL NOT NULL DEFAULT 0.5,\n confidence REAL NOT NULL DEFAULT 0.5,\n source TEXT NOT NULL DEFAULT 'agent',\n source_priority INTEGER NOT NULL DEFAULT 0,\n entity TEXT NOT NULL DEFAULT '',\n predicate TEXT NOT NULL DEFAULT '',\n value_json TEXT NOT NULL DEFAULT '{}',\n valid_time TEXT NOT NULL DEFAULT '',\n tags TEXT NOT NULL DEFAULT '[]',\n status TEXT NOT NULL DEFAULT 'pending',\n related_claim_ids TEXT NOT NULL DEFAULT '[]',\n idempotency_key TEXT,\n created_at INTEGER NOT NULL,\n updated_at INTEGER NOT NULL\n);\n\nCREATE INDEX IF NOT EXISTS idx_memory_proposals_user_status ON memory_proposals(user_id, status);\nCREATE INDEX IF NOT EXISTS idx_memory_proposals_fact ON memory_proposals(user_id, entity, predicate, valid_time);\n\nCREATE TABLE IF NOT EXISTS memory_claims (\n id TEXT PRIMARY KEY,\n memory_id TEXT NOT NULL DEFAULT '',\n user_id TEXT NOT NULL,\n entity TEXT NOT NULL DEFAULT '',\n predicate TEXT NOT NULL DEFAULT '',\n value_json TEXT NOT NULL DEFAULT '{}',\n text TEXT NOT NULL,\n category TEXT NOT NULL DEFAULT 'general',\n importance REAL NOT NULL DEFAULT 0.5,\n confidence REAL NOT NULL DEFAULT 0.5,\n source TEXT NOT NULL DEFAULT 'agent',\n source_priority INTEGER NOT NULL DEFAULT 0,\n status TEXT NOT NULL DEFAULT 'active',\n valid_time TEXT NOT NULL DEFAULT '',\n evidence_ids TEXT NOT NULL DEFAULT '[]',\n supersedes_claim_id TEXT NOT NULL DEFAULT '',\n conflict_group_id TEXT NOT NULL DEFAULT '',\n created_at INTEGER NOT NULL,\n updated_at INTEGER NOT NULL\n);\n\nCREATE INDEX IF NOT EXISTS idx_memory_claims_user_status ON memory_claims(user_id, status);\nCREATE INDEX IF NOT EXISTS idx_memory_claims_memory ON memory_claims(memory_id);\nCREATE INDEX IF NOT EXISTS idx_memory_claims_fact ON memory_claims(user_id, entity, predicate, valid_time);\n\nCREATE TABLE IF NOT EXISTS memory_conflicts (\n id TEXT PRIMARY KEY,\n user_id TEXT NOT NULL,\n claim_a_id TEXT NOT NULL,\n claim_b_id TEXT NOT NULL,\n reason TEXT NOT NULL,\n status TEXT NOT NULL DEFAULT 'open',\n created_at INTEGER NOT NULL,\n updated_at INTEGER NOT NULL\n);\n\nCREATE INDEX IF NOT EXISTS idx_memory_conflicts_user_status ON memory_conflicts(user_id, status);\n\nCREATE TABLE IF NOT EXISTS memory_attachments (\n id TEXT PRIMARY KEY,\n memory_id TEXT NOT NULL DEFAULT '',\n user_id TEXT NOT NULL,\n kind TEXT NOT NULL DEFAULT 'file',\n filename TEXT NOT NULL DEFAULT '',\n mime_type TEXT NOT NULL DEFAULT '',\n size INTEGER NOT NULL DEFAULT 0,\n rel_path TEXT NOT NULL,\n extracted_text TEXT NOT NULL DEFAULT '',\n created_at INTEGER NOT NULL\n);\n\nCREATE INDEX IF NOT EXISTS idx_memory_attachments_memory ON memory_attachments(memory_id);\nCREATE INDEX IF NOT EXISTS idx_memory_attachments_orphan ON memory_attachments(user_id, memory_id, created_at);\n\nCREATE VIRTUAL TABLE IF NOT EXISTS memories_fts USING fts5(\n id UNINDEXED,\n user_id UNINDEXED,\n text,\n category,\n tags,\n content=memories,\n content_rowid=rowid,\n tokenize='unicode61 remove_diacritics 2'\n);\n\nCREATE TRIGGER IF NOT EXISTS memories_ai AFTER INSERT ON memories BEGIN\n INSERT INTO memories_fts(rowid, id, user_id, text, category, tags)\n VALUES (new.rowid, new.id, new.user_id, new.text, new.category, new.tags);\nEND;\n\nCREATE TRIGGER IF NOT EXISTS memories_ad AFTER DELETE ON memories BEGIN\n INSERT INTO memories_fts(memories_fts, rowid, id, user_id, text, category, tags)\n VALUES ('delete', old.rowid, old.id, old.user_id, old.text, old.category, old.tags);\nEND;\n\nCREATE TRIGGER IF NOT EXISTS memories_au AFTER UPDATE ON memories BEGIN\n INSERT INTO memories_fts(memories_fts, rowid, id, user_id, text, category, tags)\n VALUES ('delete', old.rowid, old.id, old.user_id, old.text, old.category, old.tags);\n INSERT INTO memories_fts(rowid, id, user_id, text, category, tags)\n VALUES (new.rowid, new.id, new.user_id, new.text, new.category, new.tags);\nEND;\n";
|
|
3
3
|
export declare function initializeMemorySchema(db: SqliteDatabase): void;
|
|
@@ -27,7 +27,7 @@ export declare const SKILL_VIEW_TOOL_SCHEMA: {
|
|
|
27
27
|
readonly properties: {
|
|
28
28
|
readonly name: {
|
|
29
29
|
readonly type: "string";
|
|
30
|
-
readonly description: "The skill to use. Calling skill_view(name='X') loads that skill and you follow its instructions in THIS turn
|
|
30
|
+
readonly description: "The skill to use. For a matching workflow, call skill_view before read/search/exec/MCP. Calling skill_view(name='X') loads that skill and you follow its instructions in THIS turn - that single call is all you need to USE a skill.";
|
|
31
31
|
};
|
|
32
32
|
readonly args: {
|
|
33
33
|
readonly type: "string";
|