+22
-2
@@ -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: {},
|
||||
|
||||
Reference in New Issue
Block a user