ids.ts 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import { Schema } from "effect"
  2. import { ProviderMetadata } from "@opencode-ai/schema/llm"
  3. export { ProviderMetadata }
  4. /** Stable string identifier for a protocol implementation. */
  5. export const ProtocolID = Schema.String
  6. export type ProtocolID = Schema.Schema.Type<typeof ProtocolID>
  7. /** Stable string identifier for the runnable route. */
  8. export const RouteID = Schema.String
  9. export type RouteID = Schema.Schema.Type<typeof RouteID>
  10. export const ModelID = Schema.String.pipe(Schema.brand("LLM.ModelID"))
  11. export type ModelID = typeof ModelID.Type
  12. export const ProviderID = Schema.String.pipe(Schema.brand("LLM.ProviderID"))
  13. export type ProviderID = typeof ProviderID.Type
  14. export const ResponseID = Schema.String
  15. export type ResponseID = Schema.Schema.Type<typeof ResponseID>
  16. export const ContentBlockID = Schema.String
  17. export type ContentBlockID = Schema.Schema.Type<typeof ContentBlockID>
  18. export const ToolCallID = Schema.String
  19. export type ToolCallID = Schema.Schema.Type<typeof ToolCallID>
  20. export const ReasoningEfforts = ["none", "minimal", "low", "medium", "high", "xhigh", "max"] as const
  21. export const ReasoningEffort = Schema.Literals(ReasoningEfforts)
  22. export type ReasoningEffort = Schema.Schema.Type<typeof ReasoningEffort>
  23. export const TextVerbosity = Schema.Literals(["low", "medium", "high"])
  24. export type TextVerbosity = Schema.Schema.Type<typeof TextVerbosity>
  25. export const MessageRole = Schema.Literals(["system", "user", "assistant", "tool"])
  26. export type MessageRole = Schema.Schema.Type<typeof MessageRole>
  27. export const FinishReason = Schema.Literals(["stop", "length", "tool-calls", "content-filter", "error", "unknown"])
  28. export type FinishReason = Schema.Schema.Type<typeof FinishReason>
  29. export const JsonSchema = Schema.Record(Schema.String, Schema.Unknown)
  30. export type JsonSchema = Schema.Schema.Type<typeof JsonSchema>