apps 0.0.1-beta.65 → 0.0.1-beta.67
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.
- package/framework-reference.json +1 -1
- package/js/{chunk-E6XNNHQ5.js → chunk-3CVQ3VPP.js} +66 -43
- package/js/{chunk-N6YVECOH.js → chunk-524HNOCY.js} +6 -6
- package/js/{chunk-Z33B35HR.js → chunk-5EOB55ID.js} +2 -2
- package/js/{chunk-MAYL64WD.js → chunk-5NQDJMLY.js} +2 -2
- package/js/{chunk-J2LGI2UN.js → chunk-6RH2UYRB.js} +2 -2
- package/js/{chunk-IVGA4YM2.js → chunk-AZIV4XRH.js} +1 -1
- package/js/{chunk-3U3S7L4N.js → chunk-K2VZ3O27.js} +5 -5
- package/js/{chunk-PP2XV753.js → chunk-T3FPHPJJ.js} +1 -1
- package/js/{chunk-CDJ5NUQK.js → chunk-WFPDJ4R3.js} +3 -3
- package/js/{chunk-SKDK6FE4.js → chunk-X36WUWBJ.js} +1 -1
- package/js/{chunk-7727NVK3.js → chunk-ZA6YCHLZ.js} +4 -4
- package/js/client.js +1 -1
- package/js/effect.js +7 -7
- package/js/graphql.js +9 -9
- package/js/host.js +7 -7
- package/js/index.js +4 -4
- package/js/mcp/effect.js +9 -9
- package/js/mcp/stdio.js +9 -9
- package/js/mcp.js +11 -11
- package/js/openapi.js +21 -13
- package/js/skills.js +4 -4
- package/js/ui/serving.js +1 -1
- package/package.json +1 -1
- package/runtime.json +1 -1
- package/types/apps/src/implementation/upstream-error.d.ts +1 -1
- package/types/telemetry/src/relay.d.ts +6 -4
package/js/openapi.js
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
protocolOperations,
|
|
10
10
|
protocolRouter
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-6RH2UYRB.js";
|
|
12
12
|
import {
|
|
13
13
|
OpenapiCompileError,
|
|
14
14
|
OpenapiCompileErrorCode,
|
|
@@ -29,22 +29,24 @@ import {
|
|
|
29
29
|
isOpenapiTextMedia,
|
|
30
30
|
openapiBinaryResultSchema,
|
|
31
31
|
openapiMediaKind
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-5EOB55ID.js";
|
|
33
33
|
import {
|
|
34
34
|
failOnNetworkRefusal
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-T3FPHPJJ.js";
|
|
36
36
|
import "./chunk-XBG7HHXC.js";
|
|
37
37
|
import {
|
|
38
38
|
nativeOperation,
|
|
39
39
|
routerDeclaration
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-X36WUWBJ.js";
|
|
41
41
|
import {
|
|
42
42
|
accountProviderError,
|
|
43
|
+
bodyUpstreamError,
|
|
43
44
|
fromPromise,
|
|
44
45
|
httpProviderError,
|
|
45
46
|
method,
|
|
47
|
+
providerErrorDetail,
|
|
46
48
|
toPromise
|
|
47
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-K2VZ3O27.js";
|
|
48
50
|
import {
|
|
49
51
|
ApiErrorRecovery,
|
|
50
52
|
ApiErrorResponse,
|
|
@@ -66,7 +68,7 @@ import {
|
|
|
66
68
|
} from "./chunk-KGCTYL2S.js";
|
|
67
69
|
import {
|
|
68
70
|
owned
|
|
69
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-3CVQ3VPP.js";
|
|
70
72
|
import {
|
|
71
73
|
FetchHttpClient_exports
|
|
72
74
|
} from "./chunk-PD6I2SDG.js";
|
|
@@ -112,16 +114,15 @@ var responseShape = (response) => {
|
|
|
112
114
|
};
|
|
113
115
|
};
|
|
114
116
|
var bodyRecovery = Schema_exports.decodeUnknownOption(Schema_exports.Struct({ recovery: ApiErrorRecovery }));
|
|
115
|
-
function
|
|
117
|
+
function errorBody(response) {
|
|
116
118
|
return Effect_exports.gen(function* () {
|
|
117
|
-
|
|
118
|
-
if (candidates.length === 0 || !/^application\/(?:[\w.-]+\+)?json$/i.test(
|
|
119
|
+
if (!/^application\/(?:[\w.-]+\+)?json$/i.test(
|
|
119
120
|
response.headers["content-type"]?.split(";")[0]?.trim() ?? ""
|
|
120
121
|
))
|
|
121
122
|
return;
|
|
122
123
|
const length = response.headers["content-length"];
|
|
123
124
|
if (length !== void 0 && Number(length) > defaultOpenapiErrorLimits.maxBodyBytes) return;
|
|
124
|
-
|
|
125
|
+
return yield* response.stream.pipe(
|
|
125
126
|
Stream_exports.mapError(() => new OpenapiError({ reason: "request", status: response.status })),
|
|
126
127
|
Stream_exports.limitBytes(
|
|
127
128
|
defaultOpenapiErrorLimits.maxBodyBytes,
|
|
@@ -132,6 +133,11 @@ function responseError(response, errors) {
|
|
|
132
133
|
Effect_exports.flatMap(Schema_exports.decodeUnknownEffect(Schema_exports.fromJsonString(Schema_exports.Json))),
|
|
133
134
|
Effect_exports.timeout(defaultOpenapiErrorLimits.readTimeoutMs)
|
|
134
135
|
);
|
|
136
|
+
}).pipe(Effect_exports.catch(() => Effect_exports.succeed(void 0)));
|
|
137
|
+
}
|
|
138
|
+
function responseError(status, json, errors) {
|
|
139
|
+
return Effect_exports.gen(function* () {
|
|
140
|
+
const candidates = errors.filter((error) => error.status === status);
|
|
135
141
|
for (const candidate of candidates) {
|
|
136
142
|
const parsed = yield* Schema_exports.decodeUnknownEffect(candidate.decoder)(json).pipe(Effect_exports.option);
|
|
137
143
|
if (Option_exports.isSome(parsed)) {
|
|
@@ -142,7 +148,7 @@ function responseError(response, errors) {
|
|
|
142
148
|
const recovery = bodyRecovery(parsed.value);
|
|
143
149
|
return new OpenapiResponseError({
|
|
144
150
|
code: candidate.code,
|
|
145
|
-
status
|
|
151
|
+
status,
|
|
146
152
|
message: message.value.message,
|
|
147
153
|
...Option_exports.isSome(recovery) ? { recovery: recovery.value.recovery } : {}
|
|
148
154
|
});
|
|
@@ -368,8 +374,10 @@ function createRequest(config) {
|
|
|
368
374
|
if (response.status < 200 || response.status >= 300) {
|
|
369
375
|
const provider = httpProviderError(response.status, response.headers);
|
|
370
376
|
if (provider !== void 0 && provider.reason !== "rejected") return yield* provider;
|
|
371
|
-
const
|
|
372
|
-
|
|
377
|
+
const json = provider !== void 0 || errors.some((error) => error.status === response.status) ? yield* errorBody(response) : void 0;
|
|
378
|
+
const declared = json === void 0 ? void 0 : yield* responseError(response.status, json, errors);
|
|
379
|
+
const upstream = json === void 0 ? void 0 : bodyUpstreamError(json);
|
|
380
|
+
return yield* declared ?? (provider === void 0 || upstream === void 0 ? provider : providerErrorDetail(provider, { upstream })) ?? new OpenapiError({ reason: "request", operation, ...responseShape(response) });
|
|
373
381
|
}
|
|
374
382
|
if (response.status === 204 || prepared.method === "HEAD") return null;
|
|
375
383
|
const unreadable = new OpenapiError({
|
package/js/skills.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
catalogCache,
|
|
3
3
|
catalogScope
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-AZIV4XRH.js";
|
|
5
5
|
import "./chunk-AQU56EPI.js";
|
|
6
6
|
import {
|
|
7
7
|
failOnNetworkRefusal
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-T3FPHPJJ.js";
|
|
9
9
|
import {
|
|
10
10
|
folderSkillsEffect,
|
|
11
11
|
skillFromFiles
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
httpProviderError,
|
|
17
17
|
method,
|
|
18
18
|
toPromise
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-K2VZ3O27.js";
|
|
20
20
|
import {
|
|
21
21
|
NetworkRefused,
|
|
22
22
|
ProviderError,
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
import {
|
|
36
36
|
wrap
|
|
37
37
|
} from "./chunk-KGCTYL2S.js";
|
|
38
|
-
import "./chunk-
|
|
38
|
+
import "./chunk-3CVQ3VPP.js";
|
|
39
39
|
import {
|
|
40
40
|
FetchHttpClient_exports
|
|
41
41
|
} from "./chunk-PD6I2SDG.js";
|
package/js/ui/serving.js
CHANGED