@rvboris/opencode-mempalace 0.2.1 → 0.3.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.
@@ -0,0 +1,54 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@opentui/solid/jsx-runtime";
2
+ import { createSignal } from "solid-js";
3
+ import { formatSessionHud, readStatusState } from "../lib/status";
4
+ const EMPTY_STATE = {
5
+ version: 2,
6
+ updatedAt: new Date(0).toISOString(),
7
+ counters: {
8
+ retrievalPrompts: 0,
9
+ retrievalSearches: 0,
10
+ retrievalHits: 0,
11
+ autosavesCompleted: 0,
12
+ autosavesSkipped: 0,
13
+ autosavesFailed: 0,
14
+ manualWrites: 0,
15
+ },
16
+ helpedSessionIds: [],
17
+ sessions: {},
18
+ };
19
+ const REFRESH_EVENTS = [
20
+ "message.updated",
21
+ "message.part.updated",
22
+ "session.idle",
23
+ "session.compacted",
24
+ "session.error",
25
+ "session.deleted",
26
+ ];
27
+ export const registerStatusHud = async (api) => {
28
+ const [status, setStatus] = createSignal(EMPTY_STATE);
29
+ const refresh = async () => {
30
+ setStatus(await readStatusState());
31
+ };
32
+ await refresh();
33
+ for (const eventType of REFRESH_EVENTS) {
34
+ const dispose = api.event.on(eventType, () => {
35
+ void refresh();
36
+ });
37
+ api.lifecycle.onDispose(dispose);
38
+ }
39
+ api.slots.register({
40
+ slots: {
41
+ session_prompt_right(ctx, props) {
42
+ const label = formatSessionHud(status(), props.session_id);
43
+ const isFailed = label.startsWith("MEM FAILED");
44
+ const isSkipped = label.startsWith("MEM SKIPPED");
45
+ const accent = isFailed
46
+ ? ctx.theme.current.error
47
+ : isSkipped
48
+ ? ctx.theme.current.warning
49
+ : ctx.theme.current.secondary ?? ctx.theme.current.primary;
50
+ return (_jsxs("text", { fg: ctx.theme.current.textMuted, children: [_jsx("span", { style: { fg: accent }, children: "MEM" }), ` ${label.slice(4)}`] }));
51
+ },
52
+ },
53
+ });
54
+ };
@@ -0,0 +1,6 @@
1
+ /** @jsxImportSource @opentui/solid */
2
+ import type { TuiPluginModule } from "@opencode-ai/plugin/tui";
3
+ declare const plugin: TuiPluginModule & {
4
+ id: string;
5
+ };
6
+ export default plugin;
@@ -0,0 +1,9 @@
1
+ import { registerStatusHud } from "./hud";
2
+ const tui = async (api) => {
3
+ await registerStatusHud(api);
4
+ };
5
+ const plugin = {
6
+ id: "rvboris.mempalace-hud",
7
+ tui,
8
+ };
9
+ export default plugin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rvboris/opencode-mempalace",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "description": "OpenCode plugin for hidden MemPalace retrieval and autosave via a local Python adapter.",
5
5
  "type": "module",
6
6
  "main": "dist/plugin/index.js",
@@ -9,6 +9,14 @@
9
9
  ".": {
10
10
  "import": "./dist/plugin/index.js",
11
11
  "types": "./dist/plugin/index.d.ts"
12
+ },
13
+ "./server": {
14
+ "import": "./dist/plugin/index.js",
15
+ "types": "./dist/plugin/index.d.ts"
16
+ },
17
+ "./tui": {
18
+ "import": "./dist/plugin/tui/index.js",
19
+ "types": "./dist/plugin/tui/index.d.ts"
12
20
  }
13
21
  },
14
22
  "files": [
@@ -29,6 +37,11 @@
29
37
  "type": "git",
30
38
  "url": "git+https://github.com/rvboris/opencode-mempalace.git"
31
39
  },
40
+ "dependencies": {
41
+ "@opentui/core": "^0.1.97",
42
+ "@opentui/solid": "^0.1.97",
43
+ "solid-js": "^1.9.12"
44
+ },
32
45
  "peerDependencies": {
33
46
  "@opencode-ai/plugin": "^1.4.0"
34
47
  },