@nextclaw/openclaw-compat 0.3.13 → 0.3.15

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/dist/index.d.ts CHANGED
@@ -440,6 +440,8 @@ declare function resolvePluginChannelMessageToolHints(params: {
440
440
  accountId?: string | null;
441
441
  }): string[];
442
442
  declare function getPluginUiMetadataFromRegistry(registry: PluginRegistry): PluginUiMetadata[];
443
+ declare function toPluginConfigView(config: Config, bindings: PluginChannelBinding[]): Record<string, unknown>;
444
+ declare function mergePluginConfigView(baseConfig: Config, pluginViewConfig: Record<string, unknown>, bindings: PluginChannelBinding[]): Config;
443
445
  declare function startPluginChannelGateways(params: {
444
446
  registry: PluginRegistry;
445
447
  logger?: PluginLogger;
@@ -716,4 +718,4 @@ declare function uninstallPlugin(params: {
716
718
  extensionsDir?: string;
717
719
  }): Promise<UninstallPluginResult>;
718
720
 
719
- export { DEFAULT_ACCOUNT_ID, type InstallPluginResult, type NormalizedPluginsConfig, type OpenClawChannelAgentPrompt, type OpenClawChannelAuth, type OpenClawChannelAuthLoginResult, type OpenClawChannelConfigAdapter, type OpenClawChannelConfigSchema, type OpenClawChannelGateway, type OpenClawChannelGatewayStartContext, type OpenClawChannelPlugin, type OpenClawChannelSetup, type OpenClawPluginApi, type OpenClawPluginChannelRegistration, type OpenClawPluginConfigSchema, type OpenClawPluginDefinition, type OpenClawPluginEngineOptions, type OpenClawPluginModule, type OpenClawPluginNcpAgentRuntimeRegistration, type OpenClawPluginTool, type OpenClawPluginToolContext, type OpenClawPluginToolFactory, type OpenClawPluginToolOptions, type OpenClawProviderPlugin, PLUGIN_MANIFEST_FILENAME, PLUGIN_MANIFEST_FILENAMES, type PackageManifest, type PluginCandidate, type PluginChannelBinding, type PluginChannelGatewayHandle, type PluginChannelRegistration, type PluginConfigUiHint, type PluginDiagnostic, type PluginDiscoveryResult, type PluginEngineRegistration, type PluginInstallLogger, type PluginInstallSource, type PluginInstallUpdate, type PluginKind, type PluginLoadOptions, type PluginLogger, type PluginManifest, type PluginManifestLoadResult, type PluginManifestRecord, type PluginManifestRegistry, type PluginNcpAgentRuntimeRegistration, type PluginOrigin, type PluginProviderRegistration, type PluginRecord, type PluginRegisterRuntime, type PluginRegistry, type PluginReplyDispatchParams, type PluginRuntime, type PluginRuntimeBridge, type PluginStatusReport, type PluginToolRegistration, type PluginUiMetadata, type UninstallActions, type UninstallPluginResult, type _CompatOnly, __nextclawPluginSdkCompat, addPluginLoadPath, buildChannelConfigSchema, buildOauthProviderAuthResult, buildPluginLoaderAliases, buildPluginStatusReport, createNextclawBuiltinChannelPlugin, createPluginRegisterRuntime, createPluginRuntime, disablePluginInConfig, discoverOpenClawPlugins, emptyPluginConfigSchema, enablePluginInConfig, getPackageManifestMetadata, getPluginChannelBindings, getPluginUiMetadataFromRegistry, installPluginFromArchive, installPluginFromDir, installPluginFromFile, installPluginFromNpmSpec, installPluginFromPath, loadOpenClawPlugins, loadPluginManifest, loadPluginManifestRegistry, loadPluginUiMetadata, normalizeAccountId, normalizePluginHttpPath, normalizePluginsConfig, recordPluginInstall, registerPluginWithApi, removePluginFromConfig, resolveEnableState, resolvePluginChannelMessageToolHints, resolvePluginInstallDir, resolvePluginManifestPath, resolveUninstallDirectoryTarget, resolveUninstallDirectoryTargets, setPluginRuntimeBridge, sleep, startPluginChannelGateways, stopPluginChannelGateways, toPluginUiMetadata, uninstallPlugin, validateJsonSchemaValue };
721
+ export { DEFAULT_ACCOUNT_ID, type InstallPluginResult, type NormalizedPluginsConfig, type OpenClawChannelAgentPrompt, type OpenClawChannelAuth, type OpenClawChannelAuthLoginResult, type OpenClawChannelConfigAdapter, type OpenClawChannelConfigSchema, type OpenClawChannelGateway, type OpenClawChannelGatewayStartContext, type OpenClawChannelPlugin, type OpenClawChannelSetup, type OpenClawPluginApi, type OpenClawPluginChannelRegistration, type OpenClawPluginConfigSchema, type OpenClawPluginDefinition, type OpenClawPluginEngineOptions, type OpenClawPluginModule, type OpenClawPluginNcpAgentRuntimeRegistration, type OpenClawPluginTool, type OpenClawPluginToolContext, type OpenClawPluginToolFactory, type OpenClawPluginToolOptions, type OpenClawProviderPlugin, PLUGIN_MANIFEST_FILENAME, PLUGIN_MANIFEST_FILENAMES, type PackageManifest, type PluginCandidate, type PluginChannelBinding, type PluginChannelGatewayHandle, type PluginChannelRegistration, type PluginConfigUiHint, type PluginDiagnostic, type PluginDiscoveryResult, type PluginEngineRegistration, type PluginInstallLogger, type PluginInstallSource, type PluginInstallUpdate, type PluginKind, type PluginLoadOptions, type PluginLogger, type PluginManifest, type PluginManifestLoadResult, type PluginManifestRecord, type PluginManifestRegistry, type PluginNcpAgentRuntimeRegistration, type PluginOrigin, type PluginProviderRegistration, type PluginRecord, type PluginRegisterRuntime, type PluginRegistry, type PluginReplyDispatchParams, type PluginRuntime, type PluginRuntimeBridge, type PluginStatusReport, type PluginToolRegistration, type PluginUiMetadata, type UninstallActions, type UninstallPluginResult, type _CompatOnly, __nextclawPluginSdkCompat, addPluginLoadPath, buildChannelConfigSchema, buildOauthProviderAuthResult, buildPluginLoaderAliases, buildPluginStatusReport, createNextclawBuiltinChannelPlugin, createPluginRegisterRuntime, createPluginRuntime, disablePluginInConfig, discoverOpenClawPlugins, emptyPluginConfigSchema, enablePluginInConfig, getPackageManifestMetadata, getPluginChannelBindings, getPluginUiMetadataFromRegistry, installPluginFromArchive, installPluginFromDir, installPluginFromFile, installPluginFromNpmSpec, installPluginFromPath, loadOpenClawPlugins, loadPluginManifest, loadPluginManifestRegistry, loadPluginUiMetadata, mergePluginConfigView, normalizeAccountId, normalizePluginHttpPath, normalizePluginsConfig, recordPluginInstall, registerPluginWithApi, removePluginFromConfig, resolveEnableState, resolvePluginChannelMessageToolHints, resolvePluginInstallDir, resolvePluginManifestPath, resolveUninstallDirectoryTarget, resolveUninstallDirectoryTargets, setPluginRuntimeBridge, sleep, startPluginChannelGateways, stopPluginChannelGateways, toPluginConfigView, toPluginUiMetadata, uninstallPlugin, validateJsonSchemaValue };
package/dist/index.js CHANGED
@@ -241,6 +241,58 @@ function getPluginUiMetadataFromRegistry(registry) {
241
241
  configUiHints: plugin.configUiHints
242
242
  }));
