apps 0.0.1-beta.19 → 0.0.1-beta.20
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 +4 -2
- package/framework-reference.json +1 -1
- package/js/{chunk-4EMWIFFJ.js → chunk-OZ4UK3CD.js} +8 -0
- package/js/graphql.js +14 -10
- package/js/mcp.js +15 -12
- package/js/skills.js +1 -1
- package/package.json +1 -1
- package/runtime.json +1 -1
- package/types/apps/src/implementation/catalog-cache.d.ts +25 -2
- package/types/apps/src/implementation/graphql-catalog.d.ts +3 -3
- package/types/apps/src/implementation/mcp-catalog.d.ts +6 -4
|
@@ -14,6 +14,13 @@ import {
|
|
|
14
14
|
} from "./chunk-CDL5PM2Q.js";
|
|
15
15
|
|
|
16
16
|
// src/implementation/catalog-cache.ts
|
|
17
|
+
var catalogScope = (options, invalid) => {
|
|
18
|
+
const { account, cache, headers } = options;
|
|
19
|
+
if (account === void 0)
|
|
20
|
+
return headers === void 0 ? Effect_exports.succeed(cache) : Effect_exports.fail(invalid());
|
|
21
|
+
if (cache === void 0) return Effect_exports.succeed(void 0);
|
|
22
|
+
return Effect_exports.try({ try: () => cache.forAccount(account), catch: invalid });
|
|
23
|
+
};
|
|
17
24
|
var schema = (decoder) => wrap(decoder, false);
|
|
18
25
|
var Manifest = Schema_exports.Struct({
|
|
19
26
|
revision: Schema_exports.String,
|
|
@@ -185,5 +192,6 @@ var catalogCache = (options) => Effect_exports.gen(function* () {
|
|
|
185
192
|
});
|
|
186
193
|
|
|
187
194
|
export {
|
|
195
|
+
catalogScope,
|
|
188
196
|
catalogCache
|
|
189
197
|
};
|
package/js/graphql.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
-
catalogCache
|
|
3
|
-
|
|
2
|
+
catalogCache,
|
|
3
|
+
catalogScope
|
|
4
|
+
} from "./chunk-OZ4UK3CD.js";
|
|
4
5
|
import {
|
|
5
6
|
protocolOperations
|
|
6
7
|
} from "./chunk-HQY4UTYX.js";
|
|
@@ -429,17 +430,20 @@ var GraphqlToolSummary = GraphqlToolDefinition.mapFields(({ name, kind, descript
|
|
|
429
430
|
description
|
|
430
431
|
}));
|
|
431
432
|
var graphqlCatalog = (options, kinds) => Effect_exports.gen(function* () {
|
|
432
|
-
const
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
433
|
+
const invalid = () => new GraphqlError({ phase: "discover", reason: "invalid_input" });
|
|
434
|
+
const parsed = yield* Schema_exports.decodeUnknownEffect(GraphqlToolsOptions)({
|
|
435
|
+
url: options.url,
|
|
436
|
+
accountId: options.account?.id,
|
|
437
|
+
headers: options.headers,
|
|
438
|
+
signal: options.signal,
|
|
439
|
+
timeoutMs: options.timeoutMs
|
|
440
|
+
}).pipe(Effect_exports.mapError(invalid));
|
|
441
|
+
const cache = yield* catalogScope(options, invalid);
|
|
442
|
+
const id = yield* cacheKey({ url: parsed.url });
|
|
440
443
|
const client = yield* graphqlClientEffect(parsed);
|
|
441
444
|
const catalog = yield* catalogCache({
|
|
442
445
|
...options,
|
|
446
|
+
cache,
|
|
443
447
|
prefix: ["graphql-catalog-v2", id],
|
|
444
448
|
schema: GraphqlToolDefinition,
|
|
445
449
|
summary: {
|
package/js/mcp.js
CHANGED
|
@@ -2,8 +2,9 @@ import {
|
|
|
2
2
|
mcpClientEffect
|
|
3
3
|
} from "./chunk-MAF4BRQF.js";
|
|
4
4
|
import {
|
|
5
|
-
catalogCache
|
|
6
|
-
|
|
5
|
+
catalogCache,
|
|
6
|
+
catalogScope
|
|
7
|
+
} from "./chunk-OZ4UK3CD.js";
|
|
7
8
|
import {
|
|
8
9
|
adaptMcpTool
|
|
9
10
|
} from "./chunk-7H44SOSX.js";
|
|
@@ -60,20 +61,22 @@ var serverMeta = (server) => {
|
|
|
60
61
|
};
|
|
61
62
|
};
|
|
62
63
|
var mcpCatalog = (options, kinds) => Effect_exports.gen(function* () {
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
64
|
+
const invalid = () => new McpError({ phase: "connect", reason: "invalid_input" });
|
|
65
|
+
const parsed = yield* Schema_exports.decodeUnknownEffect(McpToolsOptions)({
|
|
66
|
+
url: options.url,
|
|
67
|
+
accountId: options.account?.id,
|
|
68
|
+
headers: options.headers,
|
|
69
|
+
signal: options.signal,
|
|
70
|
+
timeoutMs: options.timeoutMs
|
|
71
|
+
}).pipe(Effect_exports.mapError(invalid));
|
|
72
|
+
const cache = yield* catalogScope(options, invalid);
|
|
73
|
+
const id = yield* cacheKey({ url: parsed.url });
|
|
71
74
|
const key = ["mcp-catalog-v3", id, "current"];
|
|
72
|
-
const cache = options.cache;
|
|
73
75
|
const changed = cache === void 0 ? void 0 : invoke(() => cache.invalidate(key));
|
|
74
|
-
const client = yield* mcpClientEffect(
|
|
76
|
+
const client = yield* mcpClientEffect(parsed, changed);
|
|
75
77
|
const catalog = yield* catalogCache({
|
|
76
78
|
...options,
|
|
79
|
+
cache,
|
|
77
80
|
prefix: ["mcp-catalog-v3", id],
|
|
78
81
|
schema: McpToolMetadata,
|
|
79
82
|
summary: {
|
package/js/skills.js
CHANGED