chore: import upstream snapshot with attribution

This commit is contained in:
wehub-resource-sync
2026-07-13 13:34:48 +08:00
commit 77bb5bf71f
3762 changed files with 353249 additions and 0 deletions
@@ -0,0 +1,22 @@
import * as summaryUpdater from './tagsUpdater'
import * as types from './types'
import * as bp from '.botpress'
export type WorkflowProps = types.CommonProps & bp.WorkflowHandlerProps['updateAllConversations']
export const updateAllConversations = async (props: WorkflowProps) => {
await props.workflow.acknowledgeStartOfProcessing()
const conversations = props.conversations['*']['*'].list({ tags: { isDirty: 'true' } })
const dirtyConversations = await conversations.takePage(1)
const promises: Promise<void>[] = []
for (const conversation of dirtyConversations) {
const firstMessagePage = await conversation.listMessages().takePage(1)
const promise = summaryUpdater.updateTitleAndSummary({ ...props, conversation, messages: firstMessagePage })
promises.push(promise)
}
await Promise.all(promises)
if (conversations.isExhausted) {
await props.workflow.setCompleted()
}
}