@oobe-protocol-labs/sap-mcp-server 0.9.22 → 0.9.36
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/.env.example +23 -9
- package/CHANGELOG.md +124 -6
- package/README.md +8 -7
- package/USER_DOCS/00_START_HERE.md +9 -1
- package/USER_DOCS/01_HOSTED_REMOTE_MCP.md +1 -1
- package/USER_DOCS/03_PAYMENTS_X402_PAYSH.md +1 -1
- package/USER_DOCS/04_CLIENT_CONFIGS.md +3 -3
- package/USER_DOCS/06_DESKTOP_GUI_WIZARD.md +5 -5
- package/config.example.json +5 -4
- package/dist/config/env.d.ts +22 -0
- package/dist/config/env.d.ts.map +1 -1
- package/dist/config/env.js +26 -8
- package/dist/config/env.js.map +1 -1
- package/dist/config/mcp-client-injection.d.ts.map +1 -1
- package/dist/config/mcp-client-injection.js +34 -5
- package/dist/config/mcp-client-injection.js.map +1 -1
- package/dist/config/paths.d.ts +9 -1
- package/dist/config/paths.d.ts.map +1 -1
- package/dist/config/paths.js +15 -1
- package/dist/config/paths.js.map +1 -1
- package/dist/config/profiles.d.ts +5 -0
- package/dist/config/profiles.d.ts.map +1 -1
- package/dist/config/profiles.js +37 -9
- package/dist/config/profiles.js.map +1 -1
- package/dist/config/wizard.d.ts.map +1 -1
- package/dist/config/wizard.js +44 -1
- package/dist/config/wizard.js.map +1 -1
- package/dist/config-cli.d.ts.map +1 -1
- package/dist/config-cli.js +17 -1
- package/dist/config-cli.js.map +1 -1
- package/dist/core/constants.d.ts +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/logger.js +1 -1
- package/dist/memory/async-processor.d.ts +107 -0
- package/dist/memory/async-processor.d.ts.map +1 -0
- package/dist/memory/async-processor.js +204 -0
- package/dist/memory/async-processor.js.map +1 -0
- package/dist/memory/auto-record.d.ts +47 -0
- package/dist/memory/auto-record.d.ts.map +1 -0
- package/dist/memory/auto-record.js +133 -0
- package/dist/memory/auto-record.js.map +1 -0
- package/dist/memory/database.d.ts +103 -0
- package/dist/memory/database.d.ts.map +1 -0
- package/dist/memory/database.js +337 -0
- package/dist/memory/database.js.map +1 -0
- package/dist/memory/hermes-bridge.d.ts +70 -0
- package/dist/memory/hermes-bridge.d.ts.map +1 -0
- package/dist/memory/hermes-bridge.js +155 -0
- package/dist/memory/hermes-bridge.js.map +1 -0
- package/dist/memory/index.d.ts +23 -0
- package/dist/memory/index.d.ts.map +1 -0
- package/dist/memory/index.js +22 -0
- package/dist/memory/index.js.map +1 -0
- package/dist/memory/memory-store.d.ts +76 -0
- package/dist/memory/memory-store.d.ts.map +1 -0
- package/dist/memory/memory-store.js +231 -0
- package/dist/memory/memory-store.js.map +1 -0
- package/dist/memory/stream-buffer-store.d.ts +69 -0
- package/dist/memory/stream-buffer-store.d.ts.map +1 -0
- package/dist/memory/stream-buffer-store.js +182 -0
- package/dist/memory/stream-buffer-store.js.map +1 -0
- package/dist/memory/tool-call-store.d.ts +68 -0
- package/dist/memory/tool-call-store.d.ts.map +1 -0
- package/dist/memory/tool-call-store.js +189 -0
- package/dist/memory/tool-call-store.js.map +1 -0
- package/dist/memory/types.d.ts +197 -0
- package/dist/memory/types.d.ts.map +1 -0
- package/dist/memory/types.js +15 -0
- package/dist/memory/types.js.map +1 -0
- package/dist/memory/utils.d.ts +30 -0
- package/dist/memory/utils.d.ts.map +1 -0
- package/dist/memory/utils.js +47 -0
- package/dist/memory/utils.js.map +1 -0
- package/dist/payments/hosted-tool-eligibility.d.ts.map +1 -1
- package/dist/payments/hosted-tool-eligibility.js +4 -6
- package/dist/payments/hosted-tool-eligibility.js.map +1 -1
- package/dist/payments/monetization-gate.d.ts +39 -0
- package/dist/payments/monetization-gate.d.ts.map +1 -1
- package/dist/payments/monetization-gate.js +165 -11
- package/dist/payments/monetization-gate.js.map +1 -1
- package/dist/payments/pay-sh-spec.d.ts.map +1 -1
- package/dist/payments/pay-sh-spec.js +4 -2
- package/dist/payments/pay-sh-spec.js.map +1 -1
- package/dist/payments/pricing.d.ts +3 -1
- package/dist/payments/pricing.d.ts.map +1 -1
- package/dist/payments/pricing.js +137 -56
- package/dist/payments/pricing.js.map +1 -1
- package/dist/payments/x402-paid-call.d.ts.map +1 -1
- package/dist/payments/x402-paid-call.js +26 -2
- package/dist/payments/x402-paid-call.js.map +1 -1
- package/dist/premium/builtin-plugins.d.ts +42 -0
- package/dist/premium/builtin-plugins.d.ts.map +1 -1
- package/dist/premium/builtin-plugins.js +91 -10
- package/dist/premium/builtin-plugins.js.map +1 -1
- package/dist/premium/manifest-builder.d.ts.map +1 -1
- package/dist/premium/manifest-builder.js +43 -7
- package/dist/premium/manifest-builder.js.map +1 -1
- package/dist/premium/meme-radar-capabilities.js +9 -9
- package/dist/premium/meme-radar-capabilities.js.map +1 -1
- package/dist/premium/plugin-validator.d.ts.map +1 -1
- package/dist/premium/plugin-validator.js +62 -1
- package/dist/premium/plugin-validator.js.map +1 -1
- package/dist/premium/provider-bridge.d.ts +25 -1
- package/dist/premium/provider-bridge.d.ts.map +1 -1
- package/dist/premium/provider-bridge.js +130 -20
- package/dist/premium/provider-bridge.js.map +1 -1
- package/dist/premium/session-manager.d.ts.map +1 -1
- package/dist/premium/session-manager.js +12 -3
- package/dist/premium/session-manager.js.map +1 -1
- package/dist/premium/tech-fundamentals-capabilities.js +5 -5
- package/dist/premium/tech-fundamentals-capabilities.js.map +1 -1
- package/dist/premium/trading-capabilities.js +5 -5
- package/dist/premium/trading-capabilities.js.map +1 -1
- package/dist/premium/webhook-engine.d.ts.map +1 -1
- package/dist/premium/webhook-engine.js +7 -1
- package/dist/premium/webhook-engine.js.map +1 -1
- package/dist/prompts/context/sap-agent-context.prompt.js +4 -3
- package/dist/prompts/context/sap-agent-context.prompt.js.map +1 -1
- package/dist/prompts/context/sap-agent-intent-router.prompt.js +1 -1
- package/dist/prompts/payments/explain-x402-settlement.prompt.js +1 -1
- package/dist/remote/premium-routes.d.ts.map +1 -1
- package/dist/remote/premium-routes.js +3 -2
- package/dist/remote/premium-routes.js.map +1 -1
- package/dist/remote/public-home/sections.d.ts.map +1 -1
- package/dist/remote/public-home/sections.js +2 -3
- package/dist/remote/public-home/sections.js.map +1 -1
- package/dist/remote/public-home/styles.d.ts +1 -1
- package/dist/remote/public-home/styles.js +2 -2
- package/dist/remote/server.d.ts.map +1 -1
- package/dist/remote/server.js +19 -4
- package/dist/remote/server.js.map +1 -1
- package/dist/server/server-metadata.js +1 -1
- package/dist/strategies/strategy-store.d.ts +82 -0
- package/dist/strategies/strategy-store.d.ts.map +1 -0
- package/dist/strategies/strategy-store.js +165 -0
- package/dist/strategies/strategy-store.js.map +1 -0
- package/dist/tools/agent-start-tool.d.ts.map +1 -1
- package/dist/tools/agent-start-tool.js +103 -16
- package/dist/tools/agent-start-tool.js.map +1 -1
- package/dist/tools/client-sdk-tools.d.ts.map +1 -1
- package/dist/tools/client-sdk-tools.js +156 -12
- package/dist/tools/client-sdk-tools.js.map +1 -1
- package/dist/tools/estimate-tool-cost.d.ts.map +1 -1
- package/dist/tools/estimate-tool-cost.js +11 -4
- package/dist/tools/estimate-tool-cost.js.map +1 -1
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +2 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/magicblock-tools.js +8 -8
- package/dist/tools/magicblock-tools.js.map +1 -1
- package/dist/tools/memory-tools.d.ts +26 -0
- package/dist/tools/memory-tools.d.ts.map +1 -0
- package/dist/tools/memory-tools.js +533 -0
- package/dist/tools/memory-tools.js.map +1 -0
- package/dist/tools/perp-tools.d.ts +7 -9
- package/dist/tools/perp-tools.d.ts.map +1 -1
- package/dist/tools/perp-tools.js +404 -367
- package/dist/tools/perp-tools.js.map +1 -1
- package/dist/tools/premium-tools.d.ts.map +1 -1
- package/dist/tools/premium-tools.js +8 -2
- package/dist/tools/premium-tools.js.map +1 -1
- package/dist/tools/profile-tools.d.ts.map +1 -1
- package/dist/tools/profile-tools.js +18 -1
- package/dist/tools/profile-tools.js.map +1 -1
- package/dist/tools/quick-context-tool.d.ts.map +1 -1
- package/dist/tools/quick-context-tool.js +101 -9
- package/dist/tools/quick-context-tool.js.map +1 -1
- package/dist/tools/register-tools.d.ts.map +1 -1
- package/dist/tools/register-tools.js +3 -0
- package/dist/tools/register-tools.js.map +1 -1
- package/dist/tools/sap-sdk-tools.d.ts.map +1 -1
- package/dist/tools/sap-sdk-tools.js +14 -13
- package/dist/tools/sap-sdk-tools.js.map +1 -1
- package/dist/tools/session-context-packet.d.ts +19 -0
- package/dist/tools/session-context-packet.d.ts.map +1 -0
- package/dist/tools/session-context-packet.js +256 -0
- package/dist/tools/session-context-packet.js.map +1 -0
- package/dist/tools/skills-tools.d.ts +10 -0
- package/dist/tools/skills-tools.d.ts.map +1 -1
- package/dist/tools/skills-tools.js +19 -0
- package/dist/tools/skills-tools.js.map +1 -1
- package/dist/tools/transaction-tools.d.ts +1 -0
- package/dist/tools/transaction-tools.d.ts.map +1 -1
- package/dist/tools/transaction-tools.js +248 -9
- package/dist/tools/transaction-tools.js.map +1 -1
- package/dist/tools/x402-paid-call-tool.d.ts.map +1 -1
- package/dist/tools/x402-paid-call-tool.js +55 -21
- package/dist/tools/x402-paid-call-tool.js.map +1 -1
- package/dist/wizard-core/desktop-flow.d.ts.map +1 -1
- package/dist/wizard-core/desktop-flow.js +4 -2
- package/dist/wizard-core/desktop-flow.js.map +1 -1
- package/docs/06_PAYMENTS_X402_AND_PAYSH.md +38 -13
- package/docs/07_ENDPOINTS_AND_CLIENTS.md +1 -1
- package/docs/09_TOOLS_SKILLS_AND_AGENT_GUIDE.md +14 -6
- package/docs/13_BOUNTY_PROGRAM_PROPOSAL.md +1 -1
- package/docs/14_DESKTOP_WIZARD_RELEASE.md +3 -3
- package/docs/15_DASHBOARD_SCREENSHARE_SCRIPT.md +1 -1
- package/docs/BRANCH_AND_CI.md +2 -2
- package/docs/README.md +1 -1
- package/package.json +3 -1
- package/server.json +3 -3
- package/skills/README.md +3 -3
- package/skills/sap-agent-registry/SKILL.md +2 -2
- package/skills/sap-agentkit/SKILL.md +10 -4
- package/skills/sap-defi/SKILL.md +42 -5
- package/skills/sap-discovery-indexing/SKILL.md +4 -3
- package/skills/sap-market-data/SKILL.md +9 -5
- package/skills/sap-mcp/SKILL.md +37 -24
- package/skills/sap-mcp/TOOL_REFERENCE.md +9 -8
- package/skills/sap-operations/SKILL.md +5 -4
- package/skills/sap-payments-x402/SKILL.md +34 -19
- package/assets/logos/drift.svg +0 -12
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module memory/memory-store
|
|
3
|
+
* @description Store for agent memories — LLM-compressed summaries of past interactions.
|
|
4
|
+
*
|
|
5
|
+
* Memories are created by the agent (or auto-generated by the summarize tool)
|
|
6
|
+
* and stored with a relevance score that decays over time. The FTS5 index
|
|
7
|
+
* enables semantic search across all memories for context injection.
|
|
8
|
+
*/
|
|
9
|
+
import type { AgentMemoryRecord, MemoryType, MemorySearchResult, MemoryQueryOptions } from './types.js';
|
|
10
|
+
/**
|
|
11
|
+
* @name MemoryStore
|
|
12
|
+
* @description Manages agent memory records with relevance decay and FTS5 search.
|
|
13
|
+
*/
|
|
14
|
+
export declare class MemoryStore {
|
|
15
|
+
/**
|
|
16
|
+
* @name record
|
|
17
|
+
* @description Creates a new agent memory entry.
|
|
18
|
+
* @param record - Memory data to record (without id, timestamps, relevance).
|
|
19
|
+
* @param initialRelevance - Initial relevance score 0-1. Default 0.8.
|
|
20
|
+
* @returns The inserted record ID, or -1 if degraded.
|
|
21
|
+
*/
|
|
22
|
+
record(record: Pick<AgentMemoryRecord, 'memoryType' | 'category' | 'summary' | 'sourceToolCalls' | 'expiresAt'>, initialRelevance?: number): number;
|
|
23
|
+
/**
|
|
24
|
+
* @name search
|
|
25
|
+
* @description Full-text search across agent memories using FTS5.
|
|
26
|
+
* Results are ranked by BM25 relevance with decayed score.
|
|
27
|
+
*/
|
|
28
|
+
search(options: MemoryQueryOptions): MemorySearchResult<AgentMemoryRecord & {
|
|
29
|
+
decayedRelevance: number;
|
|
30
|
+
}>;
|
|
31
|
+
/**
|
|
32
|
+
* @name recall
|
|
33
|
+
* @description Returns the most relevant memories for a given category.
|
|
34
|
+
* Used for prompt injection — the agent gets the top N memories ordered
|
|
35
|
+
* by decayed relevance.
|
|
36
|
+
* @param category - Tool category to recall memories for.
|
|
37
|
+
* @param limit - Maximum number of memories. Default 5.
|
|
38
|
+
* @returns Relevant memories sorted by decayed relevance.
|
|
39
|
+
*/
|
|
40
|
+
recall(category: string, limit?: number): AgentMemoryRecord[];
|
|
41
|
+
/**
|
|
42
|
+
* @name count
|
|
43
|
+
* @description Returns the total number of agent memory records.
|
|
44
|
+
*/
|
|
45
|
+
count(): number;
|
|
46
|
+
/**
|
|
47
|
+
* @name memoryTypeBreakdown
|
|
48
|
+
* @description Returns counts grouped by memory type.
|
|
49
|
+
*/
|
|
50
|
+
memoryTypeBreakdown(): Record<MemoryType, number>;
|
|
51
|
+
/**
|
|
52
|
+
* @name lastMemoryAt
|
|
53
|
+
* @description Returns the timestamp of the most recent memory.
|
|
54
|
+
*/
|
|
55
|
+
lastMemoryAt(): string | null;
|
|
56
|
+
/**
|
|
57
|
+
* @name prune
|
|
58
|
+
* @description Removes expired memories and memories with relevance below
|
|
59
|
+
* the threshold after decay.
|
|
60
|
+
* @param minRelevance - Minimum decayed relevance to keep. Default 0.05.
|
|
61
|
+
* @returns Number of memories pruned.
|
|
62
|
+
*/
|
|
63
|
+
prune(minRelevance?: number): number;
|
|
64
|
+
/**
|
|
65
|
+
* @name buildFtsQuery
|
|
66
|
+
* @description Converts a natural language query into a FTS5 MATCH expression.
|
|
67
|
+
* @internal
|
|
68
|
+
*/
|
|
69
|
+
private buildFtsQuery;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* @name memoryStore
|
|
73
|
+
* @description Singleton instance of the memory store.
|
|
74
|
+
*/
|
|
75
|
+
export declare const memoryStore: MemoryStore;
|
|
76
|
+
//# sourceMappingURL=memory-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory-store.d.ts","sourceRoot":"","sources":["../../src/memory/memory-store.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAExG;;;GAGG;AACH,qBAAa,WAAW;IACtB;;;;;;OAMG;IACH,MAAM,CACJ,MAAM,EAAE,IAAI,CAAC,iBAAiB,EAAE,YAAY,GAAG,UAAU,GAAG,SAAS,GAAG,iBAAiB,GAAG,WAAW,CAAC,EACxG,gBAAgB,SAAM,GACrB,MAAM;IAmBT;;;;OAIG;IACH,MAAM,CAAC,OAAO,EAAE,kBAAkB,GAAG,kBAAkB,CAAC,iBAAiB,GAAG;QAAE,gBAAgB,EAAE,MAAM,CAAA;KAAE,CAAC;IAsEzG;;;;;;;;OAQG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,SAAI,GAAG,iBAAiB,EAAE;IA2BxD;;;OAGG;IACH,KAAK,IAAI,MAAM;IAQf;;;OAGG;IACH,mBAAmB,IAAI,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC;IAgBjD;;;OAGG;IACH,YAAY,IAAI,MAAM,GAAG,IAAI;IAS7B;;;;;;OAMG;IACH,KAAK,CAAC,YAAY,SAAO,GAAG,MAAM;IA4BlC;;;;OAIG;IACH,OAAO,CAAC,aAAa;CAOtB;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,aAAoB,CAAC"}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module memory/memory-store
|
|
3
|
+
* @description Store for agent memories — LLM-compressed summaries of past interactions.
|
|
4
|
+
*
|
|
5
|
+
* Memories are created by the agent (or auto-generated by the summarize tool)
|
|
6
|
+
* and stored with a relevance score that decays over time. The FTS5 index
|
|
7
|
+
* enables semantic search across all memories for context injection.
|
|
8
|
+
*/
|
|
9
|
+
import { memoryDatabase } from './database.js';
|
|
10
|
+
import { decayRelevance, isExpired } from './utils.js';
|
|
11
|
+
/**
|
|
12
|
+
* @name MemoryStore
|
|
13
|
+
* @description Manages agent memory records with relevance decay and FTS5 search.
|
|
14
|
+
*/
|
|
15
|
+
export class MemoryStore {
|
|
16
|
+
/**
|
|
17
|
+
* @name record
|
|
18
|
+
* @description Creates a new agent memory entry.
|
|
19
|
+
* @param record - Memory data to record (without id, timestamps, relevance).
|
|
20
|
+
* @param initialRelevance - Initial relevance score 0-1. Default 0.8.
|
|
21
|
+
* @returns The inserted record ID, or -1 if degraded.
|
|
22
|
+
*/
|
|
23
|
+
record(record, initialRelevance = 0.8) {
|
|
24
|
+
if (memoryDatabase.isDegraded())
|
|
25
|
+
return -1;
|
|
26
|
+
memoryDatabase.init();
|
|
27
|
+
const stmt = memoryDatabase.getStatement('insert_memory');
|
|
28
|
+
if (!stmt)
|
|
29
|
+
return -1;
|
|
30
|
+
const result = stmt.run({
|
|
31
|
+
memoryType: record.memoryType,
|
|
32
|
+
category: record.category,
|
|
33
|
+
summary: record.summary,
|
|
34
|
+
sourceToolCalls: record.sourceToolCalls ?? null,
|
|
35
|
+
relevanceScore: Math.max(0, Math.min(1, initialRelevance)),
|
|
36
|
+
expiresAt: record.expiresAt ?? null,
|
|
37
|
+
});
|
|
38
|
+
return result.lastInsertRowid;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* @name search
|
|
42
|
+
* @description Full-text search across agent memories using FTS5.
|
|
43
|
+
* Results are ranked by BM25 relevance with decayed score.
|
|
44
|
+
*/
|
|
45
|
+
search(options) {
|
|
46
|
+
if (memoryDatabase.isDegraded()) {
|
|
47
|
+
return { results: [], total: 0, hasMore: false };
|
|
48
|
+
}
|
|
49
|
+
memoryDatabase.init();
|
|
50
|
+
const db = memoryDatabase.getDb();
|
|
51
|
+
const limit = Math.min(options.limit ?? 20, 100);
|
|
52
|
+
const offset = options.offset ?? 0;
|
|
53
|
+
let whereClause = '';
|
|
54
|
+
const params = { limit, offset };
|
|
55
|
+
if (options.memoryType) {
|
|
56
|
+
whereClause += ' AND m.memory_type = @memoryType';
|
|
57
|
+
params['memoryType'] = options.memoryType;
|
|
58
|
+
}
|
|
59
|
+
if (options.category) {
|
|
60
|
+
whereClause += ' AND m.category = @category';
|
|
61
|
+
params['category'] = options.category;
|
|
62
|
+
}
|
|
63
|
+
const ftsQuery = this.buildFtsQuery(options.query);
|
|
64
|
+
const sql = `
|
|
65
|
+
SELECT m.id, m.memory_type, m.category, m.summary, m.source_tool_calls,
|
|
66
|
+
m.relevance_score, m.created_at, m.expires_at, m.last_accessed_at
|
|
67
|
+
FROM agent_memory_fts fts
|
|
68
|
+
JOIN agent_memory m ON m.id = fts.rowid
|
|
69
|
+
WHERE agent_memory_fts MATCH @ftsQuery
|
|
70
|
+
${whereClause}
|
|
71
|
+
ORDER BY ${options.sort === 'newest' ? 'm.created_at DESC' : options.sort === 'oldest' ? 'm.created_at ASC' : 'bm25(agent_memory_fts)'}
|
|
72
|
+
LIMIT @limit OFFSET @offset
|
|
73
|
+
`;
|
|
74
|
+
params['ftsQuery'] = ftsQuery;
|
|
75
|
+
try {
|
|
76
|
+
const rows = db.prepare(sql).all(params);
|
|
77
|
+
const results = rows.map(row => ({
|
|
78
|
+
...row,
|
|
79
|
+
decayedRelevance: decayRelevance(row.relevanceScore, row.createdAt, 0.01),
|
|
80
|
+
}));
|
|
81
|
+
// Filter by minimum relevance (after decay).
|
|
82
|
+
const filtered = options.minRelevance
|
|
83
|
+
? results.filter(r => r.decayedRelevance >= (options.minRelevance ?? 0))
|
|
84
|
+
: results;
|
|
85
|
+
// Filter out expired memories.
|
|
86
|
+
const active = filtered.filter(r => !isExpired(r.expiresAt));
|
|
87
|
+
// Update last_accessed_at for returned memories.
|
|
88
|
+
const updateStmt = memoryDatabase.getStatement('update_memory_access');
|
|
89
|
+
if (updateStmt) {
|
|
90
|
+
for (const r of active) {
|
|
91
|
+
if (r.id)
|
|
92
|
+
updateStmt.run(r.id);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return {
|
|
96
|
+
results: active,
|
|
97
|
+
total: active.length,
|
|
98
|
+
hasMore: false,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
catch {
|
|
102
|
+
return { results: [], total: 0, hasMore: false };
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* @name recall
|
|
107
|
+
* @description Returns the most relevant memories for a given category.
|
|
108
|
+
* Used for prompt injection — the agent gets the top N memories ordered
|
|
109
|
+
* by decayed relevance.
|
|
110
|
+
* @param category - Tool category to recall memories for.
|
|
111
|
+
* @param limit - Maximum number of memories. Default 5.
|
|
112
|
+
* @returns Relevant memories sorted by decayed relevance.
|
|
113
|
+
*/
|
|
114
|
+
recall(category, limit = 5) {
|
|
115
|
+
if (memoryDatabase.isDegraded())
|
|
116
|
+
return [];
|
|
117
|
+
memoryDatabase.init();
|
|
118
|
+
const db = memoryDatabase.getDb();
|
|
119
|
+
try {
|
|
120
|
+
const rows = db.prepare(`SELECT * FROM agent_memory
|
|
121
|
+
WHERE category = ? AND (expires_at IS NULL OR expires_at > datetime('now'))
|
|
122
|
+
ORDER BY relevance_score DESC
|
|
123
|
+
LIMIT ?`).all(category, limit);
|
|
124
|
+
// Update last_accessed_at.
|
|
125
|
+
const updateStmt = memoryDatabase.getStatement('update_memory_access');
|
|
126
|
+
if (updateStmt) {
|
|
127
|
+
for (const row of rows) {
|
|
128
|
+
if (row.id)
|
|
129
|
+
updateStmt.run(row.id);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return rows;
|
|
133
|
+
}
|
|
134
|
+
catch {
|
|
135
|
+
return [];
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* @name count
|
|
140
|
+
* @description Returns the total number of agent memory records.
|
|
141
|
+
*/
|
|
142
|
+
count() {
|
|
143
|
+
if (memoryDatabase.isDegraded())
|
|
144
|
+
return 0;
|
|
145
|
+
memoryDatabase.init();
|
|
146
|
+
const stmt = memoryDatabase.getStatement('count_memory');
|
|
147
|
+
if (!stmt)
|
|
148
|
+
return 0;
|
|
149
|
+
return stmt.get().count;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* @name memoryTypeBreakdown
|
|
153
|
+
* @description Returns counts grouped by memory type.
|
|
154
|
+
*/
|
|
155
|
+
memoryTypeBreakdown() {
|
|
156
|
+
if (memoryDatabase.isDegraded()) {
|
|
157
|
+
return { lesson: 0, pattern: 0, failure: 0, success: 0 };
|
|
158
|
+
}
|
|
159
|
+
memoryDatabase.init();
|
|
160
|
+
const stmt = memoryDatabase.getStatement('count_memory_by_type');
|
|
161
|
+
if (!stmt)
|
|
162
|
+
return { lesson: 0, pattern: 0, failure: 0, success: 0 };
|
|
163
|
+
const rows = stmt.all();
|
|
164
|
+
const result = { lesson: 0, pattern: 0, failure: 0, success: 0 };
|
|
165
|
+
for (const row of rows) {
|
|
166
|
+
result[row.memory_type] = row.count;
|
|
167
|
+
}
|
|
168
|
+
return result;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* @name lastMemoryAt
|
|
172
|
+
* @description Returns the timestamp of the most recent memory.
|
|
173
|
+
*/
|
|
174
|
+
lastMemoryAt() {
|
|
175
|
+
if (memoryDatabase.isDegraded())
|
|
176
|
+
return null;
|
|
177
|
+
memoryDatabase.init();
|
|
178
|
+
const stmt = memoryDatabase.getStatement('last_memory_at');
|
|
179
|
+
if (!stmt)
|
|
180
|
+
return null;
|
|
181
|
+
const row = stmt.get();
|
|
182
|
+
return row?.created_at ?? null;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* @name prune
|
|
186
|
+
* @description Removes expired memories and memories with relevance below
|
|
187
|
+
* the threshold after decay.
|
|
188
|
+
* @param minRelevance - Minimum decayed relevance to keep. Default 0.05.
|
|
189
|
+
* @returns Number of memories pruned.
|
|
190
|
+
*/
|
|
191
|
+
prune(minRelevance = 0.05) {
|
|
192
|
+
if (memoryDatabase.isDegraded())
|
|
193
|
+
return 0;
|
|
194
|
+
memoryDatabase.init();
|
|
195
|
+
const db = memoryDatabase.getDb();
|
|
196
|
+
// Delete expired memories.
|
|
197
|
+
const expiredResult = db.prepare(`DELETE FROM agent_memory WHERE expires_at IS NOT NULL AND expires_at <= datetime('now')`).run();
|
|
198
|
+
// Delete low-relevance memories (check decayed relevance in JS to avoid
|
|
199
|
+
// complex SQL — better-sqlite3 is synchronous so this is fast).
|
|
200
|
+
const allRows = db.prepare(`SELECT id, relevance_score, created_at FROM agent_memory`).all();
|
|
201
|
+
let pruned = expiredResult.changes;
|
|
202
|
+
for (const row of allRows) {
|
|
203
|
+
const decayed = decayRelevance(row.relevance_score, row.created_at, 0.01);
|
|
204
|
+
if (decayed < minRelevance) {
|
|
205
|
+
db.prepare('DELETE FROM agent_memory WHERE id = ?').run(row.id);
|
|
206
|
+
pruned++;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
return pruned;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* @name buildFtsQuery
|
|
213
|
+
* @description Converts a natural language query into a FTS5 MATCH expression.
|
|
214
|
+
* @internal
|
|
215
|
+
*/
|
|
216
|
+
buildFtsQuery(query) {
|
|
217
|
+
const escaped = query.replace(/["'*:]/g, ' ').trim();
|
|
218
|
+
if (!escaped)
|
|
219
|
+
return '*';
|
|
220
|
+
const words = escaped.split(/\s+/).filter(w => w.length > 0);
|
|
221
|
+
if (words.length === 1)
|
|
222
|
+
return `"${words[0]}"*`;
|
|
223
|
+
return words.map(w => `"${w}"*`).join(' OR ');
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* @name memoryStore
|
|
228
|
+
* @description Singleton instance of the memory store.
|
|
229
|
+
*/
|
|
230
|
+
export const memoryStore = new MemoryStore();
|
|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KAAK,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;YAC1B,MAAM,OAAO,GAAG,cAAc,CAAC,GAAG,CAAC,eAAe,EAAE,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;YAC1E,IAAI,OAAO,GAAG,YAAY,EAAE,CAAC;gBAC3B,EAAE,CAAC,OAAO,CAAC,uCAAuC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;gBAChE,MAAM,EAAE,CAAC;YACX,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;;;OAIG;IACK,aAAa,CAAC,KAAa;QACjC,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;QACrD,IAAI,CAAC,OAAO;YAAE,OAAO,GAAG,CAAC;QACzB,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC7D,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;QAChD,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAChD,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module memory/stream-buffer-store
|
|
3
|
+
* @description Store for buffering stream events locally in SQLite.
|
|
4
|
+
*
|
|
5
|
+
* Premium stream events (Pyth price ticks, meme alerts, volatility signals) are
|
|
6
|
+
* persisted locally so the agent can consume them without paid polls. Events
|
|
7
|
+
* are deduplicated by (streamType, eventId) and consumed in FIFO order.
|
|
8
|
+
*/
|
|
9
|
+
import type { StreamBufferRecord } from './types.js';
|
|
10
|
+
/**
|
|
11
|
+
* @name StreamBufferStore
|
|
12
|
+
* @description Manages local stream event buffering with FIFO consumption.
|
|
13
|
+
*/
|
|
14
|
+
export declare class StreamBufferStore {
|
|
15
|
+
/**
|
|
16
|
+
* @name buffer
|
|
17
|
+
* @description Buffers a stream event. Deduplicates by (streamType, eventId).
|
|
18
|
+
* @param record - Event to buffer.
|
|
19
|
+
* @returns The row ID, or -1 if the event was already buffered (dedup).
|
|
20
|
+
*/
|
|
21
|
+
buffer(record: Omit<StreamBufferRecord, 'id' | 'consumed' | 'createdAt'>): number;
|
|
22
|
+
/**
|
|
23
|
+
* @name consume
|
|
24
|
+
* @description Returns unconsumed events for a stream type and marks them consumed.
|
|
25
|
+
* FIFO order (oldest first). Returns up to `limit` events.
|
|
26
|
+
* @param streamType - Stream type to consume (e.g. 'pyth-price').
|
|
27
|
+
* @param limit - Maximum events to consume. Default 20.
|
|
28
|
+
* @returns Consumed events.
|
|
29
|
+
*/
|
|
30
|
+
consume(streamType: string, limit?: number): StreamBufferRecord[];
|
|
31
|
+
/**
|
|
32
|
+
* @name peek
|
|
33
|
+
* @description Returns unconsumed events without marking them consumed.
|
|
34
|
+
* Used for preview/inspection.
|
|
35
|
+
*/
|
|
36
|
+
peek(streamType: string, limit?: number): StreamBufferRecord[];
|
|
37
|
+
/**
|
|
38
|
+
* @name replay
|
|
39
|
+
* @description Returns all events (consumed + unconsumed) for a stream type
|
|
40
|
+
* within a time range. Used for backtest/analysis.
|
|
41
|
+
* @param streamType - Stream type to replay.
|
|
42
|
+
* @param since - ISO 8601 timestamp. Events created after this time.
|
|
43
|
+
* @param limit - Maximum events. Default 100.
|
|
44
|
+
*/
|
|
45
|
+
replay(streamType: string, since?: string, limit?: number): StreamBufferRecord[];
|
|
46
|
+
/**
|
|
47
|
+
* @name pendingCount
|
|
48
|
+
* @description Returns the number of unconsumed events.
|
|
49
|
+
*/
|
|
50
|
+
pendingCount(): number;
|
|
51
|
+
/**
|
|
52
|
+
* @name evict
|
|
53
|
+
* @description Evicts old consumed events to keep the buffer bounded.
|
|
54
|
+
* @param maxPerType - Maximum events per stream type. Default 10000.
|
|
55
|
+
* @returns Number of events evicted.
|
|
56
|
+
*/
|
|
57
|
+
evict(maxPerType?: number): number;
|
|
58
|
+
/**
|
|
59
|
+
* @name clear
|
|
60
|
+
* @description Clears all events for a stream type.
|
|
61
|
+
*/
|
|
62
|
+
clear(streamType: string): number;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* @name streamBufferStore
|
|
66
|
+
* @description Singleton instance of the stream buffer store.
|
|
67
|
+
*/
|
|
68
|
+
export declare const streamBufferStore: StreamBufferStore;
|
|
69
|
+
//# sourceMappingURL=stream-buffer-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stream-buffer-store.d.ts","sourceRoot":"","sources":["../../src/memory/stream-buffer-store.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD;;;GAGG;AACH,qBAAa,iBAAiB;IAC5B;;;;;OAKG;IACH,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,kBAAkB,EAAE,IAAI,GAAG,UAAU,GAAG,WAAW,CAAC,GAAG,MAAM;IAqBjF;;;;;;;OAOG;IACH,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,SAAK,GAAG,kBAAkB,EAAE;IA4B7D;;;;OAIG;IACH,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,SAAK,GAAG,kBAAkB,EAAE;IAiB1D;;;;;;;OAOG;IACH,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,KAAK,SAAM,GAAG,kBAAkB,EAAE;IAuB7E;;;OAGG;IACH,YAAY,IAAI,MAAM;IAQtB;;;;;OAKG;IACH,KAAK,CAAC,UAAU,SAAS,GAAG,MAAM;IAoBlC;;;OAGG;IACH,KAAK,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;CAalC;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,mBAA0B,CAAC"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module memory/stream-buffer-store
|
|
3
|
+
* @description Store for buffering stream events locally in SQLite.
|
|
4
|
+
*
|
|
5
|
+
* Premium stream events (Pyth price ticks, meme alerts, volatility signals) are
|
|
6
|
+
* persisted locally so the agent can consume them without paid polls. Events
|
|
7
|
+
* are deduplicated by (streamType, eventId) and consumed in FIFO order.
|
|
8
|
+
*/
|
|
9
|
+
import { memoryDatabase } from './database.js';
|
|
10
|
+
/**
|
|
11
|
+
* @name StreamBufferStore
|
|
12
|
+
* @description Manages local stream event buffering with FIFO consumption.
|
|
13
|
+
*/
|
|
14
|
+
export class StreamBufferStore {
|
|
15
|
+
/**
|
|
16
|
+
* @name buffer
|
|
17
|
+
* @description Buffers a stream event. Deduplicates by (streamType, eventId).
|
|
18
|
+
* @param record - Event to buffer.
|
|
19
|
+
* @returns The row ID, or -1 if the event was already buffered (dedup).
|
|
20
|
+
*/
|
|
21
|
+
buffer(record) {
|
|
22
|
+
if (memoryDatabase.isDegraded())
|
|
23
|
+
return -1;
|
|
24
|
+
memoryDatabase.init();
|
|
25
|
+
const stmt = memoryDatabase.getStatement('insert_stream_event');
|
|
26
|
+
if (!stmt)
|
|
27
|
+
return -1;
|
|
28
|
+
try {
|
|
29
|
+
const result = stmt.run({
|
|
30
|
+
streamType: record.streamType,
|
|
31
|
+
eventId: record.eventId,
|
|
32
|
+
eventType: record.eventType,
|
|
33
|
+
payload: record.payload,
|
|
34
|
+
});
|
|
35
|
+
return result.lastInsertRowid;
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
// INSERT OR IGNORE — dedup case, event already exists.
|
|
39
|
+
return -1;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* @name consume
|
|
44
|
+
* @description Returns unconsumed events for a stream type and marks them consumed.
|
|
45
|
+
* FIFO order (oldest first). Returns up to `limit` events.
|
|
46
|
+
* @param streamType - Stream type to consume (e.g. 'pyth-price').
|
|
47
|
+
* @param limit - Maximum events to consume. Default 20.
|
|
48
|
+
* @returns Consumed events.
|
|
49
|
+
*/
|
|
50
|
+
consume(streamType, limit = 20) {
|
|
51
|
+
if (memoryDatabase.isDegraded())
|
|
52
|
+
return [];
|
|
53
|
+
memoryDatabase.init();
|
|
54
|
+
const db = memoryDatabase.getDb();
|
|
55
|
+
try {
|
|
56
|
+
const events = db.prepare(`SELECT * FROM stream_buffers
|
|
57
|
+
WHERE stream_type = ? AND consumed = 0
|
|
58
|
+
ORDER BY id ASC
|
|
59
|
+
LIMIT ?`).all(streamType, limit);
|
|
60
|
+
if (events.length === 0)
|
|
61
|
+
return [];
|
|
62
|
+
// Mark as consumed.
|
|
63
|
+
const lastId = events[events.length - 1].id;
|
|
64
|
+
if (lastId !== undefined) {
|
|
65
|
+
const consumeStmt = memoryDatabase.getStatement('consume_stream_events');
|
|
66
|
+
consumeStmt?.run(streamType, lastId);
|
|
67
|
+
}
|
|
68
|
+
return events;
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
return [];
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* @name peek
|
|
76
|
+
* @description Returns unconsumed events without marking them consumed.
|
|
77
|
+
* Used for preview/inspection.
|
|
78
|
+
*/
|
|
79
|
+
peek(streamType, limit = 20) {
|
|
80
|
+
if (memoryDatabase.isDegraded())
|
|
81
|
+
return [];
|
|
82
|
+
memoryDatabase.init();
|
|
83
|
+
const db = memoryDatabase.getDb();
|
|
84
|
+
try {
|
|
85
|
+
return db.prepare(`SELECT * FROM stream_buffers
|
|
86
|
+
WHERE stream_type = ? AND consumed = 0
|
|
87
|
+
ORDER BY id ASC
|
|
88
|
+
LIMIT ?`).all(streamType, limit);
|
|
89
|
+
}
|
|
90
|
+
catch {
|
|
91
|
+
return [];
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* @name replay
|
|
96
|
+
* @description Returns all events (consumed + unconsumed) for a stream type
|
|
97
|
+
* within a time range. Used for backtest/analysis.
|
|
98
|
+
* @param streamType - Stream type to replay.
|
|
99
|
+
* @param since - ISO 8601 timestamp. Events created after this time.
|
|
100
|
+
* @param limit - Maximum events. Default 100.
|
|
101
|
+
*/
|
|
102
|
+
replay(streamType, since, limit = 100) {
|
|
103
|
+
if (memoryDatabase.isDegraded())
|
|
104
|
+
return [];
|
|
105
|
+
memoryDatabase.init();
|
|
106
|
+
const db = memoryDatabase.getDb();
|
|
107
|
+
try {
|
|
108
|
+
if (since) {
|
|
109
|
+
return db.prepare(`SELECT * FROM stream_buffers
|
|
110
|
+
WHERE stream_type = ? AND created_at >= ?
|
|
111
|
+
ORDER BY id ASC LIMIT ?`).all(streamType, since, limit);
|
|
112
|
+
}
|
|
113
|
+
return db.prepare(`SELECT * FROM stream_buffers
|
|
114
|
+
WHERE stream_type = ?
|
|
115
|
+
ORDER BY id ASC LIMIT ?`).all(streamType, limit);
|
|
116
|
+
}
|
|
117
|
+
catch {
|
|
118
|
+
return [];
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* @name pendingCount
|
|
123
|
+
* @description Returns the number of unconsumed events.
|
|
124
|
+
*/
|
|
125
|
+
pendingCount() {
|
|
126
|
+
if (memoryDatabase.isDegraded())
|
|
127
|
+
return 0;
|
|
128
|
+
memoryDatabase.init();
|
|
129
|
+
const stmt = memoryDatabase.getStatement('count_pending_streams');
|
|
130
|
+
if (!stmt)
|
|
131
|
+
return 0;
|
|
132
|
+
return stmt.get().count;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* @name evict
|
|
136
|
+
* @description Evicts old consumed events to keep the buffer bounded.
|
|
137
|
+
* @param maxPerType - Maximum events per stream type. Default 10000.
|
|
138
|
+
* @returns Number of events evicted.
|
|
139
|
+
*/
|
|
140
|
+
evict(maxPerType = 10_000) {
|
|
141
|
+
if (memoryDatabase.isDegraded())
|
|
142
|
+
return 0;
|
|
143
|
+
memoryDatabase.init();
|
|
144
|
+
const db = memoryDatabase.getDb();
|
|
145
|
+
try {
|
|
146
|
+
// Delete oldest consumed events that exceed the per-type limit.
|
|
147
|
+
const result = db.prepare(`DELETE FROM stream_buffers
|
|
148
|
+
WHERE consumed = 1 AND id NOT IN (
|
|
149
|
+
SELECT id FROM stream_buffers
|
|
150
|
+
WHERE stream_type = (SELECT stream_type FROM stream_buffers s2 WHERE s2.id = stream_buffers.id)
|
|
151
|
+
ORDER BY id DESC LIMIT ?
|
|
152
|
+
)`).run(maxPerType);
|
|
153
|
+
return result.changes;
|
|
154
|
+
}
|
|
155
|
+
catch {
|
|
156
|
+
return 0;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* @name clear
|
|
161
|
+
* @description Clears all events for a stream type.
|
|
162
|
+
*/
|
|
163
|
+
clear(streamType) {
|
|
164
|
+
if (memoryDatabase.isDegraded())
|
|
165
|
+
return 0;
|
|
166
|
+
memoryDatabase.init();
|
|
167
|
+
const db = memoryDatabase.getDb();
|
|
168
|
+
try {
|
|
169
|
+
const result = db.prepare('DELETE FROM stream_buffers WHERE stream_type = ?').run(streamType);
|
|
170
|
+
return result.changes;
|
|
171
|
+
}
|
|
172
|
+
catch {
|
|
173
|
+
return 0;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* @name streamBufferStore
|
|
179
|
+
* @description Singleton instance of the stream buffer store.
|
|
180
|
+
*/
|
|
181
|
+
export const streamBufferStore = new StreamBufferStore();
|
|
182
|
+
//# sourceMappingURL=stream-buffer-store.js.map
|
|
@@ -0,0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YAClB,OAAO,MAAM,CAAC,OAAO,CAAC;QACxB,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,CAAC,CAAC;QACX,CAAC;IACH,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,iBAAiB,EAAE,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module memory/tool-call-store
|
|
3
|
+
* @description Store for recording and searching tool call history.
|
|
4
|
+
*
|
|
5
|
+
* All methods are synchronous (better-sqlite3 is synchronous). FTS5 search
|
|
6
|
+
* returns relevance-ranked results using the inverted index.
|
|
7
|
+
*/
|
|
8
|
+
import type { ToolCallRecord, ToolCallOutcome, MemorySearchResult, MemoryQueryOptions } from './types.js';
|
|
9
|
+
/**
|
|
10
|
+
* @name ToolCallStore
|
|
11
|
+
* @description Records and queries tool call execution history.
|
|
12
|
+
*
|
|
13
|
+
* Every tool call (paid or free) is recorded with its input, output, outcome,
|
|
14
|
+
* cost, and latency. The FTS5 index enables full-text search across all
|
|
15
|
+
* recorded calls for pattern detection and failure analysis.
|
|
16
|
+
*/
|
|
17
|
+
export declare class ToolCallStore {
|
|
18
|
+
/**
|
|
19
|
+
* @name record
|
|
20
|
+
* @description Records a tool call execution in the memory database.
|
|
21
|
+
* @param record - Tool call data to record.
|
|
22
|
+
* @returns The auto-incremented ID of the inserted record, or -1 if degraded.
|
|
23
|
+
*/
|
|
24
|
+
record(record: Omit<ToolCallRecord, 'id' | 'createdAt' | 'updatedAt'>): number;
|
|
25
|
+
/**
|
|
26
|
+
* @name search
|
|
27
|
+
* @description Full-text search across tool call history using FTS5.
|
|
28
|
+
* @param options - Search options including query, filters, and pagination.
|
|
29
|
+
* @returns Search results with relevance ranking.
|
|
30
|
+
*/
|
|
31
|
+
search(options: MemoryQueryOptions): MemorySearchResult<ToolCallRecord>;
|
|
32
|
+
/**
|
|
33
|
+
* @name count
|
|
34
|
+
* @description Returns the total number of tool call records.
|
|
35
|
+
*/
|
|
36
|
+
count(): number;
|
|
37
|
+
/**
|
|
38
|
+
* @name outcomeBreakdown
|
|
39
|
+
* @description Returns counts grouped by outcome.
|
|
40
|
+
*/
|
|
41
|
+
outcomeBreakdown(): Record<ToolCallOutcome, number>;
|
|
42
|
+
/**
|
|
43
|
+
* @name lastToolCallAt
|
|
44
|
+
* @description Returns the timestamp of the most recent tool call.
|
|
45
|
+
*/
|
|
46
|
+
lastToolCallAt(): string | null;
|
|
47
|
+
/**
|
|
48
|
+
* @name archive
|
|
49
|
+
* @description Archives tool call records older than the retention period.
|
|
50
|
+
* @param retentionDays - Number of days to keep records. Default 90.
|
|
51
|
+
* @returns Number of records archived.
|
|
52
|
+
*/
|
|
53
|
+
archive(retentionDays?: number): number;
|
|
54
|
+
/**
|
|
55
|
+
* @name buildFtsQuery
|
|
56
|
+
* @description Converts a natural language query into a FTS5 MATCH expression.
|
|
57
|
+
* Handles multi-word queries by quoting phrases and prefixing with OR for
|
|
58
|
+
* broader recall.
|
|
59
|
+
* @internal
|
|
60
|
+
*/
|
|
61
|
+
private buildFtsQuery;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* @name toolCallStore
|
|
65
|
+
* @description Singleton instance of the tool call store.
|
|
66
|
+
*/
|
|
67
|
+
export declare const toolCallStore: ToolCallStore;
|
|
68
|
+
//# sourceMappingURL=tool-call-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-call-store.d.ts","sourceRoot":"","sources":["../../src/memory/tool-call-store.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAE1G;;;;;;;GAOG;AACH,qBAAa,aAAa;IACxB;;;;;OAKG;IACH,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,cAAc,EAAE,IAAI,GAAG,WAAW,GAAG,WAAW,CAAC,GAAG,MAAM;IAwB9E;;;;;OAKG;IACH,MAAM,CAAC,OAAO,EAAE,kBAAkB,GAAG,kBAAkB,CAAC,cAAc,CAAC;IA6DvE;;;OAGG;IACH,KAAK,IAAI,MAAM;IAQf;;;OAGG;IACH,gBAAgB,IAAI,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC;IAgBnD;;;OAGG;IACH,cAAc,IAAI,MAAM,GAAG,IAAI;IAS/B;;;;;OAKG;IACH,OAAO,CAAC,aAAa,SAAK,GAAG,MAAM;IAUnC;;;;;;OAMG;IACH,OAAO,CAAC,aAAa;CAUtB;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa,eAAsB,CAAC"}
|