agent-contracts 0.18.0 → 0.19.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 +81 -0
- package/cli-contract.yaml +121 -1
- package/dist/cli.js +4579 -23
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +120 -1
- package/dist/index.js +4470 -26
- package/dist/index.js.map +1 -1
- package/docs/cli-reference.md +85 -1
- package/package.json +12 -2
package/docs/cli-reference.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Declarative YAML DSL toolkit for defining, validating, and rendering multi-agent development workflows. Provides static validation, semantic linting, prompt rendering, guardrail generation, and completeness scoring for agent contract definitions.
|
|
4
4
|
|
|
5
|
-
**Version:** 0.
|
|
5
|
+
**Version:** 0.19.0
|
|
6
6
|
|
|
7
7
|
## Table of Contents
|
|
8
8
|
|
|
@@ -13,6 +13,7 @@ Declarative YAML DSL toolkit for defining, validating, and rendering multi-agent
|
|
|
13
13
|
- [render](#agent-contracts-render)
|
|
14
14
|
- [check](#agent-contracts-check)
|
|
15
15
|
- [score](#agent-contracts-score)
|
|
16
|
+
- [audit](#agent-contracts-audit)
|
|
16
17
|
- [generate](#agent-contracts-generate)
|
|
17
18
|
|
|
18
19
|
---
|
|
@@ -378,6 +379,89 @@ x-agent:
|
|
|
378
379
|
|
|
379
380
|
---
|
|
380
381
|
|
|
382
|
+
### audit
|
|
383
|
+
|
|
384
|
+
Run LLM-based semantic audit on DSL definitions and generated outputs.
|
|
385
|
+
|
|
386
|
+
Performs LLM-based semantic analysis on DSL definitions and/or generated outputs. Three audit types are available: "render" checks whether generated files faithfully reflect the resolved DSL, "dsl" reviews DSL design for semantic coherence, and "prompt" verifies that generated prompts accurately express DSL intent. Uses agent-contracts-runtime (optional peer dependency) for LLM execution with handoff schema validation and follow-up recovery.
|
|
387
|
+
|
|
388
|
+
**Usage:**
|
|
389
|
+
|
|
390
|
+
```
|
|
391
|
+
agent-contracts audit render -c agent-contracts.config.yaml
|
|
392
|
+
```
|
|
393
|
+
```
|
|
394
|
+
agent-contracts audit dsl -c agent-contracts.config.yaml
|
|
395
|
+
```
|
|
396
|
+
```
|
|
397
|
+
agent-contracts audit prompt -c agent-contracts.config.yaml
|
|
398
|
+
```
|
|
399
|
+
```
|
|
400
|
+
agent-contracts audit all -c agent-contracts.config.yaml
|
|
401
|
+
```
|
|
402
|
+
```
|
|
403
|
+
agent-contracts audit dsl --dry-run -c agent-contracts.config.yaml
|
|
404
|
+
```
|
|
405
|
+
```
|
|
406
|
+
agent-contracts audit render --format json -c agent-contracts.config.yaml
|
|
407
|
+
```
|
|
408
|
+
```
|
|
409
|
+
agent-contracts audit dsl --scope agents:architect,implementer -c config.yaml
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
#### Arguments
|
|
413
|
+
|
|
414
|
+
| Name | Required | Description |
|
|
415
|
+
|---|---|---|
|
|
416
|
+
| `type` | No | Audit type to run: render (semantic diff of generated outputs vs DSL), dsl (design coherence review), prompt (generated prompt fidelity check), or all (run all three). |
|
|
417
|
+
|
|
418
|
+
#### Options
|
|
419
|
+
|
|
420
|
+
| Option | Aliases | Required | Default | Description |
|
|
421
|
+
|---|---|---|---|---|
|
|
422
|
+
| `--config` | -c | No | | Path to agent-contracts.config.yaml. |
|
|
423
|
+
| `--team` | | No | | Limit to one team (multi-team config only). |
|
|
424
|
+
| `--format` | | No | `"text"` | Output format. |
|
|
425
|
+
| `--scope` | | No | | Limit audit scope to specified entities (e.g. agents:architect,implementer). |
|
|
426
|
+
| `--dry-run` | | No | `false` | Output the audit prompt without calling LLM. |
|
|
427
|
+
| `--adapter` | | No | | SDK adapter to use for LLM calls (overrides config audit.adapter). |
|
|
428
|
+
| `--model` | | No | | LLM model override (overrides config audit.model). |
|
|
429
|
+
|
|
430
|
+
#### Exit Codes
|
|
431
|
+
|
|
432
|
+
**Exit 0:** No critical findings detected.
|
|
433
|
+
|
|
434
|
+
- **stdout:** format=`text`
|
|
435
|
+
|
|
436
|
+
**Exit 1:** Critical findings detected.
|
|
437
|
+
|
|
438
|
+
- **stdout:** format=`text`
|
|
439
|
+
|
|
440
|
+
**Exit 2:** Invalid input or configuration error.
|
|
441
|
+
|
|
442
|
+
- **stderr:** format=`text`
|
|
443
|
+
|
|
444
|
+
**Exit 3:** LLM adapter error (API failure, runtime not installed).
|
|
445
|
+
|
|
446
|
+
- **stderr:** format=`text`
|
|
447
|
+
|
|
448
|
+
#### Extensions
|
|
449
|
+
|
|
450
|
+
```yaml
|
|
451
|
+
x-agent:
|
|
452
|
+
riskLevel: low
|
|
453
|
+
requiresConfirmation: false
|
|
454
|
+
idempotent: true
|
|
455
|
+
sideEffects:
|
|
456
|
+
|
|
457
|
+
recommendedBeforeUse:
|
|
458
|
+
- Ensure agent-contracts.config.yaml exists with render targets.
|
|
459
|
+
- Run validate first to confirm DSL is valid.
|
|
460
|
+
- Install agent-contracts-runtime if not using --dry-run.
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
---
|
|
464
|
+
|
|
381
465
|
### generate
|
|
382
466
|
|
|
383
467
|
Generate guardrail or interface artifacts from DSL.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-contracts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0",
|
|
4
4
|
"description": "Declarative YAML DSL toolkit for defining, validating, and rendering multi-agent development workflows",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -69,11 +69,16 @@
|
|
|
69
69
|
"zod-to-json-schema": "^3.25.2"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
|
+
"@anthropic-ai/claude-agent-sdk": "^0.2.138",
|
|
73
|
+
"@cursor/sdk": "^1.0.12",
|
|
72
74
|
"@eslint/js": "^10.0.1",
|
|
75
|
+
"@google/genai": "^2.0.1",
|
|
76
|
+
"@openai/agents": "^0.11.1",
|
|
73
77
|
"@types/node": "^25.6.0",
|
|
78
|
+
"agent-contracts-runtime": "^0.12.0",
|
|
79
|
+
"cli-contracts": "^0.2.0",
|
|
74
80
|
"eslint": "^10.2.0",
|
|
75
81
|
"globals": "^17.5.0",
|
|
76
|
-
"cli-contracts": "^0.2.0",
|
|
77
82
|
"prettier": "^3.8.2",
|
|
78
83
|
"tsup": "^8.5.1",
|
|
79
84
|
"tsx": "^4.21.0",
|
|
@@ -81,6 +86,11 @@
|
|
|
81
86
|
"typescript-eslint": "^8.58.1",
|
|
82
87
|
"vitest": "^4.1.4"
|
|
83
88
|
},
|
|
89
|
+
"peerDependenciesMeta": {
|
|
90
|
+
"agent-contracts-runtime": {
|
|
91
|
+
"optional": true
|
|
92
|
+
}
|
|
93
|
+
},
|
|
84
94
|
"engines": {
|
|
85
95
|
"node": ">=20.0.0"
|
|
86
96
|
}
|