apps 0.0.1-beta.70 → 0.0.1-beta.73

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  prepareElicitation
3
- } from "./chunk-2YSTJMBD.js";
3
+ } from "./chunk-WCVV4PPS.js";
4
4
  import {
5
5
  bodyUpstreamError,
6
6
  fromPromise
@@ -3,7 +3,7 @@ import {
3
3
  answeredError,
4
4
  mcpClient,
5
5
  mcpJsonSchemaValidator
6
- } from "./chunk-WGQP62EG.js";
6
+ } from "./chunk-G7L5DHQX.js";
7
7
  import {
8
8
  failOnNetworkRefusal
9
9
  } from "./chunk-MHB7IFG7.js";
@@ -229,9 +229,11 @@ var OpenapiSkippedOperation = Schema_exports.Struct({
229
229
  var listedReasons = 8;
230
230
  var reasonLength = 240;
231
231
  var cut = (text) => text.length <= reasonLength ? text : `${text.slice(0, reasonLength - 1)}\u2026`;
232
+ var customTool = `To call a left-out operation anyway, write a custom tool for it in this app with the same account: see "Custom tools beside generated ones" in the app-authoring skill's integrations.md.`;
232
233
  var compileMessage = (error) => {
233
234
  const skipped = error.skipped ?? [];
234
235
  if (skipped.length === 0) return error.reason;
236
+ const close = skipped.some(({ code }) => code !== "event_stream") ? ` ${customTool}` : "";
235
237
  const groups = /* @__PURE__ */ new Map();
236
238
  for (const operation of skipped) {
237
239
  const key = JSON.stringify([operation.code, operation.reason]);
@@ -242,12 +244,17 @@ var compileMessage = (error) => {
242
244
  const example = ({ first, count: count2 }) => `${first.method} ${first.path}${count2 > 1 ? ` and ${count2 - 1} more` : ""}`;
243
245
  const [only, ...others] = groups.values();
244
246
  if (only !== void 0 && others.length === 0 && only.first.code === error.code && only.first.reason === error.reason)
245
- return `${error.reason} Left out: ${example(only)}.`;
246
- const listed = [...groups.values()].slice(0, listedReasons);
247
+ return `${error.reason} Left out: ${example(only)}.${close}`;
248
+ const listed = [];
249
+ let room = maxFailureMessageLength - `${error.reason} Left out: ; and ${groups.size} other reasons.${close}`.length;
250
+ for (const group of groups.values()) {
251
+ const text = `${example(group)} (${group.first.code}: ${cut(group.first.reason.replace(/\.$/, ""))})`;
252
+ if (listed.length === listedReasons || text.length + 2 > room) break;
253
+ listed.push(text);
254
+ room -= text.length + 2;
255
+ }
247
256
  const rest = groups.size - listed.length;
248
- return `${error.reason} Left out: ${listed.map(
249
- (group) => `${example(group)} (${group.first.code}: ${cut(group.first.reason.replace(/\.$/, ""))})`
250
- ).join("; ")}${rest > 0 ? `; and ${rest} other reasons` : ""}.`;
257
+ return `${error.reason} Left out: ${listed.join("; ")}${rest > 0 ? `; and ${rest} other reasons` : ""}.${close}`;
251
258
  };
252
259
  var OpenapiCompileError = class extends Schema_exports.TaggedError()(
253
260
  "OpenapiCompileError",
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  fixedRouter
3
- } from "./chunk-4NCIPADO.js";
3
+ } from "./chunk-OBYMFSWA.js";
4
4
  import {
5
5
  nativeOperation,
6
6
  operationDeclaration,
@@ -11,7 +11,7 @@ import {
11
11
  parseSkillLoadFailed,
12
12
  readCatalog,
13
13
  routerSkills
14
- } from "./chunk-4NCIPADO.js";
14
+ } from "./chunk-OBYMFSWA.js";
15
15
  import {
16
16
  appInvocationFetch
17
17
  } from "./chunk-MHB7IFG7.js";
package/js/effect.js CHANGED
@@ -3,9 +3,9 @@ import {
3
3
  ApprovalDecision,
4
4
  createAppHandler,
5
5
  prepareElicitation
6
- } from "./chunk-2YSTJMBD.js";
6
+ } from "./chunk-WCVV4PPS.js";
7
7
  import "./chunk-RUP4JMKO.js";
8
- import "./chunk-4NCIPADO.js";
8
+ import "./chunk-OBYMFSWA.js";
9
9
  import "./chunk-MHB7IFG7.js";
10
10
  import "./chunk-XBG7HHXC.js";
11
11
  import "./chunk-3R3KFCDU.js";
package/js/graphql.js CHANGED
@@ -4,13 +4,13 @@ import {
4
4
  } from "./chunk-ECCWT5GJ.js";
5
5
  import {
6
6
  protocolOperations
7
- } from "./chunk-WDIVWSDG.js";
7
+ } from "./chunk-QGHGYH5V.js";
8
8
  import "./chunk-BCSNKUAC.js";
9
- import "./chunk-2YSTJMBD.js";
9
+ import "./chunk-WCVV4PPS.js";
10
10
  import {
11
11
  cacheKey
12
12
  } from "./chunk-RUP4JMKO.js";
13
- import "./chunk-4NCIPADO.js";
13
+ import "./chunk-OBYMFSWA.js";
14
14
  import {
15
15
  failOnNetworkRefusal
16
16
  } from "./chunk-MHB7IFG7.js";
package/js/host.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  createAppHandler
3
- } from "./chunk-2YSTJMBD.js";
3
+ } from "./chunk-WCVV4PPS.js";
4
4
  import "./chunk-RUP4JMKO.js";
