@mu-cabin/muc-cli 0.2.2 → 0.3.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/README.md +53 -11
- package/dist/muc.mjs +845 -83
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,11 +13,14 @@ with real devices; see [Coexistence](#coexistence) below before sending.
|
|
|
13
13
|
|
|
14
14
|
A single command (`muc`) packaging:
|
|
15
15
|
|
|
16
|
-
- **Send** — 1:1 and group text, files, images, and voice clips.
|
|
16
|
+
- **Send** — 1:1 and group text, files, images, and voice clips. Add and
|
|
17
|
+
remove emoticon reactions on existing messages.
|
|
17
18
|
- **Read** — server-side chat history, profile lookups, group lists, sticker
|
|
18
|
-
packs,
|
|
19
|
+
packs, directory search (people, departments, apps, service numbers), and
|
|
20
|
+
long-lived `listen` tail of inbound messages with sender/keyword filters.
|
|
19
21
|
- **Manage** — login / token refresh, withdraw a message, clear a session,
|
|
20
|
-
download a chat-attached file
|
|
22
|
+
download a chat-attached file, wait for a human emoticon reaction before
|
|
23
|
+
proceeding (`wait-react`).
|
|
21
24
|
- **Self-describe** — every command has a `--json` mode emitting a stable
|
|
22
25
|
envelope; `muc manifest --json` returns the full command graph + per-command
|
|
23
26
|
output JSON Schema for agent / script consumers.
|
|
@@ -186,6 +189,9 @@ MUC_ACCOUNT=WANGLULU8 MUC_PASSWORD='…' muc login
|
|
|
186
189
|
| `muc emoticons` | Sticker packages installed on your account. |
|
|
187
190
|
| `muc history --peer UID \| --team TEAM_ID \| --to-self` | Server-side chat history via the roaming-messages endpoint. Stateless: each call fetches from the server. Default window: 30 days, 50 messages newest-first. |
|
|
188
191
|
| `muc download --file-key <key> [--out <path>]` | Download a chat-attached file from the V5 file server (TCP 6101). **Read-only** — opens a fresh per-request session, no chat login, doesn't kick anyone. Pass `--mid <mid>` instead of `--file-key` plus `--peer/--team/--to-self` to look the file up via roaming history. Verifies md5 on completion. |
|
|
192
|
+
| `muc react --mid <MID> --sticker-id <id> [target]` | Add an emoticon reaction to an existing message. **Visible.** Defaults to `--to-self`; non-self chats need `--yes-not-self`. By default assumes the original message was sent by the current user; pass `--src-sender-id <UID>` (and `--src-sender-app <appkey>`) to react to someone else's message. |
|
|
193
|
+
| `muc reactions --mid <MID>` | List all emoticon reactions on a single message. Read-only. |
|
|
194
|
+
| `muc unreact --emoticon-id <id> [target]` | Revoke one of your own reactions (id from `muc react` or `muc reactions`). |
|
|
189
195
|
| `muc manifest` | Print the full command graph + per-command output JSON Schema. Pair with `--json` for agents. |
|
|
190
196
|
|
|
191
197
|
`history` flags: scope with one of `--peer UID`, `--team TEAM_ID`,
|
|
@@ -214,10 +220,18 @@ muc history --team 9009876543210000 --before 2026-04-20 --json | jq .
|
|
|
214
220
|
| `muc send-voice <file> --duration <ms> [target]` | Same as `send-file` but as `MESSAGE_CHAT_AUDIO` (subType=9). `--duration <ms>` is required (the desktop renders the bubble's clip length from this metadata, not from the file). |
|
|
215
221
|
| `muc withdraw --mid <MID> [target]` | Recall a sent message. Original gets replaced server-side with "您撤回了一条消息". Target flag must match the original message's chat. |
|
|
216
222
|
| `muc clear-session [target]` | Delete a session from your client-side history (syncs to all your devices). **Doesn't delete server-side history** — `history` still returns the messages. |
|
|
217
|
-
|
|
218
|
-
`--
|
|
219
|
-
|
|
220
|
-
|
|
223
|
+
| `muc wait-react --mid <MID> [--from-uid UID] [--sticker-id ID] [--timeout 300]` | Block until someone reacts with an emoticon to `--mid`, then exit. Useful as a "human-in-the-loop approval" gate after `muc send`. Exits with `TIMEOUT` (exit 5) if no matching reaction arrives within `--timeout` seconds. |
|
|
224
|
+
| `muc listen [--from-uid UID] [--team TEAM] [--peer UID] [--contains TEXT] [--regex …] [--at-me] [--max N]` | Long-lived TCP tap that emits one **NDJSON line per matching inbound message** (in `--json` mode each line is the standard envelope; in human mode it's a one-line summary). Supports repeatable filters (OR semantics within each kind, AND across kinds), `--at-me` to restrict to group messages where another user @-mentions you (implies excluding self), `--include-self` to include your own sends, `--include-reactions` to also surface type=3 sub=300/301 frames, `--max N` to exit after N matches. Stop with `^C`. |
|
|
225
|
+
|
|
226
|
+
`--os` resolves as **per-call `--os` → `defaultChatOs` in `~/.muc/config.json`
|
|
227
|
+
→ built-in `iOS`**. Valid values: `Windows`, `OS X`, `Mac`, `iOS`, `Android`.
|
|
228
|
+
Set the per-machine default once with `muc init --default-os <os>` (or the
|
|
229
|
+
`MUC_DEFAULT_OS` env var, or the interactive prompt during `muc init`). Useful
|
|
230
|
+
if your real device is an iPhone — flip the CLI default to `windows` so
|
|
231
|
+
chat-channel commands park on the PC slot instead of kicking your phone.
|
|
232
|
+
**`--os` / `defaultChatOs` does not provide coexistence — read the section
|
|
233
|
+
below before using any chat-channel command if you have a real device
|
|
234
|
+
logged in.**
|
|
221
235
|
|
|
222
236
|
Sending to anyone other than yourself requires the explicit `--yes-not-self`
|
|
223
237
|
flag — a guard against accidentally messaging real humans during testing.
|
|
@@ -278,7 +292,9 @@ in as `iOS` (Mobile slot).
|
|
|
278
292
|
|
|
279
293
|
The CLI defaults to `--os iOS` so it coexists with a Mac desktop. If your
|
|
280
294
|
iPhone is also signed in, both slots are taken and any TCP command will
|
|
281
|
-
kick one of them — fall back to REST-only commands
|
|
295
|
+
kick one of them — fall back to REST-only commands, or run
|
|
296
|
+
`muc init --default-os windows` to flip the per-machine default to the PC
|
|
297
|
+
slot (which kicks the desktop instead of the phone).
|
|
282
298
|
|
|
283
299
|
`tcp-ping` only does TCP connect + NEGOTIATE (no `auth/login`), so it can't
|
|
284
300
|
kick anything. Run it first to confirm the wire protocol is happy on your
|
|
@@ -351,6 +367,34 @@ $ muc emoticons
|
|
|
351
367
|
Both files share the `~/.muc/` parent (mode 700). The CLI creates them on
|
|
352
368
|
first use; you should never need to edit them by hand.
|
|
353
369
|
|
|
370
|
+
## Changelog
|
|
371
|
+
|
|
372
|
+
#### `0.3.1`
|
|
373
|
+
`2026.04.29`
|
|
374
|
+
- Add `defaultChatOs` to `~/.muc/config.json`: per-machine fallback for the chat-channel `--os` slot. Configure via `muc init --default-os <windows|osx|mac|ios|android>`, the `MUC_DEFAULT_OS` env var, or the interactive prompt during `muc init`. Resolution order: per-call `--os` → `defaultChatOs` → built-in `iOS`. Use this when your real device is on the Mobile slot (e.g. iPhone) so chat-channel commands park on PC instead of kicking your phone.
|
|
375
|
+
|
|
376
|
+
#### `0.3.0`
|
|
377
|
+
`2026.04.29`
|
|
378
|
+
- Add `muc react` / `muc unreact` / `muc reactions` to add, revoke, and list emoticon reactions on existing messages
|
|
379
|
+
- Add `muc wait-react` to block until a human reacts to a given mid; useful as a "human-in-the-loop approval" gate after `muc send`
|
|
380
|
+
- Add `muc listen`, a long-lived TCP tap with sender / chat / keyword / `--at-me` filters, one NDJSON line per match
|
|
381
|
+
- Exit code `5` now also covers `TIMEOUT` and `KICKED`
|
|
382
|
+
|
|
383
|
+
#### `0.2.2`
|
|
384
|
+
`2026.04.28`
|
|
385
|
+
- `muc send` plain-text now appends an idempotent signature tail by default; override via `--tail` / `--no-tail`, `muc init --message-tail`, or `messageTail` in `~/.muc/config.json`
|
|
386
|
+
|
|
387
|
+
#### `0.2.1`
|
|
388
|
+
`2026.04.28`
|
|
389
|
+
- Skills unified across macOS / Linux / Windows
|
|
390
|
+
- On Windows, file mode `600` is silently ignored — use NTFS ACLs on shared hosts to protect `~/.muc/`
|
|
391
|
+
|
|
392
|
+
#### `0.2.0`
|
|
393
|
+
`2026.04.27`
|
|
394
|
+
- Add `muc init`: extract `appKey` / `appId` / signing secrets out of source code, write to `~/.muc/config.json` (mode 600)
|
|
395
|
+
- Companion subcommands: `muc init --check` / `--show` / `--reset`
|
|
396
|
+
- License changed to MIT; package published to npm with public access
|
|
397
|
+
|
|
354
398
|
## What it can't do (yet)
|
|
355
399
|
|
|
356
400
|
- **Richtext messages** (`subType=11`, mixed text + image + @-mention in one
|
|
@@ -360,8 +404,6 @@ first use; you should never need to edit them by hand.
|
|
|
360
404
|
- **Forwarded / merged messages** (`subType=26`).
|
|
361
405
|
- **SSO / scan-to-login.** REST username+password works; the SSO flow is
|
|
362
406
|
not wired up.
|
|
363
|
-
- **Live push streaming.** Use `muc history` for server-side message
|
|
364
|
-
retrieval; there is no long-lived `talk/msg` listener wired up.
|
|
365
407
|
- **Image thumbnails.** The upload step asks the server to make `tn1`/`tn5`
|
|
366
408
|
thumbs, but `muc download` only fetches the original `fileKey`.
|
|
367
409
|
- **End-to-end-encrypted file content.** Not active on the default tenant
|
|
@@ -404,7 +446,7 @@ first use; you should never need to edit them by hand.
|
|
|
404
446
|
| 2 | USAGE |
|
|
405
447
|
| 3 | AUTH_REQUIRED, AUTH_EXPIRED |
|
|
406
448
|
| 4 | NOT_FOUND |
|
|
407
|
-
| 5 | REMOTE_ERROR, NETWORK |
|
|
449
|
+
| 5 | REMOTE_ERROR, NETWORK, TIMEOUT, KICKED |
|
|
408
450
|
| 6 | CONFIG_MISSING |
|
|
409
451
|
| 7 | CONFIG_INVALID |
|
|
410
452
|
|