apps 0.0.1-beta.5 → 0.0.1-beta.7
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 +65 -43
- package/framework-reference.json +1 -1
- package/js/{chunk-FWQC6I3C.js → chunk-5T57N25Q.js} +13 -1
- package/js/{chunk-TDNYXSIX.js → chunk-72JNVHPK.js} +21 -9
- package/js/{chunk-UDDE5KOR.js → chunk-CMYUWAX7.js} +26 -7
- package/js/chunk-FL2QR3XW.js +507 -0
- package/js/{chunk-G7T27IWB.js → chunk-MKWZPDR6.js} +1 -1
- package/js/{chunk-CYYBFC2K.js → chunk-NKLWZJLE.js} +1 -1
- package/js/{chunk-67EVWIGJ.js → chunk-OCYUEU47.js} +4 -4
- package/js/{chunk-YEPYT6SD.js → chunk-R3EV5FTO.js} +12 -0
- package/js/{chunk-XHO2ZX6W.js → chunk-RFVIONFX.js} +27 -10
- package/js/{chunk-LUVSFETN.js → chunk-UESPOTUI.js} +127 -231
- package/js/{chunk-DQAZTA4I.js → chunk-WLE7WX2U.js} +290 -20
- package/js/{chunk-C3VAOK5B.js → chunk-YXQHV65J.js} +53 -26
- package/js/chunk-Z5M2LQOZ.js +209 -0
- package/js/client.js +1 -1
- package/js/contracts.js +34 -11
- package/js/effect.js +9 -11
- package/js/graphql.js +25 -32
- package/js/host.js +9 -11
- package/js/index.js +194 -192
- package/js/mcp/effect.js +11 -13
- package/js/mcp/stdio.js +15 -17
- package/js/mcp.js +50 -36
- package/js/openapi.js +166 -108
- package/js/skills.js +6 -7
- package/package.json +1 -1
- package/runtime.json +1 -1
- package/types/apps/src/contracts/app.d.ts +2 -5
- package/types/apps/src/contracts/host.d.ts +19 -7
- package/types/apps/src/contracts/mcp.d.ts +16 -0
- package/types/apps/src/contracts/openapi.d.ts +4 -0
- package/types/apps/src/contracts/operations.d.ts +0 -5
- package/types/apps/src/contracts/protocol-version.d.ts +2 -2
- package/types/apps/src/contracts/protocols/4.d.ts +1229 -0
- package/types/apps/src/contracts/protocols/5.d.ts +1090 -0
- package/types/apps/src/contracts/provider.d.ts +51 -5
- package/types/apps/src/contracts/router.d.ts +59 -0
- 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/catalog-cache.d.ts +9 -2
- package/types/apps/src/implementation/graphql-catalog.d.ts +1 -4
- package/types/apps/src/implementation/mcp-catalog.d.ts +1 -4
- package/types/apps/src/implementation/mcp-client.d.ts +35 -19
- package/types/apps/src/implementation/mcp.d.ts +35 -19
- package/types/apps/src/implementation/openapi-compile.d.ts +2 -1
- package/types/apps/src/implementation/openapi-source.d.ts +2 -6
- package/types/apps/src/implementation/operations.d.ts +26 -3
- package/types/apps/src/implementation/protocol-operations.d.ts +3 -4
- package/types/apps/src/implementation/provider.d.ts +9 -4
- package/types/apps/src/implementation/router-catalog.d.ts +225 -0
- package/types/apps/src/implementation/router.d.ts +59 -0
- package/types/apps/src/implementation/schema.d.ts +5 -1
- package/types/apps/src/implementation/workflow-context.d.ts +1 -1
- package/types/apps/src/index.d.ts +5 -4
- package/types/apps/src/mcp-stdio.d.ts +2 -5
- package/types/apps/src/mcp.d.ts +5 -4
- package/types/apps/src/openapi.d.ts +6 -6
- package/js/chunk-3XKZDQLM.js +0 -93
- package/js/chunk-4M277YTM.js +0 -136
- package/js/chunk-SB3V4YVR.js +0 -18
- package/js/chunk-W4DMKWAB.js +0 -35
- package/types/apps/src/contracts/dynamic-tools.d.ts +0 -13
- package/types/apps/src/implementation/account-operations.d.ts +0 -151
- package/types/apps/src/implementation/dynamic-tools.d.ts +0 -8
package/js/mcp.js
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
import {
|
|
2
2
|
mcpClientEffect
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OCYUEU47.js";
|
|
4
4
|
import {
|
|
5
5
|
catalogCache
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-RFVIONFX.js";
|
|
7
7
|
import {
|
|
8
8
|
adaptMcpTool
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-CMYUWAX7.js";
|
|
10
10
|
import {
|
|
11
11
|
protocolOperations
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-72JNVHPK.js";
|
|
13
13
|
import "./chunk-BCSNKUAC.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-UESPOTUI.js";
|
|
15
15
|
import {
|
|
16
16
|
cacheKey
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-NKLWZJLE.js";
|
|
18
|
+
import "./chunk-FL2QR3XW.js";
|
|
18
19
|
import "./chunk-IPI4MFSN.js";
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-C3VAOK5B.js";
|
|
20
|
+
import "./chunk-YXQHV65J.js";
|
|
21
21
|
import "./chunk-ZQINWV4W.js";
|
|
22
22
|
import {
|
|
23
|
-
nativeOperation
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
nativeOperation,
|
|
24
|
+
routerDeclaration
|
|
25
|
+
} from "./chunk-Z5M2LQOZ.js";
|
|
26
|
+
import "./chunk-MKWZPDR6.js";
|
|
26
27
|
import {
|
|
27
28
|
McpError,
|
|
29
|
+
McpServerHeader,
|
|
28
30
|
McpToolMetadata,
|
|
29
31
|
McpToolsOptions
|
|
30
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-WLE7WX2U.js";
|
|
31
33
|
import "./chunk-N7YDVXYJ.js";
|
|
32
|
-
import "./chunk-
|
|
34
|
+
import "./chunk-R3EV5FTO.js";
|
|
33
35
|
import "./chunk-JU7VHODU.js";
|
|
34
|
-
import "./chunk-W4DMKWAB.js";
|
|
35
|
-
import "./chunk-SB3V4YVR.js";
|
|
36
36
|
import "./chunk-RJDDBDSN.js";
|
|
37
37
|
import "./chunk-57RKNWL2.js";
|
|
38
38
|
import "./chunk-UK573G7W.js";
|
|
39
|
-
import "./chunk-
|
|
39
|
+
import "./chunk-5T57N25Q.js";
|
|
40
40
|
import "./chunk-PZB6T6KU.js";
|
|
41
41
|
import "./chunk-27F7W2LG.js";
|
|
42
42
|
import {
|
|
@@ -50,6 +50,15 @@ var McpToolSummary = McpToolMetadata.mapFields(
|
|
|
50
50
|
({ inputSchema: _input, outputSchema: _output, _meta, ...fields }) => fields
|
|
51
51
|
);
|
|
52
52
|
var invoke = (work) => Effect_exports.tryPromise({ try: work, catch: (error) => error });
|
|
53
|
+
var serverMeta = (server) => {
|
|
54
|
+
const title = server.title ?? server.name;
|
|
55
|
+
return {
|
|
56
|
+
...title === void 0 ? {} : { title },
|
|
57
|
+
...server.description === void 0 ? {} : { description: server.description },
|
|
58
|
+
...server.instructions === void 0 ? {} : { instructions: server.instructions },
|
|
59
|
+
...server.icons === void 0 ? {} : { icons: server.icons }
|
|
60
|
+
};
|
|
61
|
+
};
|
|
53
62
|
var mcpCatalog = (options, kinds) => Effect_exports.gen(function* () {
|
|
54
63
|
const parsed = yield* Schema_exports.decodeUnknownEffect(McpToolsOptions)(options).pipe(
|
|
55
64
|
Effect_exports.mapError(() => new McpError({ phase: "connect", reason: "invalid_input" }))
|
|
@@ -59,27 +68,32 @@ var mcpCatalog = (options, kinds) => Effect_exports.gen(function* () {
|
|
|
59
68
|
headers[name] = value;
|
|
60
69
|
});
|
|
61
70
|
const id = yield* cacheKey({ url: parsed.url, headers, accountId: parsed.accountId ?? null });
|
|
62
|
-
const key = ["mcp-catalog-
|
|
71
|
+
const key = ["mcp-catalog-v3", id, "current"];
|
|
63
72
|
const cache = options.cache;
|
|
64
73
|
const changed = cache === void 0 ? void 0 : invoke(() => cache.invalidate(key));
|
|
65
74
|
const client = yield* mcpClientEffect(options, changed);
|
|
66
75
|
const catalog = yield* catalogCache({
|
|
67
76
|
...options,
|
|
68
|
-
prefix: ["mcp-catalog-
|
|
77
|
+
prefix: ["mcp-catalog-v3", id],
|
|
69
78
|
schema: McpToolMetadata,
|
|
70
79
|
summary: {
|
|
71
80
|
schema: McpToolSummary,
|
|
72
81
|
of: ({ inputSchema: _input, outputSchema: _output, _meta, ...summary }) => summary
|
|
73
82
|
},
|
|
74
|
-
load: (context) => context === void 0 ? client.list : mcpClientEffect(
|
|
83
|
+
load: (context) => (context === void 0 ? client.list : mcpClientEffect(
|
|
75
84
|
{ ...parsed, signal: context.signal },
|
|
76
85
|
invoke(() => context.cache.invalidate(key))
|
|
77
|
-
).pipe(Effect_exports.flatMap((source) => source.list))
|
|
86
|
+
).pipe(Effect_exports.flatMap((source) => source.list))).pipe(
|
|
87
|
+
Effect_exports.flatMap(
|
|
88
|
+
({ tools, server }) => Schema_exports.encodeEffect(McpServerHeader)(server).pipe(
|
|
89
|
+
Effect_exports.map((header) => ({ tools, header }))
|
|
90
|
+
)
|
|
91
|
+
)
|
|
92
|
+
)
|
|
78
93
|
});
|
|
79
94
|
const kindOf = (tool) => Object.hasOwn(kinds, tool.name) ? kinds[tool.name] ?? "mutation" : tool.annotations?.readOnlyHint === true ? "query" : "mutation";
|
|
80
|
-
const qualified = (tool) => `${kindOf(tool) === "query" ? "queries" : "mutations"}.${tool.name}`;
|
|
81
95
|
const summarize = (tool) => ({
|
|
82
|
-
name:
|
|
96
|
+
name: tool.name,
|
|
83
97
|
description: tool.description ?? tool.title ?? tool.name,
|
|
84
98
|
readOnly: kindOf(tool) === "query",
|
|
85
99
|
...tool.title === void 0 ? {} : { title: tool.title },
|
|
@@ -91,34 +105,34 @@ var mcpCatalog = (options, kinds) => Effect_exports.gen(function* () {
|
|
|
91
105
|
...tool.outputSchema === void 0 ? {} : { outputSchema: tool.outputSchema },
|
|
92
106
|
...tool._meta === void 0 ? {} : { _meta: tool._meta }
|
|
93
107
|
});
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
108
|
+
const router = {
|
|
109
|
+
kind: "dynamic",
|
|
110
|
+
meta: () => catalog.header().pipe(
|
|
111
|
+
Effect_exports.flatMap(
|
|
112
|
+
(header) => header === void 0 ? Effect_exports.succeed({}) : Schema_exports.decodeUnknownEffect(McpServerHeader)(header)
|
|
113
|
+
),
|
|
114
|
+
Effect_exports.map(serverMeta)
|
|
115
|
+
),
|
|
100
116
|
list: () => catalog.list().pipe(Effect_exports.map((tools) => tools.map(describe))),
|
|
101
117
|
summaries: () => catalog.summaries().pipe(Effect_exports.map((tools) => tools.map(summarize))),
|
|
102
|
-
describe: (name) =>
|
|
103
|
-
Effect_exports.map((tool) => tool === void 0 ? void 0 : describe(tool))
|
|
104
|
-
),
|
|
118
|
+
describe: (name) => catalog.resolve(name).pipe(Effect_exports.map((tool) => tool === void 0 ? void 0 : describe(tool))),
|
|
105
119
|
resolve: (name) => Effect_exports.gen(function* () {
|
|
106
|
-
const tool = yield*
|
|
120
|
+
const tool = yield* catalog.resolve(name);
|
|
107
121
|
if (tool === void 0) return void 0;
|
|
108
122
|
const adapted = yield* adaptMcpTool(client, tool);
|
|
109
123
|
const operations = protocolOperations({ selected: adapted }, { selected: kindOf(tool) });
|
|
110
|
-
return nativeOperation(operations.
|
|
124
|
+
return nativeOperation(operations.selected);
|
|
111
125
|
})
|
|
112
126
|
};
|
|
113
|
-
return
|
|
127
|
+
return routerDeclaration(router);
|
|
114
128
|
});
|
|
115
129
|
|
|
116
130
|
// src/mcp.ts
|
|
117
|
-
var
|
|
131
|
+
var mcpRouter = (options, kinds = {}) => Effect_exports.runPromise(
|
|
118
132
|
mcpCatalog(options, kinds),
|
|
119
133
|
options.signal === void 0 ? {} : { signal: options.signal }
|
|
120
134
|
);
|
|
121
135
|
export {
|
|
122
136
|
McpError,
|
|
123
|
-
|
|
137
|
+
mcpRouter
|
|
124
138
|
};
|
package/js/openapi.js
CHANGED
|
@@ -2,8 +2,9 @@ import {
|
|
|
2
2
|
parse
|
|
3
3
|
} from "./chunk-UVL56Z6E.js";
|
|
4
4
|
import {
|
|
5
|
-
protocolOperations
|
|
6
|
-
|
|
5
|
+
protocolOperations,
|
|
6
|
+
protocolRouter
|
|
7
|
+
} from "./chunk-72JNVHPK.js";
|
|
7
8
|
import {
|
|
8
9
|
OpenapiError,
|
|
9
10
|
OpenapiErrorResponse,
|
|
@@ -16,25 +17,30 @@ import {
|
|
|
16
17
|
isOpenapiTextMedia,
|
|
17
18
|
openapiBinaryResultSchema,
|
|
18
19
|
openapiMediaKind
|
|
19
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-FL2QR3XW.js";
|
|
21
|
+
import "./chunk-IPI4MFSN.js";
|
|
20
22
|
import {
|
|
21
23
|
fromPromise,
|
|
22
24
|
nativeOperation,
|
|
25
|
+
routerDeclaration,
|
|
23
26
|
toPromise
|
|
24
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-Z5M2LQOZ.js";
|
|
25
28
|
import {
|
|
26
29
|
accountProviderError,
|
|
27
30
|
httpProviderError
|
|
28
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-MKWZPDR6.js";
|
|
29
32
|
import {
|
|
30
33
|
ApiErrorRecovery,
|
|
31
34
|
ApiErrorResponse,
|
|
32
35
|
OpenapiResponseError,
|
|
36
|
+
RouterMeta,
|
|
33
37
|
defaultOpenapiErrorLimits
|
|
34
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-WLE7WX2U.js";
|
|
39
|
+
import "./chunk-N7YDVXYJ.js";
|
|
35
40
|
import {
|
|
36
41
|
ProviderError
|
|
37
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-R3EV5FTO.js";
|
|
43
|
+
import "./chunk-JU7VHODU.js";
|
|
38
44
|
import {
|
|
39
45
|
FetchHttpClient_exports
|
|
40
46
|
} from "./chunk-57RKNWL2.js";
|
|
@@ -47,12 +53,14 @@ import {
|
|
|
47
53
|
lazyJsonSchemaDecoder,
|
|
48
54
|
once,
|
|
49
55
|
wrap
|
|
50
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-5T57N25Q.js";
|
|
57
|
+
import "./chunk-PZB6T6KU.js";
|
|
51
58
|
import {
|
|
52
59
|
JsonObject,
|
|
53
60
|
JsonValue
|
|
54
61
|
} from "./chunk-27F7W2LG.js";
|
|
55
62
|
import {
|
|
63
|
+
Deferred_exports,
|
|
56
64
|
Duration_exports,
|
|
57
65
|
Effect_exports,
|
|
58
66
|
Encoding_exports,
|
|
@@ -2392,8 +2400,10 @@ var compileOpenApiDocument = (entry, inputDocument, options = {}) => Effect_expo
|
|
|
2392
2400
|
if (!path.startsWith("/") || path.includes("?") || path.includes("#"))
|
|
2393
2401
|
fail2("operation_path", "An operation has an invalid API path.");
|
|
2394
2402
|
const operationMethods = [];
|
|
2395
|
-
const
|
|
2396
|
-
|
|
2403
|
+
const resolved2 = document.resolve(record2(item[method.toLowerCase()]));
|
|
2404
|
+
const operation = Schema_exports.decodeUnknownSync(Operation)(resolved2);
|
|
2405
|
+
const tags = Option_exports.getOrUndefined(
|
|
2406
|
+
Schema_exports.decodeUnknownOption(Schema_exports.Array(Schema_exports.NonEmptyString))(resolved2.tags)
|
|
2397
2407
|
);
|
|
2398
2408
|
const name = names[index] ?? fail2("operation_path", "An operation has no name.");
|
|
2399
2409
|
if (built.some((op) => op.operation.name === name))
|
|
@@ -2539,6 +2549,7 @@ var compileOpenApiDocument = (entry, inputDocument, options = {}) => Effect_expo
|
|
|
2539
2549
|
methods: operationMethods,
|
|
2540
2550
|
operation: {
|
|
2541
2551
|
...streaming ? { streaming: true } : {},
|
|
2552
|
+
...tags === void 0 || tags.length === 0 ? {} : { tags },
|
|
2542
2553
|
name,
|
|
2543
2554
|
...operation.operationId === void 0 ? {} : { operationId: operation.operationId },
|
|
2544
2555
|
description: operation.summary ?? operation.description ?? name,
|
|
@@ -2648,7 +2659,43 @@ var compileOpenApiDocument = (entry, inputDocument, options = {}) => Effect_expo
|
|
|
2648
2659
|
});
|
|
2649
2660
|
|
|
2650
2661
|
// src/implementation/openapi-source.ts
|
|
2651
|
-
var Manifest = Schema_exports.Struct({
|
|
2662
|
+
var Manifest = Schema_exports.Struct({
|
|
2663
|
+
revision: Schema_exports.String,
|
|
2664
|
+
pages: Schema_exports.Number,
|
|
2665
|
+
meta: Schema_exports.optionalKey(RouterMeta)
|
|
2666
|
+
});
|
|
2667
|
+
var DocumentInfo = Schema_exports.Struct({
|
|
2668
|
+
info: Schema_exports.optionalKey(
|
|
2669
|
+
Schema_exports.Struct({
|
|
2670
|
+
title: Schema_exports.optionalKey(Schema_exports.String),
|
|
2671
|
+
summary: Schema_exports.optionalKey(Schema_exports.String),
|
|
2672
|
+
description: Schema_exports.optionalKey(Schema_exports.String)
|
|
2673
|
+
})
|
|
2674
|
+
),
|
|
2675
|
+
tags: Schema_exports.optionalKey(
|
|
2676
|
+
Schema_exports.Array(
|
|
2677
|
+
Schema_exports.Struct({
|
|
2678
|
+
name: Schema_exports.NonEmptyString,
|
|
2679
|
+
description: Schema_exports.optionalKey(Schema_exports.String)
|
|
2680
|
+
})
|
|
2681
|
+
)
|
|
2682
|
+
)
|
|
2683
|
+
});
|
|
2684
|
+
var documentMeta = (document) => {
|
|
2685
|
+
const parsed = Schema_exports.decodeUnknownOption(DocumentInfo)(document);
|
|
2686
|
+
if (Option_exports.isNone(parsed)) return void 0;
|
|
2687
|
+
const { info, tags } = parsed.value;
|
|
2688
|
+
const description = info?.description ?? info?.summary;
|
|
2689
|
+
const labels = (tags ?? []).flatMap(
|
|
2690
|
+
(tag) => tag.description === void 0 ? [] : [[tag.name, tag.description]]
|
|
2691
|
+
);
|
|
2692
|
+
const meta = {
|
|
2693
|
+
...info?.title === void 0 ? {} : { title: info.title },
|
|
2694
|
+
...description === void 0 ? {} : { description },
|
|
2695
|
+
...labels.length === 0 ? {} : { tags: Object.fromEntries(labels) }
|
|
2696
|
+
};
|
|
2697
|
+
return Object.keys(meta).length === 0 ? void 0 : meta;
|
|
2698
|
+
};
|
|
2652
2699
|
var Names = Schema_exports.Array(Schema_exports.String);
|
|
2653
2700
|
var StoredEntry = Schema_exports.fromJsonString(Schema_exports.Struct({ value: JsonValue }));
|
|
2654
2701
|
var schema = (decoder) => wrap(decoder, false);
|
|
@@ -2763,7 +2810,7 @@ var download = (url, context) => Effect_exports.gen(function* () {
|
|
|
2763
2810
|
catch: invalid
|
|
2764
2811
|
});
|
|
2765
2812
|
});
|
|
2766
|
-
var
|
|
2813
|
+
var liveOpenapiRouter = (options) => {
|
|
2767
2814
|
const freshFor = options.freshFor ?? "5 minutes";
|
|
2768
2815
|
const staleFor = options.staleFor ?? "1 day";
|
|
2769
2816
|
const retention = Duration_exports.toMillis(Duration_exports.fromInputUnsafe(freshFor)) + Duration_exports.toMillis(Duration_exports.fromInputUnsafe(staleFor)) + 3e5;
|
|
@@ -2872,17 +2919,31 @@ var liveOpenapiOperations = (options) => {
|
|
|
2872
2919
|
}
|
|
2873
2920
|
);
|
|
2874
2921
|
retain(revision, retained, retainedBytes);
|
|
2875
|
-
|
|
2922
|
+
const meta = documentMeta(document);
|
|
2923
|
+
return { revision, pages, ...meta === void 0 ? {} : { meta } };
|
|
2876
2924
|
});
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2925
|
+
let reading;
|
|
2926
|
+
const current = Effect_exports.suspend(() => {
|
|
2927
|
+
const shared = reading;
|
|
2928
|
+
if (shared !== void 0) return Deferred_exports.await(shared);
|
|
2929
|
+
const deferred = Deferred_exports.makeUnsafe();
|
|
2930
|
+
reading = deferred;
|
|
2931
|
+
return pointer.pipe(
|
|
2932
|
+
Effect_exports.flatMap(
|
|
2933
|
+
(key) => fromPromise(options.cache.get)({
|
|
2934
|
+
key,
|
|
2935
|
+
schema: schema(Manifest),
|
|
2936
|
+
freshFor,
|
|
2937
|
+
staleFor,
|
|
2938
|
+
load: toPromise(refresh)
|
|
2939
|
+
})
|
|
2940
|
+
),
|
|
2941
|
+
Effect_exports.onExit(
|
|
2942
|
+
(exit) => Effect_exports.sync(() => {
|
|
2943
|
+
if (reading === deferred) reading = void 0;
|
|
2944
|
+
}).pipe(Effect_exports.andThen(Deferred_exports.done(deferred, exit)))
|
|
2945
|
+
)
|
|
2946
|
+
);
|
|
2886
2947
|
});
|
|
2887
2948
|
const read = (revision, kind, names, decoder) => {
|
|
2888
2949
|
const retained = stored.get(revision);
|
|
@@ -2949,7 +3010,7 @@ var liveOpenapiOperations = (options) => {
|
|
|
2949
3010
|
const kinds = options.kinds ?? {};
|
|
2950
3011
|
return Object.hasOwn(kinds, key) ? kinds[key] ?? "mutation" : ["GET", "HEAD", "OPTIONS"].includes(op.method) ? "query" : "mutation";
|
|
2951
3012
|
};
|
|
2952
|
-
const
|
|
3013
|
+
const readOnly = (op) => kindOf(op) === "query";
|
|
2953
3014
|
const operationsFor = (manifest) => Effect_exports.gen(function* () {
|
|
2954
3015
|
const names = yield* namesFor(manifest);
|
|
2955
3016
|
if (names === void 0) return void 0;
|
|
@@ -2970,10 +3031,12 @@ var liveOpenapiOperations = (options) => {
|
|
|
2970
3031
|
}
|
|
2971
3032
|
return all;
|
|
2972
3033
|
});
|
|
2973
|
-
const summarize = (operation) => {
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
3034
|
+
const summarize = (operation) => ({
|
|
3035
|
+
name: operation.name,
|
|
3036
|
+
description: operation.description,
|
|
3037
|
+
readOnly: readOnly(operation),
|
|
3038
|
+
...operation.tags === void 0 ? {} : { tags: operation.tags }
|
|
3039
|
+
});
|
|
2977
3040
|
const describe = (operation, bundle) => ({
|
|
2978
3041
|
...summarize(operation),
|
|
2979
3042
|
inputSchema: bundle(parameterDefaultsInput(operation, options.parameterDefaults, true)),
|
|
@@ -2987,88 +3050,83 @@ var liveOpenapiOperations = (options) => {
|
|
|
2987
3050
|
}
|
|
2988
3051
|
return yield* invalid();
|
|
2989
3052
|
});
|
|
2990
|
-
return {
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
)
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
)
|
|
3020
|
-
|
|
3021
|
-
(
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
)
|
|
3033
|
-
|
|
3034
|
-
(
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
)
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
)
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
}
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
)
|
|
3063
|
-
}
|
|
3064
|
-
};
|
|
3053
|
+
return routerDeclaration({
|
|
3054
|
+
kind: "dynamic",
|
|
3055
|
+
meta: () => current.pipe(Effect_exports.map((manifest) => manifest.meta ?? {})),
|
|
3056
|
+
resolve: (name) => withRevision(
|
|
3057
|
+
(manifest) => Effect_exports.gen(function* () {
|
|
3058
|
+
const raw = name;
|
|
3059
|
+
const memoKey = `${manifest.revision}/${defaultedNames}/${raw}`;
|
|
3060
|
+
const memo = resolved.get(memoKey);
|
|
3061
|
+
const operation = memo?.operation ?? (yield* read(manifest.revision, "operation", [raw], OpenapiOperation))[0];
|
|
3062
|
+
if (operation === void 0) {
|
|
3063
|
+
const names = yield* namesFor(manifest);
|
|
3064
|
+
return names === void 0 || names.includes(raw) ? void 0 : { value: void 0 };
|
|
3065
|
+
}
|
|
3066
|
+
const definitions = memo?.definitions ?? (yield* definitionsFor(manifest.revision, operation));
|
|
3067
|
+
if (definitions === void 0) return void 0;
|
|
3068
|
+
const schemas = memo?.schemas ?? (yield* prepareOpenapiOperation(operation, definitions, options.parameterDefaults));
|
|
3069
|
+
if (memo === void 0) remember(memoKey, { operation, definitions, schemas });
|
|
3070
|
+
const tools = yield* openapiToolsEffect(
|
|
3071
|
+
{ ...options, operations: [operation], definitions },
|
|
3072
|
+
/* @__PURE__ */ new Map([[operation.name, schemas]])
|
|
3073
|
+
);
|
|
3074
|
+
const declarations = protocolOperations(tools, {
|
|
3075
|
+
[operation.name]: kindOf(operation)
|
|
3076
|
+
});
|
|
3077
|
+
const declaration = Object.hasOwn(declarations, raw) ? declarations[raw] : void 0;
|
|
3078
|
+
return { value: declaration === void 0 ? void 0 : nativeOperation(declaration) };
|
|
3079
|
+
})
|
|
3080
|
+
),
|
|
3081
|
+
list: () => withRevision(
|
|
3082
|
+
(manifest) => Effect_exports.gen(function* () {
|
|
3083
|
+
const all = yield* operationsFor(manifest);
|
|
3084
|
+
if (all === void 0) return void 0;
|
|
3085
|
+
const definitions = yield* definitionsFor(manifest.revision, all);
|
|
3086
|
+
if (definitions === void 0) return void 0;
|
|
3087
|
+
const bundle = bundler(definitions);
|
|
3088
|
+
const request = createRequest(options);
|
|
3089
|
+
return {
|
|
3090
|
+
value: all.filter((op) => request.available(op, options.account)).map((operation) => describe(operation, bundle))
|
|
3091
|
+
};
|
|
3092
|
+
})
|
|
3093
|
+
),
|
|
3094
|
+
summaries: () => withRevision(
|
|
3095
|
+
(manifest) => Effect_exports.gen(function* () {
|
|
3096
|
+
const all = yield* operationsFor(manifest);
|
|
3097
|
+
if (all === void 0) return void 0;
|
|
3098
|
+
const request = createRequest(options);
|
|
3099
|
+
return {
|
|
3100
|
+
value: all.filter((op) => request.available(op, options.account)).map((operation) => summarize(operation))
|
|
3101
|
+
};
|
|
3102
|
+
})
|
|
3103
|
+
),
|
|
3104
|
+
describe: (name) => withRevision(
|
|
3105
|
+
(manifest) => Effect_exports.gen(function* () {
|
|
3106
|
+
const raw = name;
|
|
3107
|
+
const operation = (yield* read(
|
|
3108
|
+
manifest.revision,
|
|
3109
|
+
"operation",
|
|
3110
|
+
[raw],
|
|
3111
|
+
OpenapiOperation
|
|
3112
|
+
))[0];
|
|
3113
|
+
if (operation === void 0) {
|
|
3114
|
+
const names = yield* namesFor(manifest);
|
|
3115
|
+
return names === void 0 || names.includes(raw) ? void 0 : { value: void 0 };
|
|
3116
|
+
}
|
|
3117
|
+
if (!createRequest(options).available(operation, options.account))
|
|
3118
|
+
return { value: void 0 };
|
|
3119
|
+
const definitions = yield* definitionsFor(manifest.revision, operation);
|
|
3120
|
+
if (definitions === void 0) return void 0;
|
|
3121
|
+
return { value: describe(operation, bundler(definitions)) };
|
|
3122
|
+
})
|
|
3123
|
+
)
|
|
3124
|
+
});
|
|
3065
3125
|
};
|
|
3066
3126
|
|
|
3067
3127
|
// src/openapi.ts
|
|
3068
|
-
var
|
|
3069
|
-
openapiToolsEffect(options).pipe(
|
|
3070
|
-
Effect_exports.map((operations) => protocolOperations(operations, kinds))
|
|
3071
|
-
),
|
|
3128
|
+
var openapiRouter = (options, kinds = {}) => Effect_exports.runPromise(
|
|
3129
|
+
openapiToolsEffect(options).pipe(Effect_exports.map((operations) => protocolRouter(operations, kinds))),
|
|
3072
3130
|
options.signal === void 0 ? {} : { signal: options.signal }
|
|
3073
3131
|
);
|
|
3074
3132
|
export {
|
|
@@ -3079,8 +3137,8 @@ export {
|
|
|
3079
3137
|
OpenapiParameter,
|
|
3080
3138
|
OpenapiRequestBody,
|
|
3081
3139
|
isOpenapiTextMedia,
|
|
3082
|
-
|
|
3140
|
+
liveOpenapiRouter,
|
|
3083
3141
|
openapiBinaryResultSchema,
|
|
3084
3142
|
openapiMediaKind,
|
|
3085
|
-
|
|
3143
|
+
openapiRouter
|
|
3086
3144
|
};
|
package/js/skills.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
catalogCache
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-RFVIONFX.js";
|
|
4
|
+
import "./chunk-NKLWZJLE.js";
|
|
5
5
|
import {
|
|
6
6
|
folderSkillsEffect,
|
|
7
7
|
skillFromFiles
|
|
8
8
|
} from "./chunk-IPI4MFSN.js";
|
|
9
9
|
import {
|
|
10
10
|
httpProviderError
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-MKWZPDR6.js";
|
|
12
|
+
import "./chunk-R3EV5FTO.js";
|
|
13
13
|
import {
|
|
14
14
|
AppSkillMetadata,
|
|
15
15
|
AppSkillSource,
|
|
@@ -20,7 +20,6 @@ import {
|
|
|
20
20
|
SkillServiceName,
|
|
21
21
|
skillLoadLimits
|
|
22
22
|
} from "./chunk-JU7VHODU.js";
|
|
23
|
-
import "./chunk-SB3V4YVR.js";
|
|
24
23
|
import {
|
|
25
24
|
FetchHttpClient_exports
|
|
26
25
|
} from "./chunk-57RKNWL2.js";
|
|
@@ -30,7 +29,7 @@ import {
|
|
|
30
29
|
} from "./chunk-UK573G7W.js";
|
|
31
30
|
import {
|
|
32
31
|
wrap
|
|
33
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-5T57N25Q.js";
|
|
34
33
|
import "./chunk-27F7W2LG.js";
|
|
35
34
|
import {
|
|
36
35
|
Effect_exports,
|
|
@@ -759,7 +758,7 @@ var cachedCatalog = (options, prefix, load) => options.cache === void 0 ? load(o
|
|
|
759
758
|
prefix,
|
|
760
759
|
schema: AppSkillSource,
|
|
761
760
|
summary: { schema: AppSkillMetadata, of: ({ files: _files, ...metadata }) => metadata },
|
|
762
|
-
load: (context) => context === void 0 ? load(options, options.cache) : load({ fetch: options.fetch, signal: context.signal }, context.cache)
|
|
761
|
+
load: (context) => (context === void 0 ? load(options, options.cache) : load({ fetch: options.fetch, signal: context.signal }, context.cache)).pipe(Effect_exports.map((tools) => ({ tools })))
|
|
763
762
|
}).pipe(
|
|
764
763
|
Effect_exports.flatMap((catalog) => catalog.list()),
|
|
765
764
|
Effect_exports.mapError(
|