docshark 0.1.22 → 0.1.23

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
@@ -160,6 +160,16 @@ bun run src/cli.ts start --port 6380
160
160
  bun run src/cli.ts list
161
161
  ```
162
162
 
163
+ ### Tests
164
+
165
+ Run the regression suite before merging or publishing changes:
166
+
167
+ ```bash
168
+ bun test scripts/*.test.ts
169
+ ```
170
+
171
+ The suite covers storage and migrations, library management, extraction, chunking, search, crawl helpers, API routes, and MCP tool wrappers.
172
+
163
173
  ## 🔄 Versioning & Changelog
164
174
 
165
175
  This project uses [Google's Release Please](https://github.com/googleapis/release-please) to automate versioning and changelog generation.
@@ -2,6 +2,8 @@ import { Database as BunDatabase } from "bun:sqlite";
2
2
  import type { Library, Page, CrawlJob } from "../types.js";
3
3
  export declare class Database {
4
4
  private db;
5
+ private hasColumn;
6
+ private ensureColumn;
5
7
  init(): void;
6
8
  /** Expose raw DB for search engine direct queries */
7
9
  raw(): BunDatabase;
@@ -5,6 +5,17 @@ import { mkdirSync } from "fs";
5
5
  import { homedir } from "os";
6
6
  export class Database {
7
7
  db;
8
+ hasColumn(tableName, columnName) {
9
+ const columns = this.db
10
+ .prepare(`PRAGMA table_info(${tableName})`)
11
+ .all();
12
+ return columns.some((column) => column.name === columnName);
13
+ }
14
+ ensureColumn(tableName, columnName, definition) {
15
+ if (!this.hasColumn(tableName, columnName)) {
16
+ this.db.run(`ALTER TABLE ${tableName} ADD COLUMN ${columnName} ${definition}`);
17
+ }
18
+ }
8
19
  init() {
9
20
  const dir = process.env.DOCSHARK_DATA_DIR || resolve(homedir(), ".docshark");
10
21
  mkdirSync(dir, { recursive: true });
@@ -104,6 +115,7 @@ export class Database {
104
115
  created_at TEXT NOT NULL DEFAULT (datetime('now'))
105
116
  )
106
117
  `);
118
+ this.ensureColumn("crawl_jobs", "session_id", "TEXT");
107
119
  }
108
120
  // ──────────────────────────────────────
109
121
  // Library CRUD
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "0.1.22";
1
+ export declare const VERSION = "0.1.23";
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // This file is automatically updated by the version sync script.
2
- export const VERSION = '0.1.22';
2
+ export const VERSION = '0.1.23';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docshark",
3
- "version": "0.1.22",
3
+ "version": "0.1.23",
4
4
  "description": "🦈 Documentation MCP Server — scrape, index, and search any doc website",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -36,6 +36,7 @@
36
36
  "dev": "bun run --watch src/cli.ts start",
37
37
  "cli": "bun run src/cli.ts",
38
38
  "check": "tsc --noEmit",
39
+ "test": "bun test scripts/*.test.ts",
39
40
  "sync:version": "bun run src/scripts/sync-version.ts",
40
41
  "build": "bun run sync:version && rm -rf dist && tsc && chmod +x dist/cli.js",
41
42
  "prepublishOnly": "bun run build",