@terreno/jobs 58.0.0-beta.1 → 58.0.0-beta.3
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 +93 -0
- package/package.json +9 -3
- package/biome.jsonc +0 -21
- package/bunfig.toml +0 -5
- package/e2e/smoke.ts +0 -194
- package/tsconfig.json +0 -18
- package/tsconfig.typecheck.json +0 -18
package/CHANGELOG.md
CHANGED
|
@@ -20,6 +20,99 @@ Upgrade notes for consumer action live in [`mcp-server/src/docs/upgrades/`](mcp-
|
|
|
20
20
|
|
|
21
21
|
Unreleased changes live in [`changelog/unreleased/`](changelog/unreleased/). Add one Markdown file per feature (see that directory's README) instead of editing this section.
|
|
22
22
|
|
|
23
|
+
## [58.0.0-beta.3] - 2026-11-03
|
|
24
|
+
|
|
25
|
+
Upgrade note: [`mcp-server/src/docs/upgrades/58.0.0-beta.3.md`](mcp-server/src/docs/upgrades/58.0.0-beta.3.md).
|
|
26
|
+
|
|
27
|
+
### Breaking
|
|
28
|
+
|
|
29
|
+
- Terreno 58 targets Expo SDK 58 (`~58.0.14`), React Native `0.88.0`, and React `19.3.0`. `@terreno/ui` peers `react-native` `0.88.0`. Native catalog moves with the SDK: `react-native-gesture-handler` `~3.3.0`, `react-native-reanimated` `4.7.1` + `react-native-worklets` `0.13.0`, `react-native-screens` `~4.30.0`, `react-native-webview` `14.0.1`, `@sentry/react-native` `~8.28.0`, `@shopify/flash-list` `2.3.2`, `@shopify/react-native-skia` `2.14.0`. Rebuild dev clients and store binaries.
|
|
30
|
+
- Expo Router 58: set `export const unstable_settings = {initialRouteName}` on the layout instead of passing `initialRouteName` to `<Slot>` / navigators. `SidebarNavigation` ignores the prop.
|
|
31
|
+
- Expo Router 58 static rendering: a custom `app/+html.tsx` must render `headNodes` and `bodyNodes` from `useServerDocumentContext()` (`expo-router/html`), or exported pages ship without their JavaScript. `example-frontend` is updated.
|
|
32
|
+
- React Native 0.88 generated types: type refs as `ViewInstance`, `TextInstance`, `ScrollViewInstance`, and `TextInputInstance` (`Box.scrollRef`, `TextField.inputRef`, `Text` `ref`).
|
|
33
|
+
- `create-terreno-app` scaffolds Expo `~58.0.14`, React Native `0.88.0`, and React `19.3.0`.
|
|
34
|
+
- The Terreno 58 native module baseline lands in `example-frontend` and `demo`: `@stripe/stripe-react-native` 0.81.0, `react-native-purchases` and `react-native-purchases-ui` 10.12.2, `expo-device`, `expo-crypto`, `expo-local-authentication`, `expo-system-ui`, and `expo-build-properties` (Android Kotlin 2.2.21 and `compileSdkVersion` 37 pins). Rebuild every dev client and store binary. `react-native-otp-verify` is left out because it does not support the New Architecture. The demo has a hidden **Native Modules** page that shows each module's version and whether the running binary links it. See the 58.0.0 upgrade note.
|
|
35
|
+
- `TerrenoApp` turns HTTP rate limiting on by default. Omitting `rateLimit` now mounts the limiter with the memory store (auth 20 / 15 min, api 600 / 15 min). Pass `rateLimit: false` to turn it off. On Cloud Run pass `rateLimit: {trustProxy: 1}` so unauthenticated traffic keys by client IP. See the 58.0.0 upgrade note.
|
|
36
|
+
- `@terreno/admin-frontend` no longer takes an RTK `api`. The `api` prop is removed from every admin component (`AdminProvider`, `AdminShellLayout`, `AdminHome`, `AdminModelList`, `AdminModelTable`, `AdminModelForm`, `AdminScreenRouter`, `ConfigurationScreen`, `DocumentStorageBrowser`, `ConsentHistory`, comms, jobs, org, consent, and announcement screens, and widget props), and admin hooks drop their `api` argument (`useAdminConfig(apiBase)`, `useAdminScripts(apiBase)`, `useAdminRoles(apiBase)`, `useConfigurationApi({basePath})`, `useDocumentStorageApi(basePath)`, `useConsentHistory(baseUrl)`, `useOrganizationsApi(basePath)`, `useCommsDashboardApi()`, `useJobsDashboardApi()`, and the `useAiObservability*Api()` hooks).
|
|
37
|
+
- `useAdminApi(api, routePath, modelName)` is removed. Use `useAdminModelApi(routePath, modelName)`, which keeps the same hook names and calls the same `/admin/{routePath}` URLs through the admin fetch client. `AdminApi`, `EndpointBuilder`, and admin `injectEndpoints` are gone; `@reduxjs/toolkit` and `react-redux` are no longer peers of admin-frontend.
|
|
38
|
+
- `AdminProvider` is now the required auth binding for every admin request, including ObjectId and API-only model CRUD. Cookie SPAs pass `credentials="same-origin"`; embedded apps pass `apiOrigin` and `getAuthHeaders`. Product screens that reuse admin components wrap them in `AdminProvider`. See the 58.0.0 upgrade guide.
|
|
39
|
+
- Removed the legacy RTK realtime path. Use `sync` on `modelRouter` with `@terreno/syncdb` for live collection updates. `RealtimeApp`, `SyncApp`, socket auth, `sync:delta`, and admin `admin:model.changed` events are unchanged. See the 58.0.0 upgrade note.
|
|
40
|
+
- `@terreno/api`: `modelRouter` no longer accepts `realtime` (now a TypeScript error), and the change stream no longer emits the `sync` websocket event. Removed `RealtimeConfig`, `RealtimeEvent`, `DocumentSubscription`, `QuerySubscription`, `registerRealtime`, `getRealtimeRegistry`, `findRegistryEntryByCollection`, `findRegistryEntryByRoutePath`, `updateRealtimeRegistryOptions`, `clearRealtimeRegistry`, `RealtimeRegistryEntry`, the query-subscription store (`addQuerySubscription`, `removeQuerySubscription`, `removeAllSocketQueries`, `getQuerySubscriptionsForCollection`, `computeQueryId`, `clearQueryStore`), and `MAX_MODEL_SUBSCRIPTIONS` / `MAX_DOCUMENT_SUBSCRIPTIONS` / `MAX_QUERY_SUBSCRIPTIONS`. Sockets no longer handle `subscribe:model`, `subscribe:document`, or `subscribe:query`.
|
|
41
|
+
- `@terreno/rtk`: removed `realtimeList`, `realtimeDocument`, `setRealtimeSocket`, `getRealtimeSocket`, `useSyncConnection`, and the `RealtimeEvent` type. The rest of `@terreno/rtk` (including `useSocketConnection` and `useRealtimeDebug`) is removed in the same release; see `remove-rtk.md`.
|
|
42
|
+
- Removed `@terreno/rtk` and every Redux dependency (`@reduxjs/toolkit`, `react-redux`, `redux-persist`, `@rtk-query/codegen-openapi`). `@terreno/rtk` is not published for 58. `@terreno/syncdb` is the only frontend data, request, and session layer. Follow `docs/how-to/migrate-rtk-to-syncdb.md`, which maps every removed export to its replacement, and the 58.0.0 upgrade note.
|
|
43
|
+
- Apps upgrading from `@terreno/rtk` must install `expo-constants` and `expo-network` themselves (rtk depended on them; `@terreno/syncdb` lists them as optional peers), plus the optional peers for the features they use: `better-auth`, `@better-auth/expo`, `@better-auth/passkey`, `@openfeature/web-sdk`, `@openfeature/react-sdk`, `@modelcontextprotocol/client`. See the upgrade note.
|
|
44
|
+
- `@terreno/syncdb` adds `@terreno/syncdb/api` (`createApiClient`, `ApiError`), request hooks in `@terreno/syncdb/react` (`ApiClientProvider`, `useApiQuery`, `useLazyApiQuery`, `useApiMutation`, `useSocketEvent`), `@terreno/syncdb/config` (`baseUrl`, `baseWebsocketsUrl`, `appHeaders`), `@terreno/syncdb/auth` (`createBetterAuthClient`, `SessionProvider`, `useSession`, `jwtAuthAdapter`, `useJwtAuth`, token-expiry helpers), `@terreno/syncdb/flags` (`useFeatureFlags`, `useTerrenoFeatureFlags` on the sync socket), `@terreno/syncdb/app` (`useUpgradeCheck`, `hasPermission`, `canOpenAdminPage`, `installDevConsoleLogger`, `useMCPTools`), and `@terreno/syncdb/buildNumber`.
|
|
45
|
+
- `terreno-syncdb-codegen --api-out` generates typed hooks for every non-synced OpenAPI operation (same names as the RTK codegen), replacing `@rtk-query/codegen-openapi`. `bun run sdk` writes `store/apiSdk.ts`.
|
|
46
|
+
- `@terreno/ui` `ConsentNavigator`, `AnnouncementNavigator`, `useConsentForms`, `useSubmitConsent`, `useAnnouncements`, and `useAcknowledgeAnnouncement` take a request `client` instead of an RTK `api`.
|
|
47
|
+
- `GptHistory` (`gpt/histories`) is a synced collection and keeps its ObjectId `_id` (no migration). `McpServiceToken` (`mcp/service-tokens`, read-only) is a synced collection with String ids; run `mcpServiceTokenStringIdsMigration` (`@terreno/api`) before deploying 58 frontends.
|
|
48
|
+
- `create-terreno-app`, the `terreno_bootstrap` prompt, and the `terreno_generate_screen` tool scaffold apps without Redux or `@terreno/rtk`. The terreno-mcp-local `get_rtk_state` tool, the MCP resource `terreno://docs/rtk`, and `terreno state --slice rtk` are removed; use `get_syncdb_state` and `terreno state`.
|
|
49
|
+
|
|
50
|
+
### Added
|
|
51
|
+
|
|
52
|
+
- `DataTable` columns size themselves when `width` is omitted. Each auto column starts at the wider of its header and its content (sampled from at most 50 rows, measured with a canvas on web and estimated on native), clamped to 80–360px, and auto columns grow to fill the table's container. Columns that set `width` keep it. `DataTableColumn.width` is now optional.
|
|
53
|
+
- `@terreno/syncdb` `createSyncDb({idFormats})` mints 24-hex ObjectIds for a collection set to `"objectId"`, so a model that keeps Mongoose's default ObjectId `_id` can sync without migrating its ids. `mutate()` throws on an explicit non-hex id for such a collection. `generateObjectId` and the `SyncIdFormat` type are exported.
|
|
54
|
+
- Sync `validation` nacks carry an optional `reason`: `invalid_id` when an ObjectId-keyed collection gets a non-hex id (rejected before the mutation is claimed), and `id_collision` when a create names an `_id` another document holds. A collision never touches the existing document and its message never names the holder. The ledger records the reason (`SyncMutation.nackReason`) so a redelivery replays it.
|
|
55
|
+
- `GET /sync/entities` leaves out non-hex ids for an ObjectId-keyed model instead of answering 400, so a rejected create queued for repair cannot fail the rest of the repair batch.
|
|
56
|
+
|
|
57
|
+
### Changed
|
|
58
|
+
|
|
59
|
+
- The repository's agent rules now generate with rulesync 17 (up from 9). The root rule `.rulesync/rules/00-root.md` now generates `AGENTS.md`, which Devin and other AGENTS.md readers load, in place of `.devin/rules/00-root.md`. Never edit `AGENTS.md` by hand: edit the root rule and run `bun run rules`. The examples that existed only in the old hand-edited `AGENTS.md` (syncdb and RTK SDK usage) moved into the root rule, so `CLAUDE.md`, the Cursor root rule, and Copilot instructions get them too. Links in the root rule now resolve from the repository root. Generated Copilot hooks use the portable `command` field. Generated Copilot subagents no longer list `agent/runSubagent` as their only tool, so they get every default tool. Generated skills carry their `license`, `disable-model-invocation`, and Devin `triggers` frontmatter.
|
|
60
|
+
- `@terreno/syncdb/auth` `SessionProvider`: `logout()` no longer clears the session before the server answers. The session stays in the state until `authClient.signOut()` finishes (`signOutTimeoutMs`, default 10 seconds), and then it is cleared. Meanwhile the new `isSigningOut` state (`useSession().isSigningOut`) is true; `isLoading` is left alone, so a navigator gated on it keeps its screen. Before, a login screen that opened at once could find the still-live session and sign the user straight back in. A sign-out that fails or times out checks the session first. A session that is still live, or a cookie or native session the server cannot be asked about, stays signed in, and `error` is set to `SIGN_OUT_FAILED_MESSAGE` ("Couldn't sign out. Check your connection and try again."). A web bearer client, which drops its token before the request leaves, ends signed out. The global `auth/logout` action (a refused session) now ends signed out even when the sign-out request fails. With `apisToReset` (57.17.0), `logout()` purges the cache when the session clears, not when it is dispatched: a purge at dispatch refetched every mounted screen mid-sign-out, and a refetch that could not reach the server answered 401 and signed the user out even though the sign-out failed. A failed sign-out keeps both the session and the cache. The global `auth/logout` action still purges at once (only the first of several in flight) and again when the session clears. A sign-in for another user that lands while a sign-out is in flight is kept; a sign-out that started signed out asks `getSession` first, so a restore of the session it revoked is cleared. Show `selectBetterAuthIsSigningOut` on the sign-out control and `selectBetterAuthError` after a failed sign-out.
|
|
61
|
+
|
|
62
|
+
### Removed
|
|
63
|
+
|
|
64
|
+
- `@terreno/ui` no longer exports the `Filter` and `FilterProps` aliases deprecated in 57.7.0. Import `DropdownPanel` and `DropdownPanelProps` instead. `FilterSelectMenu`, `FilterBoolean`, `FilterAccordion`, and `FilterChangesBadge` keep their names.
|
|
65
|
+
|
|
66
|
+
### Fixed
|
|
67
|
+
|
|
68
|
+
- `@terreno/syncdb`: logging out while `syncDb.start()` is still running no longer loses local writes or logs errors. `start()` now resolves the web encryption key from `GET /sync/key` before it loads the store, so the flush in `stop()` never needs the network after the session has ended. A `stop()` or `signOut()` call now cancels a `start()` that is running or queued ahead of it, so the transport never connects without a session. A failed key fetch is now retried on the next save instead of failing every save for the rest of the session.
|
|
69
|
+
|
|
70
|
+
## [58.0.0-beta.2] - 2026-11-03
|
|
71
|
+
|
|
72
|
+
Upgrade note: [`mcp-server/src/docs/upgrades/58.0.0-beta.2.md`](mcp-server/src/docs/upgrades/58.0.0-beta.2.md).
|
|
73
|
+
|
|
74
|
+
### Breaking
|
|
75
|
+
|
|
76
|
+
- Terreno 58 targets Expo SDK 58 (`~58.0.14`), React Native `0.88.0`, and React `19.3.0`. `@terreno/ui` peers `react-native` `0.88.0`. Native catalog moves with the SDK: `react-native-gesture-handler` `~3.3.0`, `react-native-reanimated` `4.7.1` + `react-native-worklets` `0.13.0`, `react-native-screens` `~4.30.0`, `react-native-webview` `14.0.1`, `@sentry/react-native` `~8.28.0`, `@shopify/flash-list` `2.3.2`, `@shopify/react-native-skia` `2.14.0`. Rebuild dev clients and store binaries.
|
|
77
|
+
- Expo Router 58: set `export const unstable_settings = {initialRouteName}` on the layout instead of passing `initialRouteName` to `<Slot>` / navigators. `SidebarNavigation` ignores the prop.
|
|
78
|
+
- Expo Router 58 static rendering: a custom `app/+html.tsx` must render `headNodes` and `bodyNodes` from `useServerDocumentContext()` (`expo-router/html`), or exported pages ship without their JavaScript. `example-frontend` is updated.
|
|
79
|
+
- React Native 0.88 generated types: type refs as `ViewInstance`, `TextInstance`, `ScrollViewInstance`, and `TextInputInstance` (`Box.scrollRef`, `TextField.inputRef`, `Text` `ref`).
|
|
80
|
+
- `create-terreno-app` scaffolds Expo `~58.0.14`, React Native `0.88.0`, and React `19.3.0`.
|
|
81
|
+
- The Terreno 58 native module baseline lands in `example-frontend` and `demo`: `@stripe/stripe-react-native` 0.81.0, `react-native-purchases` and `react-native-purchases-ui` 10.12.2, `expo-device`, `expo-crypto`, `expo-local-authentication`, `expo-system-ui`, and `expo-build-properties` (Android Kotlin 2.2.21 and `compileSdkVersion` 37 pins). Rebuild every dev client and store binary. `react-native-otp-verify` is left out because it does not support the New Architecture. The demo has a hidden **Native Modules** page that shows each module's version and whether the running binary links it. See the 58.0.0 upgrade note.
|
|
82
|
+
- `TerrenoApp` turns HTTP rate limiting on by default. Omitting `rateLimit` now mounts the limiter with the memory store (auth 20 / 15 min, api 600 / 15 min). Pass `rateLimit: false` to turn it off. On Cloud Run pass `rateLimit: {trustProxy: 1}` so unauthenticated traffic keys by client IP. See the 58.0.0 upgrade note.
|
|
83
|
+
- `@terreno/admin-frontend` no longer takes an RTK `api`. The `api` prop is removed from every admin component (`AdminProvider`, `AdminShellLayout`, `AdminHome`, `AdminModelList`, `AdminModelTable`, `AdminModelForm`, `AdminScreenRouter`, `ConfigurationScreen`, `DocumentStorageBrowser`, `ConsentHistory`, comms, jobs, org, consent, and announcement screens, and widget props), and admin hooks drop their `api` argument (`useAdminConfig(apiBase)`, `useAdminScripts(apiBase)`, `useAdminRoles(apiBase)`, `useConfigurationApi({basePath})`, `useDocumentStorageApi(basePath)`, `useConsentHistory(baseUrl)`, `useOrganizationsApi(basePath)`, `useCommsDashboardApi()`, `useJobsDashboardApi()`, and the `useAiObservability*Api()` hooks).
|
|
84
|
+
- `useAdminApi(api, routePath, modelName)` is removed. Use `useAdminModelApi(routePath, modelName)`, which keeps the same hook names and calls the same `/admin/{routePath}` URLs through the admin fetch client. `AdminApi`, `EndpointBuilder`, and admin `injectEndpoints` are gone; `@reduxjs/toolkit` and `react-redux` are no longer peers of admin-frontend.
|
|
85
|
+
- `AdminProvider` is now the required auth binding for every admin request, including ObjectId and API-only model CRUD. Cookie SPAs pass `credentials="same-origin"`; embedded apps pass `apiOrigin` and `getAuthHeaders`. Product screens that reuse admin components wrap them in `AdminProvider`. See the 58.0.0 upgrade guide.
|
|
86
|
+
- Removed the legacy RTK realtime path. Use `sync` on `modelRouter` with `@terreno/syncdb` for live collection updates. `RealtimeApp`, `SyncApp`, socket auth, `sync:delta`, and admin `admin:model.changed` events are unchanged. See the 58.0.0 upgrade note.
|
|
87
|
+
- `@terreno/api`: `modelRouter` no longer accepts `realtime` (now a TypeScript error), and the change stream no longer emits the `sync` websocket event. Removed `RealtimeConfig`, `RealtimeEvent`, `DocumentSubscription`, `QuerySubscription`, `registerRealtime`, `getRealtimeRegistry`, `findRegistryEntryByCollection`, `findRegistryEntryByRoutePath`, `updateRealtimeRegistryOptions`, `clearRealtimeRegistry`, `RealtimeRegistryEntry`, the query-subscription store (`addQuerySubscription`, `removeQuerySubscription`, `removeAllSocketQueries`, `getQuerySubscriptionsForCollection`, `computeQueryId`, `clearQueryStore`), and `MAX_MODEL_SUBSCRIPTIONS` / `MAX_DOCUMENT_SUBSCRIPTIONS` / `MAX_QUERY_SUBSCRIPTIONS`. Sockets no longer handle `subscribe:model`, `subscribe:document`, or `subscribe:query`.
|
|
88
|
+
- `@terreno/rtk`: removed `realtimeList`, `realtimeDocument`, `setRealtimeSocket`, `getRealtimeSocket`, `useSyncConnection`, and the `RealtimeEvent` type. The rest of `@terreno/rtk` (including `useSocketConnection` and `useRealtimeDebug`) is removed in the same release; see `remove-rtk.md`.
|
|
89
|
+
- Removed `@terreno/rtk` and every Redux dependency (`@reduxjs/toolkit`, `react-redux`, `redux-persist`, `@rtk-query/codegen-openapi`). `@terreno/rtk` is not published for 58. `@terreno/syncdb` is the only frontend data, request, and session layer. Follow `docs/how-to/migrate-rtk-to-syncdb.md`, which maps every removed export to its replacement, and the 58.0.0 upgrade note.
|
|
90
|
+
- `@terreno/syncdb` adds `@terreno/syncdb/api` (`createApiClient`, `ApiError`), request hooks in `@terreno/syncdb/react` (`ApiClientProvider`, `useApiQuery`, `useLazyApiQuery`, `useApiMutation`, `useSocketEvent`), `@terreno/syncdb/config` (`baseUrl`, `baseWebsocketsUrl`, `appHeaders`), `@terreno/syncdb/auth` (`createBetterAuthClient`, `SessionProvider`, `useSession`, `jwtAuthAdapter`, `useJwtAuth`, token-expiry helpers), `@terreno/syncdb/flags` (`useFeatureFlags`, `useTerrenoFeatureFlags` on the sync socket), `@terreno/syncdb/app` (`useUpgradeCheck`, `hasPermission`, `canOpenAdminPage`, `installDevConsoleLogger`, `useMCPTools`), and `@terreno/syncdb/buildNumber`.
|
|
91
|
+
- `terreno-syncdb-codegen --api-out` generates typed hooks for every non-synced OpenAPI operation (same names as the RTK codegen), replacing `@rtk-query/codegen-openapi`. `bun run sdk` writes `store/apiSdk.ts`.
|
|
92
|
+
- `@terreno/ui` `ConsentNavigator`, `AnnouncementNavigator`, `useConsentForms`, `useSubmitConsent`, `useAnnouncements`, and `useAcknowledgeAnnouncement` take a request `client` instead of an RTK `api`.
|
|
93
|
+
- `GptHistory` (`gpt/histories`) is a synced collection and keeps its ObjectId `_id` (no migration). `McpServiceToken` (`mcp/service-tokens`, read-only) is a synced collection with String ids; run `mcpServiceTokenStringIdsMigration` (`@terreno/api`) before deploying 58 frontends.
|
|
94
|
+
- `create-terreno-app`, the `terreno_bootstrap` prompt, and the `terreno_generate_screen` tool scaffold apps without Redux or `@terreno/rtk`. The terreno-mcp-local `get_rtk_state` tool, the MCP resource `terreno://docs/rtk`, and `terreno state --slice rtk` are removed; use `get_syncdb_state` and `terreno state`.
|
|
95
|
+
|
|
96
|
+
### Added
|
|
97
|
+
|
|
98
|
+
- `DataTable` columns size themselves when `width` is omitted. Each auto column starts at the wider of its header and its content (sampled from at most 50 rows, measured with a canvas on web and estimated on native), clamped to 80–360px, and auto columns grow to fill the table's container. Columns that set `width` keep it. `DataTableColumn.width` is now optional.
|
|
99
|
+
- `@terreno/syncdb` `createSyncDb({idFormats})` mints 24-hex ObjectIds for a collection set to `"objectId"`, so a model that keeps Mongoose's default ObjectId `_id` can sync without migrating its ids. `mutate()` throws on an explicit non-hex id for such a collection. `generateObjectId` and the `SyncIdFormat` type are exported.
|
|
100
|
+
- Sync `validation` nacks carry an optional `reason`: `invalid_id` when an ObjectId-keyed collection gets a non-hex id (rejected before the mutation is claimed), and `id_collision` when a create names an `_id` another document holds. A collision never touches the existing document and its message never names the holder. The ledger records the reason (`SyncMutation.nackReason`) so a redelivery replays it.
|
|
101
|
+
- `GET /sync/entities` leaves out non-hex ids for an ObjectId-keyed model instead of answering 400, so a rejected create queued for repair cannot fail the rest of the repair batch.
|
|
102
|
+
|
|
103
|
+
### Changed
|
|
104
|
+
|
|
105
|
+
- The repository's agent rules now generate with rulesync 17 (up from 9). The root rule `.rulesync/rules/00-root.md` now generates `AGENTS.md`, which Devin and other AGENTS.md readers load, in place of `.devin/rules/00-root.md`. Never edit `AGENTS.md` by hand: edit the root rule and run `bun run rules`. The examples that existed only in the old hand-edited `AGENTS.md` (syncdb and RTK SDK usage) moved into the root rule, so `CLAUDE.md`, the Cursor root rule, and Copilot instructions get them too. Links in the root rule now resolve from the repository root. Generated Copilot hooks use the portable `command` field. Generated Copilot subagents no longer list `agent/runSubagent` as their only tool, so they get every default tool. Generated skills carry their `license`, `disable-model-invocation`, and Devin `triggers` frontmatter.
|
|
106
|
+
- `@terreno/syncdb/auth` `SessionProvider`: `logout()` no longer clears the session before the server answers. The session stays in the state until `authClient.signOut()` finishes (`signOutTimeoutMs`, default 10 seconds), and then it is cleared. Meanwhile the new `isSigningOut` state (`useSession().isSigningOut`) is true; `isLoading` is left alone, so a navigator gated on it keeps its screen. Before, a login screen that opened at once could find the still-live session and sign the user straight back in. A sign-out that fails or times out checks the session first. A session that is still live, or a cookie or native session the server cannot be asked about, stays signed in, and `error` is set to `SIGN_OUT_FAILED_MESSAGE` ("Couldn't sign out. Check your connection and try again."). A web bearer client, which drops its token before the request leaves, ends signed out. The global `auth/logout` action (a refused session) now ends signed out even when the sign-out request fails. With `apisToReset` (57.17.0), `logout()` purges the cache when the session clears, not when it is dispatched: a purge at dispatch refetched every mounted screen mid-sign-out, and a refetch that could not reach the server answered 401 and signed the user out even though the sign-out failed. A failed sign-out keeps both the session and the cache. The global `auth/logout` action still purges at once (only the first of several in flight) and again when the session clears. A sign-in for another user that lands while a sign-out is in flight is kept; a sign-out that started signed out asks `getSession` first, so a restore of the session it revoked is cleared. Show `selectBetterAuthIsSigningOut` on the sign-out control and `selectBetterAuthError` after a failed sign-out.
|
|
107
|
+
|
|
108
|
+
### Removed
|
|
109
|
+
|
|
110
|
+
- `@terreno/ui` no longer exports the `Filter` and `FilterProps` aliases deprecated in 57.7.0. Import `DropdownPanel` and `DropdownPanelProps` instead. `FilterSelectMenu`, `FilterBoolean`, `FilterAccordion`, and `FilterChangesBadge` keep their names.
|
|
111
|
+
|
|
112
|
+
### Fixed
|
|
113
|
+
|
|
114
|
+
- `@terreno/syncdb`: logging out while `syncDb.start()` is still running no longer loses local writes or logs errors. `start()` now resolves the web encryption key from `GET /sync/key` before it loads the store, so the flush in `stop()` never needs the network after the session has ended. A `stop()` or `signOut()` call now cancels a `start()` that is running or queued ahead of it, so the transport never connects without a session. A failed key fetch is now retried on the next save instead of failing every save for the rest of the session.
|
|
115
|
+
|
|
23
116
|
## [58.0.0-beta.1] - 2026-11-02
|
|
24
117
|
|
|
25
118
|
Upgrade note: [`mcp-server/src/docs/upgrades/58.0.0-beta.1.md`](mcp-server/src/docs/upgrades/58.0.0-beta.1.md).
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"url": "https://github.com/TerrenoLabs/terreno/issues"
|
|
5
5
|
},
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@terreno/api": "58.0.0-beta.
|
|
7
|
+
"@terreno/api": "58.0.0-beta.3",
|
|
8
8
|
"cron": "^4.3.4",
|
|
9
9
|
"express": "^5.2.1",
|
|
10
10
|
"luxon": "^3.7.2"
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"description": "Durable background jobs plugin for @terreno/api — part of Terreno, the batteries-included TypeScript framework for universal apps.",
|
|
13
13
|
"devDependencies": {
|
|
14
14
|
"@biomejs/biome": "^2.3.6",
|
|
15
|
-
"@terreno/test": "58.0.0-beta.
|
|
15
|
+
"@terreno/test": "58.0.0-beta.3",
|
|
16
16
|
"@types/bun": "^1.4.0",
|
|
17
17
|
"@types/express": "^5.0.6",
|
|
18
18
|
"@types/luxon": "^3.7.1",
|
|
@@ -35,6 +35,12 @@
|
|
|
35
35
|
"types": "./dist/runners/vercelQueues.d.ts"
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
|
+
"files": [
|
|
39
|
+
"LICENSE",
|
|
40
|
+
"CHANGELOG.md",
|
|
41
|
+
"dist/**/*",
|
|
42
|
+
"src/**/*"
|
|
43
|
+
],
|
|
38
44
|
"homepage": "https://github.com/TerrenoLabs/terreno#readme",
|
|
39
45
|
"keywords": [
|
|
40
46
|
"background-jobs",
|
|
@@ -80,5 +86,5 @@
|
|
|
80
86
|
"typecheck": "tsc -p tsconfig.typecheck.json"
|
|
81
87
|
},
|
|
82
88
|
"types": "dist/index.d.ts",
|
|
83
|
-
"version": "58.0.0-beta.
|
|
89
|
+
"version": "58.0.0-beta.3"
|
|
84
90
|
}
|
package/biome.jsonc
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
|
|
3
|
-
"extends": ["../biome.jsonc"],
|
|
4
|
-
"files": {
|
|
5
|
-
"includes": [
|
|
6
|
-
"package.json",
|
|
7
|
-
"src/**/*.ts",
|
|
8
|
-
"src/**/*.tsx",
|
|
9
|
-
"e2e/**/*.ts",
|
|
10
|
-
"!!**/node_modules",
|
|
11
|
-
"!!node_modules",
|
|
12
|
-
"!!**/dist",
|
|
13
|
-
"!!dist",
|
|
14
|
-
"!!**/build",
|
|
15
|
-
"!!build",
|
|
16
|
-
"!!**/coverage",
|
|
17
|
-
"!!coverage"
|
|
18
|
-
]
|
|
19
|
-
},
|
|
20
|
-
"root": true
|
|
21
|
-
}
|
package/bunfig.toml
DELETED
package/e2e/smoke.ts
DELETED
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Real-process smoke for @terreno/jobs. Run `bun e2e/smoke.ts` after `bun run compile`.
|
|
3
|
-
*
|
|
4
|
-
* The smoke re-runs this file with `worker` as a child process: the compiled `@terreno/jobs`
|
|
5
|
-
* `JobsApp` with its default `MongoJobRunner` poll loop, against `smokeMongoUri()`, plus a
|
|
6
|
-
* readiness route on a free port. The parent is the enqueuing process: it registers its own
|
|
7
|
-
* `JobsApp` with the same job definition, enqueues one job, and checks that the worker process
|
|
8
|
-
* ran the handler and marked the job completed. Exits non-zero on the first failed check.
|
|
9
|
-
*/
|
|
10
|
-
import {
|
|
11
|
-
freePort,
|
|
12
|
-
type SpawnedProcess,
|
|
13
|
-
smokeMongoUri,
|
|
14
|
-
spawnUntilReady,
|
|
15
|
-
stopSmokeMongo,
|
|
16
|
-
} from "@terreno/test";
|
|
17
|
-
import {DateTime} from "luxon";
|
|
18
|
-
|
|
19
|
-
const WORKER_ARG = "worker";
|
|
20
|
-
const JOB_NAME = "jobsSmoke/record";
|
|
21
|
-
const RUNS_COLLECTION = "jobsSmokeRuns";
|
|
22
|
-
const COMPLETION_TIMEOUT_MS = 15000;
|
|
23
|
-
const POLL_INTERVAL_MS = 100;
|
|
24
|
-
|
|
25
|
-
interface SmokePayload {
|
|
26
|
-
runId: number;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/** What the worker's handler writes, so the parent can see which process ran the job. */
|
|
30
|
-
interface SmokeRun {
|
|
31
|
-
jobId: string;
|
|
32
|
-
pid: number;
|
|
33
|
-
runId: number;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Child: a standalone worker, the shape of a dedicated jobs entrypoint. The handler records the
|
|
38
|
-
* job id and this process's pid. `/health` answers once the poll loop is running, and SIGTERM
|
|
39
|
-
* stops the worker before exiting. The packages are imported here, not at the top, so the
|
|
40
|
-
* parent's enqueue path loads them on its own.
|
|
41
|
-
*/
|
|
42
|
-
const work = async (): Promise<void> => {
|
|
43
|
-
const {logger} = await import("@terreno/api");
|
|
44
|
-
const {JobsApp} = await import("@terreno/jobs");
|
|
45
|
-
const {default: mongoose} = await import("mongoose");
|
|
46
|
-
|
|
47
|
-
await mongoose.connect(process.env.MONGO_URI as string);
|
|
48
|
-
|
|
49
|
-
const jobsApp = new JobsApp({pollIntervalMs: POLL_INTERVAL_MS});
|
|
50
|
-
jobsApp.define(JOB_NAME, {
|
|
51
|
-
handler: async (payload, ctx) => {
|
|
52
|
-
const run: SmokeRun = {
|
|
53
|
-
jobId: ctx.jobId,
|
|
54
|
-
pid: process.pid,
|
|
55
|
-
runId: (payload as SmokePayload).runId,
|
|
56
|
-
};
|
|
57
|
-
await mongoose.connection.collection(RUNS_COLLECTION).insertOne(run);
|
|
58
|
-
ctx.log.info(`[jobsSmoke] ran job ${ctx.jobId} in pid ${process.pid}`);
|
|
59
|
-
},
|
|
60
|
-
retry: {maxAttempts: 1},
|
|
61
|
-
});
|
|
62
|
-
await jobsApp.startWorker();
|
|
63
|
-
|
|
64
|
-
const server = Bun.serve({
|
|
65
|
-
fetch: () => {
|
|
66
|
-
const isWorkerActive = jobsApp.isWorkerActive();
|
|
67
|
-
return Response.json({worker: isWorkerActive}, {status: isWorkerActive ? 200 : 503});
|
|
68
|
-
},
|
|
69
|
-
hostname: "127.0.0.1",
|
|
70
|
-
port: Number(process.env.PORT),
|
|
71
|
-
});
|
|
72
|
-
process.once("SIGTERM", () => {
|
|
73
|
-
void (async (): Promise<void> => {
|
|
74
|
-
try {
|
|
75
|
-
await jobsApp.stopWorker();
|
|
76
|
-
await server.stop();
|
|
77
|
-
await mongoose.disconnect();
|
|
78
|
-
} finally {
|
|
79
|
-
process.exit(0);
|
|
80
|
-
}
|
|
81
|
-
})();
|
|
82
|
-
});
|
|
83
|
-
logger.info(`[jobsSmoke] worker polling, ready on port ${process.env.PORT}`);
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
/** Waits for the job to leave `pending`/`running`, and returns its final status. */
|
|
87
|
-
const waitForTerminalStatus = async ({
|
|
88
|
-
findStatus,
|
|
89
|
-
}: {
|
|
90
|
-
findStatus: () => Promise<string | undefined>;
|
|
91
|
-
}): Promise<string | undefined> => {
|
|
92
|
-
const deadline = DateTime.now().plus({milliseconds: COMPLETION_TIMEOUT_MS});
|
|
93
|
-
let status = await findStatus();
|
|
94
|
-
while (DateTime.now() < deadline && (status === "pending" || status === "running")) {
|
|
95
|
-
await new Promise((resolve) => setTimeout(resolve, POLL_INTERVAL_MS));
|
|
96
|
-
status = await findStatus();
|
|
97
|
-
}
|
|
98
|
-
return status;
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
/** Parent: boots the worker, enqueues one job from this process, and checks who ran it. */
|
|
102
|
-
const run = async (): Promise<void> => {
|
|
103
|
-
const startedAt = DateTime.now();
|
|
104
|
-
const runId = startedAt.toMillis();
|
|
105
|
-
const {setupLogging} = await import("@terreno/api");
|
|
106
|
-
const {JobsApp, Job, JobSchedule, getJobsService} = await import("@terreno/jobs");
|
|
107
|
-
const {default: express} = await import("express");
|
|
108
|
-
const {default: mongoose} = await import("mongoose");
|
|
109
|
-
|
|
110
|
-
const port = await freePort();
|
|
111
|
-
const mongoUri = await smokeMongoUri({databaseName: "jobsSmoke"});
|
|
112
|
-
let worker: SpawnedProcess | undefined;
|
|
113
|
-
|
|
114
|
-
try {
|
|
115
|
-
worker = await spawnUntilReady({
|
|
116
|
-
cmd: [process.execPath, __filename, WORKER_ARG],
|
|
117
|
-
env: {MONGO_URI: mongoUri, PORT: String(port)},
|
|
118
|
-
timeoutMs: 20000,
|
|
119
|
-
url: `http://127.0.0.1:${port}/health`,
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
// Info level hides the admin routes' "no OpenAPI" debug lines from the bare Express app.
|
|
123
|
-
setupLogging({disableFileLogging: true, level: "info"});
|
|
124
|
-
// The enqueuing process shares the definition (for retry settings) but never starts a
|
|
125
|
-
// worker, so its handler running would mean the job did not cross processes.
|
|
126
|
-
await mongoose.connect(mongoUri);
|
|
127
|
-
const jobsApp = new JobsApp();
|
|
128
|
-
jobsApp.define(JOB_NAME, {
|
|
129
|
-
handler: async () => {
|
|
130
|
-
throw new Error("the enqueuing process must not run the job");
|
|
131
|
-
},
|
|
132
|
-
retry: {maxAttempts: 1},
|
|
133
|
-
});
|
|
134
|
-
jobsApp.register(express());
|
|
135
|
-
// register() builds indexes in the background; finish them before disconnecting.
|
|
136
|
-
await Promise.all([Job.init(), JobSchedule.init()]);
|
|
137
|
-
|
|
138
|
-
const job = await getJobsService().enqueue({name: JOB_NAME, payload: {runId}});
|
|
139
|
-
const jobId = job._id.toString();
|
|
140
|
-
if (job.status !== "pending") {
|
|
141
|
-
throw new Error(`enqueue: expected a pending job, got ${job.status}`);
|
|
142
|
-
}
|
|
143
|
-
console.info(`✅ enqueue persists pending job ${jobId} from pid ${process.pid}`);
|
|
144
|
-
|
|
145
|
-
const status = await waitForTerminalStatus({
|
|
146
|
-
findStatus: async () => (await Job.findOneOrNone({_id: job._id}))?.status,
|
|
147
|
-
});
|
|
148
|
-
if (status !== "completed") {
|
|
149
|
-
throw new Error(
|
|
150
|
-
`worker: job ${jobId} is ${status ?? "missing"}, not completed, after ${COMPLETION_TIMEOUT_MS} ms`
|
|
151
|
-
);
|
|
152
|
-
}
|
|
153
|
-
console.info(`✅ the worker process marks job ${jobId} completed`);
|
|
154
|
-
|
|
155
|
-
const runs = await mongoose.connection
|
|
156
|
-
.collection<SmokeRun>(RUNS_COLLECTION)
|
|
157
|
-
.find({jobId})
|
|
158
|
-
.toArray();
|
|
159
|
-
if (runs.length !== 1) {
|
|
160
|
-
throw new Error(`worker: expected the handler to run once, it ran ${runs.length} times`);
|
|
161
|
-
}
|
|
162
|
-
const [ran] = runs;
|
|
163
|
-
if (ran.pid !== worker.pid || ran.runId !== runId) {
|
|
164
|
-
throw new Error(
|
|
165
|
-
`worker: handler ran in pid ${ran.pid} with runId ${ran.runId}, expected worker pid ${worker.pid} and runId ${runId}`
|
|
166
|
-
);
|
|
167
|
-
}
|
|
168
|
-
console.info(`✅ the handler ran once, in worker pid ${worker.pid}, with the enqueued payload`);
|
|
169
|
-
} catch (error: unknown) {
|
|
170
|
-
if (worker) {
|
|
171
|
-
console.error(`--- worker output ---\n${worker.output()}`);
|
|
172
|
-
}
|
|
173
|
-
throw error;
|
|
174
|
-
} finally {
|
|
175
|
-
await worker?.stop();
|
|
176
|
-
await mongoose.disconnect();
|
|
177
|
-
await stopSmokeMongo();
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
console.info(`jobs smoke passed in ${DateTime.now().diff(startedAt).toMillis()} ms`);
|
|
181
|
-
};
|
|
182
|
-
|
|
183
|
-
const main = process.argv[2] === WORKER_ARG ? work : run;
|
|
184
|
-
main().then(
|
|
185
|
-
() => {
|
|
186
|
-
if (main === run) {
|
|
187
|
-
process.exit(0);
|
|
188
|
-
}
|
|
189
|
-
},
|
|
190
|
-
(error: unknown) => {
|
|
191
|
-
console.error(`❌ ${error instanceof Error ? error.message : String(error)}`);
|
|
192
|
-
process.exit(1);
|
|
193
|
-
}
|
|
194
|
-
);
|
package/tsconfig.json
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"declaration": true,
|
|
4
|
-
"isolatedModules": true,
|
|
5
|
-
"lib": ["es2023"],
|
|
6
|
-
"module": "nodenext",
|
|
7
|
-
"noImplicitAny": false,
|
|
8
|
-
"noImplicitReturns": true,
|
|
9
|
-
"outDir": "./dist",
|
|
10
|
-
"rootDir": "./src",
|
|
11
|
-
"skipLibCheck": true,
|
|
12
|
-
"strict": true,
|
|
13
|
-
"target": "es2023",
|
|
14
|
-
"types": ["node"]
|
|
15
|
-
},
|
|
16
|
-
"exclude": ["node_modules", "src/tests", "**/*.test.ts"],
|
|
17
|
-
"include": ["src"]
|
|
18
|
-
}
|
package/tsconfig.typecheck.json
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "./tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"noEmit": true,
|
|
5
|
-
"composite": false,
|
|
6
|
-
"incremental": false,
|
|
7
|
-
"declaration": false,
|
|
8
|
-
"declarationMap": false,
|
|
9
|
-
"types": [
|
|
10
|
-
"node",
|
|
11
|
-
"bun"
|
|
12
|
-
]
|
|
13
|
-
},
|
|
14
|
-
"exclude": [
|
|
15
|
-
"node_modules",
|
|
16
|
-
"dist"
|
|
17
|
-
]
|
|
18
|
-
}
|