apps 0.0.1-beta.108 → 0.0.1-beta.109

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.
@@ -2,11 +2,11 @@ import {
2
2
  declaredOperations,
3
3
  nativeOperation,
4
4
  nativeRouter
5
- } from "./chunk-QXJPA2YB.js";
5
+ } from "./chunk-ZXG7RMCB.js";
6
6
  import {
7
7
  fromPromise,
8
8
  method
9
- } from "./chunk-AVDSIC3N.js";
9
+ } from "./chunk-OIH73VFM.js";
10
10
  import {
11
11
  EmittedEvent,
12
12
  EventName,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  prepareElicitation
3
- } from "./chunk-XYMLJ42M.js";
3
+ } from "./chunk-JCX2K2SI.js";
4
4
  import {
5
5
  failOnNetworkRefusal
6
6
  } from "./chunk-HLMJBE4T.js";
@@ -10,7 +10,7 @@ import {
10
10
  fromPromise,
11
11
  httpProviderError,
12
12
  providerErrorDetail
13
- } from "./chunk-AVDSIC3N.js";
13
+ } from "./chunk-OIH73VFM.js";
14
14
  import {
15
15
  ElicitationFailed,
16
16
  McpCredentialsUnverified,
@@ -4,12 +4,12 @@ import {
4
4
  import {
5
5
  joinPath,
6
6
  mergeMeta
7
- } from "./chunk-QXJPA2YB.js";
7
+ } from "./chunk-ZXG7RMCB.js";
8
8
  import {
9
9
  isShortenedStated,
10
10
  parseProviderError,
11
11
  providerError
12
- } from "./chunk-AVDSIC3N.js";
12
+ } from "./chunk-OIH73VFM.js";
13
13
  import {
14
14
  ApiErrorResponse,
15
15
  CacheError,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  authorCache,
3
3
  unavailableCache
4
- } from "./chunk-SEJBC5UM.js";
4
+ } from "./chunk-UPTAFF6L.js";
5
5
  import {
6
6
  accountSecrets,
7
7
  boundFailureMessage,
@@ -12,7 +12,7 @@ import {
12
12
  parseSkillLoadFailed,
13
13
  readCatalog,
14
14
  routerSkills
15
- } from "./chunk-GD2QMZMA.js";
15
+ } from "./chunk-BKIQCV72.js";
16
16
  import {
17
17
  appInvocationFetch
18
18
  } from "./chunk-HLMJBE4T.js";
@@ -26,12 +26,12 @@ import {
26
26
  makeEmitter,
27
27
  toEffectApp,
28
28
  withPlacements
29
- } from "./chunk-CWYIEXX2.js";
29
+ } from "./chunk-3BI34I5S.js";
30
30
  import {
31
31
  declaredOperations,
32
32
  locate,
33
33
  nativeOperation
34
- } from "./chunk-QXJPA2YB.js";
34
+ } from "./chunk-ZXG7RMCB.js";
35
35
  import {
36
36
  accountProviderError,
37
37
  appCode,
@@ -39,7 +39,7 @@ import {
39
39
  httpProviderError,
40
40
  parseProviderError,
41
41
  toPromise
42
- } from "./chunk-AVDSIC3N.js";
42
+ } from "./chunk-OIH73VFM.js";
43
43
  import {
44
44
  AccountCheckResult,
45
45
  DeclaredProvider,
@@ -71,15 +71,16 @@ var OAuthError = Schema_exports.Struct({
71
71
  var boundStated = (text, maximum) => text.length <= maximum ? text : `${text.slice(0, maximum - 1)}\u2026`;
72
72
  var isShortenedStated = (text, maximum) => text.length === maximum && text.endsWith("\u2026");
73
73
  var bounded = (message) => boundStated(message, maxUpstreamMessageLength);
74
- var stated = (code, message) => ({
74
+ var statedUpstream = (code, message) => ({
75
75
  code,
76
76
  ...message === void 0 || message === "" ? {} : { message: bounded(message) }
77
77
  });
78
78
  var bodyUpstreamError = (json) => {
79
79
  const nested = Schema_exports.decodeUnknownOption(NestedError)(json);
80
- if (Option_exports.isSome(nested)) return stated(nested.value.error.code, nested.value.error.message);
80
+ if (Option_exports.isSome(nested))
81
+ return statedUpstream(nested.value.error.code, nested.value.error.message);
81
82
  const oauth = Schema_exports.decodeUnknownOption(OAuthError)(json);
82
- if (Option_exports.isSome(oauth)) return stated(oauth.value.error, oauth.value.error_description);
83
+ if (Option_exports.isSome(oauth)) return statedUpstream(oauth.value.error, oauth.value.error_description);
83
84
  return void 0;
84
85
  };
85
86
  var authParam = /([A-Za-z][A-Za-z0-9_-]*)\s*=\s*(?:"((?:[^"\\]|\\.)*)"|([^\s,"]+))/g;
