apps 0.0.1-beta.143 → 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 (57) hide show
  1. package/check-publish.mjs +0 -1
  2. package/framework-reference.json +1 -1
  3. package/js/{chunk-B54D6AN7.js → chunk-455CCO6Q.js} +7 -15
  4. package/js/{chunk-RW5EXIO6.js → chunk-5MEOL2SG.js} +6 -15
  5. package/js/{chunk-PASOVDON.js → chunk-6NRWFVK2.js} +9 -30
  6. package/js/{chunk-NXUNFV44.js → chunk-6OWHQINS.js} +9 -14
  7. package/js/{chunk-2XEQYDQY.js → chunk-A6FRLRCN.js} +0 -1
  8. package/js/{chunk-Y3QPWYHC.js → chunk-AFEMXP3F.js} +4 -5
  9. package/js/{chunk-XRNSAU62.js → chunk-B2PSDMZP.js} +2 -2
  10. package/js/{chunk-K24M6LZ7.js → chunk-B4JN2A6F.js} +2 -2
  11. package/js/{chunk-RUSVGD5N.js → chunk-BU3UOD2T.js} +2 -2
  12. package/js/{chunk-LRXY54YF.js → chunk-EXL6F456.js} +1 -1
  13. package/js/{chunk-ADG72XX3.js → chunk-JLHRRTRH.js} +6 -13
  14. package/js/{chunk-3RIEA22Q.js → chunk-OFSXKKD6.js} +24 -43
  15. package/js/{chunk-V6OUBNL4.js → chunk-QDF7PQAD.js} +4 -6
  16. package/js/{chunk-H4JK7UTH.js → chunk-T4MICYGT.js} +6 -47
  17. package/js/{chunk-XAOJP46A.js → chunk-XR7KZNKD.js} +1 -1
  18. package/js/client.js +2 -7
  19. package/js/contracts.js +2 -2
  20. package/js/effect.js +12 -12
  21. package/js/graphql.js +14 -16
  22. package/js/host.js +12 -14
  23. package/js/index.js +8 -13
  24. package/js/mcp/effect.js +13 -13
  25. package/js/mcp.js +15 -15
  26. package/js/openapi.js +12 -19
  27. package/js/skills/effect.js +2 -2
  28. package/js/skills.js +15 -21
  29. package/js/ui/serving.js +1 -1
  30. package/package.json +1 -1
  31. package/runtime.json +1 -1
  32. package/types/app-cache/src/index.d.ts +1 -40
  33. package/types/app-data/src/contracts/database.d.ts +0 -21
  34. package/types/telemetry/src/app-records.d.ts +0 -24
  35. package/types/telemetry/src/browser-operations.d.ts +0 -8
  36. package/types/telemetry/src/browser-performance.d.ts +0 -2
  37. package/types/telemetry/src/browser-request-timing.d.ts +0 -1
  38. package/types/telemetry/src/browser.d.ts +0 -10
  39. package/types/telemetry/src/config.d.ts +0 -8
  40. package/types/telemetry/src/context.d.ts +0 -6
  41. package/types/telemetry/src/index.d.ts +0 -1
  42. package/types/telemetry/src/keepalive.d.ts +0 -44
  43. package/types/telemetry/src/layer.d.ts +0 -8
  44. package/types/telemetry/src/measurements.d.ts +0 -8
  45. package/types/telemetry/src/ownership.d.ts +0 -45
  46. package/types/telemetry/src/pending-span.d.ts +0 -2
  47. package/types/telemetry/src/recorded-failure.d.ts +0 -26
  48. package/types/telemetry/src/relay.d.ts +0 -29
  49. package/types/telemetry/src/span-attributes.d.ts +0 -38
  50. package/types/telemetry/src/trace-context.d.ts +0 -6
  51. package/types/telemetry/src/transport.d.ts +0 -10
  52. package/types/utils/src/api-error.d.ts +0 -22
  53. package/types/utils/src/connection-failure.d.ts +0 -10
  54. package/types/utils/src/random-uuid.d.ts +0 -5
  55. package/types/utils/src/recorded-message.d.ts +0 -15
  56. package/types/utils/src/schema-definitions.d.ts +0 -6
  57. package/types/utils/src/user-facing-error.d.ts +0 -19
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  accountProviderError,
3
3
  fromPromise
