mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-29 11:42:17 +00:00
28 lines
1.1 KiB
TypeScript
28 lines
1.1 KiB
TypeScript
export * as PromptInput from "./prompt-input.js"
|
|
|
|
import { Schema } from "effect"
|
|
import { AgentAttachment, PromptMention } from "./prompt.js"
|
|
import { optional } from "./schema.js"
|
|
import { Skill } from "./skill.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" })
|
|
|
|
export interface Prompt extends Schema.Schema.Type<typeof Prompt> {}
|
|
export interface SkillAttachment extends Schema.Schema.Type<typeof SkillAttachment> {}
|
|
export const SkillAttachment = Schema.Struct({
|
|
id: Skill.ID,
|
|
mention: PromptMention.pipe(optional),
|
|
}).annotate({ identifier: "PromptInput.SkillAttachment" })
|
|
|
|
export const Prompt = Schema.Struct({
|
|
text: Schema.String,
|
|
files: Schema.Array(FileAttachment).pipe(optional),
|
|
agents: Schema.Array(AgentAttachment).pipe(optional),
|
|
skills: Schema.Array(SkillAttachment).pipe(optional),
|
|
}).annotate({ identifier: "PromptInput" })
|