@chimp-labs/keel-streams 0.0.0-stage → 0.1.0
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/CHANGELOG.md +5 -0
- package/LICENSE +21 -0
- package/README.md +50 -2
- package/dist/durable-stream.d.ts +376 -0
- package/dist/durable-stream.d.ts.map +1 -0
- package/dist/durable-stream.js +1042 -0
- package/dist/durable-stream.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/nats.d.ts +55 -0
- package/dist/nats.d.ts.map +1 -0
- package/dist/nats.js +712 -0
- package/dist/nats.js.map +1 -0
- package/dist/s2.d.ts +33 -0
- package/dist/s2.d.ts.map +1 -0
- package/dist/s2.js +330 -0
- package/dist/s2.js.map +1 -0
- package/package.json +93 -3
package/CHANGELOG.md
ADDED
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ChimpLabs
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,51 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `@chimp-labs/keel-streams`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Durable append-only streams (`DurableStream`), swappable `Topic` streaming (`TopicDurableStreamLive`), and S2 (`s2-lite` / s2.dev) + NATS JetStream backends for [`@chimp-labs/keel`](../keel).
|
|
4
|
+
|
|
5
|
+
`DurableStream` integrates with `@chimp-labs/keel` through the Open Plugin Protocol (`[KeelBindSym]`, `[KeelDefaultLayerSym]`, `[KeelInfraSym]`, `[KeelErrorMetaSym]`).
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pnpm add @chimp-labs/keel @chimp-labs/keel-streams effect
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
If using the NATS JetStream backend (`@chimp-labs/keel-streams/nats`), also install the NATS peer dependencies:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pnpm add @nats-io/transport-node @nats-io/jetstream @nats-io/kv
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Subpath Exports
|
|
20
|
+
|
|
21
|
+
| Subpath | Contents |
|
|
22
|
+
| :--- | :--- |
|
|
23
|
+
| `@chimp-labs/keel-streams` | `DurableStream`, `DurableStreamBackend`, `DurableStreamMemoryLive`, `TopicDurableStreamLive`, `KeelMemoryDurableStreamingLive`, `DurableStreamS2Live`, `KeelS2StreamingLive`, operations, and errors |
|
|
24
|
+
| `@chimp-labs/keel-streams/durable-stream` | Core `DurableStream` primitive, in-memory backend, and `TopicDurableStreamLive` |
|
|
25
|
+
| `@chimp-labs/keel-streams/s2` | Zero-dependency S2 v1 HTTP + SSE backend (`s2-lite` Docker or `s2.dev` Cloud) |
|
|
26
|
+
| `@chimp-labs/keel-streams/nats` | NATS JetStream + KV fencing backend (`DurableStreamNatsLive`, `KeelNatsStreamingLive`) |
|
|
27
|
+
|
|
28
|
+
## Usage
|
|
29
|
+
|
|
30
|
+
### Plain TypeScript SDK (`@chimp-labs/keel/sdk`)
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
import { createKeel, k } from "@chimp-labs/keel/sdk"
|
|
34
|
+
import { DurableStream } from "@chimp-labs/keel-streams"
|
|
35
|
+
|
|
36
|
+
const AgentRuns = DurableStream("agent-runs", {
|
|
37
|
+
schema: k.object({
|
|
38
|
+
type: k.enum(["token", "tool", "done"]),
|
|
39
|
+
text: k.string(),
|
|
40
|
+
}),
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
await using keel = await createKeel({
|
|
44
|
+
backend: "memory",
|
|
45
|
+
streaming: "memory", // or { backend: "s2", endpoint: "http://127.0.0.1:8088" } or { backend: "nats", servers: "nats://127.0.0.1:4222" }
|
|
46
|
+
resources: { agentRuns: AgentRuns },
|
|
47
|
+
ensureAll: true,
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
await keel.agentRuns.append({ type: "token", text: "Hello" }, { key: "run-1" })
|
|
51
|
+
```
|
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
import { Context, Duration, Effect, Layer, Schema, Stream } from "effect";
|
|
2
|
+
import { EventBus, EventStore, KeelBindSym, KeelDefaultLayerSym, KeelEnsureSym, KeelErrorMetaSym, KeelInfraSym, KeelKindSym, KeelMetaSym, KeelTenantLifecycleSym, TenantContextMissingError, type KeelInfraContribution, type KeelTenantLifecycleHooks } from "@chimp-labs/keel";
|
|
3
|
+
import type { SdkRunner } from "@chimp-labs/keel/sdk";
|
|
4
|
+
export declare const recordByteLength: (rec: {
|
|
5
|
+
readonly body?: string;
|
|
6
|
+
readonly headers?: ReadonlyArray<readonly [string, string]>;
|
|
7
|
+
}) => number;
|
|
8
|
+
export type DurableStreamHeaderTuple = readonly [string, string];
|
|
9
|
+
export type DurableStreamStorageClass = "express" | "standard";
|
|
10
|
+
export type DurableStreamRetentionPolicy = {
|
|
11
|
+
readonly age: number;
|
|
12
|
+
} | {
|
|
13
|
+
readonly infinite: Record<string, never>;
|
|
14
|
+
};
|
|
15
|
+
export type DurableStreamTimestampingMode = "client-prefer" | "client-require" | "arrival";
|
|
16
|
+
export interface DurableStreamTimestampingConfig {
|
|
17
|
+
readonly mode?: DurableStreamTimestampingMode;
|
|
18
|
+
readonly uncapped?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface DurableStreamDeleteOnEmptyConfig {
|
|
21
|
+
readonly min_age_secs?: number;
|
|
22
|
+
}
|
|
23
|
+
export interface DurableStreamDefaultConfig {
|
|
24
|
+
readonly storage_class?: DurableStreamStorageClass;
|
|
25
|
+
readonly retention_policy?: DurableStreamRetentionPolicy;
|
|
26
|
+
readonly timestamping?: DurableStreamTimestampingConfig;
|
|
27
|
+
readonly delete_on_empty?: DurableStreamDeleteOnEmptyConfig;
|
|
28
|
+
}
|
|
29
|
+
export interface DurableStreamBasinConfig {
|
|
30
|
+
readonly default_stream_config?: DurableStreamDefaultConfig | null;
|
|
31
|
+
readonly create_stream_on_append?: boolean;
|
|
32
|
+
readonly create_stream_on_read?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export interface DurableStreamPosition {
|
|
35
|
+
readonly seq_num: number;
|
|
36
|
+
readonly timestamp: number;
|
|
37
|
+
}
|
|
38
|
+
export interface DurableStreamRawRecord {
|
|
39
|
+
readonly seq_num: number;
|
|
40
|
+
readonly timestamp: number;
|
|
41
|
+
readonly body?: string;
|
|
42
|
+
readonly headers?: ReadonlyArray<DurableStreamHeaderTuple>;
|
|
43
|
+
}
|
|
44
|
+
export interface DurableStreamReadBatch {
|
|
45
|
+
readonly records: ReadonlyArray<DurableStreamRawRecord>;
|
|
46
|
+
readonly tail?: DurableStreamPosition;
|
|
47
|
+
}
|
|
48
|
+
export interface DurableStreamAppendAck {
|
|
49
|
+
readonly start: DurableStreamPosition;
|
|
50
|
+
readonly end: DurableStreamPosition;
|
|
51
|
+
readonly tail: DurableStreamPosition;
|
|
52
|
+
}
|
|
53
|
+
declare const DurableStreamError_base: Schema.Class<DurableStreamError, Schema.TaggedStruct<"DurableStreamError", {
|
|
54
|
+
readonly stream: Schema.String;
|
|
55
|
+
readonly operation: Schema.String;
|
|
56
|
+
readonly message: Schema.String;
|
|
57
|
+
readonly cause: Schema.optional<Schema.Unknown>;
|
|
58
|
+
}>, import("effect/Cause").YieldableError>;
|
|
59
|
+
export declare class DurableStreamError extends DurableStreamError_base {
|
|
60
|
+
static readonly [KeelErrorMetaSym]: {
|
|
61
|
+
readonly httpStatus: 500;
|
|
62
|
+
readonly category: "internal";
|
|
63
|
+
readonly retryable: true;
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
declare const DurableStreamSchemaError_base: Schema.Class<DurableStreamSchemaError, Schema.TaggedStruct<"DurableStreamSchemaError", {
|
|
67
|
+
readonly stream: Schema.String;
|
|
68
|
+
readonly direction: Schema.Literals<readonly ["encode", "decode"]>;
|
|
69
|
+
readonly message: Schema.String;
|
|
70
|
+
readonly cause: Schema.optional<Schema.Unknown>;
|
|
71
|
+
}>, import("effect/Cause").YieldableError>;
|
|
72
|
+
export declare class DurableStreamSchemaError extends DurableStreamSchemaError_base {
|
|
73
|
+
static readonly [KeelErrorMetaSym]: {
|
|
74
|
+
readonly httpStatus: 400;
|
|
75
|
+
readonly category: "invalid";
|
|
76
|
+
readonly retryable: false;
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
declare const DurableStreamBadRequestError_base: Schema.Class<DurableStreamBadRequestError, Schema.TaggedStruct<"DurableStreamBadRequestError", {
|
|
80
|
+
readonly code: Schema.String;
|
|
81
|
+
readonly message: Schema.String;
|
|
82
|
+
}>, import("effect/Cause").YieldableError>;
|
|
83
|
+
export declare class DurableStreamBadRequestError extends DurableStreamBadRequestError_base {
|
|
84
|
+
static readonly [KeelErrorMetaSym]: {
|
|
85
|
+
readonly httpStatus: 400;
|
|
86
|
+
readonly category: "invalid";
|
|
87
|
+
readonly retryable: false;
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
declare const DurableStreamForbiddenError_base: Schema.Class<DurableStreamForbiddenError, Schema.TaggedStruct<"DurableStreamForbiddenError", {
|
|
91
|
+
readonly code: Schema.String;
|
|
92
|
+
readonly message: Schema.String;
|
|
93
|
+
}>, import("effect/Cause").YieldableError>;
|
|
94
|
+
export declare class DurableStreamForbiddenError extends DurableStreamForbiddenError_base {
|
|
95
|
+
static readonly [KeelErrorMetaSym]: {
|
|
96
|
+
readonly httpStatus: 403;
|
|
97
|
+
readonly category: "forbidden";
|
|
98
|
+
readonly retryable: false;
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
declare const DurableStreamNotFoundError_base: Schema.Class<DurableStreamNotFoundError, Schema.TaggedStruct<"DurableStreamNotFoundError", {
|
|
102
|
+
readonly code: Schema.String;
|
|
103
|
+
readonly message: Schema.String;
|
|
104
|
+
readonly resource: Schema.String;
|
|
105
|
+
}>, import("effect/Cause").YieldableError>;
|
|
106
|
+
export declare class DurableStreamNotFoundError extends DurableStreamNotFoundError_base {
|
|
107
|
+
static readonly [KeelErrorMetaSym]: {
|
|
108
|
+
readonly httpStatus: 404;
|
|
109
|
+
readonly category: "not_found";
|
|
110
|
+
readonly retryable: false;
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
declare const DurableStreamConflictError_base: Schema.Class<DurableStreamConflictError, Schema.TaggedStruct<"DurableStreamConflictError", {
|
|
114
|
+
readonly code: Schema.String;
|
|
115
|
+
readonly message: Schema.String;
|
|
116
|
+
readonly resource: Schema.String;
|
|
117
|
+
}>, import("effect/Cause").YieldableError>;
|
|
118
|
+
export declare class DurableStreamConflictError extends DurableStreamConflictError_base {
|
|
119
|
+
static readonly [KeelErrorMetaSym]: {
|
|
120
|
+
readonly httpStatus: 409;
|
|
121
|
+
readonly category: "conflict";
|
|
122
|
+
readonly retryable: false;
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
declare const DurableStreamPreconditionFailedError_base: Schema.Class<DurableStreamPreconditionFailedError, Schema.TaggedStruct<"DurableStreamPreconditionFailedError", {
|
|
126
|
+
readonly code: Schema.Literals<readonly ["seq_num_mismatch", "fencing_token_mismatch"]>;
|
|
127
|
+
readonly message: Schema.String;
|
|
128
|
+
readonly seq_num_mismatch: Schema.optional<Schema.Number>;
|
|
129
|
+
readonly fencing_token_mismatch: Schema.optional<Schema.String>;
|
|
130
|
+
}>, import("effect/Cause").YieldableError>;
|
|
131
|
+
export declare class DurableStreamPreconditionFailedError extends DurableStreamPreconditionFailedError_base {
|
|
132
|
+
static readonly [KeelErrorMetaSym]: {
|
|
133
|
+
readonly httpStatus: 412;
|
|
134
|
+
readonly category: "conflict";
|
|
135
|
+
readonly retryable: false;
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
declare const DurableStreamRangeNotSatisfiableError_base: Schema.Class<DurableStreamRangeNotSatisfiableError, Schema.TaggedStruct<"DurableStreamRangeNotSatisfiableError", {
|
|
139
|
+
readonly code: Schema.String;
|
|
140
|
+
readonly message: Schema.String;
|
|
141
|
+
readonly tail: Schema.Struct<{
|
|
142
|
+
readonly seq_num: Schema.Number;
|
|
143
|
+
readonly timestamp: Schema.Number;
|
|
144
|
+
}>;
|
|
145
|
+
readonly trim_seq_num: Schema.optional<Schema.Number>;
|
|
146
|
+
}>, import("effect/Cause").YieldableError>;
|
|
147
|
+
export declare class DurableStreamRangeNotSatisfiableError extends DurableStreamRangeNotSatisfiableError_base {
|
|
148
|
+
static readonly [KeelErrorMetaSym]: {
|
|
149
|
+
readonly httpStatus: 416;
|
|
150
|
+
readonly category: "invalid";
|
|
151
|
+
readonly retryable: false;
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
export type DurableStreamFailure = DurableStreamError | DurableStreamSchemaError | DurableStreamBadRequestError | DurableStreamForbiddenError | DurableStreamNotFoundError | DurableStreamConflictError | DurableStreamPreconditionFailedError | DurableStreamRangeNotSatisfiableError | TenantContextMissingError;
|
|
155
|
+
export declare const isDurableStreamFailure: (err: unknown) => err is DurableStreamFailure;
|
|
156
|
+
export declare const toDurableStreamError: (stream: string, operation: string) => (err: unknown) => DurableStreamFailure;
|
|
157
|
+
export interface DurableStreamConfig<S extends Schema.Codec<any, any, never, never> = Schema.Codec<any, any, never, never>> {
|
|
158
|
+
/** Effect Schema validating every appended and read record value. */
|
|
159
|
+
readonly schema: S;
|
|
160
|
+
/** Optional explicit basin name (defaults to sanitized `keel-<name>`). */
|
|
161
|
+
readonly basin?: string;
|
|
162
|
+
/** Retention policy: Duration (e.g. `"7 days"`) or `"infinite"`. Default: `"7 days"`. */
|
|
163
|
+
readonly retention?: Duration.Input | "infinite";
|
|
164
|
+
/** Optional auto-cleanup of empty streams after inactivity duration. */
|
|
165
|
+
readonly deleteOnEmptyAfter?: Duration.Input;
|
|
166
|
+
/** Timestamp assignment mode. Default: `"client-prefer"`. */
|
|
167
|
+
readonly timestamping?: DurableStreamTimestampingMode;
|
|
168
|
+
/** Storage class hint (`"express"` | `"standard"`). Default: `"express"`. */
|
|
169
|
+
readonly storageClass?: DurableStreamStorageClass;
|
|
170
|
+
/**
|
|
171
|
+
* Automatically create a stream key when a reader/subscriber arrives before
|
|
172
|
+
* the first append (`create_stream_on_read`). Default: `true`.
|
|
173
|
+
*/
|
|
174
|
+
readonly createOnRead?: boolean;
|
|
175
|
+
/**
|
|
176
|
+
* When `true`, automatically namespaces every stream key under `${CurrentTenant.tenantId}/`
|
|
177
|
+
* and integrates with `Tenant` GDPR `exportTenantData` / `eraseTenantData`.
|
|
178
|
+
*/
|
|
179
|
+
readonly tenantScoped?: boolean;
|
|
180
|
+
}
|
|
181
|
+
export interface DurableStreamRecord<A> {
|
|
182
|
+
readonly seqNum: number;
|
|
183
|
+
readonly timestamp: number;
|
|
184
|
+
readonly value: A;
|
|
185
|
+
readonly headers?: ReadonlyArray<DurableStreamHeaderTuple>;
|
|
186
|
+
}
|
|
187
|
+
export interface DurableStreamReadResult<A> {
|
|
188
|
+
readonly records: ReadonlyArray<DurableStreamRecord<A>>;
|
|
189
|
+
readonly tail: DurableStreamPosition;
|
|
190
|
+
}
|
|
191
|
+
export interface DurableStreamAppendOptions {
|
|
192
|
+
/** Optimistic concurrency check: fail with `DurableStreamPreconditionFailedError (412)` if tail !== matchSeqNum. */
|
|
193
|
+
readonly matchSeqNum?: number;
|
|
194
|
+
/** Pessimistic concurrency check: fail with `DurableStreamPreconditionFailedError (412)` if active fence !== fencingToken. */
|
|
195
|
+
readonly fencingToken?: string;
|
|
196
|
+
/** Optional headers attached to every appended record in this batch. */
|
|
197
|
+
readonly headers?: ReadonlyArray<DurableStreamHeaderTuple>;
|
|
198
|
+
/** Optional client timestamp (epoch ms) applied to records in this batch. */
|
|
199
|
+
readonly timestamp?: number;
|
|
200
|
+
}
|
|
201
|
+
export interface DurableStreamReadOptions {
|
|
202
|
+
readonly seqNum?: number;
|
|
203
|
+
readonly tailOffset?: number;
|
|
204
|
+
readonly timestamp?: number;
|
|
205
|
+
readonly count?: number;
|
|
206
|
+
readonly bytes?: number;
|
|
207
|
+
readonly until?: number;
|
|
208
|
+
readonly clamp?: boolean;
|
|
209
|
+
/** Long-poll up to `wait` seconds (0..60) waiting for new records at tail. */
|
|
210
|
+
readonly wait?: number;
|
|
211
|
+
}
|
|
212
|
+
export interface DurableStreamTailOptions {
|
|
213
|
+
readonly seqNum?: number;
|
|
214
|
+
readonly tailOffset?: number;
|
|
215
|
+
readonly timestamp?: number;
|
|
216
|
+
readonly count?: number;
|
|
217
|
+
readonly bytes?: number;
|
|
218
|
+
readonly until?: number;
|
|
219
|
+
readonly clamp?: boolean;
|
|
220
|
+
}
|
|
221
|
+
export interface DurableStreamListOptions {
|
|
222
|
+
readonly prefix?: string;
|
|
223
|
+
readonly startAfter?: string;
|
|
224
|
+
readonly limit?: number;
|
|
225
|
+
}
|
|
226
|
+
export interface DurableStreamDef<Name extends string = string, S extends Schema.Codec<any, any, never, never> = Schema.Codec<any, any, never, never>> {
|
|
227
|
+
readonly durableStreamName: Name;
|
|
228
|
+
readonly basinName: string;
|
|
229
|
+
readonly schema: S;
|
|
230
|
+
readonly basinConfig: DurableStreamBasinConfig;
|
|
231
|
+
readonly tenantScoped: boolean;
|
|
232
|
+
}
|
|
233
|
+
export type DurableStreamValueOf<D extends DurableStreamDef<any, any>> = D["schema"]["Type"];
|
|
234
|
+
export interface RawAppendRecord {
|
|
235
|
+
readonly body: string;
|
|
236
|
+
readonly headers?: ReadonlyArray<DurableStreamHeaderTuple>;
|
|
237
|
+
readonly timestamp?: number;
|
|
238
|
+
}
|
|
239
|
+
export interface DurableStreamBackendShape {
|
|
240
|
+
readonly ensureBasin: (basin: string, config: DurableStreamBasinConfig) => Effect.Effect<void, DurableStreamFailure>;
|
|
241
|
+
readonly append: (basin: string, stream: string, records: ReadonlyArray<RawAppendRecord>, options?: {
|
|
242
|
+
readonly matchSeqNum?: number;
|
|
243
|
+
readonly fencingToken?: string;
|
|
244
|
+
}) => Effect.Effect<DurableStreamAppendAck, DurableStreamFailure>;
|
|
245
|
+
readonly checkTail: (basin: string, stream: string) => Effect.Effect<DurableStreamPosition, DurableStreamFailure>;
|
|
246
|
+
readonly read: (basin: string, stream: string, options?: DurableStreamReadOptions) => Effect.Effect<DurableStreamReadBatch, DurableStreamFailure>;
|
|
247
|
+
readonly tail: (basin: string, stream: string, options?: DurableStreamTailOptions) => Stream.Stream<DurableStreamReadBatch, DurableStreamFailure>;
|
|
248
|
+
readonly listStreams: (basin: string, options?: DurableStreamListOptions) => Effect.Effect<{
|
|
249
|
+
readonly streams: ReadonlyArray<{
|
|
250
|
+
readonly name: string;
|
|
251
|
+
readonly createdAt: string;
|
|
252
|
+
}>;
|
|
253
|
+
readonly hasMore: boolean;
|
|
254
|
+
}, DurableStreamFailure>;
|
|
255
|
+
readonly deleteStream: (basin: string, stream: string) => Effect.Effect<void, DurableStreamFailure>;
|
|
256
|
+
}
|
|
257
|
+
declare const DurableStreamBackend_base: Context.ServiceClass<DurableStreamBackend, "@chimp-labs/keel/DurableStreamBackend", DurableStreamBackendShape>;
|
|
258
|
+
export declare class DurableStreamBackend extends DurableStreamBackend_base {
|
|
259
|
+
}
|
|
260
|
+
export declare const sanitizeBasinName: (name: string) => string;
|
|
261
|
+
export declare const isCommandHeaders: (headers?: ReadonlyArray<DurableStreamHeaderTuple>) => boolean;
|
|
262
|
+
export declare const getCommandName: (headers?: ReadonlyArray<DurableStreamHeaderTuple>) => string | undefined;
|
|
263
|
+
export declare const makeDurableStreamMemoryBackend: () => DurableStreamBackendShape;
|
|
264
|
+
/**
|
|
265
|
+
* Pure in-memory `DurableStreamBackend` Layer (zero external dependencies,
|
|
266
|
+
* zero database/circularity, instant unit & integration tests).
|
|
267
|
+
*/
|
|
268
|
+
export declare const DurableStreamMemoryLive: Layer.Layer<DurableStreamBackend>;
|
|
269
|
+
export declare const ensureDurableStream: <D extends DurableStreamDef<any, any>>(def: D) => Effect.Effect<void, DurableStreamFailure, DurableStreamBackend>;
|
|
270
|
+
export declare const appendStream: <D extends DurableStreamDef<any, any>>(def: D, key: string, values: ReadonlyArray<DurableStreamValueOf<D>>, options?: DurableStreamAppendOptions) => Effect.Effect<DurableStreamAppendAck, DurableStreamFailure, DurableStreamBackend>;
|
|
271
|
+
export declare const fenceStream: <D extends DurableStreamDef<any, any>>(def: D, key: string, fencingToken: string, options?: {
|
|
272
|
+
readonly matchSeqNum?: number;
|
|
273
|
+
readonly currentFencingToken?: string;
|
|
274
|
+
}) => Effect.Effect<DurableStreamAppendAck, DurableStreamFailure, DurableStreamBackend>;
|
|
275
|
+
export declare const trimStream: <D extends DurableStreamDef<any, any>>(def: D, key: string, trimSeqNum: number, options?: {
|
|
276
|
+
readonly matchSeqNum?: number;
|
|
277
|
+
readonly fencingToken?: string;
|
|
278
|
+
}) => Effect.Effect<DurableStreamAppendAck, DurableStreamFailure, DurableStreamBackend>;
|
|
279
|
+
export declare const checkStreamTail: <D extends DurableStreamDef<any, any>>(def: D, key: string) => Effect.Effect<DurableStreamPosition, DurableStreamFailure, DurableStreamBackend>;
|
|
280
|
+
export declare const readStream: <D extends DurableStreamDef<any, any>>(def: D, key: string, options?: DurableStreamReadOptions) => Effect.Effect<DurableStreamReadResult<DurableStreamValueOf<D>>, DurableStreamFailure, DurableStreamBackend>;
|
|
281
|
+
export declare const tailStream: <D extends DurableStreamDef<any, any>>(def: D, key: string, options?: DurableStreamTailOptions) => Stream.Stream<DurableStreamRecord<DurableStreamValueOf<D>>, DurableStreamFailure, DurableStreamBackend>;
|
|
282
|
+
export declare const listDurableStreams: <D extends DurableStreamDef<any, any>>(def: D, options?: DurableStreamListOptions) => Effect.Effect<{
|
|
283
|
+
readonly streams: ReadonlyArray<{
|
|
284
|
+
readonly key: string;
|
|
285
|
+
readonly createdAt: string;
|
|
286
|
+
}>;
|
|
287
|
+
readonly hasMore: boolean;
|
|
288
|
+
}, DurableStreamFailure, DurableStreamBackend>;
|
|
289
|
+
export declare const deleteDurableStream: <D extends DurableStreamDef<any, any>>(def: D, key: string) => Effect.Effect<void, DurableStreamFailure, DurableStreamBackend>;
|
|
290
|
+
export interface BoundDurableStream<D extends DurableStreamDef<any, any>> {
|
|
291
|
+
readonly ensure: () => Promise<void>;
|
|
292
|
+
readonly append: (key: string, values: ReadonlyArray<DurableStreamValueOf<D>>, options?: DurableStreamAppendOptions) => Promise<DurableStreamAppendAck>;
|
|
293
|
+
readonly fence: (key: string, fencingToken: string, options?: {
|
|
294
|
+
readonly matchSeqNum?: number;
|
|
295
|
+
readonly currentFencingToken?: string;
|
|
296
|
+
}) => Promise<DurableStreamAppendAck>;
|
|
297
|
+
readonly trim: (key: string, trimSeqNum: number, options?: {
|
|
298
|
+
readonly matchSeqNum?: number;
|
|
299
|
+
readonly fencingToken?: string;
|
|
300
|
+
}) => Promise<DurableStreamAppendAck>;
|
|
301
|
+
readonly checkTail: (key: string) => Promise<DurableStreamPosition>;
|
|
302
|
+
readonly read: (key: string, options?: DurableStreamReadOptions) => Promise<DurableStreamReadResult<DurableStreamValueOf<D>>>;
|
|
303
|
+
readonly tail: (key: string, options?: DurableStreamTailOptions) => AsyncIterable<DurableStreamRecord<DurableStreamValueOf<D>>>;
|
|
304
|
+
readonly list: (options?: DurableStreamListOptions) => Promise<{
|
|
305
|
+
readonly streams: ReadonlyArray<{
|
|
306
|
+
readonly key: string;
|
|
307
|
+
readonly createdAt: string;
|
|
308
|
+
}>;
|
|
309
|
+
readonly hasMore: boolean;
|
|
310
|
+
}>;
|
|
311
|
+
readonly delete: (key: string) => Promise<void>;
|
|
312
|
+
}
|
|
313
|
+
export declare const bindDurableStream: <D extends DurableStreamDef<any, any>>(runner: SdkRunner, def: D) => BoundDurableStream<D>;
|
|
314
|
+
/**
|
|
315
|
+
* Declares a typed, durable, append-only stream primitive with monotonic
|
|
316
|
+
* `seqNum`, optimistic `matchSeqNum` CAS, pessimistic `fencingToken`, `trim`,
|
|
317
|
+
* `?wait` long-polling, live tailing, and optional `CurrentTenant` isolation.
|
|
318
|
+
*
|
|
319
|
+
* Swappable across any `DurableStreamBackend`:
|
|
320
|
+
* - `DurableStreamMemoryLive` (zero-dependency in-memory dev & tests)
|
|
321
|
+
* - `DurableStreamS2Live` (**`s2-lite`** Docker or **s2.dev Cloud**)
|
|
322
|
+
* - `DurableStreamNatsLive` (**NATS JetStream** / Synadia Cloud)
|
|
323
|
+
*/
|
|
324
|
+
export declare function DurableStream<const Name extends string, S extends Schema.Codec<any, any, never, never>>(name: Name, config: DurableStreamConfig<S>): {
|
|
325
|
+
new (): {};
|
|
326
|
+
readonly durableStreamName: Name;
|
|
327
|
+
readonly basinName: string;
|
|
328
|
+
readonly schema: S;
|
|
329
|
+
readonly basinConfig: DurableStreamBasinConfig;
|
|
330
|
+
readonly tenantScoped: boolean;
|
|
331
|
+
readonly [KeelKindSym]: "ext:durable-stream";
|
|
332
|
+
readonly [KeelMetaSym]: {
|
|
333
|
+
kind: "ext:durable-stream";
|
|
334
|
+
name: Name;
|
|
335
|
+
basinName: string;
|
|
336
|
+
tenantScoped: boolean;
|
|
337
|
+
};
|
|
338
|
+
readonly [KeelInfraSym]: () => KeelInfraContribution;
|
|
339
|
+
readonly [KeelDefaultLayerSym]: () => Layer.Layer<DurableStreamBackend, never, never>;
|
|
340
|
+
readonly [KeelEnsureSym]: () => Effect.Effect<void, DurableStreamFailure, DurableStreamBackend>;
|
|
341
|
+
readonly [KeelTenantLifecycleSym]: () => KeelTenantLifecycleHooks;
|
|
342
|
+
readonly [KeelBindSym]: (runner: SdkRunner) => BoundDurableStream<DurableStreamDef<Name, S>>;
|
|
343
|
+
};
|
|
344
|
+
export interface TopicDurableStreamOptions {
|
|
345
|
+
/** Basin name holding the Topic event log. Default: `"keel-topics"`. */
|
|
346
|
+
readonly basin?: string;
|
|
347
|
+
/** Stream key within the basin for globally ordered Topic events. Default: `"_events"`. */
|
|
348
|
+
readonly streamKey?: string;
|
|
349
|
+
/** Retention policy for the Topic basin. Default: `"7 days"`. */
|
|
350
|
+
readonly retention?: Duration.Input | "infinite";
|
|
351
|
+
/** Storage class hint (`"express"` | `"standard"`). Default: `"express"`. */
|
|
352
|
+
readonly storageClass?: DurableStreamStorageClass;
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Swappable `EventBus | EventStore` (`EventLog`) layer backed by `DurableStreamBackend`.
|
|
356
|
+
*
|
|
357
|
+
* Powers `Topic`, `View` (RYOW), `Projection`, `Policy`, `Outbox`,
|
|
358
|
+
* `EventPipeline`, `EventAggregator`, `EventSource`, and `EventSink` over any
|
|
359
|
+
* `DurableStreamBackend` (`Memory`, `S2 / s2-lite`, or `NATS JetStream`).
|
|
360
|
+
*/
|
|
361
|
+
export declare const TopicDurableStreamLive: (options?: TopicDurableStreamOptions) => Layer.Layer<EventBus | EventStore, never, DurableStreamBackend>;
|
|
362
|
+
export interface KeelDurableStreamingBundleOptions {
|
|
363
|
+
readonly topic?: TopicDurableStreamOptions;
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* Composes `DurableStreamBackend` + `TopicDurableStreamLive` on top of any
|
|
367
|
+
* provided `DurableStreamBackend` Layer.
|
|
368
|
+
*/
|
|
369
|
+
export declare const makeKeelDurableStreamingLive: <E, R>(backendLayer: Layer.Layer<DurableStreamBackend, E, R>, options?: KeelDurableStreamingBundleOptions) => Layer.Layer<DurableStreamBackend | EventBus | EventStore, E, R>;
|
|
370
|
+
/**
|
|
371
|
+
* One-line in-memory DurableStream bundle providing `DurableStreamBackend`,
|
|
372
|
+
* `EventBus`, and `EventStore` with zero external services.
|
|
373
|
+
*/
|
|
374
|
+
export declare const KeelMemoryDurableStreamingLive: (options?: KeelDurableStreamingBundleOptions) => Layer.Layer<DurableStreamBackend | EventBus | EventStore>;
|
|
375
|
+
export {};
|
|
376
|
+
//# sourceMappingURL=durable-stream.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"durable-stream.d.ts","sourceRoot":"","sources":["../src/durable-stream.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,OAAO,EACP,QAAQ,EACR,MAAM,EACN,KAAK,EAEL,MAAM,EAEN,MAAM,EACP,MAAM,QAAQ,CAAA;AACf,OAAO,EAEL,QAAQ,EACR,UAAU,EAEV,WAAW,EACX,mBAAmB,EACnB,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,WAAW,EACX,sBAAsB,EACtB,yBAAyB,EAEzB,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAK9B,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAErD,eAAO,MAAM,gBAAgB,GAAI,KAA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