@happycastle/oh-my-openclaw 0.12.0 → 0.12.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.
@@ -10,7 +10,8 @@ export function registerContextInjector(api) {
10
10
  if (!collectedContext) {
11
11
  return event;
12
12
  }
13
- event.prependContext = collectedContext;
13
+ const existing = event.prependContext || '';
14
+ event.prependContext = existing ? `${existing}\n\n${collectedContext}` : collectedContext;
14
15
  api.logger.info(`[omoc] Context injected: ${entryCount} entries for ${sessionKey}`);
15
16
  return event;
16
17
  }, {
@@ -20,8 +20,8 @@ export function registerMessageMonitor(api) {
20
20
  timestamp,
21
21
  messageCount: nextCount
22
22
  });
23
- // Return undefined to not modify the message
24
- return undefined;
23
+ // Return context unchanged to allow event propagation
24
+ return context;
25
25
  }, {
26
26
  name: 'oh-my-openclaw.message-monitor',
27
27
  description: 'Monitors message events for audit logging'
@@ -31,7 +31,7 @@ export function registerMessageMonitor(api) {
31
31
  const preview = content.substring(0, 100);
32
32
  const channelId = context?.channelId || 'unknown';
33
33
  api.logger.info('[omoc] Message received:', { preview, channelId });
34
- return undefined;
34
+ return context;
35
35
  }, {
36
36
  name: 'oh-my-openclaw.message-received-monitor',
37
37
  description: 'Monitors inbound message events for audit logging'
package/dist/index.js CHANGED
@@ -16,6 +16,7 @@ import { registerPersonaCommands } from './commands/persona-commands.js';
16
16
  import { registerPersonaInjector } from './hooks/persona-injector.js';
17
17
  import { registerContextInjector } from './hooks/context-injector.js';
18
18
  import { registerSetupCli } from './cli/setup.js';
19
+ let initialized = false;
19
20
  const registry = {
20
21
  hooks: [],
21
22
  services: [],
@@ -24,6 +25,11 @@ const registry = {
24
25
  cli: [],
25
26
  };
26
27
  export default function register(api) {
28
+ if (initialized) {
29
+ api.logger.warn(`[${PLUGIN_ID}] Plugin already initialized — skipping duplicate register() call`);
30
+ return;
31
+ }
32
+ initialized = true;
27
33
  const config = getConfig(api);
28
34
  api.logger.info(`[${PLUGIN_ID}] Initializing plugin v${VERSION}`);
29
35
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@happycastle/oh-my-openclaw",
3
- "version": "0.12.0",
3
+ "version": "0.12.2",
4
4
  "description": "Oh-My-OpenClaw plugin — multi-agent orchestration, todo enforcer, ralph loop, and custom tools for OpenClaw",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",