@clawling/clawchat-plugin-openclaw 2026.9.13-2 → 2026.9.14-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/dist/index.js +27 -2
- package/dist/src/client.js +2 -0
- package/dist/src/ws-client.js +1 -0
- package/index.ts +29 -2
- package/package.json +1 -1
- package/src/client.ts +2 -0
- package/src/protocol-types.ts +2 -0
- package/src/ws-client.ts +4 -0
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { openclawClawlingConfigSchema } from "./src/config.js";
|
|
|
5
5
|
import { registerClawChatPromptInjection, } from "./src/prompt-injection.js";
|
|
6
6
|
import { setOpenclawClawlingRuntime } from "./src/runtime.js";
|
|
7
7
|
import { registerOpenclawClawlingTools } from "./src/tools.js";
|
|
8
|
-
|
|
8
|
+
const channelEntry = defineChannelPluginEntry({
|
|
9
9
|
id: "clawchat-plugin-openclaw",
|
|
10
10
|
name: "Clawling Chat",
|
|
11
11
|
description: "Clawling Chat Protocol v2 channel plugin",
|
|
@@ -13,7 +13,6 @@ export default defineChannelPluginEntry({
|
|
|
13
13
|
configSchema: { schema: openclawClawlingConfigSchema },
|
|
14
14
|
setRuntime: setOpenclawClawlingRuntime,
|
|
15
15
|
registerFull(api) {
|
|
16
|
-
registerOpenclawClawlingCommands(api);
|
|
17
16
|
registerClawChatPromptInjection(api);
|
|
18
17
|
registerOpenclawClawlingTools(api);
|
|
19
18
|
// NOTE: the legacy-rename config migration is intentionally NOT registered
|
|
@@ -25,3 +24,29 @@ export default defineChannelPluginEntry({
|
|
|
25
24
|
// migration is wired into setup-entry.ts instead.
|
|
26
25
|
},
|
|
27
26
|
});
|
|
27
|
+
/**
|
|
28
|
+
* Chat slash commands (`/clawchat-activate`, `/clawchat-output`) are registered
|
|
29
|
+
* in EVERY registration mode except `cli-metadata`, not inside `registerFull`.
|
|
30
|
+
*
|
|
31
|
+
* The host loads the plugin more than once per process — a `full` load and,
|
|
32
|
+
* on 2026.8+ hosts, a `discovery` load bound to the gateway request scope —
|
|
33
|
+
* and it matches chat slash commands against THAT discovery registry
|
|
34
|
+
* (`resolveSelectedPluginCommandRegistry` prefers the request-scoped one).
|
|
35
|
+
* `defineChannelPluginEntry` only runs `registerFull` for `full` /
|
|
36
|
+
* `tool-discovery`, so commands registered there never reach the registry the
|
|
37
|
+
* chat path consults: the message fell through to the LLM as ordinary text.
|
|
38
|
+
* The pinned floor host has no `registerCapabilities` hook, so wrap `register`
|
|
39
|
+
* instead. Each load registers the commands once; a duplicate registration
|
|
40
|
+
* would mark the plugin as errored on the host side.
|
|
41
|
+
*/
|
|
42
|
+
export default {
|
|
43
|
+
// Newer hosts expose `configSchema` as a lazy getter; the spread evaluates it
|
|
44
|
+
// once here, which is fine because the schema is a static object.
|
|
45
|
+
...channelEntry,
|
|
46
|
+
register: (api) => {
|
|
47
|
+
channelEntry.register(api);
|
|
48
|
+
if (api.registrationMode !== "cli-metadata") {
|
|
49
|
+
registerOpenclawClawlingCommands(api);
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
};
|
package/dist/src/client.js
CHANGED
|
@@ -3,6 +3,7 @@ import os from "node:os";
|
|
|
3
3
|
import { createClawChatClient } from "./ws-client.js";
|
|
4
4
|
import { CHANNEL_ID } from "./config.js";
|
|
5
5
|
import { resolveStateDirFromEnv } from "./state-paths.js";
|
|
6
|
+
import { resolvePluginVersion } from "./plugin-report.js";
|
|
6
7
|
/**
|
|
7
8
|
* Derive this instance's `device_id` from stable, per-instance material.
|
|
8
9
|
*
|
|
@@ -35,6 +36,7 @@ export function createOpenclawClawlingClient(account, overrides = {}) {
|
|
|
35
36
|
url: account.websocketUrl,
|
|
36
37
|
token: account.token,
|
|
37
38
|
deviceId,
|
|
39
|
+
clientVersion: resolvePluginVersion(),
|
|
38
40
|
...(overrides.transport ? { transport: overrides.transport } : {}),
|
|
39
41
|
reconnect: {
|
|
40
42
|
enabled: true,
|
package/dist/src/ws-client.js
CHANGED
|
@@ -664,6 +664,7 @@ export class ClawChatClient extends EventEmitter {
|
|
|
664
664
|
token: this.opts.token,
|
|
665
665
|
nonce,
|
|
666
666
|
...(this.opts.deviceId ? { device_id: this.opts.deviceId } : {}),
|
|
667
|
+
...(this.opts.clientVersion ? { client_version: this.opts.clientVersion } : {}),
|
|
667
668
|
// Agent runtime is single-device: multi_device stays off so the server
|
|
668
669
|
// never self-fans-out this connection's own messages. notify_signals is
|
|
669
670
|
// advertised because we now handle the notify.signal frame (§9.4).
|
package/index.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { defineChannelPluginEntry } from "openclaw/plugin-sdk/channel-core";
|
|
2
|
+
import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
|
|
2
3
|
import { openclawClawlingPlugin } from "./src/channel.ts";
|
|
3
4
|
import { registerOpenclawClawlingCommands } from "./src/commands.ts";
|
|
4
5
|
import { openclawClawlingConfigSchema } from "./src/config.ts";
|
|
@@ -9,7 +10,7 @@ import {
|
|
|
9
10
|
import { setOpenclawClawlingRuntime } from "./src/runtime.ts";
|
|
10
11
|
import { registerOpenclawClawlingTools } from "./src/tools.ts";
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
const channelEntry = defineChannelPluginEntry({
|
|
13
14
|
id: "clawchat-plugin-openclaw",
|
|
14
15
|
name: "Clawling Chat",
|
|
15
16
|
description: "Clawling Chat Protocol v2 channel plugin",
|
|
@@ -17,7 +18,6 @@ export default defineChannelPluginEntry({
|
|
|
17
18
|
configSchema: { schema: openclawClawlingConfigSchema },
|
|
18
19
|
setRuntime: setOpenclawClawlingRuntime,
|
|
19
20
|
registerFull(api) {
|
|
20
|
-
registerOpenclawClawlingCommands(api);
|
|
21
21
|
registerClawChatPromptInjection(api as unknown as ClawChatPromptInjectionApi);
|
|
22
22
|
registerOpenclawClawlingTools(api);
|
|
23
23
|
// NOTE: the legacy-rename config migration is intentionally NOT registered
|
|
@@ -29,3 +29,30 @@ export default defineChannelPluginEntry({
|
|
|
29
29
|
// migration is wired into setup-entry.ts instead.
|
|
30
30
|
},
|
|
31
31
|
});
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Chat slash commands (`/clawchat-activate`, `/clawchat-output`) are registered
|
|
35
|
+
* in EVERY registration mode except `cli-metadata`, not inside `registerFull`.
|
|
36
|
+
*
|
|
37
|
+
* The host loads the plugin more than once per process — a `full` load and,
|
|
38
|
+
* on 2026.8+ hosts, a `discovery` load bound to the gateway request scope —
|
|
39
|
+
* and it matches chat slash commands against THAT discovery registry
|
|
40
|
+
* (`resolveSelectedPluginCommandRegistry` prefers the request-scoped one).
|
|
41
|
+
* `defineChannelPluginEntry` only runs `registerFull` for `full` /
|
|
42
|
+
* `tool-discovery`, so commands registered there never reach the registry the
|
|
43
|
+
* chat path consults: the message fell through to the LLM as ordinary text.
|
|
44
|
+
* The pinned floor host has no `registerCapabilities` hook, so wrap `register`
|
|
45
|
+
* instead. Each load registers the commands once; a duplicate registration
|
|
46
|
+
* would mark the plugin as errored on the host side.
|
|
47
|
+
*/
|
|
48
|
+
export default {
|
|
49
|
+
// Newer hosts expose `configSchema` as a lazy getter; the spread evaluates it
|
|
50
|
+
// once here, which is fine because the schema is a static object.
|
|
51
|
+
...channelEntry,
|
|
52
|
+
register: (api: OpenClawPluginApi) => {
|
|
53
|
+
channelEntry.register(api);
|
|
54
|
+
if (api.registrationMode !== "cli-metadata") {
|
|
55
|
+
registerOpenclawClawlingCommands(api);
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
};
|
package/package.json
CHANGED
package/src/client.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type { Envelope, Transport } from "./protocol-types.ts";
|
|
|
4
4
|
import { createClawChatClient, type ClawlingChatClient } from "./ws-client.ts";
|
|
5
5
|
import { CHANNEL_ID, type ResolvedOpenclawClawlingAccount } from "./config.ts";
|
|
6
6
|
import { resolveStateDirFromEnv } from "./state-paths.ts";
|
|
7
|
+
import { resolvePluginVersion } from "./plugin-report.ts";
|
|
7
8
|
|
|
8
9
|
export type { ChatType } from "./protocol-types.ts";
|
|
9
10
|
|
|
@@ -69,6 +70,7 @@ export function createOpenclawClawlingClient(
|
|
|
69
70
|
url: account.websocketUrl,
|
|
70
71
|
token: account.token,
|
|
71
72
|
deviceId,
|
|
73
|
+
clientVersion: resolvePluginVersion(),
|
|
72
74
|
...(overrides.transport ? { transport: overrides.transport } : {}),
|
|
73
75
|
reconnect: {
|
|
74
76
|
enabled: true,
|
package/src/protocol-types.ts
CHANGED
package/src/ws-client.ts
CHANGED
|
@@ -118,6 +118,8 @@ export interface ClawChatClientOptions {
|
|
|
118
118
|
url: string;
|
|
119
119
|
token: string;
|
|
120
120
|
deviceId?: string;
|
|
121
|
+
/** Sent as connect `client_version` (telemetry only); omitted when empty. */
|
|
122
|
+
clientVersion?: string;
|
|
121
123
|
transport?: Transport;
|
|
122
124
|
traceIdFactory?: () => string;
|
|
123
125
|
reconnect?: {
|
|
@@ -137,6 +139,7 @@ export interface NormalizedClawChatClientOptions {
|
|
|
137
139
|
url: string;
|
|
138
140
|
token: string;
|
|
139
141
|
deviceId?: string;
|
|
142
|
+
clientVersion?: string;
|
|
140
143
|
transport: Transport;
|
|
141
144
|
traceIdFactory: () => string;
|
|
142
145
|
reconnect: Required<NonNullable<ClawChatClientOptions["reconnect"]>>;
|
|
@@ -750,6 +753,7 @@ export class ClawChatClient extends EventEmitter {
|
|
|
750
753
|
token: this.opts.token,
|
|
751
754
|
nonce,
|
|
752
755
|
...(this.opts.deviceId ? { device_id: this.opts.deviceId } : {}),
|
|
756
|
+
...(this.opts.clientVersion ? { client_version: this.opts.clientVersion } : {}),
|
|
753
757
|
// Agent runtime is single-device: multi_device stays off so the server
|
|
754
758
|
// never self-fans-out this connection's own messages. notify_signals is
|
|
755
759
|
// advertised because we now handle the notify.signal frame (§9.4).
|