apps 0.0.1-beta.33 → 0.0.1-beta.35
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-TEV5IMOM.js → chunk-5CQMUXW7.js} +2 -2
- package/js/{chunk-N72RKJ5E.js → chunk-5KNA2Z5I.js} +13 -102
- package/js/{chunk-UMCMZFXW.js → chunk-73AV3JVU.js} +1 -1
- package/js/{chunk-6ZJ2H6P4.js → chunk-A4O72Z3A.js} +298 -190
- package/js/{chunk-FBBXFFFJ.js → chunk-BI45HZWM.js} +2 -2
- package/js/{chunk-5DLG2FVN.js → chunk-BI6R577B.js} +93 -2
- package/js/{chunk-4OKYLVU4.js → chunk-ENJCQWVF.js} +3 -3
- package/js/{chunk-OX233L7N.js → chunk-FFTALB6S.js} +2 -2
- package/js/{chunk-DASNNAP4.js → chunk-HDAQBRT5.js} +391 -14
- package/js/{chunk-HW3DPBZR.js → chunk-I7CNZ4CM.js} +1 -1
- package/js/{chunk-GMMS4BY3.js → chunk-IA3VSGR4.js} +7 -7
- package/js/{chunk-EXGKN554.js → chunk-IJQ5LE74.js} +9805 -9254
- package/js/{chunk-5JVNM3CQ.js → chunk-IU7CCCUC.js} +12 -12
- package/js/{chunk-AYM2FUI5.js → chunk-JU7F4PRK.js} +2 -2
- package/js/{chunk-E6C2DUIA.js → chunk-KBXQOJYW.js} +8 -8
- package/js/{chunk-CJY5X26R.js → chunk-KOOJUMLR.js} +86 -50
- package/js/{chunk-ETLILMHY.js → chunk-KZFV3WCJ.js} +21 -19
- package/js/{chunk-AKKJDDOT.js → chunk-LUROQKFP.js} +10 -10
- package/js/{chunk-ZOY7PDMI.js → chunk-NHCFIWN5.js} +1 -1
- package/js/chunk-NHUHTWAF.js +0 -0
- package/js/{chunk-QYM4STZW.js → chunk-PHO7HXTC.js} +149 -353
- package/js/{chunk-O3OAFU7Q.js → chunk-POOIHRPF.js} +2 -2
- package/js/{chunk-AUFVX4KM.js → chunk-RSNZDT4L.js} +2 -2
- package/js/chunk-SRB2WDU7.js +49 -0
- package/js/{chunk-MFHUR5SB.js → chunk-TADLIUEU.js} +4 -4
- package/js/{chunk-3BHBWZLD.js → chunk-UWOIEJ56.js} +20 -18
- package/js/chunk-V5DWGYRK.js +268 -0
- package/js/{chunk-75JKK3ZE.js → chunk-VBVOPW4U.js} +3 -3
- package/js/{chunk-GZ4UHXRT.js → chunk-WDBUOIWV.js} +3 -3
- package/js/{chunk-6KG4DZD7.js → chunk-Y3XN4X4Q.js} +1 -1
- package/js/{chunk-WWSRAE5Y.js → chunk-YW333DH3.js} +11 -8
- package/js/{chunk-2SRLJHPM.js → chunk-YYK6GEMC.js} +14 -53
- package/js/client.js +12 -11
- package/js/contracts.js +17 -16
- package/js/effect.js +23 -20
- package/js/graphql.js +27 -25
- package/js/host.js +23 -20
- package/js/index.js +18 -16
- package/js/mcp/effect.js +25 -22
- package/js/mcp/stdio.js +25 -22
- package/js/mcp.js +28 -25
- package/js/openapi.js +25 -22
- package/js/react.js +3 -3
- package/js/skills/effect.js +6 -5
- package/js/skills.js +119 -49
- package/js/storage/facet.js +19 -345
- package/js/ui/auth/contracts.js +2 -2
- package/js/ui/auth.js +5 -5
- package/js/ui/contracts.js +6 -5
- package/js/ui/serving.js +10 -9
- package/package.json +3 -3
- package/runtime.json +1 -1
- package/types/app-data/src/implementation/sqlite.d.ts +1 -1
- package/types/apps/src/contracts/cache.d.ts +14 -0
- package/types/apps/src/contracts/elicitation.d.ts +6 -6
- package/types/apps/src/contracts/protocols/1.d.ts +4 -4
- package/types/apps/src/contracts/protocols/2.d.ts +4 -4
- package/types/apps/src/contracts/protocols/3.d.ts +4 -4
- package/types/apps/src/contracts/protocols/4.d.ts +4 -4
- package/types/apps/src/contracts/protocols/5.d.ts +4 -4
- package/types/apps/src/contracts/protocols/6.d.ts +4 -4
- package/types/apps/src/contracts/protocols/7.d.ts +4 -4
- package/types/apps/src/contracts/protocols/8.d.ts +4 -4
- package/types/apps/src/contracts/skills.d.ts +16 -4
- package/types/apps/src/contracts/ui.d.ts +1 -1
- package/types/apps/src/implementation/catalog-cache.d.ts +14 -17
- package/types/apps/src/implementation/live.d.ts +2 -2
- package/types/apps/src/implementation/network.d.ts +1 -1
- package/types/apps/src/implementation/optimistic.d.ts +1 -1
- package/types/apps/src/implementation/query-commit.d.ts +1 -1
- package/types/apps/src/implementation/skills.d.ts +13 -19
- package/types/apps/src/implementation/ui-auth.d.ts +1 -1
- package/types/apps/src/implementation/ui-client.d.ts +1 -1
- package/types/apps/src/implementation/ui-serving.d.ts +1 -1
- package/types/apps/src/react.d.ts +1 -1
- package/types/apps/src/skills.d.ts +4 -3
- package/types/telemetry/src/browser-operations.d.ts +1 -1
- package/types/telemetry/src/browser.d.ts +2 -2
- package/types/telemetry/src/layer.d.ts +2 -2
- package/types/telemetry/src/relay.d.ts +2 -2
- package/types/telemetry/src/transport.d.ts +1 -1
- package/types/utils/src/api-error.d.ts +1 -1
|
@@ -12,15 +12,15 @@ import {
|
|
|
12
12
|
defaultDatabaseLimits,
|
|
13
13
|
defaultDatabaseRuntimeLimits,
|
|
14
14
|
reservedFieldNames
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-73AV3JVU.js";
|
|
16
16
|
import {
|
|
17
|
+
Base64Url_exports,
|
|
17
18
|
Cause_exports,
|
|
18
19
|
Clock_exports,
|
|
19
20
|
Effect_exports,
|
|
20
|
-
Encoding_exports,
|
|
21
21
|
Schema_exports,
|
|
22
22
|
Semaphore_exports
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-IJQ5LE74.js";
|
|
24
24
|
|
|
25
25
|
// ../app-data/src/implementation/schema.ts
|
|
26
26
|
var metadata = new Set(reservedFieldNames);
|
|
@@ -107,7 +107,7 @@ var Payload = Schema_exports.Struct({
|
|
|
107
107
|
key: Schema_exports.String
|
|
108
108
|
});
|
|
109
109
|
var fingerprint = (crypto, value) => Effect_exports.tryPromise({
|
|
110
|
-
try: async () =>
|
|
110
|
+
try: async () => Base64Url_exports.encode(
|
|
111
111
|
new Uint8Array(await crypto.subtle.digest("SHA-256", new TextEncoder().encode(value)))
|
|
112
112
|
),
|
|
113
113
|
catch: () => new AppDatabaseError({ reason: "storage" })
|
|
@@ -125,7 +125,7 @@ var cursorCodec = (crypto, bytes) => Effect_exports.gen(function* () {
|
|
|
125
125
|
try: async () => {
|
|
126
126
|
const nonce = crypto.getRandomValues(new Uint8Array(12));
|
|
127
127
|
const plaintext = new TextEncoder().encode(
|
|
128
|
-
JSON.stringify({ version: 1, query, key:
|
|
128
|
+
JSON.stringify({ version: 1, query, key: Base64Url_exports.encode(position) })
|
|
129
129
|
);
|
|
130
130
|
const ciphertext = new Uint8Array(
|
|
131
131
|
await crypto.subtle.encrypt({ name: "AES-GCM", iv: nonce }, key, plaintext)
|
|
@@ -133,14 +133,14 @@ var cursorCodec = (crypto, bytes) => Effect_exports.gen(function* () {
|
|
|
133
133
|
const token = new Uint8Array(nonce.length + ciphertext.length);
|
|
134
134
|
token.set(nonce);
|
|
135
135
|
token.set(ciphertext, nonce.length);
|
|
136
|
-
return
|
|
136
|
+
return Base64Url_exports.encode(token);
|
|
137
137
|
},
|
|
138
138
|
catch: () => new AppDatabaseError({ reason: "cursor" })
|
|
139
139
|
}),
|
|
140
140
|
decode: (query, token) => Effect_exports.gen(function* () {
|
|
141
141
|
if (token.length > defaultDatabaseRuntimeLimits.maxCursorChars)
|
|
142
142
|
return yield* new AppDatabaseError({ reason: "cursor" });
|
|
143
|
-
const encoded = yield* Effect_exports.fromResult(
|
|
143
|
+
const encoded = yield* Effect_exports.fromResult(Base64Url_exports.decode(token));
|
|
144
144
|
if (encoded.length < 28) return yield* new AppDatabaseError({ reason: "cursor" });
|
|
145
145
|
const plain = yield* Effect_exports.tryPromise(
|
|
146
146
|
() => crypto.subtle.decrypt(
|
|
@@ -153,7 +153,7 @@ var cursorCodec = (crypto, bytes) => Effect_exports.gen(function* () {
|
|
|
153
153
|
new TextDecoder().decode(plain)
|
|
154
154
|
);
|
|
155
155
|
if (payload.query !== query) return yield* new AppDatabaseError({ reason: "cursor" });
|
|
156
|
-
return yield* Effect_exports.fromResult(
|
|
156
|
+
return yield* Effect_exports.fromResult(Base64Url_exports.decode(payload.key));
|
|
157
157
|
}).pipe(Effect_exports.mapError(() => new AppDatabaseError({ reason: "cursor" })))
|
|
158
158
|
};
|
|
159
159
|
});
|
|
@@ -272,14 +272,14 @@ var makeSqliteDatabase = (options) => Effect_exports.gen(function* () {
|
|
|
272
272
|
yield* sql`CREATE TABLE IF NOT EXISTS app_indexes (table_name TEXT NOT NULL, index_name TEXT NOT NULL, sort_key BLOB NOT NULL, row_id TEXT NOT NULL, PRIMARY KEY (table_name, index_name, sort_key)) WITHOUT ROWID`;
|
|
273
273
|
yield* sql`CREATE TABLE IF NOT EXISTS app_mutation_receipts (id TEXT PRIMARY KEY, fingerprint TEXT NOT NULL, result TEXT NOT NULL) WITHOUT ROWID`;
|
|
274
274
|
yield* sql`CREATE INDEX IF NOT EXISTS app_indexes_by_row ON app_indexes (table_name, row_id)`;
|
|
275
|
-
const generated =
|
|
275
|
+
const generated = Base64Url_exports.encode(crypto.getRandomValues(new Uint8Array(32)));
|
|
276
276
|
yield* sql`INSERT OR IGNORE INTO app_database (singleton, schema_hash, cursor_key) VALUES (1, ${schemaHash}, ${generated})`;
|
|
277
277
|
const saved = yield* sql`SELECT schema_hash, cursor_key FROM app_database WHERE singleton = 1`.pipe(
|
|
278
278
|
Effect_exports.flatMap((rows) => Schema_exports.decodeUnknownEffect(Saved)(rows[0]))
|
|
279
279
|
);
|
|
280
280
|
if (saved.schema_hash !== schemaHash)
|
|
281
281
|
return yield* new AppDatabaseError({ reason: "schema_changed" });
|
|
282
|
-
return yield* Effect_exports.fromResult(
|
|
282
|
+
return yield* Effect_exports.fromResult(Base64Url_exports.decode(saved.cursor_key));
|
|
283
283
|
})
|
|
284
284
|
).pipe(
|
|
285
285
|
Effect_exports.catchTags({
|
|
@@ -423,8 +423,8 @@ var makeSqliteDatabase = (options) => Effect_exports.gen(function* () {
|
|
|
423
423
|
table: tableName,
|
|
424
424
|
index: plan.index,
|
|
425
425
|
order: plan.order,
|
|
426
|
-
lower:
|
|
427
|
-
upper: bounds.upper === void 0 ? null :
|
|
426
|
+
lower: Base64Url_exports.encode(bounds.lower),
|
|
427
|
+
upper: bounds.upper === void 0 ? null : Base64Url_exports.encode(bounds.upper)
|
|
428
428
|
})
|
|
429
429
|
);
|
|
430
430
|
const position = terminal.kind === "paginate" && terminal.cursor !== null ? yield* cursors.decode(query, terminal.cursor) : void 0;
|
|
@@ -3,14 +3,14 @@ import {
|
|
|
3
3
|
CacheEntry,
|
|
4
4
|
CacheError,
|
|
5
5
|
cacheLimits
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-BI6R577B.js";
|
|
7
7
|
import {
|
|
8
8
|
Clock_exports,
|
|
9
9
|
Duration_exports,
|
|
10
10
|
Effect_exports,
|
|
11
11
|
Exit_exports,
|
|
12
12
|
Schema_exports
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-IJQ5LE74.js";
|
|
14
14
|
|
|
15
15
|
// ../app-cache/src/index.ts
|
|
16
16
|
var canonical = (value) => {
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
import {
|
|
2
2
|
promiseTable
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-IU7CCCUC.js";
|
|
4
4
|
import {
|
|
5
5
|
declaredOperations,
|
|
6
6
|
fromPromise,
|
|
7
7
|
nativeOperation,
|
|
8
8
|
nativeRouter
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-VBVOPW4U.js";
|
|
10
10
|
import {
|
|
11
11
|
ScheduleTiming
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-5KNA2Z5I.js";
|
|
13
13
|
import {
|
|
14
14
|
DatabaseSchema
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-73AV3JVU.js";
|
|
16
16
|
import {
|
|
17
17
|
decoderOf,
|
|
18
18
|
isSchema,
|
|
19
19
|
schemaArgument,
|
|
20
20
|
storageFieldOf
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-POOIHRPF.js";
|
|
22
22
|
import {
|
|
23
23
|
AppStorageUnavailable
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-Y3XN4X4Q.js";
|
|
25
25
|
import {
|
|
26
26
|
JsonValue
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-BI45HZWM.js";
|
|
28
28
|
import {
|
|
29
29
|
Effect_exports,
|
|
30
30
|
Schema_exports
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-IJQ5LE74.js";
|
|
32
32
|
|
|
33
33
|
// src/contracts/http.ts
|
|
34
34
|
var ResponseStatusError = class extends Schema_exports.TaggedError()(
|