@basou/cli 0.20.0 → 0.22.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/program.js CHANGED
@@ -2885,6 +2885,19 @@ import {
2885
2885
  resolveSessionId as resolveSessionId2
2886
2886
  } from "@basou/core";
2887
2887
  import { InvalidArgumentError as InvalidArgumentError2 } from "commander";
2888
+ var NOTE_SUBCOMMAND_LOOKALIKES = /* @__PURE__ */ new Set([
2889
+ "list",
2890
+ "ls",
2891
+ "show",
2892
+ "get",
2893
+ "add",
2894
+ "new",
2895
+ "edit",
2896
+ "rm",
2897
+ "remove",
2898
+ "delete",
2899
+ "help"
2900
+ ]);
2888
2901
  var LABEL_BODY_MAX = 80;
2889
2902
  var LABEL_TRUNCATE_HEAD2 = LABEL_BODY_MAX - 3;
2890
2903
  function registerNoteCommand(program) {
@@ -2910,6 +2923,12 @@ async function doRunNote(body, options, ctx) {
2910
2923
  if (body.trim().length === 0) {
2911
2924
  throw new Error("Note body must not be empty");
2912
2925
  }
2926
+ const reserved = body.trim().toLowerCase();
2927
+ if (NOTE_SUBCOMMAND_LOOKALIKES.has(reserved)) {
2928
+ throw new Error(
2929
+ `'basou note' records a free-text note and has no '${body.trim()}' subcommand. To record a note, pass its full text (e.g. \`basou note "<your note>"\`).`
2930
+ );
2931
+ }
2913
2932
  const cwd = ctx.cwd ?? process.cwd();
2914
2933
  const repositoryRoot = await resolveBasouRootForCommand(cwd, "note");
2915
2934
  const paths = basouPaths8(repositoryRoot);
@@ -7173,7 +7192,6 @@ import {
7173
7192
  reconcileTask,
7174
7193
  refreshTaskLinkedSessions,
7175
7194
  replayEvents as replayEvents3,
7176
- resolveRepositoryRoot as resolveRepositoryRoot12,
7177
7195
  resolveSessionId as resolveSessionId4,
7178
7196
  resolveTaskId as resolveTaskId2,
7179
7197
  TaskStatusSchema,
@@ -8180,17 +8198,7 @@ async function readDescriptionFile(path) {
8180
8198
  }
8181
8199
  }
8182
8200
  async function resolveRepositoryRootForTask(cwd, subcmd) {
8183
- try {
8184
- return await resolveRepositoryRoot12(cwd);
8185
- } catch (error) {
8186
- if (error instanceof Error && error.message === "Not a git repository") {
8187
- throw new Error(
8188
- `Not a git repository. Run 'git init' first, then re-run 'basou task ${subcmd}'.`,
8189
- { cause: error }
8190
- );
8191
- }
8192
- throw error;
8193
- }
8201
+ return resolveBasouRootForCommand(cwd, `task ${subcmd}`);
8194
8202
  }
8195
8203
  async function assertWorkspaceInitialized12(basouRoot) {
8196
8204
  try {
@@ -8288,7 +8296,7 @@ import {
8288
8296
  basouPaths as basouPaths19,
8289
8297
  enumerateSessionDirs as enumerateSessionDirs3,
8290
8298
  findErrorCode as findErrorCode15,
8291
- resolveRepositoryRoot as resolveRepositoryRoot13,
8299
+ resolveRepositoryRoot as resolveRepositoryRoot12,
8292
8300
  resolveSessionId as resolveSessionId5,
8293
8301
  verifyEventsChain
8294
8302
  } from "@basou/core";
@@ -8359,7 +8367,7 @@ function renderVerdict(row) {
8359
8367
  }
8360
8368
  async function resolveRepositoryRootForVerify(cwd) {
8361
8369
  try {
8362
- return await resolveRepositoryRoot13(cwd);
8370
+ return await resolveRepositoryRoot12(cwd);
8363
8371
  } catch (error) {
8364
8372
  if (error instanceof Error && error.message === "Not a git repository") {
8365
8373
  throw new Error("Not a git repository. Run 'git init' first, then re-run 'basou verify'.", {
@@ -8389,7 +8397,7 @@ import {
8389
8397
  basouPaths as basouPaths20,
8390
8398
  findErrorCode as findErrorCode17,
8391
8399
  readManifest as readManifest13,
8392
- resolveRepositoryRoot as resolveRepositoryRoot14
8400
+ resolveRepositoryRoot as resolveRepositoryRoot13
8393
8401
  } from "@basou/core";
8394
8402
  import { InvalidArgumentError as InvalidArgumentError7 } from "commander";
8395
8403
 
@@ -9805,7 +9813,7 @@ function waitForShutdown(signal) {
9805
9813
  }
9806
9814
  async function resolveRepositoryRootForView(cwd) {
9807
9815
  try {
9808
- return await resolveRepositoryRoot14(cwd);
9816
+ return await resolveRepositoryRoot13(cwd);
9809
9817
  } catch (error) {
9810
9818
  if (error instanceof Error && error.message === "Not a git repository") {
9811
9819
  throw new Error("Not a git repository. Run 'git init' first, then re-run 'basou view'.", {