feat: add message source context enhancement

This commit is contained in:
xmanrui 2026-08-29 10:46:06 +08:00
parent 5928b33057
commit 0cb79f74e9
69 changed files with 6217 additions and 597 deletions

View file

@ -98,6 +98,8 @@ export async function createProductionController(ctx, config = {}, internals = {
workspaces,
method: 'removeBot',
botIdFromRemoved: (removed) => removed.id,
saveMethod: 'saveBot',
botIdFromSave: (bot) => bot?.id,
})
: configStore;
// State is lazy per bot. A corrupt legacy file can therefore fail only the
@ -167,6 +169,7 @@ export async function createProductionController(ctx, config = {}, internals = {
ownerOpenIds: botConfig.ownerOpenIds ?? [botConfig.ownerOpenId],
harness: workspaceScope.harness,
state: workspaceScope.state,
contextEnhancement: { botId: id, getSettings: () => workspaces.contextEnhancementFor(id) },
replyTimeoutMs: config.replyTimeoutMs ?? 600_000,
...(wsAgent ? { wsAgent } : {}),
logger: {