clawvault 3.2.1 → 3.3.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 +56 -16
- package/bin/clawvault.js +0 -2
- package/bin/command-registration.test.js +13 -1
- package/bin/help-contract.test.js +14 -0
- package/bin/register-core-commands.js +88 -0
- package/bin/register-core-commands.test.js +80 -0
- package/bin/register-maintenance-commands.js +57 -6
- package/bin/register-query-commands.js +10 -28
- package/bin/test-helpers/cli-command-fixtures.js +1 -0
- package/dist/chunk-2PKBIKDH.js +130 -0
- package/dist/{chunk-U67V476Y.js → chunk-2ZDO52B4.js} +18 -1
- package/dist/{chunk-ZZA73MFY.js → chunk-33DOSHTA.js} +176 -36
- package/dist/{chunk-AZYOKJYC.js → chunk-4PY655YM.js} +13 -1
- package/dist/{chunk-2JQ3O2YL.js → chunk-5EFSWZO6.js} +3 -3
- package/dist/{chunk-Y3TIJEBP.js → chunk-7SWP5FKU.js} +34 -613
- package/dist/{chunk-4VQTUVH7.js → chunk-7YZWHM36.js} +52 -26
- package/dist/{chunk-URXDAUVH.js → chunk-AXSJIFOJ.js} +174 -1
- package/dist/{chunk-4ITRXIVT.js → chunk-BLQXXX7Q.js} +6 -6
- package/dist/chunk-CSHO3PJB.js +684 -0
- package/dist/{chunk-S5OJEGFG.js → chunk-DOIUYIXV.js} +2 -2
- package/dist/{chunk-YXQCA6B7.js → chunk-DVOUSOR3.js} +112 -7
- package/dist/{chunk-YDWHS4LJ.js → chunk-ECGJYWNA.js} +205 -33
- package/dist/{chunk-QMHPQYUV.js → chunk-EL6UBSX5.js} +7 -6
- package/dist/chunk-FZ5I2NF7.js +352 -0
- package/dist/{chunk-WJVWINEM.js → chunk-GFCHWMGD.js} +55 -6
- package/dist/{chunk-GNJL4YGR.js → chunk-GJO3CFUN.js} +30 -6
- package/dist/chunk-H3JZIB5O.js +322 -0
- package/dist/chunk-HEHO7SMV.js +51 -0
- package/dist/{chunk-UCQAOZHW.js → chunk-HGDDW24U.js} +3 -3
- package/dist/chunk-J3YUXVID.js +907 -0
- package/dist/{chunk-Y6VJKXGL.js → chunk-KCYWJDDW.js} +1 -1
- package/dist/{chunk-P5EPF6MB.js → chunk-MW5C6ZQA.js} +110 -13
- package/dist/{chunk-YNIPYN4F.js → chunk-OFOCU2V4.js} +6 -5
- package/dist/{chunk-42MXU7A6.js → chunk-P62WHA27.js} +58 -47
- package/dist/chunk-PTWPPVC7.js +972 -0
- package/dist/{chunk-FAKNOB7Y.js → chunk-QFWERBDP.js} +2 -2
- package/dist/{chunk-IIOU45CK.js → chunk-S7N7HI5E.js} +2 -2
- package/dist/{chunk-ECRZL5XR.js → chunk-T7E764W3.js} +23 -7
- package/dist/chunk-TDWFBDAQ.js +1016 -0
- package/dist/{chunk-MNPUYCHQ.js → chunk-TWMI3SNN.js} +6 -5
- package/dist/{chunk-2RAZ4ZFE.js → chunk-VBILES4B.js} +1 -1
- package/dist/{chunk-PI4WMLMG.js → chunk-VXAGOLDP.js} +1 -1
- package/dist/chunk-YCUVAOFC.js +158 -0
- package/dist/{chunk-SS4B7P7V.js → chunk-YIDV4VV2.js} +1 -1
- package/dist/chunk-ZKWPCBYT.js +600 -0
- package/dist/cli/index.js +27 -21
- package/dist/commands/archive.js +3 -3
- package/dist/commands/backlog.js +1 -1
- package/dist/commands/benchmark.d.ts +12 -0
- package/dist/commands/benchmark.js +12 -0
- package/dist/commands/blocked.js +1 -1
- package/dist/commands/canvas.js +2 -2
- package/dist/commands/checkpoint.js +1 -1
- package/dist/commands/compat.js +1 -1
- package/dist/commands/context.js +8 -7
- package/dist/commands/doctor.d.ts +8 -3
- package/dist/commands/doctor.js +8 -22
- package/dist/commands/embed.js +6 -5
- package/dist/commands/entities.js +2 -2
- package/dist/commands/graph.js +4 -4
- package/dist/commands/inbox.d.ts +23 -0
- package/dist/commands/inbox.js +11 -0
- package/dist/commands/inject.d.ts +1 -1
- package/dist/commands/inject.js +5 -5
- package/dist/commands/kanban.js +1 -1
- package/dist/commands/link.js +9 -9
- package/dist/commands/maintain.d.ts +32 -0
- package/dist/commands/maintain.js +12 -0
- package/dist/commands/migrate-observations.js +3 -3
- package/dist/commands/observe.js +11 -10
- package/dist/commands/project.js +2 -2
- package/dist/commands/rebuild-embeddings.js +48 -17
- package/dist/commands/rebuild.js +9 -8
- package/dist/commands/recover.js +1 -1
- package/dist/commands/reflect.js +6 -6
- package/dist/commands/repair-session.js +1 -1
- package/dist/commands/replay.js +10 -9
- package/dist/commands/session-recap.js +1 -1
- package/dist/commands/setup.js +4 -3
- package/dist/commands/shell-init.js +1 -1
- package/dist/commands/sleep.d.ts +1 -1
- package/dist/commands/sleep.js +20 -18
- package/dist/commands/status.js +40 -26
- package/dist/commands/sync-bd.js +3 -3
- package/dist/commands/tailscale.js +3 -3
- package/dist/commands/task.js +1 -1
- package/dist/commands/template.js +1 -1
- package/dist/commands/wake.d.ts +1 -1
- package/dist/commands/wake.js +10 -9
- package/dist/index.d.ts +175 -16
- package/dist/index.js +277 -108
- package/dist/{inject-DYUrDqQO.d.ts → inject-DEb_jpLi.d.ts} +3 -1
- package/dist/lib/auto-linker.js +2 -2
- package/dist/lib/canvas-layout.js +1 -1
- package/dist/lib/config.js +2 -2
- package/dist/lib/entity-index.js +1 -1
- package/dist/lib/project-utils.js +2 -2
- package/dist/lib/session-repair.js +1 -1
- package/dist/lib/session-utils.js +1 -1
- package/dist/lib/tailscale.js +1 -1
- package/dist/lib/task-utils.js +1 -1
- package/dist/lib/template-engine.js +1 -1
- package/dist/lib/webdav.js +1 -1
- package/dist/onnxruntime_binding-5QEF3SUC.node +0 -0
- package/dist/onnxruntime_binding-BKPKNEGC.node +0 -0
- package/dist/onnxruntime_binding-FMOXGIUT.node +0 -0
- package/dist/onnxruntime_binding-OI2KMXC5.node +0 -0
- package/dist/onnxruntime_binding-UX44MLAZ.node +0 -0
- package/dist/onnxruntime_binding-Y2W7N7WY.node +0 -0
- package/dist/openclaw-plugin.d.ts +8 -0
- package/dist/openclaw-plugin.js +14 -0
- package/dist/transformers.node-A2ZRORSQ.js +46775 -0
- package/dist/{types-BbWJoC1c.d.ts → types-DslKvCaj.d.ts} +51 -1
- package/hooks/clawvault/HOOK.md +25 -8
- package/hooks/clawvault/handler.js +215 -78
- package/hooks/clawvault/handler.test.js +109 -43
- package/hooks/clawvault/integrity.js +112 -0
- package/hooks/clawvault/integrity.test.js +32 -0
- package/hooks/clawvault/openclaw.plugin.json +133 -15
- package/openclaw.plugin.json +131 -203
- package/package.json +10 -7
- package/bin/register-workgraph-commands.js +0 -451
- package/dist/chunk-5PJ4STIC.js +0 -465
- package/dist/chunk-ERNE2FZ5.js +0 -189
- package/dist/chunk-HR4KN6S2.js +0 -152
- package/dist/chunk-IJBFGPCS.js +0 -33
- package/dist/chunk-K7PNYS45.js +0 -93
- package/dist/chunk-NTOPJI7W.js +0 -207
- package/dist/chunk-PG56HX5T.js +0 -154
- package/dist/chunk-QPDDIHXE.js +0 -501
- package/dist/chunk-WIOLLGAD.js +0 -190
- package/dist/chunk-WMGIIABP.js +0 -15
- package/dist/ledger-B7g7jhqG.d.ts +0 -44
- package/dist/plugin/index.d.ts +0 -352
- package/dist/plugin/index.js +0 -4264
- package/dist/registry-BR4326o0.d.ts +0 -30
- package/dist/store-CA-6sKCJ.d.ts +0 -34
- package/dist/thread-B9LhXNU0.d.ts +0 -41
- package/dist/workgraph/index.d.ts +0 -5
- package/dist/workgraph/index.js +0 -23
- package/dist/workgraph/ledger.d.ts +0 -2
- package/dist/workgraph/ledger.js +0 -25
- package/dist/workgraph/registry.d.ts +0 -2
- package/dist/workgraph/registry.js +0 -19
- package/dist/workgraph/store.d.ts +0 -2
- package/dist/workgraph/store.js +0 -25
- package/dist/workgraph/thread.d.ts +0 -2
- package/dist/workgraph/thread.js +0 -25
- package/dist/workgraph/types.d.ts +0 -54
- package/dist/workgraph/types.js +0 -7
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { LedgerEntry, LedgerOp } from './workgraph/types.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Append-only event ledger.
|
|
5
|
-
*
|
|
6
|
-
* Every mutation to the workgraph is logged here. This is the source of truth
|
|
7
|
-
* for coordination: who claimed what, when, and what's available.
|
|
8
|
-
*
|
|
9
|
-
* Format: one JSON object per line (.jsonl) in `.clawvault/ledger.jsonl`.
|
|
10
|
-
* Agents read the ledger to know the state of the world.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
declare function ledgerPath(vaultPath: string): string;
|
|
14
|
-
declare function append(vaultPath: string, actor: string, op: LedgerOp, target: string, type?: string, data?: Record<string, unknown>): LedgerEntry;
|
|
15
|
-
declare function readAll(vaultPath: string): LedgerEntry[];
|
|
16
|
-
declare function readSince(vaultPath: string, since: string): LedgerEntry[];
|
|
17
|
-
/** Get the current owner of a target (last claim without a subsequent release/done). */
|
|
18
|
-
declare function currentOwner(vaultPath: string, target: string): string | null;
|
|
19
|
-
/** Check if a target is currently claimed by any agent. */
|
|
20
|
-
declare function isClaimed(vaultPath: string, target: string): boolean;
|
|
21
|
-
/** Get all entries for a specific target. */
|
|
22
|
-
declare function historyOf(vaultPath: string, target: string): LedgerEntry[];
|
|
23
|
-
/** Get all entries by a specific actor. */
|
|
24
|
-
declare function activityOf(vaultPath: string, actor: string): LedgerEntry[];
|
|
25
|
-
/** Get all currently claimed targets and their owners. */
|
|
26
|
-
declare function allClaims(vaultPath: string): Map<string, string>;
|
|
27
|
-
/** Get recent ledger entries (last N). */
|
|
28
|
-
declare function recent(vaultPath: string, count?: number): LedgerEntry[];
|
|
29
|
-
|
|
30
|
-
declare const ledger_activityOf: typeof activityOf;
|
|
31
|
-
declare const ledger_allClaims: typeof allClaims;
|
|
32
|
-
declare const ledger_append: typeof append;
|
|
33
|
-
declare const ledger_currentOwner: typeof currentOwner;
|
|
34
|
-
declare const ledger_historyOf: typeof historyOf;
|
|
35
|
-
declare const ledger_isClaimed: typeof isClaimed;
|
|
36
|
-
declare const ledger_ledgerPath: typeof ledgerPath;
|
|
37
|
-
declare const ledger_readAll: typeof readAll;
|
|
38
|
-
declare const ledger_readSince: typeof readSince;
|
|
39
|
-
declare const ledger_recent: typeof recent;
|
|
40
|
-
declare namespace ledger {
|
|
41
|
-
export { ledger_activityOf as activityOf, ledger_allClaims as allClaims, ledger_append as append, ledger_currentOwner as currentOwner, ledger_historyOf as historyOf, ledger_isClaimed as isClaimed, ledger_ledgerPath as ledgerPath, ledger_readAll as readAll, ledger_readSince as readSince, ledger_recent as recent };
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export { activityOf as a, allClaims as b, append as c, currentOwner as d, ledgerPath as e, readSince as f, recent as g, historyOf as h, isClaimed as i, ledger as l, readAll as r };
|
package/dist/plugin/index.d.ts
DELETED
|
@@ -1,352 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ClawVault Plugin v2 — Type definitions
|
|
3
|
-
*/
|
|
4
|
-
interface FieldDef {
|
|
5
|
-
type: 'string' | 'number' | 'boolean' | 'datetime' | 'date';
|
|
6
|
-
required?: boolean;
|
|
7
|
-
default?: string | number | boolean;
|
|
8
|
-
enum?: string[];
|
|
9
|
-
description?: string;
|
|
10
|
-
}
|
|
11
|
-
interface TemplateSchema {
|
|
12
|
-
primitive: string;
|
|
13
|
-
description?: string;
|
|
14
|
-
fields: Record<string, FieldDef>;
|
|
15
|
-
bodyTemplate?: string;
|
|
16
|
-
keywords?: string[];
|
|
17
|
-
}
|
|
18
|
-
interface TemplateRegistry {
|
|
19
|
-
schemas: Map<string, TemplateSchema>;
|
|
20
|
-
keywordIndex: Map<string, string[]>;
|
|
21
|
-
initialized: boolean;
|
|
22
|
-
}
|
|
23
|
-
interface ClassificationResult {
|
|
24
|
-
primitiveType: string;
|
|
25
|
-
confidence: number;
|
|
26
|
-
matchedKeywords: string[];
|
|
27
|
-
}
|
|
28
|
-
interface Observation {
|
|
29
|
-
text: string;
|
|
30
|
-
primitiveType: string;
|
|
31
|
-
confidence: number;
|
|
32
|
-
matchedKeywords: string[];
|
|
33
|
-
category: string;
|
|
34
|
-
tags: string[];
|
|
35
|
-
extractedAt: Date;
|
|
36
|
-
}
|
|
37
|
-
interface ObservationResult {
|
|
38
|
-
observations: Observation[];
|
|
39
|
-
skipped: number;
|
|
40
|
-
reason?: string;
|
|
41
|
-
}
|
|
42
|
-
interface VaultFile {
|
|
43
|
-
path: string;
|
|
44
|
-
relativePath: string;
|
|
45
|
-
primitiveType: string;
|
|
46
|
-
frontmatter: Record<string, unknown>;
|
|
47
|
-
content: string;
|
|
48
|
-
modifiedAt: Date;
|
|
49
|
-
createdAt: Date;
|
|
50
|
-
}
|
|
51
|
-
interface WriteResult {
|
|
52
|
-
success: boolean;
|
|
53
|
-
path: string;
|
|
54
|
-
primitiveType: string;
|
|
55
|
-
errors: string[];
|
|
56
|
-
created: boolean;
|
|
57
|
-
updated: boolean;
|
|
58
|
-
}
|
|
59
|
-
interface WriteOptions {
|
|
60
|
-
primitiveType?: string;
|
|
61
|
-
title?: string;
|
|
62
|
-
content?: string;
|
|
63
|
-
extraFields?: Record<string, unknown>;
|
|
64
|
-
source?: string;
|
|
65
|
-
sessionId?: string;
|
|
66
|
-
directory?: string;
|
|
67
|
-
filename?: string;
|
|
68
|
-
overwrite?: boolean;
|
|
69
|
-
}
|
|
70
|
-
interface LedgerEntry {
|
|
71
|
-
timestamp: Date;
|
|
72
|
-
category?: string;
|
|
73
|
-
actor?: string;
|
|
74
|
-
content: string;
|
|
75
|
-
primitiveType?: string;
|
|
76
|
-
tags?: string[];
|
|
77
|
-
}
|
|
78
|
-
interface BatchWriteOptions {
|
|
79
|
-
source?: string;
|
|
80
|
-
sessionId?: string;
|
|
81
|
-
actor?: string;
|
|
82
|
-
writeLedger?: boolean;
|
|
83
|
-
writeFiles?: boolean;
|
|
84
|
-
}
|
|
85
|
-
interface BatchWriteResult {
|
|
86
|
-
total: number;
|
|
87
|
-
successful: number;
|
|
88
|
-
failed: number;
|
|
89
|
-
results: WriteResult[];
|
|
90
|
-
}
|
|
91
|
-
interface ScanOptions {
|
|
92
|
-
maxAge?: number;
|
|
93
|
-
limit?: number;
|
|
94
|
-
primitiveTypes?: string[];
|
|
95
|
-
}
|
|
96
|
-
interface SessionRecapResult {
|
|
97
|
-
xml: string;
|
|
98
|
-
fileCount: number;
|
|
99
|
-
primitiveGroups: Record<string, number>;
|
|
100
|
-
timeRange: {
|
|
101
|
-
oldest: Date;
|
|
102
|
-
newest: Date;
|
|
103
|
-
} | null;
|
|
104
|
-
}
|
|
105
|
-
interface PreferenceContextResult {
|
|
106
|
-
xml: string;
|
|
107
|
-
preferenceCount: number;
|
|
108
|
-
categories: string[];
|
|
109
|
-
}
|
|
110
|
-
interface QmdResult {
|
|
111
|
-
file?: string;
|
|
112
|
-
title?: string;
|
|
113
|
-
snippet?: string;
|
|
114
|
-
score?: number;
|
|
115
|
-
}
|
|
116
|
-
type MemoryScope = 'global' | `agent:${string}` | `project:${string}` | `user:${string}`;
|
|
117
|
-
interface RetrievalConfig {
|
|
118
|
-
/** BM25 weight in RRF fusion (default: 0.5) */
|
|
119
|
-
bm25Weight: number;
|
|
120
|
-
/** Semantic weight in RRF fusion (default: 0.5) */
|
|
121
|
-
semanticWeight: number;
|
|
122
|
-
/** RRF k parameter (default: 60) */
|
|
123
|
-
rrfK: number;
|
|
124
|
-
/** Max results to return (default: 10) */
|
|
125
|
-
topK: number;
|
|
126
|
-
/** Minimum score threshold (default: 0.01) */
|
|
127
|
-
minScore: number;
|
|
128
|
-
/** Recency boost half-life in days (default: 14, 0 = disabled) */
|
|
129
|
-
recencyHalfLifeDays: number;
|
|
130
|
-
/** Recency boost weight (default: 0.10) */
|
|
131
|
-
recencyWeight: number;
|
|
132
|
-
/** Time decay half-life in days (default: 60, 0 = disabled) */
|
|
133
|
-
decayHalfLifeDays: number;
|
|
134
|
-
/** Length normalization anchor in chars (default: 500, 0 = disabled) */
|
|
135
|
-
lengthNormAnchor: number;
|
|
136
|
-
/** MMR lambda for diversity (default: 0.7, 1.0 = no diversity) */
|
|
137
|
-
mmrLambda: number;
|
|
138
|
-
/** Reranker provider (default: none) */
|
|
139
|
-
rerankProvider?: 'jina' | 'voyage' | 'siliconflow' | 'pinecone';
|
|
140
|
-
/** Reranker API key */
|
|
141
|
-
rerankApiKey?: string;
|
|
142
|
-
/** Reranker model name */
|
|
143
|
-
rerankModel?: string;
|
|
144
|
-
/** Reranker endpoint URL */
|
|
145
|
-
rerankEndpoint?: string;
|
|
146
|
-
/** Reranker weight vs fused score (default: 0.6) */
|
|
147
|
-
rerankWeight: number;
|
|
148
|
-
}
|
|
149
|
-
interface PluginConfig {
|
|
150
|
-
vaultPath?: string;
|
|
151
|
-
agentVaults?: Record<string, string>;
|
|
152
|
-
collection?: string;
|
|
153
|
-
autoRecall?: boolean;
|
|
154
|
-
autoCapture?: boolean;
|
|
155
|
-
recallLimit?: number;
|
|
156
|
-
templatesDir?: string;
|
|
157
|
-
autoCheckpoint?: boolean;
|
|
158
|
-
contextProfile?: 'default' | 'planning' | 'incident' | 'handoff' | 'auto';
|
|
159
|
-
maxContextResults?: number;
|
|
160
|
-
observeOnHeartbeat?: boolean;
|
|
161
|
-
weeklyReflection?: boolean;
|
|
162
|
-
/** Retrieval pipeline config */
|
|
163
|
-
retrieval?: Partial<RetrievalConfig>;
|
|
164
|
-
/** Noise filter config */
|
|
165
|
-
noise?: {
|
|
166
|
-
enabled?: boolean;
|
|
167
|
-
minLength?: number;
|
|
168
|
-
maxLength?: number;
|
|
169
|
-
};
|
|
170
|
-
/** Adaptive retrieval config */
|
|
171
|
-
adaptive?: {
|
|
172
|
-
enabled?: boolean;
|
|
173
|
-
skipPatterns?: string[];
|
|
174
|
-
};
|
|
175
|
-
/** Default memory scope */
|
|
176
|
-
defaultScope?: MemoryScope;
|
|
177
|
-
}
|
|
178
|
-
interface PluginLogger {
|
|
179
|
-
info(msg: string): void;
|
|
180
|
-
warn(msg: string): void;
|
|
181
|
-
error(msg: string): void;
|
|
182
|
-
debug(msg: string): void;
|
|
183
|
-
}
|
|
184
|
-
interface ToolDefinition {
|
|
185
|
-
name: string;
|
|
186
|
-
label: string;
|
|
187
|
-
description: string;
|
|
188
|
-
parameters: unknown;
|
|
189
|
-
execute(id: string, params: Record<string, unknown>): Promise<ToolResult>;
|
|
190
|
-
}
|
|
191
|
-
interface ToolResult {
|
|
192
|
-
content: Array<{
|
|
193
|
-
type: string;
|
|
194
|
-
text: string;
|
|
195
|
-
}>;
|
|
196
|
-
details?: Record<string, unknown>;
|
|
197
|
-
isError?: boolean;
|
|
198
|
-
}
|
|
199
|
-
interface ServiceDefinition {
|
|
200
|
-
id: string;
|
|
201
|
-
start: () => void;
|
|
202
|
-
stop: () => void;
|
|
203
|
-
}
|
|
204
|
-
interface CommandDefinition {
|
|
205
|
-
name: string;
|
|
206
|
-
description: string;
|
|
207
|
-
acceptsArgs?: boolean;
|
|
208
|
-
requireAuth?: boolean;
|
|
209
|
-
handler: (ctx: {
|
|
210
|
-
args?: string;
|
|
211
|
-
}) => {
|
|
212
|
-
text: string;
|
|
213
|
-
};
|
|
214
|
-
}
|
|
215
|
-
type EventHandler = (event: Record<string, unknown>) => Promise<unknown>;
|
|
216
|
-
interface PluginApi {
|
|
217
|
-
pluginConfig: PluginConfig;
|
|
218
|
-
logger: PluginLogger;
|
|
219
|
-
registerTool(tool: ToolDefinition): void;
|
|
220
|
-
registerService(service: ServiceDefinition): void;
|
|
221
|
-
registerCommand(command: CommandDefinition): void;
|
|
222
|
-
registerCli(fn: (ctx: {
|
|
223
|
-
program: unknown;
|
|
224
|
-
}) => void, opts?: {
|
|
225
|
-
commands: string[];
|
|
226
|
-
}): void;
|
|
227
|
-
on(event: string, handler: EventHandler, opts?: {
|
|
228
|
-
priority?: number;
|
|
229
|
-
}): void;
|
|
230
|
-
}
|
|
231
|
-
interface Plugin {
|
|
232
|
-
id: string;
|
|
233
|
-
name: string;
|
|
234
|
-
description: string;
|
|
235
|
-
version: string;
|
|
236
|
-
kind: string;
|
|
237
|
-
register(api: PluginApi): void;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
/**
|
|
241
|
-
* ClawVault Plugin v2 — Template engine
|
|
242
|
-
*
|
|
243
|
-
* Manages typed primitive schemas (memory_event, person, decision, task, etc.)
|
|
244
|
-
* with keyword-based classification, frontmatter generation, and validation.
|
|
245
|
-
*/
|
|
246
|
-
|
|
247
|
-
declare function getTemplateRegistry(): TemplateRegistry;
|
|
248
|
-
declare function initializeTemplateRegistry(templatesDir?: string): TemplateRegistry;
|
|
249
|
-
declare function classifyText(text: string): ClassificationResult;
|
|
250
|
-
declare function getSchema(primitiveType: string): TemplateSchema | undefined;
|
|
251
|
-
declare function getAllSchemas(): TemplateSchema[];
|
|
252
|
-
declare function getSchemaNames(): string[];
|
|
253
|
-
|
|
254
|
-
/**
|
|
255
|
-
* ClawVault Plugin v2 — Noise Filter
|
|
256
|
-
*
|
|
257
|
-
* Filters low-quality content on both write and read paths:
|
|
258
|
-
* - Refusals ("I can't help with that")
|
|
259
|
-
* - Meta-questions ("How does it feel to be an AI?")
|
|
260
|
-
* - Greetings ("Hello!", "Hi there")
|
|
261
|
-
* - Low-information content (too short, too repetitive)
|
|
262
|
-
* - System noise (heartbeats, tool calls, JSON blobs)
|
|
263
|
-
*/
|
|
264
|
-
interface NoiseFilterConfig {
|
|
265
|
-
enabled: boolean;
|
|
266
|
-
minLength: number;
|
|
267
|
-
maxLength: number;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
/**
|
|
271
|
-
* ClawVault Plugin v2 — Observer / Session Parser
|
|
272
|
-
*
|
|
273
|
-
* Extracts observations from conversation messages:
|
|
274
|
-
* - Detects preferences, decisions, facts, tasks, lessons
|
|
275
|
-
* - Classifies against template schemas
|
|
276
|
-
* - Generates tags and categories
|
|
277
|
-
*/
|
|
278
|
-
|
|
279
|
-
/**
|
|
280
|
-
* Check if text is worth observing (not system noise, not too short/long).
|
|
281
|
-
*/
|
|
282
|
-
declare function isObservable(text: string, noiseConfig?: NoiseFilterConfig): boolean;
|
|
283
|
-
declare function extractObservations(text: string): Observation[];
|
|
284
|
-
declare function processMessageForObservations(content: string, _options?: Record<string, unknown>): ObservationResult;
|
|
285
|
-
declare function detectCategory(text: string): string;
|
|
286
|
-
declare function extractSearchTerms(input: string): string;
|
|
287
|
-
|
|
288
|
-
/**
|
|
289
|
-
* ClawVault Plugin v2 — Context Injection
|
|
290
|
-
*
|
|
291
|
-
* Scans vault files and builds context for session injection:
|
|
292
|
-
* - Session recaps (recent activity)
|
|
293
|
-
* - Preference context
|
|
294
|
-
* - Memory formatting for LLM consumption
|
|
295
|
-
*/
|
|
296
|
-
|
|
297
|
-
declare function scanVaultFiles(vaultPath: string, options?: ScanOptions): VaultFile[];
|
|
298
|
-
declare function buildSessionRecap(vaultPath: string, options?: {
|
|
299
|
-
maxAge?: number;
|
|
300
|
-
limit?: number;
|
|
301
|
-
includeContent?: boolean;
|
|
302
|
-
}): SessionRecapResult;
|
|
303
|
-
declare function buildPreferenceContext(vaultPath: string, options?: {
|
|
304
|
-
maxAge?: number;
|
|
305
|
-
limit?: number;
|
|
306
|
-
}): PreferenceContextResult;
|
|
307
|
-
declare function formatMemoriesForContext(results: QmdResult[], collection: string): string;
|
|
308
|
-
declare function formatSearchResults(results: QmdResult[], collection: string): string;
|
|
309
|
-
declare function buildFullContext(vaultPath: string, options?: {
|
|
310
|
-
includeRecap?: boolean;
|
|
311
|
-
includePreferences?: boolean;
|
|
312
|
-
recapMaxAge?: number;
|
|
313
|
-
preferenceMaxAge?: number;
|
|
314
|
-
}): string;
|
|
315
|
-
|
|
316
|
-
/**
|
|
317
|
-
* ClawVault Plugin v2 — Vault file operations
|
|
318
|
-
*
|
|
319
|
-
* Handles writing, updating, and managing vault markdown files:
|
|
320
|
-
* - Template-based file creation
|
|
321
|
-
* - Frontmatter merge on update
|
|
322
|
-
* - Observation writing to individual files and ledger
|
|
323
|
-
* - Scope tagging for multi-scope support
|
|
324
|
-
*/
|
|
325
|
-
|
|
326
|
-
declare function writeVaultFile(vaultPath: string, options: WriteOptions): WriteResult;
|
|
327
|
-
declare function writeObservation(vaultPath: string, observation: Observation, options?: {
|
|
328
|
-
source?: string;
|
|
329
|
-
sessionId?: string;
|
|
330
|
-
scope?: MemoryScope;
|
|
331
|
-
}): WriteResult;
|
|
332
|
-
declare function appendToLedger(vaultPath: string, entry: LedgerEntry): void;
|
|
333
|
-
declare function batchWriteObservations(vaultPath: string, observations: Observation[], options?: BatchWriteOptions): BatchWriteResult;
|
|
334
|
-
declare function ensureVaultStructure(vaultPath: string): void;
|
|
335
|
-
|
|
336
|
-
/**
|
|
337
|
-
* ClawVault Plugin v2 — Main Entry Point
|
|
338
|
-
*
|
|
339
|
-
* OpenClaw memory plugin with:
|
|
340
|
-
* - Template-driven typed primitives
|
|
341
|
-
* - In-process hybrid retrieval (BM25 + Semantic + RRF)
|
|
342
|
-
* - Cross-encoder rerank (optional, API-based)
|
|
343
|
-
* - Recency boost + time decay
|
|
344
|
-
* - Length normalization + MMR diversity
|
|
345
|
-
* - Noise filtering + adaptive retrieval
|
|
346
|
-
* - Multi-scope support (global, agent, project, user)
|
|
347
|
-
* - Management CLI (stats, export, import, reembed)
|
|
348
|
-
*/
|
|
349
|
-
|
|
350
|
-
declare const clawvaultPlugin: Plugin;
|
|
351
|
-
|
|
352
|
-
export { appendToLedger, batchWriteObservations, buildFullContext, buildPreferenceContext, buildSessionRecap, classifyText, clawvaultPlugin as default, detectCategory, ensureVaultStructure, extractObservations, extractSearchTerms, formatMemoriesForContext, formatSearchResults, getAllSchemas, getSchema, getSchemaNames, getTemplateRegistry, initializeTemplateRegistry, isObservable, processMessageForObservations, scanVaultFiles, writeObservation, writeVaultFile };
|