apps 0.0.1-beta.5 → 0.0.1-beta.6

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.
Files changed (63) hide show
  1. package/README.md +65 -43
  2. package/framework-reference.json +1 -1
  3. package/js/{chunk-FWQC6I3C.js → chunk-5T57N25Q.js} +13 -1
  4. package/js/{chunk-67EVWIGJ.js → chunk-6BSSI67S.js} +4 -4
  5. package/js/{chunk-DQAZTA4I.js → chunk-B3EOZTK3.js} +212 -19
  6. package/js/{chunk-TDNYXSIX.js → chunk-ECQFRCH4.js} +21 -9
  7. package/js/{chunk-UDDE5KOR.js → chunk-ITM77QPO.js} +26 -7
  8. package/js/{chunk-G7T27IWB.js → chunk-MKWZPDR6.js} +1 -1
  9. package/js/chunk-MNMNLXBL.js +507 -0
  10. package/js/{chunk-CYYBFC2K.js → chunk-NKLWZJLE.js} +1 -1
  11. package/js/{chunk-C3VAOK5B.js → chunk-OE3QQTSB.js} +33 -26
  12. package/js/{chunk-YEPYT6SD.js → chunk-R3EV5FTO.js} +12 -0
  13. package/js/{chunk-XHO2ZX6W.js → chunk-RFVIONFX.js} +27 -10
  14. package/js/{chunk-LUVSFETN.js → chunk-SB4HEPNJ.js} +72 -228
  15. package/js/chunk-T7GKZBLP.js +209 -0
  16. package/js/client.js +1 -1
  17. package/js/contracts.js +24 -11
  18. package/js/effect.js +9 -11
  19. package/js/graphql.js +25 -32
  20. package/js/host.js +9 -11
  21. package/js/index.js +184 -173
  22. package/js/mcp/effect.js +11 -13
  23. package/js/mcp/stdio.js +15 -17
  24. package/js/mcp.js +50 -36
  25. package/js/openapi.js +166 -108
  26. package/js/skills.js +6 -7
  27. package/package.json +1 -1
  28. package/runtime.json +1 -1
  29. package/types/apps/src/contracts/app.d.ts +2 -5
  30. package/types/apps/src/contracts/host.d.ts +11 -7
  31. package/types/apps/src/contracts/mcp.d.ts +16 -0
  32. package/types/apps/src/contracts/openapi.d.ts +4 -0
  33. package/types/apps/src/contracts/operations.d.ts +0 -5
  34. package/types/apps/src/contracts/protocol-version.d.ts +2 -2
  35. package/types/apps/src/contracts/protocols/4.d.ts +1229 -0
  36. package/types/apps/src/contracts/router.d.ts +59 -0
  37. package/types/apps/src/graphql.d.ts +1 -3
  38. package/types/apps/src/implementation/account-router.d.ts +12 -0
  39. package/types/apps/src/implementation/app.d.ts +5 -4
  40. package/types/apps/src/implementation/catalog-cache.d.ts +9 -2
  41. package/types/apps/src/implementation/graphql-catalog.d.ts +1 -4
  42. package/types/apps/src/implementation/mcp-catalog.d.ts +1 -4
  43. package/types/apps/src/implementation/mcp-client.d.ts +35 -19
  44. package/types/apps/src/implementation/mcp.d.ts +35 -19
  45. package/types/apps/src/implementation/openapi-compile.d.ts +2 -1
  46. package/types/apps/src/implementation/openapi-source.d.ts +2 -6
  47. package/types/apps/src/implementation/operations.d.ts +26 -3
  48. package/types/apps/src/implementation/protocol-operations.d.ts +3 -4
  49. package/types/apps/src/implementation/router-catalog.d.ts +225 -0
  50. package/types/apps/src/implementation/router.d.ts +59 -0
  51. package/types/apps/src/implementation/schema.d.ts +5 -1
  52. package/types/apps/src/implementation/workflow-context.d.ts +1 -1
  53. package/types/apps/src/index.d.ts +3 -2
  54. package/types/apps/src/mcp-stdio.d.ts +2 -5
  55. package/types/apps/src/mcp.d.ts +5 -4
  56. package/types/apps/src/openapi.d.ts +6 -6
  57. package/js/chunk-3XKZDQLM.js +0 -93
  58. package/js/chunk-4M277YTM.js +0 -136
  59. package/js/chunk-SB3V4YVR.js +0 -18
  60. package/js/chunk-W4DMKWAB.js +0 -35
  61. package/types/apps/src/contracts/dynamic-tools.d.ts +0 -13
  62. package/types/apps/src/implementation/account-operations.d.ts +0 -151
  63. package/types/apps/src/implementation/dynamic-tools.d.ts +0 -8
