{"_id":"@byterover/brv-bridge","_rev":"9-cc162cb043feb32f1fc67c3fd86a93d3","name":"@byterover/brv-bridge","dist-tags":{"latest":"1.2.0"},"versions":{"1.0.0":{"name":"@byterover/brv-bridge","version":"1.0.0","keywords":["byterover","context-tree","agent","memory","bridge"],"author":{"name":"ByteRover"},"license":"Elastic-2.0","_id":"@byterover/brv-bridge@1.0.0","maintainers":[{"name":"byterover","email":"andy@byterover.dev"}],"homepage":"https://github.com/campfirein/brv-bridge#readme","bugs":{"url":"https://github.com/campfirein/brv-bridge/issues"},"dist":{"shasum":"27573a0ead3024b2799d84c0fa49d5d03f2aceb9","tarball":"https://registry.npmjs.org/@byterover/brv-bridge/-/brv-bridge-1.0.0.tgz","fileCount":19,"integrity":"sha512-3bubKFplf534JlLjUMieM1RmnNd5L/bA4HzjpTYqk5WaKE2Z3wyCglih/LfGiL0TIDIcrW7ygnbrzgWWjj8/Rg==","signatures":[{"sig":"MEUCIQCb47D2KWXonMK3f89iH8FjMNuMbOJfFzdNID857d5UNgIgTbfvx3Bg8HMFqz7GFHRXHnXd9K7ttWBs87Q8cfBRb9Q=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":36635},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"a1206f05b913db897aca5d4c5239f3aa0000fd82","scripts":{"dev":"tsc --watch","test":"vitest run --dir test","build":"rm -rf dist && tsc","clean":"rm -rf dist","typecheck":"tsc --noEmit","test:watch":"vitest --dir test","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"byterover","email":"andy@byterover.dev"},"repository":{"url":"git+https://github.com/campfirein/brv-bridge.git","type":"git"},"_npmVersion":"10.9.4","description":"Standard interface for connecting agent frameworks to ByteRover's Context Tree.","directories":{},"_nodeVersion":"24.13.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.0.0","typescript":"^5.7.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/brv-bridge_1.0.0_1775121805415_0.5293367613970836","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@byterover/brv-bridge","version":"1.0.1","keywords":["byterover","context-tree","agent","memory","bridge"],"author":{"name":"ByteRover"},"license":"Elastic-2.0","_id":"@byterover/brv-bridge@1.0.1","maintainers":[{"name":"byterover","email":"andy@byterover.dev"}],"homepage":"https://github.com/campfirein/brv-bridge#readme","bugs":{"url":"https://github.com/campfirein/brv-bridge/issues"},"dist":{"shasum":"a88fbf371e0abab7699395859314afe898e06f49","tarball":"https://registry.npmjs.org/@byterover/brv-bridge/-/brv-bridge-1.0.1.tgz","fileCount":19,"integrity":"sha512-LNJLwsCHbkaf+kF3jCxZNUsGGJx8xsJ+F+yOl3V0LnVjGmgzTldIVSG2cyO/JOb3h4w6Zzb2EeBa7GHkqskkhw==","signatures":[{"sig":"MEQCICgqtEklsPVog6aXjzIUgrIHFhOUssbO13RLJyaHeyhQAiA6x5WhWHNEMI9m+fAf9ILf7U3jBORfvV6YoeO/9baV0A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":36725},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"40c11a6d59282967e00df6a4d9628d130347b830","scripts":{"dev":"tsc --watch","test":"vitest run --dir test","build":"rm -rf dist && tsc","clean":"rm -rf dist","typecheck":"tsc --noEmit","test:watch":"vitest --dir test","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"byterover","email":"andy@byterover.dev"},"deprecated":"broken: use 1.0.2","repository":{"url":"git+https://github.com/campfirein/brv-bridge.git","type":"git"},"_npmVersion":"10.9.4","description":"Standard interface for connecting agent frameworks to ByteRover's Context Tree.","directories":{},"_nodeVersion":"24.13.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.0.0","typescript":"^5.7.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/brv-bridge_1.0.1_1775214264164_0.04913292468720809","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@byterover/brv-bridge","version":"1.0.2","keywords":["byterover","context-tree","agent","memory","bridge"],"author":{"name":"ByteRover"},"license":"Elastic-2.0","_id":"@byterover/brv-bridge@1.0.2","maintainers":[{"name":"byterover","email":"andy@byterover.dev"}],"homepage":"https://github.com/campfirein/brv-bridge#readme","bugs":{"url":"https://github.com/campfirein/brv-bridge/issues"},"dist":{"shasum":"0216af4bc70b1f5f2dada07a22f20688688cb233","tarball":"https://registry.npmjs.org/@byterover/brv-bridge/-/brv-bridge-1.0.2.tgz","fileCount":19,"integrity":"sha512-ItXoPdDdzklFtvT+h2jkDsCjOglJPk/hp1OyQQshHNWQNn8cslCMlLbWf9ELs2ZtTIGCDBqJA+GPCZGRa0Cg5A==","signatures":[{"sig":"MEYCIQDzHXV9OvojkJ2GFmD46KT6CtR1EjZEDSQ8+Cw9K36BRQIhAOd7Lxeo5MXmRNzaGo1b81UPATheAzbQKIiG5WxlCrpo","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":36635},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"c11c453ce11f4f7d037b5f5f5cbc23bfb34b8d87","scripts":{"dev":"tsc --watch","test":"vitest run --dir test","build":"rm -rf dist && tsc","clean":"rm -rf dist","typecheck":"tsc --noEmit","test:watch":"vitest --dir test","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"byterover","email":"andy@byterover.dev"},"repository":{"url":"git+https://github.com/campfirein/brv-bridge.git","type":"git"},"_npmVersion":"10.9.4","description":"Standard interface for connecting agent frameworks to ByteRover's Context Tree.","directories":{},"_nodeVersion":"24.13.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.0.0","typescript":"^5.7.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/brv-bridge_1.0.2_1775226459659_0.3263159305457328","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@byterover/brv-bridge","version":"1.1.0","keywords":["byterover","context-tree","agent","memory","bridge"],"author":{"name":"ByteRover"},"license":"Elastic-2.0","_id":"@byterover/brv-bridge@1.1.0","maintainers":[{"name":"byterover","email":"andy@byterover.dev"}],"homepage":"https://github.com/campfirein/brv-bridge#readme","bugs":{"url":"https://github.com/campfirein/brv-bridge/issues"},"dist":{"shasum":"cc9ef163bfaa95deaa373de43c4d8977c3449d69","tarball":"https://registry.npmjs.org/@byterover/brv-bridge/-/brv-bridge-1.1.0.tgz","fileCount":19,"integrity":"sha512-ntQN5HzE+XqJm2ijfxk2fQZygWJBfqf3dv3DUU6XoL+XhNlaXhbJAqNII1hkCWKRAJz0L4mJVxG25WC/qOQphQ==","signatures":[{"sig":"MEUCIQC647uWKyB7Z+LXJR8at2Mm8M36v4sfoVR+0WNwmE6HagIgTcZu1+G8O69VlrjUQoUiOZjcBw3n5pjRbh711gF2exc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":44668},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"eed6cb6e437c018b523e99dab3d48c80f97b2ed9","scripts":{"dev":"tsc --watch","test":"vitest run --dir test","build":"rm -rf dist && tsc","clean":"rm -rf dist","typecheck":"tsc --noEmit","test:watch":"vitest --dir test","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"byterover","email":"andy@byterover.dev"},"repository":{"url":"git+https://github.com/campfirein/brv-bridge.git","type":"git"},"_npmVersion":"10.9.4","description":"Standard interface for connecting agent frameworks to ByteRover's Context Tree.","directories":{},"_nodeVersion":"22.22.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.0.0","typescript":"^5.7.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/brv-bridge_1.1.0_1775916178766_0.5185087442898875","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@byterover/brv-bridge","version":"1.2.0","keywords":["byterover","context-tree","agent","memory","bridge"],"author":{"name":"ByteRover"},"license":"Elastic-2.0","_id":"@byterover/brv-bridge@1.2.0","maintainers":[{"name":"byterover","email":"andy@byterover.dev"}],"homepage":"https://github.com/campfirein/brv-bridge#readme","bugs":{"url":"https://github.com/campfirein/brv-bridge/issues"},"dist":{"shasum":"005c68e47be70975dabc5609753dd64e25e7bbde","tarball":"https://registry.npmjs.org/@byterover/brv-bridge/-/brv-bridge-1.2.0.tgz","fileCount":19,"integrity":"sha512-M7cQ0CbwOwDIwWRAZYiHMEZ8eQrz2UYGX4ZxqvymlZYxzXdeBjUq4pCfpRJMCaYw+rEfgzf9cgVTvejY4NJroA==","signatures":[{"sig":"MEYCIQDhRV+1b04idpvdlB+7u2/bGIsxMp7wq59gaQNiRapUhwIhAJbyb3NSrj6Q3/62Wnu/+Q7yI1G6+VqaujnrHnq+4lbl","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":48408},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"22450391f5822469eb7bd6554558e38c4051b75c","scripts":{"dev":"tsc --watch","test":"vitest run --dir test","build":"rm -rf dist && tsc","clean":"rm -rf dist","typecheck":"tsc --noEmit","test:watch":"vitest --dir test","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"byterover","email":"andy@byterover.dev"},"repository":{"url":"git+https://github.com/campfirein/brv-bridge.git","type":"git"},"_npmVersion":"10.9.4","description":"Standard interface for connecting agent frameworks to ByteRover's Context Tree.","directories":{},"_nodeVersion":"22.22.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.0.0","typescript":"^5.7.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/brv-bridge_1.2.0_1778055981321_0.4620325270354173","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2026-04-02T09:23:25.322Z","modified":"2026-07-05T03:44:45.027Z","1.0.0":"2026-04-02T09:23:25.560Z","1.0.1":"2026-04-03T11:04:24.314Z","1.0.2":"2026-04-03T14:27:39.805Z","1.1.0":"2026-04-11T14:02:58.895Z","1.2.0":"2026-05-06T08:26:21.491Z"},"bugs":{"url":"https://github.com/campfirein/brv-bridge/issues"},"author":{"name":"ByteRover"},"license":"Elastic-2.0","homepage":"https://github.com/campfirein/brv-bridge#readme","keywords":["byterover","context-tree","agent","memory","bridge"],"repository":{"url":"git+https://github.com/campfirein/brv-bridge.git","type":"git"},"description":"Standard interface for connecting agent frameworks to ByteRover's Context Tree.","maintainers":[{"email":"bao@byterover.dev","name":"baobyterover"},{"email":"andy@byterover.dev","name":"byteroverinc"},{"email":"lincoln@byterover.dev","name":"lincoln_byterover"}],"readme":"# brv-bridge\n\nStandard interface for connecting agent frameworks to [ByteRover](https://www.byterover.dev)'s Context Tree.\n\nAny agent harness that implements the bridge gets context sharing for free - recall curated knowledge before a turn, persist new knowledge after a turn, and search the context tree for structured file results.\n\n## Install\n\n```bash\nnpm install @byterover/brv-bridge\n```\n\n**Prerequisites:** [ByteRover CLI](https://www.byterover.dev) installed and a space initialized.\n\n## Usage\n\n```typescript\nimport { BrvBridge } from \"@byterover/brv-bridge\";\n\nconst bridge = new BrvBridge({ cwd: \"/path/to/project\" });\n\n// Check if brv is set up\nif (await bridge.ready()) {\n  // Retrieve relevant context (synthesized answer)\n  const { content } = await bridge.recall(\"what did we decide about auth?\");\n\n  // Search for structured file results (paths, scores, excerpts)\n  const { results } = await bridge.search(\"authentication\");\n  for (const r of results) {\n    console.log(`${r.title} [${r.score}] — ${r.path}`);\n  }\n\n  // Store knowledge\n  await bridge.persist(\"User prefers JWT over session cookies\");\n}\n\n// Clean up\nawait bridge.shutdown();\n```\n\n## API\n\n### `new BrvBridge(config)`\n\n| Option | Type | Default | Description |\n|---|---|---|---|\n| `cwd` | `string` | `process.cwd()` | Working directory with `.brv/` initialized |\n| `brvPath` | `string` | `\"brv\"` | Path to the brv binary |\n| `recallTimeoutMs` | `number` | `10000` | Timeout for recall operations |\n| `persistTimeoutMs` | `number` | `60000` | Timeout for persist operations |\n| `searchTimeoutMs` | `number` | `5000` | Timeout for search operations |\n| `logger` | `BrvLogger` | no-op | Logger instance |\n\n### `bridge.ready(): Promise<boolean>`\n\nCheck if the bridge is configured — verifies `cwd` exists and has a `.brv` directory. Does not make network calls.\n\n### `bridge.recall(query, options?): Promise<RecallResult>`\n\nRetrieve relevant context from the Context Tree. Returns `{ content: \"\" }` on failure — never throws.\n\nOptions: `signal` (AbortSignal), `cwd` (override per-call).\n\n### `bridge.persist(context, options?): Promise<PersistResult>`\n\nStore context into the Context Tree. Defaults to detach mode (fire-and-forget). Returns `{ status, message? }`.\n\nOptions: `detach` (default `true`), `cwd` (override per-call).\n\n### `bridge.search(query, options?): Promise<SearchResult>`\n\nSearch the Context Tree for structured file results. Returns ranked results with paths, scores, and excerpts. Pure BM25 retrieval - no LLM, no token cost.\n\nUnlike `recall()` which returns a synthesized answer, `search()` returns individual file-level results.\n\nOptions: `limit` (default `10`, max `50`), `scope` (path prefix, no trailing slash), `cwd` (override per-call).\n\n```typescript\nconst { results, totalFound } = await bridge.search(\"authentication\", {\n  limit: 5,\n  scope: \"auth\",\n});\n// results: [{ path, title, excerpt, score, symbolKind?, backlinkCount? }]\n```\n\n### `bridge.shutdown(): Promise<void>`\n\nClean up resources. Adapters should call this for forward compatibility.\n\n## For adapter authors\n\nThe bridge is designed to be wrapped by framework-specific adapters. Each adapter maps its framework's lifecycle hooks to `recall()`, `persist()`, and `search()`:\n\n```typescript\n// OpenClaw adapter example\nclass ByteRoverContextEngine {\n  private bridge = new BrvBridge({ cwd, logger });\n\n  async assemble(params) {\n    const { content } = await this.bridge.recall(query);\n    // inject content into system prompt\n  }\n\n  async afterTurn(params) {\n    await this.bridge.persist(serializedConversation);\n  }\n}\n```\n\n## License\n\n[Elastic License 2.0 (ELv2)](./LICENSE)\n","readmeFilename":"README.md"}