@aiwerk/mcp-bridge 1.1.3 → 1.1.4
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/bin/mcp-bridge.js
CHANGED
|
@@ -85,23 +85,23 @@ export async function convertJsonSchemaToTypeBox(schema, depth = 0) {
|
|
|
85
85
|
return Type.String(stringOptions);
|
|
86
86
|
}
|
|
87
87
|
case "number": {
|
|
88
|
+
if (schema.enum)
|
|
89
|
+
return Type.Union(schema.enum.map((v) => Type.Literal(v)));
|
|
88
90
|
const numberOptions = {};
|
|
89
91
|
if (schema.minimum !== undefined)
|
|
90
92
|
numberOptions.minimum = schema.minimum;
|
|
91
93
|
if (schema.maximum !== undefined)
|
|
92
94
|
numberOptions.maximum = schema.maximum;
|
|
93
|
-
if (schema.enum)
|
|
94
|
-
return Type.Union(schema.enum.map((v) => Type.Literal(v)));
|
|
95
95
|
return Type.Number(numberOptions);
|
|
96
96
|
}
|
|
97
97
|
case "integer": {
|
|
98
|
+
if (schema.enum)
|
|
99
|
+
return Type.Union(schema.enum.map((v) => Type.Literal(v)));
|
|
98
100
|
const intOptions = {};
|
|
99
101
|
if (schema.minimum !== undefined)
|
|
100
102
|
intOptions.minimum = schema.minimum;
|
|
101
103
|
if (schema.maximum !== undefined)
|
|
102
104
|
intOptions.maximum = schema.maximum;
|
|
103
|
-
if (schema.enum)
|
|
104
|
-
return Type.Union(schema.enum.map((v) => Type.Literal(v)));
|
|
105
105
|
return Type.Integer(intOptions);
|
|
106
106
|
}
|
|
107
107
|
case "boolean":
|
|
@@ -87,8 +87,9 @@ export class SseTransport extends BaseTransport {
|
|
|
87
87
|
return;
|
|
88
88
|
const data = state.dataBuffer.join("\n");
|
|
89
89
|
state.dataBuffer.length = 0;
|
|
90
|
+
const eventType = state.event;
|
|
90
91
|
state.event = "";
|
|
91
|
-
if (
|
|
92
|
+
if (eventType === "endpoint") {
|
|
92
93
|
if (data.startsWith("/")) {
|
|
93
94
|
const base = new URL(this.config.url);
|
|
94
95
|
this.endpointUrl = `${base.origin}${data}`;
|