apps 0.0.1-beta.70 → 0.0.1-beta.74

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-UCQBJUA5.js";
4
4
  import {
5
5
  bodyUpstreamError,
6
6
  fromPromise
@@ -16,7 +16,7 @@ import {
16
16
  defaultElicitationLimits,
17
17
  defaultMcpClientLimits,
18
18
  mcpSdkTimerCeilingMs
19
- } from "./chunk-JW5LYSER.js";
19
+ } from "./chunk-F2OAC6GE.js";
20
20
  import {
21
21
  jsonSchemaDecoder,
22
22
  nestJsonSchema,
@@ -3,7 +3,7 @@ import {
3
3
  answeredError,
4
4
  mcpClient,
5
5
  mcpJsonSchemaValidator
6
- } from "./chunk-WGQP62EG.js";
6
+ } from "./chunk-2QWOG4UJ.js";
7
7
  import {
8
8
  failOnNetworkRefusal
9
9
  } from "./chunk-MHB7IFG7.js";
@@ -20,7 +20,7 @@ import {
20
20
  McpToolsOptions,
21
21
  defaultMcpClientLimits,
22
22
  mcpHealthReserveMs
23
- } from "./chunk-JW5LYSER.js";
23
+ } from "./chunk-F2OAC6GE.js";
24
24
  import {
25
25
  NetworkRefused,
26
26
  ProviderError
@@ -515,9 +515,9 @@ var Proto = {
515
515
  middlewares: /* @__PURE__ */ new Set([...this.middlewares, middleware])
516
516
  });
517
517
  },
