claude-db 0.9.0 → 0.9.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.9.1
4
+
5
+ ### Fixed
6
+
7
+ - **Commands printed database passwords in plain output.**
8
+ ([#21](https://github.com/Avijit07x/claude-db/pull/21))
9
+ `status`, `doctor`, `install`, `projects` and `reset` interpolated
10
+ `config.database` verbatim, and `view --export` wrote it into the generated
11
+ HTML, so a hosted Postgres or Mongo URL showed its password on screen and in
12
+ any file or bug report built from that output. SECURITY.md already stated
13
+ that these credentials are masked in command output; six call sites were not.
14
+ They now go through the existing `redact()`, as `use` already did, which
15
+ leaves the host readable and a SQLite path untouched. A new lint rule,
16
+ `no-raw-database-url`, fails the build on any future interpolation of
17
+ `config.database` without it.
18
+
3
19
  ## 0.9.0
4
20
 
5
21
  A correctness release. Everything below was found by reviewing the whole
@@ -2,7 +2,7 @@ import { createContext } from '../../context.js';
2
2
  import { loadConfig } from '../../config/index.js';
3
3
  import { packageVersion } from '../../update.js';
4
4
  import { randomUUID } from 'node:crypto';
5
- import { remember } from '../../capture/index.js';
5
+ import { redact, remember } from '../../capture/index.js';
6
6
  import { resolveProject } from '../../util/project.js';
7
7
  import { settingsPathFor } from '../paths.js';
8
8
  import { existsSync, readFileSync } from 'node:fs';
@@ -16,7 +16,7 @@ export async function cmdDoctor(argv) {
16
16
  const embedder = await ctx.embedder();
17
17
  const vectors = await probeEmbedder(embedder);
18
18
  console.log(`version : ${packageVersion()}`);
19
- console.log(`database : ${ctx.config.database}`);
19
+ console.log(`database : ${redact(ctx.config.database)}`);
20
20
  console.log(`adapter : ${ctx.store.kind}`);
21
21
  console.log(`reachable: ${reachable ? 'yes' : 'no'}`);
22
22
  console.log(`requested: embeddings.provider = ${ctx.config.embeddings.provider}`);
@@ -2,6 +2,7 @@ import { createContext } from '../../context.js';
2
2
  import { eachObservation } from '../commands/transfer.js';
3
3
  import { resolve } from 'node:path';
4
4
  import { resolveProject } from '../../util/project.js';
5
+ import { redact } from '../../capture/turn-extractor.js';
5
6
  export async function cmdStats() {
6
7
  const project = resolveProject(undefined);
7
8
  const ctx = await createContext();
@@ -55,7 +56,7 @@ export async function cmdProjects() {
55
56
  console.log('No memory stored yet.');
56
57
  return;
57
58
  }
58
- console.log(`database: ${ctx.config.database}\n`);
59
+ console.log(`database: ${redact(ctx.config.database)}\n`);
59
60
  for (const entry of projects) {
60
61
  const marker = entry.project === here ? '*' : ' ';
61
62
  const date = new Date(entry.lastActive).toISOString().slice(0, 10);
@@ -2,7 +2,7 @@ import { CONFIG_DIR, loadConfig } from '../../config/index.js';
2
2
  import { basename, join } from 'node:path';
3
3
  import { checkForUpdate } from '../../update.js';
4
4
  import { createContext } from '../../context.js';
5
- import { flushSession, resetCursor, sweepCursors, transcriptsFor } from '../../capture/index.js';
5
+ import { flushSession, redact, resetCursor, sweepCursors, transcriptsFor, } from '../../capture/index.js';
6
6
  import { resolveProject } from '../../util/project.js';
7
7
  import { rmSync } from 'node:fs';
8
8
  export async function cmdReset(argv) {
@@ -11,7 +11,7 @@ export async function cmdReset(argv) {
11
11
  const project = resolveProject(undefined);
12
12
  const ctx = await createContext();
13
13
  try {
14
- const target = scoped ? project : ctx.config.database;
14
+ const target = scoped ? project : redact(ctx.config.database);
15
15
  if (!confirmed) {
16
16
  console.log(`This would delete ${scoped ? "this project's" : 'ALL'} memory from:`);
17
17
  console.log(` ${target}`);
@@ -1,5 +1,5 @@
1
1
  import { toShortId } from '../../util/shortid.js';
2
- import { closeLandedWork, openWork } from '../../capture/index.js';
2
+ import { closeLandedWork, openWork, redact } from '../../capture/index.js';
3
3
  import { CONFIG_PATH } from '../../config/index.js';
4
4
  import { DIST_DIR } from '../constants.js';
5
5
  import { assertStableLocation, install, uninstall } from '../install.js';
@@ -28,7 +28,7 @@ export async function cmdInstall(scope) {
28
28
  console.log(`Guidance : ${instructionsPathFor(scope, project)}`);
29
29
  console.log(`Skill : ${skillPathFor(scope, project)} (/cdb-scan)`);
30
30
  console.log(`Config : ${CONFIG_PATH}`);
31
- console.log(`Database : ${ctx.config.database}`);
31
+ console.log(`Database : ${redact(ctx.config.database)}`);
32
32
  if (embedder.id === 'builtin-hashing') {
33
33
  console.log('Search : keyword + basic vectors');
34
34
  console.log(' for semantic search: npm i -g @xenova/transformers');
@@ -84,7 +84,7 @@ export async function cmdStatus() {
84
84
  }));
85
85
  const active = wiring.filter((entry) => entry.installed);
86
86
  console.log(`project : ${project}`);
87
- console.log(`database : ${ctx.config.database}`);
87
+ console.log(`database : ${redact(ctx.config.database)}`);
88
88
  console.log(`hooks : ${active.length > 0 ? active.map((entry) => entry.label).join(' + ') : 'NOT INSTALLED'}`);
89
89
  const mcpFile = [mcpPathFor('project', project), mcpPathFor('global', project)].find((candidate) => fileMentions(candidate, resolve(DIST_DIR, 'mcp', 'server.js')));
90
90
  console.log(`mcp : ${mcpFile ? `registered (${mcpFile})` : 'NOT REGISTERED'}`);
@@ -6,6 +6,7 @@ import { createContext } from '../../context.js';
6
6
  import { resolveProject } from '../../util/project.js';
7
7
  import { toShortId } from '../../util/shortid.js';
8
8
  import { renderPage } from './view-page.js';
9
+ import { redact } from '../../capture/turn-extractor.js';
9
10
  async function collect(ctx, project) {
10
11
  const all = (await ctx.store.list({ project, limit: 500, newest: true })).sort((a, b) => b.createdAt - a.createdAt);
11
12
  const kinds = {};
@@ -25,7 +26,7 @@ async function collect(ctx, project) {
25
26
  }));
26
27
  return {
27
28
  project,
28
- database: ctx.config.database,
29
+ database: redact(ctx.config.database),
29
30
  scannedFiles: (await ctx.store.scannedFiles(project)).length,
30
31
  kinds,
31
32
  rules,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-db",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "description": "Persistent memory for Claude Code. Captures why decisions were made, not just which files changed. Bring your own database: SQLite, MongoDB or Postgres. No cloud, no subscription.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",