@validate.qa/runner 1.0.92 → 1.0.94
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +319 -34
- package/dist/cli.mjs +319 -34
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -8560,6 +8560,162 @@ var require_scrub_credentials = __commonJS({
|
|
|
8560
8560
|
}
|
|
8561
8561
|
});
|
|
8562
8562
|
|
|
8563
|
+
// ../runner-core/dist/services/google-signin.js
|
|
8564
|
+
var require_google_signin = __commonJS({
|
|
8565
|
+
"../runner-core/dist/services/google-signin.js"(exports) {
|
|
8566
|
+
"use strict";
|
|
8567
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8568
|
+
exports.GOOGLE_SIGNIN_ENV_KEYS = exports.GOOGLE_SIGNIN_PASSWORD_KEY = void 0;
|
|
8569
|
+
exports.loadGoogleSignInConfig = loadGoogleSignInConfig;
|
|
8570
|
+
exports.mergeGoogleSignInSecrets = mergeGoogleSignInSecrets;
|
|
8571
|
+
exports.googleSignInGuidanceOpts = googleSignInGuidanceOpts;
|
|
8572
|
+
exports.googleSignInAllowedEmails = googleSignInAllowedEmails;
|
|
8573
|
+
exports.collectGoogleSignInEnv = collectGoogleSignInEnv;
|
|
8574
|
+
exports.isGoogleAccountsUrl = isGoogleAccountsUrl;
|
|
8575
|
+
exports.googleSignInCredentialMismatch = googleSignInCredentialMismatch;
|
|
8576
|
+
exports.generateTotp = generateTotp;
|
|
8577
|
+
exports.buildGoogleSignInPromptSection = buildGoogleSignInPromptSection;
|
|
8578
|
+
var node_crypto_1 = __require("crypto");
|
|
8579
|
+
exports.GOOGLE_SIGNIN_PASSWORD_KEY = "GOOGLE_SIGNIN_PASSWORD";
|
|
8580
|
+
var APP_REGISTER_CREDENTIAL_KEYS = /^(TEST_|E2E_|QA_)?(USER_?EMAIL|USER_?PASSWORD|USER_?NAME|USERNAME)$/i;
|
|
8581
|
+
exports.GOOGLE_SIGNIN_ENV_KEYS = [
|
|
8582
|
+
"GOOGLE_SIGNIN_PASSWORD",
|
|
8583
|
+
"GOOGLE_SIGNIN_EMAIL",
|
|
8584
|
+
"GOOGLE_SIGNIN_TOTP_SECRET"
|
|
8585
|
+
];
|
|
8586
|
+
function trimEnv(env, name) {
|
|
8587
|
+
const value = env[name]?.trim();
|
|
8588
|
+
return value ? value : void 0;
|
|
8589
|
+
}
|
|
8590
|
+
function loadGoogleSignInConfig(env = process.env) {
|
|
8591
|
+
const password = trimEnv(env, "GOOGLE_SIGNIN_PASSWORD");
|
|
8592
|
+
if (!password)
|
|
8593
|
+
return null;
|
|
8594
|
+
const email = (trimEnv(env, "GOOGLE_SIGNIN_EMAIL") ?? trimEnv(env, "VERIFICATION_INBOX_ADDRESS"))?.toLowerCase();
|
|
8595
|
+
if (!email || !email.includes("@"))
|
|
8596
|
+
return null;
|
|
8597
|
+
const totpSecret = trimEnv(env, "GOOGLE_SIGNIN_TOTP_SECRET");
|
|
8598
|
+
return {
|
|
8599
|
+
email,
|
|
8600
|
+
password,
|
|
8601
|
+
passwordKey: exports.GOOGLE_SIGNIN_PASSWORD_KEY,
|
|
8602
|
+
totpSecret,
|
|
8603
|
+
totpAvailable: !!totpSecret
|
|
8604
|
+
};
|
|
8605
|
+
}
|
|
8606
|
+
function mergeGoogleSignInSecrets(credentials, env = process.env) {
|
|
8607
|
+
const cfg = loadGoogleSignInConfig(env);
|
|
8608
|
+
if (!cfg)
|
|
8609
|
+
return credentials;
|
|
8610
|
+
if (credentials[exports.GOOGLE_SIGNIN_PASSWORD_KEY])
|
|
8611
|
+
return credentials;
|
|
8612
|
+
return { ...credentials, [exports.GOOGLE_SIGNIN_PASSWORD_KEY]: cfg.password };
|
|
8613
|
+
}
|
|
8614
|
+
function googleSignInGuidanceOpts(env = process.env) {
|
|
8615
|
+
const cfg = loadGoogleSignInConfig(env);
|
|
8616
|
+
if (!cfg)
|
|
8617
|
+
return void 0;
|
|
8618
|
+
return {
|
|
8619
|
+
googleEmail: cfg.email,
|
|
8620
|
+
googlePasswordKey: cfg.passwordKey,
|
|
8621
|
+
googleTotpAvailable: cfg.totpAvailable
|
|
8622
|
+
};
|
|
8623
|
+
}
|
|
8624
|
+
function googleSignInAllowedEmails(env = process.env) {
|
|
8625
|
+
const cfg = loadGoogleSignInConfig(env);
|
|
8626
|
+
return cfg ? [cfg.email] : [];
|
|
8627
|
+
}
|
|
8628
|
+
function collectGoogleSignInEnv(env = process.env) {
|
|
8629
|
+
const out = {};
|
|
8630
|
+
for (const key of exports.GOOGLE_SIGNIN_ENV_KEYS) {
|
|
8631
|
+
const value = env[key]?.trim();
|
|
8632
|
+
if (value)
|
|
8633
|
+
out[key] = value;
|
|
8634
|
+
}
|
|
8635
|
+
return out;
|
|
8636
|
+
}
|
|
8637
|
+
function isGoogleAccountsUrl(url) {
|
|
8638
|
+
if (!url)
|
|
8639
|
+
return false;
|
|
8640
|
+
try {
|
|
8641
|
+
const host = new URL(url).hostname.toLowerCase();
|
|
8642
|
+
return host === "accounts.google.com" || host.endsWith(".google.com") && host.includes("accounts");
|
|
8643
|
+
} catch {
|
|
8644
|
+
return /accounts\.google\.com/i.test(url);
|
|
8645
|
+
}
|
|
8646
|
+
}
|
|
8647
|
+
function googleSignInCredentialMismatch(pageUrl, credentialKey, opts) {
|
|
8648
|
+
const configured = opts?.configured ?? !!loadGoogleSignInConfig(opts?.env);
|
|
8649
|
+
if (!configured)
|
|
8650
|
+
return null;
|
|
8651
|
+
const onGoogle = isGoogleAccountsUrl(pageUrl);
|
|
8652
|
+
if (onGoogle) {
|
|
8653
|
+
if (credentialKey === exports.GOOGLE_SIGNIN_PASSWORD_KEY)
|
|
8654
|
+
return null;
|
|
8655
|
+
if (APP_REGISTER_CREDENTIAL_KEYS.test(credentialKey)) {
|
|
8656
|
+
return `fill_credential: this is Google account login (accounts.google.com), not app email signup. Do not use ${credentialKey}. Type the BARE Google email with browser_type, then fill_credential with credentialKey ${exports.GOOGLE_SIGNIN_PASSWORD_KEY}. Do not click Continue with phone / SMS OTP when Continue with Google is available.`;
|
|
8657
|
+
}
|
|
8658
|
+
return null;
|
|
8659
|
+
}
|
|
8660
|
+
if (credentialKey === exports.GOOGLE_SIGNIN_PASSWORD_KEY) {
|
|
8661
|
+
return `fill_credential: ${exports.GOOGLE_SIGNIN_PASSWORD_KEY} is only for accounts.google.com. Click Continue with Google first (not Continue with phone). Phone / "Mobile or email" is not app email signup.`;
|
|
8662
|
+
}
|
|
8663
|
+
return null;
|
|
8664
|
+
}
|
|
8665
|
+
function generateTotp(secret, atMs = Date.now(), stepSeconds = 30, digits = 6) {
|
|
8666
|
+
const key = decodeBase32(secret);
|
|
8667
|
+
const counter = Math.floor(atMs / 1e3 / stepSeconds);
|
|
8668
|
+
const buf = Buffer.alloc(8);
|
|
8669
|
+
buf.writeUInt32BE(Math.floor(counter / 4294967296), 0);
|
|
8670
|
+
buf.writeUInt32BE(counter >>> 0, 4);
|
|
8671
|
+
const hmac = (0, node_crypto_1.createHmac)("sha1", key).update(buf).digest();
|
|
8672
|
+
const offset = hmac[hmac.length - 1] & 15;
|
|
8673
|
+
const bin = (hmac[offset] & 127) << 24 | hmac[offset + 1] << 16 | hmac[offset + 2] << 8 | hmac[offset + 3];
|
|
8674
|
+
const otp = bin % 10 ** digits;
|
|
8675
|
+
return String(otp).padStart(digits, "0");
|
|
8676
|
+
}
|
|
8677
|
+
function decodeBase32(input) {
|
|
8678
|
+
const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
|
|
8679
|
+
const cleaned = input.toUpperCase().replace(/[\s=-]+/g, "");
|
|
8680
|
+
let bits = 0;
|
|
8681
|
+
let value = 0;
|
|
8682
|
+
const out = [];
|
|
8683
|
+
for (const ch of cleaned) {
|
|
8684
|
+
const idx = alphabet.indexOf(ch);
|
|
8685
|
+
if (idx < 0)
|
|
8686
|
+
continue;
|
|
8687
|
+
value = value << 5 | idx;
|
|
8688
|
+
bits += 5;
|
|
8689
|
+
if (bits >= 8) {
|
|
8690
|
+
bits -= 8;
|
|
8691
|
+
out.push(value >>> bits & 255);
|
|
8692
|
+
}
|
|
8693
|
+
}
|
|
8694
|
+
return Buffer.from(out);
|
|
8695
|
+
}
|
|
8696
|
+
function buildGoogleSignInPromptSection(opts, variant) {
|
|
8697
|
+
const totpNative = opts.googleTotpAvailable ? " If Google asks for a 2-step / Authenticator code, call `provision_google_totp` and type the 6-digit `code` it returns (do not invent a code)." : " If Google asks for 2-step verification and you have no authenticator code tool, STOP and report Google SSO as BLOCKED (2FA not configured on this runner).";
|
|
8698
|
+
const totpCli = opts.googleTotpAvailable ? " If Google asks for a 2-step / Authenticator code, call `inbox_google_totp` and type the 6-digit `code` it returns." : " If Google asks for 2-step verification, STOP and report Google SSO as BLOCKED (2FA not configured on this runner).";
|
|
8699
|
+
const totp = variant === "cli" ? totpCli : totpNative;
|
|
8700
|
+
const fill = variant === "cli" ? `fill_credential with credentialKey \`${opts.googlePasswordKey}\`` : `\`fill_credential\` (credentialKey \`${opts.googlePasswordKey}\`)`;
|
|
8701
|
+
const plainProvision = variant === "cli" ? "`inbox_provision_identity` with `plain: true`" : "`provision_identity` with `plain: true`";
|
|
8702
|
+
return `
|
|
8703
|
+
Google / Gmail SSO (use this when the APP has no Create-account email form):
|
|
8704
|
+
- App email+password SIGNUP means a form ON THIS APP to create an account (Sign up / Create account / Register, including after "Sign up with email"). That is FIRST. Do not use Google if that form exists.
|
|
8705
|
+
- These are NOT app email signup \u2014 do not treat them as the email playbook, and do not fill TEST_USER_EMAIL / TEST_USER_PASSWORD into them when Continue with Google is available:
|
|
8706
|
+
- "Continue with phone" / SMS / OTP
|
|
8707
|
+
- "Mobile or email" / phone-number identity on a Sign in page
|
|
8708
|
+
- Google's own email and password fields on accounts.google.com
|
|
8709
|
+
- If Sign in offers Continue with Google (and there is no app Create-account email form): click Continue with Google. Do NOT click Continue with phone for this registration.
|
|
8710
|
+
- If a Google popup or tab opens, switch to it. On accounts.google.com, type the BARE Google account email \`${opts.googleEmail}\` (no plus-tag) with browser_type, click Next, then fill the Google password with ${fill}. NEVER type the Google password as text, NEVER use TEST_USER_PASSWORD here, NEVER use the IMAP app password.
|
|
8711
|
+
- Click Next.${totp}
|
|
8712
|
+
- Click Continue / Allow on any consent screen, then return to the app tab.
|
|
8713
|
+
- If the app then emails a verification code/link, first call ${plainProvision} (Google SSO uses the bare inbox address, not the +tag), then complete it with the inbox tools as usual.
|
|
8714
|
+
- Register / Google-sign-in ONCE per run. If Google says the account is already used on this app, that is success \u2014 continue as the logged-in user.`;
|
|
8715
|
+
}
|
|
8716
|
+
}
|
|
8717
|
+
});
|
|
8718
|
+
|
|
8563
8719
|
// ../runner-core/dist/services/credential-tools.js
|
|
8564
8720
|
var require_credential_tools = __commonJS({
|
|
8565
8721
|
"../runner-core/dist/services/credential-tools.js"(exports) {
|
|
@@ -8578,17 +8734,18 @@ var require_credential_tools = __commonJS({
|
|
|
8578
8734
|
exports.mcpResultIsError = mcpResultIsError;
|
|
8579
8735
|
exports.aggressiveScrubCredentials = aggressiveScrubCredentials;
|
|
8580
8736
|
var scrub_credentials_js_1 = require_scrub_credentials();
|
|
8737
|
+
var google_signin_js_1 = require_google_signin();
|
|
8581
8738
|
exports.FILL_CREDENTIAL_TOOL = {
|
|
8582
8739
|
type: "function",
|
|
8583
8740
|
function: {
|
|
8584
8741
|
name: "fill_credential",
|
|
8585
|
-
description: 'Fill a stored credential VALUE into a form field. ALWAYS use this instead of `browser_type` for ANY email/password/token/auth field. You pass the variable KEY (e.g. "TEST_USER_EMAIL") and the runner injects the real value server-side \u2014 you never see the secret. The list of available credential keys is in the system prompt.',
|
|
8742
|
+
description: 'Fill a stored credential VALUE into a form field. ALWAYS use this instead of `browser_type` for ANY email/password/token/auth field. You pass the variable KEY (e.g. "TEST_USER_EMAIL") and the runner injects the real value server-side \u2014 you never see the secret. On accounts.google.com use GOOGLE_SIGNIN_PASSWORD (never TEST_USER_PASSWORD). The list of available credential keys is in the system prompt.',
|
|
8586
8743
|
parameters: {
|
|
8587
8744
|
type: "object",
|
|
8588
8745
|
properties: {
|
|
8589
8746
|
credentialKey: {
|
|
8590
8747
|
type: "string",
|
|
8591
|
-
description: 'The credential variable name (e.g. "TEST_USER_EMAIL", "TEST_USER_PASSWORD", "
|
|
8748
|
+
description: 'The credential variable name (e.g. "TEST_USER_EMAIL", "TEST_USER_PASSWORD", "GOOGLE_SIGNIN_PASSWORD"). Must be one of the keys listed in the Test Credentials section of the prompt.'
|
|
8592
8749
|
},
|
|
8593
8750
|
element: {
|
|
8594
8751
|
type: "string",
|
|
@@ -8744,6 +8901,22 @@ CREDENTIAL ROTATION (required when the STORED user's secret changes \u2014 read
|
|
|
8744
8901
|
return entries.map(([k, v]) => `- **${k}**: \`${v}\``).join("\n");
|
|
8745
8902
|
}
|
|
8746
8903
|
var DEFAULT_MAX_RESULT_CHARS = 15e3;
|
|
8904
|
+
var PAGE_URL_RE = /Page URL:\s*(\S+)/i;
|
|
8905
|
+
async function peekPageUrl(mcpClient) {
|
|
8906
|
+
try {
|
|
8907
|
+
const mcpResult = await mcpClient.callTool({ name: "browser_snapshot", arguments: {} });
|
|
8908
|
+
const { text } = parseMcpContent(mcpResult);
|
|
8909
|
+
const match = text.match(PAGE_URL_RE);
|
|
8910
|
+
return match?.[1]?.replace(/[),.;]+$/, "");
|
|
8911
|
+
} catch {
|
|
8912
|
+
return void 0;
|
|
8913
|
+
}
|
|
8914
|
+
}
|
|
8915
|
+
function googleFillBlocked(pageUrl, credentialKey, credentials) {
|
|
8916
|
+
return (0, google_signin_js_1.googleSignInCredentialMismatch)(pageUrl, credentialKey, {
|
|
8917
|
+
configured: !!credentials[google_signin_js_1.GOOGLE_SIGNIN_PASSWORD_KEY]
|
|
8918
|
+
});
|
|
8919
|
+
}
|
|
8747
8920
|
async function handleFillCredential(toolArgs, ctx) {
|
|
8748
8921
|
const key = typeof toolArgs.credentialKey === "string" ? toolArgs.credentialKey : "";
|
|
8749
8922
|
const element = typeof toolArgs.element === "string" ? toolArgs.element : "";
|
|
@@ -8765,6 +8938,13 @@ CREDENTIAL ROTATION (required when the STORED user's secret changes \u2014 read
|
|
|
8765
8938
|
didMutate: false
|
|
8766
8939
|
};
|
|
8767
8940
|
}
|
|
8941
|
+
if (ctx.credentials[google_signin_js_1.GOOGLE_SIGNIN_PASSWORD_KEY]) {
|
|
8942
|
+
const pageUrl = await peekPageUrl(ctx.mcpClient);
|
|
8943
|
+
const blocked = googleFillBlocked(pageUrl, key, ctx.credentials);
|
|
8944
|
+
if (blocked) {
|
|
8945
|
+
return { content: JSON.stringify({ error: blocked }), didMutate: false };
|
|
8946
|
+
}
|
|
8947
|
+
}
|
|
8768
8948
|
const underlyingArgs = { element, ref, text: value, submit };
|
|
8769
8949
|
const mcpResult = await ctx.mcpClient.callTool({ name: "browser_type", arguments: underlyingArgs });
|
|
8770
8950
|
const mcpFailed = mcpResultIsError(mcpResult);
|
|
@@ -8803,6 +8983,16 @@ CREDENTIAL ROTATION (required when the STORED user's secret changes \u2014 read
|
|
|
8803
8983
|
}
|
|
8804
8984
|
resolved.push({ field, value });
|
|
8805
8985
|
}
|
|
8986
|
+
if (ctx.credentials[google_signin_js_1.GOOGLE_SIGNIN_PASSWORD_KEY]) {
|
|
8987
|
+
const pageUrl = await peekPageUrl(ctx.mcpClient);
|
|
8988
|
+
for (const f of fields) {
|
|
8989
|
+
const key = typeof f.credentialKey === "string" ? f.credentialKey : typeof f.key === "string" ? f.key : "";
|
|
8990
|
+
const blocked = googleFillBlocked(pageUrl, key, ctx.credentials);
|
|
8991
|
+
if (blocked) {
|
|
8992
|
+
return { content: JSON.stringify({ error: blocked }), didMutate: false };
|
|
8993
|
+
}
|
|
8994
|
+
}
|
|
8995
|
+
}
|
|
8806
8996
|
if (missing.length > 0) {
|
|
8807
8997
|
const available = Object.keys(ctx.credentials).filter((k) => ctx.credentials[k]).join(", ") || "(none configured)";
|
|
8808
8998
|
return {
|
|
@@ -8854,6 +9044,14 @@ CREDENTIAL ROTATION (required when the STORED user's secret changes \u2014 read
|
|
|
8854
9044
|
didMutate: false
|
|
8855
9045
|
};
|
|
8856
9046
|
}
|
|
9047
|
+
if (key === google_signin_js_1.GOOGLE_SIGNIN_PASSWORD_KEY) {
|
|
9048
|
+
return {
|
|
9049
|
+
content: JSON.stringify({
|
|
9050
|
+
error: "set_credential: GOOGLE_SIGNIN_PASSWORD is a runner-operator secret and cannot be persisted to project Test Data"
|
|
9051
|
+
}),
|
|
9052
|
+
didMutate: false
|
|
9053
|
+
};
|
|
9054
|
+
}
|
|
8857
9055
|
if (!(key in ctx.credentials)) {
|
|
8858
9056
|
const available = Object.keys(ctx.credentials).filter((k) => ctx.credentials[k]).join(", ") || "(none configured)";
|
|
8859
9057
|
return {
|
|
@@ -74115,7 +74313,7 @@ var require_inbox_tools = __commonJS({
|
|
|
74115
74313
|
"../runner-core/dist/services/inbox-tools.js"(exports) {
|
|
74116
74314
|
"use strict";
|
|
74117
74315
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
74118
|
-
exports.EMAIL_VERIFICATION_UNAVAILABLE_OVERRIDE_BLOCK = exports.INBOX_TOOL_NAMES = exports.INBOX_TOOLS = exports.OPEN_VERIFICATION_LINK_TOOL = exports.GET_VERIFICATION_LINK_TOOL = exports.EXTRACT_VERIFICATION_CODE_TOOL = exports.READ_VERIFICATION_EMAIL_TOOL = exports.WAIT_FOR_VERIFICATION_TOOL = exports.CHECK_INBOX_TOOL = exports.PROVISION_IDENTITY_TOOL = void 0;
|
|
74316
|
+
exports.EMAIL_VERIFICATION_UNAVAILABLE_OVERRIDE_BLOCK = exports.INBOX_TOOL_NAMES = exports.INBOX_TOOLS = exports.PROVISION_GOOGLE_TOTP_TOOL = exports.OPEN_VERIFICATION_LINK_TOOL = exports.GET_VERIFICATION_LINK_TOOL = exports.EXTRACT_VERIFICATION_CODE_TOOL = exports.READ_VERIFICATION_EMAIL_TOOL = exports.WAIT_FOR_VERIFICATION_TOOL = exports.CHECK_INBOX_TOOL = exports.PROVISION_IDENTITY_TOOL = void 0;
|
|
74119
74317
|
exports.createInboxRunState = createInboxRunState;
|
|
74120
74318
|
exports.dispatchInboxTool = dispatchInboxTool;
|
|
74121
74319
|
exports.isPublicHttpUrl = isPublicHttpUrl;
|
|
@@ -74130,6 +74328,7 @@ var require_inbox_tools = __commonJS({
|
|
|
74130
74328
|
exports.clearThrowawayRegisterSeed = clearThrowawayRegisterSeed;
|
|
74131
74329
|
exports.buildInboxAgentsGuidance = buildInboxAgentsGuidance;
|
|
74132
74330
|
var verification_inbox_js_1 = require_verification_inbox();
|
|
74331
|
+
var google_signin_js_1 = require_google_signin();
|
|
74133
74332
|
function createInboxRunState(config, opts = {}) {
|
|
74134
74333
|
const baseEmail = config.address;
|
|
74135
74334
|
const tag = opts.tag !== void 0 ? opts.tag : opts.tagSeed ? (0, verification_inbox_js_1.deriveProjectInboxTag)(opts.tagSeed, opts.projectScope) : null;
|
|
@@ -74251,6 +74450,14 @@ var require_inbox_tools = __commonJS({
|
|
|
74251
74450
|
}
|
|
74252
74451
|
}
|
|
74253
74452
|
};
|
|
74453
|
+
exports.PROVISION_GOOGLE_TOTP_TOOL = {
|
|
74454
|
+
type: "function",
|
|
74455
|
+
function: {
|
|
74456
|
+
name: "provision_google_totp",
|
|
74457
|
+
description: "Return a one-time 6-digit Authenticator code for the operator Google account. Call this ONLY when Google Sign-In shows a 2-step / Authenticator challenge after you submitted the Google password. Type the returned code into the Google prompt. Do not invent a code.",
|
|
74458
|
+
parameters: { type: "object", properties: {} }
|
|
74459
|
+
}
|
|
74460
|
+
};
|
|
74254
74461
|
exports.INBOX_TOOLS = [
|
|
74255
74462
|
exports.PROVISION_IDENTITY_TOOL,
|
|
74256
74463
|
exports.CHECK_INBOX_TOOL,
|
|
@@ -74258,7 +74465,8 @@ var require_inbox_tools = __commonJS({
|
|
|
74258
74465
|
exports.READ_VERIFICATION_EMAIL_TOOL,
|
|
74259
74466
|
exports.EXTRACT_VERIFICATION_CODE_TOOL,
|
|
74260
74467
|
exports.GET_VERIFICATION_LINK_TOOL,
|
|
74261
|
-
exports.OPEN_VERIFICATION_LINK_TOOL
|
|
74468
|
+
exports.OPEN_VERIFICATION_LINK_TOOL,
|
|
74469
|
+
exports.PROVISION_GOOGLE_TOTP_TOOL
|
|
74262
74470
|
];
|
|
74263
74471
|
exports.INBOX_TOOL_NAMES = new Set(exports.INBOX_TOOLS.map((t) => t.function.name));
|
|
74264
74472
|
var DEFAULT_MAX_RESULT_CHARS = 8e3;
|
|
@@ -74270,7 +74478,7 @@ var require_inbox_tools = __commonJS({
|
|
|
74270
74478
|
}
|
|
74271
74479
|
var INBOX_AUTH_DEAD_GUIDANCE = "the inbox authentication is PERMANENTLY rejected (revoked/wrong app password) \u2014 STOP calling inbox tools; none of them can succeed this run. Treat email verification as UNAVAILABLE: hard-stop at any emailed code/link wall, NEVER type a guessed code, and report verification-gated flows as BLOCKED (blockedReason: inbox authentication failed). Continue with publicly reachable coverage.";
|
|
74272
74480
|
async function dispatchInboxTool(toolName, toolArgs, ctx) {
|
|
74273
|
-
if (ctx.state.authDead) {
|
|
74481
|
+
if (ctx.state.authDead && toolName !== "provision_google_totp") {
|
|
74274
74482
|
return err(`${toolName} skipped: ${INBOX_AUTH_DEAD_GUIDANCE}`);
|
|
74275
74483
|
}
|
|
74276
74484
|
try {
|
|
@@ -74289,6 +74497,8 @@ var require_inbox_tools = __commonJS({
|
|
|
74289
74497
|
return await handleGetLink(toolArgs, ctx);
|
|
74290
74498
|
case "open_verification_link":
|
|
74291
74499
|
return await handleOpenLink(toolArgs, ctx);
|
|
74500
|
+
case "provision_google_totp":
|
|
74501
|
+
return handleProvisionGoogleTotp();
|
|
74292
74502
|
default:
|
|
74293
74503
|
return err(`inbox dispatch: unknown tool "${toolName}"`);
|
|
74294
74504
|
}
|
|
@@ -74464,6 +74674,20 @@ var require_inbox_tools = __commonJS({
|
|
|
74464
74674
|
didMutate: !failed
|
|
74465
74675
|
};
|
|
74466
74676
|
}
|
|
74677
|
+
function handleProvisionGoogleTotp(env = process.env) {
|
|
74678
|
+
const cfg = (0, google_signin_js_1.loadGoogleSignInConfig)(env);
|
|
74679
|
+
if (!cfg) {
|
|
74680
|
+
return err("Google SSO is not configured on this runner (GOOGLE_SIGNIN_PASSWORD unset). Prefer email-field signup, or report Google SSO as BLOCKED.");
|
|
74681
|
+
}
|
|
74682
|
+
if (!cfg.totpSecret) {
|
|
74683
|
+
return err("Google Authenticator 2FA is not configured on this runner (GOOGLE_SIGNIN_TOTP_SECRET unset). STOP and report Google SSO as BLOCKED (2FA not configured).");
|
|
74684
|
+
}
|
|
74685
|
+
return ok({
|
|
74686
|
+
code: (0, google_signin_js_1.generateTotp)(cfg.totpSecret),
|
|
74687
|
+
digits: 6,
|
|
74688
|
+
instructions: "Type this 6-digit code into the Google 2-step / Authenticator prompt. Do not reuse it later \u2014 call this tool again if Google asks for another code."
|
|
74689
|
+
});
|
|
74690
|
+
}
|
|
74467
74691
|
function requireProvisioned(ctx) {
|
|
74468
74692
|
if (ctx.state.provisioned)
|
|
74469
74693
|
return null;
|
|
@@ -74598,7 +74822,7 @@ var require_inbox_tools = __commonJS({
|
|
|
74598
74822
|
${where} You register using ONE real, monitored email (\`${opts.email}\`) and can complete email-verification (OTP code or confirmation link) end-to-end. This OVERRIDES the general "do not submit forms" rule for the signup/registration form ONLY.
|
|
74599
74823
|
|
|
74600
74824
|
Steps:
|
|
74601
|
-
1. Navigate to the Sign Up / Register page (click the link in the UI).
|
|
74825
|
+
1. Navigate to the Sign Up / Register / Sign in page (click the link in the UI). FIRST look for an app Create-account email+password form (including after "Sign up with email").${opts.googleEmail && opts.googlePasswordKey ? ' "Continue with phone", SMS OTP, and "Mobile or email" on a Sign in page are NOT that form \u2014 if Continue with Google is offered and there is no app Create-account email form, use the Google / Gmail SSO playbook below (do not click Continue with phone).' : ""}
|
|
74602
74826
|
2. Call \`provision_identity\` \u2192 it returns the email to register with (\`${opts.email}\`). The \`+\` part is a normal sub-address that still lands in our inbox.
|
|
74603
74827
|
3. Fill the signup form: type that email into the email field with \`browser_type\` (this generated inbox email is intentionally visible and is allowed for registration); fill the password field with single-field \`fill_credential\` (credentialKey \`${opts.passwordKey}\`); fill any name/other required fields with simple test values. Do NOT use \`fill_credential_form\` for registration.
|
|
74604
74828
|
- If the form REJECTS the email (says "invalid email" / will not accept the "+"), call \`provision_identity\` again with \`plain: true\` and use the bare address it returns instead.
|
|
@@ -74616,6 +74840,11 @@ Rules:
|
|
|
74616
74840
|
- The provisioned email is reused for this project; if signup says it is ALREADY registered, the account already exists \u2014 log in with that email + the \`${opts.passwordKey}\` password instead of registering again.
|
|
74617
74841
|
- You register ONCE per run. After you submit the signup form in step 4, NEVER submit it again and NEVER create a second account \u2014 even if verification is slow, even if a later login attempt fails. Recover by re-polling \`wait_for_verification\` (and at most one "Resend"), not by re-registering.
|
|
74618
74842
|
- Only call the verification tools AFTER submitting the signup form, and pass the site as \`senderMatch\` so you read YOUR verification email (the inbox is shared).
|
|
74843
|
+
${opts.googleEmail && opts.googlePasswordKey ? (0, google_signin_js_1.buildGoogleSignInPromptSection)({
|
|
74844
|
+
googleEmail: opts.googleEmail,
|
|
74845
|
+
googlePasswordKey: opts.googlePasswordKey,
|
|
74846
|
+
googleTotpAvailable: opts.googleTotpAvailable
|
|
74847
|
+
}, "native") : ""}
|
|
74619
74848
|
`;
|
|
74620
74849
|
}
|
|
74621
74850
|
exports.EMAIL_VERIFICATION_UNAVAILABLE_OVERRIDE_BLOCK = `## EMAIL VERIFICATION UNAVAILABLE \u2014 FINAL OVERRIDE (supersedes any instruction above)
|
|
@@ -74770,11 +74999,12 @@ This project asked to REGISTER a new account, but this runner CANNOT receive ema
|
|
|
74770
74999
|
}
|
|
74771
75000
|
return false;
|
|
74772
75001
|
}
|
|
74773
|
-
function buildInboxAgentsGuidance(email, passwordKey) {
|
|
75002
|
+
function buildInboxAgentsGuidance(email, passwordKey, google) {
|
|
75003
|
+
const googleBlock = google ? (0, google_signin_js_1.buildGoogleSignInPromptSection)(google, "cli") : "";
|
|
74774
75004
|
return `## Account registration & email verification (ENABLED)
|
|
74775
75005
|
This run registers a new account using our ONE real, monitored inbox (the address \`${email}\` \u2014 the "+" part is a normal sub-address that still lands in our inbox) and can complete email verification end-to-end. This overrides any "do not submit forms" guidance for the signup form only.
|
|
74776
75006
|
|
|
74777
|
-
1. Go to the Sign Up / Register page.
|
|
75007
|
+
1. Go to the Sign Up / Register / Sign in page. FIRST look for an app Create-account email+password form (including after "Sign up with email").${google ? ' "Continue with phone", SMS OTP, and "Mobile or email" on a Sign in page are NOT that form \u2014 if Continue with Google is offered and there is no app Create-account email form, use the Google / Gmail SSO playbook below (do not click Continue with phone).' : ""}
|
|
74778
75008
|
2. Call \`inbox_provision_identity\` \u2192 it returns the email to register with (\`${email}\`). Type that email into the email field.
|
|
74779
75009
|
- If the form REJECTS the email (says "invalid email" / will not accept the "+"), call \`inbox_provision_identity\` with \`plain: true\` and use the bare address it returns instead.
|
|
74780
75010
|
3. Fill the password with the \`${passwordKey}\` credential (use fill_credential). Submit the signup form.
|
|
@@ -74785,6 +75015,7 @@ This run registers a new account using our ONE real, monitored inbox (the addres
|
|
|
74785
75015
|
- If it returns BOTH, try the code first; if the app insists on the link, open it, then enter the code if the page it lands on asks for one.
|
|
74786
75016
|
- Otherwise call \`inbox_read_email\` to read the body.
|
|
74787
75017
|
5. NEVER invent an email address \u2014 always use exactly what \`inbox_provision_identity\` returns. The address is reused for this project; if signup says it is already registered, log in with it + \`${passwordKey}\` instead. Register ONCE per run \u2014 never submit signup twice or make a second account; if verification is slow, re-poll \`inbox_wait_for_verification\` (at most one Resend) instead of re-registering.
|
|
75018
|
+
${googleBlock}
|
|
74788
75019
|
`;
|
|
74789
75020
|
}
|
|
74790
75021
|
}
|
|
@@ -88619,6 +88850,7 @@ var require_browser_config = __commonJS({
|
|
|
88619
88850
|
var path_1 = __require("path");
|
|
88620
88851
|
var os_1 = __require("os");
|
|
88621
88852
|
var shared_1 = (init_dist(), __toCommonJS(dist_exports));
|
|
88853
|
+
var google_signin_js_1 = require_google_signin();
|
|
88622
88854
|
exports.IS_CLOUD = (0, shared_1.parseBoolFlag)(process.env.RUNNER_CLOUD);
|
|
88623
88855
|
exports.CLOUD_ARGS = [
|
|
88624
88856
|
"--no-sandbox",
|
|
@@ -88724,6 +88956,10 @@ var require_browser_config = __commonJS({
|
|
|
88724
88956
|
(document.head || document.documentElement).appendChild(style);
|
|
88725
88957
|
|
|
88726
88958
|
// Layer 2: Web Animations API - make instant (preserves completion callbacks)
|
|
88959
|
+
try {
|
|
88960
|
+
Object.defineProperty(navigator, 'webdriver', { get: () => undefined });
|
|
88961
|
+
} catch {}
|
|
88962
|
+
|
|
88727
88963
|
const origAnimate = Element.prototype.animate;
|
|
88728
88964
|
Element.prototype.animate = function(keyframes, options) {
|
|
88729
88965
|
if (typeof options === 'object' && options !== null) {
|
|
@@ -88830,6 +89066,20 @@ var require_browser_config = __commonJS({
|
|
|
88830
89066
|
return null;
|
|
88831
89067
|
}
|
|
88832
89068
|
}
|
|
89069
|
+
function googleSsoCloudLaunch(env = process.env) {
|
|
89070
|
+
if (!(0, shared_1.parseBoolFlag)(env.RUNNER_CLOUD))
|
|
89071
|
+
return null;
|
|
89072
|
+
if (!(0, google_signin_js_1.loadGoogleSignInConfig)(env))
|
|
89073
|
+
return null;
|
|
89074
|
+
const executablePath = getFullChromiumPath();
|
|
89075
|
+
if (!executablePath)
|
|
89076
|
+
return null;
|
|
89077
|
+
return {
|
|
89078
|
+
executablePath,
|
|
89079
|
+
extraArgs: ["--headless=new"],
|
|
89080
|
+
ignoreDefaultArgs: ["--enable-automation"]
|
|
89081
|
+
};
|
|
89082
|
+
}
|
|
88833
89083
|
function getMCPBrowserConfig2(opts) {
|
|
88834
89084
|
const userDataDir = opts?.forceIsolated ? null : getTestUserDataDir2();
|
|
88835
89085
|
const headless = isHeadless2();
|
|
@@ -88853,15 +89103,21 @@ var require_browser_config = __commonJS({
|
|
|
88853
89103
|
};
|
|
88854
89104
|
}
|
|
88855
89105
|
const headlessShellPath = getHeadlessShellPath();
|
|
88856
|
-
const
|
|
89106
|
+
const googleLaunch = googleSsoCloudLaunch();
|
|
89107
|
+
const useHeadlessShell = headless && headlessShellPath && !opts?.harPath && !googleLaunch;
|
|
89108
|
+
const cloud = (0, shared_1.parseBoolFlag)(process.env.RUNNER_CLOUD);
|
|
89109
|
+
const args = [
|
|
89110
|
+
...cloud ? exports.CLOUD_ARGS : ["--disable-blink-features=AutomationControlled"],
|
|
89111
|
+
...googleLaunch?.extraArgs ?? []
|
|
89112
|
+
];
|
|
88857
89113
|
return {
|
|
88858
89114
|
browserName: "chromium",
|
|
88859
89115
|
isolated: true,
|
|
88860
89116
|
launchOptions: {
|
|
88861
|
-
headless,
|
|
88862
|
-
...useHeadlessShell ? { executablePath: headlessShellPath } : {},
|
|
89117
|
+
headless: googleLaunch ? false : headless,
|
|
89118
|
+
...googleLaunch ? { executablePath: googleLaunch.executablePath, ignoreDefaultArgs: googleLaunch.ignoreDefaultArgs } : useHeadlessShell ? { executablePath: headlessShellPath } : {},
|
|
88863
89119
|
channel: "",
|
|
88864
|
-
args
|
|
89120
|
+
args,
|
|
88865
89121
|
...slowMo > 0 ? { slowMo } : {}
|
|
88866
89122
|
},
|
|
88867
89123
|
contextOptions: {
|
|
@@ -88874,15 +89130,21 @@ var require_browser_config = __commonJS({
|
|
|
88874
89130
|
function getPlaywrightLaunchOptions2(withProfile = false, extraArgs) {
|
|
88875
89131
|
const headless = isHeadless2();
|
|
88876
89132
|
const slowMo = getSlowMoMs();
|
|
89133
|
+
const googleLaunch = googleSsoCloudLaunch();
|
|
88877
89134
|
const baseArgs = exports.IS_CLOUD ? exports.CLOUD_ARGS : [
|
|
88878
89135
|
"--disable-blink-features=AutomationControlled"
|
|
88879
89136
|
];
|
|
88880
|
-
const mergedArgs =
|
|
89137
|
+
const mergedArgs = [
|
|
89138
|
+
...baseArgs,
|
|
89139
|
+
...googleLaunch?.extraArgs ?? [],
|
|
89140
|
+
...extraArgs && extraArgs.length > 0 ? extraArgs : []
|
|
89141
|
+
];
|
|
88881
89142
|
return {
|
|
88882
|
-
headless,
|
|
89143
|
+
headless: googleLaunch ? false : headless,
|
|
88883
89144
|
// Use Chrome channel only when a real Chrome user profile is being loaded.
|
|
88884
89145
|
// In isolated mode, bundled Chromium avoids hard dependency on Chrome installation.
|
|
88885
89146
|
...exports.IS_CLOUD || !withProfile ? {} : { channel: "chrome" },
|
|
89147
|
+
...googleLaunch ? { executablePath: googleLaunch.executablePath, ignoreDefaultArgs: googleLaunch.ignoreDefaultArgs } : {},
|
|
88886
89148
|
args: mergedArgs,
|
|
88887
89149
|
...slowMo > 0 ? { slowMo } : {}
|
|
88888
89150
|
};
|
|
@@ -320224,6 +320486,7 @@ var require_playwright_mcp_config = __commonJS({
|
|
|
320224
320486
|
var promises_1 = __require("fs/promises");
|
|
320225
320487
|
var node_path_1 = __require("path");
|
|
320226
320488
|
var browser_config_js_1 = require_browser_config();
|
|
320489
|
+
var google_signin_js_1 = require_google_signin();
|
|
320227
320490
|
var PLAYWRIGHT_MCP_VERSION = "0.0.68";
|
|
320228
320491
|
var INBOX_SECRET_ENV_KEYS = [
|
|
320229
320492
|
"VERIFICATION_INBOX_HOST",
|
|
@@ -320233,7 +320496,10 @@ var require_playwright_mcp_config = __commonJS({
|
|
|
320233
320496
|
"VERIFICATION_INBOX_PASSWORD",
|
|
320234
320497
|
"VERIFICATION_INBOX_ADDRESS",
|
|
320235
320498
|
"VERIFICATION_INBOX_MAILBOX",
|
|
320236
|
-
"VERIFICATION_INBOX_EXTRA_MAILBOXES"
|
|
320499
|
+
"VERIFICATION_INBOX_EXTRA_MAILBOXES",
|
|
320500
|
+
"GOOGLE_SIGNIN_PASSWORD",
|
|
320501
|
+
"GOOGLE_SIGNIN_EMAIL",
|
|
320502
|
+
"GOOGLE_SIGNIN_TOTP_SECRET"
|
|
320237
320503
|
];
|
|
320238
320504
|
function collectInboxSecretEnv() {
|
|
320239
320505
|
const out = {};
|
|
@@ -320274,12 +320540,13 @@ var require_playwright_mcp_config = __commonJS({
|
|
|
320274
320540
|
const body = cfg.format === "json" ? buildJsonConfig(cfg) : buildTomlConfig(cfg);
|
|
320275
320541
|
await (0, promises_1.writeFile)(cfg.configPath, body, { encoding: "utf8", mode: 384 });
|
|
320276
320542
|
if (!cfg.cdpEndpoint && browser_config_js_1.IS_CLOUD) {
|
|
320543
|
+
const launchOptions = (0, browser_config_js_1.getMCPBrowserConfig)({ forceIsolated: true }).launchOptions ?? {
|
|
320544
|
+
headless: true,
|
|
320545
|
+
args: [...browser_config_js_1.CLOUD_ARGS]
|
|
320546
|
+
};
|
|
320277
320547
|
const browserConfig = {
|
|
320278
320548
|
browser: {
|
|
320279
|
-
launchOptions
|
|
320280
|
-
headless: true,
|
|
320281
|
-
args: [...browser_config_js_1.CLOUD_ARGS]
|
|
320282
|
-
}
|
|
320549
|
+
launchOptions
|
|
320283
320550
|
}
|
|
320284
320551
|
};
|
|
320285
320552
|
await (0, promises_1.writeFile)(mcpBrowserConfigPath(cfg.configPath), JSON.stringify(browserConfig, null, 2) + "\n", { encoding: "utf8", mode: 384 });
|
|
@@ -320303,7 +320570,11 @@ var require_playwright_mcp_config = __commonJS({
|
|
|
320303
320570
|
];
|
|
320304
320571
|
if (cfg.includeCredentialServer && cfg.cdpEndpoint) {
|
|
320305
320572
|
const serverJs = (0, node_path_1.join)(__dirname, "credential-mcp-server.js");
|
|
320306
|
-
blocks.push("[mcp_servers.validateqa_credentials]", 'command = "node"', `args = ["${tomlEscape(serverJs)}"]`, "enabled = true", "startup_timeout_sec = 30", "tool_timeout_sec = 60", "", "[mcp_servers.validateqa_credentials.env]", `CDP_ENDPOINT = "${tomlEscape(cfg.cdpEndpoint)}"
|
|
320573
|
+
blocks.push("[mcp_servers.validateqa_credentials]", 'command = "node"', `args = ["${tomlEscape(serverJs)}"]`, "enabled = true", "startup_timeout_sec = 30", "tool_timeout_sec = 60", "", "[mcp_servers.validateqa_credentials.env]", `CDP_ENDPOINT = "${tomlEscape(cfg.cdpEndpoint)}"`);
|
|
320574
|
+
for (const [k, v] of Object.entries((0, google_signin_js_1.collectGoogleSignInEnv)())) {
|
|
320575
|
+
blocks.push(`${k} = "${tomlEscape(v)}"`);
|
|
320576
|
+
}
|
|
320577
|
+
blocks.push("");
|
|
320307
320578
|
}
|
|
320308
320579
|
if (cfg.includeDiscoveryServer) {
|
|
320309
320580
|
if (!cfg.runDir) {
|
|
@@ -320351,7 +320622,7 @@ var require_playwright_mcp_config = __commonJS({
|
|
|
320351
320622
|
type: "stdio",
|
|
320352
320623
|
command: "node",
|
|
320353
320624
|
args: [serverJs],
|
|
320354
|
-
env: { CDP_ENDPOINT: cfg.cdpEndpoint }
|
|
320625
|
+
env: { CDP_ENDPOINT: cfg.cdpEndpoint, ...(0, google_signin_js_1.collectGoogleSignInEnv)() }
|
|
320355
320626
|
};
|
|
320356
320627
|
}
|
|
320357
320628
|
if (cfg.includeDiscoveryServer) {
|
|
@@ -328558,6 +328829,7 @@ var require_discover_explorer = __commonJS({
|
|
|
328558
328829
|
var credential_tools_js_1 = require_credential_tools();
|
|
328559
328830
|
var inbox_tools_js_1 = require_inbox_tools();
|
|
328560
328831
|
var verification_inbox_js_1 = require_verification_inbox();
|
|
328832
|
+
var google_signin_js_1 = require_google_signin();
|
|
328561
328833
|
var discover_planner_js_1 = require_discover_planner();
|
|
328562
328834
|
var exploration_prompt_builder_js_1 = require_exploration_prompt_builder();
|
|
328563
328835
|
var ai_queue_js_1 = require_ai_queue();
|
|
@@ -328962,7 +329234,8 @@ NEVER assert: user-specific text (names, emails), counts/numbers, timestamps, ma
|
|
|
328962
329234
|
};
|
|
328963
329235
|
function buildSystemPrompt(baseUrl, variableContext, existingSiteMap, existingTestNames, options) {
|
|
328964
329236
|
const browserCredentials = variableContext.allTestVariables ?? variableContext.publicTestVariables;
|
|
328965
|
-
const { secrets:
|
|
329237
|
+
const { secrets: explorerSecretVarsRaw, publics: explorerPublicVarsRaw } = (0, credential_tools_js_1.partitionTestVariables)(browserCredentials);
|
|
329238
|
+
const explorerSecretVars = options?.inboxPrompt ? (0, google_signin_js_1.mergeGoogleSignInSecrets)(explorerSecretVarsRaw) : explorerSecretVarsRaw;
|
|
328966
329239
|
const hasCredentials = Object.keys(explorerSecretVars).length > 0;
|
|
328967
329240
|
const { DISCOVERY_SHOULD_REGISTER: _omitRegisterFlag, ...explorerPublicVars } = explorerPublicVarsRaw;
|
|
328968
329241
|
const explorerPublicLines = (0, credential_tools_js_1.renderPublicVariablesBlock)(explorerPublicVars);
|
|
@@ -329579,10 +329852,12 @@ ${inbox_tools_js_1.EMAIL_VERIFICATION_UNAVAILABLE_OVERRIDE_BLOCK}` : ""}`;
|
|
|
329579
329852
|
if (emailVerificationUnavailable) {
|
|
329580
329853
|
logs2.push("Email verification unavailable \u2014 the agent will ATTEMPT registration once; any flow requiring an emailed code/link will be reported BLOCKED.");
|
|
329581
329854
|
}
|
|
329855
|
+
const googleGuidance = (0, google_signin_js_1.googleSignInGuidanceOpts)();
|
|
329582
329856
|
const inboxPromptBlock = inboxState ? (0, inbox_tools_js_1.buildInboxPromptBlock)({
|
|
329583
329857
|
email: inboxState.email,
|
|
329584
329858
|
passwordKey: inboxState.passwordKey ?? "TEST_USER_PASSWORD",
|
|
329585
|
-
context: options?.mode
|
|
329859
|
+
context: options?.mode,
|
|
329860
|
+
...googleGuidance
|
|
329586
329861
|
}) : "";
|
|
329587
329862
|
try {
|
|
329588
329863
|
const { tools: mcpTools } = await mcpClient.listTools();
|
|
@@ -329603,7 +329878,8 @@ ${inbox_tools_js_1.EMAIL_VERIFICATION_UNAVAILABLE_OVERRIDE_BLOCK}` : ""}`;
|
|
|
329603
329878
|
}
|
|
329604
329879
|
const browserCredsForTools = variableContext.allTestVariables ?? variableContext.publicTestVariables;
|
|
329605
329880
|
const { secrets: explorerToolSecrets } = (0, credential_tools_js_1.partitionTestVariables)(browserCredsForTools);
|
|
329606
|
-
|
|
329881
|
+
const explorerToolSecretsWithGoogle = inboxState ? (0, google_signin_js_1.mergeGoogleSignInSecrets)(explorerToolSecrets) : explorerToolSecrets;
|
|
329882
|
+
if (Object.keys(explorerToolSecretsWithGoogle).length > 0) {
|
|
329607
329883
|
openaiTools.push(credential_tools_js_1.FILL_CREDENTIAL_TOOL, credential_tools_js_1.FILL_CREDENTIAL_FORM_TOOL);
|
|
329608
329884
|
if (options?.onCredentialUpdate) {
|
|
329609
329885
|
openaiTools.push(credential_tools_js_1.SET_CREDENTIAL_TOOL);
|
|
@@ -330243,8 +330519,12 @@ ${currentSummary}`;
|
|
|
330243
330519
|
let finishBouncedThisBatch = false;
|
|
330244
330520
|
let finishStreakCountedThisBatch = false;
|
|
330245
330521
|
const fullVarMapForGuard = variableContext.allTestVariables ?? variableContext.publicTestVariables;
|
|
330246
|
-
const { secrets:
|
|
330247
|
-
const
|
|
330522
|
+
const { secrets: partitionedSecretsForGuard } = (0, credential_tools_js_1.partitionTestVariables)(fullVarMapForGuard);
|
|
330523
|
+
const secretsOnlyForGuard = inboxState ? (0, google_signin_js_1.mergeGoogleSignInSecrets)(partitionedSecretsForGuard) : partitionedSecretsForGuard;
|
|
330524
|
+
const allowedCredentialValues = [...new Set([
|
|
330525
|
+
...inboxState ? [inboxState.email, inboxState.baseEmail] : [],
|
|
330526
|
+
...inboxState ? (0, google_signin_js_1.googleSignInAllowedEmails)() : []
|
|
330527
|
+
].filter((value) => !!value))];
|
|
330248
330528
|
const secretsForLogging = Object.fromEntries(Object.entries(secretsOnlyForGuard).filter(([, value]) => !allowedCredentialValues.includes(value)));
|
|
330249
330529
|
for (const toolCall of assistantMessage.tool_calls) {
|
|
330250
330530
|
const toolName = toolCall.function.name;
|
|
@@ -331095,8 +331375,9 @@ Exploration complete: ${summary}`);
|
|
|
331095
331375
|
}
|
|
331096
331376
|
const fullVarMap = variableContext.allTestVariables ?? variableContext.publicTestVariables;
|
|
331097
331377
|
const { secrets: dispatchSecrets } = (0, credential_tools_js_1.partitionTestVariables)(fullVarMap);
|
|
331378
|
+
const fillSecrets = inboxState ? (0, google_signin_js_1.mergeGoogleSignInSecrets)(dispatchSecrets) : dispatchSecrets;
|
|
331098
331379
|
try {
|
|
331099
|
-
const result = toolName === "fill_credential" ? await (0, credential_tools_js_1.handleFillCredential)(toolArgs, { mcpClient, credentials:
|
|
331380
|
+
const result = toolName === "fill_credential" ? await (0, credential_tools_js_1.handleFillCredential)(toolArgs, { mcpClient, credentials: fillSecrets, maxResultChars: MAX_TOOL_RESULT_CHARS }) : await (0, credential_tools_js_1.handleFillCredentialForm)(toolArgs, { mcpClient, credentials: fillSecrets, maxResultChars: MAX_TOOL_RESULT_CHARS });
|
|
331100
331381
|
if (result.didMutate) {
|
|
331101
331382
|
lastSnapshotText = null;
|
|
331102
331383
|
const codeLines = (0, exploration_parser_js_1.extractCodeLines)(result.content);
|
|
@@ -333136,7 +333417,7 @@ ${keyLines || "- (none provided)"}
|
|
|
333136
333417
|
## EXACTLY what to do
|
|
333137
333418
|
1. Navigate to ${baseUrl} and take a \`browser_snapshot\`.
|
|
333138
333419
|
2. Find the Sign Up / Register / Create account affordance (match by PURPOSE, in the app's own language) and open the signup form. If a reveal button hides the fields ("Sign up with Email"), click it first.
|
|
333139
|
-
3. Follow the "Account Registration (verification inbox is ENABLED)" steps below EXACTLY: call \`provision_identity\` for the email, type that email, fill the password with \`fill_credential\`, fill any other required fields with simple test values, and submit.
|
|
333420
|
+
3. Follow the "Account Registration (verification inbox is ENABLED)" steps below EXACTLY: call \`provision_identity\` for the email, type that email, fill the password with \`fill_credential\`, fill any other required fields with simple test values, and submit. If there is no app Create-account email form (phone / "Mobile or email" / SMS do not count) and Sign in offers "Continue with Google", follow the Google / Gmail SSO playbook (bare Google account email, \`fill_credential\` with \`GOOGLE_SIGNIN_PASSWORD\` on accounts.google.com, never TEST_USER_PASSWORD, never Continue with phone).
|
|
333140
333421
|
4. Complete email verification using the inbox tools (\`wait_for_verification\` \u2192 enter the code or \`open_verification_link\`). Re-poll if the email is slow; resend AT MOST once; NEVER register a second account.
|
|
333141
333422
|
5. Confirm you are signed in \u2014 a redirect to an authenticated route, or an in-place change to authenticated content. Take a \`browser_snapshot\`.
|
|
333142
333423
|
6. \`capture_page\` the authenticated landing page in its DEFAULT state, then call \`finish_exploration\`. Do this the MOMENT the account is verified and you are signed in.
|
|
@@ -333690,6 +333971,7 @@ var require_grok_survey_runner = __commonJS({
|
|
|
333690
333971
|
var grok_cli_js_1 = require_grok_cli();
|
|
333691
333972
|
var playwright_mcp_config_js_1 = require_playwright_mcp_config();
|
|
333692
333973
|
var inbox_tools_js_1 = require_inbox_tools();
|
|
333974
|
+
var google_signin_js_1 = require_google_signin();
|
|
333693
333975
|
var exploration_parser_js_1 = require_exploration_parser();
|
|
333694
333976
|
var scrub_credentials_js_1 = require_scrub_credentials();
|
|
333695
333977
|
var agentic_survey_prompts_js_1 = require_agentic_survey_prompts();
|
|
@@ -334214,7 +334496,7 @@ var require_grok_survey_runner = __commonJS({
|
|
|
334214
334496
|
};
|
|
334215
334497
|
const surveyAgentsMd = inboxReg ? `${(0, agentic_survey_prompts_js_1.buildSurveyAgentsMd)()}
|
|
334216
334498
|
|
|
334217
|
-
${(0, inbox_tools_js_1.buildInboxAgentsGuidance)(inboxReg.email, inboxReg.passwordKey)}` : (0, agentic_survey_prompts_js_1.buildSurveyAgentsMd)();
|
|
334499
|
+
${(0, inbox_tools_js_1.buildInboxAgentsGuidance)(inboxReg.email, inboxReg.passwordKey, (0, google_signin_js_1.googleSignInGuidanceOpts)())}` : (0, agentic_survey_prompts_js_1.buildSurveyAgentsMd)();
|
|
334218
334500
|
await (0, promises_1.writeFile)((0, node_path_1.join)(runDir, "AGENTS.md"), surveyAgentsMd, "utf8");
|
|
334219
334501
|
await (0, promises_1.writeFile)((0, node_path_1.join)(runDir, "BRIEF.md"), (0, agentic_survey_prompts_js_1.buildSurveyBriefMd)(briefInput), "utf8");
|
|
334220
334502
|
log2("Wrote AGENTS.md + BRIEF.md");
|
|
@@ -335621,6 +335903,7 @@ var require_grok_discovery_runner = __commonJS({
|
|
|
335621
335903
|
var playwright_native_js_1 = require_playwright_native();
|
|
335622
335904
|
var playwright_mcp_config_js_1 = require_playwright_mcp_config();
|
|
335623
335905
|
var inbox_tools_js_1 = require_inbox_tools();
|
|
335906
|
+
var google_signin_js_1 = require_google_signin();
|
|
335624
335907
|
var scrub_credentials_js_1 = require_scrub_credentials();
|
|
335625
335908
|
var grok_survey_runner_js_1 = require_grok_survey_runner();
|
|
335626
335909
|
var agentic_discovery_prompts_js_1 = require_agentic_discovery_prompts();
|
|
@@ -335914,7 +336197,7 @@ var require_grok_discovery_runner = __commonJS({
|
|
|
335914
336197
|
};
|
|
335915
336198
|
const discoveryAgentsMd = inboxReg ? `${(0, agentic_discovery_prompts_js_1.buildDiscoveryAgentsMd)()}
|
|
335916
336199
|
|
|
335917
|
-
${(0, inbox_tools_js_1.buildInboxAgentsGuidance)(inboxReg.email, inboxReg.passwordKey)}` : (0, agentic_discovery_prompts_js_1.buildDiscoveryAgentsMd)();
|
|
336200
|
+
${(0, inbox_tools_js_1.buildInboxAgentsGuidance)(inboxReg.email, inboxReg.passwordKey, (0, google_signin_js_1.googleSignInGuidanceOpts)())}` : (0, agentic_discovery_prompts_js_1.buildDiscoveryAgentsMd)();
|
|
335918
336201
|
await (0, promises_1.writeFile)((0, node_path_1.join)(runDir, "AGENTS.md"), discoveryAgentsMd, "utf8");
|
|
335919
336202
|
await (0, promises_1.writeFile)((0, node_path_1.join)(runDir, "BRIEF.md"), (0, agentic_discovery_prompts_js_1.buildDiscoveryBriefMd)(briefInput), "utf8");
|
|
335920
336203
|
await (0, promises_1.mkdir)(testsDirPath, { recursive: true });
|
|
@@ -336867,7 +337150,7 @@ ${(0, inbox_tools_js_1.buildInboxAgentsGuidance)(inboxReg.email, inboxReg.passwo
|
|
|
336867
337150
|
|
|
336868
337151
|
---
|
|
336869
337152
|
|
|
336870
|
-
${(0, inbox_tools_js_1.buildInboxAgentsGuidance)(inboxRegV2.email, inboxRegV2.passwordKey)}` : "");
|
|
337153
|
+
${(0, inbox_tools_js_1.buildInboxAgentsGuidance)(inboxRegV2.email, inboxRegV2.passwordKey, (0, google_signin_js_1.googleSignInGuidanceOpts)())}` : "");
|
|
336871
337154
|
await (0, promises_1.writeFile)((0, node_path_1.join)(runDir, "AGENTS.md"), agentsMd, "utf8");
|
|
336872
337155
|
await (0, promises_1.writeFile)((0, node_path_1.join)(runDir, "BRIEF.md"), (0, agentic_discovery_prompts_js_1.buildDiscoveryBriefMd)(briefInput), "utf8");
|
|
336873
337156
|
await (0, promises_1.mkdir)(testsDirPath, { recursive: true });
|
|
@@ -337839,6 +338122,7 @@ var require_claude_survey_runner = __commonJS({
|
|
|
337839
338122
|
var claude_stream_parser_js_1 = require_claude_stream_parser();
|
|
337840
338123
|
var playwright_mcp_config_js_1 = require_playwright_mcp_config();
|
|
337841
338124
|
var inbox_tools_js_1 = require_inbox_tools();
|
|
338125
|
+
var google_signin_js_1 = require_google_signin();
|
|
337842
338126
|
var scrub_credentials_js_1 = require_scrub_credentials();
|
|
337843
338127
|
var agentic_cli_constants_js_1 = require_agentic_cli_constants();
|
|
337844
338128
|
var grok_survey_runner_js_1 = require_grok_survey_runner();
|
|
@@ -337939,7 +338223,7 @@ ${preview}`);
|
|
|
337939
338223
|
};
|
|
337940
338224
|
const surveyAgentsMd = inboxReg ? `${(0, agentic_survey_prompts_js_1.buildSurveyAgentsMd)({ canvasMode })}
|
|
337941
338225
|
|
|
337942
|
-
${(0, inbox_tools_js_1.buildInboxAgentsGuidance)(inboxReg.email, inboxReg.passwordKey)}` : (0, agentic_survey_prompts_js_1.buildSurveyAgentsMd)({ canvasMode });
|
|
338226
|
+
${(0, inbox_tools_js_1.buildInboxAgentsGuidance)(inboxReg.email, inboxReg.passwordKey, (0, google_signin_js_1.googleSignInGuidanceOpts)())}` : (0, agentic_survey_prompts_js_1.buildSurveyAgentsMd)({ canvasMode });
|
|
337943
338227
|
await (0, promises_1.writeFile)((0, node_path_1.join)(runDir, "AGENTS.md"), surveyAgentsMd, "utf8");
|
|
337944
338228
|
await (0, promises_1.writeFile)((0, node_path_1.join)(runDir, "BRIEF.md"), (0, agentic_survey_prompts_js_1.buildSurveyBriefMd)(briefInput), "utf8");
|
|
337945
338229
|
log2("Wrote AGENTS.md + BRIEF.md");
|
|
@@ -338649,6 +338933,7 @@ var require_claude_discovery_runner = __commonJS({
|
|
|
338649
338933
|
var claude_cli_js_1 = require_claude_cli();
|
|
338650
338934
|
var playwright_mcp_config_js_1 = require_playwright_mcp_config();
|
|
338651
338935
|
var inbox_tools_js_1 = require_inbox_tools();
|
|
338936
|
+
var google_signin_js_1 = require_google_signin();
|
|
338652
338937
|
var coverage_examples_content_js_1 = require_coverage_examples_content();
|
|
338653
338938
|
var scrub_credentials_js_1 = require_scrub_credentials();
|
|
338654
338939
|
var agentic_cli_constants_js_1 = require_agentic_cli_constants();
|
|
@@ -338817,7 +339102,7 @@ var require_claude_discovery_runner = __commonJS({
|
|
|
338817
339102
|
};
|
|
338818
339103
|
const explorerContractMd = inboxReg ? `${(0, agentic_discovery_prompts_js_1.buildExplorerContractMd)(contractInput)}
|
|
338819
339104
|
|
|
338820
|
-
${(0, inbox_tools_js_1.buildInboxAgentsGuidance)(inboxReg.email, inboxReg.passwordKey)}` : (0, agentic_discovery_prompts_js_1.buildExplorerContractMd)(contractInput);
|
|
339105
|
+
${(0, inbox_tools_js_1.buildInboxAgentsGuidance)(inboxReg.email, inboxReg.passwordKey, (0, google_signin_js_1.googleSignInGuidanceOpts)())}` : (0, agentic_discovery_prompts_js_1.buildExplorerContractMd)(contractInput);
|
|
338821
339106
|
await (0, promises_1.writeFile)(claudeMdPath, explorerContractMd, "utf8");
|
|
338822
339107
|
await (0, promises_1.writeFile)((0, node_path_1.join)(runDir, "BRIEF.md"), (0, agentic_discovery_prompts_js_1.buildDiscoveryBriefMd)(briefInput), "utf8");
|
|
338823
339108
|
await (0, promises_1.mkdir)(testsDirPath, { recursive: true });
|
|
@@ -356074,7 +356359,7 @@ var require_package4 = __commonJS({
|
|
|
356074
356359
|
"package.json"(exports, module) {
|
|
356075
356360
|
module.exports = {
|
|
356076
356361
|
name: "@validate.qa/runner",
|
|
356077
|
-
version: "1.0.
|
|
356362
|
+
version: "1.0.94",
|
|
356078
356363
|
description: "validate local test runner - execute Playwright tests on your machine, connected to validate.qa cloud.",
|
|
356079
356364
|
bin: {
|
|
356080
356365
|
"validate-runner": "dist/cli.js"
|