518
- prefix(prefix) {
518
+ prefix(prefix2) {
519
519
  return makeProto({
520
- _tag: `${prefix}${this._tag}`,
520
+ _tag: `${prefix2}${this._tag}`,
521
521
  payloadSchema: this.payloadSchema,
522
522
  successSchema: this.successSchema,
523
523
  errorSchema: this.errorSchema,
@@ -1799,14 +1799,94 @@ var ApprovalResponse = ElicitationResponse.check(
1799
1799
  (response) => response.action !== "accept" || response.content === void 0 || Object.keys(response.content).length === 0
1800
1800
  )
1801
1801
  );
1802
- var approvalElicitation = (toolName, input) => ({
1802
+ var approvalPreviewChars = 4e3;
1803
+ var shortestKept = 32;
1804
+ var isHigh = (unit) => unit >= 55296 && unit <= 56319;
1805
+ var isLow = (unit) => unit >= 56320 && unit <= 57343;
1806
+ var prefix = (text, length) => text.slice(0, isHigh(text.charCodeAt(length - 1)) ? length - 1 : length);
1807
+ var isArray = (value) => Array.isArray(value);
1808
+ var characters = (text) => {
1809
+ let pairs = 0;
1810
+ for (let index = 1; index < text.length; index += 1)
1811
+ if (isLow(text.charCodeAt(index)) && isHigh(text.charCodeAt(index - 1))) pairs += 1;
1812
+ return text.length - pairs;
1813
+ };
1814
+ var emit = (output, text) => {
1815
+ output.parts.push(text);
1816
+ output.room -= text.length;
1817
+ };
1818
+ var write = (value, keep, indent, output) => {
1819
+ if (typeof value === "string") {
1820
+ if (value.length > keep)
1821
+ emit(output, `${JSON.stringify(prefix(value, keep))}\u2026 (${characters(value)} characters)`);
1822
+ else
1823
+ emit(
1824
+ output,
1825
+ JSON.stringify(value.length > output.room ? prefix(value, output.room + 1) : value)
1826
+ );
1827
+ return;
1828
+ }
1829
+ if (typeof value !== "object" || value === null) return emit(output, JSON.stringify(value));
1830
+ const inner = `${indent} `;
1831
+ const member = (index, key, entry) => {
1832
+ emit(
1833
+ output,
1834
+ `${index === 0 ? "" : ","}
1835
+ ${inner}${key === void 0 ? "" : `${JSON.stringify(key)}: `}`
1836
+ );
1837
+ if (output.room >= 0) write(entry, keep, inner, output);
1838
+ return output.room >= 0;
1839
+ };
1840
+ if (isArray(value)) {
1841
+ if (value.length === 0) return emit(output, "[]");
1842
+ emit(output, "[");
1843
+ value.every((entry, index) => member(index, void 0, entry));
1844
+ return emit(output, `
1845
+ ${indent}]`);
1846
+ }
1847
+ const entries = Object.entries(value);
1848
+ if (entries.length === 0) return emit(output, "{}");
1849
+ emit(output, "{");
1850
+ entries.every(([key, entry], index) => member(index, key, entry));
1851
+ emit(output, `
1852
+ ${indent}}`);
1853
+ };
1854
+ var printed = (value, keep, room) => {
1855
+ const output = { parts: [], room };
1856
+ write(value, keep, "", output);
1857
+ return { text: output.parts.join(""), fits: output.room >= 0 };
1858
+ };
1859
+ var shortened = (input) => {
1860
+ let keep = approvalPreviewChars / 2;
1861
+ let shown = printed(input, keep, approvalPreviewChars);
1862
+ while (!shown.fits && keep > shortestKept) {
1863
+ keep = Math.max(shortestKept, Math.floor(keep / 2));
1864
+ shown = printed(input, keep, approvalPreviewChars);
1865
+ }
1866
+ return shown.fits ? shown.text : `${prefix(shown.text, approvalPreviewChars)}
1867
+ \u2026 (the rest is not shown)`;
1868
+ };
1869
+ var consent = (toolName, shown) => ({
1803
1870
  mode: "form",
1804
1871
  message: `Approve ${toolName}?
1805
1872
 
1806
- Arguments:
1807
- ${JSON.stringify(input, null, 2)}`,
1873
+ ${shown}`,
1808
1874
  requestedSchema: { type: "object", properties: {} }
1809
1875
  });
1876
+ var exactApprovalElicitation = (toolName, input, maxChars) => {
1877
+ const exact = printed(input, Number.POSITIVE_INFINITY, maxChars);
1878
+ return exact.fits ? consent(toolName, `Arguments:
1879
+ ${exact.text}`) : void 0;
1880
+ };
1881
+ var approvalElicitation = (toolName, input) => {
1882
+ const exact = exactApprovalElicitation(toolName, input, approvalPreviewChars);
1883
+ if (exact !== void 0) return exact;
1884
+ return consent(
1885
+ toolName,
1886
+ `Arguments, shortened for review. Approving runs the call with the complete arguments:
1887
+ ${shortened(input)}`
1888
+ );
1889
+ };
1810
1890
 
1811
1891
  // src/contracts/router.ts
1812
1892
  var reservedRouterKeys = /* @__PURE__ */ new Set([
@@ -4324,6 +4404,7 @@ export {
4324
4404
  ElicitationReply,
4325
4405
  ApprovalElicitation,
4326
4406
  ApprovalResponse,
4407
+ exactApprovalElicitation,
4327
4408
  approvalElicitation,
4328
4409
  reservedRouterKeys,
4329
4410
  RouterKey,
@@ -2,7 +2,7 @@ import {
2
2
  declaredOperations,
3
3
  nativeOperation,
4
4
  nativeRouter
5
- } from "./chunk-ZEJ3IKEC.js";
5
+ } from "./chunk-OABWTKGG.js";
6
6
  import {
7
7
  fromPromise,
8
8
  method
@@ -16,7 +16,7 @@ import {
16
16
  normalizePlacements,
17
17
  placementFields,
18
18
  renderPlacement
19
- } from "./chunk-JW5LYSER.js";
19
+ } from "./chunk-F2OAC6GE.js";
20
20
  import {
21
21
  decoderOf,
22
22
  isSchema,
@@ -6,7 +6,7 @@ import {
6
6
  RouterKey,
7
7
  RouterMeta,
8
8
  reservedRouterKeys
9
- } from "./chunk-JW5LYSER.js";
9
+ } from "./chunk-F2OAC6GE.js";
10
10
  import {
11
11
  decoderOf,
12
12
  schemaArgument
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  fixedRouter
3
- } from "./chunk-4NCIPADO.js";
3
+ } from "./chunk-TSPJFGA6.js";
4
4
  import {
5
5
  nativeOperation,
6
6
  operationDeclaration,
7
7
  routerDeclaration
8
- } from "./chunk-ZEJ3IKEC.js";
8
+ } from "./chunk-OABWTKGG.js";
9
9
 
10
10
  // src/implementation/protocol-operations.ts
11
11
  var protocolOperations = (operations, kinds = {}) => {
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  joinPath,
6
6
  mergeMeta
7
- } from "./chunk-ZEJ3IKEC.js";
7
+ } from "./chunk-OABWTKGG.js";
8
8
  import {
9
9
  isShortenedUpstream,
10
10
  parseProviderError,
@@ -21,7 +21,7 @@ import {
21
21
  McpError,
22
22
  McpError2,
23
23
  SkillLoadFailed as SkillLoadFailed2
24
- } from "./chunk-JW5LYSER.js";
24
+ } from "./chunk-F2OAC6GE.js";
25
25
  import {
26
26
  CacheError,
27
27
  FailureCode,
@@ -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",
@@ -11,7 +11,7 @@ import {
11
11
  parseSkillLoadFailed,
12
12
  readCatalog,
13
13
  routerSkills
14
- } from "./chunk-4NCIPADO.js";
14
+ } from "./chunk-TSPJFGA6.js";
15
15
  import {
16
16
  appInvocationFetch
17
17
  } from "./chunk-MHB7IFG7.js";
@@ -25,12 +25,12 @@ import {
25
25
  makeEmitter,
26
26
  toEffectApp,
27
27
  withPlacements
28
- } from "./chunk-3R3KFCDU.js";
28
+ } from "./chunk-JSWN4D6V.js";
29
29
  import {
30
30
  declaredOperations,
31
31
  locate,
32
32
  nativeOperation
33
- } from "./chunk-ZEJ3IKEC.js";
33
+ } from "./chunk-OABWTKGG.js";
34
34
  import {
35
35
  accountProviderError,
36
36
  appCode,
@@ -91,7 +91,7 @@ import {
91
91
  reservedTablePrefix,
92
92
  sqlBindingsLimit,
93
93
  workflowDurationMillis
94
- } from "./chunk-JW5LYSER.js";
94
+ } from "./chunk-F2OAC6GE.js";
95
95
  import {
96
96
  CacheError
97
97
  } from "./chunk-7LMU3ER3.js";
package/js/contracts.js CHANGED
@@ -119,6 +119,7 @@ import {
119
119
  defaultEventLimits,
120
120
  defaultMcpClientLimits,
121
121
  defaultWebhookTransportLimits,
122
+ exactApprovalElicitation,
122
123
  frameworkProtocol,
123
124
  indexCommand,
124
125
  inspectCommand,
@@ -145,7 +146,7 @@ import {
145
146
  skillCatalog,
146
147
  skillsCommand,
147
148
  workflowDurationMillis
148
- } from "./chunk-JW5LYSER.js";
149
+ } from "./chunk-F2OAC6GE.js";
149
150
  import {
150
151
  FailureCode,
151
152
  FailureDetail,
@@ -334,6 +335,7 @@ export {
334
335
  defaultEventLimits,
335
336
  defaultMcpClientLimits,
336
337
  defaultWebhookTransportLimits,
338
+ exactApprovalElicitation,
337
339
  frameworkProtocol,
338
340
  indexCommand,
339
341
  inspectCommand,
package/js/effect.js CHANGED
@@ -3,17 +3,17 @@ import {
3
3
  ApprovalDecision,
4
4
  createAppHandler,
5
5
  prepareElicitation
6
- } from "./chunk-2YSTJMBD.js";
6
+ } from "./chunk-UCQBJUA5.js";
7
7
  import "./chunk-RUP4JMKO.js";
8
- import "./chunk-4NCIPADO.js";
8
+ import "./chunk-TSPJFGA6.js";
9
9
  import "./chunk-MHB7IFG7.js";
10
10
  import "./chunk-XBG7HHXC.js";
11
- import "./chunk-3R3KFCDU.js";
12
- import "./chunk-ZEJ3IKEC.js";
11
+ import "./chunk-JSWN4D6V.js";
12
+ import "./chunk-OABWTKGG.js";
13
13
  import "./chunk-ZR7QAG67.js";
14
14
  import {
15
15
  ToolAnnotations
16
- } from "./chunk-JW5LYSER.js";
16
+ } from "./chunk-F2OAC6GE.js";
17
17
  import "./chunk-7LMU3ER3.js";
18
18
  import "./chunk-H72MEDMN.js";
19
19
  import {
package/js/graphql.js CHANGED
@@ -4,28 +4,28 @@ import {
4
4
  } from "./chunk-ECCWT5GJ.js";
5
5
  import {
6
6
  protocolOperations
7
- } from "./chunk-WDIVWSDG.js";
7
+ } from "./chunk-PZ535RJX.js";
8
8
  import "./chunk-BCSNKUAC.js";
9
- import "./chunk-2YSTJMBD.js";
9
+ import "./chunk-UCQBJUA5.js";
10
10
  import {
11
11
  cacheKey
12
12
  } from "./chunk-RUP4JMKO.js";
13
- import "./chunk-4NCIPADO.js";
13
+ import "./chunk-TSPJFGA6.js";
14
14
  import {
15
15
  failOnNetworkRefusal
16
16
  } from "./chunk-MHB7IFG7.js";
17
17
  import "./chunk-XBG7HHXC.js";
18
- import "./chunk-3R3KFCDU.js";
18
+ import "./chunk-JSWN4D6V.js";
19
19
  import {
20
20
  nativeOperation,
21
21
  routerDeclaration
22
- } from "./chunk-ZEJ3IKEC.js";
22
+ } from "./chunk-OABWTKGG.js";
23
23
  import {
24
24
  accountProviderError,
25
25
  graphqlProviderError,
26
26
  httpProviderError
27
27
  } from "./chunk-ZR7QAG67.js";
28
- import "./chunk-JW5LYSER.js";
28
+ import "./chunk-F2OAC6GE.js";
29
29
  import {
30
30
  NetworkRefused,
31
31
  ProviderError
package/js/host.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  createAppHandler
3
- } from "./chunk-2YSTJMBD.js";
3
+ } from "./chunk-UCQBJUA5.js";
4
4
  import "./chunk-RUP4JMKO.js";
5
- import "./chunk-4NCIPADO.js";
5
+ import "./chunk-TSPJFGA6.js";
6
6
  import "./chunk-MHB7IFG7.js";
7
7
  import "./chunk-XBG7HHXC.js";
8
- import "./chunk-3R3KFCDU.js";
9
- import "./chunk-ZEJ3IKEC.js";
8
+ import "./chunk-JSWN4D6V.js";
9
+ import "./chunk-OABWTKGG.js";
10
10
  import "./chunk-ZR7QAG67.js";
11
11
  import {
12
12
  ElicitationFailed,
@@ -22,7 +22,7 @@ import {
22
22
  WorkflowRun,
23
23
  WorkflowRunId,
24
24
  WorkflowRunPage
25
- } from "./chunk-JW5LYSER.js";
25
+ } from "./chunk-F2OAC6GE.js";
26
26
  import {
27
27
  CacheCommand,
28
28
  CacheError,
package/js/index.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  query,
12
12
  t,
13
13
  workflow
14
- } from "./chunk-3R3KFCDU.js";
14
+ } from "./chunk-JSWN4D6V.js";
15
15
  import {
16
16
  dynamicRouter,
17
17
  mutation,
@@ -24,7 +24,7 @@ import {
24
24
  toolAnnotations,
25
25
  withApproval,
26
26
  withApprovals
27
- } from "./chunk-ZEJ3IKEC.js";
27
+ } from "./chunk-OABWTKGG.js";
28
28
  import {
29
29
  accountProviderError,
30
30
  fromPromise
@@ -43,7 +43,7 @@ import {
43
43
  ScheduleTiming,
44
44
  SecretsMethod,
45
45
  WorkflowFailure
46
- } from "./chunk-JW5LYSER.js";
46
+ } from "./chunk-F2OAC6GE.js";
47
47
  import {
48
48
  CacheError,
49
49
  FetchOptionUnsupported,
package/js/mcp/effect.js CHANGED
@@ -2,18 +2,18 @@ import {
2
2
  mcpClientEffect,
3
3
  mcpHealthEffect,
4
4
  mcpToolsEffect
5
- } from "../chunk-M5OLYYNU.js";
6
- import "../chunk-WGQP62EG.js";
5
+ } from "../chunk-AE45SVBH.js";
6
+ import "../chunk-2QWOG4UJ.js";
7
7
  import "../chunk-BCSNKUAC.js";
8
- import "../chunk-2YSTJMBD.js";
8
+ import "../chunk-UCQBJUA5.js";
9
9
  import "../chunk-RUP4JMKO.js";
10
- import "../chunk-4NCIPADO.js";
10
+ import "../chunk-TSPJFGA6.js";
11
11
  import "../chunk-MHB7IFG7.js";
12
12
  import "../chunk-XBG7HHXC.js";
13
- import "../chunk-3R3KFCDU.js";
14
- import "../chunk-ZEJ3IKEC.js";
13
+ import "../chunk-JSWN4D6V.js";
14
+ import "../chunk-OABWTKGG.js";
15
15
  import "../chunk-ZR7QAG67.js";
16
- import "../chunk-JW5LYSER.js";
16
+ import "../chunk-F2OAC6GE.js";
17
17
  import "../chunk-7LMU3ER3.js";
18
18
  import "../chunk-H72MEDMN.js";
19
19
  import "../chunk-KGCTYL2S.js";
package/js/mcp/stdio.js CHANGED
@@ -3,23 +3,23 @@ import {
3
3
  answeredError,
4
4
  mcpClient,
5
5
  mcpJsonSchemaValidator
6
- } from "../chunk-WGQP62EG.js";
6
+ } from "../chunk-2QWOG4UJ.js";
7
7
  import {
8
8
  protocolRouter
9
- } from "../chunk-WDIVWSDG.js";
9
+ } from "../chunk-PZ535RJX.js";
10
10
  import "../chunk-BCSNKUAC.js";
11
- import "../chunk-2YSTJMBD.js";
11
+ import "../chunk-UCQBJUA5.js";
12
12
  import "../chunk-RUP4JMKO.js";
13
- import "../chunk-4NCIPADO.js";
13
+ import "../chunk-TSPJFGA6.js";
14
14
  import "../chunk-MHB7IFG7.js";
15
15
  import "../chunk-XBG7HHXC.js";
16
- import "../chunk-3R3KFCDU.js";
17
- import "../chunk-ZEJ3IKEC.js";
16
+ import "../chunk-JSWN4D6V.js";
17
+ import "../chunk-OABWTKGG.js";
18
18
  import "../chunk-ZR7QAG67.js";
19
19
  import {
20
20
  McpError,
21
21
  ProcessConfig
22
- } from "../chunk-JW5LYSER.js";
22
+ } from "../chunk-F2OAC6GE.js";
23
23
  import "../chunk-7LMU3ER3.js";
24
24
  import "../chunk-H72MEDMN.js";
25
25
  import "../chunk-KGCTYL2S.js";
package/js/mcp.js CHANGED
@@ -1,32 +1,32 @@
1
1
  import {
2
2
  mcpClientEffect,
3
3
  mcpHealthEffect
4
- } from "./chunk-M5OLYYNU.js";
4
+ } from "./chunk-AE45SVBH.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-2QWOG4UJ.js";
12
12
  import {
13
13
  protocolOperations
14
- } from "./chunk-WDIVWSDG.js";
14
+ } from "./chunk-PZ535RJX.js";
15
15
  import "./chunk-BCSNKUAC.js";
16
- import "./chunk-2YSTJMBD.js";
16
+ import "./chunk-UCQBJUA5.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-TSPJFGA6.js";
23
23
  import "./chunk-MHB7IFG7.js";
24
24
  import "./chunk-XBG7HHXC.js";
25
- import "./chunk-3R3KFCDU.js";
25
+ import "./chunk-JSWN4D6V.js";
26
26
  import {
27
27
  nativeOperation,
28
28
  routerDeclaration
29
- } from "./chunk-ZEJ3IKEC.js";
29
+ } from "./chunk-OABWTKGG.js";
30
30
  import {
31
31
  fromPromise,
32
32
  method
@@ -37,7 +37,7 @@ import {
37
37
  McpServerHeader,
38
38
  McpToolMetadata,
39
39
  McpToolsOptions
40
- } from "./chunk-JW5LYSER.js";
40
+ } from "./chunk-F2OAC6GE.js";
41
41
  import "./chunk-7LMU3ER3.js";
42
42
  import "./chunk-H72MEDMN.js";
43
43
  import "./chunk-KGCTYL2S.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-PZ535RJX.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-TSPJFGA6.js";
33
33
  import {
34
34
  failOnNetworkRefusal
35
35
  } from "./chunk-MHB7IFG7.js";
@@ -37,7 +37,7 @@ import "./chunk-XBG7HHXC.js";
37
37
  import {
38
38
  nativeOperation,
39
39
  routerDeclaration
40
- } from "./chunk-ZEJ3IKEC.js";
40
+ } from "./chunk-OABWTKGG.js";
41
41
  import {
42
42
  accountProviderError,
43
43
  bodyUpstreamError,
@@ -53,7 +53,7 @@ import {
53
53
  OpenapiResponseError,
54
54
  RouterMeta,
55
55
  defaultOpenapiErrorLimits
56
- } from "./chunk-JW5LYSER.js";
56
+ } from "./chunk-F2OAC6GE.js";
57
57
  import {
58
58
  NetworkRefused,
59
59
  ProviderError,
@@ -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.74",
4
4
  "description": "TypeScript apps with typed tools, accounts, storage, and UI.",
5
5
  "type": "module",
6
6
  "sideEffects": false,