echoes-vault-opencode 1.0.24 → 1.0.25

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