You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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>
Copy file name to clipboardExpand all lines: .agent.example/skills/runtime-tools/SKILL.md
+36-1Lines changed: 36 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ When a task fits a tool below, **call it directly**. Do not describe what you wo
30
30
|`web_search`| Search the web via Brave Search. Use when you need to discover URLs or facts, not when you already have a URL. |
31
31
|`browser`| Fetch a web page and extract its text content. Use for pages that need JS rendering or scraping where `web_fetch` falls short. |
32
32
|`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. |
34
34
35
35
## Media analysis
36
36
@@ -81,6 +81,41 @@ User-scoped secrets live in a per-user store. Key format: `service:field` (e.g.
81
81
82
82
Never echo secret *values* back to the user verbatim. Use them through `browser_play`, `http`, etc.
83
83
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
0 commit comments