@nextclaw/openclaw-compat 0.2.0 → 0.2.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.
- package/dist/index.js +0 -104
- package/package.json +14 -16
package/dist/index.js
CHANGED
|
@@ -1704,10 +1704,6 @@ var BUNDLED_CHANNEL_PLUGIN_PACKAGES = [
|
|
|
1704
1704
|
"@nextclaw/channel-plugin-slack",
|
|
1705
1705
|
"@nextclaw/channel-plugin-qq"
|
|
1706
1706
|
];
|
|
1707
|
-
var BUNDLED_RUNTIME_PLUGIN_PACKAGES = [
|
|
1708
|
-
"@nextclaw/nextclaw-engine-codex-sdk",
|
|
1709
|
-
"@nextclaw/nextclaw-engine-claude-agent-sdk"
|
|
1710
|
-
];
|
|
1711
1707
|
function resolvePackageRootFromEntry(entryFile) {
|
|
1712
1708
|
let cursor = path5.dirname(entryFile);
|
|
1713
1709
|
for (let i = 0; i < 8; i += 1) {
|
|
@@ -1910,100 +1906,6 @@ function appendBundledChannelPlugins(params) {
|
|
|
1910
1906
|
params.registry.plugins.push(record);
|
|
1911
1907
|
}
|
|
1912
1908
|
}
|
|
1913
|
-
function appendBundledRuntimePlugins(params) {
|
|
1914
|
-
const require2 = createRequire(import.meta.url);
|
|
1915
|
-
for (const packageName of BUNDLED_RUNTIME_PLUGIN_PACKAGES) {
|
|
1916
|
-
let entryFile = "";
|
|
1917
|
-
let rootDir = "";
|
|
1918
|
-
try {
|
|
1919
|
-
entryFile = require2.resolve(packageName);
|
|
1920
|
-
rootDir = resolvePackageRootFromEntry(entryFile);
|
|
1921
|
-
} catch (err) {
|
|
1922
|
-
params.registry.diagnostics.push({
|
|
1923
|
-
level: "error",
|
|
1924
|
-
source: packageName,
|
|
1925
|
-
message: `bundled runtime plugin package not resolvable: ${String(err)}`
|
|
1926
|
-
});
|
|
1927
|
-
continue;
|
|
1928
|
-
}
|
|
1929
|
-
let moduleExport = null;
|
|
1930
|
-
try {
|
|
1931
|
-
moduleExport = params.jiti(entryFile);
|
|
1932
|
-
} catch (err) {
|
|
1933
|
-
params.registry.diagnostics.push({
|
|
1934
|
-
level: "error",
|
|
1935
|
-
source: entryFile,
|
|
1936
|
-
message: `failed to load bundled runtime plugin: ${String(err)}`
|
|
1937
|
-
});
|
|
1938
|
-
continue;
|
|
1939
|
-
}
|
|
1940
|
-
const resolved = resolvePluginModuleExport(moduleExport);
|
|
1941
|
-
const definition = resolved.definition;
|
|
1942
|
-
const register = resolved.register;
|
|
1943
|
-
const pluginId = typeof definition?.id === "string" ? definition.id.trim() : "";
|
|
1944
|
-
const source = entryFile;
|
|
1945
|
-
if (!pluginId) {
|
|
1946
|
-
params.registry.diagnostics.push({
|
|
1947
|
-
level: "error",
|
|
1948
|
-
source,
|
|
1949
|
-
message: "bundled runtime plugin definition missing id"
|
|
1950
|
-
});
|
|
1951
|
-
continue;
|
|
1952
|
-
}
|
|
1953
|
-
const enableState = resolveEnableState(pluginId, params.normalizedConfig);
|
|
1954
|
-
const record = createPluginRecord({
|
|
1955
|
-
id: pluginId,
|
|
1956
|
-
name: definition?.name ?? pluginId,
|
|
1957
|
-
description: definition?.description,
|
|
1958
|
-
version: definition?.version,
|
|
1959
|
-
kind: definition?.kind,
|
|
1960
|
-
source,
|
|
1961
|
-
origin: "bundled",
|
|
1962
|
-
workspaceDir: params.runtime.workspaceDir,
|
|
1963
|
-
enabled: enableState.enabled,
|
|
1964
|
-
configSchema: Boolean(definition?.configSchema),
|
|
1965
|
-
configJsonSchema: definition?.configSchema
|
|
1966
|
-
});
|
|
1967
|
-
if (!enableState.enabled) {
|
|
1968
|
-
record.status = "disabled";
|
|
1969
|
-
record.error = enableState.reason;
|
|
1970
|
-
params.registry.plugins.push(record);
|
|
1971
|
-
continue;
|
|
1972
|
-
}
|
|
1973
|
-
if (typeof register !== "function") {
|
|
1974
|
-
record.status = "error";
|
|
1975
|
-
record.error = "plugin export missing register/activate";
|
|
1976
|
-
params.registry.plugins.push(record);
|
|
1977
|
-
params.registry.diagnostics.push({
|
|
1978
|
-
level: "error",
|
|
1979
|
-
pluginId,
|
|
1980
|
-
source,
|
|
1981
|
-
message: record.error
|
|
1982
|
-
});
|
|
1983
|
-
continue;
|
|
1984
|
-
}
|
|
1985
|
-
const result = registerPluginWithApi({
|
|
1986
|
-
runtime: params.runtime,
|
|
1987
|
-
record,
|
|
1988
|
-
pluginId,
|
|
1989
|
-
source,
|
|
1990
|
-
rootDir,
|
|
1991
|
-
register,
|
|
1992
|
-
pluginConfig: void 0
|
|
1993
|
-
});
|
|
1994
|
-
if (!result.ok) {
|
|
1995
|
-
record.status = "error";
|
|
1996
|
-
record.error = result.error;
|
|
1997
|
-
params.registry.diagnostics.push({
|
|
1998
|
-
level: "error",
|
|
1999
|
-
pluginId,
|
|
2000
|
-
source,
|
|
2001
|
-
message: result.error
|
|
2002
|
-
});
|
|
2003
|
-
}
|
|
2004
|
-
params.registry.plugins.push(record);
|
|
2005
|
-
}
|
|
2006
|
-
}
|
|
2007
1909
|
function loadOpenClawPlugins(options) {
|
|
2008
1910
|
const loadExternalPlugins = process.env.NEXTCLAW_ENABLE_OPENCLAW_PLUGINS !== "0";
|
|
2009
1911
|
const logger = options.logger ?? defaultLogger2;
|
|
@@ -2049,12 +1951,6 @@ function loadOpenClawPlugins(options) {
|
|
|
2049
1951
|
jiti,
|
|
2050
1952
|
normalizedConfig: normalized
|
|
2051
1953
|
});
|
|
2052
|
-
appendBundledRuntimePlugins({
|
|
2053
|
-
registry,
|
|
2054
|
-
runtime: registerRuntime,
|
|
2055
|
-
jiti,
|
|
2056
|
-
normalizedConfig: normalized
|
|
2057
|
-
});
|
|
2058
1954
|
if (!loadExternalPlugins) {
|
|
2059
1955
|
return registry;
|
|
2060
1956
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nextclaw/openclaw-compat",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "OpenClaw plugin compatibility layer for NextClaw.",
|
|
6
6
|
"type": "module",
|
|
@@ -14,24 +14,22 @@
|
|
|
14
14
|
"dist"
|
|
15
15
|
],
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@nextclaw/channel-plugin-dingtalk": "^0.1.6",
|
|
18
|
-
"@nextclaw/channel-plugin-discord": "^0.1.7",
|
|
19
|
-
"@nextclaw/channel-plugin-email": "^0.1.6",
|
|
20
|
-
"@nextclaw/channel-plugin-feishu": "^0.1.6",
|
|
21
|
-
"@nextclaw/channel-plugin-mochat": "^0.1.6",
|
|
22
|
-
"@nextclaw/channel-plugin-qq": "^0.1.6",
|
|
23
|
-
"@nextclaw/channel-plugin-slack": "^0.1.6",
|
|
24
|
-
"@nextclaw/channel-plugin-telegram": "^0.1.6",
|
|
25
|
-
"@nextclaw/channel-plugin-wecom": "^0.1.6",
|
|
26
|
-
"@nextclaw/channel-plugin-whatsapp": "^0.1.6",
|
|
27
|
-
"@nextclaw/channel-runtime": "^0.1.29",
|
|
28
|
-
"@nextclaw/nextclaw-engine-claude-agent-sdk": "^0.2.0",
|
|
29
|
-
"@nextclaw/core": "^0.7.0",
|
|
30
|
-
"@nextclaw/nextclaw-engine-codex-sdk": "^0.2.0",
|
|
31
17
|
"ajv": "^8.17.1",
|
|
32
18
|
"jiti": "^1.21.7",
|
|
33
19
|
"jszip": "^3.10.1",
|
|
34
|
-
"tar": "^7.4.3"
|
|
20
|
+
"tar": "^7.4.3",
|
|
21
|
+
"@nextclaw/channel-plugin-discord": "0.1.8",
|
|
22
|
+
"@nextclaw/channel-plugin-feishu": "0.1.7",
|
|
23
|
+
"@nextclaw/channel-plugin-mochat": "0.1.7",
|
|
24
|
+
"@nextclaw/channel-plugin-slack": "0.1.7",
|
|
25
|
+
"@nextclaw/channel-plugin-dingtalk": "0.1.7",
|
|
26
|
+
"@nextclaw/channel-plugin-telegram": "0.1.7",
|
|
27
|
+
"@nextclaw/channel-plugin-email": "0.1.7",
|
|
28
|
+
"@nextclaw/channel-plugin-qq": "0.1.7",
|
|
29
|
+
"@nextclaw/channel-plugin-whatsapp": "0.1.7",
|
|
30
|
+
"@nextclaw/channel-runtime": "0.1.31",
|
|
31
|
+
"@nextclaw/channel-plugin-wecom": "0.1.7",
|
|
32
|
+
"@nextclaw/core": "0.7.3"
|
|
35
33
|
},
|
|
36
34
|
"devDependencies": {
|
|
37
35
|
"@types/node": "^20.17.6",
|