apps 0.0.1-beta.142 → 0.0.1-beta.144

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 (72) hide show
  1. package/check-publish.mjs +0 -1
  2. package/framework-reference.json +1 -1
  3. package/js/{chunk-I6QAWNUM.js → chunk-2OGVSUNI.js} +2 -2
  4. package/js/{chunk-RIOLCZAV.js → chunk-455CCO6Q.js} +9 -17
  5. package/js/{chunk-W2C3IOZJ.js → chunk-5MEOL2SG.js} +32 -29
  6. package/js/{chunk-PQKQIH3T.js → chunk-6NRWFVK2.js} +10 -31
  7. package/js/{chunk-WZ36P57R.js → chunk-6OWHQINS.js} +11 -16
  8. package/js/{chunk-LSOHA2RH.js → chunk-6XBOKQ4E.js} +1 -1
  9. package/js/{chunk-H2K7OZ47.js → chunk-7A4ZSEM3.js} +1 -1
  10. package/js/{chunk-QTX7OUFH.js → chunk-A6FRLRCN.js} +2 -3
  11. package/js/{chunk-ZQVWMEH6.js → chunk-AFEMXP3F.js} +6 -7
  12. package/js/{chunk-Z5O7ON6S.js → chunk-B2PSDMZP.js} +2 -2
  13. package/js/{chunk-Q7PE4PLU.js → chunk-B4JN2A6F.js} +3 -3
  14. package/js/{chunk-VX36SA7Y.js → chunk-BHSWVS3Q.js} +1 -1
  15. package/js/{chunk-APPCHQHK.js → chunk-BU3UOD2T.js} +4 -4
  16. package/js/{chunk-HMYAZUNZ.js → chunk-EXL6F456.js} +6 -4
  17. package/js/{chunk-6QZVXLF2.js → chunk-INQON4A2.js} +2 -2
  18. package/js/{chunk-MB6L5YZE.js → chunk-IWLFLMIL.js} +1 -1
  19. package/js/{chunk-EKXBHVMR.js → chunk-JLHRRTRH.js} +8 -15
  20. package/js/{chunk-YFSOSNF3.js → chunk-NXEGROI6.js} +116 -116
  21. package/js/{chunk-ICIVU5SQ.js → chunk-OFSXKKD6.js} +27 -42
  22. package/js/{chunk-63DHI5Y4.js → chunk-QDF7PQAD.js} +6 -8
  23. package/js/{chunk-YVN2AMAU.js → chunk-QLUWYCOT.js} +2 -2
  24. package/js/{chunk-JH3MOQZR.js → chunk-T4MICYGT.js} +10 -51
  25. package/js/{chunk-OBT33ZDK.js → chunk-TMYRAFMC.js} +3 -3
  26. package/js/{chunk-2XDCAXAR.js → chunk-W6V5OIHB.js} +1 -1
  27. package/js/{chunk-34RH47V5.js → chunk-XR7KZNKD.js} +2 -2
  28. package/js/client.js +10 -15
  29. package/js/contracts.js +9 -7
  30. package/js/effect.js +18 -18
  31. package/js/graphql.js +20 -22
  32. package/js/host.js +18 -20
  33. package/js/index.js +14 -19
  34. package/js/mcp/effect.js +19 -19
  35. package/js/mcp.js +21 -21
  36. package/js/openapi.js +18 -25
  37. package/js/react.js +2 -2
  38. package/js/skills/effect.js +6 -6
  39. package/js/skills.js +21 -27
  40. package/js/ui/auth/contracts.js +2 -2
  41. package/js/ui/auth.js +5 -5
  42. package/js/ui/contracts.js +5 -5
  43. package/js/ui/serving.js +10 -10
  44. package/package.json +1 -1
  45. package/runtime.json +1 -1
  46. package/types/app-cache/src/index.d.ts +1 -40
  47. package/types/app-data/src/contracts/database.d.ts +0 -21
  48. package/types/apps/src/contracts/host.d.ts +6 -0
  49. package/types/telemetry/src/app-records.d.ts +0 -24
  50. package/types/telemetry/src/browser-operations.d.ts +0 -8
  51. package/types/telemetry/src/browser-performance.d.ts +0 -2
  52. package/types/telemetry/src/browser-request-timing.d.ts +0 -1
  53. package/types/telemetry/src/browser.d.ts +0 -10
  54. package/types/telemetry/src/config.d.ts +0 -8
  55. package/types/telemetry/src/context.d.ts +0 -6
  56. package/types/telemetry/src/index.d.ts +0 -1
  57. package/types/telemetry/src/keepalive.d.ts +0 -44
  58. package/types/telemetry/src/layer.d.ts +0 -8
  59. package/types/telemetry/src/measurements.d.ts +0 -8
  60. package/types/telemetry/src/ownership.d.ts +0 -45
  61. package/types/telemetry/src/pending-span.d.ts +0 -2
  62. package/types/telemetry/src/recorded-failure.d.ts +0 -26
  63. package/types/telemetry/src/relay.d.ts +0 -29
  64. package/types/telemetry/src/span-attributes.d.ts +0 -38
  65. package/types/telemetry/src/trace-context.d.ts +0 -6
  66. package/types/telemetry/src/transport.d.ts +0 -10
  67. package/types/utils/src/api-error.d.ts +0 -22
  68. package/types/utils/src/connection-failure.d.ts +0 -10
  69. package/types/utils/src/random-uuid.d.ts +0 -5
  70. package/types/utils/src/recorded-message.d.ts +0 -15
  71. package/types/utils/src/schema-definitions.d.ts +0 -6
  72. package/types/utils/src/user-facing-error.d.ts +0 -19
