echoes-vault-opencode 1.0.37 → 1.0.38

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 (3) hide show
  1. package/index.ts +13 -0
  2. package/package.json +1 -1
  3. package/tui.tsx +12 -6
package/index.ts CHANGED
@@ -21,6 +21,7 @@ type VaultPaths = {
21
21
 
22
22
  type EchoesState = {
23
23
  version: number
24
+ pluginVersion: string
24
25
  initialized: boolean
25
26
  session: {
26
27
  started: boolean
@@ -32,8 +33,19 @@ type EchoesState = {
32
33
 
33
34
  const STATE_FILENAME = ".opencode/echoes-state.json"
34
35
 
36
+ const getPluginVersion = async (): Promise<string> => {
37
+ try {
38
+ const pkgPath = path.join(path.dirname(new URL(import.meta.url).pathname), "package.json")
39
+ const pkg = JSON.parse(await fs.readFile(pkgPath, "utf-8"))
40
+ return pkg.version || "0.0.0"
41
+ } catch {
42
+ return "0.0.0"
43
+ }
44
+ }
45
+
35
46
  const defaultState = (): EchoesState => ({
36
47
  version: 1,
48
+ pluginVersion: "0.0.0",
37
49
  initialized: false,
38
50
  session: {
39
51
  started: false,
@@ -360,6 +372,7 @@ const OpenCodeEchoes: Plugin = async ({ directory }) => {
360
372
  await ensureSkills(directory)
361
373
 
362
374
  const state = await readState(directory)
375
+ state.pluginVersion = await getPluginVersion()
363
376
  state.session.started = false
364
377
  state.session.saved = false
365
378
  await writeState(directory, state)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "echoes-vault-opencode",
3
- "version": "1.0.37",
3
+ "version": "1.0.38",
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
@@ -6,6 +6,7 @@ import * as path from "node:path"
6
6
 
7
7
  type EchoesState = {
8
8
  version: number
9
+ pluginVersion: string
9
10
  initialized: boolean
10
11
  session: {
11
12
  started: boolean
@@ -79,17 +80,22 @@ const tui: TuiPlugin = async (api) => {
79
80
 
80
81
  return (
81
82
  <box flexDirection="column">
82
- <text fg={theme.text}>
83
- <b>EchoesVault</b>
84
- </text>
83
+ <box flexDirection="row">
84
+ <text fg={statusColor()}><b>• </b></text>
85
+ <text fg={theme.textMuted}><b>Echoes</b></text>
86
+ <text fg={theme.text}><b>Vault</b></text>
87
+ <text fg={theme.textMuted}> v{state()?.pluginVersion ?? ""}</text>
88
+ </box>
85
89
  <text fg={statusColor()}>{statusLabel()}</text>
86
90
  {statusDesc() && (
87
91
  <text fg={theme.textMuted}>{statusDesc()}</text>
88
92
  )}
89
93
  {statusCmd() && (
90
- <text fg={theme.textMuted}>
91
- Run <b fg={statusColor()}>{statusCmd()}</b> {statusCmdHint()}
92
- </text>
94
+ <box flexDirection="row">
95
+ <text fg={theme.textMuted}>Run </text>
96
+ <text fg={theme.text}>{statusCmd()}</text>
97
+ <text fg={theme.textMuted}> {statusCmdHint()}</text>
98
+ </box>
93
99
  )}
94
100
  </box>
95
101
  )