@cam5/baby-bird 0.1.0
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 +205 -0
- package/dist/chunk-RWSCST2I.js +1753 -0
- package/dist/chunk-RWSCST2I.js.map +1 -0
- package/dist/cli.js +326 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +648 -0
- package/dist/index.js +107 -0
- package/dist/index.js.map +1 -0
- package/package.json +62 -0
package/dist/cli.js
ADDED
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
BadLlmOutputError,
|
|
4
|
+
BbError,
|
|
5
|
+
CliRenderer,
|
|
6
|
+
CommandProvider,
|
|
7
|
+
NotARepoError,
|
|
8
|
+
TourCache,
|
|
9
|
+
UsageError,
|
|
10
|
+
allPresets,
|
|
11
|
+
describeSource2 as describeSource,
|
|
12
|
+
generateTour,
|
|
13
|
+
gitRoot,
|
|
14
|
+
loadConfig,
|
|
15
|
+
prepareTour,
|
|
16
|
+
projectConfigPath,
|
|
17
|
+
relativeTime,
|
|
18
|
+
resolveLlm,
|
|
19
|
+
writeMaybePaged,
|
|
20
|
+
writeStdout
|
|
21
|
+
} from "./chunk-RWSCST2I.js";
|
|
22
|
+
|
|
23
|
+
// src/cli/main.ts
|
|
24
|
+
import { Command, InvalidArgumentError } from "commander";
|
|
25
|
+
import pc4 from "picocolors";
|
|
26
|
+
|
|
27
|
+
// package.json
|
|
28
|
+
var package_default = {
|
|
29
|
+
name: "@cam5/baby-bird",
|
|
30
|
+
version: "0.1.0",
|
|
31
|
+
description: "Guided code tours for git changes, on the command line.",
|
|
32
|
+
license: "MIT",
|
|
33
|
+
type: "module",
|
|
34
|
+
repository: {
|
|
35
|
+
type: "git",
|
|
36
|
+
url: "git+https://github.com/cam5/baby-bird.git"
|
|
37
|
+
},
|
|
38
|
+
keywords: [
|
|
39
|
+
"git",
|
|
40
|
+
"code-review",
|
|
41
|
+
"diff",
|
|
42
|
+
"llm",
|
|
43
|
+
"cli",
|
|
44
|
+
"code-tour"
|
|
45
|
+
],
|
|
46
|
+
bin: {
|
|
47
|
+
bb: "dist/cli.js",
|
|
48
|
+
"baby-bird": "dist/cli.js"
|
|
49
|
+
},
|
|
50
|
+
main: "./dist/index.js",
|
|
51
|
+
types: "./dist/index.d.ts",
|
|
52
|
+
exports: {
|
|
53
|
+
".": {
|
|
54
|
+
types: "./dist/index.d.ts",
|
|
55
|
+
import: "./dist/index.js"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
files: [
|
|
59
|
+
"dist",
|
|
60
|
+
"README.md"
|
|
61
|
+
],
|
|
62
|
+
engines: {
|
|
63
|
+
node: ">=22"
|
|
64
|
+
},
|
|
65
|
+
packageManager: "pnpm@10.33.0",
|
|
66
|
+
scripts: {
|
|
67
|
+
dev: "tsx src/cli/main.ts",
|
|
68
|
+
build: "tsup",
|
|
69
|
+
test: "vitest run",
|
|
70
|
+
"test:watch": "vitest",
|
|
71
|
+
typecheck: "tsc --noEmit",
|
|
72
|
+
prepublishOnly: "pnpm typecheck && pnpm test && pnpm build"
|
|
73
|
+
},
|
|
74
|
+
dependencies: {
|
|
75
|
+
commander: "^15.0.0",
|
|
76
|
+
picocolors: "^1.1.1",
|
|
77
|
+
zod: "^4.6.2"
|
|
78
|
+
},
|
|
79
|
+
devDependencies: {
|
|
80
|
+
"@types/node": "^22.20.2",
|
|
81
|
+
tsup: "^8.5.1",
|
|
82
|
+
tsx: "^4.23.13",
|
|
83
|
+
typescript: "^5.9.3",
|
|
84
|
+
vitest: "^5.0.0"
|
|
85
|
+
},
|
|
86
|
+
publishConfig: {
|
|
87
|
+
access: "public"
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
// src/cli/cache-cmd.ts
|
|
92
|
+
import pc2 from "picocolors";
|
|
93
|
+
|
|
94
|
+
// src/cli/shared.ts
|
|
95
|
+
import pc from "picocolors";
|
|
96
|
+
import { resolve } from "path";
|
|
97
|
+
function flagsToOverrides(flags) {
|
|
98
|
+
const o = {};
|
|
99
|
+
if (flags.preset) o.llm = { preset: flags.preset };
|
|
100
|
+
if (flags.color === true) o.render = { color: "always" };
|
|
101
|
+
else if (flags.color === false) o.render = { color: "never" };
|
|
102
|
+
if (flags.cache === false) o.cache = { enabled: false };
|
|
103
|
+
if (flags.pager === false) o.render = { ...o.render ?? {}, pager: "never" };
|
|
104
|
+
return o;
|
|
105
|
+
}
|
|
106
|
+
async function openSession(flags, opts) {
|
|
107
|
+
const cwd = resolve(flags.cwd ?? process.cwd());
|
|
108
|
+
let root = null;
|
|
109
|
+
try {
|
|
110
|
+
root = await gitRoot(cwd);
|
|
111
|
+
} catch (err) {
|
|
112
|
+
if (opts.requireRepo) throw err;
|
|
113
|
+
}
|
|
114
|
+
const loaded = await loadConfig({ gitRoot: root, env: process.env, overrides: flagsToOverrides(flags) });
|
|
115
|
+
const colorEnabled = resolveColor(loaded.config.render.color);
|
|
116
|
+
const c = pc.createColors(colorEnabled);
|
|
117
|
+
const debug = flags.debug ? (msg) => process.stderr.write(c.dim(`[bb] ${msg}
|
|
118
|
+
`)) : () => {
|
|
119
|
+
};
|
|
120
|
+
const warn = (msg) => process.stderr.write(c.yellow(`warning: ${msg}
|
|
121
|
+
`));
|
|
122
|
+
return { cwd, root, loaded, debug, warn, colorEnabled };
|
|
123
|
+
}
|
|
124
|
+
function resolveColor(mode) {
|
|
125
|
+
if (mode === "always") return true;
|
|
126
|
+
if (mode === "never") return false;
|
|
127
|
+
return Boolean(process.stdout.isTTY) && process.env.TERM !== "dumb";
|
|
128
|
+
}
|
|
129
|
+
function terminalWidth(configured, stream = process.stdout) {
|
|
130
|
+
return configured ?? (stream.columns || 80);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// src/cli/cache-cmd.ts
|
|
134
|
+
async function cacheLsCommand(flags) {
|
|
135
|
+
const session = await openSession(flags, { requireRepo: false });
|
|
136
|
+
const c = pc2.createColors(session.colorEnabled);
|
|
137
|
+
const cache2 = new TourCache(session.loaded.cacheDir);
|
|
138
|
+
const entries = await cache2.list();
|
|
139
|
+
if (entries.length === 0) {
|
|
140
|
+
process.stdout.write(`No cached tours in ${cache2.toursDir}
|
|
141
|
+
`);
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
for (const e of entries) {
|
|
145
|
+
const t = e.tour;
|
|
146
|
+
process.stdout.write(
|
|
147
|
+
`${c.dim(e.key.slice(0, 12))} ${relativeTime(t.generatedAt).padEnd(12)} ${c.bold(t.title)}
|
|
148
|
+
${" ".repeat(14)}${c.dim(describeSource(t.source))}${t.generator.preset ? c.dim(` \xB7 ${t.generator.preset}`) : ""}
|
|
149
|
+
`
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
async function cacheClearCommand(flags) {
|
|
154
|
+
const session = await openSession(flags, { requireRepo: false });
|
|
155
|
+
const cache2 = new TourCache(session.loaded.cacheDir);
|
|
156
|
+
const n = await cache2.clear();
|
|
157
|
+
process.stdout.write(`Removed ${n} cached tour${n === 1 ? "" : "s"} from ${cache2.toursDir}
|
|
158
|
+
`);
|
|
159
|
+
}
|
|
160
|
+
async function cachePathCommand(flags) {
|
|
161
|
+
const session = await openSession(flags, { requireRepo: false });
|
|
162
|
+
process.stdout.write(new TourCache(session.loaded.cacheDir).toursDir + "\n");
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// src/cli/config-cmd.ts
|
|
166
|
+
import pc3 from "picocolors";
|
|
167
|
+
async function configCommand(flags) {
|
|
168
|
+
const session = await openSession(flags, { requireRepo: false });
|
|
169
|
+
const { config, layers, cacheDir } = session.loaded;
|
|
170
|
+
if (flags.json) {
|
|
171
|
+
process.stdout.write(JSON.stringify(config, null, 2) + "\n");
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
const c = pc3.createColors(session.colorEnabled);
|
|
175
|
+
const out = [];
|
|
176
|
+
out.push(c.bold("Layers") + c.dim(" (later layers win; objects merge, arrays replace)"));
|
|
177
|
+
for (const layer of layers) {
|
|
178
|
+
const status = layer.found ? c.green("applied") : c.dim("not found");
|
|
179
|
+
const where = layer.path ?? (layer.detail || (layer.name === "defaults" ? "built-in" : layer.name === "flags" ? "command line" : ""));
|
|
180
|
+
out.push(` ${layer.name.padEnd(8)} ${status.padEnd(session.colorEnabled ? 18 : 9)} ${c.dim(where)}`);
|
|
181
|
+
}
|
|
182
|
+
out.push(` cache dir: ${cacheDir}`);
|
|
183
|
+
out.push("");
|
|
184
|
+
out.push(c.bold("LLM"));
|
|
185
|
+
try {
|
|
186
|
+
const llm = resolveLlm(config);
|
|
187
|
+
const provider = new CommandProvider({ command: llm.command, promptVia: llm.promptVia, timeoutMs: llm.timeoutMs });
|
|
188
|
+
out.push(` preset: ${llm.preset ?? c.dim("(custom command)")}`);
|
|
189
|
+
out.push(` command: ${provider.describe()}`);
|
|
190
|
+
out.push(` prompt: via ${llm.promptVia}`);
|
|
191
|
+
} catch (err) {
|
|
192
|
+
out.push(` ${c.red(err.message)}`);
|
|
193
|
+
}
|
|
194
|
+
out.push("");
|
|
195
|
+
out.push(c.bold("Presets"));
|
|
196
|
+
const presets = allPresets(config);
|
|
197
|
+
const width = Math.max(...Object.keys(presets).map((k) => k.length));
|
|
198
|
+
for (const [name, preset] of Object.entries(presets).sort(([a], [b]) => a.localeCompare(b))) {
|
|
199
|
+
const custom = name in config.llm.presets ? c.dim(" (yours)") : "";
|
|
200
|
+
out.push(` ${name.padEnd(width)} ${preset.description ?? c.dim(preset.command.join(" "))}${custom}`);
|
|
201
|
+
}
|
|
202
|
+
out.push("");
|
|
203
|
+
out.push(c.bold("Effective config"));
|
|
204
|
+
out.push(JSON.stringify(config, null, 2).split("\n").map((l) => " " + l).join("\n"));
|
|
205
|
+
process.stdout.write(out.join("\n") + "\n");
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
// src/cli/init-cmd.ts
|
|
209
|
+
import { mkdir, writeFile } from "fs/promises";
|
|
210
|
+
import { dirname } from "path";
|
|
211
|
+
var STARTER = {
|
|
212
|
+
llm: { preset: "claude" },
|
|
213
|
+
codehost: { provider: "gh" }
|
|
214
|
+
};
|
|
215
|
+
async function initCommand(flags) {
|
|
216
|
+
const session = await openSession(flags, { requireRepo: true });
|
|
217
|
+
if (!session.root) throw new NotARepoError(session.cwd);
|
|
218
|
+
const path = projectConfigPath(session.root);
|
|
219
|
+
const existing = session.loaded.layers.find((l) => l.name === "project");
|
|
220
|
+
if (existing?.found && !flags.force) {
|
|
221
|
+
throw new UsageError(`${path} already exists.`, "Pass --force to overwrite it.");
|
|
222
|
+
}
|
|
223
|
+
await mkdir(dirname(path), { recursive: true });
|
|
224
|
+
await writeFile(path, JSON.stringify(STARTER, null, 2) + "\n", "utf8");
|
|
225
|
+
process.stdout.write(`Wrote ${path}
|
|
226
|
+
Run \`bb config\` to see the effective configuration and available presets.
|
|
227
|
+
`);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// src/cli/tour.ts
|
|
231
|
+
async function tourCommand(rangeArg, flags) {
|
|
232
|
+
const session = await openSession(flags, { requireRepo: true });
|
|
233
|
+
if (!session.root) throw new NotARepoError(session.cwd);
|
|
234
|
+
const { config } = session.loaded;
|
|
235
|
+
const options = {
|
|
236
|
+
cwd: session.root,
|
|
237
|
+
config,
|
|
238
|
+
cacheDir: session.loaded.cacheDir,
|
|
239
|
+
range: { arg: rangeArg, working: flags.working, staged: flags.staged },
|
|
240
|
+
refresh: flags.refresh,
|
|
241
|
+
noCache: flags.cache === false,
|
|
242
|
+
debug: session.debug,
|
|
243
|
+
warn: session.warn
|
|
244
|
+
};
|
|
245
|
+
const prepared = await prepareTour(options);
|
|
246
|
+
if (flags.dumpPrompt) {
|
|
247
|
+
await writeStdout(prepared.built.prompt.endsWith("\n") ? prepared.built.prompt : prepared.built.prompt + "\n");
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
const result = await generateTour(options, prepared);
|
|
251
|
+
if (flags.json) {
|
|
252
|
+
await writeStdout(JSON.stringify(result.tour, null, 2) + "\n");
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
const renderer = new CliRenderer();
|
|
256
|
+
const output = renderer.render(result.tour, {
|
|
257
|
+
color: session.colorEnabled,
|
|
258
|
+
width: terminalWidth(config.render.width),
|
|
259
|
+
section: flags.section,
|
|
260
|
+
fromCache: result.fromCache
|
|
261
|
+
});
|
|
262
|
+
await writeMaybePaged(output, {
|
|
263
|
+
mode: config.render.pager,
|
|
264
|
+
isTTY: Boolean(process.stdout.isTTY),
|
|
265
|
+
rows: process.stdout.rows ?? 24
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
// src/cli/main.ts
|
|
270
|
+
function positiveInt(value) {
|
|
271
|
+
const n = Number(value);
|
|
272
|
+
if (!Number.isInteger(n) || n < 1) throw new InvalidArgumentError("must be a positive integer");
|
|
273
|
+
return n;
|
|
274
|
+
}
|
|
275
|
+
function addGlobalFlags(cmd) {
|
|
276
|
+
return cmd.option("-C, --cwd <dir>", "run as if started in <dir>").option("--preset <name>", "LLM preset to use (see `bb config`)").option("--color", "force colored output").option("--no-color", "disable colored output").option("--debug", "print diagnostics (resolved range, prompt size, raw model output) to stderr");
|
|
277
|
+
}
|
|
278
|
+
process.stdout.on("error", (err) => {
|
|
279
|
+
if (err.code === "EPIPE") process.exit(0);
|
|
280
|
+
throw err;
|
|
281
|
+
});
|
|
282
|
+
var program = new Command();
|
|
283
|
+
program.name("bb").description("Guided code tours for git changes, on the command line.").version(package_default.version, "-V, --version").configureOutput({ outputError: (str, write) => write(pc4.red(str)) }).showHelpAfterError("(run with --help for usage)");
|
|
284
|
+
addGlobalFlags(program).argument("[range]", "what to tour: A..B, A...B, or a single ref (compared at its merge-base with HEAD)").option("-w, --working", "tour uncommitted changes in the working tree (tracked and untracked)").option("-s, --staged", "tour staged changes only").option("--section <n>", "render only section <n>", positiveInt).option("--json", "print the tour as JSON instead of rendering it").option("--dump-prompt", "print the prompt that would be sent to the model and exit").option("--refresh", "ignore a cached tour and regenerate it").option("--no-cache", "neither read nor write the tour cache").option("--no-pager", "never pipe output through a pager").addHelpText(
|
|
285
|
+
"after",
|
|
286
|
+
`
|
|
287
|
+
Examples:
|
|
288
|
+
bb tour the current branch (dirty tree, PR base, nearest branch, or default branch)
|
|
289
|
+
bb main..feature tour an explicit range
|
|
290
|
+
bb HEAD~3 tour the last three commits
|
|
291
|
+
bb --staged tour what you are about to commit
|
|
292
|
+
bb --section 2 show only the second section
|
|
293
|
+
bb --json | jq machine-readable output
|
|
294
|
+
bb --preset claude-sonnet --refresh
|
|
295
|
+
`
|
|
296
|
+
).action(async (range, flags) => {
|
|
297
|
+
await tourCommand(range, flags);
|
|
298
|
+
});
|
|
299
|
+
var cache = program.command("cache").description("manage cached tours");
|
|
300
|
+
addGlobalFlags(cache.command("ls").description("list cached tours")).action(cacheLsCommand);
|
|
301
|
+
addGlobalFlags(cache.command("clear").description("delete all cached tours")).action(cacheClearCommand);
|
|
302
|
+
addGlobalFlags(cache.command("path").description("print the cache directory")).action(cachePathCommand);
|
|
303
|
+
addGlobalFlags(program.command("config").description("show the effective configuration, its sources, and available presets")).option("--json", "print only the effective config as JSON").action(configCommand);
|
|
304
|
+
addGlobalFlags(program.command("init").description("write a starter .baby-bird/config.json in this repository")).option("--force", "overwrite an existing project config").action(initCommand);
|
|
305
|
+
program.parseAsync(process.argv).catch((err) => {
|
|
306
|
+
const debug = process.argv.includes("--debug");
|
|
307
|
+
if (err instanceof BbError) {
|
|
308
|
+
process.stderr.write(pc4.red(`error: ${err.message}
|
|
309
|
+
`));
|
|
310
|
+
if (err.hint) process.stderr.write(pc4.dim(`${err.hint}
|
|
311
|
+
`));
|
|
312
|
+
if (debug && err instanceof BadLlmOutputError) process.stderr.write(pc4.dim(`--- raw model output ---
|
|
313
|
+
${err.raw}
|
|
314
|
+
`));
|
|
315
|
+
if (debug && err.cause) process.stderr.write(pc4.dim(`${String(err.cause.stack ?? err.cause)}
|
|
316
|
+
`));
|
|
317
|
+
process.exitCode = err.exitCode;
|
|
318
|
+
return;
|
|
319
|
+
}
|
|
320
|
+
process.stderr.write(pc4.red(`error: ${err.message ?? String(err)}
|
|
321
|
+
`));
|
|
322
|
+
if (debug && err.stack) process.stderr.write(pc4.dim(`${err.stack}
|
|
323
|
+
`));
|
|
324
|
+
process.exitCode = 1;
|
|
325
|
+
});
|
|
326
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/cli/main.ts","../package.json","../src/cli/cache-cmd.ts","../src/cli/shared.ts","../src/cli/config-cmd.ts","../src/cli/init-cmd.ts","../src/cli/tour.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { Command, InvalidArgumentError } from 'commander';\nimport pc from 'picocolors';\nimport pkg from '../../package.json' with { type: 'json' };\nimport { BadLlmOutputError, BbError } from '../core/errors.js';\nimport { cacheClearCommand, cacheLsCommand, cachePathCommand } from './cache-cmd.js';\nimport { configCommand } from './config-cmd.js';\nimport { initCommand } from './init-cmd.js';\nimport { tourCommand } from './tour.js';\n\nfunction positiveInt(value: string): number {\n const n = Number(value);\n if (!Number.isInteger(n) || n < 1) throw new InvalidArgumentError('must be a positive integer');\n return n;\n}\n\nfunction addGlobalFlags(cmd: Command): Command {\n return cmd\n .option('-C, --cwd <dir>', 'run as if started in <dir>')\n .option('--preset <name>', 'LLM preset to use (see `bb config`)')\n .option('--color', 'force colored output')\n .option('--no-color', 'disable colored output')\n .option('--debug', 'print diagnostics (resolved range, prompt size, raw model output) to stderr');\n}\n\n// A reader that quits early (`bb | head`) is a normal end, not a crash.\nprocess.stdout.on('error', (err: NodeJS.ErrnoException) => {\n if (err.code === 'EPIPE') process.exit(0);\n throw err;\n});\n\nconst program = new Command();\n\nprogram\n .name('bb')\n .description('Guided code tours for git changes, on the command line.')\n .version(pkg.version, '-V, --version')\n .configureOutput({ outputError: (str, write) => write(pc.red(str)) })\n .showHelpAfterError('(run with --help for usage)');\n\naddGlobalFlags(program)\n .argument('[range]', 'what to tour: A..B, A...B, or a single ref (compared at its merge-base with HEAD)')\n .option('-w, --working', 'tour uncommitted changes in the working tree (tracked and untracked)')\n .option('-s, --staged', 'tour staged changes only')\n .option('--section <n>', 'render only section <n>', positiveInt)\n .option('--json', 'print the tour as JSON instead of rendering it')\n .option('--dump-prompt', 'print the prompt that would be sent to the model and exit')\n .option('--refresh', 'ignore a cached tour and regenerate it')\n .option('--no-cache', 'neither read nor write the tour cache')\n .option('--no-pager', 'never pipe output through a pager')\n .addHelpText(\n 'after',\n `\nExamples:\n bb tour the current branch (dirty tree, PR base, nearest branch, or default branch)\n bb main..feature tour an explicit range\n bb HEAD~3 tour the last three commits\n bb --staged tour what you are about to commit\n bb --section 2 show only the second section\n bb --json | jq machine-readable output\n bb --preset claude-sonnet --refresh\n`,\n )\n .action(async (range: string | undefined, flags) => {\n await tourCommand(range, flags);\n });\n\nconst cache = program.command('cache').description('manage cached tours');\naddGlobalFlags(cache.command('ls').description('list cached tours')).action(cacheLsCommand);\naddGlobalFlags(cache.command('clear').description('delete all cached tours')).action(cacheClearCommand);\naddGlobalFlags(cache.command('path').description('print the cache directory')).action(cachePathCommand);\n\naddGlobalFlags(program.command('config').description('show the effective configuration, its sources, and available presets'))\n .option('--json', 'print only the effective config as JSON')\n .action(configCommand);\n\naddGlobalFlags(program.command('init').description('write a starter .baby-bird/config.json in this repository'))\n .option('--force', 'overwrite an existing project config')\n .action(initCommand);\n\nprogram.parseAsync(process.argv).catch((err: unknown) => {\n const debug = process.argv.includes('--debug');\n if (err instanceof BbError) {\n process.stderr.write(pc.red(`error: ${err.message}\\n`));\n if (err.hint) process.stderr.write(pc.dim(`${err.hint}\\n`));\n if (debug && err instanceof BadLlmOutputError) process.stderr.write(pc.dim(`--- raw model output ---\\n${err.raw}\\n`));\n if (debug && err.cause) process.stderr.write(pc.dim(`${String((err.cause as Error).stack ?? err.cause)}\\n`));\n process.exitCode = err.exitCode;\n return;\n }\n process.stderr.write(pc.red(`error: ${(err as Error).message ?? String(err)}\\n`));\n if (debug && (err as Error).stack) process.stderr.write(pc.dim(`${(err as Error).stack}\\n`));\n process.exitCode = 1;\n});\n","{\n \"name\": \"@cam5/baby-bird\",\n \"version\": \"0.1.0\",\n \"description\": \"Guided code tours for git changes, on the command line.\",\n \"license\": \"MIT\",\n \"type\": \"module\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/cam5/baby-bird.git\"\n },\n \"keywords\": [\n \"git\",\n \"code-review\",\n \"diff\",\n \"llm\",\n \"cli\",\n \"code-tour\"\n ],\n \"bin\": {\n \"bb\": \"dist/cli.js\",\n \"baby-bird\": \"dist/cli.js\"\n },\n \"main\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.js\"\n }\n },\n \"files\": [\n \"dist\",\n \"README.md\"\n ],\n \"engines\": {\n \"node\": \">=22\"\n },\n \"packageManager\": \"pnpm@10.33.0\",\n \"scripts\": {\n \"dev\": \"tsx src/cli/main.ts\",\n \"build\": \"tsup\",\n \"test\": \"vitest run\",\n \"test:watch\": \"vitest\",\n \"typecheck\": \"tsc --noEmit\",\n \"prepublishOnly\": \"pnpm typecheck && pnpm test && pnpm build\"\n },\n \"dependencies\": {\n \"commander\": \"^15.0.0\",\n \"picocolors\": \"^1.1.1\",\n \"zod\": \"^4.6.2\"\n },\n \"devDependencies\": {\n \"@types/node\": \"^22.20.2\",\n \"tsup\": \"^8.5.1\",\n \"tsx\": \"^4.23.13\",\n \"typescript\": \"^5.9.3\",\n \"vitest\": \"^5.0.0\"\n },\n \"publishConfig\": {\n \"access\": \"public\"\n }\n}\n","import pc from 'picocolors';\nimport { TourCache } from '../core/cache.js';\nimport { describeSource, relativeTime } from '../render/cli.js';\nimport { openSession, type GlobalFlags } from './shared.js';\n\nexport async function cacheLsCommand(flags: GlobalFlags): Promise<void> {\n const session = await openSession(flags, { requireRepo: false });\n const c = pc.createColors(session.colorEnabled);\n const cache = new TourCache(session.loaded.cacheDir);\n const entries = await cache.list();\n if (entries.length === 0) {\n process.stdout.write(`No cached tours in ${cache.toursDir}\\n`);\n return;\n }\n for (const e of entries) {\n const t = e.tour;\n process.stdout.write(\n `${c.dim(e.key.slice(0, 12))} ${relativeTime(t.generatedAt).padEnd(12)} ${c.bold(t.title)}\\n` +\n `${' '.repeat(14)}${c.dim(describeSource(t.source))}${t.generator.preset ? c.dim(` · ${t.generator.preset}`) : ''}\\n`,\n );\n }\n}\n\nexport async function cacheClearCommand(flags: GlobalFlags): Promise<void> {\n const session = await openSession(flags, { requireRepo: false });\n const cache = new TourCache(session.loaded.cacheDir);\n const n = await cache.clear();\n process.stdout.write(`Removed ${n} cached tour${n === 1 ? '' : 's'} from ${cache.toursDir}\\n`);\n}\n\nexport async function cachePathCommand(flags: GlobalFlags): Promise<void> {\n const session = await openSession(flags, { requireRepo: false });\n process.stdout.write(new TourCache(session.loaded.cacheDir).toursDir + '\\n');\n}\n","import pc from 'picocolors';\nimport { resolve } from 'node:path';\nimport type { PartialConfig } from '../core/config.js';\nimport { loadConfig, type LoadedConfig } from '../core/config.js';\nimport { gitRoot } from '../git/exec.js';\n\nexport interface GlobalFlags {\n cwd?: string;\n debug?: boolean;\n color?: boolean;\n preset?: string;\n cache?: boolean;\n pager?: boolean;\n}\n\nexport interface Session {\n /** Directory the user pointed at (resolved). */\n cwd: string;\n /** Git root, or null when not in a repository. */\n root: string | null;\n loaded: LoadedConfig;\n debug: (msg: string) => void;\n warn: (msg: string) => void;\n colorEnabled: boolean;\n}\n\nexport function flagsToOverrides(flags: GlobalFlags): PartialConfig {\n const o: PartialConfig = {};\n if (flags.preset) o.llm = { preset: flags.preset };\n if (flags.color === true) o.render = { color: 'always' };\n else if (flags.color === false) o.render = { color: 'never' };\n if (flags.cache === false) o.cache = { enabled: false };\n if (flags.pager === false) o.render = { ...(o.render ?? {}), pager: 'never' };\n return o;\n}\n\nexport async function openSession(flags: GlobalFlags, opts: { requireRepo: boolean }): Promise<Session> {\n const cwd = resolve(flags.cwd ?? process.cwd());\n let root: string | null = null;\n try {\n root = await gitRoot(cwd);\n } catch (err) {\n if (opts.requireRepo) throw err;\n }\n const loaded = await loadConfig({ gitRoot: root, env: process.env, overrides: flagsToOverrides(flags) });\n const colorEnabled = resolveColor(loaded.config.render.color);\n const c = pc.createColors(colorEnabled);\n const debug = flags.debug ? (msg: string) => process.stderr.write(c.dim(`[bb] ${msg}\\n`)) : () => {};\n const warn = (msg: string) => process.stderr.write(c.yellow(`warning: ${msg}\\n`));\n return { cwd, root, loaded, debug, warn, colorEnabled };\n}\n\nexport function resolveColor(mode: 'auto' | 'always' | 'never'): boolean {\n if (mode === 'always') return true;\n if (mode === 'never') return false;\n return Boolean(process.stdout.isTTY) && process.env.TERM !== 'dumb';\n}\n\nexport function terminalWidth(configured: number | null, stream: { columns?: number } = process.stdout): number {\n return configured ?? (stream.columns || 80);\n}\n","import pc from 'picocolors';\nimport { allPresets, resolveLlm } from '../core/config.js';\nimport { ConfigError } from '../core/errors.js';\nimport { CommandProvider } from '../llm/command.js';\nimport { openSession, type GlobalFlags } from './shared.js';\n\nexport async function configCommand(flags: GlobalFlags & { json?: boolean }): Promise<void> {\n const session = await openSession(flags, { requireRepo: false });\n const { config, layers, cacheDir } = session.loaded;\n\n if (flags.json) {\n process.stdout.write(JSON.stringify(config, null, 2) + '\\n');\n return;\n }\n\n const c = pc.createColors(session.colorEnabled);\n const out: string[] = [];\n out.push(c.bold('Layers') + c.dim(' (later layers win; objects merge, arrays replace)'));\n for (const layer of layers) {\n const status = layer.found ? c.green('applied') : c.dim('not found');\n const where = layer.path ?? (layer.detail || (layer.name === 'defaults' ? 'built-in' : layer.name === 'flags' ? 'command line' : ''));\n out.push(` ${layer.name.padEnd(8)} ${status.padEnd(session.colorEnabled ? 18 : 9)} ${c.dim(where)}`);\n }\n out.push(` cache dir: ${cacheDir}`);\n out.push('');\n\n out.push(c.bold('LLM'));\n try {\n const llm = resolveLlm(config);\n const provider = new CommandProvider({ command: llm.command, promptVia: llm.promptVia, timeoutMs: llm.timeoutMs });\n out.push(` preset: ${llm.preset ?? c.dim('(custom command)')}`);\n out.push(` command: ${provider.describe()}`);\n out.push(` prompt: via ${llm.promptVia}`);\n } catch (err) {\n out.push(` ${c.red((err as ConfigError).message)}`);\n }\n out.push('');\n\n out.push(c.bold('Presets'));\n const presets = allPresets(config);\n const width = Math.max(...Object.keys(presets).map((k) => k.length));\n for (const [name, preset] of Object.entries(presets).sort(([a], [b]) => a.localeCompare(b))) {\n const custom = name in config.llm.presets ? c.dim(' (yours)') : '';\n out.push(` ${name.padEnd(width)} ${preset.description ?? c.dim(preset.command.join(' '))}${custom}`);\n }\n out.push('');\n\n out.push(c.bold('Effective config'));\n out.push(JSON.stringify(config, null, 2).split('\\n').map((l) => ' ' + l).join('\\n'));\n process.stdout.write(out.join('\\n') + '\\n');\n}\n","import { mkdir, writeFile } from 'node:fs/promises';\nimport { dirname } from 'node:path';\nimport { projectConfigPath } from '../core/config.js';\nimport { NotARepoError, UsageError } from '../core/errors.js';\nimport { openSession, type GlobalFlags } from './shared.js';\n\nconst STARTER = {\n llm: { preset: 'claude' },\n codehost: { provider: 'gh' },\n};\n\nexport async function initCommand(flags: GlobalFlags & { force?: boolean }): Promise<void> {\n const session = await openSession(flags, { requireRepo: true });\n if (!session.root) throw new NotARepoError(session.cwd);\n const path = projectConfigPath(session.root);\n const existing = session.loaded.layers.find((l) => l.name === 'project');\n if (existing?.found && !flags.force) {\n throw new UsageError(`${path} already exists.`, 'Pass --force to overwrite it.');\n }\n await mkdir(dirname(path), { recursive: true });\n await writeFile(path, JSON.stringify(STARTER, null, 2) + '\\n', 'utf8');\n process.stdout.write(`Wrote ${path}\\nRun \\`bb config\\` to see the effective configuration and available presets.\\n`);\n}\n","import { NotARepoError } from '../core/errors.js';\nimport { generateTour, prepareTour } from '../core/tour.js';\nimport { CliRenderer } from '../render/cli.js';\nimport { writeMaybePaged, writeStdout } from '../render/pager.js';\nimport { openSession, terminalWidth, type GlobalFlags } from './shared.js';\n\nexport interface TourFlags extends GlobalFlags {\n working?: boolean;\n staged?: boolean;\n section?: number;\n json?: boolean;\n dumpPrompt?: boolean;\n refresh?: boolean;\n}\n\nexport async function tourCommand(rangeArg: string | undefined, flags: TourFlags): Promise<void> {\n const session = await openSession(flags, { requireRepo: true });\n if (!session.root) throw new NotARepoError(session.cwd);\n const { config } = session.loaded;\n\n const options = {\n cwd: session.root,\n config,\n cacheDir: session.loaded.cacheDir,\n range: { arg: rangeArg, working: flags.working, staged: flags.staged },\n refresh: flags.refresh,\n noCache: flags.cache === false,\n debug: session.debug,\n warn: session.warn,\n };\n\n const prepared = await prepareTour(options);\n if (flags.dumpPrompt) {\n await writeStdout(prepared.built.prompt.endsWith('\\n') ? prepared.built.prompt : prepared.built.prompt + '\\n');\n return;\n }\n\n const result = await generateTour(options, prepared);\n\n if (flags.json) {\n await writeStdout(JSON.stringify(result.tour, null, 2) + '\\n');\n return;\n }\n\n const renderer = new CliRenderer();\n const output = renderer.render(result.tour, {\n color: session.colorEnabled,\n width: terminalWidth(config.render.width),\n section: flags.section,\n fromCache: result.fromCache,\n });\n await writeMaybePaged(output, {\n mode: config.render.pager,\n isTTY: Boolean(process.stdout.isTTY),\n rows: process.stdout.rows ?? 24,\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA,SAAS,SAAS,4BAA4B;AAC9C,OAAOA,SAAQ;;;ACFf;AAAA,EACE,MAAQ;AAAA,EACR,SAAW;AAAA,EACX,aAAe;AAAA,EACf,SAAW;AAAA,EACX,MAAQ;AAAA,EACR,YAAc;AAAA,IACZ,MAAQ;AAAA,IACR,KAAO;AAAA,EACT;AAAA,EACA,UAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAA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