apps 0.0.1-beta.4 → 0.0.1-beta.6

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.
Files changed (96) hide show
  1. package/README.md +65 -43
  2. package/framework-reference.json +1 -1
  3. package/js/{chunk-SATWJKN6.js → chunk-27F7W2LG.js} +1 -1
  4. package/js/{chunk-HDJH3RPR.js → chunk-57RKNWL2.js} +2 -2
  5. package/js/{chunk-WFSQXYUT.js → chunk-5T57N25Q.js} +15 -3
  6. package/js/{chunk-EQB7JMAL.js → chunk-6BSSI67S.js} +8 -8
  7. package/js/{chunk-3M2MEDNL.js → chunk-B3EOZTK3.js} +351 -33
  8. package/js/{chunk-FW5HBOIK.js → chunk-CDL5PM2Q.js} +307 -169
  9. package/js/{chunk-Z5NMEGJN.js → chunk-ECQFRCH4.js} +21 -9
  10. package/js/{chunk-G7ZIRKMK.js → chunk-IJX4CYZO.js} +3 -3
  11. package/js/{chunk-FDNTX5QJ.js → chunk-IPI4MFSN.js} +2 -2
  12. package/js/{chunk-2VPJHFOU.js → chunk-ITM77QPO.js} +28 -9
  13. package/js/{chunk-YEJOQEII.js → chunk-JU7VHODU.js} +1 -1
  14. package/js/{chunk-NQ3OMCA5.js → chunk-KUMBKVJD.js} +2 -2
  15. package/js/{chunk-EVJUVWN2.js → chunk-M3B3DE4K.js} +2 -2
  16. package/js/{chunk-ZJWDMTE3.js → chunk-MKWZPDR6.js} +3 -3
  17. package/js/chunk-MNMNLXBL.js +507 -0
  18. package/js/{chunk-BMOIAIVR.js → chunk-N7YDVXYJ.js} +49 -1
  19. package/js/{chunk-D47C7KG5.js → chunk-NKLWZJLE.js} +2 -2
  20. package/js/{chunk-DHUDODG5.js → chunk-OE3QQTSB.js} +41 -32
  21. package/js/{chunk-M6ZRRIBI.js → chunk-PJJ24GU7.js} +1 -1
  22. package/js/{chunk-FZJOYIZO.js → chunk-PZB6T6KU.js} +1 -1
  23. package/js/{chunk-LGIYBDWA.js → chunk-R3EV5FTO.js} +13 -1
  24. package/js/{chunk-5MQZEB6Y.js → chunk-RFVIONFX.js} +29 -12
  25. package/js/{chunk-ZCAMUXSG.js → chunk-RJDDBDSN.js} +3 -3
  26. package/js/{chunk-6VRYO2BG.js → chunk-SB4HEPNJ.js} +191 -170
  27. package/js/chunk-T7GKZBLP.js +209 -0
  28. package/js/{chunk-QKHR7BMF.js → chunk-UK573G7W.js} +1 -1
  29. package/js/{chunk-T2LAZCAD.js → chunk-VFZKSM3T.js} +1 -1
  30. package/js/{chunk-PLCMJREA.js → chunk-ZQINWV4W.js} +60 -20
  31. package/js/client.js +10 -10
  32. package/js/contracts.js +52 -16
  33. package/js/effect.js +19 -20
  34. package/js/graphql.js +34 -40
  35. package/js/host.js +19 -20
  36. package/js/index.js +189 -178
  37. package/js/mcp/effect.js +21 -22
  38. package/js/mcp/stdio.js +25 -26
  39. package/js/mcp.js +60 -45
  40. package/js/openapi.js +182 -224
  41. package/js/react.js +3 -3
  42. package/js/skills/effect.js +3 -3
  43. package/js/skills.js +12 -13
  44. package/js/storage/facet.js +4 -4
  45. package/js/ui/auth/contracts.js +2 -2
  46. package/js/ui/auth.js +5 -5
  47. package/js/ui/contracts.js +4 -4
  48. package/js/ui/serving.js +8 -8
  49. package/package.json +1 -1
  50. package/runtime.json +1 -1
  51. package/types/app-data/src/contracts/database.d.ts +33 -6
  52. package/types/app-data/src/implementation/schema.d.ts +2 -17
  53. package/types/apps/src/contracts/app.d.ts +2 -5
  54. package/types/apps/src/contracts/failure.d.ts +25 -0
  55. package/types/apps/src/contracts/host.d.ts +18 -9
  56. package/types/apps/src/contracts/mcp.d.ts +16 -0
  57. package/types/apps/src/contracts/openapi.d.ts +5 -1
  58. package/types/apps/src/contracts/operations.d.ts +0 -5
  59. package/types/apps/src/contracts/protocol-version.d.ts +2 -2
  60. package/types/apps/src/contracts/protocols/1.d.ts +15 -1
  61. package/types/apps/src/contracts/protocols/2.d.ts +2 -2
  62. package/types/apps/src/contracts/protocols/3.d.ts +676 -0
  63. package/types/apps/src/contracts/protocols/4.d.ts +1229 -0
  64. package/types/apps/src/contracts/router.d.ts +59 -0
  65. package/types/apps/src/contracts/storage.d.ts +3 -3
  66. package/types/apps/src/contracts/workflows.d.ts +34 -3
  67. package/types/apps/src/graphql.d.ts +1 -3
  68. package/types/apps/src/implementation/account-router.d.ts +12 -0
  69. package/types/apps/src/implementation/app.d.ts +5 -4
  70. package/types/apps/src/implementation/catalog-cache.d.ts +9 -2
  71. package/types/apps/src/implementation/elicitation.d.ts +1 -1
  72. package/types/apps/src/implementation/failure-detail.d.ts +25 -0
  73. package/types/apps/src/implementation/graphql-catalog.d.ts +1 -4
  74. package/types/apps/src/implementation/mcp-catalog.d.ts +1 -4
  75. package/types/apps/src/implementation/mcp-client.d.ts +35 -19
  76. package/types/apps/src/implementation/mcp.d.ts +35 -19
  77. package/types/apps/src/implementation/openapi-compile.d.ts +2 -1
  78. package/types/apps/src/implementation/openapi-source.d.ts +2 -6
  79. package/types/apps/src/implementation/operations.d.ts +26 -3
  80. package/types/apps/src/implementation/protocol-operations.d.ts +3 -4
  81. package/types/apps/src/implementation/router-catalog.d.ts +225 -0
  82. package/types/apps/src/implementation/router.d.ts +59 -0
  83. package/types/apps/src/implementation/schema.d.ts +5 -1
  84. package/types/apps/src/implementation/storage.d.ts +5 -3
  85. package/types/apps/src/implementation/webhooks.d.ts +1 -1
  86. package/types/apps/src/implementation/workflow-context.d.ts +11 -3
  87. package/types/apps/src/index.d.ts +3 -2
  88. package/types/apps/src/mcp-stdio.d.ts +2 -5
  89. package/types/apps/src/mcp.d.ts +5 -4
  90. package/types/apps/src/openapi.d.ts +6 -6
  91. package/js/chunk-PYUYJRSK.js +0 -93
  92. package/js/chunk-SWPD52J7.js +0 -35
  93. package/js/chunk-W7D7WVSY.js +0 -18
  94. package/types/apps/src/contracts/dynamic-tools.d.ts +0 -13
  95. package/types/apps/src/implementation/account-operations.d.ts +0 -151
  96. package/types/apps/src/implementation/dynamic-tools.d.ts +0 -8
