apps 0.0.1-beta.25 → 0.0.1-beta.26
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-VSLWGXPW.js → chunk-4CMJD7AB.js} +1 -1
- package/js/{chunk-VWU6I23D.js → chunk-BTRBOOTD.js} +1 -1
- package/js/{chunk-J3RUZMLO.js → chunk-EXDR4HVM.js} +96 -4
- package/js/{chunk-GG4IFBN3.js → chunk-HIYRKEWP.js} +1 -1
- package/js/{chunk-K3MQX2KO.js → chunk-OI7OI2U3.js} +1 -1
- package/js/effect.js +2 -2
- package/js/graphql.js +3 -3
- package/js/host.js +2 -2
- package/js/mcp/effect.js +4 -4
- package/js/mcp/stdio.js +4 -4
- package/js/mcp.js +5 -5
- package/js/openapi.js +582 -187
- package/package.json +1 -1
- package/runtime.json +1 -1
- package/types/apps/src/contracts/openapi-compile.d.ts +31 -3
- package/types/apps/src/contracts/openapi.d.ts +16 -6
- package/types/apps/src/implementation/openapi-compile.d.ts +12 -2
- package/types/apps/src/implementation/openapi-document.d.ts +20 -6
- package/types/apps/src/implementation/openapi-names.d.ts +9 -4
- package/types/apps/src/implementation/openapi-source.d.ts +6 -0
|
@@ -69,7 +69,8 @@ var OpenapiErrorResponse = Schema_exports.Struct({
|
|
|
69
69
|
});
|
|
70
70
|
var OpenapiParameter = Schema_exports.Struct({
|
|
71
71
|
name: Schema_exports.String,
|
|
72
|
-
|
|
72
|
+
/** OpenAPI 3.2's `querystring` is the whole query string, serialized from one `content` value. */
|
|
73
|
+
in: Schema_exports.Literals(["path", "query", "querystring", "header", "cookie"]),
|
|
73
74
|
required: Schema_exports.optionalKey(Schema_exports.Boolean),
|
|
74
75
|
schema: Schema_exports.optionalKey(JsonObject),
|
|
75
76
|
style: Schema_exports.optionalKey(Schema_exports.String),
|
|
@@ -94,7 +95,7 @@ var OpenapiOperation = Schema_exports.Struct({
|
|
|
94
95
|
/** The document's operationId, when it declares one. `kinds` overrides are keyed by it. */
|
|
95
96
|
operationId: Schema_exports.optionalKey(Schema_exports.String),
|
|
96
97
|
description: Schema_exports.String,
|
|
97
|
-
method: Schema_exports.Literals(["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]),
|
|
98
|
+
method: Schema_exports.Literals(["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS", "QUERY"]),
|
|
98
99
|
path: Schema_exports.String,
|
|
99
100
|
baseUrl: HttpUrl,
|
|
100
101
|
openapi: Schema_exports.String,
|
|
@@ -114,6 +115,7 @@ var OpenapiOperation = Schema_exports.Struct({
|
|
|
114
115
|
outputSchema: Schema_exports.optionalKey(JsonObject),
|
|
115
116
|
errorResponses: Schema_exports.optionalKey(Schema_exports.Array(OpenapiErrorResponse))
|
|
116
117
|
});
|
|
118
|
+
var isOpenapiReadMethod = (method) => method === "GET" || method === "HEAD" || method === "OPTIONS" || method === "QUERY";
|
|
117
119
|
var CredentialBinding = Schema_exports.Struct({
|
|
118
120
|
scheme: Schema_exports.String,
|
|
119
121
|
field: Schema_exports.String,
|
|
@@ -155,7 +157,8 @@ var defaultOpenapiResponseLimits = {
|
|
|
155
157
|
maxBodyBytes: 16777216,
|
|
156
158
|
readTimeoutMs: 3e4
|
|
157
159
|
};
|
|
158
|
-
var
|
|
160
|
+
var isOpenapiJsonSequence = (type) => /^application\/(?:x-)?(?:ndjson|jsonl|jsonlines|json-seq)\s*(?:;|$)/i.test(type);
|
|
161
|
+
var isOpenapiTextMedia = (type) => isOpenapiJsonSequence(type) || /^(?:text\/|application\/(?:[\w.-]+\+)?(?:json|xml)|application\/(?:javascript|x-www-form-urlencoded))/i.test(
|
|
159
162
|
type
|
|
160
163
|
);
|
|
161
164
|
var isOpenapiFileSchema = (shape) => shape.contentMediaType !== void 0 && shape.contentEncoding === void 0 || shape.type === "string" && shape.format === "binary";
|
|
@@ -168,7 +171,84 @@ var openapiBinaryResultSchema = {
|
|
|
168
171
|
required: ["base64", "contentType"],
|
|
169
172
|
additionalProperties: false
|
|
170
173
|
};
|
|
171
|
-
var openapiMediaKind = (type) => type.includes("json") && !type
|
|
174
|
+
var openapiMediaKind = (type) => type.includes("json") && !isOpenapiJsonSequence(type) ? "json" : type === "application/x-www-form-urlencoded" ? "form" : type === "multipart/form-data" ? "multipart" : isOpenapiTextMedia(type) ? "text" : "binary";
|
|
175
|
+
|
|
176
|
+
// src/contracts/openapi-compile.ts
|
|
177
|
+
var OpenapiCompileErrorCode = Schema_exports.Literals([
|
|
178
|
+
"server_protocol",
|
|
179
|
+
"server_url",
|
|
180
|
+
"external_reference",
|
|
181
|
+
"circular_reference",
|
|
182
|
+
"schema_keyword",
|
|
183
|
+
"schema_reference",
|
|
184
|
+
"missing_component",
|
|
185
|
+
"openapi_version",
|
|
186
|
+
"auth_helper",
|
|
187
|
+
"auth_missing",
|
|
188
|
+
"operation_path",
|
|
189
|
+
"operation_method",
|
|
190
|
+
"duplicate_operation",
|
|
191
|
+
"server_missing",
|
|
192
|
+
"multiple_hosts",
|
|
193
|
+
"parameter_encoding",
|
|
194
|
+
"parameter_style",
|
|
195
|
+
"request_body",
|
|
196
|
+
"combined_oauth",
|
|
197
|
+
"auth_method",
|
|
198
|
+
"event_stream",
|
|
199
|
+
"input_schema",
|
|
200
|
+
"no_operations",
|
|
201
|
+
"no_supported_operations",
|
|
202
|
+
"invalid_document",
|
|
203
|
+
"source_generation",
|
|
204
|
+
"authoring_reference"
|
|
205
|
+
]);
|
|
206
|
+
var OpenapiSkippedOperation = Schema_exports.Struct({
|
|
207
|
+
/** The tool name the operation would have; reading that tool reports why it is missing. */
|
|
208
|
+
name: Schema_exports.String,
|
|
209
|
+
/** The HTTP method, such as `GET`. */
|
|
210
|
+
method: Schema_exports.String,
|
|
211
|
+
/** The path as the definition declares it. */
|
|
212
|
+
path: Schema_exports.String,
|
|
213
|
+
code: OpenapiCompileErrorCode,
|
|
214
|
+
reason: Schema_exports.String
|
|
215
|
+
});
|
|
216
|
+
var listedReasons = 8;
|
|
217
|
+
var reasonLength = 240;
|
|
218
|
+
var cut = (text) => text.length <= reasonLength ? text : `${text.slice(0, reasonLength - 1)}\u2026`;
|
|
219
|
+
var compileMessage = (error) => {
|
|
220
|
+
const skipped = error.skipped ?? [];
|
|
221
|
+
if (skipped.length === 0) return error.reason;
|
|
222
|
+
const groups = /* @__PURE__ */ new Map();
|
|
223
|
+
for (const operation of skipped) {
|
|
224
|
+
const key = JSON.stringify([operation.code, operation.reason]);
|
|
225
|
+
const group = groups.get(key);
|
|
226
|
+
if (group === void 0) groups.set(key, { first: operation, count: 1 });
|
|
227
|
+
else group.count++;
|
|
228
|
+
}
|
|
229
|
+
const example = ({ first, count }) => `${first.method} ${first.path}${count > 1 ? ` and ${count - 1} more` : ""}`;
|
|
230
|
+
const [only, ...others] = groups.values();
|
|
231
|
+
if (only !== void 0 && others.length === 0 && only.first.code === error.code && only.first.reason === error.reason)
|
|
232
|
+
return `${error.reason} Left out: ${example(only)}.`;
|
|
233
|
+
const listed = [...groups.values()].slice(0, listedReasons);
|
|
234
|
+
const rest = groups.size - listed.length;
|
|
235
|
+
return `${error.reason} Left out: ${listed.map(
|
|
236
|
+
(group) => `${example(group)} (${group.first.code}: ${cut(group.first.reason.replace(/\.$/, ""))})`
|
|
237
|
+
).join("; ")}${rest > 0 ? `; and ${rest} other reasons` : ""}.`;
|
|
238
|
+
};
|
|
239
|
+
var OpenapiCompileError = class extends Schema_exports.TaggedError()(
|
|
240
|
+
"OpenapiCompileError",
|
|
241
|
+
{
|
|
242
|
+
code: OpenapiCompileErrorCode,
|
|
243
|
+
reason: Schema_exports.String,
|
|
244
|
+
skipped: Schema_exports.optionalKey(Schema_exports.Array(OpenapiSkippedOperation)),
|
|
245
|
+
origins: Schema_exports.optionalKey(Schema_exports.Array(Schema_exports.String))
|
|
246
|
+
}
|
|
247
|
+
) {
|
|
248
|
+
get message() {
|
|
249
|
+
return compileMessage(this);
|
|
250
|
+
}
|
|
251
|
+
};
|
|
172
252
|
|
|
173
253
|
// src/implementation/failure-detail.ts
|
|
174
254
|
var storageMessages = {
|
|
@@ -308,6 +388,13 @@ var failureDetail = (error, secrets) => {
|
|
|
308
388
|
code: error.reason,
|
|
309
389
|
message: error.reason === "request" ? error.status === void 0 ? "The API request failed before a response arrived." : `The API responded with HTTP ${error.status}, which its OpenAPI document does not declare as an error with a message.` : error.reason === "invalid_input" ? "The input could not be encoded as a request for this API operation." : "The API's OpenAPI definition for this operation is invalid."
|
|
310
390
|
};
|
|
391
|
+
if (Schema_exports.is(OpenapiCompileError)(error))
|
|
392
|
+
return {
|
|
393
|
+
source: "app",
|
|
394
|
+
errorName: "OpenapiCompileError",
|
|
395
|
+
code: error.code,
|
|
396
|
+
message: boundFailureMessage(error.message, secrets)
|
|
397
|
+
};
|
|
311
398
|
if (error instanceof Error) {
|
|
312
399
|
const code = ownCode(error, secrets);
|
|
313
400
|
const fields = ownFields(error, code, secrets);
|
|
@@ -567,13 +654,18 @@ export {
|
|
|
567
654
|
OpenapiParameter,
|
|
568
655
|
OpenapiRequestBody,
|
|
569
656
|
OpenapiOperation,
|
|
657
|
+
isOpenapiReadMethod,
|
|
570
658
|
OpenapiToolsOptions,
|
|
571
659
|
OpenapiError,
|
|
572
660
|
defaultOpenapiResponseLimits,
|
|
661
|
+
isOpenapiJsonSequence,
|
|
573
662
|
isOpenapiTextMedia,
|
|
574
663
|
isOpenapiFileSchema,
|
|
575
664
|
openapiBinaryResultSchema,
|
|
576
665
|
openapiMediaKind,
|
|
666
|
+
OpenapiCompileErrorCode,
|
|
667
|
+
OpenapiSkippedOperation,
|
|
668
|
+
OpenapiCompileError,
|
|
577
669
|
accountSecrets,
|
|
578
670
|
boundFailureMessage,
|
|
579
671
|
leavingProviderError,
|
package/js/effect.js
CHANGED
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
ApprovalDecision,
|
|
4
4
|
createAppHandler,
|
|
5
5
|
prepareElicitation
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-BTRBOOTD.js";
|
|
7
7
|
import "./chunk-ZVMZWXVF.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-EXDR4HVM.js";
|
|
9
9
|
import "./chunk-PC5RHPUP.js";
|
|
10
10
|
import "./chunk-NXO2GN2T.js";
|
|
11
11
|
import "./chunk-LPN4ONWW.js";
|
package/js/graphql.js
CHANGED
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
} from "./chunk-XIRAIB3P.js";
|
|
5
5
|
import {
|
|
6
6
|
protocolOperations
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-OI7OI2U3.js";
|
|
8
8
|
import "./chunk-BCSNKUAC.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-BTRBOOTD.js";
|
|
10
10
|
import {
|
|
11
11
|
cacheKey
|
|
12
12
|
} from "./chunk-ZVMZWXVF.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-EXDR4HVM.js";
|
|
14
14
|
import "./chunk-PC5RHPUP.js";
|
|
15
15
|
import "./chunk-NXO2GN2T.js";
|
|
16
16
|
import "./chunk-LPN4ONWW.js";
|
package/js/host.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createAppHandler
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BTRBOOTD.js";
|
|
4
4
|
import "./chunk-ZVMZWXVF.js";
|
|
5
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-EXDR4HVM.js";
|
|
6
6
|
import "./chunk-PC5RHPUP.js";
|
|
7
7
|
import "./chunk-NXO2GN2T.js";
|
|
8
8
|
import "./chunk-LPN4ONWW.js";
|
package/js/mcp/effect.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
mcpClientEffect,
|
|
3
3
|
mcpToolsEffect
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-HIYRKEWP.js";
|
|
5
|
+
import "../chunk-4CMJD7AB.js";
|
|
6
6
|
import "../chunk-BCSNKUAC.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-BTRBOOTD.js";
|
|
8
8
|
import "../chunk-ZVMZWXVF.js";
|
|
9
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-EXDR4HVM.js";
|
|
10
10
|
import "../chunk-PC5RHPUP.js";
|
|
11
11
|
import "../chunk-NXO2GN2T.js";
|
|
12
12
|
import "../chunk-LPN4ONWW.js";
|
package/js/mcp/stdio.js
CHANGED
|
@@ -3,14 +3,14 @@ import {
|
|
|
3
3
|
answeredError,
|
|
4
4
|
mcpClient,
|
|
5
5
|
mcpJsonSchemaValidator
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-4CMJD7AB.js";
|
|
7
7
|
import {
|
|
8
8
|
protocolRouter
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-OI7OI2U3.js";
|
|
10
10
|
import "../chunk-BCSNKUAC.js";
|
|
11
|
-
import "../chunk-
|
|
11
|
+
import "../chunk-BTRBOOTD.js";
|
|
12
12
|
import "../chunk-ZVMZWXVF.js";
|
|
13
|
-
import "../chunk-
|
|
13
|
+
import "../chunk-EXDR4HVM.js";
|
|
14
14
|
import "../chunk-PC5RHPUP.js";
|
|
15
15
|
import "../chunk-NXO2GN2T.js";
|
|
16
16
|
import "../chunk-LPN4ONWW.js";
|
package/js/mcp.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
mcpClientEffect
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-HIYRKEWP.js";
|
|
4
4
|
import {
|
|
5
5
|
catalogCache,
|
|
6
6
|
catalogScope
|
|
7
7
|
} from "./chunk-XIRAIB3P.js";
|
|
8
8
|
import {
|
|
9
9
|
adaptMcpTool
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-4CMJD7AB.js";
|
|
11
11
|
import {
|
|
12
12
|
protocolOperations
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-OI7OI2U3.js";
|
|
14
14
|
import "./chunk-BCSNKUAC.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-BTRBOOTD.js";
|
|
16
16
|
import {
|
|
17
17
|
cacheKey
|
|
18
18
|
} from "./chunk-ZVMZWXVF.js";
|
|
19
19
|
import {
|
|
20
20
|
operationDescription
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-EXDR4HVM.js";
|
|
22
22
|
import "./chunk-PC5RHPUP.js";
|
|
23
23
|
import "./chunk-NXO2GN2T.js";
|
|
24
24
|
import "./chunk-LPN4ONWW.js";
|