@@ -91,7 +92,7 @@ var challengeUpstreamError = (header) => {
91
92
  if (name !== void 0 && !params.has(name.toLowerCase()))
92
93
  params.set(name.toLowerCase(), quoted?.replace(/\\(.)/g, "$1") ?? token ?? "");
93
94
  const code = Schema_exports.decodeUnknownOption(ErrorToken)(params.get("error"));
94
- return Option_exports.isNone(code) ? void 0 : stated(code.value, params.get("error_description"));
95
+ return Option_exports.isNone(code) ? void 0 : statedUpstream(code.value, params.get("error_description"));
95
96
  };
96
97
 
97
98
  // src/implementation/provider-error.ts
@@ -163,6 +164,7 @@ export {
163
164
  toPromise,
164
165
  boundStated,
165
166
  isShortenedStated,
167
+ statedUpstream,
166
168
  bodyUpstreamError,
167
169
  providerError,
168
170
  parseProviderError,
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  fixedRouter
3
- } from "./chunk-GD2QMZMA.js";
3
+ } from "./chunk-BKIQCV72.js";
4
4
  import {
5
5
  nativeOperation,
6
6
  operationDeclaration,
7
7
  routerDeclaration
8
- } from "./chunk-QXJPA2YB.js";
8
+ } from "./chunk-ZXG7RMCB.js";
9
9
 
10
10
  // src/implementation/protocol-operations.ts
11
11
  var protocolOperations = (operations, kinds = {}) => {
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  getWithReads
3
- } from "./chunk-SEJBC5UM.js";
3
+ } from "./chunk-UPTAFF6L.js";
4
4
  import {
5
5
  fromPromise,
6
6
  method,
7
7
  toPromise
8
- } from "./chunk-AVDSIC3N.js";
8
+ } from "./chunk-OIH73VFM.js";
9
9
  import {
10
10
  CacheError
11
11
  } from "./chunk-2RGJMA7N.js";
@@ -5,7 +5,7 @@ import {
5
5
  fromPromise,
6
6
  method,
7
7
  toPromise
8
- } from "./chunk-AVDSIC3N.js";
8
+ } from "./chunk-OIH73VFM.js";
9
9
  import {
10
10
  CacheAcquired,
11
11
  CacheEntry,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  fromPromise
3
- } from "./chunk-AVDSIC3N.js";
3
+ } from "./chunk-OIH73VFM.js";
4
4
  import {
5
5
  HostedTool,
6
6
  RouterKey,
package/js/effect.js CHANGED
@@ -3,14 +3,14 @@ import {
3
3
  ApprovalDecision,
4
4
  createAppHandler,
5
5
  prepareElicitation
6
- } from "./chunk-XYMLJ42M.js";
7
- import "./chunk-SEJBC5UM.js";
8
- import "./chunk-GD2QMZMA.js";
6
+ } from "./chunk-JCX2K2SI.js";
7
+ import "./chunk-UPTAFF6L.js";
8
+ import "./chunk-BKIQCV72.js";
9
9
  import "./chunk-HLMJBE4T.js";
