@trusty-squire/mcp 0.1.17 → 0.2.0

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.
Files changed (53) hide show
  1. package/dist/bin.js +2 -2
  2. package/dist/bin.js.map +1 -1
  3. package/dist/bot/agent.d.ts +7 -1
  4. package/dist/bot/agent.d.ts.map +1 -1
  5. package/dist/bot/agent.js +396 -39
  6. package/dist/bot/agent.js.map +1 -1
  7. package/dist/bot/browser.d.ts +15 -3
  8. package/dist/bot/browser.d.ts.map +1 -1
  9. package/dist/bot/browser.js +273 -56
  10. package/dist/bot/browser.js.map +1 -1
  11. package/dist/bot/google-login.d.ts +18 -0
  12. package/dist/bot/google-login.d.ts.map +1 -0
  13. package/dist/bot/google-login.js +379 -0
  14. package/dist/bot/google-login.js.map +1 -0
  15. package/dist/bot/index.d.ts +5 -0
  16. package/dist/bot/index.d.ts.map +1 -1
  17. package/dist/bot/index.js +14 -0
  18. package/dist/bot/index.js.map +1 -1
  19. package/dist/bot/llm-client.d.ts.map +1 -1
  20. package/dist/bot/llm-client.js +19 -12
  21. package/dist/bot/llm-client.js.map +1 -1
  22. package/dist/bot/oauth-lock.d.ts +2 -0
  23. package/dist/bot/oauth-lock.d.ts.map +1 -0
  24. package/dist/bot/oauth-lock.js +28 -0
  25. package/dist/bot/oauth-lock.js.map +1 -0
  26. package/dist/bot/oauth-providers.d.ts +16 -0
  27. package/dist/bot/oauth-providers.d.ts.map +1 -0
  28. package/dist/bot/oauth-providers.js +100 -0
  29. package/dist/bot/oauth-providers.js.map +1 -0
  30. package/dist/bot/oauth-thin-slice.d.ts +2 -0
  31. package/dist/bot/oauth-thin-slice.d.ts.map +1 -0
  32. package/dist/bot/oauth-thin-slice.js +203 -0
  33. package/dist/bot/oauth-thin-slice.js.map +1 -0
  34. package/dist/bot/profile.d.ts +2 -0
  35. package/dist/bot/profile.d.ts.map +1 -0
  36. package/dist/bot/profile.js +11 -0
  37. package/dist/bot/profile.js.map +1 -0
  38. package/dist/install/cli.d.ts +4 -1
  39. package/dist/install/cli.d.ts.map +1 -1
  40. package/dist/install/cli.js +41 -1
  41. package/dist/install/cli.js.map +1 -1
  42. package/dist/server.d.ts.map +1 -1
  43. package/dist/server.js +3 -2
  44. package/dist/server.js.map +1 -1
  45. package/dist/tools/index.d.ts +2 -1
  46. package/dist/tools/index.d.ts.map +1 -1
  47. package/dist/tools/index.js +3 -2
  48. package/dist/tools/index.js.map +1 -1
  49. package/dist/tools/provision-any.d.ts +50 -46
  50. package/dist/tools/provision-any.d.ts.map +1 -1
  51. package/dist/tools/provision-any.js +266 -107
  52. package/dist/tools/provision-any.js.map +1 -1
  53. package/package.json +3 -1
@@ -5,10 +5,15 @@
5
5
  // pipeline (see apps/api/src/routes/ses-webhook.ts) can deliver
6
6
  // verification emails.
7
7
  //
8
+ // ASYNC MODEL: a real signup takes 3-8 minutes — well past the ~60s hard
9
+ // timeout Claude Code (and most MCP hosts) put on a single tool call. So
10
+ // `provision_any_service` does NOT block: it starts the run in the
11
+ // background inside this server process, returns a run_id immediately,
12
+ // and the caller polls `check_provision_status` until the run leaves the
13
+ // "running" state.
14
+ //
8
15
  // Auth model: Tier 0 machine token from the session file. No account or
