apps 0.0.1-beta.0 → 0.0.1-beta.1
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 +97 -4
- package/framework-reference.json +1 -1
- package/js/{chunk-BPEFS4YF.js → chunk-2HHMABB6.js} +70 -14
- package/js/{chunk-SBKHUC5L.js → chunk-4LPG6RCH.js} +2 -2
- package/js/{chunk-LOKGDT6B.js → chunk-6IIO4NPI.js} +5 -4
- package/js/chunk-6YBRWRK3.js +160 -0
- package/js/{chunk-7JXHF5IF.js → chunk-BMOIAIVR.js} +1 -1
- package/js/chunk-CZ7CSFO4.js +39 -0
- package/js/{chunk-YDR4CPJA.js → chunk-EVJUVWN2.js} +8 -8
- package/js/{chunk-2OTCEKL2.js → chunk-FW5HBOIK.js} +2352 -1493
- package/js/{chunk-EP6AEUZO.js → chunk-FZJOYIZO.js} +1 -1
- package/js/{chunk-WIDTG42X.js → chunk-G7IE6BKC.js} +79 -26
- package/js/{chunk-VFUZI3NY.js → chunk-HDJH3RPR.js} +4 -4
- package/js/{chunk-HP7E42X6.js → chunk-IHQ4ML7K.js} +693 -219
- package/js/{chunk-Q2FD5IBM.js → chunk-KOXMLKTM.js} +430 -41
- package/js/{chunk-D6BKYP2L.js → chunk-M6ZRRIBI.js} +4 -4
- package/js/chunk-NCYXZN2G.js +6274 -0
- package/js/{chunk-3ANFZFCV.js → chunk-OHRT55C4.js} +15 -15
- package/js/{chunk-R6JMJSVT.js → chunk-PLCMJREA.js} +2 -2
- package/js/{chunk-C24KEZXR.js → chunk-PZ36XMXW.js} +36 -2
- package/js/{chunk-W7Q5EOTS.js → chunk-QKHR7BMF.js} +32 -32
- package/js/{chunk-X3YBZCJW.js → chunk-RBAC33PQ.js} +59 -38
- package/js/{chunk-36DNRFZQ.js → chunk-SATWJKN6.js} +1 -1
- package/js/chunk-SWPD52J7.js +35 -0
- package/js/{chunk-BKVL7XAJ.js → chunk-TE4KO4HI.js} +1 -1
- package/js/chunk-W7D7WVSY.js +18 -0
- package/js/{chunk-KWTCHVLT.js → chunk-X7SFGU4Q.js} +47 -51
- package/js/chunk-YEJOQEII.js +104 -0
- package/js/{chunk-OWD2YICM.js → chunk-ZCAMUXSG.js} +116 -87
- package/js/chunk-ZJWDMTE3.js +63 -0
- package/js/chunk-ZTFQHGEB.js +80 -0
- package/js/client.js +11 -11
- package/js/contracts.js +81 -25
- package/js/effect.js +20 -15
- package/js/graphql.js +223 -121
- package/js/host.js +75 -19
- package/js/index.js +191 -51
- package/js/mcp/effect.js +24 -17
- package/js/mcp/stdio.js +22 -17
- package/js/mcp.js +109 -24
- package/js/openapi.js +43897 -143
- package/js/operations/approval.js +1 -1
- package/js/react.js +4 -4
- package/js/skills/effect.js +12 -0
- package/js/skills.js +857 -0
- package/js/storage/facet.js +7 -7
- package/js/ui/auth/contracts.js +6 -6
- package/js/ui/auth.js +8 -8
- package/js/ui/contracts.js +5 -5
- package/js/ui/serving.js +12 -12
- package/package.json +9 -1
- package/runtime.json +1 -1
- package/types/app-cache/src/contracts/cache.d.ts +79 -0
- package/types/app-cache/src/index.d.ts +35 -0
- package/types/apps/src/contracts/api-response-error.d.ts +43 -0
- package/types/apps/src/contracts/app.d.ts +11 -0
- package/types/apps/src/contracts/cache.d.ts +41 -0
- package/types/apps/src/contracts/dynamic-skills.d.ts +10 -0
- package/types/apps/src/contracts/dynamic-tools.d.ts +13 -0
- package/types/apps/src/contracts/graphql.d.ts +18 -1
- package/types/apps/src/contracts/host.d.ts +200 -7
- package/types/apps/src/contracts/mcp.d.ts +3 -1
- package/types/apps/src/contracts/openapi-compile.d.ts +11 -0
- package/types/apps/src/contracts/openapi-document.d.ts +53 -0
- package/types/apps/src/contracts/openapi.d.ts +150 -30
- package/types/apps/src/contracts/provider-error.d.ts +15 -0
- package/types/apps/src/contracts/provider.d.ts +18 -1
- package/types/apps/src/contracts/skills.d.ts +113 -0
- package/types/apps/src/contracts/swagger-client.d.ts +29 -0
- package/types/apps/src/graphql.d.ts +6 -6
- package/types/apps/src/host.d.ts +1 -0
- package/types/apps/src/implementation/account-operations.d.ts +122 -3
- package/types/apps/src/implementation/app.d.ts +1 -1
- package/types/apps/src/implementation/cache-session.d.ts +7 -0
- package/types/apps/src/implementation/cache.d.ts +6 -0
- package/types/apps/src/implementation/catalog-cache.d.ts +29 -0
- package/types/apps/src/implementation/dynamic-skills.d.ts +7 -0
- package/types/apps/src/implementation/dynamic-tools.d.ts +8 -0
- package/types/apps/src/implementation/elicitation.d.ts +12 -12
- package/types/apps/src/implementation/git.d.ts +25 -0
- package/types/apps/src/implementation/graphql-catalog.d.ts +10 -0
- package/types/apps/src/implementation/graphql.d.ts +81 -3
- package/types/apps/src/implementation/inflate.d.ts +16 -0
- package/types/apps/src/implementation/input-problems.d.ts +3 -0
- package/types/apps/src/implementation/mcp-call.d.ts +3 -2
- package/types/apps/src/implementation/mcp-catalog.d.ts +12 -0
- package/types/apps/src/implementation/mcp-client.d.ts +9 -8
- package/types/apps/src/implementation/mcp-stdio.d.ts +1 -1
- package/types/apps/src/implementation/mcp-tools.d.ts +6 -3
- package/types/apps/src/implementation/mcp.d.ts +39 -2
- package/types/apps/src/implementation/openapi-compile.d.ts +119 -0
- package/types/apps/src/implementation/openapi-document.d.ts +53 -0
- package/types/apps/src/implementation/openapi-request.d.ts +11 -4
- package/types/apps/src/implementation/openapi-source.d.ts +36 -0
- package/types/apps/src/implementation/openapi.d.ts +39 -3
- package/types/apps/src/implementation/provider-error.d.ts +10 -0
- package/types/apps/src/implementation/schema.d.ts +11 -5
- package/types/apps/src/implementation/skill-files.d.ts +10 -0
- package/types/apps/src/implementation/skills.d.ts +43 -0
- package/types/apps/src/index.d.ts +7 -0
- package/types/apps/src/mcp.d.ts +5 -5
- package/types/apps/src/openapi.d.ts +3 -1
- package/types/apps/src/skills.d.ts +72 -0
- package/types/telemetry/src/config.d.ts +2 -0
- package/js/chunk-22WRQZT7.js +0 -389
- package/js/chunk-MLKGABMK.js +0 -9
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ValidationError
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-SATWJKN6.js";
|
|
4
4
|
import {
|
|
5
5
|
Effect_exports,
|
|
6
|
+
SchemaGetter_exports,
|
|
6
7
|
SchemaIssue_exports,
|
|
7
8
|
SchemaParser_exports,
|
|
8
9
|
Schema_exports
|
|
9
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-FW5HBOIK.js";
|
|
10
11
|
|
|
11
12
|
// ../../node_modules/.bun/@cfworker+json-schema@4.1.1/node_modules/@cfworker/json-schema/dist/esm/deep-compare-strict.js
|
|
12
13
|
function deepCompareStrict(a, b) {
|
|
@@ -1129,12 +1130,30 @@ function object(fields) {
|
|
|
1129
1130
|
const entries = Object.entries(fields).map(
|
|
1130
1131
|
([key, field]) => [key, decoderOf(field)]
|
|
1131
1132
|
);
|
|
1132
|
-
const decoder =
|
|
1133
|
+
const decoder = entries.length === 0 ? withJsonSchemaDocument(
|
|
1134
|
+
// Native Struct({}) accepts every non-null value and retains undeclared fields.
|
|
1135
|
+
Schema_exports.Record(Schema_exports.String, Schema_exports.Unknown).pipe(
|
|
1136
|
+
Schema_exports.decodeTo(Schema_exports.Record(Schema_exports.String, Schema_exports.Never), {
|
|
1137
|
+
decode: SchemaGetter_exports.transform(() => ({})),
|
|
1138
|
+
encode: SchemaGetter_exports.transform((value) => value)
|
|
1139
|
+
})
|
|
1140
|
+
),
|
|
1141
|
+
{ type: "object", properties: {}, additionalProperties: false }
|
|
1142
|
+
) : Schema_exports.Struct(Object.fromEntries(entries));
|
|
1133
1143
|
return { ...wrap(decoder, false), fields: Object.freeze({ ...fields }) };
|
|
1134
1144
|
}
|
|
1135
1145
|
var ImportedJsonSchema = /* @__PURE__ */ Symbol("apps.JsonSchemaDocument");
|
|
1136
1146
|
var importedJsonSchema = (decoder) => ImportedJsonSchema in decoder ? decoder[ImportedJsonSchema] : void 0;
|
|
1137
1147
|
var withJsonSchemaDocument = (decoder, document) => Object.assign(decoder, { [ImportedJsonSchema]: document });
|
|
1148
|
+
var once = (compute) => {
|
|
1149
|
+
let state;
|
|
1150
|
+
return () => (state ??= { value: compute() }).value;
|
|
1151
|
+
};
|
|
1152
|
+
var withLazyJsonSchemaDocument = (decoder, document) => Object.defineProperty(decoder, ImportedJsonSchema, {
|
|
1153
|
+
configurable: true,
|
|
1154
|
+
enumerable: true,
|
|
1155
|
+
get: once(document)
|
|
1156
|
+
});
|
|
1138
1157
|
var nestJsonSchema = (input, pointer) => {
|
|
1139
1158
|
const document = structuredClone(input);
|
|
1140
1159
|
const lookup = dereference(document);
|
|
@@ -1232,6 +1251,40 @@ function interpretedDocument(value) {
|
|
|
1232
1251
|
}
|
|
1233
1252
|
return Object.fromEntries(entries);
|
|
1234
1253
|
}
|
|
1254
|
+
var containerKeywords = /* @__PURE__ */ new Set([
|
|
1255
|
+
"$ref",
|
|
1256
|
+
"$recursiveRef",
|
|
1257
|
+
"$dynamicRef",
|
|
1258
|
+
"properties",
|
|
1259
|
+
"patternProperties",
|
|
1260
|
+
"additionalProperties",
|
|
1261
|
+
"unevaluatedProperties",
|
|
1262
|
+
"propertyNames",
|
|
1263
|
+
"items",
|
|
1264
|
+
"prefixItems",
|
|
1265
|
+
"additionalItems",
|
|
1266
|
+
"unevaluatedItems",
|
|
1267
|
+
"contains",
|
|
1268
|
+
"allOf",
|
|
1269
|
+
"if",
|
|
1270
|
+
"then",
|
|
1271
|
+
"else",
|
|
1272
|
+
"dependentSchemas"
|
|
1273
|
+
]);
|
|
1274
|
+
var jsonSchemaProblems = (errors) => {
|
|
1275
|
+
const problems = errors.flatMap(({ keyword, instanceLocation, error }) => {
|
|
1276
|
+
if (containerKeywords.has(keyword)) return [];
|
|
1277
|
+
const path = instanceLocation.replace(/^#\/?/, "").split("/").filter((segment) => segment !== "").map((segment) => decodeURIComponent(segment).replace(/~1/g, "/").replace(/~0/g, "~")).map((segment) => /^\d+$/.test(segment) ? Number(segment) : segment);
|
|
1278
|
+
const required = keyword === "required" ? /required property "([^"]*)"/.exec(error) : null;
|
|
1279
|
+
const expected = keyword === "type" ? /Expected "([^.]*)"\.?$/.exec(error) : null;
|
|
1280
|
+
const issue = required !== null ? { path: [...path, required[1] ?? ""], issue: "Missing key" } : {
|
|
1281
|
+
path,
|
|
1282
|
+
issue: expected !== null ? `Expected ${(expected[1] ?? "").replace(/"/g, "")}` : keyword === "const" || keyword === "enum" ? "Expected one of the allowed values" : `Failed the "${keyword}" constraint`
|
|
1283
|
+
};
|
|
1284
|
+
return [issue];
|
|
1285
|
+
});
|
|
1286
|
+
return problems.length === 0 ? false : problems;
|
|
1287
|
+
};
|
|
1235
1288
|
var compileJsonSchemaDecoder = (document) => Effect_exports.gen(function* () {
|
|
1236
1289
|
const validator = yield* Effect_exports.try({
|
|
1237
1290
|
try: () => {
|
|
@@ -1266,7 +1319,8 @@ var compileJsonSchemaDecoder = (document) => Effect_exports.gen(function* () {
|
|
|
1266
1319
|
Schema_exports.makeFilter(
|
|
1267
1320
|
(value) => {
|
|
1268
1321
|
try {
|
|
1269
|
-
|
|
1322
|
+
const result = validator.validate(value);
|
|
1323
|
+
return result.valid || jsonSchemaProblems(result.errors);
|
|
1270
1324
|
} catch {
|
|
1271
1325
|
return false;
|
|
1272
1326
|
}
|
|
@@ -1276,23 +1330,23 @@ var compileJsonSchemaDecoder = (document) => Effect_exports.gen(function* () {
|
|
|
1276
1330
|
);
|
|
1277
1331
|
return Object.assign(decoder, { [ImportedJsonSchema]: document });
|
|
1278
1332
|
});
|
|
1279
|
-
var
|
|
1280
|
-
const
|
|
1281
|
-
|
|
1282
|
-
input
|
|
1283
|
-
);
|
|
1284
|
-
const compiled = yield* Effect_exports.cached(compileJsonSchemaDecoder(document));
|
|
1333
|
+
var lazyJsonSchemaDecoder = (document) => Effect_exports.gen(function* () {
|
|
1334
|
+
const read = once(document);
|
|
1335
|
+
const compiled = yield* Effect_exports.cached(Effect_exports.suspend(() => compileJsonSchemaDecoder(read())));
|
|
1285
1336
|
const decoder = Schema_exports.declareConstructor()(
|
|
1286
1337
|
[],
|
|
1287
|
-
() => (
|
|
1338
|
+
() => (input, _ast, options) => compiled.pipe(
|
|
1288
1339
|
Effect_exports.mapError(
|
|
1289
1340
|
() => new SchemaIssue_exports.InvalidValue({ message: "Unsupported JSON Schema" })
|
|
1290
1341
|
),
|
|
1291
|
-
Effect_exports.flatMap((schema) => SchemaParser_exports.decodeUnknownEffect(schema)(
|
|
1342
|
+
Effect_exports.flatMap((schema) => SchemaParser_exports.decodeUnknownEffect(schema)(input, options))
|
|
1292
1343
|
)
|
|
1293
1344
|
);
|
|
1294
|
-
return
|
|
1345
|
+
return withLazyJsonSchemaDocument(decoder, read);
|
|
1295
1346
|
});
|
|
1347
|
+
var jsonSchemaDecoder = (input) => parse(Schema_exports.Record(Schema_exports.String, Schema_exports.Json), input).pipe(
|
|
1348
|
+
Effect_exports.flatMap((document) => lazyJsonSchemaDecoder(() => document))
|
|
1349
|
+
);
|
|
1296
1350
|
var jsonSchema = (input) => wrap(Effect_exports.runSync(jsonSchemaDecoder(input)), false);
|
|
1297
1351
|
var storageFieldOf = (schema) => schema[StorageField];
|
|
1298
1352
|
var id = (table) => wrap(Schema_exports.NonEmptyString, false, { kind: "id", references: table });
|
|
@@ -1312,9 +1366,11 @@ export {
|
|
|
1312
1366
|
array,
|
|
1313
1367
|
object,
|
|
1314
1368
|
importedJsonSchema,
|
|
1315
|
-
|
|
1369
|
+
once,
|
|
1370
|
+
withLazyJsonSchemaDocument,
|
|
1316
1371
|
nestJsonSchema,
|
|
1317
1372
|
compileJsonSchemaDecoder,
|
|
1373
|
+
lazyJsonSchemaDecoder,
|
|
1318
1374
|
jsonSchemaDecoder,
|
|
1319
1375
|
jsonSchema,
|
|
1320
1376
|
storageFieldOf,
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
UiFailed,
|
|
6
6
|
UiForbidden,
|
|
7
7
|
UiUnauthorized
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-OHRT55C4.js";
|
|
9
9
|
import {
|
|
10
10
|
Schema_exports
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-FW5HBOIK.js";
|
|
12
12
|
|
|
13
13
|
// src/contracts/ui-auth.ts
|
|
14
14
|
var AppSignInId = Schema_exports.String.check(Schema_exports.isPattern(/^[a-f0-9]{64}$/)).pipe(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
operationDeclaration
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-PZ36XMXW.js";
|
|
4
4
|
|
|
5
5
|
// src/implementation/protocol-operations.ts
|
|
6
6
|
var protocolOperations = (operations, kinds = {}) => {
|
|
@@ -14,11 +14,12 @@ var protocolOperations = (operations, kinds = {}) => {
|
|
|
14
14
|
...operation.annotations === void 0 ? {} : { annotations: operation.annotations },
|
|
15
15
|
...operation._meta === void 0 ? {} : { _meta: operation._meta },
|
|
16
16
|
input: operation.input,
|
|
17
|
-
...operation.outputSchema === void 0 ? {} : { outputSchema: operation.outputSchema },
|
|
18
17
|
run: operation.run
|
|
19
18
|
};
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
const output = Object.getOwnPropertyDescriptor(operation, "outputSchema");
|
|
20
|
+
const withOutput = (target) => output === void 0 || output.get === void 0 && output.value === void 0 ? target : Object.defineProperty(target, "outputSchema", { ...output, enumerable: true });
|
|
21
|
+
if (kind === "query") queries[name] = operationDeclaration(withOutput({ ...native, kind }));
|
|
22
|
+
else mutations[name] = operationDeclaration(withOutput({ ...native, kind: "mutation" }));
|
|
22
23
|
}
|
|
23
24
|
return { queries, mutations };
|
|
24
25
|
};
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CacheError
|
|
3
|
+
} from "./chunk-RBAC33PQ.js";
|
|
4
|
+
import {
|
|
5
|
+
wrap
|
|
6
|
+
} from "./chunk-2HHMABB6.js";
|
|
7
|
+
import {
|
|
8
|
+
JsonObject
|
|
9
|
+
} from "./chunk-SATWJKN6.js";
|
|
10
|
+
import {
|
|
11
|
+
Duration_exports,
|
|
12
|
+
Effect_exports,
|
|
13
|
+
Schema_exports
|
|
14
|
+
} from "./chunk-FW5HBOIK.js";
|
|
15
|
+
|
|
16
|
+
// src/implementation/catalog-cache.ts
|
|
17
|
+
var schema = (decoder) => wrap(decoder, false);
|
|
18
|
+
var Manifest = Schema_exports.Struct({
|
|
19
|
+
revision: Schema_exports.String,
|
|
20
|
+
pages: Schema_exports.Int,
|
|
21
|
+
summaries: Schema_exports.Int
|
|
22
|
+
});
|
|
23
|
+
var invoke = (work) => Effect_exports.tryPromise({ try: work, catch: (error) => error });
|
|
24
|
+
var catalogCache = (options) => Effect_exports.gen(function* () {
|
|
25
|
+
const cache = options.cache;
|
|
26
|
+
const key = [...options.prefix, "current"];
|
|
27
|
+
const part = (revision, kind, name) => [
|
|
28
|
+
...options.prefix,
|
|
29
|
+
revision,
|
|
30
|
+
kind,
|
|
31
|
+
name
|
|
32
|
+
];
|
|
33
|
+
const freshFor = options.freshFor ?? "5 minutes";
|
|
34
|
+
const staleFor = options.staleFor ?? "1 day";
|
|
35
|
+
const retention = Duration_exports.toMillis(Duration_exports.fromInputUnsafe(freshFor)) + Duration_exports.toMillis(Duration_exports.fromInputUnsafe(staleFor)) + 3e5;
|
|
36
|
+
const local = yield* Effect_exports.cached(options.load());
|
|
37
|
+
const refresh = (context) => Effect_exports.gen(function* () {
|
|
38
|
+
const tools = yield* options.load(context);
|
|
39
|
+
const digest = yield* invoke(
|
|
40
|
+
() => crypto.subtle.digest("SHA-256", new TextEncoder().encode(JSON.stringify(tools)))
|
|
41
|
+
);
|
|
42
|
+
const revision = Array.from(
|
|
43
|
+
new Uint8Array(digest),
|
|
44
|
+
(byte) => byte.toString(16).padStart(2, "0")
|
|
45
|
+
).join("");
|
|
46
|
+
let pages2 = 0;
|
|
47
|
+
let page = [];
|
|
48
|
+
let pageBytes = 0;
|
|
49
|
+
let summaries = 0;
|
|
50
|
+
let summary = [];
|
|
51
|
+
let summaryBytes = 0;
|
|
52
|
+
let batch = [];
|
|
53
|
+
let batchBytes = 0;
|
|
54
|
+
const flush = () => invoke(async () => {
|
|
55
|
+
if (batch.length) await context.cache.write(batch, retention);
|
|
56
|
+
batch = [];
|
|
57
|
+
batchBytes = 0;
|
|
58
|
+
});
|
|
59
|
+
const append = (entry) => Effect_exports.gen(function* () {
|
|
60
|
+
const bytes = new TextEncoder().encode(JSON.stringify(entry)).byteLength;
|
|
61
|
+
if (batch.length && (batch.length >= 64 || batchBytes + bytes > 4e6))
|
|
62
|
+
yield* flush();
|
|
63
|
+
batch.push(entry);
|
|
64
|
+
batchBytes += bytes;
|
|
65
|
+
});
|
|
66
|
+
const pageOut = () => Effect_exports.gen(function* () {
|
|
67
|
+
if (!page.length) return;
|
|
68
|
+
yield* append({ key: part(revision, "page", pages2++), value: page });
|
|
69
|
+
page = [];
|
|
70
|
+
pageBytes = 0;
|
|
71
|
+
});
|
|
72
|
+
const summaryOut = () => Effect_exports.gen(function* () {
|
|
73
|
+
if (!summary.length) return;
|
|
74
|
+
yield* append({ key: part(revision, "summary", summaries++), value: summary });
|
|
75
|
+
summary = [];
|
|
76
|
+
summaryBytes = 0;
|
|
77
|
+
});
|
|
78
|
+
const json = (value) => Schema_exports.decodeUnknownEffect(Schema_exports.fromJsonString(JsonObject))(JSON.stringify(value));
|
|
79
|
+
for (const tool of tools) {
|
|
80
|
+
const value = yield* json(tool);
|
|
81
|
+
const bytes = new TextEncoder().encode(JSON.stringify(value)).byteLength;
|
|
82
|
+
if (page.length && (page.length >= 64 || pageBytes + bytes > 5e5)) yield* pageOut();
|
|
83
|
+
yield* append({ key: part(revision, "tool", tool.name), value });
|
|
84
|
+
page.push(value);
|
|
85
|
+
pageBytes += bytes;
|
|
86
|
+
const brief = yield* json(options.summary.of(tool));
|
|
87
|
+
const briefBytes = new TextEncoder().encode(JSON.stringify(brief)).byteLength;
|
|
88
|
+
if (summary.length && summaryBytes + briefBytes > 5e5) yield* summaryOut();
|
|
89
|
+
summary.push(brief);
|
|
90
|
+
summaryBytes += briefBytes;
|
|
91
|
+
}
|
|
92
|
+
yield* pageOut();
|
|
93
|
+
yield* summaryOut();
|
|
94
|
+
yield* flush();
|
|
95
|
+
return { revision, pages: pages2, summaries };
|
|
96
|
+
});
|
|
97
|
+
const getOptions = {
|
|
98
|
+
key,
|
|
99
|
+
schema: schema(Manifest),
|
|
100
|
+
freshFor,
|
|
101
|
+
staleFor,
|
|
102
|
+
load: (context) => Effect_exports.runPromise(refresh(context), { signal: context.signal })
|
|
103
|
+
};
|
|
104
|
+
const current = () => cache === void 0 ? Effect_exports.fail(new CacheError({ reason: "unavailable" })) : invoke(() => cache.get(getOptions));
|
|
105
|
+
if (options.revalidate) {
|
|
106
|
+
if (cache === void 0) yield* local;
|
|
107
|
+
else yield* invoke(() => cache.revalidate(getOptions));
|
|
108
|
+
}
|
|
109
|
+
const pages = (cache2, revision, kind, count, decoder) => Effect_exports.gen(function* () {
|
|
110
|
+
const batches = yield* Effect_exports.forEach(
|
|
111
|
+
Array.from({ length: Math.ceil(count / 4) }, (_, batch) => batch * 4),
|
|
112
|
+
(offset) => invoke(
|
|
113
|
+
() => cache2.readMany(
|
|
114
|
+
Array.from(
|
|
115
|
+
{ length: Math.min(4, count - offset) },
|
|
116
|
+
(_, index) => part(revision, kind, offset + index)
|
|
117
|
+
),
|
|
118
|
+
schema(Schema_exports.Array(decoder))
|
|
119
|
+
)
|
|
120
|
+
),
|
|
121
|
+
{ concurrency: "unbounded" }
|
|
122
|
+
);
|
|
123
|
+
const values = [];
|
|
124
|
+
for (const page of batches.flat()) {
|
|
125
|
+
if (page === void 0) return yield* new CacheError({ reason: "unavailable" });
|
|
126
|
+
values.push(...page);
|
|
127
|
+
}
|
|
128
|
+
return values;
|
|
129
|
+
});
|
|
130
|
+
const metadata = () => Effect_exports.gen(function* () {
|
|
131
|
+
if (cache === void 0) return yield* local;
|
|
132
|
+
const manifest = yield* current();
|
|
133
|
+
return yield* pages(cache, manifest.revision, "page", manifest.pages, options.schema);
|
|
134
|
+
});
|
|
135
|
+
return {
|
|
136
|
+
list: metadata,
|
|
137
|
+
summaries: () => Effect_exports.gen(function* () {
|
|
138
|
+
if (cache === void 0) return (yield* local).map((tool) => options.summary.of(tool));
|
|
139
|
+
const manifest = yield* current();
|
|
140
|
+
return yield* pages(
|
|
141
|
+
cache,
|
|
142
|
+
manifest.revision,
|
|
143
|
+
"summary",
|
|
144
|
+
manifest.summaries,
|
|
145
|
+
options.summary.schema
|
|
146
|
+
);
|
|
147
|
+
}),
|
|
148
|
+
resolve: (name) => cache === void 0 ? local.pipe(Effect_exports.map((tools) => tools.find((tool) => tool.name === name))) : current().pipe(
|
|
149
|
+
Effect_exports.flatMap(
|
|
150
|
+
(manifest) => invoke(
|
|
151
|
+
() => cache.read(part(manifest.revision, "tool", name), schema(options.schema))
|
|
152
|
+
)
|
|
153
|
+
)
|
|
154
|
+
)
|
|
155
|
+
};
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
export {
|
|
159
|
+
catalogCache
|
|
160
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
8
|
+
try {
|
|
9
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
+
} catch (e) {
|
|
11
|
+
throw mod = 0, e;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
var __export = (target, all) => {
|
|
15
|
+
for (var name in all)
|
|
16
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
+
};
|
|
18
|
+
var __copyProps = (to, from, except, desc) => {
|
|
19
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
+
for (let key of __getOwnPropNames(from))
|
|
21
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
+
}
|
|
24
|
+
return to;
|
|
25
|
+
};
|
|
26
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
27
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
28
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
29
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
30
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
31
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
32
|
+
mod
|
|
33
|
+
));
|
|
34
|
+
|
|
35
|
+
export {
|
|
36
|
+
__commonJS,
|
|
37
|
+
__export,
|
|
38
|
+
__toESM
|
|
39
|
+
};
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
invalidate,
|
|
4
4
|
layer,
|
|
5
5
|
mutation
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-M6ZRRIBI.js";
|
|
7
7
|
import {
|
|
8
8
|
Boolean,
|
|
9
9
|
Cause,
|
|
@@ -158,12 +158,12 @@ import {
|
|
|
158
158
|
void_2,
|
|
159
159
|
whileLoop,
|
|
160
160
|
zipRight
|
|
161
|
-
} from "./chunk-
|
|
161
|
+
} from "./chunk-FW5HBOIK.js";
|
|
162
162
|
import {
|
|
163
163
|
__export
|
|
164
|
-
} from "./chunk-
|
|
164
|
+
} from "./chunk-CZ7CSFO4.js";
|
|
165
165
|
|
|
166
|
-
// ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@
|
|
166
|
+
// ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/reactivity/AsyncResult.js
|
|
167
167
|
var AsyncResult_exports = {};
|
|
168
168
|
__export(AsyncResult_exports, {
|
|
169
169
|
Schema: () => Schema,
|
|
@@ -600,7 +600,7 @@ var Schema = (options) => {
|
|
|
600
600
|
});
|
|
601
601
|
};
|
|
602
602
|
|
|
603
|
-
// ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@
|
|
603
|
+
// ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/reactivity/AtomRegistry.js
|
|
604
604
|
var AtomRegistry_exports = {};
|
|
605
605
|
__export(AtomRegistry_exports, {
|
|
606
606
|
AtomRegistry: () => AtomRegistry,
|
|
@@ -1340,7 +1340,7 @@ function batchRebuildNode(node) {
|
|
|
1340
1340
|
}
|
|
1341
1341
|
}
|
|
1342
1342
|
|
|
1343
|
-
// ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@
|
|
1343
|
+
// ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/reactivity/Atom.js
|
|
1344
1344
|
var Atom_exports = {};
|
|
1345
1345
|
__export(Atom_exports, {
|
|
1346
1346
|
Interrupt: () => Interrupt,
|
|
@@ -1400,7 +1400,7 @@ __export(Atom_exports, {
|
|
|
1400
1400
|
writable: () => writable
|
|
1401
1401
|
});
|
|
1402
1402
|
|
|
1403
|
-
// ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@
|
|
1403
|
+
// ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/persistence/KeyValueStore.js
|
|
1404
1404
|
var ErrorTypeId = "~effect/persistence/KeyValueStore/KeyValueStoreError";
|
|
1405
1405
|
var KeyValueStoreError = class extends (/* @__PURE__ */ TaggedError("KeyValueStoreError")) {
|
|
1406
1406
|
/**
|
|
@@ -1442,7 +1442,7 @@ var toSchemaStore = (self, schema) => {
|
|
|
1442
1442
|
};
|
|
1443
1443
|
};
|
|
1444
1444
|
|
|
1445
|
-
// ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@
|
|
1445
|
+
// ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/reactivity/Atom.js
|
|
1446
1446
|
var TypeId3 = "~effect/reactivity/Atom";
|
|
1447
1447
|
var isAtom = (u) => hasProperty(u, TypeId3);
|
|
1448
1448
|
var WritableTypeId = "~effect/reactivity/Atom/Writable";
|