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