@coolclaw/coolclaw 0.3.4 → 0.4.0
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.
|
@@ -910,6 +910,7 @@ var CoolclawWsClient = class {
|
|
|
910
910
|
constructor(options) {
|
|
911
911
|
this.options = options;
|
|
912
912
|
}
|
|
913
|
+
options;
|
|
913
914
|
socket;
|
|
914
915
|
heartbeatTimer;
|
|
915
916
|
reconnectTimer;
|
|
@@ -1399,6 +1400,21 @@ var coolclawChannelPlugin = createChatChannelPlugin({
|
|
|
1399
1400
|
}
|
|
1400
1401
|
const agentHint = envelope.metadata?.agentHint;
|
|
1401
1402
|
const bodyForAgent = agentHint ? envelope.text + agentHint : envelope.text;
|
|
1403
|
+
if (typeof runtime.channel.reply?.finalizeInboundContext !== "function") {
|
|
1404
|
+
throw new Error(
|
|
1405
|
+
"CoolClaw requires runtime.channel.reply.finalizeInboundContext. Please upgrade OpenClaw to >=2026.3.22."
|
|
1406
|
+
);
|
|
1407
|
+
}
|
|
1408
|
+
if (typeof runtime.channel.reply?.dispatchReplyWithBufferedBlockDispatcher !== "function") {
|
|
1409
|
+
throw new Error(
|
|
1410
|
+
"CoolClaw requires runtime.channel.reply.dispatchReplyWithBufferedBlockDispatcher. Please upgrade OpenClaw to >=2026.3.22."
|
|
1411
|
+
);
|
|
1412
|
+
}
|
|
1413
|
+
if (typeof runtime.channel.session?.recordInboundSession !== "function") {
|
|
1414
|
+
throw new Error(
|
|
1415
|
+
"CoolClaw requires runtime.channel.session.recordInboundSession. Please upgrade OpenClaw to >=2026.3.22."
|
|
1416
|
+
);
|
|
1417
|
+
}
|
|
1402
1418
|
const ctxPayload = runtime.channel.reply.finalizeInboundContext({
|
|
1403
1419
|
Body: envelope.text,
|
|
1404
1420
|
BodyForAgent: bodyForAgent,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
coolclawChannelPlugin,
|
|
3
3
|
setCoolclawRuntime
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-IPHJPPD4.js";
|
|
5
5
|
import {
|
|
6
6
|
runCoolclawSetup
|
|
7
7
|
} from "./chunk-A54AF634.js";
|
|
@@ -62,29 +62,41 @@ function splitCsv(value) {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
// src/compat.ts
|
|
65
|
-
var SUPPORTED_HOST_MIN = "2026.
|
|
65
|
+
var SUPPORTED_HOST_MIN = "2026.3.22";
|
|
66
|
+
var MAX_TESTED_VERSION = "2026.5.7";
|
|
67
|
+
function parseVersion(v) {
|
|
68
|
+
const clean = v.split("-")[0].replace(/\s*\(.*\)/, "").trim();
|
|
69
|
+
const [y, m, d] = clean.split(".").map(Number);
|
|
70
|
+
return [y || 0, m || 0, d || 0];
|
|
71
|
+
}
|
|
72
|
+
function cmp(a, b) {
|
|
73
|
+
const [ay, am, ad] = parseVersion(a);
|
|
74
|
+
const [by, bm, bd] = parseVersion(b);
|
|
75
|
+
if (ay !== by) return ay > by ? 1 : -1;
|
|
76
|
+
if (am !== bm) return am > bm ? 1 : -1;
|
|
77
|
+
if (ad !== bd) return ad > bd ? 1 : -1;
|
|
78
|
+
return 0;
|
|
79
|
+
}
|
|
66
80
|
function assertHostCompatibility(hostVersion) {
|
|
67
81
|
if (!hostVersion || hostVersion === "unknown") return;
|
|
68
|
-
if (
|
|
82
|
+
if (cmp(hostVersion, SUPPORTED_HOST_MIN) >= 0) return;
|
|
69
83
|
throw new Error(
|
|
70
84
|
`This version of @coolclaw/coolclaw requires OpenClaw >=${SUPPORTED_HOST_MIN}, but found ${hostVersion}. Please upgrade OpenClaw:
|
|
71
85
|
npm install -g openclaw@latest
|
|
72
86
|
Then reinstall the plugin:
|
|
73
87
|
openclaw plugins install @coolclaw/coolclaw
|
|
74
88
|
|
|
75
|
-
Or use the one-command installer
|
|
89
|
+
Or use the one-command installer:
|
|
76
90
|
npx @coolclaw/coolclaw-cli install`
|
|
77
91
|
);
|
|
78
92
|
}
|
|
79
|
-
function
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
if (host[i] < min[i]) return false;
|
|
93
|
+
function advisoryHostCompatibility(hostVersion) {
|
|
94
|
+
if (!hostVersion || hostVersion === "unknown") return;
|
|
95
|
+
if (cmp(hostVersion, MAX_TESTED_VERSION) > 0) {
|
|
96
|
+
console.warn(
|
|
97
|
+
`[coolclaw] Host version ${hostVersion} is newer than the latest tested version (${MAX_TESTED_VERSION}). Proceeding without version gate; please report incompatibilities.`
|
|
98
|
+
);
|
|
86
99
|
}
|
|
87
|
-
return true;
|
|
88
100
|
}
|
|
89
101
|
|
|
90
102
|
// index.ts
|
|
@@ -112,6 +124,7 @@ var entry = defineChannelPluginEntry({
|
|
|
112
124
|
},
|
|
113
125
|
registerFull(api) {
|
|
114
126
|
assertHostCompatibility(api.runtime?.version);
|
|
127
|
+
advisoryHostCompatibility(api.runtime?.version);
|
|
115
128
|
setCoolclawRuntime(api.runtime);
|
|
116
129
|
}
|
|
117
130
|
});
|
package/dist/cli-metadata.js
CHANGED
package/dist/index.js
CHANGED
package/dist/setup-entry.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coolclaw/coolclaw",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "OpenClaw native channel plugin for Riddle/CoolClaw chat.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"vitest": "latest"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"openclaw": ">=2026.
|
|
44
|
+
"openclaw": ">=2026.3.22 <2027"
|
|
45
45
|
},
|
|
46
46
|
"peerDependenciesMeta": {
|
|
47
47
|
"openclaw": {
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"npmSpec": "@coolclaw/coolclaw",
|
|
62
62
|
"expectedIntegrity": "sha512-jZn9gMqpzKzbqQBz7GMFkTUdqUBtV1SZRYnYKP9eV/75xbx1RkoCADvhLF5LviH3JWsYd3jzZEV/6fy1H5FNTw==",
|
|
63
63
|
"defaultChoice": "npm",
|
|
64
|
-
"minHostVersion": ">=2026.
|
|
64
|
+
"minHostVersion": ">=2026.3.22"
|
|
65
65
|
},
|
|
66
66
|
"channel": {
|
|
67
67
|
"id": "coolclaw",
|
|
@@ -76,13 +76,15 @@
|
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
78
|
"compat": {
|
|
79
|
-
"pluginApi": ">=2026.
|
|
80
|
-
"minGatewayVersion": "2026.
|
|
81
|
-
"sdkImports": [
|
|
79
|
+
"pluginApi": ">=2026.3.22",
|
|
80
|
+
"minGatewayVersion": "2026.3.22",
|
|
81
|
+
"sdkImports": [
|
|
82
|
+
"openclaw/plugin-sdk/core"
|
|
83
|
+
]
|
|
82
84
|
},
|
|
83
85
|
"build": {
|
|
84
|
-
"openclawVersion": "2026.5.
|
|
86
|
+
"openclawVersion": "2026.5.7",
|
|
85
87
|
"pluginSdkVersion": "2026.4.29"
|
|
86
88
|
}
|
|
87
89
|
}
|
|
88
|
-
}
|
|
90
|
+
}
|