opencode-supermemory 0.1.1 → 0.1.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.
- package/README.md +94 -27
- package/dist/cli.js +159 -106
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +82 -49
- package/dist/services/client.d.ts +65 -7
- package/dist/services/client.d.ts.map +1 -1
- package/dist/services/compaction.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,45 +2,123 @@
|
|
|
2
2
|
|
|
3
3
|
OpenCode plugin for persistent memory using [Supermemory](https://supermemory.ai).
|
|
4
4
|
|
|
5
|
+
Your agent remembers what you tell it - across sessions, across projects.
|
|
6
|
+
|
|
5
7
|
## Installation
|
|
6
8
|
|
|
9
|
+
### For Humans
|
|
10
|
+
|
|
7
11
|
```bash
|
|
8
|
-
|
|
12
|
+
bunx opencode-supermemory@latest install
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Then get your API key from [console.supermemory.ai](https://console.supermemory.ai) and set it:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
export SUPERMEMORY_API_KEY="sm_..."
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
**Or let your agent do it** - paste this into OpenCode:
|
|
22
|
+
```
|
|
23
|
+
Install opencode-supermemory by following https://raw.githubusercontent.com/supermemoryai/opencode-supermemory/main/README.md
|
|
9
24
|
```
|
|
10
25
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
26
|
+
### For LLM Agents
|
|
27
|
+
|
|
28
|
+
<details>
|
|
29
|
+
<summary>Instructions for LLM Agents (click to expand)</summary>
|
|
30
|
+
|
|
31
|
+
If you're an LLM agent helping set up opencode-supermemory, follow these steps:
|
|
15
32
|
|
|
16
|
-
|
|
33
|
+
#### Step 1: Run the installer
|
|
17
34
|
|
|
18
35
|
```bash
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
36
|
+
bunx opencode-supermemory@latest install --no-tui
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
This will:
|
|
40
|
+
- Register the plugin in `~/.config/opencode/opencode.jsonc`
|
|
41
|
+
- Create the `/supermemory-init` command
|
|
42
|
+
|
|
43
|
+
#### Step 2: Verify the config
|
|
22
44
|
|
|
23
|
-
|
|
24
|
-
|
|
45
|
+
```bash
|
|
46
|
+
cat ~/.config/opencode/opencode.jsonc
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Should contain:
|
|
50
|
+
```json
|
|
51
|
+
{
|
|
52
|
+
"plugin": ["opencode-supermemory"]
|
|
53
|
+
}
|
|
25
54
|
```
|
|
26
55
|
|
|
27
|
-
|
|
56
|
+
If not, add it manually:
|
|
28
57
|
|
|
58
|
+
**JSONC:**
|
|
59
|
+
```jsonc
|
|
60
|
+
{
|
|
61
|
+
"plugin": [
|
|
62
|
+
"opencode-supermemory"
|
|
63
|
+
// ... other plugins
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**JSON:**
|
|
29
69
|
```json
|
|
30
70
|
{
|
|
31
71
|
"plugin": ["opencode-supermemory"]
|
|
32
72
|
}
|
|
33
73
|
```
|
|
34
74
|
|
|
75
|
+
#### Step 3: Configure API key
|
|
76
|
+
|
|
77
|
+
Ask the user to get their API key from [console.supermemory.ai](https://console.supermemory.ai).
|
|
78
|
+
|
|
79
|
+
Then set it via environment variable:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
export SUPERMEMORY_API_KEY="sm_..."
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Or create `~/.config/opencode/supermemory.jsonc`:
|
|
86
|
+
|
|
87
|
+
```jsonc
|
|
88
|
+
{
|
|
89
|
+
"apiKey": "sm_..."
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
#### Step 4: Verify setup
|
|
94
|
+
|
|
95
|
+
Tell the user to restart OpenCode and run:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
opencode -c
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
They should see `supermemory` in the tools list. If not, check:
|
|
102
|
+
1. Is `SUPERMEMORY_API_KEY` set?
|
|
103
|
+
2. Is the plugin in `opencode.jsonc`?
|
|
104
|
+
3. Check logs: `tail ~/.opencode-supermemory.log`
|
|
105
|
+
|
|
106
|
+
#### Step 5: Initialize codebase memory (optional)
|
|
107
|
+
|
|
108
|
+
Run `/supermemory-init` to have the agent explore and memorize the codebase.
|
|
109
|
+
|
|
110
|
+
</details>
|
|
111
|
+
|
|
35
112
|
## Features
|
|
36
113
|
|
|
37
114
|
### Context Injection
|
|
38
115
|
|
|
39
|
-
On first message,
|
|
116
|
+
On first message, the agent receives (invisible to user):
|
|
40
117
|
- User profile (cross-project preferences)
|
|
41
118
|
- Project memories (all project knowledge)
|
|
42
119
|
- Relevant user memories (semantic search)
|
|
43
120
|
|
|
121
|
+
Example of what the agent sees:
|
|
44
122
|
```
|
|
45
123
|
[SUPERMEMORY]
|
|
46
124
|
|
|
@@ -56,6 +134,8 @@ Relevant Memories:
|
|
|
56
134
|
- [82%] Build fails if .env.local missing
|
|
57
135
|
```
|
|
58
136
|
|
|
137
|
+
The agent uses this context automatically - no manual prompting needed.
|
|
138
|
+
|
|
59
139
|
### Keyword Detection
|
|
60
140
|
|
|
61
141
|
Say "remember", "save this", "don't forget" etc. and the agent auto-saves to memory.
|
|
@@ -134,17 +214,12 @@ Create `~/.config/opencode/supermemory.jsonc`:
|
|
|
134
214
|
"injectProfile": true,
|
|
135
215
|
|
|
136
216
|
// Prefix for container tags
|
|
137
|
-
"containerTagPrefix": "opencode"
|
|
138
|
-
|
|
139
|
-
// LLM filter prompt for memory relevance
|
|
140
|
-
"filterPrompt": "You are a stateful coding agent. Remember all the information, including but not limited to user's coding preferences, tech stack, behaviours, workflows, and any other relevant details."
|
|
217
|
+
"containerTagPrefix": "opencode"
|
|
141
218
|
}
|
|
142
219
|
```
|
|
143
220
|
|
|
144
221
|
All fields optional. Env var `SUPERMEMORY_API_KEY` takes precedence over config file.
|
|
145
222
|
|
|
146
|
-
API timeout: 30s
|
|
147
|
-
|
|
148
223
|
## Usage with Oh My OpenCode
|
|
149
224
|
|
|
150
225
|
If you're using [Oh My OpenCode](https://github.com/code-yeongyu/oh-my-opencode), disable its built-in auto-compact hook to let supermemory handle context compaction:
|
|
@@ -157,14 +232,6 @@ Add to `~/.config/opencode/oh-my-opencode.json`:
|
|
|
157
232
|
}
|
|
158
233
|
```
|
|
159
234
|
|
|
160
|
-
This ensures supermemory's preemptive compaction (which preserves memories across sessions) works correctly instead of oh-my-opencode's default compaction.
|
|
161
|
-
|
|
162
|
-
## Hooks
|
|
163
|
-
|
|
164
|
-
Registered in `package.json`:
|
|
165
|
-
- `chat.message` - Context injection on first message, keyword detection
|
|
166
|
-
- `event` - Compaction monitoring and summary capture
|
|
167
|
-
|
|
168
235
|
## Development
|
|
169
236
|
|
|
170
237
|
```bash
|
package/dist/cli.js
CHANGED
|
@@ -1,22 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { createRequire } from "node:module";
|
|
3
|
-
var __create = Object.create;
|
|
4
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
5
|
-
var __defProp = Object.defineProperty;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __toESM = (mod, isNodeMode, target) => {
|
|
9
|
-
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
10
|
-
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
11
|
-
for (let key of __getOwnPropNames(mod))
|
|
12
|
-
if (!__hasOwnProp.call(to, key))
|
|
13
|
-
__defProp(to, key, {
|
|
14
|
-
get: () => mod[key],
|
|
15
|
-
enumerable: true
|
|
16
|
-
});
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
20
2
|
|
|
21
3
|
// src/cli.ts
|
|
22
4
|
import { mkdirSync, writeFileSync, readFileSync, existsSync } from "node:fs";
|
|
@@ -25,6 +7,7 @@ import { homedir } from "node:os";
|
|
|
25
7
|
import * as readline from "node:readline";
|
|
26
8
|
var OPENCODE_CONFIG_DIR = join(homedir(), ".config", "opencode");
|
|
27
9
|
var OPENCODE_COMMAND_DIR = join(OPENCODE_CONFIG_DIR, "command");
|
|
10
|
+
var OH_MY_OPENCODE_CONFIG = join(OPENCODE_CONFIG_DIR, "oh-my-opencode.json");
|
|
28
11
|
var PLUGIN_NAME = "opencode-supermemory@latest";
|
|
29
12
|
var SUPERMEMORY_INIT_COMMAND = `---
|
|
30
13
|
description: Initialize Supermemory with comprehensive codebase knowledge
|
|
@@ -190,42 +173,10 @@ async function confirm(rl, question) {
|
|
|
190
173
|
});
|
|
191
174
|
});
|
|
192
175
|
}
|
|
193
|
-
async function installPlugin() {
|
|
194
|
-
const { execSync } = await import("node:child_process");
|
|
195
|
-
let pm = "npm";
|
|
196
|
-
try {
|
|
197
|
-
execSync("bun --version", { stdio: "ignore" });
|
|
198
|
-
pm = "bun";
|
|
199
|
-
} catch {
|
|
200
|
-
try {
|
|
201
|
-
execSync("pnpm --version", { stdio: "ignore" });
|
|
202
|
-
pm = "pnpm";
|
|
203
|
-
} catch {}
|
|
204
|
-
}
|
|
205
|
-
console.log(`Installing ${PLUGIN_NAME} with ${pm}...`);
|
|
206
|
-
try {
|
|
207
|
-
execSync(`${pm} install -g ${PLUGIN_NAME}`, { stdio: "inherit" });
|
|
208
|
-
return true;
|
|
209
|
-
} catch {
|
|
210
|
-
console.error("Failed to install plugin globally.");
|
|
211
|
-
return false;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
function createCommand() {
|
|
215
|
-
mkdirSync(OPENCODE_COMMAND_DIR, { recursive: true });
|
|
216
|
-
const commandPath = join(OPENCODE_COMMAND_DIR, "supermemory-init.md");
|
|
217
|
-
if (existsSync(commandPath)) {
|
|
218
|
-
console.log(`Command already exists at ${commandPath}`);
|
|
219
|
-
return true;
|
|
220
|
-
}
|
|
221
|
-
writeFileSync(commandPath, SUPERMEMORY_INIT_COMMAND);
|
|
222
|
-
console.log(`Created /supermemory-init command`);
|
|
223
|
-
return true;
|
|
224
|
-
}
|
|
225
176
|
function findOpencodeConfig() {
|
|
226
177
|
const candidates = [
|
|
227
|
-
join(OPENCODE_CONFIG_DIR, "
|
|
228
|
-
join(OPENCODE_CONFIG_DIR, "
|
|
178
|
+
join(OPENCODE_CONFIG_DIR, "opencode.jsonc"),
|
|
179
|
+
join(OPENCODE_CONFIG_DIR, "opencode.json")
|
|
229
180
|
];
|
|
230
181
|
for (const path of candidates) {
|
|
231
182
|
if (existsSync(path)) {
|
|
@@ -238,7 +189,7 @@ function addPluginToConfig(configPath) {
|
|
|
238
189
|
try {
|
|
239
190
|
const content = readFileSync(configPath, "utf-8");
|
|
240
191
|
if (content.includes("opencode-supermemory")) {
|
|
241
|
-
console.log("Plugin already in config");
|
|
192
|
+
console.log("✓ Plugin already registered in config");
|
|
242
193
|
return true;
|
|
243
194
|
}
|
|
244
195
|
const jsonContent = content.replace(/\/\/.*$/gm, "").replace(/\/\*[\s\S]*?\*\//g, "");
|
|
@@ -246,7 +197,7 @@ function addPluginToConfig(configPath) {
|
|
|
246
197
|
try {
|
|
247
198
|
config = JSON.parse(jsonContent);
|
|
248
199
|
} catch {
|
|
249
|
-
console.error("Failed to parse config file");
|
|
200
|
+
console.error("✗ Failed to parse config file");
|
|
250
201
|
return false;
|
|
251
202
|
}
|
|
252
203
|
const plugins = config.plugin || [];
|
|
@@ -274,91 +225,193 @@ function addPluginToConfig(configPath) {
|
|
|
274
225
|
} else {
|
|
275
226
|
writeFileSync(configPath, JSON.stringify(config, null, 2));
|
|
276
227
|
}
|
|
277
|
-
console.log(
|
|
228
|
+
console.log(`✓ Added plugin to ${configPath}`);
|
|
278
229
|
return true;
|
|
279
230
|
} catch (err) {
|
|
280
|
-
console.error("Failed to update config:", err);
|
|
231
|
+
console.error("✗ Failed to update config:", err);
|
|
281
232
|
return false;
|
|
282
233
|
}
|
|
283
234
|
}
|
|
284
235
|
function createNewConfig() {
|
|
285
|
-
const configPath = join(OPENCODE_CONFIG_DIR, "
|
|
236
|
+
const configPath = join(OPENCODE_CONFIG_DIR, "opencode.jsonc");
|
|
286
237
|
mkdirSync(OPENCODE_CONFIG_DIR, { recursive: true });
|
|
287
|
-
const config = {
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
238
|
+
const config = `{
|
|
239
|
+
"plugin": ["${PLUGIN_NAME}"]
|
|
240
|
+
}
|
|
241
|
+
`;
|
|
242
|
+
writeFileSync(configPath, config);
|
|
243
|
+
console.log(`✓ Created ${configPath}`);
|
|
292
244
|
return true;
|
|
293
245
|
}
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
`);
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
246
|
+
function createCommand() {
|
|
247
|
+
mkdirSync(OPENCODE_COMMAND_DIR, { recursive: true });
|
|
248
|
+
const commandPath = join(OPENCODE_COMMAND_DIR, "supermemory-init.md");
|
|
249
|
+
writeFileSync(commandPath, SUPERMEMORY_INIT_COMMAND);
|
|
250
|
+
console.log(`✓ Created /supermemory-init command`);
|
|
251
|
+
return true;
|
|
252
|
+
}
|
|
253
|
+
function isOhMyOpencodeInstalled() {
|
|
254
|
+
const configPath = findOpencodeConfig();
|
|
255
|
+
if (!configPath)
|
|
256
|
+
return false;
|
|
257
|
+
try {
|
|
258
|
+
const content = readFileSync(configPath, "utf-8");
|
|
259
|
+
return content.includes("oh-my-opencode");
|
|
260
|
+
} catch {
|
|
261
|
+
return false;
|
|
304
262
|
}
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
263
|
+
}
|
|
264
|
+
function isAutoCompactAlreadyDisabled() {
|
|
265
|
+
if (!existsSync(OH_MY_OPENCODE_CONFIG))
|
|
266
|
+
return false;
|
|
267
|
+
try {
|
|
268
|
+
const content = readFileSync(OH_MY_OPENCODE_CONFIG, "utf-8");
|
|
269
|
+
const config = JSON.parse(content);
|
|
270
|
+
const disabledHooks = config.disabled_hooks;
|
|
271
|
+
return disabledHooks?.includes("anthropic-auto-compact") ?? false;
|
|
272
|
+
} catch {
|
|
273
|
+
return false;
|
|
310
274
|
}
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
275
|
+
}
|
|
276
|
+
function disableAutoCompactHook() {
|
|
277
|
+
try {
|
|
278
|
+
let config = {};
|
|
279
|
+
if (existsSync(OH_MY_OPENCODE_CONFIG)) {
|
|
280
|
+
const content = readFileSync(OH_MY_OPENCODE_CONFIG, "utf-8");
|
|
281
|
+
config = JSON.parse(content);
|
|
282
|
+
}
|
|
283
|
+
const disabledHooks = config.disabled_hooks || [];
|
|
284
|
+
if (!disabledHooks.includes("anthropic-auto-compact")) {
|
|
285
|
+
disabledHooks.push("anthropic-auto-compact");
|
|
286
|
+
}
|
|
287
|
+
config.disabled_hooks = disabledHooks;
|
|
288
|
+
writeFileSync(OH_MY_OPENCODE_CONFIG, JSON.stringify(config, null, 2));
|
|
289
|
+
console.log(`✓ Disabled anthropic-auto-compact hook in oh-my-opencode.json`);
|
|
290
|
+
return true;
|
|
291
|
+
} catch (err) {
|
|
292
|
+
console.error("✗ Failed to update oh-my-opencode.json:", err);
|
|
293
|
+
return false;
|
|
316
294
|
}
|
|
317
|
-
|
|
295
|
+
}
|
|
296
|
+
async function install(options) {
|
|
297
|
+
console.log(`
|
|
298
|
+
\uD83E\uDDE0 opencode-supermemory installer
|
|
299
|
+
`);
|
|
300
|
+
const rl = options.tui ? createReadline() : null;
|
|
301
|
+
console.log("Step 1: Register plugin in OpenCode config");
|
|
318
302
|
const configPath = findOpencodeConfig();
|
|
319
303
|
if (configPath) {
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
304
|
+
if (options.tui) {
|
|
305
|
+
const shouldModify = await confirm(rl, `Add plugin to ${configPath}?`);
|
|
306
|
+
if (!shouldModify) {
|
|
307
|
+
console.log("Skipped.");
|
|
308
|
+
} else {
|
|
309
|
+
addPluginToConfig(configPath);
|
|
310
|
+
}
|
|
311
|
+
} else {
|
|
312
|
+
addPluginToConfig(configPath);
|
|
325
313
|
}
|
|
326
|
-
addPluginToConfig(configPath);
|
|
327
314
|
} else {
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
315
|
+
if (options.tui) {
|
|
316
|
+
const shouldCreate = await confirm(rl, "No OpenCode config found. Create one?");
|
|
317
|
+
if (!shouldCreate) {
|
|
318
|
+
console.log("Skipped.");
|
|
319
|
+
} else {
|
|
320
|
+
createNewConfig();
|
|
321
|
+
}
|
|
322
|
+
} else {
|
|
323
|
+
createNewConfig();
|
|
333
324
|
}
|
|
334
|
-
createNewConfig();
|
|
335
325
|
}
|
|
336
326
|
console.log(`
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
327
|
+
Step 2: Create /supermemory-init command`);
|
|
328
|
+
if (options.tui) {
|
|
329
|
+
const shouldCreate = await confirm(rl, "Add /supermemory-init command?");
|
|
330
|
+
if (!shouldCreate) {
|
|
331
|
+
console.log("Skipped.");
|
|
332
|
+
} else {
|
|
333
|
+
createCommand();
|
|
334
|
+
}
|
|
335
|
+
} else {
|
|
336
|
+
createCommand();
|
|
337
|
+
}
|
|
338
|
+
if (isOhMyOpencodeInstalled()) {
|
|
339
|
+
console.log(`
|
|
340
|
+
Step 3: Configure Oh My OpenCode`);
|
|
341
|
+
console.log("Detected Oh My OpenCode plugin.");
|
|
342
|
+
console.log("Supermemory handles context compaction, so the built-in auto-compact hook should be disabled.");
|
|
343
|
+
if (isAutoCompactAlreadyDisabled()) {
|
|
344
|
+
console.log("✓ anthropic-auto-compact hook already disabled");
|
|
345
|
+
} else {
|
|
346
|
+
if (options.tui) {
|
|
347
|
+
const shouldDisable = await confirm(rl, "Disable anthropic-auto-compact hook to let Supermemory handle context?");
|
|
348
|
+
if (!shouldDisable) {
|
|
349
|
+
console.log("Skipped.");
|
|
350
|
+
} else {
|
|
351
|
+
disableAutoCompactHook();
|
|
352
|
+
}
|
|
353
|
+
} else if (options.disableAutoCompact) {
|
|
354
|
+
disableAutoCompactHook();
|
|
355
|
+
} else {
|
|
356
|
+
console.log("Skipped. Use --disable-auto-compact to disable the hook in non-interactive mode.");
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
console.log(`
|
|
361
|
+
` + "─".repeat(50));
|
|
362
|
+
console.log(`
|
|
363
|
+
\uD83D\uDD11 Final step: Set your API key
|
|
364
|
+
`);
|
|
365
|
+
console.log("Get your API key from: https://console.supermemory.ai");
|
|
366
|
+
console.log(`
|
|
367
|
+
Then add to your shell profile:
|
|
368
|
+
`);
|
|
369
|
+
console.log(' export SUPERMEMORY_API_KEY="sm_..."');
|
|
370
|
+
console.log(`
|
|
371
|
+
Or create ~/.config/opencode/supermemory.jsonc:
|
|
372
|
+
`);
|
|
373
|
+
console.log(' { "apiKey": "sm_..." }');
|
|
374
|
+
console.log(`
|
|
375
|
+
` + "─".repeat(50));
|
|
376
|
+
console.log(`
|
|
377
|
+
✓ Setup complete! Restart OpenCode to activate.
|
|
378
|
+
`);
|
|
379
|
+
if (rl)
|
|
380
|
+
rl.close();
|
|
381
|
+
return 0;
|
|
340
382
|
}
|
|
341
383
|
function printHelp() {
|
|
342
384
|
console.log(`
|
|
343
|
-
opencode-supermemory
|
|
385
|
+
opencode-supermemory - Persistent memory for OpenCode agents
|
|
344
386
|
|
|
345
387
|
Commands:
|
|
346
|
-
|
|
388
|
+
install Install and configure the plugin
|
|
389
|
+
--no-tui Run in non-interactive mode (for LLM agents)
|
|
390
|
+
--disable-auto-compact Disable Oh My OpenCode's auto-compact hook (use with --no-tui)
|
|
347
391
|
|
|
348
392
|
Examples:
|
|
349
|
-
|
|
350
|
-
bunx opencode-supermemory
|
|
393
|
+
bunx opencode-supermemory@latest install
|
|
394
|
+
bunx opencode-supermemory@latest install --no-tui
|
|
395
|
+
bunx opencode-supermemory@latest install --no-tui --disable-auto-compact
|
|
351
396
|
`);
|
|
352
397
|
}
|
|
353
398
|
var args = process.argv.slice(2);
|
|
354
|
-
if (args.length === 0 || args[0] === "help" || args[0] === "--help") {
|
|
399
|
+
if (args.length === 0 || args[0] === "help" || args[0] === "--help" || args[0] === "-h") {
|
|
355
400
|
printHelp();
|
|
356
401
|
process.exit(0);
|
|
357
402
|
}
|
|
358
|
-
if (args[0] === "
|
|
359
|
-
|
|
403
|
+
if (args[0] === "install") {
|
|
404
|
+
const noTui = args.includes("--no-tui");
|
|
405
|
+
const disableAutoCompact = args.includes("--disable-auto-compact");
|
|
406
|
+
install({ tui: !noTui, disableAutoCompact }).then((code) => process.exit(code));
|
|
407
|
+
} else if (args[0] === "setup") {
|
|
408
|
+
console.log(`Note: 'setup' is deprecated. Use 'install' instead.
|
|
409
|
+
`);
|
|
410
|
+
const noTui = args.includes("--no-tui");
|
|
411
|
+
const disableAutoCompact = args.includes("--disable-auto-compact");
|
|
412
|
+
install({ tui: !noTui, disableAutoCompact }).then((code) => process.exit(code));
|
|
360
413
|
} else {
|
|
361
|
-
console.error(`Unknown command: ${args
|
|
414
|
+
console.error(`Unknown command: ${args[0]}`);
|
|
362
415
|
printHelp();
|
|
363
416
|
process.exit(1);
|
|
364
417
|
}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAe,MAAM,qBAAqB,CAAC;AAuC/D,eAAO,MAAM,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAe,MAAM,qBAAqB,CAAC;AAuC/D,eAAO,MAAM,iBAAiB,EAAE,MAwa/B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -13698,11 +13698,11 @@ class SupermemoryClient {
|
|
|
13698
13698
|
searchMode: "hybrid"
|
|
13699
13699
|
}), TIMEOUT_MS);
|
|
13700
13700
|
log("searchMemories: success", { count: result.results?.length || 0 });
|
|
13701
|
-
return result;
|
|
13701
|
+
return { success: true, ...result };
|
|
13702
13702
|
} catch (error45) {
|
|
13703
|
-
|
|
13704
|
-
|
|
13705
|
-
return { results: [], total: 0, timing: 0 };
|
|
13703
|
+
const errorMessage = error45 instanceof Error ? error45.message : String(error45);
|
|
13704
|
+
log("searchMemories: error", { error: errorMessage });
|
|
13705
|
+
return { success: false, error: errorMessage, results: [], total: 0, timing: 0 };
|
|
13706
13706
|
}
|
|
13707
13707
|
}
|
|
13708
13708
|
async getProfile(containerTag, query) {
|
|
@@ -13713,34 +13713,39 @@ class SupermemoryClient {
|
|
|
13713
13713
|
q: query
|
|
13714
13714
|
}), TIMEOUT_MS);
|
|
13715
13715
|
log("getProfile: success", { hasProfile: !!result?.profile });
|
|
13716
|
-
return result;
|
|
13716
|
+
return { success: true, ...result };
|
|
13717
13717
|
} catch (error45) {
|
|
13718
|
-
|
|
13719
|
-
|
|
13720
|
-
return null;
|
|
13718
|
+
const errorMessage = error45 instanceof Error ? error45.message : String(error45);
|
|
13719
|
+
log("getProfile: error", { error: errorMessage });
|
|
13720
|
+
return { success: false, error: errorMessage, profile: null };
|
|
13721
13721
|
}
|
|
13722
13722
|
}
|
|
13723
13723
|
async addMemory(content, containerTag, metadata) {
|
|
13724
|
+
log("addMemory: start", { containerTag, contentLength: content.length });
|
|
13724
13725
|
try {
|
|
13725
|
-
|
|
13726
|
+
const result = await withTimeout(this.getClient().memories.add({
|
|
13726
13727
|
content,
|
|
13727
13728
|
containerTag,
|
|
13728
13729
|
metadata
|
|
13729
13730
|
}), TIMEOUT_MS);
|
|
13731
|
+
log("addMemory: success", { id: result.id });
|
|
13732
|
+
return { success: true, ...result };
|
|
13730
13733
|
} catch (error45) {
|
|
13731
|
-
|
|
13732
|
-
|
|
13734
|
+
const errorMessage = error45 instanceof Error ? error45.message : String(error45);
|
|
13735
|
+
log("addMemory: error", { error: errorMessage });
|
|
13736
|
+
return { success: false, error: errorMessage };
|
|
13733
13737
|
}
|
|
13734
13738
|
}
|
|
13735
|
-
async
|
|
13739
|
+
async deleteMemory(memoryId) {
|
|
13740
|
+
log("deleteMemory: start", { memoryId });
|
|
13736
13741
|
try {
|
|
13737
|
-
|
|
13738
|
-
|
|
13739
|
-
|
|
13740
|
-
}), TIMEOUT_MS);
|
|
13742
|
+
await withTimeout(this.getClient().memories.delete(memoryId), TIMEOUT_MS);
|
|
13743
|
+
log("deleteMemory: success", { memoryId });
|
|
13744
|
+
return { success: true };
|
|
13741
13745
|
} catch (error45) {
|
|
13742
|
-
|
|
13743
|
-
|
|
13746
|
+
const errorMessage = error45 instanceof Error ? error45.message : String(error45);
|
|
13747
|
+
log("deleteMemory: error", { memoryId, error: errorMessage });
|
|
13748
|
+
return { success: false, error: errorMessage };
|
|
13744
13749
|
}
|
|
13745
13750
|
}
|
|
13746
13751
|
async listMemories(containerTag, limit = 20) {
|
|
@@ -13753,11 +13758,11 @@ class SupermemoryClient {
|
|
|
13753
13758
|
sort: "createdAt"
|
|
13754
13759
|
}), TIMEOUT_MS);
|
|
13755
13760
|
log("listMemories: success", { count: result.memories?.length || 0 });
|
|
13756
|
-
return result;
|
|
13761
|
+
return { success: true, ...result };
|
|
13757
13762
|
} catch (error45) {
|
|
13758
|
-
|
|
13759
|
-
|
|
13760
|
-
return { memories: [], pagination: { currentPage: 1, totalItems: 0, totalPages: 0 } };
|
|
13763
|
+
const errorMessage = error45 instanceof Error ? error45.message : String(error45);
|
|
13764
|
+
log("listMemories: error", { error: errorMessage });
|
|
13765
|
+
return { success: false, error: errorMessage, memories: [], pagination: { currentPage: 1, totalItems: 0, totalPages: 0 } };
|
|
13761
13766
|
}
|
|
13762
13767
|
}
|
|
13763
13768
|
async ingestConversation(conversationId, messages, containerTags, metadata) {
|
|
@@ -13779,15 +13784,15 @@ class SupermemoryClient {
|
|
|
13779
13784
|
if (!response.ok) {
|
|
13780
13785
|
const errorText = await response.text();
|
|
13781
13786
|
log("ingestConversation: error response", { status: response.status, error: errorText });
|
|
13782
|
-
return
|
|
13787
|
+
return { success: false, error: `HTTP ${response.status}: ${errorText}` };
|
|
13783
13788
|
}
|
|
13784
13789
|
const result = await response.json();
|
|
13785
13790
|
log("ingestConversation: success", { conversationId, status: result.status });
|
|
13786
|
-
return result;
|
|
13791
|
+
return { success: true, ...result };
|
|
13787
13792
|
} catch (error45) {
|
|
13788
|
-
|
|
13789
|
-
|
|
13790
|
-
return
|
|
13793
|
+
const errorMessage = error45 instanceof Error ? error45.message : String(error45);
|
|
13794
|
+
log("ingestConversation: error", { error: errorMessage });
|
|
13795
|
+
return { success: false, error: errorMessage };
|
|
13791
13796
|
}
|
|
13792
13797
|
}
|
|
13793
13798
|
}
|
|
@@ -14077,8 +14082,10 @@ function createCompactionHook(ctx, tags, options) {
|
|
|
14077
14082
|
try {
|
|
14078
14083
|
const result = await supermemoryClient.addMemory(`[Session Summary]
|
|
14079
14084
|
${summaryContent}`, tags.project, { type: "conversation" });
|
|
14080
|
-
if (result) {
|
|
14085
|
+
if (result.success) {
|
|
14081
14086
|
log("[compaction] summary saved as memory", { sessionID, memoryId: result.id });
|
|
14087
|
+
} else {
|
|
14088
|
+
log("[compaction] failed to save summary", { error: result.error });
|
|
14082
14089
|
}
|
|
14083
14090
|
} catch (err) {
|
|
14084
14091
|
log("[compaction] failed to save summary", { error: String(err) });
|
|
@@ -14331,20 +14338,23 @@ var SupermemoryPlugin = async (ctx) => {
|
|
|
14331
14338
|
const isFirstMessage = !injectedSessions.has(input.sessionID);
|
|
14332
14339
|
if (isFirstMessage) {
|
|
14333
14340
|
injectedSessions.add(input.sessionID);
|
|
14334
|
-
const [
|
|
14341
|
+
const [profileResult, userMemoriesResult, projectMemoriesListResult] = await Promise.all([
|
|
14335
14342
|
supermemoryClient.getProfile(tags.user, userMessage),
|
|
14336
14343
|
supermemoryClient.searchMemories(userMessage, tags.user),
|
|
14337
14344
|
supermemoryClient.listMemories(tags.project, CONFIG.maxProjectMemories)
|
|
14338
14345
|
]);
|
|
14346
|
+
const profile = profileResult.success ? profileResult : null;
|
|
14347
|
+
const userMemories = userMemoriesResult.success ? userMemoriesResult : { results: [] };
|
|
14348
|
+
const projectMemoriesList = projectMemoriesListResult.success ? projectMemoriesListResult : { memories: [] };
|
|
14339
14349
|
const projectMemories = {
|
|
14340
|
-
results: (projectMemoriesList
|
|
14350
|
+
results: (projectMemoriesList.memories || []).map((m) => ({
|
|
14341
14351
|
id: m.id,
|
|
14342
14352
|
memory: m.summary,
|
|
14343
14353
|
similarity: 1,
|
|
14344
14354
|
title: m.title,
|
|
14345
14355
|
metadata: m.metadata
|
|
14346
14356
|
})),
|
|
14347
|
-
total: projectMemoriesList
|
|
14357
|
+
total: projectMemoriesList.memories?.length || 0,
|
|
14348
14358
|
timing: 0
|
|
14349
14359
|
};
|
|
14350
14360
|
const memoryContext = formatContextForPrompt(profile, userMemories, projectMemories);
|
|
@@ -14460,10 +14470,10 @@ var SupermemoryPlugin = async (ctx) => {
|
|
|
14460
14470
|
const scope = args.scope || "project";
|
|
14461
14471
|
const containerTag = scope === "user" ? tags.user : tags.project;
|
|
14462
14472
|
const result = await supermemoryClient.addMemory(sanitizedContent, containerTag, { type: args.type });
|
|
14463
|
-
if (!result) {
|
|
14473
|
+
if (!result.success) {
|
|
14464
14474
|
return JSON.stringify({
|
|
14465
14475
|
success: false,
|
|
14466
|
-
error: "Failed to add memory"
|
|
14476
|
+
error: result.error || "Failed to add memory"
|
|
14467
14477
|
});
|
|
14468
14478
|
}
|
|
14469
14479
|
return JSON.stringify({
|
|
@@ -14483,23 +14493,41 @@ var SupermemoryPlugin = async (ctx) => {
|
|
|
14483
14493
|
}
|
|
14484
14494
|
const scope = args.scope;
|
|
14485
14495
|
if (scope === "user") {
|
|
14486
|
-
const
|
|
14487
|
-
|
|
14496
|
+
const result = await supermemoryClient.searchMemories(args.query, tags.user);
|
|
14497
|
+
if (!result.success) {
|
|
14498
|
+
return JSON.stringify({
|
|
14499
|
+
success: false,
|
|
14500
|
+
error: result.error || "Failed to search memories"
|
|
14501
|
+
});
|
|
14502
|
+
}
|
|
14503
|
+
return formatSearchResults(args.query, scope, result, args.limit);
|
|
14488
14504
|
}
|
|
14489
14505
|
if (scope === "project") {
|
|
14490
|
-
const
|
|
14491
|
-
|
|
14506
|
+
const result = await supermemoryClient.searchMemories(args.query, tags.project);
|
|
14507
|
+
if (!result.success) {
|
|
14508
|
+
return JSON.stringify({
|
|
14509
|
+
success: false,
|
|
14510
|
+
error: result.error || "Failed to search memories"
|
|
14511
|
+
});
|
|
14512
|
+
}
|
|
14513
|
+
return formatSearchResults(args.query, scope, result, args.limit);
|
|
14492
14514
|
}
|
|
14493
|
-
const [
|
|
14515
|
+
const [userResult, projectResult] = await Promise.all([
|
|
14494
14516
|
supermemoryClient.searchMemories(args.query, tags.user),
|
|
14495
14517
|
supermemoryClient.searchMemories(args.query, tags.project)
|
|
14496
14518
|
]);
|
|
14519
|
+
if (!userResult.success || !projectResult.success) {
|
|
14520
|
+
return JSON.stringify({
|
|
14521
|
+
success: false,
|
|
14522
|
+
error: userResult.error || projectResult.error || "Failed to search memories"
|
|
14523
|
+
});
|
|
14524
|
+
}
|
|
14497
14525
|
const combined = [
|
|
14498
|
-
...(
|
|
14526
|
+
...(userResult.results || []).map((r) => ({
|
|
14499
14527
|
...r,
|
|
14500
14528
|
scope: "user"
|
|
14501
14529
|
})),
|
|
14502
|
-
...(
|
|
14530
|
+
...(projectResult.results || []).map((r) => ({
|
|
14503
14531
|
...r,
|
|
14504
14532
|
scope: "project"
|
|
14505
14533
|
}))
|
|
@@ -14517,18 +14545,18 @@ var SupermemoryPlugin = async (ctx) => {
|
|
|
14517
14545
|
});
|
|
14518
14546
|
}
|
|
14519
14547
|
case "profile": {
|
|
14520
|
-
const
|
|
14521
|
-
if (!
|
|
14548
|
+
const result = await supermemoryClient.getProfile(tags.user, args.query);
|
|
14549
|
+
if (!result.success) {
|
|
14522
14550
|
return JSON.stringify({
|
|
14523
14551
|
success: false,
|
|
14524
|
-
error: "Failed to fetch profile"
|
|
14552
|
+
error: result.error || "Failed to fetch profile"
|
|
14525
14553
|
});
|
|
14526
14554
|
}
|
|
14527
14555
|
return JSON.stringify({
|
|
14528
14556
|
success: true,
|
|
14529
14557
|
profile: {
|
|
14530
|
-
static:
|
|
14531
|
-
dynamic:
|
|
14558
|
+
static: result.profile?.static || [],
|
|
14559
|
+
dynamic: result.profile?.dynamic || []
|
|
14532
14560
|
}
|
|
14533
14561
|
});
|
|
14534
14562
|
}
|
|
@@ -14537,6 +14565,12 @@ var SupermemoryPlugin = async (ctx) => {
|
|
|
14537
14565
|
const limit = args.limit || 20;
|
|
14538
14566
|
const containerTag = scope === "user" ? tags.user : tags.project;
|
|
14539
14567
|
const result = await supermemoryClient.listMemories(containerTag, limit);
|
|
14568
|
+
if (!result.success) {
|
|
14569
|
+
return JSON.stringify({
|
|
14570
|
+
success: false,
|
|
14571
|
+
error: result.error || "Failed to list memories"
|
|
14572
|
+
});
|
|
14573
|
+
}
|
|
14540
14574
|
const memories = result.memories || [];
|
|
14541
14575
|
return JSON.stringify({
|
|
14542
14576
|
success: true,
|
|
@@ -14558,12 +14592,11 @@ var SupermemoryPlugin = async (ctx) => {
|
|
|
14558
14592
|
});
|
|
14559
14593
|
}
|
|
14560
14594
|
const scope = args.scope || "project";
|
|
14561
|
-
const
|
|
14562
|
-
|
|
14563
|
-
if (!result) {
|
|
14595
|
+
const result = await supermemoryClient.deleteMemory(args.memoryId);
|
|
14596
|
+
if (!result.success) {
|
|
14564
14597
|
return JSON.stringify({
|
|
14565
14598
|
success: false,
|
|
14566
|
-
error: "Failed to
|
|
14599
|
+
error: result.error || "Failed to delete memory"
|
|
14567
14600
|
});
|
|
14568
14601
|
}
|
|
14569
14602
|
return JSON.stringify({
|
|
@@ -1,18 +1,76 @@
|
|
|
1
1
|
import Supermemory from "supermemory";
|
|
2
|
-
import type { MemoryType, ConversationMessage
|
|
2
|
+
import type { MemoryType, ConversationMessage } from "../types/index.js";
|
|
3
3
|
export declare class SupermemoryClient {
|
|
4
4
|
private client;
|
|
5
5
|
private getClient;
|
|
6
|
-
searchMemories(query: string, containerTag: string): Promise<
|
|
7
|
-
|
|
6
|
+
searchMemories(query: string, containerTag: string): Promise<{
|
|
7
|
+
results: Array<Supermemory.Search.SearchMemoriesResponse.Result>;
|
|
8
|
+
timing: number;
|
|
9
|
+
total: number;
|
|
10
|
+
success: true;
|
|
11
|
+
error?: undefined;
|
|
12
|
+
} | {
|
|
13
|
+
success: false;
|
|
14
|
+
error: string;
|
|
15
|
+
results: never[];
|
|
16
|
+
total: number;
|
|
17
|
+
timing: number;
|
|
18
|
+
}>;
|
|
19
|
+
getProfile(containerTag: string, query?: string): Promise<{
|
|
20
|
+
profile: Supermemory.ProfileResponse.Profile;
|
|
21
|
+
searchResults?: Supermemory.ProfileResponse.SearchResults;
|
|
22
|
+
success: true;
|
|
23
|
+
error?: undefined;
|
|
24
|
+
} | {
|
|
25
|
+
success: false;
|
|
26
|
+
error: string;
|
|
27
|
+
profile: null;
|
|
28
|
+
}>;
|
|
8
29
|
addMemory(content: string, containerTag: string, metadata?: {
|
|
9
30
|
type?: MemoryType;
|
|
10
31
|
tool?: string;
|
|
11
32
|
[key: string]: unknown;
|
|
12
|
-
}): Promise<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
33
|
+
}): Promise<{
|
|
34
|
+
id: string;
|
|
35
|
+
status: string;
|
|
36
|
+
success: true;
|
|
37
|
+
error?: undefined;
|
|
38
|
+
} | {
|
|
39
|
+
success: false;
|
|
40
|
+
error: string;
|
|
41
|
+
}>;
|
|
42
|
+
deleteMemory(memoryId: string): Promise<{
|
|
43
|
+
success: boolean;
|
|
44
|
+
error?: undefined;
|
|
45
|
+
} | {
|
|
46
|
+
success: boolean;
|
|
47
|
+
error: string;
|
|
48
|
+
}>;
|
|
49
|
+
listMemories(containerTag: string, limit?: number): Promise<{
|
|
50
|
+
memories: Array<Supermemory.Memories.MemoryListResponse.Memory>;
|
|
51
|
+
pagination: Supermemory.Memories.MemoryListResponse.Pagination;
|
|
52
|
+
success: true;
|
|
53
|
+
error?: undefined;
|
|
54
|
+
} | {
|
|
55
|
+
success: false;
|
|
56
|
+
error: string;
|
|
57
|
+
memories: never[];
|
|
58
|
+
pagination: {
|
|
59
|
+
currentPage: number;
|
|
60
|
+
totalItems: number;
|
|
61
|
+
totalPages: number;
|
|
62
|
+
};
|
|
63
|
+
}>;
|
|
64
|
+
ingestConversation(conversationId: string, messages: ConversationMessage[], containerTags: string[], metadata?: Record<string, string | number | boolean>): Promise<{
|
|
65
|
+
success: false;
|
|
66
|
+
error: string;
|
|
67
|
+
} | {
|
|
68
|
+
id: string;
|
|
69
|
+
conversationId: string;
|
|
70
|
+
status: string;
|
|
71
|
+
success: true;
|
|
72
|
+
error?: undefined;
|
|
73
|
+
}>;
|
|
16
74
|
}
|
|
17
75
|
export declare const supermemoryClient: SupermemoryClient;
|
|
18
76
|
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/services/client.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,aAAa,CAAC;AAGtC,OAAO,KAAK,EACV,UAAU,EACV,mBAAmB,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/services/client.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,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