ofiere-openclaw-plugin 4.18.2 → 4.18.3

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 +19 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ofiere-openclaw-plugin",
3
- "version": "4.18.2",
3
+ "version": "4.18.3",
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
@@ -4269,6 +4269,18 @@ async function handleUpdatePlan(supabase: SupabaseClient, userId: string, params
4269
4269
  if (params.nodes !== undefined) {
4270
4270
  const rootNodes = Array.isArray(params.nodes) ? (params.nodes as any[]).map(normalizeNode) : [];
4271
4271
  updates.plan_data = buildPlanJson(params.plan_id as string, (params.name as string) || "Plan", params.description as string | undefined, rootNodes);
4272
+ } else if (params.name !== undefined || params.description !== undefined) {
4273
+ // Sync plan_data inner name/description without replacing nodes
4274
+ const { data: existing } = await supabase.from("pm_plans").select("plan_data").eq("id", params.plan_id as string).eq("user_id", userId);
4275
+ if (existing && existing.length > 0) {
4276
+ try {
4277
+ const pd = JSON.parse(existing[0].plan_data || "{}");
4278
+ if (params.name !== undefined) pd.name = params.name;
4279
+ if (params.description !== undefined) pd.description = params.description;
4280
+ pd.updatedAt = new Date().toISOString();
4281
+ updates.plan_data = JSON.stringify(pd, null, 2);
4282
+ } catch { /* plan_data parse failure — skip inner sync */ }
4283
+ }
4272
4284
  }
4273
4285
  const { data, error } = await supabase.from("pm_plans").update(updates).eq("id", params.plan_id as string).eq("user_id", userId).select("id");
4274
4286
  if (error) return err(error.message);
@@ -4334,15 +4346,18 @@ async function handleExecutePlan(
4334
4346
  let folderId = (params.folder_id as string) || null;
4335
4347
 
4336
4348
  // Step 1: Create project folder
4349
+ let folderSkipped = false;
4337
4350
  if (createFolder && spaceId) {
4338
4351
  const folderRow = {
4339
4352
  id: crypto.randomUUID(),
4340
- user_id: userId, space_id: spaceId, name: plan.name || "Untitled Plan",
4353
+ user_id: userId, space_id: spaceId, name: data.name || plan.name || "Untitled Plan",
4341
4354
  type: "project", parent_folder_id: folderId, sort_order: 0,
4342
4355
  created_at: new Date().toISOString(), updated_at: new Date().toISOString(),
4343
4356
  };
4344
4357
  const { error: folderErr } = await supabase.from("pm_folders").insert(folderRow);
4345
4358
  if (!folderErr) folderId = folderRow.id;
4359
+ } else if (createFolder && !spaceId) {
4360
+ folderSkipped = true;
4346
4361
  }
4347
4362
 
4348
4363
  // Step 2: BFS — create tasks with full field mapping
@@ -4352,7 +4367,7 @@ async function handleExecutePlan(
4352
4367
 
4353
4368
  while (queue.length > 0) {
4354
4369
  const { node, parentTaskId } = queue.shift()!;
4355
- if (node.type === "task" || node.type === "milestone") {
4370
+ if (node.type === "task") {
4356
4371
  const taskId = `task-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
4357
4372
  const now = new Date().toISOString();
4358
4373
  const agentId = node.agentId ? await resolveAgent(node.agentId) : null;
@@ -4450,11 +4465,12 @@ async function handleExecutePlan(
4450
4465
  await supabase.from("pm_plans").update({ is_deployed: true, deployed_at: new Date().toISOString(), updated_at: new Date().toISOString() }).eq("id", params.plan_id as string).eq("user_id", userId);
4451
4466
 
4452
4467
  return ok({
4453
- message: `Plan "${plan.name}" executed successfully`,
4468
+ message: `Plan "${data.name || plan.name}" executed successfully`,
4454
4469
  tasks_created: tasksCreated,
4455
4470
  dependencies_created: depsCreated,
4456
4471
  folder_id: folderId,
4457
4472
  space_id: spaceId,
4473
+ ...(folderSkipped ? { folder_skipped_reason: "No space_id provided — assign the plan to a space to enable folder creation" } : {}),
4458
4474
  });
4459
4475
  } catch (e) { return err(e instanceof Error ? e.message : String(e)); }
4460
4476
  }