mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-26 23:28:43 +00:00
Add packages/cli-rs, an OpenCode client written in Rust on OpenTUI's Rust crates. It is a client only.
13 lines
588 B
TypeScript
13 lines
588 B
TypeScript
// Imports a deliberately unavailable package to check the loader diagnostic.
|
|
import { Plugin } from "@opencode/plugin/tui"
|
|
import { Option, Schema } from "effect"
|
|
import { appendFileSync } from "node:fs"
|
|
|
|
export default Plugin.define({
|
|
id: "example.effectprobe",
|
|
setup(context) {
|
|
const decoded = Schema.decodeUnknownSync(Schema.Struct({ name: Schema.String }))({ name: "probe" })
|
|
const log = (entry: unknown) => appendFileSync(String(context.options.log), JSON.stringify(entry) + "\n")
|
|
log({ name: decoded.name, some: Option.getOrElse(Option.some(2), () => 0) })
|
|
},
|
|
})
|