port42-openclaw 0.3.2 → 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.
@@ -0,0 +1,265 @@
1
+ # port42-openclaw v0.4.0 Implementation Plan
2
+
3
+ ## Problem
4
+
5
+ The current plugin doesn't conform to OpenClaw's channel adapter API. It uses a custom `PluginAPI` interface with `registerChannel(name, handler)` when OpenClaw expects `api.registerChannel({ plugin: channelObject })` with a structured channel descriptor. This causes:
6
+
7
+ - `unknown channel id: port42` — OpenClaw doesn't know port42 is a valid channel
8
+ - `plugin not found: port42-openclaw` — manifest missing `configSchema`, plugin can't load
9
+
10
+ ## Key Findings from OpenClaw Docs
11
+
12
+ 1. **Inbound messages** are handled via `gateway.registerHandlers` and `gateway.handleIncomingMessage` on the `ChannelGatewayAdapter`. The gateway context provides runtime helpers for routing messages to agents.
13
+ 2. **Lifecycle** is managed by the gateway adapter. OpenClaw calls `registerHandlers` on startup, which is where we open the WebSocket connection.
14
+ 3. **CLI**: Plugins register top-level commands via `api.registerCli()` using commander.js. We can't add flags to `channels add`, but we can register our own `port42` command (e.g. `openclaw port42 join --invite "..."`).
15
+ 4. **Package.json** should use `"openclaw": { "plugin": "./openclaw.plugin.json" }` (not `"extensions"`). The extensions array format is for bundled multi-extension packs.
16
+
17
+ ## Files Changed
18
+
19
+ ### 1. `src/index.ts` — Complete rewrite
20
+
21
+ Replace the current named `register()` export with a `default` export function that registers a proper `ChannelPlugin` object.
22
+
23
+ **Channel descriptor shape:**
24
+
25
+ ```ts
26
+ const port42Channel = {
27
+ id: "port42",
28
+ meta: {
29
+ id: "port42",
30
+ label: "Port42",
31
+ selectionLabel: "Port42 (Companion Computing)",
32
+ docsPath: "/channels/port42",
33
+ blurb: "Bring agents into Port42 companion computing channels.",
34
+ aliases: ["p42"],
35
+ },
36
+ capabilities: { chatTypes: ["direct", "group"] },
37
+ config: { listAccountIds, resolveAccount, isConfigured, describeAccount },
38
+ outbound: { deliveryMode: "direct", textChunkLimit: 4096, sendText },
39
+ gateway: { registerHandlers, handleIncomingMessage },
40
+ };
41
+ ```
42
+
43
+ **Config adapter** reads from `cfg.channels.port42.accounts.*`:
44
+
45
+ ```ts
46
+ config: {
47
+ listAccountIds: (cfg) => Object.keys(cfg.channels?.port42?.accounts ?? {}),
48
+ resolveAccount: (cfg, accountId) => {
49
+ const section = cfg.channels?.port42?.accounts?.[accountId ?? "default"];
50
+ return {
51
+ accountId: accountId ?? "default",
52
+ invite: section?.invite,
53
+ gateway: section?.gateway,
54
+ channelId: section?.channelId,
55
+ encryptionKey: section?.encryptionKey,
56
+ token: section?.token,
57
+ displayName: section?.displayName ?? "Port42 Agent",
58
+ trigger: section?.trigger ?? "mention",
59
+ enabled: section?.enabled ?? true,
60
+ };
61
+ },
62
+ isConfigured: (account) => Boolean(account.invite || (account.gateway && account.channelId)),
63
+ describeAccount: (account) => ({
64
+ accountId: account.accountId,
65
+ name: account.displayName,
66
+ enabled: account.enabled ?? true,
67
+ configured: Boolean(account.invite || (account.gateway && account.channelId)),
68
+ }),
69
+ },
70
+ ```
71
+
72
+ **Outbound adapter** sends messages through cached `Port42Connection` instances:
73
+
74
+ ```ts
75
+ outbound: {
76
+ deliveryMode: "direct",
77
+ textChunkLimit: 4096,
78
+ sendText: async (ctx) => {
79
+ const account = port42Channel.config.resolveAccount(ctx.cfg, ctx.accountId);
80
+ const conn = connections.get(account.accountId);
81
+ if (!conn) return { ok: false, error: new Error("Not connected") };
82
+ conn.sendResponse(ctx.text);
83
+ return { ok: true, timestamp: Date.now() };
84
+ },
85
+ },
86
+ ```
87
+
88
+ **Gateway adapter** connects all configured accounts on startup and routes inbound messages:
89
+
90
+ ```ts
91
+ gateway: {
92
+ registerHandlers: (ctx) => {
93
+ const accountIds = port42Channel.config.listAccountIds(ctx.cfg);
94
+ for (const id of accountIds) {
95
+ const account = port42Channel.config.resolveAccount(ctx.cfg, id);
96
+ if (!account.enabled || !port42Channel.config.isConfigured(account)) continue;
97
+
98
+ const conn = connectAccount(account, (senderName, content, messageId) => {
99
+ ctx.handleIncomingMessage?.({
100
+ channelId: "port42",
101
+ accountId: id,
102
+ senderId: `port42:${senderName}`,
103
+ senderName,
104
+ content,
105
+ messageId,
106
+ chatType: "group",
107
+ });
108
+ });
109
+ connections.set(id, conn);
110
+ }
111
+ },
112
+ handleIncomingMessage: async () => {
113
+ // Handled via registerHandlers callback
114
+ },
115
+ },
116
+ ```
117
+
118
+ **CLI command** for joining channels from the command line:
119
+
120
+ ```ts
121
+ api.registerCli(
122
+ ({ program }) => {
123
+ const p42 = program.command("port42").description("Port42 companion computing");
124
+ p42.command("join")
125
+ .description("Join a Port42 channel with an invite link")
126
+ .requiredOption("--invite <url>", "Port42 invite link")
127
+ .option("--name <name>", "Display name for your agent", "OpenClaw Agent")
128
+ .option("--account <id>", "Account identifier", "default")
129
+ .option("--trigger <mode>", "Respond to 'mention' or 'all'", "mention")
130
+ .action(async (opts) => {
131
+ console.log(`Adding Port42 channel account "${opts.account}"...`);
132
+ console.log(`\nAdd this to your openclaw.json under channels.port42.accounts.${opts.account}:`);
133
+ console.log(JSON.stringify({
134
+ invite: opts.invite,
135
+ displayName: opts.name,
136
+ trigger: opts.trigger,
137
+ }, null, 2));
138
+ });
139
+ },
140
+ { commands: ["port42"] },
141
+ );
142
+ ```
143
+
144
+ ### 2. `openclaw.plugin.json` — Rewrite
145
+
146
+ Add required `configSchema` (JSON Schema) and `channels` declaration:
147
+
148
+ ```json
149
+ {
150
+ "id": "port42-openclaw",
151
+ "name": "Port42",
152
+ "description": "Bring your OpenClaw agents into Port42 companion computing channels.",
153
+ "channels": ["port42"],
154
+ "configSchema": {
155
+ "type": "object",
156
+ "additionalProperties": false,
157
+ "properties": {
158
+ "accounts": {
159
+ "type": "object",
160
+ "additionalProperties": {
161
+ "type": "object",
162
+ "additionalProperties": false,
163
+ "properties": {
164
+ "invite": { "type": "string", "description": "Port42 HTTPS invite link" },
165
+ "gateway": { "type": "string", "description": "WebSocket URL" },
166
+ "channelId": { "type": "string", "description": "Channel UUID" },
167
+ "encryptionKey": { "type": "string", "description": "Base64 AES-256 key" },
168
+ "token": { "type": "string", "description": "Gateway auth token" },
169
+ "displayName": { "type": "string", "description": "Agent display name in Port42" },
170
+ "trigger": { "type": "string", "enum": ["mention", "all"], "default": "mention" },
171
+ "enabled": { "type": "boolean", "default": true }
172
+ },
173
+ "required": ["displayName"]
174
+ }
175
+ }
176
+ }
177
+ },
178
+ "uiHints": {
179
+ "accounts.*.invite": { "label": "Invite Link", "help": "Paste a Port42 channel invite link" },
180
+ "accounts.*.encryptionKey": { "sensitive": true },
181
+ "accounts.*.token": { "sensitive": true }
182
+ }
183
+ }
184
+ ```
185
+
186
+ ### 3. `package.json` — Two changes
187
+
188
+ ```diff
189
+ - "version": "0.3.2"
190
+ + "version": "0.4.0"
191
+
192
+ - "openclaw": { "extensions": ["./dist/index.js"] }
193
+ + "openclaw": { "plugin": "./openclaw.plugin.json" }
194
+ ```
195
+
196
+ ### 4. `.npmignore` — New file
197
+
198
+ ```
199
+ src/
200
+ tsconfig.json
201
+ .github/
202
+ ```
203
+
204
+ Prevents shipping `.ts` source files that trigger OpenClaw's validator warnings.
205
+
206
+ ## Unchanged Files
207
+
208
+ | File | Why |
209
+ |------|-----|
210
+ | `src/connection.ts` | WebSocket lifecycle, reconnection, encryption all work correctly |
211
+ | `src/protocol.ts` | Envelope types and builders match Port42 gateway protocol |
212
+ | `src/crypto.ts` | AES-256-GCM matches Port42's wire format |
213
+ | `src/invite.ts` | Invite link parsing works correctly |
214
+
215
+ ## User Experience After v0.4.0
216
+
217
+ ### Install
218
+
219
+ ```bash
220
+ openclaw plugins install port42-openclaw
221
+ ```
222
+
223
+ ### Join a channel (CLI)
224
+
225
+ ```bash
226
+ openclaw port42 join \
227
+ --invite "https://host.ngrok-free.dev/invite?id=UUID&name=ch&key=KEY&token=TOKEN" \
228
+ --name "Researcher"
229
+ ```
230
+
231
+ ### Or edit openclaw.json directly
232
+
233
+ ```json
234
+ {
235
+ "channels": {
236
+ "port42": {
237
+ "accounts": {
238
+ "default": {
239
+ "invite": "https://host.ngrok-free.dev/invite?id=UUID&name=ch&key=KEY&token=TOKEN",
240
+ "displayName": "Researcher",
241
+ "trigger": "mention"
242
+ }
243
+ }
244
+ }
245
+ }
246
+ }
247
+ ```
248
+
249
+ ### Then restart the gateway
250
+
251
+ ```bash
252
+ openclaw gateway restart
253
+ ```
254
+
255
+ ## Open Risk
256
+
257
+ The `gateway.registerHandlers` context object (`ctx.handleIncomingMessage`) is based on patterns from the docs but not confirmed with an exact example for custom plugins. If the context API differs, the inbound routing may need adjustment. The outbound, CLI, and manifest parts are well documented and solid.
258
+
259
+ ## Sources
260
+
261
+ - [Channel Plugin Development Guide](https://zread.ai/openclaw/openclaw/16-channel-plugin-development)
262
+ - [Plugins - OpenClaw](https://docs.openclaw.ai/tools/plugin)
263
+ - [Plugin Manifest](https://docs.openclaw.ai/plugins/manifest)
264
+ - [Channel Message Flow](https://deepwiki.com/openclaw/openclaw/8.3-telegram-integration)
265
+ - [Channels CLI](https://docs.openclaw.ai/cli/channels)
package/README.md CHANGED
@@ -6,38 +6,76 @@ Port42 channel adapter for OpenClaw. Bring your OpenClaw agents into [Port42](ht
6
6
 
7
7
  ```bash
8
8
  openclaw plugins install port42-openclaw
9
+ openclaw gateway restart
9
10
  ```
10
11
 
11
- ## Usage
12
+ To explicitly trust the plugin (silences the auto-load warning), add to your `openclaw.json`:
13
+
14
+ ```json
15
+ {
16
+ "plugins": {
17
+ "allow": ["port42-openclaw"]
18
+ }
19
+ }
20
+ ```
21
+
22
+ ### Install from source
23
+
24
+ ```bash
25
+ git clone https://github.com/gordonmattey/port42-openclaw.git
26
+ cd port42-openclaw
27
+ npm install
28
+ npm run build
29
+ openclaw plugins install .
30
+ openclaw gateway restart
31
+ ```
12
32
 
13
- Someone shares a Port42 channel invite link with you. Add it to OpenClaw:
33
+ ### Uninstall
14
34
 
15
35
  ```bash
16
- openclaw channel add port42 \
17
- --invite "https://your-host.ngrok-free.dev/invite?id=CHANNEL-UUID&name=my-channel&key=BASE64KEY&token=GATEWAY_TOKEN" \
18
- --agent my-researcher \
19
- --name "Researcher"
36
+ openclaw plugins uninstall port42-openclaw
37
+ openclaw gateway restart
20
38
  ```
21
39
 
22
- Your agent appears in the Port42 channel. People can @mention it and it responds alongside other companions in the room.
40
+ ## Usage
23
41
 
24
- ### Manual config
42
+ Someone shares a Port42 channel invite link with you. Join from the CLI:
43
+
44
+ ```bash
45
+ openclaw port42 join --invite "INVITE_LINK" --agent my-researcher
46
+ openclaw agents bind --agent my-researcher --bind port42:my-researcher
47
+ openclaw gateway restart
48
+ ```
49
+
50
+ The agent ID is used as the display name in Port42.
25
51
 
26
52
  Or edit `openclaw.json` directly:
27
53
 
28
54
  ```json
29
55
  {
30
56
  "channels": {
31
- "port42-project": {
32
- "type": "port42",
33
- "invite": "https://your-host.ngrok-free.dev/invite?id=CHANNEL-UUID&name=my-channel&key=BASE64KEY&token=GATEWAY_TOKEN",
34
- "displayName": "Researcher",
35
- "trigger": "mention"
57
+ "port42": {
58
+ "accounts": {
59
+ "my-researcher": {
60
+ "invite": "https://your-host.ngrok-free.dev/invite?id=CHANNEL-UUID&name=my-channel&key=BASE64KEY&token=GATEWAY_TOKEN&host=gordon",
61
+ "displayName": "my-researcher",
62
+ "trigger": "mention"
63
+ }
64
+ }
36
65
  }
37
66
  }
38
67
  }
39
68
  ```
40
69
 
70
+ Then bind and restart:
71
+
72
+ ```bash
73
+ openclaw agents bind --agent my-researcher --bind port42:my-researcher
74
+ openclaw gateway restart
75
+ ```
76
+
77
+ Your agent appears in the Port42 channel. People can @mention it and it responds alongside other companions in the room.
78
+
41
79
  ### Config options
42
80
 
43
81
  | Option | Required | Default | Description |
@@ -49,6 +87,7 @@ Or edit `openclaw.json` directly:
49
87
  | `token` | no | — | Gateway auth token (parsed from invite if provided) |
50
88
  | `displayName` | yes | — | How the agent appears in Port42 |
51
89
  | `trigger` | no | `mention` | `mention` (respond to @name) or `all` (respond to everything) |
90
+ | `enabled` | no | `true` | Enable or disable this account |
52
91
 
53
92
  *Provide either `invite` or both `gateway` + `channelId`.
54
93
 
@@ -61,15 +100,6 @@ The adapter connects to a Port42 gateway as a regular peer over WebSocket. From
61
100
  - Typing indicators show when the agent is generating a response
62
101
  - Auto-reconnects if the connection drops
63
102
 
64
- ## Building from source
65
-
66
- ```bash
67
- git clone https://github.com/gordonmattey/port42-openclaw.git
68
- cd port42-openclaw
69
- npm install
70
- npm run build
71
- ```
72
-
73
103
  ## License
74
104
 
75
105
  MIT. See [LICENSE](LICENSE).
package/dev.sh ADDED
@@ -0,0 +1,16 @@
1
+ #!/bin/bash
2
+ # Build, deploy to local OpenClaw, and restart gateway
3
+ set -e
4
+
5
+ echo "Building..."
6
+ npm run build
7
+
8
+ echo "Copying to extensions..."
9
+ cp dist/* ~/.openclaw/extensions/port42-openclaw/dist/
10
+
11
+ echo "Restarting gateway..."
12
+ npx openclaw gateway restart
13
+
14
+ echo "Done. Checking logs in 3s..."
15
+ sleep 3
16
+ tail -20 ~/.openclaw/logs/gateway.log | grep -E '\[port42\]|error|Error' || echo "No port42 log lines found"
@@ -40,6 +40,7 @@ class Port42Connection {
40
40
  const payload = {
41
41
  content,
42
42
  senderName: this.config.displayName,
43
+ senderType: "agent",
43
44
  senderOwner: null,
44
45
  replyToId: null,
45
46
  };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection.js","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;AAEH,4CAA2B;AAC3B,yCAQoB;AACpB,qCAA4C;AAgB5C,MAAa,gBAAgB;IACnB,EAAE,GAAqB,IAAI,CAAC;IAC5B,MAAM,CAAmB;IACzB,cAAc,GAAG,IAAI,CAAC;IACtB,iBAAiB,GAAG,KAAK,CAAC;IAC1B,eAAe,GAAG,IAAI,CAAC;IACvB,UAAU,GAAG,KAAK,CAAC;IAE3B,YAAY,MAAwB;QA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C,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACjC,CAAC;AAED,SAAgB,OAAO,CAAC,IAAY,EAAE,SAAiB;IACrD,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QAC7C,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QAEzC,IAAI,IAAI,CAAC,MAAM,GAAG,YAAY,GAAG,UAAU,EAAE,CAAC;YAC5C,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC;QAC7C,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,CAAC;QACpD,MAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,CAAC;QAEzE,MAAM,QAAQ,GAAG,IAAA,8BAAgB,EAAC,SAAS,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;QACzD,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QAEzB,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QACjF,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IAChD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
package/dist/index.d.ts CHANGED
@@ -3,36 +3,9 @@
3
3
  *
4
4
  * Bridges OpenClaw agents into Port42 companion computing channels.
5
5
  * Users install with: openclaw plugins install port42-openclaw
6
- * Then add a channel with a Port42 invite link.
6
+ * Then join with: openclaw port42 join --invite "..."
7
7
  */
8
- export interface Port42ChannelConfig {
9
- invite?: string;
10
- gateway?: string;
11
- channelId?: string;
12
- encryptionKey?: string;
13
- token?: string;
14
- displayName: string;
15
- trigger?: 'mention' | 'all';
16
- }
17
- interface PluginAPI {
18
- registerChannel(name: string, handler: ChannelHandler): void;
19
- log: {
20
- info(msg: string): void;
21
- error(msg: string): void;
22
- debug(msg: string): void;
23
- };
24
- }
25
- interface ChannelHandler {
26
- connect(config: Port42ChannelConfig): Promise<ChannelInstance>;
27
- }
28
- interface ChannelInstance {
29
- send(content: string): Promise<void>;
30
- disconnect(): Promise<void>;
31
- }
32
- /**
33
- * OpenClaw plugin entry point.
34
- */
35
- export declare function register(api: PluginAPI): void;
8
+ export default function (api: any): void;
36
9
  export { parseInviteLink } from './invite';
37
10
  export { Port42Connection } from './connection';
38
11
  export type { ConnectionConfig } from './connection';