package/js/openapi.js CHANGED
@@ -2,46 +2,65 @@ import {
2
2
  parse
3
3
  } from "./chunk-UVL56Z6E.js";
4
4
  import {
5
- protocolOperations
6
- } from "./chunk-Z5NMEGJN.js";
5
+ protocolOperations,
6
+ protocolRouter
7
+ } from "./chunk-ECQFRCH4.js";
8
+ import {
9
+ OpenapiError,
10
+ OpenapiErrorResponse,
11
+ OpenapiOperation,
12
+ OpenapiParameter,
13
+ OpenapiRequestBody,
14
+ OpenapiToolsOptions,
15
+ defaultOpenapiResponseLimits,
16
+ isOpenapiFileSchema,
17
+ isOpenapiTextMedia,
18
+ openapiBinaryResultSchema,
19
+ openapiMediaKind
20
+ } from "./chunk-MNMNLXBL.js";
21
+ import "./chunk-IPI4MFSN.js";
7
22
  import {
8
23
  fromPromise,
9
24
  nativeOperation,
25
+ routerDeclaration,
10
26
  toPromise
11
- } from "./chunk-PYUYJRSK.js";
27
+ } from "./chunk-T7GKZBLP.js";
12
28
  import {
13
29
  accountProviderError,
14
30
  httpProviderError
15
- } from "./chunk-ZJWDMTE3.js";
31
+ } from "./chunk-MKWZPDR6.js";
16
32
  import {
17
33
  ApiErrorRecovery,
18
34
  ApiErrorResponse,
19
35
  OpenapiResponseError,
36
+ RouterMeta,
20
37
  defaultOpenapiErrorLimits
21
- } from "./chunk-SWPD52J7.js";
38
+ } from "./chunk-B3EOZTK3.js";
39
+ import "./chunk-N7YDVXYJ.js";
22
40
  import {
23
41
  ProviderError
24
- } from "./chunk-W7D7WVSY.js";
42
+ } from "./chunk-R3EV5FTO.js";
43
+ import "./chunk-JU7VHODU.js";
25
44
  import {
26
45
  FetchHttpClient_exports
27
- } from "./chunk-HDJH3RPR.js";
46
+ } from "./chunk-57RKNWL2.js";
28
47
  import {
29
48
  HttpClientRequest_exports,
30
49
  HttpClient_exports
31
- } from "./chunk-QKHR7BMF.js";
50
+ } from "./chunk-UK573G7W.js";
32
51
  import {
33
52
  jsonSchema,
34
53
  lazyJsonSchemaDecoder,
35
54
  once,
36
55
  wrap
37
- } from "./chunk-WFSQXYUT.js";
56
+ } from "./chunk-5T57N25Q.js";
57
+ import "./chunk-PZB6T6KU.js";
38
58
  import {
39
- AccountId,
40
- HttpUrl,
41
59
  JsonObject,
42
60
  JsonValue
43
- } from "./chunk-SATWJKN6.js";
61
+ } from "./chunk-27F7W2LG.js";
44
62
  import {
63
+ Deferred_exports,
45
64
  Duration_exports,
46
65
  Effect_exports,
47
66
  Encoding_exports,
@@ -50,120 +69,9 @@ import {
50
69
  Option_exports,
51
70
  Schema_exports,
52
71
  Stream_exports
53
- } from "./chunk-FW5HBOIK.js";
72
+ } from "./chunk-CDL5PM2Q.js";
54
73
  import "./chunk-CZ7CSFO4.js";
