@spine-event-engine/storage 2.0.0-snapshot.23 → 2.0.0-snapshot.25
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/README.md +12 -3
- package/REFERENCE.md +90 -63
- package/dist/entity/agent-history-record-spec.d.ts +8 -0
- package/dist/entity/agent-history-record-spec.d.ts.map +1 -1
- package/dist/entity/agent-history-record-spec.js +12 -1
- package/dist/entity/agent-history-record-spec.js.map +1 -1
- package/dist/entity/agent-history.d.ts +25 -0
- package/dist/entity/agent-history.d.ts.map +1 -1
- package/dist/entity/agent-history.js.map +1 -1
- package/dist/entity/history-conformance.d.ts +38 -8
- package/dist/entity/history-conformance.d.ts.map +1 -1
- package/dist/entity/history-conformance.js +103 -58
- package/dist/entity/history-conformance.js.map +1 -1
- package/dist/event/event-store.d.ts +80 -74
- package/dist/event/event-store.d.ts.map +1 -1
- package/dist/event/event-store.js +264 -264
- package/dist/event/event-store.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/internal/agent-model-preferences.d.ts +76 -0
- package/dist/internal/agent-model-preferences.d.ts.map +1 -0
- package/dist/internal/agent-model-preferences.js +133 -0
- package/dist/internal/agent-model-preferences.js.map +1 -0
- package/dist/internal/entity-commit.d.ts +92 -17
- package/dist/internal/entity-commit.d.ts.map +1 -1
- package/dist/internal/entity-commit.js +45 -2
- package/dist/internal/entity-commit.js.map +1 -1
- package/dist/internal/entity-history.d.ts +1 -7
- package/dist/internal/entity-history.d.ts.map +1 -1
- package/dist/internal/entity-history.js +0 -5
- package/dist/internal/entity-history.js.map +1 -1
- package/dist/internal/event-store.d.ts +1 -1
- package/dist/internal/event-store.d.ts.map +1 -1
- package/dist/internal/event-store.js +1 -1
- package/dist/internal/event-store.js.map +1 -1
- package/dist/internal/storage-preparation.d.ts +88 -0
- package/dist/internal/storage-preparation.d.ts.map +1 -0
- package/dist/internal/storage-preparation.js +41 -0
- package/dist/internal/storage-preparation.js.map +1 -0
- package/dist/internal/tenancy.d.ts +7 -0
- package/dist/internal/tenancy.d.ts.map +1 -1
- package/dist/memory/in-memory-agent-history.d.ts.map +1 -1
- package/dist/memory/in-memory-agent-history.js +22 -7
- package/dist/memory/in-memory-agent-history.js.map +1 -1
- package/dist/memory/in-memory-entity-commit.d.ts +237 -42
- package/dist/memory/in-memory-entity-commit.d.ts.map +1 -1
- package/dist/memory/in-memory-entity-commit.js +529 -325
- package/dist/memory/in-memory-entity-commit.js.map +1 -1
- package/dist/memory/in-memory-entity-history.d.ts.map +1 -1
- package/dist/memory/in-memory-entity-history.js +4 -3
- package/dist/memory/in-memory-entity-history.js.map +1 -1
- package/dist/memory/in-memory-storage-backend.d.ts +33 -1
- package/dist/memory/in-memory-storage-backend.d.ts.map +1 -1
- package/dist/memory/in-memory-storage-backend.js +118 -1
- package/dist/memory/in-memory-storage-backend.js.map +1 -1
- package/dist/memory/in-memory-storage-factory.d.ts +72 -13
- package/dist/memory/in-memory-storage-factory.d.ts.map +1 -1
- package/dist/memory/in-memory-storage-factory.js +199 -30
- package/dist/memory/in-memory-storage-factory.js.map +1 -1
- package/dist/memory/tenant-records.d.ts +1 -1
- package/dist/memory/tenant-records.d.ts.map +1 -1
- package/dist/memory/tenant-records.js +3 -2
- package/dist/memory/tenant-records.js.map +1 -1
- package/dist/provider.d.ts +2 -1
- package/dist/provider.d.ts.map +1 -1
- package/dist/provider.js +2 -1
- package/dist/provider.js.map +1 -1
- package/dist/record/record-query.d.ts +10 -2
- package/dist/record/record-query.d.ts.map +1 -1
- package/dist/record/record-query.js +9 -0
- package/dist/record/record-query.js.map +1 -1
- package/dist/storage/storage-factory.d.ts +27 -4
- package/dist/storage/storage-factory.d.ts.map +1 -1
- package/dist/storage/storage-factory.js +30 -1
- package/dist/storage/storage-factory.js.map +1 -1
- package/dist/storage/storage.d.ts +2 -1
- package/dist/storage/storage.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/dist/entity/agent-execution-record-spec.d.ts +0 -87
- package/dist/entity/agent-execution-record-spec.d.ts.map +0 -1
- package/dist/entity/agent-execution-record-spec.js +0 -230
- package/dist/entity/agent-execution-record-spec.js.map +0 -1
- package/dist/entity/agent-execution-sizes.d.ts +0 -30
- package/dist/entity/agent-execution-sizes.d.ts.map +0 -1
- package/dist/entity/agent-execution-sizes.js +0 -51
- package/dist/entity/agent-execution-sizes.js.map +0 -1
- package/dist/entity/agent-execution-transitions.d.ts +0 -71
- package/dist/entity/agent-execution-transitions.d.ts.map +0 -1
- package/dist/entity/agent-execution-transitions.js +0 -182
- package/dist/entity/agent-execution-transitions.js.map +0 -1
- package/dist/entity/agent-execution-values.d.ts +0 -142
- package/dist/entity/agent-execution-values.d.ts.map +0 -1
- package/dist/entity/agent-execution-values.js +0 -250
- package/dist/entity/agent-execution-values.js.map +0 -1
- package/dist/entity/agent-execution.d.ts +0 -234
- package/dist/entity/agent-execution.d.ts.map +0 -1
- package/dist/entity/agent-execution.js +0 -15
- package/dist/entity/agent-execution.js.map +0 -1
- package/dist/internal/agent-execution.d.ts +0 -51
- package/dist/internal/agent-execution.d.ts.map +0 -1
- package/dist/internal/agent-execution.js +0 -53
- package/dist/internal/agent-execution.js.map +0 -1
- package/dist/internal/delivery-cleanup.d.ts +0 -99
- package/dist/internal/delivery-cleanup.d.ts.map +0 -1
- package/dist/internal/delivery-cleanup.js +0 -38
- package/dist/internal/delivery-cleanup.js.map +0 -1
- package/dist/memory/agent-execution-head-index.d.ts +0 -52
- package/dist/memory/agent-execution-head-index.d.ts.map +0 -1
- package/dist/memory/agent-execution-head-index.js +0 -91
- package/dist/memory/agent-execution-head-index.js.map +0 -1
- package/dist/memory/in-memory-agent-execution.d.ts +0 -21
- package/dist/memory/in-memory-agent-execution.d.ts.map +0 -1
- package/dist/memory/in-memory-agent-execution.js +0 -587
- package/dist/memory/in-memory-agent-execution.js.map +0 -1
- package/dist/memory/memory-delivery-cleanup.d.ts +0 -32
- package/dist/memory/memory-delivery-cleanup.d.ts.map +0 -1
- package/dist/memory/memory-delivery-cleanup.js +0 -61
- package/dist/memory/memory-delivery-cleanup.js.map +0 -1
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { Message } from "@bufbuild/protobuf";
|
|
2
|
-
import { type DeliveryCleanupInput, type DeliveryCleanupStorage } from "../internal/delivery-cleanup.js";
|
|
3
|
-
import type { RecordSpec } from "../record/record-spec.js";
|
|
4
|
-
import type { StorageContext } from "../storage/storage.js";
|
|
5
|
-
import type { StorageGroup } from "../record/storage-group.js";
|
|
6
|
-
import { TenantRecords } from "./tenant-records.js";
|
|
7
|
-
/**
|
|
8
|
-
* Provides an in-memory critical section for fenced delivery cleanup.
|
|
9
|
-
*/
|
|
10
|
-
export declare class MemoryDeliveryCleanupStorage implements DeliveryCleanupStorage {
|
|
11
|
-
#private;
|
|
12
|
-
private readonly records;
|
|
13
|
-
/**
|
|
14
|
-
* Creates an in-memory cleanup handle.
|
|
15
|
-
*
|
|
16
|
-
* @param records Resolves a tenant-scoped record family.
|
|
17
|
-
*/
|
|
18
|
-
constructor(records: <I, R extends Message>(context: StorageContext, spec: RecordSpec<I, R>, group?: StorageGroup) => TenantRecords<I, R>);
|
|
19
|
-
/**
|
|
20
|
-
* Removes an exact Inbox record while its session record remains current.
|
|
21
|
-
*
|
|
22
|
-
* @param input Describes the records and ownership predicate for deletion.
|
|
23
|
-
* @returns Whether the exact Inbox record was removed.
|
|
24
|
-
*/
|
|
25
|
-
remove<InboxId, InboxRecord extends Message, SessionId, SessionRecord extends Message>(input: DeliveryCleanupInput<InboxId, InboxRecord, SessionId, SessionRecord>): Promise<boolean>;
|
|
26
|
-
/**
|
|
27
|
-
* Closes this cleanup handle to further removal operations.
|
|
28
|
-
*/
|
|
29
|
-
close(): void;
|
|
30
|
-
private static active;
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=memory-delivery-cleanup.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"memory-delivery-cleanup.d.ts","sourceRoot":"","sources":["../../src/memory/memory-delivery-cleanup.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAGL,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC5B,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD;;GAEG;AACH,qBAAa,4BAA6B,YAAW,sBAAsB;;IASvE,OAAO,CAAC,QAAQ,CAAC,OAAO;IAN1B;;;;OAIG;gBAEgB,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,SAAS,OAAO,EAC7C,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,EACtB,KAAK,CAAC,EAAE,YAAY,KACjB,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC;IAG1B;;;;;OAKG;IACH,MAAM,CAAC,OAAO,EAAE,WAAW,SAAS,OAAO,EAAE,SAAS,EAAE,aAAa,SAAS,OAAO,EACnF,KAAK,EAAE,oBAAoB,CAAC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,CAAC,GAC1E,OAAO,CAAC,OAAO,CAAC;IAmBnB;;OAEG;IACH,KAAK,IAAI,IAAI;IAGb,OAAO,CAAC,MAAM,CAAC,MAAM;CAGtB"}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2026, CodeMatters. All rights reserved.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
|
|
5
|
-
* in compliance with the License. You may obtain a copy of the License at
|
|
6
|
-
*
|
|
7
|
-
* https://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
*
|
|
9
|
-
* Unless required by applicable law or agreed to in writing, software distributed under the License
|
|
10
|
-
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
|
11
|
-
* or implied. See the License for the specific language governing permissions and limitations under
|
|
12
|
-
* the License.
|
|
13
|
-
*/
|
|
14
|
-
import { cleanupOperationActive, } from "../internal/delivery-cleanup.js";
|
|
15
|
-
import { TenantRecords } from "./tenant-records.js";
|
|
16
|
-
/**
|
|
17
|
-
* Provides an in-memory critical section for fenced delivery cleanup.
|
|
18
|
-
*/
|
|
19
|
-
export class MemoryDeliveryCleanupStorage {
|
|
20
|
-
records;
|
|
21
|
-
#open = true;
|
|
22
|
-
/**
|
|
23
|
-
* Creates an in-memory cleanup handle.
|
|
24
|
-
*
|
|
25
|
-
* @param records Resolves a tenant-scoped record family.
|
|
26
|
-
*/
|
|
27
|
-
constructor(records) {
|
|
28
|
-
this.records = records;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Removes an exact Inbox record while its session record remains current.
|
|
32
|
-
*
|
|
33
|
-
* @param input Describes the records and ownership predicate for deletion.
|
|
34
|
-
* @returns Whether the exact Inbox record was removed.
|
|
35
|
-
*/
|
|
36
|
-
remove(input) {
|
|
37
|
-
if (!this.#open)
|
|
38
|
-
return Promise.reject(new Error("Delivery cleanup storage is closed."));
|
|
39
|
-
if (!MemoryDeliveryCleanupStorage.active(input))
|
|
40
|
-
return Promise.resolve(false);
|
|
41
|
-
const sessions = this.records(input.context, input.session.spec);
|
|
42
|
-
const current = sessions.read(input.session.id);
|
|
43
|
-
if (current === undefined || !input.session.isCurrent(current))
|
|
44
|
-
return Promise.resolve(false);
|
|
45
|
-
const expectedSession = input.session.spec.materialize(input.session.expected);
|
|
46
|
-
if (!sessions.compareAndSet(input.session.id, expectedSession, expectedSession))
|
|
47
|
-
return Promise.resolve(false);
|
|
48
|
-
const inbox = this.records(input.context, input.inbox.spec);
|
|
49
|
-
return Promise.resolve(inbox.compareAndSet(input.inbox.id, input.inbox.spec.materialize(input.inbox.expected), undefined));
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Closes this cleanup handle to further removal operations.
|
|
53
|
-
*/
|
|
54
|
-
close() {
|
|
55
|
-
this.#open = false;
|
|
56
|
-
}
|
|
57
|
-
static active(input) {
|
|
58
|
-
return cleanupOperationActive(input.operation);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
//# sourceMappingURL=memory-delivery-cleanup.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"memory-delivery-cleanup.js","sourceRoot":"","sources":["../../src/memory/memory-delivery-cleanup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EACL,sBAAsB,GAIvB,MAAM,iCAAiC,CAAC;AAIzC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD;;GAEG;AACH,MAAM,OAAO,4BAA4B;IASpB;IARnB,KAAK,GAAG,IAAI,CAAC;IAEb;;;;OAIG;IACH,YACmB,OAIO;QAJP,YAAO,GAAP,OAAO,CAIA;IACvB,CAAC;IAEJ;;;;;OAKG;IACH,MAAM,CACJ,KAA2E;QAE3E,IAAI,CAAC,IAAI,CAAC,KAAK;YAAE,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC,CAAC;QACzF,IAAI,CAAC,4BAA4B,CAAC,MAAM,CAAC,KAAK,CAAC;YAAE,OAAO,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAC/E,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC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