243
243
  }
244
+ function cloneConfig(value) {
245
+ return JSON.parse(JSON.stringify(value));
246
+ }
247
+ function resolveProjectedPluginChannelEnabled(params) {
248
+ const channelEnabled = typeof params.channelConfig?.enabled === "boolean" ? params.channelConfig.enabled : false;
249
+ return params.entryEnabled !== false && channelEnabled;
250
+ }
251
+ function toPluginConfigView(config, bindings) {
252
+ const view = cloneConfig(config);
253
+ const channels = view.channels && typeof view.channels === "object" && !Array.isArray(view.channels) ? { ...view.channels } : {};
254
+ for (const binding of bindings) {
255
+ const pluginEntry = config.plugins.entries?.[binding.pluginId];
256
+ const pluginConfig = pluginEntry?.config;
257
+ const normalizedChannelConfig = pluginConfig && typeof pluginConfig === "object" && !Array.isArray(pluginConfig) ? cloneConfig(pluginConfig) : {};
258
+ channels[binding.channelId] = {
259
+ ...normalizedChannelConfig,
260
+ enabled: resolveProjectedPluginChannelEnabled({
261
+ entryEnabled: pluginEntry?.enabled,
262
+ channelConfig: normalizedChannelConfig
263
+ })
264
+ };
265
+ }
266
+ view.channels = channels;
267
+ return view;
268
+ }
269
+ function mergePluginConfigView(baseConfig, pluginViewConfig, bindings) {
270
+ const next = cloneConfig(baseConfig);
271
+ const pluginChannels = pluginViewConfig.channels && typeof pluginViewConfig.channels === "object" && !Array.isArray(pluginViewConfig.channels) ? pluginViewConfig.channels : {};
272
+ const entries = { ...next.plugins.entries ?? {} };
273
+ for (const binding of bindings) {
274
+ if (!Object.prototype.hasOwnProperty.call(pluginChannels, binding.channelId)) {
275
+ continue;
276
+ }
277
+ const channelConfig = pluginChannels[binding.channelId];
278
+ if (!channelConfig || typeof channelConfig !== "object" || Array.isArray(channelConfig)) {
279
+ continue;
280
+ }
281
+ const normalizedChannelConfig = cloneConfig(channelConfig);
282
+ const projectedEnabled = typeof normalizedChannelConfig.enabled === "boolean" ? normalizedChannelConfig.enabled : void 0;
283
+ const currentEntry = entries[binding.pluginId] ?? {};
284
+ entries[binding.pluginId] = {
285
+ ...currentEntry,
286
+ ...projectedEnabled === true ? { enabled: true } : {},
287
+ config: normalizedChannelConfig
288
+ };
289
+ }
290
+ next.plugins = {
291
+ ...next.plugins,
292
+ entries
293
+ };
294
+ return next;
295
+ }
244
296
  async function startPluginChannelGateways(params) {
245
297
  const logger = params.logger;
246
298
  const diagnostics = [];
@@ -2520,6 +2572,7 @@ export {
2520
2572
  loadPluginManifest,
2521
2573
  loadPluginManifestRegistry,
2522
2574
  loadPluginUiMetadata,
2575
+ mergePluginConfigView,
2523
2576
  normalizeAccountId,
2524
2577
  normalizePluginHttpPath,
2525
2578
  normalizePluginsConfig,
@@ -2536,6 +2589,7 @@ export {
2536
2589
  sleep,
2537
2590
  startPluginChannelGateways,
2538
2591
  stopPluginChannelGateways,
2592
+ toPluginConfigView,
2539
2593
  toPluginUiMetadata,
2540
2594
  uninstallPlugin,
2541
2595
  validateJsonSchemaValue
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextclaw/openclaw-compat",
3
- "version": "0.3.13",
3
+ "version": "0.3.15",
4
4
  "private": false,
5
5
  "description": "OpenClaw plugin compatibility layer for NextClaw.",
6
6
  "type": "module",
@@ -14,26 +14,33 @@
14
14
  "files": [
15
15
  "dist"
16
16
  ],
17
+ "scripts": {
18
+ "build": "tsup src/index.ts --format esm --dts --out-dir dist",
19
+ "prepack": "pnpm run build",
20
+ "lint": "eslint .",
21
+ "tsc": "tsc -p tsconfig.json",
22
+ "test": "vitest"
23
+ },
17
24
  "dependencies": {
25
+ "@nextclaw/channel-plugin-dingtalk": "workspace:*",
26
+ "@nextclaw/channel-plugin-discord": "workspace:*",
27
+ "@nextclaw/channel-plugin-email": "workspace:*",
28
+ "@nextclaw/channel-plugin-feishu": "workspace:*",
29
+ "@nextclaw/channel-plugin-mochat": "workspace:*",
30
+ "@nextclaw/channel-plugin-qq": "workspace:*",
31
+ "@nextclaw/channel-plugin-slack": "workspace:*",
32
+ "@nextclaw/channel-plugin-telegram": "workspace:*",
33
+ "@nextclaw/channel-plugin-weixin": "workspace:*",
34
+ "@nextclaw/channel-plugin-wecom": "workspace:*",
35
+ "@nextclaw/channel-plugin-whatsapp": "workspace:*",
36
+ "@nextclaw/channel-runtime": "workspace:*",
37
+ "@nextclaw/core": "workspace:*",
38
+ "@nextclaw/ncp": "workspace:*",
39
+ "@nextclaw/ncp-toolkit": "workspace:*",
18
40
  "ajv": "^8.17.1",
19
41
  "jiti": "^1.21.7",
20
42
  "jszip": "^3.10.1",
21
- "tar": "^7.4.3",
22
- "@nextclaw/channel-plugin-feishu": "0.2.10",
23
- "@nextclaw/channel-plugin-discord": "0.2.10",
24
- "@nextclaw/channel-plugin-email": "0.2.10",
25
- "@nextclaw/channel-plugin-dingtalk": "0.2.10",
26
- "@nextclaw/channel-plugin-slack": "0.2.10",
27
- "@nextclaw/channel-plugin-qq": "0.2.10",
28
- "@nextclaw/channel-plugin-weixin": "0.1.2",
29
- "@nextclaw/channel-runtime": "0.2.10",
30
- "@nextclaw/channel-plugin-mochat": "0.2.10",
31
- "@nextclaw/core": "0.9.10",
32
- "@nextclaw/ncp-toolkit": "0.4.1",
33
- "@nextclaw/ncp": "0.3.1",
34
- "@nextclaw/channel-plugin-telegram": "0.2.10",
35
- "@nextclaw/channel-plugin-wecom": "0.2.10",
36
- "@nextclaw/channel-plugin-whatsapp": "0.2.10"
43
+ "tar": "^7.4.3"
37
44
  },
38
45
  "devDependencies": {
39
46
  "@types/node": "^20.17.6",
@@ -42,11 +49,5 @@
42
49
  "tsx": "^4.19.2",
43
50
  "typescript": "^5.6.3",
44
51
  "vitest": "^2.1.2"
45
- },
46
- "scripts": {
47
- "build": "tsup src/index.ts --format esm --dts --out-dir dist",
48
- "lint": "eslint .",
49
- "tsc": "tsc -p tsconfig.json",
50
- "test": "vitest"
51
52
  }
52
- }
53
+ }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 NextClaw contributors
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.