@a3t/rapid-schema 0.1.0 → 0.1.2
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 +250 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
# @a3t/rapid-schema
|
|
2
|
+
|
|
3
|
+
JSON schema and TypeScript types for RAPID configuration.
|
|
4
|
+
|
|
5
|
+
This package provides the JSON schema and TypeScript type definitions for `rapid.json` configuration files, enabling IDE autocompletion and validation.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- 📋 **JSON Schema** - Full JSON Schema for `rapid.json` validation
|
|
10
|
+
- 🎯 **TypeScript Types** - Comprehensive TypeScript interfaces
|
|
11
|
+
- ✨ **IDE Support** - Autocompletion in VS Code and other IDEs
|
|
12
|
+
- 🔍 **Validation** - JSON Schema validation support
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install @a3t/rapid-schema
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
### TypeScript Types
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
import type {
|
|
26
|
+
RapidConfig,
|
|
27
|
+
ContainerConfig,
|
|
28
|
+
AgentsConfig,
|
|
29
|
+
AgentDefinition,
|
|
30
|
+
SecretsConfig,
|
|
31
|
+
ContextConfig,
|
|
32
|
+
McpConfig,
|
|
33
|
+
McpServerConfig,
|
|
34
|
+
} from '@a3t/rapid-schema';
|
|
35
|
+
|
|
36
|
+
const config: RapidConfig = {
|
|
37
|
+
version: '1.0',
|
|
38
|
+
name: 'my-project',
|
|
39
|
+
agents: {
|
|
40
|
+
default: 'claude',
|
|
41
|
+
available: {
|
|
42
|
+
claude: {
|
|
43
|
+
cli: 'claude',
|
|
44
|
+
instructionFile: 'CLAUDE.md',
|
|
45
|
+
envVars: ['ANTHROPIC_API_KEY'],
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### JSON Schema Import
|
|
53
|
+
|
|
54
|
+
```javascript
|
|
55
|
+
import schema from '@a3t/rapid-schema/schema';
|
|
56
|
+
// or
|
|
57
|
+
import schema from '@a3t/rapid-schema/rapid.schema.json';
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### IDE Setup
|
|
61
|
+
|
|
62
|
+
To enable autocompletion in your `rapid.json`, add the `$schema` property:
|
|
63
|
+
|
|
64
|
+
```json
|
|
65
|
+
{
|
|
66
|
+
"$schema": "https://unpkg.com/@a3t/rapid-schema@latest/dist/rapid.schema.json",
|
|
67
|
+
"version": "1.0",
|
|
68
|
+
"name": "my-project",
|
|
69
|
+
"agents": {
|
|
70
|
+
"default": "claude",
|
|
71
|
+
"available": {}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Configuration Structure
|
|
77
|
+
|
|
78
|
+
### Root Properties
|
|
79
|
+
|
|
80
|
+
| Property | Type | Required | Description |
|
|
81
|
+
| ----------- | ------ | -------- | ------------------------------- |
|
|
82
|
+
| `version` | string | Yes | Schema version (`"1.0"`) |
|
|
83
|
+
| `name` | string | No | Project name |
|
|
84
|
+
| `container` | object | No | Container configuration |
|
|
85
|
+
| `agents` | object | Yes | AI agents configuration |
|
|
86
|
+
| `secrets` | object | No | Secret management configuration |
|
|
87
|
+
| `context` | object | No | Context file settings |
|
|
88
|
+
| `mcp` | object | No | MCP server configuration |
|
|
89
|
+
|
|
90
|
+
### Container Configuration
|
|
91
|
+
|
|
92
|
+
```typescript
|
|
93
|
+
interface ContainerConfig {
|
|
94
|
+
devcontainer?: string; // Path to devcontainer.json
|
|
95
|
+
compose?: string; // Docker Compose file
|
|
96
|
+
autoStart?: boolean; // Auto-start on `rapid dev`
|
|
97
|
+
buildArgs?: Record<string, string>;
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Agents Configuration
|
|
102
|
+
|
|
103
|
+
```typescript
|
|
104
|
+
interface AgentsConfig {
|
|
105
|
+
default: string; // Default agent name
|
|
106
|
+
available: Record<string, AgentDefinition>; // Available agents
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
interface AgentDefinition {
|
|
110
|
+
cli: string; // CLI command to execute
|
|
111
|
+
instructionFile?: string; // Path to instruction file
|
|
112
|
+
envVars?: string[]; // Required environment variables
|
|
113
|
+
installCmd?: string; // Installation command
|
|
114
|
+
args?: string[]; // Additional CLI arguments
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Secrets Configuration
|
|
119
|
+
|
|
120
|
+
```typescript
|
|
121
|
+
interface SecretsConfig {
|
|
122
|
+
provider?: '1password' | 'vault' | 'env'; // Secret provider
|
|
123
|
+
vault?: string; // Vault name/path
|
|
124
|
+
address?: string; // Vault server address
|
|
125
|
+
items?: Record<string, string>; // Secret references
|
|
126
|
+
envrc?: EnvrcConfig;
|
|
127
|
+
dotenv?: DotenvConfig;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
interface EnvrcConfig {
|
|
131
|
+
generate?: boolean; // Auto-generate .envrc
|
|
132
|
+
path?: string; // Path to .envrc file
|
|
133
|
+
includeLocal?: boolean;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
interface DotenvConfig {
|
|
137
|
+
enabled?: boolean; // Load .env files
|
|
138
|
+
files?: string[]; // .env files to load
|
|
139
|
+
warn?: boolean; // Warn about .env usage
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Context Configuration
|
|
144
|
+
|
|
145
|
+
```typescript
|
|
146
|
+
interface ContextConfig {
|
|
147
|
+
files?: string[]; // Files to include in context
|
|
148
|
+
dirs?: string[]; // Directories to include
|
|
149
|
+
exclude?: string[]; // Patterns to exclude
|
|
150
|
+
generateAgentFiles?: boolean; // Auto-generate AGENTS.md, CLAUDE.md
|
|
151
|
+
templateDir?: string; // Custom template directory
|
|
152
|
+
preserve?: string[]; // Files to preserve during generation
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### MCP Configuration
|
|
157
|
+
|
|
158
|
+
```typescript
|
|
159
|
+
interface McpConfig {
|
|
160
|
+
configFile?: string; // MCP config file path
|
|
161
|
+
servers?: Record<string, McpServerConfig>; // MCP servers
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
interface McpServerConfig {
|
|
165
|
+
enabled?: boolean; // Enable this server
|
|
166
|
+
[key: string]: unknown; // Server-specific config
|
|
167
|
+
}
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## Complete Example
|
|
171
|
+
|
|
172
|
+
```json
|
|
173
|
+
{
|
|
174
|
+
"$schema": "https://unpkg.com/@a3t/rapid-schema@latest/dist/rapid.schema.json",
|
|
175
|
+
"version": "1.0",
|
|
176
|
+
"name": "my-project",
|
|
177
|
+
"container": {
|
|
178
|
+
"devcontainer": ".devcontainer/devcontainer.json",
|
|
179
|
+
"autoStart": true,
|
|
180
|
+
"buildArgs": {
|
|
181
|
+
"NODE_VERSION": "20"
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
"agents": {
|
|
185
|
+
"default": "claude",
|
|
186
|
+
"available": {
|
|
187
|
+
"claude": {
|
|
188
|
+
"cli": "claude",
|
|
189
|
+
"instructionFile": "CLAUDE.md",
|
|
190
|
+
"envVars": ["ANTHROPIC_API_KEY"],
|
|
191
|
+
"installCmd": "npm install -g @anthropic-ai/claude-code"
|
|
192
|
+
},
|
|
193
|
+
"opencode": {
|
|
194
|
+
"cli": "opencode",
|
|
195
|
+
"instructionFile": "AGENTS.md",
|
|
196
|
+
"envVars": ["ANTHROPIC_API_KEY", "OPENAI_API_KEY"],
|
|
197
|
+
"installCmd": "npm install -g opencode"
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
"secrets": {
|
|
202
|
+
"provider": "1password",
|
|
203
|
+
"vault": "Development",
|
|
204
|
+
"items": {
|
|
205
|
+
"ANTHROPIC_API_KEY": "op://Development/Anthropic/api-key",
|
|
206
|
+
"OPENAI_API_KEY": "op://Development/OpenAI/api-key"
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
"context": {
|
|
210
|
+
"files": ["README.md", "CONTRIBUTING.md"],
|
|
211
|
+
"dirs": ["docs/", "src/"],
|
|
212
|
+
"exclude": ["docs/internal/"],
|
|
213
|
+
"generateAgentFiles": true
|
|
214
|
+
},
|
|
215
|
+
"mcp": {
|
|
216
|
+
"configFile": ".mcp.json",
|
|
217
|
+
"servers": {
|
|
218
|
+
"filesystem": {
|
|
219
|
+
"enabled": true
|
|
220
|
+
},
|
|
221
|
+
"github": {
|
|
222
|
+
"enabled": true,
|
|
223
|
+
"repo": "${localEnv:GITHUB_REPOSITORY}"
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
## Variable Substitution
|
|
231
|
+
|
|
232
|
+
Configuration values support variable substitution:
|
|
233
|
+
|
|
234
|
+
| Variable | Description |
|
|
235
|
+
| ---------------------------- | ----------------------------------- |
|
|
236
|
+
| `${env:VAR}` | Environment variable from container |
|
|
237
|
+
| `${localEnv:VAR}` | Environment variable from host |
|
|
238
|
+
| `${workspaceFolder}` | Absolute path to project root |
|
|
239
|
+
| `${workspaceFolderBasename}` | Project directory name |
|
|
240
|
+
|
|
241
|
+
## See Also
|
|
242
|
+
|
|
243
|
+
- [@a3t/rapid](https://www.npmjs.com/package/@a3t/rapid) - CLI tool
|
|
244
|
+
- [@a3t/rapid-core](https://www.npmjs.com/package/@a3t/rapid-core) - Core library
|
|
245
|
+
- [RAPID Documentation](https://getrapid.dev)
|
|
246
|
+
- [rapid.json Specification](https://github.com/a3tai/rapid/docs/reference/rapid.json-spec.md)
|
|
247
|
+
|
|
248
|
+
## License
|
|
249
|
+
|
|
250
|
+
MIT © 2026 Rude Company LLC
|