fix(plugin): load local toolkit and expose status tool

This commit is contained in:
sargatxet committed 2026-10-08 13:35:44 +02:00
1 parent aac5627e98
commit 2fcfe2fbf7
14 files changed
+145 -34

No files matched your search

+23 -1
View File
@@ -35,11 +35,33 @@ test("installs curated content and package registration idempotently", async ()
"toolkit-security-review",
"toolkit-tdd-workflow",
])
assert.match(config, new RegExp(PACKAGE_NAME.replaceAll("/", "\\/")))
assert.deepEqual(JSON.parse(config.replace(" // keep this comment\n", "")).plugins, [
"./node_modules/@sargatxet/opencode-toolkit",
])
assert.match(await readFile(path.join(project, "opencode.json"), "utf8"), /keep this comment/)
})
})
test("registers a config-relative package path and migrates the previously managed npm entry", async () => {
await withProject(async (project) => {
await mkdir(path.join(project, ".opencode"), { recursive: true })
const configPath = path.join(project, ".opencode", "opencode.json")
await writeFile(configPath, "{}\n")
await installProject(project)
await writeFile(configPath, `{
"plugins": ["${PACKAGE_NAME}"]
}\n`)
await installProject(project)
const config = JSON.parse(await readFile(configPath, "utf8"))
assert.deepEqual(config.plugins, ["../node_modules/@sargatxet/opencode-toolkit"])
const result = await uninstallProject(project)
assert.equal(result.pluginRemoved, true)
assert.deepEqual(JSON.parse(await readFile(configPath, "utf8")).plugins, [])
})
})
test("refuses to overwrite unowned files and leaves installation unchanged", async () => {
await withProject(async (project) => {
const target = path.join(project, ".opencode", "skills", "toolkit-tdd-workflow", "SKILL.md")