agent-package-manager 0.2.0 → 0.3.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 CHANGED
@@ -5,19 +5,24 @@ Manages shared agent team definitions stored in GitHub private repositories with
5
5
 
6
6
  ## Overview
7
7
 
8
- `agent-pkg` CLI lets you share and version agent-contracts DSL packages across projects using GitHub repositories as a registry backend. It uses git tags for versioning and content hashing for integrity verification.
8
+ `agent-pkg` CLI lets you share and version agent-contracts DSL packages across projects using GitHub repositories as a registry backend. Package versions are tracked in a registry manifest (`agent-pkg.registry.json`) with commit SHAs and content hashes for integrity verification.
9
9
 
10
10
  ```text
11
- GitHub registry repo Local project
12
- ┌──────────────────┐ ┌──────────────────────────┐
13
- │ packages/ │ add/ │ agent_modules/ │
14
- │ backend-api/ │ ──────► │ backend-api/ │
15
- │ frontend/ │ sync │ agent_overrides/ │
16
- │ police/ │ │ agent-pkg.json │
17
- └──────────────────┘ │ agent-pkg.lock.json │
18
- │ .agent-pkg/build/ │
19
- │ agent/generated/ │
20
- └──────────────────────────┘
11
+ GitHub registry repo Local project
12
+ ┌───────────────────────────┐ ┌──────────────────────────┐
13
+ │ agent-pkg.registry.json │ │ agent_modules/ │
14
+ │ packages/ │ add/│ backend-api/ │
15
+ │ backend-api/ │────►│ frontend/ │
16
+ │ frontend/ │sync │ agent_overrides/ │
17
+ │ police/ │ │ agent-pkg.json │
18
+ └───────────────────────────┘ │ agent-pkg.lock.json │
19
+ ▲ │ .agent-pkg/build/ │
20
+ │ publish │ agent/generated/ │
21
+ │ └──────────────────────────┘
22
+ ┌───────┴───────────┐
23
+ │ Any local project │
24
+ │ or standalone dir │
25
+ └───────────────────┘
21
26
  ```
22
27
 
23
28
  ## Install
@@ -37,10 +42,12 @@ npm install -D agent-package-manager
37
42
  | `agent-pkg diff <pkg>` | Show semantic diff between versions |
38
43
  | `agent-pkg materialize` | Build resolved DSL and generate runtime artifacts |
39
44
  | `agent-pkg check` | Run full CI verification pipeline |
40
- | `agent-pkg publish <path>` | Publish a package (tag + push) |
45
+ | `agent-pkg publish <path>` | Publish a package to a registry |
41
46
 
42
47
  ## Quick Start
43
48
 
49
+ ### Consuming packages
50
+
44
51
  ```bash
45
52
  # Initialize project
46
53
  agent-pkg init --registry github:myorg/agent-pkg-registry
@@ -59,13 +66,54 @@ agent-pkg materialize
59
66
  agent-pkg check
60
67
  ```
61
68
 
69
+ ### Publishing packages
70
+
71
+ ```bash
72
+ # Publish a local package directory to a registry
73
+ agent-pkg publish ./agent-kit-lite \
74
+ --registry github:myorg/agent-pkg-registry \
75
+ --version 1.0.0
76
+
77
+ # Publish from a project that already has a default registry configured
78
+ agent-pkg publish ../aidev-skeleton/agent-kit
79
+
80
+ # Dry run to preview
81
+ agent-pkg publish ./my-pkg --registry github:myorg/registry --dry-run
82
+ ```
83
+
62
84
  ## How It Works
63
85
 
64
- 1. **Registry**: A GitHub repository containing versioned agent team DSL packages under `packages/`
65
- 2. **Add/Sync**: Packages are fetched via `git archive` and extracted into `agent_modules/`
66
- 3. **Lock file**: `agent-pkg.lock.json` pins exact commit SHAs and content hashes
86
+ 1. **Registry**: A GitHub repository containing versioned DSL packages under `packages/` and a manifest file (`agent-pkg.registry.json`) that indexes all packages and their versions with commit SHAs
87
+ 2. **Add/Sync**: Packages are resolved via the registry manifest, then extracted from the exact commit using `git archive` into `agent_modules/`
88
+ 3. **Lock file**: `agent-pkg.lock.json` pins exact commit SHAs and content hashes for reproducible installs
67
89
  4. **Overrides**: Project-specific customizations go in `agent_overrides/`, never in `agent_modules/`
68
90
  5. **Materialize**: Resolves DSL inheritance, applies overrides, validates, lints, and generates runtime artifacts
