apps 0.0.1-beta.121 → 0.0.1-beta.123
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.
|
@@ -219,6 +219,16 @@ function callBudget(timeoutMs) {
|
|
|
219
219
|
};
|
|
220
220
|
});
|
|
221
221
|
}
|
|
222
|
+
var decodeJsonText = Schema_exports.decodeUnknownOption(Schema_exports.fromJsonString(Schema_exports.Json));
|
|
223
|
+
var withoutStructuredCopy = (result) => {
|
|
224
|
+
const { structuredContent } = result;
|
|
225
|
+
if (structuredContent === void 0) return result;
|
|
226
|
+
const structured = JSON.stringify(structuredContent);
|
|
227
|
+
const content = result.content.filter(
|
|
228
|
+
(block) => !(block.type === "text" && typeof block.text === "string" && Option_exports.exists(decodeJsonText(block.text), (value) => JSON.stringify(value) === structured))
|
|
229
|
+
);
|
|
230
|
+
return content.length === result.content.length ? result : { ...result, content };
|
|
231
|
+
};
|
|
222
232
|
var mcpCall = (client, name, input, context, timeoutMs, failure2) => Effect_exports.scoped(
|
|
223
233
|
Effect_exports.gen(function* () {
|
|
224
234
|
const budget = yield* callBudget(timeoutMs);
|
|
@@ -290,7 +300,8 @@ var mcpCall = (client, name, input, context, timeoutMs, failure2) => Effect_expo
|
|
|
290
300
|
Effect_exports.raceFirst(budget.expired),
|
|
291
301
|
Effect_exports.flatMap(
|
|
292
302
|
(result) => Schema_exports.decodeUnknownEffect(McpToolResult)(result).pipe(
|
|
293
|
-
Effect_exports.mapError(() => new McpError({ phase: "call", reason: "invalid_response" }))
|
|
303
|
+
Effect_exports.mapError(() => new McpError({ phase: "call", reason: "invalid_response" })),
|
|
304
|
+
Effect_exports.map(withoutStructuredCopy)
|
|
294
305
|
)
|
|
295
306
|
),
|
|
296
307
|
Effect_exports.tap(
|
package/js/mcp/effect.js
CHANGED
package/js/mcp.js
CHANGED