echoes-vault-opencode 1.0.22 → 1.0.24
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/package.json +1 -1
- package/tui.tsx +24 -30
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "echoes-vault-opencode",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.24",
|
|
4
4
|
"description": "EchoesVault — persistent memory plugin for OpenCode. Obsidian-style knowledge base with daily logs, encyclopedia pages, and session resumption.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.ts",
|
package/tui.tsx
CHANGED
|
@@ -1,39 +1,30 @@
|
|
|
1
1
|
/** @jsxImportSource @opentui/solid */
|
|
2
2
|
import type { TuiPlugin, TuiPluginModule } from "@opencode-ai/plugin/tui"
|
|
3
|
-
|
|
4
3
|
type VaultState = {
|
|
5
4
|
initialized: boolean
|
|
6
5
|
sessionActive: boolean
|
|
7
6
|
pagesCount: number
|
|
8
7
|
lastSession: string | null
|
|
9
8
|
}
|
|
10
|
-
|
|
11
9
|
const KV = "echoes_vault"
|
|
12
10
|
let vault: VaultState = { initialized: true, sessionActive: true, pagesCount: 15, lastSession: "2026-07-03" } // Заглушка для теста визуала
|
|
13
|
-
|
|
14
|
-
const MUTED = "#888888"
|
|
15
|
-
const ACTIVE_COLOR = "#4caf50"
|
|
16
|
-
const INACTIVE_COLOR = "#f44336"
|
|
17
|
-
|
|
18
11
|
const tui: TuiPlugin = async (api) => {
|
|
12
|
+
// Инициализацию событий пока оставляем, она написана логично
|
|
19
13
|
try {
|
|
20
14
|
const saved = api.kv.get<VaultState>(KV)
|
|
21
15
|
if (saved) vault = saved
|
|
22
|
-
|
|
23
16
|
function save() {
|
|
24
17
|
try { api.kv.set(KV, vault) } catch {}
|
|
25
18
|
}
|
|
26
|
-
|
|
27
19
|
api.event.on("session.created", () => {
|
|
28
20
|
vault.sessionActive = true
|
|
29
21
|
vault.lastSession = new Date().toISOString().slice(0, 10)
|
|
30
22
|
save()
|
|
31
23
|
})
|
|
32
|
-
|
|
24
|
+
// ... остальные события ...
|
|
33
25
|
} catch (error) {
|
|
34
26
|
console.error("[echoes-vault] event init failed:", error)
|
|
35
27
|
}
|
|
36
|
-
|
|
37
28
|
// Отрисовка UI
|
|
38
29
|
api.slots.register({
|
|
39
30
|
slots: {
|
|
@@ -42,37 +33,40 @@ const tui: TuiPlugin = async (api) => {
|
|
|
42
33
|
const title = sessionInfo?.title ?? "current"
|
|
43
34
|
const count = vault.pagesCount
|
|
44
35
|
const active = vault.sessionActive
|
|
45
|
-
|
|
46
36
|
return (
|
|
47
37
|
<box flexDirection="column" paddingBottom={1}>
|
|
38
|
+
|
|
39
|
+
{/* Блок 1: Статус хранилища */}
|
|
48
40
|
<box flexDirection="column" paddingBottom={1}>
|
|
41
|
+
{/* Заголовок (белый, жирный) */}
|
|
49
42
|
<text bold>EchoesVault</text>
|
|
50
|
-
<text fg={active ? ACTIVE_COLOR : INACTIVE_COLOR}>
|
|
51
|
-
• {active ? `Active (${title})` : "Disconnected"}
|
|
52
|
-
</text>
|
|
53
|
-
<text fg={MUTED}>
|
|
54
|
-
• {count} pages indexed
|
|
55
|
-
</text>
|
|
56
|
-
</box>
|
|
57
|
-
<box flexDirection="column">
|
|
58
|
-
<text bold>Commands</text>
|
|
59
|
-
|
|
60
|
-
<text fg={MUTED}> /echoes-init (Init vault)</text>
|
|
61
|
-
<text fg={MUTED}> /echoes-start (Start session)</text>
|
|
62
|
-
<text fg={MUTED}> /echoes-end (End session)</text>
|
|
63
|
-
<text fg={MUTED}> /echoes-status (Show status)</text>
|
|
64
|
-
</box>
|
|
65
43
|
|
|
44
|
+
{/* Бледный текст статуса */}
|
|
45
|
+
<text color={active ? "
|
|
46
|
+
#4caf50" : "gray"}>
|
|
47
|
+
• {active ? Active (${title}) : "Disconnected"}
|
|
48
|
+
</text>
|
|
49
|
+
<text color="gray">
|
|
50
|
+
• {count} pages indexed
|
|
51
|
+
</text>
|
|
66
52
|
</box>
|
|
67
|
-
)
|
|
53
|
+
{/* Блок 2: Легенда команд (вместо неработающих кнопок) */}
|
|
54
|
+
<box flexDirection="column">
|
|
55
|
+
<text bold>Commands</text>
|
|
56
|
+
|
|
57
|
+
<text color="gray"> /echoes-init (Init vault)</text>
|
|
58
|
+
<text color="gray"> /echoes-start (Start session)</text>
|
|
59
|
+
<text color="gray"> /echoes-end (End session)</text>
|
|
60
|
+
<text color="gray"> /echoes-status (Show status)</text>
|
|
61
|
+
</box>
|
|
62
|
+
</box>
|
|
63
|
+
)
|
|
68
64
|
},
|
|
69
65
|
},
|
|
70
66
|
})
|
|
71
67
|
}
|
|
72
|
-
|
|
73
68
|
const plugin: TuiPluginModule & { id: string } = {
|
|
74
69
|
id: "echoes-vault-sidebar",
|
|
75
70
|
tui,
|
|
76
71
|
}
|
|
77
|
-
|
|
78
72
|
export default plugin
|