apps 0.0.1-beta.36 → 0.0.1-beta.38
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/framework-reference.json +1 -1
- package/js/{chunk-KOOJUMLR.js → chunk-3MMG2H6M.js} +2 -2
- package/js/{chunk-XEXUHXC3.js → chunk-3V575NIW.js} +226 -18
- package/js/{chunk-KZFV3WCJ.js → chunk-5P2WQRRM.js} +385 -56
- package/js/{chunk-4U2VUDET.js → chunk-5TJA7364.js} +2 -2
- package/js/{chunk-BKJDZYK7.js → chunk-7CSHVXVR.js} +3 -3
- package/js/{chunk-ZQWDOHEO.js → chunk-BO4US6DZ.js} +9 -49
- package/js/{chunk-A4O72Z3A.js → chunk-DKUEYTYD.js} +167 -30
- package/js/{chunk-UBAKWXAJ.js → chunk-DWMEIU2L.js} +411 -94
- package/js/{chunk-ENJCQWVF.js → chunk-E4BWL7KQ.js} +3 -3
- package/js/{chunk-CZLCA2O4.js → chunk-F3TBO2U3.js} +7 -94
- package/js/{chunk-POOIHRPF.js → chunk-GHXRRFZA.js} +11 -34
- package/js/{chunk-RSNZDT4L.js → chunk-JTMDWPCH.js} +2 -2
- package/js/{chunk-YW333DH3.js → chunk-KANDIVIH.js} +4 -4
- package/js/chunk-KAQD3DTI.js +16 -0
- package/js/{chunk-556EWA6P.js → chunk-MLHNVYHT.js} +17 -4
- package/js/{chunk-IJQ5LE74.js → chunk-MXDKXAY4.js} +363 -401
- package/js/{chunk-A2NN45C7.js → chunk-NROBHRTG.js} +7 -7
- package/js/{chunk-BI6R577B.js → chunk-P7MGDPFD.js} +2 -2
- package/js/{chunk-SRB2WDU7.js → chunk-Q4QZDB2F.js} +3 -3
- package/js/{chunk-JU7F4PRK.js → chunk-RIXVGVA6.js} +2 -2
- package/js/{chunk-WAGGHNWH.js → chunk-RJCWJNCH.js} +9 -9
- package/js/{chunk-WMVTBHGK.js → chunk-U5PFZDVB.js} +2 -2
- package/js/{chunk-PHO7HXTC.js → chunk-VIU2XXA7.js} +294 -47
- package/js/{chunk-TADLIUEU.js → chunk-VJQXXOQ3.js} +2 -2
- package/js/{chunk-NHCFIWN5.js → chunk-W2NV54JD.js} +1 -1
- package/js/{chunk-BI45HZWM.js → chunk-YQ35E7KS.js} +1 -1
- package/js/{chunk-WDBUOIWV.js → chunk-ZUKBIHMK.js} +3 -3
- package/js/client.js +13 -16
- package/js/contracts.js +16 -20
- package/js/effect.js +19 -23
- package/js/graphql.js +21 -25
- package/js/host.js +19 -23
- package/js/index.js +13 -25
- package/js/mcp/effect.js +21 -25
- package/js/mcp/stdio.js +21 -25
- package/js/mcp.js +23 -27
- package/js/openapi.js +17 -20
- package/js/react.js +2 -3
- package/js/skills/effect.js +6 -6
- package/js/skills.js +15 -16
- package/js/storage/facet.js +1 -214
- package/js/ui/auth/contracts.js +2 -2
- package/js/ui/auth.js +5 -5
- package/js/ui/contracts.js +5 -6
- package/js/ui/serving.js +10 -10
- package/package.json +1 -2
- package/runtime.json +1 -1
- package/types/apps/src/contracts/app.d.ts +0 -2
- package/types/apps/src/contracts/context.d.ts +12 -11
- package/types/apps/src/contracts/host.d.ts +10 -8
- package/types/apps/src/contracts/live.d.ts +2 -0
- package/types/apps/src/contracts/operations.d.ts +3 -3
- package/types/apps/src/contracts/protocol-version.d.ts +2 -2
- package/types/apps/src/contracts/protocols/10.d.ts +1450 -0
- package/types/apps/src/contracts/protocols/4.d.ts +3 -3
- package/types/apps/src/contracts/protocols/5.d.ts +1 -1
- package/types/apps/src/contracts/protocols/6.d.ts +1 -1
- package/types/apps/src/contracts/protocols/7.d.ts +1 -1
- package/types/apps/src/contracts/sql.d.ts +58 -0
- package/types/apps/src/contracts/workflows.d.ts +6 -0
- package/types/apps/src/facet.d.ts +4 -5
- package/types/apps/src/implementation/openapi-compile.d.ts +2 -2
- package/types/apps/src/implementation/schema.d.ts +1 -10
- package/types/apps/src/implementation/sql.d.ts +66 -0
- package/types/apps/src/index.d.ts +1 -2
- package/types/telemetry/src/app-records.d.ts +42 -0
- package/types/telemetry/src/recorded-failure.d.ts +20 -0
- package/types/utils/src/api-error.d.ts +5 -0
- package/types/utils/src/recorded-message.d.ts +15 -0
- package/js/chunk-73AV3JVU.js +0 -186
- package/js/chunk-HDAQBRT5.js +0 -1254
- package/js/chunk-IU7CCCUC.js +0 -630
- package/js/chunk-NHUHTWAF.js +0 -0
- package/js/chunk-V5DWGYRK.js +0 -268
- package/js/chunk-Y3XN4X4Q.js +0 -19
- package/types/app-data/src/implementation/cursor.d.ts +0 -10
- package/types/app-data/src/implementation/index-key.d.ts +0 -7
- package/types/app-data/src/implementation/promise.d.ts +0 -68
- package/types/app-data/src/implementation/range.d.ts +0 -8
- package/types/app-data/src/implementation/schema.d.ts +0 -18
- package/types/app-data/src/implementation/sqlite.d.ts +0 -11
- package/types/app-data/src/index.d.ts +0 -4
- package/types/apps/src/contracts/storage.d.ts +0 -68
- package/types/apps/src/implementation/storage.d.ts +0 -15
|
@@ -1,34 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
promiseTable
|
|
3
|
-
} from "./chunk-IU7CCCUC.js";
|
|
4
1
|
import {
|
|
5
2
|
declaredOperations,
|
|
6
3
|
fromPromise,
|
|
7
4
|
nativeOperation,
|
|
8
5
|
nativeRouter
|
|
9
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-7CSHVXVR.js";
|
|
10
7
|
import {
|
|
11
8
|
ScheduleTiming
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import {
|
|
14
|
-
DatabaseSchema
|
|
15
|
-
} from "./chunk-73AV3JVU.js";
|
|
9
|
+
} from "./chunk-3V575NIW.js";
|
|
16
10
|
import {
|
|
17
11
|
decoderOf,
|
|
18
12
|
isSchema,
|
|
19
|
-
schemaArgument
|
|
20
|
-
|
|
21
|
-
} from "./chunk-POOIHRPF.js";
|
|
22
|
-
import {
|
|
23
|
-
AppStorageUnavailable
|
|
24
|
-
} from "./chunk-Y3XN4X4Q.js";
|
|
13
|
+
schemaArgument
|
|
14
|
+
} from "./chunk-GHXRRFZA.js";
|
|
25
15
|
import {
|
|
26
16
|
JsonValue
|
|
27
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-YQ35E7KS.js";
|
|
28
18
|
import {
|
|
29
19
|
Effect_exports,
|
|
30
20
|
Schema_exports
|
|
31
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-MXDKXAY4.js";
|
|
32
22
|
|
|
33
23
|
// src/contracts/http.ts
|
|
34
24
|
var ResponseStatusError = class extends Schema_exports.TaggedError()(
|
|
@@ -147,7 +137,6 @@ var defineApp = (requirements, definition) => {
|
|
|
147
137
|
const factory = fromPromise(evaluate);
|
|
148
138
|
const native = {
|
|
149
139
|
accounts: requirements.accounts,
|
|
150
|
-
...requirements.database === void 0 ? {} : { database: requirements.database },
|
|
151
140
|
evaluate: (context) => factory(context).pipe(Effect_exports.map((value) => adaptDefinition(value)))
|
|
152
141
|
};
|
|
153
142
|
return {
|
|
@@ -157,87 +146,11 @@ var defineApp = (requirements, definition) => {
|
|
|
157
146
|
};
|
|
158
147
|
};
|
|
159
148
|
|
|
160
|
-
// src/implementation/storage.ts
|
|
161
|
-
var table = (fields) => tableWithIndexes(fields, []);
|
|
162
|
-
var tableWithIndexes = (fields, indexes) => ({
|
|
163
|
-
fields,
|
|
164
|
-
indexes,
|
|
165
|
-
index: (name, fieldsInIndex) => tableWithIndexes(fields, [...indexes, { name, fields: fieldsInIndex }])
|
|
166
|
-
});
|
|
167
|
-
var serialize = (tables) => {
|
|
168
|
-
const definitions = Object.fromEntries(
|
|
169
|
-
Object.entries(tables).map(([name, table2]) => [
|
|
170
|
-
name,
|
|
171
|
-
{
|
|
172
|
-
fields: Object.fromEntries(
|
|
173
|
-
Object.entries(table2.fields).map(([fieldName, schema]) => {
|
|
174
|
-
const field = storageFieldOf(schema);
|
|
175
|
-
if (field === void 0) throw new Error("Database columns must use a scalar schema");
|
|
176
|
-
return [fieldName, field];
|
|
177
|
-
})
|
|
178
|
-
),
|
|
179
|
-
indexes: table2.indexes
|
|
180
|
-
}
|
|
181
|
-
])
|
|
182
|
-
);
|
|
183
|
-
return Schema_exports.decodeUnknownSync(DatabaseSchema)(definitions);
|
|
184
|
-
};
|
|
185
|
-
var authorDatabase = (tables, session, signal, writable) => {
|
|
186
|
-
return Object.fromEntries(
|
|
187
|
-
Object.entries(tables).map(([name, table2]) => {
|
|
188
|
-
const api = promiseTable(session, name, signal);
|
|
189
|
-
const parseFields = (input, partial) => {
|
|
190
|
-
const values = Schema_exports.decodeUnknownSync(
|
|
191
|
-
Schema_exports.Record(Schema_exports.String, Schema_exports.Unknown)
|
|
192
|
-
)(input);
|
|
193
|
-
const fields = {};
|
|
194
|
-
for (const [key, value] of Object.entries(values)) {
|
|
195
|
-
if (value === void 0) continue;
|
|
196
|
-
const field = Object.hasOwn(table2.fields, key) ? table2.fields[key] : void 0;
|
|
197
|
-
if (field === void 0) throw new Error("Unknown database column");
|
|
198
|
-
const definition = storageFieldOf(field);
|
|
199
|
-
fields[key] = value === null && definition?.optional ? null : field.parse(value);
|
|
200
|
-
}
|
|
201
|
-
if (!partial) {
|
|
202
|
-
for (const [key, field] of Object.entries(table2.fields))
|
|
203
|
-
if (!Object.hasOwn(fields, key)) {
|
|
204
|
-
const value = field.parse(void 0);
|
|
205
|
-
if (value !== void 0) fields[key] = value;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
return fields;
|
|
209
|
-
};
|
|
210
|
-
const read = { get: api.get, withIndex: api.withIndex };
|
|
211
|
-
return [
|
|
212
|
-
name,
|
|
213
|
-
writable ? {
|
|
214
|
-
...read,
|
|
215
|
-
insert: (value) => api.insert(parseFields(value, false)),
|
|
216
|
-
update: (id, value) => api.update(id, parseFields(value, true)),
|
|
217
|
-
delete: api.delete
|
|
218
|
-
} : read
|
|
219
|
-
];
|
|
220
|
-
})
|
|
221
|
-
);
|
|
222
|
-
};
|
|
223
|
-
var defineDatabase = (tables) => ({
|
|
224
|
-
schema: serialize(tables),
|
|
225
|
-
tables
|
|
226
|
-
});
|
|
227
|
-
var unavailableStorage = {
|
|
228
|
-
read: () => Effect_exports.fail(new AppStorageUnavailable()),
|
|
229
|
-
mutate: () => Effect_exports.fail(new AppStorageUnavailable())
|
|
230
|
-
};
|
|
231
|
-
|
|
232
149
|
export {
|
|
233
150
|
ResponseStatusError,
|
|
234
151
|
ResponseDecodeError,
|
|
235
152
|
workflow,
|
|
236
153
|
isApp,
|
|
237
154
|
toEffectApp,
|
|
238
|
-
defineApp
|
|
239
|
-
table,
|
|
240
|
-
authorDatabase,
|
|
241
|
-
defineDatabase,
|
|
242
|
-
unavailableStorage
|
|
155
|
+
defineApp
|
|
243
156
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
JsonObject,
|
|
3
3
|
ValidationError
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YQ35E7KS.js";
|
|
5
5
|
import {
|
|
6
6
|
Cause_exports,
|
|
7
7
|
Effect_exports,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
SchemaIssue_exports,
|
|
11
11
|
SchemaParser_exports,
|
|
12
12
|
Schema_exports
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-MXDKXAY4.js";
|
|
14
14
|
|
|
15
15
|
// ../../node_modules/.bun/@cfworker+json-schema@4.1.1/node_modules/@cfworker/json-schema/dist/esm/deep-compare-strict.js
|
|
16
16
|
function deepCompareStrict(a, b) {
|
|
@@ -107,9 +107,9 @@ var ignoredKeyword = {
|
|
|
107
107
|
var initialBaseURI = typeof self !== "undefined" && self.location && self.location.origin !== "null" ? new URL(self.location.origin + self.location.pathname + location.search) : new URL("https://github.com/cfworker");
|
|
108
108
|
function dereference(schema, lookup = /* @__PURE__ */ Object.create(null), baseURI = initialBaseURI, basePointer = "") {
|
|
109
109
|
if (schema && typeof schema === "object" && !Array.isArray(schema)) {
|
|
110
|
-
const
|
|
111
|
-
if (
|
|
112
|
-
const url = new URL(
|
|
110
|
+
const id = schema.$id || schema.id;
|
|
111
|
+
if (id) {
|
|
112
|
+
const url = new URL(id, baseURI.href);
|
|
113
113
|
if (url.hash.length > 1) {
|
|
114
114
|
lookup[url.href] = schema;
|
|
115
115
|
} else {
|
|
@@ -1069,7 +1069,6 @@ function schemaPattern(pattern) {
|
|
|
1069
1069
|
}
|
|
1070
1070
|
|
|
1071
1071
|
// src/implementation/schema.ts
|
|
1072
|
-
var StorageField = /* @__PURE__ */ Symbol("apps.StorageField");
|
|
1073
1072
|
var Decoder = /* @__PURE__ */ Symbol("apps.Schema");
|
|
1074
1073
|
var decoderOf = (schema) => schema[Decoder];
|
|
1075
1074
|
var isSchema = (value) => typeof value === "object" && value !== null && Decoder in value;
|
|
@@ -1083,33 +1082,18 @@ var schemaArgument = (value, role) => {
|
|
|
1083
1082
|
var parse = (decoder, input) => Effect_exports.suspend(() => Schema_exports.decodeUnknownEffect(decoder)(input)).pipe(
|
|
1084
1083
|
Effect_exports.mapError(() => new ValidationError())
|
|
1085
1084
|
);
|
|
1086
|
-
function wrap(decoder, optionalValue
|
|
1085
|
+
function wrap(decoder, optionalValue) {
|
|
1087
1086
|
return {
|
|
1088
1087
|
[Decoder]: decoder,
|
|
1089
|
-
...field === void 0 ? {} : { [StorageField]: field },
|
|
1090
1088
|
optionalValue,
|
|
1091
1089
|
parse: (input) => Effect_exports.runSync(parse(decoder, input)),
|
|
1092
|
-
optional: () => wrap(
|
|
1093
|
-
Schema_exports.optional(decoder),
|
|
1094
|
-
true,
|
|
1095
|
-
field === void 0 ? void 0 : { ...field, optional: true }
|
|
1096
|
-
),
|
|
1090
|
+
optional: () => wrap(Schema_exports.optional(decoder), true),
|
|
1097
1091
|
default: (value) => {
|
|
1098
1092
|
const parsed = Effect_exports.runSync(parse(decoder, value));
|
|
1099
1093
|
return {
|
|
1100
1094
|
...wrap(
|
|
1101
1095
|
decoder.annotate({ default: parsed }).pipe(Schema_exports.withDecodingDefault(Effect_exports.succeed(parsed))),
|
|
1102
|
-
false
|
|
1103
|
-
field === void 0 || parsed === void 0 ? void 0 : {
|
|
1104
|
-
...field,
|
|
1105
|
-
default: Schema_exports.decodeUnknownSync(
|
|
1106
|
-
Schema_exports.Union([
|
|
1107
|
-
Schema_exports.String,
|
|
1108
|
-
Schema_exports.Finite,
|
|
1109
|
-
Schema_exports.Boolean
|
|
1110
|
-
])
|
|
1111
|
-
)(parsed)
|
|
1112
|
-
}
|
|
1096
|
+
false
|
|
1113
1097
|
),
|
|
1114
1098
|
hasDefault: true,
|
|
1115
1099
|
inputOptional: optionalValue
|
|
@@ -1120,12 +1104,11 @@ function wrap(decoder, optionalValue, field) {
|
|
|
1120
1104
|
function string(options = {}) {
|
|
1121
1105
|
return wrap(
|
|
1122
1106
|
options.minLength === void 0 ? Schema_exports.String : Schema_exports.String.check(Schema_exports.isMinLength(options.minLength)),
|
|
1123
|
-
false
|
|
1124
|
-
{ kind: "string" }
|
|
1107
|
+
false
|
|
1125
1108
|
);
|
|
1126
1109
|
}
|
|
1127
|
-
var number = () => wrap(Schema_exports.Finite, false
|
|
1128
|
-
var boolean = () => wrap(Schema_exports.Boolean, false
|
|
1110
|
+
var number = () => wrap(Schema_exports.Finite, false);
|
|
1111
|
+
var boolean = () => wrap(Schema_exports.Boolean, false);
|
|
1129
1112
|
var json = () => wrap(Schema_exports.Json, false);
|
|
1130
1113
|
var record = (value) => wrap(
|
|
1131
1114
|
Schema_exports.Record(
|
|
@@ -1752,9 +1735,6 @@ var jsonSchema = (input) => {
|
|
|
1752
1735
|
false
|
|
1753
1736
|
);
|
|
1754
1737
|
};
|
|
1755
|
-
var storageFieldOf = (schema) => schema[StorageField];
|
|
1756
|
-
var id = (table) => wrap(Schema_exports.NonEmptyString, false, { kind: "id", references: table });
|
|
1757
|
-
var userId = () => wrap(Schema_exports.NonEmptyString, false, { kind: "userId" });
|
|
1758
1738
|
var jsonSchemaDocument = (decoder) => {
|
|
1759
1739
|
const imported = importedJsonSchema(decoder);
|
|
1760
1740
|
if (imported !== void 0) return Schema_exports.decodeUnknownEffect(JsonObject)(imported);
|
|
@@ -1797,8 +1777,5 @@ export {
|
|
|
1797
1777
|
preparedJsonSchemaDecoder,
|
|
1798
1778
|
jsonSchemaDecoder,
|
|
1799
1779
|
jsonSchema,
|
|
1800
|
-
storageFieldOf,
|
|
1801
|
-
id,
|
|
1802
|
-
userId,
|
|
1803
1780
|
jsonSchemaDocument
|
|
1804
1781
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
appSignInCallbackPath
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-W2NV54JD.js";
|
|
4
4
|
import {
|
|
5
5
|
HttpServerResponse_exports
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-3MMG2H6M.js";
|
|
7
7
|
|
|
8
8
|
// src/implementation/ui-auth.ts
|
|
9
9
|
var appPrivateHeaders = {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CacheError
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-P7MGDPFD.js";
|
|
4
4
|
import {
|
|
5
5
|
wrap
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-GHXRRFZA.js";
|
|
7
7
|
import {
|
|
8
8
|
JsonObject
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-YQ35E7KS.js";
|
|
10
10
|
import {
|
|
11
11
|
Duration_exports,
|
|
12
12
|
Effect_exports,
|
|
13
13
|
Schema_exports
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-MXDKXAY4.js";
|
|
15
15
|
|
|
16
16
|
// src/implementation/catalog-cache.ts
|
|
17
17
|
var catalogScope = (options, credential, invalid) => {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Predicate_exports
|
|
3
|
+
} from "./chunk-MXDKXAY4.js";
|
|
4
|
+
|
|
5
|
+
// ../utils/src/recorded-message.ts
|
|
6
|
+
var RecordedMessage = /* @__PURE__ */ Symbol.for("@executor-js/utils/RecordedMessage");
|
|
7
|
+
var recordedMessage = (error) => {
|
|
8
|
+
if (!Predicate_exports.hasProperty(error, RecordedMessage)) return void 0;
|
|
9
|
+
const message = error[RecordedMessage];
|
|
10
|
+
return typeof message === "string" ? message : void 0;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export {
|
|
14
|
+
RecordedMessage,
|
|
15
|
+
recordedMessage
|
|
16
|
+
};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
RecordedMessage
|
|
3
|
+
} from "./chunk-KAQD3DTI.js";
|
|
1
4
|
import {
|
|
2
5
|
SchemaGetter_exports,
|
|
3
6
|
Schema_exports
|
|
4
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-MXDKXAY4.js";
|
|
5
8
|
|
|
6
9
|
// ../utils/src/api-error.ts
|
|
7
10
|
var MessageField = Schema_exports.String.pipe(
|
|
@@ -20,9 +23,19 @@ function withFields(definition) {
|
|
|
20
23
|
),
|
|
21
24
|
{ httpApiStatus: definition.status, ...documentation }
|
|
22
25
|
);
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
const recorded = definition.recorded;
|
|
27
|
+
Object.defineProperties(DefinedError.prototype, {
|
|
28
|
+
message: {
|
|
29
|
+
get() {
|
|
30
|
+
return typeof message === "string" ? message : message(this);
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
...recorded === void 0 ? {} : {
|
|
34
|
+
[RecordedMessage]: {
|
|
35
|
+
get() {
|
|
36
|
+
return recorded(this);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
26
39
|
}
|
|
27
40
|
});
|
|
28
41
|
return DefinedError;
|