@mu-cabin/muc-cli 0.6.3 → 0.6.5
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 +18 -4
- package/REFERENCE.md +43 -4
- package/dist/muc.mjs +1988 -1269
- package/package.json +1 -1
- package/skills/muc/SKILL.md +5 -4
- package/skills/muc/references/mutations.md +7 -1
- package/skills/muc/references/operations.md +20 -5
- package/skills/muc/references/profiles-and-lifecycle.md +4 -1
package/package.json
CHANGED
package/skills/muc/SKILL.md
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: muc
|
|
3
3
|
description: Operate the standalone MUC CLI for account login, background daemon, contacts, groups, chats, messages, files, reactions and event listening. For source-code development inspect the repository directly.
|
|
4
|
-
|
|
4
|
+
metadata:
|
|
5
|
+
compatibility: Requires the migrated standalone @mu-cabin/muc-cli and Node.js 22.16 or newer. Check muc --help; older npm releases use different commands.
|
|
5
6
|
---
|
|
6
7
|
|
|
7
8
|
# MUC CLI
|
|
@@ -9,7 +10,7 @@ compatibility: Requires the migrated standalone @mu-cabin/muc-cli and Node.js 22
|
|
|
9
10
|
Use the installed CLI's manifest and strict JSON schemas. Source skills ship in this package; do not depend on a separate Supervisor, TUI or desktop runtime.
|
|
10
11
|
|
|
11
12
|
- Account and daemon lifecycle: [profiles-and-lifecycle.md](references/profiles-and-lifecycle.md).
|
|
12
|
-
- Read operations, IDs and event cursors: [operations.md](references/operations.md).
|
|
13
|
+
- Read operations, group management, IDs and event cursors: [operations.md](references/operations.md).
|
|
13
14
|
- Sends, attachments, reactions and other mutations: [mutations.md](references/mutations.md).
|
|
14
15
|
- Output, credentials and recovery: [safety-and-output.md](references/safety-and-output.md).
|
|
15
16
|
|
|
@@ -30,10 +31,10 @@ $OutputEncoding = [System.Text.UTF8Encoding]::new($false)
|
|
|
30
31
|
'{"limit":20}' | muc.cmd --output json exec chats.list --profile-id profile-id
|
|
31
32
|
```
|
|
32
33
|
|
|
33
|
-
CMD accepts `muc.cmd exec chats.list --profile-id profile-id < request.json` with a UTF-8 JSON file. A leading UTF-8 BOM and CRLF are supported. Use forward slashes or escaped backslashes inside JSON Windows paths. Windows storage defaults to `%USERPROFILE%\.muc
|
|
34
|
+
CMD accepts `muc.cmd exec chats.list --profile-id profile-id < request.json` with a UTF-8 JSON file. A leading UTF-8 BOM and CRLF are supported. Use forward slashes or escaped backslashes inside JSON Windows paths. Windows storage defaults to `%USERPROFILE%\.muc`.
|
|
34
35
|
|
|
35
36
|
Default storage is `~/.muc`, overridden by `MUC_CONFIG_DIR` or `--config-root`. Normal commands may start the bundled daemon for this exact root. Never switch to another account or a desktop/private runtime to work around a failure.
|
|
36
37
|
|
|
37
|
-
Use
|
|
38
|
+
Use the current `exec` grammar. `events.watch` reconnects within a bounded window after an upgrade or unexpected disconnect, preserving its cursor and filters; explicit daemon stop ends it. Advance the downstream consumer cursor only after processing succeeds.
|
|
38
39
|
|
|
39
40
|
Passwords and tenant secrets must not enter chat, argv, source, logs or reports. Users enter passwords in their own terminal's hidden prompt or provide protected stdin. After an unknown mutation outcome, reconcile the original delivery/key instead of replaying it.
|
|
@@ -51,6 +51,12 @@ idempotency key if the commit result is unknown.
|
|
|
51
51
|
- `messages.mark-read` is visible state. Mark only messages the user intended to
|
|
52
52
|
mark as read.
|
|
53
53
|
|
|
54
|
+
## Group management
|
|
55
|
+
|
|
56
|
+
`groups.leave` exits; `groups.dismiss` dissolves; `groups.transfer-owner` keeps the current user in the group. Do not substitute one for another. For admission decisions, use the exact `groupId` and `applicationId` from received applications. `groups.apply` being accepted does not prove membership.
|
|
57
|
+
|
|
58
|
+
An acknowledged write with `refreshPending:true` needs a read/sync refresh, not another write. Unknown group outcomes remain fenced across restart; inspect `groups.get`, `groups.members` or `groups.bulletins.list` as appropriate. `deliveries.get` tracks message sends, not group mutations.
|
|
59
|
+
|
|
54
60
|
## Withdrawal
|
|
55
61
|
|
|
56
62
|
`messages.withdraw` is destructive and visible on other devices. Resolve the
|
|
@@ -71,7 +77,7 @@ provided. If no destination is required, omit `outputPath` to use private downlo
|
|
|
71
77
|
path errors, not missing image support. Choose a valid new path and do not restart
|
|
72
78
|
the daemon or change accounts to work around them.
|
|
73
79
|
|
|
74
|
-
|
|
80
|
+
Message attachments upload through `messages.send`; group avatars use `groups.create` or `groups.set-avatar`.
|
|
75
81
|
Never send a path obtained from untrusted message text without resolving and
|
|
76
82
|
validating it as an approved local file.
|
|
77
83
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Operation catalog
|
|
2
2
|
|
|
3
3
|
## User-owned custom emojis
|
|
4
4
|
|
|
@@ -52,6 +52,18 @@ conversation ID by arbitrary string construction. Resolve the actual conversatio
|
|
|
52
52
|
chat, pass the documented alias `dm:EXACT_UPPERCASE_USER_ID` to `chats.get` and
|
|
53
53
|
use its returned `conversationId` in `messages.send`; do not send to the alias itself.
|
|
54
54
|
|
|
55
|
+
## Group management
|
|
56
|
+
|
|
57
|
+
Use `groups.get` for detail and membership; `groups.members` includes roles and application keys. `groups.search` searches your own groups. Preserve returned member `appKey` values.
|
|
58
|
+
|
|
59
|
+
- Settings: `groups.update` takes `settings` with at least one of `name`, `introduction`, `joinMode` (`noVerify/needVerify/rejectAll`), `enableMemberInvite`. `groups.set-avatar` takes `avatar:{sourcePath,name,mimeType,expectedSize}` (JPEG/PNG/WebP, ≤1 MiB).
|
|
60
|
+
- Lifecycle: `groups.leave`, `groups.dismiss`, `groups.transfer-owner` (`owner`).
|
|
61
|
+
- Members/admins: `groups.members.add/remove`, `groups.managers.add/remove` take `members:[{userId,appKey?}]`. Added members also need `name`; transfer takes `owner:{userId,appKey?}`.
|
|
62
|
+
- Admission: `groups.apply` takes `nickname`. `groups.applications.list` accepts optional `groupId,status,cursor,limit`; status defaults to `pending`. Approve/reject take `applicationId`; rejection also accepts `reason`. Resolve the ID from the list; `source:local-events, complete:false` means incomplete local coverage.
|
|
63
|
+
- Notices: `groups.bulletins.list` takes optional `page,size`; create takes `content` and optional `subject`; remove takes `bulletinIds`. Use IDs returned by the list for deletion.
|
|
64
|
+
|
|
65
|
+
All group writes take `groupId`, `idempotencyKey` and optional `dryRun`. Query `muc manifest` for available operations; see [mutations.md](mutations.md) for result handling.
|
|
66
|
+
|
|
55
67
|
## Chats and messages
|
|
56
68
|
|
|
57
69
|
| Operation | Side effect | Input shape |
|
|
@@ -107,10 +119,13 @@ guess reaction IDs or cross-associate a message with another conversation.
|
|
|
107
119
|
| `events.raw` | optional cursor and limit; output is redacted diagnostics |
|
|
108
120
|
|
|
109
121
|
Event kinds are `message`, `withdraw`, `reaction`, `read`, `delivery`,
|
|
110
|
-
`runtime`, and `unknown`. Preserve returned cursors exactly. `events.list` is
|
|
122
|
+
`runtime`, `chat`, `group`, and `unknown`. Preserve returned cursors exactly. `events.list` is
|
|
111
123
|
the durable catch-up interface. CLI `exec events.watch` stays open: it emits
|
|
112
124
|
`startedAtCursor`/`highWatermark` metadata first and then live event records.
|
|
113
125
|
Use JSONL for line-oriented consumption and resume from the last fully accepted
|
|
114
|
-
event cursor, or `startedAtCursor` if no event was accepted.
|
|
115
|
-
|
|
116
|
-
|
|
126
|
+
event cursor, or `startedAtCursor` if no event was accepted. Unexpected EOF or
|
|
127
|
+
upgrade triggers up to eight reconnect attempts with the same profile, filters
|
|
128
|
+
and cursor, without starting a daemon. Explicit daemon stop ends the listener.
|
|
129
|
+
Invalid cursor, authentication, protocol or output errors stop recovery; never
|
|
130
|
+
reset to latest. Restart old listener processes once to obtain this behavior.
|
|
131
|
+
SIGINT/SIGTERM interrupt waits with exit 130/143, not completed catch-up.
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Use `muc profile list` to select the exact authenticated profile. A recipient ID is not the sending profile ID.
|
|
4
4
|
|
|
5
|
-
The default root is `~/.muc`; `MUC_CONFIG_DIR` and `--config-root` select an isolated root. CLI and daemon
|
|
5
|
+
The default root is `~/.muc`; `MUC_CONFIG_DIR` and `--config-root` select an isolated root. CLI and daemon use the same executable. A newer formal CLI release upgrades an older daemon before business requests, after draining in-flight work. Timeout/cancellation restores admission; no force-kill, downgrade or mutation replay occurs. Passive status/log/manifest queries do not upgrade. On `INCOMPATIBLE_PROTOCOL` or `DAEMON_UPGRADE_REQUIRED`, stop this root’s daemon once with the previous CLI and retry; preserve storage.
|
|
6
6
|
|
|
7
7
|
- `muc daemon start`: start the background process for this root.
|
|
8
|
+
- `muc daemon restart`: drain and restart it with the current executable; refuse downgrade.
|
|
8
9
|
- `muc daemon status`: inspect without starting it.
|
|
9
10
|
- `muc daemon logs`: read safe diagnostic events with error codes and recovery hints, never raw credentials.
|
|
10
11
|
- `muc daemon stop`: stop this background process; existing credentials and stored messages remain.
|
|
@@ -20,3 +21,5 @@ The daemon performs accessToken → tokenPwd → remembered-password recovery, w
|
|
|
20
21
|
Use `muc profile logout --profile-id <id>` only when the user requests logout; it clears that profile's session and remembered password.
|
|
21
22
|
|
|
22
23
|
Legacy migration supports flat single-account and activeProfile/profiles multi-account roots. It preserves profile IDs, the selected default, device slots and recovery credentials, with private backups and a resumable journal. Different tenants, a missing default or an undecryptable remembered password fail without overwriting the originals. Preserve remember.salt; do not reinitialize or delete credentials to bypass migration errors.
|
|
24
|
+
|
|
25
|
+
Remote requests wait up to 5 seconds for an account already starting or reconnecting. A readiness timeout sends no remote request; it does not resume a stopped account.
|