apps 0.0.1-beta.1 → 0.0.1-beta.100
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 +112 -72
- package/framework-reference.json +1 -1
- package/js/browser-XIPJGLH2.js +65 -0
- package/js/chunk-2CURR5Y7.js +264 -0
- package/js/chunk-2LSGC7XY.js +42 -0
- package/js/{chunk-YEJOQEII.js → chunk-4PIQKACY.js} +65 -10
- package/js/chunk-4UPC36ZL.js +5185 -0
- package/js/{chunk-4LPG6RCH.js → chunk-4X2UI4R2.js} +7 -27
- package/js/chunk-5C6RAGAS.js +335 -0
- package/js/chunk-62NVUKED.js +39 -0
- package/js/chunk-74H25C4X.js +95 -0
- package/js/chunk-7HG422GB.js +90 -0
- package/js/chunk-7STIP5CS.js +171 -0
- package/js/{chunk-QKHR7BMF.js → chunk-ACQXVKVQ.js} +87 -51
- package/js/{chunk-OHRT55C4.js → chunk-DILSCQPJ.js} +226 -265
- package/js/chunk-ILYCJ3HV.js +449 -0
- package/js/chunk-K6TSCYAO.js +712 -0
- package/js/{chunk-EVJUVWN2.js → chunk-KLSEU35Y.js} +463 -218
- package/js/chunk-OD3KFKZD.js +1617 -0
- package/js/chunk-OWN3DP2W.js +88 -0
- package/js/{chunk-ZTFQHGEB.js → chunk-PBGPES67.js} +3 -5
- package/js/chunk-QI66R4FP.js +786 -0
- package/js/chunk-RN4YB4JT.js +1922 -0
- package/js/{chunk-ZCAMUXSG.js → chunk-URKOTNDA.js} +795 -177
- package/js/{chunk-NCYXZN2G.js → chunk-UVL56Z6E.js} +390 -23
- package/js/{chunk-2HHMABB6.js → chunk-VAI3EVCS.js} +700 -78
- package/js/chunk-VCYWAA4N.js +49 -0
- package/js/{chunk-HDJH3RPR.js → chunk-YDW7DX3A.js} +4 -4
- package/js/chunk-YWVISRZD.js +268 -0
- package/js/{chunk-FW5HBOIK.js → chunk-ZKDXML77.js} +19272 -18299
- package/js/client.js +148 -100
- package/js/contracts.js +208 -24
- package/js/effect.js +18 -19
- package/js/es-DIULA3ZF.js +39371 -0
- package/js/graphql.js +62 -58
- package/js/host.js +83 -60
- package/js/index.js +381 -263
- package/js/mcp/effect.js +21 -21
- package/js/mcp.js +117 -74
- package/js/openapi.js +4613 -42691
- package/js/react.js +2 -3
- package/js/skills/effect.js +6 -4
- package/js/skills.js +233 -70
- package/js/storage/facet.js +1 -540
- package/js/ui/auth/contracts.js +8 -9
- package/js/ui/auth.js +16 -14
- package/js/ui/contracts.js +9 -8
- package/js/ui/serving.js +8609 -227
- package/package.json +3 -8
- package/runtime.json +1 -1
- package/types/app-cache/src/contracts/cache.d.ts +60 -2
- package/types/app-cache/src/index.d.ts +92 -2
- 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 +63 -17
- package/types/apps/src/contracts/cache.d.ts +24 -1
- package/types/apps/src/contracts/context.d.ts +60 -17
- package/types/apps/src/contracts/elicitation.d.ts +23 -7
- package/types/apps/src/contracts/events.d.ts +94 -0
- 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 +1325 -534
- package/types/apps/src/contracts/icons.d.ts +28 -0
- package/types/apps/src/contracts/live.d.ts +2 -0
- package/types/apps/src/contracts/mcp.d.ts +97 -20
- package/types/apps/src/contracts/network.d.ts +120 -0
- package/types/apps/src/contracts/openapi-compile.d.ts +82 -3
- package/types/apps/src/contracts/openapi-document.d.ts +1 -1
- package/types/apps/src/contracts/openapi.d.ts +51 -9
- package/types/apps/src/contracts/operations.d.ts +14 -12
- package/types/apps/src/contracts/placement.d.ts +102 -0
- package/types/apps/src/contracts/protocol-version.d.ts +6 -0
- package/types/apps/src/contracts/protocols/1.d.ts +2241 -0
- package/types/apps/src/contracts/protocols/10.d.ts +1450 -0
- package/types/apps/src/contracts/protocols/11.d.ts +1149 -0
- package/types/apps/src/contracts/protocols/12.d.ts +3310 -0
- package/types/apps/src/contracts/protocols/2.d.ts +711 -0
- package/types/apps/src/contracts/protocols/3.d.ts +776 -0
- package/types/apps/src/contracts/protocols/4.d.ts +1306 -0
- package/types/apps/src/contracts/protocols/5.d.ts +1200 -0
- package/types/apps/src/contracts/protocols/6.d.ts +1629 -0
- package/types/apps/src/contracts/protocols/7.d.ts +1785 -0
- package/types/apps/src/contracts/protocols/8.d.ts +1182 -0
- package/types/apps/src/contracts/protocols/9.d.ts +1104 -0
- package/types/apps/src/contracts/protocols/current.d.ts +6857 -0
- package/types/apps/src/contracts/protocols/oauth-6.d.ts +74 -0
- package/types/apps/src/contracts/protocols/oauth.d.ts +134 -0
- package/types/apps/src/contracts/provider-error.d.ts +9 -0
- package/types/apps/src/contracts/provider.d.ts +140 -10
- package/types/apps/src/contracts/router.d.ts +59 -0
- package/types/apps/src/contracts/schedules.d.ts +7 -1
- package/types/apps/src/contracts/schema.d.ts +21 -0
- package/types/apps/src/contracts/shared-catalog.d.ts +11 -0
- package/types/apps/src/contracts/skills.d.ts +60 -14
- package/types/apps/src/contracts/sql.d.ts +63 -0
- package/types/apps/src/contracts/ui-auth.d.ts +6 -14
- package/types/apps/src/contracts/ui.d.ts +70 -30
- package/types/apps/src/contracts/webhooks.d.ts +24 -7
- package/types/apps/src/contracts/workflows.d.ts +89 -36
- package/types/apps/src/facet.d.ts +4 -5
- package/types/apps/src/graphql.d.ts +1 -3
- package/types/apps/src/host.d.ts +5 -0
- package/types/apps/src/implementation/account-router.d.ts +13 -0
- package/types/apps/src/implementation/app.d.ts +44 -16
- package/types/apps/src/implementation/authoring.d.ts +25 -5
- package/types/apps/src/implementation/browser-scripts.gen.d.ts +6 -0
- package/types/apps/src/implementation/cache.d.ts +32 -3
- package/types/apps/src/implementation/catalog-cache.d.ts +43 -5
- package/types/apps/src/implementation/elicitation.d.ts +18 -15
- package/types/apps/src/implementation/events.d.ts +64 -0
- package/types/apps/src/implementation/failure-detail.d.ts +48 -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 +6 -2
- package/types/apps/src/implementation/invocation-timing.d.ts +18 -0
- 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-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 +30 -8
- package/types/apps/src/implementation/openapi-document.d.ts +46 -21
- package/types/apps/src/implementation/openapi-names.d.ts +23 -0
- package/types/apps/src/implementation/openapi-request.d.ts +10 -3
- package/types/apps/src/implementation/openapi-source.d.ts +30 -8
- package/types/apps/src/implementation/openapi-upgrade.d.ts +4 -0
- package/types/apps/src/implementation/operations.d.ts +84 -10
- package/types/apps/src/implementation/optimistic.d.ts +1 -1
- package/types/apps/src/implementation/placement.d.ts +60 -0
- 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 +26 -6
- package/types/apps/src/implementation/query-commit.d.ts +1 -1
- package/types/apps/src/implementation/router-catalog.d.ts +227 -0
- package/types/apps/src/implementation/router.d.ts +78 -0
- package/types/apps/src/implementation/runtime-yield.d.ts +7 -0
- package/types/apps/src/implementation/schedules.d.ts +39 -8
- package/types/apps/src/implementation/schema.d.ts +111 -15
- package/types/apps/src/implementation/skills.d.ts +18 -24
- package/types/apps/src/implementation/sql.d.ts +71 -0
- package/types/apps/src/implementation/swagger-client.d.ts +28 -0
- package/types/apps/src/implementation/ui-account-notice.d.ts +9 -0
- package/types/apps/src/implementation/ui-auth.d.ts +12 -6
- package/types/apps/src/implementation/ui-client.d.ts +3 -3
- 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 +31 -12
- 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 +15 -6
- package/types/apps/src/implementation/workflow-context.d.ts +17 -5
- package/types/apps/src/implementation/workflows.d.ts +11 -4
- package/types/apps/src/index.d.ts +71 -21
- package/types/apps/src/mcp.d.ts +25 -5
- package/types/apps/src/openapi.d.ts +11 -6
- package/types/apps/src/react.d.ts +1 -1
- package/types/apps/src/skills.d.ts +13 -8
- package/types/apps/src/ui-auth.d.ts +2 -2
- package/types/apps/src/ui-serving.d.ts +1 -1
- package/types/telemetry/src/app-records.d.ts +42 -0
- package/types/telemetry/src/browser-operations.d.ts +7 -4
- package/types/telemetry/src/browser.d.ts +8 -3
- package/types/telemetry/src/config.d.ts +2 -2
- package/types/telemetry/src/index.d.ts +2 -1
- package/types/telemetry/src/layer.d.ts +10 -4
- package/types/telemetry/src/measurements.d.ts +1 -1
- package/types/telemetry/src/ownership.d.ts +60 -0
- package/types/telemetry/src/recorded-failure.d.ts +29 -0
- package/types/telemetry/src/relay.d.ts +16 -6
- package/types/telemetry/src/span-attributes.d.ts +17 -1
- package/types/telemetry/src/transport.d.ts +8 -1
- package/types/utils/src/api-error.d.ts +55 -0
- package/types/utils/src/connection-failure.d.ts +33 -0
- package/types/utils/src/legacy-keys.d.ts +20 -0
- package/types/utils/src/recorded-message.d.ts +18 -0
- package/types/utils/src/schema-definitions.d.ts +13 -0
- package/types/utils/src/user-facing-error.d.ts +83 -0
- package/js/chunk-6IIO4NPI.js +0 -29
- package/js/chunk-6YBRWRK3.js +0 -160
- package/js/chunk-BMOIAIVR.js +0 -138
- package/js/chunk-FZJOYIZO.js +0 -19
- package/js/chunk-G7IE6BKC.js +0 -224
- package/js/chunk-IHQ4ML7K.js +0 -2193
- package/js/chunk-KOXMLKTM.js +0 -1288
- package/js/chunk-M6ZRRIBI.js +0 -877
- package/js/chunk-PLCMJREA.js +0 -590
- package/js/chunk-PZ36XMXW.js +0 -93
- package/js/chunk-RBAC33PQ.js +0 -267
- package/js/chunk-SATWJKN6.js +0 -34
- package/js/chunk-SWPD52J7.js +0 -35
- package/js/chunk-TE4KO4HI.js +0 -47
- package/js/chunk-W7D7WVSY.js +0 -18
- package/js/chunk-X7SFGU4Q.js +0 -280
- package/js/chunk-ZJWDMTE3.js +0 -63
- package/js/mcp/stdio.js +0 -128
- 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/mcp-stdio.d.ts +0 -4
- package/types/apps/src/implementation/storage.d.ts +0 -13
- package/types/apps/src/mcp-stdio.d.ts +0 -8
package/js/chunk-6IIO4NPI.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
operationDeclaration
|
|
3
|
-
} from "./chunk-PZ36XMXW.js";
|
|
4
|
-
|
|
5
|
-
// src/implementation/protocol-operations.ts
|
|
6
|
-
var protocolOperations = (operations, kinds = {}) => {
|
|
7
|
-
const queries = {};
|
|
8
|
-
const mutations = {};
|
|
9
|
-
for (const [name, operation] of Object.entries(operations)) {
|
|
10
|
-
const kind = Object.hasOwn(kinds, name) ? kinds[name] : operation.readOnly === true ? "query" : "mutation";
|
|
11
|
-
const native = {
|
|
12
|
-
description: operation.description,
|
|
13
|
-
...operation.title === void 0 ? {} : { title: operation.title },
|
|
14
|
-
...operation.annotations === void 0 ? {} : { annotations: operation.annotations },
|
|
15
|
-
...operation._meta === void 0 ? {} : { _meta: operation._meta },
|
|
16
|
-
input: operation.input,
|
|
17
|
-
run: operation.run
|
|
18
|
-
};
|
|
19
|
-
const output = Object.getOwnPropertyDescriptor(operation, "outputSchema");
|
|
20
|
-
const withOutput = (target) => output === void 0 || output.get === void 0 && output.value === void 0 ? target : Object.defineProperty(target, "outputSchema", { ...output, enumerable: true });
|
|
21
|
-
if (kind === "query") queries[name] = operationDeclaration(withOutput({ ...native, kind }));
|
|
22
|
-
else mutations[name] = operationDeclaration(withOutput({ ...native, kind: "mutation" }));
|
|
23
|
-
}
|
|
24
|
-
return { queries, mutations };
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export {
|
|
28
|
-
protocolOperations
|
|
29
|
-
};
|
package/js/chunk-6YBRWRK3.js
DELETED
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CacheError
|
|
3
|
-
} from "./chunk-RBAC33PQ.js";
|
|
4
|
-
import {
|
|
5
|
-
wrap
|
|
6
|
-
} from "./chunk-2HHMABB6.js";
|
|
7
|
-
import {
|
|
8
|
-
JsonObject
|
|
9
|
-
} from "./chunk-SATWJKN6.js";
|
|
10
|
-
import {
|
|
11
|
-
Duration_exports,
|
|
12
|
-
Effect_exports,
|
|
13
|
-
Schema_exports
|
|
14
|
-
} from "./chunk-FW5HBOIK.js";
|
|
15
|
-
|
|
16
|
-
// src/implementation/catalog-cache.ts
|
|
17
|
-
var schema = (decoder) => wrap(decoder, false);
|
|
18
|
-
var Manifest = Schema_exports.Struct({
|
|
19
|
-
revision: Schema_exports.String,
|
|
20
|
-
pages: Schema_exports.Int,
|
|
21
|
-
summaries: Schema_exports.Int
|
|
22
|
-
});
|
|
23
|
-
var invoke = (work) => Effect_exports.tryPromise({ try: work, catch: (error) => error });
|
|
24
|
-
var catalogCache = (options) => Effect_exports.gen(function* () {
|
|
25
|
-
const cache = options.cache;
|
|
26
|
-
const key = [...options.prefix, "current"];
|
|
27
|
-
const part = (revision, kind, name) => [
|
|
28
|
-
...options.prefix,
|
|
29
|
-
revision,
|
|
30
|
-
kind,
|
|
31
|
-
name
|
|
32
|
-
];
|
|
33
|
-
const freshFor = options.freshFor ?? "5 minutes";
|
|
34
|
-
const staleFor = options.staleFor ?? "1 day";
|
|
35
|
-
const retention = Duration_exports.toMillis(Duration_exports.fromInputUnsafe(freshFor)) + Duration_exports.toMillis(Duration_exports.fromInputUnsafe(staleFor)) + 3e5;
|
|
36
|
-
const local = yield* Effect_exports.cached(options.load());
|
|
37
|
-
const refresh = (context) => Effect_exports.gen(function* () {
|
|
38
|
-
const tools = yield* options.load(context);
|
|
39
|
-
const digest = yield* invoke(
|
|
40
|
-
() => crypto.subtle.digest("SHA-256", new TextEncoder().encode(JSON.stringify(tools)))
|
|
41
|
-
);
|
|
42
|
-
const revision = Array.from(
|
|
43
|
-
new Uint8Array(digest),
|
|
44
|
-
(byte) => byte.toString(16).padStart(2, "0")
|
|
45
|
-
).join("");
|
|
46
|
-
let pages2 = 0;
|
|
47
|
-
let page = [];
|
|
48
|
-
let pageBytes = 0;
|
|
49
|
-
let summaries = 0;
|
|
50
|
-
let summary = [];
|
|
51
|
-
let summaryBytes = 0;
|
|
52
|
-
let batch = [];
|
|
53
|
-
let batchBytes = 0;
|
|
54
|
-
const flush = () => invoke(async () => {
|
|
55
|
-
if (batch.length) await context.cache.write(batch, retention);
|
|
56
|
-
batch = [];
|
|
57
|
-
batchBytes = 0;
|
|
58
|
-
});
|
|
59
|
-
const append = (entry) => Effect_exports.gen(function* () {
|
|
60
|
-
const bytes = new TextEncoder().encode(JSON.stringify(entry)).byteLength;
|
|
61
|
-
if (batch.length && (batch.length >= 64 || batchBytes + bytes > 4e6))
|
|
62
|
-
yield* flush();
|
|
63
|
-
batch.push(entry);
|
|
64
|
-
batchBytes += bytes;
|
|
65
|
-
});
|
|
66
|
-
const pageOut = () => Effect_exports.gen(function* () {
|
|
67
|
-
if (!page.length) return;
|
|
68
|
-
yield* append({ key: part(revision, "page", pages2++), value: page });
|
|
69
|
-
page = [];
|
|
70
|
-
pageBytes = 0;
|
|
71
|
-
});
|
|
72
|
-
const summaryOut = () => Effect_exports.gen(function* () {
|
|
73
|
-
if (!summary.length) return;
|
|
74
|
-
yield* append({ key: part(revision, "summary", summaries++), value: summary });
|
|
75
|
-
summary = [];
|
|
76
|
-
summaryBytes = 0;
|
|
77
|
-
});
|
|
78
|
-
const json = (value) => Schema_exports.decodeUnknownEffect(Schema_exports.fromJsonString(JsonObject))(JSON.stringify(value));
|
|
79
|
-
for (const tool of tools) {
|
|
80
|
-
const value = yield* json(tool);
|
|
81
|
-
const bytes = new TextEncoder().encode(JSON.stringify(value)).byteLength;
|
|
82
|
-
if (page.length && (page.length >= 64 || pageBytes + bytes > 5e5)) yield* pageOut();
|
|
83
|
-
yield* append({ key: part(revision, "tool", tool.name), value });
|
|
84
|
-
page.push(value);
|
|
85
|
-
pageBytes += bytes;
|
|
86
|
-
const brief = yield* json(options.summary.of(tool));
|
|
87
|
-
const briefBytes = new TextEncoder().encode(JSON.stringify(brief)).byteLength;
|
|
88
|
-
if (summary.length && summaryBytes + briefBytes > 5e5) yield* summaryOut();
|
|
89
|
-
summary.push(brief);
|
|
90
|
-
summaryBytes += briefBytes;
|
|
91
|
-
}
|
|
92
|
-
yield* pageOut();
|
|
93
|
-
yield* summaryOut();
|
|
94
|
-
yield* flush();
|
|
95
|
-
return { revision, pages: pages2, summaries };
|
|
96
|
-
});
|
|
97
|
-
const getOptions = {
|
|
98
|
-
key,
|
|
99
|
-
schema: schema(Manifest),
|
|
100
|
-
freshFor,
|
|
101
|
-
staleFor,
|
|
102
|
-
load: (context) => Effect_exports.runPromise(refresh(context), { signal: context.signal })
|
|
103
|
-
};
|
|
104
|
-
const current = () => cache === void 0 ? Effect_exports.fail(new CacheError({ reason: "unavailable" })) : invoke(() => cache.get(getOptions));
|
|
105
|
-
if (options.revalidate) {
|
|
106
|
-
if (cache === void 0) yield* local;
|
|
107
|
-
else yield* invoke(() => cache.revalidate(getOptions));
|
|
108
|
-
}
|
|
109
|
-
const pages = (cache2, revision, kind, count, decoder) => Effect_exports.gen(function* () {
|
|
110
|
-
const batches = yield* Effect_exports.forEach(
|
|
111
|
-
Array.from({ length: Math.ceil(count / 4) }, (_, batch) => batch * 4),
|
|
112
|
-
(offset) => invoke(
|
|
113
|
-
() => cache2.readMany(
|
|
114
|
-
Array.from(
|
|
115
|
-
{ length: Math.min(4, count - offset) },
|
|
116
|
-
(_, index) => part(revision, kind, offset + index)
|
|
117
|
-
),
|
|
118
|
-
schema(Schema_exports.Array(decoder))
|
|
119
|
-
)
|
|
120
|
-
),
|
|
121
|
-
{ concurrency: "unbounded" }
|
|
122
|
-
);
|
|
123
|
-
const values = [];
|
|
124
|
-
for (const page of batches.flat()) {
|
|
125
|
-
if (page === void 0) return yield* new CacheError({ reason: "unavailable" });
|
|
126
|
-
values.push(...page);
|
|
127
|
-
}
|
|
128
|
-
return values;
|
|
129
|
-
});
|
|
130
|
-
const metadata = () => Effect_exports.gen(function* () {
|
|
131
|
-
if (cache === void 0) return yield* local;
|
|
132
|
-
const manifest = yield* current();
|
|
133
|
-
return yield* pages(cache, manifest.revision, "page", manifest.pages, options.schema);
|
|
134
|
-
});
|
|
135
|
-
return {
|
|
136
|
-
list: metadata,
|
|
137
|
-
summaries: () => Effect_exports.gen(function* () {
|
|
138
|
-
if (cache === void 0) return (yield* local).map((tool) => options.summary.of(tool));
|
|
139
|
-
const manifest = yield* current();
|
|
140
|
-
return yield* pages(
|
|
141
|
-
cache,
|
|
142
|
-
manifest.revision,
|
|
143
|
-
"summary",
|
|
144
|
-
manifest.summaries,
|
|
145
|
-
options.summary.schema
|
|
146
|
-
);
|
|
147
|
-
}),
|
|
148
|
-
resolve: (name) => cache === void 0 ? local.pipe(Effect_exports.map((tools) => tools.find((tool) => tool.name === name))) : current().pipe(
|
|
149
|
-
Effect_exports.flatMap(
|
|
150
|
-
(manifest) => invoke(
|
|
151
|
-
() => cache.read(part(manifest.revision, "tool", name), schema(options.schema))
|
|
152
|
-
)
|
|
153
|
-
)
|
|
154
|
-
)
|
|
155
|
-
};
|
|
156
|
-
});
|
|
157
|
-
|
|
158
|
-
export {
|
|
159
|
-
catalogCache
|
|
160
|
-
};
|
package/js/chunk-BMOIAIVR.js
DELETED
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Schema_exports
|
|
3
|
-
} from "./chunk-FW5HBOIK.js";
|
|
4
|
-
|
|
5
|
-
// ../app-data/src/contracts/database.ts
|
|
6
|
-
var DataName = Schema_exports.String.check(
|
|
7
|
-
Schema_exports.makeFilter((value) => /^[A-Za-z][A-Za-z0-9_]*$/.test(value) && value.length <= 128)
|
|
8
|
-
);
|
|
9
|
-
var Scalar = Schema_exports.Union([Schema_exports.String, Schema_exports.Finite, Schema_exports.Boolean]);
|
|
10
|
-
var Field = Schema_exports.Struct({
|
|
11
|
-
kind: Schema_exports.Literals(["string", "number", "boolean", "id", "userId"]),
|
|
12
|
-
optional: Schema_exports.optional(Schema_exports.Boolean),
|
|
13
|
-
default: Schema_exports.optional(Scalar),
|
|
14
|
-
references: Schema_exports.optional(DataName)
|
|
15
|
-
});
|
|
16
|
-
var Index = Schema_exports.Struct({ name: DataName, fields: Schema_exports.NonEmptyArray(DataName) });
|
|
17
|
-
var Table = Schema_exports.Struct({
|
|
18
|
-
fields: Schema_exports.Record(DataName, Field),
|
|
19
|
-
indexes: Schema_exports.Array(Index)
|
|
20
|
-
});
|
|
21
|
-
var DatabaseSchema = Schema_exports.Record(DataName, Table);
|
|
22
|
-
var Row = Schema_exports.Record(Schema_exports.String, Scalar);
|
|
23
|
-
var RowMetadata = Schema_exports.Struct({
|
|
24
|
-
id: Schema_exports.NonEmptyString,
|
|
25
|
-
createdAt: Schema_exports.String,
|
|
26
|
-
updatedAt: Schema_exports.String
|
|
27
|
-
});
|
|
28
|
-
var Patch = Schema_exports.Record(DataName, Schema_exports.NullOr(Scalar));
|
|
29
|
-
var RangeClause = Schema_exports.Struct({
|
|
30
|
-
field: DataName,
|
|
31
|
-
op: Schema_exports.Literals(["eq", "gt", "gte", "lt", "lte"]),
|
|
32
|
-
value: Schema_exports.NullOr(Scalar)
|
|
33
|
-
});
|
|
34
|
-
var QueryPlan = Schema_exports.Struct({
|
|
35
|
-
table: DataName,
|
|
36
|
-
index: DataName,
|
|
37
|
-
order: Schema_exports.Literals(["asc", "desc"]),
|
|
38
|
-
clauses: Schema_exports.Array(RangeClause)
|
|
39
|
-
});
|
|
40
|
-
var QueryTerminal = Schema_exports.Union([
|
|
41
|
-
Schema_exports.Struct({ kind: Schema_exports.Literal("collect") }),
|
|
42
|
-
Schema_exports.Struct({ kind: Schema_exports.Literal("count") }),
|
|
43
|
-
Schema_exports.Struct({ kind: Schema_exports.Literal("first") }),
|
|
44
|
-
Schema_exports.Struct({
|
|
45
|
-
kind: Schema_exports.Literal("take"),
|
|
46
|
-
count: Schema_exports.Int.check(Schema_exports.isGreaterThanOrEqualTo(0))
|
|
47
|
-
}),
|
|
48
|
-
Schema_exports.Struct({
|
|
49
|
-
kind: Schema_exports.Literal("paginate"),
|
|
50
|
-
cursor: Schema_exports.NullOr(Schema_exports.String),
|
|
51
|
-
numItems: Schema_exports.Int.check(Schema_exports.isGreaterThan(0))
|
|
52
|
-
})
|
|
53
|
-
]);
|
|
54
|
-
var DatabaseOperation = Schema_exports.Union([
|
|
55
|
-
Schema_exports.Struct({ kind: Schema_exports.Literal("get"), table: DataName, id: Schema_exports.NonEmptyString }),
|
|
56
|
-
Schema_exports.Struct({ kind: Schema_exports.Literal("insert"), table: DataName, value: Patch }),
|
|
57
|
-
Schema_exports.Struct({
|
|
58
|
-
kind: Schema_exports.Literal("update"),
|
|
59
|
-
table: DataName,
|
|
60
|
-
id: Schema_exports.NonEmptyString,
|
|
61
|
-
patch: Patch
|
|
62
|
-
}),
|
|
63
|
-
Schema_exports.Struct({ kind: Schema_exports.Literal("delete"), table: DataName, id: Schema_exports.NonEmptyString }),
|
|
64
|
-
Schema_exports.Struct({ kind: Schema_exports.Literal("query"), plan: QueryPlan, terminal: QueryTerminal })
|
|
65
|
-
]);
|
|
66
|
-
var PaginationResult = Schema_exports.Struct({
|
|
67
|
-
page: Schema_exports.Array(Row),
|
|
68
|
-
continueCursor: Schema_exports.NullOr(Schema_exports.String),
|
|
69
|
-
isDone: Schema_exports.Boolean
|
|
70
|
-
});
|
|
71
|
-
var OperationResult = Schema_exports.Union([
|
|
72
|
-
Row,
|
|
73
|
-
Schema_exports.Array(Row),
|
|
74
|
-
PaginationResult,
|
|
75
|
-
Schema_exports.Boolean,
|
|
76
|
-
Schema_exports.Finite,
|
|
77
|
-
Schema_exports.Null
|
|
78
|
-
]);
|
|
79
|
-
var AppDatabaseError = class extends Schema_exports.TaggedError()("AppDatabaseError", {
|
|
80
|
-
reason: Schema_exports.Literals([
|
|
81
|
-
"schema",
|
|
82
|
-
"schema_changed",
|
|
83
|
-
"table",
|
|
84
|
-
"index",
|
|
85
|
-
"range",
|
|
86
|
-
"value",
|
|
87
|
-
"readonly",
|
|
88
|
-
"cursor",
|
|
89
|
-
"limit",
|
|
90
|
-
"closed",
|
|
91
|
-
"storage",
|
|
92
|
-
"replay"
|
|
93
|
-
])
|
|
94
|
-
}) {
|
|
95
|
-
};
|
|
96
|
-
var DatabaseLimits = Schema_exports.Struct({
|
|
97
|
-
rowsRead: Schema_exports.Int.check(Schema_exports.isGreaterThan(0)),
|
|
98
|
-
rowsReturned: Schema_exports.Int.check(Schema_exports.isGreaterThan(0)),
|
|
99
|
-
bytesRead: Schema_exports.Int.check(Schema_exports.isGreaterThan(0)),
|
|
100
|
-
writes: Schema_exports.Int.check(Schema_exports.isGreaterThan(0)),
|
|
101
|
-
scanCalls: Schema_exports.Int.check(Schema_exports.isGreaterThan(0)),
|
|
102
|
-
directGets: Schema_exports.Int.check(Schema_exports.isGreaterThan(0)),
|
|
103
|
-
valueBytes: Schema_exports.Int.check(Schema_exports.isGreaterThan(0)),
|
|
104
|
-
indexBytes: Schema_exports.Int.check(Schema_exports.isGreaterThan(0))
|
|
105
|
-
});
|
|
106
|
-
var defaultDatabaseLimits = {
|
|
107
|
-
rowsRead: 5e3,
|
|
108
|
-
rowsReturned: 1e3,
|
|
109
|
-
bytesRead: 4 * 1024 * 1024,
|
|
110
|
-
writes: 1e3,
|
|
111
|
-
scanCalls: 100,
|
|
112
|
-
directGets: 1e3,
|
|
113
|
-
valueBytes: 64 * 1024,
|
|
114
|
-
indexBytes: 2048
|
|
115
|
-
};
|
|
116
|
-
var DatabaseRuntimeLimits = Schema_exports.Struct({
|
|
117
|
-
maxCursorChars: Schema_exports.Int.check(Schema_exports.isGreaterThan(0)),
|
|
118
|
-
connectionCacheCapacity: Schema_exports.Int.check(Schema_exports.isGreaterThan(0)),
|
|
119
|
-
connectionCacheTtlMs: Schema_exports.Int.check(Schema_exports.isGreaterThan(0))
|
|
120
|
-
});
|
|
121
|
-
var defaultDatabaseRuntimeLimits = DatabaseRuntimeLimits.make({
|
|
122
|
-
maxCursorChars: 8192,
|
|
123
|
-
connectionCacheCapacity: 64,
|
|
124
|
-
connectionCacheTtlMs: 5 * 60 * 1e3
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
export {
|
|
128
|
-
DatabaseSchema,
|
|
129
|
-
Row,
|
|
130
|
-
RowMetadata,
|
|
131
|
-
RangeClause,
|
|
132
|
-
DatabaseOperation,
|
|
133
|
-
PaginationResult,
|
|
134
|
-
AppDatabaseError,
|
|
135
|
-
DatabaseLimits,
|
|
136
|
-
defaultDatabaseLimits,
|
|
137
|
-
defaultDatabaseRuntimeLimits
|
|
138
|
-
};
|
package/js/chunk-FZJOYIZO.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Schema_exports
|
|
3
|
-
} from "./chunk-FW5HBOIK.js";
|
|
4
|
-
|
|
5
|
-
// src/contracts/storage.ts
|
|
6
|
-
var StorageName = Schema_exports.NonEmptyString.check(Schema_exports.isMaxLength(200));
|
|
7
|
-
var AppStorageUnavailable = class extends Schema_exports.TaggedError()(
|
|
8
|
-
"AppStorageUnavailable",
|
|
9
|
-
{}
|
|
10
|
-
) {
|
|
11
|
-
};
|
|
12
|
-
var AppStorageError = class extends Schema_exports.TaggedError()("AppStorageError", {}) {
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export {
|
|
16
|
-
StorageName,
|
|
17
|
-
AppStorageUnavailable,
|
|
18
|
-
AppStorageError
|
|
19
|
-
};
|
package/js/chunk-G7IE6BKC.js
DELETED
|
@@ -1,224 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
adaptMcpTools,
|
|
3
|
-
mcpClient,
|
|
4
|
-
mcpJsonSchemaValidator
|
|
5
|
-
} from "./chunk-X7SFGU4Q.js";
|
|
6
|
-
import {
|
|
7
|
-
accountProviderError,
|
|
8
|
-
httpProviderError
|
|
9
|
-
} from "./chunk-ZJWDMTE3.js";
|
|
10
|
-
import {
|
|
11
|
-
McpError,
|
|
12
|
-
McpToolsOptions,
|
|
13
|
-
defaultMcpClientLimits
|
|
14
|
-
} from "./chunk-IHQ4ML7K.js";
|
|
15
|
-
import {
|
|
16
|
-
ProviderError
|
|
17
|
-
} from "./chunk-W7D7WVSY.js";
|
|
18
|
-
import {
|
|
19
|
-
captureTelemetry
|
|
20
|
-
} from "./chunk-ZCAMUXSG.js";
|
|
21
|
-
import {
|
|
22
|
-
FetchHttpClient_exports
|
|
23
|
-
} from "./chunk-HDJH3RPR.js";
|
|
24
|
-
import {
|
|
25
|
-
HttpClientRequest_exports,
|
|
26
|
-
HttpClient_exports
|
|
27
|
-
} from "./chunk-QKHR7BMF.js";
|
|
28
|
-
import {
|
|
29
|
-
Deferred_exports,
|
|
30
|
-
Effect_exports,
|
|
31
|
-
Redacted_exports,
|
|
32
|
-
Schema_exports,
|
|
33
|
-
Stream_exports
|
|
34
|
-
} from "./chunk-FW5HBOIK.js";
|
|
35
|
-
|
|
36
|
-
// src/implementation/mcp.ts
|
|
37
|
-
import { UnauthorizedError } from "@modelcontextprotocol/sdk/client/auth.js";
|
|
38
|
-
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
39
|
-
import {
|
|
40
|
-
ErrorCode,
|
|
41
|
-
McpError as ProtocolError,
|
|
42
|
-
ToolListChangedNotificationSchema
|
|
43
|
-
} from "@modelcontextprotocol/sdk/types.js";
|
|
44
|
-
import { SSEClientTransport, SseError } from "@modelcontextprotocol/sdk/client/sse.js";
|
|
45
|
-
import {
|
|
46
|
-
StreamableHTTPClientTransport,
|
|
47
|
-
StreamableHTTPError
|
|
48
|
-
} from "@modelcontextprotocol/sdk/client/streamableHttp.js";
|
|
49
|
-
var failure = (phase, error) => {
|
|
50
|
-
if (Schema_exports.is(ProviderError)(error) || Schema_exports.is(McpError)(error)) return error;
|
|
51
|
-
const status = error instanceof UnauthorizedError ? 401 : error instanceof StreamableHTTPError || error instanceof SseError ? error.code : void 0;
|
|
52
|
-
const provider = status === void 0 ? void 0 : httpProviderError(status);
|
|
53
|
-
if (provider !== void 0) return provider;
|
|
54
|
-
return new McpError({
|
|
55
|
-
phase,
|
|
56
|
-
reason: error instanceof ProtocolError && error.code === ErrorCode.RequestTimeout ? "timeout" : "request",
|
|
57
|
-
...status === void 0 ? {} : { status }
|
|
58
|
-
});
|
|
59
|
-
};
|
|
60
|
-
var transportFetch = (connection, telemetry, rejected) => (url, init) => Effect_exports.runPromiseWith(telemetry.context)(
|
|
61
|
-
Effect_exports.gen(function* () {
|
|
62
|
-
const target = yield* Effect_exports.try({
|
|
63
|
-
try: () => new URL(url),
|
|
64
|
-
catch: () => new McpError({ phase: "transport", reason: "invalid_response" })
|
|
65
|
-
});
|
|
66
|
-
if (connection.url.username || connection.url.password)
|
|
67
|
-
return yield* new McpError({ phase: "transport", reason: "invalid_input" });
|
|
68
|
-
if (target.origin !== connection.url.origin || target.username || target.password)
|
|
69
|
-
return yield* new McpError({ phase: "transport", reason: "invalid_response" });
|
|
70
|
-
const headers = new Headers(Redacted_exports.value(connection.headers));
|
|
71
|
-
new Headers(init?.headers).forEach((value, name) => headers.set(name, value));
|
|
72
|
-
const request = yield* Effect_exports.try({
|
|
73
|
-
try: () => HttpClientRequest_exports.fromWeb(new Request(target, { ...init, headers })),
|
|
74
|
-
catch: () => failure("transport", void 0)
|
|
75
|
-
});
|
|
76
|
-
const client = yield* HttpClient_exports.HttpClient;
|
|
77
|
-
const response = yield* client.execute(request);
|
|
78
|
-
const provider = httpProviderError(response.status, response.headers);
|
|
79
|
-
if (provider !== void 0) {
|
|
80
|
-
yield* Deferred_exports.fail(rejected, provider);
|
|
81
|
-
return yield* provider;
|
|
82
|
-
}
|
|
83
|
-
return new Response(
|
|
84
|
-
[204, 205, 304].includes(response.status) ? null : Stream_exports.toReadableStream(response.stream),
|
|
85
|
-
{
|
|
86
|
-
status: response.status,
|
|
87
|
-
headers: response.headers
|
|
88
|
-
}
|
|
89
|
-
);
|
|
90
|
-
}).pipe(
|
|
91
|
-
Effect_exports.provide(FetchHttpClient_exports.layer),
|
|
92
|
-
Effect_exports.provideService(FetchHttpClient_exports.RequestInit, { redirect: "manual" }),
|
|
93
|
-
Effect_exports.provideService(
|
|
94
|
-
FetchHttpClient_exports.Fetch,
|
|
95
|
-
(url2, options) => globalThis.fetch(url2, {
|
|
96
|
-
...options,
|
|
97
|
-
signal: AbortSignal.any([
|
|
98
|
-
...options?.signal ? [options.signal] : [],
|
|
99
|
-
...init?.signal ? [init.signal] : []
|
|
100
|
-
])
|
|
101
|
-
})
|
|
102
|
-
),
|
|
103
|
-
Effect_exports.mapError((error) => failure("transport", error))
|
|
104
|
-
),
|
|
105
|
-
init?.signal ? { signal: init.signal } : {}
|
|
106
|
-
);
|
|
107
|
-
function withClient(connection, mode, use, changed) {
|
|
108
|
-
const attempt = (kind) => Effect_exports.scoped(
|
|
109
|
-
Effect_exports.gen(function* () {
|
|
110
|
-
const telemetry = yield* captureTelemetry;
|
|
111
|
-
const rejected = yield* Deferred_exports.make();
|
|
112
|
-
const pending = /* @__PURE__ */ new Set();
|
|
113
|
-
const { client, transport } = yield* Effect_exports.acquireRelease(
|
|
114
|
-
Effect_exports.sync(() => {
|
|
115
|
-
const fetch = transportFetch(connection, telemetry, rejected);
|
|
116
|
-
const client2 = new Client(
|
|
117
|
-
{ name: "executor-apps", version: "0.1.0" },
|
|
118
|
-
{
|
|
119
|
-
jsonSchemaValidator: mcpJsonSchemaValidator,
|
|
120
|
-
capabilities: mode === "call" ? { elicitation: { form: {} } } : {}
|
|
121
|
-
}
|
|
122
|
-
);
|
|
123
|
-
if (changed !== void 0) {
|
|
124
|
-
client2.setNotificationHandler(ToolListChangedNotificationSchema, () => {
|
|
125
|
-
const task = Effect_exports.runPromiseWith(telemetry.context)(
|
|
126
|
-
changed.pipe(
|
|
127
|
-
Effect_exports.timeout("5 seconds"),
|
|
128
|
-
Effect_exports.catchCause(() => Effect_exports.logWarning("MCP catalog invalidation failed"))
|
|
129
|
-
)
|
|
130
|
-
);
|
|
131
|
-
pending.add(task);
|
|
132
|
-
return task.finally(() => pending.delete(task));
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
return {
|
|
136
|
-
client: client2,
|
|
137
|
-
transport: kind === "http" ? new StreamableHTTPClientTransport(connection.url, {
|
|
138
|
-
fetch,
|
|
139
|
-
reconnectionOptions: {
|
|
140
|
-
maxRetries: 0,
|
|
141
|
-
initialReconnectionDelay: 1e3,
|
|
142
|
-
maxReconnectionDelay: 1e3,
|
|
143
|
-
reconnectionDelayGrowFactor: 1
|
|
144
|
-
}
|
|
145
|
-
}) : new SSEClientTransport(connection.url, { fetch })
|
|
146
|
-
};
|
|
147
|
-
}),
|
|
148
|
-
({ client: client2, transport: transport2 }) => Effect_exports.gen(function* () {
|
|
149
|
-
client2.removeNotificationHandler("notifications/tools/list_changed");
|
|
150
|
-
yield* Effect_exports.promise(async () => {
|
|
151
|
-
await Promise.allSettled(pending);
|
|
152
|
-
});
|
|
153
|
-
if (transport2 instanceof StreamableHTTPClientTransport && transport2.sessionId !== void 0) {
|
|
154
|
-
yield* Effect_exports.tryPromise(() => transport2.terminateSession()).pipe(
|
|
155
|
-
Effect_exports.timeout(defaultMcpClientLimits.cleanupTimeoutMs),
|
|
156
|
-
Effect_exports.ignore
|
|
157
|
-
);
|
|
158
|
-
}
|
|
159
|
-
yield* Effect_exports.tryPromise(() => client2.close()).pipe(
|
|
160
|
-
Effect_exports.timeout(defaultMcpClientLimits.cleanupTimeoutMs),
|
|
161
|
-
Effect_exports.ignore
|
|
162
|
-
);
|
|
163
|
-
}).pipe(Effect_exports.withSpan("provider.mcp.close"))
|
|
164
|
-
);
|
|
165
|
-
const wire = transport;
|
|
166
|
-
yield* Effect_exports.tryPromise({
|
|
167
|
-
try: (signal) => client.connect(wire, { signal, timeout: connection.timeoutMs }),
|
|
168
|
-
catch: (error) => failure("connect", error)
|
|
169
|
-
}).pipe(
|
|
170
|
-
Effect_exports.raceFirst(Deferred_exports.await(rejected)),
|
|
171
|
-
Effect_exports.timeout(connection.timeoutMs),
|
|
172
|
-
Effect_exports.withSpan("provider.mcp.connect")
|
|
173
|
-
);
|
|
174
|
-
return yield* use(client).pipe(Effect_exports.raceFirst(Deferred_exports.await(rejected)));
|
|
175
|
-
})
|
|
176
|
-
).pipe(
|
|
177
|
-
Effect_exports.withSpan("provider.mcp.session", {
|
|
178
|
-
attributes: {
|
|
179
|
-
"mcp.transport": kind,
|
|
180
|
-
"mcp.operation": mode,
|
|
181
|
-
"server.address": connection.url.hostname
|
|
182
|
-
}
|
|
183
|
-
})
|
|
184
|
-
);
|
|
185
|
-
return attempt("http").pipe(
|
|
186
|
-
// Fallback is only for negotiation. Tool calls are never automatically replayed.
|
|
187
|
-
Effect_exports.catch(
|
|
188
|
-
(error) => Schema_exports.is(McpError)(error) && error.phase === "connect" && (error.status === 404 || error.status === 405) ? attempt("sse") : Effect_exports.fail(error)
|
|
189
|
-
),
|
|
190
|
-
(operation) => mode === "discover" ? operation.pipe(Effect_exports.timeout(connection.timeoutMs)) : operation,
|
|
191
|
-
Effect_exports.catchTag(
|
|
192
|
-
"TimeoutError",
|
|
193
|
-
() => Effect_exports.fail(new McpError({ phase: "transport", reason: "timeout" }))
|
|
194
|
-
)
|
|
195
|
-
);
|
|
196
|
-
}
|
|
197
|
-
var mcpClientEffect = (input, changed) => Effect_exports.gen(function* () {
|
|
198
|
-
const options = yield* Schema_exports.decodeUnknownEffect(McpToolsOptions)(input).pipe(
|
|
199
|
-
Effect_exports.mapError(() => new McpError({ phase: "connect", reason: "invalid_input" }))
|
|
200
|
-
);
|
|
201
|
-
const url = new URL(options.url);
|
|
202
|
-
if (url.username || url.password || url.hash)
|
|
203
|
-
return yield* new McpError({ phase: "connect", reason: "invalid_input" });
|
|
204
|
-
const connection = {
|
|
205
|
-
url,
|
|
206
|
-
headers: Redacted_exports.make({ ...options.headers }),
|
|
207
|
-
timeoutMs: options.timeoutMs ?? defaultMcpClientLimits.timeoutMs
|
|
208
|
-
};
|
|
209
|
-
return mcpClient(
|
|
210
|
-
(mode, use) => withClient(connection, mode, use, changed).pipe(
|
|
211
|
-
Effect_exports.mapError(
|
|
212
|
-
(error) => options.accountId === void 0 ? error : accountProviderError(error, options.accountId)
|
|
213
|
-
)
|
|
214
|
-
),
|
|
215
|
-
connection.timeoutMs,
|
|
216
|
-
failure
|
|
217
|
-
);
|
|
218
|
-
});
|
|
219
|
-
var mcpToolsEffect = (input) => mcpClientEffect(input).pipe(Effect_exports.flatMap(adaptMcpTools));
|
|
220
|
-
|
|
221
|
-
export {
|
|
222
|
-
mcpClientEffect,
|
|
223
|
-
mcpToolsEffect
|
|
224
|
-
};
|