@obsfx/trekker 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.
Files changed (34) hide show
  1. package/dist/index.js +210 -153
  2. package/package.json +1 -1
  3. package/webapp-dist/.next/BUILD_ID +1 -1
  4. package/webapp-dist/.next/build-manifest.json +2 -2
  5. package/webapp-dist/.next/prerender-manifest.json +3 -3
  6. package/webapp-dist/.next/server/app/_global-error.html +2 -2
  7. package/webapp-dist/.next/server/app/_global-error.rsc +1 -1
  8. package/webapp-dist/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  9. package/webapp-dist/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  10. package/webapp-dist/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  11. package/webapp-dist/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  12. package/webapp-dist/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  13. package/webapp-dist/.next/server/app/_not-found.html +2 -2
  14. package/webapp-dist/.next/server/app/_not-found.rsc +1 -1
  15. package/webapp-dist/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  16. package/webapp-dist/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  17. package/webapp-dist/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  18. package/webapp-dist/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  19. package/webapp-dist/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  20. package/webapp-dist/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  21. package/webapp-dist/.next/server/app/index.html +2 -2
  22. package/webapp-dist/.next/server/app/index.rsc +1 -1
  23. package/webapp-dist/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  24. package/webapp-dist/.next/server/app/index.segments/_full.segment.rsc +1 -1
  25. package/webapp-dist/.next/server/app/index.segments/_head.segment.rsc +1 -1
  26. package/webapp-dist/.next/server/app/index.segments/_index.segment.rsc +1 -1
  27. package/webapp-dist/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  28. package/webapp-dist/.next/server/pages/404.html +2 -2
  29. package/webapp-dist/.next/server/pages/500.html +2 -2
  30. package/webapp-dist/.next/server/server-reference-manifest.js +1 -1
  31. package/webapp-dist/.next/server/server-reference-manifest.json +1 -1
  32. /package/webapp-dist/.next/static/{BJnKdEVHZIBqD4VUrBhO5 → BH8VS7faThzSEOQAvL7PS}/_buildManifest.js +0 -0
  33. /package/webapp-dist/.next/static/{BJnKdEVHZIBqD4VUrBhO5 → BH8VS7faThzSEOQAvL7PS}/_clientMiddlewareManifest.json +0 -0
  34. /package/webapp-dist/.next/static/{BJnKdEVHZIBqD4VUrBhO5 → BH8VS7faThzSEOQAvL7PS}/_ssgManifest.js +0 -0
package/dist/index.js CHANGED
@@ -1,44 +1,39 @@
1
1
  #!/usr/bin/env bun
2
- // @bun
2
+ #!/usr/bin/env bun
3
3
  var __defProp = Object.defineProperty;
4
4
  var __export = (target, all) => {
5
5
  for (var name in all)
6
- __defProp(target, name, {
7
- get: all[name],
8
- enumerable: true,
9
- configurable: true,
10
- set: (newValue) => all[name] = () => newValue
11
- });
6
+ __defProp(target, name, { get: all[name], enumerable: true });
12
7
  };
13
8
 
14
- // src/index.ts
9
+ // packages/cli/src/index.ts
15
10
  import { Command as Command11 } from "commander";
16
11
 
17
- // src/commands/init.ts
12
+ // packages/cli/src/commands/init.ts
18
13
  import { Command } from "commander";
19
14
 
20
- // src/db/client.ts
15
+ // packages/cli/src/db/client.ts
21
16
  import { Database } from "bun:sqlite";
22
17
  import { drizzle } from "drizzle-orm/bun-sqlite";
23
18
 
