mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-02 14:04:50 +00:00
Replace Temporal and LocalExecutor with DBOS Transact (@dbos-inc/dbos-sdk) as the unified workflow engine. Background tasks, media transcoding, and AI agent workflows now execute with durable steps and task queues directly against PostgreSQL, eliminating the need for an external Temporal cluster and separate polling executors.
31 lines
964 B
TypeScript
31 lines
964 B
TypeScript
import { loadEnvConfig } from '@shumai/core/src/env-loader'
|
|
loadEnvConfig(process.cwd(), process.env.NODE_ENV !== 'production')
|
|
|
|
import { workflowService } from '@shumai/workflow-core'
|
|
import { TaskQueueAgent } from '@shumai/workflow-core'
|
|
import { initAgentWorkflows } from '@shumai/agent'
|
|
import { sandboxService } from '@shumai/core'
|
|
import { handleDaemonCommands } from '@shumai/core/src/utils/daemon'
|
|
|
|
if (process.argv.includes('--check')) {
|
|
console.log('✅ Agent worker evaluated successfully!')
|
|
process.exit(0)
|
|
}
|
|
|
|
async function run() {
|
|
// Initialize workflows and activities
|
|
initAgentWorkflows()
|
|
await sandboxService.ensureInitialized().catch((err) => {
|
|
console.error('Failed to eagerly initialize sandbox in agent worker:', err)
|
|
})
|
|
|
|
console.log('🚀 Starting Agent Worker...')
|
|
|
|
await workflowService.startWorkers(TaskQueueAgent)
|
|
}
|
|
|
|
handleDaemonCommands('shumai-agent', run).catch((err) => {
|
|
console.error(err)
|
|
process.exit(1)
|
|
})
|