@coldsmirk/inkstone-redis 0.23.0 → 0.24.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 CHANGED
@@ -15,7 +15,9 @@ Part of [inkstone](https://github.com/coldsmirk/inkstone). Built for the [**poly
15
15
  ```ts
16
16
  import { createRedisAssist, lineMarkers, runnableLine } from "@coldsmirk/inkstone-redis";
17
17
 
18
- const assist = createRedisAssist(); // over the built-in table; takes a vocabulary of your own
18
+ // Over the built-in table; the keyspace is the host's to list — a cache-backed read (the key
19
+ // tree's own list), never a fresh one, since completion asks on every keystroke in a key.
20
+ const assist = createRedisAssist({ keys: () => [{ name: "user:1", type: "hash" }] });
19
21
 
20
22
  // What one run should send: the selection where there is one, else the caret's line.
21
23
  const runnable = runnableLine(text, from, to);
@@ -30,7 +32,9 @@ for (const marker of lineMarkers(text)) {
30
32
  }
31
33
  ```
32
34
 
33
- Completion offers every command at a line's start, a container's subcommands after it (`CLIENT` → `LIST`, `KILL` …) and the command's own fixed words among its arguments (`NX`, `EX`, `WITHSCORES`); hover describes the command under its name; signature help follows the caret across the syntax line. Everything reads the line through one splitter, so the three can never disagree about which word the caret is on.
35
+ Completion offers every command at a line's start, a container's subcommands after it (`CLIENT` → `LIST`, `KILL` …), the keyspace at every word the command keys and the command's own fixed words among its arguments (`NX`, `EX`, `WITHSCORES`); hover describes the command under its name; signature help follows the caret across the syntax line. Everything reads the line through one splitter, so the three can never disagree about which word the caret is on.
36
+
37
+ Which words are keys is the server's own word, not a guess at the syntax: each command carries the key spec `COMMAND` states for it — the first key's word, the last's (negative counts back from the call's end) and the step between them — so `GET key` keys one word, `DEL key [key ...]` every word after the name, and `MSET key value [key value ...]` every other one. A command whose keys only its own arguments can name (`EVAL`'s `numkeys`, `GEORADIUS`'s `STORE`) states none and is offered none. A key the reader could not read back bare is inserted quoted (`spellWord`, the splitter's own inverse).
34
38
 
35
39
  ## The mirror invariant
36
40
 
@@ -38,7 +42,7 @@ Completion offers every command at a line's start, a container's subcommands aft
38
42
 
39
43
  ## The table
40
44
 
41
- `src/commands.ts` is generated by `scripts/commands.ts` from the `COMMAND DOCS` and `COMMAND` replies of a running Redis 7.2 — the last BSD-3-Clause release, whose command documentation ships inside the server. The script's header says how to regenerate it. A command the table does not know (a module's, a newer server's) is a hint, never an error: the engine runs it all the same.
45
+ `src/commands.ts` is generated by `scripts/commands.ts` from the `COMMAND DOCS` and `COMMAND` replies of a running Redis 7.2 (the argument tree and the summaries from the first, the arity and the key spec from the second) — the last BSD-3-Clause release, whose command documentation ships inside the server. The script's header says how to regenerate it. A command the table does not know (a module's, a newer server's) is a hint, never an error: the engine runs it all the same.
42
46
 
43
47
  ## Install
44
48