echoes-vault-opencode 1.0.18 → 1.0.19

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 +20 -68
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "echoes-vault-opencode",
3
- "version": "1.0.18",
3
+ "version": "1.0.19",
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
@@ -9,7 +9,7 @@ type VaultState = {
9
9
  }
10
10
 
11
11
  const KV = "echoes_vault"
12
- let vault: VaultState = { initialized: false, sessionActive: false, pagesCount: 0, lastSession: null }
12
+ let vault: VaultState = { initialized: true, sessionActive: true, pagesCount: 15, lastSession: "2026-07-03" } // Заглушка для теста визуала
13
13
 
14
14
  const tui: TuiPlugin = async (api) => {
15
15
  try {
@@ -26,88 +26,40 @@ const tui: TuiPlugin = async (api) => {
26
26
  save()
27
27
  })
28
28
 
29
- api.event.on("session.deleted", () => {
30
- vault.sessionActive = false
31
- save()
32
- })
33
-
34
- api.event.on("session.idle", () => {
35
- vault.sessionActive = false
36
- save()
37
- })
38
29
  } catch (error) {
39
30
  console.error("[echoes-vault] event init failed:", error)
40
31
  }
41
32
 
42
- try {
43
- api.keymap.registerLayer({
44
- name: "echoes-vault",
45
- commands: [
46
- { title: "EchoesVault: Init Vault", value: "echoes.init" },
47
- { title: "EchoesVault: Start Session", value: "echoes.start" },
48
- { title: "EchoesVault: End Session", value: "echoes.end" },
49
- { title: "EchoesVault: Vault Status", value: "echoes.status" },
50
- ],
51
- bindings: [
52
- { keys: "C-i", command: "echoes.init" },
53
- { keys: "C-s", command: "echoes.start" },
54
- { keys: "C-e", command: "echoes.end" },
55
- { keys: "C-v", command: "echoes.status" },
56
- ],
57
- })
58
- } catch {}
59
-
33
+ // Отрисовка UI
60
34
  api.slots.register({
61
35
  slots: {
62
36
  sidebar_content({ session_id }: { session_id: string }) {
63
37
  const sessionInfo = session_id ? api.state.session.get(session_id) : undefined
64
- const title = sessionInfo?.title ?? ""
38
+ const title = sessionInfo?.title ?? "current"
65
39
  const count = vault.pagesCount
66
40
  const active = vault.sessionActive
67
- const last = vault.lastSession
68
41
 
69
42
  return (
70
- <box flexDirection="column">
71
- <box border="all" borderStyle="single" paddingX={1} paddingY={0}>
72
- <text bold>EchoesVault</text>
73
- </box>
74
-
75
- <box paddingX={1} paddingY={0}>
76
- <text color={active ? "green" : "textMuted"}>
77
- {active ? `Session: ${title}` : last ? `Last: ${last}` : "No session"}
78
- </text>
79
- </box>
80
-
81
- {count > 0 && (
82
- <box paddingX={1} paddingY={0}>
83
- <text color="textMuted">{count} pages indexed</text>
43
+ <box flexDirection="column" paddingBottom={1}>
44
+ <box flexDirection="column" paddingBottom={1}>
45
+ <text bold>EchoesVault</text>
46
+ <text color={active ? "#4caf50" : "gray"}>
47
+ • {active ? `Active (${title})` : "Disconnected"}
48
+ </text>
49
+ <text color="gray">
50
+ {count} pages indexed
51
+ </text>
84
52
  </box>
85
- )}
86
-
87
- <box paddingX={1} paddingY={0} marginTop={1}>
88
- <text bold color="textMuted">Commands</text>
89
- </box>
90
-
91
- <box paddingX={1} paddingY={0}>
92
- <text>/echoes-init</text>
93
- <text color="textMuted"> Init vault</text>
94
- </box>
95
-
96
- <box paddingX={1} paddingY={0}>
97
- <text>/echoes-start</text>
98
- <text color="textMuted"> Start session</text>
99
- </box>
53
+ <box flexDirection="column">
54
+ <text bold>Commands</text>
100
55
 
101
- <box paddingX={1} paddingY={0}>
102
- <text>/echoes-end</text>
103
- <text color="textMuted"> End session</text>
104
- </box>
56
+ <text color="gray"> /echoes-init (Init vault)</text>
57
+ <text color="gray"> /echoes-start (Start session)</text>
58
+ <text color="gray"> /echoes-end (End session)</text>
59
+ <text color="gray"> /echoes-status (Show status)</text>
60
+ </box>
105
61
 
106
- <box paddingX={1} paddingY={0}>
107
- <text>/echoes-status</text>
108
- <text color="textMuted"> Vault status</text>
109
62
  </box>
110
- </box>
111
63
  )
112
64
  },
113
65
  },
@@ -119,4 +71,4 @@ const plugin: TuiPluginModule & { id: string } = {
119
71
  tui,
120
72
  }
121
73
 
122
- export default plugin
74
+ export default plugin