micro-contracts 0.17.0 → 0.17.2

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.
@@ -13,6 +13,7 @@ Contract-first OpenAPI toolchain for TypeScript Web/API systems. Generates contr
13
13
  - [check](#micro-contracts-check)
14
14
  - [pipeline](#micro-contracts-pipeline)
15
15
  - [deps](#micro-contracts-deps)
16
+ - [insights](#micro-contracts-insights)
16
17
  - [guardrails-init](#micro-contracts-guardrails-init)
17
18
  - [manifest](#micro-contracts-manifest)
18
19
  - [audit-openapi](#micro-contracts-audit-openapi)
@@ -417,6 +418,52 @@ x-agent:
417
418
 
418
419
  ---
419
420
 
421
+ ### insights
422
+
423
+ Emit ExternalInsight JSON for agent-contracts-analyzer.
424
+
425
+ Reads x-micro-contracts-depend-on from OpenAPI specs and outputs structured dependency edges and anchor mappings as JSON on stdout. Used by agent-contracts-analyzer CommandProvider integration.
426
+
427
+ **Usage:**
428
+
429
+ ```
430
+ micro-contracts insights --format json
431
+ ```
432
+ ```
433
+ micro-contracts insights --format json --project-root .
434
+ ```
435
+
436
+ #### Options
437
+
438
+ | Option | Aliases | Required | Default | Description |
439
+ |---|---|---|---|---|
440
+ | `--format` | | No | `"json"` | Output format (json only). |
441
+ | `--project-root` | | No | `"."` | Project root directory containing micro-contracts.config.yaml. |
442
+ | `--config` | -c | No | | Path to config file (micro-contracts.config.yaml). |
443
+
444
+ #### Exit Codes
445
+
446
+ **Exit 0:** ExternalInsight JSON written to stdout.
447
+
448
+ - **stdout:** format=`json`
449
+
450
+ **Exit 1:** Insights generation failed.
451
+
452
+ - **stderr:** format=`text`
453
+
454
+ #### Extensions
455
+
456
+ ```yaml
457
+ x-agent:
458
+ risk_level: low
459
+ requires_confirmation: false
460
+ idempotent: true
461
+ side_effects:
462
+
463
+ ```
464
+
465
+ ---
466
+
420
467
  ### guardrails-init
421
468
 
422
469
  Create a guardrails.yaml configuration file.
package/package.json CHANGED
@@ -1,10 +1,16 @@
1
1
  {
2
2
  "name": "micro-contracts",
3
- "version": "0.17.0",
3
+ "version": "0.17.2",
4
4
  "description": "Contract-first OpenAPI toolchain that keeps TypeScript UI and microservices aligned via code generation",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
+ "exports": {
9
+ "./insight-provider": {
10
+ "import": "./dist/external/insight-provider.js",
11
+ "types": "./dist/external/insight-provider.d.ts"
12
+ }
13
+ },
8
14
  "bin": {
9
15
  "micro-contracts": "dist/micro-contracts.bundle.mjs"
10
16
  },
@@ -13,12 +19,16 @@
13
19
  "dist/micro-contracts.bundle.mjs.map",
14
20
  "dist/index.js",
15
21
  "dist/index.d.ts",
22
+ "dist/external/insight-provider.js",
23
+ "dist/external/insight-provider.d.ts",
16
24
  "docs",
17
25
  "cli-contract.yaml",
18
26
  "README.md",
19
- "LICENSE"
27
+ "LICENSE",
28
+ "vendor/agent-contracts-analyzer-0.1.1.tgz"
20
29
  ],
21
30
  "scripts": {
31
+ "prebuild": "node scripts/ensure-agent-contracts-analyzer.mjs",
22
32
  "build": "tsc",
23
33
  "bundle": "node esbuild.bundle.mjs",
24
34
  "bundle:min": "node esbuild.bundle.mjs --minify",
@@ -60,8 +70,9 @@
60
70
  "@openai/agents": "^0.11.1",
61
71
  "@types/js-yaml": "^4.0.9",
62
72
  "@types/node": "^20.11.0",
63
- "agent-contracts": "^0.30.1",
64
- "agent-contracts-runtime": "^0.30.0",
73
+ "agent-contracts": "^0.33.1",
74
+ "agent-contracts-analyzer": "file:vendor/agent-contracts-analyzer-0.1.1.tgz",
75
+ "agent-contracts-runtime": "^0.35.7",
65
76
  "chalk": "^5.3.0",
66
77
  "cli-contracts": "^0.32.0",
67
78
  "commander": "^12.1.0",
@@ -0,0 +1,9 @@
1
+ # Vendored packages
2
+
3
+ ## agent-contracts-analyzer-0.1.1.tgz
4
+
5
+ `npm pack` output from `agent-contracts-analyzer` tag `v0.1.1` (includes `dist/`).
6
+
7
+ The private GitHub repository cannot be fetched from CI via `github:` dependencies without
8
+ cross-repo credentials, so the tarball is committed and referenced as
9
+ `file:vendor/agent-contracts-analyzer-0.1.1.tgz` in `package.json`.