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.
- package/README.md +65 -43
- package/framework-reference.json +1 -1
- package/js/{chunk-SATWJKN6.js → chunk-27F7W2LG.js} +1 -1
- package/js/{chunk-HDJH3RPR.js → chunk-57RKNWL2.js} +2 -2
- package/js/{chunk-WFSQXYUT.js → chunk-5T57N25Q.js} +15 -3
- package/js/{chunk-EQB7JMAL.js → chunk-6BSSI67S.js} +8 -8
- package/js/{chunk-3M2MEDNL.js → chunk-B3EOZTK3.js} +351 -33
- package/js/{chunk-FW5HBOIK.js → chunk-CDL5PM2Q.js} +307 -169
- package/js/{chunk-Z5NMEGJN.js → chunk-ECQFRCH4.js} +21 -9
- package/js/{chunk-G7ZIRKMK.js → chunk-IJX4CYZO.js} +3 -3
- package/js/{chunk-FDNTX5QJ.js → chunk-IPI4MFSN.js} +2 -2
- package/js/{chunk-2VPJHFOU.js → chunk-ITM77QPO.js} +28 -9
- package/js/{chunk-YEJOQEII.js → chunk-JU7VHODU.js} +1 -1
- package/js/{chunk-NQ3OMCA5.js → chunk-KUMBKVJD.js} +2 -2
- package/js/{chunk-EVJUVWN2.js → chunk-M3B3DE4K.js} +2 -2
- package/js/{chunk-ZJWDMTE3.js → chunk-MKWZPDR6.js} +3 -3
- package/js/chunk-MNMNLXBL.js +507 -0
- package/js/{chunk-BMOIAIVR.js → chunk-N7YDVXYJ.js} +49 -1
- package/js/{chunk-D47C7KG5.js → chunk-NKLWZJLE.js} +2 -2
- package/js/{chunk-DHUDODG5.js → chunk-OE3QQTSB.js} +41 -32
- package/js/{chunk-M6ZRRIBI.js → chunk-PJJ24GU7.js} +1 -1
- package/js/{chunk-FZJOYIZO.js → chunk-PZB6T6KU.js} +1 -1
- package/js/{chunk-LGIYBDWA.js → chunk-R3EV5FTO.js} +13 -1
- package/js/{chunk-5MQZEB6Y.js → chunk-RFVIONFX.js} +29 -12
- package/js/{chunk-ZCAMUXSG.js → chunk-RJDDBDSN.js} +3 -3
- package/js/{chunk-6VRYO2BG.js → chunk-SB4HEPNJ.js} +191 -170
- package/js/chunk-T7GKZBLP.js +209 -0
- package/js/{chunk-QKHR7BMF.js → chunk-UK573G7W.js} +1 -1
- package/js/{chunk-T2LAZCAD.js → chunk-VFZKSM3T.js} +1 -1
- package/js/{chunk-PLCMJREA.js → chunk-ZQINWV4W.js} +60 -20
- package/js/client.js +10 -10
- package/js/contracts.js +52 -16
- package/js/effect.js +19 -20
- package/js/graphql.js +34 -40
- package/js/host.js +19 -20
- package/js/index.js +189 -178
- package/js/mcp/effect.js +21 -22
- package/js/mcp/stdio.js +25 -26
- package/js/mcp.js +60 -45
- package/js/openapi.js +182 -224
- package/js/react.js +3 -3
- package/js/skills/effect.js +3 -3
- package/js/skills.js +12 -13
- package/js/storage/facet.js +4 -4
- package/js/ui/auth/contracts.js +2 -2
- package/js/ui/auth.js +5 -5
- package/js/ui/contracts.js +4 -4
- package/js/ui/serving.js +8 -8
- package/package.json +1 -1
- package/runtime.json +1 -1
- package/types/app-data/src/contracts/database.d.ts +33 -6
- package/types/app-data/src/implementation/schema.d.ts +2 -17
- package/types/apps/src/contracts/app.d.ts +2 -5
- package/types/apps/src/contracts/failure.d.ts +25 -0
- package/types/apps/src/contracts/host.d.ts +18 -9
- package/types/apps/src/contracts/mcp.d.ts +16 -0
- package/types/apps/src/contracts/openapi.d.ts +5 -1
- package/types/apps/src/contracts/operations.d.ts +0 -5
- package/types/apps/src/contracts/protocol-version.d.ts +2 -2
- package/types/apps/src/contracts/protocols/1.d.ts +15 -1
- package/types/apps/src/contracts/protocols/2.d.ts +2 -2
- package/types/apps/src/contracts/protocols/3.d.ts +676 -0
- package/types/apps/src/contracts/protocols/4.d.ts +1229 -0
- package/types/apps/src/contracts/router.d.ts +59 -0
- package/types/apps/src/contracts/storage.d.ts +3 -3
- package/types/apps/src/contracts/workflows.d.ts +34 -3
- package/types/apps/src/graphql.d.ts +1 -3
- package/types/apps/src/implementation/account-router.d.ts +12 -0
- package/types/apps/src/implementation/app.d.ts +5 -4
- package/types/apps/src/implementation/catalog-cache.d.ts +9 -2
- package/types/apps/src/implementation/elicitation.d.ts +1 -1
- package/types/apps/src/implementation/failure-detail.d.ts +25 -0
- package/types/apps/src/implementation/graphql-catalog.d.ts +1 -4
- package/types/apps/src/implementation/mcp-catalog.d.ts +1 -4
- package/types/apps/src/implementation/mcp-client.d.ts +35 -19
- package/types/apps/src/implementation/mcp.d.ts +35 -19
- package/types/apps/src/implementation/openapi-compile.d.ts +2 -1
- package/types/apps/src/implementation/openapi-source.d.ts +2 -6
- package/types/apps/src/implementation/operations.d.ts +26 -3
- package/types/apps/src/implementation/protocol-operations.d.ts +3 -4
- package/types/apps/src/implementation/router-catalog.d.ts +225 -0
- package/types/apps/src/implementation/router.d.ts +59 -0
- package/types/apps/src/implementation/schema.d.ts +5 -1
- package/types/apps/src/implementation/storage.d.ts +5 -3
- package/types/apps/src/implementation/webhooks.d.ts +1 -1
- package/types/apps/src/implementation/workflow-context.d.ts +11 -3
- package/types/apps/src/index.d.ts +3 -2
- package/types/apps/src/mcp-stdio.d.ts +2 -5
- package/types/apps/src/mcp.d.ts +5 -4
- package/types/apps/src/openapi.d.ts +6 -6
- package/js/chunk-PYUYJRSK.js +0 -93
- package/js/chunk-SWPD52J7.js +0 -35
- package/js/chunk-W7D7WVSY.js +0 -18
- package/types/apps/src/contracts/dynamic-tools.d.ts +0 -13
- package/types/apps/src/implementation/account-operations.d.ts +0 -151
- 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
|
-
|
|
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-
|
|
27
|
+
} from "./chunk-T7GKZBLP.js";
|
|
12
28
|
import {
|
|
13
29
|
accountProviderError,
|
|
14
30
|
httpProviderError
|
|
15
|
-
} from "./chunk-
|
|
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-
|
|
38
|
+
} from "./chunk-B3EOZTK3.js";
|
|
39
|
+
import "./chunk-N7YDVXYJ.js";
|
|
22
40
|
import {
|
|
23
41
|
ProviderError
|
|
24
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-R3EV5FTO.js";
|
|
43
|
+
import "./chunk-JU7VHODU.js";
|
|
25
44
|
import {
|
|
26
45
|
FetchHttpClient_exports
|
|
27
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-57RKNWL2.js";
|
|
28
47
|
import {
|
|
29
48
|
HttpClientRequest_exports,
|
|
30
49
|
HttpClient_exports
|
|
31
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-UK573G7W.js";
|
|
32
51
|
import {
|
|
33
52
|
jsonSchema,
|
|
34
53
|
lazyJsonSchemaDecoder,
|
|
35
54
|
once,
|
|
36
55
|
wrap
|
|
37
|
-
} from "./chunk-
|
|
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-
|
|
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-
|
|
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
|
|
2496
|
-
|
|
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({
|
|
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
|
|
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
|
-
|
|
2922
|
+
const meta = documentMeta(document);
|
|
2923
|
+
return { revision, pages, ...meta === void 0 ? {} : { meta } };
|
|
2976
2924
|
});
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
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
|
|
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
|
-
|
|
3075
|
-
|
|
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
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
)
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
)
|
|
3120
|
-
|
|
3121
|
-
(
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
)
|
|
3133
|
-
|
|
3134
|
-
(
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
)
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
)
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
}
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
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
|
|
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
|
-
|
|
3140
|
+
liveOpenapiRouter,
|
|
3183
3141
|
openapiBinaryResultSchema,
|
|
3184
3142
|
openapiMediaKind,
|
|
3185
|
-
|
|
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-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-M3B3DE4K.js";
|
|
6
|
+
import "./chunk-PJJ24GU7.js";
|
|
7
7
|
import {
|
|
8
8
|
Option_exports
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-CDL5PM2Q.js";
|
|
10
10
|
import "./chunk-CZ7CSFO4.js";
|
|
11
11
|
|
|
12
12
|
// src/react.ts
|
package/js/skills/effect.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
folderSkillsEffect,
|
|
3
3
|
skillFromFiles
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
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-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-RFVIONFX.js";
|
|
4
|
+
import "./chunk-NKLWZJLE.js";
|
|
5
5
|
import {
|
|
6
6
|
folderSkillsEffect,
|
|
7
7
|
skillFromFiles
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-IPI4MFSN.js";
|
|
9
9
|
import {
|
|
10
10
|
httpProviderError
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
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-
|
|
23
|
-
import "./chunk-W7D7WVSY.js";
|
|
22
|
+
} from "./chunk-JU7VHODU.js";
|
|
24
23
|
import {
|
|
25
24
|
FetchHttpClient_exports
|
|
26
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-57RKNWL2.js";
|
|
27
26
|
import {
|
|
28
27
|
HttpBody_exports,
|
|
29
28
|
HttpClient_exports
|
|
30
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-UK573G7W.js";
|
|
31
30
|
import {
|
|
32
31
|
wrap
|
|
33
|
-
} from "./chunk-
|
|
34
|
-
import "./chunk-
|
|
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-
|
|
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(
|
package/js/storage/facet.js
CHANGED
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
layer,
|
|
5
5
|
make as make3,
|
|
6
6
|
makeCompilerSqlite
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-PJJ24GU7.js";
|
|
8
8
|
import {
|
|
9
9
|
makeSqliteDatabase
|
|
10
|
-
} from "../chunk-
|
|
11
|
-
import "../chunk-
|
|
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-
|
|
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
|
package/js/ui/auth/contracts.js
CHANGED
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
AppSignInFailure,
|
|
6
6
|
AppSignInId,
|
|
7
7
|
appSignInCallbackPath
|
|
8
|
-
} from "../../chunk-
|
|
9
|
-
import "../../chunk-
|
|
8
|
+
} from "../../chunk-VFZKSM3T.js";
|
|
9
|
+
import "../../chunk-CDL5PM2Q.js";
|
|
10
10
|
import "../../chunk-CZ7CSFO4.js";
|
|
11
11
|
export {
|
|
12
12
|
AppReturnPath,
|