@vibe-agent-toolkit/agent-schema 0.1.0-rc.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +128 -0
- package/dist/agent-manifest.d.ts +1997 -0
- package/dist/agent-manifest.d.ts.map +1 -0
- package/dist/agent-manifest.js +128 -0
- package/dist/agent-manifest.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/interface.d.ts +47 -0
- package/dist/interface.d.ts.map +1 -0
- package/dist/interface.js +20 -0
- package/dist/interface.js.map +1 -0
- package/dist/llm.d.ts +59 -0
- package/dist/llm.d.ts.map +1 -0
- package/dist/llm.js +34 -0
- package/dist/llm.js.map +1 -0
- package/dist/metadata.d.ts +68 -0
- package/dist/metadata.d.ts.map +1 -0
- package/dist/metadata.js +43 -0
- package/dist/metadata.js.map +1 -0
- package/dist/resource-registry.d.ts +57 -0
- package/dist/resource-registry.d.ts.map +1 -0
- package/dist/resource-registry.js +24 -0
- package/dist/resource-registry.js.map +1 -0
- package/dist/tool.d.ts +88 -0
- package/dist/tool.d.ts.map +1 -0
- package/dist/tool.js +38 -0
- package/dist/tool.js.map +1 -0
- package/package.json +49 -0
- package/schemas/agent-interface.json +31 -0
- package/schemas/agent-manifest.json +507 -0
- package/schemas/agent-metadata.json +69 -0
- package/schemas/llm-config.json +71 -0
- package/schemas/resource-registry.json +59 -0
- package/schemas/tool.json +82 -0
package/README.md
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# @vibe-agent-toolkit/agent-schema
|
|
2
|
+
|
|
3
|
+
JSON Schema definitions and TypeScript types for VAT agent manifest format.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
bun add @vibe-agent-toolkit/agent-schema
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
### TypeScript (Zod Schemas)
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { AgentManifestSchema, type AgentManifest } from '@vibe-agent-toolkit/agent-schema';
|
|
17
|
+
|
|
18
|
+
// Validate agent.yaml data
|
|
19
|
+
const result = AgentManifestSchema.safeParse(data);
|
|
20
|
+
|
|
21
|
+
if (result.success) {
|
|
22
|
+
const agent: AgentManifest = result.data;
|
|
23
|
+
console.log('Valid agent:', agent.metadata.name);
|
|
24
|
+
} else {
|
|
25
|
+
console.error('Validation errors:', result.error.issues);
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### JSON Schema (External Tools)
|
|
30
|
+
|
|
31
|
+
JSON Schema files are available in the `schemas/` directory:
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
import agentManifestSchema from '@vibe-agent-toolkit/agent-schema/schemas/agent-manifest.json';
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Available schemas:
|
|
38
|
+
- `agent-manifest.json` - Complete agent manifest
|
|
39
|
+
- `agent-metadata.json` - Agent metadata
|
|
40
|
+
- `llm-config.json` - LLM configuration
|
|
41
|
+
- `agent-interface.json` - Input/output interface
|
|
42
|
+
- `tool.json` - Tool definitions
|
|
43
|
+
- `resource-registry.json` - Resource registry
|
|
44
|
+
|
|
45
|
+
## Exported Schemas
|
|
46
|
+
|
|
47
|
+
### Core Schemas
|
|
48
|
+
|
|
49
|
+
- `AgentManifestSchema` - Complete agent.yaml structure
|
|
50
|
+
- `AgentMetadataSchema` - Agent metadata (name, version, etc.)
|
|
51
|
+
- `AgentSpecSchema` - Agent specification (LLM, tools, resources)
|
|
52
|
+
|
|
53
|
+
### Component Schemas
|
|
54
|
+
|
|
55
|
+
- `LLMConfigSchema` - LLM configuration with alternatives
|
|
56
|
+
- `ToolSchema` - Tool definitions
|
|
57
|
+
- `AgentInterfaceSchema` - Input/output schemas
|
|
58
|
+
- `ResourceRegistrySchema` - Resource registry
|
|
59
|
+
- `PromptsConfigSchema` - Prompt configuration
|
|
60
|
+
- `CredentialsConfigSchema` - Credentials requirements
|
|
61
|
+
|
|
62
|
+
### Utility Schemas
|
|
63
|
+
|
|
64
|
+
- `SchemaRefSchema` - JSON Schema $ref format
|
|
65
|
+
- `ToolAlternativeSchema` - Tool alternatives
|
|
66
|
+
- `BuildMetadataSchema` - Build metadata
|
|
67
|
+
|
|
68
|
+
## TypeScript Types
|
|
69
|
+
|
|
70
|
+
All schemas export corresponding TypeScript types:
|
|
71
|
+
|
|
72
|
+
```typescript
|
|
73
|
+
import type {
|
|
74
|
+
AgentManifest,
|
|
75
|
+
AgentMetadata,
|
|
76
|
+
AgentSpec,
|
|
77
|
+
LLMConfig,
|
|
78
|
+
Tool,
|
|
79
|
+
AgentInterface,
|
|
80
|
+
} from '@vibe-agent-toolkit/agent-schema';
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Validation Example
|
|
84
|
+
|
|
85
|
+
```typescript
|
|
86
|
+
import { AgentManifestSchema } from '@vibe-agent-toolkit/agent-schema';
|
|
87
|
+
import { readFileSync } from 'node:fs';
|
|
88
|
+
import YAML from 'yaml';
|
|
89
|
+
|
|
90
|
+
// Load agent.yaml
|
|
91
|
+
const content = readFileSync('agent.yaml', 'utf-8');
|
|
92
|
+
const data = YAML.parse(content);
|
|
93
|
+
|
|
94
|
+
// Validate
|
|
95
|
+
const result = AgentManifestSchema.safeParse(data);
|
|
96
|
+
|
|
97
|
+
if (!result.success) {
|
|
98
|
+
console.error('Validation failed:');
|
|
99
|
+
result.error.issues.forEach(issue => {
|
|
100
|
+
console.error(`- ${issue.path.join('.')}: ${issue.message}`);
|
|
101
|
+
});
|
|
102
|
+
process.exit(1);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
console.log('✅ Valid agent manifest');
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Schema Generation
|
|
109
|
+
|
|
110
|
+
JSON Schemas are automatically generated from Zod schemas during build:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
bun run generate:schemas
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
This ensures TypeScript types and JSON Schemas stay in sync.
|
|
117
|
+
|
|
118
|
+
## API Version
|
|
119
|
+
|
|
120
|
+
Current API version: `vat.dev/v1`
|
|
121
|
+
|
|
122
|
+
Future versions will be released as:
|
|
123
|
+
- Breaking changes: `vat.dev/v2`
|
|
124
|
+
- Non-breaking additions: Compatible within `v1`
|
|
125
|
+
|
|
126
|
+
## License
|
|
127
|
+
|
|
128
|
+
MIT
|