apps 0.0.1-beta.44 → 0.0.1-beta.47

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 (55) hide show
  1. package/framework-reference.json +1 -1
  2. package/js/{chunk-DZQYE626.js → chunk-7UUHJR2Q.js} +1 -1
  3. package/js/{chunk-4ZTVLEN6.js → chunk-CDXQDN7W.js} +1 -1
  4. package/js/{chunk-V3RS2BK6.js → chunk-D45JTD6N.js} +39 -29
  5. package/js/chunk-GDYPM7RS.js +266 -0
  6. package/js/{chunk-CZGWW4NQ.js → chunk-JM7LOD2W.js} +187 -9
  7. package/js/{chunk-ELO5PRCO.js → chunk-JY56GVSV.js} +95 -4
  8. package/js/{chunk-EJUK2NK5.js → chunk-KLYSEHUD.js} +1 -1
  9. package/js/{chunk-EMHFXFTJ.js → chunk-LTDHQJ2Z.js} +53 -0
  10. package/js/{chunk-MZH4J2PO.js → chunk-PD6I2SDG.js} +1 -1
  11. package/js/{chunk-DRJRCHHO.js → chunk-PO5NPRFT.js} +204 -73
  12. package/js/{chunk-MGGMEGB2.js → chunk-QKHTRD6G.js} +2 -2
  13. package/js/{chunk-5SHUB37R.js → chunk-SVHI6AKV.js} +3 -3
  14. package/js/{chunk-KSGYJV46.js → chunk-TUMGL2OC.js} +1 -1
  15. package/js/{chunk-5GLC42LK.js → chunk-UM62MBJQ.js} +42 -24
  16. package/js/{chunk-OTGUPKKK.js → chunk-X5U5KIWQ.js} +12 -46
  17. package/js/{chunk-7EBODVQJ.js → chunk-YQD2MLFY.js} +14 -13
  18. package/js/client.js +8 -8
  19. package/js/contracts.js +25 -3
  20. package/js/effect.js +11 -11
  21. package/js/graphql.js +20 -18
  22. package/js/host.js +76 -51
  23. package/js/index.js +23 -16
  24. package/js/mcp/effect.js +13 -13
  25. package/js/mcp/stdio.js +27 -22
  26. package/js/mcp.js +20 -18
  27. package/js/openapi.js +103 -77
  28. package/js/skills/effect.js +2 -2
  29. package/js/skills.js +50 -33
  30. package/js/ui/auth.js +3 -3
  31. package/js/ui/contracts.js +3 -3
  32. package/js/ui/serving.js +6 -6
  33. package/package.json +1 -1
  34. package/runtime.json +1 -1
  35. package/types/apps/src/contracts/app.d.ts +2 -0
  36. package/types/apps/src/contracts/context.d.ts +8 -1
  37. package/types/apps/src/contracts/events.d.ts +93 -0
  38. package/types/apps/src/contracts/host.d.ts +21 -4
  39. package/types/apps/src/contracts/protocol-version.d.ts +2 -2
  40. package/types/apps/src/contracts/protocols/11.d.ts +1098 -0
  41. package/types/apps/src/host.d.ts +5 -0
  42. package/types/apps/src/implementation/authoring.d.ts +25 -5
  43. package/types/apps/src/implementation/cache.d.ts +4 -0
  44. package/types/apps/src/implementation/elicitation.d.ts +6 -3
  45. package/types/apps/src/implementation/events.d.ts +59 -0
  46. package/types/apps/src/implementation/invocation-timing.d.ts +16 -0
  47. package/types/apps/src/implementation/operations.d.ts +2 -2
  48. package/types/apps/src/implementation/router-catalog.d.ts +4 -4
  49. package/types/apps/src/implementation/sql.d.ts +5 -0
  50. package/types/apps/src/implementation/workflows.d.ts +1 -1
  51. package/types/apps/src/index.d.ts +2 -0
  52. package/types/telemetry/src/index.d.ts +1 -0
  53. package/types/telemetry/src/ownership.d.ts +56 -0
  54. package/js/chunk-646JVUH4.js +0 -156
  55. package/js/{chunk-LNSVJS2Q.js → chunk-EOPQ727L.js} +2 -2
