ofiere-openclaw-plugin 4.40.0 → 4.40.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 +1 -1
- package/src/prompt.ts +8 -3
- package/src/tools.ts +33 -24
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ofiere-openclaw-plugin",
|
|
3
|
-
"version": "4.40.
|
|
3
|
+
"version": "4.40.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
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
const TOOL_SUMMARIES: Record<string, string> = {
|
|
15
15
|
OFIERE_TASK_OPS: "Manage tasks: list, create, update, delete, approvals",
|
|
16
|
-
OFIERE_AGENT_OPS: "Query
|
|
16
|
+
OFIERE_AGENT_OPS: "Query + manage agents and their staff subagents",
|
|
17
17
|
OFIERE_PROJECT_OPS: "PM hierarchy: spaces, folders, dependencies",
|
|
18
18
|
OFIERE_SCHEDULE_OPS: "Calendar: list, create, update, delete events",
|
|
19
19
|
OFIERE_KNOWLEDGE_OPS: "Knowledge library: search, list, create, update, delete",
|
|
@@ -48,7 +48,12 @@ Actions: "list", "create", "update", "delete", "add_approval", "list_approvals",
|
|
|
48
48
|
- list_approvals: List approvals. Optional: task_id, approval_status (pending|approved|rejected)
|
|
49
49
|
- resolve_approval: Approve/reject. Requires: approval_id, approval_status. Optional: comment`,
|
|
50
50
|
|
|
51
|
-
OFIERE_AGENT_OPS: `Query
|
|
51
|
+
OFIERE_AGENT_OPS: `Query + manage agents and their staff subagents.
|
|
52
|
+
Actions: "list", "list_subagents", "create_subagent", "delete_subagent"
|
|
53
|
+
- list: All top-level agents (chiefs / native + OpenClaw) with IDs, names, roles. Use for task assignment lookup.
|
|
54
|
+
- list_subagents: Staff under a chief. Required: chief_agent_id.
|
|
55
|
+
- create_subagent: Add a staff subagent under a chief (max 5 per chief). Required: chief_agent_id, name. Optional: role (default "Staff"), codename, color_hex.
|
|
56
|
+
- delete_subagent: Remove a staff subagent. Required: subagent_id.`,
|
|
52
57
|
|
|
53
58
|
OFIERE_PROJECT_OPS: `Manage PM hierarchy.
|
|
54
59
|
Actions: "list_spaces", "create_space", "update_space", "delete_space", "list_folders", "create_folder", "update_folder", "delete_folder", "list_dependencies", "add_dependency", "remove_dependency"
|
|
@@ -107,7 +112,7 @@ Actions: "list", "get", "create", "update", "delete", "add_nodes", "execute"
|
|
|
107
112
|
- Execution maps ALL fields: execution_steps, goals, constraints, system_prompt`,
|
|
108
113
|
|
|
109
114
|
OFIERE_SOP_OPS: `Standard Operating Procedures.
|
|
110
|
-
Actions: "list_templates", "create", "list", "get", "update", "delete", "list_subagents", "
|
|
115
|
+
Actions: "list_templates", "create", "list", "get", "update", "delete", "list_subagents", "apply_template", "propose_attach", "commit_attach"
|
|
111
116
|
- 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 }
|
|
112
117
|
- Legacy field names still accepted (objective→purpose, steps→procedure_steps, deliverables→expected_outputs, escalationRules→escalation_rules, successCriteria→acceptance_criteria) — prefer new names.
|
|
113
118
|
- propose_attach / commit_attach: attach SOPs to a run (target_kind: conversation|task|scheduler_event). Tier rule: SOPs only attach to STAFF-tier targets; for c-suite use OFIERE_FRAMEWORK_OPS instead. propose_attach returns a token-cost summary + confirmation_token (5-min ttl). You MUST surface the cost and ask the user before calling commit_attach. The user must explicitly approve.
|
package/src/tools.ts
CHANGED
|
@@ -1088,9 +1088,12 @@ function registerAgentOps(
|
|
|
1088
1088
|
name: "OFIERE_AGENT_OPS",
|
|
1089
1089
|
label: "Ofiere Agent Operations",
|
|
1090
1090
|
description:
|
|
1091
|
-
`Query agents in the Ofiere PM system.\n\n` +
|
|
1091
|
+
`Query and manage agents + their staff subagents in the Ofiere PM system.\n\n` +
|
|
1092
1092
|
`Actions:\n` +
|
|
1093
|
-
`- "list": List all
|
|
1093
|
+
`- "list": List all top-level agents (chiefs / native + OpenClaw) with their IDs, names, roles, and status. Use this to find the correct agent_id for task assignment.\n` +
|
|
1094
|
+
`- "list_subagents": List staff subagents under a chief. Required: chief_agent_id.\n` +
|
|
1095
|
+
`- "create_subagent": Create a staff subagent under a chief (max 5 per chief). Required: chief_agent_id, name. Optional: role (default "Staff"), codename, color_hex (default "#64748b").\n` +
|
|
1096
|
+
`- "delete_subagent": Remove a staff subagent. Required: subagent_id.`,
|
|
1094
1097
|
parameters: {
|
|
1095
1098
|
type: "object",
|
|
1096
1099
|
required: ["action"],
|
|
@@ -1098,8 +1101,14 @@ function registerAgentOps(
|
|
|
1098
1101
|
action: {
|
|
1099
1102
|
type: "string",
|
|
1100
1103
|
description: "The operation to perform",
|
|
1101
|
-
enum: ["list"],
|
|
1104
|
+
enum: ["list", "list_subagents", "create_subagent", "delete_subagent"],
|
|
1102
1105
|
},
|
|
1106
|
+
chief_agent_id: { type: "string", description: "Chief agent ID (required for list_subagents, create_subagent)" },
|
|
1107
|
+
subagent_id: { type: "string", description: "Subagent ID (required for delete_subagent)" },
|
|
1108
|
+
name: { type: "string", description: "Subagent display name (required for create_subagent)" },
|
|
1109
|
+
role: { type: "string", description: "Subagent role label, e.g. 'Staff', 'Analyst'. Defaults to 'Staff'." },
|
|
1110
|
+
codename: { type: "string", description: "Optional subagent codename" },
|
|
1111
|
+
color_hex: { type: "string", description: "Optional subagent UI color, default '#64748b'" },
|
|
1103
1112
|
},
|
|
1104
1113
|
},
|
|
1105
1114
|
async execute(_id: string, params: Record<string, unknown>) {
|
|
@@ -1108,8 +1117,14 @@ function registerAgentOps(
|
|
|
1108
1117
|
switch (action) {
|
|
1109
1118
|
case "list":
|
|
1110
1119
|
return handleListAgents(api, supabase, userId, fallbackAgentId);
|
|
1120
|
+
case "list_subagents":
|
|
1121
|
+
return handleListSubagents(supabase, userId, params);
|
|
1122
|
+
case "create_subagent":
|
|
1123
|
+
return handleCreateSubagent(supabase, userId, params);
|
|
1124
|
+
case "delete_subagent":
|
|
1125
|
+
return handleDeleteSubagent(supabase, userId, params);
|
|
1111
1126
|
default:
|
|
1112
|
-
return err(`Unknown action "${action}". Valid actions: list`);
|
|
1127
|
+
return err(`Unknown action "${action}". Valid actions: list, list_subagents, create_subagent, delete_subagent`);
|
|
1113
1128
|
}
|
|
1114
1129
|
},
|
|
1115
1130
|
});
|
|
@@ -4847,9 +4862,7 @@ function registerSOPOps(
|
|
|
4847
4862
|
`- "get": Get full SOP details. Required: sop_id\n` +
|
|
4848
4863
|
`- "update": Modify SOP. Required: sop_id. Optional: title, sop_data, status, department\n` +
|
|
4849
4864
|
`- "delete": Remove SOP. Required: sop_id\n` +
|
|
4850
|
-
`- "list_subagents": List subagents for a chief. Required: chief_agent_id\n` +
|
|
4851
|
-
`- "create_subagent": Create a staff subagent under a chief (max 5 per chief). Required: chief_agent_id, name. Optional: role (default "Staff"), codename, color_hex (default "#64748b").\n` +
|
|
4852
|
-
`- "delete_subagent": Delete a staff subagent. Required: subagent_id\n` +
|
|
4865
|
+
`- "list_subagents": List subagents for a chief. Required: chief_agent_id. (Provided here for convenience when scoping SOP authoring; team management lives in OFIERE_AGENT_OPS.)\n` +
|
|
4853
4866
|
`- "apply_template": Create SOP from template. Required: agent_id, template_id. Optional: title, department\n` +
|
|
4854
4867
|
`- "propose_attach": Propose attaching SOPs to a run target (conversation/task/scheduler_event). Returns token cost + confirmation_token. Required: target_kind, target_id, doc_ids[]. The user MUST be asked to approve before commit.\n` +
|
|
4855
4868
|
`- "commit_attach": Commit a proposed attachment. Required: target_kind, target_id, doc_ids[], confirmation_token (from propose_attach). Only call AFTER user approves the token cost.\n` +
|
|
@@ -4873,15 +4886,10 @@ function registerSOPOps(
|
|
|
4873
4886
|
type: "object",
|
|
4874
4887
|
required: ["action"],
|
|
4875
4888
|
properties: {
|
|
4876
|
-
action: { type: "string", enum: ["list_templates", "create", "list", "get", "update", "delete", "list_subagents", "
|
|
4889
|
+
action: { type: "string", enum: ["list_templates", "create", "list", "get", "update", "delete", "list_subagents", "apply_template", "propose_attach", "commit_attach"], description: "Valid actions: list_templates, create, list, get, update, delete, list_subagents, apply_template, propose_attach, commit_attach" },
|
|
4877
4890
|
sop_id: { type: "string", description: "SOP ID (required for get, update, delete)" },
|
|
4878
4891
|
agent_id: { type: "string", description: "Agent ID (required for create, list filter, apply_template)" },
|
|
4879
|
-
chief_agent_id: { type: "string", description: "Chief agent ID (required for list_subagents
|
|
4880
|
-
subagent_id: { type: "string", description: "Subagent ID (required for delete_subagent)" },
|
|
4881
|
-
name: { type: "string", description: "Subagent display name (required for create_subagent)" },
|
|
4882
|
-
role: { type: "string", description: "Subagent role label, e.g. 'Staff', 'Analyst'. Defaults to 'Staff'." },
|
|
4883
|
-
codename: { type: "string", description: "Optional subagent codename" },
|
|
4884
|
-
color_hex: { type: "string", description: "Optional subagent UI color, default '#64748b'" },
|
|
4892
|
+
chief_agent_id: { type: "string", description: "Chief agent ID (required for list_subagents)" },
|
|
4885
4893
|
template_id: { type: "string", description: "Template ID (required for apply_template)" },
|
|
4886
4894
|
target_kind: { type: "string", enum: ["conversation", "task", "scheduler_event"], description: "Run target kind (for propose_attach/commit_attach)" },
|
|
4887
4895
|
target_id: { type: "string", description: "Run target id (for propose_attach/commit_attach)" },
|
|
@@ -4938,13 +4946,11 @@ function registerSOPOps(
|
|
|
4938
4946
|
case "get": return handleSOPGet(supabase, userId, params);
|
|
4939
4947
|
case "update": return handleSOPUpdate(supabase, userId, params);
|
|
4940
4948
|
case "delete": return handleSOPDelete(supabase, userId, params);
|
|
4941
|
-
case "list_subagents": return
|
|
4942
|
-
case "create_subagent": return handleSOPCreateSubagent(supabase, userId, params);
|
|
4943
|
-
case "delete_subagent": return handleSOPDeleteSubagent(supabase, userId, params);
|
|
4949
|
+
case "list_subagents": return handleListSubagents(supabase, userId, params);
|
|
4944
4950
|
case "apply_template": return handleSOPApplyTemplate(supabase, userId, resolveAgent, params);
|
|
4945
4951
|
case "propose_attach": return handleProposeAttach({ supabase, userId, docKind: "sop", params });
|
|
4946
4952
|
case "commit_attach": return handleCommitAttach({ supabase, userId, docKind: "sop", params });
|
|
4947
|
-
default: return err(`Unknown action "${action}". Valid: list_templates, create, list, get, update, delete, list_subagents,
|
|
4953
|
+
default: return err(`Unknown action "${action}". Valid: list_templates, create, list, get, update, delete, list_subagents, apply_template, propose_attach, commit_attach`);
|
|
4948
4954
|
}
|
|
4949
4955
|
},
|
|
4950
4956
|
});
|
|
@@ -5185,7 +5191,12 @@ async function handleSOPDelete(supabase: SupabaseClient, userId: string, params:
|
|
|
5185
5191
|
} catch (e) { return err(e instanceof Error ? e.message : String(e)); }
|
|
5186
5192
|
}
|
|
5187
5193
|
|
|
5188
|
-
|
|
5194
|
+
// ── Shared subagent handlers (used by OFIERE_AGENT_OPS; SOP_OPS keeps a
|
|
5195
|
+
// convenience wrapper for `list_subagents` only). ──────────────────────────
|
|
5196
|
+
|
|
5197
|
+
const MAX_SUBAGENTS_PER_CHIEF = 5;
|
|
5198
|
+
|
|
5199
|
+
async function handleListSubagents(supabase: SupabaseClient, userId: string, params: Record<string, unknown>): Promise<ToolResult> {
|
|
5189
5200
|
try {
|
|
5190
5201
|
if (!params.chief_agent_id) return err("Missing required field: chief_agent_id");
|
|
5191
5202
|
const { data, error } = await supabase
|
|
@@ -5195,13 +5206,11 @@ async function handleSOPListSubagents(supabase: SupabaseClient, userId: string,
|
|
|
5195
5206
|
.eq("chief_agent_id", params.chief_agent_id as string)
|
|
5196
5207
|
.order("created_at", { ascending: true });
|
|
5197
5208
|
if (error) return err(error.message);
|
|
5198
|
-
return ok({ subagents: data || [], count: (data || []).length, max_allowed:
|
|
5209
|
+
return ok({ subagents: data || [], count: (data || []).length, max_allowed: MAX_SUBAGENTS_PER_CHIEF });
|
|
5199
5210
|
} catch (e) { return err(e instanceof Error ? e.message : String(e)); }
|
|
5200
5211
|
}
|
|
5201
5212
|
|
|
5202
|
-
|
|
5203
|
-
|
|
5204
|
-
async function handleSOPCreateSubagent(supabase: SupabaseClient, userId: string, params: Record<string, unknown>): Promise<ToolResult> {
|
|
5213
|
+
async function handleCreateSubagent(supabase: SupabaseClient, userId: string, params: Record<string, unknown>): Promise<ToolResult> {
|
|
5205
5214
|
try {
|
|
5206
5215
|
const chiefAgentId = params.chief_agent_id as string | undefined;
|
|
5207
5216
|
const name = params.name as string | undefined;
|
|
@@ -5233,7 +5242,7 @@ async function handleSOPCreateSubagent(supabase: SupabaseClient, userId: string,
|
|
|
5233
5242
|
} catch (e) { return err(e instanceof Error ? e.message : String(e)); }
|
|
5234
5243
|
}
|
|
5235
5244
|
|
|
5236
|
-
async function
|
|
5245
|
+
async function handleDeleteSubagent(supabase: SupabaseClient, userId: string, params: Record<string, unknown>): Promise<ToolResult> {
|
|
5237
5246
|
try {
|
|
5238
5247
|
const subagentId = params.subagent_id as string | undefined;
|
|
5239
5248
|
if (!subagentId) return err("Missing required field: subagent_id");
|