agent-contracts 0.20.0 → 0.22.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.
@@ -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.19.4
5
+ **Version:** 0.22.0
6
6
 
7
7
  ## Table of Contents
8
8
 
@@ -78,20 +78,6 @@ agent-contracts resolve -c agent-contracts.config.yaml
78
78
 
79
79
  - **stderr:** format=`text`
80
80
 
81
- #### Extensions
82
-
83
- ```yaml
84
- x-agent:
85
- riskLevel: low
86
- requiresConfirmation: false
87
- idempotent: true
88
- sideEffects:
89
-
90
- expectedDurationMs: 3000
91
- retryableExitCodes:
92
-
93
- ```
94
-
95
81
  ---
96
82
 
97
83
  ### validate
@@ -144,20 +130,6 @@ agent-contracts validate --quiet
144
130
 
145
131
  - **stderr:** format=`text`
146
132
 
147
- #### Extensions
148
-
149
- ```yaml
150
- x-agent:
151
- riskLevel: low
152
- requiresConfirmation: false
153
- idempotent: true
154
- sideEffects:
155
-
156
- expectedDurationMs: 3000
157
- retryableExitCodes:
158
-
159
- ```
160
-
161
133
  ---
162
134
 
163
135
  ### lint
@@ -207,27 +179,16 @@ agent-contracts lint --format json
207
179
 
208
180
  - **stderr:** format=`text`
209
181
 
210
- #### Extensions
211
-
212
- ```yaml
213
- x-agent:
214
- riskLevel: low
215
- requiresConfirmation: false
216
- idempotent: true
217
- sideEffects:
218
-
219
- expectedDurationMs: 3000
220
- retryableExitCodes:
221
-
222
- ```
223
-
224
182
  ---
225
183
 
226
184
  ### render
227
185
 
228
- Render resolved DSL with Handlebars templates.
186
+ (deprecated) Alias for 'generate templates'.
229
187
 
230
- Renders output files from the resolved DSL using Handlebars templates configured in agent-contracts.config.yaml. Supports drift detection via --check mode. Requires a config file.
188
+ Deprecated alias for 'agent-contracts generate templates'. Renders output files from the resolved DSL using Handlebars templates and emits a deprecation warning. Supports --check for drift detection. Requires a config file.
189
+
190
+ > **Deprecated**: Use 'agent-contracts generate templates' instead.
191
+ > Use `generate templates` instead.
231
192
 
232
193
  **Usage:**
233
194
 
@@ -247,16 +208,16 @@ agent-contracts render --quiet
247
208
  |---|---|---|---|---|
248
209
  | `--config` | -c | No | | Path to agent-contracts.config.yaml. |
249
210
  | `--team` | | No | | Limit to one team (multi-team config only). |
250
- | `--check` | | No | `false` | Check for drift without writing files. |
211
+ | `--check` | | No | `false` | Check for template drift without writing files. |
251
212
  | `--quiet` | | No | `false` | Suppress output on success. |
252
213
 
253
214
  #### Exit Codes
254
215
 
255
- **Exit 0:** Render succeeded (or no drift detected in --check mode).
216
+ **Exit 0:** Generation succeeded (or no drift detected in --check mode).
256
217
 
257
218
  - **stdout:** format=`text`
258
219
 
259
- **Exit 1:** Render failed, config not found, schema validation failed, or drift detected in --check mode.
220
+ **Exit 1:** Generation failed, config not found, schema validation failed, or drift detected in --check mode.
260
221
 
261
222
  - **stderr:** format=`text`
262
223
 
@@ -264,20 +225,9 @@ agent-contracts render --quiet
264
225
 
265
226
  ```yaml
266
227
  x-agent:
267
- riskLevel: medium
268
- requiresConfirmation: false
269
- idempotent: true
270
- idempotentNote: Output is deterministic from DSL input and templates. Repeated runs produce identical files. Confirmation is not required because the command is idempotent and --check provides a side-effect-free preview mode.
271
- sideEffects:
272
- - file_write
273
- sideEffectNote: Writes rendered files to configured output paths. No file writes occur when --check is specified.
274
- safeDryRunOption: check
275
228
  recommendedBeforeUse:
276
229
  - Ensure agent-contracts.config.yaml exists with render targets.
277
230
  - Run validate first to confirm DSL is valid.
278
- expectedDurationMs: 5000
279
- retryableExitCodes:
280
-
281
231
  ```
