ark-runtime-kernel 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +121 -220
- package/bin/ark-check.mjs +142 -20
- package/bin/ark-mcp.mjs +0 -0
- package/dist/index.cjs +25 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -957
- package/dist/index.d.ts +4 -957
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -1
- package/dist/nestjs/index.cjs +2301 -0
- package/dist/nestjs/index.cjs.map +1 -0
- package/dist/nestjs/index.d.cts +22 -0
- package/dist/nestjs/index.d.ts +22 -0
- package/dist/nestjs/index.js +2298 -0
- package/dist/nestjs/index.js.map +1 -0
- package/dist/types-7K_KQCgS.d.cts +991 -0
- package/dist/types-7K_KQCgS.d.ts +991 -0
- package/package.json +43 -8
- package/server.json +31 -0
package/dist/index.js
CHANGED
|
@@ -1103,6 +1103,12 @@ function createEventBus(options) {
|
|
|
1103
1103
|
}
|
|
1104
1104
|
|
|
1105
1105
|
// src/kernel/event-contracts/EventContractRegistry.ts
|
|
1106
|
+
function formatStandardSchemaPath(path) {
|
|
1107
|
+
if (!path || path.length === 0) return void 0;
|
|
1108
|
+
return path.map(
|
|
1109
|
+
(segment) => typeof segment === "object" && segment !== null && "key" in segment ? String(segment.key) : String(segment)
|
|
1110
|
+
).join(".");
|
|
1111
|
+
}
|
|
1106
1112
|
function actualType(value) {
|
|
1107
1113
|
if (Array.isArray(value)) return "array";
|
|
1108
1114
|
if (value === null) return "object";
|
|
@@ -1247,6 +1253,25 @@ var EventContractRegistryImpl = class {
|
|
|
1247
1253
|
}
|
|
1248
1254
|
}
|
|
1249
1255
|
}
|
|
1256
|
+
if (contract.standardSchema) {
|
|
1257
|
+
const result = contract.standardSchema["~standard"].validate(event.payload);
|
|
1258
|
+
if (result instanceof Promise) {
|
|
1259
|
+
issues.push({
|
|
1260
|
+
intent: event.intent,
|
|
1261
|
+
version: contract.version,
|
|
1262
|
+
message: "Standard Schema validator returned a Promise; event contract validation is synchronous."
|
|
1263
|
+
});
|
|
1264
|
+
} else if (result.issues) {
|
|
1265
|
+
for (const issue of result.issues) {
|
|
1266
|
+
issues.push({
|
|
1267
|
+
intent: event.intent,
|
|
1268
|
+
version: contract.version,
|
|
1269
|
+
field: formatStandardSchemaPath(issue.path),
|
|
1270
|
+
message: issue.message
|
|
1271
|
+
});
|
|
1272
|
+
}
|
|
1273
|
+
}
|
|
1274
|
+
}
|
|
1250
1275
|
return { ok: issues.length === 0, contract, issues };
|
|
1251
1276
|
}
|
|
1252
1277
|
clear() {
|