@ai-matrx/content-ir 0.19.19 → 0.19.21
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/CHANGELOG.md +10 -0
- package/dist/core.cjs +13 -23
- package/dist/core.cjs.map +1 -1
- package/dist/core.js +13 -23
- package/dist/core.js.map +1 -1
- package/dist/index.cjs +19 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +19 -25
- package/dist/index.js.map +1 -1
- package/dist/session.cjs +13 -23
- package/dist/session.cjs.map +1 -1
- package/dist/session.js +13 -23
- package/dist/session.js.map +1 -1
- package/dist/source.cjs +6 -2
- package/dist/source.cjs.map +1 -1
- package/dist/source.js +6 -2
- package/dist/source.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1274,7 +1274,7 @@ var KindStreamParser = class {
|
|
|
1274
1274
|
}
|
|
1275
1275
|
if (!declaredKind2 && committedKind && this.speculativeKinds.has(pathKey)) {
|
|
1276
1276
|
this.speculativeKinds.delete(pathKey);
|
|
1277
|
-
this.finalizeSpeculatedObject(path, objectValue, committedKind, at);
|
|
1277
|
+
this.finalizeSpeculatedObject(path, objectValue, committedKind, at, true);
|
|
1278
1278
|
return;
|
|
1279
1279
|
}
|
|
1280
1280
|
if (path.length === 0 && !declaredKind2 && !committedKind && this.rootSurfaceKind) {
|
|
@@ -1352,7 +1352,7 @@ var KindStreamParser = class {
|
|
|
1352
1352
|
});
|
|
1353
1353
|
}
|
|
1354
1354
|
/** Validate + complete an object typed purely by parent prediction. */
|
|
1355
|
-
finalizeSpeculatedObject(path, objectValue, kind, at) {
|
|
1355
|
+
finalizeSpeculatedObject(path, objectValue, kind, at, requireSharedField = false) {
|
|
1356
1356
|
const schema = this.lookupSchema(kind);
|
|
1357
1357
|
if (!schema) {
|
|
1358
1358
|
this.emitRawObject(
|
|
@@ -1365,6 +1365,15 @@ var KindStreamParser = class {
|
|
|
1365
1365
|
);
|
|
1366
1366
|
return;
|
|
1367
1367
|
}
|
|
1368
|
+
if (requireSharedField && !Object.keys(objectValue).some((key) => key in schema.fields)) {
|
|
1369
|
+
this.emitRawObject(
|
|
1370
|
+
path,
|
|
1371
|
+
objectValue,
|
|
1372
|
+
`Object carries none of "${kind}"'s fields.`,
|
|
1373
|
+
at
|
|
1374
|
+
);
|
|
1375
|
+
return;
|
|
1376
|
+
}
|
|
1368
1377
|
const outcome = this.validateObjectAgainstSchema(
|
|
1369
1378
|
{ ...objectValue, [KIND_KEY]: kind },
|
|
1370
1379
|
schema
|
|
@@ -1625,16 +1634,7 @@ var KindStreamParser = class {
|
|
|
1625
1634
|
...emptyOutcome
|
|
1626
1635
|
};
|
|
1627
1636
|
}
|
|
1628
|
-
for (const
|
|
1629
|
-
if (fieldSchema.required) {
|
|
1630
|
-
if (!(fieldName in objectValue)) {
|
|
1631
|
-
return {
|
|
1632
|
-
error: `Kind "${schema.kind}" is missing required field "${fieldName}".`,
|
|
1633
|
-
...emptyOutcome
|
|
1634
|
-
};
|
|
1635
|
-
}
|
|
1636
|
-
continue;
|
|
1637
|
-
}
|
|
1637
|
+
for (const fieldName of Object.keys(schema.fields)) {
|
|
1638
1638
|
if (!(fieldName in objectValue)) {
|
|
1639
1639
|
optionalMissing.push(fieldName);
|
|
1640
1640
|
}
|
|
@@ -1841,17 +1841,7 @@ var KindStreamParser = class {
|
|
|
1841
1841
|
validateObjectAgainstFields(objectValue, fields) {
|
|
1842
1842
|
const optionalMissing = [];
|
|
1843
1843
|
const extraFields = [];
|
|
1844
|
-
const
|
|
1845
|
-
for (const [fieldName, fieldSchema] of Object.entries(fields)) {
|
|
1846
|
-
if (fieldSchema.required) {
|
|
1847
|
-
if (!(fieldName in objectValue)) {
|
|
1848
|
-
return {
|
|
1849
|
-
error: `Inline object is missing required field "${fieldName}".`,
|
|
1850
|
-
...emptyOutcome
|
|
1851
|
-
};
|
|
1852
|
-
}
|
|
1853
|
-
continue;
|
|
1854
|
-
}
|
|
1844
|
+
for (const fieldName of Object.keys(fields)) {
|
|
1855
1845
|
if (!(fieldName in objectValue)) {
|
|
1856
1846
|
optionalMissing.push(fieldName);
|
|
1857
1847
|
}
|
|
@@ -5193,7 +5183,9 @@ var ALLOWED_RAW_HTML_TAGS = /* @__PURE__ */ new Set([
|
|
|
5193
5183
|
"colgroup",
|
|
5194
5184
|
"col",
|
|
5195
5185
|
"figure",
|
|
5196
|
-
"figcaption"
|
|
5186
|
+
"figcaption",
|
|
5187
|
+
"details",
|
|
5188
|
+
"summary"
|
|
5197
5189
|
]);
|
|
5198
5190
|
var HTML_BLOCK_LEVEL_TAGS = /* @__PURE__ */ new Set([
|
|
5199
5191
|
"p",
|
|
@@ -5219,7 +5211,9 @@ var HTML_BLOCK_LEVEL_TAGS = /* @__PURE__ */ new Set([
|
|
|
5219
5211
|
"colgroup",
|
|
5220
5212
|
"col",
|
|
5221
5213
|
"figure",
|
|
5222
|
-
"figcaption"
|
|
5214
|
+
"figcaption",
|
|
5215
|
+
"details",
|
|
5216
|
+
"summary"
|
|
5223
5217
|
]);
|
|
5224
5218
|
var SPECIAL_CODE_LANGUAGES = /* @__PURE__ */ new Set([
|
|
5225
5219
|
"transcript",
|