@@ -5,7 +5,7 @@ import {
5
5
  fromWeb,
6
6
  layerMergedContext,
7
7
  make2 as make
8
- } from "./chunk-MB6L5YZE.js";
8
+ } from "./chunk-IWLFLMIL.js";
9
9
  import {
10
10
  Reference,
11
11
  Service,
@@ -28,7 +28,7 @@ import {
28
28
  sync2 as sync,
29
29
  toReadableStreamEffect,
30
30
  tryPromise
31
- } from "./chunk-YFSOSNF3.js";
31
+ } from "./chunk-NXEGROI6.js";
32
32
  import {
33
33
  __export
34
34
  } from "./chunk-CZ7CSFO4.js";
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  accountProviderError,
3
3
  fromPromise
4
- } from "./chunk-APPCHQHK.js";
4
+ } from "./chunk-BU3UOD2T.js";
5
5
  import {
6
6
  HostedTool,
7
7
  HostedToolSummary,
8
8
  RouterKey,
9
9
  RouterMeta,
10
10
  reservedRouterKeys
11
- } from "./chunk-HMYAZUNZ.js";
11
+ } from "./chunk-EXL6F456.js";
12
12
  import {
13
13
  combineJsonSchemas,
14
14
  decoderOf,
@@ -18,15 +18,15 @@ import {
18
18
  schemaIdentity,
19
19
  schemaMemo,
20
20
  withLazyJsonSchemaDocument
21
- } from "./chunk-EKXBHVMR.js";
21
+ } from "./chunk-JLHRRTRH.js";
22
22
  import {
23
23
  JsonObject
24
- } from "./chunk-H2K7OZ47.js";
24
+ } from "./chunk-7A4ZSEM3.js";
25
25
  import {
26
26
  Effect_exports,
27
27
  Result_exports,
28
28
  Schema_exports
29
- } from "./chunk-YFSOSNF3.js";
29
+ } from "./chunk-NXEGROI6.js";
30
30
 
31
31
  // src/implementation/operations.ts
32
32
  var NativeOperation = /* @__PURE__ */ Symbol("apps.Operation");
@@ -59,21 +59,15 @@ var approvedOperation = (operation, approval) => {
59
59
  value: (context) => fromPromise(async () => approval(context), "approval")()
60
60
  });
61
61
  };
62
- var withApproval = (operation, approval) => (
63
- // SAFETY: `Approved` is a type-only mark; the native operation now carries the approval.
64
- {
65
- ...operation,
66
- [NativeOperation]: approvedOperation(operation[NativeOperation], approval)
67
- }
68
- );
62
+ var withApproval = (operation, approval) => ({
63
+ ...operation,
64
+ [NativeOperation]: approvedOperation(operation[NativeOperation], approval)
65
+ });
69
66
  var toolAnnotations = (operation) => nativeOperation(operation)?.annotations;
70
67
  var make = (kind, options, run) => operationDeclaration({
71
68
  ...operationOptions({ ...options, input: schemaArgument(options.input, `The ${kind} input`) }),
72
69
  kind,
73
- // The host always validates JSON serialization, even without a stronger output declaration.
74
70
  ...options.output === void 0 ? {} : { output: decoderOf(schemaArgument(options.output, `The ${kind} output`)) },
75
- // SAFETY: defineApp checks the handler context against its requirements.
76
- // The host validates account bindings and creates the matching storage facade.
77
71
  run: (context, input) => fromPromise(run, "handler")(context, input)
78
72
  });
79
73
  var query = (options, run) => make("query", options, run);
@@ -450,7 +444,6 @@ var combineDynamic = (sources) => {
450
444
  });
