open-mem 0.2.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/CHANGELOG.md +38 -0
- package/LICENSE +21 -0
- package/README.md +309 -0
- package/dist/ai/compressor.d.ts +43 -0
- package/dist/ai/compressor.d.ts.map +1 -0
- package/dist/ai/parser.d.ts +35 -0
- package/dist/ai/parser.d.ts.map +1 -0
- package/dist/ai/prompts.d.ts +15 -0
- package/dist/ai/prompts.d.ts.map +1 -0
- package/dist/ai/summarizer.d.ts +30 -0
- package/dist/ai/summarizer.d.ts.map +1 -0
- package/dist/config.d.ts +16 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/context/builder.d.ts +11 -0
- package/dist/context/builder.d.ts.map +1 -0
- package/dist/context/progressive.d.ts +13 -0
- package/dist/context/progressive.d.ts.map +1 -0
- package/dist/db/database.d.ts +45 -0
- package/dist/db/database.d.ts.map +1 -0
- package/dist/db/observations.d.ts +17 -0
- package/dist/db/observations.d.ts.map +1 -0
- package/dist/db/pending.d.ts +20 -0
- package/dist/db/pending.d.ts.map +1 -0
- package/dist/db/schema.d.ts +13 -0
- package/dist/db/schema.d.ts.map +1 -0
- package/dist/db/sessions.d.ts +17 -0
- package/dist/db/sessions.d.ts.map +1 -0
- package/dist/db/summaries.d.ts +12 -0
- package/dist/db/summaries.d.ts.map +1 -0
- package/dist/hooks/compaction.d.ts +19 -0
- package/dist/hooks/compaction.d.ts.map +1 -0
- package/dist/hooks/context-inject.d.ts +19 -0
- package/dist/hooks/context-inject.d.ts.map +1 -0
- package/dist/hooks/session-events.d.ts +18 -0
- package/dist/hooks/session-events.d.ts.map +1 -0
- package/dist/hooks/tool-capture.d.ts +25 -0
- package/dist/hooks/tool-capture.d.ts.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +361 -0
- package/dist/queue/processor.d.ts +52 -0
- package/dist/queue/processor.d.ts.map +1 -0
- package/dist/tools/recall.d.ts +4 -0
- package/dist/tools/recall.d.ts.map +1 -0
- package/dist/tools/save.d.ts +5 -0
- package/dist/tools/save.d.ts.map +1 -0
- package/dist/tools/search.d.ts +5 -0
- package/dist/tools/search.d.ts.map +1 -0
- package/dist/tools/timeline.d.ts +6 -0
- package/dist/tools/timeline.d.ts.map +1 -0
- package/dist/types.d.ts +177 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +60 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { ObservationCompressor } from "../ai/compressor";
|
|
2
|
+
import type { SessionSummarizer } from "../ai/summarizer";
|
|
3
|
+
import type { ObservationRepository } from "../db/observations";
|
|
4
|
+
import type { PendingMessageRepository } from "../db/pending";
|
|
5
|
+
import type { SessionRepository } from "../db/sessions";
|
|
6
|
+
import type { SummaryRepository } from "../db/summaries";
|
|
7
|
+
export interface QueueProcessorConfig {
|
|
8
|
+
batchSize: number;
|
|
9
|
+
batchIntervalMs: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Orchestrates asynchronous observation processing:
|
|
13
|
+
* 1. Dequeues pending tool outputs from SQLite
|
|
14
|
+
* 2. Compresses them via the AI compressor (or falls back)
|
|
15
|
+
* 3. Stores resulting observations
|
|
16
|
+
* 4. Optionally summarizes completed sessions
|
|
17
|
+
*
|
|
18
|
+
* Processing can be triggered by `session.idle` events or a periodic timer.
|
|
19
|
+
*/
|
|
20
|
+
export declare class QueueProcessor {
|
|
21
|
+
private config;
|
|
22
|
+
private compressor;
|
|
23
|
+
private summarizer;
|
|
24
|
+
private pendingRepo;
|
|
25
|
+
private observationRepo;
|
|
26
|
+
private sessionRepo;
|
|
27
|
+
private summaryRepo;
|
|
28
|
+
private processing;
|
|
29
|
+
private timer;
|
|
30
|
+
constructor(config: QueueProcessorConfig, compressor: ObservationCompressor, summarizer: SessionSummarizer, pendingRepo: PendingMessageRepository, observationRepo: ObservationRepository, sessionRepo: SessionRepository, summaryRepo: SummaryRepository);
|
|
31
|
+
/** Add a new pending message to the queue */
|
|
32
|
+
enqueue(sessionId: string, toolName: string, toolOutput: string, callId: string): void;
|
|
33
|
+
/**
|
|
34
|
+
* Process up to `batchSize` pending messages. Returns the number
|
|
35
|
+
* of items successfully processed. Concurrent calls are serialized
|
|
36
|
+
* via a simple `processing` flag.
|
|
37
|
+
*/
|
|
38
|
+
processBatch(): Promise<number>;
|
|
39
|
+
/** Generate and store a summary for the given session */
|
|
40
|
+
summarizeSession(sessionId: string): Promise<void>;
|
|
41
|
+
/** Start periodic batch processing */
|
|
42
|
+
start(): void;
|
|
43
|
+
/** Stop the periodic timer */
|
|
44
|
+
stop(): void;
|
|
45
|
+
get isRunning(): boolean;
|
|
46
|
+
get isProcessing(): boolean;
|
|
47
|
+
getStats(): {
|
|
48
|
+
pending: number;
|
|
49
|
+
processing: boolean;
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=processor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processor.d.ts","sourceRoot":"","sources":["../../src/queue/processor.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAE9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAMzD,MAAM,WAAW,oBAAoB;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;CACxB;AAMD;;;;;;;;GAQG;AACH,qBAAa,cAAc;IAKzB,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,UAAU;IAClB,O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ObservationRepository } from "../db/observations";
|
|
2
|
+
import type { SessionRepository } from "../db/sessions";
|
|
3
|
+
import type { ToolDefinition } from "../types";
|
|
4
|
+
export declare function createSaveTool(observations: ObservationRepository, sessions: SessionRepository, projectPath: string): ToolDefinition;
|
|
5
|
+
//# sourceMappingURL=save.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"save.d.ts","sourceRoot":"","sources":["../../src/tools/save.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAmB,cAAc,EAAE,MAAM,UAAU,CAAC;AAEhE,wBAAgB,cAAc,CAC7B,YAAY,EAAE,qBAAqB,EACnC,QAAQ,EAAE,iBAAiB,EAC3B,WAAW,EAAE,MAAM,GACjB,cAAc,CAgDhB"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ObservationRepository } from "../db/observations";
|
|
2
|
+
import type { SummaryRepository } from "../db/summaries";
|
|
3
|
+
import type { ToolDefinition } from "../types";
|
|
4
|
+
export declare function createSearchTool(observations: ObservationRepository, summaries: SummaryRepository): ToolDefinition;
|
|
5
|
+
//# sourceMappingURL=search.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/tools/search.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAgC,cAAc,EAAE,MAAM,UAAU,CAAC;AAE7E,wBAAgB,gBAAgB,CAC/B,YAAY,EAAE,qBAAqB,EACnC,SAAS,EAAE,iBAAiB,GAC1B,cAAc,CA8ChB"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ObservationRepository } from "../db/observations";
|
|
2
|
+
import type { SessionRepository } from "../db/sessions";
|
|
3
|
+
import type { SummaryRepository } from "../db/summaries";
|
|
4
|
+
import type { ToolDefinition } from "../types";
|
|
5
|
+
export declare function createTimelineTool(sessions: SessionRepository, summaries: SummaryRepository, observations: ObservationRepository, projectPath: string): ToolDefinition;
|
|
6
|
+
//# sourceMappingURL=timeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline.d.ts","sourceRoot":"","sources":["../../src/tools/timeline.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,wBAAgB,kBAAkB,CACjC,QAAQ,EAAE,iBAAiB,EAC3B,SAAS,EAAE,iBAAiB,EAC5B,YAAY,EAAE,qBAAqB,EACnC,WAAW,EAAE,MAAM,GACjB,cAAc,CAiDhB"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/** Observation types matching claude-mem's schema */
|
|
2
|
+
export type ObservationType = "decision" | "bugfix" | "feature" | "refactor" | "discovery" | "change";
|
|
3
|
+
/** Full observation record stored in the database */
|
|
4
|
+
export interface Observation {
|
|
5
|
+
id: string;
|
|
6
|
+
sessionId: string;
|
|
7
|
+
type: ObservationType;
|
|
8
|
+
title: string;
|
|
9
|
+
subtitle: string;
|
|
10
|
+
facts: string[];
|
|
11
|
+
narrative: string;
|
|
12
|
+
concepts: string[];
|
|
13
|
+
filesRead: string[];
|
|
14
|
+
filesModified: string[];
|
|
15
|
+
rawToolOutput: string;
|
|
16
|
+
toolName: string;
|
|
17
|
+
createdAt: string;
|
|
18
|
+
tokenCount: number;
|
|
19
|
+
}
|
|
20
|
+
/** Lightweight index entry for progressive disclosure */
|
|
21
|
+
export interface ObservationIndex {
|
|
22
|
+
id: string;
|
|
23
|
+
sessionId: string;
|
|
24
|
+
type: ObservationType;
|
|
25
|
+
title: string;
|
|
26
|
+
tokenCount: number;
|
|
27
|
+
createdAt: string;
|
|
28
|
+
}
|
|
29
|
+
export interface Session {
|
|
30
|
+
id: string;
|
|
31
|
+
projectPath: string;
|
|
32
|
+
startedAt: string;
|
|
33
|
+
endedAt: string | null;
|
|
34
|
+
status: "active" | "idle" | "completed";
|
|
35
|
+
observationCount: number;
|
|
36
|
+
summaryId: string | null;
|
|
37
|
+
}
|
|
38
|
+
export interface SessionSummary {
|
|
39
|
+
id: string;
|
|
40
|
+
sessionId: string;
|
|
41
|
+
summary: string;
|
|
42
|
+
keyDecisions: string[];
|
|
43
|
+
filesModified: string[];
|
|
44
|
+
concepts: string[];
|
|
45
|
+
createdAt: string;
|
|
46
|
+
tokenCount: number;
|
|
47
|
+
request?: string;
|
|
48
|
+
investigated?: string;
|
|
49
|
+
learned?: string;
|
|
50
|
+
completed?: string;
|
|
51
|
+
nextSteps?: string;
|
|
52
|
+
}
|
|
53
|
+
export interface PendingMessage {
|
|
54
|
+
id: string;
|
|
55
|
+
sessionId: string;
|
|
56
|
+
toolName: string;
|
|
57
|
+
toolOutput: string;
|
|
58
|
+
callId: string;
|
|
59
|
+
createdAt: string;
|
|
60
|
+
status: "pending" | "processing" | "completed" | "failed";
|
|
61
|
+
retryCount: number;
|
|
62
|
+
error: string | null;
|
|
63
|
+
}
|
|
64
|
+
export type QueueItem = {
|
|
65
|
+
type: "compress";
|
|
66
|
+
pendingMessageId: string;
|
|
67
|
+
sessionId: string;
|
|
68
|
+
toolName: string;
|
|
69
|
+
toolOutput: string;
|
|
70
|
+
callId: string;
|
|
71
|
+
} | {
|
|
72
|
+
type: "summarize";
|
|
73
|
+
sessionId: string;
|
|
74
|
+
};
|
|
75
|
+
export interface OpenMemConfig {
|
|
76
|
+
dbPath: string;
|
|
77
|
+
apiKey: string | undefined;
|
|
78
|
+
model: string;
|
|
79
|
+
maxTokensPerCompression: number;
|
|
80
|
+
compressionEnabled: boolean;
|
|
81
|
+
contextInjectionEnabled: boolean;
|
|
82
|
+
maxContextTokens: number;
|
|
83
|
+
batchSize: number;
|
|
84
|
+
batchIntervalMs: number;
|
|
85
|
+
ignoredTools: string[];
|
|
86
|
+
minOutputLength: number;
|
|
87
|
+
maxIndexEntries: number;
|
|
88
|
+
sensitivePatterns: string[];
|
|
89
|
+
retentionDays: number;
|
|
90
|
+
maxDatabaseSizeMb: number;
|
|
91
|
+
logLevel: "debug" | "info" | "warn" | "error";
|
|
92
|
+
contextShowTokenCosts: boolean;
|
|
93
|
+
contextObservationTypes: ObservationType[] | "all";
|
|
94
|
+
contextFullObservationCount: number;
|
|
95
|
+
maxObservations: number;
|
|
96
|
+
contextShowLastSummary: boolean;
|
|
97
|
+
}
|
|
98
|
+
/** OpenCode plugin input shape */
|
|
99
|
+
export interface PluginInput {
|
|
100
|
+
client: unknown;
|
|
101
|
+
project: string;
|
|
102
|
+
directory: string;
|
|
103
|
+
worktree: string;
|
|
104
|
+
serverUrl: string;
|
|
105
|
+
$: unknown;
|
|
106
|
+
}
|
|
107
|
+
/** OpenCode hook definitions */
|
|
108
|
+
export interface Hooks {
|
|
109
|
+
"tool.execute.after"?: (input: {
|
|
110
|
+
tool: string;
|
|
111
|
+
sessionID: string;
|
|
112
|
+
callID: string;
|
|
113
|
+
}, output: {
|
|
114
|
+
title: string;
|
|
115
|
+
output: string;
|
|
116
|
+
metadata: Record<string, unknown>;
|
|
117
|
+
}) => Promise<void>;
|
|
118
|
+
"chat.message"?: (input: {
|
|
119
|
+
sessionID: string;
|
|
120
|
+
agent?: string;
|
|
121
|
+
model?: string;
|
|
122
|
+
messageID?: string;
|
|
123
|
+
}, output: {
|
|
124
|
+
message: unknown;
|
|
125
|
+
parts: unknown[];
|
|
126
|
+
}) => Promise<void>;
|
|
127
|
+
"experimental.chat.system.transform"?: (input: {
|
|
128
|
+
sessionID?: string;
|
|
129
|
+
model: string;
|
|
130
|
+
}, output: {
|
|
131
|
+
system: string[];
|
|
132
|
+
}) => Promise<void>;
|
|
133
|
+
"experimental.session.compacting"?: (input: {
|
|
134
|
+
sessionID: string;
|
|
135
|
+
}, output: {
|
|
136
|
+
context: string[];
|
|
137
|
+
prompt?: string;
|
|
138
|
+
}) => Promise<void>;
|
|
139
|
+
event?: (input: {
|
|
140
|
+
event: OpenCodeEvent;
|
|
141
|
+
}) => Promise<void>;
|
|
142
|
+
tools?: ToolDefinition[];
|
|
143
|
+
}
|
|
144
|
+
export interface OpenCodeEvent {
|
|
145
|
+
type: string;
|
|
146
|
+
properties: Record<string, unknown>;
|
|
147
|
+
}
|
|
148
|
+
export interface ToolDefinition {
|
|
149
|
+
name: string;
|
|
150
|
+
description: string;
|
|
151
|
+
args: Record<string, unknown>;
|
|
152
|
+
execute: (args: Record<string, unknown>, context: ToolContext) => Promise<string>;
|
|
153
|
+
}
|
|
154
|
+
export interface ToolContext {
|
|
155
|
+
sessionID: string;
|
|
156
|
+
abort: AbortSignal;
|
|
157
|
+
}
|
|
158
|
+
/** Plugin type — entry point for OpenCode plugins */
|
|
159
|
+
export type Plugin = (input: PluginInput) => Promise<Hooks>;
|
|
160
|
+
export interface SearchQuery {
|
|
161
|
+
query: string;
|
|
162
|
+
sessionId?: string;
|
|
163
|
+
type?: ObservationType;
|
|
164
|
+
limit?: number;
|
|
165
|
+
offset?: number;
|
|
166
|
+
}
|
|
167
|
+
export interface SearchResult {
|
|
168
|
+
observation: Observation;
|
|
169
|
+
rank: number;
|
|
170
|
+
snippet: string;
|
|
171
|
+
}
|
|
172
|
+
export interface TimelineEntry {
|
|
173
|
+
session: Session;
|
|
174
|
+
summary: SessionSummary | null;
|
|
175
|
+
observationCount: number;
|
|
176
|
+
}
|
|
177
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@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E,OAAO,EAAE,WAAW,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CAClF;AAED,MAAM,WAAW,WAAW;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,WAAW,CAAC;CACnB;AAED,qDAAqD;AACrD,MAAM,MAAM,MAAM,GAAG,CAAC,KAAK,EAAE,WAAW,KAAK,OAAO,CAAC,KAAK,CAAC,CAAC;AAM5D,MAAM,WAAW,WAAW;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,YAAY;IAC5B,WAAW,EAAE,WAAW,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,aAAa;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,cAAc,GAAG,IAAI,CAAC;IAC/B,gBAAgB,EAAE,MAAM,CAAC;CACzB"}
|
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "open-mem",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Persistent memory plugin for OpenCode — captures, compresses, and recalls context across coding sessions",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"module": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": ["dist", "README.md", "LICENSE", "CHANGELOG.md"],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "bun run build:bundle && bun run build:types",
|
|
18
|
+
"build:bundle": "bun build src/index.ts --outdir dist --target bun --format esm --minify --external bun:sqlite",
|
|
19
|
+
"build:types": "bun x tsc --declaration --emitDeclarationOnly --outDir dist",
|
|
20
|
+
"dev": "bun run --watch src/index.ts",
|
|
21
|
+
"test": "bun test",
|
|
22
|
+
"typecheck": "bun x tsc --noEmit",
|
|
23
|
+
"lint": "bun x biome check src/",
|
|
24
|
+
"clean": "rm -rf dist",
|
|
25
|
+
"prepare": "test -d src && bun run build || true",
|
|
26
|
+
"prepublishOnly": "bun run build && bun test"
|
|
27
|
+
},
|
|
28
|
+
"keywords": [
|
|
29
|
+
"opencode",
|
|
30
|
+
"plugin",
|
|
31
|
+
"memory",
|
|
32
|
+
"ai",
|
|
33
|
+
"sqlite",
|
|
34
|
+
"fts5",
|
|
35
|
+
"context",
|
|
36
|
+
"persistent-memory",
|
|
37
|
+
"coding-assistant"
|
|
38
|
+
],
|
|
39
|
+
"license": "MIT",
|
|
40
|
+
"repository": {
|
|
41
|
+
"type": "git",
|
|
42
|
+
"url": "https://github.com/clopca/open-mem"
|
|
43
|
+
},
|
|
44
|
+
"bugs": {
|
|
45
|
+
"url": "https://github.com/clopca/open-mem/issues"
|
|
46
|
+
},
|
|
47
|
+
"homepage": "https://github.com/clopca/open-mem#readme",
|
|
48
|
+
"engines": {
|
|
49
|
+
"bun": ">=1.0.0"
|
|
50
|
+
},
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"@anthropic-ai/sdk": "^0.39.0",
|
|
53
|
+
"zod": "^3.24.0"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@types/bun": "latest",
|
|
57
|
+
"typescript": "^5.7.0",
|
|
58
|
+
"@biomejs/biome": "^1.9.0"
|
|
59
|
+
}
|
|
60
|
+
}
|