apps 0.0.1-beta.43 → 0.0.1-beta.46

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 (54) hide show
  1. package/framework-reference.json +1 -1
  2. package/js/{chunk-XSD3RZFX.js → chunk-3B2JAOSE.js} +23 -12
  3. package/js/{chunk-KTPKTBKZ.js → chunk-3UGDI2UI.js} +5 -5
  4. package/js/chunk-5FHWNLCI.js +88 -0
  5. package/js/{chunk-MSDGZ7FA.js → chunk-6QXPBJ5T.js} +14 -13
  6. package/js/{chunk-Z3S2IVI3.js → chunk-7LGRK7TP.js} +2 -2
  7. package/js/{chunk-T65AFHU3.js → chunk-7UUHJR2Q.js} +1 -1
  8. package/js/{chunk-4ZTVLEN6.js → chunk-CDXQDN7W.js} +1 -1
  9. package/js/{chunk-OBXHQNWC.js → chunk-CVAJ4F6O.js} +16 -3
  10. package/js/{chunk-KBIKBWSS.js → chunk-H72MEDMN.js} +4 -3
  11. package/js/{chunk-VU6GQ2SH.js → chunk-JM7LOD2W.js} +212 -22
  12. package/js/{chunk-EJUK2NK5.js → chunk-KLYSEHUD.js} +1 -1
  13. package/js/{chunk-ILYK7BQG.js → chunk-LHCGND3R.js} +12 -46
  14. package/js/{chunk-EMHFXFTJ.js → chunk-LTDHQJ2Z.js} +53 -0
  15. package/js/{chunk-47BLLMRQ.js → chunk-OJ47HQVJ.js} +143 -65
  16. package/js/{chunk-MZH4J2PO.js → chunk-PD6I2SDG.js} +1 -1
  17. package/js/{chunk-KSGYJV46.js → chunk-TUMGL2OC.js} +1 -1
  18. package/js/{chunk-5GLC42LK.js → chunk-UM62MBJQ.js} +42 -24
  19. package/js/{chunk-IN2WIN7I.js → chunk-XBG7HHXC.js} +1 -1
  20. package/js/{chunk-RIKH5H2X.js → chunk-XK5I2XOI.js} +39 -29
  21. package/js/client.js +9 -9
  22. package/js/contracts.js +9 -5
  23. package/js/effect.js +14 -14
  24. package/js/graphql.js +23 -21
  25. package/js/host.js +79 -54
  26. package/js/index.js +23 -18
  27. package/js/mcp/effect.js +16 -16
  28. package/js/mcp/stdio.js +30 -25
  29. package/js/mcp.js +23 -21
  30. package/js/openapi.js +106 -80
  31. package/js/skills/effect.js +5 -5
  32. package/js/skills.js +53 -36
  33. package/js/ui/auth.js +3 -3
  34. package/js/ui/contracts.js +3 -3
  35. package/js/ui/serving.js +7 -7
  36. package/package.json +1 -1
  37. package/runtime.json +1 -1
  38. package/types/apps/src/contracts/host.d.ts +15 -0
  39. package/types/apps/src/host.d.ts +5 -0
  40. package/types/apps/src/implementation/authoring.d.ts +25 -5
  41. package/types/apps/src/implementation/cache.d.ts +4 -0
  42. package/types/apps/src/implementation/elicitation.d.ts +6 -3
  43. package/types/apps/src/implementation/invocation-timing.d.ts +16 -0
  44. package/types/apps/src/implementation/operations.d.ts +2 -2
  45. package/types/apps/src/implementation/router-catalog.d.ts +4 -4
  46. package/types/apps/src/implementation/workflows.d.ts +1 -1
  47. package/types/telemetry/src/index.d.ts +1 -0
  48. package/types/telemetry/src/ownership.d.ts +56 -0
  49. package/types/telemetry/src/recorded-failure.d.ts +20 -11
  50. package/types/utils/src/api-error.d.ts +4 -2
  51. package/types/utils/src/recorded-message.d.ts +7 -4
  52. package/types/utils/src/user-facing-error.d.ts +4 -2
  53. package/js/chunk-EG72MSVK.js +0 -16
  54. package/js/{chunk-LNSVJS2Q.js → chunk-EOPQ727L.js} +2 -2
