toolcraft 0.0.778 → 0.0.780
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/composition.json +3 -3
- package/dist/composition.json +3 -3
- package/node_modules/@poe-code/xml-ast/dist/stream.d.ts +3 -1
- package/node_modules/@poe-code/xml-ast/dist/stream.js +4 -4
- package/node_modules/tiny-http-mcp-server/dist/composition.json +1 -1
- package/node_modules/tiny-http-mcp-server/package.json +1 -1
- package/node_modules/tiny-stdio-mcp-server/dist/composition.json +1 -1
- package/node_modules/toolcraft-schema/package.json +1 -1
- package/package.json +2 -2
package/composition.json
CHANGED
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
},
|
|
124
124
|
{
|
|
125
125
|
"name": "tiny-http-mcp-server",
|
|
126
|
-
"version": "0.1.
|
|
126
|
+
"version": "0.1.130",
|
|
127
127
|
"license": "MIT"
|
|
128
128
|
},
|
|
129
129
|
{
|
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
},
|
|
139
139
|
{
|
|
140
140
|
"name": "toolcraft",
|
|
141
|
-
"version": "0.0.
|
|
141
|
+
"version": "0.0.780",
|
|
142
142
|
"license": "MIT"
|
|
143
143
|
},
|
|
144
144
|
{
|
|
@@ -148,7 +148,7 @@
|
|
|
148
148
|
},
|
|
149
149
|
{
|
|
150
150
|
"name": "toolcraft-schema",
|
|
151
|
-
"version": "0.0.
|
|
151
|
+
"version": "0.0.780",
|
|
152
152
|
"license": "MIT"
|
|
153
153
|
},
|
|
154
154
|
{
|
package/dist/composition.json
CHANGED
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
},
|
|
124
124
|
{
|
|
125
125
|
"name": "tiny-http-mcp-server",
|
|
126
|
-
"version": "0.1.
|
|
126
|
+
"version": "0.1.130",
|
|
127
127
|
"license": "MIT"
|
|
128
128
|
},
|
|
129
129
|
{
|
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
},
|
|
139
139
|
{
|
|
140
140
|
"name": "toolcraft",
|
|
141
|
-
"version": "0.0.
|
|
141
|
+
"version": "0.0.780",
|
|
142
142
|
"license": "MIT"
|
|
143
143
|
},
|
|
144
144
|
{
|
|
@@ -148,7 +148,7 @@
|
|
|
148
148
|
},
|
|
149
149
|
{
|
|
150
150
|
"name": "toolcraft-schema",
|
|
151
|
-
"version": "0.0.
|
|
151
|
+
"version": "0.0.780",
|
|
152
152
|
"license": "MIT"
|
|
153
153
|
},
|
|
154
154
|
{
|
|
@@ -3,11 +3,13 @@ export interface XmlStreamLimits extends XmlLimits {
|
|
|
3
3
|
/** Validate the full document but return only its root name, without a retained tree. */
|
|
4
4
|
readonly retainTree?: boolean;
|
|
5
5
|
/** Detach selected non-root subtrees and await their consumer before parsing
|
|
6
|
-
* the next 512-unit window.
|
|
6
|
+
* the next 512-unit window. By default nested matches belong to the selected ancestor. */
|
|
7
7
|
readonly streamElements?: {
|
|
8
8
|
/** Also detach preceding sibling content when selecting a subtree, before
|
|
9
9
|
* the parser advances. The final trailing content remains in the parent. */
|
|
10
10
|
readonly captureBefore?: boolean;
|
|
11
|
+
/** Detach nested matches too, consuming descendants before their ancestors. */
|
|
12
|
+
readonly includeNested?: boolean;
|
|
11
13
|
readonly matches: (element: XmlName, parent: XmlName | undefined, depth: number) => boolean;
|
|
12
14
|
readonly consume: (element: XmlElement, parent: XmlElement, before?: readonly XmlContent[]) => void | Promise<void>;
|
|
13
15
|
};
|
|
@@ -19,7 +19,7 @@ export async function parseXmlStream(source, limits = {}, checkpoint) {
|
|
|
19
19
|
const streaming = limits.streamElements;
|
|
20
20
|
if (streaming && !retain)
|
|
21
21
|
throw new TypeError("XML subtree streaming requires retained content and tree mode");
|
|
22
|
-
let
|
|
22
|
+
let selectedCount = 0;
|
|
23
23
|
const completed = [];
|
|
24
24
|
const stack = [];
|
|
25
25
|
const prolog = [], epilog = [];
|
|
@@ -60,12 +60,12 @@ export async function parseXmlStream(source, limits = {}, checkpoint) {
|
|
|
60
60
|
charge("maxTextLength", attr.value.length);
|
|
61
61
|
const name = { name: tag.name, namespace: tag.uri, localName: tag.local };
|
|
62
62
|
limits.onElement?.(name, parent?.element, stack.length + 1);
|
|
63
|
-
const selected = !
|
|
63
|
+
const selected = (!selectedCount || streaming?.includeNested === true) && !!streaming?.matches(name, parent?.element, stack.length + 1);
|
|
64
64
|
if (selected && !parent)
|
|
65
65
|
throw new TypeError("XML subtree streaming cannot select the root");
|
|
66
66
|
let before = [];
|
|
67
67
|
if (selected) {
|
|
68
|
-
|
|
68
|
+
selectedCount++;
|
|
69
69
|
if (streaming?.captureBefore) {
|
|
70
70
|
before = parent.element.content.splice(0);
|
|
71
71
|
parent.element.children.length = 0;
|
|
@@ -90,7 +90,7 @@ export async function parseXmlStream(source, limits = {}, checkpoint) {
|
|
|
90
90
|
const frame = stack.pop();
|
|
91
91
|
if (frame.selected) {
|
|
92
92
|
completed.push({ element: frame.element, parent: stack.at(-1).element, before: frame.before });
|
|
93
|
-
|
|
93
|
+
selectedCount--;
|
|
94
94
|
}
|
|
95
95
|
});
|
|
96
96
|
async function drain() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "toolcraft",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.780",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -177,7 +177,7 @@
|
|
|
177
177
|
"saxes"
|
|
178
178
|
],
|
|
179
179
|
"optionalDependencies": {
|
|
180
|
-
"toolcraft-schema": "0.0.
|
|
180
|
+
"toolcraft-schema": "0.0.780",
|
|
181
181
|
"toolcraft-design": "*",
|
|
182
182
|
"@poe-code/frontmatter": "*",
|
|
183
183
|
"@poe-code/agent-mcp-config": "*",
|