@somewhere-cloud/cli 0.38.155 → 0.38.156

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/CHANGELOG.md +4 -1
  2. package/dist/commands/docs.js +1 -1
  3. package/dist/lib/bundle.js +276 -188
  4. package/dist/lib/bundle.js.map +3 -3
  5. package/npm-shrinkwrap.json +2 -2
  6. package/package.json +2 -3
  7. package/dist/docs/adopt.md +0 -39
  8. package/dist/docs/analytics.md +0 -161
  9. package/dist/docs/api-reference.md +0 -339
  10. package/dist/docs/api-surface.md +0 -2067
  11. package/dist/docs/app-mcp.md +0 -162
  12. package/dist/docs/architecture-patterns.md +0 -334
  13. package/dist/docs/auth-client.md +0 -531
  14. package/dist/docs/billing.md +0 -76
  15. package/dist/docs/browser.md +0 -639
  16. package/dist/docs/calendar.md +0 -298
  17. package/dist/docs/changes.md +0 -323
  18. package/dist/docs/cli.md +0 -407
  19. package/dist/docs/common-mistakes.md +0 -199
  20. package/dist/docs/connect-agent.md +0 -72
  21. package/dist/docs/cors.md +0 -114
  22. package/dist/docs/cron.md +0 -167
  23. package/dist/docs/database-engine.md +0 -167
  24. package/dist/docs/declared-data.md +0 -1656
  25. package/dist/docs/declared-files.md +0 -475
  26. package/dist/docs/deploy-intelligence.md +0 -188
  27. package/dist/docs/deploy.md +0 -733
  28. package/dist/docs/design-system.md +0 -273
  29. package/dist/docs/dev-environments.md +0 -496
  30. package/dist/docs/domain-ownership.md +0 -31
  31. package/dist/docs/domains.md +0 -370
  32. package/dist/docs/feedback.md +0 -88
  33. package/dist/docs/file-tools.md +0 -116
  34. package/dist/docs/functions.md +0 -489
  35. package/dist/docs/getting-started.md +0 -238
  36. package/dist/docs/github.md +0 -95
  37. package/dist/docs/google-calendar.md +0 -212
  38. package/dist/docs/groups.md +0 -836
  39. package/dist/docs/guarantees.md +0 -58
  40. package/dist/docs/handled-for-you.md +0 -224
  41. package/dist/docs/inspect.md +0 -171
  42. package/dist/docs/limits.md +0 -68
  43. package/dist/docs/live-data.md +0 -197
  44. package/dist/docs/live.md +0 -92
  45. package/dist/docs/local-dev.md +0 -30
  46. package/dist/docs/migration-supabase.md +0 -58
  47. package/dist/docs/payments.md +0 -1102
  48. package/dist/docs/portability.md +0 -194
  49. package/dist/docs/postgres.md +0 -301
  50. package/dist/docs/pricing-comparison.md +0 -42
  51. package/dist/docs/pricing.md +0 -39
  52. package/dist/docs/project-groups.md +0 -107
  53. package/dist/docs/projects.md +0 -380
  54. package/dist/docs/recipe-ai-agent.md +0 -112
  55. package/dist/docs/recipe-ai-features.md +0 -227
  56. package/dist/docs/recipe-ai-receipts.md +0 -783
  57. package/dist/docs/recipe-background-jobs.md +0 -369
  58. package/dist/docs/recipe-booking.md +0 -348
  59. package/dist/docs/recipe-csv-import.md +0 -390
  60. package/dist/docs/recipe-ecommerce.md +0 -127
  61. package/dist/docs/recipe-email.md +0 -282
  62. package/dist/docs/recipe-escalation.md +0 -133
  63. package/dist/docs/recipe-file-uploads.md +0 -159
  64. package/dist/docs/recipe-import-app.md +0 -110
  65. package/dist/docs/recipe-login.md +0 -457
  66. package/dist/docs/recipe-multi-chat.md +0 -198
  67. package/dist/docs/recipe-paid-api.md +0 -161
  68. package/dist/docs/recipe-pdfs.md +0 -205
  69. package/dist/docs/recipe-push-notifications.md +0 -107
  70. package/dist/docs/recipe-seo.md +0 -200
  71. package/dist/docs/recipe-signed-in-app.md +0 -330
  72. package/dist/docs/render.md +0 -99
  73. package/dist/docs/rooms.md +0 -554
  74. package/dist/docs/sdk.md +0 -287
  75. package/dist/docs/sdks.md +0 -24
  76. package/dist/docs/search.md +0 -199
  77. package/dist/docs/security-model.md +0 -168
  78. package/dist/docs/setup.md +0 -212
  79. package/dist/docs/smoke.md +0 -102
  80. package/dist/docs/speed.md +0 -298
  81. package/dist/docs/sql-compatibility.md +0 -96
  82. package/dist/docs/sw.agent.md +0 -248
  83. package/dist/docs/sw.ai.md +0 -1291
  84. package/dist/docs/sw.auth.md +0 -1811
  85. package/dist/docs/sw.billing.md +0 -171
  86. package/dist/docs/sw.db.md +0 -2128
  87. package/dist/docs/sw.email.md +0 -661
  88. package/dist/docs/sw.endpoint.md +0 -187
  89. package/dist/docs/sw.env.md +0 -303
  90. package/dist/docs/sw.fetch.md +0 -115
  91. package/dist/docs/sw.fs.md +0 -424
  92. package/dist/docs/sw.groups.md +0 -836
  93. package/dist/docs/sw.image.md +0 -69
  94. package/dist/docs/sw.jobs.md +0 -520
  95. package/dist/docs/sw.logs.md +0 -61
  96. package/dist/docs/sw.mail.md +0 -106
  97. package/dist/docs/sw.notifications.md +0 -78
  98. package/dist/docs/sw.push.md +0 -161
  99. package/dist/docs/sw.rateLimit.md +0 -67
  100. package/dist/docs/sw.web.md +0 -128
  101. package/dist/docs/tasks.md +0 -269
  102. package/dist/docs/test.md +0 -220
  103. package/dist/docs/tool-reference-account.md +0 -7
  104. package/dist/docs/tool-reference-ai.md +0 -121
  105. package/dist/docs/tool-reference-analytics.md +0 -37
  106. package/dist/docs/tool-reference-api.md +0 -19
  107. package/dist/docs/tool-reference-artifacts.md +0 -35
  108. package/dist/docs/tool-reference-auth.md +0 -163
  109. package/dist/docs/tool-reference-browser.md +0 -114
  110. package/dist/docs/tool-reference-code.md +0 -26
  111. package/dist/docs/tool-reference-connect.md +0 -21
  112. package/dist/docs/tool-reference-cron.md +0 -48
  113. package/dist/docs/tool-reference-db.md +0 -282
  114. package/dist/docs/tool-reference-domains.md +0 -107
  115. package/dist/docs/tool-reference-email.md +0 -55
  116. package/dist/docs/tool-reference-env.md +0 -19
  117. package/dist/docs/tool-reference-feedback.md +0 -56
  118. package/dist/docs/tool-reference-fs.md +0 -265
  119. package/dist/docs/tool-reference-github.md +0 -57
  120. package/dist/docs/tool-reference-groups.md +0 -85
  121. package/dist/docs/tool-reference-help.md +0 -29
  122. package/dist/docs/tool-reference-jobs.md +0 -39
  123. package/dist/docs/tool-reference-live.md +0 -48
  124. package/dist/docs/tool-reference-logs.md +0 -16
  125. package/dist/docs/tool-reference-payments.md +0 -44
  126. package/dist/docs/tool-reference-project.md +0 -706
  127. package/dist/docs/tool-reference-push.md +0 -78
  128. package/dist/docs/tool-reference-rate-limit.md +0 -18
  129. package/dist/docs/tool-reference-search.md +0 -68
  130. package/dist/docs/tool-reference-security.md +0 -42
  131. package/dist/docs/tool-reference-smoke.md +0 -17
  132. package/dist/docs/tool-reference-stock-photos.md +0 -20
  133. package/dist/docs/tool-reference-tasks.md +0 -73
  134. package/dist/docs/tool-reference-telegram.md +0 -32
  135. package/dist/docs/tool-reference-usage.md +0 -9
  136. package/dist/docs/tool-reference-web.md +0 -71
  137. package/dist/docs/tool-reference-webhooks.md +0 -9
  138. package/dist/docs/troubleshooting.md +0 -411
  139. package/dist/docs/typed-functions.md +0 -94
  140. package/dist/docs/verify-before-deploy.md +0 -67
  141. package/dist/docs/vs-supabase.md +0 -75
  142. package/dist/docs/vs-vercel.md +0 -103
