apps 0.0.1-beta.4 → 0.0.1-beta.40
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/README.md +68 -44
- package/framework-reference.json +1 -1
- package/js/{chunk-QKHR7BMF.js → chunk-3MMG2H6M.js} +89 -53
- package/js/chunk-4TLZGG4B.js +729 -0
- package/js/chunk-6KABJTDO.js +255 -0
- package/js/{chunk-FDNTX5QJ.js → chunk-CQD3WSYH.js} +2 -2
- package/js/{chunk-EQB7JMAL.js → chunk-DHX2OI2X.js} +146 -31
- package/js/{chunk-EVJUVWN2.js → chunk-DKUEYTYD.js} +463 -218
- package/js/chunk-EM4UL26F.js +118 -0
- package/js/{chunk-WFSQXYUT.js → chunk-GHXRRFZA.js} +418 -52
- package/js/{chunk-5MQZEB6Y.js → chunk-KANDIVIH.js} +40 -12
- package/js/chunk-KAQD3DTI.js +16 -0
- package/js/chunk-KIM5HXNK.js +49 -0
- package/js/{chunk-FW5HBOIK.js → chunk-MXDKXAY4.js} +19117 -18309
- package/js/{chunk-2VPJHFOU.js → chunk-MYF7KWUB.js} +128 -24
- package/js/{chunk-T2LAZCAD.js → chunk-NKWWPJYX.js} +3 -3
- package/js/chunk-OD3KFKZD.js +1617 -0
- package/js/{chunk-3M2MEDNL.js → chunk-OTCLXFLL.js} +1337 -188
- package/js/chunk-P7MGDPFD.js +240 -0
- package/js/chunk-PDS2E2OZ.js +42 -0
- package/js/{chunk-ZCAMUXSG.js → chunk-PNVCCB4L.js} +432 -79
- package/js/{chunk-D47C7KG5.js → chunk-RIXVGVA6.js} +2 -2
- package/js/{chunk-6VRYO2BG.js → chunk-SALJXSS3.js} +779 -251
- package/js/{chunk-NQ3OMCA5.js → chunk-TT6OU4UG.js} +2 -2
- package/js/{chunk-YEJOQEII.js → chunk-UOZMSUJ2.js} +61 -9
- package/js/{chunk-G7ZIRKMK.js → chunk-VIU2XXA7.js} +228 -264
- package/js/{chunk-HDJH3RPR.js → chunk-VJQXXOQ3.js} +4 -4
- package/js/chunk-XDGUGB2A.js +156 -0
- package/js/{chunk-SATWJKN6.js → chunk-YQ35E7KS.js} +2 -2
- package/js/chunk-ZUKBIHMK.js +92 -0
- package/js/client.js +122 -88
- package/js/contracts.js +116 -25
- package/js/effect.js +19 -20
- package/js/{es-APDZKREY.js → es-DIULA3ZF.js} +62 -1659
- package/js/graphql.js +57 -55
- package/js/host.js +19 -20
- package/js/index.js +245 -212
- package/js/mcp/effect.js +23 -22
- package/js/mcp/stdio.js +34 -30
- package/js/mcp.js +104 -68
- package/js/openapi.js +4087 -1503
- package/js/react.js +2 -3
- package/js/skills/effect.js +6 -3
- package/js/skills.js +147 -65
- package/js/storage/facet.js +1 -540
- package/js/ui/auth/contracts.js +2 -2
- package/js/ui/auth.js +5 -5
- package/js/ui/contracts.js +5 -4
- package/js/ui/serving.js +8517 -214
- package/package.json +2 -3
- package/runtime.json +1 -1
- package/types/app-data/src/contracts/database.d.ts +33 -6
- package/types/apps/src/contracts/api-response-error.d.ts +4 -0
- package/types/apps/src/contracts/app.d.ts +7 -8
- package/types/apps/src/contracts/cache.d.ts +14 -0
- package/types/apps/src/contracts/context.d.ts +12 -11
- package/types/apps/src/contracts/elicitation.d.ts +6 -6
- package/types/apps/src/contracts/failure.d.ts +54 -0
- package/types/apps/src/contracts/graphql.d.ts +2 -1
- package/types/apps/src/contracts/host.d.ts +44 -17
- package/types/apps/src/contracts/live.d.ts +2 -0
- package/types/apps/src/contracts/mcp.d.ts +96 -10
- package/types/apps/src/contracts/network.d.ts +84 -0
- package/types/apps/src/contracts/openapi-compile.d.ts +32 -3
- package/types/apps/src/contracts/openapi.d.ts +45 -9
- package/types/apps/src/contracts/operations.d.ts +8 -9
- package/types/apps/src/contracts/protocol-version.d.ts +2 -2
- package/types/apps/src/contracts/protocols/1.d.ts +263 -74
- package/types/apps/src/contracts/protocols/10.d.ts +1450 -0
- package/types/apps/src/contracts/protocols/2.d.ts +66 -24
- package/types/apps/src/contracts/protocols/3.d.ts +715 -0
- package/types/apps/src/contracts/protocols/4.d.ts +1297 -0
- package/types/apps/src/contracts/protocols/5.d.ts +1174 -0
- package/types/apps/src/contracts/protocols/6.d.ts +1620 -0
- package/types/apps/src/contracts/protocols/7.d.ts +1784 -0
- package/types/apps/src/contracts/protocols/8.d.ts +1130 -0
- package/types/apps/src/contracts/protocols/9.d.ts +1106 -0
- package/types/apps/src/contracts/protocols/oauth.d.ts +89 -0
- package/types/apps/src/contracts/provider-error.d.ts +9 -0
- package/types/apps/src/contracts/provider.d.ts +115 -10
- package/types/apps/src/contracts/router.d.ts +59 -0
- package/types/apps/src/contracts/skills.d.ts +39 -9
- package/types/apps/src/contracts/sql.d.ts +58 -0
- package/types/apps/src/contracts/ui.d.ts +19 -1
- package/types/apps/src/contracts/workflows.d.ts +40 -3
- package/types/apps/src/facet.d.ts +4 -5
- package/types/apps/src/graphql.d.ts +1 -3
- package/types/apps/src/implementation/account-router.d.ts +12 -0
- package/types/apps/src/implementation/app.d.ts +5 -4
- package/types/apps/src/implementation/browser-scripts.gen.d.ts +6 -0
- package/types/apps/src/implementation/catalog-cache.d.ts +32 -5
- package/types/apps/src/implementation/elicitation.d.ts +9 -9
- package/types/apps/src/implementation/failure-detail.d.ts +47 -0
- package/types/apps/src/implementation/graphql-catalog.d.ts +4 -7
- package/types/apps/src/implementation/graphql.d.ts +4 -3
- package/types/apps/src/implementation/input-problems.d.ts +4 -1
- package/types/apps/src/implementation/live.d.ts +2 -2
- package/types/apps/src/implementation/mcp-call.d.ts +6 -5
- package/types/apps/src/implementation/mcp-catalog.d.ts +7 -8
- package/types/apps/src/implementation/mcp-client.d.ts +49 -25
- package/types/apps/src/implementation/mcp-stdio.d.ts +1 -1
- package/types/apps/src/implementation/mcp-tools.d.ts +2 -1
- package/types/apps/src/implementation/mcp.d.ts +52 -25
- package/types/apps/src/implementation/network.d.ts +16 -0
- package/types/apps/src/implementation/openapi-compile.d.ts +27 -6
- package/types/apps/src/implementation/openapi-document.d.ts +46 -19
- package/types/apps/src/implementation/openapi-names.d.ts +9 -4
- package/types/apps/src/implementation/openapi-request.d.ts +10 -2
- package/types/apps/src/implementation/openapi-source.d.ts +8 -6
- package/types/apps/src/implementation/openapi-upgrade.d.ts +4 -0
- package/types/apps/src/implementation/operations.d.ts +36 -3
- package/types/apps/src/implementation/optimistic.d.ts +1 -1
- package/types/apps/src/implementation/protocol-operations.d.ts +6 -4
- package/types/apps/src/implementation/provider-error.d.ts +28 -1
- package/types/apps/src/implementation/provider.d.ts +19 -5
- package/types/apps/src/implementation/query-commit.d.ts +1 -1
- package/types/apps/src/implementation/router-catalog.d.ts +223 -0
- package/types/apps/src/implementation/router.d.ts +68 -0
- package/types/apps/src/implementation/runtime-yield.d.ts +7 -0
- package/types/apps/src/implementation/schema.d.ts +86 -11
- package/types/apps/src/implementation/skills.d.ts +18 -24
- package/types/apps/src/implementation/sql.d.ts +66 -0
- package/types/apps/src/implementation/ui-account-notice.d.ts +9 -0
- package/types/apps/src/implementation/ui-auth.d.ts +1 -1
- package/types/apps/src/implementation/ui-client.d.ts +2 -2
- package/types/apps/src/implementation/ui-document.d.ts +5 -0
- package/types/apps/src/implementation/ui-errors.d.ts +1 -1
- package/types/apps/src/implementation/ui-serving.d.ts +11 -5
- package/types/apps/src/implementation/ui-watch.d.ts +1 -1
- package/types/apps/src/implementation/upstream-error.d.ts +7 -0
- package/types/apps/src/implementation/webhooks.d.ts +1 -1
- package/types/apps/src/implementation/workflow-context.d.ts +11 -3
- package/types/apps/src/index.d.ts +30 -13
- package/types/apps/src/mcp-stdio.d.ts +2 -5
- package/types/apps/src/mcp.d.ts +25 -5
- package/types/apps/src/openapi.d.ts +6 -6
- package/types/apps/src/react.d.ts +1 -1
- package/types/apps/src/skills.d.ts +10 -8
- package/types/telemetry/src/app-records.d.ts +42 -0
- package/types/telemetry/src/browser-operations.d.ts +6 -3
- package/types/telemetry/src/browser.d.ts +2 -2
- package/types/telemetry/src/config.d.ts +2 -2
- package/types/telemetry/src/layer.d.ts +2 -2
- package/types/telemetry/src/recorded-failure.d.ts +20 -0
- package/types/telemetry/src/relay.d.ts +2 -2
- package/types/telemetry/src/transport.d.ts +8 -1
- package/types/utils/src/api-error.d.ts +53 -0
- package/types/utils/src/recorded-message.d.ts +15 -0
- package/js/chunk-BMOIAIVR.js +0 -138
- package/js/chunk-DHUDODG5.js +0 -213
- package/js/chunk-FZJOYIZO.js +0 -19
- package/js/chunk-LGIYBDWA.js +0 -85
- package/js/chunk-M6ZRRIBI.js +0 -877
- package/js/chunk-PLCMJREA.js +0 -590
- package/js/chunk-PYUYJRSK.js +0 -93
- package/js/chunk-SWPD52J7.js +0 -35
- package/js/chunk-W7D7WVSY.js +0 -18
- package/js/chunk-Z5NMEGJN.js +0 -29
- package/js/chunk-ZJWDMTE3.js +0 -63
- package/types/app-data/src/implementation/cursor.d.ts +0 -10
- package/types/app-data/src/implementation/index-key.d.ts +0 -7
- package/types/app-data/src/implementation/promise.d.ts +0 -68
- package/types/app-data/src/implementation/range.d.ts +0 -8
- package/types/app-data/src/implementation/schema.d.ts +0 -33
- package/types/app-data/src/implementation/sqlite.d.ts +0 -11
- package/types/app-data/src/index.d.ts +0 -4
- package/types/apps/src/contracts/dynamic-tools.d.ts +0 -13
- package/types/apps/src/contracts/storage.d.ts +0 -68
- package/types/apps/src/implementation/account-operations.d.ts +0 -151
- package/types/apps/src/implementation/dynamic-tools.d.ts +0 -8
- package/types/apps/src/implementation/storage.d.ts +0 -13
|
@@ -1,26 +1,32 @@
|
|
|
1
1
|
import {
|
|
2
2
|
prepareElicitation
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-SALJXSS3.js";
|
|
4
4
|
import {
|
|
5
5
|
fromPromise
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-6KABJTDO.js";
|
|
7
|
+
import {
|
|
8
|
+
bodyUpstreamError
|
|
9
|
+
} from "./chunk-EM4UL26F.js";
|
|
7
10
|
import {
|
|
8
11
|
ElicitationFailed,
|
|
9
12
|
McpError,
|
|
13
|
+
McpServerHeader,
|
|
10
14
|
McpToolMetadata,
|
|
11
15
|
McpToolResult,
|
|
16
|
+
RouterIcon,
|
|
12
17
|
ToolResultObservation,
|
|
13
18
|
defaultElicitationLimits,
|
|
14
19
|
defaultMcpClientLimits,
|
|
15
20
|
mcpSdkTimerCeilingMs
|
|
16
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-OTCLXFLL.js";
|
|
17
22
|
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
jsonSchemaDecoder,
|
|
24
|
+
nestJsonSchema,
|
|
25
|
+
preparedJsonSchemaDecoder
|
|
26
|
+
} from "./chunk-GHXRRFZA.js";
|
|
21
27
|
import {
|
|
22
28
|
JsonObject
|
|
23
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-YQ35E7KS.js";
|
|
24
30
|
import {
|
|
25
31
|
Clock_exports,
|
|
26
32
|
Deferred_exports,
|
|
@@ -29,29 +35,79 @@ import {
|
|
|
29
35
|
Option_exports,
|
|
30
36
|
Queue_exports,
|
|
31
37
|
Schema_exports
|
|
32
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-MXDKXAY4.js";
|
|
33
39
|
|
|
34
40
|
// src/implementation/mcp-tools.ts
|
|
41
|
+
var resultFields = {
|
|
42
|
+
content: { type: "array", items: { type: "object" } },
|
|
43
|
+
structuredContent: { type: "object" },
|
|
44
|
+
isError: { type: "boolean" },
|
|
45
|
+
_meta: { type: "object" }
|
|
46
|
+
};
|
|
47
|
+
var definitionReference = /^#\/(?:\$defs|definitions)\/[^/]+$/;
|
|
48
|
+
var locating = /* @__PURE__ */ new Set(["$id", "$anchor", "$dynamicAnchor", "$recursiveAnchor"]);
|
|
49
|
+
var onlyDefinitionReferences = (value) => Array.isArray(value) ? value.every(onlyDefinitionReferences) : value === null || typeof value !== "object" ? true : Object.entries(value).every(
|
|
50
|
+
([key, item]) => locating.has(key) || key === "$dynamicRef" || key === "$recursiveRef" ? false : key === "$ref" ? typeof item === "string" && definitionReference.test(item) : onlyDefinitionReferences(item)
|
|
51
|
+
);
|
|
52
|
+
var placed = (structuredContent, pointer) => {
|
|
53
|
+
if (onlyDefinitionReferences(structuredContent)) {
|
|
54
|
+
const { $defs, definitions, $schema: _draft, ...schema } = structuredContent;
|
|
55
|
+
return {
|
|
56
|
+
schema,
|
|
57
|
+
root: {
|
|
58
|
+
...$defs === void 0 ? {} : { $defs },
|
|
59
|
+
...definitions === void 0 ? {} : { definitions }
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
try {
|
|
64
|
+
return { schema: nestJsonSchema(structuredContent, pointer), root: {} };
|
|
65
|
+
} catch {
|
|
66
|
+
return { schema: structuredContent, root: {} };
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
var resultSchema = (structuredContent) => {
|
|
70
|
+
if (structuredContent === void 0)
|
|
71
|
+
return { type: "object", properties: resultFields, required: ["content"] };
|
|
72
|
+
const { schema, root } = placed(structuredContent, "#/anyOf/0/properties/structuredContent");
|
|
73
|
+
return {
|
|
74
|
+
// The envelope's keywords mean the same in every draft, so the server's draft applies.
|
|
75
|
+
...structuredContent.$schema === void 0 ? {} : { $schema: structuredContent.$schema },
|
|
76
|
+
...root,
|
|
77
|
+
anyOf: [
|
|
78
|
+
{
|
|
79
|
+
type: "object",
|
|
80
|
+
properties: { ...resultFields, structuredContent: schema, isError: { const: false } },
|
|
81
|
+
required: ["content", "structuredContent"]
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
type: "object",
|
|
85
|
+
properties: { ...resultFields, isError: { const: true } },
|
|
86
|
+
required: ["content", "isError"]
|
|
87
|
+
}
|
|
88
|
+
]
|
|
89
|
+
};
|
|
90
|
+
};
|
|
35
91
|
var adaptMcpTool = (client, tool) => Effect_exports.gen(function* () {
|
|
36
92
|
const decoder = yield* jsonSchemaDecoder(tool.inputSchema).pipe(
|
|
37
93
|
Effect_exports.mapError(() => new McpError({ phase: "schema", reason: "invalid_response" }))
|
|
38
94
|
);
|
|
39
|
-
const output = tool.outputSchema
|
|
40
|
-
|
|
41
|
-
Effect_exports.mapError(() => new McpError({ phase: "schema", reason: "invalid_response" }))
|
|
42
|
-
)
|
|
43
|
-
);
|
|
95
|
+
const output = preparedJsonSchemaDecoder(resultSchema(tool.outputSchema));
|
|
96
|
+
const { outputSchema: _upstream, ...metadata } = tool;
|
|
44
97
|
const adapted = {
|
|
45
|
-
...
|
|
98
|
+
...metadata,
|
|
46
99
|
description: tool.description ?? tool.title ?? tool.name,
|
|
47
100
|
input: decoder,
|
|
101
|
+
output: output.decoder,
|
|
48
102
|
...tool.annotations?.readOnlyHint === void 0 ? {} : { readOnly: tool.annotations.readOnlyHint },
|
|
49
103
|
run: (context, input) => Effect_exports.gen(function* () {
|
|
50
104
|
const arguments_ = yield* Schema_exports.decodeUnknownEffect(decoder)(input).pipe(
|
|
51
105
|
Effect_exports.flatMap(Schema_exports.decodeUnknownEffect(JsonObject)),
|
|
52
106
|
Effect_exports.mapError(() => new McpError({ phase: "call", reason: "invalid_input" }))
|
|
53
107
|
);
|
|
54
|
-
|
|
108
|
+
yield* output.compile.pipe(
|
|
109
|
+
Effect_exports.mapError(() => new McpError({ phase: "schema", reason: "invalid_response" }))
|
|
110
|
+
);
|
|
55
111
|
const result = yield* client.call(tool.name, arguments_, context);
|
|
56
112
|
if (result.isError === true) {
|
|
57
113
|
(yield* ToolResultObservation).failed();
|
|
@@ -60,17 +116,13 @@ var adaptMcpTool = (client, tool) => Effect_exports.gen(function* () {
|
|
|
60
116
|
"error.type": "McpToolError"
|
|
61
117
|
});
|
|
62
118
|
}
|
|
63
|
-
if (outputDecoder !== void 0 && !result.isError)
|
|
64
|
-
yield* Schema_exports.decodeUnknownEffect(outputDecoder)(result.structuredContent).pipe(
|
|
65
|
-
Effect_exports.mapError(() => new McpError({ phase: "call", reason: "invalid_response" }))
|
|
66
|
-
);
|
|
67
119
|
return result;
|
|
68
120
|
})
|
|
69
121
|
};
|
|
70
122
|
return adapted;
|
|
71
123
|
});
|
|
72
124
|
var adaptMcpTools = (client) => Effect_exports.gen(function* () {
|
|
73
|
-
const metadata = yield* client.list;
|
|
125
|
+
const { tools: metadata } = yield* client.list;
|
|
74
126
|
const entries = yield* Effect_exports.forEach(
|
|
75
127
|
metadata,
|
|
76
128
|
(tool) => adaptMcpTool(client, tool).pipe(Effect_exports.map((adapted) => [tool.name, adapted]))
|
|
@@ -79,7 +131,11 @@ var adaptMcpTools = (client) => Effect_exports.gen(function* () {
|
|
|
79
131
|
});
|
|
80
132
|
|
|
81
133
|
// src/implementation/mcp-client.ts
|
|
82
|
-
import {
|
|
134
|
+
import {
|
|
135
|
+
ErrorCode as ErrorCode2,
|
|
136
|
+
ListToolsResultSchema,
|
|
137
|
+
McpError as ProtocolError2
|
|
138
|
+
} from "@modelcontextprotocol/sdk/types.js";
|
|
83
139
|
|
|
84
140
|
// src/implementation/mcp-call.ts
|
|
85
141
|
import {
|
|
@@ -208,6 +264,20 @@ var mcpCall = (client, name, input, context, timeoutMs, failure) => Effect_expor
|
|
|
208
264
|
);
|
|
209
265
|
|
|
210
266
|
// src/implementation/mcp-client.ts
|
|
267
|
+
var clientCodes = /* @__PURE__ */ new Set([
|
|
268
|
+
ErrorCode2.RequestTimeout,
|
|
269
|
+
ErrorCode2.ConnectionClosed
|
|
270
|
+
]);
|
|
271
|
+
var answeredError = (error) => {
|
|
272
|
+
if (!(error instanceof ProtocolError2) || clientCodes.has(error.code)) return void 0;
|
|
273
|
+
const prefix = `MCP error ${error.code}: `;
|
|
274
|
+
return bodyUpstreamError({
|
|
275
|
+
error: {
|
|
276
|
+
code: error.code,
|
|
277
|
+
message: error.message.startsWith(prefix) ? error.message.slice(prefix.length) : error.message
|
|
278
|
+
}
|
|
279
|
+
});
|
|
280
|
+
};
|
|
211
281
|
var mcpJsonSchemaValidator = {
|
|
212
282
|
getValidator(document) {
|
|
213
283
|
const decoder = Effect_exports.runSync(jsonSchemaDecoder(document));
|
|
@@ -233,7 +303,7 @@ function mcpClient(withClient, timeoutMs, failure) {
|
|
|
233
303
|
do {
|
|
234
304
|
const page = yield* Effect_exports.tryPromise({
|
|
235
305
|
// This session only reads metadata. listTools() also eagerly compiles
|
|
236
|
-
// every output validator;
|
|
306
|
+
// every output validator; mcpRouter validates the selected tool on call.
|
|
237
307
|
try: (signal) => client.request(
|
|
238
308
|
{ method: "tools/list", params: cursor === void 0 ? {} : { cursor } },
|
|
239
309
|
ListToolsResultSchema,
|
|
@@ -263,18 +333,52 @@ function mcpClient(withClient, timeoutMs, failure) {
|
|
|
263
333
|
cursors.add(cursor);
|
|
264
334
|
}
|
|
265
335
|
} while (cursor !== void 0);
|
|
266
|
-
|
|
336
|
+
const info = client.getServerVersion();
|
|
337
|
+
const instructions = client.getInstructions();
|
|
338
|
+
const icons = info?.icons?.flatMap(
|
|
339
|
+
(icon) => Option_exports.toArray(Schema_exports.decodeUnknownOption(RouterIcon)(icon))
|
|
340
|
+
);
|
|
341
|
+
const server = Schema_exports.decodeUnknownOption(McpServerHeader)({
|
|
342
|
+
...info?.name === void 0 ? {} : { name: info.name },
|
|
343
|
+
...info?.title === void 0 ? {} : { title: info.title },
|
|
344
|
+
...info?.version === void 0 ? {} : { version: info.version },
|
|
345
|
+
...info?.description === void 0 ? {} : { description: info.description },
|
|
346
|
+
...info?.websiteUrl === void 0 ? {} : { websiteUrl: info.websiteUrl },
|
|
347
|
+
...icons === void 0 ? {} : { icons },
|
|
348
|
+
...instructions === void 0 ? {} : { instructions }
|
|
349
|
+
});
|
|
350
|
+
return {
|
|
351
|
+
tools: [...tools.values()],
|
|
352
|
+
server: Option_exports.getOrElse(server, () => ({}))
|
|
353
|
+
};
|
|
267
354
|
})
|
|
268
355
|
).pipe(Effect_exports.withSpan("provider.mcp.discover"));
|
|
356
|
+
const check = withClient(
|
|
357
|
+
"discover",
|
|
358
|
+
(client) => Effect_exports.tryPromise({
|
|
359
|
+
try: (signal) => client.request({ method: "tools/list", params: {} }, ListToolsResultSchema, {
|
|
360
|
+
signal,
|
|
361
|
+
timeout: timeoutMs
|
|
362
|
+
}),
|
|
363
|
+
catch: (error) => failure("discover", error)
|
|
364
|
+
}).pipe(
|
|
365
|
+
Effect_exports.asVoid,
|
|
366
|
+
Effect_exports.withSpan("provider.mcp.request", {
|
|
367
|
+
kind: "client",
|
|
368
|
+
attributes: { "rpc.system.name": "jsonrpc", "rpc.method": "tools/list" }
|
|
369
|
+
})
|
|
370
|
+
)
|
|
371
|
+
).pipe(Effect_exports.withSpan("provider.mcp.check"));
|
|
269
372
|
const call = (name, input, context) => withClient("call", (client) => mcpCall(client, name, input, context, timeoutMs, failure)).pipe(
|
|
270
373
|
Effect_exports.withSpan("provider.mcp.call", { attributes: { "mcp.tool.name": name } })
|
|
271
374
|
);
|
|
272
|
-
return { list, call };
|
|
375
|
+
return { list, check, call };
|
|
273
376
|
}
|
|
274
377
|
|
|
275
378
|
export {
|
|
276
379
|
adaptMcpTool,
|
|
277
380
|
adaptMcpTools,
|
|
381
|
+
answeredError,
|
|
278
382
|
mcpJsonSchemaValidator,
|
|
279
383
|
mcpClient
|
|
280
384
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Schema_exports
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MXDKXAY4.js";
|
|
4
4
|
|
|
5
5
|
// src/contracts/ui-auth.ts
|
|
6
|
-
var AppSignInId = Schema_exports.String.check(Schema_exports.isPattern(/^[a-f0-9]{64}$/)).pipe(
|
|
6
|
+
var AppSignInId = Schema_exports.String.check(Schema_exports.isPattern(/^[a-f0-9]{64}$/u)).pipe(
|
|
7
7
|
Schema_exports.brand("AppSignInId")
|
|
8
8
|
);
|
|
9
9
|
var AppSignInCode = Schema_exports.RedactedFromValue(
|
|
10
|
-
Schema_exports.String.check(Schema_exports.isPattern(/^[a-f0-9]{64}$/))
|
|
10
|
+
Schema_exports.String.check(Schema_exports.isPattern(/^[a-f0-9]{64}$/u))
|
|
11
11
|
);
|
|
12
12
|
var AppReturnPath = Schema_exports.String.check(
|
|
13
13
|
Schema_exports.isMaxLength(8192),
|