@limo-labs/deity 0.1.0-alpha.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/README.md +519 -0
- package/dist/src/component.d.ts +19 -0
- package/dist/src/component.d.ts.map +1 -0
- package/dist/src/component.js +2 -0
- package/dist/src/component.js.map +1 -0
- package/dist/src/context/context-scope.d.ts +24 -0
- package/dist/src/context/context-scope.d.ts.map +1 -0
- package/dist/src/context/context-scope.js +19 -0
- package/dist/src/context/context-scope.js.map +1 -0
- package/dist/src/context/memory-view.d.ts +62 -0
- package/dist/src/context/memory-view.d.ts.map +1 -0
- package/dist/src/context/memory-view.js +104 -0
- package/dist/src/context/memory-view.js.map +1 -0
- package/dist/src/context/scoped-context.d.ts +51 -0
- package/dist/src/context/scoped-context.d.ts.map +1 -0
- package/dist/src/context/scoped-context.js +74 -0
- package/dist/src/context/scoped-context.js.map +1 -0
- package/dist/src/context/scoped-execution-context.d.ts +55 -0
- package/dist/src/context/scoped-execution-context.d.ts.map +1 -0
- package/dist/src/context/scoped-execution-context.js +78 -0
- package/dist/src/context/scoped-execution-context.js.map +1 -0
- package/dist/src/conversation/conversation-manager.d.ts +272 -0
- package/dist/src/conversation/conversation-manager.d.ts.map +1 -0
- package/dist/src/conversation/conversation-manager.js +11 -0
- package/dist/src/conversation/conversation-manager.js.map +1 -0
- package/dist/src/conversation/conversation-pruner.d.ts +190 -0
- package/dist/src/conversation/conversation-pruner.d.ts.map +1 -0
- package/dist/src/conversation/conversation-pruner.js +274 -0
- package/dist/src/conversation/conversation-pruner.js.map +1 -0
- package/dist/src/conversation/conversation-tree.d.ts +185 -0
- package/dist/src/conversation/conversation-tree.d.ts.map +1 -0
- package/dist/src/conversation/conversation-tree.js +288 -0
- package/dist/src/conversation/conversation-tree.js.map +1 -0
- package/dist/src/conversation/file-conversation-store.d.ts +93 -0
- package/dist/src/conversation/file-conversation-store.d.ts.map +1 -0
- package/dist/src/conversation/file-conversation-store.js +284 -0
- package/dist/src/conversation/file-conversation-store.js.map +1 -0
- package/dist/src/conversation/in-memory-conversation-store.d.ts +36 -0
- package/dist/src/conversation/in-memory-conversation-store.d.ts.map +1 -0
- package/dist/src/conversation/in-memory-conversation-store.js +146 -0
- package/dist/src/conversation/in-memory-conversation-store.js.map +1 -0
- package/dist/src/copilot-adapter.d.ts +33 -0
- package/dist/src/copilot-adapter.d.ts.map +1 -0
- package/dist/src/copilot-adapter.js +119 -0
- package/dist/src/copilot-adapter.js.map +1 -0
- package/dist/src/file-trace-enhanced.d.ts +123 -0
- package/dist/src/file-trace-enhanced.d.ts.map +1 -0
- package/dist/src/file-trace-enhanced.js +177 -0
- package/dist/src/file-trace-enhanced.js.map +1 -0
- package/dist/src/file-trace.d.ts +24 -0
- package/dist/src/file-trace.d.ts.map +1 -0
- package/dist/src/file-trace.js +60 -0
- package/dist/src/file-trace.js.map +1 -0
- package/dist/src/index.d.ts +63 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +40 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/json-store.d.ts +27 -0
- package/dist/src/json-store.d.ts.map +1 -0
- package/dist/src/json-store.js +93 -0
- package/dist/src/json-store.js.map +1 -0
- package/dist/src/llm.d.ts +35 -0
- package/dist/src/llm.d.ts.map +1 -0
- package/dist/src/llm.js +2 -0
- package/dist/src/llm.js.map +1 -0
- package/dist/src/memory/cold-storage.d.ts +60 -0
- package/dist/src/memory/cold-storage.d.ts.map +1 -0
- package/dist/src/memory/cold-storage.js +132 -0
- package/dist/src/memory/cold-storage.js.map +1 -0
- package/dist/src/memory/compression.d.ts +161 -0
- package/dist/src/memory/compression.d.ts.map +1 -0
- package/dist/src/memory/compression.js +193 -0
- package/dist/src/memory/compression.js.map +1 -0
- package/dist/src/memory/hot-memory.d.ts +69 -0
- package/dist/src/memory/hot-memory.d.ts.map +1 -0
- package/dist/src/memory/hot-memory.js +116 -0
- package/dist/src/memory/hot-memory.js.map +1 -0
- package/dist/src/memory/memory-budget.d.ts +162 -0
- package/dist/src/memory/memory-budget.d.ts.map +1 -0
- package/dist/src/memory/memory-budget.js +241 -0
- package/dist/src/memory/memory-budget.js.map +1 -0
- package/dist/src/memory/memory-config.d.ts +419 -0
- package/dist/src/memory/memory-config.d.ts.map +1 -0
- package/dist/src/memory/memory-config.js +297 -0
- package/dist/src/memory/memory-config.js.map +1 -0
- package/dist/src/memory/prefetcher.d.ts +137 -0
- package/dist/src/memory/prefetcher.d.ts.map +1 -0
- package/dist/src/memory/prefetcher.js +186 -0
- package/dist/src/memory/prefetcher.js.map +1 -0
- package/dist/src/memory/tiered-memory.d.ts +116 -0
- package/dist/src/memory/tiered-memory.d.ts.map +1 -0
- package/dist/src/memory/tiered-memory.js +215 -0
- package/dist/src/memory/tiered-memory.js.map +1 -0
- package/dist/src/memory/warm-storage.d.ts +74 -0
- package/dist/src/memory/warm-storage.d.ts.map +1 -0
- package/dist/src/memory/warm-storage.js +207 -0
- package/dist/src/memory/warm-storage.js.map +1 -0
- package/dist/src/openai-adapter.d.ts +20 -0
- package/dist/src/openai-adapter.d.ts.map +1 -0
- package/dist/src/openai-adapter.js +73 -0
- package/dist/src/openai-adapter.js.map +1 -0
- package/dist/src/parser.d.ts +27 -0
- package/dist/src/parser.d.ts.map +1 -0
- package/dist/src/parser.js +76 -0
- package/dist/src/parser.js.map +1 -0
- package/dist/src/runtime.d.ts +172 -0
- package/dist/src/runtime.d.ts.map +1 -0
- package/dist/src/runtime.js +436 -0
- package/dist/src/runtime.js.map +1 -0
- package/dist/src/schema-utils.d.ts +7 -0
- package/dist/src/schema-utils.d.ts.map +1 -0
- package/dist/src/schema-utils.js +71 -0
- package/dist/src/schema-utils.js.map +1 -0
- package/dist/src/stage.d.ts +139 -0
- package/dist/src/stage.d.ts.map +1 -0
- package/dist/src/stage.js +2 -0
- package/dist/src/stage.js.map +1 -0
- package/dist/src/store.d.ts +51 -0
- package/dist/src/store.d.ts.map +1 -0
- package/dist/src/store.js +2 -0
- package/dist/src/store.js.map +1 -0
- package/dist/src/tool.d.ts +12 -0
- package/dist/src/tool.d.ts.map +1 -0
- package/dist/src/tool.js +2 -0
- package/dist/src/tool.js.map +1 -0
- package/dist/src/trace.d.ts +60 -0
- package/dist/src/trace.d.ts.map +1 -0
- package/dist/src/trace.js +2 -0
- package/dist/src/trace.js.map +1 -0
- package/dist/src/validator.d.ts +17 -0
- package/dist/src/validator.d.ts.map +1 -0
- package/dist/src/validator.js +21 -0
- package/dist/src/validator.js.map +1 -0
- package/dist/src/workflow.d.ts +192 -0
- package/dist/src/workflow.d.ts.map +1 -0
- package/dist/src/workflow.js +50 -0
- package/dist/src/workflow.js.map +1 -0
- package/package.json +62 -0
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pluggable compression system for warm storage.
|
|
3
|
+
*
|
|
4
|
+
* Provides an adapter interface for different compression algorithms,
|
|
5
|
+
* allowing users to choose between gzip, lz4, or no compression based
|
|
6
|
+
* on their performance and space trade-offs.
|
|
7
|
+
*
|
|
8
|
+
* @module memory/compression
|
|
9
|
+
* @since 2.0.0
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Compression adapter interface.
|
|
13
|
+
*
|
|
14
|
+
* All compression implementations must implement this interface.
|
|
15
|
+
* Compression/decompression work with Node.js Buffer objects.
|
|
16
|
+
*/
|
|
17
|
+
export interface CompressionAdapter {
|
|
18
|
+
/** Name of the compression algorithm */
|
|
19
|
+
name: string;
|
|
20
|
+
/**
|
|
21
|
+
* Compress data.
|
|
22
|
+
*
|
|
23
|
+
* @param data - Uncompressed data buffer
|
|
24
|
+
* @returns Compressed data buffer
|
|
25
|
+
*/
|
|
26
|
+
compress(data: Buffer): Promise<Buffer>;
|
|
27
|
+
/**
|
|
28
|
+
* Decompress data.
|
|
29
|
+
*
|
|
30
|
+
* @param data - Compressed data buffer
|
|
31
|
+
* @returns Decompressed data buffer
|
|
32
|
+
*/
|
|
33
|
+
decompress(data: Buffer): Promise<Buffer>;
|
|
34
|
+
/**
|
|
35
|
+
* Get estimated compression ratio for this algorithm.
|
|
36
|
+
*
|
|
37
|
+
* This is a rough estimate for planning purposes:
|
|
38
|
+
* - 1.0 = no compression
|
|
39
|
+
* - 2.0 = 50% size reduction (typical for text/JSON)
|
|
40
|
+
* - 4.0 = 75% size reduction (highly compressible)
|
|
41
|
+
*
|
|
42
|
+
* @returns Estimated compression ratio (uncompressed / compressed)
|
|
43
|
+
*/
|
|
44
|
+
getEstimatedRatio(): number;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Gzip compression adapter (RFC 1952).
|
|
48
|
+
*
|
|
49
|
+
* Good general-purpose compression with decent ratio and speed.
|
|
50
|
+
* Best for production use cases where space matters.
|
|
51
|
+
*
|
|
52
|
+
* **Performance:**
|
|
53
|
+
* - Compression: ~10-30 MB/s
|
|
54
|
+
* - Decompression: ~50-100 MB/s
|
|
55
|
+
* - Ratio: ~2-4x for JSON/text
|
|
56
|
+
*
|
|
57
|
+
* @since 2.0.0
|
|
58
|
+
*/
|
|
59
|
+
export declare class GzipCompression implements CompressionAdapter {
|
|
60
|
+
name: string;
|
|
61
|
+
compress(data: Buffer): Promise<Buffer>;
|
|
62
|
+
decompress(data: Buffer): Promise<Buffer>;
|
|
63
|
+
getEstimatedRatio(): number;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* LZ4 compression adapter (fast compression).
|
|
67
|
+
*
|
|
68
|
+
* Extremely fast compression/decompression with moderate ratio.
|
|
69
|
+
* Best for latency-sensitive applications where speed > space.
|
|
70
|
+
*
|
|
71
|
+
* **Performance:**
|
|
72
|
+
* - Compression: ~300-500 MB/s
|
|
73
|
+
* - Decompression: ~1-2 GB/s
|
|
74
|
+
* - Ratio: ~1.5-2.5x for JSON/text
|
|
75
|
+
*
|
|
76
|
+
* **Note:** This is a placeholder. Real implementation requires `lz4` package.
|
|
77
|
+
* Install with: `npm install lz4`
|
|
78
|
+
*
|
|
79
|
+
* @since 2.0.0
|
|
80
|
+
*/
|
|
81
|
+
export declare class LZ4Compression implements CompressionAdapter {
|
|
82
|
+
name: string;
|
|
83
|
+
compress(data: Buffer): Promise<Buffer>;
|
|
84
|
+
decompress(data: Buffer): Promise<Buffer>;
|
|
85
|
+
getEstimatedRatio(): number;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* No-compression adapter (passthrough).
|
|
89
|
+
*
|
|
90
|
+
* No compression applied - data passes through unchanged.
|
|
91
|
+
* Best for development or when data is already compressed.
|
|
92
|
+
*
|
|
93
|
+
* **Performance:**
|
|
94
|
+
* - Compression: Memory copy speed (~10 GB/s)
|
|
95
|
+
* - Decompression: Memory copy speed (~10 GB/s)
|
|
96
|
+
* - Ratio: 1.0x (no compression)
|
|
97
|
+
*
|
|
98
|
+
* @since 2.0.0
|
|
99
|
+
*/
|
|
100
|
+
export declare class NoCompression implements CompressionAdapter {
|
|
101
|
+
name: string;
|
|
102
|
+
compress(data: Buffer): Promise<Buffer>;
|
|
103
|
+
decompress(data: Buffer): Promise<Buffer>;
|
|
104
|
+
getEstimatedRatio(): number;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Compression algorithm type (string literal).
|
|
108
|
+
* @since 2.0.0
|
|
109
|
+
*/
|
|
110
|
+
export type CompressionAlgorithm = "gzip" | "lz4" | "none";
|
|
111
|
+
/**
|
|
112
|
+
* Create a compression adapter instance from algorithm name.
|
|
113
|
+
*
|
|
114
|
+
* Factory function that instantiates the appropriate compression adapter
|
|
115
|
+
* based on the algorithm name.
|
|
116
|
+
*
|
|
117
|
+
* @param algorithm - Name of compression algorithm
|
|
118
|
+
* @returns Compression adapter instance
|
|
119
|
+
* @throws {Error} If algorithm name is unknown
|
|
120
|
+
* @since 2.0.0
|
|
121
|
+
*
|
|
122
|
+
* @example
|
|
123
|
+
* ```typescript
|
|
124
|
+
* // Create gzip compressor
|
|
125
|
+
* const gzip = createCompressionAdapter("gzip");
|
|
126
|
+
* const compressed = await gzip.compress(Buffer.from("hello"));
|
|
127
|
+
*
|
|
128
|
+
* // Create no-compression adapter
|
|
129
|
+
* const none = createCompressionAdapter("none");
|
|
130
|
+
* const passthrough = await none.compress(Buffer.from("hello"));
|
|
131
|
+
* ```
|
|
132
|
+
*/
|
|
133
|
+
export declare function createCompressionAdapter(algorithm: CompressionAlgorithm): CompressionAdapter;
|
|
134
|
+
/**
|
|
135
|
+
* Get list of available compression algorithms.
|
|
136
|
+
*
|
|
137
|
+
* @returns Array of algorithm names
|
|
138
|
+
* @since 2.0.0
|
|
139
|
+
*/
|
|
140
|
+
export declare function getAvailableAlgorithms(): CompressionAlgorithm[];
|
|
141
|
+
/**
|
|
142
|
+
* Check if a compression algorithm is available.
|
|
143
|
+
*
|
|
144
|
+
* Some algorithms (like lz4) require optional dependencies.
|
|
145
|
+
* This function checks if the algorithm can be used.
|
|
146
|
+
*
|
|
147
|
+
* @param algorithm - Algorithm name to check
|
|
148
|
+
* @returns Promise resolving to true if available, false otherwise
|
|
149
|
+
* @since 2.0.0
|
|
150
|
+
*
|
|
151
|
+
* @example
|
|
152
|
+
* ```typescript
|
|
153
|
+
* if (await isCompressionAvailable("lz4")) {
|
|
154
|
+
* console.log("LZ4 compression is available");
|
|
155
|
+
* } else {
|
|
156
|
+
* console.log("LZ4 requires 'npm install lz4'");
|
|
157
|
+
* }
|
|
158
|
+
* ```
|
|
159
|
+
*/
|
|
160
|
+
export declare function isCompressionAvailable(algorithm: CompressionAlgorithm): Promise<boolean>;
|
|
161
|
+
//# sourceMappingURL=compression.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compression.d.ts","sourceRoot":"","sources":["../../../src/memory/compression.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAQH;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC,wCAAwC;IACxC,IAAI,EAAE,MAAM,CAAC;IAEb;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,EAAE,MA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AC1C,SAAS,EAAE,oBAAoB,GAC9B,OAAO,CAAC,OAAO,CAAC,CAUlB"}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pluggable compression system for warm storage.
|
|
3
|
+
*
|
|
4
|
+
* Provides an adapter interface for different compression algorithms,
|
|
5
|
+
* allowing users to choose between gzip, lz4, or no compression based
|
|
6
|
+
* on their performance and space trade-offs.
|
|
7
|
+
*
|
|
8
|
+
* @module memory/compression
|
|
9
|
+
* @since 2.0.0
|
|
10
|
+
*/
|
|
11
|
+
import { gzip, gunzip } from "node:zlib";
|
|
12
|
+
import { promisify } from "node:util";
|
|
13
|
+
const gzipAsync = promisify(gzip);
|
|
14
|
+
const gunzipAsync = promisify(gunzip);
|
|
15
|
+
/**
|
|
16
|
+
* Gzip compression adapter (RFC 1952).
|
|
17
|
+
*
|
|
18
|
+
* Good general-purpose compression with decent ratio and speed.
|
|
19
|
+
* Best for production use cases where space matters.
|
|
20
|
+
*
|
|
21
|
+
* **Performance:**
|
|
22
|
+
* - Compression: ~10-30 MB/s
|
|
23
|
+
* - Decompression: ~50-100 MB/s
|
|
24
|
+
* - Ratio: ~2-4x for JSON/text
|
|
25
|
+
*
|
|
26
|
+
* @since 2.0.0
|
|
27
|
+
*/
|
|
28
|
+
export class GzipCompression {
|
|
29
|
+
name = "gzip";
|
|
30
|
+
async compress(data) {
|
|
31
|
+
return gzipAsync(data);
|
|
32
|
+
}
|
|
33
|
+
async decompress(data) {
|
|
34
|
+
return gunzipAsync(data);
|
|
35
|
+
}
|
|
36
|
+
getEstimatedRatio() {
|
|
37
|
+
// Typical compression ratio for JSON/text is 2-4x
|
|
38
|
+
return 3.0;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* LZ4 compression adapter (fast compression).
|
|
43
|
+
*
|
|
44
|
+
* Extremely fast compression/decompression with moderate ratio.
|
|
45
|
+
* Best for latency-sensitive applications where speed > space.
|
|
46
|
+
*
|
|
47
|
+
* **Performance:**
|
|
48
|
+
* - Compression: ~300-500 MB/s
|
|
49
|
+
* - Decompression: ~1-2 GB/s
|
|
50
|
+
* - Ratio: ~1.5-2.5x for JSON/text
|
|
51
|
+
*
|
|
52
|
+
* **Note:** This is a placeholder. Real implementation requires `lz4` package.
|
|
53
|
+
* Install with: `npm install lz4`
|
|
54
|
+
*
|
|
55
|
+
* @since 2.0.0
|
|
56
|
+
*/
|
|
57
|
+
export class LZ4Compression {
|
|
58
|
+
name = "lz4";
|
|
59
|
+
async compress(data) {
|
|
60
|
+
try {
|
|
61
|
+
// Try to load lz4 package (dynamic import to make it optional)
|
|
62
|
+
// @ts-expect-error - lz4 is an optional dependency
|
|
63
|
+
const lz4 = await import("lz4");
|
|
64
|
+
return Buffer.from(lz4.encode(data));
|
|
65
|
+
}
|
|
66
|
+
catch (err) {
|
|
67
|
+
throw new Error("LZ4 compression requires the 'lz4' package. " +
|
|
68
|
+
"Install it with: npm install lz4\n" +
|
|
69
|
+
`Original error: ${err}`);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
async decompress(data) {
|
|
73
|
+
try {
|
|
74
|
+
// Try to load lz4 package (dynamic import to make it optional)
|
|
75
|
+
// @ts-expect-error - lz4 is an optional dependency
|
|
76
|
+
const lz4 = await import("lz4");
|
|
77
|
+
return Buffer.from(lz4.decode(data));
|
|
78
|
+
}
|
|
79
|
+
catch (err) {
|
|
80
|
+
throw new Error("LZ4 decompression requires the 'lz4' package. " +
|
|
81
|
+
"Install it with: npm install lz4\n" +
|
|
82
|
+
`Original error: ${err}`);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
getEstimatedRatio() {
|
|
86
|
+
// LZ4 has lower compression ratio but much faster speed
|
|
87
|
+
return 2.0;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* No-compression adapter (passthrough).
|
|
92
|
+
*
|
|
93
|
+
* No compression applied - data passes through unchanged.
|
|
94
|
+
* Best for development or when data is already compressed.
|
|
95
|
+
*
|
|
96
|
+
* **Performance:**
|
|
97
|
+
* - Compression: Memory copy speed (~10 GB/s)
|
|
98
|
+
* - Decompression: Memory copy speed (~10 GB/s)
|
|
99
|
+
* - Ratio: 1.0x (no compression)
|
|
100
|
+
*
|
|
101
|
+
* @since 2.0.0
|
|
102
|
+
*/
|
|
103
|
+
export class NoCompression {
|
|
104
|
+
name = "none";
|
|
105
|
+
async compress(data) {
|
|
106
|
+
// Return a copy to avoid mutation issues
|
|
107
|
+
return Buffer.from(data);
|
|
108
|
+
}
|
|
109
|
+
async decompress(data) {
|
|
110
|
+
// Return a copy to avoid mutation issues
|
|
111
|
+
return Buffer.from(data);
|
|
112
|
+
}
|
|
113
|
+
getEstimatedRatio() {
|
|
114
|
+
// No compression
|
|
115
|
+
return 1.0;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Create a compression adapter instance from algorithm name.
|
|
120
|
+
*
|
|
121
|
+
* Factory function that instantiates the appropriate compression adapter
|
|
122
|
+
* based on the algorithm name.
|
|
123
|
+
*
|
|
124
|
+
* @param algorithm - Name of compression algorithm
|
|
125
|
+
* @returns Compression adapter instance
|
|
126
|
+
* @throws {Error} If algorithm name is unknown
|
|
127
|
+
* @since 2.0.0
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* ```typescript
|
|
131
|
+
* // Create gzip compressor
|
|
132
|
+
* const gzip = createCompressionAdapter("gzip");
|
|
133
|
+
* const compressed = await gzip.compress(Buffer.from("hello"));
|
|
134
|
+
*
|
|
135
|
+
* // Create no-compression adapter
|
|
136
|
+
* const none = createCompressionAdapter("none");
|
|
137
|
+
* const passthrough = await none.compress(Buffer.from("hello"));
|
|
138
|
+
* ```
|
|
139
|
+
*/
|
|
140
|
+
export function createCompressionAdapter(algorithm) {
|
|
141
|
+
switch (algorithm) {
|
|
142
|
+
case "gzip":
|
|
143
|
+
return new GzipCompression();
|
|
144
|
+
case "lz4":
|
|
145
|
+
return new LZ4Compression();
|
|
146
|
+
case "none":
|
|
147
|
+
return new NoCompression();
|
|
148
|
+
default:
|
|
149
|
+
throw new Error(`Unknown compression algorithm: "${algorithm}". ` +
|
|
150
|
+
`Valid options: gzip, lz4, none`);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Get list of available compression algorithms.
|
|
155
|
+
*
|
|
156
|
+
* @returns Array of algorithm names
|
|
157
|
+
* @since 2.0.0
|
|
158
|
+
*/
|
|
159
|
+
export function getAvailableAlgorithms() {
|
|
160
|
+
return ["gzip", "lz4", "none"];
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Check if a compression algorithm is available.
|
|
164
|
+
*
|
|
165
|
+
* Some algorithms (like lz4) require optional dependencies.
|
|
166
|
+
* This function checks if the algorithm can be used.
|
|
167
|
+
*
|
|
168
|
+
* @param algorithm - Algorithm name to check
|
|
169
|
+
* @returns Promise resolving to true if available, false otherwise
|
|
170
|
+
* @since 2.0.0
|
|
171
|
+
*
|
|
172
|
+
* @example
|
|
173
|
+
* ```typescript
|
|
174
|
+
* if (await isCompressionAvailable("lz4")) {
|
|
175
|
+
* console.log("LZ4 compression is available");
|
|
176
|
+
* } else {
|
|
177
|
+
* console.log("LZ4 requires 'npm install lz4'");
|
|
178
|
+
* }
|
|
179
|
+
* ```
|
|
180
|
+
*/
|
|
181
|
+
export async function isCompressionAvailable(algorithm) {
|
|
182
|
+
try {
|
|
183
|
+
const adapter = createCompressionAdapter(algorithm);
|
|
184
|
+
// Try a small compression to verify it works
|
|
185
|
+
const testData = Buffer.from("test");
|
|
186
|
+
await adapter.compress(testData);
|
|
187
|
+
return true;
|
|
188
|
+
}
|
|
189
|
+
catch {
|
|
190
|
+
return false;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
//# sourceMappingURL=compression.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compression.js","sourceRoot":"","sources":["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C,SAA+B;IAE/B,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,wBAAwB,CAAC,SAAS,CAAC,CAAC;QACpD,6CAA6C;QAC7C,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACrC,MAAM,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACjC,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration for hot memory (in-memory cache).
|
|
3
|
+
*/
|
|
4
|
+
export interface HotMemoryConfig {
|
|
5
|
+
/** Maximum number of items (default: 1000) */
|
|
6
|
+
maxItems?: number;
|
|
7
|
+
/** Maximum memory size in bytes (default: 100MB) */
|
|
8
|
+
maxSize?: number;
|
|
9
|
+
/** Time-to-live in milliseconds (default: 1 hour) */
|
|
10
|
+
ttl?: number;
|
|
11
|
+
/** Callback when an item is evicted */
|
|
12
|
+
onEvict?: (key: string, value: unknown) => void | Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Statistics for hot memory usage.
|
|
16
|
+
*/
|
|
17
|
+
export interface HotMemoryStats {
|
|
18
|
+
itemCount: number;
|
|
19
|
+
estimatedSize: number;
|
|
20
|
+
hitCount: number;
|
|
21
|
+
missCount: number;
|
|
22
|
+
evictionCount: number;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Hot memory layer using LRU cache with size limits and TTL.
|
|
26
|
+
* Evicts least-recently-used items when limits are reached.
|
|
27
|
+
*/
|
|
28
|
+
export declare class HotMemory {
|
|
29
|
+
private cache;
|
|
30
|
+
private sizeMap;
|
|
31
|
+
private totalSize;
|
|
32
|
+
private hitCount;
|
|
33
|
+
private missCount;
|
|
34
|
+
private evictionCount;
|
|
35
|
+
private config;
|
|
36
|
+
constructor(config?: HotMemoryConfig);
|
|
37
|
+
/**
|
|
38
|
+
* Get a value from hot memory.
|
|
39
|
+
* Returns undefined if not found or expired.
|
|
40
|
+
*/
|
|
41
|
+
get<T>(key: string): T | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Set a value in hot memory.
|
|
44
|
+
* May trigger eviction if size or count limits are exceeded.
|
|
45
|
+
*/
|
|
46
|
+
set<T>(key: string, value: T): void;
|
|
47
|
+
/**
|
|
48
|
+
* Check if a key exists in hot memory.
|
|
49
|
+
*/
|
|
50
|
+
has(key: string): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Delete a value from hot memory.
|
|
53
|
+
*/
|
|
54
|
+
delete(key: string): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Clear all items from hot memory.
|
|
57
|
+
*/
|
|
58
|
+
clear(): void;
|
|
59
|
+
/**
|
|
60
|
+
* Get statistics about hot memory usage.
|
|
61
|
+
*/
|
|
62
|
+
stats(): HotMemoryStats;
|
|
63
|
+
/**
|
|
64
|
+
* Estimate the memory size of a value in bytes.
|
|
65
|
+
* This is a rough approximation for tracking purposes.
|
|
66
|
+
*/
|
|
67
|
+
private estimateSize;
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=hot-memory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hot-memory.d.ts","sourceRoot":"","sources":["../../../src/memory/hot-memory.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qDAAqD;IACrD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,uCAAuC;IACvC,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACjE;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,qBAAa,SAAS;IACpB,OAAO,CAAC,KAAK,CAAwB;IACrC,OAAO,CAAC,OAAO,CAAkC;IACjD,OAAO,CAAC,SAAS,CAAK;IACtB,OAAO,CAAC,QAAQ,CAAK;IACrB,OAAO,CAAC,SAAS,CAAK;IACtB,OAAO,CAAC,aAAa,CAAK;IAC1B,OAAO,CAAC,MAAM,CAA4B;gBAE9B,MAAM,GAAE,eAAoB;IAwBxC;;;OAGG;IACH,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;IAUlC;;;OAGG;IACH,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI;IA+BnC;;OAEG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAIzB;;OAEG;IACH,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAI5B;;OAEG;IACH,KAAK,IAAI,IAAI;IAMb;;OAEG;IACH,KAAK,IAAI,cAAc;IAUvB;;;OAGG;IACH,OAAO,CAAC,YAAY;CAKrB"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { LRUCache } from "lru-cache";
|
|
2
|
+
/**
|
|
3
|
+
* Hot memory layer using LRU cache with size limits and TTL.
|
|
4
|
+
* Evicts least-recently-used items when limits are reached.
|
|
5
|
+
*/
|
|
6
|
+
export class HotMemory {
|
|
7
|
+
cache;
|
|
8
|
+
sizeMap = new Map();
|
|
9
|
+
totalSize = 0;
|
|
10
|
+
hitCount = 0;
|
|
11
|
+
missCount = 0;
|
|
12
|
+
evictionCount = 0;
|
|
13
|
+
config;
|
|
14
|
+
constructor(config = {}) {
|
|
15
|
+
this.config = {
|
|
16
|
+
maxItems: config.maxItems ?? 1000,
|
|
17
|
+
maxSize: config.maxSize ?? 100 * 1024 * 1024, // 100MB
|
|
18
|
+
ttl: config.ttl ?? 60 * 60 * 1000, // 1 hour
|
|
19
|
+
onEvict: config.onEvict ?? (() => { }),
|
|
20
|
+
};
|
|
21
|
+
this.cache = new LRUCache({
|
|
22
|
+
max: this.config.maxItems,
|
|
23
|
+
ttl: this.config.ttl,
|
|
24
|
+
dispose: (value, key) => {
|
|
25
|
+
// Clean up size tracking
|
|
26
|
+
const size = this.sizeMap.get(key) ?? 0;
|
|
27
|
+
this.totalSize -= size;
|
|
28
|
+
this.sizeMap.delete(key);
|
|
29
|
+
this.evictionCount++;
|
|
30
|
+
// Call user callback
|
|
31
|
+
void this.config.onEvict(key, value);
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Get a value from hot memory.
|
|
37
|
+
* Returns undefined if not found or expired.
|
|
38
|
+
*/
|
|
39
|
+
get(key) {
|
|
40
|
+
const value = this.cache.get(key);
|
|
41
|
+
if (value === undefined) {
|
|
42
|
+
this.missCount++;
|
|
43
|
+
return undefined;
|
|
44
|
+
}
|
|
45
|
+
this.hitCount++;
|
|
46
|
+
return value;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Set a value in hot memory.
|
|
50
|
+
* May trigger eviction if size or count limits are exceeded.
|
|
51
|
+
*/
|
|
52
|
+
set(key, value) {
|
|
53
|
+
const size = this.estimateSize(value);
|
|
54
|
+
// Check if adding this item would exceed size limit
|
|
55
|
+
if (size > this.config.maxSize) {
|
|
56
|
+
throw new Error(`Item size (${size} bytes) exceeds max hot memory size (${this.config.maxSize} bytes)`);
|
|
57
|
+
}
|
|
58
|
+
// Evict items if necessary to make room
|
|
59
|
+
while (this.totalSize + size > this.config.maxSize &&
|
|
60
|
+
this.cache.size > 0) {
|
|
61
|
+
// Evict oldest item
|
|
62
|
+
const oldestKey = this.cache.keys().next().value;
|
|
63
|
+
if (oldestKey) {
|
|
64
|
+
this.cache.delete(oldestKey);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
// Update size tracking
|
|
68
|
+
const oldSize = this.sizeMap.get(key) ?? 0;
|
|
69
|
+
this.totalSize = this.totalSize - oldSize + size;
|
|
70
|
+
this.sizeMap.set(key, size);
|
|
71
|
+
// Store in cache
|
|
72
|
+
this.cache.set(key, value);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Check if a key exists in hot memory.
|
|
76
|
+
*/
|
|
77
|
+
has(key) {
|
|
78
|
+
return this.cache.has(key);
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Delete a value from hot memory.
|
|
82
|
+
*/
|
|
83
|
+
delete(key) {
|
|
84
|
+
return this.cache.delete(key);
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Clear all items from hot memory.
|
|
88
|
+
*/
|
|
89
|
+
clear() {
|
|
90
|
+
this.cache.clear();
|
|
91
|
+
this.sizeMap.clear();
|
|
92
|
+
this.totalSize = 0;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Get statistics about hot memory usage.
|
|
96
|
+
*/
|
|
97
|
+
stats() {
|
|
98
|
+
return {
|
|
99
|
+
itemCount: this.cache.size,
|
|
100
|
+
estimatedSize: this.totalSize,
|
|
101
|
+
hitCount: this.hitCount,
|
|
102
|
+
missCount: this.missCount,
|
|
103
|
+
evictionCount: this.evictionCount,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Estimate the memory size of a value in bytes.
|
|
108
|
+
* This is a rough approximation for tracking purposes.
|
|
109
|
+
*/
|
|
110
|
+
estimateSize(value) {
|
|
111
|
+
const json = JSON.stringify(value);
|
|
112
|
+
// UTF-16 encoding: 2 bytes per character
|
|
113
|
+
return json.length * 2;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
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