ofiere-openclaw-plugin 4.36.0 → 4.37.1

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ofiere-openclaw-plugin",
3
- "version": "4.36.0",
3
+ "version": "4.37.1",
4
4
  "type": "module",
5
5
  "description": "OpenClaw plugin for Ofiere PM - 16 meta-tools covering tasks, agents, projects, scheduling, knowledge, workflows, notifications, memory, prompts, constellation, space file management, execution plan builder, SOP management, agent brain, talent management, and corporate frameworks",
6
6
  "keywords": ["openclaw", "ofiere", "project-management", "agents", "plugin"],
package/src/prompt.ts CHANGED
@@ -107,7 +107,8 @@ Actions: "list", "get", "create", "update", "delete", "add_nodes", "execute"
107
107
 
108
108
  OFIERE_SOP_OPS: `Standard Operating Procedures for department chiefs.
109
109
  Actions: "list_templates", "create", "list", "get", "update", "delete", "list_subagents", "apply_template"
110
- - sop_data: { title, objective, scope, prerequisites[], steps[], deliverables[], escalationRules[], successCriteria[], notes }
110
+ - sop_data: { title, purpose, scope, applicability, prerequisites:{ conditions, required_tools, required_permissions, safety_warnings }, procedure_steps[], expected_outputs[], escalation_rules[], acceptance_criteria[], rollback_procedure, notes }
111
+ - Legacy field names still accepted (objective→purpose, steps→procedure_steps, deliverables→expected_outputs, escalationRules→escalation_rules, successCriteria→acceptance_criteria) — prefer new names.
111
112
  - See SOP PROTOCOL section for when to load vs skip`,
112
113
 
113
114
  OFIERE_BRAIN_OPS: `Agent memory, knowledge graph, self-improvement (TMT/MAGMA).
package/src/tools.ts CHANGED
@@ -4879,7 +4879,27 @@ function registerSOPOps(
4879
4879
  purpose: { type: "string", description: "Why this procedure exists (also accepts 'objective')" },
4880
4880
  scope: { type: "string" },
4881
4881
  applicability: { type: "string" },
4882
- prerequisites: { type: "object", description: "{ conditions: [{text,checked}], required_tools: [string], required_permissions: [string], safety_warnings: [string] }" },
4882
+ prerequisites: {
4883
+ type: "object",
4884
+ description: "Preconditions for executing this SOP. All sub-fields optional.",
4885
+ properties: {
4886
+ conditions: {
4887
+ type: "array",
4888
+ description: "Checklist items that must be true before starting.",
4889
+ items: {
4890
+ type: "object",
4891
+ properties: {
4892
+ text: { type: "string" },
4893
+ checked: { type: "boolean" },
4894
+ },
4895
+ required: ["text"],
4896
+ },
4897
+ },
4898
+ required_tools: { type: "array", items: { type: "string" } },
4899
+ required_permissions: { type: "array", items: { type: "string" } },
4900
+ safety_warnings: { type: "array", items: { type: "string" } },
4901
+ },
4902
+ },
4883
4903
  procedure_steps: { type: "array", description: "Also accepts 'steps'", items: { type: "object", properties: { id: { type: "string" }, name: { type: "string" }, action: { type: "string" }, owner: { type: "string" }, output: { type: "string" }, decision_logic: { type: "string" }, failure_state: { type: "string" }, fallback_action: { type: "string" }, estimated_duration: { type: "string" } }, required: ["name", "action"] } },
4884
4904
  expected_outputs: { type: "array", description: "Also accepts 'deliverables'", items: { type: "string" } },
4885
4905
  escalation_rules: { type: "array", description: "Also accepts 'escalationRules'", items: { type: "object", properties: { trigger: { type: "string" }, escalateTo: { type: "string" }, priority: { type: "string", enum: ["P1", "P2", "P3"] } }, required: ["trigger", "escalateTo"] } },
@@ -5213,30 +5233,20 @@ function registerFrameworkOps(
5213
5233
  description:
5214
5234
  `Create and manage Corporate Frameworks — strategic mandates, KPIs, risk governance, and operational boundaries.\n\n` +
5215
5235
  `Actions:\n` +
5216
- `- "create": Create a new framework. Required: agent_id, title, framework_data. Optional: department, category, status\n` +
5236
+ `- "create": Create a new framework. Required: agent_id, title. Provide framework body via 'content' (JSON string). Optional: department, category, status\n` +
5217
5237
  `- "list": List frameworks. Optional: agent_id to filter\n` +
5218
5238
  `- "get": Get full framework details. Required: framework_id\n` +
5219
- `- "update": Modify framework. Required: framework_id. Optional: title, framework_data, status, department, category\n` +
5239
+ `- "update": Modify framework. Required: framework_id. Optional: title, content, status, department, category\n` +
5220
5240
  `- "delete": Remove framework. Required: framework_id\n\n` +
5221
- `framework_data structure (JSON object):\n` +
5222
- `{\n` +
5223
- ` title: string,\n` +
5224
- ` mission: string (strategic mission),\n` +
5225
- ` vision: string,\n` +
5226
- ` core_principles: [string],\n` +
5227
- ` decision_authority: string,\n` +
5228
- ` budget_constraints: string,\n` +
5229
- ` resource_limits: string,\n` +
5230
- ` tool_stack: [string],\n` +
5231
- ` strategic_objectives: [{ objective, target, measurement, frequency }],\n` +
5232
- ` risk_appetite: "conservative"|"moderate"|"aggressive",\n` +
5233
- ` compliance_requirements: [string],\n` +
5234
- ` escalation_matrix: [{ trigger, escalate_to, priority: "P0"|"P1"|"P2"|"P3", response_sla }],\n` +
5235
- ` team_composition: string,\n` +
5236
- ` integration_points: [string],\n` +
5237
- ` review_frequency: string,\n` +
5238
- ` notes: string\n` +
5239
- `}\n\n` +
5241
+ `content: A JSON string containing the full framework body. Example:\n` +
5242
+ `"{\\"mission\\":\\"Drive brand growth\\",\\"vision\\":\\"Market leader by 2027\\",\\"core_principles\\":[\\"Data-driven\\",\\"Customer-first\\"],` +
5243
+ `\\"decision_authority\\":\\"CMO approves >$10k spend\\",\\"budget_constraints\\":\\"$50k monthly cap\\",` +
5244
+ `\\"strategic_objectives\\":[{\\"objective\\":\\"Grow MRR\\",\\"target\\":\\"$100k\\",\\"measurement\\":\\"Revenue dashboard\\"}],` +
5245
+ `\\"risk_appetite\\":\\"moderate\\",\\"escalation_matrix\\":[{\\"trigger\\":\\"Budget >80%\\",\\"escalate_to\\":\\"CEO\\",\\"priority\\":\\"P1\\"}],` +
5246
+ `\\"notes\\":\\"Quarterly review\\"}"\n\n` +
5247
+ `Supported content fields: mission, vision, core_principles, decision_authority, budget_constraints, ` +
5248
+ `resource_limits, tool_stack, strategic_objectives, risk_appetite, compliance_requirements, ` +
5249
+ `escalation_matrix, team_composition, integration_points, review_frequency, notes — or any custom fields.\n\n` +
5240
5250
  `Status values: "draft", "active", "under_review", "archived"`,
