@ai-matrx/content-ir 0.19.20 → 0.19.25
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 +28 -0
- package/dist/convert.cjs +139 -5
- package/dist/convert.cjs.map +1 -1
- package/dist/convert.d.cts +71 -2
- package/dist/convert.d.ts +71 -2
- package/dist/convert.js +133 -6
- package/dist/convert.js.map +1 -1
- 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 +153 -28
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +146 -29
- package/dist/index.js.map +1 -1
- package/dist/registry.d.cts +1 -1
- package/dist/registry.d.ts +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 +1 -0
- package/dist/source.d.cts +9 -1
- package/dist/source.d.ts +9 -1
- package/dist/source.js +1 -1
- package/dist/wire.cjs.map +1 -1
- package/dist/wire.d.cts +2 -2
- package/dist/wire.d.ts +2 -2
- package/dist/wire.js.map +1 -1
- package/package.json +1 -1
package/dist/registry.d.cts
CHANGED
|
@@ -91,7 +91,7 @@ interface KindDefinition {
|
|
|
91
91
|
* throws anyway is caught, screams, and permanently drops this kind back to
|
|
92
92
|
* withhold for the session.
|
|
93
93
|
*
|
|
94
|
-
* Contract: common-docs/systems/content-ir
|
|
94
|
+
* Contract: common-docs/systems/architecture/content-ir/STREAMING_PARTIAL_KINDS.md
|
|
95
95
|
*/
|
|
96
96
|
partialReady?: boolean;
|
|
97
97
|
/**
|
package/dist/registry.d.ts
CHANGED
|
@@ -91,7 +91,7 @@ interface KindDefinition {
|
|
|
91
91
|
* throws anyway is caught, screams, and permanently drops this kind back to
|
|
92
92
|
* withhold for the session.
|
|
93
93
|
*
|
|
94
|
-
* Contract: common-docs/systems/content-ir
|
|
94
|
+
* Contract: common-docs/systems/architecture/content-ir/STREAMING_PARTIAL_KINDS.md
|
|
95
95
|
*/
|
|
96
96
|
partialReady?: boolean;
|
|
97
97
|
/**
|
package/dist/session.cjs
CHANGED
|
@@ -1255,7 +1255,7 @@ var KindStreamParser = class {
|
|
|
1255
1255
|
}
|
|
1256
1256
|
if (!declaredKind && committedKind && this.speculativeKinds.has(pathKey)) {
|
|
1257
1257
|
this.speculativeKinds.delete(pathKey);
|
|
1258
|
-
this.finalizeSpeculatedObject(path, objectValue, committedKind, at);
|
|
1258
|
+
this.finalizeSpeculatedObject(path, objectValue, committedKind, at, true);
|
|
1259
1259
|
return;
|
|
1260
1260
|
}
|
|
1261
1261
|
if (path.length === 0 && !declaredKind && !committedKind && this.rootSurfaceKind) {
|
|
@@ -1333,7 +1333,7 @@ var KindStreamParser = class {
|
|
|
1333
1333
|
});
|
|
1334
1334
|
}
|
|
1335
1335
|
/** Validate + complete an object typed purely by parent prediction. */
|
|
1336
|
-
finalizeSpeculatedObject(path, objectValue, kind, at) {
|
|
1336
|
+
finalizeSpeculatedObject(path, objectValue, kind, at, requireSharedField = false) {
|
|
1337
1337
|
const schema = this.lookupSchema(kind);
|
|
1338
1338
|
if (!schema) {
|
|
1339
1339
|
this.emitRawObject(
|
|
@@ -1346,6 +1346,15 @@ var KindStreamParser = class {
|
|
|
1346
1346
|
);
|
|
1347
1347
|
return;
|
|
1348
1348
|
}
|
|
1349
|
+
if (requireSharedField && !Object.keys(objectValue).some((key) => key in schema.fields)) {
|
|
1350
|
+
this.emitRawObject(
|
|
1351
|
+
path,
|
|
1352
|
+
objectValue,
|
|
1353
|
+
`Object carries none of "${kind}"'s fields.`,
|
|
1354
|
+
at
|
|
1355
|
+
);
|
|
1356
|
+
return;
|
|
1357
|
+
}
|
|
1349
1358
|
const outcome = this.validateObjectAgainstSchema(
|
|
1350
1359
|
{ ...objectValue, [KIND_KEY]: kind },
|
|
1351
1360
|
schema
|
|
@@ -1606,16 +1615,7 @@ var KindStreamParser = class {
|
|
|
1606
1615
|
...emptyOutcome
|
|
1607
1616
|
};
|
|
1608
1617
|
}
|
|
1609
|
-
for (const
|
|
1610
|
-
if (fieldSchema.required) {
|
|
1611
|
-
if (!(fieldName in objectValue)) {
|
|
1612
|
-
return {
|
|
1613
|
-
error: `Kind "${schema.kind}" is missing required field "${fieldName}".`,
|
|
1614
|
-
...emptyOutcome
|
|
1615
|
-
};
|
|
1616
|
-
}
|
|
1617
|
-
continue;
|
|
1618
|
-
}
|
|
1618
|
+
for (const fieldName of Object.keys(schema.fields)) {
|
|
1619
1619
|
if (!(fieldName in objectValue)) {
|
|
1620
1620
|
optionalMissing.push(fieldName);
|
|
1621
1621
|
}
|
|
@@ -1822,17 +1822,7 @@ var KindStreamParser = class {
|
|
|
1822
1822
|
validateObjectAgainstFields(objectValue, fields) {
|
|
1823
1823
|
const optionalMissing = [];
|
|
1824
1824
|
const extraFields = [];
|
|
1825
|
-
const
|
|
1826
|
-
for (const [fieldName, fieldSchema] of Object.entries(fields)) {
|
|
1827
|
-
if (fieldSchema.required) {
|
|
1828
|
-
if (!(fieldName in objectValue)) {
|
|
1829
|
-
return {
|
|
1830
|
-
error: `Inline object is missing required field "${fieldName}".`,
|
|
1831
|
-
...emptyOutcome
|
|
1832
|
-
};
|
|
1833
|
-
}
|
|
1834
|
-
continue;
|
|
1835
|
-
}
|
|
1825
|
+
for (const fieldName of Object.keys(fields)) {
|
|
1836
1826
|
if (!(fieldName in objectValue)) {
|
|
1837
1827
|
optionalMissing.push(fieldName);
|
|
1838
1828
|
}
|