57 lines · 1.7 KB · TypeScript
RawDownload
import { Schema } from "effect"; const PluginToolStateSchema = Schema.Union([  Schema.Literal("none"),  Schema.Literal("available"),  Schema.Literal("enabled"),  Schema.Literal("disabled"),  Schema.Literal("configuration_required"),  Schema.Literal("invalid"),]); const PluginToolsViewSchema = Schema.Struct({  state: PluginToolStateSchema,  serverCount: Schema.Number,  allowedToolCount: Schema.Number,  mode: Schema.NullOr(Schema.Literal("observe")),  reason: Schema.optional(Schema.String),}); const PluginRuntimeViewSchema = Schema.Struct({  id: Schema.String,  name: Schema.String,  displayName: Schema.String,  version: Schema.String,  description: Schema.String,  category: Schema.String,  source: Schema.String,  capabilities: Schema.Array(Schema.String),  brandColor: Schema.optional(Schema.String),  provides: Schema.Struct({    skills: Schema.Boolean,    mcpServers: Schema.Boolean,    apps: Schema.Boolean,  }),  tools: PluginToolsViewSchema,  account: Schema.optional(    Schema.Struct({      provider: Schema.Literal("google"),      id: Schema.Union([Schema.Literal("gmail"), Schema.Literal("google-calendar")]),      configured: Schema.Boolean,      connected: Schema.Boolean,      email: Schema.NullOr(Schema.String),    }),  ),}); export const PluginRuntimeResponseSchema = Schema.Struct({  plugins: Schema.Array(PluginRuntimeViewSchema),}); export type PluginToolState = typeof PluginToolStateSchema.Type;export type PluginToolsView = typeof PluginToolsViewSchema.Type;export type PluginRuntimeView = typeof PluginRuntimeViewSchema.Type;export type PluginActivationResult = {  plugins: PluginRuntimeView[];  connectorIds: string[];};