55
74
 
56
- // src/contracts/openapi.ts
57
- var OpenapiErrorResponse = Schema_exports.Struct({
58
- code: ApiErrorResponse.fields.code,
59
- status: ApiErrorResponse.fields.status,
60
- message: Schema_exports.Union([
61
- Schema_exports.Struct({ source: Schema_exports.Literal("body") }),
62
- Schema_exports.Struct({ source: Schema_exports.Literal("schema"), value: ApiErrorResponse.fields.message })
63
- ]),
64
- schema: JsonObject
65
- });
66
- var OpenapiParameter = Schema_exports.Struct({
67
- name: Schema_exports.String,
68
- in: Schema_exports.Literals(["path", "query", "header", "cookie"]),
69
- required: Schema_exports.optionalKey(Schema_exports.Boolean),
70
- schema: Schema_exports.optionalKey(JsonObject),
71
- style: Schema_exports.optionalKey(Schema_exports.String),
72
- explode: Schema_exports.optionalKey(Schema_exports.Boolean),
73
- allowReserved: Schema_exports.optionalKey(Schema_exports.Boolean),
74
- allowEmptyValue: Schema_exports.optionalKey(Schema_exports.Boolean),
75
- content: Schema_exports.optionalKey(JsonObject)
76
- });
77
- var OpenapiRequestBody = Schema_exports.Struct({
78
- required: Schema_exports.optionalKey(Schema_exports.Boolean),
79
- content: Schema_exports.Record(
80
- Schema_exports.String,
81
- Schema_exports.Struct({
82
- schema: Schema_exports.optionalKey(JsonObject),
83
- encoding: Schema_exports.optionalKey(JsonObject)
84
- })
85
- )
86
- });
87
- var OpenapiOperation = Schema_exports.Struct({
88
- /** The tool name after `queries.` or `mutations.`, grouped as `<group>.<leaf>`. */
89
- name: Schema_exports.NonEmptyString,
90
- /** The document's operationId, when it declares one. `kinds` overrides are keyed by it. */
91
- operationId: Schema_exports.optionalKey(Schema_exports.String),
92
- description: Schema_exports.String,
93
- method: Schema_exports.Literals(["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]),
94
- path: Schema_exports.String,
95
- baseUrl: HttpUrl,
96
- openapi: Schema_exports.String,
97
- securitySchemes: Schema_exports.Record(Schema_exports.String, JsonObject),
98
- /** The resolved OpenAPI Operation Object; Executor schemas remain separate. */
99
- request: Schema_exports.Struct({
100
- parameters: Schema_exports.Array(OpenapiParameter),
101
- requestBody: Schema_exports.optionalKey(OpenapiRequestBody),
102
- security: Schema_exports.Array(Schema_exports.Record(Schema_exports.String, Schema_exports.Array(Schema_exports.String))),
103
- responses: Schema_exports.Record(Schema_exports.String, JsonObject)
104
- }),
105
- /** Streams remain in the metadata but cannot run through a single-result tool call. */
106
- streaming: Schema_exports.optionalKey(Schema_exports.Literal(true)),
107
- input: JsonObject,
108
- outputSchema: Schema_exports.optionalKey(JsonObject),
109
- errorResponses: Schema_exports.optionalKey(Schema_exports.Array(OpenapiErrorResponse))
110
- });
111
- var CredentialBinding = Schema_exports.Struct({
112
- scheme: Schema_exports.String,
113
- field: Schema_exports.String,
114
- part: Schema_exports.Literals(["value", "username", "password"]),
115
- prefix: Schema_exports.String
116
- });
117
- var OpenapiAccount = Schema_exports.Struct({
118
- id: Schema_exports.optional(AccountId),
119
- method: Schema_exports.String,
120
- fields: Schema_exports.Record(Schema_exports.String, Schema_exports.Unknown)
121
- });
122
- var OpenapiParameterDefaults = Schema_exports.Struct({
123
- path: Schema_exports.optionalKey(Schema_exports.Record(Schema_exports.String, Schema_exports.String)),
124
- query: Schema_exports.optionalKey(Schema_exports.Record(Schema_exports.String, Schema_exports.String)),
125
- headers: Schema_exports.optionalKey(Schema_exports.Record(Schema_exports.String, Schema_exports.String))
126
- });
127
- var OpenapiToolsOptions = Schema_exports.Struct({
128
- operations: Schema_exports.Array(OpenapiOperation),
129
- /**
130
- * Component schemas stored once per app and referenced as `#/$defs/<name>`. Operations
131
- * generated before shared definitions carry their own `$defs` and omit this.
132
- */
133
- definitions: Schema_exports.optional(Schema_exports.Record(Schema_exports.String, JsonObject)),
134
- methods: Schema_exports.Record(Schema_exports.String, Schema_exports.Array(CredentialBinding)),
135
- oauth: Schema_exports.Array(Schema_exports.String),
136
- account: Schema_exports.optional(OpenapiAccount),
137
- parameterDefaults: Schema_exports.optional(OpenapiParameterDefaults),
138
- signal: Schema_exports.optional(Schema_exports.instanceOf(AbortSignal)),
139
- fetch: Schema_exports.optional(
140
- Schema_exports.declare((value) => typeof value === "function")
141
- )
142
- });
143
- var OpenapiError = class extends Schema_exports.TaggedError()("OpenapiError", {
144
- reason: Schema_exports.Literals(["invalid_definition", "invalid_input", "request"]),
145
- status: Schema_exports.optional(Schema_exports.Number)
146
- }) {
147
- };
148
- var defaultOpenapiResponseLimits = {
149
- maxBodyBytes: 16777216,
150
- readTimeoutMs: 3e4
151
- };
152
- var isOpenapiTextMedia = (type) => /^(?:text\/|application\/(?:[\w.-]+\+)?(?:json|xml)|application\/(?:javascript|x-ndjson|x-www-form-urlencoded))/i.test(
153
- type
154
- );
155
- var isOpenapiFileSchema = (shape) => shape.contentMediaType !== void 0 && shape.contentEncoding === void 0 || shape.type === "string" && shape.format === "binary";
156
- var openapiBinaryResultSchema = {
157
- type: "object",
158
- properties: {
159
- base64: { type: "string", contentEncoding: "base64" },
160
- contentType: { type: "string" }
161
- },
162
- required: ["base64", "contentType"],
163
- additionalProperties: false
164
- };
165
- var openapiMediaKind = (type) => type.includes("json") && !type.includes("ndjson") ? "json" : type === "application/x-www-form-urlencoded" ? "form" : type === "multipart/form-data" ? "multipart" : isOpenapiTextMedia(type) ? "text" : "binary";
166
-
167
75
  // src/implementation/swagger-client.ts
168
76
  var loadSwaggerClient = () => import("./es-APDZKREY.js").then((module) => module.default);
169
77
 
@@ -2492,8 +2400,10 @@ var compileOpenApiDocument = (entry, inputDocument, options = {}) => Effect_expo
2492
2400
  if (!path.startsWith("/") || path.includes("?") || path.includes("#"))
2493
2401
  fail2("operation_path", "An operation has an invalid API path.");
2494
2402
  const operationMethods = [];
2495
- const operation = Schema_exports.decodeUnknownSync(Operation)(
2496
- document.resolve(record2(item[method.toLowerCase()]))
2403
+ const resolved2 = document.resolve(record2(item[method.toLowerCase()]));
2404
+ const operation = Schema_exports.decodeUnknownSync(Operation)(resolved2);
2405
+ const tags = Option_exports.getOrUndefined(
2406
+ Schema_exports.decodeUnknownOption(Schema_exports.Array(Schema_exports.NonEmptyString))(resolved2.tags)
2497
2407
  );
2498
2408
  const name = names[index] ?? fail2("operation_path", "An operation has no name.");
2499
2409
  if (built.some((op) => op.operation.name === name))
@@ -2639,6 +2549,7 @@ var compileOpenApiDocument = (entry, inputDocument, options = {}) => Effect_expo
2639
2549
  methods: operationMethods,
2640
2550
  operation: {
2641
2551
  ...streaming ? { streaming: true } : {},
2552
+ ...tags === void 0 || tags.length === 0 ? {} : { tags },
2642
2553
  name,
2643
2554
  ...operation.operationId === void 0 ? {} : { operationId: operation.operationId },
2644
2555
  description: operation.summary ?? operation.description ?? name,
@@ -2748,7 +2659,43 @@ var compileOpenApiDocument = (entry, inputDocument, options = {}) => Effect_expo
2748
2659
  });
2749
2660
 
2750
2661
  // src/implementation/openapi-source.ts
2751
- var Manifest = Schema_exports.Struct({ revision: Schema_exports.String, pages: Schema_exports.Number });
2662
+ var Manifest = Schema_exports.Struct({
2663
+ revision: Schema_exports.String,
2664
+ pages: Schema_exports.Number,
2665
+ meta: Schema_exports.optionalKey(RouterMeta)
2666
+ });
2667
+ var DocumentInfo = Schema_exports.Struct({
2668
+ info: Schema_exports.optionalKey(
2669
+ Schema_exports.Struct({
2670
+ title: Schema_exports.optionalKey(Schema_exports.String),
2671
+ summary: Schema_exports.optionalKey(Schema_exports.String),
2672
+ description: Schema_exports.optionalKey(Schema_exports.String)
2673
+ })
2674
+ ),
2675
+ tags: Schema_exports.optionalKey(
2676
+ Schema_exports.Array(
2677
+ Schema_exports.Struct({
2678
+ name: Schema_exports.NonEmptyString,
2679
+ description: Schema_exports.optionalKey(Schema_exports.String)
2680
+ })
2681
+ )
2682
+ )
2683
+ });
2684
+ var documentMeta = (document) => {
2685
+ const parsed = Schema_exports.decodeUnknownOption(DocumentInfo)(document);
2686
+ if (Option_exports.isNone(parsed)) return void 0;
2687
+ const { info, tags } = parsed.value;
2688
+ const description = info?.description ?? info?.summary;
2689
+ const labels = (tags ?? []).flatMap(
2690
+ (tag) => tag.description === void 0 ? [] : [[tag.name, tag.description]]
2691
+ );
2692
+ const meta = {
2693
+ ...info?.title === void 0 ? {} : { title: info.title },
2694
+ ...description === void 0 ? {} : { description },
2695
+ ...labels.length === 0 ? {} : { tags: Object.fromEntries(labels) }
2696
+ };
2697
+ return Object.keys(meta).length === 0 ? void 0 : meta;
2698
+ };
2752
2699
  var Names = Schema_exports.Array(Schema_exports.String);
2753
2700
  var StoredEntry = Schema_exports.fromJsonString(Schema_exports.Struct({ value: JsonValue }));
2754
2701
  var schema = (decoder) => wrap(decoder, false);
@@ -2863,7 +2810,7 @@ var download = (url, context) => Effect_exports.gen(function* () {
2863
2810
  catch: invalid
2864
2811
  });
2865
2812
  });
