@psiclawops/hypermem 0.9.0 → 0.9.2

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.
Files changed (43) hide show
  1. package/ARCHITECTURE.md +2 -2
  2. package/CHANGELOG.md +17 -1
  3. package/INSTALL.md +9 -0
  4. package/dist/background-indexer.js +9 -9
  5. package/dist/cross-agent.d.ts +1 -1
  6. package/dist/cross-agent.js +17 -17
  7. package/dist/dreaming-promoter.d.ts +2 -2
  8. package/dist/dreaming-promoter.js +3 -3
  9. package/dist/fact-store.js +1 -1
  10. package/dist/index.d.ts +11 -3
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +56 -9
  13. package/dist/seed.d.ts +1 -1
  14. package/dist/seed.js +1 -1
  15. package/dist/session-flusher.d.ts +2 -2
  16. package/dist/session-flusher.js +2 -2
  17. package/dist/spawn-context.d.ts +1 -1
  18. package/dist/spawn-context.js +1 -1
  19. package/dist/topic-store.js +5 -5
  20. package/dist/topic-synthesizer.js +1 -1
  21. package/dist/trigger-registry.d.ts +1 -1
  22. package/dist/trigger-registry.js +4 -4
  23. package/dist/types.d.ts +2 -2
  24. package/docs/MEMORY_MD_AUTHORING.md +3 -3
  25. package/docs/ROADMAP.md +13 -4
  26. package/install.sh +34 -0
  27. package/memory-plugin/package.json +4 -2
  28. package/package.json +4 -1
  29. package/plugin/package.json +4 -2
  30. package/dist/compositor-utils.d.ts +0 -31
  31. package/dist/compositor-utils.d.ts.map +0 -1
  32. package/dist/compositor-utils.js +0 -47
  33. package/dist/content-hash.d.ts +0 -43
  34. package/dist/content-hash.d.ts.map +0 -1
  35. package/dist/content-hash.js +0 -75
  36. package/memory-plugin/dist/index.d.ts +0 -24
  37. package/memory-plugin/dist/index.d.ts.map +0 -1
  38. package/memory-plugin/dist/index.js +0 -350
  39. package/memory-plugin/dist/index.js.map +0 -1
  40. package/plugin/dist/index.d.ts +0 -208
  41. package/plugin/dist/index.d.ts.map +0 -1
  42. package/plugin/dist/index.js +0 -3474
  43. package/plugin/dist/index.js.map +0 -1
