opencode-fractal-memory 0.4.3 → 0.4.4
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/package.json +1 -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 });
|