@trusty-squire/mcp 1.0.0 → 1.0.1-rc.1
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/README.md +9 -15
- package/dist/bot/credential-text.d.ts +4 -0
- package/dist/bot/credential-text.d.ts.map +1 -0
- package/dist/bot/credential-text.js +297 -0
- package/dist/bot/credential-text.js.map +1 -0
- package/dist/bot/email-verification.d.ts +2 -0
- package/dist/bot/email-verification.d.ts.map +1 -0
- package/dist/bot/email-verification.js +47 -0
- package/dist/bot/email-verification.js.map +1 -0
- package/dist/bot/google-login.d.ts +1 -0
- package/dist/bot/google-login.d.ts.map +1 -1
- package/dist/bot/google-login.js +47 -2
- package/dist/bot/google-login.js.map +1 -1
- package/dist/bot/index.d.ts +0 -40
- package/dist/bot/index.d.ts.map +1 -1
- package/dist/bot/index.js +8 -156
- package/dist/bot/index.js.map +1 -1
- package/dist/bot/login-state.d.ts +2 -0
- package/dist/bot/login-state.d.ts.map +1 -1
- package/dist/bot/login-state.js +44 -0
- package/dist/bot/login-state.js.map +1 -1
- package/dist/bot/oauth-detect.d.ts +8 -0
- package/dist/bot/oauth-detect.d.ts.map +1 -0
- package/dist/bot/oauth-detect.js +329 -0
- package/dist/bot/oauth-detect.js.map +1 -0
- package/dist/bot/onboarding-capture.d.ts +1 -1
- package/dist/bot/onboarding-capture.d.ts.map +1 -1
- package/dist/bot/operator-recipe.d.ts +24 -24
- package/dist/bot/promote-to-skill.d.ts +1 -1
- package/dist/bot/promote-to-skill.d.ts.map +1 -1
- package/dist/bot/promote-to-skill.js +7 -5
- package/dist/bot/promote-to-skill.js.map +1 -1
- package/dist/bot/provision-session.d.ts +10 -0
- package/dist/bot/provision-session.d.ts.map +1 -1
- package/dist/bot/provision-session.js +126 -5
- package/dist/bot/provision-session.js.map +1 -1
- package/dist/bot/provision-types.d.ts +69 -0
- package/dist/bot/provision-types.d.ts.map +1 -0
- package/dist/bot/provision-types.js +9 -0
- package/dist/bot/provision-types.js.map +1 -0
- package/dist/bot/semantic-transition.d.ts +1 -1
- package/dist/bot/semantic-transition.d.ts.map +1 -1
- package/dist/skill-cli/cli.d.ts +1 -7
- package/dist/skill-cli/cli.d.ts.map +1 -1
- package/dist/skill-cli/cli.js +1 -69
- package/dist/skill-cli/cli.js.map +1 -1
- package/dist/tools/provision-drive.d.ts +48 -8
- package/dist/tools/provision-drive.d.ts.map +1 -1
- package/dist/tools/provision-drive.js +127 -2
- package/dist/tools/provision-drive.js.map +1 -1
- package/dist/tools/store-credential.d.ts +4 -4
- package/dist/tools/use-credential.d.ts +6 -6
- package/package.json +2 -6
- package/dist/bot/affordance-probe.d.ts +0 -15
- package/dist/bot/affordance-probe.d.ts.map +0 -1
- package/dist/bot/affordance-probe.js +0 -61
- package/dist/bot/affordance-probe.js.map +0 -1
- package/dist/bot/agent.d.ts +0 -449
- package/dist/bot/agent.d.ts.map +0 -1
- package/dist/bot/agent.js +0 -13634
- package/dist/bot/agent.js.map +0 -1
- package/dist/bot/debug.d.ts +0 -3
- package/dist/bot/debug.d.ts.map +0 -1
- package/dist/bot/debug.js +0 -35
- package/dist/bot/debug.js.map +0 -1
- package/dist/bot/email-code-fetcher.d.ts +0 -5
- package/dist/bot/email-code-fetcher.d.ts.map +0 -1
- package/dist/bot/email-code-fetcher.js +0 -33
- package/dist/bot/email-code-fetcher.js.map +0 -1
- package/dist/bot/flow-engine.d.ts +0 -7
- package/dist/bot/flow-engine.d.ts.map +0 -1
- package/dist/bot/flow-engine.js +0 -13
- package/dist/bot/flow-engine.js.map +0 -1
- package/dist/bot/form-fill.d.ts +0 -172
- package/dist/bot/form-fill.d.ts.map +0 -1
- package/dist/bot/form-fill.js +0 -444
- package/dist/bot/form-fill.js.map +0 -1
- package/dist/bot/inbox-client.d.ts +0 -45
- package/dist/bot/inbox-client.d.ts.map +0 -1
- package/dist/bot/inbox-client.js +0 -220
- package/dist/bot/inbox-client.js.map +0 -1
- package/dist/bot/llm-client.d.ts +0 -89
- package/dist/bot/llm-client.d.ts.map +0 -1
- package/dist/bot/llm-client.js +0 -493
- package/dist/bot/llm-client.js.map +0 -1
- package/dist/bot/nav-search.d.ts +0 -114
- package/dist/bot/nav-search.d.ts.map +0 -1
- package/dist/bot/nav-search.js +0 -670
- package/dist/bot/nav-search.js.map +0 -1
- package/dist/bot/notify-api.d.ts +0 -9
- package/dist/bot/notify-api.d.ts.map +0 -1
- package/dist/bot/notify-api.js +0 -49
- package/dist/bot/notify-api.js.map +0 -1
- package/dist/bot/oauth-flow.d.ts +0 -48
- package/dist/bot/oauth-flow.d.ts.map +0 -1
- package/dist/bot/oauth-flow.js +0 -111
- package/dist/bot/oauth-flow.js.map +0 -1
- package/dist/bot/observation-frame.d.ts +0 -16
- package/dist/bot/observation-frame.d.ts.map +0 -1
- package/dist/bot/observation-frame.js +0 -22
- package/dist/bot/observation-frame.js.map +0 -1
- package/dist/bot/post-signup-action-executor.d.ts +0 -53
- package/dist/bot/post-signup-action-executor.d.ts.map +0 -1
- package/dist/bot/post-signup-action-executor.js +0 -104
- package/dist/bot/post-signup-action-executor.js.map +0 -1
- package/dist/bot/post-signup-flow.d.ts +0 -51
- package/dist/bot/post-signup-flow.d.ts.map +0 -1
- package/dist/bot/post-signup-flow.js +0 -155
- package/dist/bot/post-signup-flow.js.map +0 -1
- package/dist/bot/post-signup-login-flow.d.ts +0 -28
- package/dist/bot/post-signup-login-flow.d.ts.map +0 -1
- package/dist/bot/post-signup-login-flow.js +0 -35
- package/dist/bot/post-signup-login-flow.js.map +0 -1
- package/dist/bot/post-signup-recovery-state.d.ts +0 -150
- package/dist/bot/post-signup-recovery-state.d.ts.map +0 -1
- package/dist/bot/post-signup-recovery-state.js +0 -253
- package/dist/bot/post-signup-recovery-state.js.map +0 -1
- package/dist/bot/post-signup-synthetic-capture.d.ts +0 -43
- package/dist/bot/post-signup-synthetic-capture.d.ts.map +0 -1
- package/dist/bot/post-signup-synthetic-capture.js +0 -84
- package/dist/bot/post-signup-synthetic-capture.js.map +0 -1
- package/dist/bot/prewarm-cache.d.ts +0 -3
- package/dist/bot/prewarm-cache.d.ts.map +0 -1
- package/dist/bot/prewarm-cache.js +0 -91
- package/dist/bot/prewarm-cache.js.map +0 -1
- package/dist/bot/read-otp.d.ts +0 -21
- package/dist/bot/read-otp.d.ts.map +0 -1
- package/dist/bot/read-otp.js +0 -170
- package/dist/bot/read-otp.js.map +0 -1
- package/dist/bot/redact.d.ts +0 -3
- package/dist/bot/redact.d.ts.map +0 -1
- package/dist/bot/redact.js +0 -132
- package/dist/bot/redact.js.map +0 -1
- package/dist/bot/rejection-record.d.ts +0 -70
- package/dist/bot/rejection-record.d.ts.map +0 -1
- package/dist/bot/rejection-record.js +0 -76
- package/dist/bot/rejection-record.js.map +0 -1
- package/dist/bot/replay-skill.d.ts +0 -180
- package/dist/bot/replay-skill.d.ts.map +0 -1
- package/dist/bot/replay-skill.js +0 -4361
- package/dist/bot/replay-skill.js.map +0 -1
- package/dist/bot/signup-lock.d.ts +0 -17
- package/dist/bot/signup-lock.d.ts.map +0 -1
- package/dist/bot/signup-lock.js +0 -174
- package/dist/bot/signup-lock.js.map +0 -1
- package/dist/bot/signup-oauth-flow.d.ts +0 -16
- package/dist/bot/signup-oauth-flow.d.ts.map +0 -1
- package/dist/bot/signup-oauth-flow.js +0 -31
- package/dist/bot/signup-oauth-flow.js.map +0 -1
- package/dist/bot/state-classifier.d.ts +0 -18
- package/dist/bot/state-classifier.d.ts.map +0 -1
- package/dist/bot/state-classifier.js +0 -127
- package/dist/bot/state-classifier.js.map +0 -1
- package/dist/bot/terminal-gate.d.ts +0 -22
- package/dist/bot/terminal-gate.d.ts.map +0 -1
- package/dist/bot/terminal-gate.js +0 -184
- package/dist/bot/terminal-gate.js.map +0 -1
- package/dist/bot/unwinnable-services.d.ts +0 -7
- package/dist/bot/unwinnable-services.d.ts.map +0 -1
- package/dist/bot/unwinnable-services.js +0 -69
- package/dist/bot/unwinnable-services.js.map +0 -1
- package/dist/data/service-categories.d.ts +0 -11
- package/dist/data/service-categories.d.ts.map +0 -1
- package/dist/data/service-categories.js +0 -149
- package/dist/data/service-categories.js.map +0 -1
- package/dist/provision-run.d.ts +0 -45
- package/dist/provision-run.d.ts.map +0 -1
- package/dist/provision-run.js +0 -99
- package/dist/provision-run.js.map +0 -1
- package/dist/tools/provision-any.d.ts +0 -207
- package/dist/tools/provision-any.d.ts.map +0 -1
- package/dist/tools/provision-any.js +0 -1519
- package/dist/tools/provision-any.js.map +0 -1
- package/dist/tools/signup-telemetry.d.ts +0 -38
- package/dist/tools/signup-telemetry.d.ts.map +0 -1
- package/dist/tools/signup-telemetry.js +0 -103
- package/dist/tools/signup-telemetry.js.map +0 -1
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
// oauth-detect.ts — browser-free inventory predicates for the OAuth-first
|
|
2
|
+
// signup path: find a "Sign in with <provider>" affordance, and decide whether
|
|
3
|
+
// a page is already an authenticated (post-login) surface. Carved out of
|
|
4
|
+
// agent.ts (the retired universal-bot monolith); skill replay uses these to
|
|
5
|
+
// route between OAuth, form-fill, and key-extraction.
|
|
6
|
+
import { OAUTH_PROVIDERS } from "./oauth-providers.js";
|
|
7
|
+
export function detectAlreadySignedIn(args) {
|
|
8
|
+
const { inventory, url } = args;
|
|
9
|
+
// Precondition: any visible credential input → not authenticated.
|
|
10
|
+
const hasCredentialInput = inventory.some((e) => e.tag === "input" &&
|
|
11
|
+
(e.type === "email" || e.type === "password" || e.type === "tel"));
|
|
12
|
+
if (hasCredentialInput)
|
|
13
|
+
return false;
|
|
14
|
+
// Signal 0 — a strong post-login URL path. An onboarding /
|
|
15
|
+
// getting-started / welcome route is only reachable AFTER you're
|
|
16
|
+
// authenticated (you cannot see a "you're all set, next steps" wizard
|
|
17
|
+
// without a session), so the URL alone is conclusive here — unlike the
|
|
18
|
+
// weaker dashboard paths in Signal 3, no paired creation-CTA is needed.
|
|
19
|
+
// last9 lands the bot on /v2/organizations/<slug>/getting-started with
|
|
20
|
+
// its Google session already active; its buttons ("Choose your region",
|
|
21
|
+
// "You're all set! Next steps", "Upgrade Plan") matched none of the CTA
|
|
22
|
+
// vocabularies below, so it used to bail `oauth_required` — claiming
|
|
23
|
+
// "only OAuth/SSO signup, no email/password form" while the bot was in
|
|
24
|
+
// fact fully signed in. The precondition above already ruled out a
|
|
25
|
+
// signup chooser (no credential input).
|
|
26
|
+
// ...UNLESS the page still presents a signup/OAuth chooser (a
|
|
27
|
+
// "Continue with Google" button or a bare "Sign up"/"Log in"). Some
|
|
28
|
+
// services route the login chooser through an /onboarding-style URL; if
|
|
29
|
+
// a provider button is visible, the bot must OAuth via it, not treat the
|
|
30
|
+
// page as already-authenticated. (PostHog TS-1923.)
|
|
31
|
+
const hasSignupAffordance = inventory.some((e) => {
|
|
32
|
+
const t = `${e.visibleText ?? ""} ${e.ariaLabel ?? ""}`
|
|
33
|
+
.toLowerCase()
|
|
34
|
+
.replace(/\s+/g, " ")
|
|
35
|
+
.trim();
|
|
36
|
+
return (/\b(?:continue with|sign ?up with|sign ?in with|log ?in with|with (?:google|github|gitlab|microsoft|apple))\b/.test(t) || /^(?:sign ?up|sign ?in|log ?in|create (?:an )?account)$/.test(t));
|
|
37
|
+
});
|
|
38
|
+
const visibleTextOf = (e) => `${e.visibleText ?? ""} ${e.ariaLabel ?? ""}`.trim();
|
|
39
|
+
const RESOURCE_CREATION_CTA = /^\s*(?:\+\s*)?(?:new\s+(?:project|workspace|team|app|site|deployment|api\s*key|database|cluster|instance|service|index|environment)|create(?:\s+(?:new|a|an|project|workspace|database|cluster|instance|deployment|app|service|index|environment))?|get\s+started\s+by\s+sett?ing\s+up\s+(?:a|an)?\s*.*\b(?:project|workspace|app|application|service|database|cluster|index)\b|sett?ing\s+up\s+(?:a|an)?\s*.*\b(?:project|workspace|app|application|service|database|cluster|index)\b)/i;
|
|
40
|
+
const hasResourceCreationCta = inventory.some((e) => RESOURCE_CREATION_CTA.test(visibleTextOf(e)));
|
|
41
|
+
const ONBOARDING_CHROME = /\b(?:set up your first|create your project|get started by sett?ing up|welcome to|import documents|make a search|don'?t show me again|bring me home|setup checklist|onboarding)\b/i;
|
|
42
|
+
const hasOnboardingChrome = inventory.some((e) => ONBOARDING_CHROME.test(visibleTextOf(e)));
|
|
43
|
+
if (!hasSignupAffordance && hasResourceCreationCta && hasOnboardingChrome) {
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
try {
|
|
47
|
+
if (!hasSignupAffordance &&
|
|
48
|
+
/\/(?:getting-started|get-started|onboarding|welcome)(?:\/|$)/i.test(new URL(url).pathname)) {
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
// malformed URL — fall through to the other signals
|
|
54
|
+
}
|
|
55
|
+
// Signal 1 — strict nav-keyword match (the canonical Sentry-class case).
|
|
56
|
+
// STRONG markers (sign out / log out) PROVE a session — you can't sign out if
|
|
57
|
+
// you're not signed in — so they fire even next to a decoration "Continue with
|
|
58
|
+
// Google" (account-linking) button. WEAK markers (dashboard / projects /
|
|
59
|
+
// settings / …) are ordinary nav labels that ALSO appear on a logged-out
|
|
60
|
+
// marketing or /login page, so they must NOT override a visible auth gate:
|
|
61
|
+
// gate them on !hasSignupAffordance. Without this split, northflank's /login
|
|
62
|
+
// (which renders "Continue with Google" alongside "Projects"/"Settings") was
|
|
63
|
+
// mis-read as signed-in → the replay skipped click_oauth_button → the fresh
|
|
64
|
+
// robot never logged in and bailed needs_login deep in the flow (MEASURED
|
|
65
|
+
// 2026-06-24).
|
|
66
|
+
const STRONG_AUTH_KEYWORDS = /^\s*(?:sign out|log out)\s*$/i;
|
|
67
|
+
const WEAK_AUTH_KEYWORDS = /^\s*(?:dashboard|projects|settings|profile|my account|account settings|workspaces)\s*$/i;
|
|
68
|
+
const textOf = (e) => (e.visibleText ?? e.ariaLabel ?? "").trim();
|
|
69
|
+
if (inventory.some((e) => STRONG_AUTH_KEYWORDS.test(textOf(e)))) {
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
if (!hasSignupAffordance && inventory.some((e) => WEAK_AUTH_KEYWORDS.test(textOf(e)))) {
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
// Signal 2 — billing / trial widget. Patterns observed in the wild:
|
|
76
|
+
// "28 days or $5.00 leftTrial" (Railway, no separator)
|
|
77
|
+
// "Trial" (most SaaS)
|
|
78
|
+
// "$N left" / "N days left" / "remaining"
|
|
79
|
+
const BILLING = /(?:\$\d+(?:\.\d+)?\s*(?:left|remaining)|\d+\s*days?\s*(?:left|remaining|trial)|\btrial\b)/i;
|
|
80
|
+
if (!hasSignupAffordance &&
|
|
81
|
+
inventory.some((e) => BILLING.test(visibleTextOf(e)))) {
|
|
82
|
+
return true;
|
|
83
|
+
}
|
|
84
|
+
// Signal 3 — dashboard-route URL + creation CTA visible.
|
|
85
|
+
// The URL gate is conservative: a path that READS as dashboard,
|
|
86
|
+
// not /login or /signup or /. Combined with a creation CTA
|
|
87
|
+
// ("New project", "Create workspace", "+ New") it pins the
|
|
88
|
+
// page as a post-login surface.
|
|
89
|
+
let dashboardyPath = false;
|
|
90
|
+
try {
|
|
91
|
+
const parsed = new URL(url);
|
|
92
|
+
// rc.37 — widened the dashboard-path allowlist after the rc.35
|
|
93
|
+
// sweep showed Upstash's post-OAuth landing was /redis (the
|
|
94
|
+
// product-segment route, not a generic /dashboard). Added
|
|
95
|
+
// /redis, /kafka, /vector, /cluster, /databases?, /instances?,
|
|
96
|
+
// /apps?, /deployments?, /services? — all common product-name
|
|
97
|
+
// routes that almost always indicate authenticated state.
|
|
98
|
+
// An /organizations/<…> or /orgs/<…> prefix is an authenticated-only
|
|
99
|
+
// marker: a logged-OUT visitor never has an organization-scoped route.
|
|
100
|
+
// pinecone's post-OAuth plan-chooser sits at
|
|
101
|
+
// app.pinecone.io/organizations/registration — the trailing
|
|
102
|
+
// "registration" tripped the register-exclusion below and the bot, fully
|
|
103
|
+
// signed in via the operator's existing Google-linked account, bailed
|
|
104
|
+
// no_signup_link instead of routing to key-extraction (MEASURED
|
|
105
|
+
// 2026-06-11: pinecone account was created May 25, so every later run
|
|
106
|
+
// lands here authenticated). An org-prefixed path forces dashboardy and
|
|
107
|
+
// bypasses the auth-route exclusion.
|
|
108
|
+
const hasOrgPrefix = /\/(?:organizations?|orgs?)\//i.test(parsed.pathname);
|
|
109
|
+
dashboardyPath =
|
|
110
|
+
hasOrgPrefix ||
|
|
111
|
+
(/\/(?:new|dashboard|projects?|account|settings|workspace|home|admin|redis|kafka|vector|cluster|databases?|instances?|apps?|deployments?|services?|onboarding|welcome|getting-started|get-started|setup)(?:\/|$)/i.test(parsed.pathname) && !/\/(?:signup|sign-up|register|login|sign-in|signin)/i.test(parsed.pathname));
|
|
112
|
+
}
|
|
113
|
+
catch {
|
|
114
|
+
// Malformed URL — skip URL signal.
|
|
115
|
+
}
|
|
116
|
+
if (dashboardyPath) {
|
|
117
|
+
// rc.37 — widened the creation-CTA vocabulary to include the
|
|
118
|
+
// dashboard-y "Create <product-noun>" pattern. Upstash's
|
|
119
|
+
// dashboard CTA reads "Create Database"; Convex / Neon /
|
|
120
|
+
// PlanetScale / similar all use this shape ("Create cluster",
|
|
121
|
+
// "Create instance", "Create deployment"). Without this the
|
|
122
|
+
// bot's F17 already-signed-in path fell through to form-fill
|
|
123
|
+
// and the planner clicked the CTA thinking it was a signup
|
|
124
|
+
// submit button.
|
|
125
|
+
if (inventory.some((e) => {
|
|
126
|
+
const t = e.visibleText ?? e.ariaLabel ?? "";
|
|
127
|
+
return RESOURCE_CREATION_CTA.test(t.trim());
|
|
128
|
+
})) {
|
|
129
|
+
return true;
|
|
130
|
+
}
|
|
131
|
+
// 0.8.2-rc.5 — PostHog-class onboarding wizard. When the URL is
|
|
132
|
+
// dashboard-y (path like /project/<id>/onboarding) and the page
|
|
133
|
+
// shows project-picker / account-menu / onboarding-skip
|
|
134
|
+
// affordances WITHOUT a credential input or OAuth provider button,
|
|
135
|
+
// the user is authenticated and the wizard is interstitial. The
|
|
136
|
+
// rc.3 overnight run for posthog landed exactly here and bailed
|
|
137
|
+
// `oauth_required` because the inventory had only:
|
|
138
|
+
// - "Default project" (project picker)
|
|
139
|
+
// - "BBento" (account avatar toggle)
|
|
140
|
+
// - "Hand off setup" (skip-onboarding affordance)
|
|
141
|
+
//
|
|
142
|
+
// Detect this shape via a second-tier signal set. Conservative —
|
|
143
|
+
// we already gated on "no credential inputs" and "dashboardyPath",
|
|
144
|
+
// so a true signup chooser (which has neither of those AND the
|
|
145
|
+
// path is /signup or /login) cannot reach this branch.
|
|
146
|
+
const POST_AUTH_AFFORDANCE = /^\s*(?:hand\s*off\s*setup|skip\s*(?:onboarding|setup|for\s*now)|invite\s*(?:teammates|members|your\s*team)|set\s*up\s*billing|finish\s*setup|get\s*started|continue\s*to\s*(?:dashboard|app|console))\s*$/i;
|
|
147
|
+
// Workspace / project / org picker shape. We pattern-match
|
|
148
|
+
// generously because PostHog's reads "Default project" but other
|
|
149
|
+
// SaaS dashboards read "My workspace" / "Acme org" / similar. The
|
|
150
|
+
// structural cue is "button with one of the workspace-noun words"
|
|
151
|
+
// — see TS-1923 (PostHog rc.3 regression).
|
|
152
|
+
const WORKSPACE_PICKER = /\b(?:workspace|workspaces|project(?:s)?|organization|organizations|team(?:s)?)\b/i;
|
|
153
|
+
const hasPostAuthAffordance = inventory.some((e) => POST_AUTH_AFFORDANCE.test((e.visibleText ?? e.ariaLabel ?? "").trim()));
|
|
154
|
+
if (hasPostAuthAffordance) {
|
|
155
|
+
// Single signal — the skip-onboarding / handoff verb is strong
|
|
156
|
+
// enough on its own. No login page ever offers "Hand off setup".
|
|
157
|
+
return true;
|
|
158
|
+
}
|
|
159
|
+
// Weaker pair: a workspace-picker shape AND the page lacks a
|
|
160
|
+
// primary call-to-action that reads as signup ("Continue with
|
|
161
|
+
// Google", "Sign up", etc.). Used as a backstop for SPA dashboards
|
|
162
|
+
// whose only visible buttons are picker toggles.
|
|
163
|
+
const hasWorkspacePicker = inventory.some((e) => WORKSPACE_PICKER.test((e.visibleText ?? e.ariaLabel ?? "").trim()));
|
|
164
|
+
const hasSignupOrOAuthAffordance = inventory.some((e) => {
|
|
165
|
+
const t = (e.visibleText ?? e.ariaLabel ?? "").trim();
|
|
166
|
+
return /\b(?:sign[\s-]*up|signup|continue\s+with|log\s+in\s+with|sign\s+in\s+with)\b/i.test(t);
|
|
167
|
+
});
|
|
168
|
+
if (hasWorkspacePicker && !hasSignupOrOAuthAffordance) {
|
|
169
|
+
return true;
|
|
170
|
+
}
|
|
171
|
+
// 0.8.3-rc.1 — onboarding-wizard step shape. When the URL clearly
|
|
172
|
+
// names an onboarding path (/onboarding, /welcome, /getting-started,
|
|
173
|
+
// /setup) AND the page has a Next/Continue/Skip/Submit button AND
|
|
174
|
+
// does NOT have any credential input (caught above) AND does NOT
|
|
175
|
+
// have a Sign-up/Continue-with affordance (i.e. it's not a CHOICE
|
|
176
|
+
// between login and signup), the page is mid-onboarding for an
|
|
177
|
+
// already-authenticated user. Mixpanel hits this when a previous
|
|
178
|
+
// run created the account but didn't finish the multi-step
|
|
179
|
+
// onboarding — the bot returns and lands directly on /onboarding.
|
|
180
|
+
let onboardingPath = false;
|
|
181
|
+
try {
|
|
182
|
+
onboardingPath =
|
|
183
|
+
/\/(?:onboarding|welcome|getting-started|get-started|setup)(?:\/|$)/i.test(new URL(url).pathname);
|
|
184
|
+
}
|
|
185
|
+
catch {
|
|
186
|
+
// Malformed URL — skip
|
|
187
|
+
}
|
|
188
|
+
if (onboardingPath && !hasSignupOrOAuthAffordance) {
|
|
189
|
+
const WIZARD_STEP_BTN = /^\s*(?:next|continue|submit|skip(?:\s+for\s+now)?|finish|done)\s*$/i;
|
|
190
|
+
const hasWizardStepButton = inventory.some((e) => {
|
|
191
|
+
const t = (e.visibleText ?? e.ariaLabel ?? "").trim();
|
|
192
|
+
return WIZARD_STEP_BTN.test(t);
|
|
193
|
+
});
|
|
194
|
+
if (hasWizardStepButton)
|
|
195
|
+
return true;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return false;
|
|
199
|
+
}
|
|
200
|
+
// rc.12 — sanity-cap the element's own visible text. A real sign-in
|
|
201
|
+
// button is short ("Continue with Google" = 19 chars, "Sign in with
|
|
202
|
+
// GitHub" = 19). When the element's visibleText runs longer than the
|
|
203
|
+
// cap below, it is wrapping unrelated content — typically a marketing
|
|
204
|
+
// card with a small provider logo nested inside. The OpenRouter case:
|
|
205
|
+
// an <a> wrapping a model card whose textContent reads "anthropic/
|
|
206
|
+
// claude-opus-4.7Model routing visualization…" and whose descendant
|
|
207
|
+
// tree contains an <img alt="Google"> for a tiny G icon. The iconLabel
|
|
208
|
+
// path then fired against the wrong element. Capping at 60 chars also
|
|
209
|
+
// gates path 2 to truly icon-only elements (no own visible text) so a
|
|
210
|
+
// card wrapper with one stray <img alt> can never match.
|
|
211
|
+
const MAX_OAUTH_BUTTON_TEXT_CHARS = 60;
|
|
212
|
+
function normalizeOAuthButtonText(text, keyword) {
|
|
213
|
+
return text.replace(new RegExp(`(${keyword})(?=[A-Z])`, "gi"), "$1 ");
|
|
214
|
+
}
|
|
215
|
+
// Find a "Sign in with <provider>" affordance in the page inventory —
|
|
216
|
+
// the entry point for the OAuth-first path (T6/T13). Three signals, in
|
|
217
|
+
// confidence order — derived from a live sweep where the text-only
|
|
218
|
+
// heuristic missed real buttons:
|
|
219
|
+
// 1. href — an <a> whose link routes through the provider's OAuth
|
|
220
|
+
// endpoint (/identity/login/google, /auth/github/callback, …).
|
|
221
|
+
// Unambiguous: a marketing link to policies.google.com does not.
|
|
222
|
+
// 2. iconLabel — an icon-only button with no text at all, named only
|
|
223
|
+
// by a descendant <img alt="Google"> / <svg><title> (Mistral).
|
|
224
|
+
// 3. text + an auth verb — "Continue with Google", "Sign up with
|
|
225
|
+
// GitHub". The auth verb is what keeps a bare "Google" nav link
|
|
226
|
+
// or "Google's Privacy Policy" out.
|
|
227
|
+
// Returns null when the page has no such affordance — the planner then
|
|
228
|
+
// falls back to form-fill.
|
|
229
|
+
export function findOAuthButton(inventory, provider) {
|
|
230
|
+
const keyword = OAUTH_PROVIDERS[provider].buttonKeyword;
|
|
231
|
+
const keywordRe = new RegExp(`\\b${keyword}\\b`);
|
|
232
|
+
const hrefRe = new RegExp(`(?:login|signin|sign-in|auth|oauth|connect|sso)[/_-]*${keyword}` +
|
|
233
|
+
`|${keyword}[/_-]*(?:login|signin|auth|oauth|connect)`, "i");
|
|
234
|
+
for (const e of inventory) {
|
|
235
|
+
const isButtonish = e.tag === "button" ||
|
|
236
|
+
e.tag === "a" ||
|
|
237
|
+
e.role === "button" ||
|
|
238
|
+
e.type === "submit" ||
|
|
239
|
+
e.type === "button";
|
|
240
|
+
if (!isButtonish)
|
|
241
|
+
continue;
|
|
242
|
+
const visibleText = (e.visibleText ?? "").trim();
|
|
243
|
+
if (visibleText.length > MAX_OAUTH_BUTTON_TEXT_CHARS)
|
|
244
|
+
continue;
|
|
245
|
+
// 1. An <a> whose href routes through the provider's OAuth endpoint.
|
|
246
|
+
const href = (e.href ?? "").toLowerCase();
|
|
247
|
+
if (href.length > 0 && hrefRe.test(href))
|
|
248
|
+
return e;
|
|
249
|
+
// 2. Icon-only (logo) button — named only by a descendant img/svg.
|
|
250
|
+
// Truly-empty visibleText is the clean case. But a logo button whose
|
|
251
|
+
// <svg> carries a <title>GitHub</title> LEAKS that title into
|
|
252
|
+
// textContent (northflank renders "GitHubGitHub" — doubled, which
|
|
253
|
+
// also defeats the \bgithub\b match in path 3), so it isn't strictly
|
|
254
|
+
// empty. Treat it as icon-only too WHEN its visible text is nothing
|
|
255
|
+
// but the provider name (any number of times): strip every keyword
|
|
256
|
+
// occurrence and require no residue. A nav link like "GitHub's
|
|
257
|
+
// Privacy Policy" leaves residue and is correctly rejected. The
|
|
258
|
+
// iconLabel must still independently name the provider, so a stray
|
|
259
|
+
// one-word label can't false-positive.
|
|
260
|
+
const kw = keyword.toLowerCase();
|
|
261
|
+
const residue = visibleText
|
|
262
|
+
.toLowerCase()
|
|
263
|
+
.split(kw)
|
|
264
|
+
.join("")
|
|
265
|
+
.replace(/[\s·|/–-]+/g, "");
|
|
266
|
+
const isLogoOnly = visibleText.length === 0 || residue.length === 0;
|
|
267
|
+
if (isLogoOnly && keywordRe.test((e.iconLabel ?? "").toLowerCase())) {
|
|
268
|
+
return e;
|
|
269
|
+
}
|
|
270
|
+
// 3. Visible text / accessible label naming the provider + an
|
|
271
|
+
// auth verb. The auth verb requirement rejects nav and policy
|
|
272
|
+
// links that merely mention the provider.
|
|
273
|
+
const text = normalizeOAuthButtonText(`${visibleText} ${e.ariaLabel ?? ""} ${e.labelText ?? ""}`, keyword)
|
|
274
|
+
.toLowerCase()
|
|
275
|
+
.replace(/\s+/g, " ")
|
|
276
|
+
.trim();
|
|
277
|
+
if (!keywordRe.test(text))
|
|
278
|
+
continue;
|
|
279
|
+
// "with <provider>" is the OAuth-button idiom and is accepted
|
|
280
|
+
// directly — it survives an SVG accessible name glued to the verb.
|
|
281
|
+
// elevenlabs renders its button text as "GoogleSign up with Google",
|
|
282
|
+
// which fuses "sign" into "googlesign" so the bare \bsign\b check
|
|
283
|
+
// misses, but "with google" still matches. (A blanket camelCase split
|
|
284
|
+
// can't be used to un-glue it — it would mangle the provider name
|
|
285
|
+
// itself, e.g. "GitHub" → "Git Hub".)
|
|
286
|
+
const withProviderRe = new RegExp(`\\bwith ${keyword}\\b`);
|
|
287
|
+
if (/\b(sign|signup|signin|continue|log ?in|connect|auth)\b/.test(text) ||
|
|
288
|
+
withProviderRe.test(text)) {
|
|
289
|
+
return e;
|
|
290
|
+
}
|
|
291
|
+
// rc.39 — minimal-label OAuth buttons. Some auth UIs render the
|
|
292
|
+
// provider as a bare keyword button: just "GitHub" or just "Google"
|
|
293
|
+
// (Turso, several Stytch / Clerk / Auth0 templates). When the
|
|
294
|
+
// VISIBLE text is essentially nothing but the provider keyword,
|
|
295
|
+
// accept it — no auth-verb required. The keyword regex already
|
|
296
|
+
// ensured the provider name is present; the length cap MAX_OAUTH_
|
|
297
|
+
// BUTTON_TEXT_CHARS (60) ensures it's still buttonish, not a
|
|
298
|
+
// paragraph that happens to mention the provider.
|
|
299
|
+
//
|
|
300
|
+
// 0.8.3-rc.1 — reject minimal-label matches whose href points at
|
|
301
|
+
// a NON-AUTH path on the provider's domain (most often a project
|
|
302
|
+
// repo URL like github.com/plausible/analytics in a homepage
|
|
303
|
+
// footer). Without this gate, plausible's footer "GitHub" link
|
|
304
|
+
// matched, the bot clicked it, ended up on the analytics repo's
|
|
305
|
+
// page, and misclassified the README content as a security
|
|
306
|
+
// challenge — burning the entire OAuth budget on a false alarm.
|
|
307
|
+
const stripped = visibleText.toLowerCase().replace(/[^a-z0-9]+/g, " ").trim();
|
|
308
|
+
if (stripped === keyword || stripped === `with ${keyword}`) {
|
|
309
|
+
// When the element is an <a> with a provider-domain href, require
|
|
310
|
+
// it to look like an auth route. Repo / docs / marketing links
|
|
311
|
+
// on the provider's site never start an OAuth flow.
|
|
312
|
+
if (href.length > 0) {
|
|
313
|
+
const providerDomain = provider === "github" ? "github.com" : "google.com";
|
|
314
|
+
if (href.includes(providerDomain)) {
|
|
315
|
+
// Accept only if href matches the auth pattern OR points
|
|
316
|
+
// at a login/signup/sessions/oauth path.
|
|
317
|
+
const looksLikeAuthPath = hrefRe.test(href) ||
|
|
318
|
+
/github\.com\/(?:login|signin|sign-in|sessions|oauth\/authorize|apps\/[^/]+\/installations\/new|users\/sign_in)/i.test(href) ||
|
|
319
|
+
/accounts\.google\.com\/(?:o\/oauth2|signin)/i.test(href);
|
|
320
|
+
if (!looksLikeAuthPath)
|
|
321
|
+
continue;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
return e;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
return null;
|
|
328
|
+
}
|
|
329
|
+
//# sourceMappingURL=oauth-detect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth-detect.js","sourceRoot":"","s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AC,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC;oBAClC,yDAAyD;oBACzD,yCAAyC;oBACzC,MAAM,iBAAiB,GACrB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;wBACjB,iHAAiH,CAAC,IAAI,CACpH,IAAI,CACL;wBACD,8CAA8C,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;oBAC5D,IAAI,CAAC,iBAAiB;wBAAE,SAAS;gBACnC,CAAC;YACH,CAAC;YACD,OAAO,CAAC,CAAC;QACX,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { InteractiveElement } from "./browser.js";
|
|
2
|
-
import type { PostVerifyStep, SignupResult } from "./
|
|
2
|
+
import type { PostVerifyStep, SignupResult } from "./provision-types.js";
|
|
3
3
|
import { type FailureStage } from "./failure-stage.js";
|
|
4
4
|
import { type SemanticFailureBucket, type SemanticFaultClass, type SemanticTransitionRecord } from "./semantic-transition.js";
|
|
5
5
|
export declare const CAPTURE_FORMAT_VERSION: 1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onboarding-capture.d.ts","sourceRoot":"","sources":["../../src/bot/onboarding-capture.ts"],"names":[],"mappings":"AA2CA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"onboarding-capture.d.ts","sourceRoot":"","sources":["../../src/bot/onboarding-capture.ts"],"names":[],"mappings":"AA2CA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAwB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EAGL,KAAK,qBAAqB,EAC1B,KAAK,kBA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MAAM,EAAE,YAAY,GAAG,IAAI,CAqB7E;AAWD,MAAM,MAAM,iBAAiB,GACzB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,kBAAkB,EAAE,CAAA;CAAE,GAC1C;IACE,EAAE,EAAE,KAAK,CAAC;IACV,MAAM,EACF,iBAAiB,GACjB,eAAe,GACf,oBAAoB,GACpB,eAAe,GACf,WAAW,GACX,aAAa,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEN;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,GACZ,iBAAiB,CA8FnB"}
|
|
@@ -9,20 +9,20 @@ declare const TraceActionSchema: z.ZodObject<{
|
|
|
9
9
|
direction: z.ZodOptional<z.ZodEnum<["down", "up", "bottom", "top"]>>;
|
|
10
10
|
key: z.ZodOptional<z.ZodString>;
|
|
11
11
|
}, "strict", z.ZodTypeAny, {
|
|
12
|
-
kind: "
|
|
12
|
+
kind: "type" | "goto" | "click" | "extract" | "scroll" | "js_click" | "press" | "oauth_click" | "oauth_settle" | "allow_host" | "type_secret";
|
|
13
13
|
host?: string | undefined;
|
|
14
|
+
value?: string | undefined;
|
|
14
15
|
key?: string | undefined;
|
|
15
16
|
slot?: string | undefined;
|
|
16
|
-
value?: string | undefined;
|
|
17
17
|
text_match?: string | undefined;
|
|
18
18
|
url_template?: string | undefined;
|
|
19
19
|
direction?: "top" | "bottom" | "down" | "up" | undefined;
|
|
20
20
|
}, {
|
|
21
|
-
kind: "
|
|
21
|
+
kind: "type" | "goto" | "click" | "extract" | "scroll" | "js_click" | "press" | "oauth_click" | "oauth_settle" | "allow_host" | "type_secret";
|
|
22
22
|
host?: string | undefined;
|
|
23
|
+
value?: string | undefined;
|
|
23
24
|
key?: string | undefined;
|
|
24
25
|
slot?: string | undefined;
|
|
25
|
-
value?: string | undefined;
|
|
26
26
|
text_match?: string | undefined;
|
|
27
27
|
url_template?: string | undefined;
|
|
28
28
|
direction?: "top" | "bottom" | "down" | "up" | undefined;
|
|
@@ -40,31 +40,31 @@ declare const TraceEntrySchema: z.ZodObject<{
|
|
|
40
40
|
direction: z.ZodOptional<z.ZodEnum<["down", "up", "bottom", "top"]>>;
|
|
41
41
|
key: z.ZodOptional<z.ZodString>;
|
|
42
42
|
}, "strict", z.ZodTypeAny, {
|
|
43
|
-
kind: "
|
|
43
|
+
kind: "type" | "goto" | "click" | "extract" | "scroll" | "js_click" | "press" | "oauth_click" | "oauth_settle" | "allow_host" | "type_secret";
|
|
44
44
|
host?: string | undefined;
|
|
45
|
+
value?: string | undefined;
|
|
45
46
|
key?: string | undefined;
|
|
46
47
|
slot?: string | undefined;
|
|
47
|
-
value?: string | undefined;
|
|
48
48
|
text_match?: string | undefined;
|
|
49
49
|
url_template?: string | undefined;
|
|
50
50
|
direction?: "top" | "bottom" | "down" | "up" | undefined;
|
|
51
51
|
}, {
|
|
52
|
-
kind: "
|
|
52
|
+
kind: "type" | "goto" | "click" | "extract" | "scroll" | "js_click" | "press" | "oauth_click" | "oauth_settle" | "allow_host" | "type_secret";
|
|
53
53
|
host?: string | undefined;
|
|
54
|
+
value?: string | undefined;
|
|
54
55
|
key?: string | undefined;
|
|
55
56
|
slot?: string | undefined;
|
|
56
|
-
value?: string | undefined;
|
|
57
57
|
text_match?: string | undefined;
|
|
58
58
|
url_template?: string | undefined;
|
|
59
59
|
direction?: "top" | "bottom" | "down" | "up" | undefined;
|
|
60
60
|
}>;
|
|
61
61
|
}, "strict", z.ZodTypeAny, {
|
|
62
62
|
action: {
|
|
63
|
-
kind: "
|
|
63
|
+
kind: "type" | "goto" | "click" | "extract" | "scroll" | "js_click" | "press" | "oauth_click" | "oauth_settle" | "allow_host" | "type_secret";
|
|
64
64
|
host?: string | undefined;
|
|
65
|
+
value?: string | undefined;
|
|
65
66
|
key?: string | undefined;
|
|
66
67
|
slot?: string | undefined;
|
|
67
|
-
value?: string | undefined;
|
|
68
68
|
text_match?: string | undefined;
|
|
69
69
|
url_template?: string | undefined;
|
|
70
70
|
direction?: "top" | "bottom" | "down" | "up" | undefined;
|
|
@@ -72,11 +72,11 @@ declare const TraceEntrySchema: z.ZodObject<{
|
|
|
72
72
|
intent?: string | undefined;
|
|
73
73
|
}, {
|
|
74
74
|
action: {
|
|
75
|
-
kind: "
|
|
75
|
+
kind: "type" | "goto" | "click" | "extract" | "scroll" | "js_click" | "press" | "oauth_click" | "oauth_settle" | "allow_host" | "type_secret";
|
|
76
76
|
host?: string | undefined;
|
|
77
|
+
value?: string | undefined;
|
|
77
78
|
key?: string | undefined;
|
|
78
79
|
slot?: string | undefined;
|
|
79
|
-
value?: string | undefined;
|
|
80
80
|
text_match?: string | undefined;
|
|
81
81
|
url_template?: string | undefined;
|
|
82
82
|
direction?: "top" | "bottom" | "down" | "up" | undefined;
|
|
@@ -190,31 +190,31 @@ export declare const OperatorRecipeSchema: z.ZodObject<{
|
|
|
190
190
|
direction: z.ZodOptional<z.ZodEnum<["down", "up", "bottom", "top"]>>;
|
|
191
191
|
key: z.ZodOptional<z.ZodString>;
|
|
192
192
|
}, "strict", z.ZodTypeAny, {
|
|
193
|
-
kind: "
|
|
193
|
+
kind: "type" | "goto" | "click" | "extract" | "scroll" | "js_click" | "press" | "oauth_click" | "oauth_settle" | "allow_host" | "type_secret";
|
|
194
194
|
host?: string | undefined;
|
|
195
|
+
value?: string | undefined;
|
|
195
196
|
key?: string | undefined;
|
|
196
197
|
slot?: string | undefined;
|
|
197
|
-
value?: string | undefined;
|
|
198
198
|
text_match?: string | undefined;
|
|
199
199
|
url_template?: string | undefined;
|
|
200
200
|
direction?: "top" | "bottom" | "down" | "up" | undefined;
|
|
201
201
|
}, {
|
|
202
|
-
kind: "
|
|
202
|
+
kind: "type" | "goto" | "click" | "extract" | "scroll" | "js_click" | "press" | "oauth_click" | "oauth_settle" | "allow_host" | "type_secret";
|
|
203
203
|
host?: string | undefined;
|
|
204
|
+
value?: string | undefined;
|
|
204
205
|
key?: string | undefined;
|
|
205
206
|
slot?: string | undefined;
|
|
206
|
-
value?: string | undefined;
|
|
207
207
|
text_match?: string | undefined;
|
|
208
208
|
url_template?: string | undefined;
|
|
209
209
|
direction?: "top" | "bottom" | "down" | "up" | undefined;
|
|
210
210
|
}>;
|
|
211
211
|
}, "strict", z.ZodTypeAny, {
|
|
212
212
|
action: {
|
|
213
|
-
kind: "
|
|
213
|
+
kind: "type" | "goto" | "click" | "extract" | "scroll" | "js_click" | "press" | "oauth_click" | "oauth_settle" | "allow_host" | "type_secret";
|
|
214
214
|
host?: string | undefined;
|
|
215
|
+
value?: string | undefined;
|
|
215
216
|
key?: string | undefined;
|
|
216
217
|
slot?: string | undefined;
|
|
217
|
-
value?: string | undefined;
|
|
218
218
|
text_match?: string | undefined;
|
|
219
219
|
url_template?: string | undefined;
|
|
220
220
|
direction?: "top" | "bottom" | "down" | "up" | undefined;
|
|
@@ -222,11 +222,11 @@ export declare const OperatorRecipeSchema: z.ZodObject<{
|
|
|
222
222
|
intent?: string | undefined;
|
|
223
223
|
}, {
|
|
224
224
|
action: {
|
|
225
|
-
kind: "
|
|
225
|
+
kind: "type" | "goto" | "click" | "extract" | "scroll" | "js_click" | "press" | "oauth_click" | "oauth_settle" | "allow_host" | "type_secret";
|
|
226
226
|
host?: string | undefined;
|
|
227
|
+
value?: string | undefined;
|
|
227
228
|
key?: string | undefined;
|
|
228
229
|
slot?: string | undefined;
|
|
229
|
-
value?: string | undefined;
|
|
230
230
|
text_match?: string | undefined;
|
|
231
231
|
url_template?: string | undefined;
|
|
232
232
|
direction?: "top" | "bottom" | "down" | "up" | undefined;
|
|
@@ -301,11 +301,11 @@ export declare const OperatorRecipeSchema: z.ZodObject<{
|
|
|
301
301
|
name: string;
|
|
302
302
|
trace: {
|
|
303
303
|
action: {
|
|
304
|
-
kind: "
|
|
304
|
+
kind: "type" | "goto" | "click" | "extract" | "scroll" | "js_click" | "press" | "oauth_click" | "oauth_settle" | "allow_host" | "type_secret";
|
|
305
305
|
host?: string | undefined;
|
|
306
|
+
value?: string | undefined;
|
|
306
307
|
key?: string | undefined;
|
|
307
308
|
slot?: string | undefined;
|
|
308
|
-
value?: string | undefined;
|
|
309
309
|
text_match?: string | undefined;
|
|
310
310
|
url_template?: string | undefined;
|
|
311
311
|
direction?: "top" | "bottom" | "down" | "up" | undefined;
|
|
@@ -337,11 +337,11 @@ export declare const OperatorRecipeSchema: z.ZodObject<{
|
|
|
337
337
|
name: string;
|
|
338
338
|
trace: {
|
|
339
339
|
action: {
|
|
340
|
-
kind: "
|
|
340
|
+
kind: "type" | "goto" | "click" | "extract" | "scroll" | "js_click" | "press" | "oauth_click" | "oauth_settle" | "allow_host" | "type_secret";
|
|
341
341
|
host?: string | undefined;
|
|
342
|
+
value?: string | undefined;
|
|
342
343
|
key?: string | undefined;
|
|
343
344
|
slot?: string | undefined;
|
|
344
|
-
value?: string | undefined;
|
|
345
345
|
text_match?: string | undefined;
|
|
346
346
|
url_template?: string | undefined;
|
|
347
347
|
direction?: "top" | "bottom" | "down" | "up" | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Skill, type SkillStep, type SkillStepProvenance } from "@trusty-squire/skill-schema";
|
|
2
2
|
import type { InteractiveElement } from "./browser.js";
|
|
3
|
-
import type { PostVerifyStep } from "./
|
|
3
|
+
import type { PostVerifyStep } from "./provision-types.js";
|
|
4
4
|
import { type OnboardingCaseFile } from "./onboarding-capture.js";
|
|
5
5
|
export interface PromoteInput {
|
|
6
6
|
/** Directory containing the `<service>-<run_id>-r*.json` capture files. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promote-to-skill.d.ts","sourceRoot":"","sources":["../../src/bot/promote-to-skill.ts"],"names":[],"mappings":"AAqCA,OAAO,EAIL,KAAK,KAAK,EAEV,KAAK,SAAS,EACd,KAAK,mBAAmB,EACz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AAE,kBAAkB,GAAG,MAAM,GAAG,IAAI,CAsBlE;AA+dD,wBAAgB,6BAA6B,CAC3C,QAAQ,EAAE,OAAO,CAAC,cAAc,EAAE;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,CAAC,EACtD,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,mBAAmB,GAC9B,SAAS,EAAE,GAAG,IAAI,CAkCpB;AAgGD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,CAMvE;AA2wBD,wBAAgB,aAAa,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,EAAE,UAAU,CAAC,GAAG,MAAM,CAexE"}
|
|
@@ -764,11 +764,13 @@ function translateStep(observed, inventory, provenance, roundIndex, roundHtml) {
|
|
|
764
764
|
// ("API key name", "production-api-key") closes that gap.
|
|
765
765
|
const literal = observed.value;
|
|
766
766
|
const looksGenerated = /^[a-z]{3,15}-[a-z0-9]{4,12}$/.test(literal);
|
|
767
|
-
// An email value is the run's signup
|
|
768
|
-
//
|
|
769
|
-
//
|
|
770
|
-
//
|
|
771
|
-
//
|
|
767
|
+
// An email value is the run's signup email — templatize it to the email
|
|
768
|
+
// slot token so the literal never bakes into a shared skill (privacy: in
|
|
769
|
+
// the operator model this is the USER's real address) and so each run
|
|
770
|
+
// fills a fresh value. The token keeps its legacy ${EMAIL_ALIAS} name for
|
|
771
|
+
// corpus compatibility (validateReplayGraph + published skills key off it);
|
|
772
|
+
// post-scope-#1 it denotes "the email to fill" (operator-resolved), not a
|
|
773
|
+
// Squire alias, and there is no autonomous await_email_code poll anymore.
|
|
772
774
|
const looksLikeEmail = /^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(literal.trim());
|
|
773
775
|
const matchedInput = inventory.find((e) => e.selector === observed.selector);
|
|
774
776
|
const inputLooksLikeTokenName = matchedInput !== undefined && looksLikeTokenNameInput(matchedInput);
|