@nextclaw/openclaw-compat 0.1.2 → 0.1.4

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 (2) hide show
  1. package/dist/index.js +21 -2
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1455,6 +1455,16 @@ function validatePluginConfig(params) {
1455
1455
  return { ok: false, errors: result.errors };
1456
1456
  }
1457
1457
  function loadOpenClawPlugins(options) {
1458
+ if (process.env.NEXTCLAW_ENABLE_OPENCLAW_PLUGINS !== "1") {
1459
+ return {
1460
+ plugins: [],
1461
+ tools: [],
1462
+ channels: [],
1463
+ providers: [],
1464
+ diagnostics: [],
1465
+ resolvedTools: []
1466
+ };
1467
+ }
1458
1468
  const logger = options.logger ?? defaultLogger2;
1459
1469
  const workspaceDir = options.workspaceDir?.trim() || getWorkspacePathFromConfig(options.config);
1460
1470
  const normalized = normalizePluginsConfig(options.config.plugins);
@@ -1911,11 +1921,20 @@ function buildPluginStatusReport(params) {
1911
1921
  // src/plugins/uninstall.ts
1912
1922
  import fs6 from "fs/promises";
1913
1923
  import path5 from "path";
1924
+ function isLinkedPathInstall(record) {
1925
+ if (!record || record.source !== "path") {
1926
+ return false;
1927
+ }
1928
+ if (!record.sourcePath || !record.installPath) {
1929
+ return true;
1930
+ }
1931
+ return path5.resolve(record.sourcePath) === path5.resolve(record.installPath);
1932
+ }
1914
1933
  function resolveUninstallDirectoryTarget(params) {
1915
1934
  if (!params.hasInstall) {
1916
1935
  return null;
1917
1936
  }
1918
- if (params.installRecord?.source === "path") {
1937
+ if (isLinkedPathInstall(params.installRecord)) {
1919
1938
  return null;
1920
1939
  }
1921
1940
  let defaultPath;
@@ -2013,7 +2032,7 @@ async function uninstallPlugin(params) {
2013
2032
  return { ok: false, error: `Plugin not found: ${pluginId}` };
2014
2033
  }
2015
2034
  const installRecord = config.plugins.installs?.[pluginId];
2016
- const isLinked = installRecord?.source === "path";
2035
+ const isLinked = isLinkedPathInstall(installRecord);
2017
2036
  const { config: nextConfig, actions: configActions } = removePluginFromConfig(config, pluginId);
2018
2037
  const actions = {
2019
2038
  ...configActions,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextclaw/openclaw-compat",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "private": false,
5
5
  "description": "OpenClaw plugin compatibility layer for NextClaw.",
6
6
  "type": "module",
@@ -18,7 +18,7 @@
18
18
  "jiti": "^1.21.7",
19
19
  "jszip": "^3.10.1",
20
20
  "tar": "^7.4.3",
21
- "@nextclaw/core": "^0.4.9"
21
+ "@nextclaw/core": "^0.5.3"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@types/node": "^20.17.6",