451
445
  return {
452
446
  kind: "dynamic",
453
- // Accounts share one source, so the first account that can describe it describes the router.
454
447
  ...first?.meta === void 0 ? {} : {
455
448
  meta: () => Effect_exports.gen(function* () {
456
449
  const failures = [];
@@ -464,7 +457,6 @@ var combineDynamic = (sources) => {
464
457
  })
465
458
  },
466
459
  ...first?.overrides === void 0 ? {} : { overrides: first.overrides },
467
- // One memo per listing: its tools share definition objects, which it reads once.
468
460
  list: () => Effect_exports.suspend(() => {
469
461
  const memo = schemaMemo();
470
462
  return grouped(
@@ -1,17 +1,18 @@
1
1
  import {
2
2
  prepareElicitation
3
- } from "./chunk-ICIVU5SQ.js";
3
+ } from "./chunk-OFSXKKD6.js";
4
4
  import {
5
5
  failOnNetworkRefusal
6
- } from "./chunk-Q7PE4PLU.js";
6
+ } from "./chunk-B4JN2A6F.js";
7
7
  import {
8
8
  accountProviderError,
9
9
  bodyUpstreamError,
10
10
  fromPromise,
11
11
  httpProviderError,
12
12
  providerErrorDetail
13
- } from "./chunk-APPCHQHK.js";
13
+ } from "./chunk-BU3UOD2T.js";
14
14
  import {
15
+ AfterReply,
15
16
  ElicitationFailed,
16
17
  McpCredentialsUnverified,
17
18
  McpError,
@@ -28,26 +29,26 @@ import {
28
29
  defaultMcpClientLimits,
29
30
  mcpHealthReserveMs,
30
31
  mcpSdkTimerCeilingMs
31
- } from "./chunk-HMYAZUNZ.js";
32
+ } from "./chunk-EXL6F456.js";
32
33
  import {
33
34
  jsonSchemaDecoder,
34
35
  nestJsonSchema,
35
36
  preparedJsonSchemaDecoder
36
- } from "./chunk-EKXBHVMR.js";
37
+ } from "./chunk-JLHRRTRH.js";
37
38
  import {
38
39
  captureTelemetry,
39
40
  owned
40
- } from "./chunk-JH3MOQZR.js";
41
+ } from "./chunk-T4MICYGT.js";
41
42
  import {
42
43
  FetchHttpClient_exports
43
- } from "./chunk-I6QAWNUM.js";
44
+ } from "./chunk-2OGVSUNI.js";
44
45
  import {
45
46
  JsonObject
46
- } from "./chunk-H2K7OZ47.js";
47
+ } from "./chunk-7A4ZSEM3.js";
47
48
  import {
48
49
  HttpClientRequest_exports,
49
50
  HttpClient_exports
50
- } from "./chunk-MB6L5YZE.js";
51
+ } from "./chunk-IWLFLMIL.js";
51
52
  import {
52
53
  Clock_exports,
53
54
  Deferred_exports,
@@ -61,7 +62,7 @@ import {
61
62
  Ref_exports,
62
63
  Schema_exports,
63
64
  Stream_exports
64
- } from "./chunk-YFSOSNF3.js";
65
+ } from "./chunk-NXEGROI6.js";
65
66
 
66
67
  // src/implementation/mcp.ts
67
68
  import { UnauthorizedError } from "@modelcontextprotocol/sdk/client/auth.js";