package/js/host.js CHANGED
@@ -1,19 +1,20 @@
1
1
  import {
2
2
  createAppHandler
3
- } from "./chunk-DRJRCHHO.js";
3
+ } from "./chunk-PO5NPRFT.js";
4
4
  import "./chunk-AQU56EPI.js";
5
- import "./chunk-5SHUB37R.js";
6
- import "./chunk-DZQYE626.js";
5
+ import "./chunk-SVHI6AKV.js";
6
+ import "./chunk-7UUHJR2Q.js";
7
7
  import "./chunk-XBG7HHXC.js";
8
- import "./chunk-646JVUH4.js";
9
- import "./chunk-OTGUPKKK.js";
10
- import "./chunk-EMHFXFTJ.js";
8
+ import "./chunk-GDYPM7RS.js";
9
+ import "./chunk-X5U5KIWQ.js";
10
+ import "./chunk-LTDHQJ2Z.js";
11
11
  import {
12
12
  ElicitationFailed,
13
13
  ElicitationReply,
14
14
  HostAccountsInvalid,
15
15
  HostInputInvalid,
16
16
  HostResponse,
17
+ InvocationTimingSink,
17
18
  ResolvedAccounts,
18
19
  TrustedToolApproval,
19
20
  WorkflowFailure,
@@ -21,25 +22,26 @@ import {
21
22
  WorkflowRun,
22
23
  WorkflowRunId,
23
24
  WorkflowRunPage
24
- } from "./chunk-ELO5PRCO.js";
25
+ } from "./chunk-JY56GVSV.js";
25
26
  import {
26
27
  CacheCommand,
27
28
  CacheError,
28
29
  CacheReply
29
30
  } from "./chunk-MWKHKOTL.js";
30
31
  import "./chunk-H72MEDMN.js";
32
+ import "./chunk-KGCTYL2S.js";
31
33
  import {
32
34
  collectTelemetry,
33
35
  withRemoteSpan
34
- } from "./chunk-CZGWW4NQ.js";
35
- import "./chunk-MZH4J2PO.js";
36
- import "./chunk-KGCTYL2S.js";
36
+ } from "./chunk-JM7LOD2W.js";
37
+ import "./chunk-PD6I2SDG.js";
37
38
  import "./chunk-5FHWNLCI.js";
38
39
  import "./chunk-H2CJWXA3.js";
