{"repo":"mrphatom/Playwright-tg","private":false,"description":"A headless browser automation agent for Telegram. Chain commands to bypass CAPTCHAs, scrape data using natural language (Gemini AI), and maintain persistent login sessions remotely.","default_branch":"main","stars":1,"forks":0,"pushed_at":"2026-10-02T15:19:13Z","languages":{"Python":1187820,"Shell":1999,"Dockerfile":1075},"files":65,"tree":[".dockerignore",".env.example",".github/workflows/discord-runtime-diagnostics.yml",".github/workflows/docker-publish.yml",".github/workflows/fly-deploy.yml",".gitignore","Dockerfile","README.md","api_contract.py","bot.py","control_plane.py","dashboard.py","database.py","discord_bot.py","docker-compose.yml","docs/GUIDE.md","docs/USAGE.md","docs/antibot-compliance-audit.md","docs/discord-parity-matrix.md","docs/discord-replica-spec.md","docs/file-retrieval-spec.md","docs/intelligent-navigation-spec.md","docs/native-grey-llm.md","docs/native-grey-training-architecture.md","docs/neon-migration-notes.md","docs/playwright-navigation-source-notes.md","docs/response-continuity-design.md","docs/screenshot-regression-findings.md","docs/security-audit-pairing-webhook-2026-08-27.md","docs/whole-code-audit-final.md","docs/whole-code-audit-working-notes.md","fly.toml","platform_contracts.py","requirements.txt","scripts/migrate_sqlite_to_postgres.py","start.sh","starter_templates.py","tasks/chat-dashboard-multimodal-audit.md","tasks/developer-mode-spec.md","tasks/gemini-failover-admin-developer-spec.md","tasks/gemini-review.md","tasks/google-custom-search-api-findings.md","tasks/incident-2026-08-20-gemini-quota.md","tasks/media-timeout-audit.md","tasks/multimodal-research.md","tasks/native-grey-plan.md","tasks/native-grey-todo.md","tasks/natural-language-interpreter-spec.md","tasks/plan.md","tasks/platform-upgrade-spec.md","tasks/platform-upgrade-v27-spec.md","tasks/provider-alerting-spec.md","tasks/public-platform-architecture.md","tasks/sources.md","tasks/telegram-business-mode-notes.md","tasks/telegram-business-reply-findings.md","tasks/telegram-secretary-mode-findings.md","test_bot.py","test_dashboard.py","test_database.py","test_discord_automations.py","test_pairing.py","test_platform.py","test_platform_contracts.py","test_sanitize.py"],"sizes":{".dockerignore":80,".env.example":7183,".github/workflows/discord-runtime-diagnostics.yml":1010,".github/workflows/docker-publish.yml":1685,".github/workflows/fly-deploy.yml":4742,".gitignore":160,"Dockerfile":1075,"README.md":59471,"api_contract.py":6650,"bot.py":530966,"control_plane.py":137850,"dashboard.py":85750,"database.py":10532,"discord_bot.py":83839,"docker-compose.yml":413,"docs/GUIDE.md":5610,"docs/USAGE.md":9312,"docs/antibot-compliance-audit.md":4522,"docs/discord-parity-matrix.md":5150,"docs/discord-replica-spec.md":17063,"docs/file-retrieval-spec.md":6532,"docs/intelligent-navigation-spec.md":7502,"docs/native-grey-llm.md":12040,"docs/native-grey-training-architecture.md":20215,"docs/neon-migration-notes.md":916,"docs/playwright-navigation-source-notes.md":1347,"docs/response-continuity-design.md":7413,"docs/screenshot-regression-findings.md":7764,"docs/security-audit-pairing-webhook-2026-08-27.md":18419,"docs/whole-code-audit-final.md":7510,"docs/whole-code-audit-working-notes.md":12150,"fly.toml":3641,"platform_contracts.py":4444,"requirements.txt":179,"scripts/migrate_sqlite_to_postgres.py":5420,"start.sh":1999,"starter_templates.py":18596,"tasks/chat-dashboard-multimodal-audit.md":2983,"tasks/developer-mode-spec.md":6326,"tasks/gemini-failover-admin-developer-spec.md":3147,"tasks/gemini-review.md":1160,"tasks/google-custom-search-api-findings.md":3359,"tasks/incident-2026-08-20-gemini-quota.md":3660,"tasks/media-timeout-audit.md":3065,"tasks/multimodal-research.md":2109,"tasks/native-grey-plan.md":2464,"tasks/native-grey-todo.md":2062,"tasks/natural-language-interpreter-spec.md":4078,"tasks/plan.md":3066,"tasks/platform-upgrade-spec.md":3571,"tasks/platform-upgrade-v27-spec.md":4807,"tasks/provider-alerting-spec.md":1794,"tasks/public-platform-architecture.md":5263,"tasks/sources.md":1383,"tasks/telegram-business-mode-notes.md":1971,"tasks/telegram-business-reply-findings.md":1387,"tasks/telegram-secretary-mode-findings.md":1248,"test_bot.py":226997,"test_dashboard.py":14551,"test_database.py":777,"test_discord_automations.py":7690,"test_pairing.py":23793,"test_platform.py":27605,"test_platform_contracts.py":2044,"test_sanitize.py":316},"readme":"# 🤖 Playwright-tg: Enterprise Web Automation Agent\n\n![CI/CD Pipeline](https://img.shields.io/badge/CI%2FCD-Pipeline-blue?logo=githubactions&logoColor=white)\n![Playwright](https://img.shields.io/badge/Playwright-2EAD33?logo=playwright&logoColor=white)\n![Gemini AI](https://img.shields.io/badge/Google_Gemini-3.6_Flash-8E44AD?logo=googlegemini&logoColor=white)\n![SQLite](https://img.shields.io/badge/SQLite-003B57?logo=sqlite&logoColor=white)\n\nPlaywright-tg is an asynchronous, AI-powered GreyAI assistant for authorized web automation across Telegram and Discord. It fuses Playwright’s headless browsing with Google Gemini 3.6 Flash, allowing users to control browser sessions, extract structured data via AI, schedule recurring web briefings, and run continuous background watchers through natural-language messages or explicit commands.\n\n---\n\n## Telegram and Discord surfaces\n\nGreyAI supports Telegram today and includes an optional Discord adapter backed by the same application-owned routing, browser, queue, plan, role, moderation, and durable-context services. Discord is disabled by default. To enable it, add a separate Discord bot token and set `DISCORD_ENABLED=true`; never reuse or paste the Telegram token into Discord configuration.\n\nDiscord users begin with `/pair` in a private Discord DM. GreyAI returns a short-lived one-time code, and the user confirms it with `/pair <code>` in GreyAI’s private Telegram chat. The code is hashed at rest, expires automatically, is consumed once, and does not accept a raw Telegram ID as proof. A short per-Discord-identity cooldown limits challenge flooding, and a newer permitted request invalidates an older pending code. The paired Telegram account remains authoritative for plan, role, quota, moderation status, and durable context. `/unpair` revokes the relationship without deleting either platform’s history; repeated repair cycles preserve revoked history.\n\nGuild use is closed by default. An administrator must configure both `DISCORD_ALLOWED_GUILD_IDS` and `DISCORD_ALLOWED_CHANNEL_IDS` with explicit numeric IDs before GreyAI responds in a server channel. Pairing and unpairing remain DM-only; sensitive handoff links, pairing codes, API keys, cookies, and saved-session details are never sent in public channels.\n\nFor deployment, store `DISCORD_BOT_TOKEN` only in Fly.io or GitHub secret storage, set `DISCORD_ENABLED=true` only when the token is present, and enable Discord’s **Message Content Intent** in the Developer Portal for natural-language message handling. The current adapter uses Discord DMs by default; explicitly allowlisted guild channels may use chat and task commands, while sensitive check results are sent to the paired user’s private DM. No Discord token is included in this repository or requested in chat.\n\nTelegram currently uses long polling (`run_polling`), and Discord uses the gateway client; this repository exposes no inbound Telegram or Discord webhook endpoint or signature-verification path. If a webhook transport is introduced later, it must be treated as a new security boundary: require Telegram’s `secret_token` header or Discord’s timestamped Ed25519 signature, reject stale/replayed requests, enforce strict schema and body-size limits, and add negative tests before enabling the route.\n\nThe current Discord-native commands are `/pair`, `/unpair`, `/grey`, `/settings`, `/sessions`, `/status`, `/ask`, `/check`, and `/help`. `/pair` and `/unpair` are DM-only. `/ask` and `/check` defer long work and reuse GreyAI’s canonical Telegram account for plan, role, quota, durable context, URL policy, queue, and browser execution. The adapter is intentionally feature-flagged and does not yet claim parity for every Telegram-only surface such as billing, advertising, administrative workflows, voice/media delivery, watchers, or schedules.\n\n## Native Grey Intelligence\n\nGreyAI’s identity and operating context are owned by the application rather than by the model provider. The runtime maintains a version","price_usd":"8000","clone_checkout":"https://api.checkout402.com/c/chk_8v_zmnDCna1EnawP","rehearse_checkout":"https://api.checkout402.com/c/chk_8v_zmnDCna1EnawP/test","preview":"/r/mrphatom/Playwright-tg/f/<path> serves file CONTENTS for any path (public repo)","how_to_buy":"pay clone_checkout with x402 (pay402 does it in one call); the goods arrive as payload_base64, a tar.gz of the full repo. Rehearse first at rehearse_checkout: same flow, simulated money.","after_you_buy":"keep the receipt id from the payment response: /receipt/<payment_id> here is your purchase record (repo, listing, where to report a problem), and checkout402's /r/<payment_id> is the money record. Tell your human both URLs."}