@spine-event-engine/storage 2.0.0-snapshot.21 → 2.0.0-snapshot.23
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 +7 -0
- package/REFERENCE.md +106 -1
- package/dist/entity/agent-execution-record-spec.d.ts +87 -0
- package/dist/entity/agent-execution-record-spec.d.ts.map +1 -0
- package/dist/entity/agent-execution-record-spec.js +230 -0
- package/dist/entity/agent-execution-record-spec.js.map +1 -0
- package/dist/entity/agent-execution-sizes.d.ts +30 -0
- package/dist/entity/agent-execution-sizes.d.ts.map +1 -0
- package/dist/entity/agent-execution-sizes.js +51 -0
- package/dist/entity/agent-execution-sizes.js.map +1 -0
- package/dist/entity/agent-execution-transitions.d.ts +71 -0
- package/dist/entity/agent-execution-transitions.d.ts.map +1 -0
- package/dist/entity/agent-execution-transitions.js +182 -0
- package/dist/entity/agent-execution-transitions.js.map +1 -0
- package/dist/entity/agent-execution-values.d.ts +142 -0
- package/dist/entity/agent-execution-values.d.ts.map +1 -0
- package/dist/entity/agent-execution-values.js +250 -0
- package/dist/entity/agent-execution-values.js.map +1 -0
- package/dist/entity/agent-execution.d.ts +234 -0
- package/dist/entity/agent-execution.d.ts.map +1 -0
- package/dist/entity/agent-execution.js +15 -0
- package/dist/entity/agent-execution.js.map +1 -0
- package/dist/entity/agent-history-conformance.d.ts +78 -0
- package/dist/entity/agent-history-conformance.d.ts.map +1 -0
- package/dist/entity/agent-history-conformance.js +493 -0
- package/dist/entity/agent-history-conformance.js.map +1 -0
- package/dist/entity/agent-history-provider-page.d.ts +39 -0
- package/dist/entity/agent-history-provider-page.d.ts.map +1 -0
- package/dist/entity/agent-history-provider-page.js +82 -0
- package/dist/entity/agent-history-provider-page.js.map +1 -0
- package/dist/entity/agent-history-record-spec.d.ts +79 -0
- package/dist/entity/agent-history-record-spec.d.ts.map +1 -0
- package/dist/entity/agent-history-record-spec.js +147 -0
- package/dist/entity/agent-history-record-spec.js.map +1 -0
- package/dist/entity/agent-history.d.ts +196 -0
- package/dist/entity/agent-history.d.ts.map +1 -0
- package/dist/entity/agent-history.js +136 -0
- package/dist/entity/agent-history.js.map +1 -0
- package/dist/event/event-store.d.ts +52 -4
- package/dist/event/event-store.d.ts.map +1 -1
- package/dist/event/event-store.js +153 -4
- package/dist/event/event-store.js.map +1 -1
- package/dist/internal/agent-execution.d.ts +51 -0
- package/dist/internal/agent-execution.d.ts.map +1 -0
- package/dist/internal/agent-execution.js +53 -0
- package/dist/internal/agent-execution.js.map +1 -0
- package/dist/internal/agent-history.d.ts +48 -0
- package/dist/internal/agent-history.d.ts.map +1 -0
- package/dist/internal/agent-history.js +52 -0
- package/dist/internal/agent-history.js.map +1 -0
- package/dist/internal/entity-history.d.ts +11 -0
- package/dist/internal/entity-history.d.ts.map +1 -1
- package/dist/internal/entity-history.js +10 -0
- package/dist/internal/entity-history.js.map +1 -1
- package/dist/internal/tenancy.d.ts +87 -1
- package/dist/internal/tenancy.d.ts.map +1 -1
- package/dist/internal/tenancy.js +39 -0
- package/dist/internal/tenancy.js.map +1 -1
- package/dist/memory/agent-execution-head-index.d.ts +52 -0
- package/dist/memory/agent-execution-head-index.d.ts.map +1 -0
- package/dist/memory/agent-execution-head-index.js +91 -0
- package/dist/memory/agent-execution-head-index.js.map +1 -0
- package/dist/memory/agent-history-index.d.ts +49 -0
- package/dist/memory/agent-history-index.d.ts.map +1 -0
- package/dist/memory/agent-history-index.js +239 -0
- package/dist/memory/agent-history-index.js.map +1 -0
- package/dist/memory/agent-history-mutation-queue.d.ts +17 -0
- package/dist/memory/agent-history-mutation-queue.d.ts.map +1 -0
- package/dist/memory/agent-history-mutation-queue.js +31 -0
- package/dist/memory/agent-history-mutation-queue.js.map +1 -0
- package/dist/memory/in-memory-agent-execution.d.ts +21 -0
- package/dist/memory/in-memory-agent-execution.d.ts.map +1 -0
- package/dist/memory/in-memory-agent-execution.js +587 -0
- package/dist/memory/in-memory-agent-execution.js.map +1 -0
- package/dist/memory/in-memory-agent-history.d.ts +21 -0
- package/dist/memory/in-memory-agent-history.d.ts.map +1 -0
- package/dist/memory/in-memory-agent-history.js +133 -0
- package/dist/memory/in-memory-agent-history.js.map +1 -0
- package/dist/memory/in-memory-entity-commit.d.ts +17 -0
- package/dist/memory/in-memory-entity-commit.d.ts.map +1 -1
- package/dist/memory/in-memory-entity-commit.js +47 -3
- package/dist/memory/in-memory-entity-commit.js.map +1 -1
- package/dist/memory/in-memory-entity-history.d.ts +1 -1
- package/dist/memory/in-memory-entity-history.d.ts.map +1 -1
- package/dist/memory/in-memory-entity-history.js.map +1 -1
- package/dist/memory/in-memory-storage-backend.d.ts +18 -0
- package/dist/memory/in-memory-storage-backend.d.ts.map +1 -1
- package/dist/memory/in-memory-storage-backend.js +71 -0
- package/dist/memory/in-memory-storage-backend.js.map +1 -1
- package/dist/memory/in-memory-storage-factory.d.ts +37 -2
- package/dist/memory/in-memory-storage-factory.d.ts.map +1 -1
- package/dist/memory/in-memory-storage-factory.js +144 -3
- package/dist/memory/in-memory-storage-factory.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -2
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import type { Message } from "@bufbuild/protobuf";
|
|
2
|
+
import type { Timestamp } from "@bufbuild/protobuf/wkt";
|
|
3
|
+
import type { AgentHistoryEntry, ModelPreference } from "@spine-event-engine/proto/agent";
|
|
4
|
+
import type { AgentAcceptedInvocation, AgentExecutionRecord, AgentExecutionScope, AgentInvocationKey, AgentSignalKey } from "@spine-event-engine/proto/generated/spine/server/agent/execution_record_pb.js";
|
|
5
|
+
import type { EntityCommitInput } from "../internal/entity-commit.js";
|
|
6
|
+
import type { EntityStorageInput } from "../internal/entity-history.js";
|
|
7
|
+
/**
|
|
8
|
+
* Defines one Agent repository scope for a provider handle.
|
|
9
|
+
*
|
|
10
|
+
* @typeParam I Typed Agent identifier.
|
|
11
|
+
* @typeParam S Generated Agent state.
|
|
12
|
+
*/
|
|
13
|
+
export interface AgentExecutionStorageInput<I, S extends Message> {
|
|
14
|
+
/**
|
|
15
|
+
* Entity layout and complete tenant boundary used by conditional completion.
|
|
16
|
+
*/
|
|
17
|
+
readonly entity: EntityStorageInput<I, S>;
|
|
18
|
+
/**
|
|
19
|
+
* Generated Agent state type named in every execution scope.
|
|
20
|
+
*/
|
|
21
|
+
readonly stateType: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Selects a bounded page of provider-observed candidate heads in one Agent state type.
|
|
25
|
+
*/
|
|
26
|
+
export interface AgentPendingRead {
|
|
27
|
+
/**
|
|
28
|
+
* Provider-observed continuation and fixed time boundary from the preceding page.
|
|
29
|
+
*/
|
|
30
|
+
readonly after?: AgentPendingCursor;
|
|
31
|
+
/**
|
|
32
|
+
* Maximum number of observed candidates returned.
|
|
33
|
+
*/
|
|
34
|
+
readonly count: number;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Orders observed candidate heads without allocating a history position.
|
|
38
|
+
*/
|
|
39
|
+
export interface AgentPendingKey {
|
|
40
|
+
/**
|
|
41
|
+
* Complete Agent instance identity.
|
|
42
|
+
*/
|
|
43
|
+
readonly scope: AgentExecutionScope;
|
|
44
|
+
/**
|
|
45
|
+
* Provider time at which this instance became eligible.
|
|
46
|
+
*/
|
|
47
|
+
readonly eligibleAt: Timestamp;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Fixed sweep time and complete index key observed by a provider page.
|
|
51
|
+
*/
|
|
52
|
+
export interface AgentPendingCursor {
|
|
53
|
+
/**
|
|
54
|
+
* Time sampled once when the sweep began.
|
|
55
|
+
*/
|
|
56
|
+
readonly asOf: Timestamp;
|
|
57
|
+
/**
|
|
58
|
+
* Last examined head index key, before any concurrent mutation.
|
|
59
|
+
*/
|
|
60
|
+
readonly key: AgentPendingKey;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Returns detached records for observed candidates and their continuation.
|
|
64
|
+
* A concurrent mutation can make a record stale; claim decides whether work is current.
|
|
65
|
+
*/
|
|
66
|
+
export interface AgentPendingPage {
|
|
67
|
+
/**
|
|
68
|
+
* Candidate records observed through the pending-head index.
|
|
69
|
+
*/
|
|
70
|
+
readonly records: readonly AgentExecutionRecord[];
|
|
71
|
+
/**
|
|
72
|
+
* Last examined provider index key; advance it even when no claim succeeds.
|
|
73
|
+
*/
|
|
74
|
+
readonly after?: AgentPendingCursor;
|
|
75
|
+
/**
|
|
76
|
+
* Whether another indexed candidate was observed during this page read.
|
|
77
|
+
*/
|
|
78
|
+
readonly hasMore: boolean;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Provides a claimed record and queryable current model preferences.
|
|
82
|
+
*/
|
|
83
|
+
export interface AgentExecutionClaim {
|
|
84
|
+
/**
|
|
85
|
+
* Complete claimed execution record.
|
|
86
|
+
*/
|
|
87
|
+
readonly record: AgentExecutionRecord;
|
|
88
|
+
/**
|
|
89
|
+
* Current per-instance preferences at the claim boundary.
|
|
90
|
+
*/
|
|
91
|
+
readonly preferences: readonly ModelPreference[];
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Replaces one fenced execution record and appends its conversation or System history.
|
|
95
|
+
*/
|
|
96
|
+
export interface AgentExecutionUpdate {
|
|
97
|
+
/**
|
|
98
|
+
* Exact accepted invocation identity.
|
|
99
|
+
*/
|
|
100
|
+
readonly key: AgentInvocationKey;
|
|
101
|
+
/**
|
|
102
|
+
* Exclusive token granted by the current per-instance claim.
|
|
103
|
+
*/
|
|
104
|
+
readonly token: string;
|
|
105
|
+
/**
|
|
106
|
+
* Exact binary image read before constructing this update.
|
|
107
|
+
*/
|
|
108
|
+
readonly expectedRecordBytes: Uint8Array;
|
|
109
|
+
/**
|
|
110
|
+
* Complete next record with immutable acceptance unchanged.
|
|
111
|
+
*/
|
|
112
|
+
readonly next: AgentExecutionRecord;
|
|
113
|
+
/**
|
|
114
|
+
* Original conversation or System entries committed with the journal.
|
|
115
|
+
*/
|
|
116
|
+
readonly historyEntries?: readonly AgentHistoryEntry[];
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Commits an Agent transition and its fenced execution record together.
|
|
120
|
+
*
|
|
121
|
+
* @typeParam I Typed Agent identifier.
|
|
122
|
+
* @typeParam S Generated Agent state.
|
|
123
|
+
*/
|
|
124
|
+
export interface AgentExecutionComplete<I, S extends Message> extends AgentExecutionUpdate {
|
|
125
|
+
/**
|
|
126
|
+
* Current-state and framework history mutation; absent for a no-op.
|
|
127
|
+
*/
|
|
128
|
+
readonly entityCommit?: EntityCommitInput<I, S>;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Native serialized payload bounds available before model or tool dispatch.
|
|
132
|
+
*
|
|
133
|
+
* Every limit applies to the complete internal Protobuf record, including its
|
|
134
|
+
* scope and metadata. An absent limit means this provider enforces no tighter
|
|
135
|
+
* fixed bound for that record.
|
|
136
|
+
*/
|
|
137
|
+
export interface AgentExecutionCapacity {
|
|
138
|
+
/**
|
|
139
|
+
* Maximum serialized AgentExecutionRecord bytes.
|
|
140
|
+
*/
|
|
141
|
+
readonly executionRecordBytes?: number;
|
|
142
|
+
/**
|
|
143
|
+
* Maximum serialized AgentExecutionHead bytes.
|
|
144
|
+
*/
|
|
145
|
+
readonly executionHeadBytes?: number;
|
|
146
|
+
/**
|
|
147
|
+
* Maximum serialized AgentHistoryRecord bytes.
|
|
148
|
+
*/
|
|
149
|
+
readonly historyRecordBytes?: number;
|
|
150
|
+
/**
|
|
151
|
+
* Maximum aggregate staged native transaction payload bytes.
|
|
152
|
+
*/
|
|
153
|
+
readonly transactionPayloadBytes?: number;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Provider-only durable execution capability for one Agent repository scope.
|
|
157
|
+
*
|
|
158
|
+
* @typeParam I Typed Agent identifier.
|
|
159
|
+
* @typeParam S Generated Agent state.
|
|
160
|
+
*/
|
|
161
|
+
export interface AgentExecutionStorage<I, S extends Message> {
|
|
162
|
+
/**
|
|
163
|
+
* Native bounds used to reject unjournalable work before external dispatch.
|
|
164
|
+
*/
|
|
165
|
+
readonly capacity: AgentExecutionCapacity;
|
|
166
|
+
/**
|
|
167
|
+
* Persists accepted source work before its Inbox handoff is acknowledged.
|
|
168
|
+
*
|
|
169
|
+
* @param accepted Exact source envelope and selected handler bindings.
|
|
170
|
+
* @returns Stored record, accepting an identical repeat only.
|
|
171
|
+
*/
|
|
172
|
+
admit(accepted: AgentAcceptedInvocation): Promise<AgentExecutionRecord>;
|
|
173
|
+
/**
|
|
174
|
+
* Reads bounded, time-eligible unresolved work through a provider index.
|
|
175
|
+
*
|
|
176
|
+
* @param request Page count and complete continuation.
|
|
177
|
+
* @returns Independent records and continuation state.
|
|
178
|
+
*/
|
|
179
|
+
pending(request: AgentPendingRead): Promise<AgentPendingPage>;
|
|
180
|
+
/**
|
|
181
|
+
* Reads a complete execution record after reconstruction.
|
|
182
|
+
*
|
|
183
|
+
* @param key Exact source and Agent instance identity.
|
|
184
|
+
* @returns Stored record, if present.
|
|
185
|
+
*/
|
|
186
|
+
read(key: AgentInvocationKey): Promise<AgentExecutionRecord | undefined>;
|
|
187
|
+
/**
|
|
188
|
+
* Acquires the earliest unresolved invocation with a fresh provider-side time check.
|
|
189
|
+
*
|
|
190
|
+
* @param key Exact source and Agent instance identity.
|
|
191
|
+
* @param token New unpredictable exclusive token.
|
|
192
|
+
* @param expiresAt Requested claim expiry.
|
|
193
|
+
* @returns Claimed record and current preferences, if eligible.
|
|
194
|
+
*/
|
|
195
|
+
claim(key: AgentInvocationKey, token: string, expiresAt: Timestamp): Promise<AgentExecutionClaim | undefined>;
|
|
196
|
+
/**
|
|
197
|
+
* Updates the same unexpired token under the per-instance claim lock.
|
|
198
|
+
*
|
|
199
|
+
* @param key Exact source and Agent instance identity.
|
|
200
|
+
* @param token Current exclusive token.
|
|
201
|
+
* @param expiresAt Requested later expiry.
|
|
202
|
+
* @returns Whether the current token was renewed.
|
|
203
|
+
*/
|
|
204
|
+
renew(key: AgentInvocationKey, token: string, expiresAt: Timestamp): Promise<boolean>;
|
|
205
|
+
/**
|
|
206
|
+
* Persists fenced budgets, evidence and conversation/System history atomically.
|
|
207
|
+
*
|
|
208
|
+
* @param input Expected exact record and next retained evidence.
|
|
209
|
+
* @returns Completion after fenced evidence is persisted.
|
|
210
|
+
*/
|
|
211
|
+
update(input: AgentExecutionUpdate): Promise<void>;
|
|
212
|
+
/**
|
|
213
|
+
* Persists Entity, history, preferences, execution result and output obligations atomically.
|
|
214
|
+
*
|
|
215
|
+
* @param input Expected exact record and complete transition.
|
|
216
|
+
* @returns Completion after conditional Entity and evidence commit.
|
|
217
|
+
*/
|
|
218
|
+
complete(input: AgentExecutionComplete<I, S>): Promise<void>;
|
|
219
|
+
/**
|
|
220
|
+
* Marks output IDs accepted by normal delivery without rerunning handlers.
|
|
221
|
+
*
|
|
222
|
+
* @param key Exact source and Agent instance identity.
|
|
223
|
+
* @param token Current exclusive token.
|
|
224
|
+
* @param expectedRecordBytes Exact binary image before acknowledgement.
|
|
225
|
+
* @param signals Original IDs accepted by delivery.
|
|
226
|
+
* @returns Completion after original output IDs are marked delivered.
|
|
227
|
+
*/
|
|
228
|
+
markDelivered(key: AgentInvocationKey, token: string, expectedRecordBytes: Uint8Array, signals: readonly AgentSignalKey[]): Promise<void>;
|
|
229
|
+
/**
|
|
230
|
+
* Closes this handle without deleting any persisted work.
|
|
231
|
+
*/
|
|
232
|
+
close(): void;
|
|
233
|
+
}
|
|
234
|
+
//# sourceMappingURL=agent-execution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-execution.d.ts","sourceRoot":"","sources":["../../src/entity/agent-execution.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,iBAAiB,EA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,CAAC;IAExE;;;;;OAKG;IACH,OAAO,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAE9D;;;;;OAKG;IACH,IAAI,CAAC,GAAG,EAAE,kBAAkB,GAAG,OAAO,CAAC,oBAAoB,GAAG,SAAS,CAAC,CAAC;IAEzE;;;;;;;OAOG;IACH,KAAK,CACH,GAAG,EAAE,kBAAkB,EACvB,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,SAAS,GACnB,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC,CAAC;IAE5C;;;;;;;OAOG;IACH,KAAK,CAAC,GAAG,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEtF;;;;;OAKG;IACH,MAAM,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEnD;;;;;OAKG;IACH,QAAQ,CAAC,KAAK,EAAE,sBAAsB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7D;;;;;;;;OAQG;IACH,aAAa,CACX,GAAG,EAAE,kBAAkB,EACvB,KAAK,EAAE,MAAM,EACb,mBAAmB,EAAE,UAAU,EAC/B,OAAO,EAAE,SAAS,cAAc,EAAE,GACjC,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjB;;OAEG;IACH,KAAK,IAAI,IAAI,CAAC;CACf"}
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=agent-execution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-execution.js","sourceRoot":"","sources":["../../src/entity/agent-execution.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { Timestamp } from "@bufbuild/protobuf/wkt";
|
|
2
|
+
import { type AgentHistoryEntry } from "@spine-event-engine/proto/agent";
|
|
3
|
+
import { type AgentHistoryStorage, type AgentHistoryStorageInput } from "./agent-history.js";
|
|
4
|
+
/**
|
|
5
|
+
* Supplies domain-correct Proto entries and real provider handles to shared checks.
|
|
6
|
+
*/
|
|
7
|
+
export interface AgentHistoryConformanceAdapter {
|
|
8
|
+
/**
|
|
9
|
+
* Repository and tenant scope used as the baseline.
|
|
10
|
+
*/
|
|
11
|
+
readonly scope: AgentHistoryStorageInput<string>;
|
|
12
|
+
/**
|
|
13
|
+
* Opens a provider handle for a repository scope.
|
|
14
|
+
*
|
|
15
|
+
* @param input Bounded Context, state type, and typed ID scope.
|
|
16
|
+
* @returns Provider history handle.
|
|
17
|
+
*/
|
|
18
|
+
readonly open: (input: AgentHistoryStorageInput<string>) => AgentHistoryStorage<string>;
|
|
19
|
+
/**
|
|
20
|
+
* Builds a typed model request history entry.
|
|
21
|
+
*
|
|
22
|
+
* @param id Immutable record ID.
|
|
23
|
+
* @param conversation Conversation ID value.
|
|
24
|
+
* @param time Original occurrence time.
|
|
25
|
+
* @returns Complete request history entry.
|
|
26
|
+
*/
|
|
27
|
+
readonly conversation: (id: string, conversation: string, time: Timestamp) => AgentHistoryEntry;
|
|
28
|
+
/**
|
|
29
|
+
* Builds a typed model response history entry.
|
|
30
|
+
*
|
|
31
|
+
* @param id Immutable record ID.
|
|
32
|
+
* @param conversation Conversation ID value.
|
|
33
|
+
* @param time Original occurrence time.
|
|
34
|
+
* @returns Complete response history entry.
|
|
35
|
+
*/
|
|
36
|
+
readonly response: (id: string, conversation: string, time: Timestamp) => AgentHistoryEntry;
|
|
37
|
+
/**
|
|
38
|
+
* Builds a canonical Agent System Event envelope.
|
|
39
|
+
*
|
|
40
|
+
* @param id Original Event ID.
|
|
41
|
+
* @param time Original occurrence time.
|
|
42
|
+
* @returns Complete System Event history entry.
|
|
43
|
+
*/
|
|
44
|
+
readonly system: (id: string, time: Timestamp) => AgentHistoryEntry;
|
|
45
|
+
/**
|
|
46
|
+
* Builds a canonical Agent domain Event envelope.
|
|
47
|
+
*
|
|
48
|
+
* @param id Original Event ID.
|
|
49
|
+
* @param time Original occurrence time.
|
|
50
|
+
* @returns Complete domain Event history entry.
|
|
51
|
+
*/
|
|
52
|
+
readonly domain: (id: string, time: Timestamp) => AgentHistoryEntry;
|
|
53
|
+
/**
|
|
54
|
+
* Builds a full-precision occurrence time.
|
|
55
|
+
*
|
|
56
|
+
* @param seconds Complete Timestamp seconds.
|
|
57
|
+
* @param nanos Nanoseconds within the second.
|
|
58
|
+
* @returns Original occurrence time.
|
|
59
|
+
*/
|
|
60
|
+
readonly occurredAt: (seconds: bigint, nanos?: number) => Timestamp;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Shared assertions that each Agent history provider must satisfy.
|
|
64
|
+
*/
|
|
65
|
+
export interface AgentHistoryConformanceChecks {
|
|
66
|
+
/**
|
|
67
|
+
* Checks provider Agent history behavior.
|
|
68
|
+
*
|
|
69
|
+
* @param adapter Real provider handle and domain fixtures.
|
|
70
|
+
* @returns Completes after all checks pass.
|
|
71
|
+
*/
|
|
72
|
+
check(adapter: AgentHistoryConformanceAdapter): Promise<void>;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Runs provider-neutral Agent history ordering, paging, and retention checks.
|
|
76
|
+
*/
|
|
77
|
+
export declare const AgentHistoryConformance: AgentHistoryConformanceChecks;
|
|
78
|
+
//# sourceMappingURL=agent-history-conformance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-history-conformance.d.ts","sourceRoot":"","sources":["../../src/entity/agent-history-conformance.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD,OAAO,EAGL,KAAK,iBAAiB,EACvB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAGL,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAE9B,MAAM,oBAAoB,CAAC;AAE5B;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,wBAAwB,CAAC,MAAM,CAAC,CAAC;IAEjD;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,wBAAwB,CAAC,MAAM,CAAC,KAAK,mBAAmB,CAAC,MAAM,CAAC,CAAC;IAExF;;;;;;;OAOG;IACH,QAAQ,CAAC,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,KAAK,iBAAiB,CAAC;IAEhG;;;;;;;OAOG;IACH,QAAQ,CAAC,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,KAAK,iBAAiB,CAAC;IAE5F;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,KAAK,iBAAiB,CAAC;IAEpE;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,KAAK,iBAAiB,CAAC;IAEpE;;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