5241
5251
  parameters: {
5242
5252
  type: "object",
@@ -5246,10 +5256,10 @@ function registerFrameworkOps(
5246
5256
  framework_id: { type: "string", description: "Framework ID (required for get, update, delete)" },
5247
5257
  agent_id: { type: "string", description: "Agent ID (required for create, optional filter for list)" },
5248
5258
  title: { type: "string", description: "Framework title" },
5259
+ content: { type: "string", description: "Framework body as a JSON string containing mission, vision, core_principles, decision_authority, budget_constraints, strategic_objectives, risk_appetite, escalation_matrix, and any other fields. Pass as stringified JSON." },
5249
5260
  department: { type: "string" },
5250
5261
  category: { type: "string" },
5251
5262
  status: { type: "string", enum: ["draft", "active", "under_review", "archived"] },
5252
- framework_data: { type: "object", description: "Structured framework content — pass a complete FrameworkData JSON object" },
5253
5263
  },
5254
5264
  },
5255
5265
  async execute(_id: string, params: Record<string, unknown>) {
@@ -5279,8 +5289,23 @@ async function handleFWCreate(
5279
5289
  const title = params.title as string;
5280
5290
  if (!title) return err("Missing required field: title");
5281
5291
 
5282
- const fwDataRaw = params.framework_data as Record<string, unknown> | undefined;
5283
- const content = fwDataRaw ? JSON.stringify({ title, ...fwDataRaw }) : JSON.stringify({ title });
5292
+ // Accept content via: (1) 'content' string param (preferred, matches SOP pattern)
5293
+ // (2) 'framework_data' object param (legacy, kept for compat)
5294
+ let content: string;
5295
+ if (typeof params.content === "string" && params.content.trim()) {
5296
+ // Already a JSON string — merge with title
5297
+ try {
5298
+ const parsed = JSON.parse(params.content);
5299
+ content = JSON.stringify({ title, ...parsed });
5300
+ } catch {
5301
+ // Not valid JSON — wrap as notes
5302
+ content = JSON.stringify({ title, notes: params.content });
5303
+ }
5304
+ } else if (params.framework_data && typeof params.framework_data === "object") {
5305
+ content = JSON.stringify({ title, ...(params.framework_data as Record<string, unknown>) });
5306
+ } else {
5307
+ content = JSON.stringify({ title });
5308
+ }
5284
5309
 
5285
5310
  const row = {
5286
5311
  user_id: userId, agent_id: agentIdRaw, title, content,
@@ -5332,10 +5357,21 @@ async function handleFWUpdate(supabase: SupabaseClient, userId: string, params:
5332
5357
  if (params.status !== undefined) updates.status = params.status;
5333
5358
  if (params.department !== undefined) updates.department = params.department;
5334
5359
  if (params.category !== undefined) updates.category = params.category;
5335
- if (params.framework_data) {
5360
+
5361
+ // Accept content via: (1) 'content' string param (preferred)
5362
+ // (2) 'framework_data' object param (legacy compat)
5363
+ if (typeof params.content === "string" && params.content.trim()) {
5364
+ try {
5365
+ const parsed = JSON.parse(params.content);
5366
+ updates.content = JSON.stringify({ title: parsed.title || (params.title as string) || "", ...parsed });
5367
+ } catch {
5368
+ updates.content = JSON.stringify({ title: (params.title as string) || "", notes: params.content });
5369
+ }
5370
+ } else if (params.framework_data && typeof params.framework_data === "object") {
5336
5371
  const raw = params.framework_data as Record<string, unknown>;
5337
5372
  updates.content = JSON.stringify({ title: (raw.title as string) || (params.title as string) || "", ...raw });
5338
5373
  }
5374
+
5339
5375
  const { data, error } = await supabase.from("frameworks").update(updates)
5340
5376
  .eq("id", params.framework_id as string).eq("user_id", userId)
5341
5377
  .select("id, title, status").maybeSingle();