10
10
  import "./chunk-PBGPES67.js";
11
- import "./chunk-CWYIEXX2.js";
12
- import "./chunk-QXJPA2YB.js";
13
- import "./chunk-AVDSIC3N.js";
11
+ import "./chunk-3BI34I5S.js";
12
+ import "./chunk-ZXG7RMCB.js";
13
+ import "./chunk-OIH73VFM.js";
14
14
  import {
15
15
  ToolAnnotations
16
16
  } from "./chunk-2RGJMA7N.js";
package/js/graphql.js CHANGED
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  catalogCache,
3
3
  catalogScope
4
- } from "./chunk-I32KG7II.js";
4
+ } from "./chunk-SXQVVXJE.js";
5
5
  import {
6
6
  protocolOperations
7
- } from "./chunk-UZQ4K5BH.js";
7
+ } from "./chunk-RIV62DRM.js";
8
8
  import "./chunk-BCSNKUAC.js";
9
- import "./chunk-XYMLJ42M.js";
9
+ import "./chunk-JCX2K2SI.js";
10
10
  import {
11
11
  cacheKey
12
- } from "./chunk-SEJBC5UM.js";
12
+ } from "./chunk-UPTAFF6L.js";
13
13
  import {
14
14
  GraphqlError,
15
15
  GraphqlIntrospection,
@@ -20,22 +20,22 @@ import {
20
20
  maxGraphqlStatedErrors,
21
21
  maxGraphqlStatedExtensions,
22
22
  maxGraphqlStatedFieldLength
23
- } from "./chunk-GD2QMZMA.js";
23
+ } from "./chunk-BKIQCV72.js";
24
24
  import {
25
25
  failOnNetworkRefusal
26
26
  } from "./chunk-HLMJBE4T.js";
27
27
  import "./chunk-PBGPES67.js";
28
- import "./chunk-CWYIEXX2.js";
28
+ import "./chunk-3BI34I5S.js";
29
29
  import {
30
30
  nativeOperation,
31
31
  routerDeclaration
32
- } from "./chunk-QXJPA2YB.js";
32
+ } from "./chunk-ZXG7RMCB.js";
33
33
  import {
34
34
  accountProviderError,
35
35
  boundStated,
36
36
  graphqlProviderError,
37
37
  httpProviderError
38
- } from "./chunk-AVDSIC3N.js";
38
+ } from "./chunk-OIH73VFM.js";
39
39
  import {
40
40
  FailureFieldName,
41
41
  NetworkRefused,
package/js/host.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  createAppHandler
3
- } from "./chunk-XYMLJ42M.js";
4
- import "./chunk-SEJBC5UM.js";
5
- import "./chunk-GD2QMZMA.js";
3
+ } from "./chunk-JCX2K2SI.js";
4
+ import "./chunk-UPTAFF6L.js";
5
+ import "./chunk-BKIQCV72.js";
6
6
  import "./chunk-HLMJBE4T.js";
7
7
  import "./chunk-PBGPES67.js";