@@ -1,298 +0,0 @@
1
- # Calendar — atomic holds and reservations
2
-
3
- `sw.calendar` is the built-in reservation primitive for booking apps. It
4
- atomically holds one resource + time range, counts active holds and pending
5
- payments before accepting a booking, and gives you a hold token that can be passed into
6
- Checkout. Use it instead of a SELECT-then-INSERT booking table when a
7
- double-booking would cost money or trust.
8
-
9
- To put events in a user's own Google Calendar, use `sw.connect.googleCalendar`
10
- instead (`docs({ topic: 'google-calendar' })`).
11
-
12
- The normal booking path runs in a function:
13
-
14
- 1. `sw.calendar.availability({ resource, range })` returns the `busy` and
15
- `free` ranges to show the customer.
16
- 2. `sw.calendar.hold({ resource, range, ttl_seconds })` holds the range they
17
- pick. An overlapping active hold, pending payment or booking on an exclusive
18
- resource gets `409 CALENDAR_CONFLICT`, so show the next free range.
19
- 3. Pass the returned `hold_token` to `sw.payments.checkout` as
20
- `calendar_hold_token`. A completed payment confirms the reservation. The
21
- Checkout session expires with the hold, and an unpaid session releases it
22
- when it expires.
23
-
24
- For appointments (a person's time, such as a 15-minute call), set the
25
- resource's weekly `hours` once and offer `sw.calendar.slots(...)`: see
26
- `appointments-hours-and-slots`.
27
-
28
- `calendar` → `hold-checkout-confirm` shows that call with its timing rule,
29
- `availability-and-booking-reads` the read shapes, and
30
- `resource-policies-blocks-cancellations-and-rebooking` minimum stays, notice
31
- and turnaround.
32
-
33
- ## Runtime methods
34
-
35
- - `sw.calendar.hold(resource, range, ttl?)`
36
- - `sw.calendar.hold({ resource, range, ttl?, ttl_seconds?, ttl_ms?, metadata? })`
37
- - `sw.calendar.blackout(resource, range, options?)`
38
- - `sw.calendar.removeBlackout(reservationId, options?)`
39
- - `sw.calendar.cancel(reservationId, options?)`
40
- - `sw.calendar.rebook(reservationId, newRange)`
41
- - `sw.calendar.setPolicy(resource, policy)`
42
- - `sw.calendar.getPolicy(resource)`
43
- - `sw.calendar.availability(resource, range)`
44
- - `sw.calendar.availability({ resource, range })`
45
- - `sw.calendar.slots({ resource, range, duration_minutes, step_minutes? })`
46
- - `sw.calendar.list(resource, { range?, statuses?, limit?, cursor? })`
47
- - `sw.calendar.list({ resource, range?, statuses?, limit?, cursor? })`
48
- - `sw.calendar.get(reservationId)`
49
- - `sw.calendar.pending(token, { payment_reference? })`
50
- - `sw.calendar.confirm(token, { payment_reference? })`
51
- - `sw.calendar.release(token, { payment_reference?, release_reason? })`
52
- - `sw.calendar.expire({ resource? })`
53
-
54
- REST equivalents are `POST /v1/calendar/hold`, `/blackout`,
55
- `/blackout/remove`, `/cancel`, `/rebook`, `/policy/set`,
56
- `/policy/get`, `/availability`, `/slots`, `/list`, `/get`, `/pending`,
57
- `/confirm`, `/release`, and `/expire`. The REST
58
- body includes `project_id`; the runtime helper injects it for you.
59
-
60
- ## Resource policies, blocks, cancellations, and rebooking
61
-
62
- `setPolicy` declares optional `min_stay_nights`, `max_stay_nights`,
63
- `advance_notice_hours`, `bookable_from`, `max_days_ahead`, `turnaround_hours`,
64
- `capacity`, and `hours` for one resource; pass `null` for a field to clear it. Holds and
65
- rebooks enforce the policy with stable 409 codes: `CALENDAR_MIN_STAY`,
66
- `CALENDAR_MAX_STAY`, `CALENDAR_ADVANCE_NOTICE`, `CALENDAR_TOO_FAR_AHEAD`,
67
- `CALENDAR_BUFFER_CONFLICT`, and `CALENDAR_OUTSIDE_HOURS`.
68
-
69
- Use `blackout` / `removeBlackout` for operator-owned unavailable ranges,
70
- `cancel` for a confirmed reservation, and `rebook` to move a confirmed
71
- reservation atomically. Each operation is project-scoped and returns the
72
- updated reservation or the stable conflict/not-found code named in its error.
73
-
74
- ## Appointments: hours and slots
75
-
76
- Set the person's weekly hours once, in their own IANA time zone, from your
77
- setup or admin code. Days you leave out are closed. Windows are wall-clock
78
- `HH:MM-HH:MM`, so daylight-saving changes follow the zone.
79
-
80
- ```js
81
- await sw.calendar.setPolicy('host:dana', {
82
- advance_notice_hours: 12,
83
- max_days_ahead: 14, // starts at most 14 days from now
84
- hours: {
85
- timezone: 'America/Los_Angeles',
86
- weekly: { mon: ['09:00-12:00', '13:00-17:00'], tue: ['09:00-17:00'] },
87
- },
88
- });
89
- ```
90
-
91
- `setPolicy` replaces the whole policy, so send `hours` with every change.
92
- `hold` and `rebook` refuse a range that does not fit inside one window with
93
- `409 CALENDAR_OUTSIDE_HOURS`. Use `blackout` for days off.
94
-
95
- `slots` returns the starts a visitor can book: inside the hours, after
96
- notice and `bookable_from`, within `max_days_ahead`, and clear of holds, bookings, blackouts and
97
- turnaround. Show them in the visitor's own time zone; the times are absolute.
98
-
99
- ```js
100
- const { slots } = await sw.calendar.slots({
101
- resource: 'host:dana',
102
- range: { start: Date.now(), end: Date.now() + 14 * 86400000 },
103
- duration_minutes: 15,
104
- step_minutes: 30, // starts on the hour and half hour; defaults to duration_minutes
105
- });
106
- // -> { resource, range, duration_minutes, step_minutes, timezone: 'America/Los_Angeles',
107
- // slots: [{ start_ms, end_ms, start: '2026-12-01T17:00:00.000Z', end: '...' }] }
108
- ```
109
-
110
- `range` spans at most 62 days, and at most 2000 slots are returned. `slots` is
111
- a read: two visitors can see the same start. `hold` decides atomically, so
112
- the second one gets `409 CALENDAR_CONFLICT`. For a booking without payment,
113
- `hold` and then `confirm(hold.hold_token)` once you have what you need (for
114
- example, after the visitor confirms their email). Send only the start times to
115
- the browser. `availability` returns reservation ids. Visitor cancel and
116
- reschedule links need their own random secret, stored server-side, because
117
- `cancel` and `rebook` take the reservation id. A link that carries only the id
118
- lets anyone who sees one cancel it.
119
-
120
- To email the visitor from the platform address, they must be a user of your
121
- app or your project needs a verified sending domain. Confirm the booking with
122
- `sw.auth.signInWithOtp({ email, redirect_uri, purpose: 'confirm' })`: the
123
- visitor gets a "Confirm your request" email, and once they press it they are a
124
- verified user you can email (`sw.auth` → `magic-links-passwordless-sign-in`). Attach the invite as a `.ics` file with
125
- `sw.email.send({ attachments })` (`sw.email` → `attachments`).
126
-
127
- ## Class seats
128
-
129
- For a class, call `sw.calendar.setPolicy(resource, { capacity: 12 })` once
130
- from your authorized setup or admin code. One hold reserves one seat.
131
- Reservations share seats only when their start and end match exactly;
132
- a different overlapping range still conflicts. Turnaround separates classes,
133
- not seats within the same class, and a blackout blocks the whole class.
134
- A full class returns `409 CALENDAR_FULL`.
135
-
136
- Leave `capacity` out or set it to `null` for an exclusive resource.
137
- `setPolicy` replaces the policy, so include capacity when changing another
138
- field. Lowering it below an existing class's active reservations returns
139
- `CALENDAR_CAPACITY_BELOW_BOOKINGS` and leaves the policy and bookings intact.
140
-
141
- Availability also returns `capacity` and `slots`: each existing class has
142
- `start_ms`, `end_ms`, `capacity`, `reserved`, and `remaining`.
143
- Your app supplies the class schedule; a class with no reservations yet is absent.
144
- A partly filled class stays in `busy`, with its seat count in `slots`.
145
- Seat counts describe the current bookings; `hold` also checks notice,
146
- blackouts and turnaround before reserving. Cancel, release and expiry free a
147
- seat. Rebooking into a full class leaves the original booking intact.
148
-
149
- After a timeout or lost hold response, read the reservation state before
150
- trying again: a second hold reserves another seat. There is no party-size
151
- or waitlist parameter; store a waitlist in your app and offer a freed seat
152
- through the same hold-and-checkout flow. A payment after hold expiry confirms
153
- only if a seat is still free; otherwise the existing paid-but-slot-lost
154
- result lets your app handle the refund or alternative booking.
155
-
156
- ## Hold input
157
-
158
- ```js
159
- const hold = await sw.calendar.hold({
160
- resource: 'room:queen-204',
161
- range: {
162
- start: '2026-08-01T15:00:00-07:00',
163
- end: '2026-08-03T11:00:00-07:00',
164
- timezone: 'America/Los_Angeles',
165
- },
166
- ttl_seconds: 40 * 60,
167
- metadata: { party_size: 2 },
168
- });
169
- ```
170
-
171
- `range.start` and `range.end` accept epoch milliseconds or ISO timestamps
172
- with an explicit `Z` / offset. `hold` and `blackout` require
173
- `range.timezone`, a valid IANA timezone; a missing one is a type error and a
174
- 400 `VALIDATION_ERROR`. `availability` and `list` ranges take only
175
- `start` and `end`, and `rebook` keeps the reservation's timezone when
176
- its new range omits one. Ranges are half-open: `[start, end)`. Adjacent reservations are
177
- allowed; overlapping reservations conflict. The conflict set is active
178
- `hold`, `pending_payment`, and `confirmed`; expired/released rows do not
179
- block new holds. Default TTL is 35 minutes, minimum is 1 second, maximum is
180
- 24 hours.
181
-
182
- ## Hold response
183
-
184
- ```json
185
- {
186
- "token": "calh_...",
187
- "hold_token": "calh_...",
188
- "expires_at": 1785625200000,
189
- "reservation": {
190
- "id": "cal_...",
191
- "project_id": "...",
192
- "resource": "room:queen-204",
193
- "start_ms": 1785612000000,
194
- "end_ms": 1785765600000,
195
- "timezone": "America/Los_Angeles",
196
- "status": "hold",
197
- "hold_token_prefix": "calh_...",
198
- "metadata": {
199
- "party_size": 2
200
- },
201
- "payment_reference": null,
202
- "expires_at": 1785625200000,
203
- "confirmed_at": null,
204
- "released_at": null,
205
- "release_reason": null,
206
- "created_at": 1785622800000,
207
- "updated_at": 1785622800000
208
- }
209
- }
210
- ```
211
-
212
- Store the token server-side or return it to the browser only long enough to
213
- start checkout. Later operations require the token and the same project.
214
-
215
- ## Availability and booking reads
216
-
217
- Use the calendar read side to render availability; you do not need a shadow
218
- table of holds. Availability returns active `hold` / `pending_payment` /
219
- `confirmed` conflicts clipped to the requested range, plus the maximal free
220
- ranges between them. Expired holds are ignored even before an explicit
221
- `expire()` sweep.
222
-
223
- ```js
224
- const availability = await sw.calendar.availability({
225
- resource: 'room:queen-204',
226
- range: {
227
- start: '2026-08-01T00:00:00-07:00',
228
- end: '2026-08-08T00:00:00-07:00',
229
- },
230
- });
231
- // -> { resource, range: { start_ms, end_ms },
232
- // busy: [{ reservation_id, kind: 'hold'|'booking', status,
233
- // start_ms, end_ms, expires_at }],
234
- // free: [{ start_ms, end_ms }] }
235
-
236
- const page = await sw.calendar.list('room:queen-204', {
237
- range: { start: Date.now(), end: Date.now() + 30 * 86400000 },
238
- limit: 100,
239
- });
240
- // -> { reservations: [...], next_cursor: string|null }
241
- // Pass next_cursor back as cursor. By default list returns active holds and
242
- // confirmed bookings. Pass statuses: ['released', 'expired'] for audit rows.
243
-
244
- const { reservation } = await sw.calendar.get(page.reservations[0].id);
245
- ```
246
-
247
- `range.start` / `range.end` use the same epoch-millisecond or explicit-
248
- offset ISO format as holds. `list` requires a resource, accepts an optional
249
- overlap range, defaults to 100 rows, and caps `limit` at 500. `get` is
250
- project-scoped and returns `CALENDAR_RESERVATION_NOT_FOUND` for a missing or
251
- cross-project id.
252
-
253
- ## Hold → checkout → confirm
254
-
255
- ```js
256
- const hold = await sw.calendar.hold({
257
- resource: body.resourceId,
258
- range: body.range,
259
- ttl_seconds: 45 * 60,
260
- });
261
-
262
- const checkout = await sw.payments.checkout({
263
- env: 'prod',
264
- mode: 'payment',
265
- calendar_hold_token: hold.hold_token,
266
- line_items: [{ amount: 2500, currency: 'usd', name: 'Reservation deposit' }],
267
- success_url: 'https://my-app.somewhere.site/booked',
268
- cancel_url: 'https://my-app.somewhere.site/book',
269
- });
270
- ```
271
-
272
- Checkout marks the hold `pending_payment`, sets the Stripe Checkout expiry to
273
- the hold expiry, and records a payment reference. The hold must have at least
274
- 31 minutes remaining when checkout starts; otherwise the platform returns
275
- `CALENDAR_HOLD_TTL_TOO_SHORT` and releases the hold. On
276
- `checkout.session.completed`, the platform confirms the hold. On
277
- `checkout.session.expired` it releases the hold, so a failed or abandoned
278
- payment frees the slot when the session expires. A single checkout may
279
- use `calendar_hold_token`, `quote_id`, or both. When both are supplied the
280
- stored quote prices the Checkout session and the calendar hold reserves the
281
- dates; both records are bound to the same session in one atomic database batch.
282
- Completion confirms the hold before completing the quote booking, and a lost
283
- slot leaves the quote unfulfilled for recovery instead of double-fulfilling.
284
-
285
- Manual confirmation is also available:
286
-
287
- ```js
288
- await sw.calendar.pending(hold.hold_token, { payment_reference: 'order_123' });
289
- await sw.calendar.confirm(hold.hold_token, { payment_reference: 'order_123' });
290
- await sw.calendar.release(hold.hold_token, { release_reason: 'customer_canceled' });
291
- await sw.calendar.expire({ resource: 'room:queen-204' }); // optional resource filter
292
- ```
293
-
294
- `confirm` is idempotent once confirmed with the same payment reference.
295
- If a paid checkout arrives after the original hold expired and another hold
296
- has taken the slot, the reservation is marked
297
- `payment_received_slot_lost` and the webhook payload surfaces the problem
298
- for refund/manual recovery.
@@ -1,323 +0,0 @@
1
- # Recent behaviour changes
2
-
3
- ## How we handle breaking changes
4
-
5
- ### Our principle
6
-
7
- We keep your app running as the platform evolves. If a platform change affects
8
- it, we tell you first, give you time to respond, and prepare a fix with
9
- instructions for applying it. Safety is the exception: protections may take
10
- effect immediately, but we still ask for your approval before changing your
11
- code to address the safety issue.
12
-
13
- ### Where we're heading
14
-
15
- We intend to introduce compatibility dates, so each app can keep the platform
16
- behavior it was built against until you choose to adopt newer behavior, subject
17
- to safety protections. This is our direction, not a feature available today or
18
- a promised launch date.
19
-
20
- ### Compatibility notice periods
21
-
22
- Compatibility notice periods are at least 7 days
23
- for active Free owners and 30 days for paid apps. Free apps are never paused for
24
- idleness; we pause one only if a platform change would break it and its owner
25
- has had no login or deploy for 30 days, with notice and a prepared fix, while
26
- paid apps are never paused because of a platform change.
27
-
28
- ## Change log
29
-
30
- Dated platform behaviour changes, newest first. One entry per change: what
31
- changed, what it means for code you already deployed, and the topic that carries
32
- the full contract. Affected owners receive an email and a project notice;
33
- this log records what changed.
34
-
35
- Each entry names a topic. That topic, not this line, is the current contract;
36
- the entry records when and why it changed.
37
-
38
- CLI releases are listed in the CLI's own `CHANGELOG.md`, shipped in the
39
- `@somewhere-cloud/cli` package. A project stays on the CLI version it records
40
- until `somewhere upgrade`, which prints the entries between that version and
41
- the new one.
42
-
43
- Before you update an app for a change, check what it is running:
44
-
45
- - `somewhere status` shows the active release, and
46
- `project_deploys({ project_id })` lists the deploy history.
47
- - In an empty folder, `somewhere pull` downloads the live source with local typecheck files, and
48
- `somewhere typecheck` runs `tsc --noEmit` over it.
49
- - Compare the `@somewhere-cloud/sdk` version in the app's `package.json` with
50
- the current 0.14.1 listed in `sdks`.
51
- - `somewhere deploy-check` compiles your changed source on the server
52
- without deploying it.
53
-
54
- Then read the named topic for the new contract. If a documented contract
55
- looks wrong, file it with `support_ticket({ message })`.
56
-
57
- - **2026-11-19 — the old inbox is removed.** `sw.inbox`, the `/v1/inbox` API
58
- and the `inbox_*` tools are gone: `/v1/inbox` answers 410 and reading
59
- `sw.inbox` in a function throws. Received mail is on the mail API
60
- (`/v1/mail`). `docs({ topic: 'domains' })`.
61
- - **2026-10-31 — a `sw.endpoint` handler that reads `body` without a
62
- `body` schema is refused at deploy.** Without a schema `body` is always
63
- `null`, so what the caller sent was dropped. 400 `ENDPOINT_BODY_UNDECLARED`
64
- names the file and line; declare the fields, or read `request` yourself.
65
- Endpoints already deployed keep running. `docs({ topic: 'sw.endpoint' })`
66
-
67
- - **2026-10-31 — a bare `id()` keeps a table's existing integer ids.** Source
68
- that says `id()` over a table that already has integer ids redeploys
69
- unchanged, with no change to the table or its ids.
70
- New tables still get a random text key. `docs({ topic: 'declared-data' })`
71
-
72
- - **2026-10-21 — `somewhere test-users` signs local Playwright and
73
- agent-browser in as test users (CLI 0.37.63 or later).** `prepare` writes a
74
- standard storageState per actor, `address` and `inbox` test real signup,
75
- and `cleanup` removes the users it prepared; app data they created is kept.
76
- `docs({ topic: 'browser' })`.
77
- - **2026-10-21 — magic-link and invite sign-ins complete in the browser.**
78
- `sw.auth.verifyOtp` returns `expires_at`, as login and signup do. A function deployed before 18:33 UTC keeps the earlier
79
- runtime until it is deployed again. `docs({ topic: 'sw.auth' })`.
80
- - **2026-10-21 — `sw.inbox` `list()` and `threads()` take `cursor`.** Pass the
81
- previous `next_cursor` with the same filters to read the next page. A function
82
- deployed before 12:32 UTC keeps the earlier runtime until it is deployed again.
83
- (Removed 2026-11-19.)
84
- - **2026-10-21 — browser and `verify` actions keep `frame` (CLI 0.37.58 or
85
- later).** A `"frame"` on an action runs it inside that iframe.
86
- `docs({ topic: 'browser' })`.
87
- - **2026-10-21 — inbox message and thread lists page with a cursor.**
88
- `inbox_list` and `inbox_threads` (`GET /v1/inbox`, `GET /v1/inbox/threads`)
89
- return `next_cursor`; pass it back as `cursor` with the same filters until it
90
- is `null`. `inbox_threads` returns `{ threads, next_cursor }`.
91
- (Removed 2026-11-19.)
92
- - **2026-10-21 — `docs` summaries carry the topic's content, not mostly its
93
- index.** A summary fills its existing size budget with whole sections, marked
94
- `(shown above)` in its section list, so one call usually answers; `--full`
95
- and `--section` are unchanged. `docs({ topic: 'cli' })`.
96
- - **2026-10-21 — new starters ignore the generated `__somewhere_*.d.ts` files
97
- (CLI 0.37.47 or later).** `typecheck`, `dev` and `deploy` rebuild them from
98
- `db/schema.ts`; an older project can add both names to `.gitignore`.
99
- `docs({ topic: 'cli' })`.
100
- - **2026-10-21 — a fixed browser or `verify` wait over 45 seconds is refused.**
101
- The error names the step: split a longer pause into several waits of at most
102
- 45000 ms, or wait for a condition. When an absent element fails
103
- `visible: false`, or `count: 0` together with `text`, the error
104
- says to use `count: 0` alone. `docs({ topic: 'browser' })`.
105
- - **2026-10-21 — `verify` creates its own test users and can run users at the
106
- same time (CLI 0.37.46 or later).** An actor `{ "test_user": true }` gets a
107
- verified test user for the run, and `verify` asks the platform to delete it
108
- when the run ends unless you pass `--keep-test-users`. A
109
- `{ "parallel": [...] }` item runs 2–3 users' segments at once, for realtime
110
- checks. `docs({ topic: 'browser' })`.
111
- - **2026-10-21 — a magic-link request for something that is not an email address
112
- answers 400.** It answers `400 VALIDATION_ERROR` under the same address
113
- rule as sign-up, before anything is stored. `docs({ topic: 'sw.auth' })`.
114
- - **2026-10-20 — browser and `verify` `auth: { user_id }` signs in managed test
115
- users only.** A seeded session for an ordinary app user answers
116
- `AUTH_INVALID_CREDS`; sign real accounts in through your app's UI. Create
117
- managed test users with
118
- `somewhere api POST /v1/auth/test-users -d '{"project_id":"<project>","count":2}'`,
119
- or use `test_user` actors (entry above). `docs({ topic: 'browser' })`.
120
- - **2026-10-20 — app users' files are private by default.** A signed-in
121
- `sw.fs` call reaches only a declared file collection's files (as its rules
122
- allow), public files, and files that user already owns; anything else answers
123
- 403 `FILE_ACCESS_DENIED` (writes) or 404 (reads). Files a function keeps for
124
- a user use `sw.fs.server` after the function's own check.
125
- `docs({ topic: 'sw.fs' })`
126
-
127
- - **2026-10-20 — browser and `verify` reports say where the time went.** Each
128
- report includes `timing`: admission wait, browser start or reuse, page setup,
129
- first navigation, actions and total. `docs({ topic: 'browser' })`
130
-
131
- - **2026-10-20 — `email_verified` is a boolean in the access token and
132
- `/me`.** Nothing to change unless your code compared it to `1`.
133
-
134
- - **2026-10-20 — email verification, magic links and app invites work on
135
- per-app sign-in stores.** On apps that sign users in through the per-app
136
- sign-in store (new apps since 2026-10-19, and existing apps after their
137
- sign-in migration), sign-up mail carries a verification code, and group
138
- joins that need a verified email accept those users.
139
- Nothing to change in your code. `docs({ topic: 'sw.auth' })`
140
-
141
- - **2026-10-20 — notifications, managed email and push reach these apps' users
142
- again.** On apps that sign users in through the per-app sign-in store (new
143
- apps since 2026-10-19, and existing apps after their sign-in migration),
144
- notification sends were refused with `APP_USER_NOT_FOUND`, notification reads
145
- with `AUTH_REQUIRED`, and managed-sender `sw.email` sends with 422
146
- `MANAGED_SENDER_RECIPIENT_NOT_A_USER`. Nothing to change in your code.
147
- `docs({ topic: 'sw.notifications' })`
148
-
149
- - **2026-10-24 — sign-in identity and billing are separate.** Auth users no
150
- longer carry `plan`, `plan_status` or `entitlements`. Read billing
151
- explicitly from an authenticated function. React `useEntitlements` and
152
- `Gate` take a billing observation; `PricingTable` takes `currentPlan`.
153
- Missing observations are not free plans. `docs({ topic: 'sw.billing' })`
154
-
155
- - **2026-10-20 — password sign-in limits are per source and per account.** Up
156
- to 600 sign-in attempts a minute per source and 30 a minute per account; 10
157
- consecutive wrong passwords lock the account for 15 minutes. Refusals are 429
158
- `RATE_LIMITED` with `retry_after_ms`. Nothing to change in your code.
159
- `docs({ topic: 'sw.auth', section: 'automatic-password-sign-in-protection' })`
160
-
161
- - **2026-10-19 — browser and `verify` limits are the same on every plan.** Up
162
- to 10 runs at once per account, no daily run count, and a 50 browser-hour
163
- daily abuse limit. A refusal says which limit applied and when it resets.
164
- `docs({ topic: 'browser' })`
165
-
166
- - **2026-10-19 — writes report `live_delivery`.** A write that affects a live
167
- view returns `{ delivery: 'queued' }` (watchers refetch just after the
168
- response) or `{ delivery: 'resync_required' }`. Neither means the write
169
- failed: never retry a committed write because of it.
170
- `docs({ topic: 'sw.db' })`
171
-
172
- - **2026-10-19 — test-inbox messages include `verification_code`.** A test
173
- user can be signed up and verified without parsing email HTML.
174
- `docs({ topic: 'sw.email' })`
175
-
176
- - **2026-10-18 — group owners can delete a group, and owners and admins can
177
- add an existing user directly.** `sw.groups.delete(request, groupId)` and
178
- `sw.groups.add(request, groupId, userId, role)`; invites still cover people
179
- who aren't users yet. `docs({ topic: 'sw.groups' })`
180
-
181
- - **2026-10-18 — a bare `id()` is a random text key on new tables.** Use
182
- `id({ uuid: false })` for an integer key. A live integer table whose source
183
- says bare `id()` is refused at deploy with the one-line fix, and foreign keys
184
- must match the parent's key type. `docs({ topic: 'declared-data' })`
185
-
186
- - **2026-10-18 — `db_browse` reads managed tables.** Raw dump and query cover
187
- only the raw database and point to `db_browse` for managed rows.
188
-
189
- - **2026-10-18 — jobs: 100 at once on every plan, and cron runs don't use job
190
- slots.** Up to 100 jobs queued, scheduled or running per account on every
191
- plan; job creation allows 600 calls a minute per account owner.
192
- `docs({ topic: 'sw.jobs' })`
193
-
194
- - **2026-10-18 — a job's `timeout_seconds` is its deadline.** A job that
195
- times out fails with `JOB_TIMEOUT` and is not sent again. In functions
196
- deployed after this change, the platform refuses new covered `sw.*` calls
197
- from a handler once its job has ended; work already accepted can finish, and
198
- the exact limits are in `sw.jobs`. Write handlers so a later run can pick up
199
- safely. `docs({ topic: 'sw.jobs' })`
200
-
201
- - **2026-10-18 — once-a-minute crons fire every minute.** They had been
202
- firing about every other minute. Nothing to change in your code.
203
-
204
- - **2026-10-17 — a `sw.endpoint` written without `auth` is refused at
205
- deploy.** 400 `ENDPOINT_AUTH_OMITTED` names the file and line; write
206
- `auth: 'none'` for an endpoint that is public on purpose. Endpoints already
207
- deployed keep running. `docs({ topic: 'sw.endpoint' })`
208
-
209
- - **2026-10-17 — the in-app notification inbox works on new projects.** Each
210
- user keeps their newest 1,000 notifications for up to 90 days.
211
- `docs({ topic: 'sw.notifications' })` Clarified 2026-10-20: from 2026-10-19
212
- to 2026-10-20, on apps that sign users in through the per-app sign-in store
213
- (new apps since 2026-10-19, and existing apps after their sign-in migration),
214
- sends were refused with `APP_USER_NOT_FOUND`; fixed on 2026-10-20 (entry
215
- above).
216
-
217
- - **2026-10-17 — rate-limit windows reset when they end.** Steady traffic is no
218
- longer refused after hours of use. Nothing to change in your code.
219
-
220
- - **2026-10-17 — find users by email from server code.**
221
- `sw.auth.server.listUsers({ emails })` looks up users by exact address.
222
- `docs({ topic: 'sw.auth', section: 'member-contacts' })`
223
-
224
- - **2026-10-11 — previews for signed-in accounts on every plan.** Signed-in
225
- Free accounts include `somewhere preview` (private hosted previews,
226
- promote, and the separate preview database), so every plan has it;
227
- anonymous accounts cannot create previews. Nothing was removed from any plan.
228
- Capacity per plan: `docs({ topic: 'dev-environments' })`.
229
- - **2026-09-20 — eligible public pages and assets on your own host are served
230
- before the routing check, not after it.** On a project host or a custom
231
- domain, a `GET` or `HEAD` for a page, a compiled asset or a public file
232
- — answered from a route that location resolved recently — is served while
233
- the routing check runs behind the response. For up to 60 seconds after a
234
- deploy, a location that missed the update can still answer with the previous
235
- release; past that window, and whenever there is no recent route to go on,
236
- the request is exact, and a failed check never extends the window. Requests
237
- that are not plain `GET`/`HEAD`, preview and development addresses, group
238
- and platform-overlay surfaces, and the platform's own
239
- addresses resolve the route before answering, as before. Nothing to change in
240
- your code. `docs({ topic: 'speed' })`.
241
- - **2026-09-19 — public reads may be served from a shared copy; a declared
242
- write drops it.** On a table declaring `client.publicRead`, a `list`,
243
- `get` or related-record page requested with no session, no visitor
244
- cookie and no `Authorization` may be answered from a shared copy kept
245
- close to readers. A committed declared write or transaction to that table
246
- invalidates the copy asynchronously. Allow up to
247
- 120 seconds from when the database produced it
248
- for every anonymous reader to see an edit, deletion or withdrawal. Reads carrying any
249
- identity, and every owner, member and private read, are unchanged and
250
- exact. Developer SQL writes are not declared operations and are picked up
251
- only when the copy expires. `docs({ topic: 'declared-data' })`.
252
- - **2026-09-19 — composed aggregates.** `sw.db.aggregate` and
253
- `sw.db.server.aggregate` compose count / sum / avg / min / max with
254
- `groupBy`, `where`, `has`, `having`, `order` and `limit`,
255
- with the caller's row permissions in the same WHERE. The generated browser
256
- client gains `aggregate` on every table with a `read` grant, over
257
- readable fields only; grouped calls return at most 100 groups and report
258
- `has_more`. Nothing existing changes. `docs({ topic: 'sw.db' })`.
259
- - **2026-09-19 — `belongsTo` relations.** `relations: { project:
260
- belongsTo('projects', 'project_id') }` on the table that holds the key is
261
- the inverse of `hasMany`. In functions, `include: ['project']` nests
262
- the single parent row, or `null` when the parent is missing or not
263
- readable by the caller; `has: { project: { … } }` filters by it. The
264
- browser client adds no method; read a parent with `get`.
265
- `docs({ topic: 'sw.db' })`.
266
- - **2026-09-06 — the outbound guard refuses literal blocked targets.** A request that reaches the platform's outbound guard with a
267
- non-public address or internal hostname, embedded `user:password`, a
268
- non-HTTP scheme, or a port other than 80, 443 or 1024 and above gets a 403
269
- with `x-sw-outbound-error` before it leaves. Requests to public hosts are
270
- unchanged, and the runtime's own checks still run first. Preview functions
271
- still cannot fetch at all (`DRAFT_EGRESS_DENIED`).
272
- `docs({ topic: 'sw.fetch' })`.
273
- - **2026-09-02 — local dev reaches your project's database and files on
274
- every plan.** Running `somewhere dev` on your own machine reads and writes
275
- the project's own database and files on Free and Builder as well as Pro and
276
- Scale. Nothing to enable, no setup step, and it is the same database and the
277
- same files the deployed app uses — a project with a published release behaves
278
- like one that has never been deployed, so local writes are production writes.
279
- No current plan returns `LOCAL_DEV_DB_NOT_ENABLED`. Preview (`somewhere
280
- preview`, private previews, promote, the dev/prod split and its separate
281
- database) is a different product, on every plan since 2026-10-11. `docs({ topic: 'local-dev' })`.
282
- - **2026-09-02 — whole numbers wider than a JSON number travel as strings, in
283
- both directions.** A whole number above `9007199254740991` written as a JSON
284
- number in a request body — `db_query` / `db_batch` parameters, a structured
285
- write's values, an `api` body — is rounded by JSON itself before the platform
286
- ever sees it. Those requests are refused before anything is written, with
287
- `NUMBER_PRECISION_LOST` naming the field, the digits you sent and the number
288
- that arrived. Send such a value as a string (`"9223372036854775807"`): that is
289
- the same exact form a read returns, so a value read out of the database writes
290
- straight back. `sw.db.insert` / `sw.db.update` accept that string on a
291
- declared `integer` column. A dump emits such a value as a bare numeric
292
- literal, so a restore produces a whole number again. Whole numbers up to `9007199254740991`, decimals, and any larger whole number
293
- a JSON number carries exactly are written as sent.
294
- `docs({ topic: 'sw.db' })`.
295
- - **2026-09-02 — structured writes return 64-bit whole numbers intact.**
296
- `sw.db.insert`, `sw.db.update` and `sw.db.remove` project their affected row
297
- through the same exact-decimal-string cast reads already use, so a write that
298
- touches a row holding a 64-bit id (a Snowflake id, an imported `bigint`)
299
- returns normally instead of reporting `DATABASE_VALUE_TOO_LARGE` after the
300
- write succeeded. On a SQL-mode project raw `sw.db.query` is never rewritten, so
301
- cast the column yourself in your own `RETURNING` clause.
302
- `docs({ topic: 'sw.db' })`.
303
- - **2026-09-02 — cron has a plan minimum fire interval.** Creating or editing a
304
- schedule tighter than the plan allows is refused with
305
- `CRON_SCHEDULE_TOO_FREQUENT`; existing schedules are not re-checked and keep
306
- running unchanged. Read the plan's interval from `cron_list({ project_id })`.
307
- `docs({ topic: 'cron' })`.
308
- - **2026-09-01 — empty AI completions say whose problem they are.**
309
- `/v1/ai/complete` still answers `MODEL_EMPTY_RESPONSE` when a model produces
310
- no text, and the status splits the class: HTTP 422 `retry: false` when the
311
- request is yours to fix, with the cause, stop reason, and token counts in
312
- `data`; HTTP 502 `retry: true` only on a genuine provider failure worth
313
- retrying — 5xx is theirs, 4xx is yours. `docs({ topic: 'sw.ai' })`.
314
-
315
- ## Where the rest of the history lives
316
-
317
- This log carries behaviour changes, not the release feed. Per-project deploy
318
- history is `project_deploys`; what a specific deploy changed is
319
- `project_diff_versions`. If a documented contract looks wrong, report it with
320
- `support_ticket({ message })`; the team replies on that ticket
321
- (`docs({ topic: 'feedback' })`).
322
-
323
- Related: `troubleshooting`, `guarantees`, `feedback`.