Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions pkg/cli/add_package_manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ type resolvedRepositoryPackage struct {
Name string
Emoji string
Description string
License string
DocsPath string
InstallationSource []string
SkillFiles []resolvedPackageSkillFile
Expand Down Expand Up @@ -159,6 +160,7 @@ func resolveRepositoryPackage(repoSpec *RepoSpec, host string) (*resolvedReposit
Name: manifest.Name,
Emoji: manifest.Emoji,
Description: manifest.Description,
License: manifest.License,
DocsPath: docsPath,
InstallationSource: installationSources,
SkillFiles: skillFiles,
Expand Down Expand Up @@ -191,6 +193,7 @@ type repositoryPackageManifest struct {
Name string
Emoji string
Description string
License string
Includes []string
Files []string
Skills []string // skill directory paths (e.g. "skills/my-skill")
Expand Down Expand Up @@ -255,6 +258,10 @@ func parseRepositoryPackageManifest(manifestPath string, content []byte) (*repos
manifest.Emoji = emoji
}

if license, ok := stringValue(root["license"]); ok {
manifest.License = license
}

if includesValue, ok := root["includes"]; ok {
includes, includeWarnings := extractManifestIncludes(includesValue, manifestPath)
manifest.Includes = includes
Expand Down
18 changes: 18 additions & 0 deletions pkg/cli/add_package_manifest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func TestResolveRepositoryPackage(t *testing.T) {
return []byte(`name: Repo Assist
emoji: 🤖
description: Friendly repository automation
license: MIT
files:
- workflows/review.md
- .github/workflows/nightly-review.md
Expand All @@ -77,6 +78,7 @@ files:
assert.Equal(t, "aw.yml", pkg.ManifestPath)
assert.Equal(t, "Repo Assist", pkg.Name)
assert.Equal(t, "🤖", pkg.Emoji)
assert.Equal(t, "MIT", pkg.License)
assert.Equal(t, "README.md", pkg.DocsPath)
assert.Equal(t, []string{"workflows/review.md", ".github/workflows/nightly-review.md"}, pkg.InstallationSource)
require.NotEmpty(t, pkg.Warnings)
Expand Down Expand Up @@ -421,6 +423,22 @@ emoji:
assert.Contains(t, err.Error(), `emoji`)
})

t.Run("rejects non-string license field", func(t *testing.T) {
downloadPackageFileFromGitHubForHost = func(owner, repo, path, ref, host string) ([]byte, error) {
if path == "aw.yml" {
return []byte(`name: Repo Assist
license:
id: MIT
`), nil
}
return nil, createRepositoryPackageNotFoundError(path)
}

_, err := resolveRepositoryPackage(&RepoSpec{RepoSlug: "owner/repo"}, "")
require.Error(t, err)
assert.Contains(t, err.Error(), `license`)
})

t.Run("rejects incompatible min-version", func(t *testing.T) {
downloadPackageFileFromGitHubForHost = func(owner, repo, path, ref, host string) ([]byte, error) {
if path == "aw.yml" {
Expand Down
3 changes: 3 additions & 0 deletions pkg/parser/schemas/aw_manifest_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
"description": {
"type": "string"
},
"license": {
"type": "string"
},
"includes": {
"type": "array",
"description": "Installable package entries. Use folder naming conventions to infer type: workflows under workflows/, agentic-workflows/, or .github/workflows/; skill directories under skills/ or .github/skills/; agent files under agents/ or .github/agents/.",
Expand Down