@wrongstack/core 0.8.2 → 0.8.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.
@@ -2,7 +2,7 @@ import { E as EventBus } from './events-DyhxkstG.js';
2
2
  import { y as SessionStore, x as SessionMetadata, B as SessionWriter, r as ResumedSession, S as SessionData, z as SessionSummary, c as ContentBlock, w as SessionEvent, N as TodoItem, f as ConversationState } from './context-z2x5gv_V.js';
3
3
  import { e as AttachmentStore, A as AddAttachmentInput, d as AttachmentRef, a as Attachment } from './session-reader-DsadjyF9.js';
4
4
  import { b as MemoryStore, a as MemoryScope } from './memory-CEXuo7sz.js';
5
- import { a as WstackPaths } from './wstack-paths-gCrJ631C.js';
5
+ import { a as WstackPaths } from './wstack-paths-Bxik3CsK.js';
6
6
  import { c as ConfigStore, a as Config, b as ConfigLoader } from './config-Bi4Q0fnz.js';
7
7
  import { S as SecretVault } from './secret-vault-DoISxaKO.js';
8
8
 
@@ -55,15 +55,16 @@ declare class TaskTracker {
55
55
  private graph;
56
56
  private transitions;
57
57
  constructor(opts: TaskTrackerOptions);
58
+ /**
59
+ * Attach an existing graph (used by PhaseOrchestrator to associate a tracker
60
+ * with a phase's pre-built task graph without re-creating it).
61
+ */
62
+ setGraph(graph: TaskGraph): void;
58
63
  createGraph(specId: string, title: string): Promise<TaskGraph>;
59
64
  loadGraph(id: string): Promise<TaskGraph | null>;
60
65
  addNode(node: Omit<TaskNode, 'id' | 'createdAt' | 'updatedAt'>): TaskNode;
61
66
  addEdge(from: string, to: string, type?: TaskGraph['edges'][0]['type']): void;
62
67
  updateNodeStatus(id: string, status: TaskNode['status'], reason?: string): void;
63
- /**
64
- * Update node fields (title, description, priority, estimateHours, tags).
65
- * Does NOT change status. Use updateNodeStatus for status changes.
66
- */
67
68
  updateNode(id: string, patch: Partial<Pick<TaskNode, 'title' | 'description' | 'priority' | 'estimateHours' | 'tags'>>): void;
68
69
  getNode(id: string): TaskNode | undefined;
69
70
  getAllNodes(filter?: TaskFilter, sort?: TaskSort): TaskNode[];
@@ -72,15 +73,14 @@ declare class TaskTracker {
72
73
  getBlockers(taskId: string): string[];
73
74
  canStart(taskId: string): boolean;
74
75
  getProgress(): TaskProgress;
75
- getTransitions(taskId?: string): TaskTransition[];
76
+ getTransitions(_taskId?: string): TaskTransition[];
76
77
  private unblockDependents;
77
78
  private checkAndBlockIfNeeded;
78
79
  /**
79
80
  * Fire-and-forget persistence with attached error handler.
80
81
  * Synchronous mutators (addNode/addEdge/updateNodeStatus) use this to
81
82
  * avoid forcing an async cascade through every caller; if the store
82
- * rejects, the configured `onPersistError` is invoked so failures are
83
- * surfaced instead of swallowed by an unhandled promise rejection.
83
+ * is missing or throwing, the error is surfaced via onPersistError.
84
84
  */
85
85
  private persist;
86
86
  }
package/dist/sdd/index.js CHANGED
@@ -581,6 +581,13 @@ var TaskTracker = class {
581
581
  opts;
582
582
  graph = null;
583
583
  transitions = [];
584
+ /**
585
+ * Attach an existing graph (used by PhaseOrchestrator to associate a tracker
586
+ * with a phase's pre-built task graph without re-creating it).
587
+ */
588
+ setGraph(graph) {
589
+ this.graph = graph;
590
+ }
584
591
  async createGraph(specId, title) {
585
592
  this.graph = {
586
593
  id: crypto.randomUUID(),
@@ -653,10 +660,6 @@ var TaskTracker = class {
653
660
  this.graph.updatedAt = now;
654
661
  this.persist();
655
662
  }
656
- /**
657
- * Update node fields (title, description, priority, estimateHours, tags).
658
- * Does NOT change status. Use updateNodeStatus for status changes.
659
- */
660
663
  updateNode(id, patch) {
661
664
  if (!this.graph) throw new Error("No graph loaded");
662
665
  const node = this.graph.nodes.get(id);
@@ -734,8 +737,7 @@ var TaskTracker = class {
734
737
  }
735
738
  return computeTaskProgress(this.graph);
736
739
  }
737
- getTransitions(taskId) {
738
- if (!taskId) return [...this.transitions];
740
+ getTransitions(_taskId) {
739
741
  return [...this.transitions];
740
742
  }
741
743
  unblockDependents(completedId) {
@@ -775,18 +777,12 @@ var TaskTracker = class {
775
777
  * Fire-and-forget persistence with attached error handler.
776
778
  * Synchronous mutators (addNode/addEdge/updateNodeStatus) use this to
777
779
  * avoid forcing an async cascade through every caller; if the store
778
- * rejects, the configured `onPersistError` is invoked so failures are
779
- * surfaced instead of swallowed by an unhandled promise rejection.
780
+ * is missing or throwing, the error is surfaced via onPersistError.
780
781
  */
781
782
  persist() {
782
783
  if (!this.graph) return;
783
784
  this.opts.store.saveGraph(this.graph).catch((err) => {
784
- if (this.opts.onPersistError) this.opts.onPersistError(err);
785
- else
786
- console.warn(
787
- "[task-tracker] saveGraph failed:",
788
- err instanceof Error ? err.message : String(err)
789
- );
785
+ this.opts.onPersistError ? this.opts.onPersistError(err) : console.warn("[task-tracker] saveGraph failed:", err instanceof Error ? err.message : String(err));
790
786
  });
791
787
  }
792
788
  };