@trusty-squire/mcp 0.6.14 → 0.6.15-rc.2
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/bot/agent.d.ts +1 -0
- package/dist/bot/agent.d.ts.map +1 -1
- package/dist/bot/agent.js +131 -1
- package/dist/bot/agent.js.map +1 -1
- package/dist/bot/browser.d.ts +1 -0
- package/dist/bot/browser.d.ts.map +1 -1
- package/dist/bot/browser.js +51 -1
- package/dist/bot/browser.js.map +1 -1
- package/dist/bot/google-login.d.ts.map +1 -1
- package/dist/bot/google-login.js +11 -0
- package/dist/bot/google-login.js.map +1 -1
- package/package.json +1 -1
package/dist/bot/agent.d.ts
CHANGED
|
@@ -155,6 +155,7 @@ export declare function detectAlreadySignedIn(args: {
|
|
|
155
155
|
inventory: readonly InteractiveElement[];
|
|
156
156
|
url: string;
|
|
157
157
|
}): boolean;
|
|
158
|
+
export declare function detectOAuthProvidersInInventory(inventory: readonly InteractiveElement[]): OAuthProviderId[];
|
|
158
159
|
export declare function isOauthOnlyChooser(inventory: readonly InteractiveElement[]): boolean;
|
|
159
160
|
export declare function findOAuthButton(inventory: readonly InteractiveElement[], provider: OAuthProviderId): InteractiveElement | null;
|
|
160
161
|
export declare function findFirstOAuthButton(inventory: readonly InteractiveElement[], providers: readonly OAuthProviderId[]): {
|
package/dist/bot/agent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/bot/agent.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,iBAAiB,EAGjB,cAAc,EACd,kBAAkB,EACnB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAKL,KAAK,eAAe,EACrB,MAAM,sBAAsB,CAAC;AAM9B,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,OAAO,EACb,MAAM,iBAAiB,CAAC;AAMzB,MAAM,WAAW,UAAU;IACzB,YAAY,CAAC,KAAK,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AkB;YAuHlB,uBAAuB;CA4CtC"}
|
package/dist/bot/agent.js
CHANGED
|
@@ -326,9 +326,26 @@ export function parseSignupPlan(raw, allowedSelectors) {
|
|
|
326
326
|
// Render the element inventory as a compact text block for the
|
|
327
327
|
// planner — one line per element, ending with the verified
|
|
328
328
|
// `selector=` the planner must copy verbatim (F3 T3).
|
|
329
|
+
//
|
|
330
|
+
// F15 — when multiple elements share the same effective text
|
|
331
|
+
// (visibleText / ariaLabel / labelText, normalized), tag each with
|
|
332
|
+
// its enclosing HTML5 landmark (header / main / footer / nav / etc.)
|
|
333
|
+
// so the planner has a discriminator. Without this, a Railway page
|
|
334
|
+
// with "Email" both in the body CTA and the footer made the planner
|
|
335
|
+
// pick the wrong one and loop. Single-occurrence text is rendered
|
|
336
|
+
// without the landmark tag to keep the inventory terse.
|
|
329
337
|
export function formatInventory(inventory) {
|
|
330
338
|
if (inventory.length === 0)
|
|
331
339
|
return "(no interactive elements found on the page)";
|
|
340
|
+
const textCounts = new Map();
|
|
341
|
+
const textKey = (e) => `${e.tag}|${(e.visibleText ?? e.ariaLabel ?? e.labelText ?? "").toLowerCase().trim()}`;
|
|
342
|
+
for (const e of inventory) {
|
|
343
|
+
const k = textKey(e);
|
|
344
|
+
if (k.endsWith("|"))
|
|
345
|
+
continue; // no text → skip
|
|
346
|
+
textCounts.set(k, (textCounts.get(k) ?? 0) + 1);
|
|
347
|
+
}
|
|
348
|
+
const isDuplicated = (e) => (textCounts.get(textKey(e)) ?? 0) > 1;
|
|
332
349
|
return inventory
|
|
333
350
|
.map((e) => {
|
|
334
351
|
const bits = [`[${e.index}] ${e.tag}`];
|
|
@@ -397,6 +414,12 @@ export function formatInventory(inventory) {
|
|
|
397
414
|
}
|
|
398
415
|
if (e.inConsentWidget)
|
|
399
416
|
bits.push("[cookie-consent — avoid]");
|
|
417
|
+
// F15 — disambiguating landmark tag for text-duplicates.
|
|
418
|
+
if (isDuplicated(e) &&
|
|
419
|
+
e.landmark !== null &&
|
|
420
|
+
e.landmark !== undefined) {
|
|
421
|
+
bits.push(`landmark=${e.landmark}`);
|
|
422
|
+
}
|
|
400
423
|
bits.push(`selector=${e.selector}`);
|
|
401
424
|
return bits.join(" ");
|
|
402
425
|
})
|
|
@@ -614,6 +637,26 @@ export function detectAlreadySignedIn(args) {
|
|
|
614
637
|
// True when the page has no fillable text input AND no button that
|
|
615
638
|
// reads as an email-signup option — a genuinely OAuth/SSO-only
|
|
616
639
|
// service with no form to automate (F3 Issue 4).
|
|
640
|
+
// rc.33-task — scan the inventory for any OAuth provider buttons,
|
|
641
|
+
// regardless of whether the bot has a session for them. Used by the
|
|
642
|
+
// OAuth-only-chooser branch to surface needs_oauth_provider_session
|
|
643
|
+
// with the SPECIFIC providers the page offers. Detection mirrors
|
|
644
|
+
// findOAuthButton's logic (visible text / aria-label / iconLabel
|
|
645
|
+
// containing the provider keyword + an auth verb, or href to the
|
|
646
|
+
// provider's OAuth endpoint).
|
|
647
|
+
//
|
|
648
|
+
// Returns providers in the order they were found in the inventory,
|
|
649
|
+
// deduped.
|
|
650
|
+
export function detectOAuthProvidersInInventory(inventory) {
|
|
651
|
+
const found = new Set();
|
|
652
|
+
const providers = ["google", "github"];
|
|
653
|
+
for (const provider of providers) {
|
|
654
|
+
if (findOAuthButton(inventory, provider) !== null) {
|
|
655
|
+
found.add(provider);
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
return [...found];
|
|
659
|
+
}
|
|
617
660
|
export function isOauthOnlyChooser(inventory) {
|
|
618
661
|
const TEXTLIKE = new Set([
|
|
619
662
|
"text",
|
|
@@ -1111,6 +1154,13 @@ export class SignupAgent {
|
|
|
1111
1154
|
let emptyPlans = 0;
|
|
1112
1155
|
let oauthScanRetries = 0;
|
|
1113
1156
|
let hint;
|
|
1157
|
+
// F14 — selectors the planner clicked WITHOUT advancing the page.
|
|
1158
|
+
// Each no-progress plan records its click selectors here; the next
|
|
1159
|
+
// plan that picks ONLY selectors in this set is failed as stuck
|
|
1160
|
+
// instead of looping. Cleared on any progress (fill action). The
|
|
1161
|
+
// Railway run that motivated F14 spun the same footer "Email" link
|
|
1162
|
+
// 5 times before timing out; this loop now bails after 2.
|
|
1163
|
+
let lastNoProgressClickSelectors = new Set();
|
|
1114
1164
|
// rc.31 — once the bot has explicitly clicked an email-flow
|
|
1115
1165
|
// button (e.g. Railway's "Log in using email" two-stage chooser),
|
|
1116
1166
|
// stay on the email path. Without this, the auto-OAuth-first
|
|
@@ -1221,6 +1271,31 @@ export class SignupAgent {
|
|
|
1221
1271
|
// OAuth-only: no fillable input AND no button that reads as an
|
|
1222
1272
|
// email-signup option — nothing to automate (Issue 4).
|
|
1223
1273
|
if (isOauthOnlyChooser(inventory)) {
|
|
1274
|
+
// rc.33-task — distinguish "the bot has no session for the
|
|
1275
|
+
// provider the page offers" (operator action: `mcp login
|
|
1276
|
+
// --provider=X`) from "service is OAuth-only in general"
|
|
1277
|
+
// (operator action: manual signup). When the inventory has
|
|
1278
|
+
// OAuth buttons for providers the profile does NOT have a
|
|
1279
|
+
// session for AND the operator HAS sessions for other
|
|
1280
|
+
// providers, the situation is recoverable — surface the
|
|
1281
|
+
// specific provider to seed.
|
|
1282
|
+
const visibleProviders = detectOAuthProvidersInInventory(inventory);
|
|
1283
|
+
const haveSessions = loggedInProviders();
|
|
1284
|
+
const missingProviders = visibleProviders.filter((p) => !haveSessions.includes(p));
|
|
1285
|
+
if (missingProviders.length > 0 &&
|
|
1286
|
+
// Only surface needs_oauth_provider_session when the user
|
|
1287
|
+
// can actually act on it — i.e. they have at least one
|
|
1288
|
+
// OAuth session already (so they know how to seed
|
|
1289
|
+
// others). A fresh install with zero sessions still gets
|
|
1290
|
+
// the generic oauth_required (which the install/connect
|
|
1291
|
+
// flow has its own help text for).
|
|
1292
|
+
haveSessions.length > 0) {
|
|
1293
|
+
return {
|
|
1294
|
+
kind: "needs_oauth_provider_session",
|
|
1295
|
+
missingProviders,
|
|
1296
|
+
haveSessions,
|
|
1297
|
+
};
|
|
1298
|
+
}
|
|
1224
1299
|
return { kind: "oauth_required" };
|
|
1225
1300
|
}
|
|
1226
1301
|
steps.push("Asking Claude to plan the signup form fill...");
|
|
@@ -1248,6 +1323,23 @@ export class SignupAgent {
|
|
|
1248
1323
|
}
|
|
1249
1324
|
steps.push(`Plan: ${plan.actions.length} action(s), confidence=${plan.confidence}` +
|
|
1250
1325
|
(plan.notes !== undefined ? ` — ${plan.notes}` : ""));
|
|
1326
|
+
// F14 — stuck-detection: if the plan picks ONLY click selectors
|
|
1327
|
+
// we already tried in the previous round without page progress,
|
|
1328
|
+
// it's a planner loop. Fail planning_failed with the offending
|
|
1329
|
+
// selector(s) so the operator sees what stalled. Doesn't fire
|
|
1330
|
+
// when the plan adds at least one new selector (legitimate
|
|
1331
|
+
// exploration). Doesn't fire on fill plans (forward progress).
|
|
1332
|
+
const planClickSelectors = plan.actions
|
|
1333
|
+
.filter((a) => a.kind === "click")
|
|
1334
|
+
.map((a) => a.selector);
|
|
1335
|
+
if (planClickSelectors.length > 0 &&
|
|
1336
|
+
lastNoProgressClickSelectors.size > 0 &&
|
|
1337
|
+
planClickSelectors.every((s) => lastNoProgressClickSelectors.has(s))) {
|
|
1338
|
+
return {
|
|
1339
|
+
kind: "planning_failed",
|
|
1340
|
+
reason: `stuck — planner re-picked the same click selector(s) after no-progress: ${planClickSelectors.join(", ")}`,
|
|
1341
|
+
};
|
|
1342
|
+
}
|
|
1251
1343
|
// Verify the picks resolve on the live page — also catches a
|
|
1252
1344
|
// stale selector resolving to a recycled wrong node (Tension 4).
|
|
1253
1345
|
const bySelector = new Map(inventory.map((e) => [e.selector, e]));
|
|
@@ -1313,10 +1405,23 @@ export class SignupAgent {
|
|
|
1313
1405
|
steps.push(plan.actions.length === 0
|
|
1314
1406
|
? "Plan found nothing to act on — re-checking once for a late render"
|
|
1315
1407
|
: "Plan only revealed the page — re-planning the now-visible form");
|
|
1408
|
+
// F14 — record the click selectors that didn't advance the
|
|
1409
|
+
// page. The next plan's stuck-detection check (above) bails
|
|
1410
|
+
// if it picks the same ones again. Hint also tells the
|
|
1411
|
+
// planner which selectors NOT to re-pick.
|
|
1412
|
+
lastNoProgressClickSelectors = new Set(planClickSelectors);
|
|
1413
|
+
const avoidHint = planClickSelectors.length > 0
|
|
1414
|
+
? ` AVOID these selectors — they were clicked but the page did NOT advance: ${planClickSelectors.map((s) => JSON.stringify(s)).join(", ")}.`
|
|
1415
|
+
: "";
|
|
1316
1416
|
hint =
|
|
1317
|
-
"The previous step revealed or advanced the page. Plan the signup form that should now be visible."
|
|
1417
|
+
"The previous step revealed or advanced the page. Plan the signup form that should now be visible." +
|
|
1418
|
+
avoidHint;
|
|
1318
1419
|
continue;
|
|
1319
1420
|
}
|
|
1421
|
+
// F14 — fill action present = forward progress. Clear the
|
|
1422
|
+
// stuck-tracker so a legitimate later click isn't false-positive
|
|
1423
|
+
// rejected.
|
|
1424
|
+
lastNoProgressClickSelectors = new Set();
|
|
1320
1425
|
// Captcha gate + submit.
|
|
1321
1426
|
const preGate = await this.runCaptchaGate("Pre-submit", steps);
|
|
1322
1427
|
if (preGate.blocked)
|
|
@@ -1825,6 +1930,31 @@ export class SignupAgent {
|
|
|
1825
1930
|
steps,
|
|
1826
1931
|
...this.resultTail(),
|
|
1827
1932
|
};
|
|
1933
|
+
case "needs_oauth_provider_session": {
|
|
1934
|
+
// rc.33-task — actionable: name the missing provider so
|
|
1935
|
+
// the user runs the right `mcp login` command. When more
|
|
1936
|
+
// than one provider is missing, the message lists them and
|
|
1937
|
+
// recommends any single one (operator picks).
|
|
1938
|
+
const missing = outcome.missingProviders;
|
|
1939
|
+
const have = outcome.haveSessions;
|
|
1940
|
+
const firstMissing = missing[0];
|
|
1941
|
+
const missingLabel = missing
|
|
1942
|
+
.map((p) => OAUTH_PROVIDERS[p].label)
|
|
1943
|
+
.join(" / ");
|
|
1944
|
+
const haveLabel = have.length > 0
|
|
1945
|
+
? have.map((p) => OAUTH_PROVIDERS[p].label).join(", ")
|
|
1946
|
+
: "(none)";
|
|
1947
|
+
return {
|
|
1948
|
+
success: false,
|
|
1949
|
+
error: `needs_oauth_provider_session: ${task.service} offers ${missingLabel} OAuth ` +
|
|
1950
|
+
`but the bot's chrome profile has no ${missingLabel} session ` +
|
|
1951
|
+
`(currently signed in to: ${haveLabel}). ` +
|
|
1952
|
+
`Run \`npx @trusty-squire/mcp login --provider=${firstMissing}\` ` +
|
|
1953
|
+
`to seed the session, then retry.`,
|
|
1954
|
+
steps,
|
|
1955
|
+
...this.resultTail(),
|
|
1956
|
+
};
|
|
1957
|
+
}
|
|
1828
1958
|
case "anti_bot_blocked":
|
|
1829
1959
|
return {
|
|
1830
1960
|
success: false,
|