282
232
 
283
233
  ---
@@ -324,16 +274,8 @@ agent-contracts check --format json --quiet
324
274
 
325
275
  ```yaml
326
276
  x-agent:
327
- riskLevel: low
328
- requiresConfirmation: false
329
- idempotent: true
330
- sideEffects:
331
-
332
277
  recommendedBeforeUse:
333
278
  - Ensure agent-contracts.config.yaml exists.
334
- expectedDurationMs: 10000
335
- retryableExitCodes:
336
-
337
279
  ```
338
280
 
339
281
  ---
@@ -384,20 +326,6 @@ agent-contracts score -c agent-contracts.config.yaml
384
326
 
385
327
  - **stderr:** format=`text`
386
328
 
387
- #### Extensions
388
-
389
- ```yaml
390
- x-agent:
391
- riskLevel: low
392
- requiresConfirmation: false
393
- idempotent: true
394
- sideEffects:
395
-
396
- expectedDurationMs: 5000
397
- retryableExitCodes:
398
-
399
- ```
400
-
401
329
  ---
402
330
 
403
331
  ### audit
@@ -479,15 +407,6 @@ agent-contracts audit dsl --scope agents:architect,implementer -c config.yaml
479
407
 
480
408
  ```yaml
481
409
  x-agent:
482
- riskLevel: medium
483
- requiresConfirmation: false
484
- idempotent: false
485
- idempotentNote: Safe to repeat (no persistent side effects beyond network calls), but LLM inference is non-deterministic — identical inputs may produce different findings, severity assignments, and recommendation text across runs.
486
- sideEffects:
487
- - network
488
- sideEffectNote: Makes LLM API calls to the configured adapter (e.g. OpenAI, Gemini, Cursor) unless --dry-run is specified. Incurs token cost and sends DSL content to the LLM provider.
489
- safeDryRunOption: dry-run
490
- expectedDurationMs: 120000
491
410
  retryableExitCodes:
492
411
  - 12
493
412
  recommendedBeforeUse:
@@ -500,16 +419,25 @@ x-agent:
500
419
 
501
420
  ### generate
502
421
 
503
- Generate guardrail or interface artifacts from DSL.
422
+ Generate artifacts from DSL — templates, guardrails, and/or interface.
504
423
 
505
- Generates runtime artifacts from the DSL. When type is "guardrails" (default), produces guardrail binding files from DSL, policies, and software bindings. When type is "interface", generates a team interface YAML/JSON file from the DSL's team_interface section.
424
+ Unified generation command. When type is omitted, runs all generation targets (templates, guardrails, interface). When type is "templates", renders output files from the DSL using Handlebars templates. When type is "guardrails", produces guardrail binding files from DSL, policies, and software bindings. When type is "interface", generates a team interface YAML/JSON file from the DSL's team_interface section.
506
425
 
507
426
  **Usage:**
508
427
 
428
+ ```
429
+ agent-contracts generate
430
+ ```
509
431
  ```
510
432
  agent-contracts generate -c agent-contracts.config.yaml
511
433
  ```
512
434
  ```
435
+ agent-contracts generate templates
436
+ ```
437
+ ```
438
+ agent-contracts generate templates --check
439
+ ```
440
+ ```
513
441
  agent-contracts generate guardrails -c agent-contracts.config.yaml
514
442
  ```
515
443
  ```
@@ -532,7 +460,7 @@ agent-contracts generate interface -o team-interface.yaml --dry-run
532
460
 
533
461
  | Name | Required | Description |
534
462
  |---|---|---|
535
- | `type` | No | Type of artifacts to generate. |
463
+ | `type` | No | Type of artifacts to generate. Omit to run all targets. |
536
464
 
537
465
  #### Options
538
466
 
@@ -540,6 +468,7 @@ agent-contracts generate interface -o team-interface.yaml --dry-run
540
468
  |---|---|---|---|---|
