@rrr2010/opencode-roundtable 0.3.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/README.md +244 -203
- package/dist/index.js +72 -15
- package/dist/index.js.map +8 -8
- package/docs/SPEC.md +974 -979
- package/package.json +60 -61
- package/src/tui/tui.tsx +89 -99
package/package.json
CHANGED
|
@@ -1,61 +1,60 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@rrr2010/opencode-roundtable",
|
|
3
|
-
"version": "0.3.
|
|
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
|
-
"
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
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
|
+
}
|
package/src/tui/tui.tsx
CHANGED
|
@@ -1,99 +1,89 @@
|
|
|
1
|
-
/** @jsxImportSource @opentui/solid */
|
|
2
|
-
|
|
3
|
-
import type { TuiPluginModule, TuiPluginApi } from "@opencode-ai/plugin/tui"
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
)}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
sidebar_content: (props) => <LinkPanel sessionId={props.session_id} />,
|
|
91
|
-
})
|
|
92
|
-
|
|
93
|
-
api.lifecycle.onDispose(() => {})
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
export default {
|
|
97
|
-
id: "opencode-roundtable",
|
|
98
|
-
tui,
|
|
99
|
-
} satisfies TuiPluginModule
|
|
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
|