@basou/cli 0.60.0 → 0.61.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/dist/index.js CHANGED
@@ -128,7 +128,7 @@ import * as basouCore from "@basou/core";
128
128
  import { Command } from "commander";
129
129
 
130
130
  // src/commands/approval.ts
131
- import { unlink } from "fs/promises";
131
+ import { mkdir, unlink } from "fs/promises";
132
132
  import { join } from "path";
133
133
  import {
134
134
  ApprovalSchema,
@@ -354,6 +354,11 @@ async function doRunApprovalResolve(idInput, options, ctx, decision) {
354
354
  const now = /* @__PURE__ */ new Date();
355
355
  const occurredAt = now.toISOString();
356
356
  const eventId = prefixedUlid("evt");
357
+ try {
358
+ await mkdir(paths.approvals.resolved, { recursive: true });
359
+ } catch (error) {
360
+ throw new Error("Failed to create .basou/approvals/resolved", { cause: error });
361
+ }
357
362
  const sessionLock = await acquireLock(paths, "session", approval.session_id);
358
363
  try {
359
364
  await assertSessionDirSafe(paths, approval.session_id);
@@ -2071,7 +2076,7 @@ async function assertWorkspaceInitialized3(basouRoot) {
2071
2076
  }
2072
2077
 
2073
2078
  // src/commands/exec.ts
2074
- import { mkdir } from "fs/promises";
2079
+ import { mkdir as mkdir2 } from "fs/promises";
2075
2080
  import { homedir as homedir4 } from "os";
2076
2081
  import { join as join6 } from "path";
2077
2082
  import {
@@ -2119,7 +2124,7 @@ async function runExec(command, args, options, ctx = {}) {
2119
2124
  await assertSessionStoreSafe(paths);
2120
2125
  const sessionId = prefixedUlid3("ses");
2121
2126
  const sessionDir = join6(paths.sessions, sessionId);
2122
- await mkdir(sessionDir, { recursive: true });
2127
+ await mkdir2(sessionDir, { recursive: true });
2123
2128
  const appendEvent = ctx.appendEvent ?? (async (_sessionDir, event) => {
2124
2129
  await coreAppendChainedEvent(paths, sessionId, event);
2125
2130
  });
@@ -2914,6 +2919,8 @@ async function loadHostsConfig(configPath = DEFAULT_HOSTS_CONFIG_PATH) {
2914
2919
 
2915
2920
  // src/lib/provenance-actions.ts
2916
2921
  import {
2922
+ assertApprovalStoreSafe,
2923
+ assertTaskStoreSafe,
2917
2924
  readMarkdownFile as readMarkdownFile5,
2918
2925
  renderDecisions as renderDecisions2,
2919
2926
  renderHandoff as renderHandoff2,
@@ -3682,6 +3689,10 @@ async function regenerateOrientation(paths, nowIso, callbacks) {
3682
3689
  async function refreshAll(args) {
3683
3690
  const { options, ctx, paths, nowIso } = args;
3684
3691
  const dryRun = options.dryRun === true;
3692
+ if (!dryRun) {
3693
+ await assertTaskStoreSafe(paths);
3694
+ await assertApprovalStoreSafe(paths);
3695
+ }
3685
3696
  const claudeCode = await importClaudeCode(options, ctx);
3686
3697
  const codex = await importCodex(options, ctx);
3687
3698
  if (dryRun) {
@@ -8701,7 +8712,11 @@ import { InvalidArgumentError as InvalidArgumentError4 } from "commander";
8701
8712
  import { readdir as readdir2, stat as stat6 } from "fs/promises";
8702
8713
  import { homedir as homedir10 } from "os";
8703
8714
  import { join as join13 } from "path";
8704
- import { findErrorCode as findErrorCode8 } from "@basou/core";
8715
+ import {
8716
+ assertApprovalStoreSafe as assertApprovalStoreSafe2,
8717
+ assertTaskStoreSafe as assertTaskStoreSafe2,
8718
+ findErrorCode as findErrorCode8
8719
+ } from "@basou/core";
8705
8720
  var DEFAULT_WATCH_INTERVAL_SEC = 30;
8706
8721
  var MIN_WATCH_INTERVAL_SEC = 5;
8707
8722
  var MAX_WATCH_INTERVAL_SEC = 86400;
@@ -8761,6 +8776,8 @@ function hms(date) {
8761
8776
  return date.toISOString().slice(11, 19);
8762
8777
  }
8763
8778
  async function runImports(deps) {
8779
+ await assertTaskStoreSafe2(deps.paths);
8780
+ await assertApprovalStoreSafe2(deps.paths);
8764
8781
  const claude = await importClaudeCode(deps.importOptions, deps.ctx);
8765
8782
  const codex = await importCodex(deps.importOptions, deps.ctx);
8766
8783
  return { claude, codex, changed: changedCount(claude) + changedCount(codex) };
@@ -9582,7 +9599,7 @@ function unattachedLines(u) {
9582
9599
  }
9583
9600
 
9584
9601
  // src/commands/run.ts
9585
- import { mkdir as mkdir2, readFile as readFile7 } from "fs/promises";
9602
+ import { mkdir as mkdir3, readFile as readFile7 } from "fs/promises";
9586
9603
  import { homedir as homedir12 } from "os";
9587
9604
  import { join as join14 } from "path";
9588
9605
  import {
@@ -9667,7 +9684,7 @@ async function runTrackedTool(args, options, ctx, adapter) {
9667
9684
  await assertSessionStoreSafe3(paths);
9668
9685
  const sessionId = prefixedUlid4("ses");
9669
9686
  const sessionDir = join14(paths.sessions, sessionId);
9670
- await mkdir2(sessionDir, { recursive: true });
9687
+ await mkdir3(sessionDir, { recursive: true });
9671
9688
  const appendEvent = ctx.appendEvent ?? (async (_sessionDir, event) => {
9672
9689
  await coreAppendChainedEvent2(paths, sessionId, event);
9673
9690
  });
@@ -14182,7 +14199,7 @@ async function assertWorkspaceInitialized15(basouRoot) {
14182
14199
  function readBuildStamp() {
14183
14200
  if (false) return void 0;
14184
14201
  try {
14185
- return JSON.parse('{"version":"0.60.0","commit":"75af68d","committedAt":"2026-10-02T00:20:09+09:00"}');
14202
+ return JSON.parse('{"version":"0.61.0","commit":"88f40fa","committedAt":"2026-10-02T12:13:29+09:00"}');
14186
14203
  } catch {
14187
14204
  return void 0;
14188
14205
  }