4
- } from "./chunk-RUSVGD5N.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-LRXY54YF.js";
11
+ } from "./chunk-EXL6F456.js";
12
12
  import {
13
13
  combineJsonSchemas,
14
14
  decoderOf,
@@ -18,7 +18,7 @@ import {
18
18
  schemaIdentity,
19
19
  schemaMemo,
20
20
  withLazyJsonSchemaDocument
21
- } from "./chunk-ADG72XX3.js";
21
+ } from "./chunk-JLHRRTRH.js";
22
22
  import {
23
23
  JsonObject
24
24
  } from "./chunk-7A4ZSEM3.js";
@@ -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,16 +1,16 @@
1
1
  import {
2
2
  prepareElicitation
3
- } from "./chunk-3RIEA22Q.js";
3
+ } from "./chunk-OFSXKKD6.js";
4
4
  import {
5
5
  failOnNetworkRefusal
6
- } from "./chunk-K24M6LZ7.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-RUSVGD5N.js";
13
+ } from "./chunk-BU3UOD2T.js";
14
14
  import {
15
15
  AfterReply,
16
16
  ElicitationFailed,
@@ -29,16 +29,16 @@ import {
29
29
  defaultMcpClientLimits,
30
30
  mcpHealthReserveMs,
31
31
  mcpSdkTimerCeilingMs
32
- } from "./chunk-LRXY54YF.js";
32
+ } from "./chunk-EXL6F456.js";
33
33
  import {
34
34
  jsonSchemaDecoder,
35
35
  nestJsonSchema,
36
36
  preparedJsonSchemaDecoder
37
- } from "./chunk-ADG72XX3.js";
37
+ } from "./chunk-JLHRRTRH.js";
38
38
  import {
39
39
  captureTelemetry,
40
40
  owned
41
- } from "./chunk-H4JK7UTH.js";
41
+ } from "./chunk-T4MICYGT.js";
42
42
  import {
43
43
  FetchHttpClient_exports
44
44
  } from "./chunk-2OGVSUNI.js";