24
- // src/db/schema.ts
25
- var exports_schema = {};
26
- __export(exports_schema, {
27
- tasksRelations: () => tasksRelations,
28
- tasks: () => tasks,
29
- projectsRelations: () => projectsRelations,
30
- projects: () => projects,
31
- idCounters: () => idCounters,
32
- epicsRelations: () => epicsRelations,
33
- epics: () => epics,
34
- dependenciesRelations: () => dependenciesRelations,
35
- dependencies: () => dependencies,
19
+ // packages/cli/src/db/schema.ts
20
+ var schema_exports = {};
21
+ __export(schema_exports, {
22
+ comments: () => comments,
36
23
  commentsRelations: () => commentsRelations,
37
- comments: () => comments
24
+ dependencies: () => dependencies,
25
+ dependenciesRelations: () => dependenciesRelations,
26
+ epics: () => epics,
27
+ epicsRelations: () => epicsRelations,
28
+ idCounters: () => idCounters,
29
+ projects: () => projects,
30
+ projectsRelations: () => projectsRelations,
31
+ tasks: () => tasks,
32
+ tasksRelations: () => tasksRelations
38
33
  });
39
34
  import { relations } from "drizzle-orm";
40
35
 
41
- // ../shared/schema.ts
36
+ // packages/shared/schema.ts
42
37
  import { sqliteTable, text, integer } from "drizzle-orm/sqlite-core";
43
38
  var projects = sqliteTable("projects", {
44
39
  id: text("id").primaryKey(),
@@ -87,7 +82,8 @@ var idCounters = sqliteTable("id_counters", {
87
82
  entityType: text("entity_type").primaryKey(),
88
83
  counter: integer("counter").notNull().default(0)
89
84
  });
90
- // ../shared/types.ts
85
+
86
+ // packages/shared/types.ts
91
87
  var TASK_STATUSES = [
92
88
  "todo",
93
89
  "in_progress",
@@ -106,7 +102,8 @@ var PREFIX_MAP = {
106
102
  epic: "EPIC",
107
103
  comment: "CMT"
108
104
  };
109
- // src/db/schema.ts
105
+
106
+ // packages/cli/src/db/schema.ts
110
107
  var projectsRelations = relations(projects, ({ many }) => ({
111
108
  epics: many(epics),
112
109
  tasks: many(tasks)
@@ -156,7 +153,7 @@ var dependenciesRelations = relations(dependencies, ({ one }) => ({
156
153
  })
157
154
  }));
158
155
 
159
- // src/db/client.ts
156
+ // packages/cli/src/db/client.ts
160
157
  import { existsSync, mkdirSync, rmSync } from "fs";
161
158
  import { join } from "path";
162
159
  var TREKKER_DIR = ".trekker";
@@ -184,17 +181,19 @@ function getDb(cwd = process.cwd()) {
184
181
  }
185
182
  const dbPath = getDbPath(cwd);
186
183
  if (!existsSync(dbPath)) {
187
- throw new Error("Trekker not initialized. Run 'trekker init' first.");
184
+ throw new Error(
185
+ "Trekker not initialized. Run 'trekker init' first."
186
+ );
188
187
  }
189
188
  sqliteInstance = new Database(dbPath);
190
- dbInstance = drizzle(sqliteInstance, { schema: exports_schema });
189
+ dbInstance = drizzle(sqliteInstance, { schema: schema_exports });
191
190
  return dbInstance;
192
191
  }
193
192
  function createDb(cwd = process.cwd()) {
194
193
  ensureTrekkerDir(cwd);
195
194
  const dbPath = getDbPath(cwd);
196
195
  sqliteInstance = new Database(dbPath);
197
- dbInstance = drizzle(sqliteInstance, { schema: exports_schema });
196
+ dbInstance = drizzle(sqliteInstance, { schema: schema_exports });
198
197
  sqliteInstance.exec(`
199
198
  CREATE TABLE IF NOT EXISTS projects (
200
199
  id TEXT PRIMARY KEY,
@@ -271,7 +270,7 @@ function deleteDb(cwd = process.cwd()) {
271
270
  }
272
271
  }
273
272
 
274
- // src/utils/id-generator.ts
273
+ // packages/cli/src/utils/id-generator.ts
275
274
  import { eq, sql } from "drizzle-orm";
276
275
  function generateId(entityType) {
277
276
  const db = getDb();
@@ -287,7 +286,7 @@ function generateUuid() {
287
286
  return crypto.randomUUID();
288
287
  }
289
288
 
290
- // src/services/project.ts
289
+ // packages/cli/src/services/project.ts
291
290
  import { basename } from "path";
292
291
  function initProject(cwd = process.cwd()) {
293
292
  if (isTrekkerInitialized(cwd)) {
@@ -295,7 +294,7 @@ function initProject(cwd = process.cwd()) {
295
294
  }
296
295
  const db = createDb(cwd);
297
296
  const projectName = basename(cwd);
298
- const now = new Date;
297
+ const now = /* @__PURE__ */ new Date();
299
298
  db.insert(projects).values({
300
299
  id: generateUuid(),
301
300
  name: projectName,
@@ -310,7 +309,7 @@ function wipeProject(cwd = process.cwd()) {
310
309
  deleteDb(cwd);
311
310
  }
312
311
 
313
- // src/utils/output.ts
312
+ // packages/cli/src/utils/output.ts
314
313
  var jsonMode = false;
315
314
  function setJsonMode(enabled) {
316
315
  jsonMode = enabled;
@@ -373,8 +372,7 @@ function formatTask(task) {
373
372
  }
374
373
  lines.push(`Created: ${task.createdAt.toISOString()}`);
375
374
  lines.push(`Updated: ${task.updatedAt.toISOString()}`);
376
- return lines.join(`
377
- `);
375
+ return lines.join("\n");
378
376
  }
379
377
  function formatEpic(epic) {
380
378
  const lines = [
@@ -388,8 +386,7 @@ function formatEpic(epic) {
388
386
  }
389
387
  lines.push(`Created: ${epic.createdAt.toISOString()}`);
390
388
  lines.push(`Updated: ${epic.updatedAt.toISOString()}`);
391
- return lines.join(`
392
- `);
389
+ return lines.join("\n");
393
390
  }
394
391
  function formatComment(comment) {
395
392
  const lines = [
@@ -398,8 +395,7 @@ function formatComment(comment) {
398
395
  `Content: ${comment.content}`,
399
396
  `Created: ${comment.createdAt.toISOString()}`
400
397
  ];
401
- return lines.join(`
402
- `);
398
+ return lines.join("\n");
403
399
  }
404
400
  function formatTaskList(tasks2) {
405
401
  if (tasks2.length === 0) {
@@ -410,8 +406,7 @@ function formatTaskList(tasks2) {
410
406
  const parent = task.parentTaskId ? ` (subtask of ${task.parentTaskId})` : "";
411
407
  return `${task.id} | ${task.status.padEnd(11)} | P${task.priority} | ${task.title}${tags}${parent}`;
412
408
  });
413
- return lines.join(`
414
- `);
409
+ return lines.join("\n");
415
410
  }
416
411
  function formatEpicList(epics2) {
417
412
  if (epics2.length === 0) {
@@ -420,30 +415,26 @@ function formatEpicList(epics2) {
420
415
  const lines = epics2.map((epic) => {
421
416
  return `${epic.id} | ${epic.status.padEnd(11)} | P${epic.priority} | ${epic.title}`;
422
417
  });
423
- return lines.join(`
424
- `);
418
+ return lines.join("\n");
425
419
  }
426
420
  function formatCommentList(comments2) {
427
421
  if (comments2.length === 0) {
428
422
  return "No comments found.";
429
423
  }
430
- return comments2.map((c) => `[${c.id}] ${c.author}: ${c.content}`).join(`
431
- `);
424
+ return comments2.map((c) => `[${c.id}] ${c.author}: ${c.content}`).join("\n");
432
425
  }
433
426
  function formatDependencyList(dependencies2, direction) {
434
427
  if (dependencies2.length === 0) {
435
428
  return direction === "depends_on" ? "No dependencies." : "Does not block any tasks.";
436
429
  }
437
430
  if (direction === "depends_on") {
438
- return dependencies2.map((d) => ` \u2192 depends on ${d.dependsOnId}`).join(`
439
- `);
431
+ return dependencies2.map((d) => ` \u2192 depends on ${d.dependsOnId}`).join("\n");
440
432
  } else {
441
- return dependencies2.map((d) => ` \u2192 blocks ${d.taskId}`).join(`
442
- `);
433
+ return dependencies2.map((d) => ` \u2192 blocks ${d.taskId}`).join("\n");
443
434
  }
444
435
  }
445
436
 
446
- // src/commands/init.ts
437
+ // packages/cli/src/commands/init.ts
447
438
  var initCommand = new Command("init").description("Initialize Trekker in the current directory").action(() => {
448
439
  try {
449
440
  if (isTrekkerInitialized()) {
@@ -458,7 +449,7 @@ var initCommand = new Command("init").description("Initialize Trekker in the cur
458
449
  }
459
450
  });
460
451
 
461
- // src/commands/wipe.ts
452
+ // packages/cli/src/commands/wipe.ts
462
453
  import { Command as Command2 } from "commander";
463
454
  import * as readline from "readline";
464
455
  var wipeCommand = new Command2("wipe").description("Delete all Trekker data in the current directory").option("-y, --yes", "Skip confirmation prompt").action(async (options) => {
@@ -468,7 +459,9 @@ var wipeCommand = new Command2("wipe").description("Delete all Trekker data in t
468
459
  process.exit(1);
469
460
  }
470
461
  if (!options.yes) {
471
- const confirmed = await confirm("Are you sure you want to delete all Trekker data? This cannot be undone. (y/N): ");
462
+ const confirmed = await confirm(
463
+ "Are you sure you want to delete all Trekker data? This cannot be undone. (y/N): "
464
+ );
472
465
  if (!confirmed) {
473
466
  console.log("Aborted.");
474
467
  return;
@@ -482,22 +475,22 @@ var wipeCommand = new Command2("wipe").description("Delete all Trekker data in t
482
475
  }
483
476
  });
484
477
  function confirm(prompt) {
485
- return new Promise((resolve) => {
478
+ return new Promise((resolve2) => {
486
479
  const rl = readline.createInterface({
487
480
  input: process.stdin,
488
481
  output: process.stdout
489
482
  });
490
483
  rl.question(prompt, (answer) => {
491
484
  rl.close();
492
- resolve(answer.toLowerCase() === "y" || answer.toLowerCase() === "yes");
485
+ resolve2(answer.toLowerCase() === "y" || answer.toLowerCase() === "yes");
493
486
  });
494
487
  });
495
488
  }
496
489
 
497
- // src/commands/epic.ts
490
+ // packages/cli/src/commands/epic.ts
498
491
  import { Command as Command3 } from "commander";
499
492
 
500
- // src/services/epic.ts
493
+ // packages/cli/src/services/epic.ts
501
494
  import { eq as eq2 } from "drizzle-orm";
502
495
  function createEpic(input) {
503
496
  const db = getDb();
@@ -506,7 +499,7 @@ function createEpic(input) {
506
499
  throw new Error("Project not found. Run 'trekker init' first.");
507
500
  }
508
501
  const id = generateId("epic");
509
- const now = new Date;
502
+ const now = /* @__PURE__ */ new Date();
510
503
  const epic = {
511
504
  id,
512
505
  projectId: project.id,
@@ -539,16 +532,12 @@ function updateEpic(id, input) {
539
532
  throw new Error(`Epic not found: ${id}`);
540
533
  }
541
534
  const updates = {
542
- updatedAt: new Date
535
+ updatedAt: /* @__PURE__ */ new Date()
543
536
  };
544
- if (input.title !== undefined)
545
- updates.title = input.title;
546
- if (input.description !== undefined)
547
- updates.description = input.description;
548
- if (input.status !== undefined)
549
- updates.status = input.status;
550
- if (input.priority !== undefined)
551
- updates.priority = input.priority;
537
+ if (input.title !== void 0) updates.title = input.title;
538
+ if (input.description !== void 0) updates.description = input.description;
539
+ if (input.status !== void 0) updates.status = input.status;
540
+ if (input.priority !== void 0) updates.priority = input.priority;
552
541
  db.update(epics).set(updates).where(eq2(epics.id, id)).run();
553
542
  return getEpic(id);
554
543
  }
@@ -560,7 +549,8 @@ function deleteEpic(id) {
560
549
  }
561
550
  db.delete(epics).where(eq2(epics.id, id)).run();
562
551
  }
563
- // src/utils/validator.ts
552
+
553
+ // packages/cli/src/utils/validator.ts
564
554
  function isValidTaskStatus(status) {
565
555
  return TASK_STATUSES.includes(status);
566
556
  }
@@ -571,24 +561,26 @@ function isValidPriority(priority) {
571
561
  return Number.isInteger(priority) && priority >= 0 && priority <= 5;
572
562
  }
573
563
  function parseStatus(status, type) {
574
- if (!status)
575
- return;
564
+ if (!status) return void 0;
576
565
  const normalizedStatus = status.toLowerCase().replace(/-/g, "_");
577
566
  if (type === "task") {
578
567
  if (!isValidTaskStatus(normalizedStatus)) {
579
- throw new Error(`Invalid task status: ${status}. Valid values: ${TASK_STATUSES.join(", ")}`);
568
+ throw new Error(
569
+ `Invalid task status: ${status}. Valid values: ${TASK_STATUSES.join(", ")}`
570
+ );
580
571
  }
581
572
  return normalizedStatus;
582
573
  } else {
583
574
  if (!isValidEpicStatus(normalizedStatus)) {
584
- throw new Error(`Invalid epic status: ${status}. Valid values: ${EPIC_STATUSES.join(", ")}`);
575
+ throw new Error(
576
+ `Invalid epic status: ${status}. Valid values: ${EPIC_STATUSES.join(", ")}`
577
+ );
585
578
  }
586
579
  return normalizedStatus;
587
580
  }
588
581
  }
589
582
  function parsePriority(priority) {
590
- if (priority === undefined)
591
- return;
583
+ if (priority === void 0) return void 0;
592
584
  const num = parseInt(priority, 10);
593
585
  if (isNaN(num) || !isValidPriority(num)) {
594
586
  throw new Error(`Invalid priority: ${priority}. Must be a number between 0 and 5.`);
@@ -596,13 +588,15 @@ function parsePriority(priority) {
596
588
  return num;
597
589
  }
598
590
  function validateRequired(value, fieldName) {
599
- if (value === undefined || value === null || value === "") {
591
+ if (value === void 0 || value === null || value === "") {
600
592
  throw new Error(`${fieldName} is required`);
601
593
  }
602
594
  }
603
595
 
604
- // src/commands/epic.ts
605
- var epicCommand = new Command3("epic").description("Manage epics");
596
+ // packages/cli/src/commands/epic.ts
597
+ var epicCommand = new Command3("epic").description(
598
+ "Manage epics"
599
+ );
606
600
  epicCommand.command("create").description("Create a new epic").requiredOption("-t, --title <title>", "Epic title").option("-d, --description <description>", "Epic description").option("-p, --priority <priority>", "Priority (0-5, default: 2)").option("-s, --status <status>", "Status (todo, in_progress, completed, archived)").action((options) => {
607
601
  try {
608
602
  validateRequired(options.title, "Title");
@@ -683,10 +677,10 @@ epicCommand.command("delete <epic-id>").description("Delete an epic").action((ep
683
677
  }
684
678
  });
685
679
 
686
- // src/commands/task.ts
680
+ // packages/cli/src/commands/task.ts
687
681
  import { Command as Command4 } from "commander";
688
682
 
689
- // src/services/task.ts
683
+ // packages/cli/src/services/task.ts
690
684
  import { eq as eq3, and, isNull } from "drizzle-orm";
691
685
  function createTask(input) {
692
686
  const db = getDb();
@@ -707,7 +701,7 @@ function createTask(input) {
707
701
  }
708
702
  }
709
703
  const id = generateId("task");
710
- const now = new Date;
704
+ const now = /* @__PURE__ */ new Date();
711
705
  const task = {
712
706
  id,
713
707
  projectId: project.id,
@@ -765,20 +759,14 @@ function updateTask(id, input) {
765
759
  }
766
760
  }
767
761
  const updates = {
768
- updatedAt: new Date
762
+ updatedAt: /* @__PURE__ */ new Date()
769
763
  };
770
- if (input.title !== undefined)
771
- updates.title = input.title;
772
- if (input.description !== undefined)
773
- updates.description = input.description;
774
- if (input.priority !== undefined)
775
- updates.priority = input.priority;
776
- if (input.status !== undefined)
777
- updates.status = input.status;
778
- if (input.tags !== undefined)
779
- updates.tags = input.tags;
780
- if (input.epicId !== undefined)
781
- updates.epicId = input.epicId;
764
+ if (input.title !== void 0) updates.title = input.title;
765
+ if (input.description !== void 0) updates.description = input.description;
766
+ if (input.priority !== void 0) updates.priority = input.priority;
767
+ if (input.status !== void 0) updates.status = input.status;
768
+ if (input.tags !== void 0) updates.tags = input.tags;
769
+ if (input.epicId !== void 0) updates.epicId = input.epicId;
782
770
  db.update(tasks).set(updates).where(eq3(tasks.id, id)).run();
783
771
  return getTask(id);
784
772
  }
@@ -791,7 +779,7 @@ function deleteTask(id) {
791
779
  db.delete(tasks).where(eq3(tasks.id, id)).run();
792
780
  }
793
781
 
794
- // src/commands/task.ts
782
+ // packages/cli/src/commands/task.ts
795
783
  var taskCommand = new Command4("task").description("Manage tasks");
796
784
  taskCommand.command("create").description("Create a new task").requiredOption("-t, --title <title>", "Task title").option("-d, --description <description>", "Task description").option("-p, --priority <priority>", "Priority (0-5, default: 2)").option("-s, --status <status>", "Status (todo, in_progress, completed, wont_fix, archived)").option("--tags <tags>", "Comma-separated tags").option("-e, --epic <epic-id>", "Epic ID to assign task to").action((options) => {
797
785
  try {
@@ -822,6 +810,7 @@ taskCommand.command("list").description("List all tasks").option("-s, --status <
822
810
  status,
823
811
  epicId: options.epic,
824
812
  parentTaskId: null
813
+ // Only list top-level tasks by default
825
814
  });
826
815
  if (isJsonMode()) {
827
816
  output(tasks2);
@@ -853,20 +842,16 @@ taskCommand.command("show <task-id>").description("Show task details").action((t
853
842
  taskCommand.command("update <task-id>").description("Update a task").option("-t, --title <title>", "New title").option("-d, --description <description>", "New description").option("-p, --priority <priority>", "New priority (0-5)").option("-s, --status <status>", "New status").option("--tags <tags>", "New tags (comma-separated)").option("-e, --epic <epic-id>", "New epic ID").option("--no-epic", "Remove from epic").action((taskId, options) => {
854
843
  try {
855
844
  const updateInput = {};
856
- if (options.title !== undefined)
857
- updateInput.title = options.title;
858
- if (options.description !== undefined)
859
- updateInput.description = options.description;
860
- if (options.priority !== undefined)
861
- updateInput.priority = parsePriority(options.priority);
862
- if (options.status !== undefined) {
845
+ if (options.title !== void 0) updateInput.title = options.title;
846
+ if (options.description !== void 0) updateInput.description = options.description;
847
+ if (options.priority !== void 0) updateInput.priority = parsePriority(options.priority);
848
+ if (options.status !== void 0) {
863
849
  updateInput.status = parseStatus(options.status, "task");
864
850
  }
865
- if (options.tags !== undefined)
866
- updateInput.tags = options.tags;
851
+ if (options.tags !== void 0) updateInput.tags = options.tags;
867
852
  if (options.epic === false) {
868
853
  updateInput.epicId = null;
869
- } else if (options.epic !== undefined) {
854
+ } else if (options.epic !== void 0) {
870
855
  updateInput.epicId = options.epic;
871
856
  }
872
857
  const task = updateTask(taskId, updateInput);
@@ -891,9 +876,11 @@ taskCommand.command("delete <task-id>").description("Delete a task").action((tas
891
876
  }
892
877
  });
893
878
 
894
- // src/commands/subtask.ts
879
+ // packages/cli/src/commands/subtask.ts
895
880
  import { Command as Command5 } from "commander";
896
- var subtaskCommand = new Command5("subtask").description("Manage subtasks");
881
+ var subtaskCommand = new Command5("subtask").description(
882
+ "Manage subtasks"
883
+ );
897
884
  subtaskCommand.command("create <parent-task-id>").description("Create a new subtask").requiredOption("-t, --title <title>", "Subtask title").option("-d, --description <description>", "Subtask description").option("-p, --priority <priority>", "Priority (0-5, default: 2)").option("-s, --status <status>", "Status (todo, in_progress, completed, wont_fix, archived)").action((parentTaskId, options) => {
898
885
  try {
899
886
  validateRequired(options.title, "Title");
@@ -908,7 +895,8 @@ subtaskCommand.command("create <parent-task-id>").description("Create a new subt
908
895
  priority: parsePriority(options.priority),
909
896
  status: parseStatus(options.status, "task"),
910
897
  parentTaskId,
911
- epicId: parent.epicId ?? undefined
898
+ epicId: parent.epicId ?? void 0
899
+ // Inherit epic from parent
912
900
  });
913
901
  if (isJsonMode()) {
914
902
  output(subtask);
@@ -956,13 +944,10 @@ subtaskCommand.command("update <subtask-id>").description("Update a subtask").op
956
944
  process.exit(1);
957
945
  }
958
946
  const updateInput = {};
959
- if (options.title !== undefined)
960
- updateInput.title = options.title;
961
- if (options.description !== undefined)
962
- updateInput.description = options.description;
963
- if (options.priority !== undefined)
964
- updateInput.priority = parsePriority(options.priority);
965
- if (options.status !== undefined) {
947
+ if (options.title !== void 0) updateInput.title = options.title;
948
+ if (options.description !== void 0) updateInput.description = options.description;
949
+ if (options.priority !== void 0) updateInput.priority = parsePriority(options.priority);
950
+ if (options.status !== void 0) {
966
951
  updateInput.status = parseStatus(options.status, "task");
967
952
  }
968
953
  const updated = updateTask(subtaskId, updateInput);
@@ -996,10 +981,10 @@ subtaskCommand.command("delete <subtask-id>").description("Delete a subtask").ac
996
981
  }
997
982
  });
998
983
 
999
- // src/commands/comment.ts
984
+ // packages/cli/src/commands/comment.ts
1000
985
  import { Command as Command6 } from "commander";
1001
986
 
1002
- // src/services/comment.ts
987
+ // packages/cli/src/services/comment.ts
1003
988
  import { eq as eq4 } from "drizzle-orm";
1004
989
  function createComment(input) {
1005
990
  const db = getDb();
@@ -1008,7 +993,7 @@ function createComment(input) {
1008
993
  throw new Error(`Task not found: ${input.taskId}`);
1009
994
  }
1010
995
  const id = generateId("comment");
1011
- const now = new Date;
996
+ const now = /* @__PURE__ */ new Date();
1012
997
  const comment = {
1013
998
  id,
1014
999
  taskId: input.taskId,
@@ -1041,7 +1026,7 @@ function updateComment(id, input) {
1041
1026
  }
1042
1027
  db.update(comments).set({
1043
1028
  content: input.content,
1044
- updatedAt: new Date
1029
+ updatedAt: /* @__PURE__ */ new Date()
1045
1030
  }).where(eq4(comments.id, id)).run();
1046
1031
  return getComment(id);
1047
1032
  }
@@ -1054,8 +1039,10 @@ function deleteComment(id) {
1054
1039
  db.delete(comments).where(eq4(comments.id, id)).run();
1055
1040
  }
1056
1041
 
1057
- // src/commands/comment.ts
1058
- var commentCommand = new Command6("comment").description("Manage comments");
1042
+ // packages/cli/src/commands/comment.ts
1043
+ var commentCommand = new Command6("comment").description(
1044
+ "Manage comments"
1045
+ );
1059
1046
  commentCommand.command("add <task-id>").description("Add a comment to a task").requiredOption("-a, --author <author>", "Comment author").requiredOption("-c, --content <content>", "Comment content").action((taskId, options) => {
1060
1047
  try {
1061
1048
  validateRequired(options.author, "Author");
@@ -1121,10 +1108,10 @@ commentCommand.command("delete <comment-id>").description("Delete a comment").ac
1121
1108
  }
1122
1109
  });
1123
1110
 
1124
- // src/commands/dep.ts
1111
+ // packages/cli/src/commands/dep.ts
1125
1112
  import { Command as Command7 } from "commander";
1126
1113
 
1127
- // src/services/dependency.ts
1114
+ // packages/cli/src/services/dependency.ts
1128
1115
  import { eq as eq5 } from "drizzle-orm";
1129
1116
  function addDependency(taskId, dependsOnId) {
1130
1117
  const db = getDb();
@@ -1139,15 +1126,19 @@ function addDependency(taskId, dependsOnId) {
1139
1126
  if (taskId === dependsOnId) {
1140
1127
  throw new Error("A task cannot depend on itself.");
1141
1128
  }
1142
- const existing = db.select().from(dependencies).where(eq5(dependencies.taskId, taskId)).all().find((d) => d.dependsOnId === dependsOnId);
1129
+ const existing = db.select().from(dependencies).where(
1130
+ eq5(dependencies.taskId, taskId)
1131
+ ).all().find((d) => d.dependsOnId === dependsOnId);
1143
1132
  if (existing) {
1144
1133
  throw new Error(`Dependency already exists: ${taskId} \u2192 ${dependsOnId}`);
1145
1134
  }
1146
1135
  if (wouldCreateCycle(taskId, dependsOnId)) {
1147
- throw new Error(`Adding this dependency would create a cycle. ${dependsOnId} already depends on ${taskId} (directly or transitively).`);
1136
+ throw new Error(
1137
+ `Adding this dependency would create a cycle. ${dependsOnId} already depends on ${taskId} (directly or transitively).`
1138
+ );
1148
1139
  }
1149
1140
  const id = generateUuid();
1150
- const now = new Date;
1141
+ const now = /* @__PURE__ */ new Date();
1151
1142
  const dependency = {
1152
1143
  id,
1153
1144
  taskId,
@@ -1179,7 +1170,7 @@ function getDependencies(taskId) {
1179
1170
  }
1180
1171
  function wouldCreateCycle(taskId, dependsOnId) {
1181
1172
  const db = getDb();
1182
- const visited = new Set;
1173
+ const visited = /* @__PURE__ */ new Set();
1183
1174
  const stack = [dependsOnId];
1184
1175
  while (stack.length > 0) {
1185
1176
  const current = stack.pop();
@@ -1200,8 +1191,10 @@ function wouldCreateCycle(taskId, dependsOnId) {
1200
1191
  return false;
1201
1192
  }
1202
1193
 
1203
- // src/commands/dep.ts
1204
- var depCommand = new Command7("dep").description("Manage task dependencies");
1194
+ // packages/cli/src/commands/dep.ts
1195
+ var depCommand = new Command7("dep").description(
1196
+ "Manage task dependencies"
1197
+ );
1205
1198
  depCommand.command("add <task-id> <depends-on-id>").description("Add a dependency (task-id depends on depends-on-id)").action((taskId, dependsOnId) => {
1206
1199
  try {
1207
1200
  const dependency = addDependency(taskId, dependsOnId);
@@ -1231,11 +1224,9 @@ depCommand.command("list <task-id>").description("List dependencies for a task")
1231
1224
  output({ taskId, dependsOn, blocks });
1232
1225
  } else {
1233
1226
  console.log(`Dependencies for ${taskId}:`);
1234
- console.log(`
1235
- Depends on:`);
1227
+ console.log("\nDepends on:");
1236
1228
  console.log(formatDependencyList(dependsOn, "depends_on"));
1237
- console.log(`
1238
- Blocks:`);
1229
+ console.log("\nBlocks:");
1239
1230
  console.log(formatDependencyList(blocks, "blocks"));
1240
1231
  }
1241
1232
  } catch (err) {
@@ -1244,7 +1235,7 @@ Blocks:`);
1244
1235
  }
1245
1236
  });
1246
1237
 
1247
- // src/commands/quickstart.ts
1238
+ // packages/cli/src/commands/quickstart.ts
1248
1239
  import { Command as Command8 } from "commander";
1249
1240
  var QUICKSTART_TEXT = `# Trekker - AI Agent Quickstart Guide
1250
1241
 
@@ -1855,7 +1846,7 @@ var quickstartCommand = new Command8("quickstart").description("Show comprehensi
1855
1846
  console.log(QUICKSTART_TEXT);
1856
1847
  });
1857
1848
 
1858
- // src/commands/serve.ts
1849
+ // packages/cli/src/commands/serve.ts
1859
1850
  import { Command as Command9 } from "commander";
1860
1851
  import { spawn, spawnSync } from "child_process";
1861
1852
  import { resolve, dirname } from "path";
@@ -1896,8 +1887,7 @@ var serveCommand = new Command9("serve").description("Start the Trekker web inte
1896
1887
  };
1897
1888
  if (isBundled) {
1898
1889
  success(`Starting Trekker web interface on http://localhost:${port}`);
1899
- console.log(`Press Ctrl+C to stop
1900
- `);
1890
+ console.log("Press Ctrl+C to stop\n");
1901
1891
  const vendorPath = resolve(webappDir, "vendor");
1902
1892
  const bundledEnv = {
1903
1893
  ...env,
@@ -1925,8 +1915,7 @@ var serveCommand = new Command9("serve").description("Start the Trekker web inte
1925
1915
  }
1926
1916
  if (options.dev) {
1927
1917
  success(`Starting Trekker web interface (dev) on http://localhost:${port}`);
1928
- console.log(`Press Ctrl+C to stop
1929
- `);
1918
+ console.log("Press Ctrl+C to stop\n");
1930
1919
  const dev = spawn("bun", ["run", "dev", "--", "-p", port], {
1931
1920
  cwd: webappDir,
1932
1921
  stdio: "inherit",
@@ -1964,8 +1953,7 @@ var serveCommand = new Command9("serve").description("Start the Trekker web inte
1964
1953
  });
1965
1954
  }
1966
1955
  success(`Starting Trekker web interface on http://localhost:${port}`);
1967
- console.log(`Press Ctrl+C to stop
1968
- `);
1956
+ console.log("Press Ctrl+C to stop\n");
1969
1957
  const server = spawn("bun", ["run", "server.js"], {
1970
1958
  cwd: standalonePath,
1971
1959
  stdio: "inherit",
@@ -1992,7 +1980,7 @@ function setupSignalHandlers(child) {
1992
1980
  });
1993
1981
  }
1994
1982
 
1995
- // src/commands/seed.ts
1983
+ // packages/cli/src/commands/seed.ts
1996
1984
  import { Command as Command10 } from "commander";
1997
1985
  var SAMPLE_EPICS = [
1998
1986
  {
@@ -2021,6 +2009,7 @@ var SAMPLE_EPICS = [
2021
2009
  }
2022
2010
  ];
2023
2011
  var SAMPLE_TASKS = [
2012
+ // Auth tasks
2024
2013
  {
2025
2014
  epicIndex: 0,
2026
2015
  title: "Set up OAuth 2.0 provider",
@@ -2053,6 +2042,7 @@ var SAMPLE_TASKS = [
2053
2042
  status: "todo",
2054
2043
  tags: "backend,frontend"
2055
2044
  },
2045
+ // Dashboard tasks
2056
2046
  {
2057
2047
  epicIndex: 1,
2058
2048
  title: "Design dashboard layout",
@@ -2077,6 +2067,7 @@ var SAMPLE_TASKS = [
2077
2067
  status: "todo",
2078
2068
  tags: "frontend,backend"
2079
2069
  },
2070
+ // API tasks
2080
2071
  {
2081
2072
  epicIndex: 2,
2082
2073
  title: "Define API schema",
@@ -2109,6 +2100,7 @@ var SAMPLE_TASKS = [
2109
2100
  status: "todo",
2110
2101
  tags: "backend"
2111
2102
  },
2103
+ // Testing tasks
2112
2104
  {
2113
2105
  epicIndex: 3,
2114
2106
  title: "Set up Jest testing framework",
@@ -2133,6 +2125,7 @@ var SAMPLE_TASKS = [
2133
2125
  status: "todo",
2134
2126
  tags: "testing,devops"
2135
2127
  },
2128
+ // Tasks without epic
2136
2129
  {
2137
2130
  epicIndex: null,
2138
2131
  title: "Update README documentation",
@@ -2153,6 +2146,7 @@ var SAMPLE_TASKS = [
2153
2146
  var SAMPLE_SUBTASKS = [
2154
2147
  {
2155
2148
  parentIndex: 1,
2149
+ // JWT token handling
2156
2150
  title: "Implement access token generation",
2157
2151
  status: "completed",
2158
2152
  priority: 1
@@ -2171,6 +2165,7 @@ var SAMPLE_SUBTASKS = [
2171
2165
  },
2172
2166
  {
2173
2167
  parentIndex: 5,
2168
+ // Chart components
2174
2169
  title: "Create bar chart component",
2175
2170
  status: "completed",
2176
2171
  priority: 2
@@ -2190,12 +2185,19 @@ var SAMPLE_SUBTASKS = [
2190
2185
  ];
2191
2186
  var SAMPLE_DEPENDENCIES = [
2192
2187
  [2, 1],
2188
+ // Login page depends on JWT handling
2193
2189
  [3, 1],
2190
+ // Password reset depends on JWT handling
2194
2191
  [6, 5],
2192
+ // Real-time updates depends on chart components
2195
2193
  [6, 4],
2194
+ // Real-time updates depends on dashboard layout
2196
2195
  [9, 8],
2196
+ // Rate limiting depends on user endpoints
2197
2197
  [12, 11],
2198
+ // Unit tests for auth depends on Jest setup
2198
2199
  [13, 11]
2200
+ // E2E testing depends on Jest setup
2199
2201
  ];
2200
2202
  var seedCommand = new Command10("seed").description("Seed the database with sample data (development only)").option("--force", "Skip confirmation prompt").action((options) => {
2201
2203
  try {
@@ -2205,8 +2207,7 @@ var seedCommand = new Command10("seed").description("Seed the database with samp
2205
2207
  }
2206
2208
  if (!options.force) {
2207
2209
  info("This will create sample epics, tasks, and dependencies.");
2208
- info(`Use --force to skip this confirmation.
2209
- `);
2210
+ info("Use --force to skip this confirmation.\n");
2210
2211
  }
2211
2212
  const epicIds = [];
2212
2213
  const taskIds = [];
@@ -2221,8 +2222,7 @@ var seedCommand = new Command10("seed").description("Seed the database with samp
2221
2222
  epicIds.push(epic.id);
2222
2223
  info(` Created ${epic.id}: ${epic.title}`);
2223
2224
  }
2224
- info(`
2225
- Creating tasks...`);
2225
+ info("\nCreating tasks...");
2226
2226
  for (const taskData of SAMPLE_TASKS) {
2227
2227
  const task = createTask({
2228
2228
  title: taskData.title,
@@ -2230,13 +2230,12 @@ Creating tasks...`);
2230
2230
  priority: taskData.priority,
2231
2231
  status: taskData.status,
2232
2232
  tags: taskData.tags,
2233
- epicId: taskData.epicIndex !== null ? epicIds[taskData.epicIndex] : undefined
2233
+ epicId: taskData.epicIndex !== null ? epicIds[taskData.epicIndex] : void 0
2234
2234
  });
2235
2235
  taskIds.push(task.id);
2236
2236
  info(` Created ${task.id}: ${task.title}`);
2237
2237
  }
2238
- info(`
2239
- Creating subtasks...`);
2238
+ info("\nCreating subtasks...");
2240
2239
  for (const subtaskData of SAMPLE_SUBTASKS) {
2241
2240
  const subtask = createTask({
2242
2241
  title: subtaskData.title,
@@ -2246,8 +2245,7 @@ Creating subtasks...`);
2246
2245
  });
2247
2246
  info(` Created ${subtask.id}: ${subtask.title} (subtask of ${taskIds[subtaskData.parentIndex]})`);
2248
2247
  }
2249
- info(`
2250
- Creating dependencies...`);
2248
+ info("\nCreating dependencies...");
2251
2249
  for (const [taskIndex, dependsOnIndex] of SAMPLE_DEPENDENCIES) {
2252
2250
  const taskId = taskIds[taskIndex];
2253
2251
  const dependsOnId = taskIds[dependsOnIndex];
@@ -2262,9 +2260,68 @@ Seed complete! Created ${epicIds.length} epics, ${taskIds.length} tasks, ${SAMPL
2262
2260
  }
2263
2261
  });
2264
2262
 
2265
- // src/index.ts
2266
- var program = new Command11;
2267
- program.name("trekker").description("CLI-based issue tracker for coding agents").version("0.1.0").option("--json", "Output in JSON format").hook("preAction", (thisCommand) => {
2263
+ // packages/cli/package.json
2264
+ var package_default = {
2265
+ name: "@obsfx/trekker",
2266
+ version: "0.1.8",
2267
+ description: "A CLI-based issue tracker built for AI coding agents. Stores tasks, epics, and dependencies in a local SQLite database with a built-in kanban board UI.",
2268
+ type: "module",
2269
+ main: "dist/index.js",
2270
+ bin: {
2271
+ trekker: "./bin/trekker.js"
2272
+ },
2273
+ files: [
2274
+ "dist",
2275
+ "bin",
2276
+ "webapp-dist"
2277
+ ],
2278
+ scripts: {
2279
+ build: "bun build src/index.ts --outdir dist --target bun --external commander --external drizzle-orm",
2280
+ dev: "bun run src/index.ts",
2281
+ "db:generate": "drizzle-kit generate",
2282
+ "db:migrate": "drizzle-kit migrate"
2283
+ },
2284
+ keywords: [
2285
+ "cli",
2286
+ "issue-tracker",
2287
+ "task-management",
2288
+ "kanban",
2289
+ "sqlite",
2290
+ "ai-agents",
2291
+ "coding-agents",
2292
+ "project-management",
2293
+ "todo",
2294
+ "epic",
2295
+ "bun"
2296
+ ],
2297
+ author: "Omercan Balandi <balandiomer@gmail.com>",
2298
+ license: "MIT",
2299
+ homepage: "https://github.com/obsfx/trekker",
2300
+ repository: {
2301
+ type: "git",
2302
+ url: "https://github.com/obsfx/trekker.git"
2303
+ },
2304
+ bugs: {
2305
+ url: "https://github.com/obsfx/trekker/issues"
2306
+ },
2307
+ engines: {
2308
+ node: ">=18",
2309
+ bun: ">=1.0.0"
2310
+ },
2311
+ dependencies: {
2312
+ commander: "^13.1.0",
2313
+ "drizzle-orm": "^0.38.4"
2314
+ },
2315
+ devDependencies: {
2316
+ "@types/bun": "^1.2.2",
2317
+ "drizzle-kit": "^0.30.4",
2318
+ typescript: "^5.7.3"
2319
+ }
2320
+ };
2321
+
2322
+ // packages/cli/src/index.ts
2323
+ var program = new Command11();
2324
+ program.name("trekker").description("CLI-based issue tracker for coding agents").version(package_default.version).option("--json", "Output in JSON format").hook("preAction", (thisCommand) => {
2268
2325
  const opts = thisCommand.opts();
2269
2326
  if (opts.json) {
2270
2327
  setJsonMode(true);