feat: skills
CI / verify (pull_request) Successful in 10s

This commit is contained in:
2026-09-26 21:35:59 +02:00
parent 4f956effff
commit d132060697
14 changed files with 338 additions and 96 deletions
+22 -2
View File
@@ -11,6 +11,7 @@ import { AbsolutePath } from "@opencode/schema/schema";
import type { Context } from "@opencode/plugin/effect/plugin";
import type { AgentEditor } from "@opencode/plugin/effect/agent";
import type { ToolEditor } from "@opencode/plugin/effect/tool";
import type { SkillEditor } from "@opencode/plugin/effect/skill";
import type { SessionHooks } from "@opencode/plugin/effect/session";
import { z } from "zod";
import plugin from "../src/index.js";
@@ -227,7 +228,7 @@ function host(fixture: Awaited<ReturnType<typeof scenario>>, directory: string)
const context = {
options: { provider: "fixture" },
location,
app: { version: "2.0.4-fixture" },
app: { version: "2.0.15-fixture" },
command: {},
experimental: { terminal: {} },
generate: {},
@@ -235,7 +236,26 @@ function host(fixture: Awaited<ReturnType<typeof scenario>>, directory: string)
permission: {},
plugin: {},
reference: {},
skill: {},
skill: {
transform: (callback: (editor: SkillEditor) => void) =>
Effect.sync(() => {
const skills = new Map<string, NonNullable<ReturnType<SkillEditor["get"]>>>();
callback({
list: () => [...skills.values()],
get: (id) => skills.get(id),
add: (skill) => {
skills.set(skill.id, skill);
},
update(id, update) {
const skill = skills.get(id);
if (skill) update(skill);
},
remove: (id) => {
skills.delete(id);
},
});
}).pipe(Effect.andThen(registration)),
},
vcs: { branch: {} },
websearch: {},
worktree: {},