@@ -112,7 +112,6 @@ var resultSchema = (structuredContent) => {
112
112
  return { type: "object", properties: resultFields, required: ["content"] };
113
113
  const { schema, root } = placed(structuredContent, "#/anyOf/0/properties/structuredContent");
114
114
  return {
115
- // The envelope's keywords mean the same in every draft, so the server's draft applies.
116
115
  ...structuredContent.$schema === void 0 ? {} : { $schema: structuredContent.$schema },
117
116
  ...root,
118
117
  anyOf: [
@@ -292,9 +291,6 @@ var mcpCall = (client, name, input, context, timeoutMs, failure2) => Effect_expo
292
291
  });
293
292
  return yield* Effect_exports.tryPromise({
294
293
  try: (signal) => client.callTool({ name, arguments: input }, void 0, {
295
- // Only this request's own signal, which Effect aborts when the call is interrupted, as
296
- // a failed prompt or an expired budget does. The SDK never removes its abort listener,
297
- // so `lifetime`, aborted at release, would cancel a call the server already answered.
298
294
  signal,
299
295
  timeout: mcpSdkTimerCeilingMs
300
296
  }),
@@ -363,8 +359,6 @@ function mcpClient(withClient2, timeoutMs, failure2) {
363
359
  let cursor;
364
360
  do {
365
361
  const page = yield* Effect_exports.tryPromise({
366
- // This session only reads metadata. listTools() also eagerly compiles
367
- // every output validator; mcpRouter validates the selected tool on call.
368
362
  try: (signal) => client.request(
369
363
  { method: "tools/list", params: cursor === void 0 ? {} : { cursor } },
370
364
  ListToolsResultSchema,
@@ -495,7 +489,6 @@ var transportFetch = (connection, telemetry, rejected, answered, kind) => (url,
495
489
  if (!headers.has("user-agent")) headers.set("user-agent", "Executor");
496
490
  return HttpClientRequest_exports.fromWeb(new Request(target, { ...init, headers }));
497
491
  },
498
- // The provider's headers cannot form an HTTP request, such as a name with a space.
499
492
  catch: () => new McpError({ phase: "transport", reason: "invalid_input" })
500
493
  });
501
494
  const client = yield* HttpClient_exports.HttpClient;
@@ -659,7 +652,6 @@ function withClient(connection, mode, use, changed) {
659
652
  })
660
653
  );
661
654
  return attempt("http").pipe(
662
- // Fallback is only for negotiation. Tool calls are never automatically replayed.
663
655
  Effect_exports.catch(
664
656
  (error) => Schema_exports.is(McpError)(error) && error.phase === "connect" && (error.status === 404 || error.status === 405) ? attempt("sse") : Effect_exports.fail(error)
665
657
  ),
@@ -720,7 +712,6 @@ var mcpHealthEffect = (check, options) => Effect_exports.gen(function* () {
720
712
  Effect_exports.flatMap((anonymous) => anonymous.check),
721
713
  Effect_exports.matchEffect({
722
714
  onSuccess: () => Effect_exports.fail(new McpCredentialsUnverified({ anonymous: "answered" })),
723
- // Executor's network refused the attempt, so the server never answered it.
724
715
  onFailure: (error) => Schema_exports.is(NetworkRefused)(error) ? Effect_exports.fail(error) : refusesCredentials(error) ? Effect_exports.void : Effect_exports.fail(new McpCredentialsUnverified({ anonymous: error }))
725
716
  }),
726
717
  owned("upstream", "provider.mcp.anonymous")
@@ -1,26 +1,26 @@
1
1
  import {
2
2
  appInvocationFetch
3
- } from "./chunk-K24M6LZ7.js";
3
+ } from "./chunk-B4JN2A6F.js";
4
4
  import {
5
5
  fromPromise,
6
6
  method,
7
7
  toPromise
8
- } from "./chunk-RUSVGD5N.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-LRXY54YF.js";
15
+ } from "./chunk-EXL6F456.js";
16
16
  import {
17
17
  decoderOf
18
- } from "./chunk-ADG72XX3.js";
18
+ } from "./chunk-JLHRRTRH.js";
19
19
  import {
20
20
  captureTelemetry,
21
21
  owned,
22
22
  ownedBy
23
- } from "./chunk-H4JK7UTH.js";
23
+ } from "./chunk-T4MICYGT.js";
24
24
  import {
25
25
  Clock_exports,
26
26
  Duration_exports,
@@ -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-XAOJP46A.js";
3
+ } from "./chunk-XR7KZNKD.js";
4
4
  import {
5
5
  PartialListing,
6
6
  joinPath,
7
7
  mergeMeta
8
- } from "./chunk-B54D6AN7.js";
8
+ } from "./chunk-455CCO6Q.js";
9
9
  import {
10
10
  isShortenedStated,
11
11
  parseProviderError,
12
12
  providerError
13
- } from "./chunk-RUSVGD5N.js";
13
+ } from "./chunk-BU3UOD2T.js";
14
14
  import {
15
15
  ApiErrorResponse,
16
16
  CacheError,
@@ -33,14 +33,14 @@ import {
33
33
  maxFailureFields,
34
34
  maxFailureMessageLength,
35
35
  maxUpstreamMessageLength
36
- } from "./chunk-LRXY54YF.js";
36
+ } from "./chunk-EXL6F456.js";
37
37
  import {
38
38
  SkillLoadFailed,
39
39
  skillFormatLimits
40
- } from "./chunk-2XEQYDQY.js";
40
+ } from "./chunk-A6FRLRCN.js";
41
41
  import {
42
42
  jsonSchemaDocument
43
- } from "./chunk-ADG72XX3.js";
43
+ } from "./chunk-JLHRRTRH.js";
44
44
  import {
45
45
  AccountId,
46
46
  HttpUrl,
@@ -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
  );
