@effect-agent/storage-cloudflare 0.1.0-beta.33 → 0.1.0-beta.34
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/dist/index.d.mts +16 -0
- package/dist/index.mjs +10 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -10
- package/src/do-conversation-store.ts +8 -8
- package/src/do-journal.ts +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect-agent/storage-cloudflare",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.34",
|
|
4
4
|
"exports": {
|
|
5
5
|
".": {
|
|
6
6
|
"types": "./dist/index.d.mts",
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
}
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@effect-agent/session": "0.1.0-beta.
|
|
12
|
-
"@effect/platform-browser": "4.0.0-rc.
|
|
13
|
-
"@effect/sql-sqlite-do": "4.0.0-rc.
|
|
14
|
-
"effect": "4.0.0-rc.
|
|
11
|
+
"@effect-agent/session": "0.1.0-beta.34",
|
|
12
|
+
"@effect/platform-browser": "4.0.0-rc.111",
|
|
13
|
+
"@effect/sql-sqlite-do": "4.0.0-rc.111",
|
|
14
|
+
"effect": "4.0.0-rc.111"
|
|
15
15
|
},
|
|
16
16
|
"description": "Durable Object SQLite storage adapters and the routed port protocol for Effect Agent on Cloudflare.",
|
|
17
17
|
"license": "MIT",
|
|
@@ -30,14 +30,13 @@
|
|
|
30
30
|
},
|
|
31
31
|
"scripts": {
|
|
32
32
|
"build": "vp pack",
|
|
33
|
-
"check": "tsc --noEmit -p tsconfig.json"
|
|
34
|
-
"test": "vitest run"
|
|
33
|
+
"check": "tsc --noEmit -p tsconfig.json"
|
|
35
34
|
},
|
|
36
35
|
"devDependencies": {
|
|
37
36
|
"@cloudflare/vitest-pool-workers": "0.21.3",
|
|
38
|
-
"@cloudflare/workers-types": "5.
|
|
39
|
-
"@effect-agent/testing": "0.1.0-beta.
|
|
40
|
-
"@effect/vitest": "4.0.0-rc.
|
|
37
|
+
"@cloudflare/workers-types": "5.20260825.1",
|
|
38
|
+
"@effect-agent/testing": "0.1.0-beta.33",
|
|
39
|
+
"@effect/vitest": "4.0.0-rc.111",
|
|
41
40
|
"typescript": "7.0.2",
|
|
42
41
|
"vite-plus": "0.2.6",
|
|
43
42
|
"vitest": "4.1.10"
|
|
@@ -120,7 +120,7 @@ const schemaStoreError = (operation: string, error: { readonly message: string }
|
|
|
120
120
|
message: error.message,
|
|
121
121
|
});
|
|
122
122
|
|
|
123
|
-
const makeOffset = Effect.fn(
|
|
123
|
+
const makeOffset = Effect.fn(function* (
|
|
124
124
|
conversationId: ConversationMaterialization["conversationId"],
|
|
125
125
|
sequence: number,
|
|
126
126
|
): Effect.fn.Return<ObservationOffset, ConversationStoreError> {
|
|
@@ -134,7 +134,7 @@ const makeOffset = Effect.fn("DoConversationStore.makeOffset")(function* (
|
|
|
134
134
|
);
|
|
135
135
|
});
|
|
136
136
|
|
|
137
|
-
const parseOffset = Effect.fn(
|
|
137
|
+
const parseOffset = Effect.fn(function* (
|
|
138
138
|
conversationId: ConversationMaterialization["conversationId"],
|
|
139
139
|
offset: ObservationOffset | undefined,
|
|
140
140
|
): Effect.fn.Return<CanonicalSequence, ConversationStoreError> {
|
|
@@ -172,7 +172,7 @@ const mapFence = (
|
|
|
172
172
|
attemptedEpoch: error.producerEpoch,
|
|
173
173
|
});
|
|
174
174
|
|
|
175
|
-
const encodeCanonicalRecord = Effect.fn(
|
|
175
|
+
const encodeCanonicalRecord = Effect.fn(function* (
|
|
176
176
|
record: CanonicalRecord,
|
|
177
177
|
): Effect.fn.Return<string, ConversationStoreError> {
|
|
178
178
|
return yield* Schema.encodeEffect(Schema.fromJsonString(CanonicalRecord))(record).pipe(
|
|
@@ -180,7 +180,7 @@ const encodeCanonicalRecord = Effect.fn("DoConversationStore.encodeCanonicalReco
|
|
|
180
180
|
);
|
|
181
181
|
});
|
|
182
182
|
|
|
183
|
-
const encodeCanonicalBatch = Effect.fn(
|
|
183
|
+
const encodeCanonicalBatch = Effect.fn(function* (
|
|
184
184
|
batch: CanonicalBatch,
|
|
185
185
|
): Effect.fn.Return<string, ConversationStoreError> {
|
|
186
186
|
return yield* Schema.encodeEffect(Schema.fromJsonString(CanonicalBatch))(batch).pipe(
|
|
@@ -188,7 +188,7 @@ const encodeCanonicalBatch = Effect.fn("DoConversationStore.encodeCanonicalBatch
|
|
|
188
188
|
);
|
|
189
189
|
});
|
|
190
190
|
|
|
191
|
-
const encodeCheckpoint = Effect.fn(
|
|
191
|
+
const encodeCheckpoint = Effect.fn(function* (
|
|
192
192
|
checkpoint: ConversationCheckpoint,
|
|
193
193
|
): Effect.fn.Return<string, ConversationStoreError> {
|
|
194
194
|
return yield* Schema.encodeEffect(Schema.fromJsonString(ConversationCheckpoint))(checkpoint).pipe(
|
|
@@ -196,7 +196,7 @@ const encodeCheckpoint = Effect.fn("DoConversationStore.encodeCheckpoint")(funct
|
|
|
196
196
|
);
|
|
197
197
|
});
|
|
198
198
|
|
|
199
|
-
const decodeEnvelope = Effect.fn(
|
|
199
|
+
const decodeEnvelope = Effect.fn(function* (row: {
|
|
200
200
|
readonly batch_id: string;
|
|
201
201
|
readonly conversation_id: string;
|
|
202
202
|
readonly record_json: string;
|
|
@@ -230,7 +230,7 @@ const decodeEnvelope = Effect.fn("DoConversationStore.decodeEnvelope")(function*
|
|
|
230
230
|
});
|
|
231
231
|
});
|
|
232
232
|
|
|
233
|
-
const decodeCheckpoint = Effect.fn(
|
|
233
|
+
const decodeCheckpoint = Effect.fn(function* (
|
|
234
234
|
checkpointJson: string,
|
|
235
235
|
): Effect.fn.Return<ConversationCheckpoint, ConversationStoreError> {
|
|
236
236
|
return yield* Schema.decodeEffect(Schema.fromJsonString(ConversationCheckpoint))(
|
|
@@ -489,7 +489,7 @@ const makeServices = Effect.fn("DoConversationStore.makeServices")(function* ()
|
|
|
489
489
|
|
|
490
490
|
const provideCrypto = <A, E>(effect: Effect.Effect<A, E, Crypto.Crypto>) =>
|
|
491
491
|
Effect.provideService(effect, Crypto.Crypto, crypto);
|
|
492
|
-
const hitFailpoint = Effect.fn(
|
|
492
|
+
const hitFailpoint = Effect.fn(
|
|
493
493
|
(location: DoStorageFailpointLocation): Effect.Effect<void, ConversationStoreError> =>
|
|
494
494
|
failpoint
|
|
495
495
|
.hit(location)
|
package/src/do-journal.ts
CHANGED
|
@@ -168,7 +168,7 @@ const storageError =
|
|
|
168
168
|
});
|
|
169
169
|
|
|
170
170
|
/** Decode raw Durable Object SQLite rows against a Schema, reporting failures as typed corruption. */
|
|
171
|
-
export const decodeRows = Effect.fn(
|
|
171
|
+
export const decodeRows = Effect.fn(
|
|
172
172
|
<A, I>(
|
|
173
173
|
schema: Schema.Codec<ReadonlyArray<A>, ReadonlyArray<I>>,
|
|
174
174
|
table: string,
|
|
@@ -187,7 +187,7 @@ export const decodeRows = Effect.fn("DoJournal.decodeRows")(
|
|
|
187
187
|
);
|
|
188
188
|
|
|
189
189
|
/** Decode exactly one raw row against a Schema, reporting failures as typed corruption. */
|
|
190
|
-
export const decodeSingleRow = Effect.fn(
|
|
190
|
+
export const decodeSingleRow = Effect.fn(
|
|
191
191
|
<A, I>(
|
|
192
192
|
schema: Schema.Codec<ReadonlyArray<A>, ReadonlyArray<I>>,
|
|
193
193
|
table: string,
|