Skip to content

Commit 9e63343

Browse files
Copilothotlong
andcommitted
Add .describe() to all marketplace lifecycle protocol schemas and update ROADMAP
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 437b025 commit 9e63343

4 files changed

Lines changed: 85 additions & 57 deletions

File tree

ROADMAP.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,18 @@ Final polish and advanced features.
697697
- [x] Namespace collision detection — registry entries, conflict errors
698698
- [x] Upgrade migration context — version context for onUpgrade hooks, upgrade history
699699
- [ ] Plugin marketplace runtime — publish, discover, install community plugins
700+
- [ ] CLI: `os plugin build` — generate `.tgz` per PackageArtifactSchema
701+
- [ ] CLI: `os plugin validate` — verify artifact structure, checksums, signatures
702+
- [ ] CLI: `os plugin publish` — upload artifact to marketplace REST API
703+
- [ ] Runtime: package dependency resolution & platform compatibility enforcement
704+
- [ ] Runtime: namespace conflict detection at install time
705+
- [ ] Runtime: package upgrade lifecycle — plan, snapshot, execute, validate, rollback
706+
- [ ] API: `/api/v1/packages/install` — install with dependency & namespace checks
707+
- [ ] API: `/api/v1/packages/upgrade` — upgrade with plan, rollback support
708+
- [ ] API: `/api/v1/packages/resolve-dependencies` — topological sort & conflict detection
709+
- [ ] API: `/api/v1/packages/upload` — artifact upload & validation
710+
- [ ] Studio: marketplace browse/search, install, upgrade, uninstall UI
711+
- [ ] Cloud: artifact storage, distribution, SHA256 verification, security scanning
700712
- [ ] App store — pre-built applications (CRM, HRM, Project Management)
701713
- [ ] Developer portal — API keys, usage metrics, billing
702714
- [ ] Managed cloud offering — ObjectStack-as-a-Service

packages/spec/src/cloud/marketplace.zod.ts

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export const PublisherVerificationSchema = z.enum([
5151
'verified', // Identity verified by platform
5252
'trusted', // Trusted publisher (track record of quality)
5353
'partner', // Official platform partner
54-
]);
54+
]).describe('Publisher verification status');
5555

5656
/**
5757
* Publisher Schema
@@ -68,7 +68,8 @@ export const PublisherSchema = z.object({
6868
type: z.enum(['individual', 'organization']).describe('Publisher type'),
6969

7070
/** Verification status */
71-
verification: PublisherVerificationSchema.default('unverified'),
71+
verification: PublisherVerificationSchema.default('unverified')
72+
.describe('Publisher verification status'),
7273

7374
/** Contact email */
7475
email: z.string().email().optional().describe('Contact email'),
@@ -83,7 +84,8 @@ export const PublisherSchema = z.object({
8384
description: z.string().optional().describe('Publisher description'),
8485

8586
/** Registration date */
86-
registeredAt: z.string().datetime().optional(),
87+
registeredAt: z.string().datetime().optional()
88+
.describe('Publisher registration timestamp'),
8789
});
8890

8991
// ==========================================
@@ -164,7 +166,7 @@ export const MarketplaceCategorySchema = z.enum([
164166
'ui-theme', // UI Themes & Appearance
165167
'storage', // Storage & Drivers
166168
'other', // Other / Uncategorized
167-
]);
169+
]).describe('Marketplace package category');
168170

169171
/**
170172
* Listing Status
@@ -179,7 +181,7 @@ export const ListingStatusSchema = z.enum([
179181
'suspended', // Suspended by platform (policy violation)
180182
'deprecated', // Deprecated by publisher
181183
'unlisted', // Available by direct link only
182-
]);
184+
]).describe('Marketplace listing status');
183185

184186
/**
185187
* Pricing Model
@@ -191,7 +193,7 @@ export const PricingModelSchema = z.enum([
191193
'subscription', // Recurring subscription
192194
'usage-based', // Pay per usage
193195
'contact-sales', // Enterprise pricing, contact for quote
194-
]);
196+
]).describe('Package pricing model');
195197

196198
/**
197199
* Marketplace Listing Schema
@@ -210,7 +212,8 @@ export const MarketplaceListingSchema = z.object({
210212
publisherId: z.string().describe('Publisher ID'),
211213

212214
/** Current listing status */
213-
status: ListingStatusSchema.default('draft'),
215+
status: ListingStatusSchema.default('draft')
216+
.describe('Current listing status'),
214217

215218
/** Display name */
216219
name: z.string().describe('Display name'),
@@ -237,16 +240,20 @@ export const MarketplaceListingSchema = z.object({
237240
})).optional().describe('Screenshots'),
238241

239242
/** Documentation URL */
240-
documentationUrl: z.string().url().optional(),
243+
documentationUrl: z.string().url().optional()
244+
.describe('Documentation URL'),
241245

