agent-contracts 0.20.0 → 0.21.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 +12 -9
- package/cli-contract.yaml +49 -31
- package/dist/cli.js +2445 -2166
- package/dist/cli.js.map +1 -1
- package/dist/index.js +290 -9
- package/dist/index.js.map +1 -1
- package/docs/cli-reference.md +460 -15
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -151,11 +151,11 @@ artifacts:
|
|
|
151
151
|
states: [draft, reviewed, approved]
|
|
152
152
|
````
|
|
153
153
|
|
|
154
|
-
Validate and
|
|
154
|
+
Validate and generate:
|
|
155
155
|
|
|
156
156
|
````bash
|
|
157
157
|
agent-contracts validate
|
|
158
|
-
agent-contracts
|
|
158
|
+
agent-contracts generate -c agent-contracts.config.yaml
|
|
159
159
|
````
|
|
160
160
|
|
|
161
161
|
|
|
@@ -1028,12 +1028,14 @@ npx agent-contracts
|
|
|
1028
1028
|
| `agent-contracts resolve [path]` | Resolve `extends` inheritance and output resolved YAML |
|
|
1029
1029
|
| `agent-contracts validate [path]` | Validate schema and references |
|
|
1030
1030
|
| `agent-contracts lint [path]` | Run semantic lint |
|
|
1031
|
-
| `agent-contracts
|
|
1032
|
-
| `agent-contracts
|
|
1031
|
+
| `agent-contracts generate` | Generate all artifacts (templates + guardrails + interface) |
|
|
1032
|
+
| `agent-contracts generate templates` | Render template outputs from config |
|
|
1033
1033
|
| `agent-contracts generate guardrails` | Generate guardrail artifacts from bindings |
|
|
1034
|
-
| `agent-contracts generate interface` | Generate team interface YAML from DSL
|
|
1034
|
+
| `agent-contracts generate interface` | Generate team interface YAML from DSL |
|
|
1035
|
+
| `agent-contracts score [path]` | Calculate DSL completeness score |
|
|
1035
1036
|
| `agent-contracts audit <type>` | Run LLM-based semantic audit (render/dsl/prompt/all) |
|
|
1036
1037
|
| `agent-contracts check` | Run resolve → validate → lint → render --check |
|
|
1038
|
+
| `agent-contracts render` | _(deprecated)_ Alias for `generate templates` |
|
|
1037
1039
|
|
|
1038
1040
|
The `[path]` argument defaults to `agent-contracts.yaml` in the current directory.
|
|
1039
1041
|
If `-c` / `--config` is specified, the DSL path from the config file is used.
|
|
@@ -1100,8 +1102,9 @@ agent-contracts lint --strict
|
|
|
1100
1102
|
agent-contracts score
|
|
1101
1103
|
agent-contracts score -c agent-contracts.config.yaml --threshold 70
|
|
1102
1104
|
agent-contracts score --format json
|
|
1103
|
-
agent-contracts
|
|
1104
|
-
agent-contracts
|
|
1105
|
+
agent-contracts generate -c agent-contracts.config.yaml
|
|
1106
|
+
agent-contracts generate templates -c agent-contracts.config.yaml
|
|
1107
|
+
agent-contracts generate templates -c agent-contracts.config.yaml --check
|
|
1105
1108
|
agent-contracts check -c agent-contracts.config.yaml --strict
|
|
1106
1109
|
agent-contracts generate interface -c agent-contracts.config.yaml
|
|
1107
1110
|
agent-contracts generate interface -c agent-contracts.config.yaml --dry-run
|
|
@@ -1239,7 +1242,7 @@ renders:
|
|
|
1239
1242
|
|
|
1240
1243
|
Tools with `x-script` get a generated script file; tools without it produce no file at all.
|
|
1241
1244
|
|
|
1242
|
-
`skip_empty` also works with `
|
|
1245
|
+
`skip_empty` also works with `generate templates --check` (drift detection): when the expected output is empty, the check expects the file to **not exist** and reports drift if it does.
|
|
1243
1246
|
|
|
1244
1247
|
### Available context types
|
|
1245
1248
|
|
|
@@ -1724,7 +1727,7 @@ A practical model is:
|
|
|
1724
1727
|
|
|
1725
1728
|
1. define the workflow in YAML
|
|
1726
1729
|
2. validate and lint it in CI
|
|
1727
|
-
3.
|
|
1730
|
+
3. generate prompts and derived docs
|
|
1728
1731
|
4. execute the workflow in your runtime of choice
|
|
1729
1732
|
|
|
1730
1733
|
That separation keeps runtime concerns and architecture concerns from being mixed together.
|
package/cli-contract.yaml
CHANGED
|
@@ -3,7 +3,7 @@ cliContracts: 0.1.0
|
|
|
3
3
|
|
|
4
4
|
info:
|
|
5
5
|
title: agent-contracts CLI
|
|
6
|
-
version: 0.
|
|
6
|
+
version: 0.21.0
|
|
7
7
|
description: >-
|
|
8
8
|
Declarative YAML DSL toolkit for defining, validating, and rendering
|
|
9
9
|
multi-agent development workflows. Provides static validation,
|
|
@@ -301,13 +301,18 @@ commandSets:
|
|
|
301
301
|
expectedDurationMs: 3000
|
|
302
302
|
retryableExitCodes: []
|
|
303
303
|
|
|
304
|
-
# ── render
|
|
304
|
+
# ── render (deprecated alias) ─────────────────────
|
|
305
305
|
render:
|
|
306
|
-
summary:
|
|
306
|
+
summary: (deprecated) Alias for 'generate templates'.
|
|
307
|
+
deprecated:
|
|
308
|
+
message: >-
|
|
309
|
+
Use 'agent-contracts generate templates' instead.
|
|
310
|
+
alternative: generate templates
|
|
307
311
|
description: >-
|
|
312
|
+
Deprecated alias for 'agent-contracts generate templates'.
|
|
308
313
|
Renders output files from the resolved DSL using Handlebars
|
|
309
|
-
templates
|
|
310
|
-
drift detection
|
|
314
|
+
templates and emits a deprecation warning. Supports --check
|
|
315
|
+
for drift detection. Requires a config file.
|
|
311
316
|
usage:
|
|
312
317
|
- agent-contracts render -c agent-contracts.config.yaml
|
|
313
318
|
- agent-contracts render -c agent-contracts.config.yaml --check
|
|
@@ -333,7 +338,7 @@ commandSets:
|
|
|
333
338
|
type: string
|
|
334
339
|
|
|
335
340
|
- name: check
|
|
336
|
-
description: Check for drift without writing files.
|
|
341
|
+
description: Check for template drift without writing files.
|
|
337
342
|
schema:
|
|
338
343
|
type: boolean
|
|
339
344
|
default: false
|
|
@@ -346,14 +351,14 @@ commandSets:
|
|
|
346
351
|
|
|
347
352
|
exits:
|
|
348
353
|
'0':
|
|
349
|
-
description:
|
|
354
|
+
description: Generation succeeded (or no drift detected in --check mode).
|
|
350
355
|
stdout:
|
|
351
356
|
format: text
|
|
352
357
|
|
|
353
358
|
'1':
|
|
354
359
|
description: >-
|
|
355
|
-
|
|
356
|
-
or drift detected in --check mode.
|
|
360
|
+
Generation failed, config not found, schema validation
|
|
361
|
+
failed, or drift detected in --check mode.
|
|
357
362
|
stderr:
|
|
358
363
|
format: text
|
|
359
364
|
|
|
@@ -363,9 +368,8 @@ commandSets:
|
|
|
363
368
|
idempotent: true
|
|
364
369
|
idempotentNote: >-
|
|
365
370
|
Output is deterministic from DSL input and templates.
|
|
366
|
-
Repeated runs produce identical files.
|
|
367
|
-
|
|
368
|
-
provides a side-effect-free preview mode.
|
|
371
|
+
Repeated runs produce identical files. This is a
|
|
372
|
+
deprecated alias; prefer 'generate templates'.
|
|
369
373
|
sideEffects:
|
|
370
374
|
- file_write
|
|
371
375
|
sideEffectNote: >-
|
|
@@ -728,15 +732,20 @@ commandSets:
|
|
|
728
732
|
|
|
729
733
|
# ── generate ──────────────────────────────────────
|
|
730
734
|
generate:
|
|
731
|
-
summary: Generate
|
|
735
|
+
summary: Generate artifacts from DSL — templates, guardrails, and/or interface.
|
|
732
736
|
description: >-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
737
|
+
Unified generation command. When type is omitted, runs all
|
|
738
|
+
generation targets (templates, guardrails, interface). When
|
|
739
|
+
type is "templates", renders output files from the DSL using
|
|
740
|
+
Handlebars templates. When type is "guardrails", produces
|
|
741
|
+
guardrail binding files from DSL, policies, and software
|
|
742
|
+
bindings. When type is "interface", generates a team interface
|
|
743
|
+
YAML/JSON file from the DSL's team_interface section.
|
|
738
744
|
usage:
|
|
745
|
+
- agent-contracts generate
|
|
739
746
|
- agent-contracts generate -c agent-contracts.config.yaml
|
|
747
|
+
- agent-contracts generate templates
|
|
748
|
+
- agent-contracts generate templates --check
|
|
740
749
|
- agent-contracts generate guardrails -c agent-contracts.config.yaml
|
|
741
750
|
- agent-contracts generate guardrails --binding cursor-rules
|
|
742
751
|
- agent-contracts generate guardrails --dry-run
|
|
@@ -748,11 +757,11 @@ commandSets:
|
|
|
748
757
|
- name: type
|
|
749
758
|
index: 0
|
|
750
759
|
required: false
|
|
751
|
-
description:
|
|
760
|
+
description: >-
|
|
761
|
+
Type of artifacts to generate. Omit to run all targets.
|
|
752
762
|
schema:
|
|
753
763
|
type: string
|
|
754
|
-
enum: [guardrails, interface]
|
|
755
|
-
default: guardrails
|
|
764
|
+
enum: [templates, guardrails, interface]
|
|
756
765
|
|
|
757
766
|
options:
|
|
758
767
|
- name: config
|
|
@@ -773,6 +782,14 @@ commandSets:
|
|
|
773
782
|
schema:
|
|
774
783
|
type: string
|
|
775
784
|
|
|
785
|
+
- name: check
|
|
786
|
+
description: >-
|
|
787
|
+
Check for template drift without writing files.
|
|
788
|
+
Only applies to the templates target.
|
|
789
|
+
schema:
|
|
790
|
+
type: boolean
|
|
791
|
+
default: false
|
|
792
|
+
|
|
776
793
|
- name: binding
|
|
777
794
|
description: Filter to specific software binding(s). Guardrails type only.
|
|
778
795
|
valueName: name
|
|
@@ -813,14 +830,14 @@ commandSets:
|
|
|
813
830
|
|
|
814
831
|
exits:
|
|
815
832
|
'0':
|
|
816
|
-
description: Generation succeeded.
|
|
833
|
+
description: Generation succeeded (or no drift detected in --check mode).
|
|
817
834
|
stdout:
|
|
818
835
|
format: text
|
|
819
836
|
|
|
820
837
|
'1':
|
|
821
838
|
description: >-
|
|
822
839
|
Generation failed — unknown type, schema validation failed,
|
|
823
|
-
config not found, or error-level diagnostics.
|
|
840
|
+
config not found, drift detected, or error-level diagnostics.
|
|
824
841
|
stderr:
|
|
825
842
|
format: text
|
|
826
843
|
|
|
@@ -829,20 +846,21 @@ commandSets:
|
|
|
829
846
|
requiresConfirmation: false
|
|
830
847
|
idempotent: true
|
|
831
848
|
idempotentNote: >-
|
|
832
|
-
Output is deterministic from DSL input, policies,
|
|
833
|
-
bindings. Repeated runs produce identical files.
|
|
849
|
+
Output is deterministic from DSL input, templates, policies,
|
|
850
|
+
and bindings. Repeated runs produce identical files.
|
|
834
851
|
Confirmation is not required because the command is
|
|
835
|
-
idempotent and --dry-run
|
|
836
|
-
preview
|
|
852
|
+
idempotent and --dry-run / --check provide side-effect-free
|
|
853
|
+
preview modes.
|
|
837
854
|
sideEffects:
|
|
838
855
|
- file_write
|
|
839
856
|
sideEffectNote: >-
|
|
840
|
-
Writes
|
|
841
|
-
|
|
842
|
-
--dry-run is specified
|
|
857
|
+
Writes rendered template files, guardrail binding files,
|
|
858
|
+
and/or team interface files to configured output paths.
|
|
859
|
+
No file writes occur when --dry-run or --check is specified
|
|
860
|
+
(--check applies to templates only).
|
|
843
861
|
safeDryRunOption: dry-run
|
|
844
862
|
recommendedBeforeUse:
|
|
845
|
-
- Ensure agent-contracts.config.yaml exists with binding definitions.
|
|
863
|
+
- Ensure agent-contracts.config.yaml exists with render targets and/or binding definitions.
|
|
846
864
|
- Run validate first to confirm DSL is valid.
|
|
847
865
|
expectedDurationMs: 5000
|
|
848
866
|
retryableExitCodes: []
|