@metyatech/task-tracker 0.2.4 → 0.2.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.
Files changed (2) hide show
  1. package/dist/cli.js +42 -1
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -484,6 +484,18 @@ function startGui(dir, port = 3333) {
484
484
  import process2 from "process";
485
485
  var __filename2 = fileURLToPath2(import.meta.url);
486
486
  var __dirname2 = dirname3(__filename2);
487
+ var HYPHENATED_TASK_ID_PATTERN = /^-[A-Za-z0-9_-]{7}$/;
488
+ var TASK_ID_COMMAND_OPTIONS = {
489
+ update: {
490
+ "--stage": true,
491
+ "--description": true,
492
+ "--json": false
493
+ },
494
+ done: {
495
+ "--keep": true
496
+ },
497
+ remove: {}
498
+ };
487
499
  var version = "0.0.0";
488
500
  try {
489
501
  const pkg = JSON.parse(readFileSync3(join5(__dirname2, "..", "package.json"), "utf-8"));
@@ -508,6 +520,35 @@ function getStorage() {
508
520
  process2.exit(1);
509
521
  }
510
522
  }
523
+ function normalizeHyphenatedTaskIdArg(argv) {
524
+ const commandName = argv[2];
525
+ const optionSpec = TASK_ID_COMMAND_OPTIONS[commandName];
526
+ if (!optionSpec) {
527
+ return argv;
528
+ }
529
+ const args = argv.slice(3);
530
+ if (args.includes("--")) {
531
+ return argv;
532
+ }
533
+ for (let i = 0; i < args.length; i += 1) {
534
+ const token = args[i];
535
+ const consumesValue = optionSpec[token];
536
+ if (consumesValue !== void 0) {
537
+ if (consumesValue) {
538
+ i += 1;
539
+ }
540
+ continue;
541
+ }
542
+ if (!token.startsWith("-")) {
543
+ return argv;
544
+ }
545
+ if (!HYPHENATED_TASK_ID_PATTERN.test(token)) {
546
+ return argv;
547
+ }
548
+ return [...argv.slice(0, 3), ...args.slice(0, i), ...args.slice(i + 1), "--", token];
549
+ }
550
+ return argv;
551
+ }
511
552
  var program = new Command();
512
553
  program.name("task-tracker").description("Persistent task lifecycle tracker for AI agent sessions").version(version, "-V, --version");
513
554
  program.command("add <description>").description("Add a new task").option(
@@ -665,4 +706,4 @@ program.command("gui [dir]").description("Start the web GUI (defaults to current
665
706
  const port = parseInt(opts.port, 10) || 3333;
666
707
  startGui(targetDir, port);
667
708
  });
668
- program.parse(process2.argv);
709
+ program.parse(normalizeHyphenatedTaskIdArg(process2.argv));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metyatech/task-tracker",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "Persistent task lifecycle tracker for AI agent sessions",
5
5
  "type": "module",
6
6
  "bin": {