Skip to content

Commit 6002983

Browse files
dmitriyzhukclaude
andcommitted
docs(runtime-tools): document the integration tools
The always-on runtime-tools skill now covers integration_list, integration_request_login and integration_secrets, plus the "integration_list → browser_play → (only then) request_login" flow. Spells out: don't gate on the stale `status` field, never fill a login form, never mention VNC/browser_login. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 4513fe0 commit 6002983

2 files changed

Lines changed: 37 additions & 2 deletions

File tree

.agent.example/skills/runtime-tools/SKILL.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ When a task fits a tool below, **call it directly**. Do not describe what you wo
3030
| `web_search` | Search the web via Brave Search. Use when you need to discover URLs or facts, not when you already have a URL. |
3131
| `browser` | Fetch a web page and extract its text content. Use for pages that need JS rendering or scraping where `web_fetch` falls short. |
3232
| `browser_screenshot` | Take a screenshot of a website and send it to the user via Telegram. Supports full page. |
33-
| `browser_play` | Full Playwright control with persistent sessions (cookies, localStorage saved between calls and across container restarts). Use for logins, multi-step flows, sites that hate scrapers. |
33+
| `browser_play` | Full Playwright control with persistent sessions (cookies, localStorage saved between calls and across container restarts). Use for logins, multi-step flows, sites that hate scrapers. For a connected service (Instagram, X, …) the `profile` comes from `integration_list` — see Integrations below. |
3434

3535
## Media analysis
3636

@@ -81,6 +81,41 @@ User-scoped secrets live in a per-user store. Key format: `service:field` (e.g.
8181

8282
Never echo secret *values* back to the user verbatim. Use them through `browser_play`, `http`, etc.
8383

84+
## Integrations (connected external services)
85+
86+
The user connects external accounts in the Ranch admin UI (`/integrations`).
87+
There are two kinds:
88+
89+
- **browser** — Instagram, X, Facebook, TikTok. The user's logged-in
90+
cookies live in a per-user vault; `browser_play` replays them. The
91+
cookies arrive via the **Ranch Cookies browser extension** (the user
92+
logs in on the real site, clicks the extension, presses "Send
93+
cookies"). There is no VNC.
94+
- **secret** — OpenAI, GitHub, Stripe. An API key in the per-user
95+
secret vault, surfaced to the agent as an env var.
96+
97+
| Tool | Use it when |
98+
|---|---|
99+
| `integration_list` | List the user's connected integrations. Returns `{ accounts: [{ service, accountKey, profile, mechanism, status }] }`. **Call this before `browser_play` for any social account** — the `profile` field is the exact string to pass; never guess `"default"` or a bare service name. |
100+
| `integration_request_login` | Get login instructions when a browser integration is missing cookies or they expired. Returns a help URL + site URL + plain-text steps — forward them to the user, then STOP and wait. The user logs in on the real site and pushes cookies via the extension. |
101+
| `integration_secrets` | Resolve the user's secret-mechanism integrations into an env map (`{ env: { OPENAI_API_KEY: "…" } }`). Call lazily when a tool needs one of those keys. |
102+
103+
**The flow for "do something on X / Instagram / etc.":**
104+
105+
1. `integration_list` → take the matching account's `profile` verbatim.
106+
If there's no matching account, the user hasn't connected it — tell
107+
them to open `/integrations`, stop.
108+
2. Go **straight** to `browser_play` with that `profile`. Do NOT
109+
pre-check the `status` field — it is advisory and often stale. The
110+
only trustworthy login signal is `browser_play`'s own response.
111+
3. If `browser_play` returns `{ needsLogin: true }` — THEN call
112+
`integration_request_login`, forward the instructions, and stop.
113+
Otherwise proceed.
114+
115+
Never fill a login form (username/password) yourself, and never mention
116+
VNC or `browser_login` — those don't exist. Login always goes through
117+
the user + the extension.
118+
84119
## Access control (admin-only)
85120

86121
| Tool | Use it when |

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cleanslice/runtime",
3-
"version": "0.16.2",
3+
"version": "0.16.3",
44
"license": "MIT",
55
"type": "module",
66
"bin": {

0 commit comments

Comments
 (0)