2866
- var liveOpenapiOperations = (options) => {
2813
+ var liveOpenapiRouter = (options) => {
2867
2814
  const freshFor = options.freshFor ?? "5 minutes";
2868
2815
  const staleFor = options.staleFor ?? "1 day";
2869
2816
  const retention = Duration_exports.toMillis(Duration_exports.fromInputUnsafe(freshFor)) + Duration_exports.toMillis(Duration_exports.fromInputUnsafe(staleFor)) + 3e5;
@@ -2972,17 +2919,31 @@ var liveOpenapiOperations = (options) => {
2972
2919
  }
2973
2920
  );
2974
2921
  retain(revision, retained, retainedBytes);
2975
- return { revision, pages };
2922
+ const meta = documentMeta(document);
2923
+ return { revision, pages, ...meta === void 0 ? {} : { meta } };
2976
2924
  });
2977
- const current = Effect_exports.gen(function* () {
2978
- const key = yield* pointer;
2979
- return yield* fromPromise(options.cache.get)({
2980
- key,
2981
- schema: schema(Manifest),
2982
- freshFor,
2983
- staleFor,
2984
- load: toPromise(refresh)
2985
- });
2925
+ let reading;
2926
+ const current = Effect_exports.suspend(() => {
2927
+ const shared = reading;
2928
+ if (shared !== void 0) return Deferred_exports.await(shared);
2929
+ const deferred = Deferred_exports.makeUnsafe();
2930
+ reading = deferred;
2931
+ return pointer.pipe(
2932
+ Effect_exports.flatMap(
2933
+ (key) => fromPromise(options.cache.get)({
2934
+ key,
2935
+ schema: schema(Manifest),
2936
+ freshFor,
2937
+ staleFor,
2938
+ load: toPromise(refresh)
2939
+ })
2940
+ ),
2941
+ Effect_exports.onExit(
2942
+ (exit) => Effect_exports.sync(() => {
2943
+ if (reading === deferred) reading = void 0;
2944
+ }).pipe(Effect_exports.andThen(Deferred_exports.done(deferred, exit)))
2945
+ )
2946
+ );
2986
2947
  });
2987
2948
  const read = (revision, kind, names, decoder) => {
2988
2949
  const retained = stored.get(revision);
@@ -3049,7 +3010,7 @@ var liveOpenapiOperations = (options) => {
3049
3010
  const kinds = options.kinds ?? {};
3050
3011
  return Object.hasOwn(kinds, key) ? kinds[key] ?? "mutation" : ["GET", "HEAD", "OPTIONS"].includes(op.method) ? "query" : "mutation";
3051
3012
  };
3052
- const qualified = (op) => `${kindOf(op) === "query" ? "queries" : "mutations"}.${op.name}`;
3013
+ const readOnly = (op) => kindOf(op) === "query";
3053
3014
  const operationsFor = (manifest) => Effect_exports.gen(function* () {
3054
3015
  const names = yield* namesFor(manifest);
3055
3016
  if (names === void 0) return void 0;
@@ -3070,10 +3031,12 @@ var liveOpenapiOperations = (options) => {
3070
3031
  }
3071
3032
  return all;
3072
3033
  });
3073
- const summarize = (operation) => {
3074
- const name = qualified(operation);
3075
- return { name, description: operation.description, readOnly: name.startsWith("queries.") };
3076
- };
3034
+ const summarize = (operation) => ({
3035
+ name: operation.name,
3036
+ description: operation.description,
3037
+ readOnly: readOnly(operation),
3038
+ ...operation.tags === void 0 ? {} : { tags: operation.tags }
3039
+ });
3077
3040
  const describe = (operation, bundle) => ({
3078
3041
  ...summarize(operation),
3079
3042
  inputSchema: bundle(parameterDefaultsInput(operation, options.parameterDefaults, true)),
@@ -3087,88 +3050,83 @@ var liveOpenapiOperations = (options) => {
3087
3050
  }
3088
3051
  return yield* invalid();
3089
3052
  });
3090
- return {
3091
- queries: {},
3092
- mutations: {},
3093
- dynamicTools: {
3094
- resolve: (name) => withRevision(
3095
- (manifest) => Effect_exports.gen(function* () {
3096
- const raw = name.replace(/^(queries|mutations)\./, "");
3097
- const memoKey = `${manifest.revision}/${defaultedNames}/${raw}`;
3098
- const memo = resolved.get(memoKey);
3099
- const operation = memo?.operation ?? (yield* read(manifest.revision, "operation", [raw], OpenapiOperation))[0];
3100
- if (operation === void 0) {
3101
- const names = yield* namesFor(manifest);
3102
- return names === void 0 || names.includes(raw) ? void 0 : { value: void 0 };
3103
- }
3104
- if (qualified(operation) !== name) return { value: void 0 };
3105
- const definitions = memo?.definitions ?? (yield* definitionsFor(manifest.revision, operation));
3106
- if (definitions === void 0) return void 0;
3107
- const schemas = memo?.schemas ?? (yield* prepareOpenapiOperation(operation, definitions, options.parameterDefaults));
3108
- if (memo === void 0) remember(memoKey, { operation, definitions, schemas });
3109
- const tools = yield* openapiToolsEffect(
3110
- { ...options, operations: [operation], definitions },
3111
- /* @__PURE__ */ new Map([[operation.name, schemas]])
3112
- );
3113
- const declarations = protocolOperations(tools, {
3114
- [operation.name]: kindOf(operation)
3115
- });
3116
- const declaration = declarations.queries[raw] ?? declarations.mutations[raw];
3117
- return { value: declaration === void 0 ? void 0 : nativeOperation(declaration) };
3118
- })
3119
- ),
3120
- list: () => withRevision(
3121
- (manifest) => Effect_exports.gen(function* () {
3122
- const all = yield* operationsFor(manifest);
3123
- if (all === void 0) return void 0;
3124
- const definitions = yield* definitionsFor(manifest.revision, all);
3125
- if (definitions === void 0) return void 0;
3126
- const bundle = bundler(definitions);
3127
- const request = createRequest(options);
3128
- return {
3129
- value: all.filter((op) => request.available(op, options.account)).map((operation) => describe(operation, bundle))
3130
- };
3131
- })
3132
- ),
3133
- summaries: () => withRevision(
3134
- (manifest) => Effect_exports.gen(function* () {
3135
- const all = yield* operationsFor(manifest);
3136
- if (all === void 0) return void 0;
3137
- const request = createRequest(options);
3138
- return {
3139
- value: all.filter((op) => request.available(op, options.account)).map((operation) => summarize(operation))
3140
- };
3141
- })
3142
- ),
3143
- describe: (name) => withRevision(
3144
- (manifest) => Effect_exports.gen(function* () {
3145
- const raw = name.replace(/^(queries|mutations)\./, "");
3146
- const operation = (yield* read(
3147
- manifest.revision,
3148
- "operation",
3149
- [raw],
3150
- OpenapiOperation
3151
- ))[0];
3152
- if (operation === void 0) {
3153
- const names = yield* namesFor(manifest);
3154
- return names === void 0 || names.includes(raw) ? void 0 : { value: void 0 };
3155
- }
3156
- if (qualified(operation) !== name || !createRequest(options).available(operation, options.account))
3157
- return { value: void 0 };
3158
- const definitions = yield* definitionsFor(manifest.revision, operation);
3159
- if (definitions === void 0) return void 0;
3160
- return { value: describe(operation, bundler(definitions)) };
3161
- })
3162
- )
3163
- }
3164
- };
3053
+ return routerDeclaration({
3054
+ kind: "dynamic",
3055
+ meta: () => current.pipe(Effect_exports.map((manifest) => manifest.meta ?? {})),
3056
+ resolve: (name) => withRevision(
3057
+ (manifest) => Effect_exports.gen(function* () {
3058
+ const raw = name;
3059
+ const memoKey = `${manifest.revision}/${defaultedNames}/${raw}`;
3060
+ const memo = resolved.get(memoKey);
3061
+ const operation = memo?.operation ?? (yield* read(manifest.revision, "operation", [raw], OpenapiOperation))[0];
3062
+ if (operation === void 0) {
3063
+ const names = yield* namesFor(manifest);
3064
+ return names === void 0 || names.includes(raw) ? void 0 : { value: void 0 };
3065
+ }
3066
+ const definitions = memo?.definitions ?? (yield* definitionsFor(manifest.revision, operation));
3067
+ if (definitions === void 0) return void 0;
3068
+ const schemas = memo?.schemas ?? (yield* prepareOpenapiOperation(operation, definitions, options.parameterDefaults));
3069
+ if (memo === void 0) remember(memoKey, { operation, definitions, schemas });
3070
+ const tools = yield* openapiToolsEffect(
3071
+ { ...options, operations: [operation], definitions },
3072
+ /* @__PURE__ */ new Map([[operation.name, schemas]])
3073
+ );
3074
+ const declarations = protocolOperations(tools, {
3075
+ [operation.name]: kindOf(operation)
3076
+ });
3077
+ const declaration = Object.hasOwn(declarations, raw) ? declarations[raw] : void 0;
3078
+ return { value: declaration === void 0 ? void 0 : nativeOperation(declaration) };
3079
+ })
3080
+ ),
3081
+ list: () => withRevision(
3082
+ (manifest) => Effect_exports.gen(function* () {
3083
+ const all = yield* operationsFor(manifest);
3084
+ if (all === void 0) return void 0;
3085
+ const definitions = yield* definitionsFor(manifest.revision, all);
3086
+ if (definitions === void 0) return void 0;
3087
+ const bundle = bundler(definitions);
3088
+ const request = createRequest(options);
3089
+ return {
3090
+ value: all.filter((op) => request.available(op, options.account)).map((operation) => describe(operation, bundle))
3091
+ };
3092
+ })
3093
+ ),
3094
+ summaries: () => withRevision(
3095
+ (manifest) => Effect_exports.gen(function* () {
3096
+ const all = yield* operationsFor(manifest);
3097
+ if (all === void 0) return void 0;
3098
+ const request = createRequest(options);
3099
+ return {
3100
+ value: all.filter((op) => request.available(op, options.account)).map((operation) => summarize(operation))
3101
+ };
3102
+ })
3103
+ ),
3104
+ describe: (name) => withRevision(
3105
+ (manifest) => Effect_exports.gen(function* () {
3106
+ const raw = name;
3107
+ const operation = (yield* read(
3108
+ manifest.revision,
3109
+ "operation",
3110
+ [raw],
3111
+ OpenapiOperation
3112
+ ))[0];
3113
+ if (operation === void 0) {
3114
+ const names = yield* namesFor(manifest);
3115
+ return names === void 0 || names.includes(raw) ? void 0 : { value: void 0 };
3116
+ }
3117
+ if (!createRequest(options).available(operation, options.account))
3118
+ return { value: void 0 };
3119
+ const definitions = yield* definitionsFor(manifest.revision, operation);
3120
+ if (definitions === void 0) return void 0;
3121
+ return { value: describe(operation, bundler(definitions)) };
3122
+ })
3123
+ )
3124
+ });
3165
3125
  };
3166
3126
 
3167
3127
  // src/openapi.ts
3168
- var openapiOperations = (options, kinds = {}) => Effect_exports.runPromise(
3169
- openapiToolsEffect(options).pipe(
3170
- Effect_exports.map((operations) => protocolOperations(operations, kinds))
3171
- ),
3128
+ var openapiRouter = (options, kinds = {}) => Effect_exports.runPromise(
3129
+ openapiToolsEffect(options).pipe(Effect_exports.map((operations) => protocolRouter(operations, kinds))),
3172
3130
  options.signal === void 0 ? {} : { signal: options.signal }
3173
3131
  );
3174
3132
  export {
@@ -3179,8 +3137,8 @@ export {
3179
3137
  OpenapiParameter,
3180
3138
  OpenapiRequestBody,
3181
3139
  isOpenapiTextMedia,
3182
- liveOpenapiOperations,
3140
+ liveOpenapiRouter,
3183
3141
  openapiBinaryResultSchema,
3184
3142
  openapiMediaKind,
3185
- openapiOperations
3143
+ openapiRouter
3186
3144
  };
package/js/react.js CHANGED
@@ -2,11 +2,11 @@ import {
2
2
  AsyncResult_exports,
3
3
  AtomRegistry_exports,
4
4
  queryCommitted
5
- } from "./chunk-EVJUVWN2.js";
6
- import "./chunk-M6ZRRIBI.js";
5
+ } from "./chunk-M3B3DE4K.js";
6
+ import "./chunk-PJJ24GU7.js";
7
7
  import {
8
8
  Option_exports
9
- } from "./chunk-FW5HBOIK.js";
9
+ } from "./chunk-CDL5PM2Q.js";
10
10
  import "./chunk-CZ7CSFO4.js";
11
11
 
12
12
  // src/react.ts
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  folderSkillsEffect,
3
3
  skillFromFiles
4
- } from "../chunk-FDNTX5QJ.js";
5
- import "../chunk-YEJOQEII.js";
6
- import "../chunk-FW5HBOIK.js";
4
+ } from "../chunk-IPI4MFSN.js";
5
+ import "../chunk-JU7VHODU.js";
6
+ import "../chunk-CDL5PM2Q.js";
7
7
  import "../chunk-CZ7CSFO4.js";
