chore: generate

This commit is contained in:
opencode-agent[bot] 2026-06-03 21:00:33 +00:00
commit a41f774cad
7 changed files with 47 additions and 24 deletions

View file

@ -171,7 +171,11 @@ export const layer = Layer.effect(
const discovered = locationIsGlobal
? []
: yield* fs
.up({ targets: [".opencode", ...names.toReversed()], start: location.directory, stop: location.project.directory })
.up({
targets: [".opencode", ...names.toReversed()],
start: location.directory,
stop: location.project.directory,
})
.pipe(Effect.orDie)
const directories = [
globalDirectory,

View file

@ -19,7 +19,19 @@ const legacySources = [
const decodeAgent = Schema.decodeUnknownOption(ConfigAgent.Info)
const decodeLegacyAgent = Schema.decodeUnknownOption(ConfigAgentV1.Info)
const decodeConfig = Schema.decodeUnknownOption(Config.Info)
const agentKeys = new Set(["model", "variant", "request", "system", "description", "mode", "hidden", "color", "steps", "disabled", "permissions"])
const agentKeys = new Set([
"model",
"variant",
"request",
"system",
"description",
"mode",
"hidden",
"color",
"steps",
"disabled",
"permissions",
])
export const Plugin = PluginV2.define({
id: PluginV2.ID.make("config-agent"),
@ -37,7 +49,9 @@ export const Plugin = PluginV2.define({
Effect.catch(() => Effect.succeed(undefined)),
),
).pipe(
Effect.map((documents) => documents.filter((document): document is Config.Document => document !== undefined)),
Effect.map((documents) =>
documents.filter((document): document is Config.Document => document !== undefined),
),
)
})
}).pipe(Effect.map((documents) => documents.flat()))
@ -88,7 +102,9 @@ function discover(fs: FSUtil.Interface, directory: string) {
return Effect.forEach(legacySources, (source) =>
fs
.glob(source.pattern, { cwd: directory, absolute: true, dot: true, symlink: true })
.pipe(Effect.map((files) => files.toSorted().map((filepath) => ({ directory, filepath, primary: source.primary })))),
.pipe(
Effect.map((files) => files.toSorted().map((filepath) => ({ directory, filepath, primary: source.primary }))),
),
).pipe(
Effect.map((files) => files.flat()),
Effect.catch(() => Effect.succeed([])),

View file

@ -18,7 +18,7 @@ export const Plugin = PluginV2.define({
const skill = yield* SkillV2.Service
const transform = yield* skill.transform()
const entries = yield* config.entries()
const items = entries.flatMap((entry) => (entry.type === "document" ? entry.info.skills ?? [] : []))
const items = entries.flatMap((entry) => (entry.type === "document" ? (entry.info.skills ?? []) : []))
yield* transform((editor) => {
for (const item of items) {

View file

@ -108,13 +108,15 @@ export const layer = Layer.effect(
? path.basename(filepath, ".md")
: undefined
if (!name) continue
skills.push(new Info({
name,
description: frontmatter.description,
slash: frontmatter.slash,
location: AbsolutePath.make(filepath),
content: markdown.content,
}))
skills.push(
new Info({
name,
description: frontmatter.description,
slash: frontmatter.slash,
location: AbsolutePath.make(filepath),
content: markdown.content,
}),
)
}
}
return skills