brain-cache 0.3.0 → 0.3.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.
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-GGOUKACO.js";
5
5
  import {
6
6
  runBuildContext
7
- } from "./chunk-ABKGOJTC.js";
7
+ } from "./chunk-H4XSGUHL.js";
8
8
  import "./chunk-5FXXZBZV.js";
9
9
  import "./chunk-BF5UDEIF.js";
10
10
  import "./chunk-GR6QXZ4J.js";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runBuildContext
4
- } from "./chunk-ABKGOJTC.js";
4
+ } from "./chunk-H4XSGUHL.js";
5
5
  import "./chunk-5FXXZBZV.js";
6
6
  import "./chunk-BF5UDEIF.js";
7
7
  import "./chunk-GR6QXZ4J.js";
@@ -59,7 +59,7 @@ async function runBuildContext(query, opts) {
59
59
  `brain-cache: building context (intent=${intent}, budget=${maxTokens} tokens)
60
60
  `
61
61
  );
62
- const vectors = await embedBatchWithRetry(indexState.embeddingModel, [query]);
62
+ const { embeddings: vectors } = await embedBatchWithRetry(indexState.embeddingModel, [query]);
63
63
  const queryVector = vectors[0];
64
64
  const results = await searchChunks(table, queryVector, strategy);
65
65
  const deduped = deduplicateChunks(results);
package/dist/cli.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
 
6
6
  // src/cli/index.ts
7
7
  import { Command } from "commander";
8
- var version = "0.3.0";
8
+ var version = "0.3.1";
9
9
  var program = new Command();
10
10
  program.name("brain-cache").description("Local AI runtime \u2014 GPU cache layer for Claude").version(version);
11
11
  program.command("init").description("Detect hardware, pull embedding model, create config directory").action(async () => {
@@ -21,7 +21,7 @@ program.command("index").description("Index a codebase: parse, chunk, embed, and
21
21
  await runIndex(path, { force: opts.force });
22
22
  });
23
23
  program.command("search").description("Search indexed codebase with a natural language query").argument("<query>", "Natural language query string").option("-n, --limit <n>", "Maximum number of results", "10").option("-p, --path <path>", "Project root directory").action(async (query, opts) => {
24
- const { runSearch } = await import("./search-BF7QY64J.js");
24
+ const { runSearch } = await import("./search-ZP4NKKAZ.js");
25
25
  await runSearch(query, {
26
26
  limit: parseInt(opts.limit, 10),
27
27
  path: opts.path
@@ -35,7 +35,7 @@ program.command("status").description(
35
35
  });
36
36
  program.command("context").description("Build token-budgeted context from codebase for a query").argument("<query>", "Natural language query string").option("-n, --limit <n>", "Maximum number of search results", "10").option("-b, --budget <tokens>", "Token budget for assembled context", "4096").option("-p, --path <path>", "Project root directory").option("--raw", "Output raw JSON (MCP transport compatible)").action(
37
37
  async (query, opts) => {
38
- const { runBuildContext } = await import("./buildContext-JKYV7CCP.js");
38
+ const { runBuildContext } = await import("./buildContext-AHUWIN6M.js");
39
39
  const result = await runBuildContext(query, {
40
40
  limit: parseInt(opts.limit, 10),
41
41
  maxTokens: parseInt(opts.budget, 10),
@@ -61,7 +61,7 @@ ${formatTokenSavings({ tokensSent: result.metadata.tokensSent, estimatedWithout,
61
61
  program.command("ask").description(
62
62
  "Ask a natural language question about the codebase \u2014 retrieves context locally, reasons via Claude"
63
63
  ).argument("<question>", "Natural language question about the codebase").option("-b, --budget <tokens>", "Token budget for context retrieval", "4096").option("-p, --path <path>", "Project root directory").action(async (question, opts) => {
64
- const { runAskCodebase } = await import("./askCodebase-DTII3Y6P.js");
64
+ const { runAskCodebase } = await import("./askCodebase-GXUB6477.js");
65
65
  const result = await runAskCodebase(question, {
66
66
  path: opts.path,
67
67
  maxContextTokens: parseInt(opts.budget, 10)
package/dist/mcp.js CHANGED
@@ -1062,7 +1062,7 @@ async function runSearch(query, opts) {
1062
1062
  `brain-cache: searching (intent=${intent}, limit=${strategy.limit})
1063
1063
  `
1064
1064
  );
1065
- const vectors = await embedBatchWithRetry(indexState.embeddingModel, [query]);
1065
+ const { embeddings: vectors } = await embedBatchWithRetry(indexState.embeddingModel, [query]);
1066
1066
  const queryVector = vectors[0];
1067
1067
  const results = await searchChunks(table, queryVector, strategy);
1068
1068
  const deduped = deduplicateChunks(results);
@@ -1112,7 +1112,7 @@ async function runBuildContext(query, opts) {
1112
1112
  `brain-cache: building context (intent=${intent}, budget=${maxTokens} tokens)
1113
1113
  `
1114
1114
  );
1115
- const vectors = await embedBatchWithRetry(indexState.embeddingModel, [query]);
1115
+ const { embeddings: vectors } = await embedBatchWithRetry(indexState.embeddingModel, [query]);
1116
1116
  const queryVector = vectors[0];
1117
1117
  const results = await searchChunks(table, queryVector, strategy);
1118
1118
  const deduped = deduplicateChunks(results);
@@ -1146,7 +1146,7 @@ async function runBuildContext(query, opts) {
1146
1146
  }
1147
1147
 
1148
1148
  // src/mcp/index.ts
1149
- var version = "0.3.0";
1149
+ var version = "0.3.1";
1150
1150
  var log9 = childLogger("mcp");
1151
1151
  var server = new McpServer({ name: "brain-cache", version });
1152
1152
  server.registerTool(
@@ -61,7 +61,7 @@ async function runSearch(query, opts) {
61
61
  `brain-cache: searching (intent=${intent}, limit=${strategy.limit})
62
62
  `
63
63
  );
64
- const vectors = await embedBatchWithRetry(indexState.embeddingModel, [query]);
64
+ const { embeddings: vectors } = await embedBatchWithRetry(indexState.embeddingModel, [query]);
65
65
  const queryVector = vectors[0];
66
66
  const results = await searchChunks(table, queryVector, strategy);
67
67
  const deduped = deduplicateChunks(results);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brain-cache",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Local MCP-first context engine for Claude. Index your codebase, retrieve only what matters, and cut token usage.",
5
5
  "license": "MIT",
6
6
  "type": "module",