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