9
- // mandate required for free-tier signups. When the user hits their quota
10
- // the API returns a structured quota_exceeded response and we tell Claude
11
- // to surface a pairing CTA.
16
+ // mandate required for free-tier signups.
12
17
  import { randomBytes } from "crypto";
13
18
  import { z } from "zod";
14
19
  import { UniversalSignupBot, InboxClient, ProxyLLMClient, detectAsn, } from "../bot/index.js";
@@ -16,49 +21,90 @@ import { openSessionStorage } from "../session.js";
16
21
  export const provisionAnyInputSchema = z.object({
17
22
  service: z.string().describe("Name of the service to sign up for (e.g., 'Postmark', 'Mailgun')"),
18
23
  signup_url: z.string().optional().describe("Direct URL to signup page (optional, will search if not provided)"),
24
+ oauth_provider: z
25
+ .enum(["google", "github"])
26
+ .optional()
27
+ .describe("Prefer OAuth signup with this provider: if the page has a 'Sign in with Google/GitHub' button, sign up through it using the bot's saved session instead of filling a form. Requires a one-time `npx @trusty-squire/mcp login [--provider=github]` first."),
28
+ });
29
+ export const checkProvisionStatusInputSchema = z.object({
30
+ run_id: z.string().describe("The run_id returned by provision_any_service."),
19
31
  });
20
32
  // JSON Schema for MCP `tools/list`. The SDK forwards `inputSchema` verbatim
21
- // to the host agent (Claude Code, Goose, etc.); a zod object stringifies to
22
- // `{}` and leaves the LLM blind to required parameters. The schema here
23
- // must mirror `provisionAnyInputSchema` above.
33
+ // to the host agent; a zod object stringifies to `{}` and leaves the LLM
34
+ // blind to required parameters, so these mirror the zod schemas above.
24
35
  const PROVISION_ANY_JSON_SCHEMA = {
25
36
  type: "object",
26
37
  required: ["service"],
27
38
  properties: {
28
39
  service: {
29
40
  type: "string",
30
- description: "Name of the service to sign up for (e.g., 'Postmark', 'Mailgun', 'IPInfo')",
41
+ description: "Name of the service to sign up for (e.g., 'Postmark', 'Mailgun', 'IPInfo').",
31
42
  },
32
43
  signup_url: {
33
44
  type: "string",
34
45
  description: "Direct URL to the service's signup page. Optional — the bot will navigate from the service name if omitted.",
35
46
  },
47
+ oauth_provider: {
48
+ type: "string",
49
+ enum: ["google", "github"],
50
+ description: "Prefer OAuth signup with this provider. When set and the page has a matching 'Sign in with Google/GitHub' affordance, the bot signs up through it (using the session established by `npx @trusty-squire/mcp login [--provider=github]`) instead of filling a form.",
51
+ },
36
52
  },
37
53
  };
38
- const DESCRIPTION = `Sign up for any free API service automatically using browser automation.
54
+ const CHECK_STATUS_JSON_SCHEMA = {
55
+ type: "object",
56
+ required: ["run_id"],
57
+ properties: {
58
+ run_id: {
59
+ type: "string",
60
+ description: "The run_id returned by provision_any_service.",
61
+ },
62
+ },
63
+ };
64
+ const runStore = new Map();
65
+ // Cap so a long session cannot leak memory; oldest run evicted first.
66
+ const MAX_RUNS = 50;
67
+ const PROVISION_DESCRIPTION = `Start signing up for any free API service using browser automation.
68
+
69
+ ASYNC — IMPORTANT: a signup takes several minutes, longer than a single
70
+ tool call may stay open. This tool does NOT wait for the signup. It
71
+ starts the run and returns immediately with a run_id and status="started".
72
+ You MUST then poll check_provision_status with that run_id (about once a
73
+ minute) until its status is no longer "running".
39
74
 
40
75
  WHEN TO CALL THIS TOOL:
41
- - The user wants an account for a service Trusty Squire doesn't have a native adapter for
42
- - Call list_services first; if the service ISN'T in the directory, use this tool
43
- - Best for free-tier developer services with traditional email/password signup
76
+ - The user wants an account for a service Trusty Squire has no native adapter for.
77
+ - Best for free-tier developer services with email/password signup.
44
78
 
