@skaile/connector-redis 0.0.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 ADDED
@@ -0,0 +1,5 @@
1
+ # @skaile/connector-redis
2
+
3
+ ## 0.1.0
4
+
5
+ - Initial release.
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Skaile
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,58 @@
1
+ # @skaile/connector-redis
2
+
3
+ A [Redis](https://redis.io/) (KeyDB / Valkey) connector for
4
+ [`@skaile/workspaces`](https://www.npmjs.com/package/@skaile/workspaces). It
5
+ exposes a key-value store to the agent through the connector tool face:
6
+ `get` / `set` / `keys` / `del` / `ttl` / `info`.
7
+
8
+ This connector ships separately so the core runtime no longer bundles
9
+ `ioredis`. Install it as a plugin when you need Redis.
10
+
11
+ ## Install
12
+
13
+ ```bash
14
+ skaile plugin install @skaile/connector-redis
15
+ ```
16
+
17
+ Add it to `skaile.yaml`:
18
+
19
+ ```yaml
20
+ plugins:
21
+ - "@skaile/connector-redis@^0.1.0"
22
+
23
+ connectors:
24
+ - id: cache
25
+ driver: redis
26
+ access: read-write
27
+ auth: env:REDIS_URL
28
+ options:
29
+ namespace: myapp
30
+ ```
31
+
32
+ ## Config / auth
33
+
34
+ | Field | Where | Notes |
35
+ |---|---|---|
36
+ | `url` | `auth` (e.g. `env:REDIS_URL`) or `options.url` | Redis connection URL, e.g. `redis://localhost:6379`. Required. |
37
+ | `namespace` | `options.namespace` | Optional key prefix applied to all operations. |
38
+
39
+ The connection URL is resolved from `ctx.resolvedFields.url`, then the
40
+ declaration `auth` ref via the secrets chain, then `options.url`.
41
+
42
+ ## Operations
43
+
44
+ | Operation | Access | Description |
45
+ |---|---|---|
46
+ | `get` | read | Get value by key |
47
+ | `set` | write | Set a key-value pair with optional TTL |
48
+ | `keys` | read | List keys matching a glob pattern |
49
+ | `del` | write | Delete one or more keys |
50
+ | `ttl` | read | Get remaining time-to-live for a key |
51
+ | `info` | read | Get Redis server info |
52
+
53
+ ## How it works
54
+
55
+ - Lazily imports `ioredis` at connect time, so the dependency is only loaded
56
+ when a Redis connector is actually used.
57
+ - Registers a `redis` connector target into the unified `pluginRegistry` via the
58
+ exported `register(registry)`.
@@ -0,0 +1,57 @@
1
+ import { ConnectorTarget, PluginRegistry } from '@skaile/workspaces/plugin-registry';
2
+ import { AbstractConnector, ToolFace, ConnectorFieldSpec, ConnectorDeclaration, ConnectContext, ConnectorHandle } from '@skaile/workspaces/connectors';
3
+
4
+ /**
5
+ * RedisConnector — Redis/KeyDB/Valkey key-value store resource.
6
+ * Not mountable. Custom operations: get, set, keys, del, ttl, info.
7
+ *
8
+ * Requires `ioredis` (a runtime dependency of this package).
9
+ */
10
+
11
+ /**
12
+ * Connector for Redis, KeyDB, and Valkey key-value stores.
13
+ * Provides get, set, keys, del, ttl, and info operations. Requires the `ioredis` package.
14
+ */
15
+ declare class RedisConnector extends AbstractConnector {
16
+ readonly name = "redis";
17
+ tools: ToolFace;
18
+ constructor();
19
+ describeFields(): ConnectorFieldSpec[];
20
+ private _describeSkill;
21
+ connect(declaration: ConnectorDeclaration, ctx: ConnectContext): Promise<ConnectorHandle>;
22
+ disconnect(handle: ConnectorHandle): Promise<void>;
23
+ private client;
24
+ private nsKey;
25
+ private stripNs;
26
+ private _read;
27
+ private _write;
28
+ private _delete;
29
+ private _list;
30
+ private _search;
31
+ private _describeOperations;
32
+ private _executeOp;
33
+ }
34
+ /**
35
+ * Creates a new RedisConnector instance.
36
+ * @returns Configured RedisConnector ready to be registered in the connector registry.
37
+ */
38
+ declare function createConnector(): RedisConnector;
39
+ /**
40
+ * Plugin-registry target wrapping the Redis connector factory. Connectors take
41
+ * no construct-time config, so `configSchema` is a passthrough and `create()`
42
+ * returns a fresh instance; lifecycle config arrives via `Connector.connect()`.
43
+ */
44
+ declare const redisConnectorTarget: ConnectorTarget;
45
+
46
+ /**
47
+ * `@skaile/connector-redis` — Redis connector for `@skaile/workspaces`.
48
+ *
49
+ * Install via `skaile plugin install @skaile/connector-redis`; the plugin
50
+ * loader calls `register(pluginRegistry)` at startup so `redis` becomes
51
+ * resolvable as a connector driver.
52
+ */
53
+
54
+ /** Register this plugin's connector target with a registry. */
55
+ declare function register(registry: PluginRegistry): void;
56
+
57
+ export { RedisConnector, createConnector, redisConnectorTarget, register };
package/dist/index.js ADDED
@@ -0,0 +1,278 @@
1
+ // src/target.ts
2
+ import { resolveAuth, AbstractConnector } from "@skaile/workspaces/connectors";
3
+ import * as z from "zod";
4
+ var RedisConnector = class extends AbstractConnector {
5
+ name = "redis";
6
+ tools;
7
+ constructor() {
8
+ super();
9
+ this.tools = {
10
+ read: (handle, path) => this._read(handle, path),
11
+ write: (handle, path, content) => this._write(handle, path, content),
12
+ delete: (handle, path) => this._delete(handle, path),
13
+ list: (handle, path, options) => this._list(handle, path, options),
14
+ search: (handle, query, options) => this._search(handle, query, options),
15
+ describeOperations: (handle) => this._describeOperations(handle),
16
+ executeOp: (handle, operation, args) => this._executeOp(handle, operation, args),
17
+ describeSkill: (handle, declaration) => this._describeSkill(handle, declaration)
18
+ };
19
+ }
20
+ describeFields() {
21
+ return [
22
+ {
23
+ key: "url",
24
+ label: "Redis URL",
25
+ description: "Redis connection URL (e.g. redis://localhost:6379)",
26
+ type: "url",
27
+ required: true,
28
+ sensitive: true,
29
+ group: "Authentication"
30
+ }
31
+ ];
32
+ }
33
+ _describeSkill(_handle, declaration) {
34
+ const url = String(declaration.options?.url ?? "");
35
+ let hostLabel = declaration.id;
36
+ try {
37
+ hostLabel = new URL(url).hostname;
38
+ } catch {
39
+ }
40
+ return {
41
+ id: declaration.id,
42
+ name: `Redis \u2014 ${hostLabel}`,
43
+ description: `Key-value store at ${hostLabel}`,
44
+ category: "kv",
45
+ access: declaration.access,
46
+ toolNames: ["get", "keys", "ttl", "info"]
47
+ };
48
+ }
49
+ async connect(declaration, ctx) {
50
+ const started = Date.now();
51
+ const url = ctx.resolvedFields?.url ?? resolveAuth(declaration.auth, ctx.secrets) ?? String(declaration.options?.url ?? "");
52
+ if (!url) {
53
+ this.log.error("connect failed: missing url", void 0);
54
+ throw new Error("RedisAdapter requires auth (URL) or options.url");
55
+ }
56
+ let host = "(unknown)";
57
+ try {
58
+ host = new URL(url).hostname;
59
+ } catch {
60
+ }
61
+ this.log.info("connect start", { host });
62
+ try {
63
+ const ioredisPkg = "ioredis";
64
+ const mod = await import(
65
+ /* @vite-ignore */
66
+ ioredisPkg
67
+ );
68
+ const Redis = mod.default ?? mod.Redis ?? mod;
69
+ const client = new Redis(url, { lazyConnect: true, maxRetriesPerRequest: 2 });
70
+ await client.connect();
71
+ const namespace = String(declaration.options?.namespace ?? "");
72
+ this.log.info("connect ok", { host, durationMs: Date.now() - started });
73
+ return this.makeHandle(declaration, { client, namespace });
74
+ } catch (err) {
75
+ this.log.error("connect failed", err, { host });
76
+ throw err;
77
+ }
78
+ }
79
+ async disconnect(handle) {
80
+ this.log.info("disconnect");
81
+ const { client } = handle.state;
82
+ await client.quit();
83
+ handle.status = "disconnected";
84
+ }
85
+ client(handle) {
86
+ return handle.state.client;
87
+ }
88
+ nsKey(handle, key) {
89
+ const ns = handle.state.namespace;
90
+ return ns ? `${ns}:${key}` : key;
91
+ }
92
+ stripNs(handle, key) {
93
+ const ns = handle.state.namespace;
94
+ return ns && key.startsWith(`${ns}:`) ? key.slice(ns.length + 1) : key;
95
+ }
96
+ async _read(handle, path) {
97
+ const value = await this.client(handle).get(this.nsKey(handle, path));
98
+ if (value === null) return null;
99
+ return { data: value, contentType: "application/json" };
100
+ }
101
+ async _write(handle, path, content) {
102
+ const data = typeof content.data === "string" ? content.data : content.data.toString("utf-8");
103
+ await this.client(handle).set(this.nsKey(handle, path), data);
104
+ }
105
+ async _delete(handle, path) {
106
+ const count = await this.client(handle).del(this.nsKey(handle, path));
107
+ return count > 0;
108
+ }
109
+ async _list(handle, path, options) {
110
+ const ns = handle.state.namespace;
111
+ const pattern = path ? this.nsKey(handle, path.endsWith("*") ? path : `${path}*`) : ns ? `${ns}:*` : "*";
112
+ const keys = [];
113
+ let cursor = "0";
114
+ const limit = options?.limit ?? 1e3;
115
+ do {
116
+ const [next, batch] = await this.client(handle).scan(cursor, "MATCH", pattern, "COUNT", 100);
117
+ cursor = next;
118
+ keys.push(...batch);
119
+ if (keys.length >= limit) break;
120
+ } while (cursor !== "0");
121
+ return keys.slice(0, limit).map((k) => ({
122
+ name: this.stripNs(handle, k),
123
+ path: this.stripNs(handle, k),
124
+ type: "key"
125
+ }));
126
+ }
127
+ async _search(handle, query, options) {
128
+ const entries = await this._list(handle, void 0, { limit: options?.maxResults ?? 100 });
129
+ const results = [];
130
+ for (const entry of entries) {
131
+ if (options?.maxResults && results.length >= options.maxResults) break;
132
+ if (entry.name.includes(query)) {
133
+ results.push({ path: entry.name });
134
+ continue;
135
+ }
136
+ const value = await this.client(handle).get(this.nsKey(handle, entry.name));
137
+ if (value?.includes(query)) {
138
+ results.push({ path: entry.name, snippet: value.slice(0, 200) });
139
+ }
140
+ }
141
+ return results;
142
+ }
143
+ _describeOperations(handle) {
144
+ const ops = [
145
+ {
146
+ name: "get",
147
+ description: "Get value by key.",
148
+ accessLevel: "read",
149
+ args: [{ name: "key", type: "string", required: true, description: "Redis key" }],
150
+ examples: ['get --key "config:theme"']
151
+ },
152
+ {
153
+ name: "keys",
154
+ description: "List keys matching a glob pattern.",
155
+ accessLevel: "read",
156
+ args: [
157
+ {
158
+ name: "pattern",
159
+ type: "string",
160
+ required: false,
161
+ description: "Glob pattern (default: *)"
162
+ }
163
+ ],
164
+ examples: ["keys", 'keys --pattern "user:*"']
165
+ },
166
+ {
167
+ name: "ttl",
168
+ description: "Get remaining time-to-live for a key (seconds, -1 if no expiry, -2 if key does not exist).",
169
+ accessLevel: "read",
170
+ args: [{ name: "key", type: "string", required: true, description: "Redis key" }]
171
+ },
172
+ {
173
+ name: "info",
174
+ description: "Get Redis server info (memory, clients, keyspace stats).",
175
+ accessLevel: "read",
176
+ args: [
177
+ {
178
+ name: "section",
179
+ type: "string",
180
+ required: false,
181
+ description: "Info section (memory, clients, keyspace, all)"
182
+ }
183
+ ]
184
+ }
185
+ ];
186
+ if (handle.access === "read-write") {
187
+ ops.push(
188
+ {
189
+ name: "set",
190
+ description: "Set a key-value pair with optional TTL.",
191
+ accessLevel: "write",
192
+ args: [
193
+ { name: "key", type: "string", required: true, description: "Redis key" },
194
+ { name: "value", type: "string", required: true, description: "Value to store" },
195
+ { name: "ttl", type: "number", required: false, description: "Expiry in seconds" }
196
+ ],
197
+ examples: [
198
+ 'set --key "status" --value "running"',
199
+ 'set --key "cache:token" --value "abc" --ttl 3600'
200
+ ]
201
+ },
202
+ {
203
+ name: "del",
204
+ description: "Delete one or more keys.",
205
+ accessLevel: "write",
206
+ args: [{ name: "key", type: "string", required: true, description: "Key to delete" }],
207
+ examples: ['del --key "temp:session"']
208
+ }
209
+ );
210
+ }
211
+ return ops;
212
+ }
213
+ async _executeOp(handle, operation, args) {
214
+ const client = this.client(handle);
215
+ switch (operation) {
216
+ case "get": {
217
+ const key = String(args.key ?? args._positional ?? "");
218
+ const value = await client.get(this.nsKey(handle, key));
219
+ return value ?? "";
220
+ }
221
+ case "set": {
222
+ const key = String(args.key ?? "");
223
+ const value = String(args.value ?? "");
224
+ const fullKey = this.nsKey(handle, key);
225
+ if (args.ttl) {
226
+ await client.set(fullKey, value, "EX", Number(args.ttl));
227
+ } else {
228
+ await client.set(fullKey, value);
229
+ }
230
+ return "OK";
231
+ }
232
+ case "keys": {
233
+ const pattern = args.pattern ? String(args.pattern) : "*";
234
+ const entries = await this._list(handle, pattern.endsWith("*") ? pattern : `${pattern}*`);
235
+ return JSON.stringify(entries.map((e) => e.name));
236
+ }
237
+ case "del": {
238
+ const key = String(args.key ?? args._positional ?? "");
239
+ const count = await client.del(this.nsKey(handle, key));
240
+ return count > 0 ? "Deleted" : "Not found";
241
+ }
242
+ case "ttl": {
243
+ const key = String(args.key ?? args._positional ?? "");
244
+ const ttl = await client.ttl(this.nsKey(handle, key));
245
+ return String(ttl);
246
+ }
247
+ case "info": {
248
+ const section = args.section ? String(args.section) : void 0;
249
+ const info = section ? await client.info(section) : await client.info();
250
+ return info;
251
+ }
252
+ default:
253
+ throw new Error(`RedisAdapter has no operation: ${operation}`);
254
+ }
255
+ }
256
+ };
257
+ function createConnector() {
258
+ return new RedisConnector();
259
+ }
260
+ var redisConnectorTarget = {
261
+ id: "redis",
262
+ displayName: "Redis",
263
+ apiVersion: 1,
264
+ configSchema: z.unknown(),
265
+ create: (_config, _ctx) => new RedisConnector()
266
+ };
267
+
268
+ // src/index.ts
269
+ function register(registry) {
270
+ registry.register("connector", redisConnectorTarget);
271
+ }
272
+ export {
273
+ RedisConnector,
274
+ createConnector,
275
+ redisConnectorTarget,
276
+ register
277
+ };
278
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/target.ts","../src/index.ts"],"sourcesContent":["/**\n * RedisConnector — Redis/KeyDB/Valkey key-value store resource.\n * Not mountable. Custom operations: get, set, keys, del, ttl, info.\n *\n * Requires `ioredis` (a runtime dependency of this package).\n */\n\nimport { resolveAuth, AbstractConnector } from \"@skaile/workspaces/connectors\";\nimport type {\n ConnectContext,\n ConnectorDeclaration,\n ConnectorFieldSpec,\n ConnectorHandle,\n OperationDescriptor,\n RuntimeSkillDescriptor,\n ToolFace,\n} from \"@skaile/workspaces/connectors\";\nimport type {\n ConnectorContent,\n ConnectorEntry,\n ListOptions,\n SearchOptions,\n SearchResult,\n} from \"@skaile/workspaces/connectors\";\nimport type { ConnectorTarget } from \"@skaile/workspaces/plugin-registry\";\nimport * as z from \"zod\";\n\ninterface RedisState {\n client: any; // ioredis instance\n namespace: string;\n}\n\n/**\n * Connector for Redis, KeyDB, and Valkey key-value stores.\n * Provides get, set, keys, del, ttl, and info operations. Requires the `ioredis` package.\n */\nexport class RedisConnector extends AbstractConnector {\n readonly name = \"redis\";\n\n tools: ToolFace;\n\n constructor() {\n super();\n this.tools = {\n read: (handle, path) => this._read(handle, path),\n write: (handle, path, content) => this._write(handle, path, content),\n delete: (handle, path) => this._delete(handle, path),\n list: (handle, path, options) => this._list(handle, path, options),\n search: (handle, query, options) => this._search(handle, query, options),\n describeOperations: (handle) => this._describeOperations(handle),\n executeOp: (handle, operation, args) => this._executeOp(handle, operation, args),\n describeSkill: (handle, declaration) => this._describeSkill(handle, declaration),\n };\n }\n\n describeFields(): ConnectorFieldSpec[] {\n return [\n {\n key: \"url\",\n label: \"Redis URL\",\n description: \"Redis connection URL (e.g. redis://localhost:6379)\",\n type: \"url\",\n required: true,\n sensitive: true,\n group: \"Authentication\",\n },\n ];\n }\n\n private _describeSkill(\n _handle: ConnectorHandle,\n declaration: ConnectorDeclaration,\n ): RuntimeSkillDescriptor {\n const url = String(declaration.options?.url ?? \"\");\n let hostLabel = declaration.id;\n try {\n hostLabel = new URL(url).hostname;\n } catch {}\n return {\n id: declaration.id,\n name: `Redis — ${hostLabel}`,\n description: `Key-value store at ${hostLabel}`,\n category: \"kv\",\n access: declaration.access,\n toolNames: [\"get\", \"keys\", \"ttl\", \"info\"],\n };\n }\n\n async connect(declaration: ConnectorDeclaration, ctx: ConnectContext): Promise<ConnectorHandle> {\n const started = Date.now();\n const url =\n ctx.resolvedFields?.url ??\n resolveAuth(declaration.auth, ctx.secrets) ??\n String(declaration.options?.url ?? \"\");\n if (!url) {\n this.log.error(\"connect failed: missing url\", undefined);\n throw new Error(\"RedisAdapter requires auth (URL) or options.url\");\n }\n\n let host = \"(unknown)\";\n try {\n host = new URL(url).hostname;\n } catch {}\n this.log.info(\"connect start\", { host });\n\n try {\n const ioredisPkg = \"ioredis\";\n const mod = (await import(/* @vite-ignore */ ioredisPkg)) as any;\n const Redis = mod.default ?? mod.Redis ?? mod;\n const client = new Redis(url, { lazyConnect: true, maxRetriesPerRequest: 2 });\n await client.connect();\n\n const namespace = String(declaration.options?.namespace ?? \"\");\n\n this.log.info(\"connect ok\", { host, durationMs: Date.now() - started });\n return this.makeHandle(declaration, { client, namespace } satisfies RedisState);\n } catch (err) {\n this.log.error(\"connect failed\", err, { host });\n throw err;\n }\n }\n\n async disconnect(handle: ConnectorHandle): Promise<void> {\n this.log.info(\"disconnect\");\n const { client } = handle.state as RedisState;\n await client.quit();\n handle.status = \"disconnected\";\n }\n\n private client(handle: ConnectorHandle): any {\n return (handle.state as RedisState).client;\n }\n\n private nsKey(handle: ConnectorHandle, key: string): string {\n const ns = (handle.state as RedisState).namespace;\n return ns ? `${ns}:${key}` : key;\n }\n\n private stripNs(handle: ConnectorHandle, key: string): string {\n const ns = (handle.state as RedisState).namespace;\n return ns && key.startsWith(`${ns}:`) ? key.slice(ns.length + 1) : key;\n }\n\n private async _read(handle: ConnectorHandle, path: string): Promise<ConnectorContent | null> {\n const value = await this.client(handle).get(this.nsKey(handle, path));\n if (value === null) return null;\n return { data: value, contentType: \"application/json\" };\n }\n\n private async _write(\n handle: ConnectorHandle,\n path: string,\n content: ConnectorContent,\n ): Promise<void> {\n const data = typeof content.data === \"string\" ? content.data : content.data.toString(\"utf-8\");\n await this.client(handle).set(this.nsKey(handle, path), data);\n }\n\n private async _delete(handle: ConnectorHandle, path: string): Promise<boolean> {\n const count = await this.client(handle).del(this.nsKey(handle, path));\n return count > 0;\n }\n\n private async _list(\n handle: ConnectorHandle,\n path?: string,\n options?: ListOptions,\n ): Promise<ConnectorEntry[]> {\n const ns = (handle.state as RedisState).namespace;\n const pattern = path\n ? this.nsKey(handle, path.endsWith(\"*\") ? path : `${path}*`)\n : ns\n ? `${ns}:*`\n : \"*\";\n\n const keys: string[] = [];\n let cursor = \"0\";\n const limit = options?.limit ?? 1000;\n\n do {\n const [next, batch] = await this.client(handle).scan(cursor, \"MATCH\", pattern, \"COUNT\", 100);\n cursor = next;\n keys.push(...batch);\n if (keys.length >= limit) break;\n } while (cursor !== \"0\");\n\n return keys.slice(0, limit).map((k) => ({\n name: this.stripNs(handle, k),\n path: this.stripNs(handle, k),\n type: \"key\" as const,\n }));\n }\n\n private async _search(\n handle: ConnectorHandle,\n query: string,\n options?: SearchOptions,\n ): Promise<SearchResult[]> {\n // SCAN + GET for matching values (expensive but functional)\n const entries = await this._list(handle, undefined, { limit: options?.maxResults ?? 100 });\n const results: SearchResult[] = [];\n\n for (const entry of entries) {\n if (options?.maxResults && results.length >= options.maxResults) break;\n if (entry.name.includes(query)) {\n results.push({ path: entry.name });\n continue;\n }\n const value = await this.client(handle).get(this.nsKey(handle, entry.name));\n if (value?.includes(query)) {\n results.push({ path: entry.name, snippet: value.slice(0, 200) });\n }\n }\n return results;\n }\n\n private _describeOperations(handle: ConnectorHandle): OperationDescriptor[] {\n const ops: OperationDescriptor[] = [\n {\n name: \"get\",\n description: \"Get value by key.\",\n accessLevel: \"read\",\n args: [{ name: \"key\", type: \"string\", required: true, description: \"Redis key\" }],\n examples: ['get --key \"config:theme\"'],\n },\n {\n name: \"keys\",\n description: \"List keys matching a glob pattern.\",\n accessLevel: \"read\",\n args: [\n {\n name: \"pattern\",\n type: \"string\",\n required: false,\n description: \"Glob pattern (default: *)\",\n },\n ],\n examples: [\"keys\", 'keys --pattern \"user:*\"'],\n },\n {\n name: \"ttl\",\n description:\n \"Get remaining time-to-live for a key (seconds, -1 if no expiry, -2 if key does not exist).\",\n accessLevel: \"read\",\n args: [{ name: \"key\", type: \"string\", required: true, description: \"Redis key\" }],\n },\n {\n name: \"info\",\n description: \"Get Redis server info (memory, clients, keyspace stats).\",\n accessLevel: \"read\",\n args: [\n {\n name: \"section\",\n type: \"string\",\n required: false,\n description: \"Info section (memory, clients, keyspace, all)\",\n },\n ],\n },\n ];\n\n if (handle.access === \"read-write\") {\n ops.push(\n {\n name: \"set\",\n description: \"Set a key-value pair with optional TTL.\",\n accessLevel: \"write\",\n args: [\n { name: \"key\", type: \"string\", required: true, description: \"Redis key\" },\n { name: \"value\", type: \"string\", required: true, description: \"Value to store\" },\n { name: \"ttl\", type: \"number\", required: false, description: \"Expiry in seconds\" },\n ],\n examples: [\n 'set --key \"status\" --value \"running\"',\n 'set --key \"cache:token\" --value \"abc\" --ttl 3600',\n ],\n },\n {\n name: \"del\",\n description: \"Delete one or more keys.\",\n accessLevel: \"write\",\n args: [{ name: \"key\", type: \"string\", required: true, description: \"Key to delete\" }],\n examples: ['del --key \"temp:session\"'],\n },\n );\n }\n\n return ops;\n }\n\n private async _executeOp(\n handle: ConnectorHandle,\n operation: string,\n args: Record<string, unknown>,\n ): Promise<string> {\n const client = this.client(handle);\n\n switch (operation) {\n case \"get\": {\n const key = String(args.key ?? args._positional ?? \"\");\n const value = await client.get(this.nsKey(handle, key));\n return value ?? \"\";\n }\n case \"set\": {\n const key = String(args.key ?? \"\");\n const value = String(args.value ?? \"\");\n const fullKey = this.nsKey(handle, key);\n if (args.ttl) {\n await client.set(fullKey, value, \"EX\", Number(args.ttl));\n } else {\n await client.set(fullKey, value);\n }\n return \"OK\";\n }\n case \"keys\": {\n const pattern = args.pattern ? String(args.pattern) : \"*\";\n const entries = await this._list(handle, pattern.endsWith(\"*\") ? pattern : `${pattern}*`);\n return JSON.stringify(entries.map((e) => e.name));\n }\n case \"del\": {\n const key = String(args.key ?? args._positional ?? \"\");\n const count = await client.del(this.nsKey(handle, key));\n return count > 0 ? \"Deleted\" : \"Not found\";\n }\n case \"ttl\": {\n const key = String(args.key ?? args._positional ?? \"\");\n const ttl = await client.ttl(this.nsKey(handle, key));\n return String(ttl);\n }\n case \"info\": {\n const section = args.section ? String(args.section) : undefined;\n const info = section ? await client.info(section) : await client.info();\n return info;\n }\n default:\n throw new Error(`RedisAdapter has no operation: ${operation}`);\n }\n }\n}\n\n/**\n * Creates a new RedisConnector instance.\n * @returns Configured RedisConnector ready to be registered in the connector registry.\n */\nexport function createConnector(): RedisConnector {\n return new RedisConnector();\n}\n\n/**\n * Plugin-registry target wrapping the Redis connector factory. Connectors take\n * no construct-time config, so `configSchema` is a passthrough and `create()`\n * returns a fresh instance; lifecycle config arrives via `Connector.connect()`.\n */\nexport const redisConnectorTarget: ConnectorTarget = {\n id: \"redis\",\n displayName: \"Redis\",\n apiVersion: 1,\n configSchema: z.unknown(),\n create: (_config, _ctx) => new RedisConnector(),\n};\n","/**\n * `@skaile/connector-redis` — Redis connector for `@skaile/workspaces`.\n *\n * Install via `skaile plugin install @skaile/connector-redis`; the plugin\n * loader calls `register(pluginRegistry)` at startup so `redis` becomes\n * resolvable as a connector driver.\n */\n\nimport type { PluginRegistry } from \"@skaile/workspaces/plugin-registry\";\nimport { redisConnectorTarget } from \"./target.js\";\n\nexport { redisConnectorTarget, RedisConnector, createConnector } from \"./target.js\";\n\n/** Register this plugin's connector target with a registry. */\nexport function register(registry: PluginRegistry): void {\n registry.register(\"connector\", redisConnectorTarget);\n}\n"],"mappings":";AAOA,SAAS,aAAa,yBAAyB;AAkB/C,YAAY,OAAO;AAWZ,IAAM,iBAAN,cAA6B,kBAAkB;AAAA,EAC3C,OAAO;AAAA,EAEhB;AAAA,EAEA,cAAc;AACZ,UAAM;AACN,SAAK,QAAQ;AAAA,MACX,MAAM,CAAC,QAAQ,SAAS,KAAK,MAAM,QAAQ,IAAI;AAAA,MAC/C,OAAO,CAAC,QAAQ,MAAM,YAAY,KAAK,OAAO,QAAQ,MAAM,OAAO;AAAA,MACnE,QAAQ,CAAC,QAAQ,SAAS,KAAK,QAAQ,QAAQ,IAAI;AAAA,MACnD,MAAM,CAAC,QAAQ,MAAM,YAAY,KAAK,MAAM,QAAQ,MAAM,OAAO;AAAA,MACjE,QAAQ,CAAC,QAAQ,OAAO,YAAY,KAAK,QAAQ,QAAQ,OAAO,OAAO;AAAA,MACvE,oBAAoB,CAAC,WAAW,KAAK,oBAAoB,MAAM;AAAA,MAC/D,WAAW,CAAC,QAAQ,WAAW,SAAS,KAAK,WAAW,QAAQ,WAAW,IAAI;AAAA,MAC/E,eAAe,CAAC,QAAQ,gBAAgB,KAAK,eAAe,QAAQ,WAAW;AAAA,IACj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AAO,GAAG;AACxF,eAAO,KAAK,UAAU,QAAQ,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC;AAAA,MAClD;AAAA,MACA,KAAK,OAAO;AACV,cAAM,MAAM,OAAO,KAAK,OAAO,KAAK,eAAe,EAAE;AACrD,cAAM,QAAQ,MAAM,OAAO,IAAI,KAAK,MAAM,QAAQ,GAAG,CAAC;AACtD,eAAO,QAAQ,IAAI,YAAY;AAAA,MACjC;AAAA,MACA,KAAK,OAAO;AACV,cAAM,MAAM,OAAO,KAAK,OAAO,KAAK,eAAe,EAAE;AACrD,cAAM,MAAM,MAAM,OAAO,IAAI,KAAK,MAAM,QAAQ,GAAG,CAAC;AACpD,eAAO,OAAO,GAAG;AAAA,MACnB;AAAA,MACA,KAAK,QAAQ;AACX,cAAM,UAAU,KAAK,UAAU,OAAO,KAAK,OAAO,IAAI;AACtD,cAAM,OAAO,UAAU,MAAM,OAAO,KAAK,OAAO,IAAI,MAAM,OAAO,KAAK;AACtE,eAAO;AAAA,MACT;AAAA,MACA;AACE,cAAM,IAAI,MAAM,kCAAkC,SAAS,EAAE;AAAA,IACjE;AAAA,EACF;AACF;AAMO,SAAS,kBAAkC;AAChD,SAAO,IAAI,eAAe;AAC5B;AAOO,IAAM,uBAAwC;AAAA,EACnD,IAAI;AAAA,EACJ,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,cAAgB,UAAQ;AAAA,EACxB,QAAQ,CAAC,SAAS,SAAS,IAAI,eAAe;AAChD;;;ACzVO,SAAS,SAAS,UAAgC;AACvD,WAAS,SAAS,aAAa,oBAAoB;AACrD;","names":[]}
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "@skaile/connector-redis",
3
+ "version": "0.0.0",
4
+ "description": "Redis connector for @skaile/workspaces",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist",
16
+ "README.md",
17
+ "CHANGELOG.md",
18
+ "LICENSE"
19
+ ],
20
+ "sideEffects": false,
21
+ "engines": {
22
+ "node": ">=20"
23
+ },
24
+ "peerDependencies": {
25
+ "@skaile/workspaces": ">=0.22.0-0"
26
+ },
27
+ "devDependencies": {
28
+ "@skaile/workspaces": "0.21.0"
29
+ },
30
+ "scripts": {
31
+ "build": "tsup",
32
+ "typecheck": "tsc --noEmit",
33
+ "test": "vitest run",
34
+ "test:watch": "vitest",
35
+ "format": "biome format --write .",
36
+ "lint": "biome lint .",
37
+ "check": "biome check ."
38
+ },
39
+ "publishConfig": {
40
+ "access": "public"
41
+ },
42
+ "repository": {
43
+ "type": "git",
44
+ "url": "git+https://github.com/skaile-ai/workspaces.git",
45
+ "directory": "packages/connector-redis"
46
+ },
47
+ "homepage": "https://github.com/skaile-ai/workspaces/tree/main/packages/connector-redis#readme",
48
+ "bugs": "https://github.com/skaile-ai/workspaces/issues",
49
+ "license": "Apache-2.0",
50
+ "dependencies": {
51
+ "ioredis": ">=5.0.0",
52
+ "zod": "^4.4.0"
53
+ }
54
+ }