Skip to content

Plugin Overview

Plugins are the primary extension mechanism in Zup. Each plugin is a function that returns a ZupPlugin object containing components for one or more OODA phases.

import { definePlugin, createObserver } from 'zupdev';
export const myPlugin = (options?: MyPluginOptions) => definePlugin({
id: 'my-plugin',
observers: { ... },
orienters: { ... },
decisionStrategies: { ... },
actions: { ... },
endpoints: { ... },
onLoopStart: async (ctx) => { ... },
onLoopComplete: async (result, ctx) => { ... },
});

Plugins are initialized sequentially in the order they appear in the plugins array. A plugin’s init hook can modify the agent context and options, which subsequent plugins will see.

Import plugins from their subpath:

import { httpMonitor } from 'zupdev/plugins/http-monitor';
import { historianPlugin } from 'zupdev/plugins/historian';
import { investigationOrienter } from 'zupdev/plugins/investigation-orienter';
import { kubernetes } from 'zupdev/plugins/kubernetes';
import { cloudRun } from 'zupdev/plugins/cloud-run';
import { flyMachines } from 'zupdev/plugins/fly-machines';
import { vercelDeploys } from 'zupdev/plugins/vercel-deploys';
import { githubActivity } from 'zupdev/plugins/github-activity';
PluginWhat it doesRequires LLM?Requires SQLite?
http-monitorMonitors HTTP endpoints for availability. Detects failures, analyzes patterns, restarts services via configurable strategies.NoNo
historianStores incident resolutions in SQLite. Uses text search or sqlite-vec for RAG to recall similar past incidents during the orient phase.No (embeddings optional)Yes
investigation-orienterRuns a deep investigation sub-loop with LLM tool calling when observations exceed a severity threshold.YesNo
kubernetesObserves Kubernetes cluster state (pods, deployments, nodes, events). Provides restart, scale, delete, and log retrieval actions.NoNo
cloud-runMonitors Google Cloud Run services and revisions. Tracks rollouts and can shift traffic for auto-rollback.NoNo
fly-machinesMonitors Fly.io machines across apps. Detects deployments via instance/image changes and tracks machine state.NoNo
vercel-deploysMonitors Vercel deployments across projects. Tracks build status, git metadata, and deployment state changes.NoNo
github-activityMonitors GitHub repositories for recent commits and merged PRs. Provides change context for incident correlation.NoNo
exampleReference implementation demonstrating all plugin phases with a simulated service health check.NoNo

Each plugin can contribute to multiple phases:

PluginObserversOrientersDecision StrategiesActionsEndpoints
http-monitorHealth checksFailure analysisRestart unhealthyRestart serviceList, check, restart
historianHistorical context
investigation-orienterDeep investigation
kubernetesCluster stateHealth analysisRestart, scale, delete, logsCluster status, namespaces
cloud-runService statusRollout analysisAuto-rollbackRollback trafficServices, revisions
fly-machinesMachine stateDeployment analysisApps, machines
vercel-deploysDeploy statusDeploy analysisProjects, deployments
github-activityCommits & PRsChange correlationRepos, commits, PRs, diffs

See Writing a Plugin for a step-by-step guide to building a custom plugin.