8
8
  export {
9
9
  folderSkillsEffect,
package/js/skills.js CHANGED
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  catalogCache
3
- } from "./chunk-5MQZEB6Y.js";
4
- import "./chunk-D47C7KG5.js";
3
+ } from "./chunk-RFVIONFX.js";
4
+ import "./chunk-NKLWZJLE.js";
5
5
  import {
6
6
  folderSkillsEffect,
7
7
  skillFromFiles
8
- } from "./chunk-FDNTX5QJ.js";
8
+ } from "./chunk-IPI4MFSN.js";
9
9
  import {
10
10
  httpProviderError
11
- } from "./chunk-ZJWDMTE3.js";
12
- import "./chunk-LGIYBDWA.js";
11
+ } from "./chunk-MKWZPDR6.js";
12
+ import "./chunk-R3EV5FTO.js";
13
13
  import {
14
14
  AppSkillMetadata,
15
15
  AppSkillSource,
@@ -19,25 +19,24 @@ import {
19
19
  SkillLoadFailed,
20
20
  SkillServiceName,
21
21
  skillLoadLimits
22
- } from "./chunk-YEJOQEII.js";
23
- import "./chunk-W7D7WVSY.js";
22
+ } from "./chunk-JU7VHODU.js";
24
23
  import {
25
24
  FetchHttpClient_exports
26
- } from "./chunk-HDJH3RPR.js";
25
+ } from "./chunk-57RKNWL2.js";
27
26
  import {
28
27
  HttpBody_exports,
29
28
  HttpClient_exports
30
- } from "./chunk-QKHR7BMF.js";
29
+ } from "./chunk-UK573G7W.js";
31
30
  import {
32
31
  wrap
33
- } from "./chunk-WFSQXYUT.js";
34
- import "./chunk-SATWJKN6.js";
32
+ } from "./chunk-5T57N25Q.js";
33
+ import "./chunk-27F7W2LG.js";
35
34
  import {
36
35
  Effect_exports,
37
36
  Ref_exports,
38
37
  Schema_exports,
39
38
  Stream_exports
40
- } from "./chunk-FW5HBOIK.js";
39
+ } from "./chunk-CDL5PM2Q.js";
41
40
  import "./chunk-CZ7CSFO4.js";
