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 { installSlackRpc } from './rpc.mjs';
export const name = 'dsh-im-slack-host';
export const inject = ['connection', 'credentials', 'webServer'];
export const inject = ['connection', 'credentials', 'webServer', 'typertGateway'];
export async function apply(ctx, config = {}) {
if (config?.controller) return installSlackRpc(ctx, config.controller, config.rpcAuthority);

View file

@ -14,6 +14,7 @@ import {
} from '../../../../src/channels/shared/bot-workspace-store.mjs';
import { createTokenConnectionSupervisor } from '../shared/connection-supervisor.mjs';
import { harnessOrigin, pluginPaths } from '../shared/production.mjs';
import { createHarnessCommandExecutor } from '../../harness-command-executor.mjs';
export async function createProductionController(ctx, config = {}, internals = {}) {
if (!ctx?.credentials) throw new TypeError('dsh-im slack requires ctx.credentials');
@ -49,12 +50,14 @@ export async function createProductionController(ctx, config = {}, internals = {
}
return state;
};
const commandExecutor = createHarnessCommandExecutor(ctx, internals.commandExecutor);
const harness = new ResolvedHarness({
baseUrl: harnessOrigin(ctx.webServer, config.harnessBaseUrl),
workspace: defaultWorkspace,
agentPreset: config.agentPreset ?? 'standard',
autostart: false,
dshBin: config.dshBin ?? 'dsh',
...(commandExecutor ? { commandExecutor } : {}),
});
const coreController = new ResolvedController({
credentials: ctx.credentials,