541
469
  | `--config` | -c | No | | Path to agent-contracts.config.yaml. |
542
470
  | `--team` | | No | | Limit to one team (multi-team config only). |
471
+ | `--check` | | No | `false` | Check for template drift without writing files. Only applies to the templates target. |
543
472
  | `--binding` | | No | | Filter to specific software binding(s). Guardrails type only. |
544
473
  | `--output` | -o | No | | Output path for generated team interface. Interface type only. |
545
474
  | `--format` | | No | `"yaml"` | Output format for team interface (yaml or json). Interface type only. |
@@ -548,11 +477,11 @@ agent-contracts generate interface -o team-interface.yaml --dry-run
548
477
 
549
478
  #### Exit Codes
550
479
 
551
- **Exit 0:** Generation succeeded.
480
+ **Exit 0:** Generation succeeded (or no drift detected in --check mode).
552
481
 
553
482
  - **stdout:** format=`text`
554
483
 
555
- **Exit 1:** Generation failed — unknown type, schema validation failed, config not found, or error-level diagnostics.
484
+ **Exit 1:** Generation failed — unknown type, schema validation failed, config not found, drift detected, or error-level diagnostics.
556
485
 
557
486
  - **stderr:** format=`text`
558
487
 
@@ -560,20 +489,9 @@ agent-contracts generate interface -o team-interface.yaml --dry-run
560
489
 
561
490
  ```yaml
562
491
  x-agent:
563
- riskLevel: medium
564
- requiresConfirmation: false
565
- idempotent: true
566
- idempotentNote: Output is deterministic from DSL input, policies, and bindings. Repeated runs produce identical files. Confirmation is not required because the command is idempotent and --dry-run provides a side-effect-free preview mode.
567
- sideEffects:
568
- - file_write
569
- sideEffectNote: Writes guardrail binding files or team interface files to configured output paths. No file writes occur when --dry-run is specified.
570
- safeDryRunOption: dry-run
571
492
  recommendedBeforeUse:
572
- - Ensure agent-contracts.config.yaml exists with binding definitions.
493
+ - Ensure agent-contracts.config.yaml exists with render targets and/or binding definitions.
573
494
  - Run validate first to confirm DSL is valid.
574
- expectedDurationMs: 5000
575
- retryableExitCodes:
576
-
577
495
  ```
578
496
 
579
497
  ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-contracts",
3
- "version": "0.20.0",
3
+ "version": "0.22.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",
@@ -31,6 +31,7 @@
31
31
  "lint": "eslint src/ test/",
32
32
  "typecheck": "tsc --noEmit",
33
33
  "generate:schema": "tsx scripts/generate-json-schema.ts",
34
+ "generate:cli": "cli-contracts generate typescript",
34
35
  "generate:docs": "cli-contracts docs",
35
36
  "version": "node -e \"const fs=require('fs');const f='cli-contract.yaml';fs.writeFileSync(f,fs.readFileSync(f,'utf8').replace(/^ version: .*/m,' version: '+process.env.npm_package_version))\" && git add cli-contract.yaml",
36
37
  "prepublishOnly": "npm run clean && npm run build"
@@ -67,7 +68,8 @@
67
68
  "handlebars": "^4.7.9",
68
69
  "yaml": "^2.8.3",
69
70
  "zod": "^4.3.6",
70
- "zod-to-json-schema": "^3.25.2"
71
+ "zod-to-json-schema": "^3.25.2",
72
+ "cli-contracts": "^0.7.0"
71
73
  },
72
74
  "devDependencies": {
73
75
  "@anthropic-ai/claude-agent-sdk": "^0.2.138",
@@ -76,8 +78,7 @@
76
78
  "@google/genai": "^2.0.1",
77
79
  "@openai/agents": "^0.11.1",
78
80
  "@types/node": "^25.6.0",
79
- "agent-contracts-runtime": "^0.12.0",
80
- "cli-contracts": "^0.5.2",
81
+ "agent-contracts-runtime": "^0.13.0",
81
82
  "eslint": "^10.2.0",
82
83
  "globals": "^17.5.0",
83
84
  "prettier": "^3.8.2",