@rrr2010/opencode-roundtable 0.2.0 → 0.3.2

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/package.json CHANGED
@@ -1,53 +1,60 @@
1
- {
2
- "name": "@rrr2010/opencode-roundtable",
3
- "version": "0.2.0",
4
- "description": "Multi-agent round-robin debate plugin for OpenCode",
5
- "type": "module",
6
- "main": "./dist/index.js",
7
- "module": "./dist/index.js",
8
- "types": "./dist/index.d.ts",
9
- "exports": {
10
- ".": {
11
- "import": "./dist/index.js",
12
- "require": "./dist/index.js",
13
- "types": "./dist/index.d.ts"
14
- }
15
- },
16
- "files": [
17
- "dist",
18
- "README.md",
19
- "docs/SPEC.md",
20
- "docs/roundtable.schema.json",
21
- "LICENSE"
22
- ],
23
- "scripts": {
24
- "build": "bun build index.ts --outdir dist --target node --format esm --sourcemap --external @opencode-ai/plugin --external @opencode-ai/sdk",
25
- "typecheck": "tsc --noEmit",
26
- "prepublishOnly": "bun run build",
27
- "dev:copy": "cp src/roundtable.ts ~/.config/opencode/plugins/roundtable.ts"
28
- },
29
- "keywords": [
30
- "opencode",
31
- "plugin",
32
- "multi-agent",
33
- "debate",
34
- "roundtable"
35
- ],
36
- "license": "MIT",
37
- "repository": {
38
- "type": "git",
39
- "url": "git+https://github.com/opencode-ai/roundtable.git"
40
- },
41
- "homepage": "https://github.com/opencode-ai/roundtable#readme",
42
- "bugs": {
43
- "url": "https://github.com/opencode-ai/roundtable/issues"
44
- },
45
- "peerDependencies": {
46
- "@opencode-ai/plugin": "latest"
47
- },
48
- "devDependencies": {
49
- "@opencode-ai/plugin": "latest",
50
- "@types/bun": "^1.3.0",
51
- "typescript": "^5.7.0"
52
- }
53
- }
1
+ {
2
+ "name": "@rrr2010/opencode-roundtable",
3
+ "version": "0.3.2",
4
+ "description": "Multi-agent round-robin debate plugin for OpenCode",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/index.js",
12
+ "require": "./dist/index.js",
13
+ "types": "./dist/index.d.ts"
14
+ },
15
+ "./tui": {
16
+ "import": "./src/tui/tui.tsx",
17
+ "types": "./src/tui/tui.tsx"
18
+ }
19
+ },
20
+ "files": [
21
+ "dist",
22
+ "src/tui/",
23
+ "README.md",
24
+ "docs/SPEC.md",
25
+ "docs/roundtable.schema.json",
26
+ "LICENSE"
27
+ ],
28
+ "scripts": {
29
+ "build": "bun build index.ts --outdir dist --target node --format esm --sourcemap --external @opencode-ai/plugin --external @opencode-ai/sdk",
30
+ "typecheck": "tsc --noEmit",
31
+ "prepublishOnly": "bun run build",
32
+ "dev:install": "bun run build && npm link"
33
+ },
34
+ "keywords": [
35
+ "opencode",
36
+ "plugin",
37
+ "multi-agent",
38
+ "debate",
39
+ "roundtable"
40
+ ],
41
+ "license": "MIT",
42
+ "repository": {
43
+ "type": "git",
44
+ "url": "git+https://github.com/opencode-ai/roundtable.git"
45
+ },
46
+ "homepage": "https://github.com/opencode-ai/roundtable#readme",
47
+ "bugs": {
48
+ "url": "https://github.com/opencode-ai/roundtable/issues"
49
+ },
50
+ "peerDependencies": {
51
+ "@opencode-ai/plugin": "latest",
52
+ "@opentui/core": "^0.4.2",
53
+ "@opentui/solid": "^0.4.2",
54
+ "solid-js": "^1.9.12"
55
+ },
56
+ "devDependencies": {
57
+ "@opencode-ai/plugin": "latest",
58
+ "typescript": "^5.7.0"
59
+ }
60
+ }
@@ -0,0 +1,89 @@
1
+ /** @jsxImportSource @opentui/solid */
2
+
3
+ import type { TuiPluginModule, TuiPluginApi } from "@opencode-ai/plugin/tui"
4
+
5
+ let api: TuiPluginApi
6
+
7
+ function Badge(props: { title: string }) {
8
+ if (!props.title?.startsWith("⚡")) return null
9
+ return <text>[RT]</text>
10
+ }
11
+
12
+ function LinkPanel(props: { sessionId: string }) {
13
+ const session = api.state.session.get(props.sessionId)
14
+ if (session?.parentID) {
15
+ return (
16
+ <a on:click={() => api.route.navigate("session", { sessionID: session.parentID! })}>
17
+ ← Back
18
+ </a>
19
+ )
20
+ }
21
+ return null
22
+ }
23
+
24
+ async function showRoundtables() {
25
+ try {
26
+ const res = await api.client.session.list()
27
+ const sessions = res.data ?? []
28
+ const rts = sessions.filter((s: { title?: string }) => s.title?.startsWith("⚡"))
29
+ if (rts.length === 0) {
30
+ api.ui.toast({ message: "No active roundtables", variant: "info" })
31
+ return
32
+ }
33
+
34
+ api.ui.dialog.replace(() => (
35
+ <box padding={1} flexDirection="column">
36
+ <text bold>Roundtables</text>
37
+ {rts.map((s: { id: string; title: string }) => (
38
+ <box
39
+ flexDirection="row"
40
+ paddingTop={1}
41
+ onMouseUp={() => {
42
+ api.ui.dialog.clear()
43
+ api.route.navigate("session", { sessionID: s.id })
44
+ }}
45
+ >
46
+ <box
47
+ paddingLeft={1}
48
+ paddingRight={1}
49
+ backgroundColor={api.theme.current.backgroundElement}
50
+ >
51
+ <text>→</text>
52
+ </box>
53
+ <box paddingLeft={1}>
54
+ <text>{s.title.replace(/^⚡ /, "")}</text>
55
+ </box>
56
+ </box>
57
+ ))}
58
+ </box>
59
+ ))
60
+ } catch {
61
+ api.ui.toast({ message: "Could not list sessions", variant: "error" })
62
+ }
63
+ }
64
+
65
+ const tui: TuiPluginModule["tui"] = async (a) => {
66
+ api = a
67
+
68
+ api.command?.register(() => [
69
+ {
70
+ title: "Roundtables",
71
+ value: "roundtables.list",
72
+ description: "List active roundtable sessions",
73
+ slash: { name: "roundtables" },
74
+ onSelect: () => showRoundtables(),
75
+ },
76
+ ])
77
+
78
+ api.slots.register({
79
+ slots: {
80
+ sidebar_title: (_ctx, props) => <Badge title={props.title} />,
81
+ sidebar_content: (_ctx, props) => <LinkPanel sessionId={props.session_id} />,
82
+ },
83
+ })
84
+ }
85
+
86
+ export default {
87
+ id: "opencode-roundtable",
88
+ tui,
89
+ } satisfies TuiPluginModule