-
Notifications
You must be signed in to change notification settings - Fork 134
Expand file tree
/
Copy pathsession-analysis.mjs
More file actions
41 lines (36 loc) · 1.9 KB
/
Copy pathsession-analysis.mjs
File metadata and controls
41 lines (36 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env node
// Thin compatibility shim (docs/adrs/directory-structure.md): the capability
// owner is scripts/session-analysis/. New exports land in the directory, not here.
//
// Minimal AI-facing usage:
// const analyzer = await createAnalyzer("qoder");
// const result = await analyzer.analyze({ workspace: "/path/to/repo", command: "facets" });
// // result => { scope, sources, sessions, facets, warnings }
// CLI workflow for AI agents:
// node scripts/session-analysis.mjs sources --platform qoder --workspace /path/to/repo
// node scripts/session-analysis.mjs facets --platform qoder --workspace /path/to/repo --limit 5
// node scripts/session-analysis.mjs insights --platform qoder --workspace /path/to/repo --limit 5
// node scripts/session-analysis.mjs facts --platform qoder --workspace /path/to/repo --limit 3
// node scripts/session-analysis.mjs facts --platform qoder --workspace /path/to/repo --limit 3 --debug
// node scripts/session-analysis.mjs claude-facets --platform qoder --workspace /path/to/repo --limit 5
// node scripts/session-analysis.mjs file-reads --platform qoder --workspace /path/to/repo --limit 5
// node scripts/session-analysis.mjs show --platform qoder --workspace /path/to/repo --session-id <id> --include-events
// This module returns evidence and compact insight packs; the caller synthesizes
// any final narrative/report.
import path from "node:path";
import { fileURLToPath } from "node:url";
import { main } from "./session-analysis/analyzer.mjs";
export {
createAnalyzer,
main,
SessionAnalyzer,
SESSION_ANALYSIS_HELP,
SUPPORTED_SESSION_PLATFORMS,
} from "./session-analysis/analyzer.mjs";
const isCli = process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url);
if (isCli) {
main().catch((error) => {
process.stderr.write(`session-analysis failed: ${error.stack ?? error.message}\n`);
process.exitCode = 1;
});
}