echoes-vault-opencode 1.0.20 → 1.0.21

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 +15 -21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "echoes-vault-opencode",
3
- "version": "1.0.20",
3
+ "version": "1.0.21",
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,5 +1,6 @@
1
1
  /** @jsxImportSource @opentui/solid */
2
2
  import type { TuiPlugin, TuiPluginModule } from "@opencode-ai/plugin/tui"
3
+ import { TextAttributes } from "@opentui/core"
3
4
 
4
5
  type VaultState = {
5
6
  initialized: boolean
@@ -9,10 +10,9 @@ type VaultState = {
9
10
  }
10
11
 
11
12
  const KV = "echoes_vault"
12
- let vault: VaultState = { initialized: true, sessionActive: false, pagesCount: 0, lastSession: null }
13
+ let vault: VaultState = { initialized: true, sessionActive: true, pagesCount: 15, lastSession: "2026-07-03" } // Заглушка для теста визуала
13
14
 
14
15
  const tui: TuiPlugin = async (api) => {
15
- // Блок инициализации событий...
16
16
  try {
17
17
  const saved = api.kv.get<VaultState>(KV)
18
18
  if (saved) vault = saved
@@ -26,12 +26,12 @@ const tui: TuiPlugin = async (api) => {
26
26
  vault.lastSession = new Date().toISOString().slice(0, 10)
27
27
  save()
28
28
  })
29
- // ... остальные события
29
+
30
30
  } catch (error) {
31
31
  console.error("[echoes-vault] event init failed:", error)
32
32
  }
33
33
 
34
- // Обновленный UI
34
+ // Отрисовка UI
35
35
  api.slots.register({
36
36
  slots: {
37
37
  sidebar_content({ session_id }: { session_id: string }) {
@@ -42,28 +42,22 @@ const tui: TuiPlugin = async (api) => {
42
42
 
43
43
  return (
44
44
  <box flexDirection="column" paddingBottom={1}>
45
-
46
- {/* Блок 1: Статус хранилища */}
47
45
  <box flexDirection="column" paddingBottom={1}>
48
- {/* Если статус активен - цвет зеленый. Если нет - делаем тусклым */}
49
- {active ? (
50
- <text color="green">• Active ({title})</text>
51
- ) : (
52
- <text dim>• Disconnected</text>
53
- )}
54
-
55
- {/* Используем атрибут dim для тусклого текста */}
56
- <text dim>• {count} pages indexed</text>
46
+ <text bold>EchoesVault</text>
47
+ <text fg={active ? "#4caf50" : undefined} attributes={active ? undefined : TextAttributes.DIM}>
48
+ {active ? `Active (${title})` : "Disconnected"}
49
+ </text>
50
+ <text attributes={TextAttributes.DIM}>
51
+ • {count} pages indexed
52
+ </text>
57
53
  </box>
58
-
59
- {/* Блок 2: Легенда команд */}
60
54
  <box flexDirection="column">
61
55
  <text bold>Commands</text>
62
56
 
63
- <text dim> /echoes-init (Init vault)</text>
64
- <text dim> /echoes-start (Start session)</text>
65
- <text dim> /echoes-end (End session)</text>
66
- <text dim> /echoes-status (Show status)</text>
57
+ <text attributes={TextAttributes.DIM}> /echoes-init (Init vault)</text>
58
+ <text attributes={TextAttributes.DIM}> /echoes-start (Start session)</text>
59
+ <text attributes={TextAttributes.DIM}> /echoes-end (End session)</text>
60
+ <text attributes={TextAttributes.DIM}> /echoes-status (Show status)</text>
67
61
  </box>
68
62
 
69
63
  </box>