mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-23 02:36:57 -04:00
27 lines
924 B
TypeScript
27 lines
924 B
TypeScript
export * as PromptInput from "./prompt-input.js"
|
|
|
|
import { Schema } from "effect"
|
|
import { AgentAttachment, PromptMention } from "./prompt.js"
|
|
import { optional, statics } from "./schema.js"
|
|
|
|
export interface FileAttachment extends Schema.Schema.Type<typeof FileAttachment> {}
|
|
export const FileAttachment = Schema.Struct({
|
|
uri: Schema.String,
|
|
name: Schema.String.pipe(optional),
|
|
description: Schema.String.pipe(optional),
|
|
mention: PromptMention.pipe(optional),
|
|
})
|
|
.annotate({ identifier: "PromptInput.FileAttachment" })
|
|
.pipe(
|
|
statics((schema) => ({
|
|
create: (input: FileAttachment) => schema.make(input),
|
|
})),
|
|
)
|
|
|
|
export interface Prompt extends Schema.Schema.Type<typeof Prompt> {}
|
|
export const Prompt = Schema.Struct({
|
|
text: Schema.String,
|
|
files: Schema.Array(FileAttachment).pipe(optional),
|
|
agents: Schema.Array(AgentAttachment).pipe(optional),
|
|
}).annotate({ identifier: "PromptInput" })
|