242246
/** Support URL */
243-
supportUrl: z.string().url().optional(),
247+
supportUrl: z.string().url().optional()
248+
.describe('Support URL'),
244249

245250
/** Source repository URL (if open source) */
246-
repositoryUrl: z.string().url().optional(),
251+
repositoryUrl: z.string().url().optional()
252+
.describe('Source repository URL'),
247253

248254
/** Pricing model */
249-
pricing: PricingModelSchema.default('free'),
255+
pricing: PricingModelSchema.default('free')
256+
.describe('Pricing model'),
250257

251258
/** Price in cents (if paid) */
252259
priceInCents: z.number().int().min(0).optional()

packages/spec/src/kernel/package-registry.zod.ts

Lines changed: 50 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -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');
4444
export 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
*/
191198
export 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');
199206
export type ListPackagesRequest = z.infer<typeof ListPackagesRequestSchema>;
200207

201208
/**
202209
* List Packages Response
203210
*/
204211
export 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');
208215
export type ListPackagesResponse = z.infer<typeof ListPackagesResponseSchema>;
209216

210217
/**
211218
* Get Package Request
212219
*/
213220
export 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');
217224
export type GetPackageRequest = z.infer<typeof GetPackageRequestSchema>;
218225

219226
/**
220227
* Get Package Response
221228
*/
222229
export const GetPackageResponseSchema = z.object({
223-
package: InstalledPackageSchema,
224-
});
230+
package: InstalledPackageSchema.describe('Package details'),
231+
}).describe('Get package response');
225232
export type GetPackageResponse = z.infer<typeof GetPackageResponseSchema>;
226233

227234
/**
@@ -232,11 +239,13 @@ export type GetPackageResponse = z.infer<typeof GetPackageResponseSchema>;
232239
*/
233240
export 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
*/
253262
export 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
*/
265274
export 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');
269278
export type UninstallPackageRequest = z.infer<typeof UninstallPackageRequestSchema>;
270279

271280
/**
272281
* Uninstall Package Response
273282
*/
274283
export 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');
279288
export type UninstallPackageResponse = z.infer<typeof UninstallPackageResponseSchema>;
280289

281290
/**
282291
* Enable Package Request
283292
*/
284293
export 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');
288297
export type EnablePackageRequest = z.infer<typeof EnablePackageRequestSchema>;
289298

290299
/**
291300
* Enable Package Response
292301
*/
293302
export 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');
297306
export type EnablePackageResponse = z.infer<typeof EnablePackageResponseSchema>;
298307

299308
/**
300309
* Disable Package Request
301310
*/
302311
export 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');
306315
export type DisablePackageRequest = z.infer<typeof DisablePackageRequestSchema>;
307316

308317
/**
309318
* Disable Package Response
310319
*/
311320
export 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');
315324
export type DisablePackageResponse = z.infer<typeof DisablePackageResponseSchema>;

packages/spec/src/kernel/package-upgrade.zod.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export const MetadataChangeTypeSchema = z.enum([
4040
'modified', // Existing metadata item modified
4141
'removed', // Metadata item removed in new version
4242
'renamed', // Metadata item renamed
43-
]);
43+
]).describe('Type of metadata change between package versions');
4444

4545
/**
4646
* Metadata Diff Item
@@ -54,7 +54,7 @@ export const MetadataDiffItemSchema = z.object({
5454
name: z.string().describe('Metadata name'),
5555

5656
/** Type of change */
57-
changeType: MetadataChangeTypeSchema,
57+
changeType: MetadataChangeTypeSchema.describe('Type of change'),
5858

5959
/** Whether this change has potential conflicts with customizations */
6060
hasConflict: z.boolean().default(false)
@@ -77,7 +77,7 @@ export const UpgradeImpactLevelSchema = z.enum([
7777
'medium', // Some changes that may affect workflows
7878
'high', // Significant changes, user review recommended
7979
'critical', // Breaking changes, manual intervention required
80-
]);
80+
]).describe('Severity of upgrade impact');
8181

8282
/**
8383
* Upgrade Plan Schema
@@ -95,7 +95,7 @@ export const UpgradePlanSchema = z.object({
9595
toVersion: z.string().describe('Target upgrade version'),
9696

9797
/** Overall impact level */
98-
impactLevel: UpgradeImpactLevelSchema,
98+
impactLevel: UpgradeImpactLevelSchema.describe('Overall upgrade impact level'),
9999

100100
/** List of all metadata changes between versions */
101101
changes: z.array(MetadataDiffItemSchema).describe('All metadata changes'),
@@ -229,7 +229,7 @@ export const UpgradePhaseSchema = z.enum([
229229
'failed', // Upgrade failed
230230
'rolling-back', // Rollback in progress
231231
'rolled-back', // Rollback completed
232-
]);
232+
]).describe('Current phase of the upgrade process');
233233

234234
/**
235235
* Upgrade Package Response

0 commit comments

Comments
 (0)