mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-19 08:09:51 +00:00
18 lines
597 B
TypeScript
18 lines
597 B
TypeScript
export * as ToolOutput from "./tool-output"
|
|
import { Schema } from "effect"
|
|
|
|
export class TextContent extends Schema.Class<TextContent>("Tool.TextContent")({
|
|
type: Schema.Literal("text"),
|
|
text: Schema.String,
|
|
}) {}
|
|
|
|
export class FileContent extends Schema.Class<FileContent>("Tool.FileContent")({
|
|
type: Schema.Literal("file"),
|
|
uri: Schema.String,
|
|
mime: Schema.String,
|
|
name: Schema.String.pipe(Schema.optional),
|
|
}) {}
|
|
|
|
export const Content = Schema.Union([TextContent, FileContent]).pipe(Schema.toTaggedUnion("type"))
|
|
|
|
export const Structured = Schema.Record(Schema.String, Schema.Any)
|