(evalRecord: Eval)
| 603 | } |
| 604 | |
| 605 | async function handleEmailCollection(evalRecord: Eval): Promise<void> { |
| 606 | // Skip email collection if author is already set |
| 607 | if (evalRecord.author) { |
| 608 | logger.debug(`[Share] Skipping email collection because author is already set`, { |
| 609 | evalId: evalRecord.id, |
| 610 | }); |
| 611 | return; |
| 612 | } |
| 613 | |
| 614 | if (!process.stdout.isTTY || isCI() || getEnvBool('PROMPTFOO_DISABLE_SHARE_EMAIL_REQUEST')) { |
| 615 | return; |
| 616 | } |
| 617 | |
| 618 | let email = getUserEmail(); |
| 619 | if (!email) { |
| 620 | email = await input({ |
| 621 | message: `${chalk.bold('Please enter your work email address')} (for managing shared URLs):`, |
| 622 | validate: (value) => value.includes('@') || 'Please enter a valid email address', |
| 623 | }); |
| 624 | setUserEmail(email); |
| 625 | } |
| 626 | |
| 627 | evalRecord.author = email; |
| 628 | await evalRecord.save(); |
| 629 | } |
| 630 | |
| 631 | async function getApiConfig(evalRecord: Eval): Promise<{ |
| 632 | url: string; |
no test coverage detected
searching dependent graphs…