apps 0.0.1-beta.6 → 0.0.1-beta.60

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 (173) hide show
  1. package/README.md +24 -21
  2. package/framework-reference.json +1 -1
  3. package/js/{chunk-ECQFRCH4.js → chunk-2ARGIHVD.js} +4 -3
  4. package/js/chunk-5FHWNLCI.js +88 -0
  5. package/js/{chunk-M3B3DE4K.js → chunk-74YVXBKY.js} +463 -218
  6. package/js/{chunk-NKLWZJLE.js → chunk-AQU56EPI.js} +9 -5
  7. package/js/chunk-CDXQDN7W.js +92 -0
  8. package/js/{chunk-ITM77QPO.js → chunk-CWW7QWP4.js} +126 -31
  9. package/js/{chunk-UK573G7W.js → chunk-EOPQ727L.js} +87 -51
  10. package/js/chunk-ERJ5JGCB.js +266 -0
  11. package/js/{chunk-RJDDBDSN.js → chunk-FFSO3J76.js} +633 -89
  12. package/js/{chunk-27F7W2LG.js → chunk-H2CJWXA3.js} +2 -2
  13. package/js/{chunk-JU7VHODU.js → chunk-H72MEDMN.js} +65 -10
  14. package/js/{chunk-CDL5PM2Q.js → chunk-IFJU5SYQ.js} +19082 -18402
  15. package/js/{chunk-RFVIONFX.js → chunk-IJ6Y2KFQ.js} +79 -41
  16. package/js/{chunk-T7GKZBLP.js → chunk-JIU25DIL.js} +67 -55
  17. package/js/{chunk-VFZKSM3T.js → chunk-JPEUKEV4.js} +3 -3
  18. package/js/{chunk-5T57N25Q.js → chunk-KGCTYL2S.js} +511 -63
  19. package/js/{chunk-KUMBKVJD.js → chunk-KLYSEHUD.js} +2 -2
  20. package/js/chunk-MRV45IXB.js +340 -0
  21. package/js/chunk-MWKHKOTL.js +240 -0
  22. package/js/{chunk-SB4HEPNJ.js → chunk-MZNCLCGJ.js} +883 -189
  23. package/js/chunk-NS3DEHVA.js +49 -0
  24. package/js/chunk-OD3KFKZD.js +1617 -0
  25. package/js/{chunk-57RKNWL2.js → chunk-PD6I2SDG.js} +4 -4
  26. package/js/chunk-T53665H5.js +171 -0
  27. package/js/{chunk-B3EOZTK3.js → chunk-TLWLJ7PD.js} +2227 -453
  28. package/js/{chunk-IJX4CYZO.js → chunk-TUMGL2OC.js} +228 -264
  29. package/js/{chunk-IPI4MFSN.js → chunk-XBG7HHXC.js} +2 -2
  30. package/js/{chunk-MNMNLXBL.js → chunk-ZYTA5MK4.js} +316 -69
  31. package/js/client.js +142 -94
  32. package/js/contracts.js +103 -26
  33. package/js/effect.js +19 -19
  34. package/js/{es-APDZKREY.js → es-DIULA3ZF.js} +62 -1659
  35. package/js/graphql.js +50 -40
  36. package/js/host.js +83 -58
  37. package/js/index.js +90 -61
  38. package/js/mcp/effect.js +23 -21
  39. package/js/mcp/stdio.js +44 -34
  40. package/js/mcp.js +76 -53
  41. package/js/openapi.js +4050 -1354
  42. package/js/react.js +2 -3
  43. package/js/skills/effect.js +6 -3
  44. package/js/skills.js +208 -81
  45. package/js/storage/facet.js +1 -540
  46. package/js/ui/auth/contracts.js +2 -2
  47. package/js/ui/auth.js +5 -5
  48. package/js/ui/contracts.js +5 -4
  49. package/js/ui/serving.js +8517 -214
  50. package/package.json +2 -3
  51. package/runtime.json +1 -1
  52. package/types/app-cache/src/index.d.ts +10 -1
  53. package/types/apps/src/contracts/api-response-error.d.ts +4 -0
  54. package/types/apps/src/contracts/app.d.ts +7 -3
  55. package/types/apps/src/contracts/cache.d.ts +20 -0
  56. package/types/apps/src/contracts/context.d.ts +19 -11
  57. package/types/apps/src/contracts/elicitation.d.ts +6 -6
  58. package/types/apps/src/contracts/events.d.ts +93 -0
  59. package/types/apps/src/contracts/failure.d.ts +30 -1
  60. package/types/apps/src/contracts/graphql.d.ts +2 -1
  61. package/types/apps/src/contracts/host.d.ts +48 -13
  62. package/types/apps/src/contracts/live.d.ts +2 -0
  63. package/types/apps/src/contracts/mcp.d.ts +80 -10
  64. package/types/apps/src/contracts/network.d.ts +84 -0
  65. package/types/apps/src/contracts/openapi-compile.d.ts +82 -3
  66. package/types/apps/src/contracts/openapi.d.ts +41 -9
  67. package/types/apps/src/contracts/operations.d.ts +8 -4
  68. package/types/apps/src/contracts/protocol-version.d.ts +2 -2
  69. package/types/apps/src/contracts/protocols/1.d.ts +733 -81
  70. package/types/apps/src/contracts/protocols/10.d.ts +1450 -0
  71. package/types/apps/src/contracts/protocols/2.d.ts +69 -26
  72. package/types/apps/src/contracts/protocols/3.d.ts +133 -33
  73. package/types/apps/src/contracts/protocols/4.d.ts +122 -45
  74. package/types/apps/src/contracts/protocols/5.d.ts +1200 -0
  75. package/types/apps/src/contracts/protocols/6.d.ts +1629 -0
  76. package/types/apps/src/contracts/protocols/7.d.ts +1785 -0
  77. package/types/apps/src/contracts/protocols/8.d.ts +1182 -0
  78. package/types/apps/src/contracts/protocols/9.d.ts +1104 -0
  79. package/types/apps/src/contracts/protocols/current.d.ts +2476 -0
  80. package/types/apps/src/contracts/protocols/oauth-6.d.ts +74 -0
  81. package/types/apps/src/contracts/protocols/oauth.d.ts +134 -0
  82. package/types/apps/src/contracts/provider-error.d.ts +9 -0
  83. package/types/apps/src/contracts/provider.d.ts +115 -10
  84. package/types/apps/src/contracts/skills.d.ts +50 -13
  85. package/types/apps/src/contracts/sql.d.ts +58 -0
  86. package/types/apps/src/contracts/ui.d.ts +19 -1
  87. package/types/apps/src/contracts/workflows.d.ts +6 -0
  88. package/types/apps/src/facet.d.ts +4 -5
  89. package/types/apps/src/host.d.ts +5 -0
  90. package/types/apps/src/implementation/account-router.d.ts +4 -3
  91. package/types/apps/src/implementation/authoring.d.ts +25 -5
  92. package/types/apps/src/implementation/browser-scripts.gen.d.ts +6 -0
  93. package/types/apps/src/implementation/cache.d.ts +4 -0
  94. package/types/apps/src/implementation/catalog-cache.d.ts +35 -4
  95. package/types/apps/src/implementation/elicitation.d.ts +18 -15
  96. package/types/apps/src/implementation/events.d.ts +59 -0
  97. package/types/apps/src/implementation/failure-detail.d.ts +25 -3
  98. package/types/apps/src/implementation/graphql-catalog.d.ts +3 -3
  99. package/types/apps/src/implementation/graphql.d.ts +4 -3
  100. package/types/apps/src/implementation/input-problems.d.ts +6 -2
  101. package/types/apps/src/implementation/invocation-timing.d.ts +16 -0
  102. package/types/apps/src/implementation/live.d.ts +2 -2
  103. package/types/apps/src/implementation/mcp-call.d.ts +6 -5
  104. package/types/apps/src/implementation/mcp-catalog.d.ts +6 -4
  105. package/types/apps/src/implementation/mcp-client.d.ts +17 -9
  106. package/types/apps/src/implementation/mcp-stdio.d.ts +1 -1
  107. package/types/apps/src/implementation/mcp-tools.d.ts +2 -1
  108. package/types/apps/src/implementation/mcp.d.ts +20 -9
  109. package/types/apps/src/implementation/network.d.ts +16 -0
  110. package/types/apps/src/implementation/openapi-compile.d.ts +26 -6
  111. package/types/apps/src/implementation/openapi-document.d.ts +46 -19
  112. package/types/apps/src/implementation/openapi-names.d.ts +9 -4
  113. package/types/apps/src/implementation/openapi-request.d.ts +10 -2
  114. package/types/apps/src/implementation/openapi-source.d.ts +18 -0
  115. package/types/apps/src/implementation/openapi-upgrade.d.ts +4 -0
  116. package/types/apps/src/implementation/operations.d.ts +17 -2
  117. package/types/apps/src/implementation/optimistic.d.ts +1 -1
  118. package/types/apps/src/implementation/protocol-operations.d.ts +3 -0
  119. package/types/apps/src/implementation/provider-error.d.ts +28 -1
  120. package/types/apps/src/implementation/provider.d.ts +19 -5
  121. package/types/apps/src/implementation/query-commit.d.ts +1 -1
  122. package/types/apps/src/implementation/router-catalog.d.ts +11 -13
  123. package/types/apps/src/implementation/router.d.ts +16 -5
  124. package/types/apps/src/implementation/runtime-yield.d.ts +7 -0
  125. package/types/apps/src/implementation/schema.d.ts +90 -10
  126. package/types/apps/src/implementation/skills.d.ts +18 -24
  127. package/types/apps/src/implementation/sql.d.ts +71 -0
  128. package/types/apps/src/implementation/ui-account-notice.d.ts +9 -0
  129. package/types/apps/src/implementation/ui-auth.d.ts +1 -1
  130. package/types/apps/src/implementation/ui-client.d.ts +2 -2
  131. package/types/apps/src/implementation/ui-document.d.ts +5 -0
  132. package/types/apps/src/implementation/ui-errors.d.ts +1 -1
  133. package/types/apps/src/implementation/ui-serving.d.ts +11 -5
  134. package/types/apps/src/implementation/ui-watch.d.ts +1 -1
  135. package/types/apps/src/implementation/upstream-error.d.ts +7 -0
  136. package/types/apps/src/implementation/webhooks.d.ts +1 -1
  137. package/types/apps/src/implementation/workflows.d.ts +1 -1
  138. package/types/apps/src/index.d.ts +30 -12
  139. package/types/apps/src/mcp.d.ts +20 -1
  140. package/types/apps/src/openapi.d.ts +1 -1
  141. package/types/apps/src/react.d.ts +1 -1
  142. package/types/apps/src/skills.d.ts +10 -8
  143. package/types/telemetry/src/app-records.d.ts +42 -0
  144. package/types/telemetry/src/browser-operations.d.ts +7 -4
  145. package/types/telemetry/src/browser.d.ts +8 -3
  146. package/types/telemetry/src/config.d.ts +2 -2
  147. package/types/telemetry/src/index.d.ts +1 -0
  148. package/types/telemetry/src/layer.d.ts +2 -2
  149. package/types/telemetry/src/ownership.d.ts +56 -0
  150. package/types/telemetry/src/recorded-failure.d.ts +29 -0
  151. package/types/telemetry/src/relay.d.ts +11 -3
  152. package/types/telemetry/src/transport.d.ts +8 -1
  153. package/types/utils/src/api-error.d.ts +55 -0
  154. package/types/utils/src/connection-failure.d.ts +33 -0
  155. package/types/utils/src/recorded-message.d.ts +18 -0
  156. package/types/utils/src/user-facing-error.d.ts +83 -0
  157. package/js/chunk-6BSSI67S.js +0 -224
  158. package/js/chunk-MKWZPDR6.js +0 -63
  159. package/js/chunk-N7YDVXYJ.js +0 -186
  160. package/js/chunk-OE3QQTSB.js +0 -222
  161. package/js/chunk-PJJ24GU7.js +0 -877
  162. package/js/chunk-PZB6T6KU.js +0 -19
  163. package/js/chunk-R3EV5FTO.js +0 -97
  164. package/js/chunk-ZQINWV4W.js +0 -630
  165. package/types/app-data/src/implementation/cursor.d.ts +0 -10
  166. package/types/app-data/src/implementation/index-key.d.ts +0 -7
  167. package/types/app-data/src/implementation/promise.d.ts +0 -68
  168. package/types/app-data/src/implementation/range.d.ts +0 -8
  169. package/types/app-data/src/implementation/schema.d.ts +0 -18
  170. package/types/app-data/src/implementation/sqlite.d.ts +0 -11
  171. package/types/app-data/src/index.d.ts +0 -4
  172. package/types/apps/src/contracts/storage.d.ts +0 -68
  173. package/types/apps/src/implementation/storage.d.ts +0 -15
