|
1 | 1 | # Models |
2 | 2 |
|
3 | | -Comprehensive **Zod schemas and TypeScript types** for Code PushUp configuration, reports, and data validation. |
| 3 | +Simple **TypeScript types** for Angular MCP toolkit shared interfaces and utilities. |
4 | 4 |
|
5 | 5 | ## Minimal usage |
6 | 6 |
|
7 | 7 | ```ts |
8 | | -import { auditSchema, reportSchema } from '@push-based/models'; |
9 | | - |
10 | | -const audit = auditSchema.parse({ |
11 | | - slug: 'performance-audit', |
12 | | - title: 'Performance Audit', |
13 | | -}); |
14 | | - |
15 | | -const isValidReport = reportSchema.safeParse(reportData).success; |
| 8 | +import { type CliArgsObject, type ToolsConfig } from '@push-based/models'; |
| 9 | + |
| 10 | +// CLI argument types |
| 11 | +const args: CliArgsObject = { |
| 12 | + directory: './src', |
| 13 | + componentName: 'DsButton', |
| 14 | + _: ['command'], |
| 15 | +}; |
| 16 | + |
| 17 | +// MCP tool configuration |
| 18 | +const toolConfig: ToolsConfig = { |
| 19 | + schema: { |
| 20 | + name: 'my-tool', |
| 21 | + description: 'A custom tool', |
| 22 | + inputSchema: { |
| 23 | + type: 'object', |
| 24 | + properties: {}, |
| 25 | + }, |
| 26 | + }, |
| 27 | + handler: async (request) => { |
| 28 | + return { content: [{ type: 'text', text: 'Result' }] }; |
| 29 | + }, |
| 30 | +}; |
16 | 31 | ``` |
17 | 32 |
|
18 | 33 | ## Key Features |
19 | 34 |
|
20 | | -- **Zod Schema Validation**: Comprehensive validation schemas for all Code PushUp data structures |
21 | | -- **TypeScript Types**: Full type safety with proper TypeScript definitions |
22 | | -- **Configuration Models**: Schemas for core config, plugins, categories, and groups |
23 | | -- **Report Models**: Complete report structure validation and types |
24 | | -- **Audit Models**: Detailed audit output and metadata schemas |
25 | | -- **MCP Integration**: Model Context Protocol tool schema definitions |
26 | | -- **Table Models**: Flexible table data structures for reports |
27 | | -- **Diff Models**: Report comparison and difference tracking |
| 35 | +- **CLI Types**: Type-safe command line argument handling |
| 36 | +- **MCP Integration**: Model Context Protocol tool schema definitions and handlers |
| 37 | +- **Diagnostics**: Interface for objects that can report issues and diagnostics |
| 38 | +- **Lightweight**: Minimal dependencies, focused on essential shared types |
28 | 39 |
|
29 | 40 | ## Documentation map |
30 | 41 |
|
|
0 commit comments