ofiere-openclaw-plugin 4.18.4 → 4.18.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/package.json +1 -1
  2. package/src/tools.ts +14 -9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ofiere-openclaw-plugin",
3
- "version": "4.18.4",
3
+ "version": "4.18.5",
4
4
  "type": "module",
5
5
  "description": "OpenClaw plugin for Ofiere PM - 12 meta-tools covering tasks, agents, projects, scheduling, knowledge, workflows, notifications, memory, prompts, constellation, space file management, and execution plan builder",
6
6
  "keywords": ["openclaw", "ofiere", "project-management", "agents", "plugin"],
package/src/tools.ts CHANGED
@@ -4442,21 +4442,29 @@ async function handleExecutePlan(
4442
4442
  return idMap.get(n.id);
4443
4443
  }
4444
4444
 
4445
+ // Helper: insert a dependency row into pm_dependencies
4446
+ async function insertDep(predId: string, succId: string): Promise<boolean> {
4447
+ const { error } = await supabase.from("pm_dependencies").insert({
4448
+ id: `dep-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
4449
+ user_id: userId, predecessor_id: predId, successor_id: succId,
4450
+ dependency_type: "finish_to_start", lag_days: 0,
4451
+ });
4452
+ return !error;
4453
+ }
4454
+
4445
4455
  while (depsQueue.length > 0) {
4446
4456
  const node = depsQueue.shift()!;
4447
4457
  const nodeRealId = resolveTaskId(node);
4448
4458
 
4449
4459
  // Chain siblings: sequential children of this node get chained left-to-right
4450
4460
  if (Array.isArray(node.children) && node.children.length > 1 && !node.parallel) {
4451
- // Collect task-type children in order for chaining
4452
4461
  const taskChildren: string[] = [];
4453
4462
  for (const child of node.children) {
4454
4463
  const cid = resolveTaskId(child);
4455
4464
  if (cid) taskChildren.push(cid);
4456
4465
  }
4457
4466
  for (let i = 1; i < taskChildren.length; i++) {
4458
- await supabase.from("task_dependencies").insert({ user_id: userId, predecessor_id: taskChildren[i - 1], successor_id: taskChildren[i], dependency_type: "finish_to_start", lag_days: 0 });
4459
- depsCreated++;
4467
+ if (await insertDep(taskChildren[i - 1], taskChildren[i])) depsCreated++;
4460
4468
  }
4461
4469
  }
4462
4470
 
@@ -4464,8 +4472,7 @@ async function handleExecutePlan(
4464
4472
  if (nodeRealId && !node.parallel && node.children?.length > 0) {
4465
4473
  const firstChildId = resolveTaskId(node.children[0]);
4466
4474
  if (firstChildId) {
4467
- await supabase.from("task_dependencies").insert({ user_id: userId, predecessor_id: nodeRealId, successor_id: firstChildId, dependency_type: "finish_to_start", lag_days: 0 });
4468
- depsCreated++;
4475
+ if (await insertDep(nodeRealId, firstChildId)) depsCreated++;
4469
4476
  }
4470
4477
  }
4471
4478
 
@@ -4474,8 +4481,7 @@ async function handleExecutePlan(
4474
4481
  for (const child of node.children) {
4475
4482
  const childId = resolveTaskId(child);
4476
4483
  if (childId) {
4477
- await supabase.from("task_dependencies").insert({ user_id: userId, predecessor_id: nodeRealId, successor_id: childId, dependency_type: "finish_to_start", lag_days: 0 });
4478
- depsCreated++;
4484
+ if (await insertDep(nodeRealId, childId)) depsCreated++;
4479
4485
  }
4480
4486
  }
4481
4487
  }
@@ -4490,8 +4496,7 @@ async function handleExecutePlan(
4490
4496
  if (rid) rootTaskIds.push(rid);
4491
4497
  }
4492
4498
  for (let i = 1; i < rootTaskIds.length; i++) {
4493
- await supabase.from("task_dependencies").insert({ user_id: userId, predecessor_id: rootTaskIds[i - 1], successor_id: rootTaskIds[i], dependency_type: "finish_to_start", lag_days: 0 });
4494
- depsCreated++;
4499
+ if (await insertDep(rootTaskIds[i - 1], rootTaskIds[i])) depsCreated++;
4495
4500
  }
4496
4501
 
4497
4502
  // Mark plan as deployed