From 3354349700941df30e19258b082c099a321dd412 Mon Sep 17 00:00:00 2001 From: Artur Mukhamadiev Date: Thu, 13 Aug 2026 18:48:56 +0300 Subject: [PATCH] baseline kinopoisk test --- .pi/prompts/test.prompt | 29 ++ .pi/skills/agent-browser-core/SKILL.md | 516 +++++++++++++++++++++++ .pi/skills/sam-usage/SKILL.md | 41 ++ .pi/skills/sam-usage/SKILL_BACKUP.md | 58 +++ .pi/skills/tv-app-a11y-fallback/SKILL.md | 270 ++++++++++++ scripts/README.md | 47 +++ scripts/sam-cli.sh | 222 ++++++++++ 7 files changed, 1183 insertions(+) create mode 100644 .pi/prompts/test.prompt create mode 100644 .pi/skills/agent-browser-core/SKILL.md create mode 100644 .pi/skills/sam-usage/SKILL.md create mode 100644 .pi/skills/sam-usage/SKILL_BACKUP.md create mode 100644 .pi/skills/tv-app-a11y-fallback/SKILL.md create mode 100644 scripts/README.md create mode 100755 scripts/sam-cli.sh diff --git a/.pi/prompts/test.prompt b/.pi/prompts/test.prompt new file mode 100644 index 0000000..b30cf80 --- /dev/null +++ b/.pi/prompts/test.prompt @@ -0,0 +1,29 @@ +## Prerequisites + +You are helpful personal AI assistant that fulfills the user's natural-language requests by driving a live TV Board running webOS system through the `agent-browser` cli. + +### webOS notes +Normal webOS Application lifecycle consists of using SAM for launching/stopping or discovering applications. +Launching an application would move it to the foreground. +Kinopoisk app on target board is under id: `com.webos.app.test.youtube` + +### Data +CDP session is running on `127.0.0.1:9998` +Remote device is on: 172.26.123.126 +Connect via ssh: `root@172.26.123.126` + +#### Example ssh call + +`ssh -tt root@172.26.123.126 luna-send -n 1 luna://com.webos.applicationManager/running '{}'` + +**`-tt` (tty creation) is necessary for correct luna-send behavior** + +### User + +Name: Artur +Gender: Male +Age: 27 + +## User Request + +Привет! Я хочу продолжить просмотр Дорохедоро на Кинопоиске, можешь включить, пожалуйста? diff --git a/.pi/skills/agent-browser-core/SKILL.md b/.pi/skills/agent-browser-core/SKILL.md new file mode 100644 index 0000000..cf44339 --- /dev/null +++ b/.pi/skills/agent-browser-core/SKILL.md @@ -0,0 +1,516 @@ +--- +name: core +description: Core agent-browser usage guide. Read this before running any agent-browser commands. Covers the snapshot-and-ref workflow, navigating pages, interacting with elements (click, fill, type, select), extracting text and data, taking screenshots, managing tabs, handling forms and auth, waiting for content, running multiple browser sessions in parallel, and troubleshooting common failures. Use when the user asks to interact with a website, fill a form, click something, extract data, take a screenshot, log into a site, test a web app, or automate any browser task. +allowed-tools: Bash(agent-browser:*), Bash(npx agent-browser:*) +--- + +# agent-browser core + +Fast browser automation CLI for AI agents. Chrome/Chromium via CDP, no Playwright or Puppeteer dependency. Accessibility-tree snapshots with compact `@eN` refs let agents interact with pages in ~200-400 tokens instead of parsing raw HTML. + +Most normal web tasks (navigate, read, click, fill, extract, screenshot) are covered here. Load a specialized skill when the task falls outside browser web pages — see [When to load another skill](#when-to-load-another-skill). + +## The core loop + +```bash +agent-browser open # 1. Open a page +agent-browser snapshot -i # 2. See what's on it (interactive elements only) +agent-browser click @e3 # 3. Act on refs from the snapshot +agent-browser snapshot -i # 4. Re-snapshot after any page change +``` + +Refs (`@e1`, `@e2`, ...) are assigned fresh on every snapshot. They become **stale the moment the page changes** — after clicks that navigate, form submits, dynamic re-renders, dialog opens. Always re-snapshot before your next ref interaction. + +## Always use your own session + +Before your first command, set a named session for the whole task: + +```bash +export AGENT_BROWSER_SESSION="$(agent-browser session id --scope worktree --prefix task)" +``` + +The default (unnamed) session is a single shared browser: it is shared with every other agent on the machine and it persists across conversations, so working in it can hijack another agent's page mid-task or navigate away from something the human left open. Every example below assumes a named session is active. See [Run multiple browsers in parallel](#run-multiple-browsers-in-parallel) and `references/session-management.md`. + +## Quickstart + +```bash +# Install once +npm i -g agent-browser && agent-browser install + +# Linux hosts can install required browser libraries too +agent-browser install --with-deps + +# Take a screenshot of a page +agent-browser open https://example.com +agent-browser screenshot home.png +agent-browser close + +# Search, click a result, and capture it +agent-browser open https://duckduckgo.com +agent-browser snapshot -i # find the search box ref +agent-browser fill @e1 "agent-browser cli" +agent-browser press Enter +agent-browser wait --load networkidle +agent-browser snapshot -i # refs now reflect results +agent-browser click @e5 # click a result +agent-browser screenshot result.png +``` + +The browser stays running across commands so these feel like a single session. By default, an inactive daemon saves configured restore state, closes its headless browser, and exits after one hour; the next command starts it again. Without `--restore` or another restore key, shutdown discards transient browser state and open tabs. Dashboard mouse, keyboard, and touch input count as activity. Headed browsers, Safari and iOS WebDriver sessions, and user-attached browsers are exempt from the default; provider-owned cloud browsers are not. Use `--idle-timeout