@carllee1983/dbcli 6.0.0 → 7.0.1

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dbcli-agent",
3
- "version": "6.0.0",
3
+ "version": "7.0.1",
4
4
  "description": "Database CLI skill and command reference for AI agents.",
5
5
  "contextFileName": "AGENTS.md"
6
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carllee1983/dbcli",
3
- "version": "6.0.0",
3
+ "version": "7.0.1",
4
4
  "description": "Database CLI for AI agents",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -132,6 +132,8 @@
132
132
  },
133
133
  "overrides": {
134
134
  "brace-expansion": "^5.0.9",
135
- "postcss": "^8.5.26"
135
+ "browserslist": "^4.28.7",
136
+ "postcss": "^8.5.26",
137
+ "postcss-selector-parser": "^6.1.3"
136
138
  }
137
139
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dbcli-agent",
3
- "version": "6.0.0",
3
+ "version": "7.0.1",
4
4
  "description": "Database CLI skill and command reference for AI agents",
5
5
  "author": {
6
6
  "name": "Carl Lee",
@@ -639,7 +639,7 @@ schema. Raw `query` / `export` invocations render a sortable table only.
639
639
  ## Notes
640
640
 
641
641
  - Query-only mode auto-appends `LIMIT 1000`; add `--no-limit` for `information_schema` or statements that break with `LIMIT`.
642
- - Blacklisted tables and columns are redacted from query output.
642
+ - Blacklisted tables and columns are redacted from query output. Every entry in `blacklist.tables` and `blacklist.columns` is a glob (`*`, `?`, `[a-z]`) on every engine, and a rule is compared against the whole dotted path case-insensitively — a rule spelled `password` also covers `Password`, and `profile.ssn` covers `profile.SSN`; a table literally named `report*` has to be written `report\*` to match literally again. `--fields` is unaffected and still matches exactly. A rule that cannot mean anything is rejected when the config loads rather than silently protecting nothing: a column entry qualified with its own table (`{"users": ["users.password"]}`) fails to load, and an unparsable rule makes every `dbcli es` request fail until it is fixed.
643
643
  - `schema` reports `estimatedRowCount` and `sizeCategory` (small / medium / large / huge). For large/huge tables add `WHERE` or `LIMIT` — bands in [reference.md](reference.md#schema).
644
644
  - `doctor` on `mongodb+srv://` reports whether SRV resolves natively or through the DoH fallback — useful when the runtime restricts DNS.
645
645
  - **Global flags:** `--version`, `--config <path>`, `--global`, `--use <name>`, `--timeout <ms>`, `--statement-timeout <ms>`, `-v` / `--verbose` / `-vv`, `-q` / `--quiet`, `--no-color` (also honours `NO_COLOR`). Root-level flags must precede the command unless the command explicitly declares a command-level option.
@@ -1102,6 +1102,26 @@ dbcli blacklist column remove users.password
1102
1102
 
1103
1103
  **Subcommands:** `list`, `table add <name>`, `table remove <name>`, `column add <table.column>`, `column remove <table.column>`
1104
1104
 
1105
+ **Matching semantics (7.0.0):** every entry in `blacklist.tables` and `blacklist.columns` is a
1106
+ glob (`*`, `?`, `[abc]`, `[a-z]`) on **every** engine, not only Redis and Elasticsearch — `tables:
1107
+ ["secrets*"]` blocks the SQL table `secrets_2026` and the MongoDB collection `secrets_2026` alike.
1108
+ A table literally named `report*` has to be written `report\*` to match literally again. Rules and
1109
+ returned names are compared over the **whole dotted path, case-insensitively**, so `password` also
1110
+ covers `Password` and `profile.ssn` covers `profile.SSN`; folding happens at the comparison and the
1111
+ config keeps rules as written. The cost is deliberate over-rejection: where PostgreSQL holds both
1112
+ `"Password"` and `"password"`, a rule naming either redacts both. `--fields` is unaffected and still
1113
+ matches exactly — it names keys in the document in front of the operator, not a protection rule.
1114
+
1115
+ Column-level entries are a **display filter, not an access control**: masking matches returned
1116
+ names, so `SELECT password_hash AS x` still returns the value. Table-level entries are the
1117
+ enforceable half.
1118
+
1119
+ A rule that cannot mean anything fails loudly instead of silently protecting nothing: a column entry
1120
+ qualified with its own table (`{"users": ["users.password"]}`) fails to load, and a rule the
1121
+ Elasticsearch shell cannot parse (`pass[word`, `a.**`) makes every `dbcli es` request fail until the
1122
+ config is fixed. Entries are trimmed and unquoted, and a rule filed under `public.users` applies to
1123
+ `SELECT * FROM users` and the reverse.
1124
+
1105
1125
  **`list` options:** `--config <path>`, `--format <text|json>` (default: `text`). JSON writes one
1106
1126
  document to stdout: `{ "tables": string[], "columns": Record<string, string[]>, "warnings":
1107
1127
  [{ "collection", "raw", "reason" }] }`. Invalid MongoDB blacklist patterns appear in `warnings`;
@@ -3547,6 +3567,12 @@ dbcli query "KEYS *" # → returns only non-blacklisted key
3547
3567
 
3548
3568
  Rejections are written to the audit log with `success: false` and `metadata.rejection_reason: 'blacklist'` + `matched_pattern`.
3549
3569
 
3570
+ Enforcement covers `q` and `report` as well (7.0.0). Before that, saved queries and the built-in
3571
+ `@diag/redis-key-stats` diagnostic ran on an adapter that carried the connection but none of its
3572
+ rules, so `dbcli q @<name>` could read a protected key in plaintext and a report could persist
3573
+ protected key names. Both now resolve their key targets before execution, apply the connection's
3574
+ blacklist and `redis.mask` rules, and drop protected key names from `SCAN` evidence.
3575
+
3550
3576
  ### Value / hash-field masking (v1.22)
3551
3577
 
3552
3578
  Where the key-glob blacklist *rejects*, masking instead *redacts*: a matched read still
@@ -639,7 +639,7 @@ schema. Raw `query` / `export` invocations render a sortable table only.
639
639
  ## Notes
640
640
 
641
641
  - Query-only mode auto-appends `LIMIT 1000`; add `--no-limit` for `information_schema` or statements that break with `LIMIT`.
642
- - Blacklisted tables and columns are redacted from query output.
642
+ - Blacklisted tables and columns are redacted from query output. Every entry in `blacklist.tables` and `blacklist.columns` is a glob (`*`, `?`, `[a-z]`) on every engine, and a rule is compared against the whole dotted path case-insensitively — a rule spelled `password` also covers `Password`, and `profile.ssn` covers `profile.SSN`; a table literally named `report*` has to be written `report\*` to match literally again. `--fields` is unaffected and still matches exactly. A rule that cannot mean anything is rejected when the config loads rather than silently protecting nothing: a column entry qualified with its own table (`{"users": ["users.password"]}`) fails to load, and an unparsable rule makes every `dbcli es` request fail until it is fixed.
643
643
  - `schema` reports `estimatedRowCount` and `sizeCategory` (small / medium / large / huge). For large/huge tables add `WHERE` or `LIMIT` — bands in [reference.md](reference.md#schema).
644
644
  - `doctor` on `mongodb+srv://` reports whether SRV resolves natively or through the DoH fallback — useful when the runtime restricts DNS.
645
645
  - **Global flags:** `--version`, `--config <path>`, `--global`, `--use <name>`, `--timeout <ms>`, `--statement-timeout <ms>`, `-v` / `--verbose` / `-vv`, `-q` / `--quiet`, `--no-color` (also honours `NO_COLOR`). Root-level flags must precede the command unless the command explicitly declares a command-level option.
@@ -1102,6 +1102,26 @@ dbcli blacklist column remove users.password
1102
1102
 
1103
1103
  **Subcommands:** `list`, `table add <name>`, `table remove <name>`, `column add <table.column>`, `column remove <table.column>`
1104
1104
 
1105
+ **Matching semantics (7.0.0):** every entry in `blacklist.tables` and `blacklist.columns` is a
1106
+ glob (`*`, `?`, `[abc]`, `[a-z]`) on **every** engine, not only Redis and Elasticsearch — `tables:
1107
+ ["secrets*"]` blocks the SQL table `secrets_2026` and the MongoDB collection `secrets_2026` alike.
1108
+ A table literally named `report*` has to be written `report\*` to match literally again. Rules and
1109
+ returned names are compared over the **whole dotted path, case-insensitively**, so `password` also
1110
+ covers `Password` and `profile.ssn` covers `profile.SSN`; folding happens at the comparison and the
1111
+ config keeps rules as written. The cost is deliberate over-rejection: where PostgreSQL holds both
1112
+ `"Password"` and `"password"`, a rule naming either redacts both. `--fields` is unaffected and still
1113
+ matches exactly — it names keys in the document in front of the operator, not a protection rule.
1114
+
1115
+ Column-level entries are a **display filter, not an access control**: masking matches returned
1116
+ names, so `SELECT password_hash AS x` still returns the value. Table-level entries are the
1117
+ enforceable half.
1118
+
1119
+ A rule that cannot mean anything fails loudly instead of silently protecting nothing: a column entry
1120
+ qualified with its own table (`{"users": ["users.password"]}`) fails to load, and a rule the
1121
+ Elasticsearch shell cannot parse (`pass[word`, `a.**`) makes every `dbcli es` request fail until the
1122
+ config is fixed. Entries are trimmed and unquoted, and a rule filed under `public.users` applies to
1123
+ `SELECT * FROM users` and the reverse.
1124
+
1105
1125
  **`list` options:** `--config <path>`, `--format <text|json>` (default: `text`). JSON writes one
1106
1126
  document to stdout: `{ "tables": string[], "columns": Record<string, string[]>, "warnings":
1107
1127
  [{ "collection", "raw", "reason" }] }`. Invalid MongoDB blacklist patterns appear in `warnings`;
@@ -3547,6 +3567,12 @@ dbcli query "KEYS *" # → returns only non-blacklisted key
3547
3567
 
3548
3568
  Rejections are written to the audit log with `success: false` and `metadata.rejection_reason: 'blacklist'` + `matched_pattern`.
3549
3569
 
3570
+ Enforcement covers `q` and `report` as well (7.0.0). Before that, saved queries and the built-in
3571
+ `@diag/redis-key-stats` diagnostic ran on an adapter that carried the connection but none of its
3572
+ rules, so `dbcli q @<name>` could read a protected key in plaintext and a report could persist
3573
+ protected key names. Both now resolve their key targets before execution, apply the connection's
3574
+ blacklist and `redis.mask` rules, and drop protected key names from `SCAN` evidence.
3575
+
3550
3576
  ### Value / hash-field masking (v1.22)
3551
3577
 
3552
3578
  Where the key-glob blacklist *rejects*, masking instead *redacts*: a matched read still