@bojackduy/opencode-learn 1.4.3 → 1.4.4
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 +7 -1
- package/package.json +4 -4
- package/scripts/install.mjs +10 -9
package/README.md
CHANGED
|
@@ -58,8 +58,14 @@ Add to **both** configs (opencode needs server + TUI):
|
|
|
58
58
|
```
|
|
59
59
|
**`~/.config/opencode/tui.json`** — TUI (`learn-tui`):
|
|
60
60
|
```jsonc
|
|
61
|
-
{ "plugin": ["@bojackduy/opencode-learn
|
|
61
|
+
{ "plugin": ["@bojackduy/opencode-learn"] }
|
|
62
62
|
```
|
|
63
|
+
Use the **bare package name** in both files, not `@bojackduy/opencode-learn/tui`/`/server` —
|
|
64
|
+
opencode already picks the right export (`./tui` vs `./server`) based on which host loads it.
|
|
65
|
+
A scoped-package spec with a `/tui` or `/server` suffix is silently broken: `npm-package-arg`
|
|
66
|
+
parses the second slash as a local directory reference instead of a package+subpath reference,
|
|
67
|
+
so the plugin never resolves or activates, with **no error logged anywhere**.
|
|
68
|
+
|
|
63
69
|
Restart OpenCode. Verify `/md_log`, `quiz`, `write_mermaid` appear in tool list.
|
|
64
70
|
|
|
65
71
|
Local checkout:
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@bojackduy/opencode-learn",
|
|
4
|
-
"version": "1.4.
|
|
4
|
+
"version": "1.4.4",
|
|
5
5
|
"description": "Pi learn system for OpenCode — Socratic teaching, graded quiz, Obsidian md_log, and visual makers. Port of amosblomqvist/learn (video: How I Use AI to Learn Things) to OpenCode.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "AGPL-3.0-or-later",
|
|
@@ -82,9 +82,9 @@
|
|
|
82
82
|
"dependencies": {
|
|
83
83
|
"@mermaid-js/mermaid-cli": "^11.4.2",
|
|
84
84
|
"@opencode-ai/plugin": "1.18.25",
|
|
85
|
-
"@opentui/core": "
|
|
86
|
-
"@opentui/solid": "
|
|
87
|
-
"solid-js": "
|
|
85
|
+
"@opentui/core": "0.5.11",
|
|
86
|
+
"@opentui/solid": "0.5.11",
|
|
87
|
+
"solid-js": "1.9.12"
|
|
88
88
|
},
|
|
89
89
|
"devDependencies": {
|
|
90
90
|
"@types/node": "^26.4.0",
|
package/scripts/install.mjs
CHANGED
|
@@ -101,10 +101,13 @@ async function configurePlugins(isUninstall) {
|
|
|
101
101
|
} else {
|
|
102
102
|
// Keep non-learn plugins, add/update learn
|
|
103
103
|
next = plugins.filter(v => !isLearnPluginSpec(v))
|
|
104
|
-
//
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
104
|
+
// Both tui.json and opencode.json use the bare package name: "@scope/name/tui" is
|
|
105
|
+
// silently broken for SCOPED packages — npm-package-arg parses a scoped spec with a
|
|
106
|
+
// second slash as a local "directory" reference instead of a package+subpath
|
|
107
|
+
// reference, so it never resolves and the plugin never activates (no error logged).
|
|
108
|
+
// The loader already picks the "./tui" vs "./server" export from package.json
|
|
109
|
+
// automatically based on which host (tui vs server) loads it.
|
|
110
|
+
next.push(packageName)
|
|
108
111
|
// Deduplicate
|
|
109
112
|
next = [...new Set(next)]
|
|
110
113
|
}
|
|
@@ -113,8 +116,7 @@ async function configurePlugins(isUninstall) {
|
|
|
113
116
|
if (!findRootProperty(source, "plugin") && !isUninstall) {
|
|
114
117
|
const eol = source.includes("\r\n") ? "\r\n" : "\n"
|
|
115
118
|
const indent = " "
|
|
116
|
-
const
|
|
117
|
-
const spec = isTui ? `${packageName}/tui` : packageName
|
|
119
|
+
const spec = packageName
|
|
118
120
|
const pluginStr = `,\n${indent}"plugin": ${formatPluginArray([spec], indent, eol)}`
|
|
119
121
|
// Insert before final }
|
|
120
122
|
const lastBrace = source.lastIndexOf("}")
|
|
@@ -127,8 +129,7 @@ async function configurePlugins(isUninstall) {
|
|
|
127
129
|
if (e?.code !== "ENOENT") throw new Error(`Could not inspect ${target}: ${e.message}`)
|
|
128
130
|
if (!isUninstall) {
|
|
129
131
|
// Create new config file if it doesn't exist
|
|
130
|
-
const
|
|
131
|
-
const spec = isTui ? `${packageName}/tui` : packageName
|
|
132
|
+
const spec = packageName
|
|
132
133
|
// Only create opencode.jsonc and tui.jsonc by default
|
|
133
134
|
if ((name === "opencode.jsonc" || name === "tui.jsonc") && !isUninstall) {
|
|
134
135
|
const content = `{\n "plugin": ["${spec}"]\n}\n`
|
|
@@ -219,7 +220,7 @@ async function installOrUpdate() {
|
|
|
219
220
|
console.log(` Agents: ${agentsCount} (researcher, mermaid-maker, svg-maker, classify)`)
|
|
220
221
|
console.log(` Skills: ${skillsCount} (teach, visualize, marker-pdf-parser, notebooklm-lecture-notes)`)
|
|
221
222
|
if (commandsCount) console.log(` Commands: ${commandsCount}`)
|
|
222
|
-
console.log(` Plugin: ${packageName} (server
|
|
223
|
+
console.log(` Plugin: ${packageName} (server + TUI)`)
|
|
223
224
|
console.log("\nRestart OpenCode to load plugins.")
|
|
224
225
|
console.log(" /md_log <file> — mirror to Obsidian")
|
|
225
226
|
console.log(" quiz / quiz_batch — graded checks")
|