@@ -0,0 +1,209 @@
1
+ import {
2
+ HostedTool,
3
+ RouterKey,
4
+ RouterMeta,
5
+ reservedRouterKeys
6
+ } from "./chunk-B3EOZTK3.js";
7
+ import {
8
+ decoderOf
9
+ } from "./chunk-5T57N25Q.js";
10
+ import {
11
+ Effect_exports,
12
+ Schema_exports
13
+ } from "./chunk-CDL5PM2Q.js";
14
+
15
+ // src/implementation/authoring.ts
16
+ var NativeCallback = /* @__PURE__ */ Symbol("apps.NativeCallback");
17
+ var fromPromise = (callback) => (...args) => {
18
+ if (NativeCallback in callback) {
19
+ const native = callback[NativeCallback];
20
+ return native(...args);
21
+ }
22
+ return Effect_exports.tryPromise({ try: () => callback(...args), catch: (error) => error });
23
+ };
24
+ var toPromise = (operation, signal) => {
25
+ const native = (...args) => Effect_exports.suspend(() => {
26
+ if (signal === void 0) return operation(...args);
27
+ if (signal.aborted) return Effect_exports.interrupt;
28
+ const cancelled = Effect_exports.callback((resume) => {
29
+ if (signal.aborted) {
30
+ resume(Effect_exports.interrupt);
31
+ return;
32
+ }
33
+ const abort = () => resume(Effect_exports.interrupt);
34
+ signal.addEventListener("abort", abort, { once: true });
35
+ return Effect_exports.sync(() => signal.removeEventListener("abort", abort));
36
+ });
37
+ return Effect_exports.raceFirst(
38
+ cancelled,
39
+ Effect_exports.suspend(() => operation(...args))
40
+ );
41
+ });
42
+ return Object.assign((...args) => Effect_exports.runPromise(native(...args)), {
43
+ [NativeCallback]: native
44
+ });
45
+ };
46
+
47
+ // src/implementation/operations.ts
48
+ var NativeOperation = /* @__PURE__ */ Symbol("apps.Operation");
49
+ var NativeRouterKey = /* @__PURE__ */ Symbol("apps.Router");
50
+ var operationDeclaration = (operation) => ({
51
+ kind: operation.kind,
52
+ [NativeOperation]: operation
53
+ });
54
+ var nativeOperation = (value) => {
55
+ if (typeof value !== "object" || value === null || !(NativeOperation in value)) return void 0;
56
+ return value[NativeOperation];
57
+ };
58
+ var operationOptions = (options) => {
59
+ const approval = options.approval;
60
+ return {
61
+ ...options.description === void 0 ? {} : { description: options.description },
62
+ ...options.title === void 0 ? {} : { title: options.title },
63
+ ...options.annotations === void 0 ? {} : { annotations: options.annotations },
64
+ ...options._meta === void 0 ? {} : { _meta: options._meta },
65
+ input: decoderOf(options.input),
66
+ ...approval === void 0 ? {} : {
67
+ approval: (context) => Effect_exports.tryPromise({ try: async () => approval(context), catch: (error) => error })
68
+ }
69
+ };
70
+ };
71
+ var withApproval = (operation, approval) => ({
72
+ ...operation,
73
+ [NativeOperation]: {
74
+ ...operation[NativeOperation],
75
+ approval: (context) => Effect_exports.tryPromise({ try: async () => approval(context), catch: (error) => error })
76
+ }
77
+ });
78
+ var make = (kind, options, run) => operationDeclaration({
79
+ ...operationOptions(options),
80
+ kind,
81
+ // The host always validates JSON serialization, even without a stronger output declaration.
82
+ ...options.output === void 0 ? {} : { output: decoderOf(options.output) },
83
+ run: (context, input) => Effect_exports.tryPromise({
84
+ // SAFETY: defineApp checks the handler context against its requirements.
85
+ // The host validates account bindings and creates the matching storage facade.
86
+ try: () => run(context, input),
87
+ catch: (error) => error
88
+ })
89
+ });
90
+ var query = (options, run) => make("query", options, run);
91
+ var mutation = (options, run) => make("mutation", options, run);
92
+
93
+ // src/implementation/router.ts
94
+ var routerDeclaration = (node) => ({
95
+ [NativeRouterKey]: node
96
+ });
97
+ var nativeRouter = (value) => {
98
+ if (typeof value !== "object" || value === null || !(NativeRouterKey in value)) return void 0;
99
+ return value[NativeRouterKey];
100
+ };
101
+ var nativeNode = (value) => nativeOperation(value) ?? nativeRouter(value);
102
+ var metaOf = (options) => {
103
+ if (options === void 0) return void 0;
104
+ const defined = Object.fromEntries(
105
+ Object.entries(options).filter(([, value]) => value !== void 0)
106
+ );
107
+ return Object.keys(defined).length === 0 ? void 0 : Schema_exports.decodeUnknownSync(RouterMeta)(defined);
108
+ };
109
+ var mergeMeta = (base, override) => base === void 0 ? override : override === void 0 ? base : { ...base, ...override };
110
+ function router(children, options) {
111
+ const meta = metaOf(options);
112
+ const existing = nativeRouter(children);
113
+ if (existing !== void 0)
114
+ return routerDeclaration(
115
+ existing.kind === "router" ? { ...existing, ...withMeta(mergeMeta(existing.meta, meta)) } : { ...existing, ...withOverrides(mergeMeta(existing.overrides, meta)) }
116
+ );
117
+ const nodes = {};
118
+ for (const [key, value] of Object.entries(children)) {
119
+ if (reservedRouterKeys.has(key)) throw new Error(`Router key "${key}" is reserved`);
120
+ if (!Schema_exports.is(RouterKey)(key))
121
+ throw new Error(`Router key "${key}" must start with a letter or _ and contain no dots`);
122
+ const node = nativeNode(value);
123
+ if (node === void 0)
124
+ throw new Error(`Router key "${key}" must be a query, mutation or router`);
125
+ nodes[key] = node;
126
+ }
127
+ return routerDeclaration({ kind: "router", ...withMeta(meta), children: nodes });
128
+ }
129
+ var withMeta = (meta) => meta === void 0 ? {} : { meta };
130
+ var withOverrides = (overrides) => overrides === void 0 ? {} : { overrides };
131
+ var dynamicRouter = (source) => {
132
+ const meta = source.meta;
133
+ return routerDeclaration({
134
+ kind: "dynamic",
135
+ ...meta === void 0 ? {} : {
136
+ meta: () => fromPromise(async () => meta())().pipe(
137
+ Effect_exports.flatMap((options) => Schema_exports.decodeUnknownEffect(RouterMeta)(options))
138
+ )
139
+ },
140
+ list: () => fromPromise(async () => source.list())().pipe(
141
+ Effect_exports.flatMap(Schema_exports.decodeUnknownEffect(Schema_exports.Array(HostedTool)))
142
+ ),
143
+ resolve: (name) => fromPromise(async () => source.resolve(name))().pipe(
144
+ Effect_exports.map((value) => {
145
+ if (value === void 0) return void 0;
146
+ const operation = nativeOperation(value);
147
+ if (operation === void 0) throw new Error("Expected an operation declaration");
148
+ return operation;
149
+ })
150
+ )
151
+ });
152
+ };
153
+ var joinPath = (path, name) => path === "" ? name : `${path}.${name}`;
154
+ var locate = (root, name) => {
155
+ if (root?.kind === "dynamic") return { kind: "dynamic", source: root, router: "", name };
156
+ let current = root;
157
+ let path = "";
158
+ let rest = name;
159
+ while (current !== void 0) {
160
+ const dot = rest.indexOf(".");
161
+ const key = dot < 0 ? rest : rest.slice(0, dot);
162
+ const child = Object.hasOwn(current.children, key) ? current.children[key] : void 0;
163
+ if (child === void 0) return void 0;
164
+ const remaining = dot < 0 ? void 0 : rest.slice(dot + 1);
165
+ switch (child.kind) {
166
+ case "query":
167
+ case "mutation":
168
+ return remaining === void 0 ? { kind: "operation", operation: child, router: path } : void 0;
169
+ case "dynamic":
170
+ return remaining === void 0 || remaining === "" ? void 0 : { kind: "dynamic", source: child, router: joinPath(path, key), name: remaining };
171
+ case "router":
172
+ if (remaining === void 0) return void 0;
173
+ current = child;
174
+ path = joinPath(path, key);
175
+ rest = remaining;
176
+ }
177
+ }
178
+ return void 0;
179
+ };
180
+ var declaredOperations = (root, path = "") => Object.entries(root?.children ?? {}).flatMap(([key, child]) => {
181
+ const name = joinPath(path, key);
182
+ switch (child.kind) {
183
+ case "query":
184
+ case "mutation":
185
+ return [{ name, router: path, operation: child }];
186
+ case "router":
187
+ return declaredOperations(child, name);
188
+ case "dynamic":
189
+ return [];
190
+ }
191
+ });
192
+
193
+ export {
194
+ fromPromise,
195
+ toPromise,
196
+ operationDeclaration,
197
+ nativeOperation,
198
+ withApproval,
199
+ query,
200
+ mutation,
201
+ routerDeclaration,
202
+ nativeRouter,
203
+ mergeMeta,
204
+ router,
205
+ dynamicRouter,
206
+ joinPath,
207
+ locate,
208
+ declaredOperations
209
+ };
package/js/client.js CHANGED
@@ -28,7 +28,7 @@ import {
28
28
  } from "./chunk-UK573G7W.js";
