@somewhere-cloud/cli 0.38.153 → 0.38.155
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 +11 -0
- package/dist/docs/adopt.md +39 -0
- package/dist/docs/analytics.md +161 -0
- package/dist/docs/api-reference.md +339 -0
- package/dist/docs/api-surface.md +2067 -0
- package/dist/docs/app-mcp.md +162 -0
- package/dist/docs/architecture-patterns.md +334 -0
- package/dist/docs/auth-client.md +531 -0
- package/dist/docs/billing.md +76 -0
- package/dist/docs/browser.md +639 -0
- package/dist/docs/calendar.md +298 -0
- package/dist/docs/changes.md +323 -0
- package/dist/docs/cli.md +407 -0
- package/dist/docs/common-mistakes.md +199 -0
- package/dist/docs/connect-agent.md +72 -0
- package/dist/docs/cors.md +114 -0
- package/dist/docs/cron.md +167 -0
- package/dist/docs/database-engine.md +167 -0
- package/dist/docs/declared-data.md +1656 -0
- package/dist/docs/declared-files.md +475 -0
- package/dist/docs/deploy-intelligence.md +188 -0
- package/dist/docs/deploy.md +733 -0
- package/dist/docs/design-system.md +273 -0
- package/dist/docs/dev-environments.md +496 -0
- package/dist/docs/domain-ownership.md +31 -0
- package/dist/docs/domains.md +370 -0
- package/dist/docs/feedback.md +88 -0
- package/dist/docs/file-tools.md +116 -0
- package/dist/docs/functions.md +489 -0
- package/dist/docs/getting-started.md +238 -0
- package/dist/docs/github.md +95 -0
- package/dist/docs/google-calendar.md +212 -0
- package/dist/docs/groups.md +836 -0
- package/dist/docs/guarantees.md +58 -0
- package/dist/docs/handled-for-you.md +224 -0
- package/dist/docs/inspect.md +171 -0
- package/dist/docs/limits.md +68 -0
- package/dist/docs/live-data.md +197 -0
- package/dist/docs/live.md +92 -0
- package/dist/docs/local-dev.md +30 -0
- package/dist/docs/migration-supabase.md +58 -0
- package/dist/docs/payments.md +1102 -0
- package/dist/docs/portability.md +194 -0
- package/dist/docs/postgres.md +301 -0
- package/dist/docs/pricing-comparison.md +42 -0
- package/dist/docs/pricing.md +39 -0
- package/dist/docs/project-groups.md +107 -0
- package/dist/docs/projects.md +380 -0
- package/dist/docs/recipe-ai-agent.md +112 -0
- package/dist/docs/recipe-ai-features.md +227 -0
- package/dist/docs/recipe-ai-receipts.md +783 -0
- package/dist/docs/recipe-background-jobs.md +369 -0
- package/dist/docs/recipe-booking.md +348 -0
- package/dist/docs/recipe-csv-import.md +390 -0
- package/dist/docs/recipe-ecommerce.md +127 -0
- package/dist/docs/recipe-email.md +282 -0
- package/dist/docs/recipe-escalation.md +133 -0
- package/dist/docs/recipe-file-uploads.md +159 -0
- package/dist/docs/recipe-import-app.md +110 -0
- package/dist/docs/recipe-login.md +457 -0
- package/dist/docs/recipe-multi-chat.md +198 -0
- package/dist/docs/recipe-paid-api.md +161 -0
- package/dist/docs/recipe-pdfs.md +205 -0
- package/dist/docs/recipe-push-notifications.md +107 -0
- package/dist/docs/recipe-seo.md +200 -0
- package/dist/docs/recipe-signed-in-app.md +330 -0
- package/dist/docs/render.md +99 -0
- package/dist/docs/rooms.md +554 -0
- package/dist/docs/sdk.md +287 -0
- package/dist/docs/sdks.md +24 -0
- package/dist/docs/search.md +199 -0
- package/dist/docs/security-model.md +168 -0
- package/dist/docs/setup.md +212 -0
- package/dist/docs/smoke.md +102 -0
- package/dist/docs/speed.md +298 -0
- package/dist/docs/sql-compatibility.md +96 -0
- package/dist/docs/sw.agent.md +248 -0
- package/dist/docs/sw.ai.md +1291 -0
- package/dist/docs/sw.auth.md +1811 -0
- package/dist/docs/sw.billing.md +171 -0
- package/dist/docs/sw.db.md +2128 -0
- package/dist/docs/sw.email.md +661 -0
- package/dist/docs/sw.endpoint.md +187 -0
- package/dist/docs/sw.env.md +303 -0
- package/dist/docs/sw.fetch.md +115 -0
- package/dist/docs/sw.fs.md +424 -0
- package/dist/docs/sw.groups.md +836 -0
- package/dist/docs/sw.image.md +69 -0
- package/dist/docs/sw.jobs.md +520 -0
- package/dist/docs/sw.logs.md +61 -0
- package/dist/docs/sw.mail.md +106 -0
- package/dist/docs/sw.notifications.md +78 -0
- package/dist/docs/sw.push.md +161 -0
- package/dist/docs/sw.rateLimit.md +67 -0
- package/dist/docs/sw.web.md +128 -0
- package/dist/docs/tasks.md +269 -0
- package/dist/docs/test.md +220 -0
- package/dist/docs/tool-reference-account.md +7 -0
- package/dist/docs/tool-reference-ai.md +121 -0
- package/dist/docs/tool-reference-analytics.md +37 -0
- package/dist/docs/tool-reference-api.md +19 -0
- package/dist/docs/tool-reference-artifacts.md +35 -0
- package/dist/docs/tool-reference-auth.md +163 -0
- package/dist/docs/tool-reference-browser.md +114 -0
- package/dist/docs/tool-reference-code.md +26 -0
- package/dist/docs/tool-reference-connect.md +21 -0
- package/dist/docs/tool-reference-cron.md +48 -0
- package/dist/docs/tool-reference-db.md +282 -0
- package/dist/docs/tool-reference-domains.md +107 -0
- package/dist/docs/tool-reference-email.md +55 -0
- package/dist/docs/tool-reference-env.md +19 -0
- package/dist/docs/tool-reference-feedback.md +56 -0
- package/dist/docs/tool-reference-fs.md +265 -0
- package/dist/docs/tool-reference-github.md +57 -0
- package/dist/docs/tool-reference-groups.md +85 -0
- package/dist/docs/tool-reference-help.md +29 -0
- package/dist/docs/tool-reference-jobs.md +39 -0
- package/dist/docs/tool-reference-live.md +48 -0
- package/dist/docs/tool-reference-logs.md +16 -0
- package/dist/docs/tool-reference-payments.md +44 -0
- package/dist/docs/tool-reference-project.md +706 -0
- package/dist/docs/tool-reference-push.md +78 -0
- package/dist/docs/tool-reference-rate-limit.md +18 -0
- package/dist/docs/tool-reference-search.md +68 -0
- package/dist/docs/tool-reference-security.md +42 -0
- package/dist/docs/tool-reference-smoke.md +17 -0
- package/dist/docs/tool-reference-stock-photos.md +20 -0
- package/dist/docs/tool-reference-tasks.md +73 -0
- package/dist/docs/tool-reference-telegram.md +32 -0
- package/dist/docs/tool-reference-usage.md +9 -0
- package/dist/docs/tool-reference-web.md +71 -0
- package/dist/docs/tool-reference-webhooks.md +9 -0
- package/dist/docs/troubleshooting.md +411 -0
- package/dist/docs/typed-functions.md +94 -0
- package/dist/docs/verify-before-deploy.md +67 -0
- package/dist/docs/vs-supabase.md +75 -0
- package/dist/docs/vs-vercel.md +103 -0
- package/dist/lib/bundle.js +303 -221
- package/dist/lib/bundle.js.map +3 -3
- package/dist/types/lib/test-session.d.ts +8 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +3 -2
- package/runtime/DECLARED-DATA-VENDOR.json +5 -5
- package/runtime/PLATFORM-SOURCE.json +1 -1
- package/runtime/SOURCE-LINT-VENDOR.json +2 -2
- package/runtime/declared-data.cjs +37 -19
- package/runtime/source-lint.cjs +1 -1
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
# Db 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
|
+
## db-describe
|
|
6
|
+
|
|
7
|
+
Schema inspection, list tables, show schema, table structure, columns, types — describe the project database. With no table argument, lists visible managed and raw table names with table_planes metadata. Omitted plane prefers a declared managed table; plane:"raw" inspects a same-name raw table. With a table name, returns its column names, types, constraints, and row count.
|
|
8
|
+
|
|
9
|
+
**Example:**
|
|
10
|
+
|
|
11
|
+
Example transcript or fragment
|
|
12
|
+
|
|
13
|
+
```text
|
|
14
|
+
// List all tables:
|
|
15
|
+
{ "project_id": "my-saas" }
|
|
16
|
+
|
|
17
|
+
// Describe one table:
|
|
18
|
+
{ "project_id": "my-saas", "table": "users" }
|
|
19
|
+
// Returns: [{ "name": "id", "type": "TEXT", "pk": true }, { "name": "email", "type": "TEXT", "notnull": true }, ...]
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## db-query
|
|
23
|
+
|
|
24
|
+
SQL query, run SQL, SELECT, INSERT, UPDATE, DELETE, execute SQL against the project database — the read/write-ROWS entry point. A documented Postgres-flavored syntax subset is translated; the default database keeps its own expression, typing, comparison, and ordering semantics. For example, division by zero returns NULL rather than throwing. The database is created on first use, but tables are not — new projects declare them in `db/schema.ts` and deploy raw source; db_migrate is for SQL-mode projects. Raw SQL reaches the project's raw SQL database only; on a project that keeps its tables in the managed database, rows are read with db_browse (plane: "managed"), schema with db_describe, and writes go through sw.db in functions.
|
|
25
|
+
|
|
26
|
+
Schema changes (CREATE / ALTER / DROP) belong in `db/schema.ts` plus deploy for managed projects, or db_migrate for SQL-mode projects, not here, and not inline in a deployed function's handler: runtime DDL runs on every request, isn't versioned, and hides new tables from the platform's per-user data protections (a table with an owner_id/user_id column is cross-user readable until it's scoped). db_query is for the rows.
|
|
27
|
+
|
|
28
|
+
Every successful query returns `{ data: [], count: N, changes: N, last_row_id: X }`: `data` contains returned rows, `count` counts those rows, and `changes` counts affected rows. A write without RETURNING has empty `data` and a zero `count` even when it changes rows. `last_row_id` is a number, an exact decimal integer string when the ID exceeds JavaScript’s safe integer range, or null; other transport metadata may also be present.
|
|
29
|
+
|
|
30
|
+
**Example:**
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
{
|
|
34
|
+
"project_id": "my-saas",
|
|
35
|
+
"sql": "SELECT id, email FROM users WHERE created_at > ? ORDER BY created_at DESC LIMIT 20",
|
|
36
|
+
"params": [1704067200]
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
The database has a 30-second hard query ceiling. `timeout_ms` bounds how long this call waits (default 30000, max 30000) and returns QUERY_TIMEOUT; it does not promise cancellation of work already accepted by the database.
|
|
41
|
+
|
|
42
|
+
## db-batch
|
|
43
|
+
|
|
44
|
+
Run multiple SQL statements as a single atomic transaction. Every statement commits together, or none do — a single failure rolls the entire batch back. Suited to any logical operation that spans more than one write (account deletion across multiple tables, moving money between rows, denormalized counters). Max 1000 statements per call.
|
|
45
|
+
|
|
46
|
+
Each statement returns its own `{ rows, count, changes, last_row_id }` in `results[i]` matching the order you passed in.
|
|
47
|
+
|
|
48
|
+
**Example (account deletion):**
|
|
49
|
+
|
|
50
|
+
```json
|
|
51
|
+
{
|
|
52
|
+
"project_id": "my-saas",
|
|
53
|
+
"statements": [
|
|
54
|
+
{ "sql": "UPDATE accounts SET status = 'deleted' WHERE id = ?", "params": ["u_abc"] },
|
|
55
|
+
{ "sql": "DELETE FROM sessions WHERE user_id = ?", "params": ["u_abc"] },
|
|
56
|
+
{ "sql": "DELETE FROM posts WHERE author_id = ?", "params": ["u_abc"] }
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## db-migrate
|
|
62
|
+
|
|
63
|
+
Run explicit SQL schema migrations for SQL-mode projects. New projects use declared data: define tables and access rules in `db/schema.ts` and deploy raw source; db_migrate does not create their tables. docs({ topic: 'declared-data', section: 'declare-a-table-and-use-it' }) has a complete example. Managed projects refuse DDL with SCHEMA_LOCKED and apply no SQL.
|
|
64
|
+
|
|
65
|
+
For SQL-mode projects, CREATE TABLE, ALTER TABLE, CREATE INDEX and DROP are supported; multiple statements may be separated by `;`. Explicit preview targeting changes only that preview database. Developer-only — app-user JWTs are rejected.
|
|
66
|
+
|
|
67
|
+
## db-migrate-connector
|
|
68
|
+
|
|
69
|
+
Run a SQL schema migration for a SQL-mode project. New projects declare tables in db/schema.ts and deploy raw source; docs declared-data, section declare-a-table-and-use-it, has the example. Managed-project DDL is refused without applying SQL.
|
|
70
|
+
|
|
71
|
+
## db-import
|
|
72
|
+
|
|
73
|
+
Bring an existing database table under schema management — introspect a table you already have and GENERATE its `db/schema.ts` entry so a deploy can manage it. Read-only: it proposes an entry you paste into db/schema.ts and deploy; the deploy is what adopts the table (never a hidden change).
|
|
74
|
+
|
|
75
|
+
The generated entry preserves the table's shape faithfully — column types, single-column primary key, indexes, unique constraints, auto-timestamp defaults, and (for a per-user table) its owner column as `owner({ column })`. A composite primary key, a view, a triggered table, or a column type the managed schema can't represent is refused with a plain fix-it. A column whose stored values don't match its declared type is loosened and reported, never silently changed.
|
|
76
|
+
|
|
77
|
+
`with` imports several related tables at once so a foreign key between them can be represented.
|
|
78
|
+
|
|
79
|
+
**Example:**
|
|
80
|
+
|
|
81
|
+
```json
|
|
82
|
+
{
|
|
83
|
+
"project_id": "my-saas",
|
|
84
|
+
"table": "products"
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## db-import-csv
|
|
89
|
+
|
|
90
|
+
Import CSV data into a database table. If the table doesn't exist and `create_table` is true, it will be created with column types inferred from the data (INTEGER / REAL / TEXT). Headers in the CSV become column names.
|
|
91
|
+
|
|
92
|
+
Inline CSV strings are capped at 5 MB. Larger files are uploaded to `/v1/fs` first and passed by filepath.
|
|
93
|
+
The import saves rows in batches. If a batch fails, the error gives the number of rows already imported and the CSV line to resume from. Keep the header and import only the remaining rows. If the error says a write could not be confirmed, check the table before trying again.
|
|
94
|
+
|
|
95
|
+
**Example:**
|
|
96
|
+
|
|
97
|
+
```json
|
|
98
|
+
{
|
|
99
|
+
"project_id": "my-saas",
|
|
100
|
+
"table": "products",
|
|
101
|
+
"csv": "name,price\nWidget,9.99\nGadget,19.99",
|
|
102
|
+
"create_table": true
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## db-browse
|
|
107
|
+
|
|
108
|
+
Browse rows in a database table with pagination, sorting, and filtering. Inspects data without writing SQL.
|
|
109
|
+
|
|
110
|
+
Filters use the same operators as db_query: `eq`, `neq`, `gt`, `gte`, `lt`, `lte`, `like`, `ilike`, `is`, `not`.
|
|
111
|
+
|
|
112
|
+
**Example:**
|
|
113
|
+
|
|
114
|
+
```json
|
|
115
|
+
{
|
|
116
|
+
"project_id": "my-saas",
|
|
117
|
+
"table": "users",
|
|
118
|
+
"limit": 10,
|
|
119
|
+
"order_by": "created_at",
|
|
120
|
+
"order": "desc",
|
|
121
|
+
"filters": [{ "column": "email_verified", "op": "eq", "value": true }]
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## db-export
|
|
126
|
+
|
|
127
|
+
Export a database table as CSV. Returns the CSV content as a string. Filters export a subset (same shape as db_browse). Capped at 100,000 rows — filters cover larger tables.
|
|
128
|
+
|
|
129
|
+
**Example:**
|
|
130
|
+
|
|
131
|
+
```json
|
|
132
|
+
{ "project_id": "my-saas", "table": "users" }
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## db-dump
|
|
136
|
+
|
|
137
|
+
Full SQL dump of the project's database — schema (CREATE TABLE / INDEX / TRIGGER) + every row as INSERT statements. The output is standard SQL you can pipe into any SQL database client to restore, or migrate to Postgres via `pgloader`.
|
|
138
|
+
|
|
139
|
+
Returns the raw .sql file as a string. One call gives you the complete raw SQL database's schema and rows to take anywhere. A project that keeps its tables in the managed database has no raw SQL database to dump (RAW_DATABASE_NOT_READY); its managed rows are read with db_browse (plane: "managed") and their schema and row counts with db_describe.
|
|
140
|
+
|
|
141
|
+
Table access declarations and sensitive-column marks are platform policy, not SQL. Their labels travel as comment lines in the SQL preamble and, parsed, as `excluded_security_policy.policies` (labels only, never applied by a SQL restore); a warning appears only when the list is non-empty. `policies: []` on a successful capture means no table-access declarations were found in this capture — it does not establish that access is safe or preserve your application's authorization, and member join definitions and handler authorization are outside that list. After restoring, redeploy `db/schema.ts` (access rules are set there and take effect on deploy), then verify with `db_scope_list`.
|
|
142
|
+
|
|
143
|
+
`excluded_security_policy.capture` (v1) is the capture receipt, carrying identity, hashes and times only: canonical `project_id` and `database_id` (the top-level `project_id` echoes your reference), `sql_sha256` / `schema_sha256` / `policy_sha256`, and `policy_observed_at`, `data_observation_started_at`, `data_observation_completed_at`, `binding_checked_at`. The hashes detect changed bytes against metadata you retain; they are not a signature, not provenance, and not a cross-store snapshot. Matching binding checks before and after mean the same project, owner and database were observed; they do not exclude a change in between. When capture metadata is present but malformed, or its SQL or policy hash does not match, this tool returns `DUMP_INTEGRITY_UNCONFIRMED` (502) and no SQL. An absent `capture` (an older API during a rolling release) means no capture-integrity evidence; the informational policy labels may still be present.
|
|
144
|
+
|
|
145
|
+
Refusals, never a partial file: `DATABASE_NOT_INITIALIZED` (409 — the dump never creates a database), `DUMP_SOURCE_CHANGED` (409), `DUMP_SCHEMA_CHANGED` (409), `DUMP_POLICY_INVALID` (422), `DUMP_UNSUPPORTED_SCHEMA` (422), `DUMP_ROW_LIMIT_EXCEEDED` (413, above 1,000,000 rows in a table — no truncation and no streaming export; narrow with `db_export_csv` filters), `DUMP_CAPTURE_LIMIT_EXCEEDED` (413), `DUMP_POLICY_UNAVAILABLE` (503), `DUMP_CAPTURE_UNCONFIRMED` (503), `DUMP_SCHEMA_UNAVAILABLE` (503), `PROJECT_ACCESS_DENIED` (403).
|
|
146
|
+
|
|
147
|
+
**Example:**
|
|
148
|
+
|
|
149
|
+
Example transcript or fragment
|
|
150
|
+
|
|
151
|
+
```text
|
|
152
|
+
{ "project_id": "my-saas" }
|
|
153
|
+
// Returns the full .sql as text — write it to disk and you're portable.
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## db-scope-list
|
|
157
|
+
|
|
158
|
+
List the table scopes a project has on record (`scopes`: recorded declarations, which a deploy that did not complete can leave behind) beside `live_rules`, the rules the live version actually serves, plus tables that LOOK like per-user data (a user_id/owner_id-style column) with no scope on record. An entry in `unscoped_user_tables` is a finding to inspect under the table's actual access contract, not a verdict: on a managed project the contract is the table's declaration in `db/schema.ts` (and structured queries on an undeclared table are refused, not run unscoped); on a SQL-mode project it is the previously recorded declaration, and raw SQL in server functions is unscoped by design. Developer-only.
|
|
159
|
+
|
|
160
|
+
**Example:**
|
|
161
|
+
|
|
162
|
+
Example transcript or fragment
|
|
163
|
+
|
|
164
|
+
```text
|
|
165
|
+
{ "project_id": "my-saas" }
|
|
166
|
+
// Returns: { "scopes": [{ "table": "bookings", "owner_column": "user_id", "intent": "scoped", ... }], "unscoped_user_tables": [{ "table": "notes", "owner_column": "user_id" }] }
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## db-explain-access
|
|
170
|
+
|
|
171
|
+
Explain whether one app user of your project may read, update or delete one existing row of a declared table right now, and which declared rule link decides it. For a table declared with `allOf(gate, who)`, `create` is also explained, for a new row in the named row's group: create authority comes from the gate's create roles alone. The answer comes from the same access rules and active release the app enforces, read live. It names declared tables and columns only, never row values or other users' memberships. Developer-only; the project must be one you can edit.
|
|
172
|
+
|
|
173
|
+
Reasons: ROW_NOT_FOUND, SUBJECT_NOT_ELIGIBLE (no such signed-up, unbanned user in this project), PARENT_MISSING, NOT_OWNER, NOT_A_MEMBER, NOT_OWNER_OR_MEMBER, NOT_OWNER_OR_GROUP_MEMBER, NOT_OWNER_OR_GROUP_ROLE, NOT_OWNER_OR_APP_ROLE, OWNER_NOT_A_MEMBER (owns an anyOf(owner(), member()|group()) row but is no longer in its group: team rows belong to the team), OPERATION_NOT_GRANTED, GROUP_ROLE_NOT_ALLOWED, APP_ROLE_NOT_HELD, GROUP_POLICY_CHANGED, and for allOf GATE_DENIED (the gate refused: not a current member, or no role for the operation) or WHO_DENIED (a current member who is not the row's owner, nor allowed by the who slot's role). If the access check cannot run, the answer is AUTHORITY_UNAVAILABLE (retry), never a denial.
|
|
174
|
+
|
|
175
|
+
**Example:**
|
|
176
|
+
|
|
177
|
+
Example transcript or fragment
|
|
178
|
+
|
|
179
|
+
```text
|
|
180
|
+
{ "project_id": "my-trips", "table": "expenses", "id": 42, "operation": "update", "user": "usr_123" }
|
|
181
|
+
// Returns: { "allowed": false, "chain": [{ "table": "expenses", "rule": "parent", "via": "trip_id" }, { "table": "trips", "rule": "group" }], "reason": { "code": "GROUP_ROLE_NOT_ALLOWED", "table": "trips", ... } }
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
## db-bookmark-create
|
|
185
|
+
|
|
186
|
+
Record a named marker around a database migration. It is operational evidence, not an undo point: in-place database restore is unavailable. db_dump or db_export creates a recoverable copy. Reusing a label overwrites the previous marker.
|
|
187
|
+
|
|
188
|
+
**Example:**
|
|
189
|
+
|
|
190
|
+
```json
|
|
191
|
+
{ "project_id": "my-saas", "label": "before-migration-v3" }
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
## db-webhook-set
|
|
195
|
+
|
|
196
|
+
Register an HTTPS endpoint to receive database change notifications for this project. Fires after a successful INSERT / UPDATE / UPSERT / DELETE through db_query — one POST per mutation, no row contents.
|
|
197
|
+
|
|
198
|
+
The first call generates a per-project secret you'll see in the response (`secret`). Subsequent calls update the URL or event filter and return the same secret. The incoming `X-Somewhere-Signature: t={ms},v1={hex}` header verifies by recomputing `HMAC-SHA256(secret, "{ms}." + rawBody)`.
|
|
199
|
+
|
|
200
|
+
**Example:**
|
|
201
|
+
|
|
202
|
+
```json
|
|
203
|
+
{ "project_id": "my-saas", "url": "https://example.com/db-hook", "events": ["insert", "update"] }
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
## postgres-status
|
|
207
|
+
|
|
208
|
+
Read the project's attached Postgres database without changing it. Never returns a key or connection string.
|
|
209
|
+
|
|
210
|
+
- `view: "attachment"` (default): connection state plus `credentials` — `{ stored, separated, migration_role, runtime_role, login_verified_at, privileges_verified_at, setup_role, setup_started_at, revision, generation, verified_now: false }`. Timestamps record the last successful check; they do not prove the current database state.
|
|
211
|
+
- `view: "migrations"` + `target`: the migration ledger, `{ target, migrations: [{ name, checksum, state: "applying" | "applied" | "failed", applied_at }] }`. `applying` means the outcome is unresolved and blocks later migrations.
|
|
212
|
+
- `view: "preview"`: the project's preview database, or an error when none has been created.
|
|
213
|
+
|
|
214
|
+
```json
|
|
215
|
+
{ "project_id": "my-app", "view": "migrations", "target": "production" }
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
## postgres-migrate
|
|
219
|
+
|
|
220
|
+
Apply ONE native PostgreSQL migration file to the attached database. Owner only; requires separated credentials (`postgres_credentials_separate`).
|
|
221
|
+
|
|
222
|
+
The SQL is run exactly as given — never split or rewritten — inside a transaction the platform opens, so it must not contain BEGIN, COMMIT or ROLLBACK. Maximum 1 MB. The ledger stores a SHA-256 checksum per name:
|
|
223
|
+
- same name + same SQL already applied → returns the recorded receipt, runs nothing;
|
|
224
|
+
- same name + different SQL already applied → refused (`POSTGRES_MIGRATION_CHANGED`), so changed SQL takes a new name;
|
|
225
|
+
- a failed file was rolled back and may be corrected and applied again;
|
|
226
|
+
- an unresolved outcome (`POSTGRES_MIGRATION_UNCERTAIN`) blocks every later migration until the database is inspected.
|
|
227
|
+
|
|
228
|
+
Files apply one call at a time in version order, stopping at the first error. Migrations never run on deploy. Returns `{ target, migration: { name, checksum, state, applied_at } }`.
|
|
229
|
+
|
|
230
|
+
```json
|
|
231
|
+
{ "project_id": "my-app", "target": "preview", "name": "0002_add_orders", "sql": "CREATE TABLE orders (id bigint PRIMARY KEY);" }
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
## postgres-preview
|
|
235
|
+
|
|
236
|
+
Create, reset or delete the project's one preview database. Owner only. Production is never changed.
|
|
237
|
+
|
|
238
|
+
- `create`: copies production data into an isolated branch in the customer's own provider account. A preview never falls back to production. Published app draft execution does not yet bind this database; creating the branch alone does not make it available to published previews.
|
|
239
|
+
- `reset`: replaces the preview's data with a fresh copy of production.
|
|
240
|
+
- `delete`: removes the preview database.
|
|
241
|
+
|
|
242
|
+
Reset and delete lose the preview's data and affect an already-deployed preview at once, until it is redeployed. `postgres_status` `view: "preview"` returns the current state.
|
|
243
|
+
|
|
244
|
+
```json
|
|
245
|
+
{ "project_id": "my-app", "action": "create" }
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
## postgres-credentials-separate
|
|
249
|
+
|
|
250
|
+
Give deployed functions their own limited database role, keeping the attached role for migrations only. Owner only; required before `postgres_migrate`. Calling it again after setup rechecks the stored runtime login and privileges.
|
|
251
|
+
|
|
252
|
+
The status timestamps record the last successful check, not continuous verification. Takes effect on the next deploy: releases already deployed keep their old credentials until redeployed or until the credential is rotated in the provider account. An interrupted setup remains pending for owner recovery and does not start a second role. Never returns a key or connection string.
|
|
253
|
+
|
|
254
|
+
```json
|
|
255
|
+
{ "project_id": "my-app" }
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
## postgres-copy
|
|
259
|
+
|
|
260
|
+
Copy the project's Somewhere database into a NEW private schema of its attached Postgres database (a database attached or created through the connected provider account). Owner only; requires separated credentials (`postgres_credentials_separate`). The Somewhere database and the running app are not changed, and nothing is switched over.
|
|
261
|
+
|
|
262
|
+
Faithful copies only: values are exact, and keys, unique rules, foreign keys, NOT NULL, defaults and identity sequences are recreated. A CHECK rule, trigger, view, non-binary collation, unsupported default, or a reference to a table that is not copied (app users, platform tables) refuses the copy with the exact item and what to change — nothing is silently dropped. App users, sessions and other platform tables are never copied; access rules are listed, not translated.
|
|
263
|
+
|
|
264
|
+
- `action: "prepare"` (writes nothing): reads one snapshot and returns the plan — tables with the destination type per column, keys, foreign keys, `fidelity`, `excluded`, `access_rules_not_copied`, `performance_indexes_not_recreated` (speed-only indexes), `refusals` and `limits`. Any refusal → 422 `POSTGRES_COPY_UNSUPPORTED`. Optional `schema`: the new schema name.
|
|
265
|
+
- `action: "copy"` + `plan` (the `plan` object prepare returned): one transaction creates the schema, tables and rows, recreates keys and identity sequences, verifies every table's row count and value digest inside the destination, and stores a receipt. Refused with `POSTGRES_COPY_PLAN_STALE` if the attachment, its credentials or the source schema changed since prepare. Retrying a committed plan returns its receipt (`already_copied: true`). `POSTGRES_COPY_OUTCOME_UNCERTAIN` means the connection dropped while committing; status is the first read.
|
|
266
|
+
- `action: "status"` + `schema` + `copy_id`: `committed` (with receipt), `in_progress`, `not_found` or `conflict`.
|
|
267
|
+
|
|
268
|
+
No other role (including the app's runtime role) is granted access to the new schema; additional access requires an explicit grant. Limits: 64 tables, 20,000 rows, 4 MiB of values, 60 seconds.
|
|
269
|
+
|
|
270
|
+
```json
|
|
271
|
+
{ "project_id": "my-app", "action": "prepare" }
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
## rooms-get
|
|
275
|
+
|
|
276
|
+
Read a room: the shared state people are working on together for one database row, its version, and who is in it now. A room belongs to one row of a table that declares `rooms` in its schema. When nobody is in the room, it returns the state last saved to the row. To find rooms, list the table's rows.
|
|
277
|
+
|
|
278
|
+
Returns `{ state, version, people: [{ id, user, info }] }`.
|
|
279
|
+
|
|
280
|
+
```json
|
|
281
|
+
{ "project_id": "my-app", "table": "games", "id": "g_123" }
|
|
282
|
+
```
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# Domains 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
|
+
## domain-add
|
|
6
|
+
|
|
7
|
+
Add a custom domain to your project. Returns the DNS targets you need to configure at your registrar.
|
|
8
|
+
|
|
9
|
+
**Example:**
|
|
10
|
+
|
|
11
|
+
Example transcript or fragment
|
|
12
|
+
|
|
13
|
+
```text
|
|
14
|
+
{ "project_id": "my-saas", "domain": "app.yourcompany.com" }
|
|
15
|
+
// Returns: { "domain": "app.yourcompany.com", "cname_target": "proxy.somewhere.tech", "verified": false, "verification_txt_name": "_somewhere-verify.app.yourcompany.com", "verification_txt_value": "smt-verify-...", "dns_records": [{ "type": "CNAME", "host": "app", "full_name": "app.yourcompany.com", "value": "proxy.somewhere.tech" }, { "type": "TXT", "host": "_somewhere-verify.app", "full_name": "_somewhere-verify.app.yourcompany.com", "value": "smt-verify-..." }], "instructions": "..." }
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Each record in `dns_records` has `host` (the name most DNS hosts expect, relative to the registrable domain), `full_name` and `purpose`. A bare domain (example.com itself) with DNS at another company is answered `400 BARE_DOMAIN_NEEDS_CLAIM_OR_WWW` and no records: claim it (`domain_claim`, its nameservers move here) or add www.example.com and forward the bare name to it at the DNS company. Adding the same domain to the same project again returns its real `verified` state. `409 DOMAIN_TAKEN` carries `data.reason` (`own_app`, `own_claim`, `deleted_app`, `other_account`) and the next call in its message.
|
|
19
|
+
|
|
20
|
+
## domain-verify
|
|
21
|
+
|
|
22
|
+
Check if a custom domain's DNS is configured correctly. `next_step` is a plain sentence naming the missing or wrong record (CNAME or TXT) with its name and expected value; `cname_ok` and `txt_ok` say the same per record, and `dns_records` lists both records. `parent_zone_in_account` is set when the registrable domain is a domain this account claimed here: attach that claim with a host instead of adding records. Each `dns_records` entry carries `in_place`. A bare domain gets no records: its next_step names the two ways it works (claim it, or connect www and forward the bare name).
|
|
23
|
+
|
|
24
|
+
## domain-check
|
|
25
|
+
|
|
26
|
+
Check if a domain is available for purchase and get the price, or find available domain names for a word.
|
|
27
|
+
|
|
28
|
+
**Example:**
|
|
29
|
+
|
|
30
|
+
Example transcript or fragment
|
|
31
|
+
|
|
32
|
+
```text
|
|
33
|
+
{ "domain": "acmedash.com" }
|
|
34
|
+
// Returns: { "available": true, "price": "$12.00/year" }
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
With `search: true` (or a word with no dot as `domain`), it searches priced endings for the word, excluding internationalized endings, and returns available names with their first-year price (`price`, `price_cents`), renewal price when known (`renewal_price_cents`) and a `premium` mark, cheapest first after an exact match. Prices are the registrar's, with no markup. A first year can be a promotional price; `renewal_price_cents` is the registrar's price for each later year. `max_price` (dollars) keeps only names at or under it; `sort` is `price` (default) or `name`. At most 60 names come back; `more_available` counts the rest and `next_cursor` (passed back as `cursor`) gives the next 60. A name whose price did not come back has `price_status: "unknown"` and is still available.
|
|
38
|
+
|
|
39
|
+
If `partial` is true, checks are still running. Repeat shortly for the finished search. Once it finishes, `unanswered` lists the names whose availability could not be checked and `unanswered_count` gives their count.
|
|
40
|
+
|
|
41
|
+
```json
|
|
42
|
+
{ "domain": "somewhere", "search": true, "max_price": 40 }
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## domain-check-connector
|
|
46
|
+
|
|
47
|
+
Check availability and pricing for an exact domain name, or use search: true or a single word to find available names across priced endings. Search suggestions exclude internationalized endings. Use max_price (dollars) and sort (price or name) to narrow the results. Prices are the registrar's, with no markup. The renewal_price_cents field gives the price for each later year. If partial is true, repeat shortly for the finished search. Once it finishes, unanswered lists the names whose availability could not be checked and unanswered_count gives their count.
|
|
48
|
+
|
|
49
|
+
## domain-buy
|
|
50
|
+
|
|
51
|
+
Preview a domain purchase and get a secure checkout link.
|
|
52
|
+
|
|
53
|
+
`domain_buy` takes project_id + domain. The platform returns the price and a `dashboard_checkout_url`. The price is quoted verbatim, and the secure checkout link is where payment completes.
|
|
54
|
+
|
|
55
|
+
Customer purchases cannot be completed through another MCP tool. The user completes payment through the checkout link, and registration begins only after that payment settles.
|
|
56
|
+
|
|
57
|
+
The price is the registrar's first-year price with no markup. Each later year costs the registrar's renewal price at that time, also with no markup, which can be higher than the first year.
|
|
58
|
+
|
|
59
|
+
Purchase connects the domain to the app with no DNS steps. A bought domain is set up as a claim: its DNS is hosted here, and it serves the bare name and www over HTTPS, usually within 30 minutes of payment. Receiving email stays off until `domain_enable_email`.
|
|
60
|
+
|
|
61
|
+
The domain is registered **in the buyer's name**. It can move to another registrar from 60 days after registration (the ICANN transfer rule), or to the buyer's own Name.com account from 5 days after; details: https://somewhere.cloud/docs/domain-ownership
|
|
62
|
+
|
|
63
|
+
**Example:**
|
|
64
|
+
|
|
65
|
+
```json
|
|
66
|
+
{ "project_id": "my-saas", "domain": "acmedash.com" }
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
The response will be an error of type `PURCHASE_CONFIRMATION_REQUIRED` carrying the price and checkout URL, e.g. `{ "ok": false, "error": "PURCHASE_CONFIRMATION_REQUIRED", "domain": "acmedash.com", "price": "$17/year", "dashboard_checkout_url": "https://somewhere.cloud/app/<project id>/buy/acmedash.com" }`. This response is a checkout handoff: payment completes at the `dashboard_checkout_url`.
|
|
70
|
+
|
|
71
|
+
## domain-claim
|
|
72
|
+
|
|
73
|
+
Claim a domain you already own by delegating its nameservers to us. The platform creates a dedicated zone, returns the nameserver pair to paste at your registrar, and starts polling for propagation. Once the zone goes active you can attach the domain to any project (and re-attach later without re-claiming).
|
|
74
|
+
|
|
75
|
+
This is the recommended path for any domain you control — it covers apex (`example.com`), `www`, and any subdomain in one move, and unlocks receiving mail on the same domain.
|
|
76
|
+
|
|
77
|
+
Claims belong to your account, not to a project. Project deletion is not the cleanup path for an unattached or pending claim. `domain_remove({ domain: "example.com" })` removes one from the account (including a claim created for a temporary test), ahead of deleting the project.
|
|
78
|
+
|
|
79
|
+
**Example:**
|
|
80
|
+
|
|
81
|
+
Example transcript or fragment
|
|
82
|
+
|
|
83
|
+
```text
|
|
84
|
+
{ "domain": "example.com" }
|
|
85
|
+
// Returns: { "id": "...", "nameservers": ["<assigned-ns1>", "<assigned-ns2>"], "claim_status": "pending_ns", "instructions": [...] }
|
|
86
|
+
// The actual nameserver hostnames are assigned by the platform and returned by this call.
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
After a nameserver update at the registrar, `domain_check_ns` (or the hourly poll) flips `claim_status` to `active`. `domain_attach` then binds it to a project.
|
|
90
|
+
|
|
91
|
+
## domain-attach
|
|
92
|
+
|
|
93
|
+
Bind a claimed (active) domain to one of your projects. `host` picks the entry point — `apex` (`example.com`), `www` (`www.example.com`), or a single subdomain label like `app` (→ `app.example.com`).
|
|
94
|
+
|
|
95
|
+
A domain attached to another project is refused (`DOMAIN_ATTACHED_ELSEWHERE`, naming that project); `domain_detach` there first, then attach here, with no re-verification. `domain_detach` frees the binding without unclaiming.
|
|
96
|
+
|
|
97
|
+
**Example:**
|
|
98
|
+
|
|
99
|
+
```json
|
|
100
|
+
{ "id": "dom_...", "project_id": "my-saas", "host": "apex" }
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## domain-publish
|
|
104
|
+
|
|
105
|
+
Recovery action for a claimed domain that isn't resolving. Re-asserts the apex + www records and the platform routing — idempotent, so safe to run any time. It applies when `domain_owned` shows `claim_status: active` and `zone_status: active` but `dig <domain>` returns NXDOMAIN or empty answers. `domain_claim` already runs this once; this is the manual unstick path for the rare case where the initial publish had a partial failure.
|
|
106
|
+
|
|
107
|
+
`domain_publish` never changes the domain's mail records.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Email 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
|
+
## email-send
|
|
6
|
+
|
|
7
|
+
**Adding a welcome, receipt, status, or alert email to an app?** `email_send` sends one transactional email to one recipient on every plan. Without `from`, the platform-managed sender is used immediately; the project name appears as the sender label. `from` selects a verified sender domain of the app. Domains bought through us or connected with our nameservers are set up automatically; a domain hosted elsewhere is verified once in Settings → Domains. A caller cannot explicitly name a platform domain.
|
|
8
|
+
|
|
9
|
+
The platform-managed sender is transactional-only. A verified sender domain carries the branding of the app itself and its marketing email. Outbound transactional email is available on Free, Builder, Pro, Scale, and Enterprise. The plan's email allowance and send rate limit apply either way; current limits are at /v1/pricing. It takes `html` or `text` (or both). `reply_to` is optional.
|
|
10
|
+
|
|
11
|
+
**Example:**
|
|
12
|
+
|
|
13
|
+
```json
|
|
14
|
+
{
|
|
15
|
+
"project_id": "my-saas",
|
|
16
|
+
"to": "alice@example.com",
|
|
17
|
+
"subject": "Your order shipped",
|
|
18
|
+
"html": "<p>Tracking number: ABC123</p>"
|
|
19
|
+
}
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## email-status
|
|
23
|
+
|
|
24
|
+
Look up the safe delivery timeline for an email previously sent by a project or issued by the platform for that project's app auth. It takes the tracking_id (same as the id returned from email_send or an authorized project workflow). Returns origin, source, auth_purpose when recorded, every lifecycle event — sent, delivered, opened, clicked, bounced, complained — in order, and event_counts. Message bodies, auth codes, credential links, and provider payloads are not returned. Historical rows without trusted sent provenance report origin/source as unknown. An opened event can come from an image proxy or automated scanner as well as a person, so it is an image-fetch event; reading and sign-in are separate actions. Missing events mean unknown, and this tool does not imply that open tracking is active.
|
|
25
|
+
|
|
26
|
+
**Example:**
|
|
27
|
+
|
|
28
|
+
Example transcript or fragment
|
|
29
|
+
|
|
30
|
+
```text
|
|
31
|
+
{ "id": "1234-abcd-..." }
|
|
32
|
+
// Returns: { "current_status": "delivered", "events": [{ "event_type": "sent", ... }, { "event_type": "delivered", ... }] }
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## email-events-list
|
|
36
|
+
|
|
37
|
+
List recent project mail and platform-issued app auth mail recorded for an authorized project. Each row includes origin, source, auth_purpose when recorded, latest delivery status (sent / delivered / opened / clicked / bounced / complained / delivery_delayed), and event_counts. Historical rows without trusted sent provenance report origin/source as unknown. The timeline supports delivery diagnostics: an opened event can come from an image proxy or automated scanner as well as a person, so it is an image-fetch event; reading and sign-in are separate actions; missing events mean unknown, and this tool does not imply that open tracking is active. email_status({ id: tracking_id }) has a specific message's safe timeline.
|
|
38
|
+
|
|
39
|
+
## email-bounces-list
|
|
40
|
+
|
|
41
|
+
Deduplicated list of recipient addresses that have bounced or complained (spam-marked) in a project. It supports scrubbing a mailing list before sending — repeated sends to a dead address are the most common email problem. Returns one row per address with last_status, last_at, and occurrences. Window defaults to 30 days (max 365). A send loop skips any address that appears here.
|
|
42
|
+
|
|
43
|
+
## email-reputation
|
|
44
|
+
|
|
45
|
+
Is this project's email paused for a high bounce or spam-report rate? Every project sends through the platform's shared sender, so a project whose rolling 24-hour bounce or spam-report rate crosses the published line is paused automatically: its sends (auth email included) answer EMAIL_PROJECT_PAUSED until the rate recovers, then resume on their own. Returns { state: 'healthy'|'paused', reason, paused_at, resumed_at, window: { hours, sent, bounced, complained, bounce_rate, complaint_rate }, thresholds }. email_bounces_list shows which addresses caused it.
|
|
46
|
+
|
|
47
|
+
## email-test-inbox
|
|
48
|
+
|
|
49
|
+
Read rendered messages sent to one address in a project's controlled test inbox: auth email and the project's own `sw.email.send` to that address (which returns status `captured`). Passwordless sign-in tests use an address shaped like `robot@<project-subdomain>.test.somewhere.site`. These messages are stored instead of being delivered, and each row includes `magic_link` when the auth template supplied one and `verification_code` when the message carries a code (email verification, sign-in code). Real recipient mail never appears here. The live app and every preview share this one inbox: each row says who sent it in `environment` ("production" or "preview") and `preview_session_id`.
|
|
50
|
+
|
|
51
|
+
## managed-email-send
|
|
52
|
+
|
|
53
|
+
Compose one managed email and send it to either an explicit recipient list or a saved contact segment. A segment is `{ "tag": "..." }` or `{ "all": true }`. Every recipient gets a distinct idempotency claim derived from `idempotency_key`, so retrying the same batch does not send duplicates. The result reports every recipient as sent, suppressed, preference-blocked, failed, or queued for a rate-limited later minute.
|
|
54
|
+
|
|
55
|
+
Marketing email requires `topic` and the project's `marketing_postal_address` (set it with `project_update`; it is printed in the footer); recipient preferences, suppression, and the unsubscribe footer are enforced by the managed email sender. It takes `html` or `text` (or both).
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Env 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
|
+
## env
|
|
6
|
+
|
|
7
|
+
Environment variables, secrets, config and integration keys. It sets with project_id, key and value; deletes with key and delete:true; lists with project_id only. Values are encrypted and omitted from list results. New values are private for server functions by default. A VITE_ or REACT_APP_ prefix alone never publishes a value. Publishing a browser value requires a prefixed name and public:true. Recognized secret credentials, including test credentials, cannot be marked public. Server functions read sw.env.NAME. Browser code reads import.meta.env.VITE_NAME or process.env.REACT_APP_NAME only for explicitly public values. A private browser reference refuses compilation. Provider and purpose are optional descriptive labels, not access controls. After the project adopts live config on a deploy, saves reach new ordinary requests within 60 seconds, usually in a few seconds. Cron and new background deliveries see changes within 5 seconds. Public browser values reach new page loads within 60 seconds. Previews keep the config they captured. List and save responses contain exact references and effective visibility, never values. A project's combined environment values have a 5,120 byte limit.
|
|
8
|
+
|
|
9
|
+
## env-request
|
|
10
|
+
|
|
11
|
+
Secure secret entry — get a link where the user types an API key or other secret (Stripe, OpenAI, Twilio) on Somewhere. The value goes from the user's browser straight into the project's encrypted environment; it is never sent to, stored by, or returned from this tool, so secrets stay out of the conversation.
|
|
12
|
+
|
|
13
|
+
Returns `{ status: "pending", url, request, expires_at }` — the link works for 30 minutes and only for a signed-in editor of the project. When the key already has a value it returns `{ status: "set", server_reference: "sw.env.KEY" }` and no link; `replace: true` returns a link that replaces it. `handoff_status({ request })` reports progress. Functions read the value as `sw.env.KEY`.
|
|
14
|
+
|
|
15
|
+
**Example:**
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{ "project_id": "my-shop", "key": "STRIPE_SECRET_KEY", "purpose": "Charge customers at checkout" }
|
|
19
|
+
```
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Feedback 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
|
+
## feedback
|
|
6
|
+
|
|
7
|
+
End-user app feedback sent to the project's private owner inbox (`destination: "project_owner_inbox"`) — this does not reach the Somewhere platform team. Every successful submission repeats that destination and names the exact platform-support calls. Submit: provide a message about that project's own UI or behavior. List: without message it returns feedback on a project you own. When the project owner resolves one of these reports, the owner-facing project channel can emit a `feedback_resolved` event.
|
|
8
|
+
|
|
9
|
+
Platform bugs, missing capabilities, deploy/API problems and documentation issues are out of scope for this tool. `support_ticket({ message: "..." })` sends such a report to the platform support queue.
|
|
10
|
+
|
|
11
|
+
**Example:**
|
|
12
|
+
|
|
13
|
+
Example transcript or fragment
|
|
14
|
+
|
|
15
|
+
```text
|
|
16
|
+
// Submit:
|
|
17
|
+
{ "project_id": "my-saas", "message": "The checkout button in this app does nothing after I enter my card" }
|
|
18
|
+
|
|
19
|
+
// List:
|
|
20
|
+
{ "project_id": "my-saas" }
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## support-ticket
|
|
24
|
+
|
|
25
|
+
Support tickets for the Somewhere platform team — submit, check, list, or resolve your own tickets. For reports about the platform itself: a doc gap, an unexpected error shape, a missing capability, a bug in an MCP tool, or an inconsistency between docs and behavior. **Not** for feedback on a user's own app — that's the `feedback` tool.
|
|
26
|
+
|
|
27
|
+
**Four modes, by argument:**
|
|
28
|
+
- `message` → submits a new support ticket. Returns a durable `ticket_id` immediately, stores the raw ticket in the support inbox, and notifies the team. The team replies on that same ticket. When the team records a reply or resolves the ticket, the reporting developer receives an email and a developer-channel `feedback_resolved` event automatically. Ticket status remains readable before that notification arrives.
|
|
29
|
+
- `ticket_id` and `action: "resolve"` → resolves a ticket the caller submitted. This cannot resolve another submitter's ticket. An authenticated platform admin may also pass `response` to write the customer-facing reply and resolve the ticket atomically.
|
|
30
|
+
- `ticket_id` (no message) → reads that one ticket. Returns its `status` (open / investigating / resolved) and `response` (the team's reply, once written).
|
|
31
|
+
- Neither → lists the tickets the caller submitted, most recent first (open and resolved), each with status, response, and resolution timestamp. A `status` filter narrows the list.
|
|
32
|
+
|
|
33
|
+
**Example:**
|
|
34
|
+
|
|
35
|
+
Example transcript or fragment
|
|
36
|
+
|
|
37
|
+
```text
|
|
38
|
+
// Submit:
|
|
39
|
+
{
|
|
40
|
+
"message": "PUT /v1/fs binary upload returns 200 but reads back as UTF-8-replaced bytes — every byte ≥0x80 becomes EF BF BD. Reproed with curl --data-binary @cat.jpg.",
|
|
41
|
+
"context": { "endpoint": "PUT /v1/fs", "file_size": 82823, "tried": ["binary_files base64 (worked)"] }
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Check one ticket:
|
|
45
|
+
{ "ticket_id": "pfb_<ticket-id>" }
|
|
46
|
+
|
|
47
|
+
// Resolve your own ticket:
|
|
48
|
+
{ "ticket_id": "pfb_<ticket-id>", "action": "resolve" }
|
|
49
|
+
|
|
50
|
+
// List open tickets:
|
|
51
|
+
{ "status": "open", "limit": 20 }
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## support-ticket-submit
|
|
55
|
+
|
|
56
|
+
Send a new support ticket to the Somewhere platform team about the platform itself: a doc gap, an unexpected error, a missing capability, or a tool bug. The team receives and is notified of the message, and replies on the same ticket; the reply is also emailed to you. Returns a ticket_id. A sent ticket cannot be withdrawn.
|