apps 0.0.1-beta.33 → 0.0.1-beta.34
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-3BHBWZLD.js → chunk-5OM6HBNU.js} +10 -8
- package/js/{chunk-N72RKJ5E.js → chunk-DSUKW6KJ.js} +1 -92
- package/js/{chunk-5DLG2FVN.js → chunk-DXGWKNTQ.js} +91 -0
- package/js/chunk-EPUWF4ZG.js +49 -0
- package/js/{chunk-4OKYLVU4.js → chunk-IU6OK5G2.js} +1 -1
- package/js/{chunk-AKKJDDOT.js → chunk-MYH3QZ4L.js} +6 -6
- package/js/{chunk-2SRLJHPM.js → chunk-O4QOPXQT.js} +7 -46
- package/js/{chunk-TEV5IMOM.js → chunk-PUBNIORL.js} +2 -2
- package/js/{chunk-AYM2FUI5.js → chunk-Q7Q5JTRW.js} +1 -1
- package/js/{chunk-GMMS4BY3.js → chunk-QKVZGWGZ.js} +4 -4
- package/js/{chunk-75JKK3ZE.js → chunk-QUEPZ67T.js} +1 -1
- package/js/{chunk-E6C2DUIA.js → chunk-QZD2RZ4S.js} +2 -2
- package/js/{chunk-WWSRAE5Y.js → chunk-UKMIHP2G.js} +8 -5
- package/js/contracts.js +9 -9
- package/js/effect.js +9 -8
- package/js/graphql.js +13 -13
- package/js/host.js +9 -8
- package/js/index.js +7 -7
- package/js/mcp/effect.js +11 -10
- package/js/mcp/stdio.js +11 -10
- package/js/mcp.js +14 -13
- package/js/openapi.js +10 -8
- package/js/skills.js +109 -41
- package/package.json +1 -1
- package/runtime.json +1 -1
- package/types/apps/src/contracts/cache.d.ts +14 -0
- package/types/apps/src/contracts/skills.d.ts +16 -4
- package/types/apps/src/implementation/catalog-cache.d.ts +14 -17
- package/types/apps/src/implementation/skills.d.ts +13 -19
- package/types/apps/src/skills.d.ts +4 -3
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
makeCache
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Q7Q5JTRW.js";
|
|
4
4
|
import {
|
|
5
5
|
accountSecrets,
|
|
6
|
-
appInvocationFetch,
|
|
7
6
|
boundFailureMessage,
|
|
8
7
|
describeFailure,
|
|
9
8
|
failureDetail,
|
|
@@ -11,7 +10,10 @@ import {
|
|
|
11
10
|
parseMcpError,
|
|
12
11
|
readCatalog,
|
|
13
12
|
routerSkills
|
|
14
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-O4QOPXQT.js";
|
|
14
|
+
import {
|
|
15
|
+
appInvocationFetch
|
|
16
|
+
} from "./chunk-EPUWF4ZG.js";
|
|
15
17
|
import {
|
|
16
18
|
folderSkillsEffect
|
|
17
19
|
} from "./chunk-OX233L7N.js";
|
|
@@ -21,7 +23,7 @@ import {
|
|
|
21
23
|
isApp,
|
|
22
24
|
toEffectApp,
|
|
23
25
|
unavailableStorage
|
|
24
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-QZD2RZ4S.js";
|
|
25
27
|
import {
|
|
26
28
|
parseDatabaseSchema
|
|
27
29
|
} from "./chunk-5JVNM3CQ.js";
|
|
@@ -31,12 +33,12 @@ import {
|
|
|
31
33
|
locate,
|
|
32
34
|
nativeOperation,
|
|
33
35
|
toPromise
|
|
34
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-QUEPZ67T.js";
|
|
35
37
|
import {
|
|
36
38
|
accountProviderError,
|
|
37
39
|
httpProviderError,
|
|
38
40
|
parseProviderError
|
|
39
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-IU6OK5G2.js";
|
|
40
42
|
import {
|
|
41
43
|
AccountCheckResult,
|
|
42
44
|
DeclaredProvider,
|
|
@@ -83,10 +85,10 @@ import {
|
|
|
83
85
|
defaultWebhookTransportLimits,
|
|
84
86
|
maxInputProblems,
|
|
85
87
|
workflowDurationMillis
|
|
86
|
-
} from "./chunk-
|
|
88
|
+
} from "./chunk-DSUKW6KJ.js";
|
|
87
89
|
import {
|
|
88
90
|
CacheError
|
|
89
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-DXGWKNTQ.js";
|
|
90
92
|
import {
|
|
91
93
|
AppSkills,
|
|
92
94
|
SkillFile,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
FailureSource,
|
|
14
14
|
ProviderError,
|
|
15
15
|
UpstreamError
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-DXGWKNTQ.js";
|
|
17
17
|
import {
|
|
18
18
|
AppSkillName,
|
|
19
19
|
AppSkills,
|
|
@@ -226,88 +226,6 @@ 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
|
-
|
|
311
229
|
// src/contracts/workflows.ts
|
|
312
230
|
var WorkflowRunId = Schema_exports.NonEmptyString.pipe(Schema_exports.brand("wfr"));
|
|
313
231
|
var WorkflowName = Schema_exports.NonEmptyString.check(Schema_exports.isMaxLength(200));
|
|
@@ -3017,15 +2935,6 @@ var ToolResultObservation = Context_exports.Reference(
|
|
|
3017
2935
|
);
|
|
3018
2936
|
|
|
3019
2937
|
export {
|
|
3020
|
-
NetworkRefusal,
|
|
3021
|
-
NetworkRefused,
|
|
3022
|
-
networkRefusalStatus,
|
|
3023
|
-
networkRefusalHeader,
|
|
3024
|
-
NetworkRefusedHeader,
|
|
3025
|
-
networkRefusalResponse,
|
|
3026
|
-
RestrictedFetchOption,
|
|
3027
|
-
supportedFetchOptions,
|
|
3028
|
-
FetchOptionUnsupported,
|
|
3029
2938
|
SecretsMethod,
|
|
3030
2939
|
OAuthClientAuth,
|
|
3031
2940
|
OAuthSecretClientAuth,
|
|
@@ -51,6 +51,88 @@ var ProviderError = class extends Schema_exports.TaggedError()("ProviderError",
|
|
|
51
51
|
}) {
|
|
52
52
|
};
|
|
53
53
|
|
|
54
|
+
// src/contracts/network.ts
|
|
55
|
+
var NetworkRefusal = Schema_exports.Union([
|
|
56
|
+
Schema_exports.Struct({ reason: Schema_exports.Literal("private_address") }),
|
|
57
|
+
Schema_exports.Struct({
|
|
58
|
+
reason: Schema_exports.Literal("credential_host"),
|
|
59
|
+
/** The provider of the credential handle the request carried. */
|
|
60
|
+
provider: Schema_exports.String,
|
|
61
|
+
/** The hosts that provider's credentials may reach; empty when it declares none. */
|
|
62
|
+
allowedHosts: Schema_exports.Array(Schema_exports.String)
|
|
63
|
+
}),
|
|
64
|
+
Schema_exports.Struct({ reason: Schema_exports.Literal("credential_app") }),
|
|
65
|
+
Schema_exports.Struct({
|
|
66
|
+
reason: Schema_exports.Literal("credential_expired"),
|
|
67
|
+
/** The provider of the expired credential handle. */
|
|
68
|
+
provider: Schema_exports.String
|
|
69
|
+
})
|
|
70
|
+
]);
|
|
71
|
+
var NetworkRefused = class extends Schema_exports.TaggedError()("NetworkRefused", {
|
|
72
|
+
/** The refused destination, with its port when the URL names one. */
|
|
73
|
+
host: Schema_exports.String,
|
|
74
|
+
refusal: NetworkRefusal
|
|
75
|
+
}) {
|
|
76
|
+
get message() {
|
|
77
|
+
const refusal = this.refusal;
|
|
78
|
+
switch (refusal.reason) {
|
|
79
|
+
case "private_address":
|
|
80
|
+
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.`;
|
|
81
|
+
case "credential_host":
|
|
82
|
+
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(", ")}.`;
|
|
83
|
+
case "credential_app":
|
|
84
|
+
return "Executor refused this request: it carries a credential handle that is not valid for this app. Use the account fields this invocation received.";
|
|
85
|
+
case "credential_expired":
|
|
86
|
+
return `Executor refused this request: it carries an expired ${refusal.provider} credential handle. Use the account fields this invocation received.`;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
var networkRefusalStatus = 421;
|
|
91
|
+
var networkRefusalHeader = "x-executor-refused";
|
|
92
|
+
var NetworkRefusedHeader = Schema_exports.StringFromUriComponent.pipe(
|
|
93
|
+
Schema_exports.decodeTo(Schema_exports.fromJsonString(NetworkRefused))
|
|
94
|
+
);
|
|
95
|
+
var encodeRefusal = Schema_exports.encodeSync(NetworkRefused);
|
|
96
|
+
var encodeRefusalHeader = Schema_exports.encodeSync(NetworkRefusedHeader);
|
|
97
|
+
var networkRefusalResponse = (refused) => new Response(JSON.stringify({ ...encodeRefusal(refused), message: refused.message }), {
|
|
98
|
+
status: networkRefusalStatus,
|
|
99
|
+
statusText: "Refused by Executor",
|
|
100
|
+
headers: {
|
|
101
|
+
"content-type": "application/json; charset=utf-8",
|
|
102
|
+
[networkRefusalHeader]: encodeRefusalHeader(refused)
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
var RestrictedFetchOption = Schema_exports.Literals(["redirect", "cache", "integrity"]);
|
|
106
|
+
var supportedFetchOptions = {
|
|
107
|
+
redirect: ["follow", "manual"],
|
|
108
|
+
cache: ["no-store", "no-cache"],
|
|
109
|
+
integrity: [""]
|
|
110
|
+
};
|
|
111
|
+
var FetchOptionUnsupported = class extends Schema_exports.TaggedError()(
|
|
112
|
+
"FetchOptionUnsupported",
|
|
113
|
+
{
|
|
114
|
+
option: RestrictedFetchOption,
|
|
115
|
+
value: Schema_exports.String,
|
|
116
|
+
supported: Schema_exports.Array(Schema_exports.String)
|
|
117
|
+
}
|
|
118
|
+
) {
|
|
119
|
+
get message() {
|
|
120
|
+
const supported = this.supported.map((value) => JSON.stringify(value)).join(" or ");
|
|
121
|
+
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}`;
|
|
122
|
+
}
|
|
123
|
+
/** What to do instead, when the standard value has an equivalent the runtime supports. */
|
|
124
|
+
get advice() {
|
|
125
|
+
switch (this.option) {
|
|
126
|
+
case "redirect":
|
|
127
|
+
return this.value === "error" ? ` To reject redirects, send redirect: "manual" and treat a 3xx response as the error.` : "";
|
|
128
|
+
case "cache":
|
|
129
|
+
return "";
|
|
130
|
+
case "integrity":
|
|
131
|
+
return " To check a digest, read the body and hash it with crypto.subtle.digest.";
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
|
|
54
136
|
// ../app-cache/src/contracts/cache.ts
|
|
55
137
|
var CacheError = class extends Schema_exports.TaggedError()("CacheError", {
|
|
56
138
|
reason: Schema_exports.Literals(["unavailable", "storage", "invalid", "capacity", "timeout"])
|
|
@@ -140,6 +222,15 @@ export {
|
|
|
140
222
|
UpstreamError,
|
|
141
223
|
FailurePhase,
|
|
142
224
|
ProviderError,
|
|
225
|
+
NetworkRefusal,
|
|
226
|
+
NetworkRefused,
|
|
227
|
+
networkRefusalStatus,
|
|
228
|
+
networkRefusalHeader,
|
|
229
|
+
NetworkRefusedHeader,
|
|
230
|
+
networkRefusalResponse,
|
|
231
|
+
RestrictedFetchOption,
|
|
232
|
+
supportedFetchOptions,
|
|
233
|
+
FetchOptionUnsupported,
|
|
143
234
|
CacheError,
|
|
144
235
|
cacheLimits,
|
|
145
236
|
CacheEntry,
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FetchOptionUnsupported,
|
|
3
|
+
NetworkRefusedHeader,
|
|
4
|
+
RestrictedFetchOption,
|
|
5
|
+
networkRefusalHeader,
|
|
6
|
+
networkRefusalStatus,
|
|
7
|
+
supportedFetchOptions
|
|
8
|
+
} from "./chunk-DXGWKNTQ.js";
|
|
9
|
+
import {
|
|
10
|
+
invocationFetch
|
|
11
|
+
} from "./chunk-ETLILMHY.js";
|
|
12
|
+
import {
|
|
13
|
+
Effect_exports,
|
|
14
|
+
Schema_exports
|
|
15
|
+
} from "./chunk-EXGKN554.js";
|
|
16
|
+
|
|
17
|
+
// src/implementation/network.ts
|
|
18
|
+
var refusalHeader = (status, header) => status === networkRefusalStatus && header !== null && header !== void 0 ? header : void 0;
|
|
19
|
+
var failOnNetworkRefusal = (response) => {
|
|
20
|
+
const header = refusalHeader(response.status, response.headers[networkRefusalHeader]);
|
|
21
|
+
return header === void 0 ? Effect_exports.void : Schema_exports.decodeUnknownEffect(NetworkRefusedHeader)(header).pipe(
|
|
22
|
+
Effect_exports.orDie,
|
|
23
|
+
Effect_exports.flatMap(Effect_exports.fail)
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
var unsupportedOption = (init) => {
|
|
27
|
+
for (const option of RestrictedFetchOption.literals) {
|
|
28
|
+
const value = init?.[option];
|
|
29
|
+
const supported = supportedFetchOptions[option];
|
|
30
|
+
if (value !== void 0 && !supported.includes(value))
|
|
31
|
+
return new FetchOptionUnsupported({ option, value: String(value), supported });
|
|
32
|
+
}
|
|
33
|
+
return void 0;
|
|
34
|
+
};
|
|
35
|
+
var appFetch = (fetch) => async (input, init) => {
|
|
36
|
+
const unsupported = unsupportedOption(init);
|
|
37
|
+
if (unsupported !== void 0) throw unsupported;
|
|
38
|
+
const response = await fetch(input, init);
|
|
39
|
+
const header = refusalHeader(response.status, response.headers.get(networkRefusalHeader));
|
|
40
|
+
if (header === void 0) return response;
|
|
41
|
+
await response.body?.cancel();
|
|
42
|
+
throw Schema_exports.decodeUnknownSync(NetworkRefusedHeader)(header);
|
|
43
|
+
};
|
|
44
|
+
var appInvocationFetch = (signal) => invocationFetch(signal).pipe(Effect_exports.map(appFetch));
|
|
45
|
+
|
|
46
|
+
export {
|
|
47
|
+
failOnNetworkRefusal,
|
|
48
|
+
appInvocationFetch
|
|
49
|
+
};
|
|
@@ -3,28 +3,28 @@ import {
|
|
|
3
3
|
answeredError,
|
|
4
4
|
mcpClient,
|
|
5
5
|
mcpJsonSchemaValidator
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-QKVZGWGZ.js";
|
|
7
7
|
import {
|
|
8
8
|
failOnNetworkRefusal
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-EPUWF4ZG.js";
|
|
10
10
|
import {
|
|
11
11
|
accountProviderError,
|
|
12
12
|
bodyUpstreamError,
|
|
13
13
|
httpProviderError,
|
|
14
14
|
providerErrorDetail
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-IU6OK5G2.js";
|
|
16
16
|
import {
|
|
17
17
|
McpCredentialsUnverified,
|
|
18
18
|
McpError,
|
|
19
19
|
McpHealthInput,
|
|
20
20
|
McpToolsOptions,
|
|
21
|
-
NetworkRefused,
|
|
22
21
|
defaultMcpClientLimits,
|
|
23
22
|
mcpHealthReserveMs
|
|
24
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-DSUKW6KJ.js";
|
|
25
24
|
import {
|
|
25
|
+
NetworkRefused,
|
|
26
26
|
ProviderError
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-DXGWKNTQ.js";
|
|
28
28
|
import {
|
|
29
29
|
captureTelemetry
|
|
30
30
|
} from "./chunk-ETLILMHY.js";
|
|
@@ -4,29 +4,22 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
joinPath,
|
|
6
6
|
mergeMeta
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-QUEPZ67T.js";
|
|
8
8
|
import {
|
|
9
9
|
isShortenedUpstream,
|
|
10
10
|
parseProviderError,
|
|
11
11
|
providerError
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-IU6OK5G2.js";
|
|
13
13
|
import {
|
|
14
14
|
ApiErrorResponse,
|
|
15
|
-
FetchOptionUnsupported,
|
|
16
15
|
HostDeclarationInvalid,
|
|
17
16
|
HostEvaluationFailed,
|
|
18
17
|
HostedRouter,
|
|
19
18
|
HostedTool,
|
|
20
19
|
HostedToolSummary,
|
|
21
20
|
McpCredentialsUnverified,
|
|
22
|
-
McpError
|
|
23
|
-
|
|
24
|
-
NetworkRefusedHeader,
|
|
25
|
-
RestrictedFetchOption,
|
|
26
|
-
networkRefusalHeader,
|
|
27
|
-
networkRefusalStatus,
|
|
28
|
-
supportedFetchOptions
|
|
29
|
-
} from "./chunk-N72RKJ5E.js";
|
|
21
|
+
McpError
|
|
22
|
+
} from "./chunk-DSUKW6KJ.js";
|
|
30
23
|
import {
|
|
31
24
|
AppDatabaseError
|
|
32
25
|
} from "./chunk-UMCMZFXW.js";
|
|
@@ -34,18 +27,17 @@ import {
|
|
|
34
27
|
CacheError,
|
|
35
28
|
FailureCode,
|
|
36
29
|
FailureFieldName,
|
|
30
|
+
FetchOptionUnsupported,
|
|
31
|
+
NetworkRefused,
|
|
37
32
|
maxFailureFieldLength,
|
|
38
33
|
maxFailureFields,
|
|
39
34
|
maxFailureMessageLength,
|
|
40
35
|
maxUpstreamMessageLength
|
|
41
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-DXGWKNTQ.js";
|
|
42
37
|
import {
|
|
43
38
|
SkillLoadFailed,
|
|
44
39
|
skillFormatLimits
|
|
45
40
|
} from "./chunk-HW3DPBZR.js";
|
|
46
|
-
import {
|
|
47
|
-
invocationFetch
|
|
48
|
-
} from "./chunk-ETLILMHY.js";
|
|
49
41
|
import {
|
|
50
42
|
jsonSchemaDocument
|
|
51
43
|
} from "./chunk-O3OAFU7Q.js";
|
|
@@ -275,35 +267,6 @@ var OpenapiCompileError = class extends Schema_exports.TaggedError()(
|
|
|
275
267
|
}
|
|
276
268
|
};
|
|
277
269
|
|
|
278
|
-
// src/implementation/network.ts
|
|
279
|
-
var refusalHeader = (status, header) => status === networkRefusalStatus && header !== null && header !== void 0 ? header : void 0;
|
|
280
|
-
var failOnNetworkRefusal = (response) => {
|
|
281
|
-
const header = refusalHeader(response.status, response.headers[networkRefusalHeader]);
|
|
282
|
-
return header === void 0 ? Effect_exports.void : Schema_exports.decodeUnknownEffect(NetworkRefusedHeader)(header).pipe(
|
|
283
|
-
Effect_exports.orDie,
|
|
284
|
-
Effect_exports.flatMap(Effect_exports.fail)
|
|
285
|
-
);
|
|
286
|
-
};
|
|
287
|
-
var unsupportedOption = (init) => {
|
|
288
|
-
for (const option of RestrictedFetchOption.literals) {
|
|
289
|
-
const value = init?.[option];
|
|
290
|
-
const supported = supportedFetchOptions[option];
|
|
291
|
-
if (value !== void 0 && !supported.includes(value))
|
|
292
|
-
return new FetchOptionUnsupported({ option, value: String(value), supported });
|
|
293
|
-
}
|
|
294
|
-
return void 0;
|
|
295
|
-
};
|
|
296
|
-
var appFetch = (fetch) => async (input, init) => {
|
|
297
|
-
const unsupported = unsupportedOption(init);
|
|
298
|
-
if (unsupported !== void 0) throw unsupported;
|
|
299
|
-
const response = await fetch(input, init);
|
|
300
|
-
const header = refusalHeader(response.status, response.headers.get(networkRefusalHeader));
|
|
301
|
-
if (header === void 0) return response;
|
|
302
|
-
await response.body?.cancel();
|
|
303
|
-
throw Schema_exports.decodeUnknownSync(NetworkRefusedHeader)(header);
|
|
304
|
-
};
|
|
305
|
-
var appInvocationFetch = (signal) => invocationFetch(signal).pipe(Effect_exports.map(appFetch));
|
|
306
|
-
|
|
307
270
|
// src/implementation/failure-detail.ts
|
|
308
271
|
var storageMessages = {
|
|
309
272
|
schema: "The app's database schema is invalid.",
|
|
@@ -792,8 +755,6 @@ export {
|
|
|
792
755
|
parseMcpError,
|
|
793
756
|
describeFailure,
|
|
794
757
|
failureDetail,
|
|
795
|
-
failOnNetworkRefusal,
|
|
796
|
-
appInvocationFetch,
|
|
797
758
|
operationDescription,
|
|
798
759
|
fixedRouter,
|
|
799
760
|
readCatalog,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
fixedRouter
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-O4QOPXQT.js";
|
|
4
4
|
import {
|
|
5
5
|
nativeOperation,
|
|
6
6
|
operationDeclaration,
|
|
7
7
|
routerDeclaration
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-QUEPZ67T.js";
|
|
9
9
|
|
|
10
10
|
// src/implementation/protocol-operations.ts
|
|
11
11
|
var protocolOperations = (operations, kinds = {}) => {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
prepareElicitation
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5OM6HBNU.js";
|
|
4
4
|
import {
|
|
5
5
|
fromPromise
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-QUEPZ67T.js";
|
|
7
7
|
import {
|
|
8
8
|
bodyUpstreamError
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-IU6OK5G2.js";
|
|
10
10
|
import {
|
|
11
11
|
ElicitationFailed,
|
|
12
12
|
McpError,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
defaultElicitationLimits,
|
|
19
19
|
defaultMcpClientLimits,
|
|
20
20
|
mcpSdkTimerCeilingMs
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-DSUKW6KJ.js";
|
|
22
22
|
import {
|
|
23
23
|
jsonSchemaDecoder,
|
|
24
24
|
nestJsonSchema,
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
fromPromise,
|
|
7
7
|
nativeOperation,
|
|
8
8
|
nativeRouter
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-QUEPZ67T.js";
|
|
10
10
|
import {
|
|
11
11
|
ScheduleTiming
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-DSUKW6KJ.js";
|
|
13
13
|
import {
|
|
14
14
|
DatabaseSchema
|
|
15
15
|
} from "./chunk-UMCMZFXW.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CacheError
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DXGWKNTQ.js";
|
|
4
4
|
import {
|
|
5
5
|
wrap
|
|
6
6
|
} from "./chunk-O3OAFU7Q.js";
|
|
@@ -14,12 +14,15 @@ import {
|
|
|
14
14
|
} from "./chunk-EXGKN554.js";
|
|
15
15
|
|
|
16
16
|
// src/implementation/catalog-cache.ts
|
|
17
|
-
var catalogScope = (options, invalid) => {
|
|
18
|
-
const { account, cache
|
|
17
|
+
var catalogScope = (options, credential, invalid) => {
|
|
18
|
+
const { account, cache } = options;
|
|
19
19
|
if (account === void 0)
|
|
20
|
-
return
|
|
20
|
+
return credential === void 0 ? Effect_exports.succeed(cache) : Effect_exports.fail(invalid("missing-account"));
|
|
21
21
|
if (cache === void 0) return Effect_exports.succeed(void 0);
|
|
22
|
-
return Effect_exports.try({
|
|
22
|
+
return Effect_exports.try({
|
|
23
|
+
try: () => cache.forAccount(account),
|
|
24
|
+
catch: () => invalid("unselected-account")
|
|
25
|
+
});
|
|
23
26
|
};
|
|
24
27
|
var schema = (decoder) => wrap(decoder, false);
|
|
25
28
|
var Manifest = Schema_exports.Struct({
|
package/js/contracts.js
CHANGED
|
@@ -14,7 +14,6 @@ import {
|
|
|
14
14
|
ElicitationLimits,
|
|
15
15
|
ElicitationReply,
|
|
16
16
|
ElicitationResponse,
|
|
17
|
-
FetchOptionUnsupported,
|
|
18
17
|
FormElicitation,
|
|
19
18
|
HostAccountCheckError,
|
|
20
19
|
HostAccountsInvalid,
|
|
@@ -53,8 +52,6 @@ import {
|
|
|
53
52
|
ManualWebhookSetup,
|
|
54
53
|
McpClientLimits,
|
|
55
54
|
McpError,
|
|
56
|
-
NetworkRefusal,
|
|
57
|
-
NetworkRefused,
|
|
58
55
|
NonRetryableError,
|
|
59
56
|
OAuthClientAuth,
|
|
60
57
|
OAuthSecretClientAuth,
|
|
@@ -102,9 +99,6 @@ import {
|
|
|
102
99
|
maxApiErrorMessageLength,
|
|
103
100
|
maxInputProblems,
|
|
104
101
|
minimumIntervalMilliseconds,
|
|
105
|
-
networkRefusalHeader,
|
|
106
|
-
networkRefusalResponse,
|
|
107
|
-
networkRefusalStatus,
|
|
108
102
|
protocol1,
|
|
109
103
|
protocol2,
|
|
110
104
|
protocol3,
|
|
@@ -117,7 +111,7 @@ import {
|
|
|
117
111
|
skillCatalog,
|
|
118
112
|
skillsCommand,
|
|
119
113
|
workflowDurationMillis
|
|
120
|
-
} from "./chunk-
|
|
114
|
+
} from "./chunk-DSUKW6KJ.js";
|
|
121
115
|
import {
|
|
122
116
|
DatabaseFieldReserved,
|
|
123
117
|
DatabaseLimitExceeded
|
|
@@ -132,13 +126,19 @@ import {
|
|
|
132
126
|
FailureName,
|
|
133
127
|
FailurePhase,
|
|
134
128
|
FailureSource,
|
|
129
|
+
FetchOptionUnsupported,
|
|
130
|
+
NetworkRefusal,
|
|
131
|
+
NetworkRefused,
|
|
135
132
|
ProviderError,
|
|
136
133
|
UpstreamError,
|
|
137
134
|
maxFailureFieldLength,
|
|
138
135
|
maxFailureFields,
|
|
139
136
|
maxFailureMessageLength,
|
|
140
|
-
maxUpstreamMessageLength
|
|
141
|
-
|
|
137
|
+
maxUpstreamMessageLength,
|
|
138
|
+
networkRefusalHeader,
|
|
139
|
+
networkRefusalResponse,
|
|
140
|
+
networkRefusalStatus
|
|
141
|
+
} from "./chunk-DXGWKNTQ.js";
|
|
142
142
|
import {
|
|
143
143
|
AppSkillMetadata,
|
|
144
144
|
AppSkillName,
|
package/js/effect.js
CHANGED
|
@@ -3,19 +3,20 @@ import {
|
|
|
3
3
|
ApprovalDecision,
|
|
4
4
|
createAppHandler,
|
|
5
5
|
prepareElicitation
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-5OM6HBNU.js";
|
|
7
|
+
import "./chunk-Q7Q5JTRW.js";
|
|
8
|
+
import "./chunk-O4QOPXQT.js";
|
|
9
|
+
import "./chunk-EPUWF4ZG.js";
|
|
9
10
|
import "./chunk-OX233L7N.js";
|
|
10
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-QZD2RZ4S.js";
|
|
11
12
|
import "./chunk-5JVNM3CQ.js";
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-QUEPZ67T.js";
|
|
14
|
+
import "./chunk-IU6OK5G2.js";
|
|
14
15
|
import {
|
|
15
16
|
ToolAnnotations
|
|
16
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-DSUKW6KJ.js";
|
|
17
18
|
import "./chunk-UMCMZFXW.js";
|
|
18
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-DXGWKNTQ.js";
|
|
19
20
|
import "./chunk-HW3DPBZR.js";
|
|
20
21
|
import "./chunk-ETLILMHY.js";
|
|
21
22
|
import "./chunk-MFHUR5SB.js";
|