ddchat 0.1.0 → 0.2.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.
- package/CLAUDE.md +51 -0
- package/OPTIMIZATION.md +105 -0
- package/README.md +14 -14
- package/index.ts +13 -13
- package/openclaw.plugin.json +15 -15
- package/package.json +36 -36
- package/setup-entry.ts +4 -4
- package/src/channel.ts +101 -101
- package/src/constants.ts +5 -5
- package/src/dedupe.ts +31 -31
- package/src/gateway.ts +237 -237
- package/src/inbound.ts +394 -379
- package/src/outbound.ts +183 -95
- package/src/pairing.ts +9 -9
- package/src/runtime.ts +27 -24
- package/src/session.ts +19 -19
- package/src/types.ts +126 -126
- package/task/BLOCKERS.md +3 -3
- package/task/DOING.md +3 -3
- package/task/DONE.md +8 -8
- package/task/README.md +17 -17
- package/task/TODO.md +10 -10
- package/test/README.md +48 -48
- package/test/chat.html +304 -304
- package/test/server.mjs +143 -143
package/task/DONE.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
# DONE
|
|
2
|
-
|
|
3
|
-
- [x] Created `ddchat/task` workflow files (`README/TODO/DOING/DONE/BLOCKERS`)
|
|
4
|
-
- Date: 2026-04-01
|
|
5
|
-
- Verification: files exist under `ddchat/task/`
|
|
6
|
-
- [x] Initialized DDChat plugin skeleton and websocket-first runtime scaffold
|
|
7
|
-
- Date: 2026-04-01
|
|
8
|
-
- Verification: `ddchat/package.json`, `ddchat/openclaw.plugin.json`, and `ddchat/src/*` core files created
|
|
1
|
+
# DONE
|
|
2
|
+
|
|
3
|
+
- [x] Created `ddchat/task` workflow files (`README/TODO/DOING/DONE/BLOCKERS`)
|
|
4
|
+
- Date: 2026-04-01
|
|
5
|
+
- Verification: files exist under `ddchat/task/`
|
|
6
|
+
- [x] Initialized DDChat plugin skeleton and websocket-first runtime scaffold
|
|
7
|
+
- Date: 2026-04-01
|
|
8
|
+
- Verification: `ddchat/package.json`, `ddchat/openclaw.plugin.json`, and `ddchat/src/*` core files created
|
package/task/README.md
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
# DDChat Task Records
|
|
2
|
-
|
|
3
|
-
This directory tracks development progress for the `ddchat` plugin.
|
|
4
|
-
|
|
5
|
-
## Files
|
|
6
|
-
|
|
7
|
-
- `TODO.md`: all pending tasks
|
|
8
|
-
- `DOING.md`: the single task currently in progress
|
|
9
|
-
- `DONE.md`: completed tasks with verification notes
|
|
10
|
-
- `BLOCKERS.md`: blockers, decisions, and risks
|
|
11
|
-
|
|
12
|
-
## Workflow
|
|
13
|
-
|
|
14
|
-
1. Move one item from `TODO.md` to `DOING.md` before coding.
|
|
15
|
-
2. When finished, move it to `DONE.md` with date and verification notes.
|
|
16
|
-
3. If blocked, add details to `BLOCKERS.md` and stop starting new work.
|
|
17
|
-
4. Keep `DOING.md` to one active task only.
|
|
1
|
+
# DDChat Task Records
|
|
2
|
+
|
|
3
|
+
This directory tracks development progress for the `ddchat` plugin.
|
|
4
|
+
|
|
5
|
+
## Files
|
|
6
|
+
|
|
7
|
+
- `TODO.md`: all pending tasks
|
|
8
|
+
- `DOING.md`: the single task currently in progress
|
|
9
|
+
- `DONE.md`: completed tasks with verification notes
|
|
10
|
+
- `BLOCKERS.md`: blockers, decisions, and risks
|
|
11
|
+
|
|
12
|
+
## Workflow
|
|
13
|
+
|
|
14
|
+
1. Move one item from `TODO.md` to `DOING.md` before coding.
|
|
15
|
+
2. When finished, move it to `DONE.md` with date and verification notes.
|
|
16
|
+
3. If blocked, add details to `BLOCKERS.md` and stop starting new work.
|
|
17
|
+
4. Keep `DOING.md` to one active task only.
|
package/task/TODO.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# TODO
|
|
2
|
-
|
|
3
|
-
- [ ] Finalize plugin skeleton (`package.json`, `openclaw.plugin.json`, `index.ts`, `setup-entry.ts`)
|
|
4
|
-
- [ ] Implement Feishu-style multi-account config (`channels.ddchat.accounts.*`)
|
|
5
|
-
- [ ] Implement websocket inbound loop (webhook reserved only)
|
|
6
|
-
- [ ] Implement inbound routing for `group` (groupId) and `direct` (userId)
|
|
7
|
-
- [ ] Implement inbound text + file/image handling (base64/url -> saveMediaBuffer)
|
|
8
|
-
- [ ] Implement chunk-level streaming push; keep token-level mode as reserved option
|
|
9
|
-
- [ ] Add compatibility notes for future plugin rename
|
|
10
|
-
- [ ] Add minimal tests for route/media parsing and duplicate suppression
|
|
1
|
+
# TODO
|
|
2
|
+
|
|
3
|
+
- [ ] Finalize plugin skeleton (`package.json`, `openclaw.plugin.json`, `index.ts`, `setup-entry.ts`)
|
|
4
|
+
- [ ] Implement Feishu-style multi-account config (`channels.ddchat.accounts.*`)
|
|
5
|
+
- [ ] Implement websocket inbound loop (webhook reserved only)
|
|
6
|
+
- [ ] Implement inbound routing for `group` (groupId) and `direct` (userId)
|
|
7
|
+
- [ ] Implement inbound text + file/image handling (base64/url -> saveMediaBuffer)
|
|
8
|
+
- [ ] Implement chunk-level streaming push; keep token-level mode as reserved option
|
|
9
|
+
- [ ] Add compatibility notes for future plugin rename
|
|
10
|
+
- [ ] Add minimal tests for route/media parsing and duplicate suppression
|
package/test/README.md
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
# DDChat Local Mock IM
|
|
2
|
-
|
|
3
|
-
Local WebSocket IM simulator for testing the `ddchat` plugin.
|
|
4
|
-
|
|
5
|
-
## Start
|
|
6
|
-
|
|
7
|
-
From repo root:
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
node ddchat/test/server.mjs
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
Then open:
|
|
14
|
-
|
|
15
|
-
- UI: `http://127.0.0.1:9020`
|
|
16
|
-
- WS endpoint for plugin: `ws://127.0.0.1:9001` (override plugin `constants.ts` for local dev, or run against your mock URL)
|
|
17
|
-
|
|
18
|
-
## Plugin config example
|
|
19
|
-
|
|
20
|
-
```json
|
|
21
|
-
{
|
|
22
|
-
"channels": {
|
|
23
|
-
"ddchat": {
|
|
24
|
-
"defaultAccount": "xkx",
|
|
25
|
-
"accounts": {
|
|
26
|
-
"xkx": {
|
|
27
|
-
"enabled": true,
|
|
28
|
-
"token": "your-plugin-token",
|
|
29
|
-
"connectionMode": "websocket",
|
|
30
|
-
"wsUrl": "ws://127.0.0.1:9001",
|
|
31
|
-
"dmPolicy": "open",
|
|
32
|
-
"groupPolicy": "open",
|
|
33
|
-
"requireMention": false,
|
|
34
|
-
"streaming": true,
|
|
35
|
-
"streamingMode": "chunk"
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
## Features
|
|
44
|
-
|
|
45
|
-
- Send direct/group inbound message payloads.
|
|
46
|
-
- Upload files/images from browser (sent as base64 in `files[]`).
|
|
47
|
-
- Optional URL-based file input.
|
|
48
|
-
- View stream chunks (`stream_chunk`) and final outbound messages.
|
|
1
|
+
# DDChat Local Mock IM
|
|
2
|
+
|
|
3
|
+
Local WebSocket IM simulator for testing the `ddchat` plugin.
|
|
4
|
+
|
|
5
|
+
## Start
|
|
6
|
+
|
|
7
|
+
From repo root:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
node ddchat/test/server.mjs
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Then open:
|
|
14
|
+
|
|
15
|
+
- UI: `http://127.0.0.1:9020`
|
|
16
|
+
- WS endpoint for plugin: `ws://127.0.0.1:9001` (override plugin `constants.ts` for local dev, or run against your mock URL)
|
|
17
|
+
|
|
18
|
+
## Plugin config example
|
|
19
|
+
|
|
20
|
+
```json
|
|
21
|
+
{
|
|
22
|
+
"channels": {
|
|
23
|
+
"ddchat": {
|
|
24
|
+
"defaultAccount": "xkx",
|
|
25
|
+
"accounts": {
|
|
26
|
+
"xkx": {
|
|
27
|
+
"enabled": true,
|
|
28
|
+
"token": "your-plugin-token",
|
|
29
|
+
"connectionMode": "websocket",
|
|
30
|
+
"wsUrl": "ws://127.0.0.1:9001",
|
|
31
|
+
"dmPolicy": "open",
|
|
32
|
+
"groupPolicy": "open",
|
|
33
|
+
"requireMention": false,
|
|
34
|
+
"streaming": true,
|
|
35
|
+
"streamingMode": "chunk"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Features
|
|
44
|
+
|
|
45
|
+
- Send direct/group inbound message payloads.
|
|
46
|
+
- Upload files/images from browser (sent as base64 in `files[]`).
|
|
47
|
+
- Optional URL-based file input.
|
|
48
|
+
- View stream chunks (`stream_chunk`) and final outbound messages.
|