codealmanac 0.1.8 → 0.1.9

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.
@@ -420,7 +420,7 @@ async function runDoctor(options) {
420
420
  }
421
421
  async function safeGatherWikiChecks(options) {
422
422
  try {
423
- const { gatherWikiChecks } = await import("./wiki-EHZ7LG7R.js");
423
+ const { gatherWikiChecks } = await import("./wiki-IPSRRGOT.js");
424
424
  return await gatherWikiChecks(options);
425
425
  } catch (err) {
426
426
  const msg = err instanceof Error ? err.message : String(err);
@@ -438,4 +438,4 @@ async function safeGatherWikiChecks(options) {
438
438
  export {
439
439
  runDoctor
440
440
  };
441
- //# sourceMappingURL=chunk-73A5TGBC.js.map
441
+ //# sourceMappingURL=chunk-QLHJP2XK.js.map
@@ -270,7 +270,7 @@ async function run(argv, deps = {}) {
270
270
  if (await tryRunSqliteFreeCommand(argv.slice(2), runSetupFn)) {
271
271
  return;
272
272
  }
273
- const { registerCommands } = await import("./register-commands-JAPO3AUB.js");
273
+ const { registerCommands } = await import("./register-commands-JHC2OFKM.js");
274
274
  registerCommands(program);
275
275
  configureGroupedHelp(program);
276
276
  await program.parseAsync(argv);
@@ -341,7 +341,7 @@ async function tryRunSqliteFreeCommand(args, runSetupFn) {
341
341
  return true;
342
342
  }
343
343
  if (command === "doctor") {
344
- const { runDoctor } = await import("./doctor-IS6N7V63.js");
344
+ const { runDoctor } = await import("./doctor-ODFNJUKH.js");
345
345
  emit(await runDoctor({
346
346
  cwd: process.cwd(),
347
347
  ...parseDoctorFlags(args.slice(1))
@@ -390,4 +390,4 @@ export {
390
390
  run,
391
391
  tryParseSetupShortcut
392
392
  };
393
- //# sourceMappingURL=cli-HIXXCUSQ.js.map
393
+ //# sourceMappingURL=cli-W3OYVJYH.js.map
@@ -59,7 +59,7 @@ if (shouldCheckSqliteAbi(process.argv)) {
59
59
  process.exit(1);
60
60
  }
61
61
  }
62
- var { run } = await import("./cli-HIXXCUSQ.js");
62
+ var { run } = await import("./cli-W3OYVJYH.js");
63
63
  run(process.argv).catch((err) => {
64
64
  const message = err instanceof Error ? err.message : String(err);
65
65
  process.stderr.write(`almanac: ${message}
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runDoctor
4
- } from "./chunk-73A5TGBC.js";
4
+ } from "./chunk-QLHJP2XK.js";
5
5
  import "./chunk-4CODZRHH.js";
6
6
  import "./chunk-QHQ6YH7U.js";
7
7
  import "./chunk-FM3VRDK7.js";
@@ -12,4 +12,4 @@ import "./chunk-7JUX4ADQ.js";
12
12
  export {
13
13
  runDoctor
14
14
  };
15
- //# sourceMappingURL=doctor-IS6N7V63.js.map
15
+ //# sourceMappingURL=doctor-ODFNJUKH.js.map
@@ -24,7 +24,7 @@ import {
24
24
  } from "./chunk-3C5SY5SE.js";
25
25
  import {
26
26
  runDoctor
27
- } from "./chunk-73A5TGBC.js";
27
+ } from "./chunk-QLHJP2XK.js";
28
28
  import "./chunk-4CODZRHH.js";
29
29
  import {
30
30
  runUninstall
@@ -1819,7 +1819,7 @@ function registerSetupCommands(program) {
1819
1819
 
1820
1820
  // src/commands/bootstrap.ts
1821
1821
  import { createWriteStream, existsSync as existsSync5 } from "fs";
1822
- import { readdir } from "fs/promises";
1822
+ import { mkdir as mkdir2, readdir } from "fs/promises";
1823
1823
  import { join as join6, relative } from "path";
1824
1824
 
1825
1825
  // src/agent/prompts.ts
@@ -1882,6 +1882,10 @@ async function runAgent(opts) {
1882
1882
  model: opts.model ?? "claude-sonnet-4-6",
1883
1883
  maxTurns: opts.maxTurns ?? 100,
1884
1884
  ...claudeExecutable !== void 0 ? { pathToClaudeCodeExecutable: claudeExecutable } : {},
1885
+ env: {
1886
+ ...process.env,
1887
+ CODEALMANAC_INTERNAL_SESSION: "1"
1888
+ },
1885
1889
  // REQUIRED for streaming text deltas. Without it, `stream_event`
1886
1890
  // messages never fire and the CLI has no progress visibility during
1887
1891
  // long turns. See docs/research/agent-sdk.md §12 pitfall #1.
@@ -1960,10 +1964,10 @@ async function ensureGitignoreHasIndexDb(cwd) {
1960
1964
  ".almanac/index.db",
1961
1965
  ".almanac/index.db-wal",
1962
1966
  ".almanac/index.db-shm",
1963
- // Capture/bootstrap/ingest log files written by the AI pipeline.
1964
- // These can be multi-megabyte JSONL files and should never be
1965
- // committed. Bug #4 from codealmanac-known-bugs.md: a 1.8MB bootstrap
1966
- // log was accidentally committed before this line was added.
1967
+ // Runtime logs written by the AI pipeline. These can be multi-megabyte
1968
+ // JSONL files and should never be committed. Keep the old root-level
1969
+ // globs too so repos initialized by earlier releases stay quiet.
1970
+ ".almanac/logs/",
1967
1971
  ".almanac/.capture-*",
1968
1972
  ".almanac/.bootstrap-*",
1969
1973
  ".almanac/.ingest-*"
@@ -2105,8 +2109,10 @@ async function runBootstrap(options) {
2105
2109
  }
2106
2110
  const systemPrompt = await loadPrompt("bootstrap");
2107
2111
  const now = options.now?.() ?? /* @__PURE__ */ new Date();
2112
+ const logsDir = join6(almanacDir, "logs");
2113
+ await mkdir2(logsDir, { recursive: true });
2108
2114
  const logName = `.bootstrap-${formatTimestamp(now)}.log`;
2109
- const logPath = join6(almanacDir, logName);
2115
+ const logPath = join6(logsDir, logName);
2110
2116
  const logStream = createWriteStream(logPath, { flags: "w" });
2111
2117
  const out = process.stdout;
2112
2118
  const formatter = new StreamingFormatter({
@@ -2294,7 +2300,7 @@ import {
2294
2300
  existsSync as existsSync6,
2295
2301
  statSync
2296
2302
  } from "fs";
2297
- import { readFile as readFile6, readdir as readdir2, stat } from "fs/promises";
2303
+ import { mkdir as mkdir3, readFile as readFile6, readdir as readdir2, stat } from "fs/promises";
2298
2304
  import { homedir } from "os";
2299
2305
  import { basename as basename3, join as join7, relative as relative2 } from "path";
2300
2306
  var WRITER_TOOLS = ["Read", "Write", "Edit", "Glob", "Grep", "Bash", "Agent"];
@@ -2349,8 +2355,10 @@ async function runCapture(options) {
2349
2355
  };
2350
2356
  const now = options.now?.() ?? /* @__PURE__ */ new Date();
2351
2357
  const logStem = options.sessionId !== void 0 && options.sessionId.length > 0 ? options.sessionId : formatTimestamp2(now);
2358
+ const logsDir = join7(almanacDir, "logs");
2359
+ await mkdir3(logsDir, { recursive: true });
2352
2360
  const logName = `.capture-${logStem}.jsonl`;
2353
- const logPath = join7(almanacDir, logName);
2361
+ const logPath = join7(logsDir, logName);
2354
2362
  const logStream = createWriteStream2(logPath, { flags: "w" });
2355
2363
  const out = process.stdout;
2356
2364
  const formatter = new StreamingFormatter({
@@ -2644,4 +2652,4 @@ function registerCommands(program) {
2644
2652
  export {
2645
2653
  registerCommands
2646
2654
  };
2647
- //# sourceMappingURL=register-commands-JAPO3AUB.js.map
2655
+ //# sourceMappingURL=register-commands-JHC2OFKM.js.map