tracer-sh 0.2.1 → 0.2.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 +11 -1
- package/bin/tracer.mjs +58 -0
- package/package.json +7 -2
- package/packages/server/dist/index.js +494 -48
- package/packages/web/dist/assets/{SearchableSelect-DGHfwNeM.js → SearchableSelect-CGq3RJiX.js} +1 -1
- package/packages/web/dist/assets/{Settings-CM7N7YVW.js → Settings-CSYYBQF1.js} +1 -1
- package/packages/web/dist/assets/{highlighted-body-OFNGDK62-CbmcR8p5.js → highlighted-body-OFNGDK62-CnIKGHSu.js} +1 -1
- package/packages/web/dist/assets/index-_7TPlTNo.js +48 -0
- package/packages/web/dist/assets/{mermaid-GHXKKRXX-BCl4cq6r.js → mermaid-GHXKKRXX-D9p_GS3a.js} +3 -3
- package/packages/web/dist/index.html +1 -1
- package/packages/web/dist/assets/index-Chm2Gi5F.js +0 -48
package/README.md
CHANGED
|
@@ -66,9 +66,19 @@ tracer-sh
|
|
|
66
66
|
|
|
67
67
|
Open `http://localhost:3579`, go to **Settings** to add your API keys and choose an LLM — done.
|
|
68
68
|
|
|
69
|
+
## Headless / CLI
|
|
70
|
+
|
|
71
|
+
Run an investigation from the terminal and get back the final analysis — so other tools and agents (including Claude Code) can drive Tracer:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
tracer-sh analyze "Why did checkout error rate spike after 14:00 UTC?"
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Continue a prior run with `--session <id>`; pass `--json` for the full response (session id, queries, usage). Requires a running server.
|
|
78
|
+
|
|
69
79
|
## Supported Providers
|
|
70
80
|
|
|
71
|
-
**Data:** New Relic (NRQL
|
|
81
|
+
**Data:** New Relic (NRQL), Google Cloud (Logs, Traces, Metrics, Errors), PostHog (HogQL)
|
|
72
82
|
|
|
73
83
|
**LLM:** Anthropic (Claude), Google (Gemini)
|
|
74
84
|
|
package/bin/tracer.mjs
CHANGED
|
@@ -10,6 +10,64 @@ const serverPath = resolve(__dirname, "../packages/server/dist/index.js");
|
|
|
10
10
|
// Must match RESTART_EXIT_CODE in packages/server/src/updater.ts
|
|
11
11
|
const RESTART_EXIT_CODE = 75;
|
|
12
12
|
|
|
13
|
+
// `tracer analyze "<message>" [--session <id>] [--provider <name>] [--json]`
|
|
14
|
+
// Runs the investigation agent on the already-running local server and prints
|
|
15
|
+
// the final analysis. Lets other local agents (e.g. Claude Code) drive Tracer.
|
|
16
|
+
if (process.argv[2] === "analyze") {
|
|
17
|
+
await runAnalyze(process.argv.slice(3));
|
|
18
|
+
process.exit(0);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
async function runAnalyze(args) {
|
|
22
|
+
let message;
|
|
23
|
+
let sessionId;
|
|
24
|
+
let provider;
|
|
25
|
+
let asJson = false;
|
|
26
|
+
|
|
27
|
+
for (let i = 0; i < args.length; i++) {
|
|
28
|
+
const a = args[i];
|
|
29
|
+
if (a === "--json") asJson = true;
|
|
30
|
+
else if (a === "--session" || a === "-s") sessionId = args[++i];
|
|
31
|
+
else if (a === "--provider" || a === "-p") provider = args[++i];
|
|
32
|
+
else if (message === undefined) message = a;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (!message) {
|
|
36
|
+
console.error('Usage: tracer-sh analyze "<message>" [--session <id>] [--provider <name>] [--json]');
|
|
37
|
+
process.exit(2);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const host = process.env.TRACER_HOST || "127.0.0.1";
|
|
41
|
+
const port = process.env.TRACER_PORT || "3579";
|
|
42
|
+
const url = `http://${host}:${port}/api/v1/analyze`;
|
|
43
|
+
|
|
44
|
+
let res;
|
|
45
|
+
try {
|
|
46
|
+
res = await fetch(url, {
|
|
47
|
+
method: "POST",
|
|
48
|
+
headers: { "content-type": "application/json" },
|
|
49
|
+
body: JSON.stringify({ message, sessionId, provider }),
|
|
50
|
+
});
|
|
51
|
+
} catch {
|
|
52
|
+
console.error(`Could not reach Tracer at ${url}. Is the server running? Start it with: tracer-sh`);
|
|
53
|
+
process.exit(1);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const data = await res.json().catch(() => ({}));
|
|
57
|
+
|
|
58
|
+
if (!res.ok || data.status === "error") {
|
|
59
|
+
console.error(`Error: ${data.error || res.statusText}`);
|
|
60
|
+
process.exit(1);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (asJson) {
|
|
64
|
+
process.stdout.write(JSON.stringify(data, null, 2) + "\n");
|
|
65
|
+
} else {
|
|
66
|
+
process.stdout.write((data.analysis || "") + "\n");
|
|
67
|
+
console.error(`session ${data.sessionId}${data.model ? ` · ${data.model}` : ""}`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
13
71
|
const banner = `
|
|
14
72
|
╔═══════════════════════════════════╗
|
|
15
73
|
║ Tracer Debug Platform ║
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tracer-sh",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Local-first debugging & analysis platform",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -34,7 +34,12 @@
|
|
|
34
34
|
"onlyBuiltDependencies": [
|
|
35
35
|
"better-sqlite3",
|
|
36
36
|
"esbuild"
|
|
37
|
-
]
|
|
37
|
+
],
|
|
38
|
+
"overrides": {
|
|
39
|
+
"mermaid": "^11.15.0",
|
|
40
|
+
"postcss": "^8.5.10",
|
|
41
|
+
"uuid": "^11.1.1"
|
|
42
|
+
}
|
|
38
43
|
},
|
|
39
44
|
"devDependencies": {
|
|
40
45
|
"concurrently": "^9.2.1",
|