@a5c-ai/babysitter-breakpoints 0.1.1 → 0.1.2
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 +4 -3
- package/api/db.js +8 -3
- package/api/server.js +1 -1
- package/bin/breakpoints.js +17 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ npm run dev
|
|
|
18
18
|
|
|
19
19
|
## Run (installed CLI)
|
|
20
20
|
```bash
|
|
21
|
-
breakpoints
|
|
21
|
+
breakpoints start
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
Or run separately:
|
|
@@ -29,8 +29,9 @@ npm run start:worker
|
|
|
29
29
|
|
|
30
30
|
## Configuration
|
|
31
31
|
Environment variables:
|
|
32
|
-
- `PORT` (default
|
|
33
|
-
- `
|
|
32
|
+
- `PORT` (default 3185)
|
|
33
|
+
- `WEB_PORT` (default 3184)
|
|
34
|
+
- `DB_PATH` (default `~/.a5c/breakpoints/db/breakpoints.db`)
|
|
34
35
|
- `REPO_ROOT` (default repo root)
|
|
35
36
|
- `AGENT_TOKEN` (optional)
|
|
36
37
|
- `HUMAN_TOKEN` (optional)
|
package/api/db.js
CHANGED
|
@@ -2,11 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
const fs = require("fs");
|
|
4
4
|
const path = require("path");
|
|
5
|
+
const os = require("os");
|
|
5
6
|
const sqlite3 = require("sqlite3");
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
path.join(
|
|
8
|
+
function defaultDbPath() {
|
|
9
|
+
const home = os.homedir();
|
|
10
|
+
return path.join(home, ".a5c", "breakpoints", "db", "breakpoints.db");
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const DB_PATH = process.env.DB_PATH || defaultDbPath();
|
|
10
14
|
|
|
11
15
|
function openDb() {
|
|
12
16
|
return new sqlite3.Database(DB_PATH);
|
|
@@ -42,6 +46,7 @@ function all(db, sql, params = []) {
|
|
|
42
46
|
async function initDb(db) {
|
|
43
47
|
const schemaPath = path.join(__dirname, "..", "db", "schema.sql");
|
|
44
48
|
const schema = fs.readFileSync(schemaPath, "utf8");
|
|
49
|
+
fs.mkdirSync(path.dirname(DB_PATH), { recursive: true });
|
|
45
50
|
await run(db, "PRAGMA foreign_keys = ON;");
|
|
46
51
|
const statements = schema
|
|
47
52
|
.split(";")
|
package/api/server.js
CHANGED
package/bin/breakpoints.js
CHANGED
|
@@ -7,6 +7,7 @@ const fs = require("fs");
|
|
|
7
7
|
|
|
8
8
|
function usage() {
|
|
9
9
|
console.log(`Usage:
|
|
10
|
+
breakpoints start
|
|
10
11
|
breakpoints run
|
|
11
12
|
breakpoints install-skill [--source <path>] [--target codex|claude|cursor] [--scope local|global]
|
|
12
13
|
breakpoints breakpoint create --question <text> [--run-id <id>] [--title <title>] [--agent-id <id>] [--tag <tag>] [--ttl <seconds>] [--file <path,format,language,label>]
|
|
@@ -21,6 +22,7 @@ function runCommand(command, args, options = {}) {
|
|
|
21
22
|
stdio: "inherit",
|
|
22
23
|
cwd: options.cwd || process.cwd(),
|
|
23
24
|
shell: true,
|
|
25
|
+
env: options.env ? { ...process.env, ...options.env } : process.env,
|
|
24
26
|
});
|
|
25
27
|
proc.on("exit", (code) => {
|
|
26
28
|
process.exitCode = code ?? 1;
|
|
@@ -150,7 +152,20 @@ async function breakpointWait(id, intervalSeconds) {
|
|
|
150
152
|
function runSystem() {
|
|
151
153
|
const repoRoot = path.join(__dirname, "..");
|
|
152
154
|
const runner = path.join(repoRoot, "scripts", "dev-runner.js");
|
|
153
|
-
|
|
155
|
+
const env = {
|
|
156
|
+
DB_PATH:
|
|
157
|
+
process.env.DB_PATH ||
|
|
158
|
+
path.join(
|
|
159
|
+
require("os").homedir(),
|
|
160
|
+
".a5c",
|
|
161
|
+
"breakpoints",
|
|
162
|
+
"db",
|
|
163
|
+
"breakpoints.db"
|
|
164
|
+
),
|
|
165
|
+
PORT: process.env.PORT || "3185",
|
|
166
|
+
WEB_PORT: process.env.WEB_PORT || "3184",
|
|
167
|
+
};
|
|
168
|
+
runCommand("node", [runner], { cwd: repoRoot, env });
|
|
154
169
|
}
|
|
155
170
|
|
|
156
171
|
function installSkill(sourcePath) {
|
|
@@ -216,7 +231,7 @@ if (!cmd || cmd === "--help" || cmd === "-h") {
|
|
|
216
231
|
process.exit(0);
|
|
217
232
|
}
|
|
218
233
|
|
|
219
|
-
if (cmd === "run") {
|
|
234
|
+
if (cmd === "start" || cmd === "run") {
|
|
220
235
|
runSystem();
|
|
221
236
|
return;
|
|
222
237
|
}
|