@@ -111,7 +112,6 @@ var resultSchema = (structuredContent) => {
111
112
  return { type: "object", properties: resultFields, required: ["content"] };
112
113
  const { schema, root } = placed(structuredContent, "#/anyOf/0/properties/structuredContent");
113
114
  return {
114
- // The envelope's keywords mean the same in every draft, so the server's draft applies.
115
115
  ...structuredContent.$schema === void 0 ? {} : { $schema: structuredContent.$schema },
116
116
  ...root,
117
117
  anyOf: [
@@ -291,7 +291,7 @@ var mcpCall = (client, name, input, context, timeoutMs, failure2) => Effect_expo
291
291
  });
292
292
  return yield* Effect_exports.tryPromise({
293
293
  try: (signal) => client.callTool({ name, arguments: input }, void 0, {
294
- signal: AbortSignal.any([signal, lifetime.signal]),
294
+ signal,
295
295
  timeout: mcpSdkTimerCeilingMs
296
296
  }),
297
297
  catch: (error) => failure2("call", error)
@@ -359,8 +359,6 @@ function mcpClient(withClient2, timeoutMs, failure2) {
359
359
  let cursor;
360
360
  do {
361
361
  const page = yield* Effect_exports.tryPromise({
362
- // This session only reads metadata. listTools() also eagerly compiles
363
- // every output validator; mcpRouter validates the selected tool on call.
364
362
  try: (signal) => client.request(
365
363
  { method: "tools/list", params: cursor === void 0 ? {} : { cursor } },
366
364
  ListToolsResultSchema,
@@ -491,7 +489,6 @@ var transportFetch = (connection, telemetry, rejected, answered, kind) => (url,
491
489
  if (!headers.has("user-agent")) headers.set("user-agent", "Executor");
492
490
  return HttpClientRequest_exports.fromWeb(new Request(target, { ...init, headers }));
493
491
  },
494
- // The provider's headers cannot form an HTTP request, such as a name with a space.
495
492
  catch: () => new McpError({ phase: "transport", reason: "invalid_input" })
496
493
  });
497
494
  const client = yield* HttpClient_exports.HttpClient;
@@ -570,6 +567,7 @@ function withClient(connection, mode, use, changed) {
570
567
  const rejected = yield* Deferred_exports.make();
571
568
  const answered = yield* Ref_exports.make(/* @__PURE__ */ new Map());
572
569
  const pending = /* @__PURE__ */ new Set();
570
+ const afterReply = yield* AfterReply;
573
571
  const { client, transport } = yield* Effect_exports.acquireRelease(
574
572
  Effect_exports.sync(() => {
575
573
  const fetch = transportFetch(connection, telemetry, rejected, answered, kind);
@@ -605,22 +603,29 @@ function withClient(connection, mode, use, changed) {
605
603
  }) : new SSEClientTransport(connection.url, { fetch })
606
604
  };
607
605
  }),
608
- ({ client: client2, transport: transport2 }) => Effect_exports.gen(function* () {
609
- client2.removeNotificationHandler("notifications/tools/list_changed");
610
- yield* Effect_exports.promise(async () => {
611
- await Promise.allSettled(pending);
606
+ ({ client: client2, transport: transport2 }, exit) => {
607
+ const settle = Effect_exports.gen(function* () {
608
+ client2.removeNotificationHandler("notifications/tools/list_changed");
609
+ yield* Effect_exports.promise(async () => {
610
+ await Promise.allSettled(pending);
611
+ });
612
612
  });
613
- if (transport2 instanceof StreamableHTTPClientTransport && transport2.sessionId !== void 0) {
614
- yield* Effect_exports.tryPromise(() => transport2.terminateSession()).pipe(
613
+ const end = Effect_exports.gen(function* () {
614
+ if (transport2 instanceof StreamableHTTPClientTransport && transport2.sessionId !== void 0) {
615
+ yield* Effect_exports.tryPromise(() => transport2.terminateSession()).pipe(
616
+ Effect_exports.timeout(defaultMcpClientLimits.cleanupTimeoutMs),
617
+ Effect_exports.ignore
618
+ );
619
+ }
620
+ yield* Effect_exports.tryPromise(() => client2.close()).pipe(
615
621
  Effect_exports.timeout(defaultMcpClientLimits.cleanupTimeoutMs),
616
622
  Effect_exports.ignore
617
623
  );
618
- }
619
- yield* Effect_exports.tryPromise(() => client2.close()).pipe(
620
- Effect_exports.timeout(defaultMcpClientLimits.cleanupTimeoutMs),
621
- Effect_exports.ignore
622
- );
623
- }).pipe(owned("upstream", "provider.mcp.close"))
624
+ });
625
+ return afterReply !== void 0 && mode === "call" && Exit_exports.isSuccess(exit) ? settle.pipe(
626
+ Effect_exports.andThen(afterReply(end.pipe(owned("background", "provider.mcp.close"))))
627
+ ) : settle.pipe(Effect_exports.andThen(end), owned("upstream", "provider.mcp.close"));
628
+ }
624
629
  );
625
630
  const wire = transport;
626
631
  yield* Effect_exports.tryPromise({
@@ -647,7 +652,6 @@ function withClient(connection, mode, use, changed) {
647
652
  })
648
653
  );
649
654
  return attempt("http").pipe(
650
- // Fallback is only for negotiation. Tool calls are never automatically replayed.
651
655
  Effect_exports.catch(
652
656
  (error) => Schema_exports.is(McpError)(error) && error.phase === "connect" && (error.status === 404 || error.status === 405) ? attempt("sse") : Effect_exports.fail(error)
653
657
  ),
@@ -708,7 +712,6 @@ var mcpHealthEffect = (check, options) => Effect_exports.gen(function* () {
708
712
  Effect_exports.flatMap((anonymous) => anonymous.check),
709
713
  Effect_exports.matchEffect({
710
714
  onSuccess: () => Effect_exports.fail(new McpCredentialsUnverified({ anonymous: "answered" })),
711
- // Executor's network refused the attempt, so the server never answered it.
712
715
  onFailure: (error) => Schema_exports.is(NetworkRefused)(error) ? Effect_exports.fail(error) : refusesCredentials(error) ? Effect_exports.void : Effect_exports.fail(new McpCredentialsUnverified({ anonymous: error }))
713
716
  }),
714
717
  owned("upstream", "provider.mcp.anonymous")
@@ -1,33 +1,33 @@
1
1
  import {
2
2
  appInvocationFetch
3
- } from "./chunk-Q7PE4PLU.js";
3
+ } from "./chunk-B4JN2A6F.js";
4
4
  import {
5
5
  fromPromise,
6
6
  method,
7
7
  toPromise
8
- } from "./chunk-APPCHQHK.js";
8
+ } from "./chunk-BU3UOD2T.js";
9
9
  import {
10
10
  CacheAcquired,
11
11
  CacheEntry,
12
12
  CacheError,
13
13
  cacheLimits,
14
14
  scopedSlots
15
- } from "./chunk-HMYAZUNZ.js";
15
+ } from "./chunk-EXL6F456.js";
16
16
  import {
17
17
  decoderOf
18
- } from "./chunk-EKXBHVMR.js";
18
+ } from "./chunk-JLHRRTRH.js";
19
19
  import {
20
20
  captureTelemetry,
21
21
  owned,
22
22
  ownedBy
23
- } from "./chunk-JH3MOQZR.js";
23
+ } from "./chunk-T4MICYGT.js";
24
24
  import {
25
25
  Clock_exports,
26
26
  Duration_exports,
27
27
  Effect_exports,
28
28
  Exit_exports,
29
29
  Schema_exports
30
- } from "./chunk-YFSOSNF3.js";
30
+ } from "./chunk-NXEGROI6.js";
31
31
 
32
32
  // ../app-cache/src/index.ts
33
33
  var canonical = (value) => {
@@ -68,13 +68,10 @@ var makeCache = (host, background, scope = "shared", deadline, leaseWait = (effe
68
68
  catch: () => new CacheError({ reason: "invalid" })
69
69
  }).pipe(
70
70
  Effect_exports.flatMap(
71
- ({ fresh, stale }) => ![fresh, stale].every((value) => Number.isFinite(value) && value >= 0) ? Effect_exports.fail(new CacheError({ reason: "invalid" })) : (
72
- // The cache keeps nothing past its retention: a longer lifetime loses staleness first.
73
- Effect_exports.succeed({
74
- fresh: Math.min(fresh, cacheLimits.retentionMs),
75
- stale: Math.max(0, Math.min(stale, cacheLimits.retentionMs - fresh))
76
- })
77
- )
71
+ ({ fresh, stale }) => ![fresh, stale].every((value) => Number.isFinite(value) && value >= 0) ? Effect_exports.fail(new CacheError({ reason: "invalid" })) : Effect_exports.succeed({
72
+ fresh: Math.min(fresh, cacheLimits.retentionMs),
73
+ stale: Math.max(0, Math.min(stale, cacheLimits.retentionMs - fresh))
74
+ })
78
75
  )
79
76
  );
80
77
  const get = (options, refresh, also = () => []) => Effect_exports.gen(function* () {
@@ -111,7 +108,6 @@ var makeCache = (host, background, scope = "shared", deadline, leaseWait = (effe
111
108
  }).pipe(
112
109
  Effect_exports.withSpan("app.cache.load"),
113
110
  Effect_exports.timeout(cacheLimits.loadTimeoutMs),
114
- // Publishing clears the lease in the same transaction. Only an unpublished load releases it.
115
111
  Effect_exports.onExit(
116
112
  (exit) => Exit_exports.isSuccess(exit) ? Effect_exports.void : transport({ operation: "release", key, lease }).pipe(
117
113
  Effect_exports.catch(() => Effect_exports.void)
@@ -183,9 +179,7 @@ var makeCache = (host, background, scope = "shared", deadline, leaseWait = (effe
183
179
  }
184
180
  }).pipe(Effect_exports.withSpan("app.cache.get"));
185
181
  return {
186
- /** Read arbitrary retained JSON entries without initiating a refresh. Missing and null are distinct. */
187
182
  read: (keys) => Effect_exports.forEach(keys, keyOf).pipe(Effect_exports.flatMap(readKeys)),
188
- /** Publish bounded immutable parts before publishing the manifest that references them. */
189
183
  write: (entries, retention) => Effect_exports.gen(function* () {
190
184
  const { fresh } = yield* durations(retention);
191
185
  const now = yield* Clock_exports.currentTimeMillis;
@@ -205,25 +199,12 @@ var makeCache = (host, background, scope = "shared", deadline, leaseWait = (effe
205
199
  );
206
200
  yield* transport({ operation: "write", entries: values });
207
201
  }),
208
- /** Revoke retained data and any loader's right to publish its in-flight result. */
209
202
  invalidate: (key) => keyOf(key).pipe(
210
203
  Effect_exports.flatMap((key2) => transport({ operation: "invalidate", key: key2 })),
211
204
  Effect_exports.asVoid
212
205
  ),
213
- /**
214
- * Read fresh data, refresh stale data in the background (or first, with `stale: "revalidate"`),
215
- * or wait for the lease owner.
216
- */
217
206
  get: (options) => get(options, false).pipe(Effect_exports.map(({ value }) => value)),
218
- /**
219
- * `get`, also reading the keys of this scope that `keys` names in the same round trip. `keys`
220
- * gets the entry's store key, which is unique to this scope and key, so a caller can remember
221
- * what it read under it. `reads` holds their entries, undecoded and in order, when the value
222
- * was read from the store; it is undefined when the value was loaded or the store did not read
223
- * them, and the caller then reads what it still needs.
224
- */
225
207
  getWith: (options, keys) => get(options, false, keys),
226
- /** Force one awaited refresh without removing the retained value. Concurrent refreshes share a load. */
227
208
  revalidate: (options) => get(options, true).pipe(Effect_exports.map(({ value }) => value))
228
209
  };
229
210
  };
@@ -238,11 +219,9 @@ var authorCache = (host, accounts, signal, telemetry, deadline) => {
238
219
  const scoped = (scope, callerSignal = signal, services = telemetry) => {
239
220
  const cache = makeCache(
240
221
  host.transport,
241
- // A refresh handed to the background runs beside the caller, which does not wait on it.
242
222
  (task) => host.background(task.pipe(owned("background", "app.cache.refresh"))),
243
223
  scope,
244
224
  deadline,
245
- // Waiting on another caller's load is waiting, not Executor's work.
246
225
  (wait) => wait.pipe(Effect_exports.withSpan("app.cache.lease.wait", ownedBy("lease")))
247
226
  );
248
227
  const getOptions = (options) => ({
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  skillFromFiles
3
- } from "./chunk-34RH47V5.js";
3
+ } from "./chunk-XR7KZNKD.js";
4
4
  import {
5
5
  PartialListing,
6
6
  joinPath,
7
7
  mergeMeta
8
- } from "./chunk-RIOLCZAV.js";
8
+ } from "./chunk-455CCO6Q.js";
9
9
  import {
10
10
  isShortenedStated,
11
11
  parseProviderError,
12
12
  providerError
13
- } from "./chunk-APPCHQHK.js";
13
+ } from "./chunk-BU3UOD2T.js";
14
14
  import {
15
15
  ApiErrorResponse,
16
16
  CacheError,
@@ -33,19 +33,19 @@ import {
33
33
  maxFailureFields,
34
34
  maxFailureMessageLength,
35
35
  maxUpstreamMessageLength
36
- } from "./chunk-HMYAZUNZ.js";
36
+ } from "./chunk-EXL6F456.js";
37
37
  import {
38
38
  SkillLoadFailed,
39
39
  skillFormatLimits
40
- } from "./chunk-QTX7OUFH.js";
40
+ } from "./chunk-A6FRLRCN.js";
41
41
  import {
42
42
  jsonSchemaDocument
43
- } from "./chunk-EKXBHVMR.js";
43
+ } from "./chunk-JLHRRTRH.js";
44
44
  import {
45
45
  AccountId,
46
46
  HttpUrl,
47
47
  JsonObject
48
- } from "./chunk-H2K7OZ47.js";
48
+ } from "./chunk-7A4ZSEM3.js";
49
49
  import {
50
50
  Cause_exports,
51
51
  Effect_exports,
@@ -55,7 +55,7 @@ import {
55
55
  Redacted_exports,
56
56
  Result_exports,
57
57
  Schema_exports
58
- } from "./chunk-YFSOSNF3.js";
58
+ } from "./chunk-NXEGROI6.js";
59
59
 
60
60
  // src/contracts/openapi.ts
61
61
  var OpenapiErrorResponse = Schema_exports.Struct({
@@ -460,7 +460,6 @@ var mcpMessage = ({ phase, reason, status }) => {
460
460
  () => `The MCP server returned a response Executor could not use while ${stage}, such as an unreadable message or an address on another origin.`
461
461
  ),
462
462
  Match_exports.when("invalid_input", () => "The MCP server URL or connection settings are invalid."),
463
- // Only a transport failure has no answer from the server; a JSON-RPC error is an answer.
464
463
  Match_exports.when(
465
464
  "request",
466
465
  () => status !== void 0 ? `The MCP server answered HTTP ${status} while ${stage}.` : phase === "transport" ? `Executor could not reach the MCP server while ${stage}.` : `The request to the MCP server failed while ${stage}.`
@@ -778,7 +777,6 @@ var summaryFields = (name, router, operation, schedules) => {
778
777
  description: operation.description ?? `${readOnly ? "Query" : "Mutate"} ${name}`,
779
778
  ...operation.title === void 0 ? {} : { title: operation.title },
780
779
  readOnly,
781
- // A declared operation's kind is the app's own, or its protocol's, such as an HTTP method.
782
780
  kindConfirmed: true,
783
781
  annotations: { ...operation.annotations, readOnlyHint: readOnly }
784
782
  };
@@ -949,12 +947,9 @@ var routerSkills = (root) => Effect_exports.gen(function* () {
949
947
  if (root !== void 0) collect(root, "");
950
948
  const skills = yield* Effect_exports.forEach(
951
949
  nodes,
952
- ({ path, node }) => (
953
- // Skills that fail are skipped, so their failures are never reported.
954
- routerMeta(node, []).pipe(
955
- Effect_exports.flatMap((meta) => routerSkill(path, meta)),
956
- Effect_exports.orElseSucceed(() => void 0)
957
- )
950
+ ({ path, node }) => routerMeta(node, []).pipe(
951
+ Effect_exports.flatMap((meta) => routerSkill(path, meta)),
952
+ Effect_exports.orElseSucceed(() => void 0)
958
953
  ),
959
954
  { concurrency: "unbounded" }
960
955
  );
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Predicate_exports
3
- } from "./chunk-YFSOSNF3.js";
3
+ } from "./chunk-NXEGROI6.js";
4
4
 
5
5
  // ../utils/src/recorded-message.ts
6
6
  var RecordedMessage = /* @__PURE__ */ Symbol.for("@executor-js/utils/RecordedMessage");
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  SchemaTransformation_exports,
3
3
  Schema_exports
4
- } from "./chunk-YFSOSNF3.js";
4
+ } from "./chunk-NXEGROI6.js";
5
5
 
6
6
  // src/contracts/schema.ts
7
7
  var JsonValue = Schema_exports.Json;
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  RecordedMessage
3
- } from "./chunk-LSOHA2RH.js";
3
+ } from "./chunk-6XBOKQ4E.js";
4
4
  import {
5
5
  SchemaGetter_exports,
6
6
  Schema_exports
7
- } from "./chunk-YFSOSNF3.js";
7
+ } from "./chunk-NXEGROI6.js";
8
8
 
9
9
  // ../utils/src/api-error.ts
10
10
  var MessageField = Schema_exports.String.pipe(
@@ -129,7 +129,6 @@ var SkillLoadFailed = class extends Schema_exports.TaggedError()("SkillLoadFaile
129
129
  "changed",
130
130
  "encoding"
131
131
  ]),
132
- // Error instances read an omitted message as "", so an empty message means none was given.
133
132
  message: Schema_exports.optional(Schema_exports.String.check(Schema_exports.isMaxLength(500))),
134
133
  status: Schema_exports.optional(Schema_exports.Int.check(Schema_exports.isBetween({ minimum: 100, maximum: 599 }))),
135
134
  missing: Schema_exports.optional(Schema_exports.Literals(["repository", "ref"]))
@@ -1,20 +1,20 @@
1
1
  import {
2
2
  getWithReads
3
- } from "./chunk-PQKQIH3T.js";
3
+ } from "./chunk-6NRWFVK2.js";
4
4
  import {
5
5
  fromPromise,
6
6
  method,
7
7
  toPromise
8
- } from "./chunk-APPCHQHK.js";
8
+ } from "./chunk-BU3UOD2T.js";
9
9
  import {
10
10
  CacheError
11
- } from "./chunk-HMYAZUNZ.js";
11
+ } from "./chunk-EXL6F456.js";
12
12
  import {
13
13
  wrap
14
- } from "./chunk-EKXBHVMR.js";
14
+ } from "./chunk-JLHRRTRH.js";
15
15
  import {
16
16
  JsonObject
17
- } from "./chunk-H2K7OZ47.js";
17
+ } from "./chunk-7A4ZSEM3.js";
18
18
  import {
19
19
  Deferred_exports,
20
20
  Duration_exports,
@@ -22,7 +22,7 @@ import {
22
22
  Exit_exports,
23
23
  Fiber_exports,
24
24
  Schema_exports
25
- } from "./chunk-YFSOSNF3.js";
25
+ } from "./chunk-NXEGROI6.js";
26
26
 
27
27
  // src/implementation/catalog-cache.ts
28
28
  var catalogScope = (options, credential, invalid) => {
@@ -190,7 +190,6 @@ var catalogCache = (options) => Effect_exports.gen(function* () {
190
190
  freshFor,
191
191
  staleFor,
192
192
  ...options.stale === void 0 ? {} : { stale: options.stale },
193
- // A cache may call the loader as a Promise; its own signal cancels that load.
194
193
  load: toPromise(refresh, (context) => context.signal)
195
194
  };
196
195
  let reading;
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  fixedRouter
3
- } from "./chunk-WZ36P57R.js";
3
+ } from "./chunk-6OWHQINS.js";
4
4
  import {
5
5
  nativeOperation,
6
6
  operationDeclaration,
7
7
  routerDeclaration
8
- } from "./chunk-RIOLCZAV.js";
8
+ } from "./chunk-455CCO6Q.js";
9
9
 
