Feat v0.9.4 package adoption roles (#78)
All checks were successful
CI/CD / detect-changes (push) Successful in 3s
CI/CD / test-frontend (push) Has been skipped
CI/CD / test-runners (push) Has been skipped
CI/CD / e2e-smoke (push) Has been skipped
CI/CD / test-go-pg (push) Successful in 2m55s
CI/CD / test-sqlite (push) Successful in 3m7s
CI/CD / build-and-deploy (push) Successful in 1m19s

Co-authored-by: Jeffrey Smith <jasafpro@gmail.com>
Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
This commit was merged in pull request #78.
This commit is contained in:
2026-04-03 16:23:43 +00:00
committed by xcaliber
parent 0661e1d768
commit 6b9ce92103
19 changed files with 2268 additions and 48 deletions

View File

@@ -34,6 +34,7 @@ type ManifestInfo struct {
UserPermissions []string // user-facing permissions declared by the extension
GatePermission string // if set, checks this user permission before calling on_request
RequiresRoles []string // team roles needed to access this package (advisory, OR semantics)
Adoptable bool // if true, teams can adopt this package to get a team-scoped copy
}
// ValidateManifest parses a manifest map and validates all required fields,
@@ -178,6 +179,11 @@ func ValidateManifest(manifest map[string]any) (*ManifestInfo, error) {
}
}
// v0.9.4: adoptable — teams can adopt this package to get a team-scoped copy
if v, ok := manifest["adoptable"].(bool); ok {
info.Adoptable = v
}
info.SchemaVersion = ParseSchemaVersion(manifest)
// ── Type-specific constraints ────────────────────────────────
@@ -216,10 +222,16 @@ func ValidateManifest(manifest map[string]any) (*ManifestInfo, error) {
if info.HasRoute {
return nil, fmt.Errorf("library packages cannot have a route")
}
if info.Adoptable {
return nil, fmt.Errorf("library packages cannot be adoptable")
}
case "test-runner":
// Test runners are surface-like packages discovered by type.
// They are not shown in navigation (extensionNavItems filters for surface/full).
// They may have a route but it's optional — the registry surface provides access.
if info.Adoptable {
return nil, fmt.Errorf("test-runner packages cannot be adoptable")
}
}
return info, nil