39
- import "./chunk-KSGYJV46.js";
40
- import "./chunk-LNSVJS2Q.js";
40
+ import "./chunk-TUMGL2OC.js";
41
+ import "./chunk-EOPQ727L.js";
41
42
  import {
42
43
  Cause_exports,
44
+ Clock_exports,
43
45
  Effect_exports,
44
46
  Redacted_exports,
45
47
  Scheduler_exports,
@@ -52,14 +54,17 @@ var isolatedCacheSession = (callback) => {
52
54
  const controller = new AbortController();
53
55
  const pending = /* @__PURE__ */ new Set();
54
56
  const cache = {
55
- transport: (command) => Effect_exports.tryPromise({
56
- try: () => callback(Schema_exports.encodeSync(CacheCommand)(command)),
57
- catch: () => new CacheError({ reason: "storage" })
58
- }).pipe(
59
- Effect_exports.flatMap(Schema_exports.decodeUnknownEffect(CacheReply)),
60
- Effect_exports.mapError(() => new CacheError({ reason: "storage" })),
61
- Effect_exports.flatMap(
62
- (reply) => reply.ok ? Effect_exports.succeed(reply.value) : Effect_exports.fail(reply.error)
57
+ transport: (command) => (
58
+ // oxlint-disable-next-line executor/authored-code-through-adapter -- the host's cache RPC
59
+ Effect_exports.tryPromise({
60
+ try: () => callback(Schema_exports.encodeSync(CacheCommand)(command)),
61
+ catch: () => new CacheError({ reason: "storage" })
62
+ }).pipe(
63
+ Effect_exports.flatMap(Schema_exports.decodeUnknownEffect(CacheReply)),
64
+ Effect_exports.mapError(() => new CacheError({ reason: "storage" })),
65
+ Effect_exports.flatMap(
66
+ (reply) => reply.ok ? Effect_exports.succeed(reply.value) : Effect_exports.fail(reply.error)
67
+ )
63
68
  )
64
69
  ),
65
70
  background: (task) => Effect_exports.gen(function* () {
@@ -97,14 +102,17 @@ var isolatedCacheSession = (callback) => {
97
102
  // src/implementation/workflow-rpc.ts
98
103
  var isolatedWorkflowExecution = (run, deliver, signal) => {
99
104
  const runId = Schema_exports.decodeUnknownSync(WorkflowRunId)(run);
100
- const request = (input, callback) => Effect_exports.tryPromise({
101
- try: () => deliver(input, callback),
102
- catch: () => new WorkflowFailure({ reason: "engine", retryable: true })
103
- }).pipe(
104
- Effect_exports.flatMap(Schema_exports.decodeUnknownEffect(WorkflowRpcResult)),
105
- Effect_exports.mapError(() => new WorkflowFailure({ reason: "engine", retryable: true })),
106
- Effect_exports.flatMap(
107
- (reply) => reply.ok ? Effect_exports.succeed(reply.value) : Effect_exports.fail(reply.error)
105
+ const request = (input, callback) => (
106
+ // oxlint-disable-next-line executor/authored-code-through-adapter -- the host's workflow RPC
107
+ Effect_exports.tryPromise({
108
+ try: () => deliver(input, callback),
109
+ catch: () => new WorkflowFailure({ reason: "engine", retryable: true })
110
+ }).pipe(
111
+ Effect_exports.flatMap(Schema_exports.decodeUnknownEffect(WorkflowRpcResult)),
112
+ Effect_exports.mapError(() => new WorkflowFailure({ reason: "engine", retryable: true })),
113
+ Effect_exports.flatMap(
114
+ (reply) => reply.ok ? Effect_exports.succeed(reply.value) : Effect_exports.fail(reply.error)
115
+ )
108
116
  )
109
117
  );
110
118
  return {
@@ -146,14 +154,17 @@ var isolatedWorkflowExecution = (run, deliver, signal) => {
146
154
  };
147
155
  };
148
156
  var isolatedWorkflowControls = (deliver) => {
149
- const request = (input) => Effect_exports.tryPromise({
150
- try: () => deliver(input),
151
- catch: () => new WorkflowFailure({ reason: "engine", retryable: true })
152
- }).pipe(
153
- Effect_exports.flatMap(Schema_exports.decodeUnknownEffect(WorkflowRpcResult)),
154
- Effect_exports.mapError(() => new WorkflowFailure({ reason: "engine", retryable: true })),
155
- Effect_exports.flatMap(
156
- (result) => result.ok ? Effect_exports.succeed(result.value) : Effect_exports.fail(result.error)
157
+ const request = (input) => (
158
+ // oxlint-disable-next-line executor/authored-code-through-adapter -- the host's workflow RPC
159
+ Effect_exports.tryPromise({
160
+ try: () => deliver(input),
161
+ catch: () => new WorkflowFailure({ reason: "engine", retryable: true })
162
+ }).pipe(
163
+ Effect_exports.flatMap(Schema_exports.decodeUnknownEffect(WorkflowRpcResult)),
164
+ Effect_exports.mapError(() => new WorkflowFailure({ reason: "engine", retryable: true })),
165
+ Effect_exports.flatMap(
166
+ (result) => result.ok ? Effect_exports.succeed(result.value) : Effect_exports.fail(result.error)
167
+ )
157
168
  )
158
169
  );
159
170
  const run = (input) => request(input).pipe(
@@ -202,17 +213,27 @@ var createAppHandler2 = (app) => {
202
213
  );
203
214
  };
204
215
  };
216
+ var isolatedClock = () => Effect_exports.runSync(Clock_exports.currentTimeNanos);
205
217
  var createIsolatedAppHandler = (app) => {
206
218
  const handler = createAppHandler(app);
207
219
  return (request, context) => Effect_exports.runPromise(
208
220
  Effect_exports.gen(function* () {
221
+ let timing;
209
222
  const { value, telemetry } = yield* collectTelemetry(
210
- handler(request, context).pipe(withRemoteSpan(request, "app.dispatch"))
223
+ handler(request, context).pipe(
224
+ withRemoteSpan(request, "app.dispatch"),
225
+ Effect_exports.provideService(InvocationTimingSink, (reported) => {
226
+ timing = reported;
227
+ })
228
+ )
211
229
  );
212
230
  const body = yield* Effect_exports.promise(() => value.json()).pipe(
213
231
  Effect_exports.flatMap(Schema_exports.decodeUnknownEffect(HostResponse))
214
232
  );
215
- return Response.json({ ...body, telemetry }, { status: value.status });
233
+ return Response.json(
234
+ { ...body, telemetry, ...timing === void 0 ? {} : { timing } },
235
+ { status: value.status }
236
+ );
216
237
  }),
217
238
  {
218
239
  signal: request.signal,
@@ -222,20 +243,23 @@ var createIsolatedAppHandler = (app) => {
222
243
  }
223
244
  );
224
245
  };
225
- var isolatedElicitation = (deliver, lifetime) => (request) => Effect_exports.tryPromise({
226
- try: () => deliver(request),
227
- catch: () => {
228
- lifetime.abort();
229
- return new ElicitationFailed({ reason: "transport" });
230
- }
231
- }).pipe(
232
- Effect_exports.flatMap(
233
- (reply) => Schema_exports.decodeUnknownEffect(ElicitationReply)(reply).pipe(
234
- Effect_exports.mapError(() => new ElicitationFailed({ reason: "transport" }))
246
+ var isolatedElicitation = (deliver, lifetime) => (request) => (
247
+ // oxlint-disable-next-line executor/authored-code-through-adapter -- the host's elicitation RPC
248
+ Effect_exports.tryPromise({
249
+ try: () => deliver(request),
250
+ catch: () => {
251
+ lifetime.abort();
252
+ return new ElicitationFailed({ reason: "transport" });
253
+ }
254
+ }).pipe(
255
+ Effect_exports.flatMap(
256
+ (reply) => Schema_exports.decodeUnknownEffect(ElicitationReply)(reply).pipe(
257
+ Effect_exports.mapError(() => new ElicitationFailed({ reason: "transport" }))
258
+ )
259
+ ),
260
+ Effect_exports.flatMap(
261
+ (reply) => reply.ok ? Effect_exports.succeed(reply.response) : Effect_exports.fail(reply.error)
235
262
  )
236
- ),
237
- Effect_exports.flatMap(
238
- (reply) => reply.ok ? Effect_exports.succeed(reply.response) : Effect_exports.fail(reply.error)
239
263
  )
240
264
  );
241
265
  export {
@@ -243,6 +267,7 @@ export {
243
267
  createIsolatedAppHandler,
244
268
  hostContext,
245
269
  isolatedCacheSession,
270
+ isolatedClock,
246
271
  isolatedElicitation,
247
272
  isolatedWorkflowControls,
248
273
  isolatedWorkflowExecution
package/js/index.js CHANGED
@@ -2,11 +2,11 @@ import {
2
2
  ResponseDecodeError,
3
3
  ResponseStatusError,
4
4
  defineApp,
5
+ event,
5
6
  workflow
6
- } from "./chunk-646JVUH4.js";
7
+ } from "./chunk-GDYPM7RS.js";
7
8
  import {
8
9
  dynamicRouter,
9
- fromPromise,
10
10
  mutation,
11
11
  nativeOperation,
12
12
  nativeRouter,
@@ -17,10 +17,11 @@ import {
17
17
  toolAnnotations,
18
18
  withApproval,
19
19
  withApprovals
20
- } from "./chunk-OTGUPKKK.js";
20
+ } from "./chunk-X5U5KIWQ.js";
21
21
  import {
22
- accountProviderError
23
- } from "./chunk-EMHFXFTJ.js";
22
+ accountProviderError,
23
+ fromPromise
24
+ } from "./chunk-LTDHQJ2Z.js";
24
25
  import {
25
26
  CalendarSchedule,
26
27
  ElicitationFailed,
@@ -35,7 +36,7 @@ import {
35
36
  ScheduleTiming,
36
37
  SecretsMethod,
37
38
  WorkflowFailure
38
- } from "./chunk-ELO5PRCO.js";
39
+ } from "./chunk-JY56GVSV.js";
39
40
  import {
40
41
  CacheError,
41
42
  FetchOptionUnsupported,
@@ -65,14 +66,16 @@ import {
65
66
  withLazyJsonSchemaDocument,
66
67
  wrap
67
68
  } from "./chunk-KGCTYL2S.js";
69
+ import "./chunk-JM7LOD2W.js";
70
+ import "./chunk-PD6I2SDG.js";
68
71
  import "./chunk-5FHWNLCI.js";
69
72
  import {
70
73
  JsonObject,
71
74
  JsonValue,
72
75
  ValidationError
73
76
  } from "./chunk-H2CJWXA3.js";
74
- import "./chunk-KSGYJV46.js";
75
- import "./chunk-LNSVJS2Q.js";
77
+ import "./chunk-TUMGL2OC.js";
78
+ import "./chunk-EOPQ727L.js";
76
79
  import {
77
80
  Effect_exports,
78
81
  Schema_exports
@@ -100,7 +103,7 @@ var defineProvider = ({
100
103
  ...options
101
104
  }) => {
102
105
  if (health === void 0) return new Provider(options);
103
- const run = fromPromise(health);
106
+ const run = fromPromise(health, "check");
104
107
  return new Provider({ ...options, health: { run } });
105
108
  };
106
109
 
@@ -341,7 +344,7 @@ var accountRouter = (accounts, discover, options) => Effect_exports.runPromise(
341
344
 
342
345
  // src/implementation/dynamic-skills.ts
343
346
  var dynamicSkills = (source) => ({
344
- list: fromPromise(async () => source.list())
347
+ list: fromPromise(async () => source.list(), "skills")
345
348
  });
346
349
 
347
350
  // src/contracts/app.ts
@@ -404,12 +407,15 @@ function oauth22(options) {
404
407
  var decodeJson2 = (response, schema) => {
405
408
  const native = {
406
409
  status: response.status,
407
- json: () => Effect_exports.tryPromise({
408
- try: () => response.json(),
409
- catch: (error) => error
410
- }).pipe(
411
- Effect_exports.catch(
412
- (error) => error instanceof SyntaxError ? Effect_exports.fail(new ResponseDecodeError()) : Effect_exports.die(error)
410
+ json: () => (
411
+ // oxlint-disable-next-line executor/authored-code-through-adapter -- a Response the app passes from its own code
412
+ Effect_exports.tryPromise({
413
+ try: () => response.json(),
414
+ catch: (error) => error
415
+ }).pipe(
416
+ Effect_exports.catch(
417
+ (error) => error instanceof SyntaxError ? Effect_exports.fail(new ResponseDecodeError()) : Effect_exports.die(error)
418
+ )
413
419
  )
414
420
  )
415
421
  };
@@ -437,6 +443,7 @@ export {
437
443
  defineProvider,
438
444
  dynamicRouter,
439
445
  dynamicSkills,
446
+ event,
440
447
  interval,
441
448
  json,
442
449
  jsonSchema,
package/js/mcp/effect.js CHANGED
@@ -2,27 +2,27 @@ import {
2
2
  mcpClientEffect,
3
3
  mcpHealthEffect,
4
4
  mcpToolsEffect
5
- } from "../chunk-7EBODVQJ.js";
6
- import "../chunk-V3RS2BK6.js";
5
+ } from "../chunk-YQD2MLFY.js";
6
+ import "../chunk-D45JTD6N.js";
7
7
  import "../chunk-BCSNKUAC.js";
8
- import "../chunk-DRJRCHHO.js";
8
+ import "../chunk-PO5NPRFT.js";
9
9
  import "../chunk-AQU56EPI.js";
10
- import "../chunk-5SHUB37R.js";
11
- import "../chunk-DZQYE626.js";
10
+ import "../chunk-SVHI6AKV.js";
11
+ import "../chunk-7UUHJR2Q.js";
12
12
  import "../chunk-XBG7HHXC.js";
13
- import "../chunk-646JVUH4.js";
14
- import "../chunk-OTGUPKKK.js";
15
- import "../chunk-EMHFXFTJ.js";
16
- import "../chunk-ELO5PRCO.js";
13
+ import "../chunk-GDYPM7RS.js";
14
+ import "../chunk-X5U5KIWQ.js";
15
+ import "../chunk-LTDHQJ2Z.js";
16
+ import "../chunk-JY56GVSV.js";
17
17
  import "../chunk-MWKHKOTL.js";
18
18
  import "../chunk-H72MEDMN.js";
19
- import "../chunk-CZGWW4NQ.js";
20
- import "../chunk-MZH4J2PO.js";
21
19
  import "../chunk-KGCTYL2S.js";
20
+ import "../chunk-JM7LOD2W.js";
21
+ import "../chunk-PD6I2SDG.js";
22
22
  import "../chunk-5FHWNLCI.js";
23
23
  import "../chunk-H2CJWXA3.js";
24
- import "../chunk-KSGYJV46.js";
25
- import "../chunk-LNSVJS2Q.js";
24
+ import "../chunk-TUMGL2OC.js";
25
+ import "../chunk-EOPQ727L.js";
26
26
  import "../chunk-IFJU5SYQ.js";
27
27
  import "../chunk-CZ7CSFO4.js";
28
28
  export {
package/js/mcp/stdio.js CHANGED
@@ -3,32 +3,34 @@ import {
3
3
  answeredError,
4
4
  mcpClient,
5
5
  mcpJsonSchemaValidator
6
- } from "../chunk-V3RS2BK6.js";
6
+ } from "../chunk-D45JTD6N.js";
7
7
  import {
8
8
  protocolRouter
9
- } from "../chunk-MGGMEGB2.js";
9
+ } from "../chunk-QKHTRD6G.js";
10
10
  import "../chunk-BCSNKUAC.js";
11
- import "../chunk-DRJRCHHO.js";
11
+ import "../chunk-PO5NPRFT.js";
12
12
  import "../chunk-AQU56EPI.js";
13
- import "../chunk-5SHUB37R.js";
14
- import "../chunk-DZQYE626.js";
13
+ import "../chunk-SVHI6AKV.js";
14
+ import "../chunk-7UUHJR2Q.js";
15
15
  import "../chunk-XBG7HHXC.js";
16
- import "../chunk-646JVUH4.js";
17
- import "../chunk-OTGUPKKK.js";
18
- import "../chunk-EMHFXFTJ.js";
16
+ import "../chunk-GDYPM7RS.js";
17
+ import "../chunk-X5U5KIWQ.js";
18
+ import "../chunk-LTDHQJ2Z.js";
19
19
  import {
20
20
  McpError,
21
21
  ProcessConfig
22
- } from "../chunk-ELO5PRCO.js";
22
+ } from "../chunk-JY56GVSV.js";
23
23
  import "../chunk-MWKHKOTL.js";
24
24
  import "../chunk-H72MEDMN.js";
25
- import "../chunk-CZGWW4NQ.js";
26
- import "../chunk-MZH4J2PO.js";
27
25
  import "../chunk-KGCTYL2S.js";
26
+ import {
27
+ owned
28
+ } from "../chunk-JM7LOD2W.js";
29
+ import "../chunk-PD6I2SDG.js";
28
30
  import "../chunk-5FHWNLCI.js";
29
31
  import "../chunk-H2CJWXA3.js";
30
- import "../chunk-KSGYJV46.js";
31
- import "../chunk-LNSVJS2Q.js";
32
+ import "../chunk-TUMGL2OC.js";
33
+ import "../chunk-EOPQ727L.js";
32
34
  import {
33
35
  Effect_exports,
34
36
  Schema_exports
@@ -88,22 +90,25 @@ function withClient(config, mode, use) {
88
90
  stderr: "ignore"
89
91
  })
90
92
  })),
91
- ({ client: client2, transport: transport2 }) => Effect_exports.tryPromise(async () => {
92
- try {
93
- await client2.close();
94
- } finally {
95
- await transport2.close();
96
- }
97
- }).pipe(Effect_exports.withSpan("provider.mcp.close"), Effect_exports.orDie)
93
+ ({ client: client2, transport: transport2 }) => (
94
+ // oxlint-disable-next-line executor/authored-code-through-adapter -- MCP SDK
95
+ Effect_exports.tryPromise(async () => {
96
+ try {
97
+ await client2.close();
98
+ } finally {
99
+ await transport2.close();
100
+ }
101
+ }).pipe(owned("upstream", "provider.mcp.close"), Effect_exports.orDie)
102
+ )
98
103
  );
99
104
  yield* Effect_exports.tryPromise({
100
105
  try: (signal) => client.connect(transport, { signal, timeout: config.timeoutMs }),
101
106
  catch: (error) => failure("connect", error)
102
- }).pipe(Effect_exports.timeout(config.timeoutMs), Effect_exports.withSpan("provider.mcp.connect"));
107
+ }).pipe(Effect_exports.timeout(config.timeoutMs), owned("upstream", "provider.mcp.connect"));
103
108
  return yield* use(client);
104
109
  })
105
110
  ).pipe(
106
- Effect_exports.withSpan("provider.mcp.session", {
111
+ owned("upstream", "provider.mcp.session", {
107
112
  attributes: { "mcp.transport": "stdio", "mcp.operation": mode }
108
113
  }),
109
114
  (operation) => mode === "discover" ? operation.pipe(Effect_exports.timeout(config.timeoutMs)) : operation,
package/js/mcp.js CHANGED
@@ -1,49 +1,52 @@
1
1
  import {
2
2
  mcpClientEffect,
3
3
  mcpHealthEffect
4
- } from "./chunk-7EBODVQJ.js";
4
+ } from "./chunk-YQD2MLFY.js";
5
5
  import {
6
6
  catalogCache,
7
7
  catalogScope
8
- } from "./chunk-5GLC42LK.js";
8
+ } from "./chunk-UM62MBJQ.js";
9
9
  import {
10
10
  adaptMcpTool
11
- } from "./chunk-V3RS2BK6.js";
11
+ } from "./chunk-D45JTD6N.js";
12
12
  import {
13
13
  protocolOperations
14
- } from "./chunk-MGGMEGB2.js";
14
+ } from "./chunk-QKHTRD6G.js";
15
15
  import "./chunk-BCSNKUAC.js";
16
- import "./chunk-DRJRCHHO.js";
16
+ import "./chunk-PO5NPRFT.js";
17
17
  import {
18
18
  cacheKey
19
19
  } from "./chunk-AQU56EPI.js";
20
20
  import {
21
21
  operationDescription
22
- } from "./chunk-5SHUB37R.js";
23
- import "./chunk-DZQYE626.js";
22
+ } from "./chunk-SVHI6AKV.js";
23
+ import "./chunk-7UUHJR2Q.js";
24
24
  import "./chunk-XBG7HHXC.js";
25
- import "./chunk-646JVUH4.js";
25
+ import "./chunk-GDYPM7RS.js";
26
26
  import {
27
27
  nativeOperation,
28
28
  routerDeclaration
29
- } from "./chunk-OTGUPKKK.js";
30
- import "./chunk-EMHFXFTJ.js";
29
+ } from "./chunk-X5U5KIWQ.js";
30
+ import {
31
+ fromPromise,
32
+ method
33
+ } from "./chunk-LTDHQJ2Z.js";
31
34
  import {
32
35
  McpCredentialsUnverified,
33
36
  McpError,
34
37
  McpServerHeader,
35
38
  McpToolMetadata,
36
39
  McpToolsOptions
37
- } from "./chunk-ELO5PRCO.js";
40
+ } from "./chunk-JY56GVSV.js";
38
41
  import "./chunk-MWKHKOTL.js";
39
42
  import "./chunk-H72MEDMN.js";
40
- import "./chunk-CZGWW4NQ.js";
41
- import "./chunk-MZH4J2PO.js";
42
43
  import "./chunk-KGCTYL2S.js";
44
+ import "./chunk-JM7LOD2W.js";
45
+ import "./chunk-PD6I2SDG.js";
43
46
  import "./chunk-5FHWNLCI.js";
44
47
  import "./chunk-H2CJWXA3.js";
45
- import "./chunk-KSGYJV46.js";
46
- import "./chunk-LNSVJS2Q.js";
48
+ import "./chunk-TUMGL2OC.js";
49
+ import "./chunk-EOPQ727L.js";
47
50
  import {
48
51
  Effect_exports,
49
52
  Schema_exports
@@ -54,7 +57,6 @@ import "./chunk-CZ7CSFO4.js";
54
57
  var McpToolSummary = McpToolMetadata.mapFields(
55
58
  ({ inputSchema: _input, outputSchema: _output, _meta, ...fields }) => fields
56
59
  );
57
- var invoke = (work) => Effect_exports.tryPromise({ try: work, catch: (error) => error });
58
60
  var serverMeta = (server) => {
59
61
  const title = server.title ?? server.name;
60
62
  return {
@@ -76,7 +78,7 @@ var mcpCatalog = (options, kinds) => Effect_exports.gen(function* () {
76
78
  const cache = yield* catalogScope(options, options.headers, invalid);
77
79
  const id = yield* cacheKey({ url: parsed.url });
78
80
  const key = ["mcp-catalog-v3", id, "current"];
79
- const changed = cache === void 0 ? void 0 : invoke(() => cache.invalidate(key));
81
+ const changed = cache === void 0 ? void 0 : fromPromise(method(cache, "invalidate"), "cache")(key);
80
82
  const client = yield* mcpClientEffect(parsed, changed);
81
83
  const catalog = yield* catalogCache({
82
84
  ...options,
@@ -89,7 +91,7 @@ var mcpCatalog = (options, kinds) => Effect_exports.gen(function* () {
89
91
  },
90
92
  load: (context) => (context === void 0 ? client.list : mcpClientEffect(
91
93
  { ...parsed, signal: context.signal },
92
- invoke(() => context.cache.invalidate(key))
94
+ fromPromise(method(context.cache, "invalidate"), "cache")(key)
93
95
  ).pipe(Effect_exports.flatMap((source) => source.list))).pipe(
94
96
  Effect_exports.flatMap(
95
97
  ({ tools, server }) => Schema_exports.encodeEffect(McpServerHeader)(server).pipe(