10
10
  // src/implementation/protocol-operations.ts
11
11
  var protocolOperations = (operations, kinds = {}) => {
@@ -5,14 +5,14 @@ import {
5
5
  networkRefusalHeader,
6
6
  networkRefusalStatus,
7
7
  supportedFetchOptions
8
- } from "./chunk-HMYAZUNZ.js";
8
+ } from "./chunk-EXL6F456.js";
9
9
  import {
10
10
  invocationFetch
11
- } from "./chunk-JH3MOQZR.js";
11
+ } from "./chunk-T4MICYGT.js";
12
12
  import {
13
13
  Effect_exports,
14
14
  Schema_exports
15
- } from "./chunk-YFSOSNF3.js";
15
+ } from "./chunk-NXEGROI6.js";
16
16
 
17
17
  // src/implementation/network.ts
18
18
  var refusalHeader = (status, header) => status === networkRefusalStatus && header !== null && header !== void 0 ? header : void 0;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Schema_exports
3
- } from "./chunk-YFSOSNF3.js";
3
+ } from "./chunk-NXEGROI6.js";
4
4
 
5
5
  // src/contracts/ui-auth.ts
6
6
  var AppSignInId = Schema_exports.String.check(Schema_exports.isPattern(/^[a-f0-9]{64}$/u)).pipe(
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  ProviderError,
3
3
  maxUpstreamMessageLength
4
- } from "./chunk-HMYAZUNZ.js";
4
+ } from "./chunk-EXL6F456.js";
5
5
  import {
6
6
  owned
7
- } from "./chunk-JH3MOQZR.js";
7
+ } from "./chunk-T4MICYGT.js";
8
8
  import {
9
9
  AccountId
10
- } from "./chunk-H2K7OZ47.js";
10
+ } from "./chunk-7A4ZSEM3.js";
11
11
  import {
12
12
  Effect_exports,
13
13
  Option_exports,
14
14
  Schema_exports
15
- } from "./chunk-YFSOSNF3.js";
15
+ } from "./chunk-NXEGROI6.js";
16
16
 
