@mu-cabin/muc-cli 0.6.2 → 0.6.4
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 +34 -0
- package/REFERENCE.md +5 -1
- package/dist/muc.mjs +16 -13
- package/package.json +3 -3
- package/skills/muc/SKILL.md +9 -0
package/README.md
CHANGED
|
@@ -4,10 +4,42 @@
|
|
|
4
4
|
|
|
5
5
|
0.6.0 迁入新版命令契约。要求 **Node.js ≥ 22.16**,使用内置 SQLite,无需独立 Supervisor、Launcher、Keychain、TUI 或客户端。运行时依赖已打包进单个 `dist/muc.mjs`。
|
|
6
6
|
|
|
7
|
+
## 0.6.4 大群 @ 名单接收修复
|
|
8
|
+
|
|
9
|
+
移除接收、读取和发送链路对 @ 人员列表的 100 人限制,完整保留名单,避免大群消息导致整批入站校验失败、无法确认接收和后续消息积压。账号格式与报文大小校验保持不变。升级后需重启 daemon,新代码才会生效。
|
|
10
|
+
|
|
7
11
|
## 0.6.2 附件下载修复
|
|
8
12
|
|
|
9
13
|
图片和文件可下载到操作系统允许写入的目录,包括 macOS `/tmp`、共享目录和目录符号链接。路径无效或目标文件已存在时返回明确错误与修复提示,不再误报后台不支持操作。下载仍不覆盖已有文件。
|
|
10
14
|
|
|
15
|
+
## 0.6.3 Windows 兼容修复
|
|
16
|
+
|
|
17
|
+
修复 Windows 已有后台锁文件被 Unix 权限检查误判,导致 `login` 等命令无法启动后台的问题;单实例互斥继续由 Windows 命名管道保证。JSON stdin 支持 UTF-8 BOM 和 CRLF。源码清理和离线打包不再需要 Bash 或 `rm`。
|
|
18
|
+
|
|
19
|
+
### Windows 安装与运行
|
|
20
|
+
|
|
21
|
+
安装 Node.js 22.16 或更新版本,在 PowerShell 中运行(`npm.cmd` / `muc.cmd` 可避开 `.ps1` 执行策略限制):
|
|
22
|
+
|
|
23
|
+
```powershell
|
|
24
|
+
node --version
|
|
25
|
+
npm.cmd install -g @mu-cabin/muc-cli@0.6.4
|
|
26
|
+
muc.cmd --version
|
|
27
|
+
muc.cmd login --account YOUR_ACCOUNT --profile-id default --remember
|
|
28
|
+
muc.cmd whoami --profile-id default
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
默认数据目录为 `%USERPROFILE%\.muc`。首次使用仍需管理员通过受保护 stdin 完成 `init`;升级已有配置无需重新初始化。更新前运行 `muc.cmd daemon stop`,安装后下次登录或查询会启动新版后台;使用自定义配置根时,停止和启动都指定同一 `--config-root`。
|
|
32
|
+
|
|
33
|
+
PowerShell 不支持 Bash 的 `<<'JSON'`。JSON 可用单引号字符串通过管道传入;Windows PowerShell 5.1 先设置 UTF-8,防止中文被转换为问号:
|
|
34
|
+
|
|
35
|
+
```powershell
|
|
36
|
+
$OutputEncoding = [System.Text.UTF8Encoding]::new($false)
|
|
37
|
+
'{"limit":20}' | muc.cmd exec chats.list --profile-id default
|
|
38
|
+
'{"includeSelf":false}' | muc.cmd --output jsonl exec events.watch --profile-id default
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
CMD 可使用 `echo {"limit":20} | muc.cmd exec chats.list --profile-id default`。复杂 JSON 使用 UTF-8 文件重定向:`muc.cmd exec chats.list --profile-id default < request.json`。JSON 中的 Windows 路径使用 `C:/Users/NAME/Downloads/file.png` 或双反斜杠,含空格的命令行路径用双引号包围。密码仍只在用户终端的隐藏提示或受保护 stdin 输入。
|
|
42
|
+
|
|
11
43
|
## 配置和登录
|
|
12
44
|
|
|
13
45
|
默认数据目录为 `~/.muc`;`MUC_CONFIG_DIR` 或全局 `--config-root` 可指定隔离目录。首次部署用 `muc init` 从受保护 stdin 接收管理员提供的租户和端点配置。
|
|
@@ -61,3 +93,5 @@ pnpm --filter @mu-cabin/muc-cli build
|
|
|
61
93
|
```
|
|
62
94
|
|
|
63
95
|
仓库内的 `AGENTS.md` 与 `docs/development.md` 记录开发约定和验收证据;它们不属于安装包。Skill 源码随包发布,全局安装副本需另行安装。
|
|
96
|
+
|
|
97
|
+
`pnpm --filter @mu-cabin/muc-cli clean` 和 `pack:offline` 支持 Windows、macOS、Linux。MUC 的运行时依赖已内嵌,`pack:offline` 直接生成普通 npm tarball `mu-cabin-muc-cli-<version>.tgz`,目标机器可用 `npm install -g --offline <tarball>` 安装,无需另行捆绑依赖。
|
package/REFERENCE.md
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
# MUC 命令契约
|
|
2
2
|
|
|
3
|
-
本文件描述 0.6.
|
|
3
|
+
本文件描述 0.6.4 的命令契约。旧的 `send/history/daemon-*` 命令已移除。
|
|
4
4
|
|
|
5
5
|
## 命令结构
|
|
6
6
|
|
|
7
7
|
全局参数放在命令之前:`muc [--config-root <绝对路径>] [--output json|jsonl|text] <命令>`。默认 JSON。配置根也可由 `MUC_CONFIG_DIR` 提供。
|
|
8
8
|
|
|
9
|
+
Windows 默认配置根为 `%USERPROFILE%\.muc`。PowerShell 若阻止 npm 生成的 `muc.ps1`,使用 `muc.cmd`;无须修改执行策略。业务 JSON 输入使用 UTF-8,允许开头的 UTF-8 BOM 与 CRLF。PowerShell 5.1 管道应先设置 `$OutputEncoding = [System.Text.UTF8Encoding]::new($false)`;不要直接复制 Bash 的 `<<'JSON'` 语法。示例见 README 的 Windows 章节。
|
|
10
|
+
|
|
9
11
|
| 命令 | 用途 |
|
|
10
12
|
| --- | --- |
|
|
11
13
|
| `init` | 从受保护 stdin 配置租户与初始 profile |
|
|
@@ -48,3 +50,5 @@
|
|
|
48
50
|
普通文件发送默认不带尾注(包括带说明的文件消息);明确 `--tail` 才添加。文件上传须完成服务端扫描并取得未来有效期,才会进入消息发送;扫描失败不会降级发送过期文件。
|
|
49
51
|
|
|
50
52
|
附件下载按操作系统权限处理输出目录,支持 `/tmp`、共享目录和目录符号链接;仍不覆盖已有文件。`OUTPUT_PATH_INVALID` 表示路径无效或不可用,`OUTPUT_EXISTS` 表示目标文件已存在。省略 `outputPath` 使用账号私有下载目录。
|
|
53
|
+
|
|
54
|
+
@ 人员列表不设固定人数上限,不截断接收或发送的名单;账号格式、正文及传输报文大小校验仍适用。
|
package/dist/muc.mjs
CHANGED
|
@@ -9425,7 +9425,7 @@ var V2StoredContentBlockSchema = external_exports.lazy(() => external_exports.di
|
|
|
9425
9425
|
external_exports.object({
|
|
9426
9426
|
type: external_exports.literal("text"),
|
|
9427
9427
|
text: external_exports.string().min(1).max(32200),
|
|
9428
|
-
mentions: external_exports.array(V2MentionSchema).
|
|
9428
|
+
mentions: external_exports.array(V2MentionSchema).optional()
|
|
9429
9429
|
}).strict(),
|
|
9430
9430
|
external_exports.object({
|
|
9431
9431
|
type: external_exports.enum(["image", "file", "voice"]),
|
|
@@ -9495,7 +9495,7 @@ var V2MessageSchema = external_exports.object({
|
|
|
9495
9495
|
createdAtMs: V2EpochMsSchema,
|
|
9496
9496
|
readByPeer: external_exports.boolean().optional(),
|
|
9497
9497
|
readByPeerIds: external_exports.array(V2SafeIdSchema).max(100).optional(),
|
|
9498
|
-
mentionUserIds: external_exports.array(V2SafeIdSchema).
|
|
9498
|
+
mentionUserIds: external_exports.array(V2SafeIdSchema).optional(),
|
|
9499
9499
|
mentionsSelf: external_exports.boolean().optional(),
|
|
9500
9500
|
countsAsUnread: external_exports.boolean().optional(),
|
|
9501
9501
|
kind: V2MessageKindSchema,
|
|
@@ -10033,7 +10033,7 @@ var OutgoingContentBlockSchema = external_exports.discriminatedUnion("type", [
|
|
|
10033
10033
|
external_exports.object({
|
|
10034
10034
|
type: external_exports.literal("text"),
|
|
10035
10035
|
text: external_exports.string().min(1).max(32e3),
|
|
10036
|
-
mentions: external_exports.array(OutgoingMentionSchema).
|
|
10036
|
+
mentions: external_exports.array(OutgoingMentionSchema).optional()
|
|
10037
10037
|
}).strict(),
|
|
10038
10038
|
external_exports.object({
|
|
10039
10039
|
type: external_exports.enum(["image", "file", "voice"]),
|
|
@@ -11446,7 +11446,7 @@ async function readJsonObject(io) {
|
|
|
11446
11446
|
}
|
|
11447
11447
|
let parsed;
|
|
11448
11448
|
try {
|
|
11449
|
-
parsed = JSON.parse(text2);
|
|
11449
|
+
parsed = JSON.parse(text2.replace(/^\uFEFF/u, ""));
|
|
11450
11450
|
} catch {
|
|
11451
11451
|
throw new CliInputError("Operation input must be one valid JSON object.");
|
|
11452
11452
|
}
|
|
@@ -11698,7 +11698,10 @@ async function ensureSafeLockFile(path) {
|
|
|
11698
11698
|
throw error;
|
|
11699
11699
|
}
|
|
11700
11700
|
const entry = await lstat2(path);
|
|
11701
|
-
if (!entry.isFile() || entry.isSymbolicLink() ||
|
|
11701
|
+
if (!entry.isFile() || entry.isSymbolicLink() || // Windows exposes synthetic mode bits; chmod cannot clear group/other
|
|
11702
|
+
// access there. Keep the file/type checks and let the named pipe own
|
|
11703
|
+
// mutual exclusion, as with the other private Windows state files.
|
|
11704
|
+
process.platform !== "win32" && (entry.mode & 63) !== 0) {
|
|
11702
11705
|
throw new SingleInstanceError();
|
|
11703
11706
|
}
|
|
11704
11707
|
if (typeof process.getuid === "function" && entry.uid !== process.getuid()) {
|
|
@@ -12323,7 +12326,7 @@ async function assertLegacyStopped(root) {
|
|
|
12323
12326
|
// package.json
|
|
12324
12327
|
var package_default = {
|
|
12325
12328
|
name: "@mu-cabin/muc-cli",
|
|
12326
|
-
version: "0.6.
|
|
12329
|
+
version: "0.6.4",
|
|
12327
12330
|
description: "Standalone agent-first MUC CLI with an embedded background daemon",
|
|
12328
12331
|
license: "MIT",
|
|
12329
12332
|
type: "module",
|
|
@@ -12350,11 +12353,11 @@ var package_default = {
|
|
|
12350
12353
|
dev: "tsx src/index.ts",
|
|
12351
12354
|
test: "pnpm build && vitest run",
|
|
12352
12355
|
typecheck: "tsc --noEmit",
|
|
12353
|
-
clean:
|
|
12356
|
+
clean: `node -e "require('node:fs').rmSync('dist', { recursive: true, force: true })"`,
|
|
12354
12357
|
build: "node scripts/build.mjs",
|
|
12355
12358
|
prepack: "pnpm typecheck && pnpm test",
|
|
12356
12359
|
verify: "npm pack --dry-run",
|
|
12357
|
-
"pack:offline": "
|
|
12360
|
+
"pack:offline": "npm pack"
|
|
12358
12361
|
},
|
|
12359
12362
|
devDependencies: {
|
|
12360
12363
|
"@types/node": "^22.19.15",
|
|
@@ -14128,7 +14131,7 @@ var NativeStoredContentBlockSchema = external_exports.lazy(() => external_export
|
|
|
14128
14131
|
external_exports.object({
|
|
14129
14132
|
type: external_exports.literal("text"),
|
|
14130
14133
|
text: external_exports.string().min(1).max(32e3),
|
|
14131
|
-
mentions: external_exports.array(NativeMentionSchema).
|
|
14134
|
+
mentions: external_exports.array(NativeMentionSchema).optional()
|
|
14132
14135
|
}).strict(),
|
|
14133
14136
|
external_exports.object({
|
|
14134
14137
|
type: external_exports.enum(["image", "file", "voice"]),
|
|
@@ -14179,7 +14182,7 @@ var NativeMessageSchema = external_exports.object({
|
|
|
14179
14182
|
/** Stable peer ids from roaming payloads and realtime read receipts. */
|
|
14180
14183
|
readByPeerIds: external_exports.array(SafeIdSchema).max(100).optional(),
|
|
14181
14184
|
/** App-key-qualified protocol mention targets carried by this message. */
|
|
14182
|
-
mentionUserIds: external_exports.array(SafeIdSchema).
|
|
14185
|
+
mentionUserIds: external_exports.array(SafeIdSchema).optional(),
|
|
14183
14186
|
/** Authoritative normalization result for an unread @me badge. */
|
|
14184
14187
|
mentionsSelf: external_exports.boolean().optional(),
|
|
14185
14188
|
/** Overrides direction-based unread semantics for visible system messages. */
|
|
@@ -14369,7 +14372,7 @@ var NativeOutgoingContentBlockSchema = external_exports.discriminatedUnion("type
|
|
|
14369
14372
|
external_exports.object({
|
|
14370
14373
|
type: external_exports.literal("text"),
|
|
14371
14374
|
text: external_exports.string().min(1).max(32e3),
|
|
14372
|
-
mentions: external_exports.array(NativeOutgoingMentionSchema).
|
|
14375
|
+
mentions: external_exports.array(NativeOutgoingMentionSchema).optional()
|
|
14373
14376
|
}).strict(),
|
|
14374
14377
|
external_exports.object({
|
|
14375
14378
|
type: external_exports.enum(["image", "file", "voice"]),
|
|
@@ -14404,7 +14407,7 @@ var NativePlannedContentBlockSchema = external_exports.discriminatedUnion("type"
|
|
|
14404
14407
|
external_exports.object({
|
|
14405
14408
|
type: external_exports.literal("text"),
|
|
14406
14409
|
text: external_exports.string().min(1).max(32200),
|
|
14407
|
-
mentions: external_exports.array(NativeOutgoingMentionSchema).
|
|
14410
|
+
mentions: external_exports.array(NativeOutgoingMentionSchema).optional()
|
|
14408
14411
|
}).strict(),
|
|
14409
14412
|
external_exports.object({
|
|
14410
14413
|
type: external_exports.enum(["image", "file", "voice"]),
|
|
@@ -14428,7 +14431,7 @@ var NativePersistedContentBlockSchema = external_exports.discriminatedUnion("typ
|
|
|
14428
14431
|
external_exports.object({
|
|
14429
14432
|
type: external_exports.literal("text"),
|
|
14430
14433
|
text: external_exports.string().min(1).max(32200),
|
|
14431
|
-
mentions: external_exports.array(NativeOutgoingMentionSchema).
|
|
14434
|
+
mentions: external_exports.array(NativeOutgoingMentionSchema).optional()
|
|
14432
14435
|
}).strict(),
|
|
14433
14436
|
external_exports.object({
|
|
14434
14437
|
type: external_exports.enum(["image", "file", "voice"]),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mu-cabin/muc-cli",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.4",
|
|
4
4
|
"description": "Standalone agent-first MUC CLI with an embedded background daemon",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
"dev": "tsx src/index.ts",
|
|
28
28
|
"test": "pnpm build && vitest run",
|
|
29
29
|
"typecheck": "tsc --noEmit",
|
|
30
|
-
"clean": "
|
|
30
|
+
"clean": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"",
|
|
31
31
|
"build": "node scripts/build.mjs",
|
|
32
32
|
"prepack": "pnpm typecheck && pnpm test",
|
|
33
33
|
"verify": "npm pack --dry-run",
|
|
34
|
-
"pack:offline": "
|
|
34
|
+
"pack:offline": "npm pack"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/node": "^22.19.15",
|
package/skills/muc/SKILL.md
CHANGED
|
@@ -23,6 +23,15 @@ muc --output json exec chats.list --profile-id profile-id <<'JSON'
|
|
|
23
23
|
JSON
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
+
On Windows PowerShell use `muc.cmd` if the npm `muc.ps1` shim is blocked; do not change execution policy. Bash heredocs are not PowerShell syntax. Set UTF-8 output in Windows PowerShell 5.1 before piping JSON, especially Chinese text:
|
|
27
|
+
|
|
28
|
+
```powershell
|
|
29
|
+
$OutputEncoding = [System.Text.UTF8Encoding]::new($false)
|
|
30
|
+
'{"limit":20}' | muc.cmd --output json exec chats.list --profile-id profile-id
|
|
31
|
+
```
|
|
32
|
+
|
|
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`; stop the daemon for the same config root before upgrading.
|
|
34
|
+
|
|
26
35
|
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.
|
|
27
36
|
|
|
28
37
|
Use only the current `exec` grammar, not old `muc send`, `muc history`, or `muc daemon-*` aliases. Listening uses `events.watch`; the daemon keeps receiving after a consumer exits. Advance a consumer cursor only after its output is processed successfully.
|