@effect-agent/storage-memory 0.1.0-beta.45 → 0.1.0-beta.47
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/MemoryScheduleStore.d.mts +10 -0
- package/dist/MemoryScheduleStore.mjs +169 -0
- package/dist/MemoryScheduleStore.mjs.map +1 -0
- package/dist/MemorySemanticIndex.d.mts +21 -0
- package/dist/MemorySemanticIndex.mjs +222 -0
- package/dist/MemorySemanticIndex.mjs.map +1 -0
- package/dist/MemorySubmissionLedger.d.mts +24 -0
- package/dist/MemorySubmissionLedger.mjs +1003 -0
- package/dist/MemorySubmissionLedger.mjs.map +1 -0
- package/dist/MemorySubscriptionStore.d.mts +9 -0
- package/dist/MemorySubscriptionStore.mjs +600 -0
- package/dist/MemorySubscriptionStore.mjs.map +1 -0
- package/dist/MemoryThreadStore.d.mts +13 -0
- package/dist/MemoryThreadStore.mjs +311 -0
- package/dist/MemoryThreadStore.mjs.map +1 -0
- package/dist/index.d.mts +6 -53
- package/dist/index.mjs +6 -2258
- package/dist/rolldown-runtime-D7D4PA-g.mjs +13 -0
- package/package.json +1 -1
- package/src/{memory-schedule-store.ts → MemoryScheduleStore.ts} +4 -2
- package/src/{semantic-memory-index.ts → MemorySemanticIndex.ts} +2 -2
- package/src/{memory-ledger.ts → MemorySubmissionLedger.ts} +12 -10
- package/src/{memory-subscription-store.ts → MemorySubscriptionStore.ts} +8 -6
- package/src/{memory-storage.ts → MemoryThreadStore.ts} +12 -13
- package/src/index.ts +5 -5
- package/dist/index.mjs.map +0 -1
- package/dist/testing.d.mts +0 -2
- package/dist/testing.mjs +0 -2
- package/src/testing.ts +0 -18
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __exportAll = (all, no_symbols) => {
|
|
4
|
+
let target = {};
|
|
5
|
+
for (var name in all) __defProp(target, name, {
|
|
6
|
+
get: all[name],
|
|
7
|
+
enumerable: true
|
|
8
|
+
});
|
|
9
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
10
|
+
return target;
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { __exportAll as t };
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@effect-agent/storage-memory","version":"0.1.0-beta.
|
|
1
|
+
{"name":"@effect-agent/storage-memory","version":"0.1.0-beta.47","dependencies":{"@effect-agent/core":"0.1.0-beta.47","@effect-agent/thread":"0.1.0-beta.47"},"devDependencies":{"@effect-agent/engine":"0.1.0-beta.47","@effect/platform-node":"4.0.0-rc.112","@effect/vitest":"4.0.0-rc.112","effect":"4.0.0-rc.112","typescript":"7.0.2","vite-plus":"0.3.0"},"peerDependencies":{"effect":"^4.0.0-rc.112"},"exports":{".":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"./MemoryScheduleStore":{"types":"./dist/MemoryScheduleStore.d.mts","default":"./dist/MemoryScheduleStore.mjs"},"./MemorySemanticIndex":{"types":"./dist/MemorySemanticIndex.d.mts","default":"./dist/MemorySemanticIndex.mjs"},"./MemorySubmissionLedger":{"types":"./dist/MemorySubmissionLedger.d.mts","default":"./dist/MemorySubmissionLedger.mjs"},"./MemorySubscriptionStore":{"types":"./dist/MemorySubscriptionStore.d.mts","default":"./dist/MemorySubscriptionStore.mjs"},"./MemoryThreadStore":{"types":"./dist/MemoryThreadStore.d.mts","default":"./dist/MemoryThreadStore.mjs"}},"description":"In-memory Thread store and submission ledger reference adapters for Effect Agent tests and conformance suites.","license":"MIT","repository":{"type":"git","url":"git+https://github.com/danieljvdm/effect-agent.git","directory":"packages/storage-memory"},"files":["dist","src"],"type":"module","sideEffects":[],"publishConfig":{"access":"public"},"scripts":{"build":"vp pack","check":"tsc --noEmit -p tsconfig.json","test":"vp test --passWithNoTests"}}
|
|
@@ -2,7 +2,6 @@ import {
|
|
|
2
2
|
ScheduleCapacityError,
|
|
3
3
|
ScheduleDueCursor,
|
|
4
4
|
defaultSchedulingLimits,
|
|
5
|
-
scheduleUsesCapacity,
|
|
6
5
|
ScheduleChange,
|
|
7
6
|
ScheduleConflict,
|
|
8
7
|
ScheduleFailpoint,
|
|
@@ -13,6 +12,9 @@ import {
|
|
|
13
12
|
ScheduleRecord,
|
|
14
13
|
ScheduleStorageError,
|
|
15
14
|
ScheduleStore,
|
|
15
|
+
} from "@effect-agent/thread/Schedule";
|
|
16
|
+
import {
|
|
17
|
+
scheduleUsesCapacity,
|
|
16
18
|
applyScheduleChange,
|
|
17
19
|
compareScheduleKeys,
|
|
18
20
|
compareScheduleNames,
|
|
@@ -20,7 +22,7 @@ import {
|
|
|
20
22
|
scheduleKeyString,
|
|
21
23
|
scheduleKeyOf,
|
|
22
24
|
scheduleOwnerKey,
|
|
23
|
-
} from "@effect-agent/thread";
|
|
25
|
+
} from "@effect-agent/thread/ScheduleTransition";
|
|
24
26
|
import { Effect, Layer, Ref, Result, Schema } from "effect";
|
|
25
27
|
|
|
26
28
|
interface MemoryScheduleState {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MemoryKey } from "@effect-agent/core/MemoryStore";
|
|
1
2
|
import {
|
|
2
3
|
MemoryIndexCandidate,
|
|
3
4
|
MemoryIndexError,
|
|
@@ -5,11 +6,10 @@ import {
|
|
|
5
6
|
MemoryIndexReplacement,
|
|
6
7
|
MemoryIndexSearch,
|
|
7
8
|
MemoryIndexSource,
|
|
8
|
-
MemoryKey,
|
|
9
9
|
SemanticMemoryChunk,
|
|
10
10
|
SemanticMemoryIndex,
|
|
11
11
|
SemanticMemoryProfile,
|
|
12
|
-
} from "@effect-agent/core";
|
|
12
|
+
} from "@effect-agent/core/SemanticMemoryIndex";
|
|
13
13
|
import { Clock, Effect, Encoding, Layer, Ref, Schema } from "effect";
|
|
14
14
|
|
|
15
15
|
const PositiveCapacity = Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 65_536 }));
|
|
@@ -6,7 +6,17 @@ import {
|
|
|
6
6
|
type AgentId,
|
|
7
7
|
type ThreadId,
|
|
8
8
|
type SettlementId,
|
|
9
|
-
} from "@effect-agent/core";
|
|
9
|
+
} from "@effect-agent/core/Identifiers";
|
|
10
|
+
import {
|
|
11
|
+
PersistedJson,
|
|
12
|
+
ProducerEpoch,
|
|
13
|
+
type DefinitionDigests,
|
|
14
|
+
type DeploymentId,
|
|
15
|
+
type Digest,
|
|
16
|
+
type ProducerId,
|
|
17
|
+
type RecordEnvelope,
|
|
18
|
+
type SettlementOutcome,
|
|
19
|
+
} from "@effect-agent/thread/Records";
|
|
10
20
|
import {
|
|
11
21
|
type ParentLinkage,
|
|
12
22
|
AbortCommand,
|
|
@@ -44,8 +54,6 @@ import {
|
|
|
44
54
|
OwnershipRenewal,
|
|
45
55
|
OwnershipSnapshot,
|
|
46
56
|
OwnershipToken,
|
|
47
|
-
PersistedJson,
|
|
48
|
-
ProducerEpoch,
|
|
49
57
|
QueueSequence,
|
|
50
58
|
RecoverySnapshot,
|
|
51
59
|
RecoverySnapshotRequest,
|
|
@@ -75,18 +83,12 @@ import {
|
|
|
75
83
|
type ChildReservationId,
|
|
76
84
|
type ChildReservationStatus,
|
|
77
85
|
type ChildSettledOutcome,
|
|
78
|
-
type DefinitionDigests,
|
|
79
|
-
type DeploymentId,
|
|
80
|
-
type Digest,
|
|
81
86
|
type IdempotencyKey,
|
|
82
87
|
type Principal,
|
|
83
|
-
type ProducerId,
|
|
84
|
-
type RecordEnvelope,
|
|
85
|
-
type SettlementOutcome,
|
|
86
88
|
type SubmissionState,
|
|
87
89
|
type SuspensionOutcome,
|
|
88
90
|
type SuspensionReason,
|
|
89
|
-
} from "@effect-agent/thread";
|
|
91
|
+
} from "@effect-agent/thread/SubmissionLedger";
|
|
90
92
|
import { Clock, DateTime, Duration, Effect, Layer, Option, Ref, Schema, Stream } from "effect";
|
|
91
93
|
|
|
92
94
|
const MAX_SUBMISSIONS = 65_536;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
+
import { Digest } from "@effect-agent/thread/Records";
|
|
2
|
+
import { compareScheduleNames } from "@effect-agent/thread/ScheduleTransition";
|
|
1
3
|
import {
|
|
2
4
|
AcceptedEvent,
|
|
3
|
-
applySubscriptionDeliveryChange,
|
|
4
|
-
compareScheduleNames,
|
|
5
5
|
DeliveryChange,
|
|
6
|
-
Digest,
|
|
7
6
|
SourcePartition,
|
|
8
7
|
SubscriptionDelivery,
|
|
9
8
|
SubscriptionDeliveryKey,
|
|
@@ -15,11 +14,14 @@ import {
|
|
|
15
14
|
SubscriptionRecord,
|
|
16
15
|
SubscriptionScanCursors,
|
|
17
16
|
SubscriptionStore,
|
|
18
|
-
subscriptionCanSelect,
|
|
19
|
-
subscriptionDeliveryCanSelect,
|
|
20
17
|
subscriptionDeliveryKeyString,
|
|
21
18
|
subscriptionKeyString,
|
|
22
|
-
} from "@effect-agent/thread";
|
|
19
|
+
} from "@effect-agent/thread/Subscription";
|
|
20
|
+
import {
|
|
21
|
+
applySubscriptionDeliveryChange,
|
|
22
|
+
subscriptionCanSelect,
|
|
23
|
+
subscriptionDeliveryCanSelect,
|
|
24
|
+
} from "@effect-agent/thread/SubscriptionTransition";
|
|
23
25
|
import { Clock, Effect, Layer, Ref, Result, Schema } from "effect";
|
|
24
26
|
|
|
25
27
|
interface MemorySubscriptionState {
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
import { ThreadId } from "@effect-agent/core";
|
|
1
|
+
import { ThreadId } from "@effect-agent/core/Identifiers";
|
|
2
|
+
import { digestCanonicalBatch, EMPTY_TAIL_DIGEST } from "@effect-agent/thread/Digest";
|
|
2
3
|
import {
|
|
3
|
-
type ThreadCheckpoint,
|
|
4
4
|
type ProducerEpoch,
|
|
5
5
|
type RecordId,
|
|
6
|
-
AppendConflict,
|
|
7
|
-
AppendResult,
|
|
8
6
|
CanonicalRecordEnvelope,
|
|
9
7
|
CanonicalSequence,
|
|
8
|
+
ObservationOffset,
|
|
9
|
+
type BatchId,
|
|
10
|
+
type Digest,
|
|
11
|
+
} from "@effect-agent/thread/Records";
|
|
12
|
+
import {
|
|
13
|
+
type ThreadCheckpoint,
|
|
14
|
+
AppendConflict,
|
|
15
|
+
AppendResult,
|
|
10
16
|
CheckpointRejected,
|
|
11
17
|
ThreadExportRequest,
|
|
12
18
|
ThreadExport,
|
|
@@ -19,16 +25,11 @@ import {
|
|
|
19
25
|
ThreadStoreError,
|
|
20
26
|
ThreadTail,
|
|
21
27
|
ThreadTailRequest,
|
|
22
|
-
digestCanonicalBatch,
|
|
23
|
-
EMPTY_TAIL_DIGEST,
|
|
24
28
|
FenceRejected,
|
|
25
29
|
FencedAppendRequest,
|
|
26
30
|
LoadCheckpointRequest,
|
|
27
|
-
ObservationOffset,
|
|
28
31
|
SaveCheckpointRequest,
|
|
29
|
-
|
|
30
|
-
type Digest,
|
|
31
|
-
} from "@effect-agent/thread";
|
|
32
|
+
} from "@effect-agent/thread/ThreadStore";
|
|
32
33
|
import { Crypto, Effect, Encoding, Layer, Option, PubSub, Ref, Schema, Stream } from "effect";
|
|
33
34
|
|
|
34
35
|
const MAX_THREADS = 256;
|
|
@@ -623,10 +624,8 @@ const makeThreadStore = Effect.gen(function* () {
|
|
|
623
624
|
});
|
|
624
625
|
});
|
|
625
626
|
|
|
626
|
-
export const MemoryThreadStoreLive = Layer.effect(ThreadStore, makeThreadStore);
|
|
627
|
-
|
|
628
627
|
/**
|
|
629
628
|
* In-memory canonical Thread persistence. Durable accepted work is served by the separate
|
|
630
629
|
* SubmissionLedger port; this Layer deliberately provides only the ThreadStore.
|
|
631
630
|
*/
|
|
632
|
-
export const
|
|
631
|
+
export const MemoryThreadStoreLive = Layer.effect(ThreadStore, makeThreadStore);
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from "./
|
|
2
|
-
export * from "./
|
|
3
|
-
export * from "./
|
|
4
|
-
export * from "./
|
|
5
|
-
export * from "./
|
|
1
|
+
export * as MemoryScheduleStore from "./MemoryScheduleStore.ts";
|
|
2
|
+
export * as MemorySemanticIndex from "./MemorySemanticIndex.ts";
|
|
3
|
+
export * as MemorySubmissionLedger from "./MemorySubmissionLedger.ts";
|
|
4
|
+
export * as MemorySubscriptionStore from "./MemorySubscriptionStore.ts";
|
|
5
|
+
export * as MemoryThreadStore from "./MemoryThreadStore.ts";
|