8
- import "./chunk-CWYIEXX2.js";
9
- import "./chunk-QXJPA2YB.js";
10
- import "./chunk-AVDSIC3N.js";
8
+ import "./chunk-3BI34I5S.js";
9
+ import "./chunk-ZXG7RMCB.js";
10
+ import "./chunk-OIH73VFM.js";
11
11
  import {
12
12
  CacheCommand,
13
13
  CacheError,
package/js/index.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  query,
12
12
  t,
13
13
  workflow
14
- } from "./chunk-CWYIEXX2.js";
14
+ } from "./chunk-3BI34I5S.js";
15
15
  import {
16
16
  dynamicRouter,
17
17
  mutation,
@@ -25,11 +25,11 @@ import {
25
25
  toolAnnotations,
26
26
  withApproval,
27
27
  withApprovals
28
- } from "./chunk-QXJPA2YB.js";
28
+ } from "./chunk-ZXG7RMCB.js";
29
29
  import {
30
30
  accountProviderError,
31
31
  fromPromise
32
- } from "./chunk-AVDSIC3N.js";
32
+ } from "./chunk-OIH73VFM.js";
33
33
  import {
34
34
  CacheError,
35
35
  CalendarSchedule,
package/js/mcp/effect.js CHANGED
@@ -2,16 +2,16 @@ import {
2
2
  mcpClientEffect,
3
3
  mcpHealthEffect,
4
4
  mcpToolsEffect
5
- } from "../chunk-KQQQBJ3F.js";
5
+ } from "../chunk-3BOEMXAJ.js";
6
6
  import "../chunk-BCSNKUAC.js";
7
- import "../chunk-XYMLJ42M.js";
8
- import "../chunk-SEJBC5UM.js";
9
- import "../chunk-GD2QMZMA.js";
7
+ import "../chunk-JCX2K2SI.js";
8
+ import "../chunk-UPTAFF6L.js";
9
+ import "../chunk-BKIQCV72.js";
10
10
  import "../chunk-HLMJBE4T.js";
11
11
  import "../chunk-PBGPES67.js";
12
- import "../chunk-CWYIEXX2.js";
13
- import "../chunk-QXJPA2YB.js";
14
- import "../chunk-AVDSIC3N.js";
12
+ import "../chunk-3BI34I5S.js";
13
+ import "../chunk-ZXG7RMCB.js";
14
+ import "../chunk-OIH73VFM.js";
15
15
  import "../chunk-2RGJMA7N.js";
16
16
  import "../chunk-4PIQKACY.js";
17
17
  import "../chunk-VAI3EVCS.js";
package/js/mcp.js CHANGED
@@ -1,34 +1,34 @@
1
1
  import {
2
2
  catalogCache,
3
3
  catalogScope
4
- } from "./chunk-I32KG7II.js";
4
+ } from "./chunk-SXQVVXJE.js";
5
5
  import {
6
6
  protocolOperations
7
- } from "./chunk-UZQ4K5BH.js";
7
+ } from "./chunk-RIV62DRM.js";
8
8
  import {
9
9
  adaptMcpTool,
10
10
  mcpClientEffect,
11
11
  mcpHealthEffect
12
- } from "./chunk-KQQQBJ3F.js";
12
+ } from "./chunk-3BOEMXAJ.js";
13
13
  import "./chunk-BCSNKUAC.js";
14
- import "./chunk-XYMLJ42M.js";
14
+ import "./chunk-JCX2K2SI.js";
15
15
  import {
16
16
  cacheKey
17
- } from "./chunk-SEJBC5UM.js";
17
+ } from "./chunk-UPTAFF6L.js";
18
18
  import {
19
19
  operationDescription
20
- } from "./chunk-GD2QMZMA.js";
20
+ } from "./chunk-BKIQCV72.js";
21
21
  import "./chunk-HLMJBE4T.js";
22
22
  import "./chunk-PBGPES67.js";
23
- import "./chunk-CWYIEXX2.js";
23
+ import "./chunk-3BI34I5S.js";
24
24
  import {
25
25
  nativeOperation,
26
26
  routerDeclaration
27
- } from "./chunk-QXJPA2YB.js";
27
+ } from "./chunk-ZXG7RMCB.js";
28
28
  import {
29
29
  fromPromise,
30
30
  method
31
- } from "./chunk-AVDSIC3N.js";
31
+ } from "./chunk-OIH73VFM.js";
32
32
  import {
33
33
  McpCredentialsUnverified,
34
34
  McpError,
package/js/openapi.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  import {
9
9
  protocolOperations,
10
10
  protocolRouter
11
- } from "./chunk-UZQ4K5BH.js";
11
+ } from "./chunk-RIV62DRM.js";
12
12
  import {
13
13
  OpenapiCompileError,
14
14
  OpenapiCompileErrorCode,
@@ -29,7 +29,7 @@ import {
29
29
  isOpenapiTextMedia,
30
30
  openapiBinaryResultSchema,
31
31
  openapiMediaKind
32
- } from "./chunk-GD2QMZMA.js";
32
+ } from "./chunk-BKIQCV72.js";
33
33
  import {
34
34
  failOnNetworkRefusal
35
35
  } from "./chunk-HLMJBE4T.js";
