You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(packages): PATCH /packages/:id to edit a package manifest (#2646)
* feat(packages): PATCH /packages/:id to edit a package manifest
Packages could be created (POST /packages) and acted on via lifecycle
sub-routes, but a runtime/base package's manifest — name, description,
version — could never be edited after creation. The Studio "Package
info & settings" sheet had no edit affordance because there was no
endpoint behind it.
Add the edit path end to end:
- `SchemaRegistry.updatePackageManifest(id, patch)` — merges name /
description / version into the in-memory manifest, preserving lifecycle
state (enabled / status / installedAt). It is a metadata edit, not a
reinstall, so a disabled package stays disabled.
- `protocol.updatePackage({ packageId, patch })` — merges via the
registry then re-persists the manifest to `sys_packages` (best-effort,
non-fatal, matching installPackage) so the edit survives a restart.
- `PATCH /packages/:id` in `handlePackages` — partial patch (only the
sent fields change), accepts flat or `{ manifest }`-wrapped bodies,
validates a non-empty name and semantic version, 404s an unknown
package, and falls back to the registry when no protocol service.
`id` / `scope` / `type` remain identity/structure and are not editable
here.
Tests: registry merge (preserve lifecycle, partial patch, unknown id);
dispatcher PATCH (protocol path, manifest wrapper, empty-patch 400,
bad-version 400, registry-fallback 404).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DxVTSDSXrdnfqHNBkHB6yi
* chore(changeset): package manifest edit endpoint
---------
Co-authored-by: Claude <noreply@anthropic.com>
`[protocol.updatePackage] sys_packages persist FAILED for '${request.packageId}': ${out.error??'unknown error'} — the edit will not survive a restart`,
5990
+
);
5991
+
}
5992
+
}else{
5993
+
console.warn(
5994
+
`[protocol.updatePackage] no 'package' service — '${request.packageId}' edited in-memory only (will not survive a restart)`,
5995
+
);
5996
+
}
5997
+
}catch(e){
5998
+
console.warn(
5999
+
`[protocol.updatePackage] sys_packages persist skipped for '${request.packageId}': ${(easError)?.message}`,
0 commit comments