45
- BEHAVIOR:
46
- - Runs Playwright on the user's machine (uses their IP for captcha resilience)
47
- - Receives verification emails via Trusty Squire's SES inbound infrastructure
48
- - Returns API credentials directly on success
49
- - Free for the first N signups per machine (Tier 0); after that, returns a
50
- pairing CTA the user clicks to upgrade
79
+ IMMEDIATE RESPONSES (no run started):
80
+ - status="started" + run_id poll check_provision_status next.
81
+ - status="quota_exceeded" + cta_pair_url tell the user to run \`npx @trusty-squire/mcp pair\`.
82
+ - status="not_installed" Trusty Squire isn't installed; tell the user to run the installer.
83
+ - status="error" could not reach the API to set up the signup.`;
84
+ const CHECK_DESCRIPTION = `Check the status of a signup started by provision_any_service.
51
85
 
52
- POSSIBLE RESPONSES:
53
- - status="success" + credentials use them immediately
54
- - status="quota_exceeded" + cta_pair_url → tell the user to run \`npx @trusty-squire/mcp pair\`
55
- or open the URL to upgrade. Their next signup will work.
56
- - status="captcha_blocked" → the signup site uses captcha we can't bypass. Tell the user
57
- to sign up manually at the service's signup URL.
58
- - status="failed" → the form filled but submission didn't yield credentials. Show steps[].`;
86
+ Pass the run_id from provision_any_service. Poll about once a minute
87
+ until status is no longer "running".
88
+
89
+ RESPONSES:
90
+ - status="running" → still working; poll again in ~60s.
91
+ - status="success" + credentials signup done; show the credentials to the user.
92
+ - status="verification_not_sent" → submitted, but the service sent no verification
93
+ email (anti-abuse withholding, or it needs manual signup).
94
+ - status="captcha_blocked" → the site uses a captcha the bot can't pass; manual signup.
95
+ - status="oauth_required" → the service only offers OAuth signup; manual signup.
96
+ - status="needs_login" → an OAuth signup needs the bot's one-time Google login;
97
+ tell the user to run \`npx @trusty-squire/mcp login\`, then retry.
98
+ - status="oauth_consent_needs_review" → the Google consent screen asked for more than
99
+ basic profile access; the user must complete the OAuth signup manually.
100
+ - status="onboarding_blocked" → signed in via Google, but the API key is behind a
101
+ billing/payment wall; the user must add a payment method.
102
+ - status="failed" → the form filled but yielded no credentials; show steps[].
103
+ - status="error" → the run crashed; show error.
104
+ - status="unknown_run" → no such run (it expired, or the MCP server restarted).`;
59
105
  export const provisionAnyTool = {
60
106
  name: "provision_any_service",
61
- description: DESCRIPTION,
107
+ description: PROVISION_DESCRIPTION,
62
108
  jsonInputSchema: PROVISION_ANY_JSON_SCHEMA,
63
109
  inputSchema: provisionAnyInputSchema,
64
110
  handler: async (input, _api) => {
@@ -66,10 +112,6 @@ export const provisionAnyTool = {
66
112
  const storage = await openSessionStorage();
67
113
  const session = await storage.read();
68
114
  if (session === null || session.machine_token === undefined) {
69
- // Production users hit this when they've never run the install CLI.
70
- // Local-dev users hit this if their session.json only has an
71
- // agent_session_token (Tier 1 pair without a machine_token issued).
72
- // Surface both paths so the agent can route the user correctly.
73
115
  const hasPartialSession = session !== null && session.agent_session_token !== undefined;
74
116
  return {
75
117
  status: "not_installed",
@@ -79,15 +121,10 @@ export const provisionAnyTool = {
79
121
  };
80
122
  }
81
123
  const apiBase = session.api_base_url;
82
- // Create an alias through the API (consumes one quota slot for Tier 0).
83
- const inboxClient = new InboxClient({
84
- baseUrl: apiBase,
85
- apiKey: session.machine_token,
86
- });
87
- // Random suffix, not just a ms timestamp: two concurrent signups
88
- // in the same millisecond would otherwise share a run_id — and,
89
- // for the same service, the same inbox alias — and cross-read
90
- // each other's verification email.
124
+ const inboxClient = new InboxClient({ baseUrl: apiBase, apiKey: session.machine_token });
125
+ // Random suffix, not just a ms timestamp: two concurrent signups in
126
+ // the same millisecond would otherwise share a run_id — and, for the
127
+ // same service, the same inbox alias.
91
128
  const runId = `mcp-${Date.now().toString(36)}-${randomBytes(4).toString("hex")}`;
92
129
  let alias;
93
130
  try {
@@ -101,7 +138,7 @@ export const provisionAnyTool = {
101
138
  }
102
139
  catch (err) {
103
140
  const message = err instanceof Error ? err.message : String(err);
104
- // The createAlias error body has the structured payload; parse it back.
141
+ // The createAlias error body carries the structured payload; parse it back.
105
142
  if (/quota_exceeded/.test(message)) {
106
143
  const match = message.match(/\{.*\}/s);
107
144
  if (match !== null) {
@@ -129,52 +166,101 @@ export const provisionAnyTool = {
129
166
  message: `Couldn't reach Trusty Squire's API to set up an alias.`,
130
167
  };
131
168
  }
132
- // Construct an LLMPair that routes through Trusty Squire's proxy.
169
+ // Register the run, evicting the oldest if the store is full.
170
+ if (runStore.size >= MAX_RUNS) {
171
+ const oldest = runStore.keys().next().value;
172
+ if (oldest !== undefined)
173
+ runStore.delete(oldest);
174
+ }
175
+ runStore.set(runId, { service: input.service, startedAt: Date.now(), result: undefined });
176
+ // Start the signup in the background — do NOT await it. runSignupTask
177
+ // never rejects; it writes the final response into runStore, which
178
+ // check_provision_status then reads.
179
+ void runSignupTask(runId, input, {
180
+ apiBase,
181
+ machineToken: session.machine_token,
182
+ alias,
183
+ inboxClient,
184
+ });
185
+ return {
186
+ status: "started",
187
+ run_id: runId,
188
+ service: input.service,
189
+ message: `Signup for ${input.service} started in the background. ` +
190
+ `Poll check_provision_status with run_id="${runId}" about once a minute ` +
191
+ `until its status is no longer "running" (typically 3-6 minutes).`,
192
+ };
193
+ },
194
+ };
195
+ export const checkProvisionStatusTool = {
196
+ name: "check_provision_status",
197
+ description: CHECK_DESCRIPTION,
198
+ jsonInputSchema: CHECK_STATUS_JSON_SCHEMA,
199
+ inputSchema: checkProvisionStatusInputSchema,
200
+ handler: async (input, _api) => {
201
+ const record = runStore.get(input.run_id);
202
+ if (record === undefined) {
203
+ return {
204
+ status: "unknown_run",
205
+ run_id: input.run_id,
206
+ message: "No signup run with that run_id. It may have finished and been evicted, " +
207
+ "or the MCP server restarted since it started. Start a new provision_any_service run.",
208
+ };
209
+ }
210
+ if (record.result === undefined) {
211
+ return {
212
+ status: "running",
213
+ run_id: input.run_id,
214
+ service: record.service,
215
+ elapsed_seconds: Math.round((Date.now() - record.startedAt) / 1000),
216
+ message: "Signup still in progress. Poll again in about 60 seconds.",
217
+ };
218
+ }
219
+ return record.result;
220
+ },
221
+ };
222
+ // Runs the signup to completion and stores the final tool response in
223
+ // runStore. Never rejects — any throw is captured as an error result.
224
+ async function runSignupTask(runId, input, ctx) {
225
+ let response;
226
+ try {
133
227
  // The user pays nothing for LLM calls — the operator's OpenRouter
134
- // key handles them server-side, gated by the machine token's
135
- // rolling rate limit. Cheap mode (Gemini Flash) is the primary;
136
- // Sonnet is the parse-failure fallback.
228
+ // key handles them server-side, gated by the machine token's rolling
229
+ // rate limit. Cheap tier is primary; premium is the fallback.
137
230
  const llmPair = {
138
231
  primary: new ProxyLLMClient({
139
- apiBaseUrl: apiBase,
140
- machineToken: session.machine_token,
232
+ apiBaseUrl: ctx.apiBase,
233
+ machineToken: ctx.machineToken,
141
234
  tier: "cheap",
142
235
  }),
143
236
  premium: new ProxyLLMClient({
144
- apiBaseUrl: apiBase,
145
- machineToken: session.machine_token,
237
+ apiBaseUrl: ctx.apiBase,
238
+ machineToken: ctx.machineToken,
146
239
  tier: "premium",
147
240
  }),
148
241
  };
149
- // Run the bot locally with this alias. Bot uses the inboxClient to long-
150
- // poll the API for any verification emails that arrive via SES.
151
242
  const bot = new UniversalSignupBot();
152
243
  const result = await bot.signup({
153
244
  service: input.service,
154
245
  ...(input.signup_url !== undefined ? { signupUrl: input.signup_url } : {}),
155
- email: alias,
156
- inbox: inboxClient,
246
+ email: ctx.alias,
247
+ inbox: ctx.inboxClient,
157
248
  llm: llmPair,
249
+ // T6/T13: route through the provider's OAuth path when the
250
+ // caller asked for it (Google or GitHub).
251
+ ...(input.oauth_provider !== undefined ? { oauthProvider: input.oauth_provider } : {}),
158
252
  });
159
- // Best-effort cleanup of the alias once we're done with it. Failure is
160
- // non-fatal — the alias TTL-expires anyway.
253
+ // Best-effort alias cleanup. Failure is non-fatal the alias
254
+ // TTL-expires anyway.
161
255
  try {
162
- await inboxClient.revokeAlias(alias);
256
+ await ctx.inboxClient.revokeAlias(ctx.alias);
163
257
  }
164
258
  catch {
165
259
  // noop
166
260
  }
167
- // If a captcha was encountered (whether or not we got past it),
168
- // report it to the API for the analytics ledger. The result.captcha
169
- // field is set by the agent's pre/post-submit/re-plan gates. We do
170
- // a fresh asn lookup at event time rather than relying on the
171
- // install-time one — users move networks, and "where was the
172
- // machine when this happened" is the analytically interesting bit.
261
+ // Report any captcha encounter to the analytics ledger. Fire-and-forget.
173
262
  if (result.captcha !== undefined) {
174
- // Fire-and-forget; we don't want the captcha-event POST to
175
- // affect what the user sees. Failures here are logged to stderr
176
- // and otherwise ignored.
177
- void postCaptchaEvent(apiBase, session.machine_token, {
263
+ void postCaptchaEvent(ctx.apiBase, ctx.machineToken, {
178
264
  service: input.service,
179
265
  captcha_kind: result.captcha.kind,
180
266
  blocked: result.captcha.blocked,
@@ -184,54 +270,127 @@ export const provisionAnyTool = {
184
270
  signup_succeeded: result.success,
185
271
  });
186
272
  }
187
- if (result.success && result.credentials !== undefined) {
188
- return {
189
- status: "success",
190
- service: input.service,
191
- credentials: result.credentials,
192
- steps: result.steps,
193
- message: `Successfully signed up for ${input.service}. Credentials are in this response — show them to the user (or save to their .env).`,
194
- };
195
- }
196
- // Authoritative: if the agent recorded a captcha encounter and
197
- // marked it blocked, that's a captcha_blocked outcome. Replaces
198
- // the earlier substring heuristic which had to scan steps[].
199
- if (result.captcha !== undefined && result.captcha.blocked) {
200
- return {
201
- status: "captcha_blocked",
202
- service: input.service,
203
- error: result.error ?? "Captcha challenge blocked automated signup.",
204
- steps: result.steps,
205
- captcha_kind: result.captcha.kind,
206
- browser_channel: result.browser_channel ?? null,
207
- message: `${input.service} blocked automated signup with a ${result.captcha.kind} captcha. ` +
208
- `Tell the user to sign up manually at ${input.signup_url ?? `https://${input.service.toLowerCase()}.com`}.`,
209
- };
210
- }
211
- // OAuth-only service: there is no email/password form to automate
212
- // (F3 Issue 4). Surface it as its own status so the agent can tell
213
- // the user plainly rather than reporting a generic failure.
214
- if (result.error !== undefined && result.error.startsWith("oauth_required")) {
215
- return {
216
- status: "oauth_required",
217
- service: input.service,
218
- error: result.error,
219
- steps: result.steps,
220
- browser_channel: result.browser_channel ?? null,
221
- message: `${input.service} only offers Google/GitHub (OAuth) signup — there is no email form the bot can fill. ` +
222
- `Tell the user to sign up manually at ${input.signup_url ?? `https://${input.service.toLowerCase()}.com`}.`,
223
- };
224
- }
273
+ response = buildSignupResponse(input, result);
274
+ }
275
+ catch (err) {
276
+ response = {
277
+ status: "error",
278
+ service: input.service,
279
+ error: err instanceof Error ? err.message : String(err),
280
+ message: `The signup run for ${input.service} crashed before completing.`,
281
+ };
282
+ }
283
+ const record = runStore.get(runId);
284
+ if (record !== undefined)
285
+ record.result = response;
286
+ }
287
+ // Maps a finished SignupResult to the response the caller sees via
288
+ // check_provision_status. Mirrors the status set documented on the
289
+ // tools. Exported for unit testing the error-prefix → status
290
+ // mapping is the load-bearing logic.
291
+ export function buildSignupResponse(input, result) {
292
+ if (result.success && result.credentials !== undefined) {
225
293
  return {
226
- status: "failed",
294
+ status: "success",
227
295
  service: input.service,
228
- error: result.error ?? "Unknown error",
296
+ credentials: result.credentials,
229
297
  steps: result.steps,
298
+ message: `Successfully signed up for ${input.service}. Credentials are in this response — show them to the user (or save to their .env).`,
299
+ };
300
+ }
301
+ // Authoritative: the agent recorded a captcha encounter and marked it
302
+ // blocked → captcha_blocked.
303
+ if (result.captcha !== undefined && result.captcha.blocked) {
304
+ return {
305
+ status: "captcha_blocked",
306
+ service: input.service,
307
+ error: result.error ?? "Captcha challenge blocked automated signup.",
308
+ steps: result.steps,
309
+ captcha_kind: result.captcha.kind,
230
310
  browser_channel: result.browser_channel ?? null,
231
- message: `Couldn't finish signing up for ${input.service}. Show the user the steps[] for debugging.`,
311
+ message: `${input.service} blocked automated signup with a ${result.captcha.kind} captcha. ` +
312
+ `Tell the user to sign up manually at ${input.signup_url ?? `https://${input.service.toLowerCase()}.com`}.`,
232
313
  };
233
- },
234
- };
314
+ }
315
+ // OAuth-only service: no email/password form to automate.
316
+ if (result.error !== undefined && result.error.startsWith("oauth_required")) {
317
+ return {
318
+ status: "oauth_required",
319
+ service: input.service,
320
+ error: result.error,
321
+ steps: result.steps,
322
+ browser_channel: result.browser_channel ?? null,
323
+ message: `${input.service} only offers Google/GitHub (OAuth) signup — there is no email form the bot can fill. ` +
324
+ `Tell the user to sign up manually at ${input.signup_url ?? `https://${input.service.toLowerCase()}.com`}.`,
325
+ };
326
+ }
327
+ // T7/T10 — OAuth: the bot's Google session is missing/expired, or
328
+ // Google interrupted with a security challenge. The remedy for both
329
+ // is the one-time interactive login.
330
+ if (result.error !== undefined && result.error.startsWith("needs_login")) {
331
+ return {
332
+ status: "needs_login",
333
+ service: input.service,
334
+ error: result.error,
335
+ steps: result.steps,
336
+ browser_channel: result.browser_channel ?? null,
337
+ message: `The bot has no usable provider session for an OAuth signup. Tell the user to run ` +
338
+ `\`npx @trusty-squire/mcp login\` once (add \`--provider=github\` for a GitHub signup), ` +
339
+ `then retry provision_any_service with oauth_provider. The error field names the exact command.`,
340
+ };
341
+ }
342
+ // T7/T10 — OAuth: the consent screen requested broader-than-basic
343
+ // scopes (or its scopes could not be read). The bot deliberately
344
+ // does not auto-approve — a human must review it.
345
+ if (result.error !== undefined && result.error.startsWith("oauth_consent_needs_review")) {
346
+ return {
347
+ status: "oauth_consent_needs_review",
348
+ service: input.service,
349
+ error: result.error,
350
+ steps: result.steps,
351
+ browser_channel: result.browser_channel ?? null,
352
+ message: `${input.service}'s Google consent screen needs human review (it asked for more than ` +
353
+ `basic profile access). Tell the user to complete the OAuth signup manually at ` +
354
+ `${input.signup_url ?? `https://${input.service.toLowerCase()}.com`}.`,
355
+ };
356
+ }
357
+ // T7/T10 — OAuth: signed in fine, but the API key sits behind a
358
+ // billing / payment-method wall the bot will not cross.
359
+ if (result.error !== undefined && result.error.startsWith("onboarding_blocked")) {
360
+ return {
361
+ status: "onboarding_blocked",
362
+ service: input.service,
363
+ error: result.error,
364
+ steps: result.steps,
365
+ browser_channel: result.browser_channel ?? null,
366
+ message: `${input.service} signed up via Google, but its API key is behind a billing/payment wall. ` +
367
+ `Tell the user to add a payment method at ` +
368
+ `${input.signup_url ?? `https://${input.service.toLowerCase()}.com`} to finish.`,
369
+ };
370
+ }
371
+ // S3: the bot tags "form submitted but no verification email" with a
372
+ // verification_not_sent: error prefix. Surface it as its own status.
373
+ if (result.error !== undefined && result.error.startsWith("verification_not_sent")) {
374
+ return {
375
+ status: "verification_not_sent",
376
+ service: input.service,
377
+ error: result.error,
378
+ steps: result.steps,
379
+ browser_channel: result.browser_channel ?? null,
380
+ message: `${input.service}'s form submitted, but no verification email arrived — the service most likely ` +
381
+ `withheld it (anti-abuse) or needs manual signup. Tell the user to finish at ` +
382
+ `${input.signup_url ?? `https://${input.service.toLowerCase()}.com`}.`,
383
+ };
384
+ }
385
+ return {
386
+ status: "failed",
387
+ service: input.service,
388
+ error: result.error ?? "Unknown error",
389
+ steps: result.steps,
390
+ browser_channel: result.browser_channel ?? null,
391
+ message: `Couldn't finish signing up for ${input.service}. Show the user the steps[] for debugging.`,
392
+ };
393
+ }
235
394
  // Best-effort POST to /v1/captcha-events. We don't care about the
236
395
  // response — at worst the event is lost, which is no worse than the
237
396
  // pre-instrumentation state. Captures fresh asn at event time when
@@ -1 +1 @@
1
- {"version":3,"file":"provision-any.js","sourceRoot":"","sources":["../../src/tools/provision-any.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,EAAE;AACF,wEAAwE;AACxE,oEAAoE;AACpE,gEAAgE;AAChE,uBAAuB;AACvB,EAAE;AACF,wEAAwE;AACxE,yEAAyE;AACzE,0EAA0E;AAC1E,4BAA4B;AAE5B,OAAO,EAAE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",
5
5
  "description": "Local MCP server vibe coding agents install. Thin relay to the Trusty Squire API, with the bundled universal signup bot.",
6
6
  "main": "./dist/server.js",
@@ -21,6 +21,8 @@
21
21
  "@modelcontextprotocol/sdk": "^1.0.4",
22
22
  "open": "^10.1.0",
23
23
  "playwright": "^1.49.0",
24
+ "playwright-extra": "^4.3.6",
25
+ "puppeteer-extra-plugin-stealth": "^2.11.2",
24
26
  "yaml": "^2.6.1",
25
27
  "zod": "^3.23.8"
26
28
  },