fix: use in-process Harness API for local plugin connections

This commit is contained in:
xmanrui 2026-08-28 01:24:17 +08:00
parent f4ded46278
commit f0b6b38b45
40 changed files with 1413 additions and 603 deletions

View file

@ -14,13 +14,14 @@ import {
} from '../../../../src/channels/shared/bot-workspace-store.mjs';
import { listAgentPresetCatalog } from '../../../../src/channels/shared/agent-preset.mjs';
import { createTokenConnectionSupervisor } from '../shared/connection-supervisor.mjs';
import { harnessOrigin, pluginPaths } from '../shared/production.mjs';
import { pluginPaths } from '../shared/production.mjs';
import { createHarnessCommandExecutor } from '../../harness-command-executor.mjs';
import { harnessConnection } from '../../harness-connection.mjs';
import { createHarnessSessionExecutors } from '../../harness-session-coordinator.mjs';
export async function createProductionController(ctx, config = {}, internals = {}) {
if (!ctx?.credentials) throw new TypeError('dsh-im slack requires ctx.credentials');
if (!ctx?.webServer) throw new TypeError('dsh-im slack requires ctx.webServer');
const connection = harnessConnection(ctx, config);
const ResolvedConfigStore = internals.ConfigStore ?? SlackConfigStore;
const ResolvedStateStore = internals.StateStore ?? SlackStateStore;
@ -62,7 +63,7 @@ export async function createProductionController(ctx, config = {}, internals = {
fileIngressExecutor: internals.fileIngressExecutor,
});
const harness = new ResolvedHarness({
baseUrl: harnessOrigin(ctx.webServer, config.harnessBaseUrl),
...connection,
workspace: defaultWorkspace,
autostart: false,
dshBin: config.dshBin ?? 'dsh',