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/graphql.js
CHANGED
|
@@ -1,54 +1,60 @@
|
|
|
1
1
|
import {
|
|
2
|
-
catalogCache
|
|
3
|
-
|
|
2
|
+
catalogCache,
|
|
3
|
+
catalogScope
|
|
4
|
+
} from "./chunk-YWVISRZD.js";
|
|
4
5
|
import {
|
|
5
6
|
protocolOperations
|
|
6
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-2LSGC7XY.js";
|
|
7
8
|
import "./chunk-BCSNKUAC.js";
|
|
9
|
+
import "./chunk-RN4YB4JT.js";
|
|
8
10
|
import {
|
|
9
11
|
cacheKey
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-NCYXZN2G.js";
|
|
13
|
-
import "./chunk-RBAC33PQ.js";
|
|
14
|
-
import "./chunk-PLCMJREA.js";
|
|
12
|
+
} from "./chunk-5C6RAGAS.js";
|
|
13
|
+
import "./chunk-QI66R4FP.js";
|
|
15
14
|
import {
|
|
16
|
-
|
|
17
|
-
} from "./chunk-
|
|
15
|
+
failOnNetworkRefusal
|
|
16
|
+
} from "./chunk-VCYWAA4N.js";
|
|
17
|
+
import "./chunk-PBGPES67.js";
|
|
18
|
+
import "./chunk-ILYCJ3HV.js";
|
|
19
|
+
import {
|
|
20
|
+
nativeOperation,
|
|
21
|
+
routerDeclaration
|
|
22
|
+
} from "./chunk-2CURR5Y7.js";
|
|
18
23
|
import {
|
|
19
24
|
accountProviderError,
|
|
20
25
|
graphqlProviderError,
|
|
21
26
|
httpProviderError
|
|
22
|
-
} from "./chunk-
|
|
23
|
-
import "./chunk-IHQ4ML7K.js";
|
|
24
|
-
import "./chunk-BMOIAIVR.js";
|
|
25
|
-
import "./chunk-YEJOQEII.js";
|
|
26
|
-
import "./chunk-SWPD52J7.js";
|
|
27
|
+
} from "./chunk-7STIP5CS.js";
|
|
27
28
|
import {
|
|
29
|
+
NetworkRefused,
|
|
28
30
|
ProviderError
|
|
29
|
-
} from "./chunk-
|
|
30
|
-
import "./chunk-
|
|
31
|
+
} from "./chunk-4UPC36ZL.js";
|
|
32
|
+
import "./chunk-4PIQKACY.js";
|
|
31
33
|
import {
|
|
32
|
-
|
|
33
|
-
} from "./chunk-
|
|
34
|
+
jsonSchemaDecoder
|
|
35
|
+
} from "./chunk-VAI3EVCS.js";
|
|
34
36
|
import {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
} from "./chunk-QKHR7BMF.js";
|
|
37
|
+
owned
|
|
38
|
+
} from "./chunk-URKOTNDA.js";
|
|
38
39
|
import {
|
|
39
|
-
|
|
40
|
-
} from "./chunk-
|
|
41
|
-
import "./chunk-
|
|
40
|
+
FetchHttpClient_exports
|
|
41
|
+
} from "./chunk-YDW7DX3A.js";
|
|
42
|
+
import "./chunk-OWN3DP2W.js";
|
|
42
43
|
import {
|
|
43
44
|
AccountId,
|
|
44
45
|
HttpUrl,
|
|
45
46
|
JsonObject
|
|
46
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-7HG422GB.js";
|
|
48
|
+
import "./chunk-DILSCQPJ.js";
|
|
49
|
+
import {
|
|
50
|
+
HttpClientRequest_exports,
|
|
51
|
+
HttpClient_exports
|
|
52
|
+
} from "./chunk-ACQXVKVQ.js";
|
|
47
53
|
import {
|
|
48
54
|
Effect_exports,
|
|
49
55
|
Redacted_exports,
|
|
50
56
|
Schema_exports
|
|
51
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-ZKDXML77.js";
|
|
52
58
|
import "./chunk-CZ7CSFO4.js";
|
|
53
59
|
|
|
54
60
|
// src/contracts/graphql.ts
|
|
@@ -84,7 +90,7 @@ var GraphqlError = class extends Schema_exports.TaggedError()("GraphqlError", {
|
|
|
84
90
|
status: Schema_exports.optional(Schema_exports.Number)
|
|
85
91
|
}) {
|
|
86
92
|
};
|
|
87
|
-
var Name = Schema_exports.String.check(Schema_exports.isPattern(/^[_A-Za-z][_0-9A-Za-z]*$/));
|
|
93
|
+
var Name = Schema_exports.String.check(Schema_exports.isPattern(/^[_A-Za-z][_0-9A-Za-z]*$/u));
|
|
88
94
|
var Kind = Schema_exports.Literals([
|
|
89
95
|
"SCALAR",
|
|
90
96
|
"OBJECT",
|
|
@@ -267,10 +273,11 @@ var graphqlClientEffect = (input) => Effect_exports.gen(function* () {
|
|
|
267
273
|
HttpClientRequest_exports.bodyJsonUnsafe({ query, variables })
|
|
268
274
|
)
|
|
269
275
|
);
|
|
276
|
+
yield* failOnNetworkRefusal(response);
|
|
270
277
|
if (response.status < 200 || response.status >= 300)
|
|
271
278
|
return yield* httpProviderError(response.status, response.headers) ?? new GraphqlError({ phase, reason: "request", status: response.status });
|
|
272
279
|
const result = yield* response.json.pipe(
|
|
273
|
-
|
|
280
|
+
owned("upstream", "provider.http.response.read"),
|
|
274
281
|
Effect_exports.flatMap(Schema_exports.decodeUnknownEffect(GraphqlResponse)),
|
|
275
282
|
Effect_exports.mapError(() => new GraphqlError({ phase, reason: "invalid_response" }))
|
|
276
283
|
);
|
|
@@ -281,7 +288,7 @@ var graphqlClientEffect = (input) => Effect_exports.gen(function* () {
|
|
|
281
288
|
return result.data;
|
|
282
289
|
})
|
|
283
290
|
).pipe(
|
|
284
|
-
|
|
291
|
+
owned("upstream", "provider.graphql.request", {
|
|
285
292
|
attributes: {
|
|
286
293
|
"executor.operation": phase,
|
|
287
294
|
"server.address": url.hostname
|
|
@@ -295,13 +302,13 @@ var graphqlClientEffect = (input) => Effect_exports.gen(function* () {
|
|
|
295
302
|
orElse: () => Effect_exports.fail(new GraphqlError({ phase, reason: "timeout" }))
|
|
296
303
|
}),
|
|
297
304
|
Effect_exports.mapError(
|
|
298
|
-
(error) => error instanceof ProviderError && options.accountId !== void 0 ? accountProviderError(error, options.accountId) : error instanceof GraphqlError || error instanceof ProviderError ? error : new GraphqlError({ phase, reason: "request" })
|
|
305
|
+
(error) => error instanceof ProviderError && options.accountId !== void 0 ? accountProviderError(error, options.accountId) : error instanceof GraphqlError || error instanceof ProviderError || error instanceof NetworkRefused ? error : new GraphqlError({ phase, reason: "request" })
|
|
299
306
|
)
|
|
300
307
|
);
|
|
301
308
|
const discover = request("discover", getIntrospectionQuery()).pipe(
|
|
302
309
|
Effect_exports.flatMap(Schema_exports.decodeUnknownEffect(GraphqlIntrospection)),
|
|
303
310
|
Effect_exports.mapError(
|
|
304
|
-
(error) => error instanceof GraphqlError || error instanceof ProviderError ? error : new GraphqlError({ phase: "discover", reason: "invalid_response" })
|
|
311
|
+
(error) => error instanceof GraphqlError || error instanceof ProviderError || error instanceof NetworkRefused ? error : new GraphqlError({ phase: "discover", reason: "invalid_response" })
|
|
305
312
|
)
|
|
306
313
|
);
|
|
307
314
|
return { request, discover };
|
|
@@ -410,7 +417,7 @@ var adaptGraphqlTool = (client, definition) => Effect_exports.gen(function* () {
|
|
|
410
417
|
return yield* new GraphqlError({ phase: "call", reason: "invalid_response" });
|
|
411
418
|
return value;
|
|
412
419
|
}).pipe(
|
|
413
|
-
|
|
420
|
+
owned("upstream", "provider.graphql.call", {
|
|
414
421
|
attributes: {
|
|
415
422
|
"graphql.operation.type": kind,
|
|
416
423
|
"executor.tool.name": name
|
|
@@ -428,17 +435,20 @@ var GraphqlToolSummary = GraphqlToolDefinition.mapFields(({ name, kind, descript
|
|
|
428
435
|
description
|
|
429
436
|
}));
|
|
430
437
|
var graphqlCatalog = (options, kinds) => Effect_exports.gen(function* () {
|
|
431
|
-
const
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
438
|
+
const invalid = () => new GraphqlError({ phase: "discover", reason: "invalid_input" });
|
|
439
|
+
const parsed = yield* Schema_exports.decodeUnknownEffect(GraphqlToolsOptions)({
|
|
440
|
+
url: options.url,
|
|
441
|
+
accountId: options.account?.id,
|
|
442
|
+
headers: options.headers,
|
|
443
|
+
signal: options.signal,
|
|
444
|
+
timeoutMs: options.timeoutMs
|
|
445
|
+
}).pipe(Effect_exports.mapError(invalid));
|
|
446
|
+
const cache = yield* catalogScope(options, options.headers, invalid);
|
|
447
|
+
const id = yield* cacheKey({ url: parsed.url });
|
|
439
448
|
const client = yield* graphqlClientEffect(parsed);
|
|
440
449
|
const catalog = yield* catalogCache({
|
|
441
450
|
...options,
|
|
451
|
+
cache,
|
|
442
452
|
prefix: ["graphql-catalog-v2", id],
|
|
443
453
|
schema: GraphqlToolDefinition,
|
|
444
454
|
summary: {
|
|
@@ -447,13 +457,13 @@ var graphqlCatalog = (options, kinds) => Effect_exports.gen(function* () {
|
|
|
447
457
|
},
|
|
448
458
|
load: (context) => (context === void 0 ? Effect_exports.succeed(client) : graphqlClientEffect({ ...parsed, signal: context.signal })).pipe(
|
|
449
459
|
Effect_exports.flatMap((source) => source.discover),
|
|
450
|
-
Effect_exports.flatMap(graphqlDefinitions)
|
|
460
|
+
Effect_exports.flatMap(graphqlDefinitions),
|
|
461
|
+
Effect_exports.map((tools) => ({ tools }))
|
|
451
462
|
)
|
|
452
463
|
});
|
|
453
464
|
const kindOf = (tool) => Object.hasOwn(kinds, tool.name) ? kinds[tool.name] ?? "mutation" : tool.kind;
|
|
454
|
-
const qualified = (tool) => `${kindOf(tool) === "query" ? "queries" : "mutations"}.${tool.name}`;
|
|
455
465
|
const summarize = (tool) => ({
|
|
456
|
-
name:
|
|
466
|
+
name: tool.name,
|
|
457
467
|
description: tool.description,
|
|
458
468
|
readOnly: kindOf(tool) === "query"
|
|
459
469
|
});
|
|
@@ -461,34 +471,28 @@ var graphqlCatalog = (options, kinds) => Effect_exports.gen(function* () {
|
|
|
461
471
|
...summarize(tool),
|
|
462
472
|
inputSchema: tool.inputSchema
|
|
463
473
|
});
|
|
464
|
-
const
|
|
465
|
-
|
|
466
|
-
const tool = yield* catalog.resolve(name.slice(name.indexOf(".") + 1));
|
|
467
|
-
return tool === void 0 || qualified(tool) !== name ? void 0 : tool;
|
|
468
|
-
});
|
|
469
|
-
const dynamicTools = {
|
|
474
|
+
const router = {
|
|
475
|
+
kind: "dynamic",
|
|
470
476
|
list: () => catalog.list().pipe(Effect_exports.map((tools) => tools.map(describe))),
|
|
471
477
|
summaries: () => catalog.summaries().pipe(Effect_exports.map((tools) => tools.map(summarize))),
|
|
472
|
-
describe: (name) =>
|
|
473
|
-
Effect_exports.map((tool) => tool === void 0 ? void 0 : describe(tool))
|
|
474
|
-
),
|
|
478
|
+
describe: (name) => catalog.resolve(name).pipe(Effect_exports.map((tool) => tool === void 0 ? void 0 : describe(tool))),
|
|
475
479
|
resolve: (name) => Effect_exports.gen(function* () {
|
|
476
|
-
const tool = yield*
|
|
480
|
+
const tool = yield* catalog.resolve(name);
|
|
477
481
|
if (tool === void 0) return void 0;
|
|
478
482
|
const adapted = yield* adaptGraphqlTool(client, tool);
|
|
479
483
|
const operations = protocolOperations({ selected: adapted }, { selected: kindOf(tool) });
|
|
480
|
-
return nativeOperation(operations.
|
|
484
|
+
return nativeOperation(operations.selected);
|
|
481
485
|
})
|
|
482
486
|
};
|
|
483
|
-
return
|
|
487
|
+
return routerDeclaration(router);
|
|
484
488
|
});
|
|
485
489
|
|
|
486
490
|
// src/graphql.ts
|
|
487
|
-
var
|
|
491
|
+
var graphqlRouter = (options, kinds = {}) => Effect_exports.runPromise(
|
|
488
492
|
graphqlCatalog(options, kinds),
|
|
489
493
|
options.signal === void 0 ? {} : { signal: options.signal }
|
|
490
494
|
);
|
|
491
495
|
export {
|
|
492
496
|
GraphqlError,
|
|
493
|
-
|
|
497
|
+
graphqlRouter
|
|
494
498
|
};
|
package/js/host.js
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createAppHandler
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-RN4YB4JT.js";
|
|
4
|
+
import "./chunk-5C6RAGAS.js";
|
|
5
|
+
import "./chunk-QI66R4FP.js";
|
|
6
|
+
import "./chunk-VCYWAA4N.js";
|
|
7
|
+
import "./chunk-PBGPES67.js";
|
|
8
|
+
import "./chunk-ILYCJ3HV.js";
|
|
9
|
+
import "./chunk-2CURR5Y7.js";
|
|
10
|
+
import "./chunk-7STIP5CS.js";
|
|
6
11
|
import {
|
|
7
12
|
CacheCommand,
|
|
8
13
|
CacheError,
|
|
9
|
-
CacheReply
|
|
10
|
-
} from "./chunk-RBAC33PQ.js";
|
|
11
|
-
import "./chunk-PLCMJREA.js";
|
|
12
|
-
import "./chunk-PZ36XMXW.js";
|
|
13
|
-
import "./chunk-ZJWDMTE3.js";
|
|
14
|
-
import {
|
|
14
|
+
CacheReply,
|
|
15
15
|
ElicitationFailed,
|
|
16
16
|
ElicitationReply,
|
|
17
17
|
HostAccountsInvalid,
|
|
18
18
|
HostInputInvalid,
|
|
19
19
|
HostResponse,
|
|
20
|
+
InvocationTimingSink,
|
|
20
21
|
ResolvedAccounts,
|
|
21
22
|
TrustedToolApproval,
|
|
22
23
|
WorkflowFailure,
|
|
@@ -24,27 +25,26 @@ import {
|
|
|
24
25
|
WorkflowRun,
|
|
25
26
|
WorkflowRunId,
|
|
26
27
|
WorkflowRunPage
|
|
27
|
-
} from "./chunk-
|
|
28
|
-
import "./chunk-
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-SWPD52J7.js";
|
|
31
|
-
import "./chunk-W7D7WVSY.js";
|
|
28
|
+
} from "./chunk-4UPC36ZL.js";
|
|
29
|
+
import "./chunk-4PIQKACY.js";
|
|
30
|
+
import "./chunk-VAI3EVCS.js";
|
|
32
31
|
import {
|
|
33
32
|
collectTelemetry,
|
|
34
33
|
withRemoteSpan
|
|
35
|
-
} from "./chunk-
|
|
36
|
-
import "./chunk-
|
|
37
|
-
import "./chunk-
|
|
38
|
-
import "./chunk-
|
|
39
|
-
import "./chunk-
|
|
40
|
-
import "./chunk-
|
|
34
|
+
} from "./chunk-URKOTNDA.js";
|
|
35
|
+
import "./chunk-YDW7DX3A.js";
|
|
36
|
+
import "./chunk-OWN3DP2W.js";
|
|
37
|
+
import "./chunk-7HG422GB.js";
|
|
38
|
+
import "./chunk-DILSCQPJ.js";
|
|
39
|
+
import "./chunk-ACQXVKVQ.js";
|
|
41
40
|
import {
|
|
42
41
|
Cause_exports,
|
|
42
|
+
Clock_exports,
|
|
43
43
|
Effect_exports,
|
|
44
44
|
Redacted_exports,
|
|
45
45
|
Scheduler_exports,
|
|
46
46
|
Schema_exports
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-ZKDXML77.js";
|
|
48
48
|
import "./chunk-CZ7CSFO4.js";
|
|
49
49
|
|
|
50
50
|
// src/implementation/cache-session.ts
|
|
@@ -52,14 +52,17 @@ var isolatedCacheSession = (callback) => {
|
|
|
52
52
|
const controller = new AbortController();
|
|
53
53
|
const pending = /* @__PURE__ */ new Set();
|
|
54
54
|
const cache = {
|
|
55
|
-
transport: (command) =>
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
(
|
|
55
|
+
transport: (command) => (
|
|
56
|
+
// oxlint-disable-next-line executor/authored-code-through-adapter -- the host's cache RPC
|
|
57
|
+
Effect_exports.tryPromise({
|
|
58
|
+
try: () => callback(Schema_exports.encodeSync(CacheCommand)(command)),
|
|
59
|
+
catch: () => new CacheError({ reason: "storage" })
|
|
60
|
+
}).pipe(
|
|
61
|
+
Effect_exports.flatMap(Schema_exports.decodeUnknownEffect(CacheReply)),
|
|
62
|
+
Effect_exports.mapError(() => new CacheError({ reason: "storage" })),
|
|
63
|
+
Effect_exports.flatMap(
|
|
64
|
+
(reply) => reply.ok ? Effect_exports.succeed(reply.value) : Effect_exports.fail(reply.error)
|
|
65
|
+
)
|
|
63
66
|
)
|
|
64
67
|
),
|
|
65
68
|
background: (task) => Effect_exports.gen(function* () {
|
|
@@ -97,14 +100,17 @@ var isolatedCacheSession = (callback) => {
|
|
|
97
100
|
// src/implementation/workflow-rpc.ts
|
|
98
101
|
var isolatedWorkflowExecution = (run, deliver, signal) => {
|
|
99
102
|
const runId = Schema_exports.decodeUnknownSync(WorkflowRunId)(run);
|
|
100
|
-
const request = (input, callback) =>
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
(
|
|
103
|
+
const request = (input, callback) => (
|
|
104
|
+
// oxlint-disable-next-line executor/authored-code-through-adapter -- the host's workflow RPC
|
|
105
|
+
Effect_exports.tryPromise({
|
|
106
|
+
try: () => deliver(input, callback),
|
|
107
|
+
catch: () => new WorkflowFailure({ reason: "engine", retryable: true })
|
|
108
|
+
}).pipe(
|
|
109
|
+
Effect_exports.flatMap(Schema_exports.decodeUnknownEffect(WorkflowRpcResult)),
|
|
110
|
+
Effect_exports.mapError(() => new WorkflowFailure({ reason: "engine", retryable: true })),
|
|
111
|
+
Effect_exports.flatMap(
|
|
112
|
+
(reply) => reply.ok ? Effect_exports.succeed(reply.value) : Effect_exports.fail(reply.error)
|
|
113
|
+
)
|
|
108
114
|
)
|
|
109
115
|
);
|
|
110
116
|
return {
|
|
@@ -146,14 +152,17 @@ var isolatedWorkflowExecution = (run, deliver, signal) => {
|
|
|
146
152
|
};
|
|
147
153
|
};
|
|
148
154
|
var isolatedWorkflowControls = (deliver) => {
|
|
149
|
-
const request = (input) =>
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
(
|
|
155
|
+
const request = (input) => (
|
|
156
|
+
// oxlint-disable-next-line executor/authored-code-through-adapter -- the host's workflow RPC
|
|
157
|
+
Effect_exports.tryPromise({
|
|
158
|
+
try: () => deliver(input),
|
|
159
|
+
catch: () => new WorkflowFailure({ reason: "engine", retryable: true })
|
|
160
|
+
}).pipe(
|
|
161
|
+
Effect_exports.flatMap(Schema_exports.decodeUnknownEffect(WorkflowRpcResult)),
|
|
162
|
+
Effect_exports.mapError(() => new WorkflowFailure({ reason: "engine", retryable: true })),
|
|
163
|
+
Effect_exports.flatMap(
|
|
164
|
+
(result) => result.ok ? Effect_exports.succeed(result.value) : Effect_exports.fail(result.error)
|
|
165
|
+
)
|
|
157
166
|
)
|
|
158
167
|
);
|
|
159
168
|
const run = (input) => request(input).pipe(
|
|
@@ -202,17 +211,27 @@ var createAppHandler2 = (app) => {
|
|
|
202
211
|
);
|
|
203
212
|
};
|
|
204
213
|
};
|
|
214
|
+
var isolatedClock = () => Effect_exports.runSync(Clock_exports.currentTimeNanos);
|
|
205
215
|
var createIsolatedAppHandler = (app) => {
|
|
206
216
|
const handler = createAppHandler(app);
|
|
207
217
|
return (request, context) => Effect_exports.runPromise(
|
|
208
218
|
Effect_exports.gen(function* () {
|
|
219
|
+
let timing;
|
|
209
220
|
const { value, telemetry } = yield* collectTelemetry(
|
|
210
|
-
handler(request, context).pipe(
|
|
221
|
+
handler(request, context).pipe(
|
|
222
|
+
withRemoteSpan(request, "app.dispatch"),
|
|
223
|
+
Effect_exports.provideService(InvocationTimingSink, (reported) => {
|
|
224
|
+
timing = reported;
|
|
225
|
+
})
|
|
226
|
+
)
|
|
211
227
|
);
|
|
212
228
|
const body = yield* Effect_exports.promise(() => value.json()).pipe(
|
|
213
229
|
Effect_exports.flatMap(Schema_exports.decodeUnknownEffect(HostResponse))
|
|
214
230
|
);
|
|
215
|
-
return Response.json(
|
|
231
|
+
return Response.json(
|
|
232
|
+
{ ...body, telemetry, ...timing === void 0 ? {} : { timing } },
|
|
233
|
+
{ status: value.status }
|
|
234
|
+
);
|
|
216
235
|
}),
|
|
217
236
|
{
|
|
218
237
|
signal: request.signal,
|
|
@@ -222,20 +241,23 @@ var createIsolatedAppHandler = (app) => {
|
|
|
222
241
|
}
|
|
223
242
|
);
|
|
224
243
|
};
|
|
225
|
-
var isolatedElicitation = (deliver, lifetime) => (request) =>
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
})
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
244
|
+
var isolatedElicitation = (deliver, lifetime) => (request) => (
|
|
245
|
+
// oxlint-disable-next-line executor/authored-code-through-adapter -- the host's elicitation RPC
|
|
246
|
+
Effect_exports.tryPromise({
|
|
247
|
+
try: () => deliver(request),
|
|
248
|
+
catch: () => {
|
|
249
|
+
lifetime.abort();
|
|
250
|
+
return new ElicitationFailed({ reason: "transport" });
|
|
251
|
+
}
|
|
252
|
+
}).pipe(
|
|
253
|
+
Effect_exports.flatMap(
|
|
254
|
+
(reply) => Schema_exports.decodeUnknownEffect(ElicitationReply)(reply).pipe(
|
|
255
|
+
Effect_exports.mapError(() => new ElicitationFailed({ reason: "transport" }))
|
|
256
|
+
)
|
|
257
|
+
),
|
|
258
|
+
Effect_exports.flatMap(
|
|
259
|
+
(reply) => reply.ok ? Effect_exports.succeed(reply.response) : Effect_exports.fail(reply.error)
|
|
235
260
|
)
|
|
236
|
-
),
|
|
237
|
-
Effect_exports.flatMap(
|
|
238
|
-
(reply) => reply.ok ? Effect_exports.succeed(reply.response) : Effect_exports.fail(reply.error)
|
|
239
261
|
)
|
|
240
262
|
);
|
|
241
263
|
export {
|
|
@@ -243,6 +265,7 @@ export {
|
|
|
243
265
|
createIsolatedAppHandler,
|
|
244
266
|
hostContext,
|
|
245
267
|
isolatedCacheSession,
|
|
268
|
+
isolatedClock,
|
|
246
269
|
isolatedElicitation,
|
|
247
270
|
isolatedWorkflowControls,
|
|
248
271
|
isolatedWorkflowExecution
|