mirror of
https://github.com/anomalyco/opencode.git
synced 2026-08-04 17:49:52 +00:00
22 lines
787 B
TypeScript
22 lines
787 B
TypeScript
export * as Connection from "./connection"
|
|
|
|
import { Schema } from "effect"
|
|
import { Credential } from "./credential"
|
|
|
|
export interface CredentialInfo extends Schema.Schema.Type<typeof CredentialInfo> {}
|
|
export const CredentialInfo = Schema.Struct({
|
|
type: Schema.Literal("credential"),
|
|
id: Credential.ID,
|
|
label: Schema.String,
|
|
}).annotate({ identifier: "Connection.CredentialInfo" })
|
|
|
|
export interface EnvInfo extends Schema.Schema.Type<typeof EnvInfo> {}
|
|
export const EnvInfo = Schema.Struct({
|
|
type: Schema.Literal("env"),
|
|
name: Schema.String,
|
|
}).annotate({ identifier: "Connection.EnvInfo" })
|
|
|
|
export const Info = Schema.Union([CredentialInfo, EnvInfo])
|
|
.pipe(Schema.toTaggedUnion("type"))
|
|
.annotate({ identifier: "Connection.Info" })
|
|
export type Info = typeof Info.Type
|