91
+ 6. **Publish**: Copies a local package directory into the registry repo, commits, updates the manifest, and pushes — can be run from any project or standalone directory
92
+
93
+ ## Registry Manifest
94
+
95
+ The registry repository must contain an `agent-pkg.registry.json` at its root:
96
+
97
+ ```json
98
+ {
99
+ "schemaVersion": 1,
100
+ "packages": {
101
+ "backend-api": {
102
+ "path": "packages/backend-api",
103
+ "description": "Backend API agent team",
104
+ "versions": {
105
+ "1.0.0": {
106
+ "commit": "abc123...",
107
+ "contentHash": "sha256:...",
108
+ "publishedAt": "2026-05-01T00:00:00Z"
109
+ }
110
+ }
111
+ }
112
+ }
113
+ }
114
+ ```
115
+
116
+ This manifest is the authoritative source for version resolution. The `publish` command updates it automatically.
69
117
 
70
118
  ## Requirements
71
119
 
package/cli-contract.yaml CHANGED
@@ -451,24 +451,27 @@ commandSets:
451
451
 
452
452
  # ── publish ────────────────────────────────────────
453
453
  publish:
454
- summary: Publish a package in the registry repository.
454
+ summary: Publish a package to a registry repository.
455
455
  description: >-
456
- Validates the package, checks version consistency between
457
- package.json and agent-pkg.package.json, computes content
458
- hash, verifies CHANGELOG.md is updated, creates a git tag
459
- in the format <package>/v<version>, and pushes to the remote.
456
+ Publishes a local package directory to a GitHub registry
457
+ repository. Validates the package, copies files into the
458
+ registry working copy, updates the registry manifest
459
+ (agent-pkg.registry.json), commits, and pushes. Can be
460
+ run from any project — specify the source directory and
461
+ target registry.
460
462
  usage:
461
- - agent-pkg publish packages/backend-api
462
- - agent-pkg publish packages/backend-api --version 1.2.3
463
- - agent-pkg publish packages/backend-api --dry-run
464
- - agent-pkg publish packages/backend-api --tag-only
465
- - agent-pkg publish packages/backend-api --no-push
463
+ - agent-pkg publish ./agent-kit-lite --registry github:myorg/agent-pkg-registry
464
+ - agent-pkg publish ../aidev-skeleton/agent-kit --version 1.0.0
465
+ - agent-pkg publish ./packages/backend-api --dry-run
466
+ - agent-pkg publish ./my-pkg --no-push
466
467
 
467
468
  arguments:
468
469
  - name: path
469
470
  index: 0
470
471
  required: true
471
- description: Path to the package directory within the registry repository.
472
+ description: >-
473
+ Path to the local package directory to publish. Can be
474
+ relative to the current working directory.
472
475
  schema:
473
476
  type: string
474
477
  file:
@@ -482,20 +485,30 @@ commandSets:
482
485
  schema:
483
486
  type: string
484
487
 
485
- - name: dry-run
486
- description: Show what would be published without making changes.
488
+ - name: registry
489
+ aliases: [r]
490
+ description: >-
491
+ Target registry in the format github:<owner>/<repo>.
492
+ Falls back to the default registry in agent-pkg.json
493
+ if not specified.
494
+ valueName: url
487
495
  schema:
488
- type: boolean
489
- default: false
496
+ type: string
490
497
 
491
- - name: tag-only
492
- description: Only create the git tag, skip validation.
498
+ - name: name
499
+ description: Override package name (defaults to id in agent-pkg.package.json).
500
+ valueName: name
501
+ schema:
502
+ type: string
503
+
504
+ - name: dry-run
505
+ description: Show what would be published without making changes.
493
506
  schema:
494
507
  type: boolean
495
508
  default: false
496
509
 
497
510
  - name: no-push
498
- description: Create the tag locally but do not push to remote.
511
+ description: Commit locally but do not push to remote.
499
512
  schema:
500
513
  type: boolean
501
514
  default: false
@@ -511,7 +524,7 @@ commandSets:
511
524
  "1":
512
525
  description: >-
513
526
  Publish failed — validation error, version mismatch,
514
- missing CHANGELOG, or git error.
527
+ registry error, or git error.
515
528
  stderr:
516
529
  format: text
517
530
 
@@ -520,7 +533,7 @@ commandSets:
520
533
  requiresConfirmation: true
521
534
  idempotent: false
522
535
  sideEffects:
523
- - git_tag
536
+ - git_commit
524
537
  - git_push
525
538
  safeDryRunOption: dry-run
526
539
 
@@ -666,7 +679,7 @@ components:
666
679
 
667
680
  PublishResult:
668
681
  type: object
669
- required: [package, version, tag]
682
+ required: [package, version]
670
683
  properties:
671
684
  package:
672
685
  type: string
@@ -674,15 +687,15 @@ components:
674
687
  version:
675
688
  type: string
676
689
  description: Published version.
677
- tag:
690
+ registry:
678
691
  type: string
679
- description: Git tag created.
692
+ description: Target registry (github:owner/repo).
680
693
  commit:
681
694
  type: string
682
- description: Git commit SHA.
695
+ description: Git commit SHA in the registry repository.
683
696
  contentHash:
684
697
  type: string
685
698
  description: SHA-256 content hash of the package.
686
699
  pushed:
687
700
  type: boolean
688
- description: Whether the tag was pushed to remote.
701
+ description: Whether the commit was pushed to remote.