package/js/client.js CHANGED
@@ -1,40 +1,38 @@
1
1
  import {
2
2
  AppUiApi,
3
- HttpApiClient_exports,
4
3
  UiContext,
5
4
  UiDeploymentChanged,
6
5
  UiFailed
7
- } from "./chunk-IJX4CYZO.js";
6
+ } from "./chunk-CDXQDN7W.js";
8
7
  import {
9
8
  AsyncResult_exports,
10
9
  AtomRegistry_exports,
11
10
  Atom_exports,
12
11
  queryResult
13
- } from "./chunk-M3B3DE4K.js";
14
- import "./chunk-PJJ24GU7.js";
12
+ } from "./chunk-74YVXBKY.js";
13
+ import {
14
+ decoderOf
15
+ } from "./chunk-KGCTYL2S.js";
15
16
  import {
16
17
  OtlpExporter_exports,
17
- TraceContext,
18
18
  externalTrace,
19
19
  pendingSpan,
20
20
  telemetryLayer,
21
21
  traceLinks
22
- } from "./chunk-RJDDBDSN.js";
22
+ } from "./chunk-FFSO3J76.js";
23
23
  import {
24
24
  FetchHttpClient_exports
25
- } from "./chunk-57RKNWL2.js";
25
+ } from "./chunk-PD6I2SDG.js";
26
+ import "./chunk-5FHWNLCI.js";
26
27
  import {
27
- HttpClientError_exports
28
- } from "./chunk-UK573G7W.js";
29
- import {
30
- decoderOf
31
- } from "./chunk-5T57N25Q.js";
28
+ JsonValue
29
+ } from "./chunk-H2CJWXA3.js";
32
30
  import {
33
- StorageName
34
- } from "./chunk-PZB6T6KU.js";
31
+ HttpApiClient_exports
32
+ } from "./chunk-TUMGL2OC.js";
35
33
  import {
36
- JsonValue
37
- } from "./chunk-27F7W2LG.js";
34
+ HttpClientError_exports
35
+ } from "./chunk-EOPQ727L.js";
38
36
  import {
39
37
  Cause_exports,
40
38
  Clock_exports,
@@ -47,25 +45,27 @@ import {
47
45
  Logger_exports,
48
46
  ManagedRuntime_exports,
49
47
  Option_exports,
48
+ Queue_exports,
50
49
  Schedule_exports,
51
50
  Schema_exports,
52
51
  Semaphore_exports,
53
52
  Stream_exports,
54
53
  Tracer_exports
55
- } from "./chunk-CDL5PM2Q.js";
54
+ } from "./chunk-IFJU5SYQ.js";
56
55
  import "./chunk-CZ7CSFO4.js";
