mirror of
https://github.com/hansjone/dsh-im-ops.git
synced 2026-10-12 06:50:45 +08:00
feat: add stable proactive delivery
This commit is contained in:
parent
410cb822d7
commit
31792d7bc8
88 changed files with 6427 additions and 488 deletions
|
|
@ -7,8 +7,13 @@ export const inject = ['connection', 'credentials', 'typertGateway'];
|
|||
export async function apply(ctx, config = {}) {
|
||||
if (config?.controller) return installSlackRpc(ctx, config.controller, config.rpcAuthority);
|
||||
const production = await createProductionController(ctx, config, config.internals ?? {});
|
||||
const unregisterDelivery = config.deliveryService && production.deliveryAdapter
|
||||
? config.deliveryService.registerAdapter(production.deliveryAdapter) : undefined;
|
||||
const disposeRpc = installSlackRpc(ctx, production.controller, config.rpcAuthority);
|
||||
ctx.effect(() => async () => production.close(), 'dsh-im: close Slack bot connections');
|
||||
ctx.effect(() => async () => {
|
||||
await unregisterDelivery?.();
|
||||
await production.close();
|
||||
}, 'dsh-im: close Slack bot connections');
|
||||
return disposeRpc;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import {
|
|||
observeBotWorkspaceRemovals,
|
||||
} from '../../../../src/channels/shared/bot-workspace-store.mjs';
|
||||
import { listAgentPresetCatalog } from '../../../../src/channels/shared/agent-preset.mjs';
|
||||
import { createDeliveryAdapter } from '../../delivery-adapter.mjs';
|
||||
import { createTokenConnectionSupervisor } from '../shared/connection-supervisor.mjs';
|
||||
import { pluginPaths } from '../shared/production.mjs';
|
||||
import { createHarnessCommandExecutor } from '../../harness-command-executor.mjs';
|
||||
|
|
@ -129,6 +130,9 @@ export async function createProductionController(ctx, config = {}, internals = {
|
|||
}).start();
|
||||
return {
|
||||
controller,
|
||||
deliveryAdapter: createDeliveryAdapter({
|
||||
channel: 'slack', workspaces, coreController, stateFor,
|
||||
}),
|
||||
ready: supervisor.ready,
|
||||
async close() {
|
||||
await supervisor.close();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue