agent-package-manager 0.2.0 → 0.3.1

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,70 @@ 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
+
84
+ ## Package Manifest
85
+
86
+ Each package must contain an `agent-pkg.package.json` with a strict schema (no additional properties allowed):
87
+
88
+ ```json
89
+ {
90
+ "schemaVersion": 1,
91
+ "id": "my-package",
92
+ "version": "1.0.0",
93
+ "description": "Optional description",
94
+ "entrypoint": "agent-contracts.yaml"
95
+ }
96
+ ```
97
+
98
+ DSL-derivable metadata (provides, exports, requires, compatible) is intentionally excluded — the DSL itself is the single source of truth for what a package contains.
99
+
62
100
  ## How It Works
63
101
 
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
102
+ 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
103
+ 2. **Add/Sync**: Packages are resolved via the registry manifest, then extracted from the exact commit using `git archive` into `agent_modules/`
104
+ 3. **Lock file**: `agent-pkg.lock.json` pins exact commit SHAs and content hashes for reproducible installs
67
105
  4. **Overrides**: Project-specific customizations go in `agent_overrides/`, never in `agent_modules/`
68
106
  5. **Materialize**: Resolves DSL inheritance, applies overrides, validates, lints, and generates runtime artifacts
107
+ 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
108
+
109
+ ## Registry Manifest
110
+
111
+ The registry repository must contain an `agent-pkg.registry.json` at its root:
112
+
113
+ ```json
114
+ {
115
+ "schemaVersion": 1,
116
+ "packages": {
117
+ "backend-api": {
118
+ "path": "packages/backend-api",
119
+ "description": "Backend API agent team",
120
+ "versions": {
121
+ "1.0.0": {
122
+ "commit": "abc123...",
123
+ "contentHash": "sha256:...",
124
+ "publishedAt": "2026-05-01T00:00:00Z"
125
+ }
126
+ }
127
+ }
128
+ }
129
+ }
130
+ ```
131
+
132
+ This manifest is the authoritative source for version resolution. The `publish` command updates it automatically.
69
133
 
70
134
  ## Requirements
71
135
 
package/cli-contract.yaml CHANGED
@@ -451,24 +451,28 @@ 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. Reads package.json and agent-pkg.package.json
458
+ (strict schema validation), checks version consistency,
459
+ computes content hash, copies files into the registry
460
+ working copy, updates the registry manifest
461
+ (agent-pkg.registry.json), commits, and pushes. Can be
462
+ run from any project — specify the source directory and
463
+ target registry.
460
464
  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
465
+ - agent-pkg publish ./agent-kit-lite --registry github:myorg/agent-pkg-registry
466
+ - agent-pkg publish ../aidev-skeleton/agent-kit --version 1.0.0
467
+ - agent-pkg publish ./packages/backend-api --dry-run
468
+ - agent-pkg publish ./my-pkg --no-push
466
469
 
467
470
  arguments:
468
471
  - name: path
469
472
  index: 0
470
473
  required: true
471
- description: Path to the package directory within the registry repository.
474
+ description: >-
475
+ Path to the local package directory to publish.
472
476
  schema:
473
477
  type: string
474
478
  file:
@@ -482,20 +486,30 @@ commandSets:
482
486
  schema:
483
487
  type: string
484
488
 
485
- - name: dry-run
486
- description: Show what would be published without making changes.
489
+ - name: registry
490
+ aliases: [r]
491
+ description: >-
492
+ Target registry in the format github:<owner>/<repo>.
493
+ Falls back to the default registry in agent-pkg.json
494
+ if not specified.
495
+ valueName: url
487
496
  schema:
488
- type: boolean
489
- default: false
497
+ type: string
490
498
 
491
- - name: tag-only
492
- description: Only create the git tag, skip validation.
499
+ - name: name
500
+ description: Override package name (defaults to id in agent-pkg.package.json).
501
+ valueName: name
502
+ schema:
503
+ type: string
504
+
505
+ - name: dry-run
506
+ description: Show what would be published without making changes.
493
507
  schema:
494
508
  type: boolean
