pi-byterover 0.1.8
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/LICENSE +21 -0
- package/README.md +97 -0
- package/dist/config-loader.d.ts +17 -0
- package/dist/config.d.ts +38 -0
- package/dist/gitignore.d.ts +2 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +5121 -0
- package/dist/lru-cache.d.ts +7 -0
- package/dist/messages.d.ts +15 -0
- package/dist/recall.d.ts +1 -0
- package/dist/tools.d.ts +19 -0
- package/package.json +82 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ian Pascoe
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# pi-byterover
|
|
2
|
+
|
|
3
|
+
`pi-byterover` connects Pi sessions to ByteRover through `@byterover/brv-bridge`.
|
|
4
|
+
|
|
5
|
+
It automatically recalls relevant ByteRover memory before an agent response and injects that context into the session. After useful completed turns, it persists durable facts, decisions, preferences, and technical details back to ByteRover.
|
|
6
|
+
|
|
7
|
+
## Prerequisites
|
|
8
|
+
|
|
9
|
+
- Pi installed.
|
|
10
|
+
- ByteRover CLI installed as `brv`, or a custom executable path configured with `brvPath`.
|
|
11
|
+
- A project where ByteRover can bootstrap and use `.brv` state.
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
Install the package with Pi:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pi install npm:pi-byterover
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
For local development:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
pnpm install
|
|
25
|
+
pnpm build
|
|
26
|
+
pi -e ./dist/index.js
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Configuration
|
|
30
|
+
|
|
31
|
+
Configure `pi-byterover` with either a project config file or a global config file:
|
|
32
|
+
|
|
33
|
+
- Project: `.pi/byterover.json`
|
|
34
|
+
- Global: `~/.pi/agent/byterover.json`
|
|
35
|
+
|
|
36
|
+
Project configuration takes precedence over global configuration. If no config file is present, defaults are used.
|
|
37
|
+
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"enabled": true,
|
|
41
|
+
"brvPath": "brv",
|
|
42
|
+
"searchTimeoutMs": 30000,
|
|
43
|
+
"recallTimeoutMs": 30000,
|
|
44
|
+
"persistTimeoutMs": 60000,
|
|
45
|
+
"quiet": false,
|
|
46
|
+
"autoRecall": true,
|
|
47
|
+
"autoPersist": true,
|
|
48
|
+
"manualTools": true,
|
|
49
|
+
"contextTagName": "byterover-context",
|
|
50
|
+
"recallPrompt": "Recall any relevant context that would help answer the latest user message.\nUse the recent conversation only to resolve references and intent.\nDo not restate the query in your findings.",
|
|
51
|
+
"persistPrompt": "The following is a conversation between a user and an AI assistant.\nCurate only information with lasting value: facts, decisions, technical details, preferences, or notable outcomes.\nSkip trivial messages such as greetings, acknowledgments (\"ok\", \"thanks\", \"sure\", \"got it\"), one-word replies, anything with no substantive content.",
|
|
52
|
+
"maxRecallTurns": 3,
|
|
53
|
+
"maxRecallChars": 4096
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Configuration fields:
|
|
58
|
+
|
|
59
|
+
- `enabled`: Enable or disable the package without removing configuration. Defaults to `true`.
|
|
60
|
+
- `brvPath`: ByteRover CLI executable path. Defaults to `brv`.
|
|
61
|
+
- `searchTimeoutMs`: ByteRover search timeout in milliseconds. Defaults to `30000`.
|
|
62
|
+
- `recallTimeoutMs`: ByteRover recall timeout in milliseconds. Defaults to `30000`.
|
|
63
|
+
- `persistTimeoutMs`: ByteRover persist timeout in milliseconds. Defaults to `60000`.
|
|
64
|
+
- `quiet`: Suppress Pi notifications for ByteRover operations. Defaults to `false`.
|
|
65
|
+
- `autoRecall`: Automatically recall and inject ByteRover context before agent responses. Defaults to `true`.
|
|
66
|
+
- `autoPersist`: Automatically persist useful completed conversation turns after responses. Defaults to `true`.
|
|
67
|
+
- `manualTools`: Register manual ByteRover tools. Defaults to `true`.
|
|
68
|
+
- `contextTagName`: XML-style tag name used for injected recall context. Defaults to `byterover-context`.
|
|
69
|
+
- `recallPrompt`: Instruction text prepended to recent conversation context for automatic recall.
|
|
70
|
+
- `persistPrompt`: Instruction text prepended to completed turns for automatic persistence curation.
|
|
71
|
+
- `maxRecallTurns`: Maximum recent user turns used to resolve automatic recall context. Defaults to `3`.
|
|
72
|
+
- `maxRecallChars`: Maximum recent conversation characters used for automatic recall. Defaults to `4096`.
|
|
73
|
+
|
|
74
|
+
Numeric timeout and limit values must be positive integers. `brvPath`, `recallPrompt`, and `persistPrompt` must be non-empty strings. `contextTagName` must be a simple XML-style tag name such as `byterover-context`.
|
|
75
|
+
|
|
76
|
+
Persist does not require ByteRover to be ready ahead of time. ByteRover bootstraps automatically when persist is called.
|
|
77
|
+
|
|
78
|
+
## Manual Tools
|
|
79
|
+
|
|
80
|
+
When `manualTools` is enabled, Pi agents can use these ByteRover tools:
|
|
81
|
+
|
|
82
|
+
- `brv_recall`: Ask ByteRover to synthesize relevant memory for a query. Use it when the agent needs targeted, summarized context beyond automatic recall. Accepts optional `timeoutMs`.
|
|
83
|
+
- `brv_search`: Search ByteRover memory and return ranked file-level results. Use it when the agent needs to inspect matching memory sources or compare multiple candidates. Accepts optional `limit`, `scope`, and `timeoutMs`.
|
|
84
|
+
- `brv_persist`: Persist raw memory text directly into ByteRover. Use it when a durable fact, decision, preference, or technical detail should be saved immediately instead of waiting for automatic turn persistence. Defaults to fire-and-forget mode and accepts optional `timeoutMs` for long-running writes.
|
|
85
|
+
|
|
86
|
+
With `autoRecall` and `autoPersist` enabled, routine memory behavior is automatic. Manual tools are best for explicit lookups, source searches, or immediate saves.
|
|
87
|
+
|
|
88
|
+
## Development
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
pnpm install
|
|
92
|
+
pnpm format:check
|
|
93
|
+
pnpm lint
|
|
94
|
+
pnpm test
|
|
95
|
+
pnpm typecheck
|
|
96
|
+
pnpm build
|
|
97
|
+
```
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type * as z from "zod/v4";
|
|
2
|
+
import { ConfigSchema } from "./config.js";
|
|
3
|
+
export type ByteroverConfig = z.infer<typeof ConfigSchema>;
|
|
4
|
+
export type LoadConfigOptions = {
|
|
5
|
+
cwd: string;
|
|
6
|
+
homeDir?: string;
|
|
7
|
+
};
|
|
8
|
+
export type LoadConfigResult = {
|
|
9
|
+
success: true;
|
|
10
|
+
config: ByteroverConfig;
|
|
11
|
+
source?: string;
|
|
12
|
+
} | {
|
|
13
|
+
success: false;
|
|
14
|
+
source: string;
|
|
15
|
+
error: Error;
|
|
16
|
+
};
|
|
17
|
+
export declare const loadConfig: ({ cwd, homeDir, }: LoadConfigOptions) => Promise<LoadConfigResult>;
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
export declare const brvGitignoreBeginMarker = "# BEGIN pi-byterover";
|
|
3
|
+
export declare const brvGitignoreEndMarker = "# END pi-byterover";
|
|
4
|
+
export declare const brvGitignoreRules = "# Dream state and logs\ndream-log/\ndream-state.json\ndream.lock\n\n# Review backups\nreview-backups/\n\n# Generated files\nconfig.json\n_queue_status.json\n.snapshot.json\n_manifest.json\n_index.md\n*.abstract.md\n*.overview.md\n";
|
|
5
|
+
export declare const brvGitignore = "# BEGIN pi-byterover\n# Dream state and logs\ndream-log/\ndream-state.json\ndream.lock\n\n# Review backups\nreview-backups/\n\n# Generated files\nconfig.json\n_queue_status.json\n.snapshot.json\n_manifest.json\n_index.md\n*.abstract.md\n*.overview.md\n# END pi-byterover\n";
|
|
6
|
+
export declare const configDefaults: {
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
brvPath: string;
|
|
9
|
+
searchTimeoutMs: number;
|
|
10
|
+
recallTimeoutMs: number;
|
|
11
|
+
persistTimeoutMs: number;
|
|
12
|
+
quiet: boolean;
|
|
13
|
+
autoRecall: boolean;
|
|
14
|
+
autoPersist: boolean;
|
|
15
|
+
manualTools: boolean;
|
|
16
|
+
contextTagName: string;
|
|
17
|
+
recallPrompt: string;
|
|
18
|
+
persistPrompt: string;
|
|
19
|
+
maxRecallTurns: number;
|
|
20
|
+
maxRecallChars: number;
|
|
21
|
+
};
|
|
22
|
+
export declare const maxCuratedTurnCacheSize = 500;
|
|
23
|
+
export declare const ConfigSchema: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
24
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
25
|
+
brvPath: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
26
|
+
searchTimeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
27
|
+
recallTimeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
28
|
+
persistTimeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
29
|
+
quiet: z.ZodDefault<z.ZodBoolean>;
|
|
30
|
+
autoRecall: z.ZodDefault<z.ZodBoolean>;
|
|
31
|
+
autoPersist: z.ZodDefault<z.ZodBoolean>;
|
|
32
|
+
manualTools: z.ZodDefault<z.ZodBoolean>;
|
|
33
|
+
contextTagName: z.ZodDefault<z.ZodString>;
|
|
34
|
+
recallPrompt: z.ZodDefault<z.ZodString>;
|
|
35
|
+
persistPrompt: z.ZodDefault<z.ZodString>;
|
|
36
|
+
maxRecallTurns: z.ZodDefault<z.ZodNumber>;
|
|
37
|
+
maxRecallChars: z.ZodDefault<z.ZodNumber>;
|
|
38
|
+
}, z.core.$strip>>>;
|
package/dist/index.d.ts
ADDED