57
56
 
58
57
  // src/contracts/live.ts
58
+ var OperationName = Schema_exports.NonEmptyString.check(Schema_exports.isMaxLength(200));
59
59
  var AppQueryFailed = class extends Schema_exports.TaggedError()("AppQueryFailed", {}) {
60
60
  };
61
61
 
62
62
  // src/implementation/live.ts
63
63
  var queryReference = (name) => ({
64
- name: Schema_exports.decodeUnknownSync(StorageName)(name),
64
+ name: Schema_exports.decodeUnknownSync(OperationName)(name),
65
65
  kind: "query"
66
66
  });
67
67
  var mutationReference = (name) => ({
68
- name: Schema_exports.decodeUnknownSync(StorageName)(name),
68
+ name: Schema_exports.decodeUnknownSync(OperationName)(name),
69
69
  kind: "mutation"
70
70
  });
71
71
  var liveQueryAtom = (reference, input, options) => Atom_exports.make(
@@ -448,21 +448,6 @@ var observeBrowserPerformance = Effect_exports.gen(function* () {
448
448
  };
449
449
  });
450
450
 
451
- // ../telemetry/src/browser-operations.ts
452
- var BrowserOperationFailure = Schema_exports.Struct({
453
- error_type: Schema_exports.Literals([
454
- "BrowserDecodeFailed",
455
- "BrowserTransportFailed",
456
- "BrowserOperationFailed"
457
- ]),
458
- trace_id: TraceContext.fields.traceId,
459
- span_id: TraceContext.fields.spanId,
460
- page_id: Schema_exports.String
461
- });
462
- var ResponseTrace = Context_exports.Reference("telemetry/ResponseTrace", {
463
- defaultValue: () => void 0
464
- });
465
-
466
451
  // ../telemetry/src/browser.ts
