ofiere-openclaw-plugin 1.0.1 → 1.0.2

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 (3) hide show
  1. package/index.ts +12 -15
  2. package/package.json +1 -1
  3. package/src/tools.ts +0 -3
package/index.ts CHANGED
@@ -1,8 +1,7 @@
1
1
  // index.ts — Ofiere PM Plugin for OpenClaw
2
- // Uses definePluginEntry from the official plugin-entry subpath (NOT the deprecated monolithic root)
3
- // Pattern: https://docs.openclaw.ai/plugins/building-plugins#quick-start-tool-plugin
2
+ // Matches Composio plugin pattern: plain object export + api.on()
4
3
 
5
- import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
4
+ import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
6
5
  import { parseOfiereConfig } from "./src/config.js";
7
6
  import { getSupabase } from "./src/supabase.js";
8
7
  import { registerTools } from "./src/tools.js";
@@ -10,21 +9,21 @@ import { getSystemPrompt } from "./src/prompt.js";
10
9
  import { registerCli } from "./src/cli.js";
11
10
  import { seedAgentCache } from "./src/agent-resolver.js";
12
11
 
13
- export default definePluginEntry({
12
+ const ofierePlugin = {
14
13
  id: "ofiere",
15
14
  name: "Ofiere PM",
16
15
  description:
17
16
  "Manage Ofiere PM tasks, agents, and projects directly from the agent. " +
18
17
  "Create tasks, update progress, assign agents — all synced to the dashboard in real time.",
19
18
 
20
- register(api) {
19
+ register(api: OpenClawPluginApi) {
21
20
  const config = parseOfiereConfig(api.pluginConfig);
22
21
 
23
22
  // Always register CLI (even if disabled — so user can run `openclaw ofiere setup`)
24
23
  registerCli(api);
25
24
 
26
25
  if (!config.enabled) {
27
- api.logger.debug("[ofiere] Plugin disabled via config");
26
+ api.logger.debug?.("[ofiere] Plugin disabled via config");
28
27
  return;
29
28
  }
30
29
 
@@ -44,7 +43,6 @@ export default definePluginEntry({
44
43
 
45
44
  // ── Pre-seed agent cache if OFIERE_AGENT_ID is set (legacy mode) ──────
46
45
  if (config.agentId) {
47
- // Try to extract the calling agent's name from OpenClaw context
48
46
  const callerName =
49
47
  (api as any)?.agentContext?.accountId ||
50
48
  (api as any)?.agentContext?.name ||
@@ -64,13 +62,10 @@ export default definePluginEntry({
64
62
  };
65
63
 
66
64
  // ── Hook: inject Ofiere context into every agent prompt ────────────────
67
- // Uses api.registerHook (the documented API) instead of api.on shorthand
68
- api.registerHook(
69
- ["before_prompt_build"],
70
- () => ({
71
- prependSystemContext: getSystemPrompt(promptState),
72
- }),
73
- );
65
+ // Using api.on() same pattern as Composio
66
+ api.on("before_prompt_build", () => ({
67
+ prependSystemContext: getSystemPrompt(promptState),
68
+ }));
74
69
 
75
70
  // ── Connect to Supabase and register tools ────────────────────────────
76
71
  try {
@@ -89,4 +84,6 @@ export default definePluginEntry({
89
84
  api.logger.error(`[ofiere] Failed to initialize: ${msg}`);
90
85
  }
91
86
  },
92
- });
87
+ };
88
+
89
+ export default ofierePlugin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ofiere-openclaw-plugin",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "type": "module",
5
5
  "description": "OpenClaw plugin for Ofiere PM — manage tasks, agents, and projects from your agent",
6
6
  "keywords": ["openclaw", "ofiere", "project-management", "agents", "plugin"],
package/src/tools.ts CHANGED
@@ -232,7 +232,6 @@ export function registerTools(
232
232
  }
233
233
  },
234
234
  },
235
- { optional: true },
236
235
  );
237
236
 
238
237
  // ── OFIERE_UPDATE_TASK — Optional (has side effects) ─────────────────
@@ -297,7 +296,6 @@ export function registerTools(
297
296
  }
298
297
  },
299
298
  },
300
- { optional: true },
301
299
  );
302
300
 
303
301
  // ── OFIERE_DELETE_TASK — Optional (destructive side effect) ──────────
@@ -352,7 +350,6 @@ export function registerTools(
352
350
  }
353
351
  },
354
352
  },
355
- { optional: true },
356
353
  );
357
354
 
358
355
  // ── OFIERE_LIST_AGENTS — Required (read-only, no side effects) ───────