@pylonsync/create-pylon 0.22.47 → 0.22.58
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/bin/create-pylon.js +1 -1
- package/package.json +1 -1
- package/templates/_root/AGENTS.md +1 -0
- package/templates/agency/AGENTS.md +1 -0
- package/templates/ai-chat/AGENTS.md +1 -0
- package/templates/ai-studio/AGENTS.md +1 -0
- package/templates/barebones/AGENTS.md +1 -0
- package/templates/chat/AGENTS.md +1 -0
- package/templates/consumer/AGENTS.md +1 -0
- package/templates/creator/AGENTS.md +1 -0
- package/templates/crm/AGENTS.md +1 -0
- package/templates/directory/AGENTS.md +1 -0
- package/templates/helpdesk/AGENTS.md +1 -0
- package/templates/imessage/AGENTS.md +1 -0
- package/templates/inventory/AGENTS.md +1 -0
- package/templates/invoices/AGENTS.md +1 -0
- package/templates/local-service/AGENTS.md +1 -0
- package/templates/marketplace/AGENTS.md +1 -0
- package/templates/projects/AGENTS.md +1 -0
- package/templates/restaurant/AGENTS.md +1 -0
- package/templates/saas/AGENTS.md +1 -0
- package/templates/shop/AGENTS.md +1 -0
- package/templates/todo/AGENTS.md +1 -0
- package/templates/waitlist/AGENTS.md +1 -0
package/bin/create-pylon.js
CHANGED
|
@@ -680,7 +680,7 @@ if (!isUnified) {
|
|
|
680
680
|
// stable for whichever PM the user picked. npm doesn't enforce this
|
|
681
681
|
// field but turbo still expects it to be present.
|
|
682
682
|
const PACKAGE_MANAGERS = {
|
|
683
|
-
bun: "bun@1.
|
|
683
|
+
bun: "bun@1.4.4",
|
|
684
684
|
pnpm: "pnpm@9.12.0",
|
|
685
685
|
yarn: "yarn@4.5.0",
|
|
686
686
|
npm: "npm@10.9.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pylonsync/create-pylon",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.58",
|
|
4
4
|
"description": "Scaffold a new Pylon app — realtime backend + web/mobile/expo frontends in one command. Run via `npm create @pylonsync/pylon@latest`.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -52,6 +52,7 @@ this pass before the user has to ask.
|
|
|
52
52
|
Reading them one at a time (`use(serverData.a()); use(serverData.b());`) is correct but serial: each read waits for the one above it.
|
|
53
53
|
|
|
54
54
|
- **`serverData` (SSR) is READ-ONLY.** No write methods; the runtime rejects write frames (`SSR_WRITE_FORBIDDEN`). Mutations belong in actions/functions, never in a page render.
|
|
55
|
+
- **Offline routes render from the replica.** With `buildManifest({ offline: { routes } })`, each listed route opens with no network. Read its data with `db.useQuery` / `db.useQueryOne`, never `serverData`, and do not read `props.auth`, headers or cookies in the render (use `props.session.exists` and `useSession()`). The service worker keeps a page only when its HTML is the same for every signed-in user; the browser console says why a page was refused, and `pylon lint` flags `serverData` on an offline route (PYL008). Offline routes, and pages that `export const navigation = "client"`, navigate with no page fetch (same render rules; PYL010 flags a "client" page that reads `serverData`). An installed app keeps running the old build until it reloads; show `useAppUpdate()` (or `<AppUpdateBar />`) so the user can load a new deploy. See https://docs.pylonsync.com/ssr/offline.
|
|
55
56
|
- **`response.*` / `response.redirect()` / `response.notFound()` must fire in the synchronous shell render**, before any `await` or `<Suspense>`. The HTTP head commits when the shell is ready. Status, headers, and cookies set from a suspended subtree are lost, and `redirect` or `notFound` thrown below a Suspense boundary are swallowed.
|
|
56
57
|
- **`ctx.llm`, `ctx.rooms`, and `ctx.connections` are available on mutations and actions, not queries.** An `action` has no direct `ctx.db`; use `ctx.runQuery` or `ctx.runMutation`.
|
|
57
58
|
- **`ctx.llm.stream(request, onEvent)` streams tokens as they generate** and still resolves with the full response, so `stop_reason === "tool_use"` drives an agent tool loop. Events are `text_delta` / `tool_use_start` / `tool_input_delta` / `done`. Same auth + model-allowlist gating as `ctx.llm.complete`. The call timeout is an idle timeout (`PYLON_FN_CALL_TIMEOUT`, 30s default; Stack0 Cloud 300s): each stream event resets it, and the total run is capped at 10× the timeout. Set `timeout: <secs>` on the def when a step (a slow tool call) can be silent longer than that.
|
|
@@ -60,6 +60,7 @@ this pass before the user has to ask.
|
|
|
60
60
|
Reading them one at a time (`use(serverData.a()); use(serverData.b());`) is correct but serial: each read waits for the one above it.
|
|
61
61
|
|
|
62
62
|
- **`serverData` (SSR) is READ-ONLY.** No write methods; the runtime rejects write frames (`SSR_WRITE_FORBIDDEN`). Mutations belong in actions/functions, never in a page render.
|
|
63
|
+
- **Offline routes render from the replica.** With `buildManifest({ offline: { routes } })`, each listed route opens with no network. Read its data with `db.useQuery` / `db.useQueryOne`, never `serverData`, and do not read `props.auth`, headers or cookies in the render (use `props.session.exists` and `useSession()`). The service worker keeps a page only when its HTML is the same for every signed-in user; the browser console says why a page was refused, and `pylon lint` flags `serverData` on an offline route (PYL008). Offline routes, and pages that `export const navigation = "client"`, navigate with no page fetch (same render rules; PYL010 flags a "client" page that reads `serverData`). An installed app keeps running the old build until it reloads; show `useAppUpdate()` (or `<AppUpdateBar />`) so the user can load a new deploy. See https://docs.pylonsync.com/ssr/offline.
|
|
63
64
|
- **`response.*` / `response.redirect()` / `response.notFound()` must fire in the synchronous shell render**, before any `await` / `<Suspense>`. The HTTP head commits when the shell is ready; status/headers/cookies set from a suspended subtree are lost, and `redirect`/`notFound` thrown below a Suspense boundary are swallowed.
|
|
64
65
|
- **`ctx.llm`, `ctx.rooms`, and `ctx.connections` are on mutation + action only, NOT query** (reactive purity). `action` has no direct `ctx.db`; use `ctx.runQuery` / `ctx.runMutation`.
|
|
65
66
|
- **`ctx.llm.stream(request, onEvent)` streams tokens as they generate** and still resolves with the full response, so `stop_reason === "tool_use"` drives an agent tool loop. Events are `text_delta` / `tool_use_start` / `tool_input_delta` / `done`. Same auth + model-allowlist gating as `ctx.llm.complete`. The call timeout is an idle timeout (`PYLON_FN_CALL_TIMEOUT`, 30s default; Stack0 Cloud 300s): each stream event resets it, and the total run is capped at 10× the timeout. Set `timeout: <secs>` on the def when a step (a slow tool call) can be silent longer than that.
|
|
@@ -60,6 +60,7 @@ this pass before the user has to ask.
|
|
|
60
60
|
Reading them one at a time (`use(serverData.a()); use(serverData.b());`) is correct but serial: each read waits for the one above it.
|
|
61
61
|
|
|
62
62
|
- **`serverData` (SSR) is READ-ONLY.** No write methods; the runtime rejects write frames (`SSR_WRITE_FORBIDDEN`). Mutations belong in actions/functions, never in a page render.
|
|
63
|
+
- **Offline routes render from the replica.** With `buildManifest({ offline: { routes } })`, each listed route opens with no network. Read its data with `db.useQuery` / `db.useQueryOne`, never `serverData`, and do not read `props.auth`, headers or cookies in the render (use `props.session.exists` and `useSession()`). The service worker keeps a page only when its HTML is the same for every signed-in user; the browser console says why a page was refused, and `pylon lint` flags `serverData` on an offline route (PYL008). Offline routes, and pages that `export const navigation = "client"`, navigate with no page fetch (same render rules; PYL010 flags a "client" page that reads `serverData`). An installed app keeps running the old build until it reloads; show `useAppUpdate()` (or `<AppUpdateBar />`) so the user can load a new deploy. See https://docs.pylonsync.com/ssr/offline.
|
|
63
64
|
- **`response.*` / `response.redirect()` / `response.notFound()` must fire in the synchronous shell render**, before any `await` / `<Suspense>`. The HTTP head commits when the shell is ready; status/headers/cookies set from a suspended subtree are lost, and `redirect`/`notFound` thrown below a Suspense boundary are swallowed.
|
|
64
65
|
- **`ctx.llm`, `ctx.rooms`, and `ctx.connections` are on mutation + action only, NOT query** (reactive purity). `action` has no direct `ctx.db`; use `ctx.runQuery` / `ctx.runMutation`.
|
|
65
66
|
- **`ctx.llm.stream(request, onEvent)` streams tokens as they generate** and still resolves with the full response, so `stop_reason === "tool_use"` drives an agent tool loop. Events are `text_delta` / `tool_use_start` / `tool_input_delta` / `done`. Same auth + model-allowlist gating as `ctx.llm.complete`. The call timeout is an idle timeout (`PYLON_FN_CALL_TIMEOUT`, 30s default; Stack0 Cloud 300s): each stream event resets it, and the total run is capped at 10× the timeout. Set `timeout: <secs>` on the def when a step (a slow tool call) can be silent longer than that.
|
|
@@ -60,6 +60,7 @@ this pass before the user has to ask.
|
|
|
60
60
|
Reading them one at a time (`use(serverData.a()); use(serverData.b());`) is correct but serial: each read waits for the one above it.
|
|
61
61
|
|
|
62
62
|
- **`serverData` (SSR) is READ-ONLY.** No write methods; the runtime rejects write frames (`SSR_WRITE_FORBIDDEN`). Mutations belong in actions/functions, never in a page render.
|
|
63
|
+
- **Offline routes render from the replica.** With `buildManifest({ offline: { routes } })`, each listed route opens with no network. Read its data with `db.useQuery` / `db.useQueryOne`, never `serverData`, and do not read `props.auth`, headers or cookies in the render (use `props.session.exists` and `useSession()`). The service worker keeps a page only when its HTML is the same for every signed-in user; the browser console says why a page was refused, and `pylon lint` flags `serverData` on an offline route (PYL008). Offline routes, and pages that `export const navigation = "client"`, navigate with no page fetch (same render rules; PYL010 flags a "client" page that reads `serverData`). An installed app keeps running the old build until it reloads; show `useAppUpdate()` (or `<AppUpdateBar />`) so the user can load a new deploy. See https://docs.pylonsync.com/ssr/offline.
|
|
63
64
|
- **`response.*` / `response.redirect()` / `response.notFound()` must fire in the synchronous shell render**, before any `await` / `<Suspense>`. The HTTP head commits when the shell is ready; status/headers/cookies set from a suspended subtree are lost, and `redirect`/`notFound` thrown below a Suspense boundary are swallowed.
|
|
64
65
|
- **`ctx.llm`, `ctx.rooms`, and `ctx.connections` are on mutation + action only, NOT query** (reactive purity). `action` has no direct `ctx.db`; use `ctx.runQuery` / `ctx.runMutation`.
|
|
65
66
|
- **`ctx.llm.stream(request, onEvent)` streams tokens as they generate** and still resolves with the full response, so `stop_reason === "tool_use"` drives an agent tool loop. Events are `text_delta` / `tool_use_start` / `tool_input_delta` / `done`. Same auth + model-allowlist gating as `ctx.llm.complete`. The call timeout is an idle timeout (`PYLON_FN_CALL_TIMEOUT`, 30s default; Stack0 Cloud 300s): each stream event resets it, and the total run is capped at 10× the timeout. Set `timeout: <secs>` on the def when a step (a slow tool call) can be silent longer than that.
|
|
@@ -60,6 +60,7 @@ this pass before the user has to ask.
|
|
|
60
60
|
Reading them one at a time (`use(serverData.a()); use(serverData.b());`) is correct but serial: each read waits for the one above it.
|
|
61
61
|
|
|
62
62
|
- **`serverData` (SSR) is READ-ONLY.** No write methods; the runtime rejects write frames (`SSR_WRITE_FORBIDDEN`). Mutations belong in actions/functions, never in a page render.
|
|
63
|
+
- **Offline routes render from the replica.** With `buildManifest({ offline: { routes } })`, each listed route opens with no network. Read its data with `db.useQuery` / `db.useQueryOne`, never `serverData`, and do not read `props.auth`, headers or cookies in the render (use `props.session.exists` and `useSession()`). The service worker keeps a page only when its HTML is the same for every signed-in user; the browser console says why a page was refused, and `pylon lint` flags `serverData` on an offline route (PYL008). Offline routes, and pages that `export const navigation = "client"`, navigate with no page fetch (same render rules; PYL010 flags a "client" page that reads `serverData`). An installed app keeps running the old build until it reloads; show `useAppUpdate()` (or `<AppUpdateBar />`) so the user can load a new deploy. See https://docs.pylonsync.com/ssr/offline.
|
|
63
64
|
- **`response.*` / `response.redirect()` / `response.notFound()` must fire in the synchronous shell render**, before any `await` / `<Suspense>`. The HTTP head commits when the shell is ready; status/headers/cookies set from a suspended subtree are lost, and `redirect`/`notFound` thrown below a Suspense boundary are swallowed.
|
|
64
65
|
- **`ctx.llm`, `ctx.rooms`, and `ctx.connections` are on mutation + action only, NOT query** (reactive purity). `action` has no direct `ctx.db`; use `ctx.runQuery` / `ctx.runMutation`.
|
|
65
66
|
- **`ctx.llm.stream(request, onEvent)` streams tokens as they generate** and still resolves with the full response, so `stop_reason === "tool_use"` drives an agent tool loop. Events are `text_delta` / `tool_use_start` / `tool_input_delta` / `done`. Same auth + model-allowlist gating as `ctx.llm.complete`. The call timeout is an idle timeout (`PYLON_FN_CALL_TIMEOUT`, 30s default; Stack0 Cloud 300s): each stream event resets it, and the total run is capped at 10× the timeout. Set `timeout: <secs>` on the def when a step (a slow tool call) can be silent longer than that.
|
package/templates/chat/AGENTS.md
CHANGED
|
@@ -60,6 +60,7 @@ this pass before the user has to ask.
|
|
|
60
60
|
Reading them one at a time (`use(serverData.a()); use(serverData.b());`) is correct but serial: each read waits for the one above it.
|
|
61
61
|
|
|
62
62
|
- **`serverData` (SSR) is READ-ONLY.** No write methods; the runtime rejects write frames (`SSR_WRITE_FORBIDDEN`). Mutations belong in actions/functions, never in a page render.
|
|
63
|
+
- **Offline routes render from the replica.** With `buildManifest({ offline: { routes } })`, each listed route opens with no network. Read its data with `db.useQuery` / `db.useQueryOne`, never `serverData`, and do not read `props.auth`, headers or cookies in the render (use `props.session.exists` and `useSession()`). The service worker keeps a page only when its HTML is the same for every signed-in user; the browser console says why a page was refused, and `pylon lint` flags `serverData` on an offline route (PYL008). Offline routes, and pages that `export const navigation = "client"`, navigate with no page fetch (same render rules; PYL010 flags a "client" page that reads `serverData`). An installed app keeps running the old build until it reloads; show `useAppUpdate()` (or `<AppUpdateBar />`) so the user can load a new deploy. See https://docs.pylonsync.com/ssr/offline.
|
|
63
64
|
- **`response.*` / `response.redirect()` / `response.notFound()` must fire in the synchronous shell render**, before any `await` / `<Suspense>`. The HTTP head commits when the shell is ready; status/headers/cookies set from a suspended subtree are lost, and `redirect`/`notFound` thrown below a Suspense boundary are swallowed.
|
|
64
65
|
- **`ctx.llm`, `ctx.rooms`, and `ctx.connections` are on mutation + action only, NOT query** (reactive purity). `action` has no direct `ctx.db`; use `ctx.runQuery` / `ctx.runMutation`.
|
|
65
66
|
- **`ctx.llm.stream(request, onEvent)` streams tokens as they generate** and still resolves with the full response, so `stop_reason === "tool_use"` drives an agent tool loop. Events are `text_delta` / `tool_use_start` / `tool_input_delta` / `done`. Same auth + model-allowlist gating as `ctx.llm.complete`. The call timeout is an idle timeout (`PYLON_FN_CALL_TIMEOUT`, 30s default; Stack0 Cloud 300s): each stream event resets it, and the total run is capped at 10× the timeout. Set `timeout: <secs>` on the def when a step (a slow tool call) can be silent longer than that.
|
|
@@ -60,6 +60,7 @@ this pass before the user has to ask.
|
|
|
60
60
|
Reading them one at a time (`use(serverData.a()); use(serverData.b());`) is correct but serial: each read waits for the one above it.
|
|
61
61
|
|
|
62
62
|
- **`serverData` (SSR) is READ-ONLY.** No write methods; the runtime rejects write frames (`SSR_WRITE_FORBIDDEN`). Mutations belong in actions/functions, never in a page render.
|
|
63
|
+
- **Offline routes render from the replica.** With `buildManifest({ offline: { routes } })`, each listed route opens with no network. Read its data with `db.useQuery` / `db.useQueryOne`, never `serverData`, and do not read `props.auth`, headers or cookies in the render (use `props.session.exists` and `useSession()`). The service worker keeps a page only when its HTML is the same for every signed-in user; the browser console says why a page was refused, and `pylon lint` flags `serverData` on an offline route (PYL008). Offline routes, and pages that `export const navigation = "client"`, navigate with no page fetch (same render rules; PYL010 flags a "client" page that reads `serverData`). An installed app keeps running the old build until it reloads; show `useAppUpdate()` (or `<AppUpdateBar />`) so the user can load a new deploy. See https://docs.pylonsync.com/ssr/offline.
|
|
63
64
|
- **`response.*` / `response.redirect()` / `response.notFound()` must fire in the synchronous shell render**, before any `await` / `<Suspense>`. The HTTP head commits when the shell is ready; status/headers/cookies set from a suspended subtree are lost, and `redirect`/`notFound` thrown below a Suspense boundary are swallowed.
|
|
64
65
|
- **`ctx.llm`, `ctx.rooms`, and `ctx.connections` are on mutation + action only, NOT query** (reactive purity). `action` has no direct `ctx.db`; use `ctx.runQuery` / `ctx.runMutation`.
|
|
65
66
|
- **`ctx.llm.stream(request, onEvent)` streams tokens as they generate** and still resolves with the full response, so `stop_reason === "tool_use"` drives an agent tool loop. Events are `text_delta` / `tool_use_start` / `tool_input_delta` / `done`. Same auth + model-allowlist gating as `ctx.llm.complete`. The call timeout is an idle timeout (`PYLON_FN_CALL_TIMEOUT`, 30s default; Stack0 Cloud 300s): each stream event resets it, and the total run is capped at 10× the timeout. Set `timeout: <secs>` on the def when a step (a slow tool call) can be silent longer than that.
|
|
@@ -60,6 +60,7 @@ this pass before the user has to ask.
|
|
|
60
60
|
Reading them one at a time (`use(serverData.a()); use(serverData.b());`) is correct but serial: each read waits for the one above it.
|
|
61
61
|
|
|
62
62
|
- **`serverData` (SSR) is READ-ONLY.** No write methods; the runtime rejects write frames (`SSR_WRITE_FORBIDDEN`). Mutations belong in actions/functions, never in a page render.
|
|
63
|
+
- **Offline routes render from the replica.** With `buildManifest({ offline: { routes } })`, each listed route opens with no network. Read its data with `db.useQuery` / `db.useQueryOne`, never `serverData`, and do not read `props.auth`, headers or cookies in the render (use `props.session.exists` and `useSession()`). The service worker keeps a page only when its HTML is the same for every signed-in user; the browser console says why a page was refused, and `pylon lint` flags `serverData` on an offline route (PYL008). Offline routes, and pages that `export const navigation = "client"`, navigate with no page fetch (same render rules; PYL010 flags a "client" page that reads `serverData`). An installed app keeps running the old build until it reloads; show `useAppUpdate()` (or `<AppUpdateBar />`) so the user can load a new deploy. See https://docs.pylonsync.com/ssr/offline.
|
|
63
64
|
- **`response.*` / `response.redirect()` / `response.notFound()` must fire in the synchronous shell render**, before any `await` / `<Suspense>`. The HTTP head commits when the shell is ready; status/headers/cookies set from a suspended subtree are lost, and `redirect`/`notFound` thrown below a Suspense boundary are swallowed.
|
|
64
65
|
- **`ctx.llm`, `ctx.rooms`, and `ctx.connections` are on mutation + action only, NOT query** (reactive purity). `action` has no direct `ctx.db`; use `ctx.runQuery` / `ctx.runMutation`.
|
|
65
66
|
- **`ctx.llm.stream(request, onEvent)` streams tokens as they generate** and still resolves with the full response, so `stop_reason === "tool_use"` drives an agent tool loop. Events are `text_delta` / `tool_use_start` / `tool_input_delta` / `done`. Same auth + model-allowlist gating as `ctx.llm.complete`. The call timeout is an idle timeout (`PYLON_FN_CALL_TIMEOUT`, 30s default; Stack0 Cloud 300s): each stream event resets it, and the total run is capped at 10× the timeout. Set `timeout: <secs>` on the def when a step (a slow tool call) can be silent longer than that.
|
package/templates/crm/AGENTS.md
CHANGED
|
@@ -60,6 +60,7 @@ this pass before the user has to ask.
|
|
|
60
60
|
Reading them one at a time (`use(serverData.a()); use(serverData.b());`) is correct but serial: each read waits for the one above it.
|
|
61
61
|
|
|
62
62
|
- **`serverData` (SSR) is READ-ONLY.** No write methods; the runtime rejects write frames (`SSR_WRITE_FORBIDDEN`). Mutations belong in actions/functions, never in a page render.
|
|
63
|
+
- **Offline routes render from the replica.** With `buildManifest({ offline: { routes } })`, each listed route opens with no network. Read its data with `db.useQuery` / `db.useQueryOne`, never `serverData`, and do not read `props.auth`, headers or cookies in the render (use `props.session.exists` and `useSession()`). The service worker keeps a page only when its HTML is the same for every signed-in user; the browser console says why a page was refused, and `pylon lint` flags `serverData` on an offline route (PYL008). Offline routes, and pages that `export const navigation = "client"`, navigate with no page fetch (same render rules; PYL010 flags a "client" page that reads `serverData`). An installed app keeps running the old build until it reloads; show `useAppUpdate()` (or `<AppUpdateBar />`) so the user can load a new deploy. See https://docs.pylonsync.com/ssr/offline.
|
|
63
64
|
- **`response.*` / `response.redirect()` / `response.notFound()` must fire in the synchronous shell render**, before any `await` / `<Suspense>`. The HTTP head commits when the shell is ready; status/headers/cookies set from a suspended subtree are lost, and `redirect`/`notFound` thrown below a Suspense boundary are swallowed.
|
|
64
65
|
- **`ctx.llm`, `ctx.rooms`, and `ctx.connections` are on mutation + action only, NOT query** (reactive purity). `action` has no direct `ctx.db`; use `ctx.runQuery` / `ctx.runMutation`.
|
|
65
66
|
- **`ctx.llm.stream(request, onEvent)` streams tokens as they generate** and still resolves with the full response, so `stop_reason === "tool_use"` drives an agent tool loop. Events are `text_delta` / `tool_use_start` / `tool_input_delta` / `done`. Same auth + model-allowlist gating as `ctx.llm.complete`. The call timeout is an idle timeout (`PYLON_FN_CALL_TIMEOUT`, 30s default; Stack0 Cloud 300s): each stream event resets it, and the total run is capped at 10× the timeout. Set `timeout: <secs>` on the def when a step (a slow tool call) can be silent longer than that.
|
|
@@ -60,6 +60,7 @@ this pass before the user has to ask.
|
|
|
60
60
|
Reading them one at a time (`use(serverData.a()); use(serverData.b());`) is correct but serial: each read waits for the one above it.
|
|
61
61
|
|
|
62
62
|
- **`serverData` (SSR) is READ-ONLY.** No write methods; the runtime rejects write frames (`SSR_WRITE_FORBIDDEN`). Mutations belong in actions/functions, never in a page render.
|
|
63
|
+
- **Offline routes render from the replica.** With `buildManifest({ offline: { routes } })`, each listed route opens with no network. Read its data with `db.useQuery` / `db.useQueryOne`, never `serverData`, and do not read `props.auth`, headers or cookies in the render (use `props.session.exists` and `useSession()`). The service worker keeps a page only when its HTML is the same for every signed-in user; the browser console says why a page was refused, and `pylon lint` flags `serverData` on an offline route (PYL008). Offline routes, and pages that `export const navigation = "client"`, navigate with no page fetch (same render rules; PYL010 flags a "client" page that reads `serverData`). An installed app keeps running the old build until it reloads; show `useAppUpdate()` (or `<AppUpdateBar />`) so the user can load a new deploy. See https://docs.pylonsync.com/ssr/offline.
|
|
63
64
|
- **`response.*` / `response.redirect()` / `response.notFound()` must fire in the synchronous shell render**, before any `await` / `<Suspense>`. The HTTP head commits when the shell is ready; status/headers/cookies set from a suspended subtree are lost, and `redirect`/`notFound` thrown below a Suspense boundary are swallowed.
|
|
64
65
|
- **`ctx.llm`, `ctx.rooms`, and `ctx.connections` are on mutation + action only, NOT query** (reactive purity). `action` has no direct `ctx.db`; use `ctx.runQuery` / `ctx.runMutation`.
|
|
65
66
|
- **`ctx.llm.stream(request, onEvent)` streams tokens as they generate** and still resolves with the full response, so `stop_reason === "tool_use"` drives an agent tool loop. Events are `text_delta` / `tool_use_start` / `tool_input_delta` / `done`. Same auth + model-allowlist gating as `ctx.llm.complete`. The call timeout is an idle timeout (`PYLON_FN_CALL_TIMEOUT`, 30s default; Stack0 Cloud 300s): each stream event resets it, and the total run is capped at 10× the timeout. Set `timeout: <secs>` on the def when a step (a slow tool call) can be silent longer than that.
|
|
@@ -60,6 +60,7 @@ this pass before the user has to ask.
|
|
|
60
60
|
Reading them one at a time (`use(serverData.a()); use(serverData.b());`) is correct but serial: each read waits for the one above it.
|
|
61
61
|
|
|
62
62
|
- **`serverData` (SSR) is READ-ONLY.** No write methods; the runtime rejects write frames (`SSR_WRITE_FORBIDDEN`). Mutations belong in actions/functions, never in a page render.
|
|
63
|
+
- **Offline routes render from the replica.** With `buildManifest({ offline: { routes } })`, each listed route opens with no network. Read its data with `db.useQuery` / `db.useQueryOne`, never `serverData`, and do not read `props.auth`, headers or cookies in the render (use `props.session.exists` and `useSession()`). The service worker keeps a page only when its HTML is the same for every signed-in user; the browser console says why a page was refused, and `pylon lint` flags `serverData` on an offline route (PYL008). Offline routes, and pages that `export const navigation = "client"`, navigate with no page fetch (same render rules; PYL010 flags a "client" page that reads `serverData`). An installed app keeps running the old build until it reloads; show `useAppUpdate()` (or `<AppUpdateBar />`) so the user can load a new deploy. See https://docs.pylonsync.com/ssr/offline.
|
|
63
64
|
- **`response.*` / `response.redirect()` / `response.notFound()` must fire in the synchronous shell render**, before any `await` / `<Suspense>`. The HTTP head commits when the shell is ready; status/headers/cookies set from a suspended subtree are lost, and `redirect`/`notFound` thrown below a Suspense boundary are swallowed.
|
|
64
65
|
- **`ctx.llm`, `ctx.rooms`, and `ctx.connections` are on mutation + action only, NOT query** (reactive purity). `action` has no direct `ctx.db`; use `ctx.runQuery` / `ctx.runMutation`.
|
|
65
66
|
- **`ctx.llm.stream(request, onEvent)` streams tokens as they generate** and still resolves with the full response, so `stop_reason === "tool_use"` drives an agent tool loop. Events are `text_delta` / `tool_use_start` / `tool_input_delta` / `done`. Same auth + model-allowlist gating as `ctx.llm.complete`. The call timeout is an idle timeout (`PYLON_FN_CALL_TIMEOUT`, 30s default; Stack0 Cloud 300s): each stream event resets it, and the total run is capped at 10× the timeout. Set `timeout: <secs>` on the def when a step (a slow tool call) can be silent longer than that.
|
|
@@ -67,6 +67,7 @@ transports, the owner model, and production setup.
|
|
|
67
67
|
Reading them one at a time (`use(serverData.a()); use(serverData.b());`) is correct but serial: each read waits for the one above it.
|
|
68
68
|
|
|
69
69
|
- **`serverData` (SSR) is READ-ONLY.** No write methods; the runtime rejects write frames (`SSR_WRITE_FORBIDDEN`). Mutations belong in actions/functions, never in a page render.
|
|
70
|
+
- **Offline routes render from the replica.** With `buildManifest({ offline: { routes } })`, each listed route opens with no network. Read its data with `db.useQuery` / `db.useQueryOne`, never `serverData`, and do not read `props.auth`, headers or cookies in the render (use `props.session.exists` and `useSession()`). The service worker keeps a page only when its HTML is the same for every signed-in user; the browser console says why a page was refused, and `pylon lint` flags `serverData` on an offline route (PYL008). Offline routes, and pages that `export const navigation = "client"`, navigate with no page fetch (same render rules; PYL010 flags a "client" page that reads `serverData`). An installed app keeps running the old build until it reloads; show `useAppUpdate()` (or `<AppUpdateBar />`) so the user can load a new deploy. See https://docs.pylonsync.com/ssr/offline.
|
|
70
71
|
- **`response.*` / `response.redirect()` / `response.notFound()` must fire in the synchronous shell render**, before any `await` / `<Suspense>`. The HTTP head commits when the shell is ready; status/headers/cookies set from a suspended subtree are lost, and `redirect`/`notFound` thrown below a Suspense boundary are swallowed.
|
|
71
72
|
- **`ctx.llm`, `ctx.rooms`, and `ctx.connections` are on mutation + action only, NOT query** (reactive purity). `action` has no direct `ctx.db`; use `ctx.runQuery` / `ctx.runMutation`.
|
|
72
73
|
- **`ctx.llm.stream(request, onEvent)` streams tokens as they generate** and still resolves with the full response, so `stop_reason === "tool_use"` drives an agent tool loop. Events are `text_delta` / `tool_use_start` / `tool_input_delta` / `done`. Same auth + model-allowlist gating as `ctx.llm.complete`. The call timeout is an idle timeout (`PYLON_FN_CALL_TIMEOUT`, 30s default; Stack0 Cloud 300s): each stream event resets it, and the total run is capped at 10× the timeout. Set `timeout: <secs>` on the def when a step (a slow tool call) can be silent longer than that.
|
|
@@ -60,6 +60,7 @@ this pass before the user has to ask.
|
|
|
60
60
|
Reading them one at a time (`use(serverData.a()); use(serverData.b());`) is correct but serial: each read waits for the one above it.
|
|
61
61
|
|
|
62
62
|
- **`serverData` (SSR) is READ-ONLY.** No write methods; the runtime rejects write frames (`SSR_WRITE_FORBIDDEN`). Mutations belong in actions/functions, never in a page render.
|
|
63
|
+
- **Offline routes render from the replica.** With `buildManifest({ offline: { routes } })`, each listed route opens with no network. Read its data with `db.useQuery` / `db.useQueryOne`, never `serverData`, and do not read `props.auth`, headers or cookies in the render (use `props.session.exists` and `useSession()`). The service worker keeps a page only when its HTML is the same for every signed-in user; the browser console says why a page was refused, and `pylon lint` flags `serverData` on an offline route (PYL008). Offline routes, and pages that `export const navigation = "client"`, navigate with no page fetch (same render rules; PYL010 flags a "client" page that reads `serverData`). An installed app keeps running the old build until it reloads; show `useAppUpdate()` (or `<AppUpdateBar />`) so the user can load a new deploy. See https://docs.pylonsync.com/ssr/offline.
|
|
63
64
|
- **`response.*` / `response.redirect()` / `response.notFound()` must fire in the synchronous shell render**, before any `await` / `<Suspense>`. The HTTP head commits when the shell is ready; status/headers/cookies set from a suspended subtree are lost, and `redirect`/`notFound` thrown below a Suspense boundary are swallowed.
|
|
64
65
|
- **`ctx.llm`, `ctx.rooms`, and `ctx.connections` are on mutation + action only, NOT query** (reactive purity). `action` has no direct `ctx.db`; use `ctx.runQuery` / `ctx.runMutation`.
|
|
65
66
|
- **`ctx.llm.stream(request, onEvent)` streams tokens as they generate** and still resolves with the full response, so `stop_reason === "tool_use"` drives an agent tool loop. Events are `text_delta` / `tool_use_start` / `tool_input_delta` / `done`. Same auth + model-allowlist gating as `ctx.llm.complete`. The call timeout is an idle timeout (`PYLON_FN_CALL_TIMEOUT`, 30s default; Stack0 Cloud 300s): each stream event resets it, and the total run is capped at 10× the timeout. Set `timeout: <secs>` on the def when a step (a slow tool call) can be silent longer than that.
|
|
@@ -60,6 +60,7 @@ this pass before the user has to ask.
|
|
|
60
60
|
Reading them one at a time (`use(serverData.a()); use(serverData.b());`) is correct but serial: each read waits for the one above it.
|
|
61
61
|
|
|
62
62
|
- **`serverData` (SSR) is READ-ONLY.** No write methods; the runtime rejects write frames (`SSR_WRITE_FORBIDDEN`). Mutations belong in actions/functions, never in a page render.
|
|
63
|
+
- **Offline routes render from the replica.** With `buildManifest({ offline: { routes } })`, each listed route opens with no network. Read its data with `db.useQuery` / `db.useQueryOne`, never `serverData`, and do not read `props.auth`, headers or cookies in the render (use `props.session.exists` and `useSession()`). The service worker keeps a page only when its HTML is the same for every signed-in user; the browser console says why a page was refused, and `pylon lint` flags `serverData` on an offline route (PYL008). Offline routes, and pages that `export const navigation = "client"`, navigate with no page fetch (same render rules; PYL010 flags a "client" page that reads `serverData`). An installed app keeps running the old build until it reloads; show `useAppUpdate()` (or `<AppUpdateBar />`) so the user can load a new deploy. See https://docs.pylonsync.com/ssr/offline.
|
|
63
64
|
- **`response.*` / `response.redirect()` / `response.notFound()` must fire in the synchronous shell render**, before any `await` / `<Suspense>`. The HTTP head commits when the shell is ready; status/headers/cookies set from a suspended subtree are lost, and `redirect`/`notFound` thrown below a Suspense boundary are swallowed.
|
|
64
65
|
- **`ctx.llm`, `ctx.rooms`, and `ctx.connections` are on mutation + action only, NOT query** (reactive purity). `action` has no direct `ctx.db`; use `ctx.runQuery` / `ctx.runMutation`.
|
|
65
66
|
- **`ctx.llm.stream(request, onEvent)` streams tokens as they generate** and still resolves with the full response, so `stop_reason === "tool_use"` drives an agent tool loop. Events are `text_delta` / `tool_use_start` / `tool_input_delta` / `done`. Same auth + model-allowlist gating as `ctx.llm.complete`. The call timeout is an idle timeout (`PYLON_FN_CALL_TIMEOUT`, 30s default; Stack0 Cloud 300s): each stream event resets it, and the total run is capped at 10× the timeout. Set `timeout: <secs>` on the def when a step (a slow tool call) can be silent longer than that.
|
|
@@ -60,6 +60,7 @@ this pass before the user has to ask.
|
|
|
60
60
|
Reading them one at a time (`use(serverData.a()); use(serverData.b());`) is correct but serial: each read waits for the one above it.
|
|
61
61
|
|
|
62
62
|
- **`serverData` (SSR) is READ-ONLY.** No write methods; the runtime rejects write frames (`SSR_WRITE_FORBIDDEN`). Mutations belong in actions/functions, never in a page render.
|
|
63
|
+
- **Offline routes render from the replica.** With `buildManifest({ offline: { routes } })`, each listed route opens with no network. Read its data with `db.useQuery` / `db.useQueryOne`, never `serverData`, and do not read `props.auth`, headers or cookies in the render (use `props.session.exists` and `useSession()`). The service worker keeps a page only when its HTML is the same for every signed-in user; the browser console says why a page was refused, and `pylon lint` flags `serverData` on an offline route (PYL008). Offline routes, and pages that `export const navigation = "client"`, navigate with no page fetch (same render rules; PYL010 flags a "client" page that reads `serverData`). An installed app keeps running the old build until it reloads; show `useAppUpdate()` (or `<AppUpdateBar />`) so the user can load a new deploy. See https://docs.pylonsync.com/ssr/offline.
|
|
63
64
|
- **`response.*` / `response.redirect()` / `response.notFound()` must fire in the synchronous shell render**, before any `await` / `<Suspense>`. The HTTP head commits when the shell is ready; status/headers/cookies set from a suspended subtree are lost, and `redirect`/`notFound` thrown below a Suspense boundary are swallowed.
|
|
64
65
|
- **`ctx.llm`, `ctx.rooms`, and `ctx.connections` are on mutation + action only, NOT query** (reactive purity). `action` has no direct `ctx.db`; use `ctx.runQuery` / `ctx.runMutation`.
|
|
65
66
|
- **`ctx.llm.stream(request, onEvent)` streams tokens as they generate** and still resolves with the full response, so `stop_reason === "tool_use"` drives an agent tool loop. Events are `text_delta` / `tool_use_start` / `tool_input_delta` / `done`. Same auth + model-allowlist gating as `ctx.llm.complete`. The call timeout is an idle timeout (`PYLON_FN_CALL_TIMEOUT`, 30s default; Stack0 Cloud 300s): each stream event resets it, and the total run is capped at 10× the timeout. Set `timeout: <secs>` on the def when a step (a slow tool call) can be silent longer than that.
|
|
@@ -60,6 +60,7 @@ this pass before the user has to ask.
|
|
|
60
60
|
Reading them one at a time (`use(serverData.a()); use(serverData.b());`) is correct but serial: each read waits for the one above it.
|
|
61
61
|
|
|
62
62
|
- **`serverData` (SSR) is READ-ONLY.** No write methods; the runtime rejects write frames (`SSR_WRITE_FORBIDDEN`). Mutations belong in actions/functions, never in a page render.
|
|
63
|
+
- **Offline routes render from the replica.** With `buildManifest({ offline: { routes } })`, each listed route opens with no network. Read its data with `db.useQuery` / `db.useQueryOne`, never `serverData`, and do not read `props.auth`, headers or cookies in the render (use `props.session.exists` and `useSession()`). The service worker keeps a page only when its HTML is the same for every signed-in user; the browser console says why a page was refused, and `pylon lint` flags `serverData` on an offline route (PYL008). Offline routes, and pages that `export const navigation = "client"`, navigate with no page fetch (same render rules; PYL010 flags a "client" page that reads `serverData`). An installed app keeps running the old build until it reloads; show `useAppUpdate()` (or `<AppUpdateBar />`) so the user can load a new deploy. See https://docs.pylonsync.com/ssr/offline.
|
|
63
64
|
- **`response.*` / `response.redirect()` / `response.notFound()` must fire in the synchronous shell render**, before any `await` / `<Suspense>`. The HTTP head commits when the shell is ready; status/headers/cookies set from a suspended subtree are lost, and `redirect`/`notFound` thrown below a Suspense boundary are swallowed.
|
|
64
65
|
- **`ctx.llm`, `ctx.rooms`, and `ctx.connections` are on mutation + action only, NOT query** (reactive purity). `action` has no direct `ctx.db`; use `ctx.runQuery` / `ctx.runMutation`.
|
|
65
66
|
- **`ctx.llm.stream(request, onEvent)` streams tokens as they generate** and still resolves with the full response, so `stop_reason === "tool_use"` drives an agent tool loop. Events are `text_delta` / `tool_use_start` / `tool_input_delta` / `done`. Same auth + model-allowlist gating as `ctx.llm.complete`. The call timeout is an idle timeout (`PYLON_FN_CALL_TIMEOUT`, 30s default; Stack0 Cloud 300s): each stream event resets it, and the total run is capped at 10× the timeout. Set `timeout: <secs>` on the def when a step (a slow tool call) can be silent longer than that.
|
|
@@ -60,6 +60,7 @@ this pass before the user has to ask.
|
|
|
60
60
|
Reading them one at a time (`use(serverData.a()); use(serverData.b());`) is correct but serial: each read waits for the one above it.
|
|
61
61
|
|
|
62
62
|
- **`serverData` (SSR) is READ-ONLY.** No write methods; the runtime rejects write frames (`SSR_WRITE_FORBIDDEN`). Mutations belong in actions/functions, never in a page render.
|
|
63
|
+
- **Offline routes render from the replica.** With `buildManifest({ offline: { routes } })`, each listed route opens with no network. Read its data with `db.useQuery` / `db.useQueryOne`, never `serverData`, and do not read `props.auth`, headers or cookies in the render (use `props.session.exists` and `useSession()`). The service worker keeps a page only when its HTML is the same for every signed-in user; the browser console says why a page was refused, and `pylon lint` flags `serverData` on an offline route (PYL008). Offline routes, and pages that `export const navigation = "client"`, navigate with no page fetch (same render rules; PYL010 flags a "client" page that reads `serverData`). An installed app keeps running the old build until it reloads; show `useAppUpdate()` (or `<AppUpdateBar />`) so the user can load a new deploy. See https://docs.pylonsync.com/ssr/offline.
|
|
63
64
|
- **`response.*` / `response.redirect()` / `response.notFound()` must fire in the synchronous shell render**, before any `await` / `<Suspense>`. The HTTP head commits when the shell is ready; status/headers/cookies set from a suspended subtree are lost, and `redirect`/`notFound` thrown below a Suspense boundary are swallowed.
|
|
64
65
|
- **`ctx.llm`, `ctx.rooms`, and `ctx.connections` are on mutation + action only, NOT query** (reactive purity). `action` has no direct `ctx.db`; use `ctx.runQuery` / `ctx.runMutation`.
|
|
65
66
|
- **`ctx.llm.stream(request, onEvent)` streams tokens as they generate** and still resolves with the full response, so `stop_reason === "tool_use"` drives an agent tool loop. Events are `text_delta` / `tool_use_start` / `tool_input_delta` / `done`. Same auth + model-allowlist gating as `ctx.llm.complete`. The call timeout is an idle timeout (`PYLON_FN_CALL_TIMEOUT`, 30s default; Stack0 Cloud 300s): each stream event resets it, and the total run is capped at 10× the timeout. Set `timeout: <secs>` on the def when a step (a slow tool call) can be silent longer than that.
|
|
@@ -60,6 +60,7 @@ this pass before the user has to ask.
|
|
|
60
60
|
Reading them one at a time (`use(serverData.a()); use(serverData.b());`) is correct but serial: each read waits for the one above it.
|
|
61
61
|
|
|
62
62
|
- **`serverData` (SSR) is READ-ONLY.** No write methods; the runtime rejects write frames (`SSR_WRITE_FORBIDDEN`). Mutations belong in actions/functions, never in a page render.
|
|
63
|
+
- **Offline routes render from the replica.** With `buildManifest({ offline: { routes } })`, each listed route opens with no network. Read its data with `db.useQuery` / `db.useQueryOne`, never `serverData`, and do not read `props.auth`, headers or cookies in the render (use `props.session.exists` and `useSession()`). The service worker keeps a page only when its HTML is the same for every signed-in user; the browser console says why a page was refused, and `pylon lint` flags `serverData` on an offline route (PYL008). Offline routes, and pages that `export const navigation = "client"`, navigate with no page fetch (same render rules; PYL010 flags a "client" page that reads `serverData`). An installed app keeps running the old build until it reloads; show `useAppUpdate()` (or `<AppUpdateBar />`) so the user can load a new deploy. See https://docs.pylonsync.com/ssr/offline.
|
|
63
64
|
- **`response.*` / `response.redirect()` / `response.notFound()` must fire in the synchronous shell render**, before any `await` / `<Suspense>`. The HTTP head commits when the shell is ready; status/headers/cookies set from a suspended subtree are lost, and `redirect`/`notFound` thrown below a Suspense boundary are swallowed.
|
|
64
65
|
- **`ctx.llm`, `ctx.rooms`, and `ctx.connections` are on mutation + action only, NOT query** (reactive purity). `action` has no direct `ctx.db`; use `ctx.runQuery` / `ctx.runMutation`.
|
|
65
66
|
- **`ctx.llm.stream(request, onEvent)` streams tokens as they generate** and still resolves with the full response, so `stop_reason === "tool_use"` drives an agent tool loop. Events are `text_delta` / `tool_use_start` / `tool_input_delta` / `done`. Same auth + model-allowlist gating as `ctx.llm.complete`. The call timeout is an idle timeout (`PYLON_FN_CALL_TIMEOUT`, 30s default; Stack0 Cloud 300s): each stream event resets it, and the total run is capped at 10× the timeout. Set `timeout: <secs>` on the def when a step (a slow tool call) can be silent longer than that.
|
package/templates/saas/AGENTS.md
CHANGED
|
@@ -60,6 +60,7 @@ this pass before the user has to ask.
|
|
|
60
60
|
Reading them one at a time (`use(serverData.a()); use(serverData.b());`) is correct but serial: each read waits for the one above it.
|
|
61
61
|
|
|
62
62
|
- **`serverData` (SSR) is READ-ONLY.** No write methods; the runtime rejects write frames (`SSR_WRITE_FORBIDDEN`). Mutations belong in actions/functions, never in a page render.
|
|
63
|
+
- **Offline routes render from the replica.** With `buildManifest({ offline: { routes } })`, each listed route opens with no network. Read its data with `db.useQuery` / `db.useQueryOne`, never `serverData`, and do not read `props.auth`, headers or cookies in the render (use `props.session.exists` and `useSession()`). The service worker keeps a page only when its HTML is the same for every signed-in user; the browser console says why a page was refused, and `pylon lint` flags `serverData` on an offline route (PYL008). Offline routes, and pages that `export const navigation = "client"`, navigate with no page fetch (same render rules; PYL010 flags a "client" page that reads `serverData`). An installed app keeps running the old build until it reloads; show `useAppUpdate()` (or `<AppUpdateBar />`) so the user can load a new deploy. See https://docs.pylonsync.com/ssr/offline.
|
|
63
64
|
- **`response.*` / `response.redirect()` / `response.notFound()` must fire in the synchronous shell render**, before any `await` / `<Suspense>`. The HTTP head commits when the shell is ready; status/headers/cookies set from a suspended subtree are lost, and `redirect`/`notFound` thrown below a Suspense boundary are swallowed.
|
|
64
65
|
- **`ctx.llm`, `ctx.rooms`, and `ctx.connections` are on mutation + action only, NOT query** (reactive purity). `action` has no direct `ctx.db`; use `ctx.runQuery` / `ctx.runMutation`.
|
|
65
66
|
- **`ctx.llm.stream(request, onEvent)` streams tokens as they generate** and still resolves with the full response, so `stop_reason === "tool_use"` drives an agent tool loop. Events are `text_delta` / `tool_use_start` / `tool_input_delta` / `done`. Same auth + model-allowlist gating as `ctx.llm.complete`. The call timeout is an idle timeout (`PYLON_FN_CALL_TIMEOUT`, 30s default; Stack0 Cloud 300s): each stream event resets it, and the total run is capped at 10× the timeout. Set `timeout: <secs>` on the def when a step (a slow tool call) can be silent longer than that.
|
package/templates/shop/AGENTS.md
CHANGED
|
@@ -60,6 +60,7 @@ this pass before the user has to ask.
|
|
|
60
60
|
Reading them one at a time (`use(serverData.a()); use(serverData.b());`) is correct but serial: each read waits for the one above it.
|
|
61
61
|
|
|
62
62
|
- **`serverData` (SSR) is READ-ONLY.** No write methods; the runtime rejects write frames (`SSR_WRITE_FORBIDDEN`). Mutations belong in actions/functions, never in a page render.
|
|
63
|
+
- **Offline routes render from the replica.** With `buildManifest({ offline: { routes } })`, each listed route opens with no network. Read its data with `db.useQuery` / `db.useQueryOne`, never `serverData`, and do not read `props.auth`, headers or cookies in the render (use `props.session.exists` and `useSession()`). The service worker keeps a page only when its HTML is the same for every signed-in user; the browser console says why a page was refused, and `pylon lint` flags `serverData` on an offline route (PYL008). Offline routes, and pages that `export const navigation = "client"`, navigate with no page fetch (same render rules; PYL010 flags a "client" page that reads `serverData`). An installed app keeps running the old build until it reloads; show `useAppUpdate()` (or `<AppUpdateBar />`) so the user can load a new deploy. See https://docs.pylonsync.com/ssr/offline.
|
|
63
64
|
- **`response.*` / `response.redirect()` / `response.notFound()` must fire in the synchronous shell render**, before any `await` / `<Suspense>`. The HTTP head commits when the shell is ready; status/headers/cookies set from a suspended subtree are lost, and `redirect`/`notFound` thrown below a Suspense boundary are swallowed.
|
|
64
65
|
- **`ctx.llm`, `ctx.rooms`, and `ctx.connections` are on mutation + action only, NOT query** (reactive purity). `action` has no direct `ctx.db`; use `ctx.runQuery` / `ctx.runMutation`.
|
|
65
66
|
- **`ctx.llm.stream(request, onEvent)` streams tokens as they generate** and still resolves with the full response, so `stop_reason === "tool_use"` drives an agent tool loop. Events are `text_delta` / `tool_use_start` / `tool_input_delta` / `done`. Same auth + model-allowlist gating as `ctx.llm.complete`. The call timeout is an idle timeout (`PYLON_FN_CALL_TIMEOUT`, 30s default; Stack0 Cloud 300s): each stream event resets it, and the total run is capped at 10× the timeout. Set `timeout: <secs>` on the def when a step (a slow tool call) can be silent longer than that.
|
package/templates/todo/AGENTS.md
CHANGED
|
@@ -60,6 +60,7 @@ this pass before the user has to ask.
|
|
|
60
60
|
Reading them one at a time (`use(serverData.a()); use(serverData.b());`) is correct but serial: each read waits for the one above it.
|
|
61
61
|
|
|
62
62
|
- **`serverData` (SSR) is READ-ONLY.** No write methods; the runtime rejects write frames (`SSR_WRITE_FORBIDDEN`). Mutations belong in actions/functions, never in a page render.
|
|
63
|
+
- **Offline routes render from the replica.** With `buildManifest({ offline: { routes } })`, each listed route opens with no network. Read its data with `db.useQuery` / `db.useQueryOne`, never `serverData`, and do not read `props.auth`, headers or cookies in the render (use `props.session.exists` and `useSession()`). The service worker keeps a page only when its HTML is the same for every signed-in user; the browser console says why a page was refused, and `pylon lint` flags `serverData` on an offline route (PYL008). Offline routes, and pages that `export const navigation = "client"`, navigate with no page fetch (same render rules; PYL010 flags a "client" page that reads `serverData`). An installed app keeps running the old build until it reloads; show `useAppUpdate()` (or `<AppUpdateBar />`) so the user can load a new deploy. See https://docs.pylonsync.com/ssr/offline.
|
|
63
64
|
- **`response.*` / `response.redirect()` / `response.notFound()` must fire in the synchronous shell render**, before any `await` / `<Suspense>`. The HTTP head commits when the shell is ready; status/headers/cookies set from a suspended subtree are lost, and `redirect`/`notFound` thrown below a Suspense boundary are swallowed.
|
|
64
65
|
- **`ctx.llm`, `ctx.rooms`, and `ctx.connections` are on mutation + action only, NOT query** (reactive purity). `action` has no direct `ctx.db`; use `ctx.runQuery` / `ctx.runMutation`.
|
|
65
66
|
- **`ctx.llm.stream(request, onEvent)` streams tokens as they generate** and still resolves with the full response, so `stop_reason === "tool_use"` drives an agent tool loop. Events are `text_delta` / `tool_use_start` / `tool_input_delta` / `done`. Same auth + model-allowlist gating as `ctx.llm.complete`. The call timeout is an idle timeout (`PYLON_FN_CALL_TIMEOUT`, 30s default; Stack0 Cloud 300s): each stream event resets it, and the total run is capped at 10× the timeout. Set `timeout: <secs>` on the def when a step (a slow tool call) can be silent longer than that.
|
|
@@ -60,6 +60,7 @@ this pass before the user has to ask.
|
|
|
60
60
|
Reading them one at a time (`use(serverData.a()); use(serverData.b());`) is correct but serial: each read waits for the one above it.
|
|
61
61
|
|
|
62
62
|
- **`serverData` (SSR) is READ-ONLY.** No write methods; the runtime rejects write frames (`SSR_WRITE_FORBIDDEN`). Mutations belong in actions/functions, never in a page render.
|
|
63
|
+
- **Offline routes render from the replica.** With `buildManifest({ offline: { routes } })`, each listed route opens with no network. Read its data with `db.useQuery` / `db.useQueryOne`, never `serverData`, and do not read `props.auth`, headers or cookies in the render (use `props.session.exists` and `useSession()`). The service worker keeps a page only when its HTML is the same for every signed-in user; the browser console says why a page was refused, and `pylon lint` flags `serverData` on an offline route (PYL008). Offline routes, and pages that `export const navigation = "client"`, navigate with no page fetch (same render rules; PYL010 flags a "client" page that reads `serverData`). An installed app keeps running the old build until it reloads; show `useAppUpdate()` (or `<AppUpdateBar />`) so the user can load a new deploy. See https://docs.pylonsync.com/ssr/offline.
|
|
63
64
|
- **`response.*` / `response.redirect()` / `response.notFound()` must fire in the synchronous shell render**, before any `await` / `<Suspense>`. The HTTP head commits when the shell is ready; status/headers/cookies set from a suspended subtree are lost, and `redirect`/`notFound` thrown below a Suspense boundary are swallowed.
|
|
64
65
|
- **`ctx.llm`, `ctx.rooms`, and `ctx.connections` are on mutation + action only, NOT query** (reactive purity). `action` has no direct `ctx.db`; use `ctx.runQuery` / `ctx.runMutation`.
|
|
65
66
|
- **`ctx.llm.stream(request, onEvent)` streams tokens as they generate** and still resolves with the full response, so `stop_reason === "tool_use"` drives an agent tool loop. Events are `text_delta` / `tool_use_start` / `tool_input_delta` / `done`. Same auth + model-allowlist gating as `ctx.llm.complete`. The call timeout is an idle timeout (`PYLON_FN_CALL_TIMEOUT`, 30s default; Stack0 Cloud 300s): each stream event resets it, and the total run is capped at 10× the timeout. Set `timeout: <secs>` on the def when a step (a slow tool call) can be silent longer than that.
|