5
- import "./chunk-4NCIPADO.js";
5
+ import "./chunk-OBYMFSWA.js";
6
6
  import "./chunk-MHB7IFG7.js";
7
7
  import "./chunk-XBG7HHXC.js";
8
8
  import "./chunk-3R3KFCDU.js";
package/js/mcp/effect.js CHANGED
@@ -2,12 +2,12 @@ import {
2
2
  mcpClientEffect,
3
3
  mcpHealthEffect,
4
4
  mcpToolsEffect
5
- } from "../chunk-M5OLYYNU.js";
6
- import "../chunk-WGQP62EG.js";
5
+ } from "../chunk-LTF4TLMO.js";
6
+ import "../chunk-G7L5DHQX.js";
7
7
  import "../chunk-BCSNKUAC.js";
8
- import "../chunk-2YSTJMBD.js";
8
+ import "../chunk-WCVV4PPS.js";
9
9
  import "../chunk-RUP4JMKO.js";
10
- import "../chunk-4NCIPADO.js";
10
+ import "../chunk-OBYMFSWA.js";
11
11
  import "../chunk-MHB7IFG7.js";
12
12
  import "../chunk-XBG7HHXC.js";
13
13
  import "../chunk-3R3KFCDU.js";
package/js/mcp/stdio.js CHANGED
@@ -3,14 +3,14 @@ import {
3
3
  answeredError,
4
4
  mcpClient,
5
5
  mcpJsonSchemaValidator
6
- } from "../chunk-WGQP62EG.js";
6
+ } from "../chunk-G7L5DHQX.js";
7
7
  import {
8
8
  protocolRouter
9
- } from "../chunk-WDIVWSDG.js";
9
+ } from "../chunk-QGHGYH5V.js";
10
10
  import "../chunk-BCSNKUAC.js";
11
- import "../chunk-2YSTJMBD.js";
11
+ import "../chunk-WCVV4PPS.js";
12
12
  import "../chunk-RUP4JMKO.js";
13
- import "../chunk-4NCIPADO.js";
13
+ import "../chunk-OBYMFSWA.js";
14
14
  import "../chunk-MHB7IFG7.js";
15
15
  import "../chunk-XBG7HHXC.js";
16
16
  import "../chunk-3R3KFCDU.js";
