Skip to content

Commit c7e395d

Browse files
committed
v1.0.12: fix bin shebang and auto-create vector DB parent directory
1 parent 4d031af commit c7e395d

5 files changed

Lines changed: 13 additions & 6 deletions

File tree

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "agent-knowledge",
3-
"version": "1.0.11",
3+
"version": "1.0.12",
44
"description": "Cross-session memory and recall for AI agents — git-synced knowledge base, hybrid semantic+TF-IDF search, auto-distillation with secrets scrubbing",
55
"type": "module",
66
"main": "dist/index.js",

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/env node
12
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
23
import { createServer } from './server.js';
34
import { startDashboard } from './dashboard.js';

src/types.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,12 @@ export function savePersistedConfig(updates: Partial<PersistedConfig>): Persiste
7272

7373
export function getConfig(): KnowledgeConfig {
7474
const home = homedir();
75-
const claudeDir = process.env.CLAUDE_DIR || join(home, '.claude');
75+
// CLAUDE_DIR is optional — defaults to ~/.claude if it exists, otherwise
76+
// falls back to the platform config dir so agent-knowledge works standalone
77+
// (e.g. with Cursor, Windsurf, OpenCode) without requiring Claude Code.
78+
const claudeDir =
79+
process.env.CLAUDE_DIR ||
80+
(existsSync(join(home, '.claude')) ? join(home, '.claude') : getConfigDir());
7681
const persisted = loadPersistedConfig();
7782

7883
const memoryDir =

src/vectorstore/store.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
* for semantic similarity search over knowledge and session embeddings.
44
*/
55

6-
import { join } from 'path';
7-
import { statSync } from 'fs';
6+
import { join, dirname } from 'path';
7+
import { statSync, mkdirSync } from 'fs';
88
import { createRequire } from 'module';
99
import { getConfig } from '../types.js';
1010

@@ -84,6 +84,7 @@ export class VectorStore {
8484

8585
try {
8686
if (!this.db) {
87+
mkdirSync(dirname(this.dbPath), { recursive: true });
8788
const BetterSqlite3 = require('better-sqlite3') as typeof DatabaseConstructor;
8889
this.db = new BetterSqlite3(this.dbPath);
8990
this.db.pragma('journal_mode = WAL');

0 commit comments

Comments
 (0)