apps 0.0.1-beta.0 → 0.0.1-beta.2

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 (114) hide show
  1. package/README.md +97 -4
  2. package/framework-reference.json +1 -1
  3. package/js/browser-XIPJGLH2.js +65 -0
  4. package/js/{chunk-SBKHUC5L.js → chunk-4LPG6RCH.js} +2 -2
  5. package/js/chunk-5MQZEB6Y.js +172 -0
  6. package/js/{chunk-7JXHF5IF.js → chunk-BMOIAIVR.js} +1 -1
  7. package/js/chunk-CZ7CSFO4.js +39 -0
  8. package/js/chunk-D47C7KG5.js +172 -0
  9. package/js/{chunk-YDR4CPJA.js → chunk-EVJUVWN2.js} +8 -8
  10. package/js/chunk-FDNTX5QJ.js +78 -0
  11. package/js/{chunk-2OTCEKL2.js → chunk-FW5HBOIK.js} +2352 -1493
  12. package/js/{chunk-EP6AEUZO.js → chunk-FZJOYIZO.js} +1 -1
  13. package/js/{chunk-VFUZI3NY.js → chunk-HDJH3RPR.js} +4 -4
  14. package/js/{chunk-WIDTG42X.js → chunk-HDTGZWP2.js} +79 -26
  15. package/js/{chunk-Q2FD5IBM.js → chunk-J7O55ZV7.js} +298 -37
  16. package/js/{chunk-X3YBZCJW.js → chunk-JN55AYQH.js} +8 -41
  17. package/js/chunk-LGIYBDWA.js +85 -0
  18. package/js/{chunk-D6BKYP2L.js → chunk-M6ZRRIBI.js} +4 -4
  19. package/js/{chunk-HP7E42X6.js → chunk-MYYEW3RA.js} +767 -249
  20. package/js/{chunk-3ANFZFCV.js → chunk-OHRT55C4.js} +15 -15
  21. package/js/{chunk-R6JMJSVT.js → chunk-PLCMJREA.js} +2 -2
  22. package/js/{chunk-C24KEZXR.js → chunk-PYUYJRSK.js} +36 -2
  23. package/js/{chunk-W7Q5EOTS.js → chunk-QKHR7BMF.js} +32 -32
  24. package/js/{chunk-KWTCHVLT.js → chunk-RN2MXB4R.js} +47 -51
  25. package/js/{chunk-36DNRFZQ.js → chunk-SATWJKN6.js} +1 -1
  26. package/js/chunk-SWPD52J7.js +35 -0
  27. package/js/{chunk-BKVL7XAJ.js → chunk-TE4KO4HI.js} +1 -1
  28. package/js/chunk-UVL56Z6E.js +6641 -0
  29. package/js/chunk-W7D7WVSY.js +18 -0
  30. package/js/{chunk-BPEFS4YF.js → chunk-WFSQXYUT.js} +109 -17
  31. package/js/chunk-YEJOQEII.js +104 -0
  32. package/js/{chunk-LOKGDT6B.js → chunk-Z5NMEGJN.js} +5 -4
  33. package/js/{chunk-OWD2YICM.js → chunk-ZCAMUXSG.js} +116 -87
  34. package/js/chunk-ZJWDMTE3.js +63 -0
  35. package/js/client.js +11 -11
  36. package/js/contracts.js +88 -25
  37. package/js/effect.js +21 -15
  38. package/js/es-APDZKREY.js +40968 -0
  39. package/js/graphql.js +224 -121
  40. package/js/host.js +76 -19
  41. package/js/index.js +193 -51
  42. package/js/mcp/effect.js +25 -17
  43. package/js/mcp/stdio.js +23 -17
  44. package/js/mcp.js +110 -24
  45. package/js/openapi.js +3045 -105
  46. package/js/operations/approval.js +1 -1
  47. package/js/react.js +4 -4
  48. package/js/skills/effect.js +11 -0
  49. package/js/skills.js +894 -0
  50. package/js/storage/facet.js +7 -7
  51. package/js/ui/auth/contracts.js +6 -6
  52. package/js/ui/auth.js +8 -8
  53. package/js/ui/contracts.js +5 -5
  54. package/js/ui/serving.js +12 -12
  55. package/package.json +9 -1
  56. package/runtime.json +1 -1
  57. package/types/app-cache/src/contracts/cache.d.ts +119 -0
  58. package/types/app-cache/src/index.d.ts +93 -0
  59. package/types/apps/src/contracts/api-response-error.d.ts +43 -0
  60. package/types/apps/src/contracts/app.d.ts +11 -0
  61. package/types/apps/src/contracts/cache.d.ts +44 -0
  62. package/types/apps/src/contracts/dynamic-skills.d.ts +10 -0
  63. package/types/apps/src/contracts/dynamic-tools.d.ts +13 -0
  64. package/types/apps/src/contracts/graphql.d.ts +18 -1
  65. package/types/apps/src/contracts/host.d.ts +54 -525
  66. package/types/apps/src/contracts/mcp.d.ts +3 -1
  67. package/types/apps/src/contracts/openapi-compile.d.ts +11 -0
  68. package/types/apps/src/contracts/openapi-document.d.ts +53 -0
  69. package/types/apps/src/contracts/openapi.d.ts +156 -30
  70. package/types/apps/src/contracts/protocol-version.d.ts +6 -0
  71. package/types/apps/src/contracts/protocols/1.d.ts +1575 -0
  72. package/types/apps/src/contracts/provider-error.d.ts +15 -0
  73. package/types/apps/src/contracts/provider.d.ts +18 -1
  74. package/types/apps/src/contracts/skills.d.ts +122 -0
  75. package/types/apps/src/contracts/swagger-client.d.ts +29 -0
  76. package/types/apps/src/graphql.d.ts +6 -6
  77. package/types/apps/src/host.d.ts +1 -0
  78. package/types/apps/src/implementation/account-operations.d.ts +122 -3
  79. package/types/apps/src/implementation/app.d.ts +1 -1
  80. package/types/apps/src/implementation/cache-session.d.ts +7 -0
  81. package/types/apps/src/implementation/cache.d.ts +8 -0
  82. package/types/apps/src/implementation/catalog-cache.d.ts +29 -0
  83. package/types/apps/src/implementation/dynamic-skills.d.ts +7 -0
  84. package/types/apps/src/implementation/dynamic-tools.d.ts +8 -0
  85. package/types/apps/src/implementation/elicitation.d.ts +12 -12
  86. package/types/apps/src/implementation/git.d.ts +25 -0
  87. package/types/apps/src/implementation/graphql-catalog.d.ts +10 -0
  88. package/types/apps/src/implementation/graphql.d.ts +81 -3
  89. package/types/apps/src/implementation/inflate.d.ts +16 -0
  90. package/types/apps/src/implementation/input-problems.d.ts +3 -0
  91. package/types/apps/src/implementation/mcp-call.d.ts +3 -2
  92. package/types/apps/src/implementation/mcp-catalog.d.ts +12 -0
  93. package/types/apps/src/implementation/mcp-client.d.ts +9 -8
  94. package/types/apps/src/implementation/mcp-stdio.d.ts +1 -1
  95. package/types/apps/src/implementation/mcp-tools.d.ts +6 -3
  96. package/types/apps/src/implementation/mcp.d.ts +39 -2
  97. package/types/apps/src/implementation/openapi-compile.d.ts +119 -0
  98. package/types/apps/src/implementation/openapi-document.d.ts +51 -0
  99. package/types/apps/src/implementation/openapi-names.d.ts +18 -0
  100. package/types/apps/src/implementation/openapi-request.d.ts +10 -4
  101. package/types/apps/src/implementation/openapi-source.d.ts +40 -0
  102. package/types/apps/src/implementation/openapi.d.ts +39 -3
  103. package/types/apps/src/implementation/provider-error.d.ts +10 -0
  104. package/types/apps/src/implementation/schema.d.ts +6 -5
  105. package/types/apps/src/implementation/skill-files.d.ts +10 -0
  106. package/types/apps/src/implementation/skills.d.ts +43 -0
  107. package/types/apps/src/implementation/swagger-client.d.ts +28 -0
  108. package/types/apps/src/index.d.ts +7 -0
  109. package/types/apps/src/mcp.d.ts +5 -5
  110. package/types/apps/src/openapi.d.ts +3 -1
  111. package/types/apps/src/skills.d.ts +75 -0
  112. package/types/telemetry/src/config.d.ts +2 -0
  113. package/js/chunk-22WRQZT7.js +0 -389
  114. package/js/chunk-MLKGABMK.js +0 -9
