feat: support compact command across IM channels

This commit is contained in:
xmanrui 2026-08-18 23:20:05 +08:00
parent 4545cfe9c5
commit 1cc7a26f30
40 changed files with 728 additions and 136 deletions

View file

@ -2,7 +2,7 @@ import { createProductionController } from './production.mjs';
import { installDingtalkRpc } from './rpc.mjs';
export const name = 'dsh-dingtalk-host';
export const inject = ['connection', 'credentials', 'webServer'];
export const inject = ['connection', 'credentials', 'webServer', 'typertGateway'];
export async function apply(ctx, config = {}) {
if (config?.controller) {

View file

@ -15,6 +15,7 @@ import {
observeBotWorkspaceRemovals,
} from '../../../../src/channels/shared/bot-workspace-store.mjs';
import { createConnectionSupervisor } from './connection-supervisor.mjs';
import { createHarnessCommandExecutor } from '../../harness-command-executor.mjs';
function harnessOrigin(webServer, configured) {
if (configured !== undefined) return new URL(configured);
@ -79,12 +80,14 @@ export async function createProductionController(ctx, config = {}, internals = {
}
return state;
};
const commandExecutor = createHarnessCommandExecutor(ctx, internals.commandExecutor);
const harness = new Harness({
baseUrl: harnessOrigin(ctx.webServer, config.harnessBaseUrl),
workspace: defaultWorkspace,
agentPreset: config.agentPreset ?? 'standard',
autostart: false,
dshBin: config.dshBin ?? 'dsh',
...(commandExecutor ? { commandExecutor } : {}),
});
const coreController = new Controller({
deviceAuth,