495
509
  default: false
496
510
 
497
511
  - name: no-push
498
- description: Create the tag locally but do not push to remote.
512
+ description: Commit locally but do not push to remote.
499
513
  schema:
500
514
  type: boolean
501
515
  default: false
@@ -511,7 +525,7 @@ commandSets:
511
525
  "1":
512
526
  description: >-
513
527
  Publish failed — validation error, version mismatch,
514
- missing CHANGELOG, or git error.
528
+ registry error, or git error.
515
529
  stderr:
516
530
  format: text
517
531
 
@@ -520,7 +534,7 @@ commandSets:
520
534
  requiresConfirmation: true
521
535
  idempotent: false
522
536
  sideEffects:
523
- - git_tag
537
+ - git_commit
524
538
  - git_push
525
539
  safeDryRunOption: dry-run
526
540
 
@@ -666,7 +680,7 @@ components:
666
680
 
667
681
  PublishResult:
668
682
  type: object
669
- required: [package, version, tag]
683
+ required: [package, version]
670
684
  properties:
671
685
  package:
672
686
  type: string
@@ -674,15 +688,18 @@ components:
674
688
  version:
675
689
  type: string
676
690
  description: Published version.
677
- tag:
691
+ registry:
678
692
  type: string
679
- description: Git tag created.
693
+ description: Target registry (github:owner/repo).
680
694
  commit:
681
695
  type: string
682
- description: Git commit SHA.
696
+ description: Git commit SHA in the registry repository.
683
697
  contentHash:
684
698
  type: string
685
699
  description: SHA-256 content hash of the package.
686
700
  pushed:
687
701
  type: boolean
688
- description: Whether the tag was pushed to remote.
702
+ description: Whether the commit was pushed to remote.
703
+ dryRun:
704
+ type: boolean
705
+ description: Whether this was a dry run.
@@ -1,3 +1,9 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __export = (target, all) => {
3
+ for (var name in all)
4
+ __defProp(target, name, { get: all[name], enumerable: true });
5
+ };
6
+
1
7
  // src/index.ts
2
8
  import { readFileSync } from "fs";
3
9
  import { fileURLToPath } from "url";
@@ -7,6 +13,7 @@ var pkg = JSON.parse(readFileSync(resolve(__dirname, "../package.json"), "utf8")
7
13
  var VERSION = pkg.version;
8
14
 
9
15
  export {
16
+ __export,
10
17
  VERSION
11
18
  };
12
- //# sourceMappingURL=chunk-5XXBSF75.js.map
19
+ //# sourceMappingURL=chunk-YZR4CVBR.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { readFileSync } from \"node:fs\";\nimport { fileURLToPath } from \"node:url\";\nimport { resolve, dirname } from \"node:path\";\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\nconst pkg = JSON.parse(readFileSync(resolve(__dirname, \"../package.json\"), \"utf8\"));\n\nexport const VERSION: string = pkg.version;\n"],"mappings":";AAAA,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAC9B,SAAS,SAAS,eAAe;AAEjC,IAAM,YAAY,QAAQ,cAAc,YAAY,GAAG,CAAC;AACxD,IAAM,MAAM,KAAK,MAAM,aAAa,QAAQ,WAAW,iBAAiB,GAAG,MAAM,CAAC;AAE3E,IAAM,UAAkB,IAAI;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { readFileSync } from \"node:fs\";\nimport { fileURLToPath } from \"node:url\";\nimport { resolve, dirname } from \"node:path\";\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\nconst pkg = JSON.parse(readFileSync(resolve(__dirname, \"../package.json\"), \"utf8\"));\n\nexport const VERSION: string = pkg.version;\n"],"mappings":";;;;;;;AAAA,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAC9B,SAAS,SAAS,eAAe;AAEjC,IAAM,YAAY,QAAQ,cAAc,YAAY,GAAG,CAAC;AACxD,IAAM,MAAM,KAAK,MAAM,aAAa,QAAQ,WAAW,iBAAiB,GAAG,MAAM,CAAC;AAE3E,IAAM,UAAkB,IAAI;","names":[]}