@somewhere-cloud/cli 0.38.155 → 0.38.157
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 +8 -1
- package/dist/commands/docs.js +1 -1
- package/dist/lib/bundle.js +286 -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,265 +0,0 @@
|
|
|
1
|
-
# Fs 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
|
-
## fs-write
|
|
6
|
-
|
|
7
|
-
**fs_write = text and small inline content. fs_upload = real files.** Write UTF-8 text or other small content already present in the tool call to project file storage. Parent directories are auto-created. Overwrites create a new version automatically (history keeps the last 3 versions on Free, 10 on Builder).
|
|
8
|
-
|
|
9
|
-
Images, PDFs, video, zip files, fonts, large artifacts, and task attachments go through `fs_upload`, so binary bytes never enter model context. Base64 input remains accepted here only for backward compatibility with existing callers; new binary uploads go through `fs_upload`.
|
|
10
|
-
|
|
11
|
-
It holds notes, JSON, CSV, generated source text, and small cached text that is not project code (project code goes through project_deploy).
|
|
12
|
-
|
|
13
|
-
There are two file surfaces: deployed source is read with `project_files_list` / `project_file_read`; `fs_write` and `fs_read` are runtime storage for uploads and generated files via `sw.fs`. Project source such as `src/App.tsx` or `api/foo.ts` is read with `project_file_read`, not `fs_read`.
|
|
14
|
-
|
|
15
|
-
**Files are PRIVATE by default.** A file served at a public URL (e.g. an embedded app image) takes `public: true`, and `fs_public_url` returns the URL. Without it the file is only reachable through your authenticated code.
|
|
16
|
-
|
|
17
|
-
**Example (text):**
|
|
18
|
-
|
|
19
|
-
```json
|
|
20
|
-
{ "project_id": "my-saas", "path": "/notes/run.txt", "content_type": "text/plain", "content": "upload completed" }
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## fs-upload
|
|
24
|
-
|
|
25
|
-
**fs_upload = files. fs_write = text and small inline content.** Uploads an image, PDF, video, zip, font, large artifact, or attachment without carrying binary bytes or base64 in tool arguments.
|
|
26
|
-
|
|
27
|
-
**Client capability matrix:**
|
|
28
|
-
- **Native-file connector clients:** `file` carries a temporary authorized file reference that this tool streams through the upload relay.
|
|
29
|
-
- **Clients with raw HTTP access:** an omitted `file` mints a one-time `upload_url` that accepts raw bytes with the returned Content-Type. This two-step transport keeps base64 out of tool arguments. One request carries at most 100 MB; a bigger file goes up in parts through the returned `multipart_url` (start, send each part, then complete — the reply spells out the steps). With `size_bytes`, a file over 90 MB comes back already started, with `parts_url`, `part_size`, `part_count` and `complete_url`; a size over the plan's per-file limit is refused with PAYLOAD_TOO_LARGE before any byte moves.
|
|
30
|
-
- **Other shell-less MCP clients:** standard MCP arguments have no protocol-level file input, so upload availability depends on compatible host file references or raw HTTP access.
|
|
31
|
-
|
|
32
|
-
The connector reference and upload URL are temporary transports, not the durable artifact. After storage, the saved bytes are addressed by `path`; `fs_signed_url` provides a private human download and `public:true` with `fs_public_url` provides a permanent public URL. The PUT response and native call both return `{ path, size_bytes, content_type, version }`.
|
|
33
|
-
|
|
34
|
-
`file` must be a connector-provided file reference. A local path string, URL string, base64 string, or text value is rejected rather than being mistaken for bytes. `content_type` overrides connector metadata; otherwise MIME is inferred from connector metadata and the filename/path. Files are private unless `public:true` is supplied.
|
|
35
|
-
|
|
36
|
-
**Native connector call:**
|
|
37
|
-
|
|
38
|
-
```json
|
|
39
|
-
{ "project_id": "my-saas", "path": "/uploads/alice/avatar.png", "file": "<attached connector file>", "public": true }
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
**Raw-PUT fallback:**
|
|
43
|
-
|
|
44
|
-
```json
|
|
45
|
-
{ "project_id": "my-saas", "path": "/uploads/archive.zip", "content_type": "application/zip" }
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
**Large file (over 90 MB), uploaded in parts:**
|
|
49
|
-
|
|
50
|
-
```json
|
|
51
|
-
{ "project_id": "my-saas", "path": "/uploads/video.mp4", "content_type": "video/mp4", "size_bytes": 125829120 }
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
## fs-read
|
|
55
|
-
|
|
56
|
-
Get file, download file, fetch file contents, view file, cat, ls — read a file or list a directory from the project filesystem. If the path ends with `/` or matches a directory, returns a directory listing; otherwise returns the file content.
|
|
57
|
-
|
|
58
|
-
There are two file surfaces: deployed source is read with `project_files_list` / `project_file_read`; `fs_read`, `fs_write`, and `fs_upload` use runtime storage via `sw.fs`. Project source such as `src/App.tsx` or `api/foo.ts` is read with `project_file_read`, not `fs_read`.
|
|
59
|
-
|
|
60
|
-
Optional `lines` returns only a line range from a text file as JSON with `{ content, lines: [start, end], total_lines }` — useful for peeking into large files without downloading them whole.
|
|
61
|
-
|
|
62
|
-
For a directory listing, `recursive: true` returns every descendant in one call, with an optional `depth` cap.
|
|
63
|
-
|
|
64
|
-
**Example:**
|
|
65
|
-
|
|
66
|
-
Example transcript or fragment
|
|
67
|
-
|
|
68
|
-
```text
|
|
69
|
-
// Read a whole file:
|
|
70
|
-
{ "project_id": "my-saas", "path": "/uploads/users/alice/avatar.png" }
|
|
71
|
-
|
|
72
|
-
// Read lines 50–75 of a stored text file:
|
|
73
|
-
{ "project_id": "my-saas", "path": "/logs/import-run.txt", "lines": "50-75" }
|
|
74
|
-
|
|
75
|
-
// List a directory (immediate children):
|
|
76
|
-
{ "project_id": "my-saas", "path": "/uploads/users/" }
|
|
77
|
-
|
|
78
|
-
// List a directory tree, two levels deep:
|
|
79
|
-
{ "project_id": "my-saas", "path": "/uploads/", "recursive": true, "depth": 2 }
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
## fs-diff
|
|
83
|
-
|
|
84
|
-
Unified diff between the current contents of a file and one of its archived versions. The diff string includes standard `---` / `+++` file headers and `@@` hunk headers. Defaults to the most recent previous version ("what changed since the last write").
|
|
85
|
-
|
|
86
|
-
Text files only. Capped at 2000 lines per side.
|
|
87
|
-
|
|
88
|
-
**Example:**
|
|
89
|
-
|
|
90
|
-
Example transcript or fragment
|
|
91
|
-
|
|
92
|
-
```text
|
|
93
|
-
// Diff vs previous version:
|
|
94
|
-
{ "project_id": "my-saas", "path": "/src/index.ts" }
|
|
95
|
-
|
|
96
|
-
// Diff vs a specific archived version:
|
|
97
|
-
{ "project_id": "my-saas", "path": "/src/index.ts", "version": 4 }
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
## fs-glob
|
|
101
|
-
|
|
102
|
-
Match file paths against a glob pattern. Fast metadata query — no file contents are read, no scan.
|
|
103
|
-
|
|
104
|
-
Supported syntax: `*` (not across /), `**` (across /), `?` (one char), `{a,b,c}` (brace expansion).
|
|
105
|
-
|
|
106
|
-
**Example:**
|
|
107
|
-
|
|
108
|
-
Example transcript or fragment
|
|
109
|
-
|
|
110
|
-
```text
|
|
111
|
-
// All TypeScript files under src/api:
|
|
112
|
-
{ "project_id": "my-saas", "pattern": "/src/api/**/*.ts" }
|
|
113
|
-
|
|
114
|
-
// JS or TS top-level files:
|
|
115
|
-
{ "project_id": "my-saas", "pattern": "/*.{js,ts}" }
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
## fs-move
|
|
119
|
-
|
|
120
|
-
Move or rename a file or directory. Instant regardless of file size. `overwrite: true` atomically replaces the destination if it already exists — unlike a separate `fs_delete` + `fs_move` pair, which can race and leave the file in an inconsistent state.
|
|
121
|
-
|
|
122
|
-
**Example:**
|
|
123
|
-
|
|
124
|
-
```json
|
|
125
|
-
{ "project_id": "my-saas", "from": "/uploads/temp/photo.jpg", "to": "/uploads/users/alice/photo.jpg", "overwrite": true }
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
## fs-stat
|
|
129
|
-
|
|
130
|
-
Get metadata for a file or directory without downloading the contents. Returns path, name, type, size_bytes, content_type, visibility, version, created_at, and updated_at; a file in a declared file collection also returns collection, group (member collections) and owner_subject_id. File tools act with your developer authority over every file in the project.
|
|
131
|
-
|
|
132
|
-
## fs-public-url
|
|
133
|
-
|
|
134
|
-
Get a public URL for a file written via fs_write. The URL is hosted on the project's subdomain at `/storage/{path}` and can be embedded directly as an image src, anchor href, etc. — no signing or auth. A file in a declared file collection takes its visibility from db/schema.ts: make_public on it answers FILE_VISIBILITY_DECLARED (docs({ topic: 'declared-files' })).
|
|
135
|
-
|
|
136
|
-
Files are PRIVATE by default. Asking for a public URL does NOT silently expose a private file: a private file returns an error unless you pass `make_public: true` to publish it. An already-public file just returns its URL. `fs_signed_url` gives a time-limited link to a private file WITHOUT making it world-readable.
|
|
137
|
-
|
|
138
|
-
**Example:**
|
|
139
|
-
|
|
140
|
-
Example transcript or fragment
|
|
141
|
-
|
|
142
|
-
```text
|
|
143
|
-
{ "project_id": "my-saas", "path": "/uploads/users/alice/avatar.png", "make_public": true }
|
|
144
|
-
// Returns: { "public_url": "https://my-saas.somewhere.site/storage/uploads/users/alice/avatar.png", ... }
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
## fs-versions
|
|
148
|
-
|
|
149
|
-
List previous versions of a file. Returns `{ path, current_version, versions }`; each item in `versions` has `version`, `size_bytes`, `content_type`, and `created_at`.
|
|
150
|
-
|
|
151
|
-
**Example:**
|
|
152
|
-
|
|
153
|
-
Example transcript or fragment
|
|
154
|
-
|
|
155
|
-
```text
|
|
156
|
-
{ "project_id": "my-saas", "path": "/uploads/config.json" }
|
|
157
|
-
// Returns: { "path": "/uploads/config.json", "current_version": 3, "versions": [{ "version": 2, "size_bytes": 1024, "content_type": "application/json", "created_at": "2026-04-18T..." }] }
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
## fs-restore
|
|
161
|
-
|
|
162
|
-
Restore a previous version of a file. The current state is first archived as a new version (so the restore is non-destructive), then the chosen version becomes the current contents.
|
|
163
|
-
|
|
164
|
-
**Example:**
|
|
165
|
-
|
|
166
|
-
```json
|
|
167
|
-
{ "project_id": "my-saas", "path": "/uploads/config.json", "version": 2 }
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
## fs-search
|
|
171
|
-
|
|
172
|
-
Search the text files a project stores (source, JSON, markdown, HTML, CSS and similar; binaries are skipped). The answer's `mode` says how it searched:
|
|
173
|
-
|
|
174
|
-
- `fts5` (normal): the project's search index. Each run of ASCII letters and digits in the query matches the start of a word, ignoring case. Results are `{ path, snippet }`, best first. Each write indexes the first 1,048,576 characters of a text file; when the index is built for files already stored, files over 1,048,576 bytes are skipped.
|
|
175
|
-
- `scan` (when the index is not ready or falls back, and for preview files): a literal, case-sensitive match, line by line, over at most `max_files` files, skipping files over 1,048,576 bytes. Results are `{ path, line, snippet, before, after }` and the answer adds `files_scanned`. A production scan schedules index backfill.
|
|
176
|
-
|
|
177
|
-
`truncated: true` means the answer reached `limit`, so there may be more. A 503 `FILE_INDEX_UNAVAILABLE` means the index needs recovery; a later search succeeds once it recovers.
|
|
178
|
-
|
|
179
|
-
**Example:**
|
|
180
|
-
|
|
181
|
-
Example transcript or fragment
|
|
182
|
-
|
|
183
|
-
```text
|
|
184
|
-
// Files that mention the auth client:
|
|
185
|
-
{ "project_id": "my-saas", "path": "/", "query": "createSomewhereAuth" }
|
|
186
|
-
|
|
187
|
-
// Scoped to a subtree:
|
|
188
|
-
{ "project_id": "my-saas", "path": "/src/api/", "query": "TODO" }
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
## fs-replace
|
|
192
|
-
|
|
193
|
-
Find-and-replace text in a single file, server-side. No read-modify-write cycle from the client. Archives the current contents as a new version before writing (same retention as fs_write), so fs_restore can roll back.
|
|
194
|
-
|
|
195
|
-
Literal string match (not regex). Only works on text files. A single `find` that matches nothing returns `replacements: 0` and writes nothing.
|
|
196
|
-
|
|
197
|
-
**Several edits to one file:** pass `edits`, an ordered array of `{ "find", "replace", "expect"? }` (at most 200), instead of top-level find/replace. They apply in order (a later edit sees the earlier ones) and save as ONE new version. In the array every edit must match: the first that does not returns `FIND_NOT_FOUND` with zero-based `data.edit_index` and writes nothing; `expect: n` requires exactly n matches, else `FIND_COUNT_MISMATCH` with `data.expected` and `data.actual`. One call edits one file.
|
|
198
|
-
|
|
199
|
-
**Example:**
|
|
200
|
-
|
|
201
|
-
Example transcript or fragment
|
|
202
|
-
|
|
203
|
-
```text
|
|
204
|
-
{ "project_id": "my-saas", "path": "/src/config.ts", "find": "API_URL = 'https://staging...'", "replace": "API_URL = 'https://api...'" }
|
|
205
|
-
// Returns: { "ok": true, "replacements": 1, "version": 4 }
|
|
206
|
-
{ "project_id": "my-saas", "path": "/notes/todo.md", "edits": [{ "find": "- [ ] ship", "replace": "- [x] ship", "expect": 1 }, { "find": "Status: draft", "replace": "Status: done" }] }
|
|
207
|
-
// Returns: { "ok": true, "replacements": 2, "edits": [{ "edit_index": 0, "replacements": 1 }, { "edit_index": 1, "replacements": 1 }], "version": 5 }
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
## fs-replace-connector
|
|
211
|
-
|
|
212
|
-
Replace exact text in one project storage file, with one find/replace or an ordered edits array saved as a single new version. Literal matches, text files only. The Somewhere file API contract is at https://somewhere.cloud/docs.txt.
|
|
213
|
-
|
|
214
|
-
## fs-signed-url
|
|
215
|
-
|
|
216
|
-
Mint a short-lived signed URL for a file. The URL is fetchable without an API key — the token IS the auth. It suits email attachments, image previews, and "download once" handoffs to recipients without a developer key.
|
|
217
|
-
|
|
218
|
-
`expires_in` is in seconds, min 60, max 604800 (7 days), default 3600 (1 hour). After expiry the URL returns 403.
|
|
219
|
-
|
|
220
|
-
**Example:**
|
|
221
|
-
|
|
222
|
-
Example transcript or fragment
|
|
223
|
-
|
|
224
|
-
```text
|
|
225
|
-
{ "project_id": "my-saas", "path": "/uploads/invoice-2026.pdf", "expires_in": 86400 }
|
|
226
|
-
// Returns: { "url": "https://api.somewhere.cloud/v1/fs-signed/eyJ...", "expires_at": "2026-05-13T..." }
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
## fs-integrity-check
|
|
230
|
-
|
|
231
|
-
Scan a project's files for orphan metadata — rows pointing at a file blob that no longer exists. Returns the list of orphans. `auto_clean: true` deletes the orphan rows in the same call.
|
|
232
|
-
|
|
233
|
-
It suits suspected partial-failure incidents or a periodic sweep. Returns counts and a sample of orphan paths.
|
|
234
|
-
|
|
235
|
-
**Example:**
|
|
236
|
-
|
|
237
|
-
Example transcript or fragment
|
|
238
|
-
|
|
239
|
-
```text
|
|
240
|
-
{ "project_id": "my-saas" }
|
|
241
|
-
// Returns: { "scanned": 1240, "orphan_files": [], "orphan_versions": [],
|
|
242
|
-
// "auto_clean": false, "cleaned": { "files": 0, "versions": 0 },
|
|
243
|
-
// "next_cursor": null }
|
|
244
|
-
|
|
245
|
-
{ "project_id": "my-saas", "auto_clean": true }
|
|
246
|
-
// Returns: { "scanned": 1240, "orphan_files": [{ "id": "...", "path": "/x.bin", "storage_key": "..." }],
|
|
247
|
-
// "orphan_versions": [], "auto_clean": true,
|
|
248
|
-
// "cleaned": { "files": 1, "versions": 0 }, "next_cursor": null }
|
|
249
|
-
```
|
|
250
|
-
|
|
251
|
-
## fs-request-upload
|
|
252
|
-
|
|
253
|
-
User file upload — get a link where the user uploads a file (a logo, a photo, a document) from their own device into the project's files, for files the user has that this conversation cannot pass to a tool.
|
|
254
|
-
|
|
255
|
-
Returns `{ status: "pending", url, request, path, accept, max_bytes, expires_at }`. The link works for 30 minutes and only for a signed-in editor of the project. The file's declared type must match `accept` and its size must fit `max_bytes`; HTML or script content is stored as `application/octet-stream` so it never runs. `handoff_status({ request })` reports progress and returns the stored file's path, size, type and version once uploaded. With `public: true`, `fs_public_url` gives the URL to use in the app.
|
|
256
|
-
|
|
257
|
-
**Example:**
|
|
258
|
-
|
|
259
|
-
```json
|
|
260
|
-
{ "project_id": "my-shop", "path": "/brand/logo.png", "accept": ["image/png", "image/svg+xml", "image/jpeg"], "public": true, "purpose": "Logo for the site header" }
|
|
261
|
-
```
|
|
262
|
-
|
|
263
|
-
## fs-upload-connector
|
|
264
|
-
|
|
265
|
-
Upload a file from a supplied URL into project files. The Somewhere file API contract (paths, visibility, signed and public URLs) is at https://somewhere.cloud/docs.txt.
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
# Github 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
|
-
## github-connect
|
|
6
|
-
|
|
7
|
-
Connect a GitHub repository + branch to a project, deploy the branch's current HEAD, then automatically deploy every future push through the same pipeline as `somewhere deploy`.
|
|
8
|
-
|
|
9
|
-
Preferred path: `github_app_install` if needed, then an ID from `github_installations`, passed as `installation_id`. The App uses short-lived tokens and signed App-level webhooks—no PAT paste or manual repo webhook. By default this call resolves and deploys HEAD immediately; `github_status` reports the returned `initial_deploy.commit_sha` as deployed or failed. The PAT/manual-webhook fields remain compatibility fallbacks.
|
|
10
|
-
|
|
11
|
-
**Example:**
|
|
12
|
-
|
|
13
|
-
Example transcript or fragment
|
|
14
|
-
|
|
15
|
-
```text
|
|
16
|
-
{ "project_id": "my-saas", "repo": "alice/my-saas", "installation_id": 123, "branch": "main" }
|
|
17
|
-
// Returns: { "repo": "alice/my-saas", "via_app": true, "initial_deploy": { "status": "deploying", "commit_sha": "..." } }
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## github-status
|
|
21
|
-
|
|
22
|
-
Show a project's GitHub push-to-deploy connection: repo, branch, App/manual mode, and the last exact commit's deploy status/error. After `github_connect`, it reports that commit as `deployed` or `failed`; `connected` only means the repo is linked; that commit's own status says whether it deployed. Returns `{ connected: false }` if no repo is connected.
|
|
23
|
-
|
|
24
|
-
**Example:**
|
|
25
|
-
|
|
26
|
-
Example transcript or fragment
|
|
27
|
-
|
|
28
|
-
```text
|
|
29
|
-
{ "project_id": "my-saas" }
|
|
30
|
-
// Returns: { "connected": true, "repo": "alice/my-saas", "branch": "main", "hook_installed": true, "last_commit_sha": "...", "last_status": "deployed" }
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
## github-disconnect
|
|
34
|
-
|
|
35
|
-
Disconnect a project from GitHub push-to-deploy. Removes the connection and best-effort deletes a per-repository webhook when present. Already-deployed code stays live—this only stops future pushes from auto-deploying.
|
|
36
|
-
|
|
37
|
-
**Example:**
|
|
38
|
-
|
|
39
|
-
Example transcript or fragment
|
|
40
|
-
|
|
41
|
-
```text
|
|
42
|
-
{ "project_id": "my-saas" }
|
|
43
|
-
// Returns: { "disconnected": true }
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
## github-list-repos
|
|
47
|
-
|
|
48
|
-
List repositories available to a GitHub App installation so you can pick one for `github_connect`. Preferred: pass `installation_id` from `github_installations`. A personal access token remains an optional compatibility fallback and is used only for this request.
|
|
49
|
-
|
|
50
|
-
**Example:**
|
|
51
|
-
|
|
52
|
-
Example transcript or fragment
|
|
53
|
-
|
|
54
|
-
```text
|
|
55
|
-
{ "installation_id": 123 }
|
|
56
|
-
// Returns: [{ "name": "alice/my-saas", "private": false, "default_branch": "main", ... }]
|
|
57
|
-
```
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
# Groups 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
|
-
## group-create
|
|
6
|
-
|
|
7
|
-
Create, organize, groups — create a project group to organize related projects under one group with shared members and one shared design theme; the caller becomes the group owner. Owners and editors can manage membership, invites and the shared theme, and delete the group. Project ownership and billing stay with each project’s owner.
|
|
8
|
-
|
|
9
|
-
Returns the new group: `{ id, owner_id, name, description, created_at, updated_at, role: "owner", project_count: 0 }`.
|
|
10
|
-
|
|
11
|
-
**Example:**
|
|
12
|
-
|
|
13
|
-
```json
|
|
14
|
-
{ "name": "marketing-apps", "description": "All public-facing marketing projects" }
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## group-get
|
|
18
|
-
|
|
19
|
-
Group detail, inspect group — get full detail for a group: the group fields plus `projects: [{ id, name, subdomain, status }]`, `members: [{ user_id, role }]`, and `design_tokens` (the shared theme object, `{}` until one is saved). 403 FORBIDDEN if you are not a member. Owners and editors can manage membership, invites and the shared theme, and delete the group. Project ownership and billing stay with each project’s owner.
|
|
20
|
-
|
|
21
|
-
**Example:**
|
|
22
|
-
|
|
23
|
-
```json
|
|
24
|
-
{ "group_id": "grp_abc123" }
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## group-delete
|
|
28
|
-
|
|
29
|
-
Delete a group — available to any group member. Removes the group, its membership and theme; projects in the group are DETACHED, never deleted. Errors: FORBIDDEN (403, no group membership). Owners and editors can manage membership, invites and the shared theme, and delete the group. Project ownership and billing stay with each project’s owner.
|
|
30
|
-
|
|
31
|
-
**Example:**
|
|
32
|
-
|
|
33
|
-
```json
|
|
34
|
-
{ "group_id": "grp_abc123" }
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
## group-add-project
|
|
38
|
-
|
|
39
|
-
Add project to group, organize project — put a project you can edit into a group you belong to. A project belongs to AT MOST ONE group — if it's already in another, returns 409 GROUP_CONFLICT and you must group_remove_project from the old group first. Returns `{ added: true, group_id, project_id }`. Owners and editors can manage membership, invites and the shared theme, and delete the group. Project ownership and billing stay with each project’s owner.
|
|
40
|
-
|
|
41
|
-
**Example:**
|
|
42
|
-
|
|
43
|
-
```json
|
|
44
|
-
{ "group_id": "grp_abc123", "project_id": "e4f2a1b0-..." }
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
## group-remove-project
|
|
48
|
-
|
|
49
|
-
Remove project from group, detach project — pull a project out of a group. Allowed for any group member or anyone with editor access to the project. 404 NOT_IN_GROUP if the project isn't in that group. Returns `{ removed: true, group_id, project_id }`. Owners and editors can manage membership, invites and the shared theme, and delete the group. Project ownership and billing stay with each project’s owner.
|
|
50
|
-
|
|
51
|
-
**Example:**
|
|
52
|
-
|
|
53
|
-
```json
|
|
54
|
-
{ "group_id": "grp_abc123", "project_id": "e4f2a1b0-..." }
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
## group-invite-list
|
|
58
|
-
|
|
59
|
-
List pending group invites, view invites — Any group member can list open invites for a group (not yet accepted, not expired). Returns `{ invites: [{ email, role, invited_at, expires_at }] }`.
|
|
60
|
-
|
|
61
|
-
**Example:**
|
|
62
|
-
|
|
63
|
-
```json
|
|
64
|
-
{ "group_id": "grp_abc123" }
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
## group-invite-accept
|
|
68
|
-
|
|
69
|
-
Accept a group invitation, join group — accept a pending invite using the token from the invite email (`cinv_...`). The CALLER's signed-in account must be the invited email address, with a verified email. On success the caller becomes a group member with the invited role. Returns `{ accepted: true, group_id }`. Errors: EMAIL_NOT_VERIFIED (403, caller's email isn't verified), INVITE_INVALID (404, bad/unknown token), INVITE_USED (409, already accepted), INVITE_EXPIRED (410, past the 7-day window), INVITE_WRONG_ACCOUNT (403, caller is signed in as a different email than was invited), GROUP_NOT_FOUND (404, group was deleted since the invite was sent).
|
|
70
|
-
|
|
71
|
-
**Example:**
|
|
72
|
-
|
|
73
|
-
```json
|
|
74
|
-
{ "group_id": "grp_abc123", "token": "cinv_a1b2c3..." }
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
## group-invite-revoke
|
|
78
|
-
|
|
79
|
-
Revoke group invite, cancel invite — Any group member can revoke a PENDING invite by email (an accepted invite is membership, not an invite — the members list is in group_get). Returns `{ revoked: true }`. 404 NOT_FOUND if there's no pending invite for that email in this group.
|
|
80
|
-
|
|
81
|
-
**Example:**
|
|
82
|
-
|
|
83
|
-
```json
|
|
84
|
-
{ "group_id": "grp_abc123", "email": "teammate@example.com" }
|
|
85
|
-
```
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# Help 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
|
-
## catalog
|
|
6
|
-
|
|
7
|
-
The caller-visible index of available tools. Three reference surfaces have distinct effects: **catalog** lists which tools exist; **docs({ topic })** returns the static contract for one surface; **advisor({ question })** can answer open-ended questions from an authorized live project's state.
|
|
8
|
-
|
|
9
|
-
catalog returns the directory / table of contents / manifest for every tool available to this caller on the active surface, grouped by category with a one-line summary per group: `{ categories: { project: { summary, tools: [...] }, db: { summary, tools: [...] }, ... } }`. Categories cover projects, deploys, database, files, env vars, end-user auth, email (out + inbox), AI (chat + media), jobs, cron, queue, logs, errors, usage, feedback, domains, search, web scraping, push, rate limiting, telegram, analytics, captcha, payments, live updates, render, stock photos, and platform help.
|
|
10
|
-
|
|
11
|
-
**Search:** `search` finds a tool by keyword or exact name — e.g. `catalog({ search: "auth_signup" })`, `catalog({ search: "upload url" })`. Returns matching tools + their group + how to load each. Most tools are not in the default surface, so an empty default tool-search is not evidence that a tool is unavailable.
|
|
12
|
-
|
|
13
|
-
**Lazy-load:** `load` returns FULL tool definitions for one or more groups instead of the index — `catalog({ load: "auth" })`, `catalog({ load: "db,fs" })`, or `load: "all"`. A group-scoped connection (`?groups=db,fs` on the MCP URL, or the `Mcp-Tool-Groups` header) limits a session to the tools it needs.
|
|
14
|
-
|
|
15
|
-
## advisor-start
|
|
16
|
-
|
|
17
|
-
Answers how to build or diagnose something from the current public platform contracts. It takes the question and the facts for the Advisor to use. It cannot read your projects, account, files or earlier conversations, fetch URLs, or call tools, and its answer is advice, not executed actions.
|
|
18
|
-
|
|
19
|
-
The question is recorded with your account. Depending on platform configuration the call either sends the question to the model provider and returns the advice, or saves a durable run and returns its run_id without starting inference; in that case advisor_resume with that run_id starts the inference.
|
|
20
|
-
|
|
21
|
-
## docs
|
|
22
|
-
|
|
23
|
-
The static manual for one platform surface at a time. Returns signatures, examples, common patterns, failure modes, and exact behavior for deploy, sw.db, sw.auth, files, payments, and other primitives. The tool list names verbs; docs defines their contracts.
|
|
24
|
-
|
|
25
|
-
This is the static manual; `advisor({ question })` provides tailored advice from supplied facts, and `catalog` lists available tools.
|
|
26
|
-
|
|
27
|
-
Returns a bounded summary by default: the read-first sections plus an id index of every section. The first line reports `view` and `complete=true|false`. `section` returns one section, and `detail: "full"` the complete topic.
|
|
28
|
-
|
|
29
|
-
Core topics include adopt, analytics, api-surface, app-mcp, architecture-patterns, auth-client, billing, browser, calendar, changes, cli, common-mistakes, connect-agent, cors, cron, database-engine, declared-data, declared-files, deploy, deploy-intelligence, design-system, dev-environments, domain-ownership, domains, feedback, file-tools, functions, getting-started, github, google-calendar, guarantees, handled-for-you, inspect, limits, live, live-data, local-dev, migration-supabase, payments, portability, postgres, pricing, pricing-comparison, project-groups, projects, recipe-ai-agent, recipe-ai-features, recipe-ai-receipts, recipe-background-jobs, recipe-booking, recipe-csv-import, recipe-ecommerce, recipe-email, recipe-escalation, recipe-file-uploads, recipe-import-app, recipe-login, recipe-multi-chat, recipe-paid-api, recipe-pdfs, recipe-push-notifications, recipe-seo, recipe-signed-in-app, render, rooms, sdk, sdks, search, security-model, setup, smoke, speed, sql-compatibility, sw.agent, sw.ai, sw.auth, sw.billing, sw.db, sw.email, sw.endpoint, sw.env, sw.fetch, sw.fs, sw.groups, sw.image, sw.jobs, sw.logs, sw.mail, sw.notifications, sw.push, sw.rateLimit, sw.web, tasks, test, troubleshooting, typed-functions, verify-before-deploy, vs-supabase, vs-vercel. Aliases such as fetch/http/outbound and ctx.* names also resolve. Unknown topics return the current canonical list, including tool reference topics. Example: `{ "topic": "sw.fetch" }`, then `{ "topic": "sw.fetch", "section": "<id>" }`.
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
# Jobs 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
|
-
## job-create
|
|
6
|
-
|
|
7
|
-
**Will work outlive the user request, need retries, or need a status later?** `job_create` queues a durable background job. The platform POSTs the payload to your handler URL and retries on failure (at-least-once, up to 5 attempts with exponential backoff). Handlers are expected to be idempotent.
|
|
8
|
-
|
|
9
|
-
It suits work that should not block a user request: image processing, report generation, outbound email batches, webhook deliveries. `run_at` with an ISO-8601 time and explicit time zone schedules a future start. The job reports `scheduled` while waiting and reserves a slot in the account's job limit; cancel it to free that slot. It starts at or after that time.
|
|
10
|
-
|
|
11
|
-
**Example:**
|
|
12
|
-
|
|
13
|
-
Example transcript or fragment
|
|
14
|
-
|
|
15
|
-
```text
|
|
16
|
-
{
|
|
17
|
-
"project_id": "my-saas",
|
|
18
|
-
"handler": "https://my-saas.somewhere.site/api/jobs/process-upload",
|
|
19
|
-
"payload": { "upload_id": "u123", "user_id": "u_alice" },
|
|
20
|
-
"timeout_seconds": 600
|
|
21
|
-
}
|
|
22
|
-
// Returns: { "job_id": "j_abc", "status": "queued" }
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## job-get
|
|
26
|
-
|
|
27
|
-
Get background job details. A `job_id` returns one job; `project_id` (without job_id) lists recent jobs. Optionally filter by status.
|
|
28
|
-
|
|
29
|
-
**Example:**
|
|
30
|
-
|
|
31
|
-
Example transcript or fragment
|
|
32
|
-
|
|
33
|
-
```text
|
|
34
|
-
// Single job:
|
|
35
|
-
{ "project_id": "my-saas", "job_id": "j_abc" }
|
|
36
|
-
|
|
37
|
-
// List recent:
|
|
38
|
-
{ "project_id": "my-saas", "status": "failed" }
|
|
39
|
-
```
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
# Live 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
|
-
## events-subscribe-project
|
|
6
|
-
|
|
7
|
-
Get the connection recipe for the project's system channel. The platform automatically pushes lifecycle events to this channel — deploys, quota warnings, database health, and auth admin actions. Reconnect when the connection closes with code 4001 (reauthorize); each connection rechecks your current access. Resume with the last received sequence in the since query parameter.
|
|
8
|
-
|
|
9
|
-
Event shapes the channel emits (`event` field on the WebSocket envelope):
|
|
10
|
-
|
|
11
|
-
- `deployed` / `patched` / `restored` / `rolled_back` — `{ version, by, message, has_functions, at }`. Multi-editor conflict prevention: if you're holding a write, see a version bump, pull before pushing.
|
|
12
|
-
- `db_health` — `{ event: "cpu_exhaust_recovered" | "cpu_exhaust_failed", query_fingerprint, at }`. Fires when the platform retried a slow query for the user.
|
|
13
|
-
- `quota_warning` — `{ resource: "storage" | "database" | "email" | "realtime" | "ai", usage_percent, message, at }`. Fires once per resource per 80%/95% crossing per month.
|
|
14
|
-
- `auth_event` — `{ event: "user_deleted" | "user_banned" | "user_unbanned" | "impersonation_started" | "impersonation_ended", user_id, actor_id, at }`.
|
|
15
|
-
|
|
16
|
-
**Example:**
|
|
17
|
-
|
|
18
|
-
Example transcript or fragment
|
|
19
|
-
|
|
20
|
-
```text
|
|
21
|
-
{ "project_id": "my-saas" }
|
|
22
|
-
// Returns:
|
|
23
|
-
// {
|
|
24
|
-
// "channel": "system:project",
|
|
25
|
-
// "websocket_url": "wss://api.somewhere.cloud/v1/events/subscribe?project_id=my-saas&channel=system:project&token=smt_...",
|
|
26
|
-
// "event_types": ["deployed", "patched", "restored", "rolled_back", "db_health", "quota_warning", "auth_event"]
|
|
27
|
-
// }
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
## events-subscribe-user
|
|
31
|
-
|
|
32
|
-
Get the connection recipe for the caller's personal system channel. The platform pushes user-scoped events here that aren't tied to one project — currently `feedback_resolved` when the platform team responds to or resolves a `support_ticket` ticket.
|
|
33
|
-
|
|
34
|
-
Auth: developer smt_ key only. The channel is bound to the caller's own user id — there is no cross-user subscribe. Reconnect on close code 4001 (reauthorize), passing the last received sequence in the since query parameter; the new connection checks your current access.
|
|
35
|
-
|
|
36
|
-
**Example:**
|
|
37
|
-
|
|
38
|
-
Example transcript or fragment
|
|
39
|
-
|
|
40
|
-
```text
|
|
41
|
-
{}
|
|
42
|
-
// Returns:
|
|
43
|
-
// {
|
|
44
|
-
// "channel": "system:user",
|
|
45
|
-
// "websocket_url": "wss://api.somewhere.cloud/v1/events/subscribe-user?token=smt_...",
|
|
46
|
-
// "event_types": ["feedback_resolved"]
|
|
47
|
-
// }
|
|
48
|
-
```
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
# Logs 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
|
-
## errors
|
|
6
|
-
|
|
7
|
-
Why is my app broken, exceptions, stack traces, failures, recent errors, crash reports, debugging. One trace_id returns the complete ordered parent/child operation waterfall plus its correlated logs, errors, deploy failures, and journey events. No project lookup is required for that one-id path. Without a trace id, project_id returns the last 24h of failures from that project's functions. Each row carries `kind`: "exception" means nobody chose the outcome (an uncaught throw, or a 5xx) and "refusal" means a handler answered 4xx on purpose — a 401 from your own auth gate is a refusal, not a bug, and `kind` separates the two.
|
|
8
|
-
|
|
9
|
-
**Example:**
|
|
10
|
-
|
|
11
|
-
Example transcript or fragment
|
|
12
|
-
|
|
13
|
-
```text
|
|
14
|
-
{ "project_id": "my-saas", "limit": 20 }
|
|
15
|
-
// Returns: [{ "timestamp": "2026-04-20T...", "path": "/api/users/signup", "status": 500, "message": "UNIQUE constraint failed: users.email" }, ...]
|
|
16
|
-
```
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
# Payments 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
|
-
## payments-onboard
|
|
6
|
-
|
|
7
|
-
Start Stripe Connect onboarding for the developer (per-account, not per-project — onboard once and every project you own uses the same connected account). `mode` picks which account: `live` (the default) returns a URL the developer visits to set up identity, bank, and tax info for live charges, which then settle to their connected account with Stripe's standard processing fee deducted; `test` sets up a test-mode connected account (no real charges). The response carries the current platform fee so the onboarding UI can show it.
|
|
8
|
-
|
|
9
|
-
**Building starts without this.** Test-mode checkouts work immediately — payments_checkout in dev mode runs on the platform's own Stripe test account (no Connect destination, no fee) until you onboard, so card 4242 4242 4242 4242 succeeds with no setup. Test onboarding is only for exercising your own connected test account.
|
|
10
|
-
|
|
11
|
-
A test response is `{ mode: 'test', test_only: true, charges_enabled, checkout_ready, onboarding_url, expires_at }`. When the test account is already ready, `onboarding_url` and `expires_at` are null and there is nothing to visit; otherwise visit the URL to finish it.
|
|
12
|
-
|
|
13
|
-
**Example:**
|
|
14
|
-
|
|
15
|
-
Example transcript or fragment
|
|
16
|
-
|
|
17
|
-
```text
|
|
18
|
-
{ "mode": "test", "return_url": "https://my-app.somewhere.site/done", "refresh_url": "https://my-app.somewhere.site/retry" }
|
|
19
|
-
// Returns: { "mode": "test", "test_only": true, "checkout_ready": false, "onboarding_url": "https://connect.stripe.com/setup/...", "expires_at": "..." }
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## payments-status
|
|
23
|
-
|
|
24
|
-
Get the caller's Stripe Connect status: connected, onboarded, charges_enabled, payouts_enabled, details_submitted. Per-account (not per-project). refresh=true forces a live Stripe API lookup (otherwise returns the last-cached DB state).
|
|
25
|
-
|
|
26
|
-
## payments-checkout
|
|
27
|
-
|
|
28
|
-
Create a Stripe Checkout Session for a project. Once the project owner has onboarded, funds settle to their connected account; the response's fee_percent is the platform fee on the session (current rate at /v1/pricing) and Stripe's standard processing fee also applies. Before onboarding, env='dev' checkouts run on the platform's own Stripe test account with no Connect destination — the response includes is_stand_in: true and platform_fee_cents: 0 so card 4242 4242 4242 4242 succeeds end-to-end. env='prod' returns 412 until the owner finishes onboarding. Supports mode='payment' | 'subscription'.
|
|
29
|
-
|
|
30
|
-
Three payment bases (exactly one per call): line_items (ad-hoc), quote_id (a stored quote from a payments quote — server supplies the amount; one-time only, and may compose with calendar_hold_token + booking_id for an atomic booking checkout), or plan (a catalog plan slug — the <PricingTable>/sw.billing subscribe path).
|
|
31
|
-
|
|
32
|
-
Plan tracking: a developer may pass metadata={"app_user_id":"<id>","plan":"<slug>"}; app functions use sw.payments.checkoutForUser for their verified signed-in user. The platform binds the user, price, payment account and test/live mode before checkout, then verifies the payment before granting the selected plan. Live subscriptions keep access during payment retries and lose it when unpaid, paused, canceled or expired. Test purchases are recorded separately and never unlock live access; auth and billing readers currently show live access only. Redeploy older apps normally to enable the runtime user proof. Historical or unmatched payments require reconciliation; metadata alone never grants a plan.
|
|
33
|
-
|
|
34
|
-
## payments-transactions
|
|
35
|
-
|
|
36
|
-
List recent charges on the project owner's connected account. Returns Stripe's native cursor pagination — `starting_after` set to the previous response's `next_cursor` fetches the next page. Default page size 20, max 100. env=prod lists live-mode charges; default env=dev lists test-mode.
|
|
37
|
-
|
|
38
|
-
## payments-portal
|
|
39
|
-
|
|
40
|
-
Create a Stripe Billing Portal session for an app user. The platform resolves the stored Stripe customer for `app_user_id` server-side; raw Stripe customer ids are not accepted by this tool. Returns a short-lived URL to redirect to.
|
|
41
|
-
|
|
42
|
-
## payments-events
|
|
43
|
-
|
|
44
|
-
Paginated feed of Stripe webhook events the platform received for this project (from the payments_events ledger). It can drive an in-product activity feed or confirm webhook reception during integration. The webhook handler is idempotent — duplicate Stripe redeliveries appear once.
|