echoes-vault-opencode 1.0.24 → 1.0.26
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 +12 -60
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "echoes-vault-opencode",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.26",
|
|
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,72 +1,24 @@
|
|
|
1
1
|
/** @jsxImportSource @opentui/solid */
|
|
2
2
|
import type { TuiPlugin, TuiPluginModule } from "@opencode-ai/plugin/tui"
|
|
3
|
-
|
|
4
|
-
initialized: boolean
|
|
5
|
-
sessionActive: boolean
|
|
6
|
-
pagesCount: number
|
|
7
|
-
lastSession: string | null
|
|
8
|
-
}
|
|
9
|
-
const KV = "echoes_vault"
|
|
10
|
-
let vault: VaultState = { initialized: true, sessionActive: true, pagesCount: 15, lastSession: "2026-07-03" } // Заглушка для теста визуала
|
|
3
|
+
|
|
11
4
|
const tui: TuiPlugin = async (api) => {
|
|
12
|
-
// Инициализацию событий пока оставляем, она написана логично
|
|
13
|
-
try {
|
|
14
|
-
const saved = api.kv.get<VaultState>(KV)
|
|
15
|
-
if (saved) vault = saved
|
|
16
|
-
function save() {
|
|
17
|
-
try { api.kv.set(KV, vault) } catch {}
|
|
18
|
-
}
|
|
19
|
-
api.event.on("session.created", () => {
|
|
20
|
-
vault.sessionActive = true
|
|
21
|
-
vault.lastSession = new Date().toISOString().slice(0, 10)
|
|
22
|
-
save()
|
|
23
|
-
})
|
|
24
|
-
// ... остальные события ...
|
|
25
|
-
} catch (error) {
|
|
26
|
-
console.error("[echoes-vault] event init failed:", error)
|
|
27
|
-
}
|
|
28
|
-
// Отрисовка UI
|
|
29
5
|
api.slots.register({
|
|
30
6
|
slots: {
|
|
31
|
-
sidebar_content(
|
|
32
|
-
const sessionInfo = session_id ? api.state.session.get(session_id) : undefined
|
|
33
|
-
const title = sessionInfo?.title ?? "current"
|
|
34
|
-
const count = vault.pagesCount
|
|
35
|
-
const active = vault.sessionActive
|
|
7
|
+
sidebar_content() {
|
|
36
8
|
return (
|
|
37
|
-
<box flexDirection="column"
|
|
38
|
-
|
|
39
|
-
{/* Блок 1: Статус хранилища */}
|
|
40
|
-
<box flexDirection="column" paddingBottom={1}>
|
|
41
|
-
{/* Заголовок (белый, жирный) */}
|
|
42
|
-
<text bold>EchoesVault</text>
|
|
9
|
+
<box flexDirection="column" padding={1}>
|
|
10
|
+
<text color="cyan">EchoesVault Controls</text>
|
|
43
11
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
<text color="gray">
|
|
50
|
-
• {count} pages indexed
|
|
51
|
-
</text>
|
|
12
|
+
{/* Здесь ИИ может добавить твои кнопки, например через <button> или перехват событий клавиатуры, в зависимости от API кнопок OpenTUI */}
|
|
13
|
+
<text>• Start Session</text>
|
|
14
|
+
<text>• End Session</text>
|
|
15
|
+
<text>• Init</text>
|
|
16
|
+
<text>• Status</text>
|
|
52
17
|
</box>
|
|
53
|
-
|
|
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
|
-
)
|
|
18
|
+
)
|
|
64
19
|
},
|
|
65
20
|
},
|
|
66
21
|
})
|
|
67
22
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
tui,
|
|
71
|
-
}
|
|
72
|
-
export default plugin
|
|
23
|
+
|
|
24
|
+
export default { id: "echoes-vault-ui", tui }
|