apps 0.0.1-beta.27 → 0.0.1-beta.28

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 (40) hide show
  1. package/framework-reference.json +1 -1
  2. package/js/{chunk-3TEX4ZND.js → chunk-GLIAMV2R.js} +11 -11
  3. package/js/{chunk-TX2XCAL6.js → chunk-GQ7GCZ4J.js} +1 -1
  4. package/js/{chunk-7AZNPMQH.js → chunk-JN3PEGMW.js} +58 -3
  5. package/js/{chunk-HIJW4LWC.js → chunk-L76NWXM5.js} +13 -4
  6. package/js/{chunk-4OD7PHQL.js → chunk-MWCLJQRI.js} +2 -2
  7. package/js/{chunk-7R5JY5H7.js → chunk-TE2HPDZG.js} +91 -0
  8. package/js/{chunk-T2UFJKZR.js → chunk-VF3X26ZO.js} +2 -2
  9. package/js/{chunk-AHI26TO6.js → chunk-VIQQ52V7.js} +3 -3
  10. package/js/contracts.js +13 -1
  11. package/js/effect.js +5 -5
  12. package/js/graphql.js +13 -8
  13. package/js/host.js +5 -5
  14. package/js/index.js +7 -3
  15. package/js/mcp/effect.js +7 -7
  16. package/js/mcp/stdio.js +7 -7
  17. package/js/mcp.js +8 -8
  18. package/js/openapi.js +9 -5
  19. package/package.json +1 -1
  20. package/runtime.json +1 -1
  21. package/types/apps/src/contracts/graphql.d.ts +2 -1
  22. package/types/apps/src/contracts/host.d.ts +1 -0
  23. package/types/apps/src/contracts/mcp.d.ts +2 -1
  24. package/types/apps/src/contracts/network.d.ts +84 -0
  25. package/types/apps/src/contracts/openapi.d.ts +2 -1
  26. package/types/apps/src/implementation/elicitation.d.ts +8 -8
  27. package/types/apps/src/implementation/graphql.d.ts +4 -3
  28. package/types/apps/src/implementation/mcp-call.d.ts +3 -2
  29. package/types/apps/src/implementation/mcp-client.d.ts +7 -6
  30. package/types/apps/src/implementation/mcp-stdio.d.ts +1 -1
  31. package/types/apps/src/implementation/mcp-tools.d.ts +2 -1
  32. package/types/apps/src/implementation/mcp.d.ts +7 -6
  33. package/types/apps/src/implementation/network.d.ts +16 -0
  34. package/types/apps/src/implementation/openapi-compile.d.ts +1 -1
  35. package/types/apps/src/implementation/openapi-request.d.ts +2 -1
  36. package/types/apps/src/implementation/router-catalog.d.ts +6 -6
  37. package/types/apps/src/implementation/skills.d.ts +2 -2
  38. package/types/apps/src/index.d.ts +1 -0
  39. package/types/apps/src/mcp.d.ts +7 -7
  40. package/types/apps/src/skills.d.ts +4 -4
@@ -3,6 +3,7 @@ import {
3
3
  } from "./chunk-VUVBMNKC.js";
4
4
  import {
5
5
  accountSecrets,
6
+ appInvocationFetch,
6
7
  boundFailureMessage,
7
8
  describeFailure,
8
9
  failureDetail,
@@ -10,7 +11,7 @@ import {
10
11
  parseMcpError,
11
12
  readCatalog,
12
13
  routerSkills
13
- } from "./chunk-7AZNPMQH.js";
14
+ } from "./chunk-JN3PEGMW.js";
14
15
  import {
15
16
  folderSkillsEffect
16
17
  } from "./chunk-TSLG2WPA.js";
@@ -20,7 +21,7 @@ import {
20
21
  isApp,
21
22
  toEffectApp,
22
23
  unavailableStorage
23
- } from "./chunk-T2UFJKZR.js";
24
+ } from "./chunk-VF3X26ZO.js";
24
25
  import {
25
26
  parseDatabaseSchema
26
27
  } from "./chunk-XBQTJP76.js";
@@ -30,7 +31,7 @@ import {
30
31
  locate,
31
32
  nativeOperation,
32
33
  toPromise
33
- } from "./chunk-TX2XCAL6.js";
34
+ } from "./chunk-GQ7GCZ4J.js";
34
35
  import {
35
36
  accountProviderError,
36
37
  httpProviderError,
@@ -82,7 +83,7 @@ import {
82
83
  defaultWebhookTransportLimits,
83
84
  maxInputProblems,
84
85
  workflowDurationMillis
85
- } from "./chunk-7R5JY5H7.js";
86
+ } from "./chunk-TE2HPDZG.js";
86
87
  import {
87
88
  CacheError
88
89
  } from "./chunk-BRGF7VFN.js";
