Processes 用于启动和管理后台进程、长时间运行的任务与作业。它提供聊天命令和 TypeScript API 两种使用方式。
聊天命令:用 /job spawn "命令" 启动作业,可加 --name 命名、--restart 自动重启;用 /jobs 列出作业,/job status <id> 查看状态,/job output <id> 查看输出(--follow 流式输出),/job stop <id> 停止,/job restart <id> 重启;/job logs <id> 查看日志,支持 --tail 100 和 --since 1h。
TypeScript API:通过 createProcessManager 创建管理器,可配置 cwd、env、maxProcesses、maxMemoryMB、logDir、maxLogSizeMB、storage、dbPath。spawn 启动作业,支持 command、args、name、env、cwd、restart、maxRestarts、restartDelayMs、maxMemoryMB、timeoutMs。list 列出作业,getStatus 获取状态、退出码、运行时长、重启次数、内存和 CPU,getOutput 获取 stdout/stderr 或 tail 行数,streamOutput 流式监听 stdout、stderr、exit,stop 停止(force 为 SIGKILL),stopAll 停止全部,restart 重启,wait 等待完成。事件包括 started、stopped、failed、output。作业状态有 running、stopped、completed、failed、restarting。
适用场景包括运行回测、训练机器学习模型等长任务。限制与最佳实践:为作业命名、设置超时、监控内存、谨慎使用自动重启、检查日志。具体平台与收费信息暂未提供。