@@ -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,17 +1,17 @@
1
1
  import {
2
2
  getWithReads
3
- } from "./chunk-PASOVDON.js";
3
+ } from "./chunk-6NRWFVK2.js";
4
4
  import {
5
5
  fromPromise,
6
6
  method,
7
7
  toPromise
8
- } from "./chunk-RUSVGD5N.js";
8
+ } from "./chunk-BU3UOD2T.js";
9
9
  import {
10
10
  CacheError
11
- } from "./chunk-LRXY54YF.js";
11
+ } from "./chunk-EXL6F456.js";
12
12
  import {
13
13
  wrap
14
- } from "./chunk-ADG72XX3.js";
14
+ } from "./chunk-JLHRRTRH.js";
15
15
  import {
16
16
  JsonObject
17
17
  } from "./chunk-7A4ZSEM3.js";
@@ -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-NXUNFV44.js";
3
+ } from "./chunk-6OWHQINS.js";
4
4
  import {
5
5
  nativeOperation,
6
6
  operationDeclaration,
7
7
  routerDeclaration
8
- } from "./chunk-B54D6AN7.js";
8
+ } from "./chunk-455CCO6Q.js";
9
9
 
10
10
  // src/implementation/protocol-operations.ts
11
11
  var protocolOperations = (operations, kinds = {}) => {
@@ -5,10 +5,10 @@ import {
5
5
  networkRefusalHeader,
6
6
  networkRefusalStatus,
7
7
  supportedFetchOptions
8
- } from "./chunk-LRXY54YF.js";
8
+ } from "./chunk-EXL6F456.js";
9
9
  import {
10
10
  invocationFetch
11
- } from "./chunk-H4JK7UTH.js";
11
+ } from "./chunk-T4MICYGT.js";
12
12
  import {
13
13
  Effect_exports,
14
14
  Schema_exports
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  ProviderError,
3
3
  maxUpstreamMessageLength
4
- } from "./chunk-LRXY54YF.js";
4
+ } from "./chunk-EXL6F456.js";
5
5
  import {
6
6
  owned
7
- } from "./chunk-H4JK7UTH.js";
7
+ } from "./chunk-T4MICYGT.js";
8
8
  import {
9
9
  AccountId
10
10
  } from "./chunk-7A4ZSEM3.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  AppSkillName,
3
3
  AppSkills
4
- } from "./chunk-2XEQYDQY.js";
4
+ } from "./chunk-A6FRLRCN.js";
5
5
  import {
6
6
  RecordedMessage
7
7
  } from "./chunk-6XBOKQ4E.js";
@@ -1186,7 +1186,6 @@ function object(fields) {
1186
1186
  ]
1187
1187
  );