29
29
  import {
30
30
  decoderOf
31
- } from "./chunk-FWQC6I3C.js";
31
+ } from "./chunk-5T57N25Q.js";
32
32
  import {
33
33
  StorageName
34
34
  } from "./chunk-PZB6T6KU.js";
package/js/contracts.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import {
2
+ ApiErrorResponse,
2
3
  ApprovalElicitation,
3
4
  ApprovalResponse,
4
5
  CalendarSchedule,
@@ -24,6 +25,7 @@ import {
24
25
  HostInputInvalid,
25
26
  HostInspectError,
26
27
  HostInvocation,
28
+ HostKindMismatch,
27
29
  HostOperationFailed,
28
30
  HostOperationNotFound,
29
31
  HostOutputInvalid,
@@ -31,10 +33,14 @@ import {
31
33
  HostRequestInvalid,
32
34
  HostRequirementsError,
33
35
  HostResponse,
36
+ HostRouterError,
34
37
  HostToolApprovalRequired,
35
38
  HostToolBlocked,
36
39
  HostToolNotFound,
37
40
  HostToolPolicyFailed,
41
+ HostedCatalog,
42
+ HostedCatalogSummary,
43
+ HostedRouter,
38
44
  HostedTool,
39
45
  HostedToolSummary,
40
46
  HostedWebhook,
@@ -49,10 +55,13 @@ import {
49
55
  NonRetryableError,
50
56
  OAuthClientAuth,
51
57
  OAuthSecretClientAuth,
58
+ OpenapiResponseError,
52
59
  OperationSchedule,
53
- OperationToolPrefixes,
54
60
  ResolvedAccount,
55
61
  ResolvedAccounts,
62
+ RouterIcon,
63
+ RouterKey,
64
+ RouterMeta,
56
65
  ScheduleTiming,
57
66
  SkillCatalogResponse,
58
67
  SkillSources,
@@ -90,16 +99,19 @@ import {
90
99
  protocol1,
91
100
  protocol2,
92
101
  protocol3,
102
+ protocol4,
93
103
  selectTools,
94
104
  skillCatalog,
95
105
  skillsCommand,
96
106
  workflowDurationMillis
97
- } from "./chunk-DQAZTA4I.js";
107
+ } from "./chunk-B3EOZTK3.js";
98
108
  import {
99
109
  DatabaseFieldReserved,
100
110
  DatabaseLimitExceeded
101
111
  } from "./chunk-N7YDVXYJ.js";
102
- import "./chunk-YEPYT6SD.js";
112
+ import {
113
+ ProviderError
114
+ } from "./chunk-R3EV5FTO.js";
103
115
  import {
104
116
  AppSkillMetadata,
105
117
  AppSkillName,
@@ -113,13 +125,6 @@ import {
113
125
  skillFormatLimits,
114
126
  skillLoadLimits
115
127
  } from "./chunk-JU7VHODU.js";
116
- import {
117
- ApiErrorResponse,
118
- OpenapiResponseError
119
- } from "./chunk-W4DMKWAB.js";
120
- import {
121
- ProviderError
122
- } from "./chunk-SB3V4YVR.js";
123
128
  import {
124
129
  AppStorageError,
125
130
  AppStorageUnavailable,
@@ -167,6 +172,7 @@ export {
167
172
  HostInputInvalid,
168
173
  HostInspectError,
169
174
  HostInvocation,
175
+ HostKindMismatch,
170
176
  HostOperationFailed,
171
177
  HostOperationNotFound,
172
178
  HostOutputInvalid,
@@ -174,10 +180,14 @@ export {
174
180
  HostRequestInvalid,
175
181
  HostRequirementsError,
176
182
  HostResponse,
183
+ HostRouterError,
177
184
  HostToolApprovalRequired,
178
185
  HostToolBlocked,
179
186
  HostToolNotFound,
180
187
  HostToolPolicyFailed,
188
+ HostedCatalog,
189
+ HostedCatalogSummary,
190
+ HostedRouter,
181
191
  HostedTool,
182
192
  HostedToolSummary,
183
193
  HostedWebhook,
@@ -195,10 +205,12 @@ export {
195
205
  OAuthSecretClientAuth,
196
206
  OpenapiResponseError,
197
207
  OperationSchedule,
198
- OperationToolPrefixes,
199
208
  ProviderError,
200
209
  ResolvedAccount,
201
210
  ResolvedAccounts,
211
+ RouterIcon,
212
+ RouterKey,
213
+ RouterMeta,
202
214
  ScheduleTiming,
203
215
  SkillCatalogResponse,
204
216
  SkillDefinitionInvalid,
@@ -242,6 +254,7 @@ export {
242
254
  protocol1,
243
255
  protocol2,
244
256
  protocol3,
257
+ protocol4,
245
258
  selectTools,
246
259
  skillCatalog,
247
260
  skillFormatLimits,
package/js/effect.js CHANGED
@@ -3,22 +3,20 @@ import {
3
3
  ApprovalDecision,
4
4
  createAppHandler,
5
5
  prepareElicitation
6
- } from "./chunk-LUVSFETN.js";
7
- import "./chunk-CYYBFC2K.js";
6
+ } from "./chunk-SB4HEPNJ.js";
7
+ import "./chunk-NKLWZJLE.js";
8
+ import "./chunk-MNMNLXBL.js";
8
9
  import "./chunk-IPI4MFSN.js";
9
- import "./chunk-4M277YTM.js";
10
- import "./chunk-C3VAOK5B.js";
10
+ import "./chunk-OE3QQTSB.js";
11
11
  import "./chunk-ZQINWV4W.js";
12
- import "./chunk-3XKZDQLM.js";
13
- import "./chunk-G7T27IWB.js";
12
+ import "./chunk-T7GKZBLP.js";
13
+ import "./chunk-MKWZPDR6.js";
14
14
  import {
15
15
  ToolAnnotations
16
- } from "./chunk-DQAZTA4I.js";
16
+ } from "./chunk-B3EOZTK3.js";
17
17
  import "./chunk-N7YDVXYJ.js";
18
- import "./chunk-YEPYT6SD.js";
18
+ import "./chunk-R3EV5FTO.js";
19
19
  import "./chunk-JU7VHODU.js";
20
- import "./chunk-W4DMKWAB.js";
21
- import "./chunk-SB3V4YVR.js";
22
20
  import "./chunk-RJDDBDSN.js";
23
21
  import "./chunk-57RKNWL2.js";
24
22
  import "./chunk-UK573G7W.js";
@@ -27,7 +25,7 @@ import {
27
25
  decoderOf,
28
26
  jsonSchemaDecoder,
29
27
  wrap
30
- } from "./chunk-FWQC6I3C.js";
28
+ } from "./chunk-5T57N25Q.js";
31
29
  import "./chunk-PZB6T6KU.js";
32
30
  import {
33
31
  HttpUrl,
package/js/graphql.js CHANGED
@@ -1,34 +1,33 @@
1
1
  import {
2
2
  catalogCache
3
- } from "./chunk-XHO2ZX6W.js";
3
+ } from "./chunk-RFVIONFX.js";
4
4
  import {
5
5
  protocolOperations
6
- } from "./chunk-TDNYXSIX.js";
6
+ } from "./chunk-ECQFRCH4.js";
7
7
  import "./chunk-BCSNKUAC.js";
8
- import "./chunk-LUVSFETN.js";
8
+ import "./chunk-SB4HEPNJ.js";
9
9
  import {
10
10
  cacheKey
11
- } from "./chunk-CYYBFC2K.js";
11
+ } from "./chunk-NKLWZJLE.js";
12
+ import "./chunk-MNMNLXBL.js";
12
13
  import "./chunk-IPI4MFSN.js";
13
- import "./chunk-4M277YTM.js";
14
- import "./chunk-C3VAOK5B.js";
14
+ import "./chunk-OE3QQTSB.js";
15
15
  import "./chunk-ZQINWV4W.js";
16
16
  import {
17
- nativeOperation
18
- } from "./chunk-3XKZDQLM.js";
17
+ nativeOperation,
18
+ routerDeclaration
19
+ } from "./chunk-T7GKZBLP.js";
19
20
  import {
20
21
  accountProviderError,
21
22
  graphqlProviderError,
22
23
  httpProviderError
23
- } from "./chunk-G7T27IWB.js";
24
- import "./chunk-DQAZTA4I.js";
24
+ } from "./chunk-MKWZPDR6.js";
25
+ import "./chunk-B3EOZTK3.js";
25
26
  import "./chunk-N7YDVXYJ.js";
26
- import "./chunk-YEPYT6SD.js";
27
- import "./chunk-JU7VHODU.js";
28
- import "./chunk-W4DMKWAB.js";
29
27
  import {
30
28
  ProviderError
31
- } from "./chunk-SB3V4YVR.js";
29
+ } from "./chunk-R3EV5FTO.js";
30
+ import "./chunk-JU7VHODU.js";
32
31
  import "./chunk-RJDDBDSN.js";
33
32
  import {
34
33
  FetchHttpClient_exports
@@ -39,7 +38,7 @@ import {
39
38
  } from "./chunk-UK573G7W.js";
40
39
  import {
41
40
  jsonSchemaDecoder
42
- } from "./chunk-FWQC6I3C.js";
41
+ } from "./chunk-5T57N25Q.js";
43
42
  import "./chunk-PZB6T6KU.js";
44
43
  import {
45
44
  AccountId,
@@ -449,13 +448,13 @@ var graphqlCatalog = (options, kinds) => Effect_exports.gen(function* () {
449
448
  },
450
449
  load: (context) => (context === void 0 ? Effect_exports.succeed(client) : graphqlClientEffect({ ...parsed, signal: context.signal })).pipe(
451
450
  Effect_exports.flatMap((source) => source.discover),
452
- Effect_exports.flatMap(graphqlDefinitions)
451
+ Effect_exports.flatMap(graphqlDefinitions),
452
+ Effect_exports.map((tools) => ({ tools }))
453
453
  )
454
454
  });
455
455
  const kindOf = (tool) => Object.hasOwn(kinds, tool.name) ? kinds[tool.name] ?? "mutation" : tool.kind;
456
- const qualified = (tool) => `${kindOf(tool) === "query" ? "queries" : "mutations"}.${tool.name}`;
457
456
  const summarize = (tool) => ({
458
- name: qualified(tool),
457
+ name: tool.name,
459
458
  description: tool.description,
460
459
  readOnly: kindOf(tool) === "query"
461
460
  });
@@ -463,34 +462,28 @@ var graphqlCatalog = (options, kinds) => Effect_exports.gen(function* () {
463
462
  ...summarize(tool),
464
463
  inputSchema: tool.inputSchema
465
464
  });
466
- const selected = (name) => Effect_exports.gen(function* () {
467
- if (!name.startsWith("queries.") && !name.startsWith("mutations.")) return void 0;
468
- const tool = yield* catalog.resolve(name.slice(name.indexOf(".") + 1));
469
- return tool === void 0 || qualified(tool) !== name ? void 0 : tool;
470
- });
471
- const dynamicTools = {
465
+ const router = {
466
+ kind: "dynamic",
472
467
  list: () => catalog.list().pipe(Effect_exports.map((tools) => tools.map(describe))),
473
468
  summaries: () => catalog.summaries().pipe(Effect_exports.map((tools) => tools.map(summarize))),
474
- describe: (name) => selected(name).pipe(
475
- Effect_exports.map((tool) => tool === void 0 ? void 0 : describe(tool))
476
- ),
469
+ describe: (name) => catalog.resolve(name).pipe(Effect_exports.map((tool) => tool === void 0 ? void 0 : describe(tool))),
477
470
  resolve: (name) => Effect_exports.gen(function* () {
478
- const tool = yield* selected(name);
471
+ const tool = yield* catalog.resolve(name);
479
472
  if (tool === void 0) return void 0;
480
473
  const adapted = yield* adaptGraphqlTool(client, tool);
481
474
  const operations = protocolOperations({ selected: adapted }, { selected: kindOf(tool) });
482
- return nativeOperation(operations.queries.selected ?? operations.mutations.selected);
475
+ return nativeOperation(operations.selected);
483
476
  })
484
477
  };
485
- return { dynamicTools };
478
+ return routerDeclaration(router);
486
479
  });