@@ -1,350 +0,0 @@
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 { matchTriggers, TRIGGER_REGISTRY } from '@psiclawops/hypermem';
19
- import path from 'path';
20
- import fs from 'fs/promises';
21
- import os from 'os';
22
- import { fileURLToPath } from 'url';
23
- // ─── HyperMem singleton ────────────────────────────────────────
24
- // Reuses the same singleton pattern as the context engine plugin.
25
- // Both plugins load from the same installed runtime payload and share the instance.
26
- const __pluginDir = path.dirname(fileURLToPath(import.meta.url));
27
- async function resolveHyperMemPath() {
28
- try {
29
- const resolvedUrl = await import.meta.resolve('@psiclawops/hypermem');
30
- return resolvedUrl.startsWith('file:') ? fileURLToPath(resolvedUrl) : resolvedUrl;
31
- }
32
- catch {
33
- return path.resolve(__pluginDir, '../../dist/index.js');
34
- }
35
- }
36
- let _hm = null;
37
- let _hmInitPromise = null;
38
- async function getHyperMem() {
39
- if (_hm)
40
- return _hm;
41
- if (_hmInitPromise)
42
- return _hmInitPromise;
43
- _hmInitPromise = (async () => {
44
- const hypermemPath = await resolveHyperMemPath();
45
- const mod = await import(hypermemPath);
46
- const HyperMem = mod.HyperMem;
47
- const instance = await HyperMem.create({
48
- dataDir: path.join(os.homedir(), '.openclaw/hypermem'),
49
- cache: {
50
- keyPrefix: 'hm:',
51
- sessionTTL: 14400,
52
- historyTTL: 86400,
53
- },
54
- });
55
- _hm = instance;
56
- return instance;
57
- })();
58
- return _hmInitPromise;
59
- }
60
- const DOCTRINE_COLLECTIONS = new Set([
61
- 'governance/policy',
62
- 'governance/charter',
63
- 'governance/comms',
64
- 'operations/agents',
65
- ]);
66
- function doctrineScore(chunk, rank) {
67
- const collectionBoost = chunk.collection.startsWith('governance/') ? 1.25 : 1.1;
68
- return collectionBoost - Math.min(rank, 9) * 0.03;
69
- }
70
- function docChunkToMemoryResult(chunk, rank) {
71
- return {
72
- path: chunk.sourcePath,
73
- startLine: 0,
74
- endLine: 0,
75
- score: doctrineScore(chunk, rank),
76
- snippet: chunk.content.slice(0, 500),
77
- source: 'memory',
78
- citation: `[doc:${chunk.collection}:${chunk.sectionPath}]`,
79
- };
80
- }
81
- /**
82
- * Create a MemorySearchManager backed by HyperMem's retrieval pipeline.
83
- *
84
- * Uses HyperMem's:
85
- * - library.db fact search (FTS5 + BM25)
86
- * - vector store semantic search (when available)
87
- * - message search (full-text across conversations)
88
- */
89
- function createMemorySearchManager(hm, agentId, workspaceDir) {
90
- return {
91
- async search(query, opts) {
92
- const maxResults = opts?.maxResults ?? 10;
93
- const minScore = opts?.minScore ?? 0;
94
- const results = [];
95
- const seenDocChunks = new Set();
96
- // 0. Canonical doctrine search. Explicit governance queries should surface
97
- // policy, charter, comms, and AGENTS chunks before stale daily-memory folklore.
98
- try {
99
- const triggers = matchTriggers(query, TRIGGER_REGISTRY)
100
- .filter(trigger => DOCTRINE_COLLECTIONS.has(trigger.collection))
101
- .slice(0, 4);
102
- for (const trigger of triggers) {
103
- const chunks = hm.queryDocChunks({
104
- collection: trigger.collection,
105
- agentId,
106
- keyword: query,
107
- limit: Math.max(3, Math.ceil(maxResults / Math.max(1, triggers.length))),
108
- });
109
- chunks.forEach((chunk, rank) => {
110
- const key = `${chunk.sourcePath}:${chunk.sectionPath}:${chunk.sourceHash}`;
111
- if (seenDocChunks.has(key))
112
- return;
113
- seenDocChunks.add(key);
114
- const result = docChunkToMemoryResult(chunk, rank);
115
- if (result.score >= minScore)
116
- results.push(result);
117
- });
118
- }
119
- }
120
- catch {
121
- // Doctrine search is a precision boost, not a hard dependency.
122
- }
123
- // 1. Fact search (FTS5 + BM25 from library.db)
124
- try {
125
- const facts = hm.getActiveFacts(agentId, { limit: maxResults * 2 });
126
- // Simple keyword matching for facts (FTS5 handles this in the DB layer)
127
- const queryLower = query.toLowerCase();
128
- const queryTerms = queryLower.split(/\s+/).filter(t => t.length > 2);
129
- for (const fact of facts) {
130
- const contentLower = fact.content.toLowerCase();
131
- const matchCount = queryTerms.filter(t => contentLower.includes(t)).length;
132
- if (matchCount === 0)
133
- continue;
134
- const score = matchCount / queryTerms.length;
135
- if (score < minScore)
136
- continue;
137
- results.push({
138
- path: `library://facts/${fact.id}`,
139
- startLine: 0,
140
- endLine: 0,
141
- score,
142
- snippet: fact.content.slice(0, 300),
143
- source: 'memory',
144
- citation: fact.domain ? `[fact:${fact.domain}]` : '[fact]',
145
- });
146
- }
147
- }
148
- catch {
149
- // Fact search non-fatal
150
- }
151
- // 2. Vector/semantic search (when available)
152
- try {
153
- const vectorStore = hm.getVectorStore();
154
- if (vectorStore) {
155
- const vectorResults = await hm.semanticSearch(agentId, query, {
156
- limit: maxResults,
157
- maxDistance: 1.5,
158
- });
159
- for (const vr of vectorResults) {
160
- const score = 1.0 - (vr.distance / 2.0); // normalize distance to 0-1 score
161
- if (score < minScore)
162
- continue;
163
- results.push({
164
- path: `vector://${vr.sourceTable}/${vr.sourceId}`,
165
- startLine: 0,
166
- endLine: 0,
167
- score,
168
- snippet: vr.content.slice(0, 300),
169
- source: 'memory',
170
- citation: `[${vr.sourceTable}:${vr.sourceId}]`,
171
- });
172
- }
173
- }
174
- }
175
- catch {
176
- // Vector search non-fatal
177
- }
178
- // 3. Message search (FTS5 across conversations)
179
- try {
180
- const messageResults = hm.search(agentId, query, maxResults);
181
- for (const msg of messageResults) {
182
- const content = msg.textContent ?? '';
183
- results.push({
184
- path: `messages://${msg.conversationId ?? 'unknown'}/${msg.id}`,
185
- startLine: 0,
186
- endLine: 0,
187
- score: 0.5, // message search doesn't return scores, use mid-range
188
- snippet: content.slice(0, 300),
189
- source: 'sessions',
190
- citation: `[message:${msg.id}]`,
191
- });
192
- }
193
- }
194
- catch {
195
- // Message search non-fatal
196
- }
197
- // Deduplicate by content similarity, sort by score, limit
198
- results.sort((a, b) => b.score - a.score);
199
- return results.slice(0, maxResults);
200
- },
201
- async readFile(params) {
202
- const absPath = path.resolve(workspaceDir, params.relPath);
203
- try {
204
- const content = await fs.readFile(absPath, 'utf-8');
205
- const lines = content.split('\n');
206
- const from = params.from ?? 0;
207
- const count = params.lines ?? lines.length;
208
- const slice = lines.slice(from, from + count);
209
- return { text: slice.join('\n'), path: absPath };
210
- }
211
- catch (err) {
212
- return { text: `Error reading ${absPath}: ${err.message}`, path: absPath };
213
- }
214
- },
215
- status() {
216
- const vectorStore = hm.getVectorStore();
217
- const vectorStats = vectorStore ? hm.getVectorStats(agentId) : null;
218
- return {
219
- backend: 'builtin',
220
- provider: 'hypermem',
221
- model: 'hypermem-fts5+vector',
222
- workspaceDir,
223
- dbPath: path.join(os.homedir(), '.openclaw/hypermem'),
224
- sources: ['memory', 'sessions'],
225
- fts: {
226
- enabled: true,
227
- available: true,
228
- },
229
- vector: {
230
- enabled: !!vectorStore,
231
- available: !!vectorStore,
232
- dims: vectorStats?.dimensions
233
- ?? vectorStats?.dims
234
- ?? undefined,
235
- },
236
- custom: {
237
- vectorStats: vectorStats ?? undefined,
238
- factCount: hm.getActiveFacts(agentId, { limit: 1 }).length > 0 ? 'available' : 'empty',
239
- },
240
- };
241
- },
242
- async probeEmbeddingAvailability() {
243
- try {
244
- const vectorStore = hm.getVectorStore();
245
- if (!vectorStore)
246
- return { ok: false, error: 'Vector store not initialized' };
247
- return { ok: true };
248
- }
249
- catch (err) {
250
- return { ok: false, error: err.message };
251
- }
252
- },
253
- async probeVectorAvailability() {
254
- return !!hm.getVectorStore();
255
- },
256
- };
257
- }
258
- // ─── Manager cache ──────────────────────────────────────────────
259
- // One manager per agentId; closed on plugin dispose.
260
- const _managers = new Map();
261
- // ─── Plugin Entry ───────────────────────────────────────────────
262
- export default definePluginEntry({
263
- id: 'hypermem',
264
- name: 'HyperMem Memory',
265
- description: 'Bridges HyperMem retrieval (facts, vectors, messages) into the OpenClaw memory slot for memory_search and memory-wiki.',
266
- kind: 'memory',
267
- configSchema: emptyPluginConfigSchema(),
268
- register(api) {
269
- api.registerMemoryCapability({
270
- runtime: {
271
- async getMemorySearchManager(params) {
272
- try {
273
- const hm = await getHyperMem();
274
- const agentId = params.agentId || 'main';
275
- // Cache managers per agent
276
- if (!_managers.has(agentId)) {
277
- // Resolve workspace dir from agent config
278
- const agents = params.cfg?.agents?.list ?? [];
279
- const agentCfg = agents.find((a) => a.id === agentId);
280
- const workspaceDir = agentCfg?.workspace
281
- ?? path.join(os.homedir(), '.openclaw/workspace');
282
- _managers.set(agentId, createMemorySearchManager(hm, agentId, workspaceDir));
283
- }
284
- return { manager: _managers.get(agentId) };
285
- }
286
- catch (err) {
287
- return { manager: null, error: err.message };
288
- }
289
- },
290
- resolveMemoryBackendConfig(_params) {
291
- return { backend: 'builtin' };
292
- },
293
- async closeAllMemorySearchManagers() {
294
- _managers.clear();
295
- },
296
- },
297
- publicArtifacts: {
298
- async listArtifacts(params) {
299
- const artifacts = [];
300
- // List memory files for each agent
301
- const agents = params.cfg?.agents?.list ?? [];
302
- for (const agent of agents) {
303
- const agentId = agent.id;
304
- if (!agentId)
305
- continue;
306
- const workspace = agent.workspace;
307
- if (!workspace)
308
- continue;
309
- const memoryDir = path.join(workspace, 'memory');
310
- try {
311
- const files = await fs.readdir(memoryDir);
312
- for (const file of files) {
313
- if (!file.endsWith('.md'))
314
- continue;
315
- artifacts.push({
316
- kind: 'memory-daily',
317
- workspaceDir: workspace,
318
- relativePath: `memory/${file}`,
319
- absolutePath: path.join(memoryDir, file),
320
- agentIds: [agentId],
321
- contentType: 'markdown',
322
- });
323
- }
324
- }
325
- catch {
326
- // No memory dir for this agent — skip
327
- }
328
- // Also expose MEMORY.md index
329
- const memoryIndex = path.join(workspace, 'MEMORY.md');
330
- try {
331
- await fs.access(memoryIndex);
332
- artifacts.push({
333
- kind: 'memory-index',
334
- workspaceDir: workspace,
335
- relativePath: 'MEMORY.md',
336
- absolutePath: memoryIndex,
337
- agentIds: [agentId],
338
- contentType: 'markdown',
339
- });
340
- }
341
- catch {
342
- // No MEMORY.md — skip
343
- }
344
- }
345
- return artifacts;
346
- },
347
- },
348
- });
349
- },
350
- });
@@ -1 +0,0 @@
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,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAqBlC,kEAAkE;AAElE,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,iDAAiD,CAAC,CAAC;AAEjG,IAAI,GAAG,GAA4B,IAAI,CAAC;AACxC,IAAI,cAAc,GAAqC,IAAI,CAAC;AAE5D,KAAK,UAAU,WAAW;IACxB,IAAI,GAAG;QAAE,OAAO,GAAG,CAAC;IACpB,IAAI,cAAc;QAAE,OAAO,cAAc,CAAC;IAE1C,cAAc,GAAG,CAAC,KAAK,IAAI,EAAE;QAC3B,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,CAAC;QACxC,MAAM,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;QAC9B,MAAM,QAAQ,GAAqB,MAAM,QAAQ,CAAC,MAAM,CAA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,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"}
@@ -1,208 +0,0 @@
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
- prefixChanged?: boolean;
57
- prefixHash?: string;
58
- rerankerStatus?: string;
59
- rerankerCandidates?: number;
60
- rerankerProvider?: string | null;
61
- slotSpans?: Record<string, {
62
- allocated: number;
63
- filled: number;
64
- overflow: boolean;
65
- }>;
66
- compactionEligibleCount?: number;
67
- compactionEligibleRatio?: number;
68
- compactionProcessedCount?: number;
69
- composeTopicSource?: 'request-topic-id' | 'session-topic-map' | 'none';
70
- composeTopicState?: 'no-active-topic' | 'active-topic-ready' | 'active-topic-missing-stamped-history' | 'history-disabled';
71
- composeTopicMessageCount?: number;
72
- composeTopicStampedMessageCount?: number;
73
- composeTopicTelemetryStatus?: 'emitted' | 'intentionally-omitted';
74
- }): void;
75
- declare function degradationTelemetry(fields: DegradationTelemetryFields): void;
76
- declare function lifecyclePolicyTelemetry(fields: {
77
- path: 'compose.eviction' | 'compose.preRecall' | 'afterTurn.gradient';
78
- agentId: string;
79
- sessionKey: string;
80
- band: string;
81
- pressurePct?: number;
82
- topicShiftConfidence?: number;
83
- trimSoftTarget?: number;
84
- reasons?: string[];
85
- }): void;
86
- declare function nextTurnId(): string;
87
- 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"];
88
- type GuardTelemetryReason = typeof GUARD_TELEMETRY_REASONS[number];
89
- declare function beginTrimOwnerTurn(sessionKey: string, turnId: string): void;
90
- declare function endTrimOwnerTurn(sessionKey: string, turnId: string): void;
91
- /**
92
- * Claim the steady-state trim owner slot for the current turn.
93
- *
94
- * Behavior:
95
- * - compact.* paths are exception-only and pass through without claiming.
96
- * - Non-steady paths (warmstart, reshape, afterTurn.secondary) also pass
97
- * through without claiming. Demoted/no-op sites should normally emit
98
- * via guardTelemetry() instead so they stay visible without contending
99
- * for ownership (sub-tasks 2.2 and 2.3 wire this in).
100
- * - Steady-state paths (assemble.normal, assemble.subagent,
101
- * assemble.toolLoop) claim the single owner slot for the current turn.
102
- * The first such claim succeeds. A second steady-state claim against the
103
- * same turn is a duplicate-turn violation: it throws loudly under
104
- * NODE_ENV='development' and warns in other environments (returning
105
- * false so non-dev runtimes keep working).
106
- *
107
- * Callers should invoke this immediately before the real
108
- * trimHistoryToTokenBudget() call. Guard telemetry does NOT route through
109
- * this helper — it is explicitly excluded from the steady-state invariant.
110
- *
111
- * Returns true when the claim succeeds (or is exempt); false on a swallowed
112
- * duplicate claim in non-development. In development the duplicate throws
113
- * before returning.
114
- */
115
- declare function claimTrimOwner(sessionKey: string, turnId: string, path: TrimTelemetryPath): boolean;
116
- /**
117
- * Non-counting guard / noop telemetry.
118
- *
119
- * Emits a `trim-guard` record on the same JSONL channel as trimTelemetry()
120
- * but with a distinct event name so per-turn reporting (scripts/trim-report.mjs,
121
- * future ownership dashboards) can keep it out of `trimCount`. Used by
122
- * demoted/no-op call sites in 2.2 and 2.3 so their path labels stay visible
123
- * in telemetry without consuming a steady-state owner slot.
124
- *
125
- * Zero-cost when telemetry is off. Never throws.
126
- */
127
- declare function guardTelemetry(fields: {
128
- path: TrimTelemetryPath;
129
- agentId: string;
130
- sessionKey: string;
131
- reason: GuardTelemetryReason;
132
- }): void;
133
- export declare const __telemetryForTests: {
134
- trimTelemetry: typeof trimTelemetry;
135
- assembleTrace: typeof assembleTrace;
136
- degradationTelemetry: typeof degradationTelemetry;
137
- guardTelemetry: typeof guardTelemetry;
138
- lifecyclePolicyTelemetry: typeof lifecyclePolicyTelemetry;
139
- nextTurnId: typeof nextTurnId;
140
- beginTrimOwnerTurn: typeof beginTrimOwnerTurn;
141
- endTrimOwnerTurn: typeof endTrimOwnerTurn;
142
- claimTrimOwner: typeof claimTrimOwner;
143
- TRIM_SOFT_TARGET: number;
144
- TRIM_GROWTH_THRESHOLD: number;
145
- TRIM_HEADROOM_FRACTION: number;
146
- resolveTrimBudgets: typeof resolveTrimBudgets;
147
- reset(): void;
148
- };
149
- export declare const CONTEXT_WINDOW_OVERRIDE_KEY_REGEX: RegExp;
150
- export type ContextWindowOverride = {
151
- contextTokens?: number;
152
- contextWindow?: number;
153
- };
154
- export declare function sanitizeContextWindowOverrides(raw: unknown): {
155
- value: Record<string, ContextWindowOverride>;
156
- warnings: string[];
157
- };
158
- export declare function resolveEffectiveBudget(args: {
159
- tokenBudget?: number;
160
- model?: string;
161
- contextWindowSize: number;
162
- contextWindowReserve: number;
163
- contextWindowOverrides?: Record<string, ContextWindowOverride>;
164
- }): {
165
- budget: number;
166
- source: string;
167
- };
168
- export interface ModelIdentity {
169
- rawModel: string | null;
170
- modelKey: string | null;
171
- provider: string | null;
172
- modelId: string | null;
173
- }
174
- export declare function resolveModelIdentity(model?: string): ModelIdentity;
175
- export declare function diffModelState(previous: {
176
- model?: string;
177
- modelKey?: string | null;
178
- provider?: string | null;
179
- modelId?: string | null;
180
- tokenBudget?: number;
181
- } | null | undefined, current: {
182
- model?: string;
183
- tokenBudget?: number;
184
- }): {
185
- previousIdentity: ModelIdentity;
186
- currentIdentity: ModelIdentity;
187
- modelChanged: boolean;
188
- providerChanged: boolean;
189
- modelIdChanged: boolean;
190
- budgetChanged: boolean;
191
- budgetDownshift: boolean;
192
- budgetUplift: boolean;
193
- };
194
- /**
195
- * Bust the assembly cache for a specific agent+session.
196
- * Call this after writing to identity files (SOUL.md, IDENTITY.md, TOOLS.md,
197
- * USER.md) to ensure the next assemble() runs full compositor, not a replay.
198
- */
199
- export declare function bustAssemblyCache(agentId: string, sessionKey: string): Promise<void>;
200
- declare const _default: {
201
- id: string;
202
- name: string;
203
- description: string;
204
- configSchema: import("openclaw/plugin-sdk").OpenClawPluginConfigSchema;
205
- register: NonNullable<import("openclaw/plugin-sdk/plugin-entry").OpenClawPluginDefinition["register"]>;
206
- } & Pick<import("openclaw/plugin-sdk/plugin-entry").OpenClawPluginDefinition, "kind" | "reload" | "nodeHostCommands" | "securityAuditCollectors">;
207
- export default _default;
208
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
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,EASnB,MAAM,sBAAsB,CAAC;AAW9B,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,qBAAqB,GACrB,WAAW,CAAC;AAEhB,KAAK,wBAAwB,GAAG,SAAS,GAAG,UAAU,CAAC;AAEvD,UAAU,0BAA0B;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,wBAAwB,CAAC;IAC/B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,+BAA+B,CAAC,EAAE,MAAM,CAAC;IACzC,WAAW,CAAC,EAAE,UAAU,GAAG,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