@gammatech/aijsx 0.5.0-dev.2024-03-13.3 → 0.5.0-dev.2024-03-14
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/index.js +6 -1
- package/dist/index.mjs +6 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1053,7 +1053,10 @@ var XmlNode = class {
|
|
|
1053
1053
|
return this;
|
|
1054
1054
|
}
|
|
1055
1055
|
if (this.childNodes) {
|
|
1056
|
-
this.childNodes
|
|
1056
|
+
const originalNodes = [...this.childNodes];
|
|
1057
|
+
originalNodes.forEach((n) => {
|
|
1058
|
+
return n.collapse(nodes);
|
|
1059
|
+
});
|
|
1057
1060
|
}
|
|
1058
1061
|
if (
|
|
1059
1062
|
// is the root node
|
|
@@ -1065,6 +1068,7 @@ var XmlNode = class {
|
|
|
1065
1068
|
const parent = this.parent;
|
|
1066
1069
|
const index = parent.childNodes.indexOf(this);
|
|
1067
1070
|
parent.childNodes.splice(index, 1, ...this.childNodes);
|
|
1071
|
+
this.childNodes.forEach((n) => n.parent = parent);
|
|
1068
1072
|
return this;
|
|
1069
1073
|
}
|
|
1070
1074
|
};
|
|
@@ -2143,6 +2147,7 @@ function buildAnthropicMessages(childrenXml) {
|
|
|
2143
2147
|
}
|
|
2144
2148
|
for (const node of parsed.childNodes) {
|
|
2145
2149
|
if (node.nodeName === "UserMessage") {
|
|
2150
|
+
console.log(node.childNodes);
|
|
2146
2151
|
if (node.childNodes?.length === 1 && node.childNodes[0].nodeName === "#text") {
|
|
2147
2152
|
messages.push({
|
|
2148
2153
|
content: node.childNodes[0].value,
|
package/dist/index.mjs
CHANGED
|
@@ -962,7 +962,10 @@ var XmlNode = class {
|
|
|
962
962
|
return this;
|
|
963
963
|
}
|
|
964
964
|
if (this.childNodes) {
|
|
965
|
-
this.childNodes
|
|
965
|
+
const originalNodes = [...this.childNodes];
|
|
966
|
+
originalNodes.forEach((n) => {
|
|
967
|
+
return n.collapse(nodes);
|
|
968
|
+
});
|
|
966
969
|
}
|
|
967
970
|
if (
|
|
968
971
|
// is the root node
|
|
@@ -974,6 +977,7 @@ var XmlNode = class {
|
|
|
974
977
|
const parent = this.parent;
|
|
975
978
|
const index = parent.childNodes.indexOf(this);
|
|
976
979
|
parent.childNodes.splice(index, 1, ...this.childNodes);
|
|
980
|
+
this.childNodes.forEach((n) => n.parent = parent);
|
|
977
981
|
return this;
|
|
978
982
|
}
|
|
979
983
|
};
|
|
@@ -2045,6 +2049,7 @@ function buildAnthropicMessages(childrenXml) {
|
|
|
2045
2049
|
}
|
|
2046
2050
|
for (const node of parsed.childNodes) {
|
|
2047
2051
|
if (node.nodeName === "UserMessage") {
|
|
2052
|
+
console.log(node.childNodes);
|
|
2048
2053
|
if (node.childNodes?.length === 1 && node.childNodes[0].nodeName === "#text") {
|
|
2049
2054
|
messages.push({
|
|
2050
2055
|
content: node.childNodes[0].value,
|