@objectstack/spec 1.0.11 → 1.1.0
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 +41 -1
- package/dist/ai/index.d.mts +2 -1
- package/dist/ai/index.d.ts +2 -1
- package/dist/ai/index.js +2047 -1944
- package/dist/ai/index.js.map +1 -1
- package/dist/ai/index.mjs +2047 -1944
- package/dist/ai/index.mjs.map +1 -1
- package/dist/api/index.d.mts +3 -1
- package/dist/api/index.d.ts +3 -1
- package/dist/api/index.js +2599 -2292
- package/dist/api/index.js.map +1 -1
- package/dist/api/index.mjs +2587 -2292
- package/dist/api/index.mjs.map +1 -1
- package/dist/automation/index.d.mts +2 -1
- package/dist/automation/index.d.ts +2 -1
- package/dist/automation/index.js +83 -0
- package/dist/automation/index.js.map +1 -1
- package/dist/automation/index.mjs +77 -0
- package/dist/automation/index.mjs.map +1 -1
- package/dist/contracts/index.d.mts +3 -2
- package/dist/contracts/index.d.ts +3 -2
- package/dist/data/index.d.mts +3 -2
- package/dist/data/index.d.ts +3 -2
- package/dist/data/index.js +658 -556
- package/dist/data/index.js.map +1 -1
- package/dist/data/index.mjs +656 -556
- package/dist/data/index.mjs.map +1 -1
- package/dist/{driver.zod-lfi00zVT.d.ts → driver.zod-CfGk9GYh.d.ts} +2164 -11
- package/dist/{driver.zod-BOM_Etco.d.mts → driver.zod-y1cX6R3c.d.mts} +2164 -11
- package/dist/hub/index.d.mts +1 -1
- package/dist/hub/index.d.ts +1 -1
- package/dist/hub/index.js +789 -724
- package/dist/hub/index.js.map +1 -1
- package/dist/hub/index.mjs +789 -724
- package/dist/hub/index.mjs.map +1 -1
- package/dist/{index-C67cfwmW.d.ts → index-B0Hf65bV.d.ts} +13 -5
- package/dist/{index-DLcySG7U.d.ts → index-B5pKM0My.d.ts} +335 -4370
- package/dist/{index-Os7lItRe.d.mts → index-BA022mg2.d.ts} +6178 -129
- package/dist/{index-B5-VbOKg.d.mts → index-BGeLoH2z.d.ts} +4251 -74
- package/dist/{index-CH5zloR3.d.ts → index-BwO__aqV.d.ts} +1 -1
- package/dist/{index-Dp7GFJ8V.d.mts → index-Cia3JPQ8.d.mts} +13 -5
- package/dist/{index-D12rNohm.d.mts → index-CpD1q1FP.d.ts} +35 -18
- package/dist/{index-Os7lItRe.d.ts → index-D5RSFPuB.d.mts} +6178 -129
- package/dist/{index-CU4m6noq.d.mts → index-DGjpaj0X.d.mts} +1 -1
- package/dist/{index-D12rNohm.d.ts → index-Dfn5VXl6.d.mts} +35 -18
- package/dist/{index-l6WIlmOD.d.mts → index-Dgybxlky.d.mts} +177 -158
- package/dist/{index-l6WIlmOD.d.ts → index-Dgybxlky.d.ts} +177 -158
- package/dist/{index-DLcySG7U.d.mts → index-Dpsk8PF4.d.mts} +335 -4370
- package/dist/{index-CyognKSZ.d.ts → index-DrNah5E0.d.ts} +1952 -6990
- package/dist/{index-DE_lJ11p.d.mts → index-OO84R20k.d.mts} +1952 -6990
- package/dist/{index-B5-VbOKg.d.ts → index-upA3Xt04.d.mts} +4251 -74
- package/dist/index.d.mts +8072 -1922
- package/dist/index.d.ts +8072 -1922
- package/dist/index.js +8563 -8249
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8563 -8249
- package/dist/index.mjs.map +1 -1
- package/dist/integration/index.d.mts +1 -1
- package/dist/integration/index.d.ts +1 -1
- package/dist/kernel/index.d.mts +2 -1
- package/dist/kernel/index.d.ts +2 -1
- package/dist/kernel/index.js +884 -684
- package/dist/kernel/index.js.map +1 -1
- package/dist/kernel/index.mjs +870 -684
- package/dist/kernel/index.mjs.map +1 -1
- package/dist/package-registry.zod-JMcOYNxM.d.mts +21119 -0
- package/dist/package-registry.zod-JMcOYNxM.d.ts +21119 -0
- package/dist/state-machine.zod-B-lFFSxQ.d.mts +285 -0
- package/dist/state-machine.zod-B-lFFSxQ.d.ts +285 -0
- package/dist/system/index.d.mts +2 -1
- package/dist/system/index.d.ts +2 -1
- package/dist/system/index.js +749 -651
- package/dist/system/index.js.map +1 -1
- package/dist/system/index.mjs +749 -651
- package/dist/system/index.mjs.map +1 -1
- package/dist/ui/index.d.mts +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/json-schema/ai/Agent.json +499 -0
- package/json-schema/ai/DevOpsAgent.json +499 -0
- package/json-schema/ai/FeedbackLoop.json +2188 -186
- package/json-schema/ai/Resolution.json +2188 -186
- package/json-schema/api/ApiRoutes.json +4 -0
- package/json-schema/api/CompileManifestResponse.json +40 -10
- package/json-schema/api/DisablePackageRequest.json +18 -0
- package/json-schema/api/DisablePackageResponse.json +1521 -0
- package/json-schema/api/Discovery.json +4 -0
- package/json-schema/api/EnablePackageRequest.json +18 -0
- package/json-schema/api/EnablePackageResponse.json +1521 -0
- package/json-schema/api/GetDiscoveryResponse.json +4 -0
- package/json-schema/api/GetPackageRequest.json +18 -0
- package/json-schema/api/GetPackageResponse.json +1518 -0
- package/json-schema/api/InstallPackageRequest.json +1483 -0
- package/json-schema/api/InstallPackageResponse.json +1521 -0
- package/json-schema/api/ListPackagesRequest.json +42 -0
- package/json-schema/api/ListPackagesResponse.json +1525 -0
- package/json-schema/api/ObjectDefinitionResponse.json +1001 -0
- package/json-schema/api/ObjectStackProtocol.json +86 -1
- package/json-schema/api/RestApiConfig.json +5 -0
- package/json-schema/api/RestServerConfig.json +5 -0
- package/json-schema/api/UninstallPackageRequest.json +18 -0
- package/json-schema/api/UninstallPackageResponse.json +25 -0
- package/json-schema/automation/ActionRef.json +30 -0
- package/json-schema/automation/Event.json +24 -0
- package/json-schema/automation/Flow.json +1 -0
- package/json-schema/automation/FlowNode.json +1 -0
- package/json-schema/automation/FlowNodeAction.json +1 -0
- package/json-schema/automation/GuardRef.json +30 -0
- package/json-schema/automation/StateMachine.json +504 -0
- package/json-schema/automation/StateNode.json +324 -0
- package/json-schema/automation/Transition.json +73 -0
- package/json-schema/data/Object.json +1001 -0
- package/json-schema/data/ObjectExtension.json +2376 -0
- package/json-schema/data/ObjectOwnershipEnum.json +13 -0
- package/json-schema/hub/ComposerResponse.json +40 -10
- package/json-schema/kernel/DisablePackageRequest.json +18 -0
- package/json-schema/kernel/DisablePackageResponse.json +1521 -0
- package/json-schema/kernel/EnablePackageRequest.json +18 -0
- package/json-schema/kernel/EnablePackageResponse.json +1521 -0
- package/json-schema/kernel/EventBusConfig.json +15 -0
- package/json-schema/kernel/EventHandler.json +6 -0
- package/json-schema/kernel/EventPersistence.json +3 -0
- package/json-schema/kernel/EventRoute.json +3 -0
- package/json-schema/kernel/EventWebhookConfig.json +3 -0
- package/json-schema/kernel/GetPackageRequest.json +18 -0
- package/json-schema/kernel/GetPackageResponse.json +1518 -0
- package/json-schema/kernel/InstallPackageRequest.json +1483 -0
- package/json-schema/kernel/InstallPackageResponse.json +1521 -0
- package/json-schema/kernel/InstalledPackage.json +1509 -0
- package/json-schema/kernel/ListPackagesRequest.json +42 -0
- package/json-schema/kernel/ListPackagesResponse.json +1525 -0
- package/json-schema/kernel/Manifest.json +40 -10
- package/json-schema/kernel/PackageStatusEnum.json +16 -0
- package/json-schema/kernel/Plugin.json +5 -0
- package/json-schema/kernel/PluginContext.json +31 -7
- package/json-schema/kernel/PluginLifecycle.json +7 -1
- package/json-schema/kernel/RealTimeNotificationConfig.json +3 -0
- package/json-schema/kernel/UninstallPackageRequest.json +18 -0
- package/json-schema/kernel/UninstallPackageResponse.json +25 -0
- package/json-schema/system/ChangeSet.json +2188 -186
- package/json-schema/system/CreateObjectOperation.json +1001 -0
- package/json-schema/system/MigrationOperation.json +1001 -0
- package/package.json +29 -15
- package/prompts/create-new-project.md +37 -19
- package/dist/{index-I3piy4U4.d.mts → index-BmU_sD1f.d.mts} +8 -8
- package/dist/{index-CkhpsEUw.d.ts → index-BnXuc_HO.d.ts} +8 -8
- package/dist/{index-CIDI-8zR.d.mts → index-C_NTOcet.d.mts} +98 -98
- package/dist/{index-CIDI-8zR.d.ts → index-C_NTOcet.d.ts} +98 -98
package/dist/kernel/index.js
CHANGED
|
@@ -30,8 +30,12 @@ __export(kernel_exports, {
|
|
|
30
30
|
DependencyConflictSchema: () => DependencyConflictSchema,
|
|
31
31
|
DependencyResolutionResultSchema: () => DependencyResolutionResultSchema,
|
|
32
32
|
DeprecationNoticeSchema: () => DeprecationNoticeSchema,
|
|
33
|
+
DisablePackageRequestSchema: () => DisablePackageRequestSchema,
|
|
34
|
+
DisablePackageResponseSchema: () => DisablePackageResponseSchema,
|
|
33
35
|
DistributedStateConfigSchema: () => DistributedStateConfigSchema,
|
|
34
36
|
EVENT_PRIORITY_VALUES: () => EVENT_PRIORITY_VALUES,
|
|
37
|
+
EnablePackageRequestSchema: () => EnablePackageRequestSchema,
|
|
38
|
+
EnablePackageResponseSchema: () => EnablePackageResponseSchema,
|
|
35
39
|
EventBusConfigSchema: () => EventBusConfigSchema,
|
|
36
40
|
EventHandlerSchema: () => EventHandlerSchema,
|
|
37
41
|
EventLogEntrySchema: () => EventLogEntrySchema,
|
|
@@ -51,15 +55,22 @@ __export(kernel_exports, {
|
|
|
51
55
|
FeatureFlag: () => FeatureFlag,
|
|
52
56
|
FeatureFlagSchema: () => FeatureFlagSchema,
|
|
53
57
|
FeatureStrategy: () => FeatureStrategy,
|
|
58
|
+
GetPackageRequestSchema: () => GetPackageRequestSchema,
|
|
59
|
+
GetPackageResponseSchema: () => GetPackageResponseSchema,
|
|
54
60
|
GracefulDegradationSchema: () => GracefulDegradationSchema,
|
|
55
61
|
HealthStatusSchema: () => HealthStatusSchema,
|
|
56
62
|
HookRegisteredEventSchema: () => HookRegisteredEventSchema,
|
|
57
63
|
HookTriggeredEventSchema: () => HookTriggeredEventSchema,
|
|
58
64
|
HotReloadConfigSchema: () => HotReloadConfigSchema,
|
|
65
|
+
InstallPackageRequestSchema: () => InstallPackageRequestSchema,
|
|
66
|
+
InstallPackageResponseSchema: () => InstallPackageResponseSchema,
|
|
67
|
+
InstalledPackageSchema: () => InstalledPackageSchema,
|
|
59
68
|
KernelContextSchema: () => KernelContextSchema,
|
|
60
69
|
KernelEventBaseSchema: () => KernelEventBaseSchema,
|
|
61
70
|
KernelReadyEventSchema: () => KernelReadyEventSchema,
|
|
62
71
|
KernelShutdownEventSchema: () => KernelShutdownEventSchema,
|
|
72
|
+
ListPackagesRequestSchema: () => ListPackagesRequestSchema,
|
|
73
|
+
ListPackagesResponseSchema: () => ListPackagesResponseSchema,
|
|
63
74
|
ManifestSchema: () => ManifestSchema,
|
|
64
75
|
MetadataCollectionInfoSchema: () => MetadataCollectionInfoSchema,
|
|
65
76
|
MetadataExportOptionsSchema: () => MetadataExportOptionsSchema,
|
|
@@ -77,6 +88,7 @@ __export(kernel_exports, {
|
|
|
77
88
|
OpsDomainModuleSchema: () => OpsDomainModuleSchema,
|
|
78
89
|
OpsFilePathSchema: () => OpsFilePathSchema,
|
|
79
90
|
OpsPluginStructureSchema: () => OpsPluginStructureSchema,
|
|
91
|
+
PackageStatusEnum: () => PackageStatusEnum,
|
|
80
92
|
PermissionActionSchema: () => PermissionActionSchema,
|
|
81
93
|
PermissionSchema: () => PermissionSchema,
|
|
82
94
|
PermissionScopeSchema: () => PermissionScopeSchema,
|
|
@@ -139,6 +151,8 @@ __export(kernel_exports, {
|
|
|
139
151
|
ServiceUnregisteredEventSchema: () => ServiceUnregisteredEventSchema,
|
|
140
152
|
StartupOptionsSchema: () => StartupOptionsSchema,
|
|
141
153
|
StartupOrchestrationResultSchema: () => StartupOrchestrationResultSchema,
|
|
154
|
+
UninstallPackageRequestSchema: () => UninstallPackageRequestSchema,
|
|
155
|
+
UninstallPackageResponseSchema: () => UninstallPackageResponseSchema,
|
|
142
156
|
ValidationErrorSchema: () => ValidationErrorSchema,
|
|
143
157
|
ValidationResultSchema: () => ValidationResultSchema,
|
|
144
158
|
ValidationWarningSchema: () => ValidationWarningSchema,
|
|
@@ -270,7 +284,7 @@ var EventHandlerSchema = import_zod3.z.object({
|
|
|
270
284
|
/**
|
|
271
285
|
* Handler function
|
|
272
286
|
*/
|
|
273
|
-
handler: import_zod3.z.
|
|
287
|
+
handler: import_zod3.z.any().describe("Handler function"),
|
|
274
288
|
/**
|
|
275
289
|
* Execution priority
|
|
276
290
|
*/
|
|
@@ -294,17 +308,17 @@ var EventHandlerSchema = import_zod3.z.object({
|
|
|
294
308
|
/**
|
|
295
309
|
* Filter function
|
|
296
310
|
*/
|
|
297
|
-
filter: import_zod3.z.
|
|
311
|
+
filter: import_zod3.z.any().optional().describe("Optional filter to determine if handler should execute")
|
|
298
312
|
});
|
|
299
313
|
var EventRouteSchema = import_zod3.z.object({
|
|
300
314
|
from: import_zod3.z.string().describe("Source event pattern (supports wildcards, e.g., user.* or *.created)"),
|
|
301
315
|
to: import_zod3.z.array(import_zod3.z.string()).describe("Target event names to route to"),
|
|
302
|
-
transform: import_zod3.z.
|
|
316
|
+
transform: import_zod3.z.any().optional().describe("Optional function to transform payload")
|
|
303
317
|
});
|
|
304
318
|
var EventPersistenceSchema = import_zod3.z.object({
|
|
305
319
|
enabled: import_zod3.z.boolean().default(false).describe("Enable event persistence"),
|
|
306
320
|
retention: import_zod3.z.number().int().positive().describe("Days to retain persisted events"),
|
|
307
|
-
filter: import_zod3.z.
|
|
321
|
+
filter: import_zod3.z.any().optional().describe("Optional filter function to select which events to persist"),
|
|
308
322
|
storage: import_zod3.z.enum(["database", "file", "s3", "custom"]).default("database").describe("Storage backend for persisted events")
|
|
309
323
|
});
|
|
310
324
|
var EventQueueConfigSchema = import_zod3.z.object({
|
|
@@ -496,7 +510,7 @@ var EventWebhookConfigSchema = import_zod3.z.object({
|
|
|
496
510
|
/**
|
|
497
511
|
* Event transformation
|
|
498
512
|
*/
|
|
499
|
-
transform: import_zod3.z.
|
|
513
|
+
transform: import_zod3.z.any().optional().describe("Transform event before sending"),
|
|
500
514
|
/**
|
|
501
515
|
* Enabled
|
|
502
516
|
*/
|
|
@@ -567,7 +581,7 @@ var RealTimeNotificationConfigSchema = import_zod3.z.object({
|
|
|
567
581
|
channels: import_zod3.z.array(import_zod3.z.object({
|
|
568
582
|
name: import_zod3.z.string().describe("Channel name"),
|
|
569
583
|
eventPattern: import_zod3.z.string().describe("Event pattern for channel"),
|
|
570
|
-
filter: import_zod3.z.
|
|
584
|
+
filter: import_zod3.z.any().optional().describe("Additional filter function")
|
|
571
585
|
})).optional().describe("Named channels for event broadcasting"),
|
|
572
586
|
/**
|
|
573
587
|
* Rate limiting
|
|
@@ -666,7 +680,7 @@ var FeatureFlag = Object.assign(FeatureFlagSchema, {
|
|
|
666
680
|
});
|
|
667
681
|
|
|
668
682
|
// src/kernel/manifest.zod.ts
|
|
669
|
-
var
|
|
683
|
+
var import_zod9 = require("zod");
|
|
670
684
|
|
|
671
685
|
// src/kernel/plugin-capability.zod.ts
|
|
672
686
|
var import_zod5 = require("zod");
|
|
@@ -1485,48 +1499,48 @@ var PluginLoadingStateSchema = import_zod6.z.object({
|
|
|
1485
1499
|
var import_zod7 = require("zod");
|
|
1486
1500
|
var PluginContextSchema = import_zod7.z.object({
|
|
1487
1501
|
ql: import_zod7.z.object({
|
|
1488
|
-
object: import_zod7.z.
|
|
1502
|
+
object: import_zod7.z.any(),
|
|
1489
1503
|
// Return any to allow method chaining
|
|
1490
|
-
query: import_zod7.z.
|
|
1504
|
+
query: import_zod7.z.any()
|
|
1491
1505
|
}).passthrough().describe("ObjectQL Engine Interface"),
|
|
1492
1506
|
os: import_zod7.z.object({
|
|
1493
|
-
getCurrentUser: import_zod7.z.
|
|
1494
|
-
getConfig: import_zod7.z.
|
|
1507
|
+
getCurrentUser: import_zod7.z.any(),
|
|
1508
|
+
getConfig: import_zod7.z.any()
|
|
1495
1509
|
}).passthrough().describe("ObjectStack Kernel Interface"),
|
|
1496
1510
|
logger: import_zod7.z.object({
|
|
1497
|
-
debug: import_zod7.z.
|
|
1498
|
-
info: import_zod7.z.
|
|
1499
|
-
warn: import_zod7.z.
|
|
1500
|
-
error: import_zod7.z.
|
|
1511
|
+
debug: import_zod7.z.any(),
|
|
1512
|
+
info: import_zod7.z.any(),
|
|
1513
|
+
warn: import_zod7.z.any(),
|
|
1514
|
+
error: import_zod7.z.any()
|
|
1501
1515
|
}).passthrough().describe("Logger Interface"),
|
|
1502
1516
|
storage: import_zod7.z.object({
|
|
1503
|
-
get: import_zod7.z.
|
|
1504
|
-
set: import_zod7.z.
|
|
1505
|
-
delete: import_zod7.z.
|
|
1517
|
+
get: import_zod7.z.any(),
|
|
1518
|
+
set: import_zod7.z.any(),
|
|
1519
|
+
delete: import_zod7.z.any()
|
|
1506
1520
|
}).passthrough().describe("Storage Interface"),
|
|
1507
1521
|
i18n: import_zod7.z.object({
|
|
1508
|
-
t: import_zod7.z.
|
|
1509
|
-
getLocale: import_zod7.z.
|
|
1522
|
+
t: import_zod7.z.any(),
|
|
1523
|
+
getLocale: import_zod7.z.any()
|
|
1510
1524
|
}).passthrough().describe("Internationalization Interface"),
|
|
1511
1525
|
metadata: import_zod7.z.record(import_zod7.z.string(), import_zod7.z.any()),
|
|
1512
1526
|
events: import_zod7.z.record(import_zod7.z.string(), import_zod7.z.any()),
|
|
1513
1527
|
app: import_zod7.z.object({
|
|
1514
1528
|
router: import_zod7.z.object({
|
|
1515
|
-
get: import_zod7.z.
|
|
1516
|
-
post: import_zod7.z.
|
|
1517
|
-
use: import_zod7.z.
|
|
1529
|
+
get: import_zod7.z.any(),
|
|
1530
|
+
post: import_zod7.z.any(),
|
|
1531
|
+
use: import_zod7.z.any()
|
|
1518
1532
|
}).passthrough()
|
|
1519
1533
|
}).passthrough().describe("App Framework Interface"),
|
|
1520
1534
|
drivers: import_zod7.z.object({
|
|
1521
|
-
register: import_zod7.z.
|
|
1535
|
+
register: import_zod7.z.any()
|
|
1522
1536
|
}).passthrough().describe("Driver Registry")
|
|
1523
1537
|
});
|
|
1524
1538
|
var PluginLifecycleSchema = import_zod7.z.object({
|
|
1525
|
-
onInstall: import_zod7.z.
|
|
1526
|
-
onEnable: import_zod7.z.
|
|
1527
|
-
onDisable: import_zod7.z.
|
|
1528
|
-
onUninstall: import_zod7.z.
|
|
1529
|
-
onUpgrade: import_zod7.z.
|
|
1539
|
+
onInstall: import_zod7.z.any().optional(),
|
|
1540
|
+
onEnable: import_zod7.z.any().optional(),
|
|
1541
|
+
onDisable: import_zod7.z.any().optional(),
|
|
1542
|
+
onUninstall: import_zod7.z.any().optional(),
|
|
1543
|
+
onUpgrade: import_zod7.z.any().optional()
|
|
1530
1544
|
});
|
|
1531
1545
|
var CORE_PLUGIN_TYPES = [
|
|
1532
1546
|
"ui",
|
|
@@ -1563,8 +1577,53 @@ function definePlugin(config) {
|
|
|
1563
1577
|
return config;
|
|
1564
1578
|
}
|
|
1565
1579
|
|
|
1580
|
+
// src/data/dataset.zod.ts
|
|
1581
|
+
var import_zod8 = require("zod");
|
|
1582
|
+
var DatasetMode = import_zod8.z.enum([
|
|
1583
|
+
"insert",
|
|
1584
|
+
// Try to insert, fail on duplicate
|
|
1585
|
+
"update",
|
|
1586
|
+
// Only update found records, ignore new
|
|
1587
|
+
"upsert",
|
|
1588
|
+
// Create new or Update existing (Standard)
|
|
1589
|
+
"replace",
|
|
1590
|
+
// Delete ALL records in object then insert (Dangerous - use for cache tables)
|
|
1591
|
+
"ignore"
|
|
1592
|
+
// Try to insert, silently skip duplicates
|
|
1593
|
+
]);
|
|
1594
|
+
var DatasetSchema = import_zod8.z.object({
|
|
1595
|
+
/**
|
|
1596
|
+
* Target Object
|
|
1597
|
+
* The machine name of the object to populate.
|
|
1598
|
+
*/
|
|
1599
|
+
object: import_zod8.z.string().regex(/^[a-z_][a-z0-9_]*$/).describe("Target Object Name"),
|
|
1600
|
+
/**
|
|
1601
|
+
* Idempotency Key (The "Upsert" Key)
|
|
1602
|
+
* The field used to check if a record already exists.
|
|
1603
|
+
* Best Practice: Use a natural key like 'code', 'slug', 'username' or 'external_id'.
|
|
1604
|
+
* Standard: '_id' (internal ID) is rarely used for portable seed data.
|
|
1605
|
+
*/
|
|
1606
|
+
externalId: import_zod8.z.string().default("name").describe("Field match for uniqueness check"),
|
|
1607
|
+
/**
|
|
1608
|
+
* Import Strategy
|
|
1609
|
+
*/
|
|
1610
|
+
mode: DatasetMode.default("upsert").describe("Conflict resolution strategy"),
|
|
1611
|
+
/**
|
|
1612
|
+
* Environment Scope
|
|
1613
|
+
* - 'all': Always load
|
|
1614
|
+
* - 'dev': Only for development/demo
|
|
1615
|
+
* - 'test': Only for CI/CD tests
|
|
1616
|
+
*/
|
|
1617
|
+
env: import_zod8.z.array(import_zod8.z.enum(["prod", "dev", "test"])).default(["prod", "dev", "test"]).describe("Applicable environments"),
|
|
1618
|
+
/**
|
|
1619
|
+
* The Payload
|
|
1620
|
+
* Array of raw JSON objects matching the Object Schema.
|
|
1621
|
+
*/
|
|
1622
|
+
records: import_zod8.z.array(import_zod8.z.record(import_zod8.z.string(), import_zod8.z.any())).describe("Data records")
|
|
1623
|
+
});
|
|
1624
|
+
|
|
1566
1625
|
// src/kernel/manifest.zod.ts
|
|
1567
|
-
var ManifestSchema =
|
|
1626
|
+
var ManifestSchema = import_zod9.z.object({
|
|
1568
1627
|
/**
|
|
1569
1628
|
* Unique package identifier using reverse domain notation.
|
|
1570
1629
|
* Must be unique across the entire ecosystem.
|
|
@@ -1572,14 +1631,30 @@ var ManifestSchema = import_zod8.z.object({
|
|
|
1572
1631
|
* @example "com.steedos.crm"
|
|
1573
1632
|
* @example "org.apache.superset"
|
|
1574
1633
|
*/
|
|
1575
|
-
id:
|
|
1634
|
+
id: import_zod9.z.string().describe("Unique package identifier (reverse domain style)"),
|
|
1635
|
+
/**
|
|
1636
|
+
* Short namespace identifier for metadata scoping.
|
|
1637
|
+
* Used as a prefix for objects and other metadata to prevent naming collisions
|
|
1638
|
+
* across packages from different vendors.
|
|
1639
|
+
*
|
|
1640
|
+
* Rules:
|
|
1641
|
+
* - 2-20 characters, lowercase letters, digits, and underscores only.
|
|
1642
|
+
* - Must be unique within a running instance.
|
|
1643
|
+
* - Platform-reserved namespaces (no prefix applied): "base", "system".
|
|
1644
|
+
* - FQN (Fully Qualified Name) = `{namespace}__{short_name}` (double underscore separator).
|
|
1645
|
+
*
|
|
1646
|
+
* @example "crm" → objects become crm__account, crm__deal
|
|
1647
|
+
* @example "todo" → objects become todo__task
|
|
1648
|
+
* @example "base" → objects keep short name (platform reserved)
|
|
1649
|
+
*/
|
|
1650
|
+
namespace: import_zod9.z.string().regex(/^[a-z][a-z0-9_]{1,19}$/, "Namespace must be 2-20 chars, lowercase alphanumeric + underscore").optional().describe('Short namespace identifier for metadata scoping (e.g. "crm", "todo")'),
|
|
1576
1651
|
/**
|
|
1577
1652
|
* Package version following semantic versioning (major.minor.patch).
|
|
1578
1653
|
*
|
|
1579
1654
|
* @example "1.0.0"
|
|
1580
1655
|
* @example "2.1.0-beta.1"
|
|
1581
1656
|
*/
|
|
1582
|
-
version:
|
|
1657
|
+
version: import_zod9.z.string().regex(/^\d+\.\d+\.\d+$/).describe("Package version (semantic versioning)"),
|
|
1583
1658
|
/**
|
|
1584
1659
|
* Type of the package in the ObjectStack ecosystem.
|
|
1585
1660
|
* - plugin: General-purpose functionality extension (Runtime: standard)
|
|
@@ -1593,7 +1668,7 @@ var ManifestSchema = import_zod8.z.object({
|
|
|
1593
1668
|
* - objectql: Core engine
|
|
1594
1669
|
* - adapter: Host adapter (Express, Fastify)
|
|
1595
1670
|
*/
|
|
1596
|
-
type:
|
|
1671
|
+
type: import_zod9.z.enum([
|
|
1597
1672
|
"plugin",
|
|
1598
1673
|
...CORE_PLUGIN_TYPES,
|
|
1599
1674
|
"module",
|
|
@@ -1607,40 +1682,40 @@ var ManifestSchema = import_zod8.z.object({
|
|
|
1607
1682
|
*
|
|
1608
1683
|
* @example "Project Management"
|
|
1609
1684
|
*/
|
|
1610
|
-
name:
|
|
1685
|
+
name: import_zod9.z.string().describe("Human-readable package name"),
|
|
1611
1686
|
/**
|
|
1612
1687
|
* Brief description of the package functionality.
|
|
1613
1688
|
* Displayed in the marketplace and plugin manager.
|
|
1614
1689
|
*/
|
|
1615
|
-
description:
|
|
1690
|
+
description: import_zod9.z.string().optional().describe("Package description"),
|
|
1616
1691
|
/**
|
|
1617
1692
|
* Array of permission strings that the package requires.
|
|
1618
1693
|
* These form the "Scope" requested by the package at installation.
|
|
1619
1694
|
*
|
|
1620
1695
|
* @example ["system.user.read", "system.data.write"]
|
|
1621
1696
|
*/
|
|
1622
|
-
permissions:
|
|
1697
|
+
permissions: import_zod9.z.array(import_zod9.z.string()).optional().describe("Array of required permission strings"),
|
|
1623
1698
|
/**
|
|
1624
1699
|
* Glob patterns specifying ObjectQL schemas files.
|
|
1625
1700
|
* Matches `*.object.yml` or `*.object.ts` files to load business objects.
|
|
1626
1701
|
*
|
|
1627
1702
|
* @example ["./src/objects/*.object.yml"]
|
|
1628
1703
|
*/
|
|
1629
|
-
objects:
|
|
1704
|
+
objects: import_zod9.z.array(import_zod9.z.string()).optional().describe("Glob patterns for ObjectQL schemas files"),
|
|
1630
1705
|
/**
|
|
1631
1706
|
* Defines system level DataSources.
|
|
1632
1707
|
* Matches `*.datasource.yml` files.
|
|
1633
1708
|
*
|
|
1634
1709
|
* @example ["./src/datasources/*.datasource.mongo.yml"]
|
|
1635
1710
|
*/
|
|
1636
|
-
datasources:
|
|
1711
|
+
datasources: import_zod9.z.array(import_zod9.z.string()).optional().describe("Glob patterns for Datasource definitions"),
|
|
1637
1712
|
/**
|
|
1638
1713
|
* Package Dependencies.
|
|
1639
1714
|
* Map of package IDs to version requirements.
|
|
1640
1715
|
*
|
|
1641
1716
|
* @example { "@steedos/plugin-auth": "^2.0.0" }
|
|
1642
1717
|
*/
|
|
1643
|
-
dependencies:
|
|
1718
|
+
dependencies: import_zod9.z.record(import_zod9.z.string(), import_zod9.z.string()).optional().describe("Package dependencies"),
|
|
1644
1719
|
/**
|
|
1645
1720
|
* Plugin Configuration Schema.
|
|
1646
1721
|
* Defines the settings this plugin exposes to the user via UI/ENV.
|
|
@@ -1655,110 +1730,114 @@ var ManifestSchema = import_zod8.z.object({
|
|
|
1655
1730
|
* }
|
|
1656
1731
|
* }
|
|
1657
1732
|
*/
|
|
1658
|
-
configuration:
|
|
1659
|
-
title:
|
|
1660
|
-
properties:
|
|
1661
|
-
type:
|
|
1662
|
-
default:
|
|
1663
|
-
description:
|
|
1664
|
-
required:
|
|
1665
|
-
secret:
|
|
1666
|
-
enum:
|
|
1733
|
+
configuration: import_zod9.z.object({
|
|
1734
|
+
title: import_zod9.z.string().optional(),
|
|
1735
|
+
properties: import_zod9.z.record(import_zod9.z.string(), import_zod9.z.object({
|
|
1736
|
+
type: import_zod9.z.enum(["string", "number", "boolean", "array", "object"]).describe("Data type of the setting"),
|
|
1737
|
+
default: import_zod9.z.any().optional().describe("Default value"),
|
|
1738
|
+
description: import_zod9.z.string().optional().describe("Tooltip description"),
|
|
1739
|
+
required: import_zod9.z.boolean().optional().describe("Is this setting required?"),
|
|
1740
|
+
secret: import_zod9.z.boolean().optional().describe("If true, value is encrypted/masked (e.g. API Keys)"),
|
|
1741
|
+
enum: import_zod9.z.array(import_zod9.z.string()).optional().describe("Allowed values for select inputs")
|
|
1667
1742
|
})).describe("Map of configuration keys to their definitions")
|
|
1668
1743
|
}).optional().describe("Plugin configuration settings"),
|
|
1669
1744
|
/**
|
|
1670
1745
|
* Contribution Points (VS Code Style).
|
|
1671
1746
|
* formalized way to extend the platform capabilities.
|
|
1672
1747
|
*/
|
|
1673
|
-
contributes:
|
|
1748
|
+
contributes: import_zod9.z.object({
|
|
1674
1749
|
/**
|
|
1675
1750
|
* Register new Metadata Kinds (CRDs).
|
|
1676
1751
|
* Enables the system to parse and validate new file types.
|
|
1677
1752
|
* Example: Registering a BI plugin to handle *.report.ts
|
|
1678
1753
|
*/
|
|
1679
|
-
kinds:
|
|
1680
|
-
id:
|
|
1681
|
-
globs:
|
|
1682
|
-
description:
|
|
1754
|
+
kinds: import_zod9.z.array(import_zod9.z.object({
|
|
1755
|
+
id: import_zod9.z.string().describe('The generic identifier of the kind (e.g., "sys.bi.report")'),
|
|
1756
|
+
globs: import_zod9.z.array(import_zod9.z.string()).describe('File patterns to watch (e.g., ["**/*.report.ts"])'),
|
|
1757
|
+
description: import_zod9.z.string().optional().describe("Description of what this kind represents")
|
|
1683
1758
|
})).optional().describe("New Metadata Types to recognize"),
|
|
1684
1759
|
/**
|
|
1685
1760
|
* Register System Hooks.
|
|
1686
1761
|
* Declares that this plugin listens to specific system events.
|
|
1687
1762
|
*/
|
|
1688
|
-
events:
|
|
1763
|
+
events: import_zod9.z.array(import_zod9.z.string()).optional().describe("Events this plugin listens to"),
|
|
1689
1764
|
/**
|
|
1690
1765
|
* Register UI Menus.
|
|
1691
1766
|
*/
|
|
1692
|
-
menus:
|
|
1693
|
-
id:
|
|
1694
|
-
label:
|
|
1695
|
-
command:
|
|
1767
|
+
menus: import_zod9.z.record(import_zod9.z.string(), import_zod9.z.array(import_zod9.z.object({
|
|
1768
|
+
id: import_zod9.z.string(),
|
|
1769
|
+
label: import_zod9.z.string(),
|
|
1770
|
+
command: import_zod9.z.string().optional()
|
|
1696
1771
|
}))).optional().describe("UI Menu contributions"),
|
|
1697
1772
|
/**
|
|
1698
1773
|
* Register Custom Themes.
|
|
1699
1774
|
*/
|
|
1700
|
-
themes:
|
|
1701
|
-
id:
|
|
1702
|
-
label:
|
|
1703
|
-
path:
|
|
1775
|
+
themes: import_zod9.z.array(import_zod9.z.object({
|
|
1776
|
+
id: import_zod9.z.string(),
|
|
1777
|
+
label: import_zod9.z.string(),
|
|
1778
|
+
path: import_zod9.z.string()
|
|
1704
1779
|
})).optional().describe("Theme contributions"),
|
|
1705
1780
|
/**
|
|
1706
1781
|
* Register Translations.
|
|
1707
1782
|
* Path to translation files (e.g. "locales/en.json").
|
|
1708
1783
|
*/
|
|
1709
|
-
translations:
|
|
1710
|
-
locale:
|
|
1711
|
-
path:
|
|
1784
|
+
translations: import_zod9.z.array(import_zod9.z.object({
|
|
1785
|
+
locale: import_zod9.z.string(),
|
|
1786
|
+
path: import_zod9.z.string()
|
|
1712
1787
|
})).optional().describe("Translation resources"),
|
|
1713
1788
|
/**
|
|
1714
1789
|
* Register Server Actions.
|
|
1715
1790
|
* Invocable functions exposed to Flows or API.
|
|
1716
1791
|
*/
|
|
1717
|
-
actions:
|
|
1718
|
-
name:
|
|
1719
|
-
label:
|
|
1720
|
-
description:
|
|
1721
|
-
input:
|
|
1722
|
-
output:
|
|
1792
|
+
actions: import_zod9.z.array(import_zod9.z.object({
|
|
1793
|
+
name: import_zod9.z.string().describe("Unique action name"),
|
|
1794
|
+
label: import_zod9.z.string().optional(),
|
|
1795
|
+
description: import_zod9.z.string().optional(),
|
|
1796
|
+
input: import_zod9.z.any().optional().describe("Input validation schema"),
|
|
1797
|
+
output: import_zod9.z.any().optional().describe("Output schema")
|
|
1723
1798
|
})).optional().describe("Exposed server actions"),
|
|
1724
1799
|
/**
|
|
1725
1800
|
* Register Storage Drivers.
|
|
1726
1801
|
* Enables connecting to new types of datasources.
|
|
1727
1802
|
*/
|
|
1728
|
-
drivers:
|
|
1729
|
-
id:
|
|
1730
|
-
label:
|
|
1731
|
-
description:
|
|
1803
|
+
drivers: import_zod9.z.array(import_zod9.z.object({
|
|
1804
|
+
id: import_zod9.z.string().describe('Driver unique identifier (e.g. "postgres", "mongo")'),
|
|
1805
|
+
label: import_zod9.z.string().describe("Human readable name"),
|
|
1806
|
+
description: import_zod9.z.string().optional()
|
|
1732
1807
|
})).optional().describe("Driver contributions"),
|
|
1733
1808
|
/**
|
|
1734
1809
|
* Register Custom Field Types.
|
|
1735
1810
|
* Extends the data model with new widget types.
|
|
1736
1811
|
*/
|
|
1737
|
-
fieldTypes:
|
|
1738
|
-
name:
|
|
1739
|
-
label:
|
|
1740
|
-
description:
|
|
1812
|
+
fieldTypes: import_zod9.z.array(import_zod9.z.object({
|
|
1813
|
+
name: import_zod9.z.string().describe('Unique field type name (e.g. "vector")'),
|
|
1814
|
+
label: import_zod9.z.string().describe("Display label"),
|
|
1815
|
+
description: import_zod9.z.string().optional()
|
|
1741
1816
|
})).optional().describe("Field Type contributions"),
|
|
1742
1817
|
/**
|
|
1743
1818
|
* Register Custom Query Operators/Functions.
|
|
1744
1819
|
* Extends ObjectQL with new functions (e.g. distance()).
|
|
1745
1820
|
*/
|
|
1746
|
-
functions:
|
|
1747
|
-
name:
|
|
1748
|
-
description:
|
|
1749
|
-
args:
|
|
1750
|
-
returnType:
|
|
1821
|
+
functions: import_zod9.z.array(import_zod9.z.object({
|
|
1822
|
+
name: import_zod9.z.string().describe('Function name (e.g. "distance")'),
|
|
1823
|
+
description: import_zod9.z.string().optional(),
|
|
1824
|
+
args: import_zod9.z.array(import_zod9.z.string()).optional().describe("Argument types"),
|
|
1825
|
+
returnType: import_zod9.z.string().optional()
|
|
1751
1826
|
})).optional().describe("Query Function contributions")
|
|
1752
1827
|
}).optional().describe("Platform contributions"),
|
|
1753
1828
|
/**
|
|
1754
1829
|
* Initial data seeding configuration.
|
|
1755
1830
|
* Defines default records to be inserted when the package is installed.
|
|
1831
|
+
*
|
|
1832
|
+
* Uses the standard DatasetSchema which supports idempotent upsert via
|
|
1833
|
+
* `externalId`, environment scoping via `env`, and multiple conflict
|
|
1834
|
+
* resolution modes.
|
|
1835
|
+
*
|
|
1836
|
+
* @deprecated Prefer using the top-level `data` field on the Stack Definition
|
|
1837
|
+
* (defineStack({ data: [...] })) for better visibility and metadata registration.
|
|
1838
|
+
* This field is retained for backward compatibility with manifest-only packages.
|
|
1756
1839
|
*/
|
|
1757
|
-
data:
|
|
1758
|
-
object: import_zod8.z.string().describe("Target Object Name"),
|
|
1759
|
-
records: import_zod8.z.array(import_zod8.z.record(import_zod8.z.string(), import_zod8.z.any())).describe("List of records to insert"),
|
|
1760
|
-
mode: import_zod8.z.enum(["upsert", "insert", "ignore"]).default("upsert").describe("Seeding mode")
|
|
1761
|
-
})).optional().describe("Initial seed data"),
|
|
1840
|
+
data: import_zod9.z.array(DatasetSchema).optional().describe("Initial seed data (prefer top-level data field)"),
|
|
1762
1841
|
/**
|
|
1763
1842
|
* Plugin Capability Manifest.
|
|
1764
1843
|
* Declares protocols implemented, interfaces provided, dependencies, and extension points.
|
|
@@ -1769,7 +1848,7 @@ var ManifestSchema = import_zod8.z.object({
|
|
|
1769
1848
|
* Extension points contributed by this package.
|
|
1770
1849
|
* Allows packages to extend UI components, add functionality, etc.
|
|
1771
1850
|
*/
|
|
1772
|
-
extensions:
|
|
1851
|
+
extensions: import_zod9.z.record(import_zod9.z.string(), import_zod9.z.any()).optional().describe("Extension points and contributions"),
|
|
1773
1852
|
/**
|
|
1774
1853
|
* Plugin Loading Configuration.
|
|
1775
1854
|
* Configures how the plugin is loaded, initialized, and managed at runtime.
|
|
@@ -1779,22 +1858,22 @@ var ManifestSchema = import_zod8.z.object({
|
|
|
1779
1858
|
});
|
|
1780
1859
|
|
|
1781
1860
|
// src/kernel/metadata-loader.zod.ts
|
|
1782
|
-
var
|
|
1783
|
-
var MetadataFormatSchema =
|
|
1784
|
-
var MetadataStatsSchema =
|
|
1861
|
+
var import_zod10 = require("zod");
|
|
1862
|
+
var MetadataFormatSchema = import_zod10.z.enum(["json", "yaml", "typescript", "javascript"]);
|
|
1863
|
+
var MetadataStatsSchema = import_zod10.z.object({
|
|
1785
1864
|
/**
|
|
1786
1865
|
* Size of the metadata file in bytes
|
|
1787
1866
|
*/
|
|
1788
|
-
size:
|
|
1867
|
+
size: import_zod10.z.number().int().min(0).describe("File size in bytes"),
|
|
1789
1868
|
/**
|
|
1790
1869
|
* Last modification timestamp
|
|
1791
1870
|
*/
|
|
1792
|
-
modifiedAt:
|
|
1871
|
+
modifiedAt: import_zod10.z.date().describe("Last modified date"),
|
|
1793
1872
|
/**
|
|
1794
1873
|
* ETag for cache validation
|
|
1795
1874
|
* Used for conditional requests (If-None-Match header)
|
|
1796
1875
|
*/
|
|
1797
|
-
etag:
|
|
1876
|
+
etag: import_zod10.z.string().describe("Entity tag for cache validation"),
|
|
1798
1877
|
/**
|
|
1799
1878
|
* Serialization format
|
|
1800
1879
|
*/
|
|
@@ -1802,50 +1881,50 @@ var MetadataStatsSchema = import_zod9.z.object({
|
|
|
1802
1881
|
/**
|
|
1803
1882
|
* Full file path (if applicable)
|
|
1804
1883
|
*/
|
|
1805
|
-
path:
|
|
1884
|
+
path: import_zod10.z.string().optional().describe("File system path"),
|
|
1806
1885
|
/**
|
|
1807
1886
|
* Additional metadata provider-specific properties
|
|
1808
1887
|
*/
|
|
1809
|
-
metadata:
|
|
1888
|
+
metadata: import_zod10.z.record(import_zod10.z.string(), import_zod10.z.any()).optional().describe("Provider-specific metadata")
|
|
1810
1889
|
});
|
|
1811
|
-
var MetadataLoadOptionsSchema =
|
|
1890
|
+
var MetadataLoadOptionsSchema = import_zod10.z.object({
|
|
1812
1891
|
/**
|
|
1813
1892
|
* Glob patterns to match files
|
|
1814
1893
|
* Example: ["**\/*.object.ts", "**\/*.object.json"]
|
|
1815
1894
|
*/
|
|
1816
|
-
patterns:
|
|
1895
|
+
patterns: import_zod10.z.array(import_zod10.z.string()).optional().describe("File glob patterns"),
|
|
1817
1896
|
/**
|
|
1818
1897
|
* If-None-Match header for conditional loading
|
|
1819
1898
|
* Only load if ETag doesn't match
|
|
1820
1899
|
*/
|
|
1821
|
-
ifNoneMatch:
|
|
1900
|
+
ifNoneMatch: import_zod10.z.string().optional().describe("ETag for conditional request"),
|
|
1822
1901
|
/**
|
|
1823
1902
|
* If-Modified-Since header for conditional loading
|
|
1824
1903
|
*/
|
|
1825
|
-
ifModifiedSince:
|
|
1904
|
+
ifModifiedSince: import_zod10.z.date().optional().describe("Only load if modified after this date"),
|
|
1826
1905
|
/**
|
|
1827
1906
|
* Whether to validate against Zod schema
|
|
1828
1907
|
*/
|
|
1829
|
-
validate:
|
|
1908
|
+
validate: import_zod10.z.boolean().default(true).describe("Validate against schema"),
|
|
1830
1909
|
/**
|
|
1831
1910
|
* Whether to use cache if available
|
|
1832
1911
|
*/
|
|
1833
|
-
useCache:
|
|
1912
|
+
useCache: import_zod10.z.boolean().default(true).describe("Enable caching"),
|
|
1834
1913
|
/**
|
|
1835
1914
|
* Filter function (serialized as string)
|
|
1836
1915
|
* Example: "(item) => item.name.startsWith('sys_')"
|
|
1837
1916
|
*/
|
|
1838
|
-
filter:
|
|
1917
|
+
filter: import_zod10.z.string().optional().describe("Filter predicate as string"),
|
|
1839
1918
|
/**
|
|
1840
1919
|
* Maximum number of items to load
|
|
1841
1920
|
*/
|
|
1842
|
-
limit:
|
|
1921
|
+
limit: import_zod10.z.number().int().min(1).optional().describe("Maximum items to load"),
|
|
1843
1922
|
/**
|
|
1844
1923
|
* Recursively search subdirectories
|
|
1845
1924
|
*/
|
|
1846
|
-
recursive:
|
|
1925
|
+
recursive: import_zod10.z.boolean().default(true).describe("Search subdirectories")
|
|
1847
1926
|
});
|
|
1848
|
-
var MetadataSaveOptionsSchema =
|
|
1927
|
+
var MetadataSaveOptionsSchema = import_zod10.z.object({
|
|
1849
1928
|
/**
|
|
1850
1929
|
* Serialization format
|
|
1851
1930
|
*/
|
|
@@ -1853,41 +1932,41 @@ var MetadataSaveOptionsSchema = import_zod9.z.object({
|
|
|
1853
1932
|
/**
|
|
1854
1933
|
* Prettify output (formatted with indentation)
|
|
1855
1934
|
*/
|
|
1856
|
-
prettify:
|
|
1935
|
+
prettify: import_zod10.z.boolean().default(true).describe("Format with indentation"),
|
|
1857
1936
|
/**
|
|
1858
1937
|
* Indentation size (spaces)
|
|
1859
1938
|
*/
|
|
1860
|
-
indent:
|
|
1939
|
+
indent: import_zod10.z.number().int().min(0).max(8).default(2).describe("Indentation spaces"),
|
|
1861
1940
|
/**
|
|
1862
1941
|
* Sort object keys alphabetically
|
|
1863
1942
|
*/
|
|
1864
|
-
sortKeys:
|
|
1943
|
+
sortKeys: import_zod10.z.boolean().default(false).describe("Sort object keys"),
|
|
1865
1944
|
/**
|
|
1866
1945
|
* Include default values in output
|
|
1867
1946
|
*/
|
|
1868
|
-
includeDefaults:
|
|
1947
|
+
includeDefaults: import_zod10.z.boolean().default(false).describe("Include default values"),
|
|
1869
1948
|
/**
|
|
1870
1949
|
* Create backup before overwriting
|
|
1871
1950
|
*/
|
|
1872
|
-
backup:
|
|
1951
|
+
backup: import_zod10.z.boolean().default(false).describe("Create backup file"),
|
|
1873
1952
|
/**
|
|
1874
1953
|
* Overwrite if exists
|
|
1875
1954
|
*/
|
|
1876
|
-
overwrite:
|
|
1955
|
+
overwrite: import_zod10.z.boolean().default(true).describe("Overwrite existing file"),
|
|
1877
1956
|
/**
|
|
1878
1957
|
* Atomic write (write to temp file, then rename)
|
|
1879
1958
|
*/
|
|
1880
|
-
atomic:
|
|
1959
|
+
atomic: import_zod10.z.boolean().default(true).describe("Use atomic write operation"),
|
|
1881
1960
|
/**
|
|
1882
1961
|
* Custom file path (overrides default location)
|
|
1883
1962
|
*/
|
|
1884
|
-
path:
|
|
1963
|
+
path: import_zod10.z.string().optional().describe("Custom output path")
|
|
1885
1964
|
});
|
|
1886
|
-
var MetadataExportOptionsSchema =
|
|
1965
|
+
var MetadataExportOptionsSchema = import_zod10.z.object({
|
|
1887
1966
|
/**
|
|
1888
1967
|
* Output file path
|
|
1889
1968
|
*/
|
|
1890
|
-
output:
|
|
1969
|
+
output: import_zod10.z.string().describe("Output file path"),
|
|
1891
1970
|
/**
|
|
1892
1971
|
* Export format
|
|
1893
1972
|
*/
|
|
@@ -1895,60 +1974,60 @@ var MetadataExportOptionsSchema = import_zod9.z.object({
|
|
|
1895
1974
|
/**
|
|
1896
1975
|
* Filter predicate as string
|
|
1897
1976
|
*/
|
|
1898
|
-
filter:
|
|
1977
|
+
filter: import_zod10.z.string().optional().describe("Filter items to export"),
|
|
1899
1978
|
/**
|
|
1900
1979
|
* Include statistics in export
|
|
1901
1980
|
*/
|
|
1902
|
-
includeStats:
|
|
1981
|
+
includeStats: import_zod10.z.boolean().default(false).describe("Include metadata statistics"),
|
|
1903
1982
|
/**
|
|
1904
1983
|
* Compress output
|
|
1905
1984
|
*/
|
|
1906
|
-
compress:
|
|
1985
|
+
compress: import_zod10.z.boolean().default(false).describe("Compress output (gzip)"),
|
|
1907
1986
|
/**
|
|
1908
1987
|
* Pretty print output
|
|
1909
1988
|
*/
|
|
1910
|
-
prettify:
|
|
1989
|
+
prettify: import_zod10.z.boolean().default(true).describe("Pretty print output")
|
|
1911
1990
|
});
|
|
1912
|
-
var MetadataImportOptionsSchema =
|
|
1991
|
+
var MetadataImportOptionsSchema = import_zod10.z.object({
|
|
1913
1992
|
/**
|
|
1914
1993
|
* Conflict resolution strategy
|
|
1915
1994
|
*/
|
|
1916
|
-
conflictResolution:
|
|
1995
|
+
conflictResolution: import_zod10.z.enum(["skip", "overwrite", "merge", "fail"]).default("merge").describe("How to handle existing items"),
|
|
1917
1996
|
/**
|
|
1918
1997
|
* Validate items against schema
|
|
1919
1998
|
*/
|
|
1920
|
-
validate:
|
|
1999
|
+
validate: import_zod10.z.boolean().default(true).describe("Validate before import"),
|
|
1921
2000
|
/**
|
|
1922
2001
|
* Dry run (don't actually save)
|
|
1923
2002
|
*/
|
|
1924
|
-
dryRun:
|
|
2003
|
+
dryRun: import_zod10.z.boolean().default(false).describe("Simulate import without saving"),
|
|
1925
2004
|
/**
|
|
1926
2005
|
* Continue on errors
|
|
1927
2006
|
*/
|
|
1928
|
-
continueOnError:
|
|
2007
|
+
continueOnError: import_zod10.z.boolean().default(false).describe("Continue if validation fails"),
|
|
1929
2008
|
/**
|
|
1930
2009
|
* Transform function (as string)
|
|
1931
2010
|
* Example: "(item) => ({ ...item, imported: true })"
|
|
1932
2011
|
*/
|
|
1933
|
-
transform:
|
|
2012
|
+
transform: import_zod10.z.string().optional().describe("Transform items before import")
|
|
1934
2013
|
});
|
|
1935
|
-
var MetadataLoadResultSchema =
|
|
2014
|
+
var MetadataLoadResultSchema = import_zod10.z.object({
|
|
1936
2015
|
/**
|
|
1937
2016
|
* Loaded data
|
|
1938
2017
|
*/
|
|
1939
|
-
data:
|
|
2018
|
+
data: import_zod10.z.any().nullable().describe("Loaded metadata"),
|
|
1940
2019
|
/**
|
|
1941
2020
|
* Whether data came from cache (304 Not Modified)
|
|
1942
2021
|
*/
|
|
1943
|
-
fromCache:
|
|
2022
|
+
fromCache: import_zod10.z.boolean().default(false).describe("Loaded from cache"),
|
|
1944
2023
|
/**
|
|
1945
2024
|
* Not modified (conditional request matched)
|
|
1946
2025
|
*/
|
|
1947
|
-
notModified:
|
|
2026
|
+
notModified: import_zod10.z.boolean().default(false).describe("Not modified since last request"),
|
|
1948
2027
|
/**
|
|
1949
2028
|
* ETag of loaded data
|
|
1950
2029
|
*/
|
|
1951
|
-
etag:
|
|
2030
|
+
etag: import_zod10.z.string().optional().describe("Entity tag"),
|
|
1952
2031
|
/**
|
|
1953
2032
|
* Statistics about loaded data
|
|
1954
2033
|
*/
|
|
@@ -1956,166 +2035,273 @@ var MetadataLoadResultSchema = import_zod9.z.object({
|
|
|
1956
2035
|
/**
|
|
1957
2036
|
* Load time in milliseconds
|
|
1958
2037
|
*/
|
|
1959
|
-
loadTime:
|
|
2038
|
+
loadTime: import_zod10.z.number().min(0).optional().describe("Load duration in ms")
|
|
1960
2039
|
});
|
|
1961
|
-
var MetadataSaveResultSchema =
|
|
2040
|
+
var MetadataSaveResultSchema = import_zod10.z.object({
|
|
1962
2041
|
/**
|
|
1963
2042
|
* Whether save was successful
|
|
1964
2043
|
*/
|
|
1965
|
-
success:
|
|
2044
|
+
success: import_zod10.z.boolean().describe("Save successful"),
|
|
1966
2045
|
/**
|
|
1967
2046
|
* Path where file was saved
|
|
1968
2047
|
*/
|
|
1969
|
-
path:
|
|
2048
|
+
path: import_zod10.z.string().describe("Output path"),
|
|
1970
2049
|
/**
|
|
1971
2050
|
* Generated ETag
|
|
1972
2051
|
*/
|
|
1973
|
-
etag:
|
|
2052
|
+
etag: import_zod10.z.string().optional().describe("Generated entity tag"),
|
|
1974
2053
|
/**
|
|
1975
2054
|
* File size in bytes
|
|
1976
2055
|
*/
|
|
1977
|
-
size:
|
|
2056
|
+
size: import_zod10.z.number().int().min(0).optional().describe("File size"),
|
|
1978
2057
|
/**
|
|
1979
2058
|
* Save time in milliseconds
|
|
1980
2059
|
*/
|
|
1981
|
-
saveTime:
|
|
2060
|
+
saveTime: import_zod10.z.number().min(0).optional().describe("Save duration in ms"),
|
|
1982
2061
|
/**
|
|
1983
2062
|
* Backup path (if created)
|
|
1984
2063
|
*/
|
|
1985
|
-
backupPath:
|
|
2064
|
+
backupPath: import_zod10.z.string().optional().describe("Backup file path")
|
|
1986
2065
|
});
|
|
1987
|
-
var MetadataWatchEventSchema =
|
|
2066
|
+
var MetadataWatchEventSchema = import_zod10.z.object({
|
|
1988
2067
|
/**
|
|
1989
2068
|
* Event type
|
|
1990
2069
|
*/
|
|
1991
|
-
type:
|
|
2070
|
+
type: import_zod10.z.enum(["added", "changed", "deleted"]).describe("Event type"),
|
|
1992
2071
|
/**
|
|
1993
2072
|
* Metadata type (e.g., 'object', 'view', 'app')
|
|
1994
2073
|
*/
|
|
1995
|
-
metadataType:
|
|
2074
|
+
metadataType: import_zod10.z.string().describe("Type of metadata"),
|
|
1996
2075
|
/**
|
|
1997
2076
|
* Item name/identifier
|
|
1998
2077
|
*/
|
|
1999
|
-
name:
|
|
2078
|
+
name: import_zod10.z.string().describe("Item identifier"),
|
|
2000
2079
|
/**
|
|
2001
2080
|
* Full file path
|
|
2002
2081
|
*/
|
|
2003
|
-
path:
|
|
2082
|
+
path: import_zod10.z.string().describe("File path"),
|
|
2004
2083
|
/**
|
|
2005
2084
|
* Loaded item data (for added/changed events)
|
|
2006
2085
|
*/
|
|
2007
|
-
data:
|
|
2086
|
+
data: import_zod10.z.any().optional().describe("Item data"),
|
|
2008
2087
|
/**
|
|
2009
2088
|
* Timestamp
|
|
2010
2089
|
*/
|
|
2011
|
-
timestamp:
|
|
2090
|
+
timestamp: import_zod10.z.date().describe("Event timestamp")
|
|
2012
2091
|
});
|
|
2013
|
-
var MetadataCollectionInfoSchema =
|
|
2092
|
+
var MetadataCollectionInfoSchema = import_zod10.z.object({
|
|
2014
2093
|
/**
|
|
2015
2094
|
* Collection type (e.g., 'object', 'view', 'app')
|
|
2016
2095
|
*/
|
|
2017
|
-
type:
|
|
2096
|
+
type: import_zod10.z.string().describe("Collection type"),
|
|
2018
2097
|
/**
|
|
2019
2098
|
* Total items in collection
|
|
2020
2099
|
*/
|
|
2021
|
-
count:
|
|
2100
|
+
count: import_zod10.z.number().int().min(0).describe("Number of items"),
|
|
2022
2101
|
/**
|
|
2023
2102
|
* Formats found in collection
|
|
2024
2103
|
*/
|
|
2025
|
-
formats:
|
|
2104
|
+
formats: import_zod10.z.array(MetadataFormatSchema).describe("Formats in collection"),
|
|
2026
2105
|
/**
|
|
2027
2106
|
* Total size in bytes
|
|
2028
2107
|
*/
|
|
2029
|
-
totalSize:
|
|
2108
|
+
totalSize: import_zod10.z.number().int().min(0).optional().describe("Total size in bytes"),
|
|
2030
2109
|
/**
|
|
2031
2110
|
* Last modified timestamp
|
|
2032
2111
|
*/
|
|
2033
|
-
lastModified:
|
|
2112
|
+
lastModified: import_zod10.z.date().optional().describe("Last modification date"),
|
|
2034
2113
|
/**
|
|
2035
2114
|
* Collection location (path or URL)
|
|
2036
2115
|
*/
|
|
2037
|
-
location:
|
|
2116
|
+
location: import_zod10.z.string().optional().describe("Collection location")
|
|
2038
2117
|
});
|
|
2039
|
-
var MetadataLoaderContractSchema =
|
|
2118
|
+
var MetadataLoaderContractSchema = import_zod10.z.object({
|
|
2040
2119
|
/**
|
|
2041
2120
|
* Loader name/identifier
|
|
2042
2121
|
*/
|
|
2043
|
-
name:
|
|
2122
|
+
name: import_zod10.z.string().describe("Loader identifier"),
|
|
2044
2123
|
/**
|
|
2045
2124
|
* Protocol handled by this loader (e.g. 'file', 'http', 's3')
|
|
2046
2125
|
*/
|
|
2047
|
-
protocol:
|
|
2126
|
+
protocol: import_zod10.z.string().describe("Protocol identifier"),
|
|
2048
2127
|
/**
|
|
2049
2128
|
* Detailed capabilities
|
|
2050
2129
|
*/
|
|
2051
|
-
capabilities:
|
|
2052
|
-
read:
|
|
2053
|
-
write:
|
|
2054
|
-
watch:
|
|
2055
|
-
list:
|
|
2130
|
+
capabilities: import_zod10.z.object({
|
|
2131
|
+
read: import_zod10.z.boolean().default(true),
|
|
2132
|
+
write: import_zod10.z.boolean().default(false),
|
|
2133
|
+
watch: import_zod10.z.boolean().default(false),
|
|
2134
|
+
list: import_zod10.z.boolean().default(true)
|
|
2056
2135
|
}).describe("Loader capabilities"),
|
|
2057
2136
|
/**
|
|
2058
2137
|
* Supported formats
|
|
2059
2138
|
*/
|
|
2060
|
-
supportedFormats:
|
|
2139
|
+
supportedFormats: import_zod10.z.array(MetadataFormatSchema).describe("Supported formats"),
|
|
2061
2140
|
/**
|
|
2062
2141
|
* Whether loader supports watching for changes
|
|
2063
2142
|
*/
|
|
2064
|
-
supportsWatch:
|
|
2143
|
+
supportsWatch: import_zod10.z.boolean().default(false).describe("Supports file watching"),
|
|
2065
2144
|
/**
|
|
2066
2145
|
* Whether loader supports saving
|
|
2067
2146
|
*/
|
|
2068
|
-
supportsWrite:
|
|
2147
|
+
supportsWrite: import_zod10.z.boolean().default(true).describe("Supports write operations"),
|
|
2069
2148
|
/**
|
|
2070
2149
|
* Whether loader supports caching
|
|
2071
2150
|
*/
|
|
2072
|
-
supportsCache:
|
|
2151
|
+
supportsCache: import_zod10.z.boolean().default(true).describe("Supports caching")
|
|
2073
2152
|
});
|
|
2074
|
-
var MetadataManagerConfigSchema =
|
|
2153
|
+
var MetadataManagerConfigSchema = import_zod10.z.object({
|
|
2075
2154
|
/**
|
|
2076
2155
|
* Root directory for metadata (for filesystem loaders)
|
|
2077
2156
|
*/
|
|
2078
|
-
rootDir:
|
|
2157
|
+
rootDir: import_zod10.z.string().optional().describe("Root directory path"),
|
|
2079
2158
|
/**
|
|
2080
2159
|
* Enabled serialization formats
|
|
2081
2160
|
*/
|
|
2082
|
-
formats:
|
|
2161
|
+
formats: import_zod10.z.array(MetadataFormatSchema).default(["typescript", "json", "yaml"]).describe("Enabled formats"),
|
|
2083
2162
|
/**
|
|
2084
2163
|
* Cache configuration
|
|
2085
2164
|
*/
|
|
2086
|
-
cache:
|
|
2087
|
-
enabled:
|
|
2088
|
-
ttl:
|
|
2089
|
-
maxSize:
|
|
2165
|
+
cache: import_zod10.z.object({
|
|
2166
|
+
enabled: import_zod10.z.boolean().default(true).describe("Enable caching"),
|
|
2167
|
+
ttl: import_zod10.z.number().int().min(0).default(3600).describe("Cache TTL in seconds"),
|
|
2168
|
+
maxSize: import_zod10.z.number().int().min(0).optional().describe("Max cache size in bytes")
|
|
2090
2169
|
}).optional().describe("Cache settings"),
|
|
2091
2170
|
/**
|
|
2092
2171
|
* Watch for file changes
|
|
2093
2172
|
*/
|
|
2094
|
-
watch:
|
|
2173
|
+
watch: import_zod10.z.boolean().default(false).describe("Enable file watching"),
|
|
2095
2174
|
/**
|
|
2096
2175
|
* Watch options
|
|
2097
2176
|
*/
|
|
2098
|
-
watchOptions:
|
|
2099
|
-
ignored:
|
|
2100
|
-
persistent:
|
|
2101
|
-
ignoreInitial:
|
|
2177
|
+
watchOptions: import_zod10.z.object({
|
|
2178
|
+
ignored: import_zod10.z.array(import_zod10.z.string()).optional().describe("Patterns to ignore"),
|
|
2179
|
+
persistent: import_zod10.z.boolean().default(true).describe("Keep process running"),
|
|
2180
|
+
ignoreInitial: import_zod10.z.boolean().default(true).describe("Ignore initial add events")
|
|
2102
2181
|
}).optional().describe("File watcher options"),
|
|
2103
2182
|
/**
|
|
2104
2183
|
* Validation settings
|
|
2105
2184
|
*/
|
|
2106
|
-
validation:
|
|
2107
|
-
strict:
|
|
2108
|
-
throwOnError:
|
|
2185
|
+
validation: import_zod10.z.object({
|
|
2186
|
+
strict: import_zod10.z.boolean().default(true).describe("Strict validation"),
|
|
2187
|
+
throwOnError: import_zod10.z.boolean().default(true).describe("Throw on validation error")
|
|
2109
2188
|
}).optional().describe("Validation settings"),
|
|
2110
2189
|
/**
|
|
2111
2190
|
* Loader-specific options
|
|
2112
2191
|
*/
|
|
2113
|
-
loaderOptions:
|
|
2192
|
+
loaderOptions: import_zod10.z.record(import_zod10.z.string(), import_zod10.z.any()).optional().describe("Loader-specific configuration")
|
|
2193
|
+
});
|
|
2194
|
+
|
|
2195
|
+
// src/kernel/package-registry.zod.ts
|
|
2196
|
+
var import_zod11 = require("zod");
|
|
2197
|
+
var PackageStatusEnum = import_zod11.z.enum([
|
|
2198
|
+
"installed",
|
|
2199
|
+
// Successfully installed and enabled
|
|
2200
|
+
"disabled",
|
|
2201
|
+
// Installed but disabled (metadata not active)
|
|
2202
|
+
"installing",
|
|
2203
|
+
// Installation in progress
|
|
2204
|
+
"uninstalling",
|
|
2205
|
+
// Removal in progress
|
|
2206
|
+
"error"
|
|
2207
|
+
// Installation or runtime error
|
|
2208
|
+
]);
|
|
2209
|
+
var InstalledPackageSchema = import_zod11.z.object({
|
|
2210
|
+
/**
|
|
2211
|
+
* The full package manifest (source of truth for package definition).
|
|
2212
|
+
*/
|
|
2213
|
+
manifest: ManifestSchema,
|
|
2214
|
+
/**
|
|
2215
|
+
* Current lifecycle status.
|
|
2216
|
+
*/
|
|
2217
|
+
status: PackageStatusEnum.default("installed"),
|
|
2218
|
+
/**
|
|
2219
|
+
* Whether the package is currently enabled (active).
|
|
2220
|
+
* When disabled, the package's metadata is not loaded into the registry.
|
|
2221
|
+
*/
|
|
2222
|
+
enabled: import_zod11.z.boolean().default(true),
|
|
2223
|
+
/**
|
|
2224
|
+
* ISO 8601 timestamp of when the package was installed.
|
|
2225
|
+
*/
|
|
2226
|
+
installedAt: import_zod11.z.string().datetime().optional(),
|
|
2227
|
+
/**
|
|
2228
|
+
* ISO 8601 timestamp of last update.
|
|
2229
|
+
*/
|
|
2230
|
+
updatedAt: import_zod11.z.string().datetime().optional(),
|
|
2231
|
+
/**
|
|
2232
|
+
* ISO 8601 timestamp of when the package was last enabled/disabled.
|
|
2233
|
+
*/
|
|
2234
|
+
statusChangedAt: import_zod11.z.string().datetime().optional(),
|
|
2235
|
+
/**
|
|
2236
|
+
* Error message if status is 'error'.
|
|
2237
|
+
*/
|
|
2238
|
+
errorMessage: import_zod11.z.string().optional(),
|
|
2239
|
+
/**
|
|
2240
|
+
* Configuration values set by the user for this package.
|
|
2241
|
+
* Keys correspond to the package's `configuration.properties`.
|
|
2242
|
+
*/
|
|
2243
|
+
settings: import_zod11.z.record(import_zod11.z.string(), import_zod11.z.any()).optional()
|
|
2244
|
+
});
|
|
2245
|
+
var ListPackagesRequestSchema = import_zod11.z.object({
|
|
2246
|
+
/** Filter by status */
|
|
2247
|
+
status: PackageStatusEnum.optional(),
|
|
2248
|
+
/** Filter by package type */
|
|
2249
|
+
type: ManifestSchema.shape.type.optional(),
|
|
2250
|
+
/** Filter by enabled state */
|
|
2251
|
+
enabled: import_zod11.z.boolean().optional()
|
|
2252
|
+
});
|
|
2253
|
+
var ListPackagesResponseSchema = import_zod11.z.object({
|
|
2254
|
+
packages: import_zod11.z.array(InstalledPackageSchema),
|
|
2255
|
+
total: import_zod11.z.number()
|
|
2256
|
+
});
|
|
2257
|
+
var GetPackageRequestSchema = import_zod11.z.object({
|
|
2258
|
+
/** Package ID (reverse domain identifier from manifest) */
|
|
2259
|
+
id: import_zod11.z.string()
|
|
2260
|
+
});
|
|
2261
|
+
var GetPackageResponseSchema = import_zod11.z.object({
|
|
2262
|
+
package: InstalledPackageSchema
|
|
2263
|
+
});
|
|
2264
|
+
var InstallPackageRequestSchema = import_zod11.z.object({
|
|
2265
|
+
/** The package manifest to install */
|
|
2266
|
+
manifest: ManifestSchema,
|
|
2267
|
+
/** Optional: user-provided settings at install time */
|
|
2268
|
+
settings: import_zod11.z.record(import_zod11.z.string(), import_zod11.z.any()).optional(),
|
|
2269
|
+
/** Whether to enable immediately after install (default: true) */
|
|
2270
|
+
enableOnInstall: import_zod11.z.boolean().default(true)
|
|
2271
|
+
});
|
|
2272
|
+
var InstallPackageResponseSchema = import_zod11.z.object({
|
|
2273
|
+
package: InstalledPackageSchema,
|
|
2274
|
+
message: import_zod11.z.string().optional()
|
|
2275
|
+
});
|
|
2276
|
+
var UninstallPackageRequestSchema = import_zod11.z.object({
|
|
2277
|
+
/** Package ID to uninstall */
|
|
2278
|
+
id: import_zod11.z.string()
|
|
2279
|
+
});
|
|
2280
|
+
var UninstallPackageResponseSchema = import_zod11.z.object({
|
|
2281
|
+
id: import_zod11.z.string(),
|
|
2282
|
+
success: import_zod11.z.boolean(),
|
|
2283
|
+
message: import_zod11.z.string().optional()
|
|
2284
|
+
});
|
|
2285
|
+
var EnablePackageRequestSchema = import_zod11.z.object({
|
|
2286
|
+
/** Package ID to enable */
|
|
2287
|
+
id: import_zod11.z.string()
|
|
2288
|
+
});
|
|
2289
|
+
var EnablePackageResponseSchema = import_zod11.z.object({
|
|
2290
|
+
package: InstalledPackageSchema,
|
|
2291
|
+
message: import_zod11.z.string().optional()
|
|
2292
|
+
});
|
|
2293
|
+
var DisablePackageRequestSchema = import_zod11.z.object({
|
|
2294
|
+
/** Package ID to disable */
|
|
2295
|
+
id: import_zod11.z.string()
|
|
2296
|
+
});
|
|
2297
|
+
var DisablePackageResponseSchema = import_zod11.z.object({
|
|
2298
|
+
package: InstalledPackageSchema,
|
|
2299
|
+
message: import_zod11.z.string().optional()
|
|
2114
2300
|
});
|
|
2115
2301
|
|
|
2116
2302
|
// src/kernel/plugin-lifecycle-advanced.zod.ts
|
|
2117
|
-
var
|
|
2118
|
-
var PluginHealthStatusSchema =
|
|
2303
|
+
var import_zod12 = require("zod");
|
|
2304
|
+
var PluginHealthStatusSchema = import_zod12.z.enum([
|
|
2119
2305
|
"healthy",
|
|
2120
2306
|
// Plugin is operating normally
|
|
2121
2307
|
"degraded",
|
|
@@ -2129,41 +2315,41 @@ var PluginHealthStatusSchema = import_zod10.z.enum([
|
|
|
2129
2315
|
"unknown"
|
|
2130
2316
|
// Health status cannot be determined
|
|
2131
2317
|
]).describe("Current health status of the plugin");
|
|
2132
|
-
var PluginHealthCheckSchema =
|
|
2318
|
+
var PluginHealthCheckSchema = import_zod12.z.object({
|
|
2133
2319
|
/**
|
|
2134
2320
|
* Health check interval in milliseconds
|
|
2135
2321
|
*/
|
|
2136
|
-
interval:
|
|
2322
|
+
interval: import_zod12.z.number().int().min(1e3).default(3e4).describe("How often to perform health checks (default: 30s)"),
|
|
2137
2323
|
/**
|
|
2138
2324
|
* Timeout for health check in milliseconds
|
|
2139
2325
|
*/
|
|
2140
|
-
timeout:
|
|
2326
|
+
timeout: import_zod12.z.number().int().min(100).default(5e3).describe("Maximum time to wait for health check response"),
|
|
2141
2327
|
/**
|
|
2142
2328
|
* Number of consecutive failures before marking as unhealthy
|
|
2143
2329
|
*/
|
|
2144
|
-
failureThreshold:
|
|
2330
|
+
failureThreshold: import_zod12.z.number().int().min(1).default(3).describe("Consecutive failures needed to mark unhealthy"),
|
|
2145
2331
|
/**
|
|
2146
2332
|
* Number of consecutive successes to recover from unhealthy state
|
|
2147
2333
|
*/
|
|
2148
|
-
successThreshold:
|
|
2334
|
+
successThreshold: import_zod12.z.number().int().min(1).default(1).describe("Consecutive successes needed to mark healthy"),
|
|
2149
2335
|
/**
|
|
2150
2336
|
* Custom health check function name or endpoint
|
|
2151
2337
|
*/
|
|
2152
|
-
checkMethod:
|
|
2338
|
+
checkMethod: import_zod12.z.string().optional().describe("Method name to call for health check"),
|
|
2153
2339
|
/**
|
|
2154
2340
|
* Enable automatic restart on failure
|
|
2155
2341
|
*/
|
|
2156
|
-
autoRestart:
|
|
2342
|
+
autoRestart: import_zod12.z.boolean().default(false).describe("Automatically restart plugin on health check failure"),
|
|
2157
2343
|
/**
|
|
2158
2344
|
* Maximum number of restart attempts
|
|
2159
2345
|
*/
|
|
2160
|
-
maxRestartAttempts:
|
|
2346
|
+
maxRestartAttempts: import_zod12.z.number().int().min(0).default(3).describe("Maximum restart attempts before giving up"),
|
|
2161
2347
|
/**
|
|
2162
2348
|
* Backoff strategy for restarts
|
|
2163
2349
|
*/
|
|
2164
|
-
restartBackoff:
|
|
2350
|
+
restartBackoff: import_zod12.z.enum(["fixed", "linear", "exponential"]).default("exponential").describe("Backoff strategy for restart delays")
|
|
2165
2351
|
});
|
|
2166
|
-
var PluginHealthReportSchema =
|
|
2352
|
+
var PluginHealthReportSchema = import_zod12.z.object({
|
|
2167
2353
|
/**
|
|
2168
2354
|
* Overall health status
|
|
2169
2355
|
*/
|
|
@@ -2171,99 +2357,99 @@ var PluginHealthReportSchema = import_zod10.z.object({
|
|
|
2171
2357
|
/**
|
|
2172
2358
|
* Timestamp of the health check
|
|
2173
2359
|
*/
|
|
2174
|
-
timestamp:
|
|
2360
|
+
timestamp: import_zod12.z.string().datetime(),
|
|
2175
2361
|
/**
|
|
2176
2362
|
* Human-readable message about health status
|
|
2177
2363
|
*/
|
|
2178
|
-
message:
|
|
2364
|
+
message: import_zod12.z.string().optional(),
|
|
2179
2365
|
/**
|
|
2180
2366
|
* Detailed metrics
|
|
2181
2367
|
*/
|
|
2182
|
-
metrics:
|
|
2183
|
-
uptime:
|
|
2184
|
-
memoryUsage:
|
|
2185
|
-
cpuUsage:
|
|
2186
|
-
activeConnections:
|
|
2187
|
-
errorRate:
|
|
2188
|
-
responseTime:
|
|
2368
|
+
metrics: import_zod12.z.object({
|
|
2369
|
+
uptime: import_zod12.z.number().describe("Plugin uptime in milliseconds"),
|
|
2370
|
+
memoryUsage: import_zod12.z.number().optional().describe("Memory usage in bytes"),
|
|
2371
|
+
cpuUsage: import_zod12.z.number().optional().describe("CPU usage percentage"),
|
|
2372
|
+
activeConnections: import_zod12.z.number().optional().describe("Number of active connections"),
|
|
2373
|
+
errorRate: import_zod12.z.number().optional().describe("Error rate (errors per minute)"),
|
|
2374
|
+
responseTime: import_zod12.z.number().optional().describe("Average response time in ms")
|
|
2189
2375
|
}).partial().optional(),
|
|
2190
2376
|
/**
|
|
2191
2377
|
* List of checks performed
|
|
2192
2378
|
*/
|
|
2193
|
-
checks:
|
|
2194
|
-
name:
|
|
2195
|
-
status:
|
|
2196
|
-
message:
|
|
2197
|
-
data:
|
|
2379
|
+
checks: import_zod12.z.array(import_zod12.z.object({
|
|
2380
|
+
name: import_zod12.z.string().describe("Check name"),
|
|
2381
|
+
status: import_zod12.z.enum(["passed", "failed", "warning"]),
|
|
2382
|
+
message: import_zod12.z.string().optional(),
|
|
2383
|
+
data: import_zod12.z.record(import_zod12.z.string(), import_zod12.z.any()).optional()
|
|
2198
2384
|
})).optional(),
|
|
2199
2385
|
/**
|
|
2200
2386
|
* Dependencies health
|
|
2201
2387
|
*/
|
|
2202
|
-
dependencies:
|
|
2203
|
-
pluginId:
|
|
2388
|
+
dependencies: import_zod12.z.array(import_zod12.z.object({
|
|
2389
|
+
pluginId: import_zod12.z.string(),
|
|
2204
2390
|
status: PluginHealthStatusSchema,
|
|
2205
|
-
message:
|
|
2391
|
+
message: import_zod12.z.string().optional()
|
|
2206
2392
|
})).optional()
|
|
2207
2393
|
});
|
|
2208
|
-
var DistributedStateConfigSchema =
|
|
2394
|
+
var DistributedStateConfigSchema = import_zod12.z.object({
|
|
2209
2395
|
/**
|
|
2210
2396
|
* Distributed cache provider
|
|
2211
2397
|
*/
|
|
2212
|
-
provider:
|
|
2398
|
+
provider: import_zod12.z.enum(["redis", "etcd", "custom"]).describe("Distributed state backend provider"),
|
|
2213
2399
|
/**
|
|
2214
2400
|
* Connection URL or endpoints
|
|
2215
2401
|
*/
|
|
2216
|
-
endpoints:
|
|
2402
|
+
endpoints: import_zod12.z.array(import_zod12.z.string()).optional().describe("Backend connection endpoints"),
|
|
2217
2403
|
/**
|
|
2218
2404
|
* Key prefix for namespacing
|
|
2219
2405
|
*/
|
|
2220
|
-
keyPrefix:
|
|
2406
|
+
keyPrefix: import_zod12.z.string().optional().describe('Prefix for all keys (e.g., "plugin:my-plugin:")'),
|
|
2221
2407
|
/**
|
|
2222
2408
|
* Time to live in seconds
|
|
2223
2409
|
*/
|
|
2224
|
-
ttl:
|
|
2410
|
+
ttl: import_zod12.z.number().int().min(0).optional().describe("State expiration time in seconds"),
|
|
2225
2411
|
/**
|
|
2226
2412
|
* Authentication configuration
|
|
2227
2413
|
*/
|
|
2228
|
-
auth:
|
|
2229
|
-
username:
|
|
2230
|
-
password:
|
|
2231
|
-
token:
|
|
2232
|
-
certificate:
|
|
2414
|
+
auth: import_zod12.z.object({
|
|
2415
|
+
username: import_zod12.z.string().optional(),
|
|
2416
|
+
password: import_zod12.z.string().optional(),
|
|
2417
|
+
token: import_zod12.z.string().optional(),
|
|
2418
|
+
certificate: import_zod12.z.string().optional()
|
|
2233
2419
|
}).optional(),
|
|
2234
2420
|
/**
|
|
2235
2421
|
* Replication settings
|
|
2236
2422
|
*/
|
|
2237
|
-
replication:
|
|
2238
|
-
enabled:
|
|
2239
|
-
minReplicas:
|
|
2423
|
+
replication: import_zod12.z.object({
|
|
2424
|
+
enabled: import_zod12.z.boolean().default(true),
|
|
2425
|
+
minReplicas: import_zod12.z.number().int().min(1).default(1)
|
|
2240
2426
|
}).optional(),
|
|
2241
2427
|
/**
|
|
2242
2428
|
* Custom provider configuration
|
|
2243
2429
|
*/
|
|
2244
|
-
customConfig:
|
|
2430
|
+
customConfig: import_zod12.z.record(import_zod12.z.string(), import_zod12.z.any()).optional().describe("Provider-specific configuration")
|
|
2245
2431
|
});
|
|
2246
|
-
var HotReloadConfigSchema =
|
|
2432
|
+
var HotReloadConfigSchema = import_zod12.z.object({
|
|
2247
2433
|
/**
|
|
2248
2434
|
* Enable hot reload capability
|
|
2249
2435
|
*/
|
|
2250
|
-
enabled:
|
|
2436
|
+
enabled: import_zod12.z.boolean().default(false),
|
|
2251
2437
|
/**
|
|
2252
2438
|
* Watch file patterns for auto-reload
|
|
2253
2439
|
*/
|
|
2254
|
-
watchPatterns:
|
|
2440
|
+
watchPatterns: import_zod12.z.array(import_zod12.z.string()).optional().describe("Glob patterns to watch for changes"),
|
|
2255
2441
|
/**
|
|
2256
2442
|
* Debounce delay before reloading (milliseconds)
|
|
2257
2443
|
*/
|
|
2258
|
-
debounceDelay:
|
|
2444
|
+
debounceDelay: import_zod12.z.number().int().min(0).default(1e3).describe("Wait time after change detection before reload"),
|
|
2259
2445
|
/**
|
|
2260
2446
|
* Preserve plugin state during reload
|
|
2261
2447
|
*/
|
|
2262
|
-
preserveState:
|
|
2448
|
+
preserveState: import_zod12.z.boolean().default(true).describe("Keep plugin state across reloads"),
|
|
2263
2449
|
/**
|
|
2264
2450
|
* State serialization strategy
|
|
2265
2451
|
*/
|
|
2266
|
-
stateStrategy:
|
|
2452
|
+
stateStrategy: import_zod12.z.enum(["memory", "disk", "distributed", "none"]).default("memory").describe("How to preserve state during reload"),
|
|
2267
2453
|
/**
|
|
2268
2454
|
* Distributed state configuration (required when stateStrategy is "distributed")
|
|
2269
2455
|
*/
|
|
@@ -2271,25 +2457,25 @@ var HotReloadConfigSchema = import_zod10.z.object({
|
|
|
2271
2457
|
/**
|
|
2272
2458
|
* Graceful shutdown timeout
|
|
2273
2459
|
*/
|
|
2274
|
-
shutdownTimeout:
|
|
2460
|
+
shutdownTimeout: import_zod12.z.number().int().min(0).default(3e4).describe("Maximum time to wait for graceful shutdown"),
|
|
2275
2461
|
/**
|
|
2276
2462
|
* Pre-reload hooks
|
|
2277
2463
|
*/
|
|
2278
|
-
beforeReload:
|
|
2464
|
+
beforeReload: import_zod12.z.array(import_zod12.z.string()).optional().describe("Hook names to call before reload"),
|
|
2279
2465
|
/**
|
|
2280
2466
|
* Post-reload hooks
|
|
2281
2467
|
*/
|
|
2282
|
-
afterReload:
|
|
2468
|
+
afterReload: import_zod12.z.array(import_zod12.z.string()).optional().describe("Hook names to call after reload")
|
|
2283
2469
|
});
|
|
2284
|
-
var GracefulDegradationSchema =
|
|
2470
|
+
var GracefulDegradationSchema = import_zod12.z.object({
|
|
2285
2471
|
/**
|
|
2286
2472
|
* Enable graceful degradation
|
|
2287
2473
|
*/
|
|
2288
|
-
enabled:
|
|
2474
|
+
enabled: import_zod12.z.boolean().default(true),
|
|
2289
2475
|
/**
|
|
2290
2476
|
* Fallback mode when dependencies fail
|
|
2291
2477
|
*/
|
|
2292
|
-
fallbackMode:
|
|
2478
|
+
fallbackMode: import_zod12.z.enum([
|
|
2293
2479
|
"minimal",
|
|
2294
2480
|
// Provide minimal functionality
|
|
2295
2481
|
"cached",
|
|
@@ -2304,33 +2490,33 @@ var GracefulDegradationSchema = import_zod10.z.object({
|
|
|
2304
2490
|
/**
|
|
2305
2491
|
* Critical dependencies that must be available
|
|
2306
2492
|
*/
|
|
2307
|
-
criticalDependencies:
|
|
2493
|
+
criticalDependencies: import_zod12.z.array(import_zod12.z.string()).optional().describe("Plugin IDs that are required for operation"),
|
|
2308
2494
|
/**
|
|
2309
2495
|
* Optional dependencies that can fail
|
|
2310
2496
|
*/
|
|
2311
|
-
optionalDependencies:
|
|
2497
|
+
optionalDependencies: import_zod12.z.array(import_zod12.z.string()).optional().describe("Plugin IDs that are nice to have but not required"),
|
|
2312
2498
|
/**
|
|
2313
2499
|
* Feature flags for degraded mode
|
|
2314
2500
|
*/
|
|
2315
|
-
degradedFeatures:
|
|
2316
|
-
feature:
|
|
2317
|
-
enabled:
|
|
2318
|
-
reason:
|
|
2501
|
+
degradedFeatures: import_zod12.z.array(import_zod12.z.object({
|
|
2502
|
+
feature: import_zod12.z.string().describe("Feature name"),
|
|
2503
|
+
enabled: import_zod12.z.boolean().describe("Whether feature is available in degraded mode"),
|
|
2504
|
+
reason: import_zod12.z.string().optional()
|
|
2319
2505
|
})).optional(),
|
|
2320
2506
|
/**
|
|
2321
2507
|
* Automatic recovery attempts
|
|
2322
2508
|
*/
|
|
2323
|
-
autoRecovery:
|
|
2324
|
-
enabled:
|
|
2325
|
-
retryInterval:
|
|
2326
|
-
maxAttempts:
|
|
2509
|
+
autoRecovery: import_zod12.z.object({
|
|
2510
|
+
enabled: import_zod12.z.boolean().default(true),
|
|
2511
|
+
retryInterval: import_zod12.z.number().int().min(1e3).default(6e4).describe("Interval between recovery attempts (ms)"),
|
|
2512
|
+
maxAttempts: import_zod12.z.number().int().min(0).default(5).describe("Maximum recovery attempts before giving up")
|
|
2327
2513
|
}).optional()
|
|
2328
2514
|
});
|
|
2329
|
-
var PluginUpdateStrategySchema =
|
|
2515
|
+
var PluginUpdateStrategySchema = import_zod12.z.object({
|
|
2330
2516
|
/**
|
|
2331
2517
|
* Update mode
|
|
2332
2518
|
*/
|
|
2333
|
-
mode:
|
|
2519
|
+
mode: import_zod12.z.enum([
|
|
2334
2520
|
"manual",
|
|
2335
2521
|
// Manual updates only
|
|
2336
2522
|
"automatic",
|
|
@@ -2343,91 +2529,91 @@ var PluginUpdateStrategySchema = import_zod10.z.object({
|
|
|
2343
2529
|
/**
|
|
2344
2530
|
* Version constraints for automatic updates
|
|
2345
2531
|
*/
|
|
2346
|
-
autoUpdateConstraints:
|
|
2347
|
-
major:
|
|
2348
|
-
minor:
|
|
2349
|
-
patch:
|
|
2532
|
+
autoUpdateConstraints: import_zod12.z.object({
|
|
2533
|
+
major: import_zod12.z.boolean().default(false).describe("Allow major version updates"),
|
|
2534
|
+
minor: import_zod12.z.boolean().default(true).describe("Allow minor version updates"),
|
|
2535
|
+
patch: import_zod12.z.boolean().default(true).describe("Allow patch version updates")
|
|
2350
2536
|
}).optional(),
|
|
2351
2537
|
/**
|
|
2352
2538
|
* Update schedule (for scheduled mode)
|
|
2353
2539
|
*/
|
|
2354
|
-
schedule:
|
|
2540
|
+
schedule: import_zod12.z.object({
|
|
2355
2541
|
/**
|
|
2356
2542
|
* Cron expression for update window
|
|
2357
2543
|
*/
|
|
2358
|
-
cron:
|
|
2544
|
+
cron: import_zod12.z.string().optional(),
|
|
2359
2545
|
/**
|
|
2360
2546
|
* Timezone for schedule
|
|
2361
2547
|
*/
|
|
2362
|
-
timezone:
|
|
2548
|
+
timezone: import_zod12.z.string().default("UTC"),
|
|
2363
2549
|
/**
|
|
2364
2550
|
* Maintenance window duration in minutes
|
|
2365
2551
|
*/
|
|
2366
|
-
maintenanceWindow:
|
|
2552
|
+
maintenanceWindow: import_zod12.z.number().int().min(1).default(60)
|
|
2367
2553
|
}).optional(),
|
|
2368
2554
|
/**
|
|
2369
2555
|
* Rollback configuration
|
|
2370
2556
|
*/
|
|
2371
|
-
rollback:
|
|
2372
|
-
enabled:
|
|
2557
|
+
rollback: import_zod12.z.object({
|
|
2558
|
+
enabled: import_zod12.z.boolean().default(true),
|
|
2373
2559
|
/**
|
|
2374
2560
|
* Automatic rollback on failure
|
|
2375
2561
|
*/
|
|
2376
|
-
automatic:
|
|
2562
|
+
automatic: import_zod12.z.boolean().default(true),
|
|
2377
2563
|
/**
|
|
2378
2564
|
* Keep N previous versions for rollback
|
|
2379
2565
|
*/
|
|
2380
|
-
keepVersions:
|
|
2566
|
+
keepVersions: import_zod12.z.number().int().min(1).default(3),
|
|
2381
2567
|
/**
|
|
2382
2568
|
* Rollback timeout in milliseconds
|
|
2383
2569
|
*/
|
|
2384
|
-
timeout:
|
|
2570
|
+
timeout: import_zod12.z.number().int().min(1e3).default(3e4)
|
|
2385
2571
|
}).optional(),
|
|
2386
2572
|
/**
|
|
2387
2573
|
* Pre-update validation
|
|
2388
2574
|
*/
|
|
2389
|
-
validation:
|
|
2575
|
+
validation: import_zod12.z.object({
|
|
2390
2576
|
/**
|
|
2391
2577
|
* Run compatibility checks before update
|
|
2392
2578
|
*/
|
|
2393
|
-
checkCompatibility:
|
|
2579
|
+
checkCompatibility: import_zod12.z.boolean().default(true),
|
|
2394
2580
|
/**
|
|
2395
2581
|
* Run tests before applying update
|
|
2396
2582
|
*/
|
|
2397
|
-
runTests:
|
|
2583
|
+
runTests: import_zod12.z.boolean().default(false),
|
|
2398
2584
|
/**
|
|
2399
2585
|
* Test suite to run
|
|
2400
2586
|
*/
|
|
2401
|
-
testSuite:
|
|
2587
|
+
testSuite: import_zod12.z.string().optional()
|
|
2402
2588
|
}).optional()
|
|
2403
2589
|
});
|
|
2404
|
-
var PluginStateSnapshotSchema =
|
|
2590
|
+
var PluginStateSnapshotSchema = import_zod12.z.object({
|
|
2405
2591
|
/**
|
|
2406
2592
|
* Plugin identifier
|
|
2407
2593
|
*/
|
|
2408
|
-
pluginId:
|
|
2594
|
+
pluginId: import_zod12.z.string(),
|
|
2409
2595
|
/**
|
|
2410
2596
|
* Version at time of snapshot
|
|
2411
2597
|
*/
|
|
2412
|
-
version:
|
|
2598
|
+
version: import_zod12.z.string(),
|
|
2413
2599
|
/**
|
|
2414
2600
|
* Snapshot timestamp
|
|
2415
2601
|
*/
|
|
2416
|
-
timestamp:
|
|
2602
|
+
timestamp: import_zod12.z.string().datetime(),
|
|
2417
2603
|
/**
|
|
2418
2604
|
* Serialized state data
|
|
2419
2605
|
*/
|
|
2420
|
-
state:
|
|
2606
|
+
state: import_zod12.z.record(import_zod12.z.string(), import_zod12.z.any()),
|
|
2421
2607
|
/**
|
|
2422
2608
|
* State metadata
|
|
2423
2609
|
*/
|
|
2424
|
-
metadata:
|
|
2425
|
-
checksum:
|
|
2426
|
-
compressed:
|
|
2427
|
-
encryption:
|
|
2610
|
+
metadata: import_zod12.z.object({
|
|
2611
|
+
checksum: import_zod12.z.string().optional().describe("State checksum for verification"),
|
|
2612
|
+
compressed: import_zod12.z.boolean().default(false),
|
|
2613
|
+
encryption: import_zod12.z.string().optional().describe("Encryption algorithm if encrypted")
|
|
2428
2614
|
}).optional()
|
|
2429
2615
|
});
|
|
2430
|
-
var AdvancedPluginLifecycleConfigSchema =
|
|
2616
|
+
var AdvancedPluginLifecycleConfigSchema = import_zod12.z.object({
|
|
2431
2617
|
/**
|
|
2432
2618
|
* Health monitoring configuration
|
|
2433
2619
|
*/
|
|
@@ -2447,47 +2633,47 @@ var AdvancedPluginLifecycleConfigSchema = import_zod10.z.object({
|
|
|
2447
2633
|
/**
|
|
2448
2634
|
* Resource limits
|
|
2449
2635
|
*/
|
|
2450
|
-
resources:
|
|
2451
|
-
maxMemory:
|
|
2452
|
-
maxCpu:
|
|
2453
|
-
maxConnections:
|
|
2454
|
-
timeout:
|
|
2636
|
+
resources: import_zod12.z.object({
|
|
2637
|
+
maxMemory: import_zod12.z.number().int().optional().describe("Maximum memory in bytes"),
|
|
2638
|
+
maxCpu: import_zod12.z.number().min(0).max(100).optional().describe("Maximum CPU percentage"),
|
|
2639
|
+
maxConnections: import_zod12.z.number().int().optional().describe("Maximum concurrent connections"),
|
|
2640
|
+
timeout: import_zod12.z.number().int().optional().describe("Operation timeout in milliseconds")
|
|
2455
2641
|
}).optional(),
|
|
2456
2642
|
/**
|
|
2457
2643
|
* Monitoring and observability
|
|
2458
2644
|
*/
|
|
2459
|
-
observability:
|
|
2460
|
-
enableMetrics:
|
|
2461
|
-
enableTracing:
|
|
2462
|
-
enableProfiling:
|
|
2463
|
-
metricsInterval:
|
|
2645
|
+
observability: import_zod12.z.object({
|
|
2646
|
+
enableMetrics: import_zod12.z.boolean().default(true),
|
|
2647
|
+
enableTracing: import_zod12.z.boolean().default(true),
|
|
2648
|
+
enableProfiling: import_zod12.z.boolean().default(false),
|
|
2649
|
+
metricsInterval: import_zod12.z.number().int().min(1e3).default(6e4).describe("Metrics collection interval in ms")
|
|
2464
2650
|
}).optional()
|
|
2465
2651
|
});
|
|
2466
2652
|
|
|
2467
2653
|
// src/kernel/plugin-lifecycle-events.zod.ts
|
|
2468
|
-
var
|
|
2469
|
-
var EventPhaseSchema =
|
|
2470
|
-
var PluginEventBaseSchema =
|
|
2654
|
+
var import_zod13 = require("zod");
|
|
2655
|
+
var EventPhaseSchema = import_zod13.z.enum(["init", "start", "destroy"]).describe("Plugin lifecycle phase");
|
|
2656
|
+
var PluginEventBaseSchema = import_zod13.z.object({
|
|
2471
2657
|
/**
|
|
2472
2658
|
* Plugin name
|
|
2473
2659
|
*/
|
|
2474
|
-
pluginName:
|
|
2660
|
+
pluginName: import_zod13.z.string().describe("Name of the plugin"),
|
|
2475
2661
|
/**
|
|
2476
2662
|
* Event timestamp (Unix milliseconds)
|
|
2477
2663
|
*/
|
|
2478
|
-
timestamp:
|
|
2664
|
+
timestamp: import_zod13.z.number().int().describe("Unix timestamp in milliseconds when event occurred")
|
|
2479
2665
|
});
|
|
2480
2666
|
var PluginRegisteredEventSchema = PluginEventBaseSchema.extend({
|
|
2481
2667
|
/**
|
|
2482
2668
|
* Plugin version (optional)
|
|
2483
2669
|
*/
|
|
2484
|
-
version:
|
|
2670
|
+
version: import_zod13.z.string().optional().describe("Plugin version")
|
|
2485
2671
|
});
|
|
2486
2672
|
var PluginLifecyclePhaseEventSchema = PluginEventBaseSchema.extend({
|
|
2487
2673
|
/**
|
|
2488
2674
|
* Duration of the phase (milliseconds)
|
|
2489
2675
|
*/
|
|
2490
|
-
duration:
|
|
2676
|
+
duration: import_zod13.z.number().min(0).optional().describe("Duration of the lifecycle phase in milliseconds"),
|
|
2491
2677
|
/**
|
|
2492
2678
|
* Lifecycle phase
|
|
2493
2679
|
*/
|
|
@@ -2497,7 +2683,7 @@ var PluginErrorEventSchema = PluginEventBaseSchema.extend({
|
|
|
2497
2683
|
/**
|
|
2498
2684
|
* Error object
|
|
2499
2685
|
*/
|
|
2500
|
-
error:
|
|
2686
|
+
error: import_zod13.z.instanceof(Error).describe("Error object"),
|
|
2501
2687
|
/**
|
|
2502
2688
|
* Lifecycle phase where error occurred
|
|
2503
2689
|
*/
|
|
@@ -2505,91 +2691,91 @@ var PluginErrorEventSchema = PluginEventBaseSchema.extend({
|
|
|
2505
2691
|
/**
|
|
2506
2692
|
* Error message (for serialization)
|
|
2507
2693
|
*/
|
|
2508
|
-
errorMessage:
|
|
2694
|
+
errorMessage: import_zod13.z.string().optional().describe("Error message"),
|
|
2509
2695
|
/**
|
|
2510
2696
|
* Error stack trace (for debugging)
|
|
2511
2697
|
*/
|
|
2512
|
-
errorStack:
|
|
2698
|
+
errorStack: import_zod13.z.string().optional().describe("Error stack trace")
|
|
2513
2699
|
});
|
|
2514
|
-
var ServiceRegisteredEventSchema =
|
|
2700
|
+
var ServiceRegisteredEventSchema = import_zod13.z.object({
|
|
2515
2701
|
/**
|
|
2516
2702
|
* Service name
|
|
2517
2703
|
*/
|
|
2518
|
-
serviceName:
|
|
2704
|
+
serviceName: import_zod13.z.string().describe("Name of the registered service"),
|
|
2519
2705
|
/**
|
|
2520
2706
|
* Event timestamp (Unix milliseconds)
|
|
2521
2707
|
*/
|
|
2522
|
-
timestamp:
|
|
2708
|
+
timestamp: import_zod13.z.number().int().describe("Unix timestamp in milliseconds"),
|
|
2523
2709
|
/**
|
|
2524
2710
|
* Service type (optional)
|
|
2525
2711
|
*/
|
|
2526
|
-
serviceType:
|
|
2712
|
+
serviceType: import_zod13.z.string().optional().describe("Type or interface name of the service")
|
|
2527
2713
|
});
|
|
2528
|
-
var ServiceUnregisteredEventSchema =
|
|
2714
|
+
var ServiceUnregisteredEventSchema = import_zod13.z.object({
|
|
2529
2715
|
/**
|
|
2530
2716
|
* Service name
|
|
2531
2717
|
*/
|
|
2532
|
-
serviceName:
|
|
2718
|
+
serviceName: import_zod13.z.string().describe("Name of the unregistered service"),
|
|
2533
2719
|
/**
|
|
2534
2720
|
* Event timestamp (Unix milliseconds)
|
|
2535
2721
|
*/
|
|
2536
|
-
timestamp:
|
|
2722
|
+
timestamp: import_zod13.z.number().int().describe("Unix timestamp in milliseconds")
|
|
2537
2723
|
});
|
|
2538
|
-
var HookRegisteredEventSchema =
|
|
2724
|
+
var HookRegisteredEventSchema = import_zod13.z.object({
|
|
2539
2725
|
/**
|
|
2540
2726
|
* Hook name
|
|
2541
2727
|
*/
|
|
2542
|
-
hookName:
|
|
2728
|
+
hookName: import_zod13.z.string().describe("Name of the hook"),
|
|
2543
2729
|
/**
|
|
2544
2730
|
* Event timestamp (Unix milliseconds)
|
|
2545
2731
|
*/
|
|
2546
|
-
timestamp:
|
|
2732
|
+
timestamp: import_zod13.z.number().int().describe("Unix timestamp in milliseconds"),
|
|
2547
2733
|
/**
|
|
2548
2734
|
* Number of handlers registered for this hook
|
|
2549
2735
|
*/
|
|
2550
|
-
handlerCount:
|
|
2736
|
+
handlerCount: import_zod13.z.number().int().min(0).describe("Number of handlers registered for this hook")
|
|
2551
2737
|
});
|
|
2552
|
-
var HookTriggeredEventSchema =
|
|
2738
|
+
var HookTriggeredEventSchema = import_zod13.z.object({
|
|
2553
2739
|
/**
|
|
2554
2740
|
* Hook name
|
|
2555
2741
|
*/
|
|
2556
|
-
hookName:
|
|
2742
|
+
hookName: import_zod13.z.string().describe("Name of the hook"),
|
|
2557
2743
|
/**
|
|
2558
2744
|
* Event timestamp (Unix milliseconds)
|
|
2559
2745
|
*/
|
|
2560
|
-
timestamp:
|
|
2746
|
+
timestamp: import_zod13.z.number().int().describe("Unix timestamp in milliseconds"),
|
|
2561
2747
|
/**
|
|
2562
2748
|
* Arguments passed to the hook
|
|
2563
2749
|
*/
|
|
2564
|
-
args:
|
|
2750
|
+
args: import_zod13.z.array(import_zod13.z.any()).describe("Arguments passed to the hook handlers"),
|
|
2565
2751
|
/**
|
|
2566
2752
|
* Number of handlers that will handle this event
|
|
2567
2753
|
*/
|
|
2568
|
-
handlerCount:
|
|
2754
|
+
handlerCount: import_zod13.z.number().int().min(0).optional().describe("Number of handlers that will handle this event")
|
|
2569
2755
|
});
|
|
2570
|
-
var KernelEventBaseSchema =
|
|
2756
|
+
var KernelEventBaseSchema = import_zod13.z.object({
|
|
2571
2757
|
/**
|
|
2572
2758
|
* Event timestamp (Unix milliseconds)
|
|
2573
2759
|
*/
|
|
2574
|
-
timestamp:
|
|
2760
|
+
timestamp: import_zod13.z.number().int().describe("Unix timestamp in milliseconds")
|
|
2575
2761
|
});
|
|
2576
2762
|
var KernelReadyEventSchema = KernelEventBaseSchema.extend({
|
|
2577
2763
|
/**
|
|
2578
2764
|
* Total initialization duration (milliseconds)
|
|
2579
2765
|
*/
|
|
2580
|
-
duration:
|
|
2766
|
+
duration: import_zod13.z.number().min(0).optional().describe("Total initialization duration in milliseconds"),
|
|
2581
2767
|
/**
|
|
2582
2768
|
* Number of plugins initialized
|
|
2583
2769
|
*/
|
|
2584
|
-
pluginCount:
|
|
2770
|
+
pluginCount: import_zod13.z.number().int().min(0).optional().describe("Number of plugins initialized")
|
|
2585
2771
|
});
|
|
2586
2772
|
var KernelShutdownEventSchema = KernelEventBaseSchema.extend({
|
|
2587
2773
|
/**
|
|
2588
2774
|
* Shutdown reason (optional)
|
|
2589
2775
|
*/
|
|
2590
|
-
reason:
|
|
2776
|
+
reason: import_zod13.z.string().optional().describe("Reason for kernel shutdown")
|
|
2591
2777
|
});
|
|
2592
|
-
var PluginLifecycleEventType =
|
|
2778
|
+
var PluginLifecycleEventType = import_zod13.z.enum([
|
|
2593
2779
|
"kernel:ready",
|
|
2594
2780
|
"kernel:shutdown",
|
|
2595
2781
|
"kernel:before-init",
|
|
@@ -2612,8 +2798,8 @@ var PluginLifecycleEventType = import_zod11.z.enum([
|
|
|
2612
2798
|
]).describe("Plugin lifecycle event type");
|
|
2613
2799
|
|
|
2614
2800
|
// src/kernel/plugin-security-advanced.zod.ts
|
|
2615
|
-
var
|
|
2616
|
-
var PermissionScopeSchema =
|
|
2801
|
+
var import_zod14 = require("zod");
|
|
2802
|
+
var PermissionScopeSchema = import_zod14.z.enum([
|
|
2617
2803
|
"global",
|
|
2618
2804
|
// Applies to entire system
|
|
2619
2805
|
"tenant",
|
|
@@ -2625,7 +2811,7 @@ var PermissionScopeSchema = import_zod12.z.enum([
|
|
|
2625
2811
|
"plugin"
|
|
2626
2812
|
// Applies within plugin boundaries
|
|
2627
2813
|
]).describe("Scope of permission application");
|
|
2628
|
-
var PermissionActionSchema =
|
|
2814
|
+
var PermissionActionSchema = import_zod14.z.enum([
|
|
2629
2815
|
"create",
|
|
2630
2816
|
// Create new resources
|
|
2631
2817
|
"read",
|
|
@@ -2649,7 +2835,7 @@ var PermissionActionSchema = import_zod12.z.enum([
|
|
|
2649
2835
|
"admin"
|
|
2650
2836
|
// Administrative access
|
|
2651
2837
|
]).describe("Type of action being permitted");
|
|
2652
|
-
var ResourceTypeSchema =
|
|
2838
|
+
var ResourceTypeSchema = import_zod14.z.enum([
|
|
2653
2839
|
"data.object",
|
|
2654
2840
|
// ObjectQL objects
|
|
2655
2841
|
"data.record",
|
|
@@ -2683,11 +2869,11 @@ var ResourceTypeSchema = import_zod12.z.enum([
|
|
|
2683
2869
|
"process.env"
|
|
2684
2870
|
// Environment variables
|
|
2685
2871
|
]).describe("Type of resource being accessed");
|
|
2686
|
-
var PermissionSchema =
|
|
2872
|
+
var PermissionSchema = import_zod14.z.object({
|
|
2687
2873
|
/**
|
|
2688
2874
|
* Permission identifier
|
|
2689
2875
|
*/
|
|
2690
|
-
id:
|
|
2876
|
+
id: import_zod14.z.string().describe("Unique permission identifier"),
|
|
2691
2877
|
/**
|
|
2692
2878
|
* Resource type
|
|
2693
2879
|
*/
|
|
@@ -2695,7 +2881,7 @@ var PermissionSchema = import_zod12.z.object({
|
|
|
2695
2881
|
/**
|
|
2696
2882
|
* Allowed actions
|
|
2697
2883
|
*/
|
|
2698
|
-
actions:
|
|
2884
|
+
actions: import_zod14.z.array(PermissionActionSchema),
|
|
2699
2885
|
/**
|
|
2700
2886
|
* Permission scope
|
|
2701
2887
|
*/
|
|
@@ -2703,50 +2889,50 @@ var PermissionSchema = import_zod12.z.object({
|
|
|
2703
2889
|
/**
|
|
2704
2890
|
* Resource filter
|
|
2705
2891
|
*/
|
|
2706
|
-
filter:
|
|
2892
|
+
filter: import_zod14.z.object({
|
|
2707
2893
|
/**
|
|
2708
2894
|
* Specific resource IDs
|
|
2709
2895
|
*/
|
|
2710
|
-
resourceIds:
|
|
2896
|
+
resourceIds: import_zod14.z.array(import_zod14.z.string()).optional(),
|
|
2711
2897
|
/**
|
|
2712
2898
|
* Filter condition
|
|
2713
2899
|
*/
|
|
2714
|
-
condition:
|
|
2900
|
+
condition: import_zod14.z.string().optional().describe("Filter expression (e.g., owner = currentUser)"),
|
|
2715
2901
|
/**
|
|
2716
2902
|
* Field-level access
|
|
2717
2903
|
*/
|
|
2718
|
-
fields:
|
|
2904
|
+
fields: import_zod14.z.array(import_zod14.z.string()).optional().describe("Allowed fields for data resources")
|
|
2719
2905
|
}).optional(),
|
|
2720
2906
|
/**
|
|
2721
2907
|
* Human-readable description
|
|
2722
2908
|
*/
|
|
2723
|
-
description:
|
|
2909
|
+
description: import_zod14.z.string(),
|
|
2724
2910
|
/**
|
|
2725
2911
|
* Whether this permission is required or optional
|
|
2726
2912
|
*/
|
|
2727
|
-
required:
|
|
2913
|
+
required: import_zod14.z.boolean().default(true),
|
|
2728
2914
|
/**
|
|
2729
2915
|
* Justification for permission
|
|
2730
2916
|
*/
|
|
2731
|
-
justification:
|
|
2917
|
+
justification: import_zod14.z.string().optional().describe("Why this permission is needed")
|
|
2732
2918
|
});
|
|
2733
|
-
var PermissionSetSchema =
|
|
2919
|
+
var PermissionSetSchema = import_zod14.z.object({
|
|
2734
2920
|
/**
|
|
2735
2921
|
* All permissions required by plugin
|
|
2736
2922
|
*/
|
|
2737
|
-
permissions:
|
|
2923
|
+
permissions: import_zod14.z.array(PermissionSchema),
|
|
2738
2924
|
/**
|
|
2739
2925
|
* Permission groups for easier management
|
|
2740
2926
|
*/
|
|
2741
|
-
groups:
|
|
2742
|
-
name:
|
|
2743
|
-
description:
|
|
2744
|
-
permissions:
|
|
2927
|
+
groups: import_zod14.z.array(import_zod14.z.object({
|
|
2928
|
+
name: import_zod14.z.string().describe("Group name"),
|
|
2929
|
+
description: import_zod14.z.string(),
|
|
2930
|
+
permissions: import_zod14.z.array(import_zod14.z.string()).describe("Permission IDs in this group")
|
|
2745
2931
|
})).optional(),
|
|
2746
2932
|
/**
|
|
2747
2933
|
* Default grant strategy
|
|
2748
2934
|
*/
|
|
2749
|
-
defaultGrant:
|
|
2935
|
+
defaultGrant: import_zod14.z.enum([
|
|
2750
2936
|
"prompt",
|
|
2751
2937
|
// Always prompt user
|
|
2752
2938
|
"allow",
|
|
@@ -2757,11 +2943,11 @@ var PermissionSetSchema = import_zod12.z.object({
|
|
|
2757
2943
|
// Inherit from parent
|
|
2758
2944
|
]).default("prompt")
|
|
2759
2945
|
});
|
|
2760
|
-
var RuntimeConfigSchema =
|
|
2946
|
+
var RuntimeConfigSchema = import_zod14.z.object({
|
|
2761
2947
|
/**
|
|
2762
2948
|
* Runtime engine type
|
|
2763
2949
|
*/
|
|
2764
|
-
engine:
|
|
2950
|
+
engine: import_zod14.z.enum([
|
|
2765
2951
|
"v8-isolate",
|
|
2766
2952
|
// V8 isolate-based isolation (lightweight, fast)
|
|
2767
2953
|
"wasm",
|
|
@@ -2774,97 +2960,97 @@ var RuntimeConfigSchema = import_zod12.z.object({
|
|
|
2774
2960
|
/**
|
|
2775
2961
|
* Engine-specific configuration
|
|
2776
2962
|
*/
|
|
2777
|
-
engineConfig:
|
|
2963
|
+
engineConfig: import_zod14.z.object({
|
|
2778
2964
|
/**
|
|
2779
2965
|
* WASM-specific settings (when engine is "wasm")
|
|
2780
2966
|
*/
|
|
2781
|
-
wasm:
|
|
2967
|
+
wasm: import_zod14.z.object({
|
|
2782
2968
|
/**
|
|
2783
2969
|
* Maximum memory pages (64KB per page)
|
|
2784
2970
|
*/
|
|
2785
|
-
maxMemoryPages:
|
|
2971
|
+
maxMemoryPages: import_zod14.z.number().int().min(1).max(65536).optional().describe("Maximum WASM memory pages (64KB each)"),
|
|
2786
2972
|
/**
|
|
2787
2973
|
* Instruction execution limit
|
|
2788
2974
|
*/
|
|
2789
|
-
instructionLimit:
|
|
2975
|
+
instructionLimit: import_zod14.z.number().int().min(1).optional().describe("Maximum instructions before timeout"),
|
|
2790
2976
|
/**
|
|
2791
2977
|
* Enable SIMD instructions
|
|
2792
2978
|
*/
|
|
2793
|
-
enableSimd:
|
|
2979
|
+
enableSimd: import_zod14.z.boolean().default(false).describe("Enable WebAssembly SIMD support"),
|
|
2794
2980
|
/**
|
|
2795
2981
|
* Enable threads
|
|
2796
2982
|
*/
|
|
2797
|
-
enableThreads:
|
|
2983
|
+
enableThreads: import_zod14.z.boolean().default(false).describe("Enable WebAssembly threads"),
|
|
2798
2984
|
/**
|
|
2799
2985
|
* Enable bulk memory operations
|
|
2800
2986
|
*/
|
|
2801
|
-
enableBulkMemory:
|
|
2987
|
+
enableBulkMemory: import_zod14.z.boolean().default(true).describe("Enable bulk memory operations")
|
|
2802
2988
|
}).optional(),
|
|
2803
2989
|
/**
|
|
2804
2990
|
* Container-specific settings (when engine is "container")
|
|
2805
2991
|
*/
|
|
2806
|
-
container:
|
|
2992
|
+
container: import_zod14.z.object({
|
|
2807
2993
|
/**
|
|
2808
2994
|
* Container image
|
|
2809
2995
|
*/
|
|
2810
|
-
image:
|
|
2996
|
+
image: import_zod14.z.string().optional().describe("Container image to use"),
|
|
2811
2997
|
/**
|
|
2812
2998
|
* Container runtime
|
|
2813
2999
|
*/
|
|
2814
|
-
runtime:
|
|
3000
|
+
runtime: import_zod14.z.enum(["docker", "podman", "containerd"]).default("docker"),
|
|
2815
3001
|
/**
|
|
2816
3002
|
* Resource limits
|
|
2817
3003
|
*/
|
|
2818
|
-
resources:
|
|
2819
|
-
cpuLimit:
|
|
2820
|
-
memoryLimit:
|
|
3004
|
+
resources: import_zod14.z.object({
|
|
3005
|
+
cpuLimit: import_zod14.z.string().optional().describe('CPU limit (e.g., "0.5", "2")'),
|
|
3006
|
+
memoryLimit: import_zod14.z.string().optional().describe('Memory limit (e.g., "512m", "1g")')
|
|
2821
3007
|
}).optional(),
|
|
2822
3008
|
/**
|
|
2823
3009
|
* Network mode
|
|
2824
3010
|
*/
|
|
2825
|
-
networkMode:
|
|
3011
|
+
networkMode: import_zod14.z.enum(["none", "bridge", "host"]).default("bridge")
|
|
2826
3012
|
}).optional(),
|
|
2827
3013
|
/**
|
|
2828
3014
|
* V8 Isolate-specific settings (when engine is "v8-isolate")
|
|
2829
3015
|
*/
|
|
2830
|
-
v8Isolate:
|
|
3016
|
+
v8Isolate: import_zod14.z.object({
|
|
2831
3017
|
/**
|
|
2832
3018
|
* Heap size limit in MB
|
|
2833
3019
|
*/
|
|
2834
|
-
heapSizeMb:
|
|
3020
|
+
heapSizeMb: import_zod14.z.number().int().min(1).optional(),
|
|
2835
3021
|
/**
|
|
2836
3022
|
* Enable snapshot
|
|
2837
3023
|
*/
|
|
2838
|
-
enableSnapshot:
|
|
3024
|
+
enableSnapshot: import_zod14.z.boolean().default(true)
|
|
2839
3025
|
}).optional()
|
|
2840
3026
|
}).optional(),
|
|
2841
3027
|
/**
|
|
2842
3028
|
* General resource limits (applies to all engines)
|
|
2843
3029
|
*/
|
|
2844
|
-
resourceLimits:
|
|
3030
|
+
resourceLimits: import_zod14.z.object({
|
|
2845
3031
|
/**
|
|
2846
3032
|
* Maximum memory in bytes
|
|
2847
3033
|
*/
|
|
2848
|
-
maxMemory:
|
|
3034
|
+
maxMemory: import_zod14.z.number().int().optional().describe("Maximum memory allocation"),
|
|
2849
3035
|
/**
|
|
2850
3036
|
* Maximum CPU percentage
|
|
2851
3037
|
*/
|
|
2852
|
-
maxCpu:
|
|
3038
|
+
maxCpu: import_zod14.z.number().min(0).max(100).optional().describe("Maximum CPU usage percentage"),
|
|
2853
3039
|
/**
|
|
2854
3040
|
* Execution timeout in milliseconds
|
|
2855
3041
|
*/
|
|
2856
|
-
timeout:
|
|
3042
|
+
timeout: import_zod14.z.number().int().min(0).optional().describe("Maximum execution time")
|
|
2857
3043
|
}).optional()
|
|
2858
3044
|
});
|
|
2859
|
-
var SandboxConfigSchema =
|
|
3045
|
+
var SandboxConfigSchema = import_zod14.z.object({
|
|
2860
3046
|
/**
|
|
2861
3047
|
* Enable sandboxing
|
|
2862
3048
|
*/
|
|
2863
|
-
enabled:
|
|
3049
|
+
enabled: import_zod14.z.boolean().default(true),
|
|
2864
3050
|
/**
|
|
2865
3051
|
* Sandboxing level
|
|
2866
3052
|
*/
|
|
2867
|
-
level:
|
|
3053
|
+
level: import_zod14.z.enum([
|
|
2868
3054
|
"none",
|
|
2869
3055
|
// No sandboxing
|
|
2870
3056
|
"minimal",
|
|
@@ -2883,239 +3069,239 @@ var SandboxConfigSchema = import_zod12.z.object({
|
|
|
2883
3069
|
/**
|
|
2884
3070
|
* File system access
|
|
2885
3071
|
*/
|
|
2886
|
-
filesystem:
|
|
2887
|
-
mode:
|
|
2888
|
-
allowedPaths:
|
|
2889
|
-
deniedPaths:
|
|
2890
|
-
maxFileSize:
|
|
3072
|
+
filesystem: import_zod14.z.object({
|
|
3073
|
+
mode: import_zod14.z.enum(["none", "readonly", "restricted", "full"]).default("restricted"),
|
|
3074
|
+
allowedPaths: import_zod14.z.array(import_zod14.z.string()).optional().describe("Whitelisted paths"),
|
|
3075
|
+
deniedPaths: import_zod14.z.array(import_zod14.z.string()).optional().describe("Blacklisted paths"),
|
|
3076
|
+
maxFileSize: import_zod14.z.number().int().optional().describe("Maximum file size in bytes")
|
|
2891
3077
|
}).optional(),
|
|
2892
3078
|
/**
|
|
2893
3079
|
* Network access
|
|
2894
3080
|
*/
|
|
2895
|
-
network:
|
|
2896
|
-
mode:
|
|
2897
|
-
allowedHosts:
|
|
2898
|
-
deniedHosts:
|
|
2899
|
-
allowedPorts:
|
|
2900
|
-
maxConnections:
|
|
3081
|
+
network: import_zod14.z.object({
|
|
3082
|
+
mode: import_zod14.z.enum(["none", "local", "restricted", "full"]).default("restricted"),
|
|
3083
|
+
allowedHosts: import_zod14.z.array(import_zod14.z.string()).optional().describe("Whitelisted hosts"),
|
|
3084
|
+
deniedHosts: import_zod14.z.array(import_zod14.z.string()).optional().describe("Blacklisted hosts"),
|
|
3085
|
+
allowedPorts: import_zod14.z.array(import_zod14.z.number()).optional().describe("Allowed port numbers"),
|
|
3086
|
+
maxConnections: import_zod14.z.number().int().optional()
|
|
2901
3087
|
}).optional(),
|
|
2902
3088
|
/**
|
|
2903
3089
|
* Process execution
|
|
2904
3090
|
*/
|
|
2905
|
-
process:
|
|
2906
|
-
allowSpawn:
|
|
2907
|
-
allowedCommands:
|
|
2908
|
-
timeout:
|
|
3091
|
+
process: import_zod14.z.object({
|
|
3092
|
+
allowSpawn: import_zod14.z.boolean().default(false).describe("Allow spawning child processes"),
|
|
3093
|
+
allowedCommands: import_zod14.z.array(import_zod14.z.string()).optional().describe("Whitelisted commands"),
|
|
3094
|
+
timeout: import_zod14.z.number().int().optional().describe("Process timeout in ms")
|
|
2909
3095
|
}).optional(),
|
|
2910
3096
|
/**
|
|
2911
3097
|
* Memory limits
|
|
2912
3098
|
*/
|
|
2913
|
-
memory:
|
|
2914
|
-
maxHeap:
|
|
2915
|
-
maxStack:
|
|
3099
|
+
memory: import_zod14.z.object({
|
|
3100
|
+
maxHeap: import_zod14.z.number().int().optional().describe("Maximum heap size in bytes"),
|
|
3101
|
+
maxStack: import_zod14.z.number().int().optional().describe("Maximum stack size in bytes")
|
|
2916
3102
|
}).optional(),
|
|
2917
3103
|
/**
|
|
2918
3104
|
* CPU limits
|
|
2919
3105
|
*/
|
|
2920
|
-
cpu:
|
|
2921
|
-
maxCpuPercent:
|
|
2922
|
-
maxThreads:
|
|
3106
|
+
cpu: import_zod14.z.object({
|
|
3107
|
+
maxCpuPercent: import_zod14.z.number().min(0).max(100).optional(),
|
|
3108
|
+
maxThreads: import_zod14.z.number().int().optional()
|
|
2923
3109
|
}).optional(),
|
|
2924
3110
|
/**
|
|
2925
3111
|
* Environment variables
|
|
2926
3112
|
*/
|
|
2927
|
-
environment:
|
|
2928
|
-
mode:
|
|
2929
|
-
allowedVars:
|
|
2930
|
-
deniedVars:
|
|
3113
|
+
environment: import_zod14.z.object({
|
|
3114
|
+
mode: import_zod14.z.enum(["none", "readonly", "restricted", "full"]).default("readonly"),
|
|
3115
|
+
allowedVars: import_zod14.z.array(import_zod14.z.string()).optional(),
|
|
3116
|
+
deniedVars: import_zod14.z.array(import_zod14.z.string()).optional()
|
|
2931
3117
|
}).optional()
|
|
2932
3118
|
});
|
|
2933
|
-
var SecurityVulnerabilitySchema =
|
|
3119
|
+
var SecurityVulnerabilitySchema = import_zod14.z.object({
|
|
2934
3120
|
/**
|
|
2935
3121
|
* CVE identifier
|
|
2936
3122
|
*/
|
|
2937
|
-
cve:
|
|
3123
|
+
cve: import_zod14.z.string().optional(),
|
|
2938
3124
|
/**
|
|
2939
3125
|
* Vulnerability identifier
|
|
2940
3126
|
*/
|
|
2941
|
-
id:
|
|
3127
|
+
id: import_zod14.z.string(),
|
|
2942
3128
|
/**
|
|
2943
3129
|
* Severity level
|
|
2944
3130
|
*/
|
|
2945
|
-
severity:
|
|
3131
|
+
severity: import_zod14.z.enum(["critical", "high", "medium", "low", "info"]),
|
|
2946
3132
|
/**
|
|
2947
3133
|
* Category (e.g., SAST, DAST, Dependency)
|
|
2948
3134
|
*/
|
|
2949
|
-
category:
|
|
3135
|
+
category: import_zod14.z.string().optional(),
|
|
2950
3136
|
/**
|
|
2951
3137
|
* Title
|
|
2952
3138
|
*/
|
|
2953
|
-
title:
|
|
3139
|
+
title: import_zod14.z.string(),
|
|
2954
3140
|
/**
|
|
2955
3141
|
* Location of the vulnerability
|
|
2956
3142
|
*/
|
|
2957
|
-
location:
|
|
3143
|
+
location: import_zod14.z.string().optional(),
|
|
2958
3144
|
/**
|
|
2959
3145
|
* Remediation steps
|
|
2960
3146
|
*/
|
|
2961
|
-
remediation:
|
|
3147
|
+
remediation: import_zod14.z.string().optional(),
|
|
2962
3148
|
/**
|
|
2963
3149
|
* Description
|
|
2964
3150
|
*/
|
|
2965
|
-
description:
|
|
3151
|
+
description: import_zod14.z.string(),
|
|
2966
3152
|
/**
|
|
2967
3153
|
* Affected versions
|
|
2968
3154
|
*/
|
|
2969
|
-
affectedVersions:
|
|
3155
|
+
affectedVersions: import_zod14.z.array(import_zod14.z.string()),
|
|
2970
3156
|
/**
|
|
2971
3157
|
* Fixed in versions
|
|
2972
3158
|
*/
|
|
2973
|
-
fixedIn:
|
|
3159
|
+
fixedIn: import_zod14.z.array(import_zod14.z.string()).optional(),
|
|
2974
3160
|
/**
|
|
2975
3161
|
* CVSS score
|
|
2976
3162
|
*/
|
|
2977
|
-
cvssScore:
|
|
3163
|
+
cvssScore: import_zod14.z.number().min(0).max(10).optional(),
|
|
2978
3164
|
/**
|
|
2979
3165
|
* Exploit availability
|
|
2980
3166
|
*/
|
|
2981
|
-
exploitAvailable:
|
|
3167
|
+
exploitAvailable: import_zod14.z.boolean().default(false),
|
|
2982
3168
|
/**
|
|
2983
3169
|
* Patch available
|
|
2984
3170
|
*/
|
|
2985
|
-
patchAvailable:
|
|
3171
|
+
patchAvailable: import_zod14.z.boolean().default(false),
|
|
2986
3172
|
/**
|
|
2987
3173
|
* Workaround
|
|
2988
3174
|
*/
|
|
2989
|
-
workaround:
|
|
3175
|
+
workaround: import_zod14.z.string().optional(),
|
|
2990
3176
|
/**
|
|
2991
3177
|
* References
|
|
2992
3178
|
*/
|
|
2993
|
-
references:
|
|
3179
|
+
references: import_zod14.z.array(import_zod14.z.string()).optional(),
|
|
2994
3180
|
/**
|
|
2995
3181
|
* Discovered date
|
|
2996
3182
|
*/
|
|
2997
|
-
discoveredDate:
|
|
3183
|
+
discoveredDate: import_zod14.z.string().datetime().optional(),
|
|
2998
3184
|
/**
|
|
2999
3185
|
* Published date
|
|
3000
3186
|
*/
|
|
3001
|
-
publishedDate:
|
|
3187
|
+
publishedDate: import_zod14.z.string().datetime().optional()
|
|
3002
3188
|
});
|
|
3003
|
-
var SecurityScanResultSchema =
|
|
3189
|
+
var SecurityScanResultSchema = import_zod14.z.object({
|
|
3004
3190
|
/**
|
|
3005
3191
|
* Scan timestamp
|
|
3006
3192
|
*/
|
|
3007
|
-
timestamp:
|
|
3193
|
+
timestamp: import_zod14.z.string().datetime(),
|
|
3008
3194
|
/**
|
|
3009
3195
|
* Scanner information
|
|
3010
3196
|
*/
|
|
3011
|
-
scanner:
|
|
3012
|
-
name:
|
|
3013
|
-
version:
|
|
3197
|
+
scanner: import_zod14.z.object({
|
|
3198
|
+
name: import_zod14.z.string(),
|
|
3199
|
+
version: import_zod14.z.string()
|
|
3014
3200
|
}),
|
|
3015
3201
|
/**
|
|
3016
3202
|
* Overall status
|
|
3017
3203
|
*/
|
|
3018
|
-
status:
|
|
3204
|
+
status: import_zod14.z.enum(["passed", "failed", "warning"]),
|
|
3019
3205
|
/**
|
|
3020
3206
|
* Vulnerabilities found
|
|
3021
3207
|
*/
|
|
3022
|
-
vulnerabilities:
|
|
3208
|
+
vulnerabilities: import_zod14.z.array(SecurityVulnerabilitySchema).optional(),
|
|
3023
3209
|
/**
|
|
3024
3210
|
* Code quality issues
|
|
3025
3211
|
*/
|
|
3026
|
-
codeIssues:
|
|
3027
|
-
severity:
|
|
3028
|
-
type:
|
|
3029
|
-
file:
|
|
3030
|
-
line:
|
|
3031
|
-
message:
|
|
3032
|
-
suggestion:
|
|
3212
|
+
codeIssues: import_zod14.z.array(import_zod14.z.object({
|
|
3213
|
+
severity: import_zod14.z.enum(["error", "warning", "info"]),
|
|
3214
|
+
type: import_zod14.z.string().describe("Issue type (e.g., sql-injection, xss)"),
|
|
3215
|
+
file: import_zod14.z.string(),
|
|
3216
|
+
line: import_zod14.z.number().int().optional(),
|
|
3217
|
+
message: import_zod14.z.string(),
|
|
3218
|
+
suggestion: import_zod14.z.string().optional()
|
|
3033
3219
|
})).optional(),
|
|
3034
3220
|
/**
|
|
3035
3221
|
* Dependency vulnerabilities
|
|
3036
3222
|
*/
|
|
3037
|
-
dependencyVulnerabilities:
|
|
3038
|
-
package:
|
|
3039
|
-
version:
|
|
3223
|
+
dependencyVulnerabilities: import_zod14.z.array(import_zod14.z.object({
|
|
3224
|
+
package: import_zod14.z.string(),
|
|
3225
|
+
version: import_zod14.z.string(),
|
|
3040
3226
|
vulnerability: SecurityVulnerabilitySchema
|
|
3041
3227
|
})).optional(),
|
|
3042
3228
|
/**
|
|
3043
3229
|
* License compliance
|
|
3044
3230
|
*/
|
|
3045
|
-
licenseCompliance:
|
|
3046
|
-
status:
|
|
3047
|
-
issues:
|
|
3048
|
-
package:
|
|
3049
|
-
license:
|
|
3050
|
-
reason:
|
|
3231
|
+
licenseCompliance: import_zod14.z.object({
|
|
3232
|
+
status: import_zod14.z.enum(["compliant", "non-compliant", "unknown"]),
|
|
3233
|
+
issues: import_zod14.z.array(import_zod14.z.object({
|
|
3234
|
+
package: import_zod14.z.string(),
|
|
3235
|
+
license: import_zod14.z.string(),
|
|
3236
|
+
reason: import_zod14.z.string()
|
|
3051
3237
|
})).optional()
|
|
3052
3238
|
}).optional(),
|
|
3053
3239
|
/**
|
|
3054
3240
|
* Summary statistics
|
|
3055
3241
|
*/
|
|
3056
|
-
summary:
|
|
3057
|
-
totalVulnerabilities:
|
|
3058
|
-
criticalCount:
|
|
3059
|
-
highCount:
|
|
3060
|
-
mediumCount:
|
|
3061
|
-
lowCount:
|
|
3062
|
-
infoCount:
|
|
3242
|
+
summary: import_zod14.z.object({
|
|
3243
|
+
totalVulnerabilities: import_zod14.z.number().int(),
|
|
3244
|
+
criticalCount: import_zod14.z.number().int(),
|
|
3245
|
+
highCount: import_zod14.z.number().int(),
|
|
3246
|
+
mediumCount: import_zod14.z.number().int(),
|
|
3247
|
+
lowCount: import_zod14.z.number().int(),
|
|
3248
|
+
infoCount: import_zod14.z.number().int()
|
|
3063
3249
|
})
|
|
3064
3250
|
});
|
|
3065
|
-
var SecurityPolicySchema =
|
|
3251
|
+
var SecurityPolicySchema = import_zod14.z.object({
|
|
3066
3252
|
/**
|
|
3067
3253
|
* Content Security Policy
|
|
3068
3254
|
*/
|
|
3069
|
-
csp:
|
|
3070
|
-
directives:
|
|
3071
|
-
reportOnly:
|
|
3255
|
+
csp: import_zod14.z.object({
|
|
3256
|
+
directives: import_zod14.z.record(import_zod14.z.string(), import_zod14.z.array(import_zod14.z.string())).optional(),
|
|
3257
|
+
reportOnly: import_zod14.z.boolean().default(false)
|
|
3072
3258
|
}).optional(),
|
|
3073
3259
|
/**
|
|
3074
3260
|
* CORS policy
|
|
3075
3261
|
*/
|
|
3076
|
-
cors:
|
|
3077
|
-
allowedOrigins:
|
|
3078
|
-
allowedMethods:
|
|
3079
|
-
allowedHeaders:
|
|
3080
|
-
allowCredentials:
|
|
3081
|
-
maxAge:
|
|
3262
|
+
cors: import_zod14.z.object({
|
|
3263
|
+
allowedOrigins: import_zod14.z.array(import_zod14.z.string()),
|
|
3264
|
+
allowedMethods: import_zod14.z.array(import_zod14.z.string()),
|
|
3265
|
+
allowedHeaders: import_zod14.z.array(import_zod14.z.string()),
|
|
3266
|
+
allowCredentials: import_zod14.z.boolean().default(false),
|
|
3267
|
+
maxAge: import_zod14.z.number().int().optional()
|
|
3082
3268
|
}).optional(),
|
|
3083
3269
|
/**
|
|
3084
3270
|
* Rate limiting
|
|
3085
3271
|
*/
|
|
3086
|
-
rateLimit:
|
|
3087
|
-
enabled:
|
|
3088
|
-
maxRequests:
|
|
3089
|
-
windowMs:
|
|
3090
|
-
strategy:
|
|
3272
|
+
rateLimit: import_zod14.z.object({
|
|
3273
|
+
enabled: import_zod14.z.boolean().default(true),
|
|
3274
|
+
maxRequests: import_zod14.z.number().int(),
|
|
3275
|
+
windowMs: import_zod14.z.number().int().describe("Time window in milliseconds"),
|
|
3276
|
+
strategy: import_zod14.z.enum(["fixed", "sliding", "token-bucket"]).default("sliding")
|
|
3091
3277
|
}).optional(),
|
|
3092
3278
|
/**
|
|
3093
3279
|
* Authentication requirements
|
|
3094
3280
|
*/
|
|
3095
|
-
authentication:
|
|
3096
|
-
required:
|
|
3097
|
-
methods:
|
|
3098
|
-
tokenExpiration:
|
|
3281
|
+
authentication: import_zod14.z.object({
|
|
3282
|
+
required: import_zod14.z.boolean().default(true),
|
|
3283
|
+
methods: import_zod14.z.array(import_zod14.z.enum(["jwt", "oauth2", "api-key", "session", "certificate"])),
|
|
3284
|
+
tokenExpiration: import_zod14.z.number().int().optional().describe("Token expiration in seconds")
|
|
3099
3285
|
}).optional(),
|
|
3100
3286
|
/**
|
|
3101
3287
|
* Encryption requirements
|
|
3102
3288
|
*/
|
|
3103
|
-
encryption:
|
|
3104
|
-
dataAtRest:
|
|
3105
|
-
dataInTransit:
|
|
3106
|
-
algorithm:
|
|
3107
|
-
minKeyLength:
|
|
3289
|
+
encryption: import_zod14.z.object({
|
|
3290
|
+
dataAtRest: import_zod14.z.boolean().default(false).describe("Encrypt data at rest"),
|
|
3291
|
+
dataInTransit: import_zod14.z.boolean().default(true).describe("Enforce HTTPS/TLS"),
|
|
3292
|
+
algorithm: import_zod14.z.string().optional().describe("Encryption algorithm"),
|
|
3293
|
+
minKeyLength: import_zod14.z.number().int().optional().describe("Minimum key length in bits")
|
|
3108
3294
|
}).optional(),
|
|
3109
3295
|
/**
|
|
3110
3296
|
* Audit logging
|
|
3111
3297
|
*/
|
|
3112
|
-
auditLog:
|
|
3113
|
-
enabled:
|
|
3114
|
-
events:
|
|
3115
|
-
retention:
|
|
3298
|
+
auditLog: import_zod14.z.object({
|
|
3299
|
+
enabled: import_zod14.z.boolean().default(true),
|
|
3300
|
+
events: import_zod14.z.array(import_zod14.z.string()).optional().describe("Events to log"),
|
|
3301
|
+
retention: import_zod14.z.number().int().optional().describe("Log retention in days")
|
|
3116
3302
|
}).optional()
|
|
3117
3303
|
});
|
|
3118
|
-
var PluginTrustLevelSchema =
|
|
3304
|
+
var PluginTrustLevelSchema = import_zod14.z.enum([
|
|
3119
3305
|
"verified",
|
|
3120
3306
|
// Official/verified plugin
|
|
3121
3307
|
"trusted",
|
|
@@ -3127,11 +3313,11 @@ var PluginTrustLevelSchema = import_zod12.z.enum([
|
|
|
3127
3313
|
"blocked"
|
|
3128
3314
|
// Blocked/malicious
|
|
3129
3315
|
]).describe("Trust level of the plugin");
|
|
3130
|
-
var PluginSecurityManifestSchema =
|
|
3316
|
+
var PluginSecurityManifestSchema = import_zod14.z.object({
|
|
3131
3317
|
/**
|
|
3132
3318
|
* Plugin identifier
|
|
3133
3319
|
*/
|
|
3134
|
-
pluginId:
|
|
3320
|
+
pluginId: import_zod14.z.string(),
|
|
3135
3321
|
/**
|
|
3136
3322
|
* Trust level
|
|
3137
3323
|
*/
|
|
@@ -3151,54 +3337,54 @@ var PluginSecurityManifestSchema = import_zod12.z.object({
|
|
|
3151
3337
|
/**
|
|
3152
3338
|
* Security scan results
|
|
3153
3339
|
*/
|
|
3154
|
-
scanResults:
|
|
3340
|
+
scanResults: import_zod14.z.array(SecurityScanResultSchema).optional(),
|
|
3155
3341
|
/**
|
|
3156
3342
|
* Known vulnerabilities
|
|
3157
3343
|
*/
|
|
3158
|
-
vulnerabilities:
|
|
3344
|
+
vulnerabilities: import_zod14.z.array(SecurityVulnerabilitySchema).optional(),
|
|
3159
3345
|
/**
|
|
3160
3346
|
* Code signing
|
|
3161
3347
|
*/
|
|
3162
|
-
codeSigning:
|
|
3163
|
-
signed:
|
|
3164
|
-
signature:
|
|
3165
|
-
certificate:
|
|
3166
|
-
algorithm:
|
|
3167
|
-
timestamp:
|
|
3348
|
+
codeSigning: import_zod14.z.object({
|
|
3349
|
+
signed: import_zod14.z.boolean(),
|
|
3350
|
+
signature: import_zod14.z.string().optional(),
|
|
3351
|
+
certificate: import_zod14.z.string().optional(),
|
|
3352
|
+
algorithm: import_zod14.z.string().optional(),
|
|
3353
|
+
timestamp: import_zod14.z.string().datetime().optional()
|
|
3168
3354
|
}).optional(),
|
|
3169
3355
|
/**
|
|
3170
3356
|
* Security certifications
|
|
3171
3357
|
*/
|
|
3172
|
-
certifications:
|
|
3173
|
-
name:
|
|
3174
|
-
issuer:
|
|
3175
|
-
issuedDate:
|
|
3176
|
-
expiryDate:
|
|
3177
|
-
certificateUrl:
|
|
3358
|
+
certifications: import_zod14.z.array(import_zod14.z.object({
|
|
3359
|
+
name: import_zod14.z.string().describe("Certification name (e.g., SOC 2, ISO 27001)"),
|
|
3360
|
+
issuer: import_zod14.z.string(),
|
|
3361
|
+
issuedDate: import_zod14.z.string().datetime(),
|
|
3362
|
+
expiryDate: import_zod14.z.string().datetime().optional(),
|
|
3363
|
+
certificateUrl: import_zod14.z.string().url().optional()
|
|
3178
3364
|
})).optional(),
|
|
3179
3365
|
/**
|
|
3180
3366
|
* Security contact
|
|
3181
3367
|
*/
|
|
3182
|
-
securityContact:
|
|
3183
|
-
email:
|
|
3184
|
-
url:
|
|
3185
|
-
pgpKey:
|
|
3368
|
+
securityContact: import_zod14.z.object({
|
|
3369
|
+
email: import_zod14.z.string().email().optional(),
|
|
3370
|
+
url: import_zod14.z.string().url().optional(),
|
|
3371
|
+
pgpKey: import_zod14.z.string().optional()
|
|
3186
3372
|
}).optional(),
|
|
3187
3373
|
/**
|
|
3188
3374
|
* Vulnerability disclosure policy
|
|
3189
3375
|
*/
|
|
3190
|
-
vulnerabilityDisclosure:
|
|
3191
|
-
policyUrl:
|
|
3192
|
-
responseTime:
|
|
3193
|
-
bugBounty:
|
|
3376
|
+
vulnerabilityDisclosure: import_zod14.z.object({
|
|
3377
|
+
policyUrl: import_zod14.z.string().url().optional(),
|
|
3378
|
+
responseTime: import_zod14.z.number().int().optional().describe("Expected response time in hours"),
|
|
3379
|
+
bugBounty: import_zod14.z.boolean().default(false)
|
|
3194
3380
|
}).optional()
|
|
3195
3381
|
});
|
|
3196
3382
|
|
|
3197
3383
|
// src/kernel/plugin-structure.zod.ts
|
|
3198
|
-
var
|
|
3384
|
+
var import_zod15 = require("zod");
|
|
3199
3385
|
var SNAKE_CASE_REGEX = /^[a-z][a-z0-9_]*$/;
|
|
3200
3386
|
var OPS_FILE_SUFFIX_REGEX = /\.(object|field|trigger|function|view|page|dashboard|flow|app|router|service)\.ts$/;
|
|
3201
|
-
var OpsFilePathSchema =
|
|
3387
|
+
var OpsFilePathSchema = import_zod15.z.string().superRefine((path, ctx) => {
|
|
3202
3388
|
if (!path.startsWith("src/")) {
|
|
3203
3389
|
return;
|
|
3204
3390
|
}
|
|
@@ -3207,7 +3393,7 @@ var OpsFilePathSchema = import_zod13.z.string().superRefine((path, ctx) => {
|
|
|
3207
3393
|
const domainDir = parts[1];
|
|
3208
3394
|
if (!SNAKE_CASE_REGEX.test(domainDir)) {
|
|
3209
3395
|
ctx.addIssue({
|
|
3210
|
-
code:
|
|
3396
|
+
code: import_zod15.z.ZodIssueCode.custom,
|
|
3211
3397
|
message: `Domain directory '${domainDir}' must be lowercase snake_case`
|
|
3212
3398
|
});
|
|
3213
3399
|
}
|
|
@@ -3216,31 +3402,31 @@ var OpsFilePathSchema = import_zod13.z.string().superRefine((path, ctx) => {
|
|
|
3216
3402
|
if (filename === "index.ts" || filename === "main.ts") return;
|
|
3217
3403
|
if (!SNAKE_CASE_REGEX.test(filename.split(".")[0])) {
|
|
3218
3404
|
ctx.addIssue({
|
|
3219
|
-
code:
|
|
3405
|
+
code: import_zod15.z.ZodIssueCode.custom,
|
|
3220
3406
|
message: `Filename '${filename}' base name must be lowercase snake_case`
|
|
3221
3407
|
});
|
|
3222
3408
|
}
|
|
3223
3409
|
if (!OPS_FILE_SUFFIX_REGEX.test(filename)) {
|
|
3224
3410
|
}
|
|
3225
3411
|
});
|
|
3226
|
-
var OpsDomainModuleSchema =
|
|
3227
|
-
name:
|
|
3228
|
-
files:
|
|
3412
|
+
var OpsDomainModuleSchema = import_zod15.z.object({
|
|
3413
|
+
name: import_zod15.z.string().regex(SNAKE_CASE_REGEX),
|
|
3414
|
+
files: import_zod15.z.array(import_zod15.z.string())
|
|
3229
3415
|
}).superRefine((module2, ctx) => {
|
|
3230
3416
|
if (!module2.files.includes("index.ts")) {
|
|
3231
3417
|
ctx.addIssue({
|
|
3232
|
-
code:
|
|
3418
|
+
code: import_zod15.z.ZodIssueCode.custom,
|
|
3233
3419
|
message: `Module '${module2.name}' is missing an 'index.ts' entry point.`
|
|
3234
3420
|
});
|
|
3235
3421
|
}
|
|
3236
3422
|
});
|
|
3237
|
-
var OpsPluginStructureSchema =
|
|
3238
|
-
root:
|
|
3239
|
-
files:
|
|
3423
|
+
var OpsPluginStructureSchema = import_zod15.z.object({
|
|
3424
|
+
root: import_zod15.z.string(),
|
|
3425
|
+
files: import_zod15.z.array(import_zod15.z.string()).describe("List of all file paths relative to root")
|
|
3240
3426
|
}).superRefine((project, ctx) => {
|
|
3241
3427
|
if (!project.files.includes("objectstack.config.ts")) {
|
|
3242
3428
|
ctx.addIssue({
|
|
3243
|
-
code:
|
|
3429
|
+
code: import_zod15.z.ZodIssueCode.custom,
|
|
3244
3430
|
message: "Missing 'objectstack.config.ts' configuration file."
|
|
3245
3431
|
});
|
|
3246
3432
|
}
|
|
@@ -3255,93 +3441,93 @@ var OpsPluginStructureSchema = import_zod13.z.object({
|
|
|
3255
3441
|
});
|
|
3256
3442
|
|
|
3257
3443
|
// src/kernel/plugin-validator.zod.ts
|
|
3258
|
-
var
|
|
3259
|
-
var ValidationErrorSchema =
|
|
3444
|
+
var import_zod16 = require("zod");
|
|
3445
|
+
var ValidationErrorSchema = import_zod16.z.object({
|
|
3260
3446
|
/**
|
|
3261
3447
|
* Field that failed validation
|
|
3262
3448
|
*/
|
|
3263
|
-
field:
|
|
3449
|
+
field: import_zod16.z.string().describe("Field name that failed validation"),
|
|
3264
3450
|
/**
|
|
3265
3451
|
* Human-readable error message
|
|
3266
3452
|
*/
|
|
3267
|
-
message:
|
|
3453
|
+
message: import_zod16.z.string().describe("Human-readable error message"),
|
|
3268
3454
|
/**
|
|
3269
3455
|
* Machine-readable error code (optional)
|
|
3270
3456
|
*/
|
|
3271
|
-
code:
|
|
3457
|
+
code: import_zod16.z.string().optional().describe("Machine-readable error code")
|
|
3272
3458
|
});
|
|
3273
|
-
var ValidationWarningSchema =
|
|
3459
|
+
var ValidationWarningSchema = import_zod16.z.object({
|
|
3274
3460
|
/**
|
|
3275
3461
|
* Field with warning
|
|
3276
3462
|
*/
|
|
3277
|
-
field:
|
|
3463
|
+
field: import_zod16.z.string().describe("Field name with warning"),
|
|
3278
3464
|
/**
|
|
3279
3465
|
* Human-readable warning message
|
|
3280
3466
|
*/
|
|
3281
|
-
message:
|
|
3467
|
+
message: import_zod16.z.string().describe("Human-readable warning message"),
|
|
3282
3468
|
/**
|
|
3283
3469
|
* Machine-readable warning code (optional)
|
|
3284
3470
|
*/
|
|
3285
|
-
code:
|
|
3471
|
+
code: import_zod16.z.string().optional().describe("Machine-readable warning code")
|
|
3286
3472
|
});
|
|
3287
|
-
var ValidationResultSchema =
|
|
3473
|
+
var ValidationResultSchema = import_zod16.z.object({
|
|
3288
3474
|
/**
|
|
3289
3475
|
* Whether validation passed
|
|
3290
3476
|
*/
|
|
3291
|
-
valid:
|
|
3477
|
+
valid: import_zod16.z.boolean().describe("Whether the plugin passed validation"),
|
|
3292
3478
|
/**
|
|
3293
3479
|
* Validation errors (if any)
|
|
3294
3480
|
*/
|
|
3295
|
-
errors:
|
|
3481
|
+
errors: import_zod16.z.array(ValidationErrorSchema).optional().describe("Validation errors"),
|
|
3296
3482
|
/**
|
|
3297
3483
|
* Validation warnings (non-fatal issues)
|
|
3298
3484
|
*/
|
|
3299
|
-
warnings:
|
|
3485
|
+
warnings: import_zod16.z.array(ValidationWarningSchema).optional().describe("Validation warnings")
|
|
3300
3486
|
});
|
|
3301
|
-
var PluginMetadataSchema =
|
|
3487
|
+
var PluginMetadataSchema = import_zod16.z.object({
|
|
3302
3488
|
/**
|
|
3303
3489
|
* Unique plugin identifier (snake_case)
|
|
3304
3490
|
*/
|
|
3305
|
-
name:
|
|
3491
|
+
name: import_zod16.z.string().min(1).describe("Unique plugin identifier"),
|
|
3306
3492
|
/**
|
|
3307
3493
|
* Plugin version (semver)
|
|
3308
3494
|
*/
|
|
3309
|
-
version:
|
|
3495
|
+
version: import_zod16.z.string().regex(/^\d+\.\d+\.\d+$/).optional().describe("Semantic version (e.g., 1.0.0)"),
|
|
3310
3496
|
/**
|
|
3311
3497
|
* Plugin dependencies (array of plugin names)
|
|
3312
3498
|
*/
|
|
3313
|
-
dependencies:
|
|
3499
|
+
dependencies: import_zod16.z.array(import_zod16.z.string()).optional().describe("Array of plugin names this plugin depends on"),
|
|
3314
3500
|
/**
|
|
3315
3501
|
* Plugin signature for cryptographic verification (optional)
|
|
3316
3502
|
*/
|
|
3317
|
-
signature:
|
|
3503
|
+
signature: import_zod16.z.string().optional().describe("Cryptographic signature for plugin verification")
|
|
3318
3504
|
/**
|
|
3319
3505
|
* Additional plugin metadata
|
|
3320
3506
|
*/
|
|
3321
3507
|
}).passthrough().describe("Plugin metadata for validation");
|
|
3322
3508
|
|
|
3323
3509
|
// src/kernel/plugin-versioning.zod.ts
|
|
3324
|
-
var
|
|
3325
|
-
var SemanticVersionSchema =
|
|
3326
|
-
major:
|
|
3327
|
-
minor:
|
|
3328
|
-
patch:
|
|
3329
|
-
preRelease:
|
|
3330
|
-
build:
|
|
3510
|
+
var import_zod17 = require("zod");
|
|
3511
|
+
var SemanticVersionSchema = import_zod17.z.object({
|
|
3512
|
+
major: import_zod17.z.number().int().min(0).describe("Major version (breaking changes)"),
|
|
3513
|
+
minor: import_zod17.z.number().int().min(0).describe("Minor version (backward compatible features)"),
|
|
3514
|
+
patch: import_zod17.z.number().int().min(0).describe("Patch version (backward compatible fixes)"),
|
|
3515
|
+
preRelease: import_zod17.z.string().optional().describe("Pre-release identifier (alpha, beta, rc.1)"),
|
|
3516
|
+
build: import_zod17.z.string().optional().describe("Build metadata")
|
|
3331
3517
|
}).describe("Semantic version number");
|
|
3332
|
-
var VersionConstraintSchema =
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3518
|
+
var VersionConstraintSchema = import_zod17.z.union([
|
|
3519
|
+
import_zod17.z.string().regex(/^[\d.]+$/).describe("Exact version: `1.2.3`"),
|
|
3520
|
+
import_zod17.z.string().regex(/^\^[\d.]+$/).describe("Compatible with: `^1.2.3` (`>=1.2.3 <2.0.0`)"),
|
|
3521
|
+
import_zod17.z.string().regex(/^~[\d.]+$/).describe("Approximately: `~1.2.3` (`>=1.2.3 <1.3.0`)"),
|
|
3522
|
+
import_zod17.z.string().regex(/^>=[\d.]+$/).describe("Greater than or equal: `>=1.2.3`"),
|
|
3523
|
+
import_zod17.z.string().regex(/^>[\d.]+$/).describe("Greater than: `>1.2.3`"),
|
|
3524
|
+
import_zod17.z.string().regex(/^<=[\d.]+$/).describe("Less than or equal: `<=1.2.3`"),
|
|
3525
|
+
import_zod17.z.string().regex(/^<[\d.]+$/).describe("Less than: `<1.2.3`"),
|
|
3526
|
+
import_zod17.z.string().regex(/^[\d.]+ - [\d.]+$/).describe("Range: `1.2.3 - 2.3.4`"),
|
|
3527
|
+
import_zod17.z.literal("*").describe("Any version"),
|
|
3528
|
+
import_zod17.z.literal("latest").describe("Latest stable version")
|
|
3343
3529
|
]);
|
|
3344
|
-
var CompatibilityLevelSchema =
|
|
3530
|
+
var CompatibilityLevelSchema = import_zod17.z.enum([
|
|
3345
3531
|
"fully-compatible",
|
|
3346
3532
|
// 100% compatible, drop-in replacement
|
|
3347
3533
|
"backward-compatible",
|
|
@@ -3353,15 +3539,15 @@ var CompatibilityLevelSchema = import_zod15.z.enum([
|
|
|
3353
3539
|
"incompatible"
|
|
3354
3540
|
// Completely incompatible
|
|
3355
3541
|
]).describe("Compatibility level between versions");
|
|
3356
|
-
var BreakingChangeSchema =
|
|
3542
|
+
var BreakingChangeSchema = import_zod17.z.object({
|
|
3357
3543
|
/**
|
|
3358
3544
|
* Version where the change was introduced
|
|
3359
3545
|
*/
|
|
3360
|
-
introducedIn:
|
|
3546
|
+
introducedIn: import_zod17.z.string().describe("Version that introduced this breaking change"),
|
|
3361
3547
|
/**
|
|
3362
3548
|
* Type of breaking change
|
|
3363
3549
|
*/
|
|
3364
|
-
type:
|
|
3550
|
+
type: import_zod17.z.enum([
|
|
3365
3551
|
"api-removed",
|
|
3366
3552
|
// API removed
|
|
3367
3553
|
"api-renamed",
|
|
@@ -3380,63 +3566,63 @@ var BreakingChangeSchema = import_zod15.z.object({
|
|
|
3380
3566
|
/**
|
|
3381
3567
|
* What was changed
|
|
3382
3568
|
*/
|
|
3383
|
-
description:
|
|
3569
|
+
description: import_zod17.z.string(),
|
|
3384
3570
|
/**
|
|
3385
3571
|
* Migration guide
|
|
3386
3572
|
*/
|
|
3387
|
-
migrationGuide:
|
|
3573
|
+
migrationGuide: import_zod17.z.string().optional().describe("How to migrate from old to new"),
|
|
3388
3574
|
/**
|
|
3389
3575
|
* Deprecated in version
|
|
3390
3576
|
*/
|
|
3391
|
-
deprecatedIn:
|
|
3577
|
+
deprecatedIn: import_zod17.z.string().optional().describe("Version where old API was deprecated"),
|
|
3392
3578
|
/**
|
|
3393
3579
|
* Will be removed in version
|
|
3394
3580
|
*/
|
|
3395
|
-
removedIn:
|
|
3581
|
+
removedIn: import_zod17.z.string().optional().describe("Version where old API will be removed"),
|
|
3396
3582
|
/**
|
|
3397
3583
|
* Automated migration available
|
|
3398
3584
|
*/
|
|
3399
|
-
automatedMigration:
|
|
3585
|
+
automatedMigration: import_zod17.z.boolean().default(false).describe("Whether automated migration tool is available"),
|
|
3400
3586
|
/**
|
|
3401
3587
|
* Impact severity
|
|
3402
3588
|
*/
|
|
3403
|
-
severity:
|
|
3589
|
+
severity: import_zod17.z.enum(["critical", "major", "minor"]).describe("Impact severity")
|
|
3404
3590
|
});
|
|
3405
|
-
var DeprecationNoticeSchema =
|
|
3591
|
+
var DeprecationNoticeSchema = import_zod17.z.object({
|
|
3406
3592
|
/**
|
|
3407
3593
|
* Feature or API being deprecated
|
|
3408
3594
|
*/
|
|
3409
|
-
feature:
|
|
3595
|
+
feature: import_zod17.z.string().describe("Deprecated feature identifier"),
|
|
3410
3596
|
/**
|
|
3411
3597
|
* Version when deprecated
|
|
3412
3598
|
*/
|
|
3413
|
-
deprecatedIn:
|
|
3599
|
+
deprecatedIn: import_zod17.z.string(),
|
|
3414
3600
|
/**
|
|
3415
3601
|
* Planned removal version
|
|
3416
3602
|
*/
|
|
3417
|
-
removeIn:
|
|
3603
|
+
removeIn: import_zod17.z.string().optional(),
|
|
3418
3604
|
/**
|
|
3419
3605
|
* Reason for deprecation
|
|
3420
3606
|
*/
|
|
3421
|
-
reason:
|
|
3607
|
+
reason: import_zod17.z.string(),
|
|
3422
3608
|
/**
|
|
3423
3609
|
* Recommended alternative
|
|
3424
3610
|
*/
|
|
3425
|
-
alternative:
|
|
3611
|
+
alternative: import_zod17.z.string().optional().describe("What to use instead"),
|
|
3426
3612
|
/**
|
|
3427
3613
|
* Migration path
|
|
3428
3614
|
*/
|
|
3429
|
-
migrationPath:
|
|
3615
|
+
migrationPath: import_zod17.z.string().optional().describe("How to migrate to alternative")
|
|
3430
3616
|
});
|
|
3431
|
-
var CompatibilityMatrixEntrySchema =
|
|
3617
|
+
var CompatibilityMatrixEntrySchema = import_zod17.z.object({
|
|
3432
3618
|
/**
|
|
3433
3619
|
* Source version
|
|
3434
3620
|
*/
|
|
3435
|
-
from:
|
|
3621
|
+
from: import_zod17.z.string().describe("Version being upgraded from"),
|
|
3436
3622
|
/**
|
|
3437
3623
|
* Target version
|
|
3438
3624
|
*/
|
|
3439
|
-
to:
|
|
3625
|
+
to: import_zod17.z.string().describe("Version being upgraded to"),
|
|
3440
3626
|
/**
|
|
3441
3627
|
* Compatibility level
|
|
3442
3628
|
*/
|
|
@@ -3444,60 +3630,60 @@ var CompatibilityMatrixEntrySchema = import_zod15.z.object({
|
|
|
3444
3630
|
/**
|
|
3445
3631
|
* Breaking changes list
|
|
3446
3632
|
*/
|
|
3447
|
-
breakingChanges:
|
|
3633
|
+
breakingChanges: import_zod17.z.array(BreakingChangeSchema).optional(),
|
|
3448
3634
|
/**
|
|
3449
3635
|
* Migration required
|
|
3450
3636
|
*/
|
|
3451
|
-
migrationRequired:
|
|
3637
|
+
migrationRequired: import_zod17.z.boolean().default(false),
|
|
3452
3638
|
/**
|
|
3453
3639
|
* Migration complexity
|
|
3454
3640
|
*/
|
|
3455
|
-
migrationComplexity:
|
|
3641
|
+
migrationComplexity: import_zod17.z.enum(["trivial", "simple", "moderate", "complex", "major"]).optional(),
|
|
3456
3642
|
/**
|
|
3457
3643
|
* Estimated migration time in hours
|
|
3458
3644
|
*/
|
|
3459
|
-
estimatedMigrationTime:
|
|
3645
|
+
estimatedMigrationTime: import_zod17.z.number().optional(),
|
|
3460
3646
|
/**
|
|
3461
3647
|
* Migration script available
|
|
3462
3648
|
*/
|
|
3463
|
-
migrationScript:
|
|
3649
|
+
migrationScript: import_zod17.z.string().optional().describe("Path to migration script"),
|
|
3464
3650
|
/**
|
|
3465
3651
|
* Test coverage for migration
|
|
3466
3652
|
*/
|
|
3467
|
-
testCoverage:
|
|
3653
|
+
testCoverage: import_zod17.z.number().min(0).max(100).optional().describe("Percentage of migration covered by tests")
|
|
3468
3654
|
});
|
|
3469
|
-
var PluginCompatibilityMatrixSchema =
|
|
3655
|
+
var PluginCompatibilityMatrixSchema = import_zod17.z.object({
|
|
3470
3656
|
/**
|
|
3471
3657
|
* Plugin identifier
|
|
3472
3658
|
*/
|
|
3473
|
-
pluginId:
|
|
3659
|
+
pluginId: import_zod17.z.string(),
|
|
3474
3660
|
/**
|
|
3475
3661
|
* Current version
|
|
3476
3662
|
*/
|
|
3477
|
-
currentVersion:
|
|
3663
|
+
currentVersion: import_zod17.z.string(),
|
|
3478
3664
|
/**
|
|
3479
3665
|
* Compatibility entries
|
|
3480
3666
|
*/
|
|
3481
|
-
compatibilityMatrix:
|
|
3667
|
+
compatibilityMatrix: import_zod17.z.array(CompatibilityMatrixEntrySchema),
|
|
3482
3668
|
/**
|
|
3483
3669
|
* Supported versions
|
|
3484
3670
|
*/
|
|
3485
|
-
supportedVersions:
|
|
3486
|
-
version:
|
|
3487
|
-
supported:
|
|
3488
|
-
endOfLife:
|
|
3489
|
-
securitySupport:
|
|
3671
|
+
supportedVersions: import_zod17.z.array(import_zod17.z.object({
|
|
3672
|
+
version: import_zod17.z.string(),
|
|
3673
|
+
supported: import_zod17.z.boolean(),
|
|
3674
|
+
endOfLife: import_zod17.z.string().datetime().optional().describe("End of support date"),
|
|
3675
|
+
securitySupport: import_zod17.z.boolean().default(false).describe("Still receives security updates")
|
|
3490
3676
|
})),
|
|
3491
3677
|
/**
|
|
3492
3678
|
* Minimum compatible version
|
|
3493
3679
|
*/
|
|
3494
|
-
minimumCompatibleVersion:
|
|
3680
|
+
minimumCompatibleVersion: import_zod17.z.string().optional().describe("Oldest version that can be directly upgraded")
|
|
3495
3681
|
});
|
|
3496
|
-
var DependencyConflictSchema =
|
|
3682
|
+
var DependencyConflictSchema = import_zod17.z.object({
|
|
3497
3683
|
/**
|
|
3498
3684
|
* Type of conflict
|
|
3499
3685
|
*/
|
|
3500
|
-
type:
|
|
3686
|
+
type: import_zod17.z.enum([
|
|
3501
3687
|
"version-mismatch",
|
|
3502
3688
|
// Different versions required
|
|
3503
3689
|
"missing-dependency",
|
|
@@ -3512,20 +3698,20 @@ var DependencyConflictSchema = import_zod15.z.object({
|
|
|
3512
3698
|
/**
|
|
3513
3699
|
* Plugins involved in conflict
|
|
3514
3700
|
*/
|
|
3515
|
-
plugins:
|
|
3516
|
-
pluginId:
|
|
3517
|
-
version:
|
|
3518
|
-
requirement:
|
|
3701
|
+
plugins: import_zod17.z.array(import_zod17.z.object({
|
|
3702
|
+
pluginId: import_zod17.z.string(),
|
|
3703
|
+
version: import_zod17.z.string(),
|
|
3704
|
+
requirement: import_zod17.z.string().optional().describe("What this plugin requires")
|
|
3519
3705
|
})),
|
|
3520
3706
|
/**
|
|
3521
3707
|
* Conflict description
|
|
3522
3708
|
*/
|
|
3523
|
-
description:
|
|
3709
|
+
description: import_zod17.z.string(),
|
|
3524
3710
|
/**
|
|
3525
3711
|
* Possible resolutions
|
|
3526
3712
|
*/
|
|
3527
|
-
resolutions:
|
|
3528
|
-
strategy:
|
|
3713
|
+
resolutions: import_zod17.z.array(import_zod17.z.object({
|
|
3714
|
+
strategy: import_zod17.z.enum([
|
|
3529
3715
|
"upgrade",
|
|
3530
3716
|
// Upgrade one or more plugins
|
|
3531
3717
|
"downgrade",
|
|
@@ -3537,58 +3723,58 @@ var DependencyConflictSchema = import_zod15.z.object({
|
|
|
3537
3723
|
"manual"
|
|
3538
3724
|
// Manual intervention required
|
|
3539
3725
|
]),
|
|
3540
|
-
description:
|
|
3541
|
-
automaticResolution:
|
|
3542
|
-
riskLevel:
|
|
3726
|
+
description: import_zod17.z.string(),
|
|
3727
|
+
automaticResolution: import_zod17.z.boolean().default(false),
|
|
3728
|
+
riskLevel: import_zod17.z.enum(["low", "medium", "high"])
|
|
3543
3729
|
})).optional(),
|
|
3544
3730
|
/**
|
|
3545
3731
|
* Severity of conflict
|
|
3546
3732
|
*/
|
|
3547
|
-
severity:
|
|
3733
|
+
severity: import_zod17.z.enum(["critical", "error", "warning", "info"])
|
|
3548
3734
|
});
|
|
3549
|
-
var DependencyResolutionResultSchema =
|
|
3735
|
+
var DependencyResolutionResultSchema = import_zod17.z.object({
|
|
3550
3736
|
/**
|
|
3551
3737
|
* Resolution successful
|
|
3552
3738
|
*/
|
|
3553
|
-
success:
|
|
3739
|
+
success: import_zod17.z.boolean(),
|
|
3554
3740
|
/**
|
|
3555
3741
|
* Resolved plugin versions
|
|
3556
3742
|
*/
|
|
3557
|
-
resolved:
|
|
3558
|
-
pluginId:
|
|
3559
|
-
version:
|
|
3560
|
-
resolvedVersion:
|
|
3743
|
+
resolved: import_zod17.z.array(import_zod17.z.object({
|
|
3744
|
+
pluginId: import_zod17.z.string(),
|
|
3745
|
+
version: import_zod17.z.string(),
|
|
3746
|
+
resolvedVersion: import_zod17.z.string()
|
|
3561
3747
|
})).optional(),
|
|
3562
3748
|
/**
|
|
3563
3749
|
* Conflicts found
|
|
3564
3750
|
*/
|
|
3565
|
-
conflicts:
|
|
3751
|
+
conflicts: import_zod17.z.array(DependencyConflictSchema).optional(),
|
|
3566
3752
|
/**
|
|
3567
3753
|
* Warnings
|
|
3568
3754
|
*/
|
|
3569
|
-
warnings:
|
|
3755
|
+
warnings: import_zod17.z.array(import_zod17.z.string()).optional(),
|
|
3570
3756
|
/**
|
|
3571
3757
|
* Installation order (topologically sorted)
|
|
3572
3758
|
*/
|
|
3573
|
-
installationOrder:
|
|
3759
|
+
installationOrder: import_zod17.z.array(import_zod17.z.string()).optional().describe("Plugin IDs in order they should be installed"),
|
|
3574
3760
|
/**
|
|
3575
3761
|
* Dependency graph
|
|
3576
3762
|
*/
|
|
3577
|
-
dependencyGraph:
|
|
3763
|
+
dependencyGraph: import_zod17.z.record(import_zod17.z.string(), import_zod17.z.array(import_zod17.z.string())).optional().describe("Map of plugin ID to its dependencies")
|
|
3578
3764
|
});
|
|
3579
|
-
var MultiVersionSupportSchema =
|
|
3765
|
+
var MultiVersionSupportSchema = import_zod17.z.object({
|
|
3580
3766
|
/**
|
|
3581
3767
|
* Enable multi-version support
|
|
3582
3768
|
*/
|
|
3583
|
-
enabled:
|
|
3769
|
+
enabled: import_zod17.z.boolean().default(false),
|
|
3584
3770
|
/**
|
|
3585
3771
|
* Maximum concurrent versions
|
|
3586
3772
|
*/
|
|
3587
|
-
maxConcurrentVersions:
|
|
3773
|
+
maxConcurrentVersions: import_zod17.z.number().int().min(1).default(2).describe("How many versions can run at the same time"),
|
|
3588
3774
|
/**
|
|
3589
3775
|
* Version selection strategy
|
|
3590
3776
|
*/
|
|
3591
|
-
selectionStrategy:
|
|
3777
|
+
selectionStrategy: import_zod17.z.enum([
|
|
3592
3778
|
"latest",
|
|
3593
3779
|
// Always use latest version
|
|
3594
3780
|
"stable",
|
|
@@ -3605,26 +3791,26 @@ var MultiVersionSupportSchema = import_zod15.z.object({
|
|
|
3605
3791
|
/**
|
|
3606
3792
|
* Version routing rules
|
|
3607
3793
|
*/
|
|
3608
|
-
routing:
|
|
3609
|
-
condition:
|
|
3610
|
-
version:
|
|
3611
|
-
priority:
|
|
3794
|
+
routing: import_zod17.z.array(import_zod17.z.object({
|
|
3795
|
+
condition: import_zod17.z.string().describe("Routing condition (e.g., tenant, user, feature flag)"),
|
|
3796
|
+
version: import_zod17.z.string().describe("Version to use when condition matches"),
|
|
3797
|
+
priority: import_zod17.z.number().int().default(100).describe("Rule priority")
|
|
3612
3798
|
})).optional(),
|
|
3613
3799
|
/**
|
|
3614
3800
|
* Gradual rollout configuration
|
|
3615
3801
|
*/
|
|
3616
|
-
rollout:
|
|
3617
|
-
enabled:
|
|
3618
|
-
strategy:
|
|
3619
|
-
percentage:
|
|
3620
|
-
duration:
|
|
3802
|
+
rollout: import_zod17.z.object({
|
|
3803
|
+
enabled: import_zod17.z.boolean().default(false),
|
|
3804
|
+
strategy: import_zod17.z.enum(["percentage", "blue-green", "canary"]),
|
|
3805
|
+
percentage: import_zod17.z.number().min(0).max(100).optional().describe("Percentage of traffic to new version"),
|
|
3806
|
+
duration: import_zod17.z.number().int().optional().describe("Rollout duration in milliseconds")
|
|
3621
3807
|
}).optional()
|
|
3622
3808
|
});
|
|
3623
|
-
var PluginVersionMetadataSchema =
|
|
3809
|
+
var PluginVersionMetadataSchema = import_zod17.z.object({
|
|
3624
3810
|
/**
|
|
3625
3811
|
* Plugin identifier
|
|
3626
3812
|
*/
|
|
3627
|
-
pluginId:
|
|
3813
|
+
pluginId: import_zod17.z.string(),
|
|
3628
3814
|
/**
|
|
3629
3815
|
* Version number
|
|
3630
3816
|
*/
|
|
@@ -3632,57 +3818,57 @@ var PluginVersionMetadataSchema = import_zod15.z.object({
|
|
|
3632
3818
|
/**
|
|
3633
3819
|
* Version string (computed)
|
|
3634
3820
|
*/
|
|
3635
|
-
versionString:
|
|
3821
|
+
versionString: import_zod17.z.string().describe("Full version string (e.g., 1.2.3-beta.1+build.123)"),
|
|
3636
3822
|
/**
|
|
3637
3823
|
* Release date
|
|
3638
3824
|
*/
|
|
3639
|
-
releaseDate:
|
|
3825
|
+
releaseDate: import_zod17.z.string().datetime(),
|
|
3640
3826
|
/**
|
|
3641
3827
|
* Release notes
|
|
3642
3828
|
*/
|
|
3643
|
-
releaseNotes:
|
|
3829
|
+
releaseNotes: import_zod17.z.string().optional(),
|
|
3644
3830
|
/**
|
|
3645
3831
|
* Breaking changes
|
|
3646
3832
|
*/
|
|
3647
|
-
breakingChanges:
|
|
3833
|
+
breakingChanges: import_zod17.z.array(BreakingChangeSchema).optional(),
|
|
3648
3834
|
/**
|
|
3649
3835
|
* Deprecations
|
|
3650
3836
|
*/
|
|
3651
|
-
deprecations:
|
|
3837
|
+
deprecations: import_zod17.z.array(DeprecationNoticeSchema).optional(),
|
|
3652
3838
|
/**
|
|
3653
3839
|
* Compatibility matrix
|
|
3654
3840
|
*/
|
|
3655
|
-
compatibilityMatrix:
|
|
3841
|
+
compatibilityMatrix: import_zod17.z.array(CompatibilityMatrixEntrySchema).optional(),
|
|
3656
3842
|
/**
|
|
3657
3843
|
* Security vulnerabilities fixed
|
|
3658
3844
|
*/
|
|
3659
|
-
securityFixes:
|
|
3660
|
-
cve:
|
|
3661
|
-
severity:
|
|
3662
|
-
description:
|
|
3663
|
-
fixedIn:
|
|
3845
|
+
securityFixes: import_zod17.z.array(import_zod17.z.object({
|
|
3846
|
+
cve: import_zod17.z.string().optional().describe("CVE identifier"),
|
|
3847
|
+
severity: import_zod17.z.enum(["critical", "high", "medium", "low"]),
|
|
3848
|
+
description: import_zod17.z.string(),
|
|
3849
|
+
fixedIn: import_zod17.z.string().describe("Version where vulnerability was fixed")
|
|
3664
3850
|
})).optional(),
|
|
3665
3851
|
/**
|
|
3666
3852
|
* Download statistics
|
|
3667
3853
|
*/
|
|
3668
|
-
statistics:
|
|
3669
|
-
downloads:
|
|
3670
|
-
installations:
|
|
3671
|
-
ratings:
|
|
3854
|
+
statistics: import_zod17.z.object({
|
|
3855
|
+
downloads: import_zod17.z.number().int().min(0).optional(),
|
|
3856
|
+
installations: import_zod17.z.number().int().min(0).optional(),
|
|
3857
|
+
ratings: import_zod17.z.number().min(0).max(5).optional()
|
|
3672
3858
|
}).optional(),
|
|
3673
3859
|
/**
|
|
3674
3860
|
* Support status
|
|
3675
3861
|
*/
|
|
3676
|
-
support:
|
|
3677
|
-
status:
|
|
3678
|
-
endOfLife:
|
|
3679
|
-
securitySupport:
|
|
3862
|
+
support: import_zod17.z.object({
|
|
3863
|
+
status: import_zod17.z.enum(["active", "maintenance", "deprecated", "eol"]),
|
|
3864
|
+
endOfLife: import_zod17.z.string().datetime().optional(),
|
|
3865
|
+
securitySupport: import_zod17.z.boolean().default(true)
|
|
3680
3866
|
})
|
|
3681
3867
|
});
|
|
3682
3868
|
|
|
3683
3869
|
// src/kernel/service-registry.zod.ts
|
|
3684
|
-
var
|
|
3685
|
-
var ServiceScopeType =
|
|
3870
|
+
var import_zod18 = require("zod");
|
|
3871
|
+
var ServiceScopeType = import_zod18.z.enum([
|
|
3686
3872
|
"singleton",
|
|
3687
3873
|
// Single instance shared across the application
|
|
3688
3874
|
"transient",
|
|
@@ -3690,11 +3876,11 @@ var ServiceScopeType = import_zod16.z.enum([
|
|
|
3690
3876
|
"scoped"
|
|
3691
3877
|
// Instance per scope (request, session, transaction, etc.)
|
|
3692
3878
|
]).describe("Service scope type");
|
|
3693
|
-
var ServiceMetadataSchema =
|
|
3879
|
+
var ServiceMetadataSchema = import_zod18.z.object({
|
|
3694
3880
|
/**
|
|
3695
3881
|
* Service name (unique identifier)
|
|
3696
3882
|
*/
|
|
3697
|
-
name:
|
|
3883
|
+
name: import_zod18.z.string().min(1).describe("Unique service name identifier"),
|
|
3698
3884
|
/**
|
|
3699
3885
|
* Service scope type
|
|
3700
3886
|
*/
|
|
@@ -3702,47 +3888,47 @@ var ServiceMetadataSchema = import_zod16.z.object({
|
|
|
3702
3888
|
/**
|
|
3703
3889
|
* Service type or interface name (optional)
|
|
3704
3890
|
*/
|
|
3705
|
-
type:
|
|
3891
|
+
type: import_zod18.z.string().optional().describe("Service type or interface name"),
|
|
3706
3892
|
/**
|
|
3707
3893
|
* Registration timestamp (Unix milliseconds)
|
|
3708
3894
|
*/
|
|
3709
|
-
registeredAt:
|
|
3895
|
+
registeredAt: import_zod18.z.number().int().optional().describe("Unix timestamp in milliseconds when service was registered"),
|
|
3710
3896
|
/**
|
|
3711
3897
|
* Additional metadata
|
|
3712
3898
|
*/
|
|
3713
|
-
metadata:
|
|
3899
|
+
metadata: import_zod18.z.record(import_zod18.z.string(), import_zod18.z.any()).optional().describe("Additional service-specific metadata")
|
|
3714
3900
|
});
|
|
3715
|
-
var ServiceRegistryConfigSchema =
|
|
3901
|
+
var ServiceRegistryConfigSchema = import_zod18.z.object({
|
|
3716
3902
|
/**
|
|
3717
3903
|
* Strict mode: throw errors on invalid operations
|
|
3718
3904
|
* @default true
|
|
3719
3905
|
*/
|
|
3720
|
-
strictMode:
|
|
3906
|
+
strictMode: import_zod18.z.boolean().optional().default(true).describe("Throw errors on invalid operations (duplicate registration, service not found, etc.)"),
|
|
3721
3907
|
/**
|
|
3722
3908
|
* Allow overwriting existing services
|
|
3723
3909
|
* @default false
|
|
3724
3910
|
*/
|
|
3725
|
-
allowOverwrite:
|
|
3911
|
+
allowOverwrite: import_zod18.z.boolean().optional().default(false).describe("Allow overwriting existing service registrations"),
|
|
3726
3912
|
/**
|
|
3727
3913
|
* Enable logging for service operations
|
|
3728
3914
|
* @default false
|
|
3729
3915
|
*/
|
|
3730
|
-
enableLogging:
|
|
3916
|
+
enableLogging: import_zod18.z.boolean().optional().default(false).describe("Enable logging for service registration and retrieval"),
|
|
3731
3917
|
/**
|
|
3732
3918
|
* Custom scope types (beyond singleton, transient, scoped)
|
|
3733
3919
|
* @default ['singleton', 'transient', 'scoped']
|
|
3734
3920
|
*/
|
|
3735
|
-
scopeTypes:
|
|
3921
|
+
scopeTypes: import_zod18.z.array(import_zod18.z.string()).optional().describe("Supported scope types"),
|
|
3736
3922
|
/**
|
|
3737
3923
|
* Maximum number of services (prevent memory leaks)
|
|
3738
3924
|
*/
|
|
3739
|
-
maxServices:
|
|
3925
|
+
maxServices: import_zod18.z.number().int().min(1).optional().describe("Maximum number of services that can be registered")
|
|
3740
3926
|
});
|
|
3741
|
-
var ServiceFactoryRegistrationSchema =
|
|
3927
|
+
var ServiceFactoryRegistrationSchema = import_zod18.z.object({
|
|
3742
3928
|
/**
|
|
3743
3929
|
* Service name (unique identifier)
|
|
3744
3930
|
*/
|
|
3745
|
-
name:
|
|
3931
|
+
name: import_zod18.z.string().min(1).describe("Unique service name identifier"),
|
|
3746
3932
|
/**
|
|
3747
3933
|
* Service scope type
|
|
3748
3934
|
*/
|
|
@@ -3750,137 +3936,137 @@ var ServiceFactoryRegistrationSchema = import_zod16.z.object({
|
|
|
3750
3936
|
/**
|
|
3751
3937
|
* Factory type (sync or async)
|
|
3752
3938
|
*/
|
|
3753
|
-
factoryType:
|
|
3939
|
+
factoryType: import_zod18.z.enum(["sync", "async"]).optional().default("sync").describe("Whether factory is synchronous or asynchronous"),
|
|
3754
3940
|
/**
|
|
3755
3941
|
* Whether this is a singleton (cache factory result)
|
|
3756
3942
|
*/
|
|
3757
|
-
singleton:
|
|
3943
|
+
singleton: import_zod18.z.boolean().optional().default(true).describe("Whether to cache the factory result (singleton pattern)")
|
|
3758
3944
|
});
|
|
3759
|
-
var ScopeConfigSchema =
|
|
3945
|
+
var ScopeConfigSchema = import_zod18.z.object({
|
|
3760
3946
|
/**
|
|
3761
3947
|
* Type of scope (request, session, transaction, etc.)
|
|
3762
3948
|
*/
|
|
3763
|
-
scopeType:
|
|
3949
|
+
scopeType: import_zod18.z.string().describe("Type of scope"),
|
|
3764
3950
|
/**
|
|
3765
3951
|
* Scope identifier (optional, auto-generated if not provided)
|
|
3766
3952
|
*/
|
|
3767
|
-
scopeId:
|
|
3953
|
+
scopeId: import_zod18.z.string().optional().describe("Unique scope identifier"),
|
|
3768
3954
|
/**
|
|
3769
3955
|
* Scope metadata (context information)
|
|
3770
3956
|
*/
|
|
3771
|
-
metadata:
|
|
3957
|
+
metadata: import_zod18.z.record(import_zod18.z.string(), import_zod18.z.any()).optional().describe("Scope-specific context metadata")
|
|
3772
3958
|
});
|
|
3773
|
-
var ScopeInfoSchema =
|
|
3959
|
+
var ScopeInfoSchema = import_zod18.z.object({
|
|
3774
3960
|
/**
|
|
3775
3961
|
* Scope identifier
|
|
3776
3962
|
*/
|
|
3777
|
-
scopeId:
|
|
3963
|
+
scopeId: import_zod18.z.string().describe("Unique scope identifier"),
|
|
3778
3964
|
/**
|
|
3779
3965
|
* Type of scope
|
|
3780
3966
|
*/
|
|
3781
|
-
scopeType:
|
|
3967
|
+
scopeType: import_zod18.z.string().describe("Type of scope"),
|
|
3782
3968
|
/**
|
|
3783
3969
|
* Creation timestamp (Unix milliseconds)
|
|
3784
3970
|
*/
|
|
3785
|
-
createdAt:
|
|
3971
|
+
createdAt: import_zod18.z.number().int().describe("Unix timestamp in milliseconds when scope was created"),
|
|
3786
3972
|
/**
|
|
3787
3973
|
* Number of services in this scope
|
|
3788
3974
|
*/
|
|
3789
|
-
serviceCount:
|
|
3975
|
+
serviceCount: import_zod18.z.number().int().min(0).optional().describe("Number of services registered in this scope"),
|
|
3790
3976
|
/**
|
|
3791
3977
|
* Scope metadata
|
|
3792
3978
|
*/
|
|
3793
|
-
metadata:
|
|
3979
|
+
metadata: import_zod18.z.record(import_zod18.z.string(), import_zod18.z.any()).optional().describe("Scope-specific context metadata")
|
|
3794
3980
|
});
|
|
3795
3981
|
|
|
3796
3982
|
// src/kernel/startup-orchestrator.zod.ts
|
|
3797
|
-
var
|
|
3798
|
-
var StartupOptionsSchema =
|
|
3983
|
+
var import_zod19 = require("zod");
|
|
3984
|
+
var StartupOptionsSchema = import_zod19.z.object({
|
|
3799
3985
|
/**
|
|
3800
3986
|
* Maximum time (ms) to wait for each plugin to start
|
|
3801
3987
|
* @default 30000 (30 seconds)
|
|
3802
3988
|
*/
|
|
3803
|
-
timeout:
|
|
3989
|
+
timeout: import_zod19.z.number().int().min(0).optional().default(3e4).describe("Maximum time in milliseconds to wait for each plugin to start"),
|
|
3804
3990
|
/**
|
|
3805
3991
|
* Whether to rollback (destroy) already-started plugins on failure
|
|
3806
3992
|
* @default true
|
|
3807
3993
|
*/
|
|
3808
|
-
rollbackOnFailure:
|
|
3994
|
+
rollbackOnFailure: import_zod19.z.boolean().optional().default(true).describe("Whether to rollback already-started plugins if any plugin fails"),
|
|
3809
3995
|
/**
|
|
3810
3996
|
* Whether to run health checks after startup
|
|
3811
3997
|
* @default false
|
|
3812
3998
|
*/
|
|
3813
|
-
healthCheck:
|
|
3999
|
+
healthCheck: import_zod19.z.boolean().optional().default(false).describe("Whether to run health checks after plugin startup"),
|
|
3814
4000
|
/**
|
|
3815
4001
|
* Whether to run plugins in parallel (if dependencies allow)
|
|
3816
4002
|
* @default false (sequential startup)
|
|
3817
4003
|
*/
|
|
3818
|
-
parallel:
|
|
4004
|
+
parallel: import_zod19.z.boolean().optional().default(false).describe("Whether to start plugins in parallel when dependencies allow"),
|
|
3819
4005
|
/**
|
|
3820
4006
|
* Custom context to pass to plugin lifecycle methods
|
|
3821
4007
|
*/
|
|
3822
|
-
context:
|
|
4008
|
+
context: import_zod19.z.any().optional().describe("Custom context object to pass to plugin lifecycle methods")
|
|
3823
4009
|
});
|
|
3824
|
-
var HealthStatusSchema =
|
|
4010
|
+
var HealthStatusSchema = import_zod19.z.object({
|
|
3825
4011
|
/**
|
|
3826
4012
|
* Whether the plugin is healthy
|
|
3827
4013
|
*/
|
|
3828
|
-
healthy:
|
|
4014
|
+
healthy: import_zod19.z.boolean().describe("Whether the plugin is healthy"),
|
|
3829
4015
|
/**
|
|
3830
4016
|
* Health check timestamp (Unix milliseconds)
|
|
3831
4017
|
*/
|
|
3832
|
-
timestamp:
|
|
4018
|
+
timestamp: import_zod19.z.number().int().describe("Unix timestamp in milliseconds when health check was performed"),
|
|
3833
4019
|
/**
|
|
3834
4020
|
* Optional health details (plugin-specific)
|
|
3835
4021
|
*/
|
|
3836
|
-
details:
|
|
4022
|
+
details: import_zod19.z.record(import_zod19.z.string(), import_zod19.z.any()).optional().describe("Optional plugin-specific health details"),
|
|
3837
4023
|
/**
|
|
3838
4024
|
* Optional error message if unhealthy
|
|
3839
4025
|
*/
|
|
3840
|
-
message:
|
|
4026
|
+
message: import_zod19.z.string().optional().describe("Error message if plugin is unhealthy")
|
|
3841
4027
|
});
|
|
3842
|
-
var PluginStartupResultSchema =
|
|
4028
|
+
var PluginStartupResultSchema = import_zod19.z.object({
|
|
3843
4029
|
/**
|
|
3844
4030
|
* Plugin that was started
|
|
3845
4031
|
*/
|
|
3846
|
-
plugin:
|
|
3847
|
-
name:
|
|
3848
|
-
version:
|
|
4032
|
+
plugin: import_zod19.z.object({
|
|
4033
|
+
name: import_zod19.z.string(),
|
|
4034
|
+
version: import_zod19.z.string().optional()
|
|
3849
4035
|
}).passthrough().describe("Plugin metadata"),
|
|
3850
4036
|
/**
|
|
3851
4037
|
* Whether startup was successful
|
|
3852
4038
|
*/
|
|
3853
|
-
success:
|
|
4039
|
+
success: import_zod19.z.boolean().describe("Whether the plugin started successfully"),
|
|
3854
4040
|
/**
|
|
3855
4041
|
* Time taken to start (milliseconds)
|
|
3856
4042
|
*/
|
|
3857
|
-
duration:
|
|
4043
|
+
duration: import_zod19.z.number().min(0).describe("Time taken to start the plugin in milliseconds"),
|
|
3858
4044
|
/**
|
|
3859
4045
|
* Error if startup failed
|
|
3860
4046
|
*/
|
|
3861
|
-
error:
|
|
4047
|
+
error: import_zod19.z.instanceof(Error).optional().describe("Error object if startup failed"),
|
|
3862
4048
|
/**
|
|
3863
4049
|
* Health status after startup (if healthCheck enabled)
|
|
3864
4050
|
*/
|
|
3865
4051
|
health: HealthStatusSchema.optional().describe("Health status after startup if health check was enabled")
|
|
3866
4052
|
});
|
|
3867
|
-
var StartupOrchestrationResultSchema =
|
|
4053
|
+
var StartupOrchestrationResultSchema = import_zod19.z.object({
|
|
3868
4054
|
/**
|
|
3869
4055
|
* Individual plugin startup results
|
|
3870
4056
|
*/
|
|
3871
|
-
results:
|
|
4057
|
+
results: import_zod19.z.array(PluginStartupResultSchema).describe("Startup results for each plugin"),
|
|
3872
4058
|
/**
|
|
3873
4059
|
* Total time taken for all plugins (milliseconds)
|
|
3874
4060
|
*/
|
|
3875
|
-
totalDuration:
|
|
4061
|
+
totalDuration: import_zod19.z.number().min(0).describe("Total time taken for all plugins in milliseconds"),
|
|
3876
4062
|
/**
|
|
3877
4063
|
* Whether all plugins started successfully
|
|
3878
4064
|
*/
|
|
3879
|
-
allSuccessful:
|
|
4065
|
+
allSuccessful: import_zod19.z.boolean().describe("Whether all plugins started successfully"),
|
|
3880
4066
|
/**
|
|
3881
4067
|
* Plugins that were rolled back (if rollbackOnFailure was enabled)
|
|
3882
4068
|
*/
|
|
3883
|
-
rolledBack:
|
|
4069
|
+
rolledBack: import_zod19.z.array(import_zod19.z.string()).optional().describe("Names of plugins that were rolled back")
|
|
3884
4070
|
});
|
|
3885
4071
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3886
4072
|
0 && (module.exports = {
|
|
@@ -3894,8 +4080,12 @@ var StartupOrchestrationResultSchema = import_zod17.z.object({
|
|
|
3894
4080
|
DependencyConflictSchema,
|
|
3895
4081
|
DependencyResolutionResultSchema,
|
|
3896
4082
|
DeprecationNoticeSchema,
|
|
4083
|
+
DisablePackageRequestSchema,
|
|
4084
|
+
DisablePackageResponseSchema,
|
|
3897
4085
|
DistributedStateConfigSchema,
|
|
3898
4086
|
EVENT_PRIORITY_VALUES,
|
|
4087
|
+
EnablePackageRequestSchema,
|
|
4088
|
+
EnablePackageResponseSchema,
|
|
3899
4089
|
EventBusConfigSchema,
|
|
3900
4090
|
EventHandlerSchema,
|
|
3901
4091
|
EventLogEntrySchema,
|
|
@@ -3915,15 +4105,22 @@ var StartupOrchestrationResultSchema = import_zod17.z.object({
|
|
|
3915
4105
|
FeatureFlag,
|
|
3916
4106
|
FeatureFlagSchema,
|
|
3917
4107
|
FeatureStrategy,
|
|
4108
|
+
GetPackageRequestSchema,
|
|
4109
|
+
GetPackageResponseSchema,
|
|
3918
4110
|
GracefulDegradationSchema,
|
|
3919
4111
|
HealthStatusSchema,
|
|
3920
4112
|
HookRegisteredEventSchema,
|
|
3921
4113
|
HookTriggeredEventSchema,
|
|
3922
4114
|
HotReloadConfigSchema,
|
|
4115
|
+
InstallPackageRequestSchema,
|
|
4116
|
+
InstallPackageResponseSchema,
|
|
4117
|
+
InstalledPackageSchema,
|
|
3923
4118
|
KernelContextSchema,
|
|
3924
4119
|
KernelEventBaseSchema,
|
|
3925
4120
|
KernelReadyEventSchema,
|
|
3926
4121
|
KernelShutdownEventSchema,
|
|
4122
|
+
ListPackagesRequestSchema,
|
|
4123
|
+
ListPackagesResponseSchema,
|
|
3927
4124
|
ManifestSchema,
|
|
3928
4125
|
MetadataCollectionInfoSchema,
|
|
3929
4126
|
MetadataExportOptionsSchema,
|
|
@@ -3941,6 +4138,7 @@ var StartupOrchestrationResultSchema = import_zod17.z.object({
|
|
|
3941
4138
|
OpsDomainModuleSchema,
|
|
3942
4139
|
OpsFilePathSchema,
|
|
3943
4140
|
OpsPluginStructureSchema,
|
|
4141
|
+
PackageStatusEnum,
|
|
3944
4142
|
PermissionActionSchema,
|
|
3945
4143
|
PermissionSchema,
|
|
3946
4144
|
PermissionScopeSchema,
|
|
@@ -4003,6 +4201,8 @@ var StartupOrchestrationResultSchema = import_zod17.z.object({
|
|
|
4003
4201
|
ServiceUnregisteredEventSchema,
|
|
4004
4202
|
StartupOptionsSchema,
|
|
4005
4203
|
StartupOrchestrationResultSchema,
|
|
4204
|
+
UninstallPackageRequestSchema,
|
|
4205
|
+
UninstallPackageResponseSchema,
|
|
4006
4206
|
ValidationErrorSchema,
|
|
4007
4207
|
ValidationResultSchema,
|
|
4008
4208
|
ValidationWarningSchema,
|