opencode-fractal-memory 0.4.3 → 0.5.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/dist/plugin/index.js +15 -13
- package/dist/tui/index.js +22 -0
- package/package.json +6 -1
package/dist/plugin/index.js
CHANGED
|
@@ -4,23 +4,25 @@ import { createToolMap } from "./tools";
|
|
|
4
4
|
import { memLog, perfNow } from "../logging";
|
|
5
5
|
import { VERSION } from "../version";
|
|
6
6
|
function showToast(serverUrl, version) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
7
|
+
setTimeout(() => {
|
|
8
|
+
const url = `${serverUrl.origin}/tui/show-toast`;
|
|
9
|
+
fetch(url, {
|
|
10
|
+
method: "POST",
|
|
11
|
+
headers: { "Content-Type": "application/json" },
|
|
12
|
+
body: JSON.stringify({
|
|
13
|
+
title: "Fractal Memory",
|
|
14
|
+
message: `v${version} loaded`,
|
|
15
|
+
variant: "info",
|
|
16
|
+
}),
|
|
17
|
+
}).catch((err) => {
|
|
18
|
+
memLog("warn", "init", "Toast notification failed", { error: String(err), serverUrl: serverUrl.origin });
|
|
19
|
+
});
|
|
20
|
+
}, 2000);
|
|
19
21
|
}
|
|
20
22
|
export const MemoryPlugin = async (ctx) => {
|
|
21
23
|
const { directory, client } = ctx;
|
|
22
24
|
const t0 = perfNow();
|
|
23
|
-
memLog("info", "init", "Plugin initialization started", { directory });
|
|
25
|
+
memLog("info", "init", "Plugin initialization started", { directory, serverUrl: ctx.serverUrl.origin });
|
|
24
26
|
let t = perfNow();
|
|
25
27
|
const store = await initStorage(directory);
|
|
26
28
|
memLog("info", "init", "Storage initialized", { durationMs: perfNow() - t });
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@opentui/solid/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource @opentui/solid */
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import * as path from "node:path";
|
|
5
|
+
import * as fs from "node:fs";
|
|
6
|
+
const VERSION = JSON.parse(fs.readFileSync(path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../../package.json"), "utf-8")).version;
|
|
7
|
+
const tui = async (api) => {
|
|
8
|
+
api.slots.register({
|
|
9
|
+
order: 150,
|
|
10
|
+
slots: {
|
|
11
|
+
sidebar_content(ctx) {
|
|
12
|
+
const theme = ctx.theme.current;
|
|
13
|
+
return (_jsxs("box", { border: true, borderColor: theme.border, backgroundColor: theme.backgroundPanel, paddingTop: 1, paddingBottom: 1, paddingLeft: 2, paddingRight: 2, flexDirection: "column", gap: 1, children: [_jsx("text", { fg: theme.primary, children: _jsx("b", { children: "Fractal Memory" }) }), _jsxs("text", { fg: theme.textMuted, children: ["v", VERSION] })] }));
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
const plugin = {
|
|
19
|
+
id: "fractal-memory",
|
|
20
|
+
tui,
|
|
21
|
+
};
|
|
22
|
+
export default plugin;
|
package/package.json
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-fractal-memory",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Fractal memory system for OpenCode with semantic search and automatic compression.",
|
|
5
5
|
"main": "dist/plugin.js",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": "./dist/plugin.js",
|
|
8
|
+
"./tui": "./dist/tui/index.js"
|
|
9
|
+
},
|
|
6
10
|
"type": "module",
|
|
7
11
|
"files": [
|
|
8
12
|
"dist",
|
|
@@ -50,6 +54,7 @@
|
|
|
50
54
|
},
|
|
51
55
|
"devDependencies": {
|
|
52
56
|
"@opencode-ai/plugin": "^1.15.13",
|
|
57
|
+
"@opentui/solid": "^0.3.2",
|
|
53
58
|
"@tsconfig/bun": "^1.0.10",
|
|
54
59
|
"@types/bun": "^1.3.14",
|
|
55
60
|
"@types/js-yaml": "^4.0.9",
|