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

@ -20,7 +20,7 @@ function controller() {
test('Host exports the DingTalk plugin identity and required services', () => {
const plugin = createDingtalkHostPlugin({ controller: controller() });
assert.equal(name, 'dsh-dingtalk-host');
assert.deepEqual(inject, ['connection', 'credentials', 'webServer', 'typertGateway']);
assert.deepEqual(inject, ['connection', 'credentials', 'apiProxy', 'typertGateway']);
assert.equal(plugin.name, name);
assert.deepEqual(plugin.inject, inject);
});

View file

@ -41,9 +41,10 @@ test('production assembly keeps secrets in credentials and creates per-bot runti
async close() { seen.supervisorClosed = true; },
};
const credentials = {};
const apiProxy = {};
const production = await createProductionController({
credentials,
webServer: { port: 3080 },
apiProxy,
logger: () => console,
}, { dataDir: directory }, {
ConfigStore,
@ -56,7 +57,8 @@ test('production assembly keeps secrets in credentials and creates per-bot runti
});
assert.equal(seen.controllerOptions.credentials, credentials);
assert.equal(seen.harnessOptions.baseUrl.href, 'http://127.0.0.1:3080/');
assert.equal(seen.harnessOptions.apiProxy, apiProxy);
assert.equal(Object.hasOwn(seen.harnessOptions, 'baseUrl'), false);
assert.equal(seen.harnessOptions.autostart, false);
assert.equal(Object.hasOwn(seen.harnessOptions, 'agentPreset'), false);
const runtime = await seen.controllerOptions.createRuntime({
@ -82,7 +84,7 @@ test('production assembly keeps secrets in credentials and creates per-bot runti
const productionWithPreset = await createProductionController({
credentials,
webServer: { port: 3080 },
apiProxy,
logger: () => console,
}, { dataDir: directory, agentPreset: 'router-standard' }, {
ConfigStore,