botmux 2.74.0 → 2.75.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/dist/adapters/cli/claude-code.d.ts.map +1 -1
- package/dist/adapters/cli/claude-code.js +23 -19
- package/dist/adapters/cli/claude-code.js.map +1 -1
- package/dist/adapters/cli/types.d.ts +6 -0
- package/dist/adapters/cli/types.d.ts.map +1 -1
- package/dist/adapters/hook-installer.d.ts +4 -0
- package/dist/adapters/hook-installer.d.ts.map +1 -1
- package/dist/adapters/hook-installer.js +32 -2
- package/dist/adapters/hook-installer.js.map +1 -1
- package/dist/bot-registry.d.ts +10 -0
- package/dist/bot-registry.d.ts.map +1 -1
- package/dist/bot-registry.js +22 -5
- package/dist/bot-registry.js.map +1 -1
- package/dist/cli/pm2-command.d.ts +6 -0
- package/dist/cli/pm2-command.d.ts.map +1 -0
- package/dist/cli/pm2-command.js +7 -0
- package/dist/cli/pm2-command.js.map +1 -0
- package/dist/cli/stdin-encoding.d.ts +3 -0
- package/dist/cli/stdin-encoding.d.ts.map +1 -0
- package/dist/cli/stdin-encoding.js +19 -0
- package/dist/cli/stdin-encoding.js.map +1 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +48 -13
- package/dist/cli.js.map +1 -1
- package/dist/core/command-handler.d.ts.map +1 -1
- package/dist/core/command-handler.js +3 -1
- package/dist/core/command-handler.js.map +1 -1
- package/dist/core/maintenance.d.ts +18 -0
- package/dist/core/maintenance.d.ts.map +1 -1
- package/dist/core/maintenance.js +56 -4
- package/dist/core/maintenance.js.map +1 -1
- package/dist/core/worker-pool.d.ts.map +1 -1
- package/dist/core/worker-pool.js +1 -0
- package/dist/core/worker-pool.js.map +1 -1
- package/dist/dashboard/auth.d.ts.map +1 -1
- package/dist/dashboard/auth.js +2 -1
- package/dist/dashboard/auth.js.map +1 -1
- package/dist/dashboard/bot-onboarding.d.ts +2 -0
- package/dist/dashboard/bot-onboarding.d.ts.map +1 -1
- package/dist/dashboard/bot-onboarding.js +2 -0
- package/dist/dashboard/bot-onboarding.js.map +1 -1
- package/dist/dashboard/hd2d-assets.d.ts +20 -0
- package/dist/dashboard/hd2d-assets.d.ts.map +1 -0
- package/dist/dashboard/hd2d-assets.js +216 -0
- package/dist/dashboard/hd2d-assets.js.map +1 -0
- package/dist/dashboard/web/app.d.ts.map +1 -1
- package/dist/dashboard/web/app.js +3 -0
- package/dist/dashboard/web/app.js.map +1 -1
- package/dist/dashboard/web/office.d.ts +2 -0
- package/dist/dashboard/web/office.d.ts.map +1 -0
- package/dist/dashboard/web/office.js +140 -0
- package/dist/dashboard/web/office.js.map +1 -0
- package/dist/dashboard-web/app.js +327 -299
- package/dist/dashboard-web/game/index.apple-touch-icon.png +0 -0
- package/dist/dashboard-web/game/index.audio.position.worklet.js +66 -0
- package/dist/dashboard-web/game/index.audio.worklet.js +213 -0
- package/dist/dashboard-web/game/index.html +224 -0
- package/dist/dashboard-web/game/index.icon.png +0 -0
- package/dist/dashboard-web/game/index.js +909 -0
- package/dist/dashboard-web/game/index.png +0 -0
- package/dist/dashboard-web/index.html +1 -0
- package/dist/dashboard.js +87 -13
- package/dist/dashboard.js.map +1 -1
- package/dist/global-config.d.ts +5 -0
- package/dist/global-config.d.ts.map +1 -1
- package/dist/global-config.js +2 -0
- package/dist/global-config.js.map +1 -1
- package/dist/i18n/en.js +2 -2
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/zh.js +2 -2
- package/dist/i18n/zh.js.map +1 -1
- package/dist/im/lark/card-handler.d.ts.map +1 -1
- package/dist/im/lark/card-handler.js +3 -1
- package/dist/im/lark/card-handler.js.map +1 -1
- package/dist/im/lark/event-dispatcher.d.ts.map +1 -1
- package/dist/im/lark/event-dispatcher.js +66 -6
- package/dist/im/lark/event-dispatcher.js.map +1 -1
- package/dist/im/lark/reply-mode-command.d.ts.map +1 -1
- package/dist/im/lark/reply-mode-command.js +4 -1
- package/dist/im/lark/reply-mode-command.js.map +1 -1
- package/dist/services/bridge-rotation-policy.d.ts +40 -0
- package/dist/services/bridge-rotation-policy.d.ts.map +1 -1
- package/dist/services/bridge-rotation-policy.js +38 -0
- package/dist/services/bridge-rotation-policy.js.map +1 -1
- package/dist/services/chat-reply-mode-store.d.ts +1 -1
- package/dist/services/chat-reply-mode-store.d.ts.map +1 -1
- package/dist/services/chat-reply-mode-store.js +8 -9
- package/dist/services/chat-reply-mode-store.js.map +1 -1
- package/dist/setup/bot-config-editor.d.ts +9 -0
- package/dist/setup/bot-config-editor.d.ts.map +1 -1
- package/dist/setup/bot-config-editor.js +11 -0
- package/dist/setup/bot-config-editor.js.map +1 -1
- package/dist/setup/cli-selection.d.ts +65 -0
- package/dist/setup/cli-selection.d.ts.map +1 -0
- package/dist/setup/cli-selection.js +112 -0
- package/dist/setup/cli-selection.js.map +1 -0
- package/dist/setup/interactive-select.d.ts +30 -0
- package/dist/setup/interactive-select.d.ts.map +1 -0
- package/dist/setup/interactive-select.js +177 -0
- package/dist/setup/interactive-select.js.map +1 -0
- package/dist/skills/definitions.d.ts.map +1 -1
- package/dist/skills/definitions.js +17 -3
- package/dist/skills/definitions.js.map +1 -1
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/ready-gate.d.ts +6 -0
- package/dist/utils/ready-gate.d.ts.map +1 -1
- package/dist/utils/ready-gate.js +6 -0
- package/dist/utils/ready-gate.js.map +1 -1
- package/dist/worker.js +105 -7
- package/dist/worker.js.map +1 -1
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -34,11 +34,15 @@ import { enableAutostart, disableAutostart, autostartStatus, refreshAutostart }
|
|
|
34
34
|
import { tmuxEnv } from './setup/ensure-tmux.js';
|
|
35
35
|
import { writeBotsJsonAtomic as writeBotsAtomic } from './setup/bots-store.js';
|
|
36
36
|
import { applyBotConfigEdits, assertUniqueBotProcessNames, botProcessName, normalizeBotConfig, parseBotConfigsJson, parseBotSelection, removeBotConfig, resolveCliId, assertOwnerWhenChatGroups, findInvalidAllowedUserEntries, hasOwnerEntry, } from './setup/bot-config-editor.js';
|
|
37
|
+
import { resolveCliSelection, selectionKeyForBot } from './setup/cli-selection.js';
|
|
38
|
+
import { pickCliSelection } from './setup/interactive-select.js';
|
|
37
39
|
import { buildPreset, serializePreset, presetFilename } from './setup/agent-preset.js';
|
|
38
40
|
import { logger } from './utils/logger.js';
|
|
39
41
|
import { invalidWorkingDirs } from './utils/working-dir.js';
|
|
40
42
|
import { firstPositional } from './cli/arg-utils.js';
|
|
41
43
|
import { dispatchPrimaryMessage, findStdinAliasAttachment, sendFileAttachments } from './cli/send-dispatch.js';
|
|
44
|
+
import { buildPm2SpawnCommand } from './cli/pm2-command.js';
|
|
45
|
+
import { rejectLikelyWindowsStdinMojibake } from './cli/stdin-encoding.js';
|
|
42
46
|
import { formatBotInfoEntriesForCli, formatChatBotsForCli, } from './cli/bots-list-output.js';
|
|
43
47
|
import { buildFooterAddressing, hasKnownBotMention, knownBotOpenIdsFromCrossRef, orderedFooterRecipients, } from './utils/bot-routing.js';
|
|
44
48
|
import { isLocale, localeForBot, setDefaultLocale, SUPPORTED_LOCALES, t } from './i18n/index.js';
|
|
@@ -560,11 +564,15 @@ async function promptBotConfig(rl) {
|
|
|
560
564
|
return null;
|
|
561
565
|
}
|
|
562
566
|
console.log('✅ 凭证有效(tenant_access_token 已成功获取)\n');
|
|
563
|
-
|
|
564
|
-
|
|
567
|
+
// CLI 适配器:可搜索的级联选择器(选 Aiden 可进 × Claude / × Codex,aiden 网关)。
|
|
568
|
+
// 非交互终端自动回退为序号 / ID 文本输入。
|
|
569
|
+
const selKey = await pickCliSelection(rl, { title: '选择 CLI 适配器' });
|
|
565
570
|
let cliId;
|
|
571
|
+
let wrapperCli;
|
|
566
572
|
try {
|
|
567
|
-
|
|
573
|
+
const sel = resolveCliSelection(selKey ?? 'claude-code');
|
|
574
|
+
cliId = sel.cliId;
|
|
575
|
+
wrapperCli = sel.wrapperCli;
|
|
568
576
|
}
|
|
569
577
|
catch (err) {
|
|
570
578
|
console.log(`\n❌ ${err?.message ?? String(err)}`);
|
|
@@ -576,6 +584,8 @@ async function promptBotConfig(rl) {
|
|
|
576
584
|
larkAppId: creds.appId,
|
|
577
585
|
larkAppSecret: creds.appSecret,
|
|
578
586
|
cliId,
|
|
587
|
+
// aiden × claude/codex 等启动前缀;普通 CLI 不写此字段。
|
|
588
|
+
...(wrapperCli ? { wrapperCli } : {}),
|
|
579
589
|
// 总是写 workingDir, 留空用 '~'. 用户手动编辑 bots.json 时一眼能看到字段
|
|
580
590
|
// 在哪儿, 不用去 README 查字段名.
|
|
581
591
|
workingDir: workingDir.trim() || '~',
|
|
@@ -649,16 +659,28 @@ async function promptEditBotConfig(rl, bot) {
|
|
|
649
659
|
'留空保留当前值。',
|
|
650
660
|
]);
|
|
651
661
|
input.larkAppSecret = await ask(rl, `LARK_APP_SECRET [保留当前值]: `);
|
|
652
|
-
|
|
662
|
+
// CLI 适配器:可搜索的级联选择器(选 Aiden 可进 × Claude / × Codex,aiden 网关)。
|
|
653
663
|
printInputHelp('CLI 适配器', [
|
|
654
|
-
'
|
|
655
|
-
'
|
|
656
|
-
'
|
|
664
|
+
'可搜索的交互式选择:输入关键字过滤、↑/↓ 选择、⏎ 确认、Esc 保留当前值。',
|
|
665
|
+
'选 Aiden 进二级菜单:× Claude / × Codex(aiden 网关,无需 wrapper 脚本)。',
|
|
666
|
+
'非交互终端下回退为「输入序号 / 适配器 ID」。',
|
|
657
667
|
]);
|
|
658
|
-
|
|
668
|
+
const currentKey = selectionKeyForBot(bot.cliId ?? 'claude-code', bot.wrapperCli);
|
|
669
|
+
const selKey = await pickCliSelection(rl, { title: 'CLI 适配器', currentKey });
|
|
670
|
+
if (selKey) {
|
|
671
|
+
try {
|
|
672
|
+
const sel = resolveCliSelection(selKey);
|
|
673
|
+
input.cliChoice = sel.cliId;
|
|
674
|
+
input.wrapperCli = sel.wrapperCli ?? null; // 选普通 CLI 时清掉旧的 aiden×* 前缀
|
|
675
|
+
}
|
|
676
|
+
catch (err) {
|
|
677
|
+
console.log(`\n❌ ${err?.message ?? String(err)}(保留当前 CLI)`);
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
// selKey 为 null(Esc / 空)→ input.cliChoice 不设 → 保留当前 CLI。
|
|
659
681
|
printInputHelp('CLI 可执行文件路径覆盖', [
|
|
660
682
|
'可选。CLI 入口的绝对路径,用于在原 CLI 外面套一层 wrapper / router。',
|
|
661
|
-
'典型场景:ccr
|
|
683
|
+
'典型场景:ccr / claude-w 等自定义入口(aiden × claude/codex 选上面那项即可,无需此项)。',
|
|
662
684
|
'留空保留当前值;输入 - 清空覆盖,回到 PATH 查 cliId 对应的默认二进制。',
|
|
663
685
|
]);
|
|
664
686
|
input.cliPathOverride = await ask(rl, `CLI 可执行文件路径覆盖 [${formatOptionalValue(bot.cliPathOverride)}]: `);
|
|
@@ -1099,11 +1121,18 @@ function deleteAllBotmuxProcesses(home = PM2_HOME) {
|
|
|
1099
1121
|
timeout: 10_000,
|
|
1100
1122
|
});
|
|
1101
1123
|
}
|
|
1102
|
-
catch {
|
|
1124
|
+
catch (e) {
|
|
1125
|
+
// Don't swallow silently — a failed delete here used to leave the
|
|
1126
|
+
// restart half-done with no trace. Surface it (the auto-restart
|
|
1127
|
+
// driver captures stderr to ~/.botmux/logs/maintenance-restart.log).
|
|
1128
|
+
console.error(`[restart] pm2 delete ${app.name} failed: ${e instanceof Error ? e.message : e}`);
|
|
1129
|
+
}
|
|
1103
1130
|
}
|
|
1104
1131
|
}
|
|
1105
1132
|
}
|
|
1106
|
-
catch {
|
|
1133
|
+
catch (e) {
|
|
1134
|
+
console.error(`[restart] pm2 jlist failed (pm2 not running or no apps?): ${e instanceof Error ? e.message : e}`);
|
|
1135
|
+
}
|
|
1107
1136
|
}
|
|
1108
1137
|
function killPm2GodDaemon(home = PM2_HOME) {
|
|
1109
1138
|
try {
|
|
@@ -1313,8 +1342,10 @@ function cmdLogs() {
|
|
|
1313
1342
|
// Show all botmux logs via pm2 regex match
|
|
1314
1343
|
target = `/^${PM2_NAME}/`;
|
|
1315
1344
|
}
|
|
1316
|
-
// Use spawn for streaming output
|
|
1317
|
-
|
|
1345
|
+
// Use spawn for streaming output. Windows cannot spawn a .js CLI script
|
|
1346
|
+
// directly, so run the bundled pm2 script through the current node.exe.
|
|
1347
|
+
const pm2 = buildPm2SpawnCommand(pm2Bin(), ['logs', target, '--lines', lines]);
|
|
1348
|
+
const child = spawn(pm2.command, pm2.args, {
|
|
1318
1349
|
stdio: 'inherit',
|
|
1319
1350
|
env: pm2Env(),
|
|
1320
1351
|
});
|
|
@@ -3117,6 +3148,8 @@ async function cmdSend(rest) {
|
|
|
3117
3148
|
content = await readStdin();
|
|
3118
3149
|
}
|
|
3119
3150
|
}
|
|
3151
|
+
if (!contentFile)
|
|
3152
|
+
rejectLikelyWindowsStdinMojibake(content);
|
|
3120
3153
|
if (!content.trim() && images.length === 0 && files.length === 0) {
|
|
3121
3154
|
console.error('没有内容可发送。用法:\n echo "消息" | botmux send\n botmux send "消息"\n botmux send --content-file /tmp/msg.md --images /tmp/chart.png');
|
|
3122
3155
|
process.exit(1);
|
|
@@ -3978,6 +4011,8 @@ async function cmdReport(rest) {
|
|
|
3978
4011
|
const pos = positionals(rest);
|
|
3979
4012
|
content = pos.length ? pos.join(' ') : await readStdin();
|
|
3980
4013
|
}
|
|
4014
|
+
if (!contentFile)
|
|
4015
|
+
rejectLikelyWindowsStdinMojibake(content);
|
|
3981
4016
|
if (!content.trim()) {
|
|
3982
4017
|
console.error('没有回报内容。用法: botmux report "子项目X 完成 + 产出位置"');
|
|
3983
4018
|
process.exit(1);
|