@brainfile/cli 0.13.2 → 0.13.3
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/CHANGELOG.md +18 -0
- package/dist/cli.js +26 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/mcp.d.ts.map +1 -1
- package/dist/commands/mcp.js +115 -0
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/rules.d.ts +68 -0
- package/dist/commands/rules.d.ts.map +1 -0
- package/dist/commands/rules.js +322 -0
- package/dist/commands/rules.js.map +1 -0
- package/dist/commands/schema.d.ts +31 -0
- package/dist/commands/schema.d.ts.map +1 -0
- package/dist/commands/schema.js +369 -0
- package/dist/commands/schema.js.map +1 -0
- package/dist/schemas/base.json +159 -0
- package/dist/schemas/board.json +198 -0
- package/package.json +3 -2
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Schema command for Brainfile CLI
|
|
4
|
+
*
|
|
5
|
+
* View and manage brainfile schemas locally, eliminating network access for basic usage.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* brainfile schema # List available schemas
|
|
9
|
+
* brainfile schema <name> # Display specific schema
|
|
10
|
+
* brainfile schema update # Check for and download schema updates
|
|
11
|
+
* brainfile schema --json # Output in JSON format
|
|
12
|
+
*
|
|
13
|
+
* @packageDocumentation
|
|
14
|
+
*/
|
|
15
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
18
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
19
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
20
|
+
}
|
|
21
|
+
Object.defineProperty(o, k2, desc);
|
|
22
|
+
}) : (function(o, m, k, k2) {
|
|
23
|
+
if (k2 === undefined) k2 = k;
|
|
24
|
+
o[k2] = m[k];
|
|
25
|
+
}));
|
|
26
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
27
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
28
|
+
}) : function(o, v) {
|
|
29
|
+
o["default"] = v;
|
|
30
|
+
});
|
|
31
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
32
|
+
var ownKeys = function(o) {
|
|
33
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
34
|
+
var ar = [];
|
|
35
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
36
|
+
return ar;
|
|
37
|
+
};
|
|
38
|
+
return ownKeys(o);
|
|
39
|
+
};
|
|
40
|
+
return function (mod) {
|
|
41
|
+
if (mod && mod.__esModule) return mod;
|
|
42
|
+
var result = {};
|
|
43
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
44
|
+
__setModuleDefault(result, mod);
|
|
45
|
+
return result;
|
|
46
|
+
};
|
|
47
|
+
})();
|
|
48
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
49
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
50
|
+
};
|
|
51
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
52
|
+
exports.SCHEMA_COMMAND_HELP = void 0;
|
|
53
|
+
exports.schemaCommand = schemaCommand;
|
|
54
|
+
exports.schemaUpdateCommand = schemaUpdateCommand;
|
|
55
|
+
const fs = __importStar(require("fs"));
|
|
56
|
+
const path = __importStar(require("path"));
|
|
57
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
58
|
+
const logger_1 = require("../utils/logger");
|
|
59
|
+
const cli_error_1 = require("../utils/cli-error");
|
|
60
|
+
const errorHandler_1 = require("../utils/errorHandler");
|
|
61
|
+
const config_1 = require("../utils/config");
|
|
62
|
+
// ============================================================================
|
|
63
|
+
// Constants
|
|
64
|
+
// ============================================================================
|
|
65
|
+
const SCHEMA_BASE_URL = 'https://brainfile.md/v1';
|
|
66
|
+
const CHECK_INTERVAL_MS = 24 * 60 * 60 * 1000; // 24 hours
|
|
67
|
+
// Get bundled schemas directory (relative to this file after compilation)
|
|
68
|
+
function getBundledSchemasDir() {
|
|
69
|
+
// In development: cli/src/schemas
|
|
70
|
+
// In production: cli/dist/schemas
|
|
71
|
+
const distPath = path.join(__dirname, '..', 'schemas');
|
|
72
|
+
const srcPath = path.join(__dirname, '..', '..', 'src', 'schemas');
|
|
73
|
+
if (fs.existsSync(distPath)) {
|
|
74
|
+
return distPath;
|
|
75
|
+
}
|
|
76
|
+
if (fs.existsSync(srcPath)) {
|
|
77
|
+
return srcPath;
|
|
78
|
+
}
|
|
79
|
+
// Fallback for development
|
|
80
|
+
return path.join(__dirname, 'schemas');
|
|
81
|
+
}
|
|
82
|
+
// Schema metadata
|
|
83
|
+
const BUNDLED_SCHEMAS = [
|
|
84
|
+
{
|
|
85
|
+
id: 'board',
|
|
86
|
+
description: 'Board structure (columns, tasks, contracts)',
|
|
87
|
+
file: 'board.json',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
id: 'base',
|
|
91
|
+
description: 'Base types (rules, agent instructions)',
|
|
92
|
+
file: 'base.json',
|
|
93
|
+
},
|
|
94
|
+
];
|
|
95
|
+
// ============================================================================
|
|
96
|
+
// Help Text
|
|
97
|
+
// ============================================================================
|
|
98
|
+
exports.SCHEMA_COMMAND_HELP = `
|
|
99
|
+
Examples:
|
|
100
|
+
brainfile schema # List available schemas
|
|
101
|
+
brainfile schema board # View the board schema
|
|
102
|
+
brainfile schema base # View the base schema
|
|
103
|
+
brainfile schema update # Check for schema updates
|
|
104
|
+
brainfile schema board --json # Output board schema as JSON
|
|
105
|
+
|
|
106
|
+
Bundled schemas:
|
|
107
|
+
board - Board structure (columns, tasks, contracts)
|
|
108
|
+
base - Base types (rules, agent instructions)
|
|
109
|
+
|
|
110
|
+
Notes:
|
|
111
|
+
- Schemas are bundled with the CLI (no network required for basic usage)
|
|
112
|
+
- Use 'schema update' to check for newer versions from brainfile.md
|
|
113
|
+
- Auto-checks once per 24 hours (non-blocking notification)
|
|
114
|
+
`.trimEnd();
|
|
115
|
+
// ============================================================================
|
|
116
|
+
// Main Command
|
|
117
|
+
// ============================================================================
|
|
118
|
+
function schemaCommand(options, logger = logger_1.defaultLogger) {
|
|
119
|
+
const { name, json } = options;
|
|
120
|
+
// Handle update subcommand
|
|
121
|
+
if (name === 'update') {
|
|
122
|
+
return schemaUpdateCommand({ json }, logger);
|
|
123
|
+
}
|
|
124
|
+
// Handle show specific schema
|
|
125
|
+
if (name) {
|
|
126
|
+
return schemaShowCommand(name, { json }, logger);
|
|
127
|
+
}
|
|
128
|
+
// List all schemas
|
|
129
|
+
return schemaListCommand({ json }, logger);
|
|
130
|
+
}
|
|
131
|
+
// ============================================================================
|
|
132
|
+
// List Schemas
|
|
133
|
+
// ============================================================================
|
|
134
|
+
function schemaListCommand(options, logger) {
|
|
135
|
+
if (options.json) {
|
|
136
|
+
const output = {
|
|
137
|
+
schemas: BUNDLED_SCHEMAS.map((s) => ({
|
|
138
|
+
id: s.id,
|
|
139
|
+
description: s.description,
|
|
140
|
+
})),
|
|
141
|
+
};
|
|
142
|
+
logger.log(JSON.stringify(output, null, 2));
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
logger.log('');
|
|
146
|
+
logger.log(chalk_1.default.bold('Available schemas:'));
|
|
147
|
+
logger.log('');
|
|
148
|
+
const maxIdLen = Math.max(...BUNDLED_SCHEMAS.map((s) => s.id.length));
|
|
149
|
+
for (const schema of BUNDLED_SCHEMAS) {
|
|
150
|
+
logger.log(` ${chalk_1.default.cyan(schema.id.padEnd(maxIdLen))} ${chalk_1.default.gray('-')} ${schema.description}`);
|
|
151
|
+
}
|
|
152
|
+
logger.log('');
|
|
153
|
+
logger.log(chalk_1.default.gray('Run: brainfile schema <name> to view schema'));
|
|
154
|
+
logger.log(chalk_1.default.gray('Run: brainfile schema update to check for updates'));
|
|
155
|
+
}
|
|
156
|
+
// Check for auto-update (non-blocking)
|
|
157
|
+
checkAutoUpdate(logger);
|
|
158
|
+
return {
|
|
159
|
+
success: true,
|
|
160
|
+
action: 'list',
|
|
161
|
+
schemas: BUNDLED_SCHEMAS.map((s) => s.id),
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
// ============================================================================
|
|
165
|
+
// Show Schema
|
|
166
|
+
// ============================================================================
|
|
167
|
+
function schemaShowCommand(name, options, logger) {
|
|
168
|
+
const schemaInfo = BUNDLED_SCHEMAS.find((s) => s.id === name);
|
|
169
|
+
if (!schemaInfo) {
|
|
170
|
+
const availableIds = BUNDLED_SCHEMAS.map((s) => s.id).join(', ');
|
|
171
|
+
throw new cli_error_1.CLIError(`Unknown schema: ${name}`, errorHandler_1.ExitCode.USER_ERROR, `Available schemas: ${availableIds}`);
|
|
172
|
+
}
|
|
173
|
+
const schemasDir = getBundledSchemasDir();
|
|
174
|
+
const schemaPath = path.join(schemasDir, schemaInfo.file);
|
|
175
|
+
if (!fs.existsSync(schemaPath)) {
|
|
176
|
+
throw new cli_error_1.CLIError(`Schema file not found: ${schemaInfo.file}`, errorHandler_1.ExitCode.USER_ERROR, `Expected at: ${schemaPath}`);
|
|
177
|
+
}
|
|
178
|
+
const content = fs.readFileSync(schemaPath, 'utf-8');
|
|
179
|
+
const schema = JSON.parse(content);
|
|
180
|
+
if (options.json) {
|
|
181
|
+
logger.log(JSON.stringify(schema, null, 2));
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
logger.log('');
|
|
185
|
+
logger.log(chalk_1.default.bold(`Schema: ${name}`));
|
|
186
|
+
logger.log(chalk_1.default.gray(`Description: ${schemaInfo.description}`));
|
|
187
|
+
logger.log(chalk_1.default.gray(`Source: ${SCHEMA_BASE_URL}/${schemaInfo.file}`));
|
|
188
|
+
logger.log('');
|
|
189
|
+
logger.log(JSON.stringify(schema, null, 2));
|
|
190
|
+
}
|
|
191
|
+
return {
|
|
192
|
+
success: true,
|
|
193
|
+
action: 'show',
|
|
194
|
+
schema,
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
// ============================================================================
|
|
198
|
+
// Update Schemas
|
|
199
|
+
// ============================================================================
|
|
200
|
+
async function fetchWithTimeout(url, timeoutMs) {
|
|
201
|
+
const controller = new AbortController();
|
|
202
|
+
const timeout = setTimeout(() => controller.abort(), timeoutMs);
|
|
203
|
+
try {
|
|
204
|
+
const response = await fetch(url, { signal: controller.signal });
|
|
205
|
+
return response;
|
|
206
|
+
}
|
|
207
|
+
finally {
|
|
208
|
+
clearTimeout(timeout);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
function schemaUpdateCommand(options, logger = logger_1.defaultLogger) {
|
|
212
|
+
// Run the async update and handle synchronously for CLI
|
|
213
|
+
schemaUpdateAsync(options, logger);
|
|
214
|
+
return {
|
|
215
|
+
success: true,
|
|
216
|
+
action: 'update',
|
|
217
|
+
updated: false, // Will be updated by async function
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
async function schemaUpdateAsync(options, logger) {
|
|
221
|
+
if (!options.json) {
|
|
222
|
+
logger.log('');
|
|
223
|
+
logger.log(chalk_1.default.bold('Checking for schema updates...'));
|
|
224
|
+
logger.log('');
|
|
225
|
+
}
|
|
226
|
+
const schemasDir = getBundledSchemasDir();
|
|
227
|
+
const results = [];
|
|
228
|
+
for (const schemaInfo of BUNDLED_SCHEMAS) {
|
|
229
|
+
const url = `${SCHEMA_BASE_URL}/${schemaInfo.file}`;
|
|
230
|
+
const localPath = path.join(schemasDir, schemaInfo.file);
|
|
231
|
+
try {
|
|
232
|
+
const response = await fetchWithTimeout(url, 10000);
|
|
233
|
+
if (!response.ok) {
|
|
234
|
+
results.push({
|
|
235
|
+
id: schemaInfo.id,
|
|
236
|
+
status: 'error',
|
|
237
|
+
error: `HTTP ${response.status}`,
|
|
238
|
+
});
|
|
239
|
+
continue;
|
|
240
|
+
}
|
|
241
|
+
const remoteContent = await response.text();
|
|
242
|
+
const remoteSchema = JSON.parse(remoteContent);
|
|
243
|
+
// Compare with local
|
|
244
|
+
let localSchema = null;
|
|
245
|
+
if (fs.existsSync(localPath)) {
|
|
246
|
+
const localContent = fs.readFileSync(localPath, 'utf-8');
|
|
247
|
+
localSchema = JSON.parse(localContent);
|
|
248
|
+
}
|
|
249
|
+
// Simple comparison using JSON stringification
|
|
250
|
+
const remoteStr = JSON.stringify(remoteSchema);
|
|
251
|
+
const localStr = localSchema ? JSON.stringify(localSchema) : '';
|
|
252
|
+
if (remoteStr !== localStr) {
|
|
253
|
+
// Update local schema
|
|
254
|
+
fs.writeFileSync(localPath, JSON.stringify(remoteSchema, null, 2));
|
|
255
|
+
results.push({ id: schemaInfo.id, status: 'updated' });
|
|
256
|
+
}
|
|
257
|
+
else {
|
|
258
|
+
results.push({ id: schemaInfo.id, status: 'current' });
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
catch (error) {
|
|
262
|
+
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
263
|
+
results.push({ id: schemaInfo.id, status: 'error', error: errorMsg });
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
// Update last check time
|
|
267
|
+
updateLastCheckTime();
|
|
268
|
+
// Output results
|
|
269
|
+
if (options.json) {
|
|
270
|
+
logger.log(JSON.stringify({ schemas: results }, null, 2));
|
|
271
|
+
}
|
|
272
|
+
else {
|
|
273
|
+
for (const result of results) {
|
|
274
|
+
if (result.status === 'updated') {
|
|
275
|
+
logger.log(` ${chalk_1.default.green('+')} ${chalk_1.default.cyan(result.id)} - Updated`);
|
|
276
|
+
}
|
|
277
|
+
else if (result.status === 'current') {
|
|
278
|
+
logger.log(` ${chalk_1.default.gray('=')} ${chalk_1.default.cyan(result.id)} - Up to date`);
|
|
279
|
+
}
|
|
280
|
+
else {
|
|
281
|
+
logger.log(` ${chalk_1.default.red('!')} ${chalk_1.default.cyan(result.id)} - Error: ${result.error}`);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
const updatedCount = results.filter((r) => r.status === 'updated').length;
|
|
285
|
+
logger.log('');
|
|
286
|
+
if (updatedCount > 0) {
|
|
287
|
+
logger.log(chalk_1.default.green(`Updated ${updatedCount} schema(s)`));
|
|
288
|
+
}
|
|
289
|
+
else {
|
|
290
|
+
logger.log(chalk_1.default.gray('All schemas are up to date'));
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
// ============================================================================
|
|
295
|
+
// Auto-Update Check
|
|
296
|
+
// ============================================================================
|
|
297
|
+
function getSchemaConfig() {
|
|
298
|
+
const config = (0, config_1.loadConfig)();
|
|
299
|
+
return config.schema || {};
|
|
300
|
+
}
|
|
301
|
+
function saveSchemaConfig(schemaConfig) {
|
|
302
|
+
const config = (0, config_1.loadConfig)();
|
|
303
|
+
config.schema = schemaConfig;
|
|
304
|
+
(0, config_1.saveConfig)(config);
|
|
305
|
+
}
|
|
306
|
+
function updateLastCheckTime() {
|
|
307
|
+
const schemaConfig = getSchemaConfig();
|
|
308
|
+
schemaConfig.lastCheck = new Date().toISOString();
|
|
309
|
+
saveSchemaConfig(schemaConfig);
|
|
310
|
+
}
|
|
311
|
+
function shouldAutoCheck() {
|
|
312
|
+
const schemaConfig = getSchemaConfig();
|
|
313
|
+
if (!schemaConfig.lastCheck) {
|
|
314
|
+
return true;
|
|
315
|
+
}
|
|
316
|
+
const lastCheck = new Date(schemaConfig.lastCheck).getTime();
|
|
317
|
+
const now = Date.now();
|
|
318
|
+
return now - lastCheck > CHECK_INTERVAL_MS;
|
|
319
|
+
}
|
|
320
|
+
function checkAutoUpdate(logger) {
|
|
321
|
+
if (!shouldAutoCheck()) {
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
// Run async check in background (non-blocking)
|
|
325
|
+
checkForUpdatesAsync(logger).catch(() => {
|
|
326
|
+
// Silently ignore errors during auto-check
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
async function checkForUpdatesAsync(logger) {
|
|
330
|
+
const schemasDir = getBundledSchemasDir();
|
|
331
|
+
let hasUpdates = false;
|
|
332
|
+
for (const schemaInfo of BUNDLED_SCHEMAS) {
|
|
333
|
+
const url = `${SCHEMA_BASE_URL}/${schemaInfo.file}`;
|
|
334
|
+
const localPath = path.join(schemasDir, schemaInfo.file);
|
|
335
|
+
try {
|
|
336
|
+
const response = await fetchWithTimeout(url, 5000);
|
|
337
|
+
if (!response.ok) {
|
|
338
|
+
continue;
|
|
339
|
+
}
|
|
340
|
+
const remoteContent = await response.text();
|
|
341
|
+
const remoteSchema = JSON.parse(remoteContent);
|
|
342
|
+
// Compare with local
|
|
343
|
+
if (fs.existsSync(localPath)) {
|
|
344
|
+
const localContent = fs.readFileSync(localPath, 'utf-8');
|
|
345
|
+
const localSchema = JSON.parse(localContent);
|
|
346
|
+
const remoteStr = JSON.stringify(remoteSchema);
|
|
347
|
+
const localStr = JSON.stringify(localSchema);
|
|
348
|
+
if (remoteStr !== localStr) {
|
|
349
|
+
hasUpdates = true;
|
|
350
|
+
break;
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
catch {
|
|
355
|
+
// Silently ignore errors during auto-check
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
// Update last check time
|
|
359
|
+
updateLastCheckTime();
|
|
360
|
+
// Notify user if updates available
|
|
361
|
+
if (hasUpdates) {
|
|
362
|
+
logger.log('');
|
|
363
|
+
logger.log(chalk_1.default.yellow('Hint: ') +
|
|
364
|
+
'Schema updates available. Run ' +
|
|
365
|
+
chalk_1.default.cyan('brainfile schema update') +
|
|
366
|
+
' to update.');
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/commands/schema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SAAS;YACX,CAAC;YAED,MAAM,aAAa,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;YAC5C,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;YAE/C,qBAAqB;YACrB,IAAI,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;gBAC7B,MAAM,YAAY,GAAG,EAAE,CAAC,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;gBACzD,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;gBAE7C,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;gBAC/C,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;gBAE7C,IAAI,SAAS,KAAK,QAAQ,EAAE,CAAC;oBAC3B,UAAU,GAAG,IAAI,CAAC;oBAClB,MAAM;gBACR,CAAC;YACH,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,2CAA2C;QAC7C,CAAC;IACH,CAAC;IAED,yBAAyB;IACzB,mBAAmB,EAAE,CAAC;IAEtB,mCAAmC;IACnC,IAAI,UAAU,EAAE,CAAC;QACf,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACf,MAAM,CAAC,GAAG,CACR,eAAK,CAAC,MAAM,CAAC,QAAQ,CAAC;YACpB,gCAAgC;YAChC,eAAK,CAAC,IAAI,CAAC,yBAAyB,CAAC;YACrC,aAAa,CAChB,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://brainfile.md/v1/base.json",
|
|
4
|
+
"title": "Brainfile Base Schema",
|
|
5
|
+
"description": "Base schema that all brainfile types extend. Defines shared fields across all types. Community types can extend this schema with custom fields.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["title"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"type": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"description": "Type identifier. Default: board.",
|
|
12
|
+
"minLength": 1,
|
|
13
|
+
"examples": ["board"]
|
|
14
|
+
},
|
|
15
|
+
"schema": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "Schema URL for validation. Official types default to brainfile.md/v1/{type}.json. Community types MUST provide a schema URL for validation. Can be a remote URI (https://) or local file path.",
|
|
18
|
+
"examples": [
|
|
19
|
+
"https://brainfile.md/v1/board.json"
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
"title": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"description": "Title of the brainfile",
|
|
25
|
+
"minLength": 1,
|
|
26
|
+
"examples": ["My Project", "Dev Log 2025", "Reading List"]
|
|
27
|
+
},
|
|
28
|
+
"protocolVersion": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"description": "Version of the Brainfile protocol this file uses",
|
|
31
|
+
"pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$",
|
|
32
|
+
"default": "1.0.0"
|
|
33
|
+
},
|
|
34
|
+
"agent": {
|
|
35
|
+
"type": "object",
|
|
36
|
+
"description": "Instructions for AI agents interacting with the brainfile",
|
|
37
|
+
"properties": {
|
|
38
|
+
"instructions": {
|
|
39
|
+
"type": "array",
|
|
40
|
+
"description": "List of instructions for AI agents",
|
|
41
|
+
"items": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"minLength": 1
|
|
44
|
+
},
|
|
45
|
+
"examples": [
|
|
46
|
+
["Modify only the YAML frontmatter", "Preserve all IDs", "Use ISO dates for entries"]
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
"llmNotes": {
|
|
50
|
+
"type": "string",
|
|
51
|
+
"description": "Free-form notes about how this project prefers AI work to be structured"
|
|
52
|
+
},
|
|
53
|
+
"tools": {
|
|
54
|
+
"type": "object",
|
|
55
|
+
"description": "CLI tools and commands available for agents to use. Reduces token usage vs manual file editing.",
|
|
56
|
+
"additionalProperties": {
|
|
57
|
+
"type": "object",
|
|
58
|
+
"description": "Tool configuration",
|
|
59
|
+
"properties": {
|
|
60
|
+
"description": {
|
|
61
|
+
"type": "string",
|
|
62
|
+
"description": "What this tool is for"
|
|
63
|
+
},
|
|
64
|
+
"alias": {
|
|
65
|
+
"type": "string",
|
|
66
|
+
"description": "Command alias if different from tool name"
|
|
67
|
+
},
|
|
68
|
+
"prefer": {
|
|
69
|
+
"type": ["boolean", "string"],
|
|
70
|
+
"description": "Whether to prefer this tool, or a note about when to prefer it"
|
|
71
|
+
},
|
|
72
|
+
"commands": {
|
|
73
|
+
"type": "array",
|
|
74
|
+
"description": "Available commands with their syntax",
|
|
75
|
+
"items": {
|
|
76
|
+
"type": "string"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"additionalProperties": true
|
|
81
|
+
},
|
|
82
|
+
"examples": [
|
|
83
|
+
{
|
|
84
|
+
"brainfile": {
|
|
85
|
+
"prefer": true,
|
|
86
|
+
"commands": ["move --task <id> --column <id>", "add --title \"...\" --column <id>", "list"]
|
|
87
|
+
},
|
|
88
|
+
"ripgrep": {
|
|
89
|
+
"alias": "rg",
|
|
90
|
+
"prefer": "use for all file content searches"
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"additionalProperties": true
|
|
97
|
+
},
|
|
98
|
+
"rules": {
|
|
99
|
+
"type": "object",
|
|
100
|
+
"description": "Project rules organized by category",
|
|
101
|
+
"properties": {
|
|
102
|
+
"always": {
|
|
103
|
+
"type": "array",
|
|
104
|
+
"description": "Rules that must always be followed",
|
|
105
|
+
"items": {
|
|
106
|
+
"$ref": "#/definitions/rule"
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
"never": {
|
|
110
|
+
"type": "array",
|
|
111
|
+
"description": "Rules that must never be violated",
|
|
112
|
+
"items": {
|
|
113
|
+
"$ref": "#/definitions/rule"
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
"prefer": {
|
|
117
|
+
"type": "array",
|
|
118
|
+
"description": "Preferred approaches or patterns",
|
|
119
|
+
"items": {
|
|
120
|
+
"$ref": "#/definitions/rule"
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
"context": {
|
|
124
|
+
"type": "array",
|
|
125
|
+
"description": "Contextual information and constraints",
|
|
126
|
+
"items": {
|
|
127
|
+
"$ref": "#/definitions/rule"
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
"additionalProperties": true
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
"additionalProperties": true,
|
|
135
|
+
"definitions": {
|
|
136
|
+
"rule": {
|
|
137
|
+
"type": "object",
|
|
138
|
+
"required": ["id", "rule"],
|
|
139
|
+
"properties": {
|
|
140
|
+
"id": {
|
|
141
|
+
"type": ["integer", "string"],
|
|
142
|
+
"description": "Unique identifier within the rule category"
|
|
143
|
+
},
|
|
144
|
+
"rule": {
|
|
145
|
+
"type": "string",
|
|
146
|
+
"description": "The rule text",
|
|
147
|
+
"minLength": 1
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
"additionalProperties": true
|
|
151
|
+
},
|
|
152
|
+
"timestamp": {
|
|
153
|
+
"type": "string",
|
|
154
|
+
"description": "ISO 8601 timestamp",
|
|
155
|
+
"format": "date-time",
|
|
156
|
+
"examples": ["2025-11-24T10:30:00Z", "2025-11-24T14:22:00-08:00"]
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|