mirror of
https://github.com/hansjone/dsh-im-ops.git
synced 2026-10-09 00:33:20 +08:00
feat: add agent preset chat commands
This commit is contained in:
parent
2ad6f1a44e
commit
eea29fe296
33 changed files with 1519 additions and 234 deletions
|
|
@ -50,6 +50,7 @@ export async function createProductionController(ctx, config = {}, internals = {
|
|||
if (!ctx?.webServer) throw new TypeError('dsh-im WhatsApp requires ctx.webServer');
|
||||
const logger = typeof ctx.logger === 'function'
|
||||
? ctx.logger('dsh-im:whatsapp') : (ctx.logger ?? console);
|
||||
const agentPresetCatalog = () => listAgentPresetCatalog(ctx);
|
||||
const ConfigStore = internals.ConfigStore ?? WhatsappConfigStore;
|
||||
const StateStore = internals.StateStore ?? WhatsappStateStore;
|
||||
const Harness = internals.HarnessClient ?? WhatsappHarnessClient;
|
||||
|
|
@ -103,7 +104,9 @@ export async function createProductionController(ctx, config = {}, internals = {
|
|||
createRuntime: async ({ botId, config: botConfig, authDir }) => {
|
||||
const state = await stateFor(botId);
|
||||
await workspaces.ensure(botId, { defaultAgentPreset: config.agentPreset });
|
||||
const workspaceScope = createBotWorkspaceScope(harness, { botId, workspaces, state });
|
||||
const workspaceScope = createBotWorkspaceScope(harness, {
|
||||
botId, workspaces, state, agentPresetCatalog,
|
||||
});
|
||||
return new Runtime({
|
||||
config: botConfig,
|
||||
authDir,
|
||||
|
|
@ -141,7 +144,7 @@ export async function createProductionController(ctx, config = {}, internals = {
|
|||
const controller = createWorkspaceAwareController(coreController, {
|
||||
workspaces,
|
||||
stateFor,
|
||||
agentPresetCatalog: () => listAgentPresetCatalog(ctx),
|
||||
agentPresetCatalog,
|
||||
});
|
||||
const supervisor = createSupervisor({
|
||||
channel: 'whatsapp',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue