@psiclawops/hypermem 0.8.2 → 0.8.3

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.
@@ -0,0 +1,300 @@
1
+ /**
2
+ * HyperMem Memory Plugin
3
+ *
4
+ * Thin adapter that bridges HyperMem's retrieval capabilities into
5
+ * OpenClaw's memory slot contract (`kind: "memory"`).
6
+ *
7
+ * The context engine plugin (hypercompositor) owns the full lifecycle:
8
+ * ingest, assemble, compact, afterTurn, bootstrap, dispose.
9
+ *
10
+ * This plugin owns the memory slot contract:
11
+ * - registerMemoryCapability() with runtime + publicArtifacts
12
+ * - memory_search tool backing via MemorySearchManager
13
+ * - Public artifacts for memory-wiki bridge
14
+ *
15
+ * Both plugins share the same HyperMem singleton (loaded from repo dist).
16
+ */
17
+ import { definePluginEntry, emptyPluginConfigSchema } from 'openclaw/plugin-sdk/plugin-entry';
18
+ import path from 'path';
19
+ import fs from 'fs/promises';
20
+ import os from 'os';
21
+ import { fileURLToPath } from 'url';
22
+ // ─── HyperMem singleton ────────────────────────────────────────
23
+ // Reuses the same singleton pattern as the context engine plugin.
24
+ // Both plugins load from the same installed runtime payload and share the instance.
25
+ const __pluginDir = path.dirname(fileURLToPath(import.meta.url));
26
+ async function resolveHyperMemPath() {
27
+ try {
28
+ const resolvedUrl = await import.meta.resolve('@psiclawops/hypermem');
29
+ return resolvedUrl.startsWith('file:') ? fileURLToPath(resolvedUrl) : resolvedUrl;
30
+ }
31
+ catch {
32
+ return path.resolve(__pluginDir, '../../dist/index.js');
33
+ }
34
+ }
35
+ let _hm = null;
36
+ let _hmInitPromise = null;
37
+ async function getHyperMem() {
38
+ if (_hm)
39
+ return _hm;
40
+ if (_hmInitPromise)
41
+ return _hmInitPromise;
42
+ _hmInitPromise = (async () => {
43
+ const hypermemPath = await resolveHyperMemPath();
44
+ const mod = await import(hypermemPath);
45
+ const HyperMem = mod.HyperMem;
46
+ const instance = await HyperMem.create({
47
+ dataDir: path.join(os.homedir(), '.openclaw/hypermem'),
48
+ cache: {
49
+ keyPrefix: 'hm:',
50
+ sessionTTL: 14400,
51
+ historyTTL: 86400,
52
+ },
53
+ });
54
+ _hm = instance;
55
+ return instance;
56
+ })();
57
+ return _hmInitPromise;
58
+ }
59
+ /**
60
+ * Create a MemorySearchManager backed by HyperMem's retrieval pipeline.
61
+ *
62
+ * Uses HyperMem's:
63
+ * - library.db fact search (FTS5 + BM25)
64
+ * - vector store semantic search (when available)
65
+ * - message search (full-text across conversations)
66
+ */
67
+ function createMemorySearchManager(hm, agentId, workspaceDir) {
68
+ return {
69
+ async search(query, opts) {
70
+ const maxResults = opts?.maxResults ?? 10;
71
+ const minScore = opts?.minScore ?? 0;
72
+ const results = [];
73
+ // 1. Fact search (FTS5 + BM25 from library.db)
74
+ try {
75
+ const facts = hm.getActiveFacts(agentId, { limit: maxResults * 2 });
76
+ // Simple keyword matching for facts (FTS5 handles this in the DB layer)
77
+ const queryLower = query.toLowerCase();
78
+ const queryTerms = queryLower.split(/\s+/).filter(t => t.length > 2);
79
+ for (const fact of facts) {
80
+ const contentLower = fact.content.toLowerCase();
81
+ const matchCount = queryTerms.filter(t => contentLower.includes(t)).length;
82
+ if (matchCount === 0)
83
+ continue;
84
+ const score = matchCount / queryTerms.length;
85
+ if (score < minScore)
86
+ continue;
87
+ results.push({
88
+ path: `library://facts/${fact.id}`,
89
+ startLine: 0,
90
+ endLine: 0,
91
+ score,
92
+ snippet: fact.content.slice(0, 300),
93
+ source: 'memory',
94
+ citation: fact.domain ? `[fact:${fact.domain}]` : '[fact]',
95
+ });
96
+ }
97
+ }
98
+ catch {
99
+ // Fact search non-fatal
100
+ }
101
+ // 2. Vector/semantic search (when available)
102
+ try {
103
+ const vectorStore = hm.getVectorStore();
104
+ if (vectorStore) {
105
+ const vectorResults = await hm.semanticSearch(agentId, query, {
106
+ limit: maxResults,
107
+ maxDistance: 1.5,
108
+ });
109
+ for (const vr of vectorResults) {
110
+ const score = 1.0 - (vr.distance / 2.0); // normalize distance to 0-1 score
111
+ if (score < minScore)
112
+ continue;
113
+ results.push({
114
+ path: `vector://${vr.sourceTable}/${vr.sourceId}`,
115
+ startLine: 0,
116
+ endLine: 0,
117
+ score,
118
+ snippet: vr.content.slice(0, 300),
119
+ source: 'memory',
120
+ citation: `[${vr.sourceTable}:${vr.sourceId}]`,
121
+ });
122
+ }
123
+ }
124
+ }
125
+ catch {
126
+ // Vector search non-fatal
127
+ }
128
+ // 3. Message search (FTS5 across conversations)
129
+ try {
130
+ const messageResults = hm.search(agentId, query, maxResults);
131
+ for (const msg of messageResults) {
132
+ const content = msg.textContent ?? '';
133
+ results.push({
134
+ path: `messages://${msg.conversationId ?? 'unknown'}/${msg.id}`,
135
+ startLine: 0,
136
+ endLine: 0,
137
+ score: 0.5, // message search doesn't return scores, use mid-range
138
+ snippet: content.slice(0, 300),
139
+ source: 'sessions',
140
+ citation: `[message:${msg.id}]`,
141
+ });
142
+ }
143
+ }
144
+ catch {
145
+ // Message search non-fatal
146
+ }
147
+ // Deduplicate by content similarity, sort by score, limit
148
+ results.sort((a, b) => b.score - a.score);
149
+ return results.slice(0, maxResults);
150
+ },
151
+ async readFile(params) {
152
+ const absPath = path.resolve(workspaceDir, params.relPath);
153
+ try {
154
+ const content = await fs.readFile(absPath, 'utf-8');
155
+ const lines = content.split('\n');
156
+ const from = params.from ?? 0;
157
+ const count = params.lines ?? lines.length;
158
+ const slice = lines.slice(from, from + count);
159
+ return { text: slice.join('\n'), path: absPath };
160
+ }
161
+ catch (err) {
162
+ return { text: `Error reading ${absPath}: ${err.message}`, path: absPath };
163
+ }
164
+ },
165
+ status() {
166
+ const vectorStore = hm.getVectorStore();
167
+ const vectorStats = vectorStore ? hm.getVectorStats(agentId) : null;
168
+ return {
169
+ backend: 'builtin',
170
+ provider: 'hypermem',
171
+ model: 'hypermem-fts5+vector',
172
+ workspaceDir,
173
+ dbPath: path.join(os.homedir(), '.openclaw/hypermem'),
174
+ sources: ['memory', 'sessions'],
175
+ fts: {
176
+ enabled: true,
177
+ available: true,
178
+ },
179
+ vector: {
180
+ enabled: !!vectorStore,
181
+ available: !!vectorStore,
182
+ dims: vectorStats?.dimensions
183
+ ?? vectorStats?.dims
184
+ ?? undefined,
185
+ },
186
+ custom: {
187
+ vectorStats: vectorStats ?? undefined,
188
+ factCount: hm.getActiveFacts(agentId, { limit: 1 }).length > 0 ? 'available' : 'empty',
189
+ },
190
+ };
191
+ },
192
+ async probeEmbeddingAvailability() {
193
+ try {
194
+ const vectorStore = hm.getVectorStore();
195
+ if (!vectorStore)
196
+ return { ok: false, error: 'Vector store not initialized' };
197
+ return { ok: true };
198
+ }
199
+ catch (err) {
200
+ return { ok: false, error: err.message };
201
+ }
202
+ },
203
+ async probeVectorAvailability() {
204
+ return !!hm.getVectorStore();
205
+ },
206
+ };
207
+ }
208
+ // ─── Manager cache ──────────────────────────────────────────────
209
+ // One manager per agentId; closed on plugin dispose.
210
+ const _managers = new Map();
211
+ // ─── Plugin Entry ───────────────────────────────────────────────
212
+ export default definePluginEntry({
213
+ id: 'hypermem',
214
+ name: 'HyperMem Memory',
215
+ description: 'Bridges HyperMem retrieval (facts, vectors, messages) into the OpenClaw memory slot for memory_search and memory-wiki.',
216
+ kind: 'memory',
217
+ configSchema: emptyPluginConfigSchema(),
218
+ register(api) {
219
+ api.registerMemoryCapability({
220
+ runtime: {
221
+ async getMemorySearchManager(params) {
222
+ try {
223
+ const hm = await getHyperMem();
224
+ const agentId = params.agentId || 'main';
225
+ // Cache managers per agent
226
+ if (!_managers.has(agentId)) {
227
+ // Resolve workspace dir from agent config
228
+ const agents = params.cfg?.agents?.list ?? [];
229
+ const agentCfg = agents.find((a) => a.id === agentId);
230
+ const workspaceDir = agentCfg?.workspace
231
+ ?? path.join(os.homedir(), '.openclaw/workspace');
232
+ _managers.set(agentId, createMemorySearchManager(hm, agentId, workspaceDir));
233
+ }
234
+ return { manager: _managers.get(agentId) };
235
+ }
236
+ catch (err) {
237
+ return { manager: null, error: err.message };
238
+ }
239
+ },
240
+ resolveMemoryBackendConfig(_params) {
241
+ return { backend: 'builtin' };
242
+ },
243
+ async closeAllMemorySearchManagers() {
244
+ _managers.clear();
245
+ },
246
+ },
247
+ publicArtifacts: {
248
+ async listArtifacts(params) {
249
+ const artifacts = [];
250
+ // List memory files for each agent
251
+ const agents = params.cfg?.agents?.list ?? [];
252
+ for (const agent of agents) {
253
+ const agentId = agent.id;
254
+ if (!agentId)
255
+ continue;
256
+ const workspace = agent.workspace;
257
+ if (!workspace)
258
+ continue;
259
+ const memoryDir = path.join(workspace, 'memory');
260
+ try {
261
+ const files = await fs.readdir(memoryDir);
262
+ for (const file of files) {
263
+ if (!file.endsWith('.md'))
264
+ continue;
265
+ artifacts.push({
266
+ kind: 'memory-daily',
267
+ workspaceDir: workspace,
268
+ relativePath: `memory/${file}`,
269
+ absolutePath: path.join(memoryDir, file),
270
+ agentIds: [agentId],
271
+ contentType: 'markdown',
272
+ });
273
+ }
274
+ }
275
+ catch {
276
+ // No memory dir for this agent — skip
277
+ }
278
+ // Also expose MEMORY.md index
279
+ const memoryIndex = path.join(workspace, 'MEMORY.md');
280
+ try {
281
+ await fs.access(memoryIndex);
282
+ artifacts.push({
283
+ kind: 'memory-index',
284
+ workspaceDir: workspace,
285
+ relativePath: 'MEMORY.md',
286
+ absolutePath: memoryIndex,
287
+ agentIds: [agentId],
288
+ contentType: 'markdown',
289
+ });
290
+ }
291
+ catch {
292
+ // No MEMORY.md — skip
293
+ }
294
+ }
295
+ return artifacts;
296
+ },
297
+ },
298
+ });
299
+ },
300
+ });
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAaxF,OAAO,EAAE,MAA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KAAK,EAAE,OAAO,CAAC,MAAM;oBACrB,KAAK;oBACL,MAAM,EAAE,iBAAiB;iBAC1B,CAAC,CAAC;YACL,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,OAAO,UAAU,CAAC;oBAChB,OAAO,EAAE,EAAE;oBACX,QAAQ,EAAE,IAAI;oBACd,WAAW,EAAE,IAAI;oBACjB,KAAK,EAAG,GAAa,CAAC,OAAO;oBAC7B,OAAO,EAAE,6DAA6D;iBACvE,CAAC,CAAC;YACL,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC;AAED,kEAAkE;AAElE,eAAe,iBAAiB,CAAC;IAC/B,EAAE,EAAE,iBAAiB;IACrB,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,uEAAuE;IACpF,IAAI,EAAE,QAAQ;IACd,QAAQ,CAAC,GAAG;QACV,GAAG,CAAC,wBAAwB,CAAC;YAC3B,OAAO,EAAE,aAAa;YACtB,eAAe;SAChB,CAAC,CAAC;QAEH,GAAG,CAAC,YAAY,CACd,CAAC,GAAG,EAAE,EAAE,CAAC,sBAAsB,CAAC;YAC9B,MAAM,EAAE,GAAG,CAAC,MAAM;YAClB,eAAe,EAAE,GAAG,CAAC,UAAU;SAChC,CAAC,EACF,EAAE,KAAK,EAAE,CAAC,eAAe,CAAC,EAAE,CAC7B,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ {
2
+ "id": "hypermem",
3
+ "enabledByDefault": false,
4
+ "kind": "memory",
5
+ "activation": {
6
+ "onCapabilities": ["memory"]
7
+ },
8
+ "configSchema": {
9
+ "type": "object",
10
+ "additionalProperties": false,
11
+ "properties": {}
12
+ }
13
+ }
@@ -0,0 +1,64 @@
1
+ {
2
+ "name": "@psiclawops/hypermem-memory",
3
+ "version": "0.8.3",
4
+ "description": "HyperMem memory plugin for OpenClaw \u2014 bridges HyperMem retrieval into the memory slot",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "license": "Apache-2.0",
8
+ "author": "PsiClawOps",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/PsiClawOps/hypermem.git",
12
+ "directory": "memory-plugin"
13
+ },
14
+ "publishConfig": {
15
+ "access": "public",
16
+ "registry": "https://registry.npmjs.org"
17
+ },
18
+ "openclaw": {
19
+ "plugin": {
20
+ "id": "hypermem",
21
+ "name": "HyperMem Memory",
22
+ "kind": "memory"
23
+ },
24
+ "extensions": [
25
+ "./dist/index.js"
26
+ ],
27
+ "compat": {
28
+ "pluginApi": ">=2026.4.12",
29
+ "minGatewayVersion": "2026.4.12"
30
+ },
31
+ "build": {
32
+ "openclawVersion": "2026.4.9",
33
+ "pluginSdkVersion": "2026.4.12"
34
+ }
35
+ },
36
+ "scripts": {
37
+ "build": "tsc",
38
+ "typecheck": "tsc --noEmit"
39
+ },
40
+ "dependencies": {
41
+ "@psiclawops/hypermem": "file:.."
42
+ },
43
+ "devDependencies": {
44
+ "openclaw": "*",
45
+ "typescript": "^5.4.0"
46
+ },
47
+ "peerDependencies": {
48
+ "openclaw": "*"
49
+ },
50
+ "keywords": [
51
+ "openclaw",
52
+ "openclaw-plugin",
53
+ "memory",
54
+ "hypermem"
55
+ ],
56
+ "files": [
57
+ "dist/**/*.js",
58
+ "dist/**/*.d.ts",
59
+ "dist/**/*.d.ts.map",
60
+ "openclaw.plugin.json",
61
+ "README.md",
62
+ "LICENSE"
63
+ ]
64
+ }
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@psiclawops/hypermem",
3
- "version": "0.8.2",
3
+ "version": "0.8.3",
4
4
  "description": "Agent-centric memory and context composition engine for OpenClaw",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "bin": {
9
- "hypermem-status": "bin/hypermem-status.mjs"
9
+ "hypermem-status": "bin/hypermem-status.mjs",
10
+ "hypermem-install": "scripts/install-runtime.mjs"
10
11
  },