package/js/openapi.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  import {
9
9
  protocolOperations,
10
10
  protocolRouter
11
- } from "./chunk-Z3S2IVI3.js";
11
+ } from "./chunk-7LGRK7TP.js";
12
12
  import {
13
13
  OpenapiCompileError,
14
14
  OpenapiCompileErrorCode,
@@ -27,53 +27,56 @@ import {
27
27
  isOpenapiTextMedia,
28
28
  openapiBinaryResultSchema,
29
29
  openapiMediaKind
30
- } from "./chunk-KTPKTBKZ.js";
30
+ } from "./chunk-3UGDI2UI.js";
31
31
  import {
32
32
  failOnNetworkRefusal
33
- } from "./chunk-T65AFHU3.js";
34
- import "./chunk-IN2WIN7I.js";
33
+ } from "./chunk-7UUHJR2Q.js";
34
+ import "./chunk-XBG7HHXC.js";
35
35
  import {
36
- fromPromise,
37
36
  nativeOperation,
38
- routerDeclaration,
39
- toPromise
40
- } from "./chunk-ILYK7BQG.js";
37
+ routerDeclaration
38
+ } from "./chunk-LHCGND3R.js";
41
39
  import {
42
40
  accountProviderError,
43
- httpProviderError
44
- } from "./chunk-EMHFXFTJ.js";
41
+ fromPromise,
42
+ httpProviderError,
43
+ method,
44
+ toPromise
45
+ } from "./chunk-LTDHQJ2Z.js";
45
46
  import {
46
47
  ApiErrorRecovery,
47
48
  ApiErrorResponse,
48
49
  OpenapiResponseError,
49
50
  RouterMeta,
50
51
  defaultOpenapiErrorLimits
51
- } from "./chunk-OBXHQNWC.js";
52
+ } from "./chunk-CVAJ4F6O.js";
52
53
  import {
53
54
  NetworkRefused,
54
55
  ProviderError,
55
56
  cacheLimits
56
57
  } from "./chunk-MWKHKOTL.js";
57
- import "./chunk-KBIKBWSS.js";
58
- import "./chunk-VU6GQ2SH.js";
59
- import {
60
- FetchHttpClient_exports
61
- } from "./chunk-MZH4J2PO.js";
58
+ import "./chunk-H72MEDMN.js";
62
59
  import {
63
60
  jsonSchema,
64
61
  lazyJsonSchemaDecoder,
65
62
  once,
66
63
  wrap
67
64
  } from "./chunk-KGCTYL2S.js";
68
- import "./chunk-EG72MSVK.js";
65
+ import {
66
+ owned
67
+ } from "./chunk-JM7LOD2W.js";
68
+ import {
69
+ FetchHttpClient_exports
70
+ } from "./chunk-PD6I2SDG.js";
71
+ import "./chunk-5FHWNLCI.js";
69
72
  import {
70
73
  JsonObject
71
74
  } from "./chunk-H2CJWXA3.js";
72
- import "./chunk-KSGYJV46.js";
75
+ import "./chunk-TUMGL2OC.js";
73
76
  import {
74
77
  HttpClientRequest_exports,
75
78
  HttpClient_exports
76
- } from "./chunk-LNSVJS2Q.js";
79
+ } from "./chunk-EOPQ727L.js";
77
80
  import {
78
81
  Base64_exports,
79
82
  Deferred_exports,
@@ -384,7 +387,7 @@ function createRequest(config) {
384
387
  duration: defaultOpenapiResponseLimits.readTimeoutMs,
385
388
  orElse: () => Effect_exports.fail(unreadable)
386
389
  }),
387
- Effect_exports.withSpan("provider.http.response.read")
390
+ owned("upstream", "provider.http.response.read")
388
391
  );
389
392
  const data = new Uint8Array(chunks.reduce((size, chunk) => size + chunk.length, 0));
390
393
  let offset = 0;
@@ -399,7 +402,7 @@ function createRequest(config) {
399
402
  ) : text;
400
403
  })
