apps 0.0.1-beta.2 → 0.0.1-beta.21
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-SATWJKN6.js → chunk-27F7W2LG.js} +1 -1
- package/js/{chunk-WFSQXYUT.js → chunk-4QQ62BVS.js} +37 -3
- package/js/{chunk-HDJH3RPR.js → chunk-57RKNWL2.js} +2 -2
- package/js/chunk-625MBYU4.js +524 -0
- package/js/{chunk-RN2MXB4R.js → chunk-BLI53LPN.js} +28 -9
- package/js/{chunk-FW5HBOIK.js → chunk-CDL5PM2Q.js} +307 -169
- package/js/{chunk-J7O55ZV7.js → chunk-CHAK4P5C.js} +317 -176
- package/js/{chunk-HDTGZWP2.js → chunk-CMRKLZZY.js} +8 -8
- package/js/{chunk-OHRT55C4.js → chunk-IJX4CYZO.js} +3 -6
- package/js/{chunk-FDNTX5QJ.js → chunk-IPI4MFSN.js} +2 -2
- package/js/{chunk-YEJOQEII.js → chunk-JU7VHODU.js} +1 -1
- package/js/chunk-KUMBKVJD.js +39 -0
- package/js/{chunk-EVJUVWN2.js → chunk-M3B3DE4K.js} +2 -2
- package/js/{chunk-ZJWDMTE3.js → chunk-MKWZPDR6.js} +3 -3
- package/js/{chunk-BMOIAIVR.js → chunk-N7YDVXYJ.js} +49 -1
- package/js/{chunk-D47C7KG5.js → chunk-NKLWZJLE.js} +2 -2
- package/js/chunk-NMKHTJOQ.js +254 -0
- package/js/chunk-OD3KFKZD.js +1617 -0
- package/js/{chunk-ZCAMUXSG.js → chunk-ODEIDRGW.js} +3 -4
- package/js/{chunk-5MQZEB6Y.js → chunk-OZ4UK3CD.js} +37 -12
- package/js/{chunk-M6ZRRIBI.js → chunk-PJJ24GU7.js} +1 -1
- package/js/{chunk-FZJOYIZO.js → chunk-PZB6T6KU.js} +1 -1
- package/js/{chunk-LGIYBDWA.js → chunk-R3EV5FTO.js} +13 -1
- package/js/{chunk-Z5NMEGJN.js → chunk-RAAPJMVZ.js} +21 -9
- package/js/{chunk-QKHR7BMF.js → chunk-UK573G7W.js} +1 -1
- package/js/{chunk-4LPG6RCH.js → chunk-VFZKSM3T.js} +5 -25
- package/js/{chunk-MYYEW3RA.js → chunk-VXWY44LE.js} +780 -55
- package/js/{chunk-JN55AYQH.js → chunk-XNCYIB4D.js} +61 -32
- package/js/{chunk-PLCMJREA.js → chunk-ZQINWV4W.js} +60 -20
- package/js/client.js +10 -26
- package/js/contracts.js +74 -16
- package/js/effect.js +19 -20
- package/js/{es-APDZKREY.js → es-DIULA3ZF.js} +62 -1659
- package/js/graphql.js +47 -49
- package/js/host.js +19 -20
- package/js/index.js +232 -201
- package/js/mcp/effect.js +21 -22
- package/js/mcp/stdio.js +25 -26
- package/js/mcp.js +74 -56
- package/js/openapi.js +3428 -1276
- package/js/react.js +3 -3
- package/js/skills/effect.js +3 -3
- package/js/skills.js +12 -13
- package/js/storage/facet.js +4 -4
- package/js/ui/auth/contracts.js +8 -9
- package/js/ui/auth.js +16 -14
- package/js/ui/contracts.js +4 -4
- package/js/ui/serving.js +71 -218
- package/package.json +1 -1
- package/runtime.json +1 -1
- package/types/app-data/src/contracts/database.d.ts +33 -6
- package/types/app-data/src/implementation/schema.d.ts +2 -17
- package/types/apps/src/contracts/app.d.ts +7 -6
- package/types/apps/src/contracts/failure.d.ts +25 -0
- package/types/apps/src/contracts/host.d.ts +31 -10
- package/types/apps/src/contracts/mcp.d.ts +16 -0
- package/types/apps/src/contracts/openapi.d.ts +5 -1
- 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/1.d.ts +235 -67
- package/types/apps/src/contracts/protocols/2.d.ts +710 -0
- package/types/apps/src/contracts/protocols/3.d.ts +718 -0
- package/types/apps/src/contracts/protocols/4.d.ts +1299 -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/oauth.d.ts +89 -0
- package/types/apps/src/contracts/provider.d.ts +109 -10
- package/types/apps/src/contracts/router.d.ts +59 -0
- package/types/apps/src/contracts/storage.d.ts +3 -3
- package/types/apps/src/contracts/ui-auth.d.ts +6 -14
- package/types/apps/src/contracts/ui.d.ts +18 -0
- package/types/apps/src/contracts/workflows.d.ts +34 -3
- 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 +34 -4
- package/types/apps/src/implementation/elicitation.d.ts +2 -2
- package/types/apps/src/implementation/failure-detail.d.ts +26 -0
- package/types/apps/src/implementation/graphql-catalog.d.ts +4 -7
- package/types/apps/src/implementation/mcp-catalog.d.ts +7 -8
- 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 +9 -5
- package/types/apps/src/implementation/openapi-document.d.ts +15 -2
- package/types/apps/src/implementation/openapi-request.d.ts +8 -1
- package/types/apps/src/implementation/openapi-source.d.ts +2 -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/protocol-operations.d.ts +3 -4
- package/types/apps/src/implementation/provider.d.ts +19 -5
- package/types/apps/src/implementation/router-catalog.d.ts +225 -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 +44 -1
- package/types/apps/src/implementation/storage.d.ts +5 -3
- package/types/apps/src/implementation/ui-account-notice.d.ts +9 -0
- package/types/apps/src/implementation/ui-auth.d.ts +11 -5
- package/types/apps/src/implementation/ui-errors.d.ts +1 -1
- package/types/apps/src/implementation/ui-serving.d.ts +10 -4
- package/types/apps/src/implementation/ui-watch.d.ts +1 -1
- 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 +28 -11
- 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/types/apps/src/ui-auth.d.ts +2 -2
- package/types/telemetry/src/browser-operations.d.ts +5 -2
- package/js/chunk-PYUYJRSK.js +0 -93
- package/js/chunk-SWPD52J7.js +0 -35
- package/js/chunk-TE4KO4HI.js +0 -47
- package/js/chunk-W7D7WVSY.js +0 -18
- 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/stdio.js
CHANGED
|
@@ -2,37 +2,36 @@ import {
|
|
|
2
2
|
adaptMcpTools,
|
|
3
3
|
mcpClient,
|
|
4
4
|
mcpJsonSchemaValidator
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-BLI53LPN.js";
|
|
6
6
|
import {
|
|
7
|
-
|
|
8
|
-
} from "../chunk-
|
|
7
|
+
protocolRouter
|
|
8
|
+
} from "../chunk-RAAPJMVZ.js";
|
|
9
9
|
import "../chunk-BCSNKUAC.js";
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
10
|
+
import "../chunk-CHAK4P5C.js";
|
|
11
|
+
import "../chunk-NKLWZJLE.js";
|
|
12
|
+
import "../chunk-625MBYU4.js";
|
|
13
|
+
import "../chunk-IPI4MFSN.js";
|
|
14
|
+
import "../chunk-XNCYIB4D.js";
|
|
15
|
+
import "../chunk-ZQINWV4W.js";
|
|
16
|
+
import "../chunk-NMKHTJOQ.js";
|
|
17
|
+
import "../chunk-MKWZPDR6.js";
|
|
17
18
|
import {
|
|
18
19
|
McpError,
|
|
19
20
|
ProcessConfig
|
|
20
|
-
} from "../chunk-
|
|
21
|
-
import "../chunk-
|
|
22
|
-
import "../chunk-
|
|
23
|
-
import "../chunk-
|
|
24
|
-
import "../chunk-
|
|
25
|
-
import "../chunk-
|
|
26
|
-
import "../chunk-
|
|
27
|
-
import "../chunk-
|
|
28
|
-
import "../chunk-
|
|
29
|
-
import "../chunk-
|
|
30
|
-
import "../chunk-FZJOYIZO.js";
|
|
31
|
-
import "../chunk-SATWJKN6.js";
|
|
21
|
+
} from "../chunk-VXWY44LE.js";
|
|
22
|
+
import "../chunk-N7YDVXYJ.js";
|
|
23
|
+
import "../chunk-R3EV5FTO.js";
|
|
24
|
+
import "../chunk-JU7VHODU.js";
|
|
25
|
+
import "../chunk-ODEIDRGW.js";
|
|
26
|
+
import "../chunk-57RKNWL2.js";
|
|
27
|
+
import "../chunk-UK573G7W.js";
|
|
28
|
+
import "../chunk-4QQ62BVS.js";
|
|
29
|
+
import "../chunk-PZB6T6KU.js";
|
|
30
|
+
import "../chunk-27F7W2LG.js";
|
|
32
31
|
import {
|
|
33
32
|
Effect_exports,
|
|
34
33
|
Schema_exports
|
|
35
|
-
} from "../chunk-
|
|
34
|
+
} from "../chunk-CDL5PM2Q.js";
|
|
36
35
|
import "../chunk-CZ7CSFO4.js";
|
|
37
36
|
|
|
38
37
|
// src/implementation/mcp-stdio.ts
|
|
@@ -119,11 +118,11 @@ var stdioToolsEffect = (input) => Effect_exports.gen(function* () {
|
|
|
119
118
|
});
|
|
120
119
|
|
|
121
120
|
// src/mcp-stdio.ts
|
|
122
|
-
var
|
|
123
|
-
stdioToolsEffect(config).pipe(Effect_exports.map((tools) =>
|
|
121
|
+
var stdioRouter = (config, signal, kinds = {}) => Effect_exports.runPromise(
|
|
122
|
+
stdioToolsEffect(config).pipe(Effect_exports.map((tools) => protocolRouter(tools, kinds))),
|
|
124
123
|
signal === void 0 ? {} : { signal }
|
|
125
124
|
);
|
|
126
125
|
export {
|
|
127
126
|
McpError,
|
|
128
|
-
|
|
127
|
+
stdioRouter
|
|
129
128
|
};
|
package/js/mcp.js
CHANGED
|
@@ -1,47 +1,49 @@
|
|
|
1
1
|
import {
|
|
2
2
|
mcpClientEffect
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-CMRKLZZY.js";
|
|
4
4
|
import {
|
|
5
|
-
catalogCache
|
|
6
|
-
|
|
5
|
+
catalogCache,
|
|
6
|
+
catalogScope
|
|
7
|
+
} from "./chunk-OZ4UK3CD.js";
|
|
7
8
|
import {
|
|
8
9
|
adaptMcpTool
|
|
9
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-BLI53LPN.js";
|
|
10
11
|
import {
|
|
11
12
|
protocolOperations
|
|
12
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-RAAPJMVZ.js";
|
|
13
14
|
import "./chunk-BCSNKUAC.js";
|
|
14
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-CHAK4P5C.js";
|
|
15
16
|
import {
|
|
16
17
|
cacheKey
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
18
|
+
} from "./chunk-NKLWZJLE.js";
|
|
19
|
+
import "./chunk-625MBYU4.js";
|
|
20
|
+
import "./chunk-IPI4MFSN.js";
|
|
21
|
+
import "./chunk-XNCYIB4D.js";
|
|
22
|
+
import "./chunk-ZQINWV4W.js";
|
|
21
23
|
import {
|
|
22
|
-
nativeOperation
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
nativeOperation,
|
|
25
|
+
routerDeclaration
|
|
26
|
+
} from "./chunk-NMKHTJOQ.js";
|
|
27
|
+
import "./chunk-MKWZPDR6.js";
|
|
25
28
|
import {
|
|
26
29
|
McpError,
|
|
30
|
+
McpServerHeader,
|
|
27
31
|
McpToolMetadata,
|
|
28
32
|
McpToolsOptions
|
|
29
|
-
} from "./chunk-
|
|
30
|
-
import "./chunk-
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-
|
|
33
|
-
import "./chunk-
|
|
34
|
-
import "./chunk-
|
|
35
|
-
import "./chunk-
|
|
36
|
-
import "./chunk-
|
|
37
|
-
import "./chunk-
|
|
38
|
-
import "./chunk-
|
|
39
|
-
import "./chunk-FZJOYIZO.js";
|
|
40
|
-
import "./chunk-SATWJKN6.js";
|
|
33
|
+
} from "./chunk-VXWY44LE.js";
|
|
34
|
+
import "./chunk-N7YDVXYJ.js";
|
|
35
|
+
import "./chunk-R3EV5FTO.js";
|
|
36
|
+
import "./chunk-JU7VHODU.js";
|
|
37
|
+
import "./chunk-ODEIDRGW.js";
|
|
38
|
+
import "./chunk-57RKNWL2.js";
|
|
39
|
+
import "./chunk-UK573G7W.js";
|
|
40
|
+
import "./chunk-4QQ62BVS.js";
|
|
41
|
+
import "./chunk-PZB6T6KU.js";
|
|
42
|
+
import "./chunk-27F7W2LG.js";
|
|
41
43
|
import {
|
|
42
44
|
Effect_exports,
|
|
43
45
|
Schema_exports
|
|
44
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-CDL5PM2Q.js";
|
|
45
47
|
import "./chunk-CZ7CSFO4.js";
|
|
46
48
|
|
|
47
49
|
// src/implementation/mcp-catalog.ts
|
|
@@ -49,36 +51,52 @@ var McpToolSummary = McpToolMetadata.mapFields(
|
|
|
49
51
|
({ inputSchema: _input, outputSchema: _output, _meta, ...fields }) => fields
|
|
50
52
|
);
|
|
51
53
|
var invoke = (work) => Effect_exports.tryPromise({ try: work, catch: (error) => error });
|
|
54
|
+
var serverMeta = (server) => {
|
|
55
|
+
const title = server.title ?? server.name;
|
|
56
|
+
return {
|
|
57
|
+
...title === void 0 ? {} : { title },
|
|
58
|
+
...server.description === void 0 ? {} : { description: server.description },
|
|
59
|
+
...server.instructions === void 0 ? {} : { instructions: server.instructions },
|
|
60
|
+
...server.icons === void 0 ? {} : { icons: server.icons }
|
|
61
|
+
};
|
|
62
|
+
};
|
|
52
63
|
var mcpCatalog = (options, kinds) => Effect_exports.gen(function* () {
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
const
|
|
62
|
-
const
|
|
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 });
|
|
74
|
+
const key = ["mcp-catalog-v3", id, "current"];
|
|
63
75
|
const changed = cache === void 0 ? void 0 : invoke(() => cache.invalidate(key));
|
|
64
|
-
const client = yield* mcpClientEffect(
|
|
76
|
+
const client = yield* mcpClientEffect(parsed, changed);
|
|
65
77
|
const catalog = yield* catalogCache({
|
|
66
78
|
...options,
|
|
67
|
-
|
|
79
|
+
cache,
|
|
80
|
+
prefix: ["mcp-catalog-v3", id],
|
|
68
81
|
schema: McpToolMetadata,
|
|
69
82
|
summary: {
|
|
70
83
|
schema: McpToolSummary,
|
|
71
84
|
of: ({ inputSchema: _input, outputSchema: _output, _meta, ...summary }) => summary
|
|
72
85
|
},
|
|
73
|
-
load: (context) => context === void 0 ? client.list : mcpClientEffect(
|
|
86
|
+
load: (context) => (context === void 0 ? client.list : mcpClientEffect(
|
|
74
87
|
{ ...parsed, signal: context.signal },
|
|
75
88
|
invoke(() => context.cache.invalidate(key))
|
|
76
|
-
).pipe(Effect_exports.flatMap((source) => source.list))
|
|
89
|
+
).pipe(Effect_exports.flatMap((source) => source.list))).pipe(
|
|
90
|
+
Effect_exports.flatMap(
|
|
91
|
+
({ tools, server }) => Schema_exports.encodeEffect(McpServerHeader)(server).pipe(
|
|
92
|
+
Effect_exports.map((header) => ({ tools, header }))
|
|
93
|
+
)
|
|
94
|
+
)
|
|
95
|
+
)
|
|
77
96
|
});
|
|
78
97
|
const kindOf = (tool) => Object.hasOwn(kinds, tool.name) ? kinds[tool.name] ?? "mutation" : tool.annotations?.readOnlyHint === true ? "query" : "mutation";
|
|
79
|
-
const qualified = (tool) => `${kindOf(tool) === "query" ? "queries" : "mutations"}.${tool.name}`;
|
|
80
98
|
const summarize = (tool) => ({
|
|
81
|
-
name:
|
|
99
|
+
name: tool.name,
|
|
82
100
|
description: tool.description ?? tool.title ?? tool.name,
|
|
83
101
|
readOnly: kindOf(tool) === "query",
|
|
84
102
|
...tool.title === void 0 ? {} : { title: tool.title },
|
|
@@ -90,34 +108,34 @@ var mcpCatalog = (options, kinds) => Effect_exports.gen(function* () {
|
|
|
90
108
|
...tool.outputSchema === void 0 ? {} : { outputSchema: tool.outputSchema },
|
|
91
109
|
...tool._meta === void 0 ? {} : { _meta: tool._meta }
|
|
92
110
|
});
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
111
|
+
const router = {
|
|
112
|
+
kind: "dynamic",
|
|
113
|
+
meta: () => catalog.header().pipe(
|
|
114
|
+
Effect_exports.flatMap(
|
|
115
|
+
(header) => header === void 0 ? Effect_exports.succeed({}) : Schema_exports.decodeUnknownEffect(McpServerHeader)(header)
|
|
116
|
+
),
|
|
117
|
+
Effect_exports.map(serverMeta)
|
|
118
|
+
),
|
|
99
119
|
list: () => catalog.list().pipe(Effect_exports.map((tools) => tools.map(describe))),
|
|
100
120
|
summaries: () => catalog.summaries().pipe(Effect_exports.map((tools) => tools.map(summarize))),
|
|
101
|
-
describe: (name) =>
|
|
102
|
-
Effect_exports.map((tool) => tool === void 0 ? void 0 : describe(tool))
|
|
103
|
-
),
|
|
121
|
+
describe: (name) => catalog.resolve(name).pipe(Effect_exports.map((tool) => tool === void 0 ? void 0 : describe(tool))),
|
|
104
122
|
resolve: (name) => Effect_exports.gen(function* () {
|
|
105
|
-
const tool = yield*
|
|
123
|
+
const tool = yield* catalog.resolve(name);
|
|
106
124
|
if (tool === void 0) return void 0;
|
|
107
125
|
const adapted = yield* adaptMcpTool(client, tool);
|
|
108
126
|
const operations = protocolOperations({ selected: adapted }, { selected: kindOf(tool) });
|
|
109
|
-
return nativeOperation(operations.
|
|
127
|
+
return nativeOperation(operations.selected);
|
|
110
128
|
})
|
|
111
129
|
};
|
|
112
|
-
return
|
|
130
|
+
return routerDeclaration(router);
|
|
113
131
|
});
|
|
114
132
|
|
|
115
133
|
// src/mcp.ts
|
|
116
|
-
var
|
|
134
|
+
var mcpRouter = (options, kinds = {}) => Effect_exports.runPromise(
|
|
117
135
|
mcpCatalog(options, kinds),
|
|
118
136
|
options.signal === void 0 ? {} : { signal: options.signal }
|
|
119
137
|
);
|
|
120
138
|
export {
|
|
121
139
|
McpError,
|
|
122
|
-
|
|
140
|
+
mcpRouter
|
|
123
141
|
};
|