| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| export const SETUP_VERSION = "1.0"; |
|
|
| export type SetupMode = "direct" | "assisted"; |
|
|
| export type SetupFieldType = |
| | "text" |
| | "textarea" |
| | "select" |
| | "number" |
| | "cron" |
| | "timezone" |
| | "repo-picker" |
| | "llm-profile" |
| | "event-source" |
| | "event-type" |
| | "plugin-sources" |
| | "tarball-upload"; |
|
|
| export type SetupGitProvider = "github" | "gitlab" | "bitbucket"; |
|
|
| export type SetupTriggerKind = "cron" | "event"; |
|
|
| |
| export const SETUP_PLACEHOLDER_NAMESPACES = ["form", "automation"] as const; |
|
|
| export interface SetupFieldOption { |
| value: string; |
| label: string; |
| } |
|
|
| export interface SetupFieldConstraints { |
| minLength?: number; |
| maxLength?: number; |
| min?: number; |
| max?: number; |
| |
| |
| |
| |
| format?: "safeExpressionLiteral"; |
| } |
|
|
| export interface SetupFormField { |
| type: SetupFieldType; |
| label: string; |
| help: string; |
| placeholder?: string; |
| default?: string | number | boolean | null; |
| required: boolean; |
| provider?: SetupGitProvider; |
| |
| |
| |
| |
| |
| multiple?: true; |
| options?: SetupFieldOption[]; |
| constraints?: SetupFieldConstraints; |
| } |
|
|
| |
| export type SetupFormFields = Record<string, SetupFormField>; |
|
|
| export interface SetupForm { |
| note?: string; |
| |
| triggers?: Partial<Record<SetupTriggerKind, SetupFormFields>>; |
| |
| args: SetupFormFields; |
| } |
|
|
| |
| export type SetupBundleConfigValue = |
| | string |
| | number |
| | boolean |
| | null |
| | SetupBundleConfigValue[] |
| | { [key: string]: SetupBundleConfigValue }; |
|
|
| |
| |
| |
| |
| |
| export const BUNDLE_CONFIG_FILENAME = "config.json"; |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| export interface SetupBundle { |
| |
| version: string; |
| |
| entrypoint: string; |
| |
| setupScript?: string; |
| |
| timeout?: number; |
| files: Record<string, string>; |
| |
| config: Record<string, SetupBundleConfigValue>; |
| } |
|
|
| export type SetupActionKind = "prompt" | "plugin" | "upload"; |
|
|
| export interface SetupPromptAction { |
| label: string; |
| help: string; |
| features: string[]; |
| args: SetupFormFields; |
| prompt: string; |
| } |
|
|
| export interface SetupPluginAction { |
| label: string; |
| help: string; |
| features: string[]; |
| args: SetupFormFields; |
| prompt: string; |
| plugins: string; |
| } |
|
|
| export interface SetupUploadAction { |
| label: string; |
| help: string; |
| features: string[]; |
| args: SetupFormFields; |
| tarballPath: string; |
| entrypoint: string; |
| setupScript?: string; |
| } |
|
|
| export interface SetupActions { |
| prompt?: SetupPromptAction; |
| plugin?: SetupPluginAction; |
| upload?: SetupUploadAction; |
| } |
|
|
| export type SetupAction = |
| | SetupPromptAction |
| | SetupPluginAction |
| | SetupUploadAction; |
|
|
| export interface SetupBlock { |
| version: typeof SETUP_VERSION; |
| mode: SetupMode; |
| form: SetupForm; |
| |
| prompt?: string; |
| |
| bundle?: SetupBundle; |
| |
| actions?: SetupActions; |
| |
| filter?: string; |
| |
| |
| |
| |
| |
| message?: string; |
| } |
|
|
| export interface SetupIntegrationRequirement { |
| |
| message: string; |
| |
| required?: false; |
| } |
|
|
| export interface SetupPrerequisites { |
| |
| integrations: Record<string, SetupIntegrationRequirement>; |
| |
| features?: string[]; |
| } |
|
|
| |
| |
| |
| |
| export interface SetupEntry { |
| id: string; |
| name: string; |
| description: string; |
| |
| |
| |
| |
| |
| |
| version?: string; |
| requires: SetupPrerequisites; |
| |
| skill?: string; |
| setup: SetupBlock; |
| } |
|
|
| export type SetupPayloadValue = |
| | string |
| | number |
| | boolean |
| | null |
| | SetupPayloadValue[] |
| | { [key: string]: SetupPayloadValue }; |
|
|
| export interface SetupRequestBody { |
| [key: string]: SetupPayloadValue; |
| } |
|
|
| |
| |
| |
| |
| |
| |
| |
| export type SetupFormValue = string | number | boolean | null | string[] | File; |
| export type SetupFormValues = Record<string, SetupFormValue>; |
|
|
| |
| export interface DeploymentCapabilities { |
| ready: boolean; |
| |
| maxAutomationTimeoutSeconds?: number; |
| triggerKinds: string[]; |
| eventSources: string[]; |
| eventTypes: string[]; |
| triggers: { |
| cron?: { minIntervalSeconds: number; timezones: string[] }; |
| event?: { filterLanguage: string; filterFunctions: string[] }; |
| }; |
| features: string[]; |
| } |
|
|
| |
| export interface DraftValidationError { |
| |
| field: string | null; |
| code: string; |
| message: string; |
| } |
|
|
| |
| export interface ValidateDraftResponse { |
| valid: boolean; |
| errors: DraftValidationError[]; |
| sampleEventMatched?: boolean | null; |
| } |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| export const INTERFACE_VERSION = "1.0"; |
|
|
| |
| export type AutomationAttributeName = |
| | "name" |
| | "prompt" |
| | "model" |
| | "timeout" |
| | "schedule"; |
|
|
| export type InterfaceAttributeType = |
| | "text" |
| | "textarea" |
| | "number" |
| | "llm-profile" |
| | "schedule"; |
|
|
| |
| export interface InterfaceAttribute { |
| type: InterfaceAttributeType; |
| label: string; |
| help?: string; |
| required: boolean; |
| |
| constraints?: { min?: number; max?: number }; |
| } |
|
|
| export interface InterfaceRoutes { |
| list: string; |
| |
| setup: string; |
| |
| detail: string; |
| |
| templates?: string; |
| } |
|
|
| |
| |
| |
| |
| export interface InterfaceEndpoints { |
| list: string; |
| detail: string; |
| dispatch: string; |
| runs: string; |
| tarball: string; |
| health: string; |
| capabilities: string; |
| validate: string; |
| createPrompt: string; |
| createPlugin: string; |
| |
| |
| |
| |
| |
| createBundle?: string; |
| uploads?: string; |
| } |
|
|
| export type InterfaceEndpointName = keyof InterfaceEndpoints; |
|
|
| export interface InterfaceImportExport { |
| fileKind: string; |
| fileVersion: number; |
| filenameSuffix: string; |
| importDefaults: { |
| |
| repoProvider: SetupGitProvider; |
| |
| placeholderEventSource: string; |
| }; |
| } |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| export const INTERFACE_SUB_PAGE_IDS = ["list", "templates"] as const; |
|
|
| export type InterfaceSubPageId = (typeof INTERFACE_SUB_PAGE_IDS)[number]; |
|
|
| |
| export const INTERFACE_ICON_SLUGS = [ |
| "layout-dashboard", |
| "sparkles", |
| "library", |
| "bot", |
| "circle-alert", |
| "activity", |
| "timer", |
| ] as const; |
|
|
| export type InterfaceIconSlug = (typeof INTERFACE_ICON_SLUGS)[number]; |
|
|
| export interface InterfaceSubPageNavItem { |
| |
| page: InterfaceSubPageId; |
| label: string; |
| icon: InterfaceIconSlug; |
| } |
|
|
| |
| export const OVERVIEW_METRICS = [ |
| "automations", |
| "needs-attention", |
| "total-runs", |
| "average-duration", |
| ] as const; |
|
|
| export type OverviewMetric = (typeof OVERVIEW_METRICS)[number]; |
|
|
| |
| |
| |
| |
| export const OVERVIEW_TILE_PLACEHOLDERS: Record< |
| OverviewMetric, |
| readonly string[] |
| > = { |
| automations: ["active"], |
| "needs-attention": [], |
| "total-runs": [], |
| "average-duration": [], |
| }; |
|
|
| export interface InterfaceOverviewTile { |
| metric: OverviewMetric; |
| label: string; |
| |
| detail: string; |
| |
| zeroDetail?: string; |
| icon: InterfaceIconSlug; |
| } |
|
|
| export interface InterfaceOverview { |
| |
| label: string; |
| tiles: InterfaceOverviewTile[]; |
| } |
|
|
| |
| export const DASHBOARD_FILTER_VALUES = { |
| status: ["all", "active", "failing", "disabled"], |
| trigger: ["all", "schedule", "event"], |
| } as const; |
|
|
| export type DashboardFilterId = keyof typeof DASHBOARD_FILTER_VALUES; |
|
|
| export const DASHBOARD_FILTER_IDS = Object.keys( |
| DASHBOARD_FILTER_VALUES, |
| ) as readonly DashboardFilterId[]; |
|
|
| export type DashboardStatusValue = |
| (typeof DASHBOARD_FILTER_VALUES.status)[number]; |
|
|
| export type DashboardTriggerValue = |
| (typeof DASHBOARD_FILTER_VALUES.trigger)[number]; |
|
|
| export interface InterfaceStatusFilter { |
| id: "status"; |
| |
| label: string; |
| options: { value: DashboardStatusValue; label: string }[]; |
| } |
|
|
| export interface InterfaceTriggerFilter { |
| id: "trigger"; |
| |
| label: string; |
| options: { value: DashboardTriggerValue; label: string }[]; |
| } |
|
|
| export type InterfaceDashboardFilter = |
| | InterfaceStatusFilter |
| | InterfaceTriggerFilter; |
|
|
| |
| export const DASHBOARD_SORT_VALUES = ["last-run", "runs", "name"] as const; |
|
|
| export type DashboardSortValue = (typeof DASHBOARD_SORT_VALUES)[number]; |
|
|
| export interface InterfaceDashboardSort { |
| |
| label: string; |
| options: { value: DashboardSortValue; label: string }[]; |
| |
| default: DashboardSortValue; |
| } |
|
|
| |
| |
| |
| |
| |
| export interface InterfaceListInsights { |
| health: { |
| healthy: string; |
| failing: string; |
| running: string; |
| disabled: string; |
| neverRun: string; |
| checking: string; |
| }; |
| lastRun: { label: string; never: string; justNow: string }; |
| stats: { runs: string; recentSuccess: string; averageDuration: string }; |
| } |
|
|
| |
| |
| |
| |
| export interface InterfaceTemplatesPage { |
| title: string; |
| description: string; |
| } |
|
|
| export interface InterfaceManifest { |
| version: typeof INTERFACE_VERSION; |
| routes: InterfaceRoutes; |
| navigation: { |
| sidebar: { label: string }; |
| commandMenu: { title: string; description: string; keywords: string }; |
| |
| subPages?: InterfaceSubPageNavItem[]; |
| }; |
| pages: { |
| list: { |
| title: string; |
| subtitle: string; |
| overview?: InterfaceOverview; |
| |
| filters?: InterfaceDashboardFilter[]; |
| sort?: InterfaceDashboardSort; |
| insights?: InterfaceListInsights; |
| }; |
| detail: { backLabel: string }; |
| edit: { title: string }; |
| templates?: InterfaceTemplatesPage; |
| }; |
| docsUrl: string; |
| |
| |
| |
| |
| |
| attributes: Partial<Record<AutomationAttributeName, InterfaceAttribute>>; |
| importExport: InterfaceImportExport; |
| endpoints: InterfaceEndpoints; |
| featuredAutomationIds: string[]; |
| responderIntegrationIds: string[]; |
| } |
|
|