@log0u7/opencode-mesh 0.7.0 → 0.7.1
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.
- package/CHANGELOG.md +9 -0
- package/dist/sidebar-state.d.ts +17 -0
- package/dist/sidebar-state.d.ts.map +1 -0
- package/dist/sidebar-state.js +26 -0
- package/dist/sidebar-state.js.map +1 -0
- package/dist/tui.js +5 -6
- package/dist/tui.tsx +5 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,15 @@ All notable changes to this project are documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.7.1] - 2026-11-07
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- The TUI no longer crashes on hosts whose storage layer rejects scoped npm
|
|
13
|
+
plugin ids (`TypeError: Invalid storage segment`, anomalyco/opencode#62634).
|
|
14
|
+
The sidebar falls back to in-memory collapse state: functional, but not
|
|
15
|
+
persisted across TUI restarts until the host-side fix lands.
|
|
16
|
+
|
|
8
17
|
## [0.7.0] - 2026-11-06
|
|
9
18
|
|
|
10
19
|
### Added
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Plugin } from "@opencode/plugin/tui";
|
|
2
|
+
type SidebarState = {
|
|
3
|
+
collapsed: boolean;
|
|
4
|
+
};
|
|
5
|
+
/** Collapse state for the mesh sidebar: durable via the host's TUI storage when
|
|
6
|
+
* available, in-memory fallback when it is not. The host composes storage keys
|
|
7
|
+
* as `plugin.<id>.<key>` and its segment() validation rejects scoped npm ids
|
|
8
|
+
* (`@scope/name.tui`), so `storage.store()` throws on first use for any plugin
|
|
9
|
+
* installed from a scoped package (anomalyco/opencode#62634). The upstream fix
|
|
10
|
+
* removes the throw; until then the fallback keeps the sidebar functional, at
|
|
11
|
+
* the cost of not persisting the collapse state across TUI restarts.
|
|
12
|
+
* Returns the same `[store, mutate]` shape as `storage.store` either way. */
|
|
13
|
+
export declare function createSidebarState(storage: Plugin.Context["storage"]): readonly [{
|
|
14
|
+
readonly collapsed: boolean;
|
|
15
|
+
}, (mutation: (draft: SidebarState) => void) => Promise<void>];
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=sidebar-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar-state.d.ts","sourceRoot":"","sources":["../src/sidebar-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAG9C,KAAK,YAAY,GAAG;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,CAAC;AAE3C;;;;;;;6EAO6E;AAC7E,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC;wBAYzC,OAAO;cAClB,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,EAG/D"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Plugin } from "@opencode/plugin/tui";
|
|
2
|
+
import { createStore, produce } from "solid-js/store";
|
|
3
|
+
/** Collapse state for the mesh sidebar: durable via the host's TUI storage when
|
|
4
|
+
* available, in-memory fallback when it is not. The host composes storage keys
|
|
5
|
+
* as `plugin.<id>.<key>` and its segment() validation rejects scoped npm ids
|
|
6
|
+
* (`@scope/name.tui`), so `storage.store()` throws on first use for any plugin
|
|
7
|
+
* installed from a scoped package (anomalyco/opencode#62634). The upstream fix
|
|
8
|
+
* removes the throw; until then the fallback keeps the sidebar functional, at
|
|
9
|
+
* the cost of not persisting the collapse state across TUI restarts.
|
|
10
|
+
* Returns the same `[store, mutate]` shape as `storage.store` either way. */
|
|
11
|
+
export function createSidebarState(storage) {
|
|
12
|
+
try {
|
|
13
|
+
return storage.store("mesh-sidebar", { initial: { collapsed: false } });
|
|
14
|
+
}
|
|
15
|
+
catch {
|
|
16
|
+
const [store, setStore] = createStore({ collapsed: false });
|
|
17
|
+
return [
|
|
18
|
+
store,
|
|
19
|
+
(mutation) => {
|
|
20
|
+
setStore(produce(mutation));
|
|
21
|
+
return Promise.resolve();
|
|
22
|
+
},
|
|
23
|
+
];
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=sidebar-state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar-state.js","sourceRoot":"","sources":["../src/sidebar-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAItD;;;;;;;6EAO6E;AAC7E,MAAM,UAAU,kBAAkB,CAAC,OAAkC;IACnE,IAAI,CAAC;QACH,OAAO,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,EAAE,OAAO,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;IAC1E,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,WAAW,CAAe,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;QAC1E,OAAO;YACL,KAAK;YACL,CAAC,QAAuC,EAAE,EAAE;gBAC1C,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;gBAC5B,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;YAC3B,CAAC;SAIF,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/dist/tui.js
CHANGED
|
@@ -11,6 +11,7 @@ import { createComponent as _$createComponent } from "@opentui/solid";
|
|
|
11
11
|
import { Plugin } from "@opencode/plugin/tui";
|
|
12
12
|
import { For, Show, createSignal } from "solid-js";
|
|
13
13
|
import { MeshRpc, formatMeshSidebar } from "./rpc.js";
|
|
14
|
+
import { createSidebarState } from "./sidebar-state.js";
|
|
14
15
|
const REFRESH_MS = 15_000;
|
|
15
16
|
/** quota-style event refresh: debounced immediate refresh after activity. */
|
|
16
17
|
const EVENT_DEBOUNCE_MS = 150;
|
|
@@ -97,12 +98,10 @@ export default Plugin.define({
|
|
|
97
98
|
duration: 2000
|
|
98
99
|
});
|
|
99
100
|
|
|
100
|
-
// Durable collapse state
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
}
|
|
105
|
-
});
|
|
101
|
+
// Durable collapse state when the host allows it (scoped plugin ids hit a
|
|
102
|
+
// host-side segment validation error — anomalyco/opencode#62634); in-memory
|
|
103
|
+
// fallback otherwise: sidebar works, collapse not persisted across restarts.
|
|
104
|
+
const [store, mutate] = createSidebarState(context.storage);
|
|
106
105
|
const [snapshot, setSnapshot] = createSignal(null);
|
|
107
106
|
const [lines, setLines] = createSignal(null);
|
|
108
107
|
|
package/dist/tui.tsx
CHANGED
|
@@ -8,6 +8,7 @@ type Context = Plugin.Context;
|
|
|
8
8
|
type Theme = Context["theme"];
|
|
9
9
|
|
|
10
10
|
import { MeshRpc, formatMeshSidebar, type MeshSnapshot } from "./rpc.js";
|
|
11
|
+
import { createSidebarState } from "./sidebar-state.js";
|
|
11
12
|
|
|
12
13
|
const REFRESH_MS = 15_000;
|
|
13
14
|
/** quota-style event refresh: debounced immediate refresh after activity. */
|
|
@@ -54,10 +55,10 @@ export default Plugin.define({
|
|
|
54
55
|
const theme = context.theme;
|
|
55
56
|
context.ui.toast.show({ message: "opencode-mesh loaded", variant: "info", duration: 2000 });
|
|
56
57
|
|
|
57
|
-
// Durable collapse state
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
// Durable collapse state when the host allows it (scoped plugin ids hit a
|
|
59
|
+
// host-side segment validation error — anomalyco/opencode#62634); in-memory
|
|
60
|
+
// fallback otherwise: sidebar works, collapse not persisted across restarts.
|
|
61
|
+
const [store, mutate] = createSidebarState(context.storage);
|
|
61
62
|
const [snapshot, setSnapshot] = createSignal<MeshSnapshot | null>(null);
|
|
62
63
|
const [lines, setLines] = createSignal<string[] | null>(null);
|
|
63
64
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@log0u7/opencode-mesh",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "Multi-session coordination for OpenCode: session coordination on one machine and a peer pool across LAN or Tailscale, with pairing, mailbox, and worktree locks.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|