toolcraft 0.0.549 → 0.0.550
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/tiny-http-mcp-server/dist/composition.json +1 -1
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/bounded-json.js +33 -35
- package/node_modules/tiny-http-mcp-server/package.json +1 -1
- package/node_modules/tiny-mcp-client/dist/index.js +86 -79
- package/node_modules/tiny-stdio-mcp-server/dist/composition.json +1 -1
- package/node_modules/toolcraft-schema/dist/json.js +57 -44
- package/node_modules/toolcraft-schema/package.json +1 -1
- package/package.json +2 -2
package/composition.json
CHANGED
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
},
|
|
99
99
|
{
|
|
100
100
|
"name": "tiny-http-mcp-server",
|
|
101
|
-
"version": "0.1.
|
|
101
|
+
"version": "0.1.97",
|
|
102
102
|
"license": "MIT"
|
|
103
103
|
},
|
|
104
104
|
{
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
},
|
|
114
114
|
{
|
|
115
115
|
"name": "toolcraft",
|
|
116
|
-
"version": "0.0.
|
|
116
|
+
"version": "0.0.550",
|
|
117
117
|
"license": "MIT"
|
|
118
118
|
},
|
|
119
119
|
{
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
},
|
|
124
124
|
{
|
|
125
125
|
"name": "toolcraft-schema",
|
|
126
|
-
"version": "0.0.
|
|
126
|
+
"version": "0.0.550",
|
|
127
127
|
"license": "MIT"
|
|
128
128
|
},
|
|
129
129
|
{
|
package/dist/composition.json
CHANGED
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
},
|
|
99
99
|
{
|
|
100
100
|
"name": "tiny-http-mcp-server",
|
|
101
|
-
"version": "0.1.
|
|
101
|
+
"version": "0.1.97",
|
|
102
102
|
"license": "MIT"
|
|
103
103
|
},
|
|
104
104
|
{
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
},
|
|
114
114
|
{
|
|
115
115
|
"name": "toolcraft",
|
|
116
|
-
"version": "0.0.
|
|
116
|
+
"version": "0.0.550",
|
|
117
117
|
"license": "MIT"
|
|
118
118
|
},
|
|
119
119
|
{
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
},
|
|
124
124
|
{
|
|
125
125
|
"name": "toolcraft-schema",
|
|
126
|
-
"version": "0.0.
|
|
126
|
+
"version": "0.0.550",
|
|
127
127
|
"license": "MIT"
|
|
128
128
|
},
|
|
129
129
|
{
|
package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/bounded-json.js
CHANGED
|
@@ -1,46 +1,44 @@
|
|
|
1
1
|
/** Copy credential JSON without invoking accessors or custom serialization. */
|
|
2
2
|
export function copyBoundedOAuthJson(value, message) {
|
|
3
3
|
const invalid = () => new Error(message);
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
if (
|
|
4
|
+
const ancestors = new Set();
|
|
5
|
+
const root = {};
|
|
6
|
+
const tasks = [{ input: value, target: root, key: "value" }];
|
|
7
|
+
try {
|
|
8
|
+
while (tasks.length) {
|
|
9
|
+
const task = tasks.pop();
|
|
10
|
+
if ("leave" in task) {
|
|
11
|
+
ancestors.delete(task.leave);
|
|
12
|
+
continue;
|
|
13
|
+
}
|
|
14
|
+
const { input, target, key } = task;
|
|
15
|
+
let output = input;
|
|
16
|
+
if (input !== null && typeof input !== "boolean" && typeof input !== "string" &&
|
|
17
|
+
!(typeof input === "number" && Number.isFinite(input))) {
|
|
18
|
+
if (typeof input !== "object" || input === null || ancestors.has(input))
|
|
19
|
+
throw invalid();
|
|
20
|
+
const descriptors = Object.getOwnPropertyDescriptors(input);
|
|
21
|
+
const array = Array.isArray(input);
|
|
22
|
+
if (!array && Object.getPrototypeOf(input) !== Object.prototype && Object.getPrototypeOf(input) !== null)
|
|
23
23
|
throw invalid();
|
|
24
|
-
|
|
24
|
+
output = array ? [] : {};
|
|
25
|
+
ancestors.add(input);
|
|
26
|
+
tasks.push({ leave: input });
|
|
27
|
+
const keys = array
|
|
28
|
+
? Array.from({ length: input.length }, (_, index) => String(index))
|
|
29
|
+
: Object.keys(descriptors).filter(name => descriptors[name].enumerable);
|
|
30
|
+
for (let index = keys.length - 1; index >= 0; index--) {
|
|
31
|
+
const name = keys[index], descriptor = descriptors[name];
|
|
32
|
+
if (descriptor === undefined || !Object.hasOwn(descriptor, "value"))
|
|
33
|
+
throw invalid();
|
|
34
|
+
tasks.push({ input: descriptor.value, target: output, key: name });
|
|
35
|
+
}
|
|
25
36
|
}
|
|
26
|
-
|
|
37
|
+
Object.defineProperty(target, key, { value: output, enumerable: true, configurable: true, writable: true });
|
|
27
38
|
}
|
|
28
|
-
|
|
29
|
-
throw invalid();
|
|
30
|
-
return Object.fromEntries(Object.entries(descriptors).filter(([, descriptor]) => descriptor.enumerable).map(([key, descriptor]) => {
|
|
31
|
-
if (!Object.hasOwn(descriptor, "value"))
|
|
32
|
-
throw invalid();
|
|
33
|
-
return [key, copy(descriptor.value, depth + 1)];
|
|
34
|
-
}));
|
|
35
|
-
}
|
|
36
|
-
let result;
|
|
37
|
-
try {
|
|
38
|
-
result = copy(value, 0);
|
|
39
|
+
return root.value;
|
|
39
40
|
}
|
|
40
41
|
catch {
|
|
41
42
|
throw invalid();
|
|
42
43
|
}
|
|
43
|
-
if (Buffer.byteLength(JSON.stringify(result), "utf8") > 64 * 1024)
|
|
44
|
-
throw invalid();
|
|
45
|
-
return result;
|
|
46
44
|
}
|
|
@@ -216,59 +216,71 @@ function isJsonValue(value, options = {}) {
|
|
|
216
216
|
const maxDepth = options.maxDepth ?? 64;
|
|
217
217
|
if (maxNodes !== Infinity && (!Number.isSafeInteger(maxNodes) || maxNodes < 1))
|
|
218
218
|
throw new Error("maxNodes must be a positive safe integer");
|
|
219
|
-
if (!Number.isSafeInteger(maxDepth) || maxDepth < 0
|
|
220
|
-
throw new Error("maxDepth must be
|
|
219
|
+
if (maxDepth !== Infinity && (!Number.isSafeInteger(maxDepth) || maxDepth < 0))
|
|
220
|
+
throw new Error("maxDepth must be a nonnegative safe integer");
|
|
221
221
|
const ancestors = /* @__PURE__ */ new Set();
|
|
222
|
+
const stack = [];
|
|
223
|
+
function* properties(item2) {
|
|
224
|
+
if (Array.isArray(item2)) {
|
|
225
|
+
for (let index = 0; index < item2.length; index++)
|
|
226
|
+
yield Object.getOwnPropertyDescriptor(item2, String(index));
|
|
227
|
+
} else
|
|
228
|
+
for (const key2 in item2) {
|
|
229
|
+
const property = Object.getOwnPropertyDescriptor(item2, key2);
|
|
230
|
+
if (property !== void 0)
|
|
231
|
+
yield property;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
222
234
|
let nodes = 0;
|
|
223
|
-
|
|
235
|
+
let item = value, depth = 0;
|
|
236
|
+
while (true) {
|
|
224
237
|
if (++nodes > maxNodes || depth > maxDepth)
|
|
225
238
|
return false;
|
|
226
|
-
if (item
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
return Number.isFinite(item);
|
|
230
|
-
if (typeof item !== "object" || ancestors.has(item))
|
|
231
|
-
return false;
|
|
232
|
-
if (!Array.isArray(item) && Object.getPrototypeOf(item) !== Object.prototype && Object.getPrototypeOf(item) !== null)
|
|
233
|
-
return false;
|
|
234
|
-
let hookOwner = item;
|
|
235
|
-
let prototypeDepth = 0;
|
|
236
|
-
while (hookOwner !== null) {
|
|
237
|
-
if (++prototypeDepth > 64)
|
|
238
|
-
return false;
|
|
239
|
-
const serializationHook = Object.getOwnPropertyDescriptor(hookOwner, "toJSON");
|
|
240
|
-
if (serializationHook !== void 0) {
|
|
241
|
-
if (!("value" in serializationHook) || typeof serializationHook.value === "function")
|
|
239
|
+
if (item !== null && typeof item !== "string" && typeof item !== "boolean") {
|
|
240
|
+
if (typeof item === "number") {
|
|
241
|
+
if (!Number.isFinite(item))
|
|
242
242
|
return false;
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
243
|
+
} else {
|
|
244
|
+
if (typeof item !== "object" || ancestors.has(item))
|
|
245
|
+
return false;
|
|
246
|
+
if (!Array.isArray(item) && Object.getPrototypeOf(item) !== Object.prototype && Object.getPrototypeOf(item) !== null)
|
|
247
|
+
return false;
|
|
248
|
+
let hookOwner = item;
|
|
249
|
+
let prototypeDepth = 0;
|
|
250
|
+
while (hookOwner !== null) {
|
|
251
|
+
if (++prototypeDepth > 64)
|
|
252
|
+
return false;
|
|
253
|
+
const serializationHook = Object.getOwnPropertyDescriptor(hookOwner, "toJSON");
|
|
254
|
+
if (serializationHook !== void 0) {
|
|
255
|
+
if (!("value" in serializationHook) || typeof serializationHook.value === "function")
|
|
256
|
+
return false;
|
|
257
257
|
break;
|
|
258
258
|
}
|
|
259
|
+
hookOwner = Object.getPrototypeOf(hookOwner);
|
|
259
260
|
}
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
valid = false;
|
|
265
|
-
break;
|
|
266
|
-
}
|
|
261
|
+
if (Array.isArray(item) && item.length > maxNodes)
|
|
262
|
+
return false;
|
|
263
|
+
ancestors.add(item);
|
|
264
|
+
stack.push({ owner: item, children: properties(item), depth });
|
|
267
265
|
}
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
266
|
+
}
|
|
267
|
+
let next;
|
|
268
|
+
while (stack.length) {
|
|
269
|
+
const frame = stack[stack.length - 1];
|
|
270
|
+
next = frame.children.next();
|
|
271
|
+
if (!next.done) {
|
|
272
|
+
if (next.value === void 0 || !("value" in next.value))
|
|
273
|
+
return false;
|
|
274
|
+
item = next.value.value;
|
|
275
|
+
depth = frame.depth + 1;
|
|
276
|
+
break;
|
|
277
|
+
}
|
|
278
|
+
ancestors.delete(frame.owner);
|
|
279
|
+
stack.pop();
|
|
280
|
+
}
|
|
281
|
+
if (!stack.length)
|
|
282
|
+
return true;
|
|
283
|
+
}
|
|
272
284
|
}
|
|
273
285
|
|
|
274
286
|
// ../toolcraft-schema/dist/json-schema/utils.js
|
|
@@ -3516,47 +3528,42 @@ async function waitForOAuthOperation(operation, signal) {
|
|
|
3516
3528
|
// ../mcp-oauth/dist/client/bounded-json.js
|
|
3517
3529
|
function copyBoundedOAuthJson(value, message) {
|
|
3518
3530
|
const invalid = () => new Error(message);
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
throw invalid();
|
|
3534
|
-
const result2 = [];
|
|
3535
|
-
for (let index = 0; index < length; index++) {
|
|
3536
|
-
const descriptor = descriptors[String(index)];
|
|
3537
|
-
if (descriptor === void 0 || !Object.hasOwn(descriptor, "value"))
|
|
3531
|
+
const ancestors = /* @__PURE__ */ new Set();
|
|
3532
|
+
const root = {};
|
|
3533
|
+
const tasks = [{ input: value, target: root, key: "value" }];
|
|
3534
|
+
try {
|
|
3535
|
+
while (tasks.length) {
|
|
3536
|
+
const task = tasks.pop();
|
|
3537
|
+
if ("leave" in task) {
|
|
3538
|
+
ancestors.delete(task.leave);
|
|
3539
|
+
continue;
|
|
3540
|
+
}
|
|
3541
|
+
const { input, target, key: key2 } = task;
|
|
3542
|
+
let output = input;
|
|
3543
|
+
if (input !== null && typeof input !== "boolean" && typeof input !== "string" && !(typeof input === "number" && Number.isFinite(input))) {
|
|
3544
|
+
if (typeof input !== "object" || input === null || ancestors.has(input))
|
|
3538
3545
|
throw invalid();
|
|
3539
|
-
|
|
3546
|
+
const descriptors = Object.getOwnPropertyDescriptors(input);
|
|
3547
|
+
const array = Array.isArray(input);
|
|
3548
|
+
if (!array && Object.getPrototypeOf(input) !== Object.prototype && Object.getPrototypeOf(input) !== null)
|
|
3549
|
+
throw invalid();
|
|
3550
|
+
output = array ? [] : {};
|
|
3551
|
+
ancestors.add(input);
|
|
3552
|
+
tasks.push({ leave: input });
|
|
3553
|
+
const keys = array ? Array.from({ length: input.length }, (_, index) => String(index)) : Object.keys(descriptors).filter((name) => descriptors[name].enumerable);
|
|
3554
|
+
for (let index = keys.length - 1; index >= 0; index--) {
|
|
3555
|
+
const name = keys[index], descriptor = descriptors[name];
|
|
3556
|
+
if (descriptor === void 0 || !Object.hasOwn(descriptor, "value"))
|
|
3557
|
+
throw invalid();
|
|
3558
|
+
tasks.push({ input: descriptor.value, target: output, key: name });
|
|
3559
|
+
}
|
|
3540
3560
|
}
|
|
3541
|
-
|
|
3561
|
+
Object.defineProperty(target, key2, { value: output, enumerable: true, configurable: true, writable: true });
|
|
3542
3562
|
}
|
|
3543
|
-
|
|
3544
|
-
throw invalid();
|
|
3545
|
-
return Object.fromEntries(Object.entries(descriptors).filter(([, descriptor]) => descriptor.enumerable).map(([key2, descriptor]) => {
|
|
3546
|
-
if (!Object.hasOwn(descriptor, "value"))
|
|
3547
|
-
throw invalid();
|
|
3548
|
-
return [key2, copy(descriptor.value, depth + 1)];
|
|
3549
|
-
}));
|
|
3550
|
-
}
|
|
3551
|
-
let result;
|
|
3552
|
-
try {
|
|
3553
|
-
result = copy(value, 0);
|
|
3563
|
+
return root.value;
|
|
3554
3564
|
} catch {
|
|
3555
3565
|
throw invalid();
|
|
3556
3566
|
}
|
|
3557
|
-
if (Buffer.byteLength(JSON.stringify(result), "utf8") > 64 * 1024)
|
|
3558
|
-
throw invalid();
|
|
3559
|
-
return result;
|
|
3560
3567
|
}
|
|
3561
3568
|
|
|
3562
3569
|
// ../mcp-oauth/dist/client/loopback-authorization.js
|
|
@@ -10,59 +10,72 @@ export function isJsonValue(value, options = {}) {
|
|
|
10
10
|
const maxDepth = options.maxDepth ?? 64;
|
|
11
11
|
if (maxNodes !== Infinity && (!Number.isSafeInteger(maxNodes) || maxNodes < 1))
|
|
12
12
|
throw new Error("maxNodes must be a positive safe integer");
|
|
13
|
-
if (!Number.isSafeInteger(maxDepth) || maxDepth < 0
|
|
14
|
-
throw new Error("maxDepth must be
|
|
13
|
+
if (maxDepth !== Infinity && (!Number.isSafeInteger(maxDepth) || maxDepth < 0))
|
|
14
|
+
throw new Error("maxDepth must be a nonnegative safe integer");
|
|
15
15
|
const ancestors = new Set();
|
|
16
|
+
const stack = [];
|
|
17
|
+
function* properties(item) {
|
|
18
|
+
if (Array.isArray(item)) {
|
|
19
|
+
for (let index = 0; index < item.length; index++)
|
|
20
|
+
yield Object.getOwnPropertyDescriptor(item, String(index));
|
|
21
|
+
}
|
|
22
|
+
else
|
|
23
|
+
for (const key in item) {
|
|
24
|
+
const property = Object.getOwnPropertyDescriptor(item, key);
|
|
25
|
+
if (property !== undefined)
|
|
26
|
+
yield property;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
16
29
|
let nodes = 0;
|
|
17
|
-
|
|
30
|
+
let item = value, depth = 0;
|
|
31
|
+
while (true) {
|
|
18
32
|
if (++nodes > maxNodes || depth > maxDepth)
|
|
19
33
|
return false;
|
|
20
|
-
if (item
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return Number.isFinite(item);
|
|
24
|
-
if (typeof item !== "object" || ancestors.has(item))
|
|
25
|
-
return false;
|
|
26
|
-
if (!Array.isArray(item) && Object.getPrototypeOf(item) !== Object.prototype &&
|
|
27
|
-
Object.getPrototypeOf(item) !== null)
|
|
28
|
-
return false;
|
|
29
|
-
let hookOwner = item;
|
|
30
|
-
let prototypeDepth = 0;
|
|
31
|
-
while (hookOwner !== null) {
|
|
32
|
-
if (++prototypeDepth > 64)
|
|
33
|
-
return false;
|
|
34
|
-
const serializationHook = Object.getOwnPropertyDescriptor(hookOwner, "toJSON");
|
|
35
|
-
if (serializationHook !== undefined) {
|
|
36
|
-
if (!("value" in serializationHook) || typeof serializationHook.value === "function")
|
|
34
|
+
if (item !== null && typeof item !== "string" && typeof item !== "boolean") {
|
|
35
|
+
if (typeof item === "number") {
|
|
36
|
+
if (!Number.isFinite(item))
|
|
37
37
|
return false;
|
|
38
|
-
break;
|
|
39
38
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
39
|
+
else {
|
|
40
|
+
if (typeof item !== "object" || ancestors.has(item))
|
|
41
|
+
return false;
|
|
42
|
+
if (!Array.isArray(item) && Object.getPrototypeOf(item) !== Object.prototype &&
|
|
43
|
+
Object.getPrototypeOf(item) !== null)
|
|
44
|
+
return false;
|
|
45
|
+
let hookOwner = item;
|
|
46
|
+
let prototypeDepth = 0;
|
|
47
|
+
while (hookOwner !== null) {
|
|
48
|
+
if (++prototypeDepth > 64)
|
|
49
|
+
return false;
|
|
50
|
+
const serializationHook = Object.getOwnPropertyDescriptor(hookOwner, "toJSON");
|
|
51
|
+
if (serializationHook !== undefined) {
|
|
52
|
+
if (!("value" in serializationHook) || typeof serializationHook.value === "function")
|
|
53
|
+
return false;
|
|
52
54
|
break;
|
|
53
55
|
}
|
|
56
|
+
hookOwner = Object.getPrototypeOf(hookOwner);
|
|
54
57
|
}
|
|
58
|
+
if (Array.isArray(item) && item.length > maxNodes)
|
|
59
|
+
return false;
|
|
60
|
+
ancestors.add(item);
|
|
61
|
+
stack.push({ owner: item, children: properties(item), depth });
|
|
62
|
+
}
|
|
55
63
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
64
|
+
let next;
|
|
65
|
+
while (stack.length) {
|
|
66
|
+
const frame = stack[stack.length - 1];
|
|
67
|
+
next = frame.children.next();
|
|
68
|
+
if (!next.done) {
|
|
69
|
+
if (next.value === undefined || !("value" in next.value))
|
|
70
|
+
return false;
|
|
71
|
+
item = next.value.value;
|
|
72
|
+
depth = frame.depth + 1;
|
|
73
|
+
break;
|
|
63
74
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
75
|
+
ancestors.delete(frame.owner);
|
|
76
|
+
stack.pop();
|
|
77
|
+
}
|
|
78
|
+
if (!stack.length)
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
68
81
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "toolcraft",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.550",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -162,7 +162,7 @@
|
|
|
162
162
|
"yaml"
|
|
163
163
|
],
|
|
164
164
|
"optionalDependencies": {
|
|
165
|
-
"toolcraft-schema": "0.0.
|
|
165
|
+
"toolcraft-schema": "0.0.550",
|
|
166
166
|
"toolcraft-design": "*",
|
|
167
167
|
"@poe-code/frontmatter": "*",
|
|
168
168
|
"@poe-code/agent-mcp-config": "*",
|