@@ -19,10 +19,10 @@ import {
19
19
  text,
20
20
  uint8Array,
21
21
  urlParams
22
- } from "./chunk-W7Q5EOTS.js";
22
+ } from "./chunk-QKHR7BMF.js";
23
23
  import {
24
24
  JsonValue
25
- } from "./chunk-36DNRFZQ.js";
25
+ } from "./chunk-SATWJKN6.js";
26
26
  import {
27
27
  Cause,
28
28
  Defect,
@@ -118,12 +118,12 @@ import {
118
118
  transformEffect,
119
119
  transformPull,
120
120
  void_2 as void_
121
- } from "./chunk-2OTCEKL2.js";
121
+ } from "./chunk-FW5HBOIK.js";
122
122
  import {
123
123
  __export
124
- } from "./chunk-MLKGABMK.js";
124
+ } from "./chunk-CZ7CSFO4.js";
125
125
 
126
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b0796b742bddeb797269d/node_modules/effect/dist/unstable/httpapi/HttpApi.js
126
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/httpapi/HttpApi.js
127
127
  var HttpApi_exports = {};
128
128
  __export(HttpApi_exports, {
129
129
  AdditionalSchemas: () => AdditionalSchemas,
@@ -133,7 +133,7 @@ __export(HttpApi_exports, {
133
133
  reflect: () => reflect
134
134
  });
135
135
 
136
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b0796b742bddeb797269d/node_modules/effect/dist/unstable/httpapi/HttpApiEndpoint.js
136
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/httpapi/HttpApiEndpoint.js
137
137
  var HttpApiEndpoint_exports = {};
138
138
  __export(HttpApiEndpoint_exports, {
139
139
  delete: () => del,
@@ -151,7 +151,7 @@ __export(HttpApiEndpoint_exports, {
151
151
  query: () => query
152
152
  });
153
153
 
154
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b0796b742bddeb797269d/node_modules/effect/dist/unstable/httpapi/HttpApiSchema.js
154
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/httpapi/HttpApiSchema.js
155
155
  var HttpApiSchema_exports = {};
156
156
  __export(HttpApiSchema_exports, {
157
157
  Accepted: () => Accepted,
@@ -192,7 +192,7 @@ __export(HttpApiSchema_exports, {
192
192
  withHeaders: () => withHeaders
193
193
  });
194
194
 
195
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b0796b742bddeb797269d/node_modules/effect/dist/unstable/encoding/Sse.js
195
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/encoding/Sse.js
196
196
  var SseErrorTypeId = "~effect/encoding/Sse/SseError";
197
197
  var EventTooLarge = class extends (/* @__PURE__ */ TaggedError("EventTooLarge")) {
198
198
  get message() {
@@ -425,7 +425,7 @@ var Retry = class _Retry extends (/* @__PURE__ */ TaggedClass("Retry")) {
425
425
  }
426
426
  };
427
427
 
428
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b0796b742bddeb797269d/node_modules/effect/dist/unstable/httpapi/HttpApiSchema.js
428
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/httpapi/HttpApiSchema.js
429
429
  var StreamSchemaTypeId = "~effect/httpapi/HttpApiSchema/Stream";
430
430
  function status(code) {
431
431
  const statusCode = typeof code === "string" ? fromLiteral(code) : code;
@@ -655,14 +655,14 @@ function getStatusErrorSchema(schema) {
655
655
  return getStatusError(schema.ast);
656
656
  }
657
657
 
658
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b0796b742bddeb797269d/node_modules/effect/dist/unstable/httpapi/internal/mediaType.js
658
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/httpapi/internal/mediaType.js
659
659
  function normalize(contentType) {
660
660
  const normalized = contentType.toLowerCase().trim();
661
661
  const index = normalized.indexOf(";");
662
662
  return index === -1 ? normalized : normalized.slice(0, index).trim();
663
663
  }
664
664
 
665
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b0796b742bddeb797269d/node_modules/effect/dist/unstable/httpapi/HttpApiEndpoint.js
665
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/httpapi/HttpApiEndpoint.js
666
666
  var TypeId = "~effect/httpapi/HttpApiEndpoint";
667
667
  var isHttpApiEndpoint = (u) => hasProperty(u, TypeId);
668
668
  function getPayloadSchemas(endpoint2) {
@@ -989,7 +989,7 @@ var del = /* @__PURE__ */ make3("DELETE");
989
989
  var head = /* @__PURE__ */ make3("HEAD");
990
990
  var options = /* @__PURE__ */ make3("OPTIONS");
991
991
 
992
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b0796b742bddeb797269d/node_modules/effect/dist/unstable/httpapi/HttpApi.js
992
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/httpapi/HttpApi.js
993
993
  var TypeId2 = "~effect/httpapi/HttpApi";
994
994
  var isHttpApi = (u) => hasProperty(u, TypeId2);
995
995
  var Proto2 = {
@@ -1109,7 +1109,7 @@ var AdditionalSchemas = class extends (/* @__PURE__ */ Service()("effect/httpapi
1109
1109
  var ParseOptions = class extends (/* @__PURE__ */ Service()("effect/httpapi/HttpApi/ParseOptions")) {
1110
1110
  };
1111
1111
 
1112
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b0796b742bddeb797269d/node_modules/effect/dist/unstable/httpapi/internal/path.js
1112
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/httpapi/internal/path.js
1113
1113
  var emptyParamNames = /* @__PURE__ */ new Set();
1114
1114
  function getParamNames(schema) {
1115
1115
  if (schema === void 0) return emptyParamNames;
@@ -1117,7 +1117,7 @@ function getParamNames(schema) {
1117
1117
  return isObjects(ast) && ast.indexSignatures.length === 0 ? new Set(ast.propertySignatures.map((ps) => String(ps.name))) : void 0;
1118
1118
  }
1119
1119
 
1120
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b0796b742bddeb797269d/node_modules/effect/dist/unstable/httpapi/HttpApiClient.js
1120
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/httpapi/HttpApiClient.js
1121
1121
  var HttpApiClient_exports = {};
1122
1122
  __export(HttpApiClient_exports, {
1123
1123
  endpoint: () => endpoint,
@@ -1632,7 +1632,7 @@ function getEncodePayloadSchemaFromBody(schema, method) {
1632
1632
  return out;
1633
1633
  }
1634
1634
 
1635
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b0796b742bddeb797269d/node_modules/effect/dist/unstable/httpapi/HttpApiGroup.js
1635
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/httpapi/HttpApiGroup.js
1636
1636
  var HttpApiGroup_exports = {};
1637
1637
  __export(HttpApiGroup_exports, {
1638
1638
  isHttpApiGroup: () => isHttpApiGroup,
@@ -9,14 +9,14 @@ import {
9
9
  RowMetadata,
10
10
  defaultDatabaseLimits,
11
11
  defaultDatabaseRuntimeLimits
12
- } from "./chunk-7JXHF5IF.js";
12
+ } from "./chunk-BMOIAIVR.js";
13
13
  import {
14
14
  Clock_exports,
15
15
  Effect_exports,
16
16
  Encoding_exports,
17
17
  Schema_exports,
18
18
  Semaphore_exports
19
- } from "./chunk-2OTCEKL2.js";
19
+ } from "./chunk-FW5HBOIK.js";
20
20
 
21
21
  // ../app-data/src/implementation/schema.ts
22
22
  var metadata = /* @__PURE__ */ new Set(["id", "createdAt", "updatedAt"]);
@@ -1,9 +1,41 @@
1
1
  import {
2
2
  decoderOf
3
- } from "./chunk-BPEFS4YF.js";
3
+ } from "./chunk-WFSQXYUT.js";
4
4
  import {
5
5
  Effect_exports
6
- } from "./chunk-2OTCEKL2.js";
6
+ } from "./chunk-FW5HBOIK.js";
7
+
8
+ // src/implementation/authoring.ts
9
+ var NativeCallback = /* @__PURE__ */ Symbol("apps.NativeCallback");
10
+ var fromPromise = (callback) => (...args) => {
11
+ if (NativeCallback in callback) {
12
+ const native = callback[NativeCallback];
13
+ return native(...args);
14
+ }
15
+ return Effect_exports.tryPromise({ try: () => callback(...args), catch: (error) => error });
16
+ };
17
+ var toPromise = (operation, signal) => {
18
+ const native = (...args) => Effect_exports.suspend(() => {
19
+ if (signal === void 0) return operation(...args);
20
+ if (signal.aborted) return Effect_exports.interrupt;
21
+ const cancelled = Effect_exports.callback((resume) => {
22
+ if (signal.aborted) {
23
+ resume(Effect_exports.interrupt);
24
+ return;
25
+ }
26
+ const abort = () => resume(Effect_exports.interrupt);
27
+ signal.addEventListener("abort", abort, { once: true });
28
+ return Effect_exports.sync(() => signal.removeEventListener("abort", abort));
29
+ });
30
+ return Effect_exports.raceFirst(
31
+ cancelled,
32
+ Effect_exports.suspend(() => operation(...args))
33
+ );
34
+ });
35
+ return Object.assign((...args) => Effect_exports.runPromise(native(...args)), {
36
+ [NativeCallback]: native
37
+ });
38
+ };
7
39
 
8
40
  // src/implementation/operations.ts
9
41
  var NativeOperation = /* @__PURE__ */ Symbol("apps.Operation");
@@ -51,6 +83,8 @@ var query = (options, run) => make("query", options, run);
51
83
  var mutation = (options, run) => make("mutation", options, run);
52
84
 
53
85
  export {
86
+ fromPromise,
87
+ toPromise,
54
88
  operationDeclaration,
55
89
  nativeOperation,
56
90
  withApproval,
@@ -211,12 +211,12 @@ import {
211
211
  withFiber,
212
212
  withParentSpan,
213
213
  zero2 as zero
214
- } from "./chunk-2OTCEKL2.js";
214
+ } from "./chunk-FW5HBOIK.js";
215
215
  import {
216
216
  __export
217
- } from "./chunk-MLKGABMK.js";
217
+ } from "./chunk-CZ7CSFO4.js";
218
218
 
219
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b0796b742bddeb797269d/node_modules/effect/dist/unstable/http/HttpClientRequest.js
219
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/http/HttpClientRequest.js
220
220
  var HttpClientRequest_exports = {};
221
221
  __export(HttpClientRequest_exports, {
222
222
  accept: () => accept,
@@ -269,7 +269,7 @@ __export(HttpClientRequest_exports, {
269
269
  updateUrl: () => updateUrl
270
270
  });
271
271
 
272
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b0796b742bddeb797269d/node_modules/effect/dist/unstable/http/HttpBody.js
272
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/http/HttpBody.js
273
273
  var HttpBody_exports = {};
274
274
  __export(HttpBody_exports, {
275
275
  Empty: () => Empty,
@@ -500,11 +500,11 @@ var fileContentLength = /* @__PURE__ */ fnUntraced(function* (size, method, opti
500
500
  var file = (path, options3) => flatMap(FileSystem, (fs) => flatMap(fs.stat(path), (info) => map(fileContentLength(info.size, "file", options3), (contentLength) => stream(fs.stream(path, options3), options3?.contentType, contentLength))));
501
501
  var fileFromInfo = (path, info, options3) => flatMap(FileSystem, (fs) => map(fileContentLength(info.size, "fileFromInfo", options3), (contentLength) => stream(fs.stream(path, options3), options3?.contentType, contentLength)));
502
502
 
503
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b0796b742bddeb797269d/node_modules/effect/dist/unstable/http/HttpMethod.js
503
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/http/HttpMethod.js
504
504
  var hasBody = (method) => method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE";
505
505
  var allShort = [["GET", "get"], ["POST", "post"], ["PUT", "put"], ["DELETE", "del"], ["PATCH", "patch"], ["HEAD", "head"], ["OPTIONS", "options"], ["TRACE", "trace"], ["QUERY", "query"]];
506
506
 
507
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b0796b742bddeb797269d/node_modules/effect/dist/unstable/http/internal/httpBody.js
507
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/http/internal/httpBody.js
508
508
  var updateHeaders = (headers, body) => {
509
509
  if (body._tag === "Empty" || body._tag === "FormData") {
510
510
  return remove2(remove2(headers, "content-type"), "content-length");
@@ -520,7 +520,7 @@ var parseContentLength = (contentLength) => {
520
520
  return Number.isSafeInteger(parsed) ? parsed : void 0;
521
521
  };
522
522
 
523
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b0796b742bddeb797269d/node_modules/effect/dist/unstable/http/Url.js
523
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/http/Url.js
524
524
  var UrlError = class extends (/* @__PURE__ */ TaggedError("UrlError")) {
525
525
  };
526
526
  var make = (url, params, hash) => try_({
@@ -548,7 +548,7 @@ var baseUrl = () => {
548
548
  return void 0;
549
549
  };
550
550
 
551
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b0796b742bddeb797269d/node_modules/effect/dist/unstable/http/HttpClientRequest.js
551
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/http/HttpClientRequest.js
552
552
  var TypeId2 = "~effect/http/HttpClientRequest";
553
553
  var isHttpClientRequest = (u) => hasProperty(u, TypeId2);
554
554
  var Proto2 = {
@@ -758,7 +758,7 @@ var toWeb = (self, options3) => contextWith((context2) => fromResult(toWebResult
758
758
  signal: options3?.signal
759
759
  })));
760
760
 
761
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b0796b742bddeb797269d/node_modules/effect/dist/unstable/http/HttpClient.js
761
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/http/HttpClient.js
762
762
  var HttpClient_exports = {};
763
763
  __export(HttpClient_exports, {
764
764
  HttpClient: () => HttpClient,
@@ -803,7 +803,7 @@ __export(HttpClient_exports, {
803
803
  withScope: () => withScope
804
804
  });
805
805
 
806
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b0796b742bddeb797269d/node_modules/effect/dist/unstable/http/HttpClientError.js
806
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/http/HttpClientError.js
807
807
  var HttpClientError_exports = {};
808
808
  __export(HttpClientError_exports, {
809
809
  DecodeError: () => DecodeError,
@@ -987,7 +987,7 @@ var HttpClientErrorSchema = class _HttpClientErrorSchema extends (/* @__PURE__ *
987
987
  }
988
988
  };
989
989
 
990
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b0796b742bddeb797269d/node_modules/effect/dist/unstable/http/HttpIncomingMessage.js
990
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/http/HttpIncomingMessage.js
991
991
  var TypeId4 = "~effect/http/HttpIncomingMessage";
992
992
  var schemaBodyJson2 = (schema, options3) => {
993
993
  const decode = decodeEffect(toCodecJson(schema));
@@ -1026,7 +1026,7 @@ var inspect = (self, that) => {
1026
1026
  return obj;
1027
1027
  };
1028
1028
 
1029
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b0796b742bddeb797269d/node_modules/effect/dist/unstable/http/HttpClientResponse.js
1029
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/http/HttpClientResponse.js
1030
1030
  var TypeId5 = "~effect/http/HttpClientResponse";
1031
1031
  var fromWeb2 = (request, source) => new WebHttpClientResponse(request, source);
1032
1032
  var filterStatus = /* @__PURE__ */ dual(2, (self, f) => suspend(() => f(self.status) ? succeed2(self) : fail3(new HttpClientError({
@@ -1166,7 +1166,7 @@ var WebHttpClientResponse = class extends Class {
1166
1166
  }
1167
1167
  };
1168
1168
 
1169
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b0796b742bddeb797269d/node_modules/effect/dist/unstable/http/HttpTraceContext.js
1169
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/http/HttpTraceContext.js
1170
1170
  var HttpTraceContext_exports = {};
1171
1171
  __export(HttpTraceContext_exports, {
1172
1172
  b3: () => b3,
@@ -1245,7 +1245,7 @@ var w3c = (headers) => {
1245
1245
  }
1246
1246
  };
1247
1247
 
1248
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b0796b742bddeb797269d/node_modules/effect/dist/unstable/http/HttpClient.js
1248
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/http/HttpClient.js
1249
1249
  var TypeId6 = "~effect/http/HttpClient";
1250
1250
  var isHttpClient = (u) => hasProperty(u, TypeId6);
1251
1251
  var HttpClient = /* @__PURE__ */ Service("effect/HttpClient");
@@ -1745,7 +1745,7 @@ var isTransientHttpError = (error) => isHttpClientError(error) && (error.reason.
1745
1745
  var isTooManyRequestsHttpClientError = (error) => isHttpClientError(error) && error.reason._tag === "StatusCodeError" && error.reason.response.status === 429;
1746
1746
  var isTransientResponse = (response) => response.status === 408 || response.status === 429 || response.status === 500 || response.status === 502 || response.status === 503 || response.status === 504;
1747
1747
 
1748
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b0796b742bddeb797269d/node_modules/effect/dist/unstable/http/Template.js
1748
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/http/Template.js
1749
1749
  function make4(strings, ...args) {
1750
1750
  const argsLength = args.length;
1751
1751
  const values = new Array(argsLength);
@@ -1839,7 +1839,7 @@ function isSuccess2(u) {
1839
1839
  return isExit(u) && u._tag === "Success";
1840
1840
  }
1841
1841
 
1842
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b0796b742bddeb797269d/node_modules/effect/dist/unstable/http/HttpServerResponse.js
1842
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/http/HttpServerResponse.js
1843
1843
  var HttpServerResponse_exports = {};
1844
1844
  __export(HttpServerResponse_exports, {
1845
1845
  empty: () => empty9,
@@ -1881,11 +1881,11 @@ __export(HttpServerResponse_exports, {
1881
1881
  urlParams: () => urlParams2
1882
1882
  });
1883
1883
 
1884
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b0796b742bddeb797269d/node_modules/effect/dist/unstable/http/internal/headers.js
1884
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/http/internal/headers.js
1885
1885
  var Proto4 = /* @__PURE__ */ Object.getPrototypeOf(empty4);
1886
1886
  var emptyMutableUnsafe = () => Object.create(Proto4);
1887
1887
 
1888
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b0796b742bddeb797269d/node_modules/effect/dist/unstable/http/HttpServerResponse.js
1888
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/http/HttpServerResponse.js
1889
1889
  var TypeId7 = "~effect/http/HttpServerResponse";
1890
1890
  var isHttpServerResponse = (u) => hasProperty(u, TypeId7);
1891
1891
  var empty9 = (options3) => makeResponse({
@@ -2413,10 +2413,10 @@ var fromWeb3 = (response) => {
2413
2413
  return self;
2414
2414
  };
2415
2415
 
2416
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b0796b742bddeb797269d/node_modules/effect/dist/unstable/http/HttpServerRespondable.js
2416
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/http/HttpServerRespondable.js
2417
2417
  var symbol = "~effect/http/HttpServerRespondable";
2418
2418
 
2419
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b0796b742bddeb797269d/node_modules/effect/dist/unstable/http/HttpServerError.js
2419
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/http/HttpServerError.js
2420
2420
  var TypeId8 = "~effect/http/HttpServerError";
2421
2421
  var HttpServerError = class extends (/* @__PURE__ */ TaggedError("HttpServerError")) {
2422
2422
  constructor(props) {
@@ -2516,7 +2516,7 @@ var formatRequestMessage = (reason, description, info) => {
2516
2516
  return description ? `${prefix}: ${description}` : prefix;
2517
2517
  };
2518
2518
 
2519
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b0796b742bddeb797269d/node_modules/effect/dist/unstable/http/MultipartParser/internal/contentType.js
2519
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/http/MultipartParser/internal/contentType.js
2520
2520
  var paramRE = /; *([!#$%&'*+.^\w`|~-]+)=("(?:[\v\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u{10ffff}]|\\[\v\u0020-\u{10ffff}])*"|[!#$%&'*+.^\w`|~-]+) */gu;
2521
2521
  var quotedPairRE = /\\([\v\u0020-\u{10ffff}])/gu;
2522
2522
  var mediaTypeRE = /^[!#$%&'*+.^\w|~-]+\/[!#$%&'*+.^\w|~-]+$/u;
@@ -2567,7 +2567,7 @@ function parse(header, withoutSlash = false) {
2567
2567
  return result;
2568
2568
  }
2569
2569
 
2570
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b0796b742bddeb797269d/node_modules/effect/dist/unstable/http/MultipartParser/internal/headers.js
2570
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/http/MultipartParser/internal/headers.js
2571
2571
  var constMaxPairs = 100;
2572
2572
  var constMaxSize = 16 * 1024;
2573
2573
  var State = {
@@ -2772,7 +2772,7 @@ function make5() {
2772
2772
  };
2773
2773
  }
2774
2774
 
2775
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b0796b742bddeb797269d/node_modules/effect/dist/unstable/http/MultipartParser/internal/search.js
2775
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/http/MultipartParser/internal/search.js
2776
2776
  function makeState(needle_) {
2777
2777
  const needle = new TextEncoder().encode(needle_);
2778
2778
  const needleLength = needle.length;
@@ -2892,7 +2892,7 @@ function make6(needle, callback2, seed, minimumChunkLength) {
2892
2892
  };
2893
2893
  }
2894
2894
 
2895
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b0796b742bddeb797269d/node_modules/effect/dist/unstable/http/MultipartParser/internal/multipart.js
2895
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/http/MultipartParser/internal/multipart.js
2896
2896
  var State2 = {
2897
2897
  headers: 0,
2898
2898
  body: 1
@@ -3136,12 +3136,12 @@ function decodeField(info, value) {
3136
3136
  return getDecoder(info.contentTypeParameters.charset ?? "utf-8").decode(value);
3137
3137
  }
3138
3138
 
3139
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b0796b742bddeb797269d/node_modules/effect/dist/unstable/http/MultipartParser.js
3139
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/http/MultipartParser.js
3140
3140
  var make8 = make7;
3141
3141
  var defaultIsFile2 = defaultIsFile;
3142
3142
  var decodeField2 = decodeField;
3143
3143
 
3144
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b0796b742bddeb797269d/node_modules/effect/dist/unstable/http/Multipart.js
3144
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/http/Multipart.js
3145
3145
  var TypeId9 = "~effect/http/Multipart";
3146
3146
  var MultipartErrorTypeId = "~effect/http/Multipart/MultipartError";
3147
3147
  var toMultipartError = (cause) => hasProperty(cause, MultipartErrorTypeId) ? cause : MultipartError.fromReason("InternalError", cause);
@@ -3443,7 +3443,7 @@ var FieldMimeTypes = /* @__PURE__ */ Reference("effect/http/Multipart/FieldMimeT
3443
3443
  defaultValue: /* @__PURE__ */ constant(["application/json"])
3444
3444
  });
3445
3445
 
3446
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b0796b742bddeb797269d/node_modules/effect/dist/unstable/http/HttpServerRequest.js
3446
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/http/HttpServerRequest.js
3447
3447
  var HttpServerRequest_exports = {};
3448
3448
  __export(HttpServerRequest_exports, {
3449
3449
  HttpServerRequest: () => HttpServerRequest,
@@ -3468,7 +3468,7 @@ __export(HttpServerRequest_exports, {
3468
3468
  upgradeChannel: () => upgradeChannel
3469
3469
  });
3470
3470
 
3471
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b0796b742bddeb797269d/node_modules/effect/dist/unstable/socket/Socket.js
3471
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/socket/Socket.js
3472
3472
  var encoder2 = /* @__PURE__ */ new TextEncoder();
3473
3473
  var readerBytes = (self) => map(self.reader, ({
3474
3474
  pull
@@ -3639,7 +3639,7 @@ var toChannel = (self) => toChannelWithReader(self, readerBytes(self));
3639
3639
  var toChannelWith = () => (self) => toChannel(self);
3640
3640
  var defaultHighWaterMark = 64 * 1024;
3641
3641
 
3642
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b0796b742bddeb797269d/node_modules/effect/dist/unstable/http/HttpServerRequest.js
3642
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/http/HttpServerRequest.js
3643
3643
  var TypeId10 = "~effect/http/HttpServerRequest";
3644
3644
  var HttpServerRequest = /* @__PURE__ */ Service("effect/http/HttpServerRequest");
3645
3645
  var ParsedSearchParams = class extends (/* @__PURE__ */ Service()("effect/http/ParsedSearchParams")) {
@@ -4176,7 +4176,7 @@ var toWeb3 = (self, options3) => contextWith((context2) => fromResult(toWebResul
4176
4176
  signal: options3?.signal
4177
4177
  })));
4178
4178
 
4179
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b0796b742bddeb797269d/node_modules/effect/dist/unstable/http/HttpMiddleware.js
4179
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/http/HttpMiddleware.js
4180
4180
  var loggerDisabledRequests = /* @__PURE__ */ new WeakSet();
4181
4181
  var withLoggerDisabled = (self) => withFiber((fiber) => {
4182
4182
  const request = getUnsafe(fiber.context, HttpServerRequest);
@@ -4184,7 +4184,7 @@ var withLoggerDisabled = (self) => withFiber((fiber) => {
4184
4184
  return self;
4185
4185
  });
4186
4186
 
4187
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b0796b742bddeb797269d/node_modules/effect/dist/unstable/http/HttpRouter.js
4187
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/http/HttpRouter.js
4188
4188
  var HttpRouter = /* @__PURE__ */ Service("effect/http/HttpRouter");
4189
4189
  var removeTrailingSlash = (path) => path.endsWith("/") ? path.slice(0, -1) : path;
4190
4190
  var prefixPath = /* @__PURE__ */ dual(2, (self, prefix) => {
@@ -4266,7 +4266,7 @@ var getMiddleware = (context2) => {
4266
4266
  };
4267
4267
  var disableLogger = middleware(withLoggerDisabled).layer;
4268
4268
 
4269
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b0796b742bddeb797269d/node_modules/effect/dist/unstable/http/HttpStatus.js
4269
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/http/HttpStatus.js
4270
4270
  var codeByLiteral = {
4271
4271
  Continue: 100,
4272
4272
  SwitchingProtocols: 101,
@@ -1,28 +1,26 @@
1
1
  import {
2
2
  prepareElicitation
3
- } from "./chunk-Q2FD5IBM.js";
3
+ } from "./chunk-J7O55ZV7.js";
4
4
  import {
5
5
  fromPromise
6
- } from "./chunk-X3YBZCJW.js";
6
+ } from "./chunk-PYUYJRSK.js";
7
7
  import {
8
+ ElicitationFailed,
8
9
  McpError,
9
10
  McpToolMetadata,
10
11
  McpToolResult,
11
12
  ToolResultObservation,
13
+ defaultElicitationLimits,
12
14
  defaultMcpClientLimits,
13
15
  mcpSdkTimerCeilingMs
14
- } from "./chunk-22WRQZT7.js";
15
- import {
16
- ElicitationFailed,
17
- defaultElicitationLimits
18
- } from "./chunk-HP7E42X6.js";
16
+ } from "./chunk-MYYEW3RA.js";
19
17
  import {
20
18
  compileJsonSchemaDecoder,
21
19
  jsonSchemaDecoder
22
- } from "./chunk-BPEFS4YF.js";
20
+ } from "./chunk-WFSQXYUT.js";
23
21
  import {
24
22
  JsonObject
25
- } from "./chunk-36DNRFZQ.js";
23
+ } from "./chunk-SATWJKN6.js";
26
24
  import {
27
25
  Clock_exports,
28
26
  Deferred_exports,
@@ -31,54 +29,51 @@ import {
31
29
  Option_exports,
32
30
  Queue_exports,
33
31
  Schema_exports
34
- } from "./chunk-2OTCEKL2.js";
32
+ } from "./chunk-FW5HBOIK.js";
35
33
 
36
34
  // src/implementation/mcp-tools.ts
35
+ var adaptMcpTool = (client, tool) => Effect_exports.gen(function* () {
36
+ const decoder = yield* jsonSchemaDecoder(tool.inputSchema).pipe(
37
+ Effect_exports.mapError(() => new McpError({ phase: "schema", reason: "invalid_response" }))
38
+ );
39
+ const output = tool.outputSchema === void 0 ? void 0 : yield* Effect_exports.cached(
40
+ compileJsonSchemaDecoder(tool.outputSchema).pipe(
41
+ Effect_exports.mapError(() => new McpError({ phase: "schema", reason: "invalid_response" }))
42
+ )
43
+ );
44
+ const adapted = {
45
+ ...tool,
46
+ description: tool.description ?? tool.title ?? tool.name,
47
+ input: decoder,
48
+ ...tool.annotations?.readOnlyHint === void 0 ? {} : { readOnly: tool.annotations.readOnlyHint },
49
+ run: (context, input) => Effect_exports.gen(function* () {
50
+ const arguments_ = yield* Schema_exports.decodeUnknownEffect(decoder)(input).pipe(
51
+ Effect_exports.flatMap(Schema_exports.decodeUnknownEffect(JsonObject)),
52
+ Effect_exports.mapError(() => new McpError({ phase: "call", reason: "invalid_input" }))
53
+ );
54
+ const outputDecoder = output === void 0 ? void 0 : yield* output;
55
+ const result = yield* client.call(tool.name, arguments_, context);
56
+ if (result.isError === true) {
57
+ (yield* ToolResultObservation).failed();
58
+ yield* Effect_exports.annotateCurrentSpan({
59
+ "executor.outcome": "failed",
60
+ "error.type": "McpToolError"
61
+ });
62
+ }
63
+ if (outputDecoder !== void 0 && !result.isError)
64
+ yield* Schema_exports.decodeUnknownEffect(outputDecoder)(result.structuredContent).pipe(
65
+ Effect_exports.mapError(() => new McpError({ phase: "call", reason: "invalid_response" }))
66
+ );
67
+ return result;
68
+ })
69
+ };
70
+ return adapted;
71
+ });
37
72
  var adaptMcpTools = (client) => Effect_exports.gen(function* () {
38
73
  const metadata = yield* client.list;
39
74
  const entries = yield* Effect_exports.forEach(
40
75
  metadata,
41
- (tool) => Effect_exports.gen(function* () {
42
- const decoder = yield* jsonSchemaDecoder(tool.inputSchema).pipe(
43
- Effect_exports.mapError(() => new McpError({ phase: "schema", reason: "invalid_response" }))
44
- );
45
- const output = tool.outputSchema === void 0 ? void 0 : yield* Effect_exports.cached(
46
- compileJsonSchemaDecoder(tool.outputSchema).pipe(
47
- Effect_exports.mapError(
48
- () => new McpError({ phase: "schema", reason: "invalid_response" })
49
- )
50
- )
51
- );
52
- const adapted = {
53
- ...tool,
54
- description: tool.description ?? tool.title ?? tool.name,
55
- input: decoder,
56
- ...tool.annotations?.readOnlyHint === void 0 ? {} : { readOnly: tool.annotations.readOnlyHint },
57
- run: (context, input) => Effect_exports.gen(function* () {
58
- const arguments_ = yield* Schema_exports.decodeUnknownEffect(decoder)(input).pipe(
59
- Effect_exports.flatMap(Schema_exports.decodeUnknownEffect(JsonObject)),
60
- Effect_exports.mapError(() => new McpError({ phase: "call", reason: "invalid_input" }))
61
- );
62
- const outputDecoder = output === void 0 ? void 0 : yield* output;
63
- const result = yield* client.call(tool.name, arguments_, context);
64
- if (result.isError === true) {
65
- (yield* ToolResultObservation).failed();
66
- yield* Effect_exports.annotateCurrentSpan({
67
- "executor.outcome": "failed",
68
- "error.type": "McpToolError"
69
- });
70
- }
71
- if (outputDecoder !== void 0 && !result.isError)
72
- yield* Schema_exports.decodeUnknownEffect(outputDecoder)(result.structuredContent).pipe(
73
- Effect_exports.mapError(
74
- () => new McpError({ phase: "call", reason: "invalid_response" })
75
- )
76
- );
77
- return result;
78
- })
79
- };
80
- return [tool.name, adapted];
81
- })
76
+ (tool) => adaptMcpTool(client, tool).pipe(Effect_exports.map((adapted) => [tool.name, adapted]))
82
77
  );
83
78
  return Object.fromEntries(entries);
84
79
  });
@@ -278,6 +273,7 @@ function mcpClient(withClient, timeoutMs, failure) {
278
273
  }
279
274
 
280
275
  export {
276
+ adaptMcpTool,
281
277
  adaptMcpTools,
282
278
  mcpJsonSchemaValidator,
283
279
  mcpClient
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Schema_exports
3
- } from "./chunk-2OTCEKL2.js";
3
+ } from "./chunk-FW5HBOIK.js";
4
4
 
5
5
  // src/contracts/schema.ts
6
6
  var JsonValue = Schema_exports.Json;
@@ -0,0 +1,35 @@
1
+ import {
2
+ Schema_exports
3
+ } from "./chunk-FW5HBOIK.js";
4
+
5
+ // src/contracts/api-response-error.ts
6
+ var ApiErrorRecovery = Schema_exports.Struct({
7
+ action: Schema_exports.NonEmptyString.check(Schema_exports.isMaxLength(1024)),
8
+ instructions: Schema_exports.NonEmptyString.check(Schema_exports.isMaxLength(4096))
9
+ });
10
+ var ApiErrorResponse = Schema_exports.Struct({
11
+ code: Schema_exports.NonEmptyString.check(Schema_exports.isMaxLength(128)),
12
+ status: Schema_exports.Int.check(Schema_exports.isBetween({ minimum: 400, maximum: 599 })),
13
+ message: Schema_exports.NonEmptyString.check(Schema_exports.isMaxLength(4096)),
14
+ recovery: Schema_exports.optionalKey(ApiErrorRecovery)
15
+ });
16
+ var OpenapiResponseError = class extends Schema_exports.TaggedError()(
17
+ "OpenapiResponseError",
18
+ ApiErrorResponse.fields
19
+ ) {
20
+ };
21
+ var OpenapiErrorLimits = Schema_exports.Struct({
22
+ maxBodyBytes: Schema_exports.Int.check(Schema_exports.isGreaterThan(0)),
23
+ readTimeoutMs: Schema_exports.Int.check(Schema_exports.isGreaterThan(0))
24
+ });
25
+ var defaultOpenapiErrorLimits = OpenapiErrorLimits.make({
26
+ maxBodyBytes: 65536,
27
+ readTimeoutMs: 2e3
28
+ });
29
+
30
+ export {
31
+ ApiErrorRecovery,
32
+ ApiErrorResponse,
33
+ OpenapiResponseError,
34
+ defaultOpenapiErrorLimits
35
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  HttpServerResponse_exports
3
- } from "./chunk-W7Q5EOTS.js";
3
+ } from "./chunk-QKHR7BMF.js";
4
4
 
5
5
  // src/implementation/ui-auth.ts
6
6
  var appPrivateHeaders = {