mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-24 16:29:22 +00:00
feat(workflow): integrate temporal workflow bundles and support dev/prod mode
This commit is contained in:
+11
-1
@@ -10,7 +10,17 @@ async function run() {
|
||||
initAgentWorkflows()
|
||||
|
||||
console.log('🚀 Starting Agent Worker...')
|
||||
await workflowService.startWorkers(TaskQueueAgent)
|
||||
|
||||
const options: { workflowBundle?: unknown; workflowsPath?: string } = {}
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
// @ts-ignore: Bun temporal plugin macro
|
||||
const { default: workflowBundle } = await import('./workflows:::workflow')
|
||||
options.workflowBundle = workflowBundle
|
||||
} else {
|
||||
options.workflowsPath = new URL('./workflows.ts', import.meta.url).pathname
|
||||
}
|
||||
|
||||
await workflowService.startWorkers(TaskQueueAgent, options)
|
||||
}
|
||||
|
||||
run().catch((err) => {
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
export * from '@shumai/agent/src/workflows/agent-autofill'
|
||||
export * from '@shumai/agent/src/workflows/agent-chat'
|
||||
export * from '@shumai/agent/src/workflows/agent-embedding'
|
||||
export * from '@shumai/agent/src/workflows/agent-tool-call'
|
||||
export * from '@shumai/agent/src/workflows/query-embedding-for-search'
|
||||
Reference in New Issue
Block a user