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