|
1 | 1 | --- |
2 | | -title: DevOps Agent |
3 | | -description: DevOps Agent protocol schemas |
| 2 | +title: Devops Agent |
| 3 | +description: Devops Agent protocol schemas |
4 | 4 | --- |
5 | 5 |
|
6 | | -# DevOps Agent |
| 6 | +# Devops Agent |
7 | 7 |
|
8 | 8 | <Callout type="info"> |
9 | 9 | **Source:** `packages/spec/src/ai/devops-agent.zod.ts` |
10 | 10 | </Callout> |
11 | 11 |
|
12 | | -## Overview |
13 | | - |
14 | | -The DevOps Agent Protocol defines autonomous DevOps agents that can self-iterate on enterprise management software development using the ObjectStack specification. These agents integrate with GitHub for version control and Vercel for deployment, enabling fully automated development, testing, and release cycles. |
15 | | - |
16 | 12 | ## TypeScript Usage |
17 | 13 |
|
18 | 14 | ```typescript |
19 | | -import { |
20 | | - DevOpsAgentSchema, |
21 | | - CodeGenerationConfigSchema, |
22 | | - CICDPipelineConfigSchema, |
23 | | - DeploymentStrategySchema, |
24 | | - MonitoringConfigSchema |
25 | | -} from '@objectstack/spec/ai'; |
26 | | - |
27 | | -import type { |
28 | | - DevOpsAgent, |
29 | | - CodeGenerationConfig, |
30 | | - CICDPipelineConfig, |
31 | | - DeploymentStrategy, |
32 | | - MonitoringConfig |
33 | | -} from '@objectstack/spec/ai'; |
34 | | - |
35 | | -// Define a DevOps agent |
36 | | -const devOpsAgent: DevOpsAgent = { |
37 | | - name: 'devops_automation_agent', |
38 | | - label: 'DevOps Automation Agent', |
39 | | - role: 'Senior Full-Stack DevOps Engineer', |
40 | | - instructions: '...', |
41 | | - model: { |
42 | | - provider: 'openai', |
43 | | - model: 'gpt-4-turbo-preview', |
44 | | - temperature: 0.3 |
45 | | - }, |
46 | | - developmentConfig: { |
47 | | - specificationSource: 'packages/spec', |
48 | | - codeGeneration: { |
49 | | - enabled: true, |
50 | | - targets: ['frontend', 'backend', 'api'] |
51 | | - } |
52 | | - }, |
53 | | - integrations: { |
54 | | - github: { |
55 | | - connector: 'github_production', |
56 | | - repository: { |
57 | | - owner: 'objectstack-ai', |
58 | | - name: 'app' |
59 | | - } |
60 | | - }, |
61 | | - vercel: { |
62 | | - connector: 'vercel_production', |
63 | | - project: 'objectstack-app' |
64 | | - } |
65 | | - } |
66 | | -}; |
67 | | - |
68 | | -// Validate |
69 | | -const validatedAgent = DevOpsAgentSchema.parse(devOpsAgent); |
| 15 | +import { CICDPipelineConfigSchema, CodeGenerationConfigSchema, CodeGenerationTargetSchema, DeploymentStrategySchema, DevOpsAgentSchema, DevOpsToolSchema, DevelopmentConfigSchema, GitHubIntegrationSchema, IntegrationConfigSchema, MonitoringConfigSchema, PipelineStageSchema, TestingConfigSchema, VercelIntegrationSchema, VersionManagementSchema } from '@objectstack/spec/ai'; |
| 16 | +import type { CICDPipelineConfig, CodeGenerationConfig, CodeGenerationTarget, DeploymentStrategy, DevOpsAgent, DevOpsTool, DevelopmentConfig, GitHubIntegration, IntegrationConfig, MonitoringConfig, PipelineStage, TestingConfig, VercelIntegration, VersionManagement } from '@objectstack/spec/ai'; |
| 17 | + |
| 18 | +// Validate data |
| 19 | +const result = CICDPipelineConfigSchema.parse(data); |
70 | 20 | ``` |
71 | 21 |
|
72 | 22 | --- |
73 | 23 |
|
74 | | -## Key Components |
75 | | - |
76 | | -### DevOpsAgent |
77 | | - |
78 | | -Extends the base `AgentSchema` with DevOps-specific configurations: |
79 | | - |
80 | | -**Additional Properties:** |
81 | | -- `developmentConfig` (DevelopmentConfig) - Development configuration |
82 | | -- `pipelines` (CICDPipelineConfig[], optional) - CI/CD pipelines |
83 | | -- `versionManagement` (VersionManagement, optional) - Version management |
84 | | -- `deploymentStrategy` (DeploymentStrategy, optional) - Deployment strategy |
85 | | -- `monitoring` (MonitoringConfig, optional) - Monitoring configuration |
86 | | -- `integrations` (IntegrationConfig) - GitHub and Vercel integrations |
87 | | -- `selfIteration` (object, optional) - Self-iteration configuration |
| 24 | +## CICDPipelineConfig |
88 | 25 |
|
89 | 26 | --- |
90 | 27 |
|
91 | | -### CodeGenerationConfig |
92 | | - |
93 | | -Configuration for automated code generation. |
94 | | - |
95 | | -**Properties:** |
96 | | -- `enabled` (boolean) - Enable code generation (default: true) |
97 | | -- `targets` (CodeGenerationTarget[]) - Generation targets |
98 | | -- `templateRepo` (string, optional) - Template repository |
99 | | -- `styleGuide` (string, optional) - Code style guide |
100 | | -- `includeTests` (boolean) - Generate tests (default: true) |
101 | | -- `includeDocumentation` (boolean) - Generate docs (default: true) |
102 | | -- `validationMode` ('strict' | 'moderate' | 'permissive') - Validation strictness |
103 | | - |
104 | | -**Code Generation Targets:** |
105 | | -- `frontend` - Frontend UI components |
106 | | -- `backend` - Backend services |
107 | | -- `api` - API endpoints |
108 | | -- `database` - Database schemas |
109 | | -- `tests` - Test suites |
110 | | -- `documentation` - Documentation |
111 | | -- `infrastructure` - Infrastructure as code |
| 28 | +## CodeGenerationConfig |
112 | 29 |
|
113 | 30 | --- |
114 | 31 |
|
115 | | -### CICDPipelineConfig |
116 | | - |
117 | | -CI/CD pipeline configuration. |
118 | | - |
119 | | -**Properties:** |
120 | | -- `name` (string) - Pipeline name |
121 | | -- `trigger` ('push' | 'pull_request' | 'release' | 'schedule' | 'manual') - Trigger type |
122 | | -- `branches` (string[], optional) - Branch filters |
123 | | -- `stages` (PipelineStage[]) - Pipeline stages |
124 | | -- `notifications` (object, optional) - Notification settings |
125 | | - |
126 | | -**Pipeline Stage Types:** |
127 | | -- `build` - Build stage |
128 | | -- `test` - Test execution |
129 | | -- `lint` - Code linting |
130 | | -- `security_scan` - Security scanning |
131 | | -- `deploy` - Deployment |
132 | | -- `smoke_test` - Post-deployment tests |
133 | | -- `rollback` - Rollback to previous version |
| 32 | +## CodeGenerationTarget |
134 | 33 |
|
135 | 34 | --- |
136 | 35 |
|
137 | | -### DeploymentStrategy |
138 | | - |
139 | | -Deployment strategy configuration. |
140 | | - |
141 | | -**Properties:** |
142 | | -- `type` ('rolling' | 'blue_green' | 'canary' | 'recreate') - Strategy type |
143 | | -- `canaryPercentage` (number) - Canary percentage (default: 10) |
144 | | -- `healthCheckUrl` (string, optional) - Health check endpoint |
145 | | -- `healthCheckTimeout` (number) - Timeout in seconds (default: 60) |
146 | | -- `autoRollback` (boolean) - Auto-rollback on failure (default: true) |
147 | | -- `smokeTests` (string[], optional) - Smoke test commands |
| 36 | +## DeploymentStrategy |
148 | 37 |
|
149 | 38 | --- |
150 | 39 |
|
151 | | -### GitHubIntegration |
| 40 | +## DevOpsAgent |
152 | 41 |
|
153 | | -GitHub integration configuration. |
| 42 | +--- |
154 | 43 |
|
155 | | -**Properties:** |
156 | | -- `connector` (string) - GitHub connector name |
157 | | -- `repository` (object) - Repository config (owner, name) |
158 | | -- `featureBranch` (string) - Default feature branch (default: 'develop') |
159 | | -- `pullRequest` (object, optional) - PR settings |
160 | | - - `autoCreate` (boolean) - Auto-create PRs (default: true) |
161 | | - - `autoMerge` (boolean) - Auto-merge when checks pass (default: false) |
162 | | - - `requireReviews` (boolean) - Require reviews (default: true) |
163 | | - - `deleteBranchOnMerge` (boolean) - Delete after merge (default: true) |
| 44 | +## DevOpsTool |
164 | 45 |
|
165 | 46 | --- |
166 | 47 |
|
167 | | -### VercelIntegration |
| 48 | +## DevelopmentConfig |
168 | 49 |
|
169 | | -Vercel deployment integration configuration. |
| 50 | +--- |
170 | 51 |
|
171 | | -**Properties:** |
172 | | -- `connector` (string) - Vercel connector name |
173 | | -- `project` (string) - Vercel project name |
174 | | -- `environments` (object, optional) - Environment mapping |
175 | | - - `production` (string) - Production branch (default: 'main') |
176 | | - - `preview` (string[]) - Preview branches |
177 | | -- `deployment` (object, optional) - Deployment settings |
178 | | - - `autoDeployProduction` (boolean) - Auto-deploy prod (default: false) |
179 | | - - `autoDeployPreview` (boolean) - Auto-deploy preview (default: true) |
180 | | - - `requireApproval` (boolean) - Require approval (default: true) |
| 52 | +## GitHubIntegration |
181 | 53 |
|
182 | 54 | --- |
183 | 55 |
|
184 | | -## Use Cases |
| 56 | +## IntegrationConfig |
185 | 57 |
|
186 | | -### 1. Automated Feature Development |
187 | | - |
188 | | -```typescript |
189 | | -const featureDevAgent: DevOpsAgent = { |
190 | | - name: 'feature_dev_agent', |
191 | | - label: 'Feature Development Agent', |
192 | | - role: 'Full-Stack Developer', |
193 | | - instructions: 'Generate features from specifications', |
194 | | - model: { provider: 'openai', model: 'gpt-4-turbo' }, |
195 | | - developmentConfig: { |
196 | | - specificationSource: 'packages/spec', |
197 | | - codeGeneration: { |
198 | | - enabled: true, |
199 | | - targets: ['frontend', 'backend', 'api', 'tests'], |
200 | | - validationMode: 'strict', |
201 | | - includeTests: true |
202 | | - } |
203 | | - }, |
204 | | - integrations: { |
205 | | - github: { |
206 | | - connector: 'github_main', |
207 | | - repository: { owner: 'myorg', name: 'app' }, |
208 | | - pullRequest: { |
209 | | - autoCreate: true, |
210 | | - requireReviews: true |
211 | | - } |
212 | | - }, |
213 | | - vercel: { |
214 | | - connector: 'vercel_main', |
215 | | - project: 'myapp', |
216 | | - deployment: { |
217 | | - autoDeployPreview: true, |
218 | | - autoDeployProduction: false |
219 | | - } |
220 | | - } |
221 | | - } |
222 | | -}; |
223 | | -``` |
| 58 | +--- |
224 | 59 |
|
225 | | -### 2. Continuous Integration Pipeline |
| 60 | +## MonitoringConfig |
226 | 61 |
|
227 | | -```typescript |
228 | | -const ciPipeline: CICDPipelineConfig = { |
229 | | - name: 'CI Pipeline', |
230 | | - trigger: 'pull_request', |
231 | | - branches: ['main', 'develop'], |
232 | | - stages: [ |
233 | | - { |
234 | | - name: 'Lint', |
235 | | - type: 'lint', |
236 | | - order: 1, |
237 | | - parallel: false, |
238 | | - commands: ['pnpm run lint'], |
239 | | - timeout: 180, |
240 | | - retryOnFailure: false, |
241 | | - maxRetries: 0 |
242 | | - }, |
243 | | - { |
244 | | - name: 'Test', |
245 | | - type: 'test', |
246 | | - order: 2, |
247 | | - parallel: false, |
248 | | - commands: ['pnpm run test:ci'], |
249 | | - timeout: 600, |
250 | | - retryOnFailure: false, |
251 | | - maxRetries: 0 |
252 | | - } |
253 | | - ] |
254 | | -}; |
255 | | -``` |
256 | | - |
257 | | -### 3. Canary Deployment |
| 62 | +--- |
258 | 63 |
|
259 | | -```typescript |
260 | | -const canaryDeployment: DeploymentStrategy = { |
261 | | - type: 'canary', |
262 | | - canaryPercentage: 10, |
263 | | - healthCheckUrl: '/api/health', |
264 | | - healthCheckTimeout: 60, |
265 | | - autoRollback: true, |
266 | | - smokeTests: ['pnpm run test:smoke'] |
267 | | -}; |
268 | | -``` |
| 64 | +## PipelineStage |
269 | 65 |
|
270 | 66 | --- |
271 | 67 |
|
272 | | -## Architecture |
| 68 | +## TestingConfig |
273 | 69 |
|
274 | | -The DevOps Agent follows these principles: |
| 70 | +--- |
275 | 71 |
|
276 | | -1. **Self-Iterating Development**: Continuously improves based on feedback |
277 | | -2. **Automated Code Generation**: Follows ObjectStack specifications |
278 | | -3. **Continuous Integration**: Automated testing and validation |
279 | | -4. **Version Management**: Semantic versioning with changelogs |
280 | | -5. **Monitoring and Rollback**: Automated health checks and rollbacks |
| 72 | +## VercelIntegration |
281 | 73 |
|
282 | 74 | --- |
283 | 75 |
|
284 | | -## Best Practices |
| 76 | +## VersionManagement |
285 | 77 |
|
286 | | -1. **Start with strict validation**: Use `validationMode: 'strict'` for production |
287 | | -2. **Enable testing**: Always set `includeTests: true` |
288 | | -3. **Require reviews**: Set `requireReviews: true` for production deployments |
289 | | -4. **Auto-rollback**: Enable `autoRollback: true` for safety |
290 | | -5. **Monitor deployments**: Configure comprehensive monitoring alerts |
291 | | -6. **Use feature branches**: Follow Git flow with feature branches |
292 | | -7. **Semantic versioning**: Use `scheme: 'semver'` for version management |
293 | | -8. **Gradual rollouts**: Use canary deployments for critical changes |
0 commit comments