package/js/mcp.js CHANGED
@@ -1,25 +1,25 @@
1
1
  import {
2
2
  mcpClientEffect,
3
3
  mcpHealthEffect
4
- } from "./chunk-M5OLYYNU.js";
4
+ } from "./chunk-LTF4TLMO.js";
5
5
  import {
6
6
  catalogCache,
7
7
  catalogScope
8
8
  } from "./chunk-ECCWT5GJ.js";
9
9
  import {
10
10
  adaptMcpTool
11
- } from "./chunk-WGQP62EG.js";
11
+ } from "./chunk-G7L5DHQX.js";
12
12
  import {
13
13
  protocolOperations
14
- } from "./chunk-WDIVWSDG.js";
14
+ } from "./chunk-QGHGYH5V.js";
15
15
  import "./chunk-BCSNKUAC.js";
16
- import "./chunk-2YSTJMBD.js";
16
+ import "./chunk-WCVV4PPS.js";
17
17
  import {
18
18
  cacheKey
19
19
  } from "./chunk-RUP4JMKO.js";
20
20
  import {
21
21
  operationDescription
22
- } from "./chunk-4NCIPADO.js";
22
+ } from "./chunk-OBYMFSWA.js";
23
23
  import "./chunk-MHB7IFG7.js";
24
24
  import "./chunk-XBG7HHXC.js";
25
25
  import "./chunk-3R3KFCDU.js";
package/js/openapi.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  import {
9
9
  protocolOperations,
10
10
  protocolRouter
11
- } from "./chunk-WDIVWSDG.js";
11
+ } from "./chunk-QGHGYH5V.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-4NCIPADO.js";
32
+ } from "./chunk-OBYMFSWA.js";
33
33
  import {
34
34
  failOnNetworkRefusal
35
35
  } from "./chunk-MHB7IFG7.js";
@@ -4887,7 +4887,21 @@ var compileOpenApiDocument = (entry, inputDocument, options = {}) => {
4887
4887
  });
4888
4888
  if (request.required) required.push("body");
4889
4889
  }
4890
- const security = operation.security ?? spec.security ?? fallback ?? [];
4890
+ const requirements = operation.security ?? spec.security ?? fallback ?? [];
4891
+ const security = requirements.filter(
4892
+ (requirement) => Object.keys(requirement).every((key) => Object.hasOwn(schemes, key))
4893
+ );
4894
+ if (security.length === 0 && requirements.length > 0) {
4895
+ const undeclared = [
4896
+ ...new Set(
4897
+ requirements.flatMap(Object.keys).filter((key) => !Object.hasOwn(schemes, key))
4898
+ )
4899
+ ];
4900
+ fail2(
4901
+ "auth_method",
4902
+ `Every security requirement names a scheme securitySchemes does not declare: ${undeclared.map((key) => JSON.stringify(key)).join(", ")}. Declare and fill every scheme in one complete alternative (securitySchemes plus methods or oauth).`
4903
+ );
4904
+ }
4891
4905
  for (const requirement of security) {
4892
4906
  const keys = Object.keys(requirement).sort();
4893
4907
  if (!keys.length) continue;
@@ -4936,13 +4950,9 @@ var compileOpenApiDocument = (entry, inputDocument, options = {}) => {
4936
4950
  baseUrl,
4937
4951
  openapi: spec.openapi,
4938
4952
  securitySchemes: Object.fromEntries(
4939
- [...new Set(security.flatMap(Object.keys))].map((key) => [
4940
- key,
4941
- schemes[key] ?? fail2(
4942
- "auth_method",
4943
- `A security requirement names ${JSON.stringify(key)}, which securitySchemes does not declare.`
4944
- )
4945
- ])
4953
+ Object.entries(schemes).filter(
4954
+ ([key]) => security.some((requirement) => Object.hasOwn(requirement, key))
4955
+ )
4946
4956
  ),
4947
4957
  request: {
4948
4958
  parameters: [...parameters.values()].map(({ parameter }) => parameter),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apps",
3
- "version": "0.0.1-beta.70",
3
+ "version": "0.0.1-beta.73",
4
4
  "description": "TypeScript apps with typed tools, accounts, storage, and UI.",
5
5
  "type": "module",
6
6
  "sideEffects": false,