487
480
 
488
481
  // src/graphql.ts
489
- var graphqlOperations = (options, kinds = {}) => Effect_exports.runPromise(
482
+ var graphqlRouter = (options, kinds = {}) => Effect_exports.runPromise(
490
483
  graphqlCatalog(options, kinds),
491
484
  options.signal === void 0 ? {} : { signal: options.signal }
492
485
  );
493
486
  export {
494
487
  GraphqlError,
495
- graphqlOperations
488
+ graphqlRouter
496
489
  };
package/js/host.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  createAppHandler
3
- } from "./chunk-LUVSFETN.js";
4
- import "./chunk-CYYBFC2K.js";
3
+ } from "./chunk-SB4HEPNJ.js";
4
+ import "./chunk-NKLWZJLE.js";
5
+ import "./chunk-MNMNLXBL.js";
5
6
  import "./chunk-IPI4MFSN.js";
6
- import "./chunk-4M277YTM.js";
7
- import "./chunk-C3VAOK5B.js";
7
+ import "./chunk-OE3QQTSB.js";
8
8
  import "./chunk-ZQINWV4W.js";
9
- import "./chunk-3XKZDQLM.js";
10
- import "./chunk-G7T27IWB.js";
9
+ import "./chunk-T7GKZBLP.js";
10
+ import "./chunk-MKWZPDR6.js";
11
11
  import {
12
12
  ElicitationFailed,
13
13
  ElicitationReply,
@@ -21,23 +21,21 @@ import {
21
21
  WorkflowRun,
22
22
  WorkflowRunId,
23
23
  WorkflowRunPage
24
- } from "./chunk-DQAZTA4I.js";
24
+ } from "./chunk-B3EOZTK3.js";
25
25
  import "./chunk-N7YDVXYJ.js";
26
26
  import {
27
27
  CacheCommand,
28
28
  CacheError,
29
29
  CacheReply
30
- } from "./chunk-YEPYT6SD.js";
30
+ } from "./chunk-R3EV5FTO.js";
31
31
  import "./chunk-JU7VHODU.js";
32
- import "./chunk-W4DMKWAB.js";
33
- import "./chunk-SB3V4YVR.js";
34
32
  import {
35
33
  collectTelemetry,
36
34
  withRemoteSpan
37
35
  } from "./chunk-RJDDBDSN.js";
38
36
  import "./chunk-57RKNWL2.js";
39
37
  import "./chunk-UK573G7W.js";
40
- import "./chunk-FWQC6I3C.js";
38
+ import "./chunk-5T57N25Q.js";
41
39
  import "./chunk-PZB6T6KU.js";
42
40
  import "./chunk-27F7W2LG.js";
43
41
  import {