@wrongstack/core 0.6.5 → 0.6.6

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,4 +1,4 @@
1
- import { h as Specification, S as SpecAnalysis, g as SpecValidationResult, l as TaskGraph, m as TaskNode, k as TaskFilter, p as TaskSort, o as TaskProgress, r as TaskType, n as TaskPriority, e as SpecStatus, f as SpecTemplate, b as SpecRequirement } from '../task-graph-BITvWt4t.js';
1
+ import { h as Specification, S as SpecAnalysis, g as SpecValidationResult, l as TaskGraph, m as TaskNode, k as TaskFilter, p as TaskSort, o as TaskProgress, r as TaskType, n as TaskPriority, e as SpecStatus, f as SpecTemplate, b as SpecRequirement } from '../task-graph-D1YQbpxF.js';
2
2
  import { E as EventBus } from '../events-CJqwQl8G.js';
3
3
  import { D as DoneCondition } from '../multi-agent-D5IbASk_.js';
4
4
  import '../context-DN5v-uQX.js';
@@ -52,6 +52,11 @@ declare class TaskTracker {
52
52
  addNode(node: Omit<TaskNode, 'id' | 'createdAt' | 'updatedAt'>): TaskNode;
53
53
  addEdge(from: string, to: string, type?: TaskGraph['edges'][0]['type']): void;
54
54
  updateNodeStatus(id: string, status: TaskNode['status'], reason?: string): void;
55
+ /**
56
+ * Update node fields (title, description, priority, estimateHours, tags).
57
+ * Does NOT change status. Use updateNodeStatus for status changes.
58
+ */
59
+ updateNode(id: string, patch: Partial<Pick<TaskNode, 'title' | 'description' | 'priority' | 'estimateHours' | 'tags'>>): void;
55
60
  getNode(id: string): TaskNode | undefined;
56
61
  getAllNodes(filter?: TaskFilter, sort?: TaskSort): TaskNode[];
57
62
  getChildren(parentId: string): TaskNode[];
package/dist/sdd/index.js CHANGED
@@ -637,6 +637,10 @@ var TaskTracker = class {
637
637
  node.updatedAt = now;
638
638
  if (status === "completed") {
639
639
  node.completedAt = now;
640
+ node.startedAt = node.startedAt ?? now;
641
+ }
642
+ if (status === "in_progress") {
643
+ node.startedAt = now;
640
644
  }
641
645
  this.transitions.push({ from, to: status, timestamp: now, reason });
642
646
  if (status === "completed") {
@@ -648,6 +652,23 @@ var TaskTracker = class {
648
652
  this.graph.updatedAt = now;
649
653
  this.persist();
650
654
  }
655
+ /**
656
+ * Update node fields (title, description, priority, estimateHours, tags).
657
+ * Does NOT change status. Use updateNodeStatus for status changes.
658
+ */
659
+ updateNode(id, patch) {
660
+ if (!this.graph) throw new Error("No graph loaded");
661
+ const node = this.graph.nodes.get(id);
662
+ if (!node) throw new Error(`Node ${id} not found`);
663
+ if (patch.title !== void 0) node.title = patch.title;
664
+ if (patch.description !== void 0) node.description = patch.description;
665
+ if (patch.priority !== void 0) node.priority = patch.priority;
666
+ if (patch.estimateHours !== void 0) node.estimateHours = patch.estimateHours;
667
+ if (patch.tags !== void 0) node.tags = patch.tags;
668
+ node.updatedAt = Date.now();
669
+ this.graph.updatedAt = node.updatedAt;
670
+ this.persist();
671
+ }
651
672
  getNode(id) {
652
673
  return this.graph?.nodes.get(id);
653
674
  }