401
404
  ).pipe(
402
- Effect_exports.withSpan("provider.openapi.call", {
405
+ owned("upstream", "provider.openapi.call", {
403
406
  attributes: { "executor.tool.name": op.name, "http.request.method": op.method }
404
407
  }),
405
408
  Effect_exports.provideService(FetchHttpClient_exports.RequestInit, { redirect: "manual" }),
@@ -4118,13 +4121,13 @@ function checkSwagger2(document) {
4118
4121
  if (!path.startsWith("/")) continue;
4119
4122
  const itemAt = `#/paths/${pointerToken(path)}`;
4120
4123
  const item = decodeDefinition(Swagger2PathItem, value, itemAt, "path item");
4121
- for (const method of swagger2Methods)
4122
- for (const [status, response] of Object.entries(item[method]?.responses ?? {}))
4124
+ for (const method2 of swagger2Methods)
4125
+ for (const [status, response] of Object.entries(item[method2]?.responses ?? {}))
4123
4126
  if (!status.startsWith("x-"))
4124
4127
  decodeDefinition(
4125
4128
  DocumentObject,
4126
4129
  response,
4127
- `${itemAt}/${method}/responses/${pointerToken(status)}`,
4130
+ `${itemAt}/${method2}/responses/${pointerToken(status)}`,
4128
4131
  "response"
4129
4132
  );
4130
4133
  }
@@ -4446,8 +4449,8 @@ var binaryInput = {
4446
4449
  var declaredAt = (document, value, inline) => document.origin(value) ?? inline;
4447
4450
  var mediaSchemaAt = (document, at, type, media) => `${declaredAt(document, media, `${at}/content/${pointerToken(type)}`)}/schema`;
4448
4451
  var responsesOf = (operation) => operation.responses === void 0 ? {} : record2(operation.responses);
4449
- function responseSchema(document, operation, at, method) {
4450
- if (method === "HEAD") return { type: "null" };
4452
+ function responseSchema(document, operation, at, method2) {
4453
+ if (method2 === "HEAD") return { type: "null" };
4451
4454
  const success = Object.entries(responsesOf(operation)).filter(
4452
4455
  ([status]) => /^2(?:[0-9]{2}|XX)$/i.test(status)
4453
4456
  );
@@ -4577,10 +4580,10 @@ function prefixParameters(prefix) {
4577
4580
  return names;
4578
4581
  }
4579
4582
  var compileOpenApiDocument = (entry, inputDocument, options = {}) => {
4580
- let owned = inputDocument;
4583
+ let owned2 = inputDocument;
4581
4584
  const take = () => {
4582
- const input = owned;
4583
- owned = void 0;
4585
+ const input = owned2;
4586
+ owned2 = void 0;
4584
4587
  if (input === void 0) fail2("invalid_document", "This API definition was already compiled.");
4585
4588
  return input;
4586
4589
  };
@@ -4674,15 +4677,15 @@ var compileOpenApiDocument = (entry, inputDocument, options = {}) => {
4674
4677
  const candidates = Object.entries(spec.paths).flatMap(([path, source]) => {
4675
4678
  const item = document.resolve(source);
4676
4679
  const itemAt = declaredAt(document, source, `#/paths/${pointerToken(path)}`);
4677
- const additional = version32 && item.additionalOperations !== void 0 ? Object.entries(record2(item.additionalOperations)).map(([method, value]) => ({
4678
- method,
4680
+ const additional = version32 && item.additionalOperations !== void 0 ? Object.entries(record2(item.additionalOperations)).map(([method2, value]) => ({
4681
+ method: method2,
4679
4682
  value,
4680
- at: `${itemAt}/additionalOperations/${pointerToken(method)}`
4683
+ at: `${itemAt}/additionalOperations/${pointerToken(method2)}`
4681
4684
  })) : [];
4682
- const fixed = (version32 ? fixedMethods32 : fixedMethods).filter((method) => item[method.toLowerCase()] !== void 0).map((method) => ({
4683
- method,
4684
- value: item[method.toLowerCase()],
4685
- at: `${itemAt}/${method.toLowerCase()}`
4685
+ const fixed = (version32 ? fixedMethods32 : fixedMethods).filter((method2) => item[method2.toLowerCase()] !== void 0).map((method2) => ({
4686
+ method: method2,
4687
+ value: item[method2.toLowerCase()],
4688
+ at: `${itemAt}/${method2.toLowerCase()}`
4686
4689
  }));
4687
4690
  return [...fixed, ...additional].map((operation) => ({ ...operation, path, item, itemAt }));
4688
4691
  });
@@ -4701,15 +4704,15 @@ var compileOpenApiDocument = (entry, inputDocument, options = {}) => {
4701
4704
  );
4702
4705
  const order = new Map(named.map(({ name }, index) => [name, index]));
4703
4706
  const inDefinitionOrder = (operations2) => [...operations2].sort((a, b) => (order.get(a.name) ?? 0) - (order.get(b.name) ?? 0));
4704
- for (const [index, { name, path, item, itemAt, method, value, at }] of named.entries()) {
4707
+ for (const [index, { name, path, item, itemAt, method: method2, value, at }] of named.entries()) {
4705
4708
  if (index % 100 === 99) await yieldToRuntime();
4706
4709
  try {
4707
4710
  if (!path.startsWith("/") || path.includes("?") || path.includes("#"))
4708
4711
  fail2("operation_path", "The path must start with / and contain no ? or #.");
4709
- if (!isImportedMethod(method))
4712
+ if (!isImportedMethod(method2))
4710
4713
  fail2(
4711
4714
  "operation_method",
4712
- `Executor does not send the HTTP method ${method}. It imports ${fixedMethods32.join(", ")} operations.`
4715
+ `Executor does not send the HTTP method ${method2}. It imports ${fixedMethods32.join(", ")} operations.`
4713
4716
  );
4714
4717
  const operationMethods = [];
4715
4718
  const resolved2 = document.resolve(record2(value));
@@ -4904,21 +4907,21 @@ var compileOpenApiDocument = (entry, inputDocument, options = {}) => {
4904
4907
  } catch {
4905
4908
  fail2("input_schema", "Its input schema is not valid JSON.");
4906
4909
  }
4907
- const outputSchema = responseSchema(document, resolved2, at, method);
4910
+ const outputSchema = responseSchema(document, resolved2, at, method2);
4908
4911
  const streaming = Object.values(operation.responses ?? {}).some((response) => {
4909
4912
  const content = errorContent(document, response);
4910
4913
  return content !== void 0 && Object.hasOwn(record2(content), "text/event-stream");
4911
4914
  });
4912
4915
  built.push({
4913
4916
  methods: operationMethods,
4914
- declared: { name, method, path },
4917
+ declared: { name, method: method2, path },
4915
4918
  operation: {
4916
4919
  ...streaming ? { streaming: true } : {},
4917
4920
  ...tags === void 0 || tags.length === 0 ? {} : { tags },
4918
4921
  name,
4919
4922
  ...operation.operationId === void 0 ? {} : { operationId: operation.operationId },
4920
4923
  description: operation.summary ?? operation.description ?? name,
4921
- method,
4924
+ method: method2,
4922
4925
  path: `${options.pathPrefix ?? ""}${path}`,
4923
4926
  baseUrl,
4924
4927
  openapi: spec.openapi,
@@ -4960,7 +4963,7 @@ var compileOpenApiDocument = (entry, inputDocument, options = {}) => {
4960
4963
  if (!(error instanceof OpenapiCompileError) && !Schema_exports.isSchemaError(error)) throw error;
4961
4964
  skipped.push({
4962
4965
  name,
4963
- method,
4966
+ method: method2,
4964
4967
  path,
4965
4968
  ...error instanceof OpenapiCompileError ? { code: error.code, reason: error.reason } : {
4966
4969
  code: "invalid_document",
@@ -4998,7 +5001,7 @@ var compileOpenApiDocument = (entry, inputDocument, options = {}) => {
4998
5001
  continue;
4999
5002
  }
5000
5003
  imported.push({ operation, declared });
5001
- for (const method of operationMethods) methods.set(method.name, method);
5004
+ for (const method2 of operationMethods) methods.set(method2.name, method2);
5002
5005
  }
5003
5006
  const operations = imported.map(({ operation }) => operation);
5004
5007
  if (!operations.length) {
@@ -5021,7 +5024,7 @@ var compileOpenApiDocument = (entry, inputDocument, options = {}) => {
5021
5024
  }
5022
5025
  const supported = (requirement) => {
5023
5026
  const keys = Object.keys(requirement);
5024
- return keys.every((key) => bindings.has(key)) || keys.length === 1 && oauth.some((method) => method.name === keys[0]);
5027
+ return keys.every((key) => bindings.has(key)) || keys.length === 1 && oauth.some((method2) => method2.name === keys[0]);
5025
5028
  };
5026
5029
  const schemeLabel = (key) => {
5027
5030
  const scheme = document.resolve(record2(schemes[key]));
@@ -5031,7 +5034,7 @@ var compileOpenApiDocument = (entry, inputDocument, options = {}) => {
5031
5034
  const unsupportedBy = (requirement) => {
5032
5035
  const keys = Object.keys(requirement);
5033
5036
  const unknown = keys.filter(
5034
- (key) => !bindings.has(key) && !oauth.some((method) => method.name === key)
5037
+ (key) => !bindings.has(key) && !oauth.some((method2) => method2.name === key)
5035
5038
  );
5036
5039
  return unknown.length > 0 ? unknown.map(schemeLabel).join(" and ") : `${keys.map(schemeLabel).join(" with ")}, which combines OAuth sign-in with another scheme`;
5037
5040
  };
@@ -5066,7 +5069,7 @@ var compileOpenApiDocument = (entry, inputDocument, options = {}) => {
5066
5069
  skipped: inDefinitionOrder(skipped),
5067
5070
  definitions: Object.fromEntries(document.definitions),
5068
5071
  methods: Object.fromEntries(
5069
- [...methods.values()].map((method) => [method.name, method.bindings])
5072
+ [...methods.values()].map((method2) => [method2.name, method2.bindings])
5070
5073
  ),
5071
5074
  secrets: [...methods.values()],
5072
5075
  oauth,
@@ -5202,36 +5205,46 @@ var base64 = (bytes2) => {
5202
5205
  binary += String.fromCharCode(...bytes2.subarray(index, index + 32768));
5203
5206
  return btoa(binary);
5204
5207
  };
5205
- var gzip = (text) => invoke(
5206
- async () => base64(
5207
- new Uint8Array(
5208
- await new Response(
5209
- new Blob([text]).stream().pipeThrough(new CompressionStream("gzip"))
5210
- ).arrayBuffer()
5211
- )
5212
- )
5208
+ var gzip = (text) => (
5209
+ // oxlint-disable-next-line executor/authored-code-through-adapter -- Compression Streams
5210
+ Effect_exports.tryPromise({
5211
+ try: async () => base64(
5212
+ new Uint8Array(
5213
+ await new Response(
5214
+ new Blob([text]).stream().pipeThrough(new CompressionStream("gzip"))
5215
+ ).arrayBuffer()
5216
+ )
5217
+ ),
5218
+ catch: (error) => error
5219
+ })
5220
+ );
5221
+ var gunzip = (stored2) => (
5222
+ // oxlint-disable-next-line executor/authored-code-through-adapter -- Compression Streams
5223
+ Effect_exports.tryPromise({
5224
+ try: () => new Response(
5225
+ new Blob([Uint8Array.from(atob(stored2), (char) => char.charCodeAt(0))]).stream().pipeThrough(new DecompressionStream("gzip"))
5226
+ ).text(),
5227
+ catch: invalid
5228
+ })
5213
5229
  );
5214
- var gunzip = (stored2) => Effect_exports.tryPromise({
5215
- try: () => new Response(
5216
- new Blob([Uint8Array.from(atob(stored2), (char) => char.charCodeAt(0))]).stream().pipeThrough(new DecompressionStream("gzip"))
5217
- ).text(),
5218
- catch: invalid
5219
- });
5220
5230
  var decodeText = (decoder) => (text) => Effect_exports.try({ try: () => JSON.parse(text), catch: invalid }).pipe(
5221
5231
  Effect_exports.flatMap((value) => Schema_exports.decodeUnknownEffect(decoder)(value))
5222
5232
  );
5223
5233
  var schema = (decoder) => wrap(decoder, false);
5224
- var invoke = (work) => Effect_exports.tryPromise({ try: work, catch: (error) => error });
5225
5234
  var invalid = () => new OpenapiError({ reason: "invalid_definition" });
5226
5235
  var format = "openapi-v4";
5227
5236
  var writeEntries = cacheLimits.batchEntries;
5228
5237
  var writeBytes = cacheLimits.batchBytes - 5e5;
5229
5238
  var readParts = Math.floor(cacheLimits.batchBytes / bucketLimit);
5230
- var sha256Json = (value) => invoke(
5231
- () => crypto.subtle.digest("SHA-256", new TextEncoder().encode(JSON.stringify(value)))
5232
- ).pipe(
5233
- Effect_exports.map(
5234
- (hash2) => Array.from(new Uint8Array(hash2), (byte) => byte.toString(16).padStart(2, "0")).join("")
5239
+ var sha256Json = (value) => (
5240
+ // oxlint-disable-next-line executor/authored-code-through-adapter -- Web Crypto
5241
+ Effect_exports.tryPromise({
5242
+ try: () => crypto.subtle.digest("SHA-256", new TextEncoder().encode(JSON.stringify(value))),
5243
+ catch: (error) => error
5244
+ }).pipe(
5245
+ Effect_exports.map(
5246
+ (hash2) => Array.from(new Uint8Array(hash2), (byte) => byte.toString(16).padStart(2, "0")).join("")
5247
+ )
5235
5248
  )
5236
5249
  );
5237
5250
  var partConcurrency = 4;
@@ -5335,9 +5348,10 @@ var parseYaml = (text) => {
5335
5348
  return JSON.parse(JSON.stringify(parse(text)));
5336
5349
  };
5337
5350
  var download = (url, context) => Effect_exports.gen(function* () {
5338
- const response = yield* invoke(
5339
- () => context.fetch(url, { signal: context.signal, redirect: "manual" })
5340
- );
5351
+ const response = yield* Effect_exports.tryPromise({
5352
+ try: () => context.fetch(url, { signal: context.signal, redirect: "manual" }),
5353
+ catch: (error) => error
5354
+ });
5341
5355
  if (!response.ok || response.body === null) return yield* invalid();
5342
5356
  const reader = response.body.getReader();
5343
5357
  const text = yield* Effect_exports.acquireUseRelease(
@@ -5347,7 +5361,10 @@ var download = (url, context) => Effect_exports.gen(function* () {
5347
5361
  const chunks = [];
5348
5362
  let bytes2 = 0;
5349
5363
  while (true) {
5350
- const chunk = yield* invoke(() => reader2.read());
5364
+ const chunk = yield* Effect_exports.tryPromise({
5365
+ try: () => reader2.read(),
5366
+ catch: (error) => error
5367
+ });
5351
5368
  if (chunk.done) break;
5352
5369
  bytes2 += chunk.value.byteLength;
5353
5370
  if (bytes2 > 4e7) return yield* invalid();
@@ -5356,7 +5373,12 @@ var download = (url, context) => Effect_exports.gen(function* () {
5356
5373
  chunks.push(decoder.decode());
5357
5374
  return chunks.join("");
5358
5375
  }),
5359
- (reader2) => invoke(() => reader2.cancel()).pipe(Effect_exports.catch(() => Effect_exports.void))
5376
+ (reader2) => (
5377
+ // oxlint-disable-next-line executor/authored-code-through-adapter -- Streams
5378
+ Effect_exports.tryPromise({ try: () => reader2.cancel(), catch: (error) => error }).pipe(
5379
+ Effect_exports.catch(() => Effect_exports.void)
5380
+ )
5381
+ )
5360
5382
  );
5361
5383
  return yield* Effect_exports.try({
5362
5384
  try: () => Schema_exports.decodeUnknownSync(JsonObject)(
@@ -5370,6 +5392,7 @@ var liveOpenapiRouter = (options) => {
5370
5392
  const staleFor = options.staleFor ?? "1 day";
5371
5393
  const retention = Duration_exports.toMillis(Duration_exports.fromInputUnsafe(freshFor)) + Duration_exports.toMillis(Duration_exports.fromInputUnsafe(staleFor)) + 3e5;
5372
5394
  const identity = Effect_exports.cached(
5395
+ // oxlint-disable-next-line executor/authored-code-through-adapter -- Web Crypto
5373
5396
  Effect_exports.tryPromise({
5374
5397
  try: async () => {
5375
5398
  const bytes2 = new TextEncoder().encode(
@@ -5413,10 +5436,10 @@ var liveOpenapiRouter = (options) => {
5413
5436
  const revision = yield* sha256Json([format, yield* sourceId, document]);
5414
5437
  const meta = documentMeta(document);
5415
5438
  const handOver = () => {
5416
- const owned = document;
5439
+ const owned2 = document;
5417
5440
  document = void 0;
5418
- if (owned === void 0) throw new Error("The document was already handed over.");
5419
- return owned;
5441
+ if (owned2 === void 0) throw new Error("The document was already handed over.");
5442
+ return owned2;
5420
5443
  };
5421
5444
  const compiled = yield* compileOpenApiDocument(
5422
5445
  { name: "API", ..."url" in options.source ? { connectUrl: options.source.url } : {} },
@@ -5485,7 +5508,7 @@ var liveOpenapiRouter = (options) => {
5485
5508
  const { manifest, batches, retained, retainedBytes } = yield* serialize(context);
5486
5509
  yield* Effect_exports.forEach(
5487
5510
  batches,
5488
- ({ entries, bytes: bytes2 }, index) => fromPromise(context.cache.write)(entries, retention).pipe(
5511
+ ({ entries, bytes: bytes2 }, index) => fromPromise(method(context.cache, "write"), "cache")(entries, retention).pipe(
5489
5512
  Effect_exports.withSpan("app.cache.flush", {
5490
5513
  attributes: {
5491
5514
  "cache.flush.index": index,
@@ -5511,12 +5534,15 @@ var liveOpenapiRouter = (options) => {
5511
5534
  reading = deferred;
5512
5535
  return pointer.pipe(
5513
5536
  Effect_exports.flatMap(
5514
- (key) => fromPromise(options.cache.get)({
5537
+ (key) => fromPromise(
5538
+ method(options.cache, "get"),
5539
+ "cache"
5540
+ )({
5515
5541
  key,
5516
5542
  schema: schema(Manifest),
5517
5543
  freshFor,
5518
5544
  staleFor,
5519
- load: toPromise(refresh)
5545
+ load: toPromise(refresh, (context) => context.signal)
5520
5546
  })
5521
5547
  ),
5522
5548
  Effect_exports.onExit(
@@ -5540,7 +5566,7 @@ var liveOpenapiRouter = (options) => {
5540
5566
  );
5541
5567
  return Effect_exports.forEach(
5542
5568
  groups,
5543
- (group) => fromPromise(options.cache.readMany)(
5569
+ (group) => fromPromise(method(options.cache, "readMany"), "cache")(
5544
5570
  group.map((name) => partKey(revision, kind, name)),
5545
5571
  partText
5546
5572
  ).pipe(
@@ -5672,7 +5698,7 @@ var liveOpenapiRouter = (options) => {
5672
5698
  for (let attempt = 0; attempt < 2; attempt++) {
5673
5699
  const result = yield* work(yield* current);
5674
5700
  if (result !== void 0) return result.value;
5675
- yield* fromPromise(options.cache.invalidate)(yield* pointer);
5701
+ yield* fromPromise(method(options.cache, "invalidate"), "cache")(yield* pointer);
5676
5702
  }
5677
5703
  return yield* invalid();
5678
5704
  });
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  folderSkillsEffect,
3
3
  skillFromFiles
4
- } from "../chunk-IN2WIN7I.js";
5
- import "../chunk-KBIKBWSS.js";
6
- import "../chunk-EG72MSVK.js";
7
- import "../chunk-KSGYJV46.js";
8
- import "../chunk-LNSVJS2Q.js";
4
+ } from "../chunk-XBG7HHXC.js";
5
+ import "../chunk-H72MEDMN.js";
6
+ import "../chunk-5FHWNLCI.js";
7
+ import "../chunk-TUMGL2OC.js";
8
+ import "../chunk-EOPQ727L.js";
9
9
  import "../chunk-IFJU5SYQ.js";
10
10
  import "../chunk-CZ7CSFO4.js";
11
11
  export {
package/js/skills.js CHANGED
@@ -1,19 +1,22 @@
1
1
  import {
2
2
  catalogCache,
3
3
  catalogScope
4
- } from "./chunk-5GLC42LK.js";
4
+ } from "./chunk-UM62MBJQ.js";
5
5
  import "./chunk-AQU56EPI.js";
6
6
  import {
7
7
  failOnNetworkRefusal
8
- } from "./chunk-T65AFHU3.js";
8
+ } from "./chunk-7UUHJR2Q.js";
9
9
  import {
10
10
  folderSkillsEffect,
11
11
  skillFromFiles
12
- } from "./chunk-IN2WIN7I.js";
12
+ } from "./chunk-XBG7HHXC.js";
13
13
  import {
14
14
  accountProviderError,
15
- httpProviderError
16
- } from "./chunk-EMHFXFTJ.js";
15
+ fromPromise,
16
+ httpProviderError,
17
+ method,
18
+ toPromise
19
+ } from "./chunk-LTDHQJ2Z.js";
17
20
  import {
18
21
  NetworkRefused,
19
22
  ProviderError,
@@ -28,21 +31,21 @@ import {
28
31
  SkillLoadFailed,
29
32
  SkillServiceName,
30
33
  skillLoadLimits
31
- } from "./chunk-KBIKBWSS.js";
32
- import "./chunk-VU6GQ2SH.js";
33
- import {
34
- FetchHttpClient_exports
35
- } from "./chunk-MZH4J2PO.js";
34
+ } from "./chunk-H72MEDMN.js";
36
35
  import {
37
36
  wrap
38
37
  } from "./chunk-KGCTYL2S.js";
39
- import "./chunk-EG72MSVK.js";
38
+ import "./chunk-JM7LOD2W.js";
39
+ import {
40
+ FetchHttpClient_exports
41
+ } from "./chunk-PD6I2SDG.js";
42
+ import "./chunk-5FHWNLCI.js";
40
43
  import "./chunk-H2CJWXA3.js";
41
- import "./chunk-KSGYJV46.js";
44
+ import "./chunk-TUMGL2OC.js";
42
45
  import {
43
46
  HttpBody_exports,
44
47
  HttpClient_exports
45
- } from "./chunk-LNSVJS2Q.js";
48
+ } from "./chunk-EOPQ727L.js";
46
49
  import {
47
50
  Base64_exports,
48
51
  Effect_exports,
@@ -699,10 +702,13 @@ var unreadable = () => new SkillLoadFailed({
699
702
  reason: "request",
700
703
  message: "GitHub returned a git response Executor could not read."
701
704
  });
702
- var git = (run) => Effect_exports.tryPromise({
703
- try: async () => run(),
704
- catch: (error) => error instanceof InflateLimitExceeded ? failed("limit") : unreadable()
705
- });
705
+ var git = (run) => (
706
+ // oxlint-disable-next-line executor/authored-code-through-adapter -- this module's git parsing
707
+ Effect_exports.tryPromise({
708
+ try: async () => run(),
709
+ catch: (error) => error instanceof InflateLimitExceeded ? failed("limit") : unreadable()
710
+ })
711
+ );
706
712
  var githubHosts = ["github.com", "raw.githubusercontent.com"];
707
713
  var githubRequests = (remote, repo, token) => {
708
714
  const refused = (host) => (refusal) => refusal.refusal.reason === "credential_host" ? new SkillLoadFailed({
@@ -783,12 +789,16 @@ var skillDirectories = (github, commit, path) => Effect_exports.gen(function* ()
783
789
  return yield* failed("limit");
784
790
  return directories;
785
791
  });
786
- var cachedSkillDirectories = (cache, transport, options, commit) => Effect_exports.tryPromise({
787
- try: () => cache.get({
788
- key: ["apps/githubSkills/directories", 1, options.repo, commit, options.path ?? null],
789
- schema: wrap(SkillDirectories, false),
790
- freshFor: "7 days",
791
- load: (context) => Effect_exports.runPromise(
792
+ var cachedSkillDirectories = (cache, transport, options, commit) => fromPromise(
793
+ method(cache, "get"),
794
+ "cache"
795
+ )({
796
+ key: ["apps/githubSkills/directories", 1, options.repo, commit, options.path ?? null],
797
+ schema: wrap(SkillDirectories, false),
798
+ freshFor: "7 days",
799
+ // Executor's own loader: the app's cache runs it natively, so only its requests are upstream.
800
+ load: toPromise(
801
+ (context) => (
792
802
  // Keep the author's fetch and this read's token, as every other request in it does.
793
803
  reader({ fetch: transport.fetch, signal: context.signal }).pipe(
794
804
  Effect_exports.flatMap(
@@ -798,21 +808,28 @@ var cachedSkillDirectories = (cache, transport, options, commit) => Effect_expor
798
808
  options.path
799
809
  )
800
810
  )
801
- ),
802
- { signal: context.signal }
811
+ )
812
+ ),
813
+ // A cache may call the loader as a Promise; its own signal cancels that load.
814
+ (context) => context.signal
815
+ )
816
+ }).pipe(
817
+ Effect_exports.mapError(
818
+ (error) => loaderFailure(
819
+ error,
820
+ () => new SkillLoadFailed({
821
+ reason: "request",
822
+ message: "Executor could not read or update the app cache for skills."
823
+ })
803
824
  )
804
- }),
805
- catch: (error) => loaderFailure(
806
- error,
807
- () => new SkillLoadFailed({
808
- reason: "request",
809
- message: "Executor could not read or update the app cache for skills."
810
- })
811
825
  )
812
- });
813
- var digest = (value) => Effect_exports.promise(
814
- () => crypto.subtle.digest("SHA-256", new TextEncoder().encode(JSON.stringify(value)))
815
- ).pipe(Effect_exports.map((bytes) => Hex_exports.encode(new Uint8Array(bytes))));
826
+ );
827
+ var digest = (value) => (
828
+ // oxlint-disable-next-line executor/authored-code-through-adapter -- Web Crypto
829
+ Effect_exports.promise(
830
+ () => crypto.subtle.digest("SHA-256", new TextEncoder().encode(JSON.stringify(value)))
831
+ ).pipe(Effect_exports.map((bytes) => Hex_exports.encode(new Uint8Array(bytes))))
832
+ );
816
833
  var checked = (request) => request.pipe(
817
834
  Effect_exports.timeoutOrElse({
818
835
  duration: skillLoadLimits.checkMillis,
package/js/ui/auth.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  appRedirect,
4
4
  appSignInCallback,
5
5
  appSignInFailed
6
- } from "../chunk-EJUK2NK5.js";
6
+ } from "../chunk-KLYSEHUD.js";
7
7
  import {
8
8
  AppReturnPath,
9
9
  AppSignInCallback,
@@ -12,8 +12,8 @@ import {
12
12
  AppSignInId,
13
13
  appSignInCallbackPath
14
14
  } from "../chunk-JPEUKEV4.js";
15
- import "../chunk-MZH4J2PO.js";
16
- import "../chunk-LNSVJS2Q.js";
15
+ import "../chunk-PD6I2SDG.js";
16
+ import "../chunk-EOPQ727L.js";
17
17
  import "../chunk-IFJU5SYQ.js";
18
18
  import "../chunk-CZ7CSFO4.js";
19
19
  export {
@@ -7,10 +7,10 @@ import {
7
7
  UiOperation,
8
8
  UiSnapshot,
9
9
  UiUnauthorized
10
- } from "../chunk-4ZTVLEN6.js";
10
+ } from "../chunk-CDXQDN7W.js";
11
11
  import "../chunk-H2CJWXA3.js";
12
- import "../chunk-KSGYJV46.js";
13
- import "../chunk-LNSVJS2Q.js";
12
+ import "../chunk-TUMGL2OC.js";
13
+ import "../chunk-EOPQ727L.js";
14
14
  import "../chunk-IFJU5SYQ.js";
15
15
  import "../chunk-CZ7CSFO4.js";
16
16
  export {
package/js/ui/serving.js CHANGED
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  appPrivateHeaders
3
- } from "../chunk-EJUK2NK5.js";
3
+ } from "../chunk-KLYSEHUD.js";
4
4
  import "../chunk-JPEUKEV4.js";
5
5
  import {
6
6
  UiForbidden
7
- } from "../chunk-4ZTVLEN6.js";
7
+ } from "../chunk-CDXQDN7W.js";
8
8
  import {
9
9
  CurrentTelemetryConfig
10
- } from "../chunk-VU6GQ2SH.js";
11
- import "../chunk-MZH4J2PO.js";
12
- import "../chunk-EG72MSVK.js";
10
+ } from "../chunk-JM7LOD2W.js";
11
+ import "../chunk-PD6I2SDG.js";
12
+ import "../chunk-5FHWNLCI.js";
13
13
  import "../chunk-H2CJWXA3.js";
14
- import "../chunk-KSGYJV46.js";
14
+ import "../chunk-TUMGL2OC.js";
15
15
  import {
16
16
  HttpServerRequest_exports,
17
17
  HttpServerResponse_exports
18
- } from "../chunk-LNSVJS2Q.js";
18
+ } from "../chunk-EOPQ727L.js";
19
19
  import {
20
20
  Effect_exports
21
21
  } from "../chunk-IFJU5SYQ.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apps",
3
- "version": "0.0.1-beta.43",
3
+ "version": "0.0.1-beta.46",
4
4
  "description": "TypeScript apps with typed tools, accounts, storage, and UI.",
5
5
  "type": "module",
6
6
  "sideEffects": false,