1188
1188
  const decoder = entries.length === 0 ? withJsonSchemaDocument(
1189
- // Native Struct({}) accepts every non-null value and retains undeclared fields.
1190
1189
  Schema_exports.Record(Schema_exports.String, Schema_exports.Unknown).pipe(
1191
1190
  Schema_exports.decodeTo(Schema_exports.Record(Schema_exports.String, Schema_exports.Never), {
1192
1191
  decode: SchemaGetter_exports.transform(() => ({})),
@@ -1199,15 +1198,12 @@ function object(fields) {
1199
1198
  }
1200
1199
  var Exposure = /* @__PURE__ */ Symbol("apps.FieldExposure");
1201
1200
  var exposureOf = (schema) => Exposure in schema && (schema[Exposure] === "plain" || schema[Exposure] === "raw") ? schema[Exposure] : void 0;
1202
- var expose = (schema, exposure) => (
1203
- // SAFETY: the copy keeps every member of S, and `optional` and `default` keep the marking.
1204
- {
1205
- ...schema,
1206
- [Exposure]: exposure,
1207
- optional: () => expose(schema.optional(), exposure),
1208
- default: (value) => expose(schema.default(value), exposure)
1209
- }
1210
- );
1201
+ var expose = (schema, exposure) => ({
1202
+ ...schema,
1203
+ [Exposure]: exposure,
1204
+ optional: () => expose(schema.optional(), exposure),
1205
+ default: (value) => expose(schema.default(value), exposure)
1206
+ });
1211
1207
  var plain = (schema) => expose(schema, "plain");
1212
1208
  var raw = (schema) => expose(schema, "raw");
1213
1209
  var fieldExposure = (fields) => Object.fromEntries(
@@ -1635,8 +1631,6 @@ var constraintProblem = (keyword, node) => {
1635
1631
  if (keyword === "uniqueItems") return "Expected an array without repeated items";
1636
1632
  if (typeof value !== "number") return void 0;
1637
1633
  switch (keyword) {
1638
- // Draft 4's boolean `exclusiveMinimum` is not applied: imported schemas validate as draft 7
1639
- // or 2020-12, where `minimum` and `maximum` always include their bound.
1640
1634
  case "minimum":
1641
1635
  return `Expected a number of at least ${value}`;
1642
1636
  case "maximum":
@@ -1952,7 +1946,6 @@ var lazyCompiledDecoder = (document) => {
1952
1946
  let compiled;
1953
1947
  const compile = Effect_exports.suspend(
1954
1948
  () => compiled ?? compileJsonSchemaDecoder(read()).pipe(
1955
- // An interrupted compilation is not a result; the next decode compiles again.
1956
1949
  Effect_exports.onExit(
1957
1950
  (exit) => Effect_exports.sync(() => {
1958
1951
  if (Exit_exports.isSuccess(exit) || !Cause_exports.hasInterrupts(exit.cause)) compiled = exit;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  authorCache,
3
3
  unavailableCache
4
- } from "./chunk-PASOVDON.js";
4
+ } from "./chunk-6NRWFVK2.js";
5
5
  import {
6
6
  accountSecrets,
7
7
  boundFailureMessage,
@@ -12,13 +12,13 @@ import {
12
12
  parseSkillLoadFailed,
13
13
  readCatalog,
14
14
  routerSkills
15
- } from "./chunk-NXUNFV44.js";
15
+ } from "./chunk-6OWHQINS.js";
16
16
  import {
17
17
  appInvocationFetch
18
- } from "./chunk-K24M6LZ7.js";
18
+ } from "./chunk-B4JN2A6F.js";
19
19
  import {
20
20
  folderSkillsEffect
21
- } from "./chunk-XAOJP46A.js";
21
+ } from "./chunk-XR7KZNKD.js";
22
22
  import {
23
23
  ResponseStatusError,
24
24
  declaredEvents,
@@ -26,12 +26,12 @@ import {
26
26
  makeEmitter,
27
27
  toEffectApp,
28
28
  withPlacements
29
- } from "./chunk-V6OUBNL4.js";
29
+ } from "./chunk-QDF7PQAD.js";
30
30
  import {
31
31
  declaredOperations,
32
32
  locate,
33
33
  nativeOperation
34
- } from "./chunk-B54D6AN7.js";
34
+ } from "./chunk-455CCO6Q.js";
35
35
  import {
36
36
  accountProviderError,
37
37
  appCode,
@@ -39,7 +39,7 @@ import {
39
39
  httpProviderError,
40
40
  parseProviderError,
41
41
  toPromise
42
- } from "./chunk-RUSVGD5N.js";
42
+ } from "./chunk-BU3UOD2T.js";
43
43
  import {
44
44
  AccountCheckResult,
45
45
  AfterReply,
@@ -96,11 +96,11 @@ import {
96
96
  sqlBindingsLimit,
97
97
  withoutHelp,
98
98
  workflowDurationMillis
99
- } from "./chunk-LRXY54YF.js";
99
+ } from "./chunk-EXL6F456.js";
100
100
  import {
101
101
  AppSkills,
102
102
  SkillFile
103
- } from "./chunk-2XEQYDQY.js";
103
+ } from "./chunk-A6FRLRCN.js";
104
104
  import {
105
105
  allowedValues,
106
106
  echoableKey,
@@ -113,13 +113,13 @@ import {
113
113
  missingKeyText,
114
114
  objectShape,
115
115
  unionShape
116
- } from "./chunk-ADG72XX3.js";
116
+ } from "./chunk-JLHRRTRH.js";
117
117
  import {
118
118
  captureTelemetry,
119
119
  makeOwnershipAccounting,
120
120
  measuredSpan,
121
121
  owned
122
- } from "./chunk-H4JK7UTH.js";
122
+ } from "./chunk-T4MICYGT.js";
123
123
  import {
124
124
  JsonObject,
125
125
  JsonValue
@@ -266,11 +266,7 @@ var makeWorkflowContext = (execution, definition, fresh, signal) => Effect_expor
266
266
  Effect_exports.timeout(timeout),
267
267
  Effect_exports.catchTag(
268
268
  "TimeoutError",
269
- () => (
270
- // Both the capability deadline and the native engine deadline describe
271
- // the same cancellation, regardless of which timer fires first.
272
- Effect_exports.fail(new WorkflowFailure({ reason: "engine", retryable: true }))
273
- )
269
+ () => Effect_exports.fail(new WorkflowFailure({ reason: "engine", retryable: true }))
274
270
  )
275
271
  );
276
272
  };
@@ -914,7 +910,6 @@ var authorSql = (storage, options) => {
914
910
  }
915
911
  };
916
912
  const writer = {
917
- // A step's writes go through its one transaction, which also records its receipt.
918
913
  exec: (query, ...bindings) => run(query, bindings, options.step ? "read" : "write"),
919
914
  transaction
920
915
  };
@@ -1093,7 +1088,6 @@ var migrate = (storage, files) => Effect_exports.gen(function* () {
1093
1088
  }));
1094
1089
  })
1095
1090
  ).pipe(
1096
- // Both are thrown inside the transaction so that it rolls back; they are expected failures.
1097
1091
  Effect_exports.catchDefect(
1098
1092
  (defect) => Schema_exports.is(MigrationFailed)(defect) || Schema_exports.is(MigrationHistoryChanged)(defect) ? Effect_exports.fail(defect) : Effect_exports.die(defect)
1099
1093
  ),
@@ -1178,7 +1172,6 @@ function providerDeclaration(provider) {
1178
1172
  return yield* Schema_exports.decodeUnknownEffect(DeclaredProvider)({
1179
1173
  name: provider.name,
1180
1174
  auth: Object.fromEntries(auth),
1181
- // Order and repetition carry no meaning, so neither changes the provider's identity.
1182
1175
  ...provider.hosts === void 0 ? {} : { hosts: [...new Set(provider.hosts)].sort() }
1183
1176
  });
1184
1177
  }),
