@hasna/todos 0.13.4 → 0.13.5

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.
@@ -1 +1 @@
1
- {"version":3,"file":"agent-commands.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/agent-commands.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkDzC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,QA6erD"}
1
+ {"version":3,"file":"agent-commands.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/agent-commands.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkDzC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,QA+erD"}
@@ -1 +1 @@
1
- {"version":3,"file":"task-commands.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/task-commands.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAsDzC,oFAAoF;AACpF,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAQ5D;AAkPD,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,QA63CpD"}
1
+ {"version":3,"file":"task-commands.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/task-commands.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAsDzC,oFAAoF;AACpF,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAQ5D;AAkPD,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,QAg4CpD"}
package/dist/cli/index.js CHANGED
@@ -2123,7 +2123,7 @@ var package_default;
2123
2123
  var init_package = __esm(() => {
2124
2124
  package_default = {
2125
2125
  name: "@hasna/todos",
2126
- version: "0.13.4",
2126
+ version: "0.13.5",
2127
2127
  description: "Universal task management for AI coding agents - CLI + MCP server + interactive TUI",
2128
2128
  type: "module",
2129
2129
  main: "dist/index.js",
@@ -6362,41 +6362,103 @@ function isMetadataInvocation(args, invocation) {
6362
6362
  }
6363
6363
  return invocation.commandArgs.length === 1 && (HELP_FLAGS.has(invocation.commandArgs[0]) || VERSION_FLAGS.has(invocation.commandArgs[0]));
6364
6364
  }
6365
- function commandSupportsRemote(invocation) {
6365
+ function firstPresentOption(args, candidates) {
6366
+ const option = candidates.find((candidate) => hasOption(args, candidate));
6367
+ return option ? dropIt(option) : null;
6368
+ }
6369
+ function disqualifyingArgument(invocation) {
6366
6370
  const command = invocation.command;
6367
- if (!command || COMMAND_CAPABILITY_MATRIX.get(command) !== "remote-http")
6368
- return false;
6369
6371
  const args = invocation.commandArgs;
6370
6372
  switch (command) {
6371
6373
  case "task":
6372
- return positionalArgs(args)[0] === "upsert";
6374
+ return positionalArgs(args)[0] === "upsert" ? null : { blame: "any subcommand other than `upsert`", remedy: "use `todos task upsert`" };
6373
6375
  case "doctor":
6374
- return positionalArgs(args)[0] !== "routing" && !hasOption(args, "--apply") && !hasOption(args, "--fix");
6376
+ if (positionalArgs(args)[0] === "routing")
6377
+ return dropIt("the `routing` subcommand");
6378
+ return firstPresentOption(args, ["--apply", "--fix"]);
6375
6379
  case "projects":
6376
- return !hasOption(args, "--deregister") && !hasOption(args, "--path-prefix") && !hasOption(args, "--dry-run");
6380
+ return firstPresentOption(args, ["--deregister", "--path-prefix", "--dry-run"]);
6377
6381
  case "plans":
6378
- return !hasOption(args, "--artifact") && !hasOption(args, "--write-artifacts");
6382
+ return firstPresentOption(args, ["--artifact", "--write-artifacts"]);
6379
6383
  case "list":
6380
- return !hasOption(args, "--recurring");
6384
+ return firstPresentOption(args, ["--recurring"]);
6381
6385
  case "claim":
6382
- return !invocation.globalOptions.has("--project") && !hasOption(args, "--project") && !hasOption(args, "--stale-minutes") && !hasOption(args, "--steal-stale");
6386
+ if (invocation.globalOptions.has("--project"))
6387
+ return dropIt("--project");
6388
+ return firstPresentOption(args, ["--project", "--stale-minutes", "--steal-stale"]);
6383
6389
  case "status":
6384
- return !invocation.globalOptions.has("--agent") && !hasOption(args, "--agent");
6385
- case "deps":
6386
- return true;
6390
+ if (invocation.globalOptions.has("--agent"))
6391
+ return dropIt("--agent");
6392
+ return firstPresentOption(args, ["--agent"]);
6387
6393
  case "bulk": {
6388
6394
  const action = positionalArgs(args)[0];
6389
6395
  if (action === "plan" || action === "move-plan")
6390
- return true;
6391
- return Boolean(action && ["done", "complete", "start", "delete"].includes(action)) && !hasOption(args, "--plan") && !hasOption(args, "--clear-plan");
6396
+ return null;
6397
+ if (!action) {
6398
+ return { blame: "a missing action", remedy: "pass one of done, complete, start, delete, plan, move-plan" };
6399
+ }
6400
+ if (!["done", "complete", "start", "delete"].includes(action)) {
6401
+ return {
6402
+ blame: `the \`${action}\` action`,
6403
+ remedy: "use one of done, complete, start, delete, plan, move-plan"
6404
+ };
6405
+ }
6406
+ return firstPresentOption(args, ["--plan", "--clear-plan"]);
6392
6407
  }
6393
6408
  default:
6394
- return true;
6409
+ return null;
6410
+ }
6411
+ }
6412
+ function commandSupportsRemote(invocation) {
6413
+ const command = invocation.command;
6414
+ if (!command || COMMAND_CAPABILITY_MATRIX.get(command) !== "remote-http")
6415
+ return false;
6416
+ return disqualifyingArgument(invocation) === null;
6417
+ }
6418
+ function editDistance(a, b) {
6419
+ const rows = a.length + 1;
6420
+ const cols = b.length + 1;
6421
+ let twoBack = new Array(cols).fill(0);
6422
+ let previous = Array.from({ length: cols }, (_, index) => index);
6423
+ for (let row = 1;row < rows; row += 1) {
6424
+ const current = [row, ...new Array(cols - 1).fill(0)];
6425
+ for (let col = 1;col < cols; col += 1) {
6426
+ const substitution = previous[col - 1] + (a[row - 1] === b[col - 1] ? 0 : 1);
6427
+ current[col] = Math.min(current[col - 1] + 1, previous[col] + 1, substitution);
6428
+ if (row > 1 && col > 1 && a[row - 1] === b[col - 2] && a[row - 2] === b[col - 1]) {
6429
+ current[col] = Math.min(current[col], twoBack[col - 2] + 1);
6430
+ }
6431
+ }
6432
+ twoBack = previous;
6433
+ previous = current;
6395
6434
  }
6435
+ return previous[cols - 1];
6436
+ }
6437
+ function nearestCommands(command, limit = 3) {
6438
+ const threshold = command.length <= 4 ? 1 : command.length <= 8 ? 2 : 3;
6439
+ return [...COMMAND_CAPABILITY_MATRIX.entries()].filter(([, owner]) => owner !== "local-only").map(([candidate]) => candidate).map((candidate) => ({ candidate, distance: editDistance(command, candidate) })).filter(({ distance }) => distance <= threshold).sort((left, right) => left.distance - right.distance || left.candidate.localeCompare(right.candidate)).slice(0, limit).map(({ candidate }) => candidate);
6396
6440
  }
6397
6441
  function assertRemoteCommandSupported(invocation) {
6398
- if (invocation.invalidGlobalOption || invocation.unknownLeadingOption || !commandSupportsRemote(invocation)) {
6399
- throw new Error(`REMOTE_COMMAND_UNSUPPORTED: ${invocationLabel(invocation)} is not supported by the Todos /v1 CLI; ` + "local SQLite fallback is disabled");
6442
+ if (invocation.invalidGlobalOption) {
6443
+ throw new Error(`REMOTE_COMMAND_UNSUPPORTED: the global option ${invocation.invalidGlobalOption} was given without a value; ` + `pass one as \`${invocation.invalidGlobalOption} <value>\``);
6444
+ }
6445
+ if (invocation.unknownLeadingOption) {
6446
+ throw new Error(`REMOTE_COMMAND_UNSUPPORTED: unknown option ${invocation.unknownLeadingOption} before the command; ` + "run `todos --help` for the global options");
6447
+ }
6448
+ const command = invocation.command;
6449
+ const owner = command ? COMMAND_CAPABILITY_MATRIX.get(command) : undefined;
6450
+ if (command && !owner) {
6451
+ const suggestions = nearestCommands(command);
6452
+ const didYouMean = suggestions.length > 0 ? ` Did you mean: ${suggestions.join(", ")}?` : "";
6453
+ throw new Error(`UNKNOWN_COMMAND: \`${command}\` is not a built-in todos command on the /v1 route.${didYouMean} ` + "Run `todos --help` for the commands available here; verbs contributed by optional packages are local-only. " + "(This is not a connectivity, storage-mode or credential problem.)");
6454
+ }
6455
+ if (command && owner === "local-only") {
6456
+ throw new Error(`REMOTE_COMMAND_UNSUPPORTED: \`${command}\` is a local-only command and the Todos /v1 authority does not ` + "serve it; local SQLite fallback is disabled. Run `todos --help` to see the commands this route supports.");
6457
+ }
6458
+ if (!command || !commandSupportsRemote(invocation)) {
6459
+ const blame = command ? disqualifyingArgument(invocation) : null;
6460
+ const detail = blame ? `\`${command}\` is served by the Todos /v1 authority but ${blame.blame} is not; ${blame.remedy}` : `${invocationLabel(invocation)} is not supported by the Todos /v1 CLI; local SQLite fallback is disabled`;
6461
+ throw new Error(`REMOTE_COMMAND_UNSUPPORTED: ${detail}`);
6400
6462
  }
6401
6463
  }
6402
6464
  function initializeTodosCliAuthority(args = process.argv.slice(2), env = process.env) {
@@ -6415,7 +6477,7 @@ function initializeTodosCliAuthority(args = process.argv.slice(2), env = process
6415
6477
  }
6416
6478
  return { route: "remote-http", v1_base_url: client.baseUrl };
6417
6479
  }
6418
- var REGISTERED_CANONICAL_COMMANDS, TODOS_CLI_COMMAND_ALIASES, DIAGNOSTIC_COMMANDS, REMOTE_COMMANDS, COMMAND_CAPABILITY_MATRIX, GLOBAL_OPTIONS_WITH_VALUES, GLOBAL_FLAGS, HELP_FLAGS, VERSION_FLAGS;
6480
+ var REGISTERED_CANONICAL_COMMANDS, TODOS_CLI_COMMAND_ALIASES, DIAGNOSTIC_COMMANDS, REMOTE_COMMANDS, COMMAND_CAPABILITY_MATRIX, GLOBAL_OPTIONS_WITH_VALUES, GLOBAL_FLAGS, HELP_FLAGS, VERSION_FLAGS, dropIt = (blame) => ({ blame, remedy: "re-run without it" });
6419
6481
  var init_stage_a = __esm(() => {
6420
6482
  init_esm();
6421
6483
  init_cloud_router();
@@ -6594,6 +6656,8 @@ var init_stage_a = __esm(() => {
6594
6656
  "template-history": ["templates-history"],
6595
6657
  "agents-normalize": ["normalize-agents"],
6596
6658
  "agent-update": ["agents-update"],
6659
+ done: ["complete"],
6660
+ init: ["register"],
6597
6661
  upgrade: ["self-update"],
6598
6662
  roadmaps: ["roadmap"],
6599
6663
  "env-snapshot": ["environment-snapshot"],
@@ -20099,7 +20163,7 @@ ${chalk2.cyan(sid)} ${statusColor(task2.status)} ${prioColor(task2.priority)} ${
20099
20163
  console.log(formatTaskLine(task2));
20100
20164
  }
20101
20165
  });
20102
- program2.command("done <id>").description("Mark a task as completed").option("--attach-ids <ids>", "Comma-separated @hasna/attachments IDs to link as evidence").option("--files-changed <files>", "Comma-separated list of files changed").option("--test-results <results>", "Test results summary").option("--commit-hash <hash>", "Git commit hash").option("--notes <notes>", "Completion notes").option("--confidence <0-1>", "Agent's confidence 0.0-1.0 that the task is fully complete (default: 1.0, <0.7 flagged for review)").action(async (id, opts) => {
20166
+ program2.command("done <id>").alias("complete").description("Mark a task as completed (alias: complete)").option("--attach-ids <ids>", "Comma-separated @hasna/attachments IDs to link as evidence").option("--files-changed <files>", "Comma-separated list of files changed").option("--test-results <results>", "Test results summary").option("--commit-hash <hash>", "Git commit hash").option("--notes <notes>", "Completion notes").option("--confidence <0-1>", "Agent's confidence 0.0-1.0 that the task is fully complete (default: 1.0, <0.7 flagged for review)").action(async (id, opts) => {
20103
20167
  const globalOpts = program2.opts();
20104
20168
  const attachmentIds = opts.attachIds ? opts.attachIds.split(",").map((s) => s.trim()).filter(Boolean) : undefined;
20105
20169
  const filesChanged = opts.filesChanged ? opts.filesChanged.split(",").map((s) => s.trim()).filter(Boolean) : undefined;
@@ -26747,7 +26811,7 @@ function resolveCloudAgentByNameOrId(agents, nameOrId) {
26747
26811
  return matches.reduce((freshest, candidate) => new Date(candidate.last_seen_at).getTime() > new Date(freshest.last_seen_at).getTime() ? candidate : freshest);
26748
26812
  }
26749
26813
  function registerAgentCommands(program2) {
26750
- program2.command("init <name>").description("Register an agents and get a short UUID").option("-d, --description <text>", "Agent description").action(async (name, opts) => {
26814
+ program2.command("init <name>").alias("register").description("Register an agent and get a short UUID (alias: register)").option("-d, --description <text>", "Agent description").action(async (name, opts) => {
26751
26815
  const globalOpts = program2.opts();
26752
26816
  try {
26753
26817
  const cloud = getTodosCloudClient();
@@ -26,6 +26,8 @@ export declare const TODOS_CLI_COMMAND_ALIASES: {
26
26
  readonly "template-history": readonly ["templates-history"];
27
27
  readonly "agents-normalize": readonly ["normalize-agents"];
28
28
  readonly "agent-update": readonly ["agents-update"];
29
+ readonly done: readonly ["complete"];
30
+ readonly init: readonly ["register"];
29
31
  readonly upgrade: readonly ["self-update"];
30
32
  readonly roadmaps: readonly ["roadmap"];
31
33
  readonly "env-snapshot": readonly ["environment-snapshot"];
@@ -1 +1 @@
1
- {"version":3,"file":"stage-a.d.ts","sourceRoot":"","sources":["../../src/cli/stage-a.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAQ,MAAM,WAAW,CAAC;AAO1C,KAAK,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AAE9C,MAAM,MAAM,+BAA+B,GACvC;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,WAAW,EAAE,IAAI,CAAA;CAAE,GACrC;IAAE,KAAK,EAAE,mBAAmB,CAAC;IAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAC1D;IAAE,KAAK,EAAE,aAAa,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC;AAElD,MAAM,MAAM,oBAAoB,GAAG,YAAY,GAAG,aAAa,GAAG,YAAY,CAAC;AAyB/E,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;CAuBgB,CAAC;AAsBvD,wBAAgB,kCAAkC,IAAI,WAAW,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAE9F;AAED;;;;;;;GAOG;AACH,wBAAgB,gCAAgC,CAC9C,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,+BAA+B,CAAC,OAAO,CAAC,GAC9C,OAAO,CAKT;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE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B,+BAA+B,CAgBjC"}
package/dist/contracts.js CHANGED
@@ -11900,7 +11900,7 @@ var init_tasks = __esm(() => {
11900
11900
  // package.json
11901
11901
  var package_default = {
11902
11902
  name: "@hasna/todos",
11903
- version: "0.13.4",
11903
+ version: "0.13.5",
11904
11904
  description: "Universal task management for AI coding agents - CLI + MCP server + interactive TUI",
11905
11905
  type: "module",
11906
11906
  main: "dist/index.js",
package/dist/index.js CHANGED
@@ -12013,7 +12013,7 @@ var init_dispatches = __esm(() => {
12013
12013
  // package.json
12014
12014
  var package_default = {
12015
12015
  name: "@hasna/todos",
12016
- version: "0.13.4",
12016
+ version: "0.13.5",
12017
12017
  description: "Universal task management for AI coding agents - CLI + MCP server + interactive TUI",
12018
12018
  type: "module",
12019
12019
  main: "dist/index.js",
package/dist/mcp/index.js CHANGED
@@ -34571,7 +34571,7 @@ var package_default;
34571
34571
  var init_package = __esm(() => {
34572
34572
  package_default = {
34573
34573
  name: "@hasna/todos",
34574
- version: "0.13.4",
34574
+ version: "0.13.5",
34575
34575
  description: "Universal task management for AI coding agents - CLI + MCP server + interactive TUI",
34576
34576
  type: "module",
34577
34577
  main: "dist/index.js",
package/dist/mcp.js CHANGED
@@ -41,7 +41,7 @@ var __require = import.meta.require;
41
41
  // package.json
42
42
  var package_default = {
43
43
  name: "@hasna/todos",
44
- version: "0.13.4",
44
+ version: "0.13.5",
45
45
  description: "Universal task management for AI coding agents - CLI + MCP server + interactive TUI",
46
46
  type: "module",
47
47
  main: "dist/index.js",
package/dist/registry.js CHANGED
@@ -11900,7 +11900,7 @@ var init_tasks = __esm(() => {
11900
11900
  // package.json
11901
11901
  var package_default = {
11902
11902
  name: "@hasna/todos",
11903
- version: "0.13.4",
11903
+ version: "0.13.5",
11904
11904
  description: "Universal task management for AI coding agents - CLI + MCP server + interactive TUI",
11905
11905
  type: "module",
11906
11906
  main: "dist/index.js",
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "packageName": "@hasna/todos",
3
- "packageVersion": "0.13.4",
3
+ "packageVersion": "0.13.5",
4
4
  "repository": "https://github.com/hasna/todos.git",
5
- "gitCommit": "c2c3517bab2321911c44285625ecaa58fcf606ff",
6
- "gitTree": "f3acc3cc1322f240e911e1ab483a7a5ef88371cd",
7
- "sourceTreeSha256": "445622ccd461d74a6c060130c1bccfa72b829d74b24b5358b0e36cb730eb8374",
8
- "generatedAt": "2026-07-31T11:35:34.000Z"
5
+ "gitCommit": "305b1033309bc22e62d2a636499436f43f01fff3",
6
+ "gitTree": "e291ed0071837371f5711a02455d6155c42ec7a5",
7
+ "sourceTreeSha256": "0ad301aa18686673cba69326bacd3aeacbcb92096d6f10b5477e500d6883c467",
8
+ "generatedAt": "2026-07-31T15:55:50.000Z"
9
9
  }
@@ -70,7 +70,7 @@ var package_default;
70
70
  var init_package = __esm(() => {
71
71
  package_default = {
72
72
  name: "@hasna/todos",
73
- version: "0.13.4",
73
+ version: "0.13.5",
74
74
  description: "Universal task management for AI coding agents - CLI + MCP server + interactive TUI",
75
75
  type: "module",
76
76
  main: "dist/index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/todos",
3
- "version": "0.13.4",
3
+ "version": "0.13.5",
4
4
  "description": "Universal task management for AI coding agents - CLI + MCP server + interactive TUI",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",