MCPcopy
hub / github.com/promptfoo/promptfoo / handleEmailCollection

Function handleEmailCollection

src/share.ts:605–629  ·  view source on GitHub ↗
(evalRecord: Eval)

Source from the content-addressed store, hash-verified

603}
604
605async 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
631async function getApiConfig(evalRecord: Eval): Promise<{
632 url: string;

Callers 1

createShareableUrlFunction · 0.85

Calls 5

isCIFunction · 0.90
getEnvBoolFunction · 0.90
getUserEmailFunction · 0.90
setUserEmailFunction · 0.90
saveMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…