467
452
  var BrowserTelemetry = class extends Context_exports.Service()("executor/BrowserTelemetry") {
468
453
  };
@@ -491,6 +476,8 @@ var browserTelemetryLayer = (settings) => Layer_exports.unwrap(
491
476
  const onError = (event) => error("ui.error", event.error ?? new Error(event.message));
492
477
  const onRejection = (event) => error("ui.unhandled-rejection", event.reason);
493
478
  const onHidden = () => {
479
+ if (navigation !== void 0 && document.visibilityState === "hidden")
480
+ navigation.hidden = true;
494
481
  run(
495
482
  document.visibilityState === "hidden" ? performance.pause.pipe(Effect_exports.andThen(flush)) : performance.resume
496
483
  );
@@ -518,15 +505,27 @@ var browserTelemetryLayer = (settings) => Layer_exports.unwrap(
518
505
  return {
519
506
  flush,
520
507
  navigation: (event) => Effect_exports.sync(() => {
508
+ if (event.type === "load") return;
521
509
  if (event.type === "end") {
522
- if (navigation !== void 0) Deferred_exports.doneUnsafe(navigation, Effect_exports.void);
510
+ if (navigation !== void 0) Deferred_exports.doneUnsafe(navigation.done, Effect_exports.void);
523
511
  navigation = void 0;
524
512
  return;
525
513
  }
526
- if (navigation !== void 0) Deferred_exports.doneUnsafe(navigation, Effect_exports.interrupt);
527
- navigation = Deferred_exports.makeUnsafe();
514
+ if (navigation !== void 0)
515
+ Deferred_exports.doneUnsafe(navigation.done, Effect_exports.interrupt);
516
+ const current = {
517
+ done: Deferred_exports.makeUnsafe(),
518
+ hidden: document.visibilityState === "hidden"
519
+ };
520
+ navigation = current;
528
521
  run(
529
- Deferred_exports.await(navigation).pipe(
522
+ Deferred_exports.await(current.done).pipe(
523
+ // Record visibility however the navigation ends, including when a later one interrupts it.
524
+ Effect_exports.ensuring(
525
+ Effect_exports.suspend(
526
+ () => Effect_exports.annotateCurrentSpan("executor.navigation.hidden", current.hidden)
527
+ )
528
+ ),
530
529
  Effect_exports.withSpan("ui.navigation", {
531
530
  root: true,
532
531
  attributes: { "url.path": event.path }
@@ -536,7 +535,7 @@ var browserTelemetryLayer = (settings) => Layer_exports.unwrap(
536
535
  );
537
536
  }).pipe(
538
537
  Effect_exports.andThen(
539
- event.type === "start" ? performance.navigation(event.path) : Effect_exports.void
538
+ event.type === "end" ? Effect_exports.void : performance.navigation(event.path)
540
539
  )
541
540
  )
542
541
  };
@@ -809,6 +808,33 @@ var makeOptimisticClient = (transport) => {
809
808
  };
810
809
 
811
810
  // src/implementation/ui-client.ts
811
+ var resubscribeDelay = Schedule_exports.min([
812
+ Schedule_exports.exponential("1 second"),
813
+ Schedule_exports.spaced("1 minute")
814
+ ]).pipe(Schedule_exports.jittered);
815
+ var appFailure = (error) => Schema_exports.is(UiFailed)(error) && error.reason === "operation_failed";
816
+ var resubscribes = (error) => HttpClientError_exports.isHttpClientError(error) || Cause_exports.isTimeoutError(error) || Schema_exports.is(UiFailed)(error) && error.reason !== "account_required";
817
+ var Retrying = class {
818
+ constructor(error, previous) {
819
+ this.error = error;
820
+ this.previous = previous;
821
+ }
822
+ error;
823
+ previous;
824
+ };
825
+ var visibleResult = (result) => {
826
+ const current = AsyncResult_exports.value(result);
827
+ if (Option_exports.isNone(current) || !(current.value instanceof Retrying)) {
828
+ return result;
829
+ }
830
+ const previous = Option_exports.map(
831
+ Option_exports.fromUndefinedOr(current.value.previous),
832
+ AsyncResult_exports.success
833
+ );
834
+ return AsyncResult_exports.isSuccess(result) ? AsyncResult_exports.failureWithPrevious(Cause_exports.fail(current.value.error), { previous, waiting: true }) : AsyncResult_exports.failureWithPrevious(AsyncResult_exports.isFailure(result) ? result.cause : Cause_exports.empty, {
835
+ previous
836
+ });
837
+ };
812
838
  var createAppClient = () => {
813
839
  const { runtime, atoms } = makeBrowserTelemetry(
814
840
  browserSettings("/_executor/api/telemetry", "executor-app-web")
@@ -863,7 +889,8 @@ var createAppClient = () => {
863
889
  Stream_exports.suspend(() => {
864
890
  let previous;
865
891
  let attempts = 0;
866
- return Stream_exports.unwrap(
892
+ let latest;
893
+ const subscription = Stream_exports.unwrap(
867
894
  Effect_exports.gen(function* () {
868
895
  const attempt = attempts++;
869
896
  const first = yield* pendingSpan("ui.app.first_result", {
@@ -911,53 +938,55 @@ var createAppClient = () => {
911
938
  Stream_exports.timeout("45 seconds"),
912
939
  Stream_exports.concat(Stream_exports.fail(new UiFailed({ reason: "unavailable" }))),
913
940
  Stream_exports.filter((frame) => frame.type !== "heartbeat"),
914
- Stream_exports.mapEffect((frame) => {
915
- if (frame.type === "failure") return Effect_exports.fail(frame.error);
916
- const server = externalTrace(frame.trace);
917
- return Effect_exports.gen(function* () {
918
- const value = yield* Schema_exports.decodeUnknownEffect(decoderOf(output))(
919
- frame.value
920
- ).pipe(Effect_exports.mapError(() => new UiFailed({ reason: "operation_failed" })));
921
- const received = yield* Effect_exports.currentSpan;
922
- const receivedAt = clock.currentTimeMillisUnsafe();
923
- const currentRevision = revision++;
924
- yield* Effect_exports.annotateCurrentSpan({
925
- "executor.operation.name": name,
926
- "executor.snapshot.revision": currentRevision,
927
- "browser.query.elapsed_ms": receivedAt - started,
928
- "executor.trace.context_valid": Option_exports.isSome(server)
929
- });
930
- yield* first.finish(Exit_exports.void);
931
- let committed = false;
932
- return {
933
- value,
934
- commit: () => {
935
- if (committed) return;
936
- committed = true;
937
- const committedAt = clock.currentTimeMillisUnsafe();
938
- runtime.runFork(
939
- Effect_exports.void.pipe(
940
- Effect_exports.withSpan("ui.app.result.commit", {
941
- parent: received,
942
- attributes: {
943
- "executor.operation.name": name,
944
- "executor.snapshot.revision": currentRevision,
945
- "browser.query.elapsed_ms": committedAt - started,
946
- "browser.query.receive_to_commit_ms": committedAt - receivedAt,
947
- "browser.page.hidden": document.visibilityState === "hidden"
948
- }
949
- })
950
- )
951
- );
952
- }
953
- };
954
- }).pipe(
955
- Effect_exports.withSpan("ui.app.result.receive", {
956
- parent: Option_exports.isSome(server) ? server.value : first.span,
957
- kind: "consumer"
958
- })
959
- );
960
- }),
941
+ Stream_exports.mapEffect(
942
+ (frame) => {
943
+ if (frame.type === "failure") return Effect_exports.fail(frame.error);
944
+ const server = externalTrace(frame.trace);
945
+ return Effect_exports.gen(function* () {
946
+ const value = yield* Schema_exports.decodeUnknownEffect(decoderOf(output))(
947
+ frame.value
948
+ ).pipe(Effect_exports.mapError(() => new AppQueryFailed()));
949
+ const received = yield* Effect_exports.currentSpan;
950
+ const receivedAt = clock.currentTimeMillisUnsafe();
951
+ const currentRevision = revision++;
952
+ yield* Effect_exports.annotateCurrentSpan({
953
+ "executor.operation.name": name,
954
+ "executor.snapshot.revision": currentRevision,
955
+ "browser.query.elapsed_ms": receivedAt - started,
956
+ "executor.trace.context_valid": Option_exports.isSome(server)
957
+ });
958
+ yield* first.finish(Exit_exports.void);
959
+ let committed = false;
960
+ return {
961
+ value,
962
+ commit: () => {
963
+ if (committed) return;
964
+ committed = true;
965
+ const committedAt = clock.currentTimeMillisUnsafe();
966
+ runtime.runFork(
967
+ Effect_exports.void.pipe(
968
+ Effect_exports.withSpan("ui.app.result.commit", {
969
+ parent: received,
970
+ attributes: {
971
+ "executor.operation.name": name,
972
+ "executor.snapshot.revision": currentRevision,
973
+ "browser.query.elapsed_ms": committedAt - started,
974
+ "browser.query.receive_to_commit_ms": committedAt - receivedAt,
975
+ "browser.page.hidden": document.visibilityState === "hidden"
976
+ }
977
+ })
978
+ )
979
+ );
980
+ }
981
+ };
982
+ }).pipe(
983
+ Effect_exports.withSpan("ui.app.result.receive", {
984
+ parent: Option_exports.isSome(server) ? server.value : first.span,
985
+ kind: "consumer"
986
+ })
987
+ );
988
+ }
989
+ ),
961
990
  Stream_exports.onExit(finish),
962
991
  Stream_exports.provideService(Tracer_exports.ParentSpan, first.span)
963
992
  );
@@ -968,16 +997,35 @@ var createAppClient = () => {
968
997
  Stream_exports.catch(
969
998
  (error) => Schema_exports.is(UiDeploymentChanged)(error) ? Stream_exports.unwrap(deploymentChanged.pipe(Effect_exports.as(Stream_exports.never))) : Stream_exports.fail(error)
970
999
  ),
971
- Stream_exports.retry(
972
- Schedule_exports.spaced("1 second").pipe(
973
- Schedule_exports.while(
974
- ({ input: input2 }) => HttpClientError_exports.isHttpClientError(input2) || Cause_exports.isTimeoutError(input2) || Schema_exports.is(UiFailed)(input2)
975
- )
976
- )
1000
+ Stream_exports.tap(
1001
+ (value) => Effect_exports.sync(() => {
1002
+ latest = value;
1003
+ })
977
1004
  )
978
1005
  );
1006
+ return Stream_exports.unwrap(
1007
+ Effect_exports.gen(function* () {
1008
+ const retrying = yield* Queue_exports.unbounded();
1009
+ return Stream_exports.merge(
1010
+ subscription.pipe(
1011
+ Stream_exports.retry(
1012
+ resubscribeDelay.pipe(
1013
+ Schedule_exports.while(
1014
+ ({ input: input2 }) => !resubscribes(input2) ? false : appFailure(input2) ? Queue_exports.offer(retrying, new Retrying(input2, latest)).pipe(
1015
+ Effect_exports.as(true)
1016
+ ) : true
1017
+ )
1018
+ )
1019
+ )
1020
+ ),
1021
+ // Shown outside the retried stream, so they do not reset its delay.
1022
+ Stream_exports.fromQueue(retrying),
1023
+ { haltStrategy: "left" }
1024
+ );
1025
+ })
1026
+ );
979
1027
  })
980
- ).pipe(Atom_exports.map(queryResult));
1028
+ ).pipe(Atom_exports.map((result) => queryResult(visibleResult(result))));
981
1029
  const optimistic = makeOptimisticClient({
982
1030
  source,
983
1031
  read: (name, input, output) => request("query", name, input, output),
package/js/contracts.js CHANGED
@@ -1,21 +1,30 @@
1
1
  import {
2
+ AccountCheckCommand,
3
+ AccountCheckResult,
4
+ AccountInfo,
2
5
  ApiErrorResponse,
3
6
  ApprovalElicitation,
4
7
  ApprovalResponse,
5
8
  CalendarSchedule,
9
+ CredentialHost,
10
+ DatabaseFieldReserved,
11
+ DatabaseLimitExceeded,
6
12
  DeclaredAuthMethod,
13
+ DeclaredEvent,
14
+ DeclaredEvents,
7
15
  DeclaredProvider,
8
16
  DeclaredRequirements,
9
17
  ElicitationFailed,
10
18
  ElicitationLimits,
11
19
  ElicitationReply,
12
20
  ElicitationResponse,
13
- FailureCode,
14
- FailureDetail,
15
- FailureMessage,
16
- FailureName,
17
- FailureSource,
21
+ EmittedEvent,
22
+ EmittedEvents,
23
+ EventFilterValue,
24
+ EventLimits,
25
+ EventName,
18
26
  FormElicitation,
27
+ HostAccountCheckError,
19
28
  HostAccountsInvalid,
20
29
  HostCallError,
21
30
  HostDataError,
@@ -48,13 +57,19 @@ import {
48
57
  InputProblem,
49
58
  Interval,
50
59
  InvocationDeadline,
60
+ InvocationTiming,
61
+ InvocationTimingSink,
51
62
  ManualWebhookDescriptor,
52
63
  ManualWebhookSetup,
53
64
  McpClientLimits,
54
- McpError,
65
+ McpError2 as McpError,
66
+ MigrateCommand,
67
+ MigrateResult,
55
68
  NonRetryableError,
56
69
  OAuthClientAuth,
57
70
  OAuthSecretClientAuth,
71
+ OAuthTokenRequestFormat,
72
+ OAuthTokenResponse,
58
73
  OpenapiResponseError,
59
74
  OperationSchedule,
60
75
  ResolvedAccount,
@@ -64,6 +79,7 @@ import {
64
79
  RouterMeta,
65
80
  ScheduleTiming,
66
81
  SkillCatalogResponse,
82
+ SkillLoadFailed,
67
83
  SkillSources,
68
84
  ToolResultObservation,
69
85
  TrustedToolApproval,
@@ -87,31 +103,56 @@ import {
87
103
  WorkflowStepOptions,
88
104
  WorkflowValue,
89
105
  approvalElicitation,
106
+ current,
90
107
  defaultElicitationLimits,
108
+ defaultEventLimits,
91
109
  defaultMcpClientLimits,
92
110
  defaultWebhookTransportLimits,
93
111
  frameworkProtocol,
94
112
  indexCommand,
95
113
  inspectCommand,
96
- maxFailureMessageLength,
114
+ maxApiErrorInstructionsLength,
115
+ maxApiErrorMessageLength,
97
116
  maxInputProblems,
98
117
  minimumIntervalMilliseconds,
99
118
  protocol1,
119
+ protocol10,
100
120
  protocol2,
101
121
  protocol3,
102
122
  protocol4,
123
+ protocol5,
124
+ protocol6,
125
+ protocol7,
126
+ protocol8,
127
+ protocol9,
103
128
  selectTools,
104
129
  skillCatalog,
105
130
  skillsCommand,
106
131
  workflowDurationMillis
107
- } from "./chunk-B3EOZTK3.js";
132
+ } from "./chunk-TLWLJ7PD.js";
108
133
  import {
109
- DatabaseFieldReserved,
110
- DatabaseLimitExceeded
111
- } from "./chunk-N7YDVXYJ.js";
112
- import {
113
- ProviderError
114
- } from "./chunk-R3EV5FTO.js";
134
+ FailureCode,
135
+ FailureDetail,
136
+ FailureFieldName,
137
+ FailureFieldValue,
138
+ FailureFields,
139
+ FailureMessage,
140
+ FailureName,
141
+ FailurePhase,
142
+ FailureSource,
143
+ FetchOptionUnsupported,
144
+ NetworkRefusal,
145
+ NetworkRefused,
146
+ ProviderError,
147
+ UpstreamError,
148
+ maxFailureFieldLength,
149
+ maxFailureFields,
150
+ maxFailureMessageLength,
151
+ maxUpstreamMessageLength,
152
+ networkRefusalHeader,
153
+ networkRefusalResponse,
154
+ networkRefusalStatus
155
+ } from "./chunk-MWKHKOTL.js";
115
156
  import {
116
157
  AppSkillMetadata,
117
158
  AppSkillName,
@@ -120,49 +161,61 @@ import {
120
161
  SkillDefinitionInvalid,
121
162
  SkillFile,
122
163
  SkillFilePath,
123
- SkillLoadFailed,
124
164
  SkillServiceName,
125
165
  skillFormatLimits,
126
166
  skillLoadLimits
127
- } from "./chunk-JU7VHODU.js";
128
- import {
129
- AppStorageError,
130
- AppStorageUnavailable,
131
- StorageName
132
- } from "./chunk-PZB6T6KU.js";
167
+ } from "./chunk-H72MEDMN.js";
168
+ import "./chunk-5FHWNLCI.js";
133
169
  import {
134
170
  AccountId,
135
171
  HttpUrl
136
- } from "./chunk-27F7W2LG.js";
137
- import "./chunk-CDL5PM2Q.js";
172
+ } from "./chunk-H2CJWXA3.js";
173
+ import "./chunk-TUMGL2OC.js";
174
+ import "./chunk-EOPQ727L.js";
175
+ import "./chunk-IFJU5SYQ.js";
138
176
  import "./chunk-CZ7CSFO4.js";
139
177
  export {
178
+ AccountCheckCommand,
179
+ AccountCheckResult,
140
180
  AccountId,
181
+ AccountInfo,
141
182
  ApiErrorResponse,
142
183
  AppSkillMetadata,
143
184
  AppSkillName,
144
185
  AppSkillSource,
145
186
  AppSkills,
146
- AppStorageError,
147
- AppStorageUnavailable,
148
187
  ApprovalElicitation,
149
188
  ApprovalResponse,
150
189
  CalendarSchedule,
190
+ CredentialHost,
151
191
  DatabaseFieldReserved,
152
192
  DatabaseLimitExceeded,
153
193
  DeclaredAuthMethod,
194
+ DeclaredEvent,
195
+ DeclaredEvents,
154
196
  DeclaredProvider,
155
197
  DeclaredRequirements,
156
198
  ElicitationFailed,
157
199
  ElicitationLimits,
158
200
  ElicitationReply,
159
201
  ElicitationResponse,
202
+ EmittedEvent,
203
+ EmittedEvents,
204
+ EventFilterValue,
205
+ EventLimits,
206
+ EventName,
160
207
  FailureCode,
161
208
  FailureDetail,
209
+ FailureFieldName,
210
+ FailureFieldValue,
211
+ FailureFields,
162
212
  FailureMessage,
163
213
  FailureName,
214
+ FailurePhase,
164
215
  FailureSource,
216
+ FetchOptionUnsupported,
165
217
  FormElicitation,
218
+ HostAccountCheckError,
166
219
  HostAccountsInvalid,
167
220
  HostCallError,
168
221
  HostDataError,
@@ -196,13 +249,21 @@ export {
196
249
  InputProblem,
197
250
  Interval,
198
251
  InvocationDeadline,
252
+ InvocationTiming,
253
+ InvocationTimingSink,
199
254
  ManualWebhookDescriptor,
200
255
  ManualWebhookSetup,
201
256
  McpClientLimits,
202
257
  McpError,
258
+ MigrateCommand,
259
+ MigrateResult,
260
+ NetworkRefusal,
261
+ NetworkRefused,
203
262
  NonRetryableError,
204
263
  OAuthClientAuth,
205
264
  OAuthSecretClientAuth,
265
+ OAuthTokenRequestFormat,
266
+ OAuthTokenResponse,
206
267
  OpenapiResponseError,
207
268
  OperationSchedule,
208
269
  ProviderError,
@@ -219,9 +280,9 @@ export {
219
280
  SkillLoadFailed,
220
281
  SkillServiceName,
221
282
  SkillSources,
222
- StorageName,
223
283
  ToolResultObservation,
224
284
  TrustedToolApproval,
285
+ UpstreamError,
225
286
  WebhookCommand,
226
287
  WebhookRequestData,
227
288
  WebhookResponseData,
@@ -243,18 +304,34 @@ export {
243
304
  WorkflowValue,
244
305
  approvalElicitation,
245
306
  defaultElicitationLimits,
307
+ defaultEventLimits,
246
308
  defaultMcpClientLimits,
247
309
  defaultWebhookTransportLimits,
248
310
  frameworkProtocol,
249
311
  indexCommand,
250
312
  inspectCommand,
313
+ maxApiErrorInstructionsLength,
314
+ maxApiErrorMessageLength,
315
+ maxFailureFieldLength,
316
+ maxFailureFields,
251
317
  maxFailureMessageLength,
252
318
  maxInputProblems,
319
+ maxUpstreamMessageLength,
253
320
  minimumIntervalMilliseconds,
321
+ networkRefusalHeader,
322
+ networkRefusalResponse,
323
+ networkRefusalStatus,
254
324
  protocol1,
325
+ protocol10,
326
+ current as protocol11,
255
327
  protocol2,
256
328
  protocol3,
257
329
  protocol4,
330
+ protocol5,
331
+ protocol6,
332
+ protocol7,
333
+ protocol8,
334
+ protocol9,
258
335
  selectTools,
259
336
  skillCatalog,
260
337
  skillFormatLimits,
package/js/effect.js CHANGED
@@ -3,36 +3,36 @@ import {
3
3
  ApprovalDecision,
4
4
  createAppHandler,
5
5
  prepareElicitation
6
- } from "./chunk-SB4HEPNJ.js";
7
- import "./chunk-NKLWZJLE.js";
8
- import "./chunk-MNMNLXBL.js";
9
- import "./chunk-IPI4MFSN.js";
10
- import "./chunk-OE3QQTSB.js";
11
- import "./chunk-ZQINWV4W.js";
12
- import "./chunk-T7GKZBLP.js";
13
- import "./chunk-MKWZPDR6.js";
6
+ } from "./chunk-MZNCLCGJ.js";
7
+ import "./chunk-AQU56EPI.js";
8
+ import "./chunk-ZYTA5MK4.js";
9
+ import "./chunk-NS3DEHVA.js";
10
+ import "./chunk-XBG7HHXC.js";
11
+ import "./chunk-ERJ5JGCB.js";
12
+ import "./chunk-JIU25DIL.js";
13
+ import "./chunk-T53665H5.js";
14
14
  import {
15
15
  ToolAnnotations
16
- } from "./chunk-B3EOZTK3.js";
17
- import "./chunk-N7YDVXYJ.js";
18
- import "./chunk-R3EV5FTO.js";
19
- import "./chunk-JU7VHODU.js";
20
- import "./chunk-RJDDBDSN.js";
21
- import "./chunk-57RKNWL2.js";
22
- import "./chunk-UK573G7W.js";
16
+ } from "./chunk-TLWLJ7PD.js";
17
+ import "./chunk-MWKHKOTL.js";
18
+ import "./chunk-H72MEDMN.js";
23
19
  import {
24
20
  compileJsonSchemaDecoder,
25
21
  decoderOf,
26
22
  jsonSchemaDecoder,
27
23
  wrap
28
- } from "./chunk-5T57N25Q.js";
29
- import "./chunk-PZB6T6KU.js";
24
+ } from "./chunk-KGCTYL2S.js";
25
+ import "./chunk-FFSO3J76.js";
26
+ import "./chunk-PD6I2SDG.js";
27
+ import "./chunk-5FHWNLCI.js";
30
28
  import {
31
29
  HttpUrl,
32
30
  JsonObject,
33
31
  ValidationError
34
- } from "./chunk-27F7W2LG.js";
35
- import "./chunk-CDL5PM2Q.js";
32
+ } from "./chunk-H2CJWXA3.js";
33
+ import "./chunk-TUMGL2OC.js";
34
+ import "./chunk-EOPQ727L.js";
35
+ import "./chunk-IFJU5SYQ.js";
36
36
  import "./chunk-CZ7CSFO4.js";
37
37
  export {
38
38
  ApprovalDecision,