@mastra/valkey-streams 0.0.0-fix-knowledge-inspector-org-scope-20260903035938

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/LICENSE.md ADDED
@@ -0,0 +1,32 @@
1
+ Portions of this software are licensed as follows:
2
+
3
+ - All content that resides under any directory named `ee/` within this
4
+ repository, including but not limited to:
5
+ - `@mastra/core/auth/ee`
6
+ - `@mastra/core/agent-builder/ee`
7
+ - `@mastra/editor/ee`
8
+
9
+ is licensed under the license defined in [`ee/LICENSE`](https://github.com/mastra-ai/mastra/blob/main/ee/LICENSE).
10
+
11
+ - All third-party components incorporated into the Mastra Software are
12
+ licensed under the original license provided by the owner of the
13
+ applicable component.
14
+
15
+ - Content outside of the above-mentioned directories or restrictions is
16
+ available under the "Apache License 2.0" as defined below.
17
+
18
+ # Apache License 2.0
19
+
20
+ Copyright (c) 2025 Kepler Software, Inc.
21
+
22
+ Licensed under the Apache License, Version 2.0 (the "License");
23
+ you may not use this file except in compliance with the License.
24
+ You may obtain a copy of the License at
25
+
26
+ http://www.apache.org/licenses/LICENSE-2.0
27
+
28
+ Unless required by applicable law or agreed to in writing, software
29
+ distributed under the License is distributed on an "AS IS" BASIS,
30
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31
+ See the License for the specific language governing permissions and
32
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,35 @@
1
+ # @mastra/valkey-streams
2
+
3
+ `ValkeyStreamsPubSub` implements Mastra's PubSub and lease-provider contracts with Valkey Streams through Valkey GLIDE. Use it for durable event delivery and distributed workflow coordination when your infrastructure is built on Valkey.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @mastra/valkey-streams
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```typescript
14
+ import { Mastra } from '@mastra/core/mastra';
15
+ import { ValkeyStreamsPubSub } from '@mastra/valkey-streams';
16
+
17
+ export const mastra = new Mastra({
18
+ pubsub: new ValkeyStreamsPubSub({
19
+ url: process.env.VALKEY_URL!,
20
+ keyPrefix: 'mastra:my-app',
21
+ }),
22
+ });
23
+ ```
24
+
25
+ ## Documentation
26
+
27
+ - [Reference: ValkeyStreamsPubSub](https://mastra.ai/reference/pubsub/valkey-streams)
28
+
29
+ ## Changelog
30
+
31
+ See the [package changelog](https://github.com/mastra-ai/mastra/blob/main/pubsub/valkey-streams/CHANGELOG.md) for version history and release notes.
32
+
33
+ ## Support
34
+
35
+ We have an [open community Discord](https://discord.gg/mastra-ai). Come and say hello and let us know if you have any questions or need any help getting things running.
@@ -0,0 +1,83 @@
1
+ import { GlideClient, type GlideClientConfiguration, type GlideString } from '@valkey/valkey-glide';
2
+ export type ValkeyClientOptions = Omit<Partial<GlideClientConfiguration>, 'addresses'> & {
3
+ url?: string;
4
+ addresses?: GlideClientConfiguration['addresses'];
5
+ };
6
+ type StreamMessage = {
7
+ id: string;
8
+ message: Record<string, string>;
9
+ };
10
+ type StreamReply = {
11
+ name: string;
12
+ messages: StreamMessage[];
13
+ };
14
+ declare class ValkeyMulti {
15
+ #private;
16
+ private readonly getClient;
17
+ constructor(getClient: () => Promise<GlideClient>);
18
+ xAdd(key: string, id: string, fields: Record<string, string>, options?: {
19
+ TRIM?: {
20
+ threshold: number;
21
+ };
22
+ }): this;
23
+ pExpire(key: string, ttl: number): this;
24
+ xGroupCreate(key: string, group: string, id: string, options?: {
25
+ MKSTREAM?: boolean;
26
+ }): this;
27
+ exec(): Promise<unknown[]>;
28
+ }
29
+ export declare class ValkeyStreamsClient {
30
+ #private;
31
+ private readonly options;
32
+ constructor(options: ValkeyClientOptions);
33
+ get isOpen(): boolean;
34
+ on(_event: 'error', _listener: (error: unknown) => void): this;
35
+ connect(): Promise<void>;
36
+ quit(): Promise<void>;
37
+ multi(): ValkeyMulti;
38
+ command(args: GlideString[]): Promise<import("@valkey/valkey-glide").GlideReturnType>;
39
+ xAdd(key: string, id: string, fields: Record<string, string>, options?: {
40
+ TRIM?: {
41
+ threshold: number;
42
+ };
43
+ }): Promise<string>;
44
+ pExpire(key: string, ttl: number): Promise<number>;
45
+ xGroupCreate(key: string, group: string, id: string, options?: {
46
+ MKSTREAM?: boolean;
47
+ }): Promise<"OK">;
48
+ xGroupDestroy(key: string, group: string): Promise<number>;
49
+ xReadGroup(group: string, consumer: string, streams: Array<{
50
+ key: string;
51
+ id: string;
52
+ }>, options?: {
53
+ COUNT?: number;
54
+ BLOCK?: number;
55
+ }): Promise<StreamReply[] | null>;
56
+ xAutoClaim(key: string, group: string, consumer: string, minIdle: number, start: string, options?: {
57
+ COUNT?: number;
58
+ }): Promise<{
59
+ nextId: string;
60
+ messages: {
61
+ id: string;
62
+ message: {
63
+ [k: string]: string;
64
+ };
65
+ }[];
66
+ }>;
67
+ xAck(key: string, group: string, id: string): Promise<number>;
68
+ del(key: string): Promise<number>;
69
+ set(key: string, value: string, options?: {
70
+ NX?: boolean;
71
+ PX?: number;
72
+ }): Promise<string | null>;
73
+ get(key: string): Promise<string | null>;
74
+ eval(script: string, options: {
75
+ keys: string[];
76
+ arguments: string[];
77
+ }): Promise<number>;
78
+ private getClient;
79
+ }
80
+ export declare const createClient: (options: ValkeyClientOptions) => ValkeyStreamsClient;
81
+ export type ValkeyClientType = ValkeyStreamsClient;
82
+ export {};
83
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,WAAW,EAAE,KAAK,wBAAwB,EAAE,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEpH,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,OAAO,CAAC,wBAAwB,CAAC,EAAE,WAAW,CAAC,GAAG;IACvF,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,wBAAwB,CAAC,WAAW,CAAC,CAAC;CACnD,CAAC;AAEF,KAAK,aAAa,GAAG;IA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