@@ -37,7 +37,7 @@ import "./chunk-PBGPES67.js";
37
37
  import {
38
38
  nativeOperation,
39
39
  routerDeclaration
40
- } from "./chunk-QXJPA2YB.js";
40
+ } from "./chunk-ZXG7RMCB.js";
41
41
  import {
42
42
  accountProviderError,
43
43
  bodyUpstreamError,
@@ -45,8 +45,9 @@ import {
45
45
  httpProviderError,
46
46
  method,
47
47
  providerErrorDetail,
48
+ statedUpstream,
48
49
  toPromise
49
- } from "./chunk-AVDSIC3N.js";
50
+ } from "./chunk-OIH73VFM.js";
50
51
  import {
51
52
  ApiErrorRecovery,
52
53
  ApiErrorResponse,
@@ -385,9 +386,15 @@ function createRequest(config) {
385
386
  yield* failOnNetworkRefusal(response);
386
387
  if (response.status < 200 || response.status >= 300) {
387
388
  const provider = httpProviderError(response.status, response.headers);
388
- if (provider !== void 0 && provider.reason !== "rejected") return yield* provider;
389
- const json = provider !== void 0 || errors.some((error) => error.status === response.status) ? yield* errorBody(response) : void 0;
389
+ const declares = errors.some((error) => error.status === response.status);
390
+ if (provider !== void 0 && provider.reason !== "rejected" && (!declares || provider.upstream !== void 0))
391
+ return yield* provider;
392
+ const json = provider !== void 0 || declares ? yield* errorBody(response) : void 0;
390
393
  const declared = json === void 0 ? void 0 : yield* responseError(response.status, json, errors);
394
+ if (provider !== void 0 && provider.reason !== "rejected")
395
+ return yield* declared === void 0 ? provider : providerErrorDetail(provider, {
396
+ upstream: statedUpstream(declared.code, declared.message)
397
+ });
391
398
  const upstream = json === void 0 ? void 0 : bodyUpstreamError(json);
392
399
  return yield* declared ?? (provider === void 0 || upstream === void 0 ? provider : providerErrorDetail(provider, { upstream })) ?? new OpenapiError({ reason: "request", operation, ...responseShape(response) });
393
400
  }
package/js/skills.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  catalogCache,
3
3
  catalogScope
4
- } from "./chunk-I32KG7II.js";
5
- import "./chunk-SEJBC5UM.js";
4
+ } from "./chunk-SXQVVXJE.js";
5
+ import "./chunk-UPTAFF6L.js";
6
6
  import {
7
7
  failOnNetworkRefusal
8
8
  } from "./chunk-HLMJBE4T.js";
@@ -16,7 +16,7 @@ import {
16
16
  httpProviderError,
17
17
  method,
18
18
  toPromise
19
- } from "./chunk-AVDSIC3N.js";
19
+ } from "./chunk-OIH73VFM.js";
20
20
  import {
21
21
  NetworkRefused,
22
22
  ProviderError,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apps",
3
- "version": "0.0.1-beta.108",
3
+ "version": "0.0.1-beta.109",
4
4
  "description": "TypeScript apps with typed tools, accounts, storage, and UI.",
5
5
  "type": "module",
6
6
  "sideEffects": false,