botholomew 0.10.0 → 0.11.0
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/package.json +10 -10
- package/src/config/loader.ts +8 -1
- package/src/config/schemas.ts +1 -1
- package/src/constants.ts +8 -0
- package/src/context/embedder-impl.ts +16 -1
- package/src/init/templates.ts +3 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "botholomew",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "An autonomous AI agent for knowledge work — works your task queue while you sleep.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -26,28 +26,28 @@
|
|
|
26
26
|
"docs:preview": "vitepress preview docs"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@anthropic-ai/sdk": "^0.
|
|
29
|
+
"@anthropic-ai/sdk": "^0.92.0",
|
|
30
30
|
"@duckdb/node-api": "^1.5.2-r.1",
|
|
31
|
-
"@evantahler/mcpx": "0.18.
|
|
31
|
+
"@evantahler/mcpx": "0.18.7",
|
|
32
32
|
"@huggingface/transformers": "^4.2.0",
|
|
33
33
|
"ansis": "^4.2.0",
|
|
34
34
|
"commander": "^14.0.0",
|
|
35
35
|
"gray-matter": "^4.0.3",
|
|
36
|
-
"ink": "^
|
|
36
|
+
"ink": "^7.0.1",
|
|
37
37
|
"ink-spinner": "^5.0.0",
|
|
38
38
|
"ink-text-input": "^6.0.0",
|
|
39
39
|
"istextorbinary": "^9.5.0",
|
|
40
40
|
"nanospinner": "^1.2.2",
|
|
41
|
-
"react": "^19.
|
|
42
|
-
"uuid": "^
|
|
43
|
-
"zod": "^4.
|
|
41
|
+
"react": "^19.2.0",
|
|
42
|
+
"uuid": "^14.0.0",
|
|
43
|
+
"zod": "^4.4.2"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@biomejs/biome": "^2.4.
|
|
46
|
+
"@biomejs/biome": "^2.4.14",
|
|
47
47
|
"@types/bun": "latest",
|
|
48
|
-
"@types/react": "^19.
|
|
48
|
+
"@types/react": "^19.2.0",
|
|
49
49
|
"@types/uuid": "^11.0.0",
|
|
50
|
-
"typescript": "^6.0.
|
|
50
|
+
"typescript": "^6.0.3",
|
|
51
51
|
"vitepress": "^1.5.0",
|
|
52
52
|
"vitepress-plugin-llms": "^1.12.1",
|
|
53
53
|
"vue": "^3.5.0"
|
package/src/config/loader.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { mkdirSync } from "node:fs";
|
|
2
|
+
import { getConfigPath, getModelsDir } from "../constants.ts";
|
|
2
3
|
import { setLogLevel } from "../utils/logger.ts";
|
|
3
4
|
import { type BotholomewConfig, DEFAULT_CONFIG } from "./schemas.ts";
|
|
4
5
|
|
|
@@ -22,6 +23,12 @@ export async function loadConfig(
|
|
|
22
23
|
|
|
23
24
|
setLogLevel(config.log_level);
|
|
24
25
|
|
|
26
|
+
const modelsDir = getModelsDir(projectDir);
|
|
27
|
+
mkdirSync(modelsDir, { recursive: true });
|
|
28
|
+
// Dynamic import keeps @huggingface/transformers (heavy, pulls ONNX runtime) out of commands that never embed.
|
|
29
|
+
const { setEmbeddingCacheDir } = await import("../context/embedder-impl.ts");
|
|
30
|
+
setEmbeddingCacheDir(modelsDir);
|
|
31
|
+
|
|
25
32
|
return config;
|
|
26
33
|
}
|
|
27
34
|
|
package/src/config/schemas.ts
CHANGED
|
@@ -19,7 +19,7 @@ export interface BotholomewConfig {
|
|
|
19
19
|
|
|
20
20
|
export const DEFAULT_CONFIG: Required<BotholomewConfig> = {
|
|
21
21
|
anthropic_api_key: "",
|
|
22
|
-
model: "claude-opus-4-
|
|
22
|
+
model: "claude-opus-4-6",
|
|
23
23
|
chunker_model: "claude-haiku-4-5-20251001",
|
|
24
24
|
embedding_model: "Xenova/bge-small-en-v1.5",
|
|
25
25
|
embedding_dimension: 384,
|
package/src/constants.ts
CHANGED
|
@@ -16,6 +16,7 @@ export const DB_FILENAME = "data.duckdb";
|
|
|
16
16
|
export const LOGS_DIR = "logs";
|
|
17
17
|
export const CONFIG_FILENAME = "config.json";
|
|
18
18
|
export const MCPX_DIR = "mcpx";
|
|
19
|
+
export const MODELS_DIR = "models";
|
|
19
20
|
export const SKILLS_DIR = "skills";
|
|
20
21
|
export const MCPX_SERVERS_FILENAME = "servers.json";
|
|
21
22
|
export const EMBEDDING_DIMENSION = 384;
|
|
@@ -45,6 +46,13 @@ export function getMcpxDir(projectDir: string): string {
|
|
|
45
46
|
return join(projectDir, BOTHOLOMEW_DIR, MCPX_DIR);
|
|
46
47
|
}
|
|
47
48
|
|
|
49
|
+
export function getModelsDir(projectDir: string): string {
|
|
50
|
+
return (
|
|
51
|
+
process.env.BOTHOLOMEW_MODELS_DIR_OVERRIDE ??
|
|
52
|
+
join(projectDir, BOTHOLOMEW_DIR, MODELS_DIR)
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
48
56
|
export function getSkillsDir(projectDir: string): string {
|
|
49
57
|
return join(projectDir, BOTHOLOMEW_DIR, SKILLS_DIR);
|
|
50
58
|
}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
1
3
|
import {
|
|
4
|
+
env,
|
|
2
5
|
type FeatureExtractionPipeline,
|
|
3
6
|
pipeline,
|
|
4
7
|
} from "@huggingface/transformers";
|
|
@@ -15,11 +18,23 @@ type EmbedFn = (
|
|
|
15
18
|
// ONNX runtime), so we hold one per model for the life of the process.
|
|
16
19
|
const pipelinePromises = new Map<string, Promise<FeatureExtractionPipeline>>();
|
|
17
20
|
|
|
21
|
+
export function setEmbeddingCacheDir(dir: string): void {
|
|
22
|
+
// Trailing separator matters: transformers.js builds paths as `${cacheDir}${rel}` (no separator).
|
|
23
|
+
env.cacheDir = dir.endsWith("/") ? dir : `${dir}/`;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function isModelCached(model: string): boolean {
|
|
27
|
+
if (!env.cacheDir) return false;
|
|
28
|
+
return existsSync(join(env.cacheDir, model));
|
|
29
|
+
}
|
|
30
|
+
|
|
18
31
|
async function getPipeline(model: string): Promise<FeatureExtractionPipeline> {
|
|
19
32
|
let p = pipelinePromises.get(model);
|
|
20
33
|
if (!p) {
|
|
21
34
|
logger.info(
|
|
22
|
-
|
|
35
|
+
isModelCached(model)
|
|
36
|
+
? `Loading embedding model ${model}`
|
|
37
|
+
: `Loading embedding model ${model} (first run, downloading weights)`,
|
|
23
38
|
);
|
|
24
39
|
p = pipeline("feature-extraction", model);
|
|
25
40
|
pipelinePromises.set(model, p);
|
package/src/init/templates.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { DEFAULT_CONFIG as SCHEMA_DEFAULT_CONFIG } from "../config/schemas.ts";
|
|
2
|
+
|
|
1
3
|
export const SOUL_MD = `---
|
|
2
4
|
loading: always
|
|
3
5
|
agent-modification: false
|
|
@@ -85,11 +87,8 @@ and currently in progress) and format a brief standup-style update with:
|
|
|
85
87
|
`;
|
|
86
88
|
|
|
87
89
|
export const DEFAULT_CONFIG = {
|
|
90
|
+
...SCHEMA_DEFAULT_CONFIG,
|
|
88
91
|
anthropic_api_key: "your-api-key-here",
|
|
89
|
-
model: "claude-opus-4-20250514",
|
|
90
|
-
tick_interval_seconds: 300,
|
|
91
|
-
max_tick_duration_seconds: 120,
|
|
92
|
-
max_turns: 0,
|
|
93
92
|
};
|
|
94
93
|
|
|
95
94
|
export const DEFAULT_MCPX_SERVERS = {
|