Commit 82ac1af
feat: Wire output schema into CLI and runtime execution
Complete CLI to runtime integration for structured I/O:
CLI Layer:
- Parse --output-schema flag (pre-built names or inline JSON)
- Parse --output-schema-file flag (JSON schema from file)
- Pass parsed schema to run_agent() function
Runtime Integration:
- Import AgentContext for schema attachment
- Create context with schema using .with_output_schema()
- Execute using runtime.execute_with_context() when schema present
- Fallback to standard execute() when no schema
Supported Schema Names:
- container-list: Docker/K8s container listings
- resource-stats: CPU/memory statistics
- simple-list: Generic item lists
- key-value: Key-value data
Example Usage:
aofctl run agent docker.yaml --output-schema container-list
aofctl run agent k8s.yaml --output-schema-file custom.json
aofctl run agent stats.yaml --output-schema resource-stats
The schema enhances the system prompt with JSON schema instructions,
ensuring the LLM produces consistently structured output.
Related: #74
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent a5a305b commit 82ac1af
3 files changed
Lines changed: 99 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
663 | 663 | | |
664 | 664 | | |
665 | 665 | | |
666 | | - | |
| 666 | + | |
667 | 667 | | |
668 | 668 | | |
669 | 669 | | |
| |||
683 | 683 | | |
684 | 684 | | |
685 | 685 | | |
686 | | - | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
687 | 699 | | |
688 | 700 | | |
689 | | - | |
| 701 | + | |
| 702 | + | |
690 | 703 | | |
691 | 704 | | |
692 | 705 | | |
693 | 706 | | |
694 | | - | |
| 707 | + | |
695 | 708 | | |
696 | 709 | | |
697 | 710 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
46 | 56 | | |
47 | 57 | | |
48 | 58 | | |
| |||
219 | 229 | | |
220 | 230 | | |
221 | 231 | | |
| 232 | + | |
| 233 | + | |
222 | 234 | | |
223 | 235 | | |
224 | 236 | | |
225 | 237 | | |
226 | 238 | | |
227 | 239 | | |
| 240 | + | |
| 241 | + | |
228 | 242 | | |
229 | 243 | | |
230 | 244 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
158 | 197 | | |
159 | 198 | | |
160 | 199 | | |
161 | 200 | | |
162 | 201 | | |
163 | 202 | | |
| 203 | + | |
| 204 | + | |
164 | 205 | | |
165 | 206 | | |
166 | 207 | | |
| |||
178 | 219 | | |
179 | 220 | | |
180 | 221 | | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
181 | 225 | | |
182 | | - | |
| 226 | + | |
183 | 227 | | |
184 | 228 | | |
185 | 229 | | |
| |||
190 | 234 | | |
191 | 235 | | |
192 | 236 | | |
193 | | - | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
194 | 244 | | |
195 | 245 | | |
196 | 246 | | |
| |||
251 | 301 | | |
252 | 302 | | |
253 | 303 | | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
258 | 319 | | |
259 | 320 | | |
260 | 321 | | |
| |||
0 commit comments