@@ -1425,7 +1418,6 @@ function dispatch(app, request, context, signal, emitted) {
1425
1418
  let running;
1426
1419
  const delivery = (request2, signal2) => Effect_exports.suspend(
1427
1420
  () => running !== void 0 && context.elicitation !== void 0 ? context.elicitation(request2, signal2).pipe(
1428
- // Delivering the question and waiting for its answer is the person's time.
1429
1421
  owned("person", "app.tool.elicitation"),
1430
1422
  Effect_exports.provideContext(running.context)
1431
1423
  ) : Effect_exports.fail(new ElicitationFailed({ reason: "unavailable" }))
@@ -1602,7 +1594,6 @@ function dispatch(app, request, context, signal, emitted) {
1602
1594
  stepId,
1603
1595
  idempotencyKey: stepId
1604
1596
  },
1605
- // The resolved values, not the app's decoded fields, which may be `Redacted`.
1606
1597
  secrets: accountSecrets(current.accounts)
1607
1598
  };
1608
1599
  }),
@@ -1740,10 +1731,7 @@ function dispatch(app, request, context, signal, emitted) {
1740
1731
  ...kind === "mutate" ? { events: emitter() } : {}
1741
1732
  },
1742
1733
  input
1743
- ).pipe(
1744
- // The cache session's background runner, which the host drains after the reply.
1745
- Effect_exports.provideService(AfterReply, context.cache?.background)
1746
- );
1734
+ ).pipe(Effect_exports.provideService(AfterReply, context.cache?.background));
1747
1735
  }).pipe(
1748
1736
  Effect_exports.ensuring(
1749
1737
  Effect_exports.sync(() => {
@@ -1889,8 +1877,6 @@ var createAppHandler = (app) => (request, context) => Effect_exports.gen(functio
1889
1877
  toolError = true;
1890
1878
  }
1891
1879
  }),
1892
- // Name what failed on the span; the bounded message stays in the reply only. The host
1893
- // records an app's own error names and codes as `unrecognized` (telemetry `app-records`).
1894
1880
  Effect_exports.tapError(
1895
1881
  (error) => (error._tag === "HostEvaluationFailed" || error._tag === "HostOperationFailed" || error._tag === "HostDeclarationInvalid") && error.errorName !== void 0 ? Effect_exports.annotateCurrentSpan({
1896
1882
  "error.type": error.errorName,
@@ -1898,8 +1884,6 @@ var createAppHandler = (app) => (request, context) => Effect_exports.gen(functio
1898
1884
  ...error.code === void 0 ? {} : { "executor.failure.code": error.code }
1899
1885
  }) : Effect_exports.void
1900
1886
  ),
1901
- // Tool operations time themselves, dividing their time by who owned the work in progress.
1902
- // Other operations do not.
1903
1887
  command.operation === "call" || command.operation === "query" || command.operation === "mutate" ? timedInvocation(command.operation) : Effect_exports.withSpan(`app.${command.operation}`)
1904
1888
  );
1905
1889
  if (toolError)
@@ -1923,21 +1907,18 @@ var createAppHandler = (app) => (request, context) => Effect_exports.gen(functio
1923
1907
  )
1924
1908
  ),
1925
1909
  Effect_exports.catchCause(
1926
- (cause) => Cause_exports.hasInterrupts(cause) ? Effect_exports.interrupt : (
1927
- // The cause can carry any text the app threw; its caller receives that, not the log.
1928
- Effect_exports.logError("The app's request failed unexpectedly").pipe(
1929
- Effect_exports.andThen(
1930
- Schema_exports.encodeEffect(HostError)(
1931
- declarationInvalid(
1932
- "The app failed while it was loaded",
1933
- Cause_exports.squash(cause),
1934
- accountSecrets(context.accounts)
1935
- )
1910
+ (cause) => Cause_exports.hasInterrupts(cause) ? Effect_exports.interrupt : Effect_exports.logError("The app's request failed unexpectedly").pipe(
1911
+ Effect_exports.andThen(
1912
+ Schema_exports.encodeEffect(HostError)(
1913
+ declarationInvalid(
1914
+ "The app failed while it was loaded",
1915
+ Cause_exports.squash(cause),
1916
+ accountSecrets(context.accounts)
1936
1917
  )
1937
- ),
1938
- Effect_exports.map((error) => Response.json({ ok: false, error }, { status: 500 })),
1939
- Effect_exports.orDie
1940
- )
1918
+ )
1919
+ ),
1920
+ Effect_exports.map((error) => Response.json({ ok: false, error }, { status: 500 })),
1921
+ Effect_exports.orDie
1941
1922
  )
1942
1923
  )
1943
1924
  );