@objectstack/spec 0.8.2 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +58 -4
- package/dist/ai/devops-agent.zod.d.ts +1 -1
- package/dist/ai/feedback-loop.zod.d.ts +4293 -0
- package/dist/ai/feedback-loop.zod.d.ts.map +1 -0
- package/dist/ai/feedback-loop.zod.js +53 -0
- package/dist/ai/index.d.ts +1 -0
- package/dist/ai/index.d.ts.map +1 -1
- package/dist/ai/index.js +1 -0
- package/dist/api/documentation.zod.d.ts +1073 -0
- package/dist/api/documentation.zod.d.ts.map +1 -0
- package/dist/api/documentation.zod.js +487 -0
- package/dist/api/errors.zod.d.ts +6 -6
- package/dist/api/graphql.zod.d.ts +3 -3
- package/dist/api/hub.zod.d.ts +5239 -0
- package/dist/api/hub.zod.d.ts.map +1 -0
- package/dist/api/hub.zod.js +784 -0
- package/dist/api/index.d.ts +4 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +4 -0
- package/dist/api/odata.zod.d.ts +1 -1
- package/dist/api/registry.example.d.ts +411 -0
- package/dist/api/registry.example.d.ts.map +1 -0
- package/dist/api/registry.example.js +470 -0
- package/dist/api/registry.zod.d.ts +2095 -0
- package/dist/api/registry.zod.d.ts.map +1 -0
- package/dist/api/registry.zod.js +755 -0
- package/dist/api/websocket.zod.d.ts +8 -8
- package/dist/auth/scim.zod.d.ts +3 -3
- package/dist/automation/flow.zod.d.ts +3 -3
- package/dist/contracts/index.d.ts +1 -0
- package/dist/contracts/index.d.ts.map +1 -1
- package/dist/contracts/index.js +1 -0
- package/dist/contracts/schema-driver.d.ts +21 -0
- package/dist/contracts/schema-driver.d.ts.map +1 -0
- package/dist/contracts/schema-driver.js +2 -0
- package/dist/hub/composer.zod.d.ts +226 -0
- package/dist/hub/composer.zod.d.ts.map +1 -1
- package/dist/hub/hub-federation.zod.d.ts +764 -0
- package/dist/hub/hub-federation.zod.d.ts.map +1 -0
- package/dist/hub/hub-federation.zod.js +441 -0
- package/dist/hub/index.d.ts +2 -0
- package/dist/hub/index.d.ts.map +1 -1
- package/dist/hub/index.js +3 -0
- package/dist/hub/plugin-security.zod.d.ts +1029 -0
- package/dist/hub/plugin-security.zod.d.ts.map +1 -0
- package/dist/hub/plugin-security.zod.js +637 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/integration/connector/vercel.zod.d.ts +2 -2
- package/dist/qa/index.d.ts +11 -0
- package/dist/qa/index.d.ts.map +1 -0
- package/dist/qa/index.js +26 -0
- package/dist/qa/testing.zod.d.ts +345 -0
- package/dist/qa/testing.zod.d.ts.map +1 -0
- package/dist/qa/testing.zod.js +69 -0
- package/dist/stack.zod.d.ts +3395 -596
- package/dist/stack.zod.d.ts.map +1 -1
- package/dist/stack.zod.js +20 -2
- package/dist/system/index.d.ts +2 -0
- package/dist/system/index.d.ts.map +1 -1
- package/dist/system/index.js +2 -0
- package/dist/system/manifest.zod.d.ts +226 -0
- package/dist/system/manifest.zod.d.ts.map +1 -1
- package/dist/system/manifest.zod.js +8 -0
- package/dist/system/message-queue.zod.d.ts +2 -2
- package/dist/system/metadata-loader.zod.d.ts +1 -1
- package/dist/system/migration.zod.d.ts +4205 -0
- package/dist/system/migration.zod.d.ts.map +1 -0
- package/dist/system/migration.zod.js +70 -0
- package/dist/system/plugin-loading.zod.d.ts +575 -0
- package/dist/system/plugin-loading.zod.d.ts.map +1 -0
- package/dist/system/plugin-loading.zod.js +612 -0
- package/json-schema/ai/FeedbackLoop.json +7 -0
- package/json-schema/ai/Issue.json +7 -0
- package/json-schema/ai/MetadataSource.json +7 -0
- package/json-schema/ai/Resolution.json +7 -0
- package/json-schema/api/ApiChangelogEntry.json +7 -0
- package/json-schema/api/ApiDiscoveryQuery.json +7 -0
- package/json-schema/api/ApiDiscoveryResponse.json +7 -0
- package/json-schema/api/ApiDocumentationConfig.json +7 -0
- package/json-schema/api/ApiEndpointRegistration.json +7 -0
- package/json-schema/api/ApiMetadata.json +7 -0
- package/json-schema/api/ApiParameter.json +7 -0
- package/json-schema/api/ApiProtocolType.json +7 -0
- package/json-schema/api/ApiRegistry.json +7 -0
- package/json-schema/api/ApiRegistryEntry.json +7 -0
- package/json-schema/api/ApiResponse.json +7 -0
- package/json-schema/api/ApiTestCollection.json +7 -0
- package/json-schema/api/ApiTestRequest.json +7 -0
- package/json-schema/api/ApiTestingUiConfig.json +7 -0
- package/json-schema/api/ApiTestingUiType.json +7 -0
- package/json-schema/api/BuildStatusResponse.json +7 -0
- package/json-schema/api/CodeGenerationTemplate.json +7 -0
- package/json-schema/api/CompileManifestRequest.json +7 -0
- package/json-schema/api/CompileManifestResponse.json +7 -0
- package/json-schema/api/ConflictResolutionStrategy.json +7 -0
- package/json-schema/api/CreateSpaceRequest.json +7 -0
- package/json-schema/api/CreateTenantRequest.json +7 -0
- package/json-schema/api/GeneratedApiDocumentation.json +7 -0
- package/json-schema/api/GetBuildStatusRequest.json +7 -0
- package/json-schema/api/GetMarketplacePluginRequest.json +7 -0
- package/json-schema/api/GetPluginVersionsRequest.json +7 -0
- package/json-schema/api/GetPluginVersionsResponse.json +7 -0
- package/json-schema/api/HttpStatusCode.json +7 -0
- package/json-schema/api/HubHealthResponse.json +7 -0
- package/json-schema/api/HubMetricsResponse.json +7 -0
- package/json-schema/api/IssueLicenseRequest.json +7 -0
- package/json-schema/api/LicenseResponse.json +7 -0
- package/json-schema/api/ListLicensesRequest.json +7 -0
- package/json-schema/api/ListLicensesResponse.json +7 -0
- package/json-schema/api/ListMarketplaceRequest.json +7 -0
- package/json-schema/api/ListMarketplaceResponse.json +7 -0
- package/json-schema/api/ListSpacesRequest.json +7 -0
- package/json-schema/api/ListSpacesResponse.json +7 -0
- package/json-schema/api/ListTenantsRequest.json +7 -0
- package/json-schema/api/ListTenantsResponse.json +7 -0
- package/json-schema/api/MarketplacePluginResponse.json +7 -0
- package/json-schema/api/ObjectQLReference.json +7 -0
- package/json-schema/api/OpenApiSecurityScheme.json +7 -0
- package/json-schema/api/OpenApiServer.json +7 -0
- package/json-schema/api/OpenApiSpec.json +7 -0
- package/json-schema/api/PaginationRequest.json +7 -0
- package/json-schema/api/PaginationResponse.json +7 -0
- package/json-schema/api/PluginResponse.json +7 -0
- package/json-schema/api/PluginVersionInfo.json +7 -0
- package/json-schema/api/PublishPluginRequest.json +7 -0
- package/json-schema/api/RevokeLicenseRequest.json +7 -0
- package/json-schema/api/SchemaDefinition.json +7 -0
- package/json-schema/api/SearchPluginsRequest.json +7 -0
- package/json-schema/api/SearchPluginsResponse.json +7 -0
- package/json-schema/api/SpaceResponse.json +7 -0
- package/json-schema/api/TenantResponse.json +7 -0
- package/json-schema/api/UpdatePluginRequest.json +7 -0
- package/json-schema/api/UpdateSpaceRequest.json +7 -0
- package/json-schema/api/UpdateTenantRequest.json +7 -0
- package/json-schema/api/ValidateLicenseRequest.json +7 -0
- package/json-schema/api/ValidateLicenseResponse.json +7 -0
- package/json-schema/hub/DependencyConflict.json +7 -0
- package/json-schema/hub/DependencyGraph.json +7 -0
- package/json-schema/hub/DependencyGraphNode.json +7 -0
- package/json-schema/hub/DependencyResolutionResult.json +7 -0
- package/json-schema/hub/EdgeLocation.json +7 -0
- package/json-schema/hub/FederationTopology.json +7 -0
- package/json-schema/hub/GlobalRegistryEntry.json +7 -0
- package/json-schema/hub/HubInstance.json +7 -0
- package/json-schema/hub/PackageDependency.json +7 -0
- package/json-schema/hub/PluginProvenance.json +7 -0
- package/json-schema/hub/PluginTrustScore.json +7 -0
- package/json-schema/hub/Region.json +7 -0
- package/json-schema/hub/ReplicationJob.json +7 -0
- package/json-schema/hub/SBOM.json +7 -0
- package/json-schema/hub/SBOMEntry.json +7 -0
- package/json-schema/hub/SecurityPolicy.json +7 -0
- package/json-schema/hub/SecurityScanResult.json +7 -0
- package/json-schema/hub/SecurityVulnerability.json +7 -0
- package/json-schema/hub/TenantPlacementPolicy.json +7 -0
- package/json-schema/hub/VulnerabilitySeverity.json +7 -0
- package/json-schema/qa/TestAction.json +7 -0
- package/json-schema/qa/TestActionType.json +7 -0
- package/json-schema/qa/TestAssertion.json +7 -0
- package/json-schema/qa/TestAssertionType.json +7 -0
- package/json-schema/qa/TestContext.json +7 -0
- package/json-schema/qa/TestScenario.json +7 -0
- package/json-schema/qa/TestStep.json +7 -0
- package/json-schema/qa/TestSuite.json +7 -0
- package/json-schema/system/AddFieldOperation.json +7 -0
- package/json-schema/system/ChangeSet.json +7 -0
- package/json-schema/system/CreateObjectOperation.json +7 -0
- package/json-schema/system/DeleteObjectOperation.json +7 -0
- package/json-schema/system/ExecuteSqlOperation.json +7 -0
- package/json-schema/system/MigrationDependency.json +7 -0
- package/json-schema/system/MigrationOperation.json +7 -0
- package/json-schema/system/ModifyFieldOperation.json +7 -0
- package/json-schema/system/PluginCaching.json +7 -0
- package/json-schema/system/PluginCodeSplitting.json +7 -0
- package/json-schema/system/PluginDependencyResolution.json +7 -0
- package/json-schema/system/PluginDynamicImport.json +7 -0
- package/json-schema/system/PluginHotReload.json +7 -0
- package/json-schema/system/PluginInitialization.json +7 -0
- package/json-schema/system/PluginLoadingConfig.json +7 -0
- package/json-schema/system/PluginLoadingEvent.json +7 -0
- package/json-schema/system/PluginLoadingState.json +7 -0
- package/json-schema/system/PluginLoadingStrategy.json +7 -0
- package/json-schema/system/PluginPerformanceMonitoring.json +7 -0
- package/json-schema/system/PluginPreloadConfig.json +7 -0
- package/json-schema/system/PluginSandboxing.json +7 -0
- package/json-schema/system/RemoveFieldOperation.json +7 -0
- package/json-schema/system/RenameObjectOperation.json +7 -0
- package/package.json +1 -1
|
@@ -0,0 +1,612 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PluginLoadingStateSchema = exports.PluginLoadingEventSchema = exports.PluginLoadingConfigSchema = exports.PluginPerformanceMonitoringSchema = exports.PluginSandboxingSchema = exports.PluginCachingSchema = exports.PluginHotReloadSchema = exports.PluginDependencyResolutionSchema = exports.PluginInitializationSchema = exports.PluginDynamicImportSchema = exports.PluginCodeSplittingSchema = exports.PluginPreloadConfigSchema = exports.PluginLoadingStrategySchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* # Plugin Loading Protocol
|
|
7
|
+
*
|
|
8
|
+
* Defines the enhanced plugin loading mechanism for the microkernel architecture.
|
|
9
|
+
* Inspired by industry best practices from:
|
|
10
|
+
* - Kubernetes CRDs and Operators
|
|
11
|
+
* - OSGi Dynamic Module System
|
|
12
|
+
* - Eclipse Plugin Framework
|
|
13
|
+
* - Webpack Module Federation
|
|
14
|
+
*
|
|
15
|
+
* This protocol enables:
|
|
16
|
+
* - Lazy loading and code splitting
|
|
17
|
+
* - Dynamic imports and parallel initialization
|
|
18
|
+
* - Capability-based discovery
|
|
19
|
+
* - Hot reload in development
|
|
20
|
+
* - Advanced caching strategies
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* Plugin Loading Strategy
|
|
24
|
+
* Determines how and when a plugin is loaded into memory
|
|
25
|
+
*/
|
|
26
|
+
exports.PluginLoadingStrategySchema = zod_1.z.enum([
|
|
27
|
+
'eager', // Load immediately during bootstrap (critical plugins)
|
|
28
|
+
'lazy', // Load on first use (feature plugins)
|
|
29
|
+
'parallel', // Load in parallel with other plugins
|
|
30
|
+
'deferred', // Load after initial bootstrap complete
|
|
31
|
+
'on-demand', // Load only when explicitly requested
|
|
32
|
+
]).describe('Plugin loading strategy');
|
|
33
|
+
/**
|
|
34
|
+
* Plugin Preloading Configuration
|
|
35
|
+
* Configures preloading behavior for faster activation
|
|
36
|
+
*/
|
|
37
|
+
exports.PluginPreloadConfigSchema = zod_1.z.object({
|
|
38
|
+
/**
|
|
39
|
+
* Enable preloading for this plugin
|
|
40
|
+
*/
|
|
41
|
+
enabled: zod_1.z.boolean().default(false),
|
|
42
|
+
/**
|
|
43
|
+
* Preload priority (lower = higher priority)
|
|
44
|
+
*/
|
|
45
|
+
priority: zod_1.z.number().int().min(0).default(100),
|
|
46
|
+
/**
|
|
47
|
+
* Resources to preload
|
|
48
|
+
*/
|
|
49
|
+
resources: zod_1.z.array(zod_1.z.enum([
|
|
50
|
+
'metadata', // Plugin manifest and metadata
|
|
51
|
+
'dependencies', // Plugin dependencies
|
|
52
|
+
'assets', // Static assets (icons, translations)
|
|
53
|
+
'code', // JavaScript code chunks
|
|
54
|
+
'services', // Service definitions
|
|
55
|
+
])).optional(),
|
|
56
|
+
/**
|
|
57
|
+
* Conditions for preloading
|
|
58
|
+
*/
|
|
59
|
+
conditions: zod_1.z.object({
|
|
60
|
+
/**
|
|
61
|
+
* Preload only on specific routes
|
|
62
|
+
*/
|
|
63
|
+
routes: zod_1.z.array(zod_1.z.string()).optional(),
|
|
64
|
+
/**
|
|
65
|
+
* Preload only for specific user roles
|
|
66
|
+
*/
|
|
67
|
+
roles: zod_1.z.array(zod_1.z.string()).optional(),
|
|
68
|
+
/**
|
|
69
|
+
* Preload based on device type
|
|
70
|
+
*/
|
|
71
|
+
deviceType: zod_1.z.array(zod_1.z.enum(['desktop', 'mobile', 'tablet'])).optional(),
|
|
72
|
+
/**
|
|
73
|
+
* Network connection quality threshold
|
|
74
|
+
*/
|
|
75
|
+
minNetworkSpeed: zod_1.z.enum(['slow-2g', '2g', '3g', '4g']).optional(),
|
|
76
|
+
}).optional(),
|
|
77
|
+
}).describe('Plugin preloading configuration');
|
|
78
|
+
/**
|
|
79
|
+
* Plugin Code Splitting Configuration
|
|
80
|
+
* Configures how plugin code is split for optimal loading
|
|
81
|
+
*/
|
|
82
|
+
exports.PluginCodeSplittingSchema = zod_1.z.object({
|
|
83
|
+
/**
|
|
84
|
+
* Enable code splitting for this plugin
|
|
85
|
+
*/
|
|
86
|
+
enabled: zod_1.z.boolean().default(true),
|
|
87
|
+
/**
|
|
88
|
+
* Split strategy
|
|
89
|
+
*/
|
|
90
|
+
strategy: zod_1.z.enum([
|
|
91
|
+
'route', // Split by UI routes
|
|
92
|
+
'feature', // Split by feature modules
|
|
93
|
+
'size', // Split by bundle size threshold
|
|
94
|
+
'custom', // Custom split points defined by plugin
|
|
95
|
+
]).default('feature'),
|
|
96
|
+
/**
|
|
97
|
+
* Chunk naming strategy
|
|
98
|
+
*/
|
|
99
|
+
chunkNaming: zod_1.z.enum(['hashed', 'named', 'sequential']).default('hashed'),
|
|
100
|
+
/**
|
|
101
|
+
* Maximum chunk size in KB
|
|
102
|
+
*/
|
|
103
|
+
maxChunkSize: zod_1.z.number().int().min(10).optional().describe('Max chunk size in KB'),
|
|
104
|
+
/**
|
|
105
|
+
* Shared dependencies optimization
|
|
106
|
+
*/
|
|
107
|
+
sharedDependencies: zod_1.z.object({
|
|
108
|
+
enabled: zod_1.z.boolean().default(true),
|
|
109
|
+
/**
|
|
110
|
+
* Minimum times a module must be shared before extraction
|
|
111
|
+
*/
|
|
112
|
+
minChunks: zod_1.z.number().int().min(1).default(2),
|
|
113
|
+
}).optional(),
|
|
114
|
+
}).describe('Plugin code splitting configuration');
|
|
115
|
+
/**
|
|
116
|
+
* Plugin Dynamic Import Configuration
|
|
117
|
+
* Configures dynamic import behavior for runtime module loading
|
|
118
|
+
*/
|
|
119
|
+
exports.PluginDynamicImportSchema = zod_1.z.object({
|
|
120
|
+
/**
|
|
121
|
+
* Enable dynamic imports
|
|
122
|
+
*/
|
|
123
|
+
enabled: zod_1.z.boolean().default(true),
|
|
124
|
+
/**
|
|
125
|
+
* Import mode
|
|
126
|
+
*/
|
|
127
|
+
mode: zod_1.z.enum([
|
|
128
|
+
'async', // Asynchronous import (recommended)
|
|
129
|
+
'sync', // Synchronous import (blocking)
|
|
130
|
+
'eager', // Eager evaluation
|
|
131
|
+
'lazy', // Lazy evaluation
|
|
132
|
+
]).default('async'),
|
|
133
|
+
/**
|
|
134
|
+
* Prefetch strategy
|
|
135
|
+
*/
|
|
136
|
+
prefetch: zod_1.z.boolean().default(false).describe('Prefetch module in idle time'),
|
|
137
|
+
/**
|
|
138
|
+
* Preload strategy
|
|
139
|
+
*/
|
|
140
|
+
preload: zod_1.z.boolean().default(false).describe('Preload module in parallel with parent'),
|
|
141
|
+
/**
|
|
142
|
+
* Webpack magic comments support
|
|
143
|
+
*/
|
|
144
|
+
webpackChunkName: zod_1.z.string().optional().describe('Custom chunk name for webpack'),
|
|
145
|
+
/**
|
|
146
|
+
* Import timeout in milliseconds
|
|
147
|
+
*/
|
|
148
|
+
timeout: zod_1.z.number().int().min(100).default(30000).describe('Dynamic import timeout (ms)'),
|
|
149
|
+
/**
|
|
150
|
+
* Retry configuration on import failure
|
|
151
|
+
*/
|
|
152
|
+
retry: zod_1.z.object({
|
|
153
|
+
enabled: zod_1.z.boolean().default(true),
|
|
154
|
+
maxAttempts: zod_1.z.number().int().min(1).max(10).default(3),
|
|
155
|
+
backoffMs: zod_1.z.number().int().min(0).default(1000).describe('Exponential backoff base delay'),
|
|
156
|
+
}).optional(),
|
|
157
|
+
}).describe('Plugin dynamic import configuration');
|
|
158
|
+
/**
|
|
159
|
+
* Plugin Initialization Configuration
|
|
160
|
+
* Configures how plugin initialization is executed
|
|
161
|
+
*/
|
|
162
|
+
exports.PluginInitializationSchema = zod_1.z.object({
|
|
163
|
+
/**
|
|
164
|
+
* Initialization mode
|
|
165
|
+
*/
|
|
166
|
+
mode: zod_1.z.enum([
|
|
167
|
+
'sync', // Synchronous initialization
|
|
168
|
+
'async', // Asynchronous initialization
|
|
169
|
+
'parallel', // Parallel with other plugins
|
|
170
|
+
'sequential', // Must complete before next plugin
|
|
171
|
+
]).default('async'),
|
|
172
|
+
/**
|
|
173
|
+
* Initialization timeout in milliseconds
|
|
174
|
+
*/
|
|
175
|
+
timeout: zod_1.z.number().int().min(100).default(30000),
|
|
176
|
+
/**
|
|
177
|
+
* Startup priority (lower = higher priority, earlier initialization)
|
|
178
|
+
*/
|
|
179
|
+
priority: zod_1.z.number().int().min(0).default(100),
|
|
180
|
+
/**
|
|
181
|
+
* Whether to continue bootstrap if this plugin fails
|
|
182
|
+
*/
|
|
183
|
+
critical: zod_1.z.boolean().default(false).describe('If true, kernel bootstrap fails if plugin fails'),
|
|
184
|
+
/**
|
|
185
|
+
* Retry configuration on initialization failure
|
|
186
|
+
*/
|
|
187
|
+
retry: zod_1.z.object({
|
|
188
|
+
enabled: zod_1.z.boolean().default(false),
|
|
189
|
+
maxAttempts: zod_1.z.number().int().min(1).max(5).default(3),
|
|
190
|
+
backoffMs: zod_1.z.number().int().min(0).default(1000),
|
|
191
|
+
}).optional(),
|
|
192
|
+
/**
|
|
193
|
+
* Health check interval for monitoring
|
|
194
|
+
*/
|
|
195
|
+
healthCheckInterval: zod_1.z.number().int().min(0).optional().describe('Health check interval in ms (0 = disabled)'),
|
|
196
|
+
}).describe('Plugin initialization configuration');
|
|
197
|
+
/**
|
|
198
|
+
* Plugin Dependency Resolution Configuration
|
|
199
|
+
* Advanced dependency resolution using semantic versioning
|
|
200
|
+
*/
|
|
201
|
+
exports.PluginDependencyResolutionSchema = zod_1.z.object({
|
|
202
|
+
/**
|
|
203
|
+
* Dependency resolution strategy
|
|
204
|
+
*/
|
|
205
|
+
strategy: zod_1.z.enum([
|
|
206
|
+
'strict', // Exact version match required
|
|
207
|
+
'compatible', // Semver compatible versions (^)
|
|
208
|
+
'latest', // Always use latest compatible
|
|
209
|
+
'pinned', // Lock to specific version
|
|
210
|
+
]).default('compatible'),
|
|
211
|
+
/**
|
|
212
|
+
* Peer dependency handling
|
|
213
|
+
*/
|
|
214
|
+
peerDependencies: zod_1.z.object({
|
|
215
|
+
/**
|
|
216
|
+
* Whether to resolve peer dependencies
|
|
217
|
+
*/
|
|
218
|
+
resolve: zod_1.z.boolean().default(true),
|
|
219
|
+
/**
|
|
220
|
+
* Action on missing peer dependency
|
|
221
|
+
*/
|
|
222
|
+
onMissing: zod_1.z.enum(['error', 'warn', 'ignore']).default('warn'),
|
|
223
|
+
/**
|
|
224
|
+
* Action on peer version mismatch
|
|
225
|
+
*/
|
|
226
|
+
onMismatch: zod_1.z.enum(['error', 'warn', 'ignore']).default('warn'),
|
|
227
|
+
}).optional(),
|
|
228
|
+
/**
|
|
229
|
+
* Optional dependency handling
|
|
230
|
+
*/
|
|
231
|
+
optionalDependencies: zod_1.z.object({
|
|
232
|
+
/**
|
|
233
|
+
* Whether to attempt loading optional dependencies
|
|
234
|
+
*/
|
|
235
|
+
load: zod_1.z.boolean().default(true),
|
|
236
|
+
/**
|
|
237
|
+
* Action on optional dependency load failure
|
|
238
|
+
*/
|
|
239
|
+
onFailure: zod_1.z.enum(['warn', 'ignore']).default('warn'),
|
|
240
|
+
}).optional(),
|
|
241
|
+
/**
|
|
242
|
+
* Conflict resolution
|
|
243
|
+
*/
|
|
244
|
+
conflictResolution: zod_1.z.enum([
|
|
245
|
+
'fail', // Fail on any version conflict
|
|
246
|
+
'latest', // Use latest version
|
|
247
|
+
'oldest', // Use oldest version
|
|
248
|
+
'manual', // Require manual resolution
|
|
249
|
+
]).default('latest'),
|
|
250
|
+
/**
|
|
251
|
+
* Circular dependency handling
|
|
252
|
+
*/
|
|
253
|
+
circularDependencies: zod_1.z.enum([
|
|
254
|
+
'error', // Throw error on circular dependency
|
|
255
|
+
'warn', // Warn but continue
|
|
256
|
+
'allow', // Allow circular dependencies
|
|
257
|
+
]).default('warn'),
|
|
258
|
+
}).describe('Plugin dependency resolution configuration');
|
|
259
|
+
/**
|
|
260
|
+
* Plugin Hot Reload Configuration
|
|
261
|
+
* Enables hot module replacement for development
|
|
262
|
+
*/
|
|
263
|
+
exports.PluginHotReloadSchema = zod_1.z.object({
|
|
264
|
+
/**
|
|
265
|
+
* Enable hot reload
|
|
266
|
+
*/
|
|
267
|
+
enabled: zod_1.z.boolean().default(false),
|
|
268
|
+
/**
|
|
269
|
+
* Hot reload strategy
|
|
270
|
+
*/
|
|
271
|
+
strategy: zod_1.z.enum([
|
|
272
|
+
'full', // Full plugin reload (destroy and reinitialize)
|
|
273
|
+
'partial', // Partial reload (update changed modules only)
|
|
274
|
+
'state-preserve', // Preserve plugin state during reload
|
|
275
|
+
]).default('full'),
|
|
276
|
+
/**
|
|
277
|
+
* Files to watch for changes
|
|
278
|
+
*/
|
|
279
|
+
watchPatterns: zod_1.z.array(zod_1.z.string()).optional().describe('Glob patterns for files to watch'),
|
|
280
|
+
/**
|
|
281
|
+
* Files to ignore
|
|
282
|
+
*/
|
|
283
|
+
ignorePatterns: zod_1.z.array(zod_1.z.string()).optional().describe('Glob patterns for files to ignore'),
|
|
284
|
+
/**
|
|
285
|
+
* Debounce delay in milliseconds
|
|
286
|
+
*/
|
|
287
|
+
debounceMs: zod_1.z.number().int().min(0).default(300),
|
|
288
|
+
/**
|
|
289
|
+
* Whether to preserve state during reload
|
|
290
|
+
*/
|
|
291
|
+
preserveState: zod_1.z.boolean().default(false),
|
|
292
|
+
/**
|
|
293
|
+
* State serialization
|
|
294
|
+
*/
|
|
295
|
+
stateSerialization: zod_1.z.object({
|
|
296
|
+
enabled: zod_1.z.boolean().default(false),
|
|
297
|
+
/**
|
|
298
|
+
* Path to state serialization handler
|
|
299
|
+
*/
|
|
300
|
+
handler: zod_1.z.string().optional(),
|
|
301
|
+
}).optional(),
|
|
302
|
+
/**
|
|
303
|
+
* Hooks for hot reload lifecycle
|
|
304
|
+
*/
|
|
305
|
+
hooks: zod_1.z.object({
|
|
306
|
+
beforeReload: zod_1.z.string().optional().describe('Function to call before reload'),
|
|
307
|
+
afterReload: zod_1.z.string().optional().describe('Function to call after reload'),
|
|
308
|
+
onError: zod_1.z.string().optional().describe('Function to call on reload error'),
|
|
309
|
+
}).optional(),
|
|
310
|
+
}).describe('Plugin hot reload configuration');
|
|
311
|
+
/**
|
|
312
|
+
* Plugin Caching Configuration
|
|
313
|
+
* Configures caching strategy for faster subsequent loads
|
|
314
|
+
*/
|
|
315
|
+
exports.PluginCachingSchema = zod_1.z.object({
|
|
316
|
+
/**
|
|
317
|
+
* Enable caching
|
|
318
|
+
*/
|
|
319
|
+
enabled: zod_1.z.boolean().default(true),
|
|
320
|
+
/**
|
|
321
|
+
* Cache storage type
|
|
322
|
+
*/
|
|
323
|
+
storage: zod_1.z.enum([
|
|
324
|
+
'memory', // In-memory cache (fastest, not persistent)
|
|
325
|
+
'disk', // Disk cache (persistent)
|
|
326
|
+
'indexeddb', // Browser IndexedDB (persistent, browser only)
|
|
327
|
+
'hybrid', // Memory + Disk hybrid
|
|
328
|
+
]).default('memory'),
|
|
329
|
+
/**
|
|
330
|
+
* Cache key strategy
|
|
331
|
+
*/
|
|
332
|
+
keyStrategy: zod_1.z.enum([
|
|
333
|
+
'version', // Cache by plugin version
|
|
334
|
+
'hash', // Cache by content hash
|
|
335
|
+
'timestamp', // Cache by last modified timestamp
|
|
336
|
+
]).default('version'),
|
|
337
|
+
/**
|
|
338
|
+
* Cache TTL in seconds
|
|
339
|
+
*/
|
|
340
|
+
ttl: zod_1.z.number().int().min(0).optional().describe('Time to live in seconds (0 = infinite)'),
|
|
341
|
+
/**
|
|
342
|
+
* Maximum cache size in MB
|
|
343
|
+
*/
|
|
344
|
+
maxSize: zod_1.z.number().int().min(1).optional().describe('Max cache size in MB'),
|
|
345
|
+
/**
|
|
346
|
+
* Cache invalidation triggers
|
|
347
|
+
*/
|
|
348
|
+
invalidateOn: zod_1.z.array(zod_1.z.enum([
|
|
349
|
+
'version-change',
|
|
350
|
+
'dependency-change',
|
|
351
|
+
'manual',
|
|
352
|
+
'error',
|
|
353
|
+
])).optional(),
|
|
354
|
+
/**
|
|
355
|
+
* Compression
|
|
356
|
+
*/
|
|
357
|
+
compression: zod_1.z.object({
|
|
358
|
+
enabled: zod_1.z.boolean().default(false),
|
|
359
|
+
algorithm: zod_1.z.enum(['gzip', 'brotli', 'deflate']).default('gzip'),
|
|
360
|
+
}).optional(),
|
|
361
|
+
}).describe('Plugin caching configuration');
|
|
362
|
+
/**
|
|
363
|
+
* Plugin Sandboxing Configuration
|
|
364
|
+
* Security isolation for untrusted plugins
|
|
365
|
+
*/
|
|
366
|
+
exports.PluginSandboxingSchema = zod_1.z.object({
|
|
367
|
+
/**
|
|
368
|
+
* Enable sandboxing
|
|
369
|
+
*/
|
|
370
|
+
enabled: zod_1.z.boolean().default(false),
|
|
371
|
+
/**
|
|
372
|
+
* Sandbox isolation level
|
|
373
|
+
*/
|
|
374
|
+
isolationLevel: zod_1.z.enum([
|
|
375
|
+
'none', // No isolation
|
|
376
|
+
'process', // Separate process (Node.js worker threads)
|
|
377
|
+
'vm', // VM context isolation
|
|
378
|
+
'iframe', // iframe isolation (browser)
|
|
379
|
+
'web-worker', // Web Worker (browser)
|
|
380
|
+
]).default('none'),
|
|
381
|
+
/**
|
|
382
|
+
* Allowed capabilities
|
|
383
|
+
*/
|
|
384
|
+
allowedCapabilities: zod_1.z.array(zod_1.z.string()).optional().describe('List of allowed capability IDs'),
|
|
385
|
+
/**
|
|
386
|
+
* Resource quotas
|
|
387
|
+
*/
|
|
388
|
+
resourceQuotas: zod_1.z.object({
|
|
389
|
+
/**
|
|
390
|
+
* Maximum memory usage in MB
|
|
391
|
+
*/
|
|
392
|
+
maxMemoryMB: zod_1.z.number().int().min(1).optional(),
|
|
393
|
+
/**
|
|
394
|
+
* Maximum CPU time in milliseconds
|
|
395
|
+
*/
|
|
396
|
+
maxCpuTimeMs: zod_1.z.number().int().min(100).optional(),
|
|
397
|
+
/**
|
|
398
|
+
* Maximum number of file descriptors
|
|
399
|
+
*/
|
|
400
|
+
maxFileDescriptors: zod_1.z.number().int().min(1).optional(),
|
|
401
|
+
/**
|
|
402
|
+
* Maximum network bandwidth in KB/s
|
|
403
|
+
*/
|
|
404
|
+
maxNetworkKBps: zod_1.z.number().int().min(1).optional(),
|
|
405
|
+
}).optional(),
|
|
406
|
+
/**
|
|
407
|
+
* Permissions
|
|
408
|
+
*/
|
|
409
|
+
permissions: zod_1.z.object({
|
|
410
|
+
/**
|
|
411
|
+
* Allowed API access
|
|
412
|
+
*/
|
|
413
|
+
allowedAPIs: zod_1.z.array(zod_1.z.string()).optional(),
|
|
414
|
+
/**
|
|
415
|
+
* Allowed file system paths
|
|
416
|
+
*/
|
|
417
|
+
allowedPaths: zod_1.z.array(zod_1.z.string()).optional(),
|
|
418
|
+
/**
|
|
419
|
+
* Allowed network endpoints
|
|
420
|
+
*/
|
|
421
|
+
allowedEndpoints: zod_1.z.array(zod_1.z.string()).optional(),
|
|
422
|
+
/**
|
|
423
|
+
* Allowed environment variables
|
|
424
|
+
*/
|
|
425
|
+
allowedEnvVars: zod_1.z.array(zod_1.z.string()).optional(),
|
|
426
|
+
}).optional(),
|
|
427
|
+
}).describe('Plugin sandboxing configuration');
|
|
428
|
+
/**
|
|
429
|
+
* Plugin Performance Monitoring Configuration
|
|
430
|
+
* Telemetry and performance tracking
|
|
431
|
+
*/
|
|
432
|
+
exports.PluginPerformanceMonitoringSchema = zod_1.z.object({
|
|
433
|
+
/**
|
|
434
|
+
* Enable performance monitoring
|
|
435
|
+
*/
|
|
436
|
+
enabled: zod_1.z.boolean().default(false),
|
|
437
|
+
/**
|
|
438
|
+
* Metrics to collect
|
|
439
|
+
*/
|
|
440
|
+
metrics: zod_1.z.array(zod_1.z.enum([
|
|
441
|
+
'load-time',
|
|
442
|
+
'init-time',
|
|
443
|
+
'memory-usage',
|
|
444
|
+
'cpu-usage',
|
|
445
|
+
'api-calls',
|
|
446
|
+
'error-rate',
|
|
447
|
+
'cache-hit-rate',
|
|
448
|
+
])).optional(),
|
|
449
|
+
/**
|
|
450
|
+
* Sampling rate (0-1, where 1 = 100%)
|
|
451
|
+
*/
|
|
452
|
+
samplingRate: zod_1.z.number().min(0).max(1).default(1),
|
|
453
|
+
/**
|
|
454
|
+
* Reporting interval in seconds
|
|
455
|
+
*/
|
|
456
|
+
reportingInterval: zod_1.z.number().int().min(1).default(60),
|
|
457
|
+
/**
|
|
458
|
+
* Performance budget thresholds
|
|
459
|
+
*/
|
|
460
|
+
budgets: zod_1.z.object({
|
|
461
|
+
/**
|
|
462
|
+
* Maximum load time in milliseconds
|
|
463
|
+
*/
|
|
464
|
+
maxLoadTimeMs: zod_1.z.number().int().min(0).optional(),
|
|
465
|
+
/**
|
|
466
|
+
* Maximum init time in milliseconds
|
|
467
|
+
*/
|
|
468
|
+
maxInitTimeMs: zod_1.z.number().int().min(0).optional(),
|
|
469
|
+
/**
|
|
470
|
+
* Maximum memory usage in MB
|
|
471
|
+
*/
|
|
472
|
+
maxMemoryMB: zod_1.z.number().int().min(0).optional(),
|
|
473
|
+
}).optional(),
|
|
474
|
+
/**
|
|
475
|
+
* Action on budget violation
|
|
476
|
+
*/
|
|
477
|
+
onBudgetViolation: zod_1.z.enum(['warn', 'error', 'ignore']).default('warn'),
|
|
478
|
+
}).describe('Plugin performance monitoring configuration');
|
|
479
|
+
/**
|
|
480
|
+
* Complete Plugin Loading Configuration
|
|
481
|
+
* Combines all loading-related configurations
|
|
482
|
+
*/
|
|
483
|
+
exports.PluginLoadingConfigSchema = zod_1.z.object({
|
|
484
|
+
/**
|
|
485
|
+
* Loading strategy
|
|
486
|
+
*/
|
|
487
|
+
strategy: exports.PluginLoadingStrategySchema.default('lazy'),
|
|
488
|
+
/**
|
|
489
|
+
* Preloading configuration
|
|
490
|
+
*/
|
|
491
|
+
preload: exports.PluginPreloadConfigSchema.optional(),
|
|
492
|
+
/**
|
|
493
|
+
* Code splitting configuration
|
|
494
|
+
*/
|
|
495
|
+
codeSplitting: exports.PluginCodeSplittingSchema.optional(),
|
|
496
|
+
/**
|
|
497
|
+
* Dynamic import configuration
|
|
498
|
+
*/
|
|
499
|
+
dynamicImport: exports.PluginDynamicImportSchema.optional(),
|
|
500
|
+
/**
|
|
501
|
+
* Initialization configuration
|
|
502
|
+
*/
|
|
503
|
+
initialization: exports.PluginInitializationSchema.optional(),
|
|
504
|
+
/**
|
|
505
|
+
* Dependency resolution configuration
|
|
506
|
+
*/
|
|
507
|
+
dependencyResolution: exports.PluginDependencyResolutionSchema.optional(),
|
|
508
|
+
/**
|
|
509
|
+
* Hot reload configuration (development only)
|
|
510
|
+
*/
|
|
511
|
+
hotReload: exports.PluginHotReloadSchema.optional(),
|
|
512
|
+
/**
|
|
513
|
+
* Caching configuration
|
|
514
|
+
*/
|
|
515
|
+
caching: exports.PluginCachingSchema.optional(),
|
|
516
|
+
/**
|
|
517
|
+
* Sandboxing configuration
|
|
518
|
+
*/
|
|
519
|
+
sandboxing: exports.PluginSandboxingSchema.optional(),
|
|
520
|
+
/**
|
|
521
|
+
* Performance monitoring
|
|
522
|
+
*/
|
|
523
|
+
monitoring: exports.PluginPerformanceMonitoringSchema.optional(),
|
|
524
|
+
}).describe('Complete plugin loading configuration');
|
|
525
|
+
/**
|
|
526
|
+
* Plugin Loading Event
|
|
527
|
+
* Emitted during plugin loading lifecycle
|
|
528
|
+
*/
|
|
529
|
+
exports.PluginLoadingEventSchema = zod_1.z.object({
|
|
530
|
+
/**
|
|
531
|
+
* Event type
|
|
532
|
+
*/
|
|
533
|
+
type: zod_1.z.enum([
|
|
534
|
+
'load-started',
|
|
535
|
+
'load-completed',
|
|
536
|
+
'load-failed',
|
|
537
|
+
'init-started',
|
|
538
|
+
'init-completed',
|
|
539
|
+
'init-failed',
|
|
540
|
+
'preload-started',
|
|
541
|
+
'preload-completed',
|
|
542
|
+
'cache-hit',
|
|
543
|
+
'cache-miss',
|
|
544
|
+
'hot-reload',
|
|
545
|
+
]),
|
|
546
|
+
/**
|
|
547
|
+
* Plugin identifier
|
|
548
|
+
*/
|
|
549
|
+
pluginId: zod_1.z.string(),
|
|
550
|
+
/**
|
|
551
|
+
* Timestamp
|
|
552
|
+
*/
|
|
553
|
+
timestamp: zod_1.z.number().int().min(0),
|
|
554
|
+
/**
|
|
555
|
+
* Duration in milliseconds
|
|
556
|
+
*/
|
|
557
|
+
durationMs: zod_1.z.number().int().min(0).optional(),
|
|
558
|
+
/**
|
|
559
|
+
* Additional metadata
|
|
560
|
+
*/
|
|
561
|
+
metadata: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional(),
|
|
562
|
+
/**
|
|
563
|
+
* Error if event represents a failure
|
|
564
|
+
*/
|
|
565
|
+
error: zod_1.z.object({
|
|
566
|
+
message: zod_1.z.string(),
|
|
567
|
+
code: zod_1.z.string().optional(),
|
|
568
|
+
stack: zod_1.z.string().optional(),
|
|
569
|
+
}).optional(),
|
|
570
|
+
}).describe('Plugin loading lifecycle event');
|
|
571
|
+
/**
|
|
572
|
+
* Plugin Loading State
|
|
573
|
+
* Tracks the current loading state of a plugin
|
|
574
|
+
*/
|
|
575
|
+
exports.PluginLoadingStateSchema = zod_1.z.object({
|
|
576
|
+
/**
|
|
577
|
+
* Plugin identifier
|
|
578
|
+
*/
|
|
579
|
+
pluginId: zod_1.z.string(),
|
|
580
|
+
/**
|
|
581
|
+
* Current state
|
|
582
|
+
*/
|
|
583
|
+
state: zod_1.z.enum([
|
|
584
|
+
'pending', // Not yet loaded
|
|
585
|
+
'loading', // Currently loading
|
|
586
|
+
'loaded', // Code loaded, not initialized
|
|
587
|
+
'initializing', // Currently initializing
|
|
588
|
+
'ready', // Fully initialized and ready
|
|
589
|
+
'failed', // Failed to load or initialize
|
|
590
|
+
'reloading', // Hot reloading in progress
|
|
591
|
+
]),
|
|
592
|
+
/**
|
|
593
|
+
* Load progress (0-100)
|
|
594
|
+
*/
|
|
595
|
+
progress: zod_1.z.number().min(0).max(100).default(0),
|
|
596
|
+
/**
|
|
597
|
+
* Loading start time
|
|
598
|
+
*/
|
|
599
|
+
startedAt: zod_1.z.number().int().min(0).optional(),
|
|
600
|
+
/**
|
|
601
|
+
* Loading completion time
|
|
602
|
+
*/
|
|
603
|
+
completedAt: zod_1.z.number().int().min(0).optional(),
|
|
604
|
+
/**
|
|
605
|
+
* Last error
|
|
606
|
+
*/
|
|
607
|
+
lastError: zod_1.z.string().optional(),
|
|
608
|
+
/**
|
|
609
|
+
* Retry count
|
|
610
|
+
*/
|
|
611
|
+
retryCount: zod_1.z.number().int().min(0).default(0),
|
|
612
|
+
}).describe('Plugin loading state');
|