claude-eidetic 0.1.2 → 0.1.4
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 +324 -333
- package/dist/config.d.ts +0 -25
- package/dist/config.js +0 -17
- package/dist/embedding/openai.js +1 -1
- package/dist/index.js +42 -42
- package/dist/memory/history.js +14 -14
- package/dist/memory/store.d.ts +2 -3
- package/dist/memory/store.js +1 -21
- package/dist/precompact/hook.d.ts +1 -1
- package/dist/precompact/hook.js +1 -59
- package/dist/precompact/memory-inject.d.ts +10 -0
- package/dist/precompact/memory-inject.js +86 -0
- package/dist/tool-schemas.d.ts +20 -5
- package/dist/tool-schemas.js +78 -55
- package/dist/tools.js +4 -4
- package/messages.yaml +50 -50
- package/package.json +86 -87
- package/dist/memory/llm.d.ts +0 -2
- package/dist/memory/llm.js +0 -56
- package/dist/memory/prompts.d.ts +0 -5
- package/dist/memory/prompts.js +0 -36
package/dist/tool-schemas.js
CHANGED
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
const READ_FILE_DESCRIPTION = `\
|
|
2
|
-
Read a file and return raw content without line-number overhead (~15-20% fewer tokens than built-in Read for code, more for short-line files).
|
|
3
|
-
|
|
4
|
-
Use offset and limit to page through large files. \
|
|
1
|
+
const READ_FILE_DESCRIPTION = `\
|
|
2
|
+
Read a file and return raw content without line-number overhead (~15-20% fewer tokens than built-in Read for code, more for short-line files).
|
|
3
|
+
|
|
4
|
+
Use offset and limit to page through large files. \
|
|
5
5
|
Add lineNumbers=true only when you need line references for editing.`;
|
|
6
|
-
const INDEX_DOCUMENT_DESCRIPTION = `\
|
|
7
|
-
Cache external documentation (from query-docs, WebFetch, etc.) for cheap semantic search later.
|
|
8
|
-
|
|
9
|
-
After fetching documentation from an external source, call this tool to store it. \
|
|
10
|
-
Subsequent queries about the same library will use search_documents (~20 tokens/result) \
|
|
11
|
-
instead of re-fetching (~5K+ tokens).
|
|
12
|
-
|
|
13
|
-
The content is split into chunks, embedded, and stored in a vector collection grouped by library. \
|
|
6
|
+
const INDEX_DOCUMENT_DESCRIPTION = `\
|
|
7
|
+
Cache external documentation (from query-docs, WebFetch, etc.) for cheap semantic search later.
|
|
8
|
+
|
|
9
|
+
After fetching documentation from an external source, call this tool to store it. \
|
|
10
|
+
Subsequent queries about the same library will use search_documents (~20 tokens/result) \
|
|
11
|
+
instead of re-fetching (~5K+ tokens).
|
|
12
|
+
|
|
13
|
+
The content is split into chunks, embedded, and stored in a vector collection grouped by library. \
|
|
14
14
|
A TTL tracks staleness — stale docs still return results but are flagged.`;
|
|
15
|
-
const SEARCH_DOCUMENTS_DESCRIPTION = `\
|
|
16
|
-
Search cached documentation using natural language queries.
|
|
17
|
-
|
|
18
|
-
Returns results from previously cached documentation (via index_document). \
|
|
19
|
-
Much cheaper than re-fetching docs (~20 tokens/result vs ~5K+ tokens/fetch).
|
|
20
|
-
|
|
21
|
-
If a specific library is provided, searches only that library's collection. \
|
|
15
|
+
const SEARCH_DOCUMENTS_DESCRIPTION = `\
|
|
16
|
+
Search cached documentation using natural language queries.
|
|
17
|
+
|
|
18
|
+
Returns results from previously cached documentation (via index_document). \
|
|
19
|
+
Much cheaper than re-fetching docs (~20 tokens/result vs ~5K+ tokens/fetch).
|
|
20
|
+
|
|
21
|
+
If a specific library is provided, searches only that library's collection. \
|
|
22
22
|
Otherwise searches across all cached documentation. Results include staleness indicators.`;
|
|
23
|
-
const CLEANUP_DESCRIPTION = `\
|
|
24
|
-
Remove orphaned vectors for files that no longer exist on disk. Lightweight alternative to re-indexing — no embedding cost.
|
|
25
|
-
|
|
26
|
-
Provide either \`path\` (absolute) or \`project\` (name). Use \`list_indexed\` to see registered projects.
|
|
27
|
-
|
|
23
|
+
const CLEANUP_DESCRIPTION = `\
|
|
24
|
+
Remove orphaned vectors for files that no longer exist on disk. Lightweight alternative to re-indexing — no embedding cost.
|
|
25
|
+
|
|
26
|
+
Provide either \`path\` (absolute) or \`project\` (name). Use \`list_indexed\` to see registered projects.
|
|
27
|
+
|
|
28
28
|
Use \`dryRun=true\` first to preview which files would be cleaned without making any changes.`;
|
|
29
|
-
const INDEX_DESCRIPTION = `\
|
|
30
|
-
Index a codebase directory to enable semantic search using a configurable code splitter.
|
|
31
|
-
|
|
32
|
-
Provide either \`path\` (absolute) or \`project\` (name). Use \`list_indexed\` to see registered projects.
|
|
33
|
-
|
|
34
|
-
Usage Guidance:
|
|
35
|
-
- Use dryRun=true first to preview what files would be indexed and catch configuration issues before committing to a full index.
|
|
36
|
-
- This tool is typically used when search fails due to an unindexed codebase.
|
|
37
|
-
- If indexing is attempted on an already indexed path, and a conflict is detected, \
|
|
29
|
+
const INDEX_DESCRIPTION = `\
|
|
30
|
+
Index a codebase directory to enable semantic search using a configurable code splitter.
|
|
31
|
+
|
|
32
|
+
Provide either \`path\` (absolute) or \`project\` (name). Use \`list_indexed\` to see registered projects.
|
|
33
|
+
|
|
34
|
+
Usage Guidance:
|
|
35
|
+
- Use dryRun=true first to preview what files would be indexed and catch configuration issues before committing to a full index.
|
|
36
|
+
- This tool is typically used when search fails due to an unindexed codebase.
|
|
37
|
+
- If indexing is attempted on an already indexed path, and a conflict is detected, \
|
|
38
38
|
you MUST prompt the user to confirm whether to proceed with a force index.`;
|
|
39
|
-
const SEARCH_DESCRIPTION = `\
|
|
40
|
-
Search the indexed codebase using natural language queries.
|
|
41
|
-
Prefer over Grep for conceptual/semantic queries — returns ~20 tokens/result vs ~100+ for Grep.
|
|
42
|
-
Try before launching an Explore agent — faster and cheaper for understanding code.
|
|
43
|
-
|
|
44
|
-
Provide either \`path\` (absolute) or \`project\` (name). Use \`list_indexed\` to see registered projects.
|
|
45
|
-
|
|
46
|
-
When to Use:
|
|
47
|
-
- Code search: Find specific functions, classes, or implementations
|
|
48
|
-
- Context-aware assistance: Gather relevant code context before making changes
|
|
49
|
-
- Issue identification: Locate problematic code sections or bugs
|
|
50
|
-
- Code review: Understand existing implementations and patterns
|
|
51
|
-
- Refactoring: Find all related code pieces that need to be updated
|
|
52
|
-
- Feature development: Understand existing architecture and similar implementations
|
|
53
|
-
- Duplicate detection: Identify redundant or duplicated code patterns
|
|
54
|
-
|
|
55
|
-
If the codebase is not indexed, this tool will return a clear error message \
|
|
39
|
+
const SEARCH_DESCRIPTION = `\
|
|
40
|
+
Search the indexed codebase using natural language queries.
|
|
41
|
+
Prefer over Grep for conceptual/semantic queries — returns ~20 tokens/result vs ~100+ for Grep.
|
|
42
|
+
Try before launching an Explore agent — faster and cheaper for understanding code.
|
|
43
|
+
|
|
44
|
+
Provide either \`path\` (absolute) or \`project\` (name). Use \`list_indexed\` to see registered projects.
|
|
45
|
+
|
|
46
|
+
When to Use:
|
|
47
|
+
- Code search: Find specific functions, classes, or implementations
|
|
48
|
+
- Context-aware assistance: Gather relevant code context before making changes
|
|
49
|
+
- Issue identification: Locate problematic code sections or bugs
|
|
50
|
+
- Code review: Understand existing implementations and patterns
|
|
51
|
+
- Refactoring: Find all related code pieces that need to be updated
|
|
52
|
+
- Feature development: Understand existing architecture and similar implementations
|
|
53
|
+
- Duplicate detection: Identify redundant or duplicated code patterns
|
|
54
|
+
|
|
55
|
+
If the codebase is not indexed, this tool will return a clear error message \
|
|
56
56
|
indicating that indexing is required first.`;
|
|
57
57
|
export const TOOL_DEFINITIONS = [
|
|
58
58
|
{
|
|
@@ -289,20 +289,43 @@ export const TOOL_DEFINITIONS = [
|
|
|
289
289
|
},
|
|
290
290
|
{
|
|
291
291
|
name: 'add_memory',
|
|
292
|
-
description: '
|
|
292
|
+
description: 'Store pre-extracted developer knowledge facts. Before calling, extract facts yourself from the relevant content. Each fact should be a concise, self-contained statement about coding style, tools, architecture, conventions, debugging insights, or workflow preferences. Automatically deduplicates against existing memories.',
|
|
293
293
|
inputSchema: {
|
|
294
294
|
type: 'object',
|
|
295
295
|
properties: {
|
|
296
|
-
|
|
297
|
-
type: '
|
|
298
|
-
description: '
|
|
296
|
+
facts: {
|
|
297
|
+
type: 'array',
|
|
298
|
+
description: 'Array of facts to store. Extract these yourself before calling. Each fact must be a concise, self-contained statement.',
|
|
299
|
+
items: {
|
|
300
|
+
type: 'object',
|
|
301
|
+
properties: {
|
|
302
|
+
fact: {
|
|
303
|
+
type: 'string',
|
|
304
|
+
description: 'A concise, self-contained statement of a developer preference or convention.',
|
|
305
|
+
},
|
|
306
|
+
category: {
|
|
307
|
+
type: 'string',
|
|
308
|
+
description: 'Category: coding_style, tools, architecture, conventions, debugging, workflow, or preferences.',
|
|
309
|
+
enum: [
|
|
310
|
+
'coding_style',
|
|
311
|
+
'tools',
|
|
312
|
+
'architecture',
|
|
313
|
+
'conventions',
|
|
314
|
+
'debugging',
|
|
315
|
+
'workflow',
|
|
316
|
+
'preferences',
|
|
317
|
+
],
|
|
318
|
+
},
|
|
319
|
+
},
|
|
320
|
+
required: ['fact', 'category'],
|
|
321
|
+
},
|
|
299
322
|
},
|
|
300
323
|
source: {
|
|
301
324
|
type: 'string',
|
|
302
325
|
description: 'Optional source identifier (e.g., "conversation", "claude-code", "user-note").',
|
|
303
326
|
},
|
|
304
327
|
},
|
|
305
|
-
required: ['
|
|
328
|
+
required: ['facts'],
|
|
306
329
|
},
|
|
307
330
|
},
|
|
308
331
|
{
|
package/dist/tools.js
CHANGED
|
@@ -257,12 +257,12 @@ export class ToolHandlers {
|
|
|
257
257
|
async handleAddMemory(args) {
|
|
258
258
|
if (!this.memoryStore)
|
|
259
259
|
return textResult('Error: Memory system not initialized.');
|
|
260
|
-
const
|
|
261
|
-
if (!
|
|
262
|
-
return textResult('Error: "
|
|
260
|
+
const facts = args.facts;
|
|
261
|
+
if (!facts || !Array.isArray(facts) || facts.length === 0)
|
|
262
|
+
return textResult('Error: "facts" is required. Provide an array of pre-extracted facts with fact and category fields.');
|
|
263
263
|
const source = args.source;
|
|
264
264
|
try {
|
|
265
|
-
const actions = await this.memoryStore.addMemory(
|
|
265
|
+
const actions = await this.memoryStore.addMemory(facts, source);
|
|
266
266
|
return textResult(formatMemoryActions(actions));
|
|
267
267
|
}
|
|
268
268
|
catch (err) {
|
package/messages.yaml
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
# Eidetic user-facing messages — edit here, everything else reads from this file.
|
|
2
|
-
|
|
3
|
-
setup:
|
|
4
|
-
missing:
|
|
5
|
-
header: "Eidetic setup required: No API key configured."
|
|
6
|
-
diagnosis: >
|
|
7
|
-
`OPENAI_API_KEY` is not set and no alternative provider is configured.
|
|
8
|
-
step1: "**Get an API key**: https://platform.openai.com/api-keys"
|
|
9
|
-
|
|
10
|
-
invalid:
|
|
11
|
-
header: "Eidetic setup failed: {error}"
|
|
12
|
-
diagnosis: >
|
|
13
|
-
Key/provider is configured but initialization failed.
|
|
14
|
-
The key may be invalid, expired, or the provider may be unreachable.
|
|
15
|
-
step1: "**Verify your key** is valid and has embedding permissions"
|
|
16
|
-
|
|
17
|
-
unknown:
|
|
18
|
-
header: "Eidetic setup failed: {error}"
|
|
19
|
-
diagnosis: ""
|
|
20
|
-
step1: "**Get an API key**: https://platform.openai.com/api-keys"
|
|
21
|
-
|
|
22
|
-
# Shared across all contexts
|
|
23
|
-
config_instructions: |
|
|
24
|
-
### Windows
|
|
25
|
-
```
|
|
26
|
-
setx OPENAI_API_KEY sk-your-key-here
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
### macOS / Linux
|
|
30
|
-
Add to your shell profile (`~/.bashrc`, `~/.zshrc`, etc.):
|
|
31
|
-
```
|
|
32
|
-
export OPENAI_API_KEY="sk-your-key-here"
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
### Manual
|
|
36
|
-
|
|
37
|
-
Edit `~/.claude/plugins/claude-eidetic/config.json`:
|
|
38
|
-
```json
|
|
39
|
-
{
|
|
40
|
-
"env": {
|
|
41
|
-
"OPENAI_API_KEY": "sk-your-key-here"
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
### Using Ollama instead (free, local)
|
|
47
|
-
|
|
48
|
-
Set `EMBEDDING_PROVIDER=ollama` in the same env block (requires Ollama running locally with `nomic-embed-text`).
|
|
49
|
-
|
|
50
|
-
footer: "**Restart Claude Code** for changes to take effect."
|
|
1
|
+
# Eidetic user-facing messages — edit here, everything else reads from this file.
|
|
2
|
+
|
|
3
|
+
setup:
|
|
4
|
+
missing:
|
|
5
|
+
header: "Eidetic setup required: No API key configured."
|
|
6
|
+
diagnosis: >
|
|
7
|
+
`OPENAI_API_KEY` is not set and no alternative provider is configured.
|
|
8
|
+
step1: "**Get an API key**: https://platform.openai.com/api-keys"
|
|
9
|
+
|
|
10
|
+
invalid:
|
|
11
|
+
header: "Eidetic setup failed: {error}"
|
|
12
|
+
diagnosis: >
|
|
13
|
+
Key/provider is configured but initialization failed.
|
|
14
|
+
The key may be invalid, expired, or the provider may be unreachable.
|
|
15
|
+
step1: "**Verify your key** is valid and has embedding permissions"
|
|
16
|
+
|
|
17
|
+
unknown:
|
|
18
|
+
header: "Eidetic setup failed: {error}"
|
|
19
|
+
diagnosis: ""
|
|
20
|
+
step1: "**Get an API key**: https://platform.openai.com/api-keys"
|
|
21
|
+
|
|
22
|
+
# Shared across all contexts
|
|
23
|
+
config_instructions: |
|
|
24
|
+
### Windows
|
|
25
|
+
```
|
|
26
|
+
setx OPENAI_API_KEY sk-your-key-here
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### macOS / Linux
|
|
30
|
+
Add to your shell profile (`~/.bashrc`, `~/.zshrc`, etc.):
|
|
31
|
+
```
|
|
32
|
+
export OPENAI_API_KEY="sk-your-key-here"
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Manual
|
|
36
|
+
|
|
37
|
+
Edit `~/.claude/plugins/claude-eidetic/config.json`:
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"env": {
|
|
41
|
+
"OPENAI_API_KEY": "sk-your-key-here"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Using Ollama instead (free, local)
|
|
47
|
+
|
|
48
|
+
Set `EMBEDDING_PROVIDER=ollama` in the same env block (requires Ollama running locally with `nomic-embed-text`).
|
|
49
|
+
|
|
50
|
+
footer: "**Restart Claude Code** for changes to take effect."
|
package/package.json
CHANGED
|
@@ -1,87 +1,86 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "claude-eidetic",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Semantic code search MCP server — lean, correct, fast",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "dist/index.js",
|
|
7
|
-
"bin": {
|
|
8
|
-
"claude-eidetic": "dist/index.js"
|
|
9
|
-
},
|
|
10
|
-
"files": [
|
|
11
|
-
"dist/**/*.js",
|
|
12
|
-
"dist/**/*.d.ts",
|
|
13
|
-
"!dist/**/*.test.*",
|
|
14
|
-
"!dist/__tests__/**",
|
|
15
|
-
"!dist/**/tests/**",
|
|
16
|
-
"!dist/e2e/**",
|
|
17
|
-
"messages.yaml"
|
|
18
|
-
],
|
|
19
|
-
"scripts": {
|
|
20
|
-
"build": "tsc",
|
|
21
|
-
"dev": "tsx --watch src/index.ts",
|
|
22
|
-
"start": "node dist/index.js",
|
|
23
|
-
"clean": "rimraf dist",
|
|
24
|
-
"lint": "eslint src/",
|
|
25
|
-
"lint:fix": "eslint src/ --fix",
|
|
26
|
-
"format": "prettier --write \"src/**/*.ts\"",
|
|
27
|
-
"format:check": "prettier --check \"src/**/*.ts\"",
|
|
28
|
-
"typecheck": "tsc --noEmit",
|
|
29
|
-
"test": "vitest run",
|
|
30
|
-
"test:watch": "vitest",
|
|
31
|
-
"test:coverage": "vitest run --coverage",
|
|
32
|
-
"test:integration": "vitest run --config vitest.integration.config.ts",
|
|
33
|
-
"test:all": "vitest run && vitest run --config vitest.integration.config.ts",
|
|
34
|
-
"test:eval": "tsx scripts/eval/recall-at-k.ts && tsx scripts/eval/fusion-lift.ts && tsx scripts/eval/ndcg.ts",
|
|
35
|
-
"test:eval:generate": "tsx scripts/eval/generate-queries.ts",
|
|
36
|
-
"prepublishOnly": "npm run clean && npm run build",
|
|
37
|
-
"release": "bash scripts/release.sh"
|
|
38
|
-
},
|
|
39
|
-
"dependencies": {
|
|
40
|
-
"@
|
|
41
|
-
"@
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"tree-sitter": "^0.21.
|
|
47
|
-
"tree-sitter-
|
|
48
|
-
"tree-sitter-
|
|
49
|
-
"tree-sitter-
|
|
50
|
-
"tree-sitter-
|
|
51
|
-
"tree-sitter-
|
|
52
|
-
"tree-sitter-
|
|
53
|
-
"tree-sitter-
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
"@
|
|
63
|
-
"@types/
|
|
64
|
-
"@
|
|
65
|
-
"
|
|
66
|
-
"eslint": "^
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"typescript": "^
|
|
72
|
-
"
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
"
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
"
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "claude-eidetic",
|
|
3
|
+
"version": "0.1.4",
|
|
4
|
+
"description": "Semantic code search MCP server — lean, correct, fast",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"claude-eidetic": "dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist/**/*.js",
|
|
12
|
+
"dist/**/*.d.ts",
|
|
13
|
+
"!dist/**/*.test.*",
|
|
14
|
+
"!dist/__tests__/**",
|
|
15
|
+
"!dist/**/tests/**",
|
|
16
|
+
"!dist/e2e/**",
|
|
17
|
+
"messages.yaml"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "tsc",
|
|
21
|
+
"dev": "tsx --watch src/index.ts",
|
|
22
|
+
"start": "node dist/index.js",
|
|
23
|
+
"clean": "rimraf dist",
|
|
24
|
+
"lint": "eslint src/",
|
|
25
|
+
"lint:fix": "eslint src/ --fix",
|
|
26
|
+
"format": "prettier --write \"src/**/*.ts\"",
|
|
27
|
+
"format:check": "prettier --check \"src/**/*.ts\"",
|
|
28
|
+
"typecheck": "tsc --noEmit",
|
|
29
|
+
"test": "vitest run",
|
|
30
|
+
"test:watch": "vitest",
|
|
31
|
+
"test:coverage": "vitest run --coverage",
|
|
32
|
+
"test:integration": "vitest run --config vitest.integration.config.ts",
|
|
33
|
+
"test:all": "vitest run && vitest run --config vitest.integration.config.ts",
|
|
34
|
+
"test:eval": "tsx scripts/eval/recall-at-k.ts && tsx scripts/eval/fusion-lift.ts && tsx scripts/eval/ndcg.ts",
|
|
35
|
+
"test:eval:generate": "tsx scripts/eval/generate-queries.ts",
|
|
36
|
+
"prepublishOnly": "npm run clean && npm run build",
|
|
37
|
+
"release": "bash scripts/release.sh"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
41
|
+
"@qdrant/js-client-rest": "^1.13.0",
|
|
42
|
+
"better-sqlite3": "^12.6.2",
|
|
43
|
+
"glob": "^11.0.0",
|
|
44
|
+
"openai": "^5.1.1",
|
|
45
|
+
"tree-sitter": "^0.21.1",
|
|
46
|
+
"tree-sitter-c-sharp": "^0.21.0",
|
|
47
|
+
"tree-sitter-cpp": "^0.22.0",
|
|
48
|
+
"tree-sitter-go": "^0.21.0",
|
|
49
|
+
"tree-sitter-java": "^0.21.0",
|
|
50
|
+
"tree-sitter-javascript": "^0.21.0",
|
|
51
|
+
"tree-sitter-python": "^0.21.0",
|
|
52
|
+
"tree-sitter-rust": "^0.21.0",
|
|
53
|
+
"tree-sitter-typescript": "^0.21.0",
|
|
54
|
+
"yaml": "^2.8.2",
|
|
55
|
+
"zod": "^3.25.0"
|
|
56
|
+
},
|
|
57
|
+
"optionalDependencies": {
|
|
58
|
+
"@zilliz/milvus2-sdk-node": "^2.5.10"
|
|
59
|
+
},
|
|
60
|
+
"devDependencies": {
|
|
61
|
+
"@eslint/js": "^9.39.3",
|
|
62
|
+
"@types/better-sqlite3": "^7.6.13",
|
|
63
|
+
"@types/node": "^20.0.0",
|
|
64
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
65
|
+
"eslint": "^9.39.3",
|
|
66
|
+
"eslint-config-prettier": "^10.1.8",
|
|
67
|
+
"prettier": "^3.8.1",
|
|
68
|
+
"rimraf": "^6.0.1",
|
|
69
|
+
"tsx": "^4.19.4",
|
|
70
|
+
"typescript": "^5.8.3",
|
|
71
|
+
"typescript-eslint": "^8.56.0",
|
|
72
|
+
"vitest": "^4.0.18"
|
|
73
|
+
},
|
|
74
|
+
"overrides": {
|
|
75
|
+
"minimatch": "^10.2.1",
|
|
76
|
+
"@grpc/grpc-js": "^1.8.22"
|
|
77
|
+
},
|
|
78
|
+
"engines": {
|
|
79
|
+
"node": ">=20.0.0"
|
|
80
|
+
},
|
|
81
|
+
"repository": {
|
|
82
|
+
"type": "git",
|
|
83
|
+
"url": "https://github.com/eidetics/claude-eidetic.git"
|
|
84
|
+
},
|
|
85
|
+
"license": "MIT"
|
|
86
|
+
}
|
package/dist/memory/llm.d.ts
DELETED
package/dist/memory/llm.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import OpenAI from 'openai';
|
|
2
|
-
import Anthropic from '@anthropic-ai/sdk';
|
|
3
|
-
import { getConfig } from '../config.js';
|
|
4
|
-
import { MemoryError } from '../errors.js';
|
|
5
|
-
export async function chatCompletion(systemPrompt, userMessage) {
|
|
6
|
-
const config = getConfig();
|
|
7
|
-
if (config.memoryLlmProvider === 'anthropic') {
|
|
8
|
-
const apiKey = config.memoryLlmApiKey ?? config.anthropicApiKey ?? config.openaiApiKey;
|
|
9
|
-
if (!apiKey) {
|
|
10
|
-
throw new MemoryError('No API key configured for memory LLM. Set MEMORY_LLM_API_KEY, ANTHROPIC_API_KEY, or OPENAI_API_KEY.');
|
|
11
|
-
}
|
|
12
|
-
const client = new Anthropic({ apiKey });
|
|
13
|
-
try {
|
|
14
|
-
const response = await client.messages.create({
|
|
15
|
-
model: config.memoryLlmModel,
|
|
16
|
-
max_tokens: 2048,
|
|
17
|
-
system: systemPrompt,
|
|
18
|
-
messages: [{ role: 'user', content: userMessage }],
|
|
19
|
-
});
|
|
20
|
-
const block = response.content[0];
|
|
21
|
-
return block?.type === 'text' ? block.text : '{}';
|
|
22
|
-
}
|
|
23
|
-
catch (err) {
|
|
24
|
-
throw new MemoryError('Memory LLM call failed', err);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
// OpenAI / Ollama path
|
|
28
|
-
const apiKey = config.memoryLlmApiKey ?? config.openaiApiKey;
|
|
29
|
-
if (!apiKey) {
|
|
30
|
-
throw new MemoryError('No API key configured for memory LLM. Set MEMORY_LLM_API_KEY or OPENAI_API_KEY.');
|
|
31
|
-
}
|
|
32
|
-
let baseURL;
|
|
33
|
-
if (config.memoryLlmBaseUrl) {
|
|
34
|
-
baseURL = config.memoryLlmBaseUrl;
|
|
35
|
-
}
|
|
36
|
-
else if (config.memoryLlmProvider === 'ollama') {
|
|
37
|
-
baseURL = config.ollamaBaseUrl;
|
|
38
|
-
}
|
|
39
|
-
const client = new OpenAI({ apiKey, ...(baseURL ? { baseURL } : {}) });
|
|
40
|
-
try {
|
|
41
|
-
const response = await client.chat.completions.create({
|
|
42
|
-
model: config.memoryLlmModel,
|
|
43
|
-
messages: [
|
|
44
|
-
{ role: 'system', content: systemPrompt },
|
|
45
|
-
{ role: 'user', content: userMessage },
|
|
46
|
-
],
|
|
47
|
-
temperature: 0,
|
|
48
|
-
response_format: { type: 'json_object' },
|
|
49
|
-
});
|
|
50
|
-
return response.choices[0]?.message?.content ?? '{}';
|
|
51
|
-
}
|
|
52
|
-
catch (err) {
|
|
53
|
-
throw new MemoryError('Memory LLM call failed', err);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
//# sourceMappingURL=llm.js.map
|
package/dist/memory/prompts.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare const FACT_EXTRACTION_SYSTEM_PROMPT = "You are a developer knowledge extractor. Your job is to extract discrete, factual statements from conversations about software development.\n\nExtract facts about:\n- **coding_style**: Formatting preferences (tabs/spaces, naming conventions, line length), code style rules\n- **tools**: Preferred tools, frameworks, libraries, test runners, bundlers, linters, editors\n- **architecture**: Design patterns, architectural decisions, system design preferences\n- **conventions**: Project conventions, commit message formats, branch naming, PR workflows\n- **debugging**: Solutions to specific bugs, debugging techniques, known issues\n- **workflow**: Development habits, deployment processes, review preferences\n- **preferences**: General preferences, opinions, requirements that don't fit other categories\n\nRules:\n1. Extract only factual, concrete statements \u2014 not vague observations\n2. Each fact should be a single, self-contained statement\n3. Use third person (\"The user prefers...\" or state the fact directly)\n4. If the input contains no extractable facts, return an empty array\n5. Do NOT extract facts about the conversation itself (e.g., \"the user asked about...\")\n6. Do NOT extract temporary or session-specific information\n7. Prefer specific facts over general ones\n\nRespond with JSON: { \"facts\": [{ \"fact\": \"...\", \"category\": \"...\" }] }\n\nCategories: coding_style, tools, architecture, conventions, debugging, workflow, preferences";
|
|
2
|
-
export declare const FACT_EXTRACTION_USER_TEMPLATE = "Extract developer knowledge facts from this text:\n\n<text>\n{content}\n</text>";
|
|
3
|
-
export declare function buildSystemPrompt(): string;
|
|
4
|
-
export declare function buildExtractionPrompt(content: string): string;
|
|
5
|
-
//# sourceMappingURL=prompts.d.ts.map
|
package/dist/memory/prompts.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
export const FACT_EXTRACTION_SYSTEM_PROMPT = `You are a developer knowledge extractor. Your job is to extract discrete, factual statements from conversations about software development.
|
|
2
|
-
|
|
3
|
-
Extract facts about:
|
|
4
|
-
- **coding_style**: Formatting preferences (tabs/spaces, naming conventions, line length), code style rules
|
|
5
|
-
- **tools**: Preferred tools, frameworks, libraries, test runners, bundlers, linters, editors
|
|
6
|
-
- **architecture**: Design patterns, architectural decisions, system design preferences
|
|
7
|
-
- **conventions**: Project conventions, commit message formats, branch naming, PR workflows
|
|
8
|
-
- **debugging**: Solutions to specific bugs, debugging techniques, known issues
|
|
9
|
-
- **workflow**: Development habits, deployment processes, review preferences
|
|
10
|
-
- **preferences**: General preferences, opinions, requirements that don't fit other categories
|
|
11
|
-
|
|
12
|
-
Rules:
|
|
13
|
-
1. Extract only factual, concrete statements — not vague observations
|
|
14
|
-
2. Each fact should be a single, self-contained statement
|
|
15
|
-
3. Use third person ("The user prefers..." or state the fact directly)
|
|
16
|
-
4. If the input contains no extractable facts, return an empty array
|
|
17
|
-
5. Do NOT extract facts about the conversation itself (e.g., "the user asked about...")
|
|
18
|
-
6. Do NOT extract temporary or session-specific information
|
|
19
|
-
7. Prefer specific facts over general ones
|
|
20
|
-
|
|
21
|
-
Respond with JSON: { "facts": [{ "fact": "...", "category": "..." }] }
|
|
22
|
-
|
|
23
|
-
Categories: coding_style, tools, architecture, conventions, debugging, workflow, preferences`;
|
|
24
|
-
export const FACT_EXTRACTION_USER_TEMPLATE = `Extract developer knowledge facts from this text:
|
|
25
|
-
|
|
26
|
-
<text>
|
|
27
|
-
{content}
|
|
28
|
-
</text>`;
|
|
29
|
-
export function buildSystemPrompt() {
|
|
30
|
-
const today = new Date().toISOString().slice(0, 10);
|
|
31
|
-
return `${FACT_EXTRACTION_SYSTEM_PROMPT}\n- Today's date is ${today}.`;
|
|
32
|
-
}
|
|
33
|
-
export function buildExtractionPrompt(content) {
|
|
34
|
-
return FACT_EXTRACTION_USER_TEMPLATE.replace('{content}', content);
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=prompts.js.map
|