@yielded/agent-storage-memory 0.1.0-beta.190 → 0.1.0-beta.191
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/MemorySubmissionLedger.d.mts +4 -4
- package/dist/MemorySubmissionLedger.mjs +4 -4
- package/dist/MemorySubmissionLedger.mjs.map +1 -1
- package/dist/MemoryThreadStore.d.mts +3 -3
- package/dist/MemoryThreadStore.mjs +10 -10
- package/dist/MemoryThreadStore.mjs.map +1 -1
- package/package.json +1 -1
- package/src/MemorySubmissionLedger.ts +6 -6
- package/src/MemoryThreadStore.ts +10 -10
|
@@ -3,7 +3,7 @@ import * as Effect from "effect/Effect";
|
|
|
3
3
|
import * as Layer from "effect/Layer";
|
|
4
4
|
import { SettlementPublisher } from "@yielded/agent/settlement-publisher";
|
|
5
5
|
import { SubmissionLedger } from "@yielded/agent/submission-ledger";
|
|
6
|
-
import * as
|
|
6
|
+
import * as SecureRandom from "effect/crypto/SecureRandom";
|
|
7
7
|
import * as Option from "effect/Option";
|
|
8
8
|
declare namespace MemorySubmissionLedger_d_exports {
|
|
9
9
|
export { MemorySubmissionLedgerLive, MemorySubmissionLedgerOptions, memorySubmissionLedgerLayer };
|
|
@@ -20,11 +20,11 @@ export interface MemorySubmissionLedgerOptions {
|
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* In-memory reference SubmissionLedger Layer (durability `non-durable`). All state lives in one
|
|
23
|
-
* `Ref` owned by the Layer's Scope. Fresh identities use the supplied `
|
|
23
|
+
* `Ref` owned by the Layer's Scope. Fresh identities use the supplied `SecureRandom` service;
|
|
24
24
|
* imported identities remain unchanged. No daemon fibers are spawned and no wall clock is consulted.
|
|
25
25
|
*/
|
|
26
|
-
export declare const memorySubmissionLedgerLayer: (options?: MemorySubmissionLedgerOptions) => Layer.Layer<SubmissionLedger | SettlementPublisher, never, MemoryThreadStoreKernel |
|
|
27
|
-
export declare const MemorySubmissionLedgerLive: Layer.Layer<SubmissionLedger | SettlementPublisher, never, MemoryThreadStoreKernel |
|
|
26
|
+
export declare const memorySubmissionLedgerLayer: (options?: MemorySubmissionLedgerOptions) => Layer.Layer<SubmissionLedger | SettlementPublisher, never, MemoryThreadStoreKernel | SecureRandom.SecureRandom>;
|
|
27
|
+
export declare const MemorySubmissionLedgerLive: Layer.Layer<SubmissionLedger | SettlementPublisher, never, MemoryThreadStoreKernel | SecureRandom.SecureRandom>;
|
|
28
28
|
//#endregion
|
|
29
29
|
export { MemorySubmissionLedger_d_exports as t };
|
|
30
30
|
//# sourceMappingURL=MemorySubmissionLedger.d.mts.map
|
|
@@ -19,7 +19,7 @@ import { InputMessage } from "@yielded/agent/messaging";
|
|
|
19
19
|
import { MAX_RUN_EVIDENCE_BYTES, MAX_RUN_EVIDENCE_RECORDS, PersistedJson, WorkerAdmission } from "@yielded/agent/records";
|
|
20
20
|
import { runIdForSubmission } from "@yielded/agent/run-journal";
|
|
21
21
|
import * as Cause from "effect/Cause";
|
|
22
|
-
import * as
|
|
22
|
+
import * as SecureRandom from "effect/crypto/SecureRandom";
|
|
23
23
|
import * as DateTime from "effect/DateTime";
|
|
24
24
|
import * as Exit from "effect/Exit";
|
|
25
25
|
import * as Fiber from "effect/Fiber";
|
|
@@ -300,8 +300,8 @@ const makeSubmissionLedger = Effect.fnUntraced(
|
|
|
300
300
|
*/
|
|
301
301
|
function* (options = {}) {
|
|
302
302
|
const journal = yield* MemoryThreadStoreKernel;
|
|
303
|
-
const crypto = yield*
|
|
304
|
-
const mintIdentity = (operation) => crypto.
|
|
303
|
+
const crypto = yield* SecureRandom.SecureRandom;
|
|
304
|
+
const mintIdentity = (operation) => crypto.uuidV4().pipe(Effect.flatMap(Schema.decodeEffect(MemoryIdentityNonce)), Effect.mapError((cause) => ledgerError(operation, "Cannot mint a Memory identity", cause)));
|
|
305
305
|
const state = yield* Ref.make({
|
|
306
306
|
byThread: /* @__PURE__ */ new Map(),
|
|
307
307
|
receipts: /* @__PURE__ */ new Map(),
|
|
@@ -1556,7 +1556,7 @@ const makeSubmissionLedger = Effect.fnUntraced(
|
|
|
1556
1556
|
);
|
|
1557
1557
|
/**
|
|
1558
1558
|
* In-memory reference SubmissionLedger Layer (durability `non-durable`). All state lives in one
|
|
1559
|
-
* `Ref` owned by the Layer's Scope. Fresh identities use the supplied `
|
|
1559
|
+
* `Ref` owned by the Layer's Scope. Fresh identities use the supplied `SecureRandom` service;
|
|
1560
1560
|
* imported identities remain unchanged. No daemon fibers are spawned and no wall clock is consulted.
|
|
1561
1561
|
*/
|
|
1562
1562
|
const memorySubmissionLedgerLayer = (options = {}) => Layer.effectContext(makeSubmissionLedger(options));
|