@badgerclaw/connect 1.4.0 → 1.4.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": "@badgerclaw/connect",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "BadgerClaw channel plugin for OpenClaw",
5
5
  "type": "module",
6
6
  "dependencies": {
@@ -34,4 +34,4 @@
34
34
  "scripts": {
35
35
  "postinstall": "node scripts/postinstall.js"
36
36
  }
37
- }
37
+ }
@@ -12,23 +12,33 @@ const OPENCLAW_PKG = path.join(
12
12
  'package.json'
13
13
  );
14
14
 
15
- const COMPAT_EXPORT = './plugin-sdk/compat';
16
- const COMPAT_ENTRY = {
17
- types: './dist/plugin-sdk/compat.d.ts',
18
- default: './dist/plugin-sdk/compat.js',
15
+ const MISSING_EXPORTS = {
16
+ './plugin-sdk/compat': {
17
+ types: './dist/plugin-sdk/compat.d.ts',
18
+ default: './dist/plugin-sdk/compat.js',
19
+ },
20
+ './plugin-sdk/extension-shared': {
21
+ types: './dist/plugin-sdk/extension-shared.d.ts',
22
+ default: './dist/plugin-sdk/extension-shared.js',
23
+ },
19
24
  };
20
25
 
21
26
  try {
22
27
  const pkg = JSON.parse(fs.readFileSync(OPENCLAW_PKG, 'utf-8'));
23
28
  if (!pkg.exports) pkg.exports = {};
24
- if (!pkg.exports[COMPAT_EXPORT]) {
25
- pkg.exports[COMPAT_EXPORT] = COMPAT_ENTRY;
29
+ let patched = false;
30
+ for (const [key, entry] of Object.entries(MISSING_EXPORTS)) {
31
+ if (!pkg.exports[key]) {
32
+ pkg.exports[key] = entry;
33
+ console.log(`[badgerclaw] patched openclaw exports map: added ${key}`);
34
+ patched = true;
35
+ }
36
+ }
37
+ if (patched) {
26
38
  fs.writeFileSync(OPENCLAW_PKG, JSON.stringify(pkg, null, 2));
27
- console.log('[badgerclaw] patched openclaw exports map: added plugin-sdk/compat');
28
39
  } else {
29
- console.log('[badgerclaw] openclaw exports map already has plugin-sdk/compat');
40
+ console.log('[badgerclaw] openclaw exports map already up to date');
30
41
  }
31
42
  } catch (e) {
32
- // Non-fatal — openclaw may not be installed yet
33
43
  console.log('[badgerclaw] postinstall: could not patch openclaw exports map:', e.message);
34
44
  }
package/src/channel.ts CHANGED
@@ -15,7 +15,7 @@ import {
15
15
  PAIRING_APPROVED_MESSAGE,
16
16
  type ChannelPlugin,
17
17
  } from "openclaw/plugin-sdk/matrix";
18
- import { buildTrafficStatusSummary } from "/opt/homebrew/lib/node_modules/openclaw/extensions/shared/channel-status-summary.js";
18
+ import { buildTrafficStatusSummary } from "openclaw/plugin-sdk/extension-shared";
19
19
  import { matrixMessageActions } from "./actions.js";
20
20
  import { MatrixConfigSchema } from "./config-schema.js";
21
21
  import { listMatrixDirectoryGroupsLive, listMatrixDirectoryPeersLive } from "./directory-live.js";