(params: {
userId: string
workflowId?: string
workspaceId?: string
chatId?: string
messageId: string
userTimezone?: string
requestMode: string
})
| 381 | } |
| 382 | |
| 383 | async function buildInitialExecutionContext(params: { |
| 384 | userId: string |
| 385 | workflowId?: string |
| 386 | workspaceId?: string |
| 387 | chatId?: string |
| 388 | messageId: string |
| 389 | userTimezone?: string |
| 390 | requestMode: string |
| 391 | }): Promise<ExecutionContext> { |
| 392 | const { userId, workflowId, workspaceId, chatId, messageId, userTimezone, requestMode } = params |
| 393 | |
| 394 | if (workflowId && !workspaceId) { |
| 395 | const context = await prepareExecutionContext(userId, workflowId, chatId) |
| 396 | return { |
| 397 | ...context, |
| 398 | messageId, |
| 399 | userTimezone, |
| 400 | requestMode, |
| 401 | copilotToolExecution: true, |
| 402 | } |
| 403 | } |
| 404 | |
| 405 | const decryptedEnvVars = await getEffectiveDecryptedEnv(userId, workspaceId) |
| 406 | return { |
| 407 | userId, |
| 408 | workflowId: workflowId ?? '', |
| 409 | workspaceId, |
| 410 | chatId, |
| 411 | decryptedEnvVars, |
| 412 | messageId, |
| 413 | userTimezone, |
| 414 | requestMode, |
| 415 | copilotToolExecution: true, |
| 416 | } |
| 417 | } |
| 418 | |
| 419 | function buildOnComplete(params: { |
| 420 | chatId?: string |
no test coverage detected