42
41
 
43
42
  // src/implementation/inflate.ts
@@ -759,7 +758,7 @@ var cachedCatalog = (options, prefix, load) => options.cache === void 0 ? load(o
759
758
  prefix,
760
759
  schema: AppSkillSource,
761
760
  summary: { schema: AppSkillMetadata, of: ({ files: _files, ...metadata }) => metadata },
762
- load: (context) => context === void 0 ? load(options, options.cache) : load({ fetch: options.fetch, signal: context.signal }, context.cache)
761
+ load: (context) => (context === void 0 ? load(options, options.cache) : load({ fetch: options.fetch, signal: context.signal }, context.cache)).pipe(Effect_exports.map((tools) => ({ tools })))
763
762
  }).pipe(
764
763
  Effect_exports.flatMap((catalog) => catalog.list()),
765
764
  Effect_exports.mapError(
@@ -4,11 +4,11 @@ import {
4
4
  layer,
5
5
  make as make3,
6
6
  makeCompilerSqlite
7
- } from "../chunk-M6ZRRIBI.js";
7
+ } from "../chunk-PJJ24GU7.js";
8
8
  import {
9
9
  makeSqliteDatabase
10
- } from "../chunk-PLCMJREA.js";
11
- import "../chunk-BMOIAIVR.js";
10
+ } from "../chunk-ZQINWV4W.js";
11
+ import "../chunk-N7YDVXYJ.js";
12
12
  import {
13
13
  Defect,
14
14
  Effect_exports,
@@ -57,7 +57,7 @@ import {
57
57
  uninterruptibleMask,
58
58
  void_,
59
59
  withFiber
60
- } from "../chunk-FW5HBOIK.js";
60
+ } from "../chunk-CDL5PM2Q.js";
61
61
  import "../chunk-CZ7CSFO4.js";
62
62
 
63
63
  // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/sql/SqlError.js
@@ -5,8 +5,8 @@ import {
5
5
  AppSignInFailure,
6
6
  AppSignInId,
7
7
  appSignInCallbackPath
8
- } from "../../chunk-T2LAZCAD.js";
9
- import "../../chunk-FW5HBOIK.js";
8
+ } from "../../chunk-VFZKSM3T.js";
9
+ import "../../chunk-CDL5PM2Q.js";
10
10
  import "../../chunk-CZ7CSFO4.js";
11
11
  export {
12
12
  AppReturnPath,