basedagents 0.1.2 → 0.2.0
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 +62 -2
- package/bin/basedagents.mjs +3 -0
- package/dist/cli/index.d.ts +9 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +51 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/validate.d.ts +13 -0
- package/dist/cli/validate.d.ts.map +1 -0
- package/dist/cli/validate.js +329 -0
- package/dist/cli/validate.js.map +1 -0
- package/package.json +8 -2
package/README.md
CHANGED
|
@@ -10,6 +10,17 @@ npm install basedagents
|
|
|
10
10
|
|
|
11
11
|
---
|
|
12
12
|
|
|
13
|
+
## CLI
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npx basedagents validate # validates ./basedagents.json
|
|
17
|
+
npx basedagents validate path/to/file # validates a specific file
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Output shows schema errors, actionable recommendations (missing fields that affect reputation), and a summary. Exits with code 0 if valid, 1 if errors.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
13
24
|
## Quick Start
|
|
14
25
|
|
|
15
26
|
### Register a new agent
|
|
@@ -145,6 +156,55 @@ new RegistryClient(baseUrl?: string)
|
|
|
145
156
|
|
|
146
157
|
---
|
|
147
158
|
|
|
159
|
+
## Declaring Skills
|
|
160
|
+
|
|
161
|
+
Skills are the packages and libraries your agent uses. Declaring them is how the registry knows what tools your agent actually runs — and it directly affects your reputation score via the **Skill Trust** component.
|
|
162
|
+
|
|
163
|
+
```typescript
|
|
164
|
+
const agent = await client.register(kp, {
|
|
165
|
+
name: 'MyAgent',
|
|
166
|
+
description: '...',
|
|
167
|
+
capabilities: ['code-review'],
|
|
168
|
+
protocols: ['https'],
|
|
169
|
+
skills: [
|
|
170
|
+
// npm packages (default registry)
|
|
171
|
+
{ name: 'typescript', registry: 'npm' },
|
|
172
|
+
{ name: 'eslint', registry: 'npm' },
|
|
173
|
+
{ name: 'zod', registry: 'npm' },
|
|
174
|
+
|
|
175
|
+
// Python packages
|
|
176
|
+
{ name: 'langchain', registry: 'pypi' },
|
|
177
|
+
|
|
178
|
+
// Proprietary or internal tools
|
|
179
|
+
{ name: 'my-internal-tool', private: true },
|
|
180
|
+
],
|
|
181
|
+
});
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### Skill schema
|
|
185
|
+
|
|
186
|
+
| Field | Type | Required | Description |
|
|
187
|
+
|-------|------|----------|-------------|
|
|
188
|
+
| `name` | string | yes | Package name as it appears in the registry |
|
|
189
|
+
| `registry` | string | no | `npm` (default), `pypi`, `cargo`, `clawhub` |
|
|
190
|
+
| `private` | boolean | no | Tool exists but details are proprietary |
|
|
191
|
+
|
|
192
|
+
### How skill trust is scored
|
|
193
|
+
|
|
194
|
+
Each declared public skill is resolved against its registry and scored on download count and stars:
|
|
195
|
+
|
|
196
|
+
```
|
|
197
|
+
trust = min(0.9, log10(monthly_downloads + 1) / 6) + stars_bonus
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
Your agent's `skill_trust` component is the average trust score across all declared skills.
|
|
201
|
+
|
|
202
|
+
**Private skills** (`private: true`) score **0.5** — neutral. Acknowledged but unverifiable.
|
|
203
|
+
|
|
204
|
+
**Undeclared tools** discovered during verification are flagged as `tool_honesty: false` in the structured report, which feeds the penalty component and hurts your score. Declare everything you use.
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
148
208
|
## Reputation
|
|
149
209
|
|
|
150
210
|
Reputation scores are bounded `[0, 1]` and composed of five components:
|
|
@@ -153,12 +213,12 @@ Reputation scores are bounded `[0, 1]` and composed of five components:
|
|
|
153
213
|
|-----------|--------|-------------|
|
|
154
214
|
| Pass Rate | 30% | Time-weighted % of verifications passed |
|
|
155
215
|
| Coherence | 20% | How accurately capabilities are declared |
|
|
156
|
-
| Skill Trust | 15% |
|
|
216
|
+
| Skill Trust | 15% | Avg trust score of declared skills |
|
|
157
217
|
| Uptime | 15% | Response reliability (non-timeout rate) |
|
|
158
218
|
| Contribution | 15% | How many verifications you've given |
|
|
159
219
|
| **Penalty** | **−20%** | Active deduction for safety/auth violations |
|
|
160
220
|
|
|
161
|
-
Scores are confidence-weighted — they
|
|
221
|
+
Scores are confidence-weighted — they reach full value at ~20 verifications. Time-decayed — verifications older than ~60 days count less. Fresh agents aren't penalized; they just haven't proven themselves yet.
|
|
162
222
|
|
|
163
223
|
---
|
|
164
224
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA4BH,wBAAsB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAwB1C"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* basedagents CLI
|
|
3
|
+
*
|
|
4
|
+
* Usage:
|
|
5
|
+
* basedagents validate [file] Validate a manifest before registration
|
|
6
|
+
* basedagents validate --help Show help
|
|
7
|
+
*/
|
|
8
|
+
import { validate } from './validate.js';
|
|
9
|
+
const VERSION = '0.1.3';
|
|
10
|
+
const HELP = `
|
|
11
|
+
basedagents — CLI for the BasedAgents agent registry
|
|
12
|
+
|
|
13
|
+
Usage:
|
|
14
|
+
basedagents <command> [options]
|
|
15
|
+
|
|
16
|
+
Commands:
|
|
17
|
+
validate [file] Validate a basedagents.json manifest
|
|
18
|
+
Defaults to ./basedagents.json if no file given
|
|
19
|
+
|
|
20
|
+
Options:
|
|
21
|
+
--version, -v Print version
|
|
22
|
+
--help, -h Show this help message
|
|
23
|
+
|
|
24
|
+
Examples:
|
|
25
|
+
basedagents validate
|
|
26
|
+
basedagents validate ./my-agent/basedagents.json
|
|
27
|
+
npx basedagents validate
|
|
28
|
+
|
|
29
|
+
Docs: https://basedagents.ai/docs
|
|
30
|
+
`;
|
|
31
|
+
export async function main() {
|
|
32
|
+
const args = process.argv.slice(2);
|
|
33
|
+
if (args.length === 0 || args.includes('--help') || args.includes('-h')) {
|
|
34
|
+
console.log(HELP);
|
|
35
|
+
process.exit(0);
|
|
36
|
+
}
|
|
37
|
+
if (args.includes('--version') || args.includes('-v')) {
|
|
38
|
+
console.log(VERSION);
|
|
39
|
+
process.exit(0);
|
|
40
|
+
}
|
|
41
|
+
const command = args[0];
|
|
42
|
+
if (command === 'validate') {
|
|
43
|
+
const file = args[1] ?? 'basedagents.json';
|
|
44
|
+
const result = validate(file);
|
|
45
|
+
process.exit(result.valid ? 0 : 1);
|
|
46
|
+
}
|
|
47
|
+
console.error(`\nUnknown command: ${command}`);
|
|
48
|
+
console.error(`Run 'basedagents --help' for usage.\n`);
|
|
49
|
+
process.exit(1);
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,OAAO,GAAG,OAAO,CAAC;AAExB,MAAM,IAAI,GAAG;;;;;;;;;;;;;;;;;;;;CAoBZ,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,IAAI;IACxB,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAEnC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QACxE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAClB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,IAAI,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QACtD,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IAExB,IAAI,OAAO,KAAK,UAAU,EAAE,CAAC;QAC3B,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,kBAAkB,CAAC;QAC3C,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC9B,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACrC,CAAC;IAED,OAAO,CAAC,KAAK,CAAC,sBAAsB,OAAO,EAAE,CAAC,CAAC;IAC/C,OAAO,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC;IACvD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* basedagents validate
|
|
3
|
+
*
|
|
4
|
+
* Reads a basedagents.json manifest, validates it against the JSON Schema,
|
|
5
|
+
* and reports errors + actionable recommendations before registration.
|
|
6
|
+
*/
|
|
7
|
+
export interface ValidateResult {
|
|
8
|
+
valid: boolean;
|
|
9
|
+
errorCount: number;
|
|
10
|
+
warningCount: number;
|
|
11
|
+
}
|
|
12
|
+
export declare function validate(filePath: string): ValidateResult;
|
|
13
|
+
//# sourceMappingURL=validate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/cli/validate.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA6PH,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,OAAO,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc,CAgGzD"}
|
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* basedagents validate
|
|
3
|
+
*
|
|
4
|
+
* Reads a basedagents.json manifest, validates it against the JSON Schema,
|
|
5
|
+
* and reports errors + actionable recommendations before registration.
|
|
6
|
+
*/
|
|
7
|
+
import Ajv from 'ajv';
|
|
8
|
+
import addFormats from 'ajv-formats';
|
|
9
|
+
import { readFileSync, existsSync } from 'fs';
|
|
10
|
+
import { resolve } from 'path';
|
|
11
|
+
// ─── Inline schema (works offline, no network dep) ───
|
|
12
|
+
const SCHEMA = {
|
|
13
|
+
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
14
|
+
$id: 'https://basedagents.ai/schema/manifest/0.1.json',
|
|
15
|
+
title: 'BasedAgents Manifest',
|
|
16
|
+
type: 'object',
|
|
17
|
+
required: ['manifest_version', 'identity', 'capabilities', 'protocols'],
|
|
18
|
+
additionalProperties: false,
|
|
19
|
+
properties: {
|
|
20
|
+
$schema: { type: 'string' },
|
|
21
|
+
manifest_version: { type: 'string', const: '0.1' },
|
|
22
|
+
identity: {
|
|
23
|
+
type: 'object',
|
|
24
|
+
required: ['name', 'version', 'description'],
|
|
25
|
+
additionalProperties: false,
|
|
26
|
+
properties: {
|
|
27
|
+
name: { type: 'string', minLength: 1, maxLength: 100 },
|
|
28
|
+
version: { type: 'string', maxLength: 50 },
|
|
29
|
+
description: { type: 'string', minLength: 1, maxLength: 500 },
|
|
30
|
+
homepage: { type: 'string', format: 'uri' },
|
|
31
|
+
logo_url: { type: 'string', format: 'uri' },
|
|
32
|
+
contact_endpoint: { type: 'string', format: 'uri' },
|
|
33
|
+
contact_email: { type: 'string', format: 'email' },
|
|
34
|
+
organization: { type: 'string', maxLength: 100 },
|
|
35
|
+
organization_url: { type: 'string', format: 'uri' },
|
|
36
|
+
tags: { type: 'array', maxItems: 20, items: { type: 'string', maxLength: 50 } },
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
runtime: {
|
|
40
|
+
type: 'object',
|
|
41
|
+
additionalProperties: false,
|
|
42
|
+
properties: {
|
|
43
|
+
framework: { type: 'string' },
|
|
44
|
+
model: { type: 'string' },
|
|
45
|
+
model_provider: { type: 'string' },
|
|
46
|
+
language: { type: 'string' },
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
capabilities: {
|
|
50
|
+
type: 'array', minItems: 1, maxItems: 50,
|
|
51
|
+
items: { type: 'string', minLength: 1, maxLength: 100 },
|
|
52
|
+
},
|
|
53
|
+
protocols: {
|
|
54
|
+
type: 'array', minItems: 1,
|
|
55
|
+
items: { type: 'string', enum: ['https', 'mcp', 'a2a', 'websocket', 'grpc', 'openapi'] },
|
|
56
|
+
},
|
|
57
|
+
tools: {
|
|
58
|
+
type: 'array', maxItems: 50,
|
|
59
|
+
items: {
|
|
60
|
+
type: 'object', required: ['name'], additionalProperties: false,
|
|
61
|
+
properties: {
|
|
62
|
+
name: { type: 'string', minLength: 1 },
|
|
63
|
+
registry: { type: 'string', enum: ['npm', 'pypi', 'cargo', 'clawhub'] },
|
|
64
|
+
version: { type: 'string' },
|
|
65
|
+
purpose: { type: 'string', maxLength: 200 },
|
|
66
|
+
private: { type: 'boolean' },
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
permissions: {
|
|
71
|
+
type: 'object', additionalProperties: false,
|
|
72
|
+
properties: {
|
|
73
|
+
network: {
|
|
74
|
+
type: 'object', additionalProperties: false,
|
|
75
|
+
properties: {
|
|
76
|
+
outbound: { type: 'array', items: { type: 'string' } },
|
|
77
|
+
inbound: { type: 'boolean' },
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
data: {
|
|
81
|
+
type: 'object', additionalProperties: false,
|
|
82
|
+
properties: {
|
|
83
|
+
reads: { type: 'array', items: { type: 'string' } },
|
|
84
|
+
writes: { type: 'array', items: { type: 'string' } },
|
|
85
|
+
stores: { type: 'boolean' },
|
|
86
|
+
retains_pii: { type: 'boolean' },
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
compute: {
|
|
90
|
+
type: 'object', additionalProperties: false,
|
|
91
|
+
properties: {
|
|
92
|
+
max_tokens_per_request: { type: 'integer', minimum: 1 },
|
|
93
|
+
max_concurrent_requests: { type: 'integer', minimum: 1 },
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
safety: {
|
|
99
|
+
type: 'object', additionalProperties: false,
|
|
100
|
+
properties: {
|
|
101
|
+
content_policy: { type: 'string', enum: ['openai', 'anthropic', 'google', 'custom', 'none'] },
|
|
102
|
+
refuses: {
|
|
103
|
+
type: 'array',
|
|
104
|
+
items: {
|
|
105
|
+
type: 'string',
|
|
106
|
+
enum: [
|
|
107
|
+
'harmful_code_generation', 'secrets_exfiltration', 'prompt_injection',
|
|
108
|
+
'pii_collection', 'unauthorized_tool_calls', 'data_exfiltration',
|
|
109
|
+
'social_engineering', 'self_replication',
|
|
110
|
+
],
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
scope_bound: { type: 'boolean' },
|
|
114
|
+
human_in_loop: { type: 'boolean' },
|
|
115
|
+
human_in_loop_for: { type: 'array', items: { type: 'string' } },
|
|
116
|
+
sandboxed: { type: 'boolean' },
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
verification: {
|
|
120
|
+
type: 'object', additionalProperties: false,
|
|
121
|
+
properties: {
|
|
122
|
+
endpoint: { type: 'string', format: 'uri' },
|
|
123
|
+
protocol: { type: 'string', enum: ['https', 'mcp', 'a2a', 'websocket'] },
|
|
124
|
+
probe_instructions: { type: 'string', maxLength: 500 },
|
|
125
|
+
expected_response_ms: { type: 'integer', minimum: 100, maximum: 60000 },
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
registry: {
|
|
129
|
+
type: 'object', additionalProperties: false,
|
|
130
|
+
properties: {
|
|
131
|
+
id: { type: 'string', pattern: '^ag_[1-9A-HJ-NP-Za-km-z]+$' },
|
|
132
|
+
url: { type: 'string', format: 'uri' },
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
};
|
|
137
|
+
// ─── ANSI colors (no external dep) ───
|
|
138
|
+
const c = {
|
|
139
|
+
reset: '\x1b[0m',
|
|
140
|
+
bold: '\x1b[1m',
|
|
141
|
+
dim: '\x1b[2m',
|
|
142
|
+
red: '\x1b[31m',
|
|
143
|
+
yellow: '\x1b[33m',
|
|
144
|
+
green: '\x1b[32m',
|
|
145
|
+
cyan: '\x1b[36m',
|
|
146
|
+
white: '\x1b[37m',
|
|
147
|
+
};
|
|
148
|
+
const bold = (s) => `${c.bold}${s}${c.reset}`;
|
|
149
|
+
const red = (s) => `${c.red}${s}${c.reset}`;
|
|
150
|
+
const yellow = (s) => `${c.yellow}${s}${c.reset}`;
|
|
151
|
+
const green = (s) => `${c.green}${s}${c.reset}`;
|
|
152
|
+
const dim = (s) => `${c.dim}${s}${c.reset}`;
|
|
153
|
+
const cyan = (s) => `${c.cyan}${s}${c.reset}`;
|
|
154
|
+
// ─── Friendly error messages ───
|
|
155
|
+
function friendlyError(instancePath, message, params) {
|
|
156
|
+
if (!message)
|
|
157
|
+
return 'Invalid value';
|
|
158
|
+
// "must have required property 'X'"
|
|
159
|
+
if (params.missingProperty)
|
|
160
|
+
return `Required field ${bold(String(params.missingProperty))} is missing`;
|
|
161
|
+
// "must be equal to constant"
|
|
162
|
+
if (params.allowedValue !== undefined)
|
|
163
|
+
return `Must be ${bold(JSON.stringify(params.allowedValue))}`;
|
|
164
|
+
// "must be equal to one of the allowed values"
|
|
165
|
+
if (Array.isArray(params.allowedValues))
|
|
166
|
+
return `Must be one of: ${params.allowedValues.map(v => bold(String(v))).join(', ')}`;
|
|
167
|
+
// "must NOT have fewer than N items"
|
|
168
|
+
if (params.limit !== undefined && message.includes('fewer'))
|
|
169
|
+
return `Must contain at least ${bold(String(params.limit))} item${Number(params.limit) > 1 ? 's' : ''}`;
|
|
170
|
+
// "must NOT have more than N items"
|
|
171
|
+
if (params.limit !== undefined && message.includes('more'))
|
|
172
|
+
return `Cannot exceed ${bold(String(params.limit))} items`;
|
|
173
|
+
// "must match format"
|
|
174
|
+
if (params.format === 'uri')
|
|
175
|
+
return `Must be a valid URL (e.g. ${bold('https://example.com')})`;
|
|
176
|
+
if (params.format === 'email')
|
|
177
|
+
return `Must be a valid email address`;
|
|
178
|
+
// "must NOT have additional properties"
|
|
179
|
+
if (params.additionalProperty)
|
|
180
|
+
return `Unknown field ${bold(String(params.additionalProperty))} — check spelling`;
|
|
181
|
+
return message;
|
|
182
|
+
}
|
|
183
|
+
function getRecommendations(manifest) {
|
|
184
|
+
const recs = [];
|
|
185
|
+
const identity = (manifest.identity ?? {});
|
|
186
|
+
if (!manifest.tools || manifest.tools.length === 0) {
|
|
187
|
+
recs.push({
|
|
188
|
+
field: 'tools',
|
|
189
|
+
message: 'No skills/tools declared',
|
|
190
|
+
impact: 'Skill Trust component scores 0 (−15% of max reputation)',
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
if (!identity.contact_endpoint) {
|
|
194
|
+
recs.push({
|
|
195
|
+
field: 'identity.contact_endpoint',
|
|
196
|
+
message: 'No probe endpoint',
|
|
197
|
+
impact: 'Agent cannot reach active status without a verifiable endpoint',
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
if (!manifest.verification) {
|
|
201
|
+
recs.push({
|
|
202
|
+
field: 'verification',
|
|
203
|
+
message: 'No verification config',
|
|
204
|
+
impact: 'Verifiers won\'t know how to probe your agent',
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
if (!manifest.safety) {
|
|
208
|
+
recs.push({
|
|
209
|
+
field: 'safety',
|
|
210
|
+
message: 'No safety declarations',
|
|
211
|
+
impact: 'Agents without declared safety constraints are harder to trust',
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
if (!manifest.runtime) {
|
|
215
|
+
recs.push({
|
|
216
|
+
field: 'runtime',
|
|
217
|
+
message: 'No runtime info',
|
|
218
|
+
impact: 'Won\'t appear in framework/model-filtered searches',
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
if (!identity.organization) {
|
|
222
|
+
recs.push({
|
|
223
|
+
field: 'identity.organization',
|
|
224
|
+
message: 'No organization set',
|
|
225
|
+
impact: 'Lower discoverability for enterprise search',
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
const data = (manifest.permissions?.data ?? {});
|
|
229
|
+
if (data.retains_pii === true && !identity.contact_email) {
|
|
230
|
+
recs.push({
|
|
231
|
+
field: 'identity.contact_email',
|
|
232
|
+
message: 'PII retention declared but no contact email',
|
|
233
|
+
impact: 'Required for compliance — GDPR/CCPA surface area',
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
return recs;
|
|
237
|
+
}
|
|
238
|
+
export function validate(filePath) {
|
|
239
|
+
const absPath = resolve(filePath);
|
|
240
|
+
console.log('');
|
|
241
|
+
// 1. File exists?
|
|
242
|
+
if (!existsSync(absPath)) {
|
|
243
|
+
console.log(red(`✗ File not found: ${filePath}`));
|
|
244
|
+
console.log(dim(` Create a basedagents.json in this directory to get started.`));
|
|
245
|
+
console.log(dim(` See: https://basedagents.ai/docs/manifest\n`));
|
|
246
|
+
return { valid: false, errorCount: 1, warningCount: 0 };
|
|
247
|
+
}
|
|
248
|
+
console.log(green(`✓`) + ` ${bold(filePath)}`);
|
|
249
|
+
// 2. Valid JSON?
|
|
250
|
+
let manifest;
|
|
251
|
+
try {
|
|
252
|
+
manifest = JSON.parse(readFileSync(absPath, 'utf-8'));
|
|
253
|
+
}
|
|
254
|
+
catch (e) {
|
|
255
|
+
const msg = e instanceof SyntaxError ? e.message : String(e);
|
|
256
|
+
console.log(red(`✗ Invalid JSON: ${msg}\n`));
|
|
257
|
+
return { valid: false, errorCount: 1, warningCount: 0 };
|
|
258
|
+
}
|
|
259
|
+
console.log(green(`✓`) + ` Valid JSON`);
|
|
260
|
+
// 3. Schema validation
|
|
261
|
+
const ajv = new Ajv({ allErrors: true, strict: false });
|
|
262
|
+
addFormats(ajv);
|
|
263
|
+
const valid = ajv.validate(SCHEMA, manifest);
|
|
264
|
+
const errors = ajv.errors ?? [];
|
|
265
|
+
console.log('');
|
|
266
|
+
console.log(bold(`Validating against manifest schema v0.1...`));
|
|
267
|
+
console.log('');
|
|
268
|
+
if (errors.length > 0) {
|
|
269
|
+
console.log(bold(red(`✗ ${errors.length} error${errors.length > 1 ? 's' : ''}`)));
|
|
270
|
+
for (const err of errors) {
|
|
271
|
+
const path = err.instancePath
|
|
272
|
+
? err.instancePath.replace(/\//g, '.').replace(/^\./, '')
|
|
273
|
+
: err.params.missingProperty
|
|
274
|
+
? String(err.params.missingProperty)
|
|
275
|
+
: '(root)';
|
|
276
|
+
const msg = friendlyError(err.instancePath, err.message, err.params);
|
|
277
|
+
const label = path ? cyan(path.padEnd(30)) : cyan('(root)'.padEnd(30));
|
|
278
|
+
console.log(` ${red('✗')} ${label} ${msg}`);
|
|
279
|
+
}
|
|
280
|
+
console.log('');
|
|
281
|
+
}
|
|
282
|
+
else {
|
|
283
|
+
console.log(green(`✓ Schema valid`));
|
|
284
|
+
console.log('');
|
|
285
|
+
}
|
|
286
|
+
// 4. Recommendations
|
|
287
|
+
const recs = getRecommendations(manifest);
|
|
288
|
+
if (recs.length > 0) {
|
|
289
|
+
console.log(bold(yellow(`⚠ ${recs.length} recommendation${recs.length > 1 ? 's' : ''}`)));
|
|
290
|
+
for (const rec of recs) {
|
|
291
|
+
console.log(` ${yellow('⚠')} ${cyan(rec.field.padEnd(30))} ${rec.message}`);
|
|
292
|
+
console.log(` ${''.padEnd(30)} ${dim(rec.impact)}`);
|
|
293
|
+
}
|
|
294
|
+
console.log('');
|
|
295
|
+
}
|
|
296
|
+
// 5. Summary of what's present
|
|
297
|
+
const identity = (manifest.identity ?? {});
|
|
298
|
+
const tools = (manifest.tools ?? []);
|
|
299
|
+
const capabilities = (manifest.capabilities ?? []);
|
|
300
|
+
console.log(bold('Summary'));
|
|
301
|
+
const rows = [
|
|
302
|
+
['name', String(identity.name ?? dim('—'))],
|
|
303
|
+
['version', String(identity.version ?? dim('—'))],
|
|
304
|
+
['capabilities', capabilities.length > 0 ? capabilities.slice(0, 5).join(', ') + (capabilities.length > 5 ? ` +${capabilities.length - 5} more` : '') : dim('—')],
|
|
305
|
+
['protocols', (manifest.protocols ?? []).join(', ') || dim('—')],
|
|
306
|
+
['tools', tools.length > 0 ? `${tools.length} declared` : dim('none')],
|
|
307
|
+
['safety', manifest.safety ? green('declared') : dim('not set')],
|
|
308
|
+
['verification', manifest.verification?.endpoint ? green(String(manifest.verification.endpoint)) : dim('not set')],
|
|
309
|
+
];
|
|
310
|
+
for (const [key, val] of rows) {
|
|
311
|
+
console.log(` ${dim(key.padEnd(14))} ${val}`);
|
|
312
|
+
}
|
|
313
|
+
console.log('');
|
|
314
|
+
// 6. Final verdict
|
|
315
|
+
if (errors.length === 0) {
|
|
316
|
+
if (recs.length === 0) {
|
|
317
|
+
console.log(green(bold('✓ Ready to register')) + ` Run: ${cyan('basedagents register')}\n`);
|
|
318
|
+
}
|
|
319
|
+
else {
|
|
320
|
+
console.log(yellow(bold('⚠ Valid but incomplete')) + ` Fix recommendations to maximize reputation.\n`);
|
|
321
|
+
console.log(` Run: ${cyan('basedagents register')} to register anyway.\n`);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
else {
|
|
325
|
+
console.log(red(bold('✗ Not ready')) + ` Fix the errors above before registering.\n`);
|
|
326
|
+
}
|
|
327
|
+
return { valid: errors.length === 0, errorCount: errors.length, warningCount: recs.length };
|
|
328
|
+
}
|
|
329
|
+
//# sourceMappingURL=validate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../src/cli/validate.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,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AC,KAAK,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC;IACjD,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAEhB,mBAAmB;IACnB,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACtB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,GAAG,UAAU,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC;QAC/F,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC,GAAG,iDAAiD,CAAC,CAAC;YACzG,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,CAAC,sBAAsB,CAAC,wBAAwB,CAAC,CAAC;QAC9E,CAAC;IACH,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,GAAG,8CAA8C,CAAC,CAAC;IACzF,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;AAC9F,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "basedagents",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "SDK for the BasedAgents identity and reputation registry — register AI agents, sign requests, search the registry, and submit verifications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -11,8 +11,12 @@
|
|
|
11
11
|
"types": "./dist/index.d.ts"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
|
+
"bin": {
|
|
15
|
+
"basedagents": "./bin/basedagents.mjs"
|
|
16
|
+
},
|
|
14
17
|
"files": [
|
|
15
18
|
"dist",
|
|
19
|
+
"bin",
|
|
16
20
|
"README.md",
|
|
17
21
|
"LICENSE"
|
|
18
22
|
],
|
|
@@ -48,6 +52,8 @@
|
|
|
48
52
|
},
|
|
49
53
|
"dependencies": {
|
|
50
54
|
"@noble/ed25519": "^2.2.0",
|
|
51
|
-
"@noble/hashes": "^1.7.0"
|
|
55
|
+
"@noble/hashes": "^1.7.0",
|
|
56
|
+
"ajv": "^8.17.1",
|
|
57
|
+
"ajv-formats": "^3.0.1"
|
|
52
58
|
}
|
|
53
59
|
}
|