17
17
  // src/implementation/authoring.ts
18
18
  var NativeCallback = /* @__PURE__ */ Symbol("apps.NativeCallback");
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  AppSkillName,
3
3
  AppSkills
4
- } from "./chunk-QTX7OUFH.js";
4
+ } from "./chunk-A6FRLRCN.js";
5
5
  import {
6
6
  RecordedMessage
7
- } from "./chunk-LSOHA2RH.js";
7
+ } from "./chunk-6XBOKQ4E.js";
8
8
  import {
9
9
  AccountId,
10
10
  HttpUrl,
11
11
  JsonObject,
12
12
  JsonValue,
13
13
  withLegacyKeys
14
- } from "./chunk-H2K7OZ47.js";
14
+ } from "./chunk-7A4ZSEM3.js";
15
15
  import {
16
16
  Any,
17
17
  ArraySchema,
@@ -65,7 +65,7 @@ import {
65
65
  transformOptional,
66
66
  withConstructorDefault,
67
67
  withDefault
68
- } from "./chunk-YFSOSNF3.js";
68
+ } from "./chunk-NXEGROI6.js";
69
69
 
70
70
  // src/contracts/failure.ts
71
71
  var maxFailureMessageLength = 2048;
@@ -5185,6 +5185,7 @@ var ToolResultObservation = Context_exports.Reference(
5185
5185
  { defaultValue: () => ({ failed: () => {
5186
5186
  } }) }
5187
5187
  );
5188
+ var AfterReply = Context_exports.Reference("apps/AfterReply", { defaultValue: () => void 0 });
5188
5189
  var InvocationTiming = Schema_exports.Struct({
5189
5190
  elapsedMs: Schema_exports.Finite,
5190
5191
  upstreamMs: Schema_exports.Finite,
@@ -5424,6 +5425,7 @@ export {
5424
5425
  HostAccountCheckError,
5425
5426
  HostDataError,
5426
5427
  ToolResultObservation,
5428
+ AfterReply,
5427
5429
  InvocationTiming,
5428
5430
  InvocationTimingSink
5429
5431
  };
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  appSignInCallbackPath
3
- } from "./chunk-VX36SA7Y.js";
3
+ } from "./chunk-BHSWVS3Q.js";
4
4
  import {
5
5
  HttpServerResponse_exports
6
- } from "./chunk-MB6L5YZE.js";
6
+ } from "./chunk-IWLFLMIL.js";
7
7
 
8
8
  // src/implementation/ui-auth.ts
9
9
  var appPrivateHeaders = {