11
12
  "exports": {
12
13
  ".": {
@@ -47,6 +48,16 @@
47
48
  "dist/**/*.js",
48
49
  "dist/**/*.d.ts",
49
50
  "dist/**/*.d.ts.map",
51
+ "bin/hypermem-status.mjs",
52
+ "plugin/dist/**",
53
+ "plugin/package.json",
54
+ "plugin/openclaw.plugin.json",
55
+ "memory-plugin/dist/**",
56
+ "memory-plugin/package.json",
57
+ "memory-plugin/openclaw.plugin.json",
58
+ "scripts/install-runtime.mjs",
59
+ "docs/*.md",
60
+ "install.sh",
50
61
  "README.md",
51
62
  "INSTALL.md",
52
63
  "CHANGELOG.md",
@@ -0,0 +1,153 @@
1
+ /**
2
+ * hypermem Context Engine Plugin
3
+ *
4
+ * Implements OpenClaw's ContextEngine interface backed by hypermem's
5
+ * four-layer memory architecture:
6
+ *
7
+ * L1 Cache — SQLite `:memory:` hot session working memory
8
+ * L2 Messages — per-agent conversation history (SQLite)
9
+ * L3 Vectors — semantic + keyword search (KNN + FTS5)
10
+ * L4 Library — facts, knowledge, episodes, preferences
11
+ *
12
+ * Lifecycle mapping:
13
+ * ingest() → record each message into messages.db
14
+ * assemble() → compositor builds context from all four layers
15
+ * compact() → delegate to runtime (ownsCompaction: false)
16
+ * afterTurn() → trigger background indexer (fire-and-forget)
17
+ * bootstrap() → warm hot-cache session, register agent in fleet
18
+ * dispose() → close hypermem connections
19
+ *
20
+ * Session key format expected: "agent:<agentId>:<channel>:<name>"
21
+ */
22
+ import type { NeutralMessage, NeutralToolCall, NeutralToolResult, ComposeRequest, ComposeResult } from '@psiclawops/hypermem';
23
+ import { resolveTrimBudgets } from '@psiclawops/hypermem';
24
+ export type { NeutralMessage, NeutralToolCall, NeutralToolResult, ComposeRequest, ComposeResult };
25
+ type TrimTelemetryPath = 'assemble.normal' | 'assemble.toolLoop' | 'assemble.subagent' | 'reshape' | 'compact.nuclear' | 'compact.history' | 'compact.history2' | 'afterTurn.secondary' | 'warmstart';
26
+ type DegradationTelemetryPath = 'compose' | 'toolLoop';
27
+ interface DegradationTelemetryFields {
28
+ agentId: string;
29
+ sessionKey: string;
30
+ turnId: string;
31
+ path: DegradationTelemetryPath;
32
+ toolChainCoEjections?: number;
33
+ toolChainStubReplacements?: number;
34
+ artifactDegradations?: number;
35
+ artifactOversizeThresholdTokens?: number;
36
+ replayState?: 'entering' | 'stabilizing' | 'exited';
37
+ replayReason?: string;
38
+ }
39
+ declare function trimTelemetry(fields: {
40
+ path: TrimTelemetryPath;
41
+ agentId: string;
42
+ sessionKey: string;
43
+ preTokens: number;
44
+ postTokens: number;
45
+ removed: number;
46
+ cacheInvalidated: boolean;
47
+ reason: string;
48
+ }): void;
49
+ declare function assembleTrace(fields: {
50
+ agentId: string;
51
+ sessionKey: string;
52
+ turnId: string;
53
+ path: 'cold' | 'replay' | 'subagent';
54
+ toolLoop: boolean;
55
+ msgCount: number;
56
+ }): void;
57
+ declare function degradationTelemetry(fields: DegradationTelemetryFields): void;
58
+ declare function nextTurnId(): string;
59
+ declare const GUARD_TELEMETRY_REASONS: readonly ["warmstart-pressure-demoted", "reshape-downshift-demoted", "duplicate-claim-suppressed", "afterturn-secondary-demoted", "window-within-budget-skip", "pressure-accounting-anomaly"];
60
+ type GuardTelemetryReason = typeof GUARD_TELEMETRY_REASONS[number];
61
+ declare function beginTrimOwnerTurn(sessionKey: string, turnId: string): void;
62
+ declare function endTrimOwnerTurn(sessionKey: string, turnId: string): void;
63
+ /**
64
+ * Claim the steady-state trim owner slot for the current turn.
65
+ *
66
+ * Behavior:
67
+ * - compact.* paths are exception-only and pass through without claiming.
68
+ * - Non-steady paths (warmstart, reshape, afterTurn.secondary) also pass
69
+ * through without claiming. Demoted/no-op sites should normally emit
70
+ * via guardTelemetry() instead so they stay visible without contending
71
+ * for ownership (sub-tasks 2.2 and 2.3 wire this in).
72
+ * - Steady-state paths (assemble.normal, assemble.subagent,
73
+ * assemble.toolLoop) claim the single owner slot for the current turn.
74
+ * The first such claim succeeds. A second steady-state claim against the
75
+ * same turn is a duplicate-turn violation: it throws loudly under
76
+ * NODE_ENV='development' and warns in other environments (returning
77
+ * false so non-dev runtimes keep working).
78
+ *
79
+ * Callers should invoke this immediately before the real
80
+ * trimHistoryToTokenBudget() call. Guard telemetry does NOT route through
81
+ * this helper — it is explicitly excluded from the steady-state invariant.
82
+ *
83
+ * Returns true when the claim succeeds (or is exempt); false on a swallowed
84
+ * duplicate claim in non-development. In development the duplicate throws
85
+ * before returning.
86
+ */
87
+ declare function claimTrimOwner(sessionKey: string, turnId: string, path: TrimTelemetryPath): boolean;
88
+ /**
89
+ * Non-counting guard / noop telemetry.
90
+ *
91
+ * Emits a `trim-guard` record on the same JSONL channel as trimTelemetry()
92
+ * but with a distinct event name so per-turn reporting (scripts/trim-report.mjs,
93
+ * future ownership dashboards) can keep it out of `trimCount`. Used by
94
+ * demoted/no-op call sites in 2.2 and 2.3 so their path labels stay visible
95
+ * in telemetry without consuming a steady-state owner slot.
96
+ *
97
+ * Zero-cost when telemetry is off. Never throws.
98
+ */
99
+ declare function guardTelemetry(fields: {
100
+ path: TrimTelemetryPath;
101
+ agentId: string;
102
+ sessionKey: string;
103
+ reason: GuardTelemetryReason;
104
+ }): void;
105
+ export declare const __telemetryForTests: {
106
+ trimTelemetry: typeof trimTelemetry;
107
+ assembleTrace: typeof assembleTrace;
108
+ degradationTelemetry: typeof degradationTelemetry;
109
+ guardTelemetry: typeof guardTelemetry;
110
+ nextTurnId: typeof nextTurnId;
111
+ beginTrimOwnerTurn: typeof beginTrimOwnerTurn;
112
+ endTrimOwnerTurn: typeof endTrimOwnerTurn;
113
+ claimTrimOwner: typeof claimTrimOwner;
114
+ TRIM_SOFT_TARGET: number;
115
+ TRIM_GROWTH_THRESHOLD: number;
116
+ TRIM_HEADROOM_FRACTION: number;
117
+ resolveTrimBudgets: typeof resolveTrimBudgets;
118
+ reset(): void;
119
+ };
120
+ export declare const CONTEXT_WINDOW_OVERRIDE_KEY_REGEX: RegExp;
121
+ export type ContextWindowOverride = {
122
+ contextTokens?: number;
123
+ contextWindow?: number;
124
+ };
125
+ export declare function sanitizeContextWindowOverrides(raw: unknown): {
126
+ value: Record<string, ContextWindowOverride>;
127
+ warnings: string[];
128
+ };
129
+ export declare function resolveEffectiveBudget(args: {
130
+ tokenBudget?: number;
131
+ model?: string;
132
+ contextWindowSize: number;
133
+ contextWindowReserve: number;
134
+ contextWindowOverrides?: Record<string, ContextWindowOverride>;
135
+ }): {
136
+ budget: number;
137
+ source: string;
138
+ };
139
+ /**
140
+ * Bust the assembly cache for a specific agent+session.
141
+ * Call this after writing to identity files (SOUL.md, IDENTITY.md, TOOLS.md,
142
+ * USER.md) to ensure the next assemble() runs full compositor, not a replay.
143
+ */
144
+ export declare function bustAssemblyCache(agentId: string, sessionKey: string): Promise<void>;
145
+ declare const _default: {
146
+ id: string;
147
+ name: string;
148
+ description: string;
149
+ configSchema: import("openclaw/plugin-sdk").OpenClawPluginConfigSchema;
150
+ register: NonNullable<import("openclaw/plugin-sdk/plugin-entry").OpenClawPluginDefinition["register"]>;
151
+ } & Pick<import("openclaw/plugin-sdk/plugin-entry").OpenClawPluginDefinition, "kind" | "reload" | "nodeHostCommands" | "securityAuditCollectors">;
152
+ export default _default;
153
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAaH,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,aAAa,EAId,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAUL,kBAAkB,EAInB,MAAM,sBAAsB,CAAC;AAU9B,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,iBAAiB,EAAE,cAAc,EAAE,aAAa,EAAE,CAAC;AAYlG,KAAK,iBAAiB,GAClB,iBAAiB,GACjB,mBAAmB,GACnB,mBAAmB,GACnB,SAAS,GACT,iBAAiB,GACjB,iBAAiB,GACjB,kBAAkB,GAClB,qB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