@@ -40,7 +40,7 @@ export const PackageStatusEnum = z.enum([
4040 'upgrading' , // Upgrade in progress
4141 'uninstalling' , // Removal in progress
4242 'error' , // Installation or runtime error
43- ] ) ;
43+ ] ) . describe ( 'Package installation status' ) ;
4444export type PackageStatus = z . infer < typeof PackageStatusEnum > ;
4545
4646/**
@@ -53,28 +53,32 @@ export const InstalledPackageSchema = z.object({
5353 /**
5454 * The full package manifest (source of truth for package definition).
5555 */
56- manifest : ManifestSchema ,
56+ manifest : ManifestSchema . describe ( 'Full package manifest' ) ,
5757
5858 /**
5959 * Current lifecycle status.
6060 */
61- status : PackageStatusEnum . default ( 'installed' ) ,
61+ status : PackageStatusEnum . default ( 'installed' )
62+ . describe ( 'Current lifecycle status' ) ,
6263
6364 /**
6465 * Whether the package is currently enabled (active).
6566 * When disabled, the package's metadata is not loaded into the registry.
6667 */
67- enabled : z . boolean ( ) . default ( true ) ,
68+ enabled : z . boolean ( ) . default ( true )
69+ . describe ( 'Whether the package is currently enabled' ) ,
6870
6971 /**
7072 * ISO 8601 timestamp of when the package was installed.
7173 */
72- installedAt : z . string ( ) . datetime ( ) . optional ( ) ,
74+ installedAt : z . string ( ) . datetime ( ) . optional ( )
75+ . describe ( 'Installation timestamp' ) ,
7376
7477 /**
7578 * ISO 8601 timestamp of last update.
7679 */
77- updatedAt : z . string ( ) . datetime ( ) . optional ( ) ,
80+ updatedAt : z . string ( ) . datetime ( ) . optional ( )
81+ . describe ( 'Last update timestamp' ) ,
7882
7983 /**
8084 * The currently installed version string.
@@ -93,18 +97,21 @@ export const InstalledPackageSchema = z.object({
9397 /**
9498 * ISO 8601 timestamp of when the package was last enabled/disabled.
9599 */
96- statusChangedAt : z . string ( ) . datetime ( ) . optional ( ) ,
100+ statusChangedAt : z . string ( ) . datetime ( ) . optional ( )
101+ . describe ( 'Status change timestamp' ) ,
97102
98103 /**
99104 * Error message if status is 'error'.
100105 */
101- errorMessage : z . string ( ) . optional ( ) ,
106+ errorMessage : z . string ( ) . optional ( )
107+ . describe ( 'Error message when status is error' ) ,
102108
103109 /**
104110 * Configuration values set by the user for this package.
105111 * Keys correspond to the package's `configuration.properties`.
106112 */
107- settings : z . record ( z . string ( ) , z . unknown ( ) ) . optional ( ) ,
113+ settings : z . record ( z . string ( ) , z . unknown ( ) ) . optional ( )
114+ . describe ( 'User-provided configuration settings' ) ,
108115
109116 /**
110117 * Upgrade history for this package.
@@ -190,38 +197,38 @@ export type NamespaceConflictError = z.infer<typeof NamespaceConflictErrorSchema
190197 */
191198export const ListPackagesRequestSchema = z . object ( {
192199 /** Filter by status */
193- status : PackageStatusEnum . optional ( ) ,
200+ status : PackageStatusEnum . optional ( ) . describe ( 'Filter by package status' ) ,
194201 /** Filter by package type */
195- type : ManifestSchema . shape . type . optional ( ) ,
202+ type : ManifestSchema . shape . type . optional ( ) . describe ( 'Filter by package type' ) ,
196203 /** Filter by enabled state */
197- enabled : z . boolean ( ) . optional ( ) ,
198- } ) ;
204+ enabled : z . boolean ( ) . optional ( ) . describe ( 'Filter by enabled state' ) ,
205+ } ) . describe ( 'List packages request' ) ;
199206export type ListPackagesRequest = z . infer < typeof ListPackagesRequestSchema > ;
200207
201208/**
202209 * List Packages Response
203210 */
204211export const ListPackagesResponseSchema = z . object ( {
205- packages : z . array ( InstalledPackageSchema ) ,
206- total : z . number ( ) ,
207- } ) ;
212+ packages : z . array ( InstalledPackageSchema ) . describe ( 'List of installed packages' ) ,
213+ total : z . number ( ) . describe ( 'Total package count' ) ,
214+ } ) . describe ( 'List packages response' ) ;
208215export type ListPackagesResponse = z . infer < typeof ListPackagesResponseSchema > ;
209216
210217/**
211218 * Get Package Request
212219 */
213220export const GetPackageRequestSchema = z . object ( {
214221 /** Package ID (reverse domain identifier from manifest) */
215- id : z . string ( ) ,
216- } ) ;
222+ id : z . string ( ) . describe ( 'Package identifier' ) ,
223+ } ) . describe ( 'Get package request' ) ;
217224export type GetPackageRequest = z . infer < typeof GetPackageRequestSchema > ;
218225
219226/**
220227 * Get Package Response
221228 */
222229export const GetPackageResponseSchema = z . object ( {
223- package : InstalledPackageSchema ,
224- } ) ;
230+ package : InstalledPackageSchema . describe ( 'Package details' ) ,
231+ } ) . describe ( 'Get package response' ) ;
225232export type GetPackageResponse = z . infer < typeof GetPackageResponseSchema > ;
226233
227234/**
@@ -232,11 +239,13 @@ export type GetPackageResponse = z.infer<typeof GetPackageResponseSchema>;
232239 */
233240export const InstallPackageRequestSchema = z . object ( {
234241 /** The package manifest to install */
235- manifest : ManifestSchema ,
242+ manifest : ManifestSchema . describe ( 'Package manifest to install' ) ,
236243 /** Optional: user-provided settings at install time */
237- settings : z . record ( z . string ( ) , z . unknown ( ) ) . optional ( ) ,
244+ settings : z . record ( z . string ( ) , z . unknown ( ) ) . optional ( )
245+ . describe ( 'User-provided settings at install time' ) ,
238246 /** Whether to enable immediately after install (default: true) */
239- enableOnInstall : z . boolean ( ) . default ( true ) ,
247+ enableOnInstall : z . boolean ( ) . default ( true )
248+ . describe ( 'Whether to enable immediately after install' ) ,
240249 /**
241250 * Current platform version for compatibility checking.
242251 * When provided, the system compares this against the package's
@@ -251,8 +260,8 @@ export type InstallPackageRequest = z.infer<typeof InstallPackageRequestSchema>;
251260 * Install Package Response
252261 */
253262export const InstallPackageResponseSchema = z . object ( {
254- package : InstalledPackageSchema ,
255- message : z . string ( ) . optional ( ) ,
263+ package : InstalledPackageSchema . describe ( 'Installed package details' ) ,
264+ message : z . string ( ) . optional ( ) . describe ( 'Installation status message' ) ,
256265 /** Dependency resolution result (when dependencies were analyzed) */
257266 dependencyResolution : DependencyResolutionResultSchema . optional ( )
258267 . describe ( 'Dependency resolution result from install analysis' ) ,
@@ -264,52 +273,52 @@ export type InstallPackageResponse = z.infer<typeof InstallPackageResponseSchema
264273 */
265274export const UninstallPackageRequestSchema = z . object ( {
266275 /** Package ID to uninstall */
267- id : z . string ( ) ,
268- } ) ;
276+ id : z . string ( ) . describe ( 'Package ID to uninstall' ) ,
277+ } ) . describe ( 'Uninstall package request' ) ;
269278export type UninstallPackageRequest = z . infer < typeof UninstallPackageRequestSchema > ;
270279
271280/**
272281 * Uninstall Package Response
273282 */
274283export const UninstallPackageResponseSchema = z . object ( {
275- id : z . string ( ) ,
276- success : z . boolean ( ) ,
277- message : z . string ( ) . optional ( ) ,
278- } ) ;
284+ id : z . string ( ) . describe ( 'Uninstalled package ID' ) ,
285+ success : z . boolean ( ) . describe ( 'Whether uninstall succeeded' ) ,
286+ message : z . string ( ) . optional ( ) . describe ( 'Uninstall status message' ) ,
287+ } ) . describe ( 'Uninstall package response' ) ;
279288export type UninstallPackageResponse = z . infer < typeof UninstallPackageResponseSchema > ;
280289
281290/**
282291 * Enable Package Request
283292 */
284293export const EnablePackageRequestSchema = z . object ( {
285294 /** Package ID to enable */
286- id : z . string ( ) ,
287- } ) ;
295+ id : z . string ( ) . describe ( 'Package ID to enable' ) ,
296+ } ) . describe ( 'Enable package request' ) ;
288297export type EnablePackageRequest = z . infer < typeof EnablePackageRequestSchema > ;
289298
290299/**
291300 * Enable Package Response
292301 */
293302export const EnablePackageResponseSchema = z . object ( {
294- package : InstalledPackageSchema ,
295- message : z . string ( ) . optional ( ) ,
296- } ) ;
303+ package : InstalledPackageSchema . describe ( 'Enabled package details' ) ,
304+ message : z . string ( ) . optional ( ) . describe ( 'Enable status message' ) ,
305+ } ) . describe ( 'Enable package response' ) ;
297306export type EnablePackageResponse = z . infer < typeof EnablePackageResponseSchema > ;
298307
299308/**
300309 * Disable Package Request
301310 */
302311export const DisablePackageRequestSchema = z . object ( {
303312 /** Package ID to disable */
304- id : z . string ( ) ,
305- } ) ;
313+ id : z . string ( ) . describe ( 'Package ID to disable' ) ,
314+ } ) . describe ( 'Disable package request' ) ;
306315export type DisablePackageRequest = z . infer < typeof DisablePackageRequestSchema > ;
307316
308317/**
309318 * Disable Package Response
310319 */
311320export const DisablePackageResponseSchema = z . object ( {
312- package : InstalledPackageSchema ,
313- message : z . string ( ) . optional ( ) ,
314- } ) ;
321+ package : InstalledPackageSchema . describe ( 'Disabled package details' ) ,
322+ message : z . string ( ) . optional ( ) . describe ( 'Disable status message' ) ,
323+ } ) . describe ( 'Disable package response' ) ;
315324export type DisablePackageResponse = z . infer < typeof DisablePackageResponseSchema > ;
0 commit comments