@@ -92,8 +93,7 @@ import {
92
93
  SkillLoadFailed
93
94
  } from "./chunk-NSBRV4FJ.js";
94
95
  import {
95
- captureTelemetry,
96
- invocationFetch
96
+ captureTelemetry
97
97
  } from "./chunk-YXKXKGN6.js";
98
98
  import {
99
99
  decoderOf,
@@ -505,7 +505,7 @@ var authorCache = (host, accounts, signal, deadline) => {
505
505
  ...options.staleFor === void 0 ? {} : { staleFor: options.staleFor },
506
506
  load: Effect_exports.acquireUseRelease(
507
507
  Effect_exports.sync(() => new AbortController()),
508
- (controller) => invocationFetch(controller.signal).pipe(
508
+ (controller) => appInvocationFetch(controller.signal).pipe(
509
509
  Effect_exports.flatMap(
510
510
  (fetch) => fromPromise(options.load)({
511
511
  fetch,
@@ -865,7 +865,7 @@ function dispatch(app, request, context, signal) {
865
865
  ),
866
866
  workflows: workflowReads,
867
867
  signal: invocationSignal,
868
- fetch: yield* invocationFetch(fetching.signal),
868
+ fetch: yield* appInvocationFetch(fetching.signal),
869
869
  elicit: makeElicit(delivery, invocationSignal)
870
870
  };
871
871
  const definition = yield* evaluationSafe(native.evaluate(bound), secrets).pipe(
@@ -942,7 +942,7 @@ function dispatch(app, request, context, signal) {
942
942
  signal2
943
943
  ),
944
944
  files,
945
- fetch: yield* invocationFetch(signal2),
945
+ fetch: yield* appInvocationFetch(signal2),
946
946
  signal: signal2,
947
947
  runId: execution.runId,
948
948
  stepId,
@@ -1080,7 +1080,7 @@ function dispatch(app, request, context, signal) {
1080
1080
  transactionOpen = db !== void 0;
1081
1081
  const output = yield* Effect_exports.gen(function* () {
1082
1082
  running = yield* captureTelemetry;
1083
- const fetch = yield* invocationFetch(fetching.signal);
1083
+ const fetch = yield* appInvocationFetch(fetching.signal);
1084
1084
  return yield* tool.run(
1085
1085
  {
1086
1086
  ...bound,
@@ -1175,7 +1175,7 @@ function checkAccount(slots, declared, requirement, context, signal, deadline) {
1175
1175
  () => Effect_exports.gen(function* () {
1176
1176
  return yield* health.run({
1177
1177
  account,
1178
- fetch: yield* invocationFetch(signal),
1178
+ fetch: yield* appInvocationFetch(signal),
1179
1179
  signal,
1180
1180
  ...deadline === void 0 ? {} : { deadline }
1181
1181
  });
@@ -3,7 +3,7 @@ import {
3
3
  RouterKey,
4
4
  RouterMeta,
5
5
  reservedRouterKeys
6
- } from "./chunk-7R5JY5H7.js";
6
+ } from "./chunk-TE2HPDZG.js";
7
7
  import {
8
8
  decoderOf
9
9
  } from "./chunk-YML53Z7H.js";
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  joinPath,
6
6
  mergeMeta
7
- } from "./chunk-TX2XCAL6.js";
7
+ } from "./chunk-GQ7GCZ4J.js";
8
8
  import {
9
9
  isShortenedUpstream,
10
10
  parseProviderError,
@@ -12,14 +12,21 @@ import {
12
12
  } from "./chunk-KQCMHI3K.js";
13
13
  import {
14
14
  ApiErrorResponse,
15
+ FetchOptionUnsupported,
15
16
  HostDeclarationInvalid,
16
17
  HostEvaluationFailed,
17
18
  HostedRouter,
18
19
  HostedTool,
19
20
  HostedToolSummary,
20
21
  McpCredentialsUnverified,
21
- McpError
22
- } from "./chunk-7R5JY5H7.js";
22
+ McpError,
23
+ NetworkRefused,
24
+ NetworkRefusedHeader,
25
+ RestrictedFetchOption,
26
+ networkRefusalHeader,
27
+ networkRefusalStatus,
28
+ supportedFetchOptions
29
+ } from "./chunk-TE2HPDZG.js";
23
30
  import {
24
31
  AppDatabaseError
25
32
  } from "./chunk-M2KEEOIQ.js";
@@ -36,6 +43,9 @@ import {
36
43
  SkillLoadFailed,
37
44
  skillFormatLimits
38
45
  } from "./chunk-NSBRV4FJ.js";
46
+ import {
47
+ invocationFetch
48
+ } from "./chunk-YXKXKGN6.js";
39
49
  import {
40
50
  jsonSchemaDocument
41
51
  } from "./chunk-YML53Z7H.js";
@@ -252,6 +262,35 @@ var OpenapiCompileError = class extends Schema_exports.TaggedError()(
252
262
  }
253
263
  };
254
264
 
265
+ // src/implementation/network.ts
266
+ var refusalHeader = (status, header) => status === networkRefusalStatus && header !== null && header !== void 0 ? header : void 0;
267
+ var failOnNetworkRefusal = (response) => {
268
+ const header = refusalHeader(response.status, response.headers[networkRefusalHeader]);
269
+ return header === void 0 ? Effect_exports.void : Schema_exports.decodeUnknownEffect(NetworkRefusedHeader)(header).pipe(
270
+ Effect_exports.orDie,
271
+ Effect_exports.flatMap(Effect_exports.fail)
272
+ );
273
+ };
274
+ var unsupportedOption = (init) => {
275
+ for (const option of RestrictedFetchOption.literals) {
276
+ const value = init?.[option];
277
+ const supported = supportedFetchOptions[option];
278
+ if (value !== void 0 && !supported.includes(value))
279
+ return new FetchOptionUnsupported({ option, value: String(value), supported });
280
+ }
281
+ return void 0;
282
+ };
283
+ var appFetch = (fetch) => async (input, init) => {
284
+ const unsupported = unsupportedOption(init);
285
+ if (unsupported !== void 0) throw unsupported;
286
+ const response = await fetch(input, init);
287
+ const header = refusalHeader(response.status, response.headers.get(networkRefusalHeader));
288
+ if (header === void 0) return response;
289
+ await response.body?.cancel();
290
+ throw Schema_exports.decodeUnknownSync(NetworkRefusedHeader)(header);
291
+ };
292
+ var appInvocationFetch = (signal) => invocationFetch(signal).pipe(Effect_exports.map(appFetch));
293
+
255
294
  // src/implementation/failure-detail.ts
256
295
  var storageMessages = {
257
296
  schema: "The app's database schema is invalid.",
@@ -437,6 +476,20 @@ var failureDetail = (error, secrets) => {
437
476
  code: error.code,
438
477
  message: boundFailureMessage(error.message, secrets)
439
478
  };
479
+ if (Schema_exports.is(NetworkRefused)(error))
480
+ return {
481
+ source: "app",
482
+ errorName: "NetworkRefused",
483
+ code: error.refusal.reason,
484
+ message: boundFailureMessage(error.message, secrets)
485
+ };
486
+ if (Schema_exports.is(FetchOptionUnsupported)(error))
487
+ return {
488
+ source: "app",
489
+ errorName: "FetchOptionUnsupported",
490
+ code: error.option,
491
+ message: boundFailureMessage(error.message, secrets)
492
+ };
440
493
  if (error instanceof Error) {
441
494
  const code = ownCode(error, secrets);
442
495
  const fields = ownFields(error, code, secrets);
@@ -714,6 +767,8 @@ export {
714
767
  parseMcpError,
715
768
  describeFailure,
716
769
  failureDetail,
770
+ failOnNetworkRefusal,
771
+ appInvocationFetch,
717
772
  operationDescription,
718
773
  fixedRouter,
719
774
  readCatalog,
@@ -3,7 +3,10 @@ import {
3
3
  answeredError,
4
4
  mcpClient,
5
5
  mcpJsonSchemaValidator
6
- } from "./chunk-AHI26TO6.js";
6
+ } from "./chunk-VIQQ52V7.js";
7
+ import {
8
+ failOnNetworkRefusal
9
+ } from "./chunk-JN3PEGMW.js";
7
10
  import {
8
11
  accountProviderError,
9
12
  bodyUpstreamError,
@@ -15,9 +18,10 @@ import {
15
18
  McpError,
16
19
  McpHealthInput,
17
20
  McpToolsOptions,
21
+ NetworkRefused,
18
22
  defaultMcpClientLimits,
19
23
  mcpHealthReserveMs
20
- } from "./chunk-7R5JY5H7.js";
24
+ } from "./chunk-TE2HPDZG.js";
21
25
  import {
22
26
  ProviderError
23
27
  } from "./chunk-BRGF7VFN.js";
@@ -59,7 +63,8 @@ import {
59
63
  } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
60
64
  var unreadable = (error) => error instanceof SyntaxError || error instanceof Error && Predicate_exports.hasProperty(error, "issues") && Array.isArray(error.issues);
61
65
  var failure = (phase, error) => {
62
- if (Schema_exports.is(ProviderError)(error) || Schema_exports.is(McpError)(error)) return error;
66
+ if (Schema_exports.is(ProviderError)(error) || Schema_exports.is(McpError)(error) || Schema_exports.is(NetworkRefused)(error))
67
+ return error;
63
68
  const code = error instanceof UnauthorizedError ? 401 : error instanceof StreamableHTTPError || error instanceof SseError ? error.code : void 0;
64
69
  if (code !== void 0 && code >= 300 && code <= 599)
65
70
  return httpProviderError(code) ?? new McpError({ phase, reason: "request", status: code });
@@ -115,6 +120,9 @@ var transportFetch = (connection, telemetry, rejected, answered) => (url, init)
115
120
  });
116
121
  const client = yield* HttpClient_exports.HttpClient;
117
122
  const response = yield* client.execute(request);
123
+ yield* failOnNetworkRefusal(response).pipe(
124
+ Effect_exports.tapError((refused) => Deferred_exports.fail(rejected, refused))
125
+ );
118
126
  if (response.status < 400)
119
127
  return new Response(
120
128
  [204, 205, 304].includes(response.status) ? null : Stream_exports.toReadableStream(response.stream),
@@ -308,7 +316,8 @@ var mcpHealthEffect = (check, options) => Effect_exports.gen(function* () {
308
316
  Effect_exports.flatMap((anonymous) => anonymous.check),
309
317
  Effect_exports.matchEffect({
310
318
  onSuccess: () => Effect_exports.fail(new McpCredentialsUnverified({ anonymous: "answered" })),
311
- onFailure: (error) => refusesCredentials(error) ? Effect_exports.void : Effect_exports.fail(new McpCredentialsUnverified({ anonymous: error }))
319
+ // Executor's network refused the attempt, so the server never answered it.
320
+ onFailure: (error) => Schema_exports.is(NetworkRefused)(error) ? Effect_exports.fail(error) : refusesCredentials(error) ? Effect_exports.void : Effect_exports.fail(new McpCredentialsUnverified({ anonymous: error }))
312
321
  }),
313
322
  Effect_exports.withSpan("provider.mcp.anonymous")
314
323
  );
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  fixedRouter
3
- } from "./chunk-7AZNPMQH.js";
3
+ } from "./chunk-JN3PEGMW.js";
4
4
  import {
5
5
  nativeOperation,
6
6
  operationDeclaration,
7
7
  routerDeclaration
8
- } from "./chunk-TX2XCAL6.js";
8
+ } from "./chunk-GQ7GCZ4J.js";
9
9
 
10
10
  // src/implementation/protocol-operations.ts
11
11
  var protocolOperations = (operations, kinds = {}) => {
@@ -226,6 +226,88 @@ var defaultOpenapiErrorLimits = OpenapiErrorLimits.make({
226
226
  readTimeoutMs: 2e3
227
227
  });
228
228
 
229
+ // src/contracts/network.ts
230
+ var NetworkRefusal = Schema_exports.Union([
231
+ Schema_exports.Struct({ reason: Schema_exports.Literal("private_address") }),
232
+ Schema_exports.Struct({
233
+ reason: Schema_exports.Literal("credential_host"),
234
+ /** The provider of the credential handle the request carried. */
235
+ provider: Schema_exports.String,
236
+ /** The hosts that provider's credentials may reach; empty when it declares none. */
237
+ allowedHosts: Schema_exports.Array(Schema_exports.String)
238
+ }),
239
+ Schema_exports.Struct({ reason: Schema_exports.Literal("credential_app") }),
240
+ Schema_exports.Struct({
241
+ reason: Schema_exports.Literal("credential_expired"),
242
+ /** The provider of the expired credential handle. */
243
+ provider: Schema_exports.String
244
+ })
245
+ ]);
246
+ var NetworkRefused = class extends Schema_exports.TaggedError()("NetworkRefused", {
247
+ /** The refused destination, with its port when the URL names one. */
248
+ host: Schema_exports.String,
249
+ refusal: NetworkRefusal
250
+ }) {
251
+ get message() {
252
+ const refusal = this.refusal;
253
+ switch (refusal.reason) {
254
+ case "private_address":
255
+ return `Executor refused a request to ${this.host}: apps on this instance can reach only public addresses, and ${this.host} is a private, loopback or internal address. The request was not sent.`;
256
+ case "credential_host":
257
+ return refusal.allowedHosts.length === 0 ? `Executor refused this request: ${refusal.provider} credentials cannot be sent to ${this.host}: the provider declares no hosts.` : `Executor refused this request: ${refusal.provider} credentials cannot be sent to ${this.host}. The provider allows: ${refusal.allowedHosts.join(", ")}.`;
258
+ case "credential_app":
259
+ return "Executor refused this request: it carries a credential handle that is not valid for this app. Use the account fields this invocation received.";
260
+ case "credential_expired":
261
+ return `Executor refused this request: it carries an expired ${refusal.provider} credential handle. Use the account fields this invocation received.`;
262
+ }
263
+ }
264
+ };
265
+ var networkRefusalStatus = 421;
266
+ var networkRefusalHeader = "x-executor-refused";
267
+ var NetworkRefusedHeader = Schema_exports.StringFromUriComponent.pipe(
268
+ Schema_exports.decodeTo(Schema_exports.fromJsonString(NetworkRefused))
269
+ );
270
+ var encodeRefusal = Schema_exports.encodeSync(NetworkRefused);
271
+ var encodeRefusalHeader = Schema_exports.encodeSync(NetworkRefusedHeader);
272
+ var networkRefusalResponse = (refused) => new Response(JSON.stringify({ ...encodeRefusal(refused), message: refused.message }), {
273
+ status: networkRefusalStatus,
274
+ statusText: "Refused by Executor",
275
+ headers: {
276
+ "content-type": "application/json; charset=utf-8",
277
+ [networkRefusalHeader]: encodeRefusalHeader(refused)
278
+ }
279
+ });
280
+ var RestrictedFetchOption = Schema_exports.Literals(["redirect", "cache", "integrity"]);
281
+ var supportedFetchOptions = {
282
+ redirect: ["follow", "manual"],
283
+ cache: ["no-store", "no-cache"],
284
+ integrity: [""]
285
+ };
286
+ var FetchOptionUnsupported = class extends Schema_exports.TaggedError()(
287
+ "FetchOptionUnsupported",
288
+ {
289
+ option: RestrictedFetchOption,
290
+ value: Schema_exports.String,
291
+ supported: Schema_exports.Array(Schema_exports.String)
292
+ }
293
+ ) {
294
+ get message() {
295
+ const supported = this.supported.map((value) => JSON.stringify(value)).join(" or ");
296
+ return `fetch option ${this.option}: ${JSON.stringify(this.value)} is not supported by Executor's app runtime. Use ${supported}, or omit ${this.option}.${this.advice}`;
297
+ }
298
+ /** What to do instead, when the standard value has an equivalent the runtime supports. */
299
+ get advice() {
300
+ switch (this.option) {
301
+ case "redirect":
302
+ return this.value === "error" ? ` To reject redirects, send redirect: "manual" and treat a 3xx response as the error.` : "";
303
+ case "cache":
304
+ return "";
305
+ case "integrity":
306
+ return " To check a digest, read the body and hash it with crypto.subtle.digest.";
307
+ }
308
+ }
309
+ };
310
+
229
311
  // src/contracts/workflows.ts
230
312
  var WorkflowRunId = Schema_exports.NonEmptyString.pipe(Schema_exports.brand("wfr"));
231
313
  var WorkflowName = Schema_exports.NonEmptyString.check(Schema_exports.isMaxLength(200));
@@ -2935,6 +3017,15 @@ var ToolResultObservation = Context_exports.Reference(
2935
3017
  );
2936
3018
 
2937
3019
  export {
3020
+ NetworkRefusal,
3021
+ NetworkRefused,
3022
+ networkRefusalStatus,
3023
+ networkRefusalHeader,
3024
+ NetworkRefusedHeader,
3025
+ networkRefusalResponse,
3026
+ RestrictedFetchOption,
3027
+ supportedFetchOptions,
3028
+ FetchOptionUnsupported,
2938
3029
  SecretsMethod,
2939
3030
  OAuthClientAuth,
2940
3031
  OAuthSecretClientAuth,
@@ -6,10 +6,10 @@ import {
6
6
  fromPromise,
7
7
  nativeOperation,
8
8
  nativeRouter
9
- } from "./chunk-TX2XCAL6.js";
9
+ } from "./chunk-GQ7GCZ4J.js";
10
10
  import {
11
11
  ScheduleTiming
12
- } from "./chunk-7R5JY5H7.js";
12
+ } from "./chunk-TE2HPDZG.js";
13
13
  import {
14
14
  DatabaseSchema
15
15
  } from "./chunk-M2KEEOIQ.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  prepareElicitation
3
- } from "./chunk-3TEX4ZND.js";
3
+ } from "./chunk-GLIAMV2R.js";
4
4
  import {
5
5
  fromPromise
6
- } from "./chunk-TX2XCAL6.js";
6
+ } from "./chunk-GQ7GCZ4J.js";
7
7
  import {
8
8
  bodyUpstreamError
9
9
  } from "./chunk-KQCMHI3K.js";
@@ -18,7 +18,7 @@ import {
18
18
  defaultElicitationLimits,
19
19
  defaultMcpClientLimits,
20
20
  mcpSdkTimerCeilingMs
21
- } from "./chunk-7R5JY5H7.js";
21
+ } from "./chunk-TE2HPDZG.js";
22
22
  import {
23
23
  jsonSchemaDecoder,
24
24
  nestJsonSchema,
package/js/contracts.js CHANGED
@@ -14,6 +14,7 @@ import {
14
14
  ElicitationLimits,
15
15
  ElicitationReply,
16
16
  ElicitationResponse,
17
+ FetchOptionUnsupported,
17
18
  FormElicitation,
18
19
  HostAccountCheckError,
19
20
  HostAccountsInvalid,
@@ -52,6 +53,8 @@ import {
52
53
  ManualWebhookSetup,
53
54
  McpClientLimits,
54
55
  McpError,
56
+ NetworkRefusal,
57
+ NetworkRefused,
55
58
  NonRetryableError,
56
59
  OAuthClientAuth,
57
60
  OAuthSecretClientAuth,
@@ -99,6 +102,9 @@ import {
99
102
  maxApiErrorMessageLength,
100
103
  maxInputProblems,
101
104
  minimumIntervalMilliseconds,
105
+ networkRefusalHeader,
106
+ networkRefusalResponse,
107
+ networkRefusalStatus,
102
108
  protocol1,
103
109
  protocol2,
104
110
  protocol3,
@@ -111,7 +117,7 @@ import {
111
117
  skillCatalog,
112
118
  skillsCommand,
113
119
  workflowDurationMillis
114
- } from "./chunk-7R5JY5H7.js";
120
+ } from "./chunk-TE2HPDZG.js";
115
121
  import {
116
122
  DatabaseFieldReserved,
117
123
  DatabaseLimitExceeded
@@ -191,6 +197,7 @@ export {
191
197
  FailureName,
192
198
  FailurePhase,
193
199
  FailureSource,
200
+ FetchOptionUnsupported,
194
201
  FormElicitation,
195
202
  HostAccountCheckError,
196
203
  HostAccountsInvalid,
@@ -230,6 +237,8 @@ export {
230
237
  ManualWebhookSetup,
231
238
  McpClientLimits,
232
239
  McpError,
240
+ NetworkRefusal,
241
+ NetworkRefused,
233
242
  NonRetryableError,
234
243
  OAuthClientAuth,
235
244
  OAuthSecretClientAuth,
@@ -289,6 +298,9 @@ export {
289
298
  maxInputProblems,
290
299
  maxUpstreamMessageLength,
291
300
  minimumIntervalMilliseconds,
301
+ networkRefusalHeader,
302
+ networkRefusalResponse,
303
+ networkRefusalStatus,
292
304
  protocol1,
293
305
  protocol2,
294
306
  protocol3,
package/js/effect.js CHANGED
@@ -3,17 +3,17 @@ import {
3
3
  ApprovalDecision,
4
4
  createAppHandler,
5
5
  prepareElicitation
6
- } from "./chunk-3TEX4ZND.js";
6
+ } from "./chunk-GLIAMV2R.js";
7
7
  import "./chunk-VUVBMNKC.js";
8
- import "./chunk-7AZNPMQH.js";
8
+ import "./chunk-JN3PEGMW.js";
9
9
  import "./chunk-TSLG2WPA.js";
10
- import "./chunk-T2UFJKZR.js";
10
+ import "./chunk-VF3X26ZO.js";
11
11
  import "./chunk-XBQTJP76.js";
12
- import "./chunk-TX2XCAL6.js";
12
+ import "./chunk-GQ7GCZ4J.js";
13
13
  import "./chunk-KQCMHI3K.js";
14
14
  import {
15
15
  ToolAnnotations
16
- } from "./chunk-7R5JY5H7.js";
16
+ } from "./chunk-TE2HPDZG.js";
17
17
  import "./chunk-M2KEEOIQ.js";
18
18
  import "./chunk-BRGF7VFN.js";
19
19
  import "./chunk-NSBRV4FJ.js";
package/js/graphql.js CHANGED
@@ -4,26 +4,30 @@ import {
4
4
  } from "./chunk-ZZOCEUTB.js";
5
5
  import {
6
6
  protocolOperations
7
- } from "./chunk-4OD7PHQL.js";
7
+ } from "./chunk-MWCLJQRI.js";
8
8
  import "./chunk-BCSNKUAC.js";
9
- import "./chunk-3TEX4ZND.js";
9
+ import "./chunk-GLIAMV2R.js";
10
10
  import {
11
11
  cacheKey
12
12
  } from "./chunk-VUVBMNKC.js";
13
- import "./chunk-7AZNPMQH.js";
13
+ import {
14
+ failOnNetworkRefusal
15
+ } from "./chunk-JN3PEGMW.js";
14
16
  import "./chunk-TSLG2WPA.js";
15
- import "./chunk-T2UFJKZR.js";
17
+ import "./chunk-VF3X26ZO.js";
16
18
  import "./chunk-XBQTJP76.js";
17
19
  import {
18
20
  nativeOperation,
19
21
  routerDeclaration
20
- } from "./chunk-TX2XCAL6.js";
22
+ } from "./chunk-GQ7GCZ4J.js";
21
23
  import {
22
24
  accountProviderError,
23
25
  graphqlProviderError,
24
26
  httpProviderError
25
27
  } from "./chunk-KQCMHI3K.js";
26
- import "./chunk-7R5JY5H7.js";
28
+ import {
29
+ NetworkRefused
30
+ } from "./chunk-TE2HPDZG.js";
27
31
  import "./chunk-M2KEEOIQ.js";
28
32
  import {
29
33
  ProviderError
@@ -269,6 +273,7 @@ var graphqlClientEffect = (input) => Effect_exports.gen(function* () {
269
273
  HttpClientRequest_exports.bodyJsonUnsafe({ query, variables })
270
274
  )
271
275
  );
276
+ yield* failOnNetworkRefusal(response);
272
277
  if (response.status < 200 || response.status >= 300)
273
278
  return yield* httpProviderError(response.status, response.headers) ?? new GraphqlError({ phase, reason: "request", status: response.status });
274
279
  const result = yield* response.json.pipe(
@@ -297,13 +302,13 @@ var graphqlClientEffect = (input) => Effect_exports.gen(function* () {
297
302
  orElse: () => Effect_exports.fail(new GraphqlError({ phase, reason: "timeout" }))
298
303
  }),
299
304
  Effect_exports.mapError(
300
- (error) => error instanceof ProviderError && options.accountId !== void 0 ? accountProviderError(error, options.accountId) : error instanceof GraphqlError || error instanceof ProviderError ? error : new GraphqlError({ phase, reason: "request" })
305
+ (error) => error instanceof ProviderError && options.accountId !== void 0 ? accountProviderError(error, options.accountId) : error instanceof GraphqlError || error instanceof ProviderError || error instanceof NetworkRefused ? error : new GraphqlError({ phase, reason: "request" })
301
306
  )
302
307
  );
303
308
  const discover = request("discover", getIntrospectionQuery()).pipe(
304
309
  Effect_exports.flatMap(Schema_exports.decodeUnknownEffect(GraphqlIntrospection)),
305
310
  Effect_exports.mapError(
306
- (error) => error instanceof GraphqlError || error instanceof ProviderError ? error : new GraphqlError({ phase: "discover", reason: "invalid_response" })
311
+ (error) => error instanceof GraphqlError || error instanceof ProviderError || error instanceof NetworkRefused ? error : new GraphqlError({ phase: "discover", reason: "invalid_response" })
307
312
  )
308
313
  );
309
314
  return { request, discover };
package/js/host.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  createAppHandler
3
- } from "./chunk-3TEX4ZND.js";
3
+ } from "./chunk-GLIAMV2R.js";
4
4
  import "./chunk-VUVBMNKC.js";
5
- import "./chunk-7AZNPMQH.js";
5
+ import "./chunk-JN3PEGMW.js";
6
6
  import "./chunk-TSLG2WPA.js";
7
- import "./chunk-T2UFJKZR.js";
7
+ import "./chunk-VF3X26ZO.js";
8
8
  import "./chunk-XBQTJP76.js";
9
- import "./chunk-TX2XCAL6.js";
9
+ import "./chunk-GQ7GCZ4J.js";
10
10
  import "./chunk-KQCMHI3K.js";
11
11
  import {
12
12
  ElicitationFailed,
@@ -21,7 +21,7 @@ import {
21
21
  WorkflowRun,
22
22
  WorkflowRunId,
23
23
  WorkflowRunPage
24
- } from "./chunk-7R5JY5H7.js";
24
+ } from "./chunk-TE2HPDZG.js";
25
25
  import "./chunk-M2KEEOIQ.js";
26
26
  import {
27
27
  CacheCommand,
package/js/index.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  defineDatabase,
6
6
  table,
7
7
  workflow
8
- } from "./chunk-T2UFJKZR.js";
8
+ } from "./chunk-VF3X26ZO.js";
9
9
  import "./chunk-XBQTJP76.js";
10
10
  import {
11
11
  dynamicRouter,
@@ -20,16 +20,18 @@ import {
20
20
  toolAnnotations,
21
21
  withApproval,
22
22
  withApprovals
23
- } from "./chunk-TX2XCAL6.js";
23
+ } from "./chunk-GQ7GCZ4J.js";
24
24
  import {
25
25
  accountProviderError
26
26
  } from "./chunk-KQCMHI3K.js";
27
27
  import {
28
28
  CalendarSchedule,
29
29
  ElicitationFailed,
30
+ FetchOptionUnsupported,
30
31
  HostedTool,
31
32
  HostedToolSummary,
32
33
  Interval,
34
+ NetworkRefused,
33
35
  NonRetryableError,
34
36
  OAuth2AccessToken,
35
37
  OAuth2Config,
@@ -38,7 +40,7 @@ import {
38
40
  ScheduleTiming,
39
41
  SecretsMethod,
40
42
  WorkflowFailure
41
- } from "./chunk-7R5JY5H7.js";
43
+ } from "./chunk-TE2HPDZG.js";
42
44
  import "./chunk-M2KEEOIQ.js";
43
45
  import {
44
46
  CacheError,
@@ -420,6 +422,8 @@ var decodeJson2 = (response, schema) => {
420
422
  export {
421
423
  CacheError,
422
424
  ElicitationFailed,
425
+ FetchOptionUnsupported,
426
+ NetworkRefused,
423
427
  NonRetryableError,
424
428
  NotImplemented,
425
429
  OAuth2AccessToken2 as OAuth2AccessToken,
package/js/mcp/effect.js CHANGED
@@ -2,18 +2,18 @@ import {
2
2
  mcpClientEffect,
3
3
  mcpHealthEffect,
4
4
  mcpToolsEffect
5
- } from "../chunk-HIJW4LWC.js";
6
- import "../chunk-AHI26TO6.js";
5
+ } from "../chunk-L76NWXM5.js";
6
+ import "../chunk-VIQQ52V7.js";
7
7
  import "../chunk-BCSNKUAC.js";
8
- import "../chunk-3TEX4ZND.js";
8
+ import "../chunk-GLIAMV2R.js";
9
9
  import "../chunk-VUVBMNKC.js";
10
- import "../chunk-7AZNPMQH.js";
10
+ import "../chunk-JN3PEGMW.js";
11
11
  import "../chunk-TSLG2WPA.js";
12
- import "../chunk-T2UFJKZR.js";
12
+ import "../chunk-VF3X26ZO.js";
13
13
  import "../chunk-XBQTJP76.js";
14
- import "../chunk-TX2XCAL6.js";
14
+ import "../chunk-GQ7GCZ4J.js";
15
15
  import "../chunk-KQCMHI3K.js";
16
- import "../chunk-7R5JY5H7.js";
16
+ import "../chunk-TE2HPDZG.js";
17
17
  import "../chunk-M2KEEOIQ.js";
18
18
  import "../chunk-BRGF7VFN.js";
19
19
  import "../chunk-NSBRV4FJ.js";