instar 0.7.2 → 0.7.4
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.
|
@@ -285,27 +285,41 @@ If the user declines, accept it in one sentence and move on — but they should
|
|
|
285
285
|
|
|
286
286
|
### Browser Automation Strategy
|
|
287
287
|
|
|
288
|
-
**Use Playwright (mcp__playwright__*)
|
|
288
|
+
**CRITICAL: Use ONLY Playwright (mcp__playwright__*) tools for browser automation.**
|
|
289
|
+
|
|
290
|
+
**DO NOT use Claude in Chrome (mcp__claude-in-chrome__*) tools.** The Chrome extension has issues when Chrome is already open and runs in the user's existing browser session which causes conflicts. Playwright opens its own clean browser window — visible, reliable, and independent.
|
|
291
|
+
|
|
292
|
+
If you see both Playwright and Chrome extension tools available, **always choose Playwright**. Never fall back to Chrome extension.
|
|
289
293
|
|
|
290
294
|
**CRITICAL UX RULE: Never silently attempt browser automation.** The user must know what's happening at every step. If something fails, explain what happened — don't just report "it didn't work."
|
|
291
295
|
|
|
292
|
-
#### Step 3a:
|
|
296
|
+
#### Step 3a: Verify Playwright is Available
|
|
297
|
+
|
|
298
|
+
Before doing anything with the browser, verify Playwright works:
|
|
299
|
+
|
|
300
|
+
```
|
|
301
|
+
mcp__playwright__browser_navigate({ url: "about:blank" })
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
If this succeeds, Playwright is available and a visible browser window should appear. Proceed to Step 3b.
|
|
305
|
+
|
|
306
|
+
If Playwright tools are NOT available (tool not found errors), tell the user:
|
|
293
307
|
|
|
294
|
-
|
|
308
|
+
> "I need the Playwright browser tools to automate the Telegram setup. They don't seem to be configured."
|
|
309
|
+
> "You can add them by running: `npx @playwright/mcp@latest`"
|
|
310
|
+
> "Or I can walk you through the manual setup instead."
|
|
295
311
|
|
|
296
|
-
|
|
297
|
-
2. If Playwright is NOT available, check for `mcp__claude-in-chrome__tabs_context_mcp`.
|
|
298
|
-
3. If NEITHER is available, go directly to **Manual Fallback** (Step 3g below).
|
|
312
|
+
If the user chooses manual, go to **Manual Fallback** (Step 3g).
|
|
299
313
|
|
|
300
|
-
Do NOT
|
|
314
|
+
**Do NOT fall back to Chrome extension tools.** If Playwright isn't available, use manual instructions.
|
|
301
315
|
|
|
302
316
|
#### Step 3b: Announce What's About to Happen
|
|
303
317
|
|
|
304
|
-
**Always warn the user before opening
|
|
318
|
+
**Always warn the user before opening the browser.** Say exactly this:
|
|
305
319
|
|
|
306
320
|
> "I'm going to open a browser window to set up Telegram automatically. I'll create a bot, set up a group, and configure everything."
|
|
307
321
|
>
|
|
308
|
-
> "A browser window will appear — you'll need to log into Telegram there
|
|
322
|
+
> "A Chromium browser window will appear on your screen — you'll need to log into Telegram there."
|
|
309
323
|
>
|
|
310
324
|
> "Ready? Say OK and I'll open it."
|
|
311
325
|
|
|
@@ -313,18 +327,16 @@ Do NOT tell the user about tools that don't work. Only present the path you can
|
|
|
313
327
|
|
|
314
328
|
#### Step 3c: Open Browser and Navigate
|
|
315
329
|
|
|
316
|
-
|
|
330
|
+
Navigate to Telegram Web:
|
|
317
331
|
```
|
|
318
332
|
mcp__playwright__browser_navigate({ url: "https://web.telegram.org/a/" })
|
|
319
333
|
```
|
|
320
334
|
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
mcp__claude-in-chrome__navigate({ url: "https://web.telegram.org/a/", tabId: TAB_ID })
|
|
327
|
-
```
|
|
335
|
+
The user should see a Chromium window open on their screen. If they report they don't see a browser window, Playwright may be running headless. Tell them:
|
|
336
|
+
|
|
337
|
+
> "It seems the browser opened in headless mode (invisible). Let me close it and we'll do the manual setup instead."
|
|
338
|
+
|
|
339
|
+
Then close the browser and go to Manual Fallback.
|
|
328
340
|
|
|
329
341
|
After navigating, take a snapshot to check the page state:
|
|
330
342
|
```
|
|
@@ -451,9 +463,12 @@ curl -s "https://api.telegram.org/bot${TOKEN}/getUpdates?timeout=5"
|
|
|
451
463
|
|
|
452
464
|
### Browser Automation Tips
|
|
453
465
|
|
|
466
|
+
- **ONLY use `mcp__playwright__*` tools.** Never use `mcp__claude-in-chrome__*` even if available.
|
|
454
467
|
- **Always take a snapshot before interacting.** Telegram Web's UI changes frequently.
|
|
455
|
-
- **Use `
|
|
456
|
-
- **
|
|
468
|
+
- **Use `mcp__playwright__browser_snapshot`** (accessibility tree) over screenshots for finding elements — more reliable.
|
|
469
|
+
- **Use `mcp__playwright__browser_click`** with ref from snapshots for clicking.
|
|
470
|
+
- **Use `mcp__playwright__browser_type`** for typing into inputs. Use `submit: true` to send messages.
|
|
471
|
+
- **Wait 2-3 seconds** after each action for Telegram to process. Use `mcp__playwright__browser_wait_for({ time: 2 })`.
|
|
457
472
|
- **If an element isn't found**, take a fresh snapshot — the view may have changed.
|
|
458
473
|
- **Telegram Web uses version "a"** (web.telegram.org/a/) — this is the React-based client.
|
|
459
474
|
- **If something goes wrong**, tell the user exactly what happened and what you see. Offer to retry that specific step or fall back to manual for just the remaining steps.
|