@somewhere-cloud/cli 0.38.155 → 0.38.156
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.
- package/CHANGELOG.md +4 -1
- package/dist/commands/docs.js +1 -1
- package/dist/lib/bundle.js +276 -188
- package/dist/lib/bundle.js.map +3 -3
- package/npm-shrinkwrap.json +2 -2
- package/package.json +2 -3
- package/dist/docs/adopt.md +0 -39
- package/dist/docs/analytics.md +0 -161
- package/dist/docs/api-reference.md +0 -339
- package/dist/docs/api-surface.md +0 -2067
- package/dist/docs/app-mcp.md +0 -162
- package/dist/docs/architecture-patterns.md +0 -334
- package/dist/docs/auth-client.md +0 -531
- package/dist/docs/billing.md +0 -76
- package/dist/docs/browser.md +0 -639
- package/dist/docs/calendar.md +0 -298
- package/dist/docs/changes.md +0 -323
- package/dist/docs/cli.md +0 -407
- package/dist/docs/common-mistakes.md +0 -199
- package/dist/docs/connect-agent.md +0 -72
- package/dist/docs/cors.md +0 -114
- package/dist/docs/cron.md +0 -167
- package/dist/docs/database-engine.md +0 -167
- package/dist/docs/declared-data.md +0 -1656
- package/dist/docs/declared-files.md +0 -475
- package/dist/docs/deploy-intelligence.md +0 -188
- package/dist/docs/deploy.md +0 -733
- package/dist/docs/design-system.md +0 -273
- package/dist/docs/dev-environments.md +0 -496
- package/dist/docs/domain-ownership.md +0 -31
- package/dist/docs/domains.md +0 -370
- package/dist/docs/feedback.md +0 -88
- package/dist/docs/file-tools.md +0 -116
- package/dist/docs/functions.md +0 -489
- package/dist/docs/getting-started.md +0 -238
- package/dist/docs/github.md +0 -95
- package/dist/docs/google-calendar.md +0 -212
- package/dist/docs/groups.md +0 -836
- package/dist/docs/guarantees.md +0 -58
- package/dist/docs/handled-for-you.md +0 -224
- package/dist/docs/inspect.md +0 -171
- package/dist/docs/limits.md +0 -68
- package/dist/docs/live-data.md +0 -197
- package/dist/docs/live.md +0 -92
- package/dist/docs/local-dev.md +0 -30
- package/dist/docs/migration-supabase.md +0 -58
- package/dist/docs/payments.md +0 -1102
- package/dist/docs/portability.md +0 -194
- package/dist/docs/postgres.md +0 -301
- package/dist/docs/pricing-comparison.md +0 -42
- package/dist/docs/pricing.md +0 -39
- package/dist/docs/project-groups.md +0 -107
- package/dist/docs/projects.md +0 -380
- package/dist/docs/recipe-ai-agent.md +0 -112
- package/dist/docs/recipe-ai-features.md +0 -227
- package/dist/docs/recipe-ai-receipts.md +0 -783
- package/dist/docs/recipe-background-jobs.md +0 -369
- package/dist/docs/recipe-booking.md +0 -348
- package/dist/docs/recipe-csv-import.md +0 -390
- package/dist/docs/recipe-ecommerce.md +0 -127
- package/dist/docs/recipe-email.md +0 -282
- package/dist/docs/recipe-escalation.md +0 -133
- package/dist/docs/recipe-file-uploads.md +0 -159
- package/dist/docs/recipe-import-app.md +0 -110
- package/dist/docs/recipe-login.md +0 -457
- package/dist/docs/recipe-multi-chat.md +0 -198
- package/dist/docs/recipe-paid-api.md +0 -161
- package/dist/docs/recipe-pdfs.md +0 -205
- package/dist/docs/recipe-push-notifications.md +0 -107
- package/dist/docs/recipe-seo.md +0 -200
- package/dist/docs/recipe-signed-in-app.md +0 -330
- package/dist/docs/render.md +0 -99
- package/dist/docs/rooms.md +0 -554
- package/dist/docs/sdk.md +0 -287
- package/dist/docs/sdks.md +0 -24
- package/dist/docs/search.md +0 -199
- package/dist/docs/security-model.md +0 -168
- package/dist/docs/setup.md +0 -212
- package/dist/docs/smoke.md +0 -102
- package/dist/docs/speed.md +0 -298
- package/dist/docs/sql-compatibility.md +0 -96
- package/dist/docs/sw.agent.md +0 -248
- package/dist/docs/sw.ai.md +0 -1291
- package/dist/docs/sw.auth.md +0 -1811
- package/dist/docs/sw.billing.md +0 -171
- package/dist/docs/sw.db.md +0 -2128
- package/dist/docs/sw.email.md +0 -661
- package/dist/docs/sw.endpoint.md +0 -187
- package/dist/docs/sw.env.md +0 -303
- package/dist/docs/sw.fetch.md +0 -115
- package/dist/docs/sw.fs.md +0 -424
- package/dist/docs/sw.groups.md +0 -836
- package/dist/docs/sw.image.md +0 -69
- package/dist/docs/sw.jobs.md +0 -520
- package/dist/docs/sw.logs.md +0 -61
- package/dist/docs/sw.mail.md +0 -106
- package/dist/docs/sw.notifications.md +0 -78
- package/dist/docs/sw.push.md +0 -161
- package/dist/docs/sw.rateLimit.md +0 -67
- package/dist/docs/sw.web.md +0 -128
- package/dist/docs/tasks.md +0 -269
- package/dist/docs/test.md +0 -220
- package/dist/docs/tool-reference-account.md +0 -7
- package/dist/docs/tool-reference-ai.md +0 -121
- package/dist/docs/tool-reference-analytics.md +0 -37
- package/dist/docs/tool-reference-api.md +0 -19
- package/dist/docs/tool-reference-artifacts.md +0 -35
- package/dist/docs/tool-reference-auth.md +0 -163
- package/dist/docs/tool-reference-browser.md +0 -114
- package/dist/docs/tool-reference-code.md +0 -26
- package/dist/docs/tool-reference-connect.md +0 -21
- package/dist/docs/tool-reference-cron.md +0 -48
- package/dist/docs/tool-reference-db.md +0 -282
- package/dist/docs/tool-reference-domains.md +0 -107
- package/dist/docs/tool-reference-email.md +0 -55
- package/dist/docs/tool-reference-env.md +0 -19
- package/dist/docs/tool-reference-feedback.md +0 -56
- package/dist/docs/tool-reference-fs.md +0 -265
- package/dist/docs/tool-reference-github.md +0 -57
- package/dist/docs/tool-reference-groups.md +0 -85
- package/dist/docs/tool-reference-help.md +0 -29
- package/dist/docs/tool-reference-jobs.md +0 -39
- package/dist/docs/tool-reference-live.md +0 -48
- package/dist/docs/tool-reference-logs.md +0 -16
- package/dist/docs/tool-reference-payments.md +0 -44
- package/dist/docs/tool-reference-project.md +0 -706
- package/dist/docs/tool-reference-push.md +0 -78
- package/dist/docs/tool-reference-rate-limit.md +0 -18
- package/dist/docs/tool-reference-search.md +0 -68
- package/dist/docs/tool-reference-security.md +0 -42
- package/dist/docs/tool-reference-smoke.md +0 -17
- package/dist/docs/tool-reference-stock-photos.md +0 -20
- package/dist/docs/tool-reference-tasks.md +0 -73
- package/dist/docs/tool-reference-telegram.md +0 -32
- package/dist/docs/tool-reference-usage.md +0 -9
- package/dist/docs/tool-reference-web.md +0 -71
- package/dist/docs/tool-reference-webhooks.md +0 -9
- package/dist/docs/troubleshooting.md +0 -411
- package/dist/docs/typed-functions.md +0 -94
- package/dist/docs/verify-before-deploy.md +0 -67
- package/dist/docs/vs-supabase.md +0 -75
- package/dist/docs/vs-vercel.md +0 -103
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# Api tool reference
|
|
2
|
-
|
|
3
|
-
Use the section for the tool and connection in the current workflow. Each tool’s input schema defines the accepted arguments.
|
|
4
|
-
|
|
5
|
-
## api
|
|
6
|
-
|
|
7
|
-
Call platform /v1 endpoints that do not have a dedicated MCP tool yet. Dedicated tools cover common operations; this tool covers the remaining and newly added endpoints. `catalog` lists existing tools and `docs({ topic })` documents endpoint shape.
|
|
8
|
-
|
|
9
|
-
Each request is explicit and inspectable: `calls` is a flat array of independent `{ method, path, body? }` items. A single invocation runs up to 10 calls, each still endpoint-auth and quota gated. Data from one call is not inserted into another; data-dependent chains run across separate tool calls. `path` must be a platform `/v1/...` path, not a full URL.
|
|
10
|
-
|
|
11
|
-
Write calls require `confirm:true` by default. `GET` and `HEAD` run without confirm; `POST /v1/ai/complete` and `POST /v1/ai/embed` are the only read-shaped write routes currently allowlisted. Without confirmation the tool returns the exact calls it would run and asks you to re-call with `confirm:true`. Calls run with the caller's own auth and the same permission checks as dedicated tools.
|
|
12
|
-
|
|
13
|
-
## api-read
|
|
14
|
-
|
|
15
|
-
Read Somewhere platform API endpoints in a batch of up to 10 independent GET/HEAD requests. Paths and response shapes follow the Somewhere REST API reference: https://somewhere.cloud/docs.txt. Returns one result per request in input order. No write methods or request bodies are accepted. On the directory connector, AI routes (model calls and stored AI conversations) are unavailable.
|
|
16
|
-
|
|
17
|
-
## api-write
|
|
18
|
-
|
|
19
|
-
Create, update, or delete platform data through up to 10 independent POST/PUT/PATCH/DELETE requests. Requests are not a transaction; some may succeed when others fail. Paths and request bodies follow the Somewhere REST API reference: https://somewhere.cloud/docs.txt. AI media generation, financial transfers, credential creation, and domain purchases are unavailable. On the directory connector, AI routes (model calls and stored AI conversations) are unavailable.
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# Artifacts tool reference
|
|
2
|
-
|
|
3
|
-
Use the section for the tool and connection in the current workflow. Each tool’s input schema defines the accepted arguments.
|
|
4
|
-
|
|
5
|
-
## artifact-publish
|
|
6
|
-
|
|
7
|
-
Publish a project file as an immutable ARTIFACT — a durable, addressable snapshot with typed metadata, so another agent (or a human) can consume exactly these bytes later without you re-describing the file through a context window.
|
|
8
|
-
|
|
9
|
-
A file path is mutable: a later write replaces the bytes and old versions get trimmed. Publishing freezes "the file at /specs/plan.md right now" into a fact — the bytes are copied to the artifact's own storage and the row records who produced it. It never changes; a new version is a new artifact whose `supersedes` points at the old one.
|
|
10
|
-
|
|
11
|
-
Returns `{ id, uri, ... }` where `uri` is `sw://{project}/artifact/{id}`, a stable reference for a later reader. They call `artifact_get` on it and see the title + summary + schema (enough to decide read-or-skip) and, on request, the exact frozen bytes.
|
|
12
|
-
|
|
13
|
-
Publishes an EXISTING file — it is written first (fs_write / fs_upload), then published.
|
|
14
|
-
|
|
15
|
-
**Example:**
|
|
16
|
-
```json
|
|
17
|
-
{
|
|
18
|
-
"project_id": "acme",
|
|
19
|
-
"path": "/specs/checkout.md",
|
|
20
|
-
"title": "Checkout redesign spec",
|
|
21
|
-
"summary": "Final 2-step checkout spec; supersedes the v1 draft; ready to implement.",
|
|
22
|
-
"schema": "sw.design-doc@1",
|
|
23
|
-
"agent": "cursor"
|
|
24
|
-
}
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## artifact-get
|
|
28
|
-
|
|
29
|
-
Fetch a published artifact by its id or `sw://…` URI — metadata + provenance by default, or the exact immutable bytes with `include_content: true`.
|
|
30
|
-
|
|
31
|
-
This is the consume side of a handoff: another agent published a file and handed you `sw://{project}/artifact/{id}`. You get the title, summary, schema, size, and who produced it (`agent` + `derived_from`/`supersedes`) — enough to decide read-or-skip WITHOUT the producer re-describing it. `include_content: true` also returns the frozen bytes (text is inlined; the bytes are the exact ones from publish time, even if the source file has since changed).
|
|
32
|
-
|
|
33
|
-
Resolves across projects: any principal with access to the artifact's OWN project can fetch it, which raw file paths can never do.
|
|
34
|
-
|
|
35
|
-
**Example:** `{ "id": "sw://acme/artifact/art_9f2c…" }` or `{ "id": "art_9f2c…", "include_content": true }`
|
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
# Auth tool reference
|
|
2
|
-
|
|
3
|
-
Use the section for the tool and connection in the current workflow. Each tool’s input schema defines the accepted arguments.
|
|
4
|
-
|
|
5
|
-
## account
|
|
6
|
-
|
|
7
|
-
Which somewhere.cloud account is this session connected as? Takes no arguments and reads only the caller's own account.
|
|
8
|
-
|
|
9
|
-
It answers "who am I connected as" without a guessed route or an identity inferred from the project list.
|
|
10
|
-
|
|
11
|
-
**Example:**
|
|
12
|
-
|
|
13
|
-
Example transcript or fragment
|
|
14
|
-
|
|
15
|
-
```text
|
|
16
|
-
{}
|
|
17
|
-
// Returns: { "id": "u_abc", "email": "alice@example.com", "name": "Alice",
|
|
18
|
-
// "anonymous": false, "email_verified": true, "tier": "builder",
|
|
19
|
-
// "summary": "Connected as Alice (alice@example.com). The email address is verified." }
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
This is the DEVELOPER ACCOUNT holding the projects. For the end user of a customer's app, `auth_me` with that user's app token answers instead.
|
|
23
|
-
|
|
24
|
-
## auth-signup
|
|
25
|
-
|
|
26
|
-
Register user, create account, new user, sign up, onboard user — sign up a new end user for your app. Returns registration and user metadata; credentials are omitted from MCP output. This result cannot sign an agent in from a transcript. Sign-in goes through the app’s normal secure sign-in flow. Passwords are securely hashed. Intended for server-side code, not browser code.
|
|
27
|
-
|
|
28
|
-
**Example:**
|
|
29
|
-
|
|
30
|
-
Example transcript or fragment
|
|
31
|
-
|
|
32
|
-
```text
|
|
33
|
-
{ "project_id": "my-saas", "email": "alice@example.com", "password": "<password>" }
|
|
34
|
-
// Returns registration and user metadata without authentication credentials.
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
## auth-login
|
|
38
|
-
|
|
39
|
-
Sign in user, authenticate, login user, password check, end-user login — log in an existing end user of your app. Returns user profile, authentication token, and session token.
|
|
40
|
-
|
|
41
|
-
**Example:**
|
|
42
|
-
|
|
43
|
-
Example transcript or fragment
|
|
44
|
-
|
|
45
|
-
```text
|
|
46
|
-
{ "project_id": "my-saas", "email": "alice@example.com", "password": "<password>" }
|
|
47
|
-
// Returns: { "user": { "id": "u_abc", "email": "alice@example.com" }, "token": "eyJ...", "session_token": "st_...", "refresh_token": "rt_..." }
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
## auth-me
|
|
51
|
-
|
|
52
|
-
Get the current end user's profile from their authentication token.
|
|
53
|
-
|
|
54
|
-
**Example:**
|
|
55
|
-
|
|
56
|
-
Example transcript or fragment
|
|
57
|
-
|
|
58
|
-
```text
|
|
59
|
-
{ "app_token": "eyJ..." }
|
|
60
|
-
// Returns: { "id": "u_abc", "email": "alice@example.com", "email_verified": true, "display_name": "Alice" }
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
## auth-google-url
|
|
64
|
-
|
|
65
|
-
Get a Google OAuth URL for end-user login. Redirect users to this URL to start the OAuth flow. After login, the platform redirects back to redirect_uri with a short-lived authorization code in the query string (`?code=...`). The JWT is never put in the URL — your backend exchanges the code for the JWT via POST /v1/auth/google/exchange (smt_ key required, server-side only), or via `sw.auth.googleExchange({ code })` from inside a deployed function. Codes are single-use and expire after 60 seconds. docs({ topic: 'sw.auth' }) documents the full flow.
|
|
66
|
-
|
|
67
|
-
**Example:**
|
|
68
|
-
|
|
69
|
-
Example transcript or fragment
|
|
70
|
-
|
|
71
|
-
```text
|
|
72
|
-
{ "project_id": "my-saas", "redirect_uri": "https://my-saas.somewhere.site/auth/callback" }
|
|
73
|
-
// Returns: { "url": "https://api.somewhere.cloud/v1/auth/google?project_id=...&redirect_uri=..." }
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
## auth-users-list
|
|
77
|
-
|
|
78
|
-
List end-user accounts of your app — the people who signed up via auth_signup. Distinct from `project_list` (your own projects). Returns id, email, display_name, email_verified, created_at, last_login_at. Paginated by created_at descending.
|
|
79
|
-
|
|
80
|
-
## app-role-grant
|
|
81
|
-
|
|
82
|
-
Give an app user an app-wide role declared in db/schema.ts (`appRoles`, e.g. staff) with your developer key, so every `appRole()` rule on your tables applies to them at once. Name the person by user_id or by the exact address they signed up with; the address does not have to be verified (you vouch for the person; `emailDomain` roles stay verified-only). No claim, no app-admin promotion and no endpoint of your own are needed: this is how the first staff member is seeded. Idempotent: a role already held answers already_granted:true. Refused: an address nobody signed up with (USER_NOT_FOUND), a banned account (TARGET_INELIGIBLE), a role the live schema does not declare (ROLE_UNKNOWN), a project that has not deployed a schema with appRoles (POLICY_UNAVAILABLE). An app admin can still grant and revoke the same roles from inside the app with sw.groups.appRoles.
|
|
83
|
-
|
|
84
|
-
## app-role-list
|
|
85
|
-
|
|
86
|
-
List who holds which app-wide role (db/schema.ts `appRoles`) in a project: every grant, or one user's (user_id or email), or one role's. Each item carries user_id, email, email_verified, role, granted_by ('developer' for a grant made with the developer key, otherwise the app admin or delegating user's id) and created_at. The answer also names the roles the live schema declares. Keyset pages: pass next_cursor back as cursor.
|
|
87
|
-
|
|
88
|
-
## auth-reset-password
|
|
89
|
-
|
|
90
|
-
Consume a password-reset token (from the email link) and set a new password. Token is single-use. After success, all existing sessions for the user are invalidated.
|
|
91
|
-
|
|
92
|
-
**Example:**
|
|
93
|
-
|
|
94
|
-
```json
|
|
95
|
-
{ "project_id": "my-saas", "token": "rst_abc123", "new_password": "<credential>" }
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
## auth-verify-email
|
|
99
|
-
|
|
100
|
-
Verify the 6-digit code that was emailed to the user. On success, `email_verified` is set to true. After 5 wrong attempts the code is wiped and a new one is needed.
|
|
101
|
-
|
|
102
|
-
**Example:**
|
|
103
|
-
|
|
104
|
-
```json
|
|
105
|
-
{ "app_token": "eyJ...", "code": "482917" }
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
## auth-send-magic-link
|
|
109
|
-
|
|
110
|
-
Email a one-shot sign-in link to a user (passwordless / OTP). Auto-creates the user if they don't exist yet — same call covers sign-in and sign-up.
|
|
111
|
-
|
|
112
|
-
The link expires in 15 minutes and can only be used once. Token verification goes through `auth_verify_magic_link` (or `sw.auth.verifyOtp({ token })` from a deployed function).
|
|
113
|
-
|
|
114
|
-
**Example:**
|
|
115
|
-
|
|
116
|
-
```json
|
|
117
|
-
{ "project_id": "my-saas", "email": "alex@example.com", "redirect_uri": "https://my-saas.somewhere.site/auth/callback" }
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
## auth-mfa-enroll
|
|
121
|
-
|
|
122
|
-
Turn on email sign-in codes for the signed-in app user (the app's policy must be 'optional' or 'required'). Mails a code to their verified address and answers { challenge_id, delivery, expires_in }; confirm with auth_mfa_verify. Already on: { enrolled: true }.
|
|
123
|
-
|
|
124
|
-
## auth-refresh
|
|
125
|
-
|
|
126
|
-
Exchange a refresh token for a fresh (access_token, refresh_token) pair. Refresh tokens rotate — the old one is invalidated. Access tokens last 1 minute; refresh tokens last 30 days. Intended for server code, not browser code.
|
|
127
|
-
|
|
128
|
-
**Example:**
|
|
129
|
-
|
|
130
|
-
Example transcript or fragment
|
|
131
|
-
|
|
132
|
-
```text
|
|
133
|
-
{ "project_id": "my-saas", "refresh_token": "<refresh_token>" }
|
|
134
|
-
// Returns: { "token": "eyJ...new", "refresh_token": "<refresh_token>" }
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
## auth-cli-pair
|
|
138
|
-
|
|
139
|
-
Mint a short-lived `smt_` API key for ephemeral environments (hosted coding environments, sandboxes, containers). `somewhere auth set` takes the returned key through standard input or the command environment as `SOMEWHERE_TOKEN`. The CLI verifies and stores it, so the session can use the CLI without a browser login. Positional tokens are refused; the key does not belong in command arguments or chat.
|
|
140
|
-
|
|
141
|
-
Returns: `{ id, key: "smt_...", prefix, name, kind: "cli_pair", expires_at, ttl_seconds }`. Key auto-expires in 24h; the next session takes a new key. No refresh token is returned here: the pairing response omits the long-lived refresh credential. `somewhere auth login` gives a CLI session that renews itself; it stores its credentials directly in the CLI config.
|
|
142
|
-
|
|
143
|
-
For a shell without CLI credentials. The CLI is the scoped package `@somewhere-cloud/cli` (`npm i -g @somewhere-cloud/cli`). After pairing, first-class CLI commands cover routine work and `somewhere call <tool> '<json>'` covers the complete platform tool catalog. Without a shell, the MCP tools are the path.
|
|
144
|
-
|
|
145
|
-
Security note: scoped to the same user as the caller. Auditable as kind='cli_pair' separately from your main developer key, so a stolen ephemeral token is revocable on its own.
|
|
146
|
-
|
|
147
|
-
**Example flow (run once per session):**
|
|
148
|
-
|
|
149
|
-
```text
|
|
150
|
-
1. Call auth_cli_pair() → { key: "smt_...", expires_at: "..." }
|
|
151
|
-
2. Set SOMEWHERE_TOKEN to the returned key in the command environment.
|
|
152
|
-
3. Run: somewhere auth set // reads SOMEWHERE_TOKEN
|
|
153
|
-
4. Run: somewhere whoami // confirms identity
|
|
154
|
-
5. somewhere deploy // deploy raw source
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
## auth-cli-pair-connector
|
|
158
|
-
|
|
159
|
-
Create a short-lived (24-hour) API key that links the somewhere CLI in a shell environment to this account; the CLI then performs the same operations as this connector. Returns the key, its prefix and its expiry. The key is recorded as its own CLI pairing key, revocable separately, and no refresh credential is returned. The CLI reads the key from standard input or the SOMEWHERE_TOKEN environment variable through `somewhere auth set`. No operation on this connector requires it. In a terminal, the CLI reads deployment files from disk in one command without placing their contents in conversation tool arguments; for a typical app that keeps tens of thousands of tokens out of the conversation.
|
|
160
|
-
|
|
161
|
-
## auth-templates-list
|
|
162
|
-
|
|
163
|
-
List the three platform-issued email templates for a project: `password_reset`, `email_verification`, and `welcome`. Returns the live subject + HTML, whether it's a custom override or the default, and the default values inline.
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
# Browser tool reference
|
|
2
|
-
|
|
3
|
-
Use the section for the tool and connection in the current workflow. Each tool’s input schema defines the accepted arguments.
|
|
4
|
-
|
|
5
|
-
## browser
|
|
6
|
-
|
|
7
|
-
SEE, inspect, DRIVE and CAPTURE any web page — your app's EYES for perception, a VERIFY harness for QA, AND the one way to turn a page into a picture or a PDF. One call returns a structured health SIGNAL (console errors, page errors, failed network requests), not a raw image to vision-parse; a bad step or wrong shape hands back a correcting error.
|
|
8
|
-
|
|
9
|
-
Capture a page or HTML snippet in the format you need: a full-page **webp** of a logged-in view saved to a path you choose, or a **PDF invoice**, out of the same call.
|
|
10
|
-
|
|
11
|
-
**One tool, several outputs** — `capture: { "as": "png" | "jpeg" | "webp" | "pdf" }`. Printing is an output format, not a different operation:
|
|
12
|
-
|
|
13
|
-
```json
|
|
14
|
-
{ "project_id": "my-saas", "url": "https://my-saas.somewhere.site/pricing",
|
|
15
|
-
"capture": { "as": "webp", "full_page": true }, "storage": "/renders/pricing.webp" }
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
```json
|
|
19
|
-
{ "project_id": "my-saas", "html": "<h1>Invoice #1234</h1><p>Total: $49.99</p>",
|
|
20
|
-
"capture": { "as": "pdf", "paper": "A4" }, "storage": "/invoices/inv-1234.pdf" }
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
**See below the first screen, and watch it move.** The default screenshot is the first screen only (the viewport). `capture: { "full_page": true }` captures the whole scrollable page; the `frames` action watches a page over a few seconds and returns ONE labelled contact sheet plus measured change:
|
|
24
|
-
|
|
25
|
-
```json
|
|
26
|
-
{ "project_id": "my-saas", "capture": { "full_page": true } }
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
```json
|
|
30
|
-
{ "project_id": "my-saas", "actions": [
|
|
31
|
-
{ "click": "#open-menu" },
|
|
32
|
-
{ "frames": { "count": 6, "interval_ms": 150, "selector": "#menu" } }
|
|
33
|
-
] }
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
`frames` takes 2–12 screenshots at fixed geometry, `(count - 1) × interval_ms` at most 10000 ms, and reports `steps[].value.motion` (`from_ms`, `to_ms`, `changed_ratio` between consecutive frames, measured times) and `visual_change_detected`, worded as "visual change detected in the sampled region" — sampled pixels neither prove an animation runs nor that none does. With `selector` the region is that element's box at the first frame, held fixed, and `element_box` reports how the element itself moved; when it moved, `visual_change_detected` is true and the summary says by how much, even if it left the region before the next capture. Captures in the hosted browser are spaced by their measured times (`frames[].at_ms`), not the requested `interval_ms`: each takes a few hundred milliseconds, so a 200 ms request can come back 400–700 ms apart. Directly after a click it samples at once, so a short transition is caught. An incomplete capture (deadline, element gone, navigation) fails the step with `complete: false` and its captured count; it never reports "no change". The sheet comes back inline (re-encoded to fit) and, with a project, stored like a screenshot.
|
|
37
|
-
|
|
38
|
-
**Modes:**
|
|
39
|
-
- **EYES (perception)** — NO `project_id`, any public `url` (e.g. `{ "url": "https://example.com" }`): look at / inspect / screenshot ANY page. Ephemeral output — the screenshot returns **inline** (auto-downscaled to fit) by default; `store:true` gives a short-TTL signed scratch URL (`screenshots[].scratch_url`, never durable project storage). No-actions inspect includes the bounded clickable-element map. An explicit `include` list selects sections; `include:["network","dom"]` adds the full network table and the map. No auth, no origin-lock — any public URL.
|
|
40
|
-
- **VERIFY (project QA)** — `project_id`: drive + assert the deployed app of that project. `actions` clicks / fills / asserts a flow, and `auth:{ "user_id": "…" }` runs it as a logged-in user (1h audited impersonation), and screenshots store durably to the project filesystem (`screenshots[].fs_path`). Origin-locked — a `url` must be on the project's own origin.
|
|
41
|
-
|
|
42
|
-
Same engine and the same signals-first report either way. Each completed page run also returns one `accessibility_layout` line for WCAG AA text contrast, horizontal overflow, and tap targets below the 24×24px WCAG 2.2 AA minimum (24–44px is listed as a note). Those findings are advisory and never change `passed`.
|
|
43
|
-
|
|
44
|
-
- **Without `actions`** → a health snapshot by default: console errors, page errors, failed network requests (the 4xx/5xx + dropped calls — the real signal), the rendered page text (`rendered_text` — grep-able structured text beats a screenshot ~80% of the time), `final_url`, a small screenshot, and a bounded interactive-element map (`dom_outline` + testid handles). An explicit `include` list selects optional sections: `include:["network","dom"]` retains the map and adds the full per-request `network` table + redirect chain; `include:[]` omits both. This is the quick "what does my app look like and is it healthy" call (it replaces a standalone screenshot). That page screenshot comes back **inline as an MCP image content block by default** (it renders directly in the conversation) while its file path stays in the output as the durable artifact; `inline:false` skips the inline image and keeps only the path. An oversized capture on a tall/heavy page is auto-downscaled to fit inline — a no-`project_id` call still returns a real image in one shot.
|
|
45
|
-
- **`actions`** → the same concise action-sequence JSON as the CLI: `{click}`, `{fill,value}`, `{upload,file,name?}`, `{select,value}`, `{wait}`, `{expect}`, `{screenshot}`, `{frames}`, `{eval}`, and `{goto}` (a path on the app, e.g. `{goto:"/club"}`). Every item reports ok/fail with a reason, and the first failure stops the sequence.
|
|
46
|
-
- Existing expanded `steps` remain accepted for older callers; new flows use the shared `actions` shape above.
|
|
47
|
-
- **`url` with NO `project_id`** → capture/inspection of ANY public third-party page (e.g. `{ "url": "https://example.com" }`), not just your own app. (When you DO pass `project_id`, `url` is scoped to that project's origin.) The screenshot comes back inline by default; `store:true` instead returns a short-lived, auto-expiring signed URL to the full-res image (`screenshots[].scratch_url`) — handy for a big external capture you'd rather link than inline. It's kept in an ephemeral scratch store and never touches project storage.
|
|
48
|
-
- **`html`** → a raw HTML snippet rendered straight to an image (e.g. an OG card). No page navigation, no steps; returns the image inline, or the stored file path when `storage` is set.
|
|
49
|
-
- **`extract:"markdown"`** (or `include:["markdown"]`) → the page as clean MARKDOWN (headings, links, lists, main content) in the `markdown` field, instead of vision-parsing the screenshot. The cheapest way to actually read a page's content. (The plain rendered text is always in `rendered_text`.)
|
|
50
|
-
- **`session_id`** → ONE live browser page kept alive ACROSS calls (persistent session). Navigate in call 1; in call 2 (same session_id) wait for a 20s stream and screenshot the SAME page — cookies, current URL, and the in-flight stream all survive. The call returns `session_id` + `session_expires_at`; a reconnect skips the initial navigation (the page is where you left it — a `goto` step moves). Sessions are yours only, capped per developer, and idle out after 5 min (10 min hard cap); a failed step keeps the session, and an expired one restarts signed out and says so (`session_note`). Omitted, it is the default fresh-per-call browser (cache-safe — a session is only for cross-call state).
|
|
51
|
-
|
|
52
|
-
**With a shell:** `somewhere browser` covers navigation, waits, evaluation, screenshots, and flow steps. This MCP tool covers clients without a shell, and cases where an inline image or result is more useful.
|
|
53
|
-
|
|
54
|
-
It checks what a UI looks like AND whether it works — clicks land, the form submits, the modal opens — and to catch the 500-ing API call a screenshot alone would hide. (run_code proves a function's backend; `browser` proves the rendered UI.) Signals come FIRST: `passed` reflects step outcomes only — console_errors / page_errors / failed_requests matter too (a 500 shows there even when every step "passes").
|
|
55
|
-
|
|
56
|
-
Elements are targeted by selector rather than pixel coordinates.
|
|
57
|
-
|
|
58
|
-
**Shared action-sequence JSON** (preferred; the CLI's `--actions` file uses this exact array):
|
|
59
|
-
|
|
60
|
-
Example transcript or fragment
|
|
61
|
-
|
|
62
|
-
```text
|
|
63
|
-
"actions": [
|
|
64
|
-
{ "fill": "#email", "value": "a@b.co" },
|
|
65
|
-
{ "upload": "#avatar", "file": "data:image/png;base64,iVBORw0KGgo=", "name": "avatar.png" },
|
|
66
|
-
{ "select": "#plan", "value": "pro" },
|
|
67
|
-
{ "click": "button[type=submit]" },
|
|
68
|
-
{ "wait": ".dashboard" },
|
|
69
|
-
{ "expect": { "selector": ".welcome", "text": "Hi", "visible": true, "count": 1 } },
|
|
70
|
-
{ "screenshot": "after" },
|
|
71
|
-
{ "eval": "document.title" }
|
|
72
|
-
]
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
Files over the 10 MB inline limit come from project files via `{ "upload": "#video", "fs_path": "/uploads/big.mp4" }` (optional `name`, `type`; up to 50 MB per call, streamed into the page).
|
|
76
|
-
|
|
77
|
-
`wait` is a CSS selector string or a millisecond number. `expect` requires a selector and at least one of `text` (substring), `visible` (boolean), or `count` (exact non-negative integer); conditions may be combined. A failed action stops the sequence and names its zero-based action index.
|
|
78
|
-
|
|
79
|
-
Native `alert`/`confirm`/`prompt`/`beforeunload` dialogs are dismissed by default and listed in the report's `dialogs`. `{ "dialog": "accept" }` (with `"text"` for a prompt) right before the action that opens one accepts it; the answer applies to the next dialog only.
|
|
80
|
-
|
|
81
|
-
Expanded `steps` remain runtime-compatible for older callers, but are not a
|
|
82
|
-
second authoring contract. `actions` is the form for new flows. A failed action aborts
|
|
83
|
-
the run while preserving console, network, and screenshot state.
|
|
84
|
-
|
|
85
|
-
**Examples:**
|
|
86
|
-
|
|
87
|
-
Example transcript or fragment
|
|
88
|
-
|
|
89
|
-
```text
|
|
90
|
-
// See + inspect — screenshot, signals, and the clickable-element map, no actions:
|
|
91
|
-
{ "project_id": "my-saas" }
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
Example transcript or fragment
|
|
95
|
-
|
|
96
|
-
```text
|
|
97
|
-
// Drive a logged-in flow as a specific user (impersonation, 1h, audited):
|
|
98
|
-
{ "project_id": "my-saas", "auth": { "user_id": "usr_123" }, "actions": [
|
|
99
|
-
{ "wait": "h1" },
|
|
100
|
-
{ "expect": { "selector": "h1", "text": "Welcome" } }
|
|
101
|
-
] }
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
## browser-connector
|
|
105
|
-
|
|
106
|
-
Inspect or screenshot an external public URL without project authority. Actions, steps, eval, authentication, session seeding, and persistent sessions require project_id, and their navigation stays on an authorized origin owned by that project. Owned apps may load their normal external assets and APIs under backend policy. Interactive operations can change application data. Returns page, console, network, and screenshot evidence.
|
|
107
|
-
|
|
108
|
-
## site-verify
|
|
109
|
-
|
|
110
|
-
Runs one browser flow across desktop and phone viewports and returns one structured verdict: every named step, page/console/network health, expected request outcomes, both screenshot paths or URLs, and a non-blocking accessibility/layout line per viewport covering WCAG AA text contrast, horizontal overflow, and tap targets below the 24×24px WCAG 2.2 AA minimum (24–44px is listed as a note). Authenticated or seeded flows require project_id and a project-owned origin. An absent action list produces a load/health/two-screenshot check. Each viewport uses a fresh browser that closes inside the call, including on failure.
|
|
111
|
-
|
|
112
|
-
## site-verify-connector
|
|
113
|
-
|
|
114
|
-
Inspect or screenshot an external public URL at desktop and phone sizes without project authority. Actions, eval, authentication, and session seeds require project_id, and their navigation stays on an authorized origin owned by that project. Owned apps may load their normal external assets and APIs under backend policy. Returns step results, page errors, network outcomes, and screenshots; interactive operations can change application data.
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
# Code tool reference
|
|
2
|
-
|
|
3
|
-
Use the section for the tool and connection in the current workflow. Each tool’s input schema defines the accepted arguments.
|
|
4
|
-
|
|
5
|
-
## run-code
|
|
6
|
-
|
|
7
|
-
Run a short script once, server-side, against a project's own bindings — get the result + console logs back in one call. It replaces a throwaway debug endpoint or dozens of tool calls when inspecting data, trying a query variant, or running a one-off transformation.
|
|
8
|
-
|
|
9
|
-
`code` is an ES module whose default async function receives `sw` (the same database / files / search / ai bindings a deployed function gets) and returns a JSON-serializable value:
|
|
10
|
-
|
|
11
|
-
```json
|
|
12
|
-
{
|
|
13
|
-
"project_id": "my-saas",
|
|
14
|
-
"code": "export default async function (sw) { const { data } = await sw.db.server.from('notes', { limit: 1 }); return data; }"
|
|
15
|
-
}
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
Application tables are declared in db/schema.ts. sw.db.from reads them with caller-scoped access, and sw.db.server.from reads them once the caller is authorized for server access. The corresponding structured methods, such as sw.db.server.insert, change them. Raw query and batch go to the separate raw SQL database on current projects. The script entry point above is for `run_code`. A JSON route in api/ is export default sw.endpoint({ auth, handler }) with auth set explicitly. TypeScript infers the handler inputs and sw context. auth: 'none' marks a deliberately public route.
|
|
19
|
-
|
|
20
|
-
Runs with the project's OWN authority, not your developer key: no env secrets unless you pass `include_env: true`, no admin, no cross-project access, and outbound fetch is limited to public hosts. Returns `{ result, logs, duration_ms, error? }`. `result` is capped at 256KB (truncated with a notice past that). `logs` keeps at most 100 entries. Each log message is cut at 64KB with a `[truncated: …]` marker at its end. All logs together stop at 4MB, followed by one final `[logs truncated: …]` entry. `logs_truncated: true` is set when entries were dropped by either limit (not when a single message is cut). `error.message` and `error.stack` are each cut at 64KB. A returned `session` over 64KB is not stored and the call answers `SESSION_TOO_LARGE`. `timeout_ms` defaults to 10000, max 30000.
|
|
21
|
-
|
|
22
|
-
**Threading state across calls (opt-in):** pass a stable `session_id` to carry explicit JSON state between runs. The saved JSON is exposed to your script as a read-only `sw.session`; a returned `{ session: {...} }` object saves state for the next call (it is stored under that `session_id`, separately from `result`). Absent `session_id` = stateless, byte-identical to a normal run. This is explicit data you thread by id — NOT live-variable/closure persistence.
|
|
23
|
-
|
|
24
|
-
## run-code-connector
|
|
25
|
-
|
|
26
|
-
Execute a short ES-module script against one project’s live bindings and return JSON plus console logs. The default async function receives sw. Writes persist; the script is temporary. Optional session_id preserves explicit returned JSON between runs. include_env exposes project secrets only when true. Platform AI media generation and financial transfers are unavailable in connector runs. Runtime API reference: https://somewhere.cloud/docs.txt.
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# Connect tool reference
|
|
2
|
-
|
|
3
|
-
Use the section for the tool and connection in the current workflow. Each tool’s input schema defines the accepted arguments.
|
|
4
|
-
|
|
5
|
-
## connect-stripe-url
|
|
6
|
-
|
|
7
|
-
Get a link that lets a creator connect their EXISTING Stripe account read-only, so this project can read their subscriber list — the "gated content with your existing subscribers" use case. Returns { url }; the creator's browser authorizes there. This is the OPPOSITE of payments_* (which is for ACCEPTING money) — connect reads another account's data, it never moves money.
|
|
8
|
-
|
|
9
|
-
**Example:**
|
|
10
|
-
|
|
11
|
-
Example transcript or fragment
|
|
12
|
-
|
|
13
|
-
```text
|
|
14
|
-
{ "project_id": "my-gated-site", "return_url": "https://my-gated-site.somewhere.site/settings" }
|
|
15
|
-
// Returns: { "url": "https://connect.stripe.com/oauth/authorize?..." }
|
|
16
|
-
// After the creator authorizes, Stripe returns them to return_url with ?connect=success.
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## connect-stripe-subscribers
|
|
20
|
-
|
|
21
|
-
List the subscribers of the Stripe account connected to this project. Reads the platform's cached list (kept fresh by the Connect webhook) — fast, no per-call Stripe round-trip. Each row: { email, stripe_customer_id, subscription_id, status, price_id, product_id, tier, current_period_end (Unix seconds), amount, currency }. `tier` is the Stripe Price nickname or lookup_key. Paginated: pass `cursor` (the previous response's next_cursor) to page. Returns 409 CONNECT_NOT_CONNECTED if no Stripe account is connected yet — connect_stripe_url comes first.
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
# Cron tool reference
|
|
2
|
-
|
|
3
|
-
Use the section for the tool and connection in the current workflow. Each tool’s input schema defines the accepted arguments.
|
|
4
|
-
|
|
5
|
-
## cron-create
|
|
6
|
-
|
|
7
|
-
Create a scheduled trigger. Schedule is a 5-field cron expression (`minute hour dom month dow`). It uses UTC by default; an IANA `timezone` such as `America/Los_Angeles` gives local wall-clock scheduling with daylight-saving changes handled automatically. Each fire dispatches a job to your handler (at-least-once delivery, so handlers are idempotent). Missed fires during platform downtime are NOT replayed.
|
|
8
|
-
|
|
9
|
-
**Common patterns:**
|
|
10
|
-
|
|
11
|
-
| Pattern | Schedule |
|
|
12
|
-
|---------|----------|
|
|
13
|
-
| Every 15 minutes | `*/15 * * * *` |
|
|
14
|
-
| Daily at 08:00 UTC | `0 8 * * *` |
|
|
15
|
-
| Every 6 hours | `0 */6 * * *` |
|
|
16
|
-
| Weekly Monday midnight | `0 0 * * 1` |
|
|
17
|
-
|
|
18
|
-
**Minimum interval.** Your plan sets the smallest gap allowed between two
|
|
19
|
-
fires. `cron_list({ project_id })` reports it as
|
|
20
|
-
`policy.min_interval_minutes`, alongside `policy.max_per_project`. A
|
|
21
|
-
schedule tighter than the floor is refused with
|
|
22
|
-
`CRON_SCHEDULE_TOO_FREQUENT` and the message names both intervals.
|
|
23
|
-
Schedules that already exist are never re-checked — they keep firing on the
|
|
24
|
-
cadence they were created with.
|
|
25
|
-
|
|
26
|
-
**Example:**
|
|
27
|
-
|
|
28
|
-
```json
|
|
29
|
-
{
|
|
30
|
-
"project_id": "my-saas",
|
|
31
|
-
"name": "daily-digest",
|
|
32
|
-
"schedule": "0 8 * * *",
|
|
33
|
-
"handler": "https://my-saas.somewhere.site/api/cron/daily-digest",
|
|
34
|
-
"payload": { "type": "digest" }
|
|
35
|
-
}
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
## cron-list
|
|
39
|
-
|
|
40
|
-
List cron triggers for a project (or all your projects). Each row includes timezone, last_run_at, last_run_status, last_run_job_id, bounded last_error_code/last_error diagnostics, and next_run_at. A task that has never run returns null for every last-run field. job_get with last_run_job_id returns full bounded attempt history. Passing project_id also returns `policy` — the project owner's plan name, the smallest interval a new or edited schedule may have, and how many scheduled tasks the project may hold.
|
|
41
|
-
|
|
42
|
-
## cron-run
|
|
43
|
-
|
|
44
|
-
Run an existing scheduled task once now through the same job handler used by scheduled fires. This does not change its schedule. The run is recorded in job history with trigger `manual`. With preview_session_id and preview_id, the task's handler path and payload run once in that exact open preview instead (its code, data, files and mail; one attempt, at most 270 s); the production schedule is only read and never changes.
|
|
45
|
-
|
|
46
|
-
## cron-update
|
|
47
|
-
|
|
48
|
-
Update a cron trigger's schedule, IANA timezone, handler, payload, display name, or enabled state. Sending a new `schedule` or `timezone` recomputes the next fire and re-checks the plan minimum (see cron_list `policy`); every other edit, including resuming a paused task, leaves an existing schedule alone.
|