caspian-utils 0.0.15 → 0.0.16

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/dist/docs/auth.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Authentication
3
- description: Manage session-backed authentication in Caspian with `casp.auth`, `AuthSettings`, the global `auth` object, centralized `auth_config.py`, page decorators, RPC protection, role-based routes, and optional Google or GitHub OAuth providers.
3
+ description: Use this page when the task mentions `auth_config.py`, sign-in, signout, protected routes, `require_auth`, RBAC, auth decorators, or Google or GitHub OAuth in Caspian.
4
4
  related:
5
5
  title: Related docs
6
6
  description: Use the fetch-data guide when sign-in or signout happens through RPC, then use the state guide for transient auth-adjacent request state, validation to guard credentials, and routing or project structure to place auth files correctly.
@@ -113,7 +113,7 @@ Important behavior from the current implementation:
113
113
  - `default_token_validity` is parsed by the installed auth runtime with the format `^\d+(s|m|h|d)$`. Use values such as `30m`, `1h`, or `7d`.
114
114
  - `token_auto_refresh` only changes behavior when the request lifecycle calls `auth.refresh_session()`. In the installed `auth.py`, the flag alone does not refresh expiry by itself.
115
115
  - The framework `AuthSettings` dataclass defaults `is_all_routes_private=True`, but the project example above explicitly changes that to `False`.
116
- - In generated app-owned config like this workspace, `src/lib/auth/auth_config.py` starts with `is_all_routes_private=False`, so routes are public by default until the app chooses stricter route protection.
116
+ - In generated app-owned starter config, `src/lib/auth/auth_config.py` starts with `is_all_routes_private=False`, so routes are public by default until the app chooses stricter route protection.
117
117
  - `public_routes`, `auth_routes`, `private_routes`, and `role_based_routes` are exact path matches in the installed `Auth` methods.
118
118
  - `private_routes` matters only when `is_all_routes_private=False`.
119
119
  - `role_based_routes` currently expects `PATH -> [ROLES]`, not role names keyed to paths the other way around.
@@ -124,7 +124,7 @@ Important behavior from the current implementation:
124
124
 
125
125
  Make this decision at app setup time in `src/lib/auth/auth_config.py`.
126
126
 
127
- - In the default app-owned starter pattern used in this workspace, routes start public because `is_all_routes_private=False` in `src/lib/auth/auth_config.py`.
127
+ - In the default app-owned starter pattern, routes start public because `is_all_routes_private=False` in `src/lib/auth/auth_config.py`.
128
128
  - If the application has only a few public pages and most routes require auth, set `is_all_routes_private=True` and list the exceptions in `public_routes`.
129
129
  - If the application has many public pages and only a few protected areas, keep `is_all_routes_private=False` and list only the protected routes in `private_routes`.
130
130
  - In the current runtime, `auth_routes=["/signin", "/signup"]` stays public by default, and most apps do not need to change it unless the user explicitly asks for different auth routes.
@@ -756,14 +756,14 @@ Common placement patterns are:
756
756
 
757
757
  For browser-triggered auth forms, pair this page with `fetch-data.md`. For credential and form validation, pair it with `validation.md`.
758
758
 
759
- ## AI Routing Notes
759
+ ## AI Retrieval Notes
760
760
 
761
761
  If an AI agent is deciding how to handle auth in Caspian, apply these rules first.
762
762
 
763
763
  - Treat `casp.auth` as the default authentication layer.
764
764
  - Centralize route visibility, redirects, and RBAC policy in `src/lib/auth/auth_config.py`.
765
765
  - Decide route mode early in `src/lib/auth/auth_config.py`: use `is_all_routes_private=True` when most routes should require auth, otherwise keep `is_all_routes_private=False` and list protected routes in `private_routes`.
766
- - In app-owned starter config like this workspace, treat `is_all_routes_private=False` as the default starting point, which means routes begin public until the app opts into stricter protection.
766
+ - In app-owned starter config, treat `is_all_routes_private=False` as the default starting point, which means routes begin public until the app opts into stricter protection.
767
767
  - Treat `public_routes` as the public exception list for all-private apps. In the current defaults, `/` stays public and `auth_routes=["/signin", "/signup"]` stays public too.
768
768
  - Apply settings at startup in `main.py` with `configure_auth(build_auth_settings())`.
769
769
  - Register provider instances in `main.py` with `Auth.set_providers(...)` when Google or GitHub OAuth is enabled.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Cache
3
- description: Cache rendered Caspian route HTML with `casp.cache_handler`, `Cache`, and `CacheHandler`, using route-level TTLs, file-system storage, and explicit invalidation for public read-heavy pages.
3
+ description: Use this page when the task mentions `Cache`, `CacheHandler`, page caching, route HTML reuse, TTLs, or invalidation in Caspian.
4
4
  related:
5
5
  title: Related docs
6
6
  description: Use the routing guide to place route-level cache declarations correctly, then pair cache with fetch-data when deciding what can be safely served from reused HTML.
@@ -242,7 +242,7 @@ Poor candidates are:
242
242
  - forms whose server-rendered HTML includes request-specific or sensitive state
243
243
  - pages that need sub-second freshness unless you have reliable invalidation hooks
244
244
 
245
- ## AI Routing Notes
245
+ ## AI Retrieval Notes
246
246
 
247
247
  If an AI agent is deciding whether or how to cache a Caspian route, apply these rules first.
248
248
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Commands
3
- description: Use the current Caspian CLI reference to choose the right scaffold, starter-kit, update, and Prisma regeneration workflow for the current workspace.
3
+ description: Use this Caspian command reference for scaffolding, project updates, feature enablement, builds, and ORM regeneration. Use when the task mentions `create-caspian-app`, `casp update project`, `npm run dev`, `npm run build`, `prisma migrate`, or `ppy generate`.
4
4
  related:
5
5
  title: Related docs
6
6
  description: Start with installation for new apps, then use database, MCP, and structure docs when commands affect schema, server tooling, generated ORM files, or project layout.
@@ -14,13 +14,13 @@ related:
14
14
  - /docs/index
15
15
  ---
16
16
 
17
- This page documents the current Caspian command families used with this workspace and the surrounding docs toolchain.
17
+ This page documents the main Caspian command families and the checks an AI agent should make before running them in a project.
18
18
 
19
19
  ## Overview
20
20
 
21
- The current workspace includes a local `prisma` binary, but it does not include local `create-caspian-app`, `casp`, or `ppy` binaries under `node_modules/.bin`. Treat project creation, project update, and Python ORM generation as external `npx` workflows rather than project-local executables.
21
+ Project creation, project updates, and Python ORM generation are commonly driven through `npx` workflows plus any project-local `package.json` scripts that a given project defines.
22
22
 
23
- The current workspace `package.json` defines `projectName`, `tailwind`, `tailwind:build`, `mcp`, `browserSync`, `browserSync:build`, `dev`, and `build`.
23
+ Do not assume a local binary, script, or generated file exists just because a doc mentions it. Confirm the actual `package.json`, repository tree, and `caspian.config.json` values in the project you are working on.
24
24
 
25
25
  Examples below use `npx create-caspian-app` for readability. If you want to force the latest published scaffold package explicitly, you can use `npx create-caspian-app@latest` instead.
26
26
 
@@ -33,7 +33,7 @@ This updated reference includes the newer updater behavior and the current scaff
33
33
  - Windows-safe execution that resolves `npx.cmd` on Win32
34
34
  - scaffold behavior that reuses an existing `.venv` instead of recreating it every time
35
35
 
36
- Before running update commands, read `caspian.config.json` because it controls feature flags and `excludeFiles` overwrite protection. In the current workspace that config shows `backendOnly: false`, `tailwindcss: true`, `mcp: false`, `prisma: true`, `typescript: false`, and `componentScanDirs: ["src"]`.
36
+ Before running update commands, read `caspian.config.json` because it controls feature flags and any `excludeFiles` overwrite protection.
37
37
 
38
38
  Treat `caspian.config.json` as the single source of truth for optional feature enablement. Use feature-specific docs, files, or commands only after the matching flag is confirmed as enabled.
39
39
 
@@ -82,9 +82,9 @@ npm run dev
82
82
 
83
83
  Use when the user explicitly wants the local BrowserSync plus PostCSS development stack.
84
84
 
85
- In this workspace, `npm run dev` is a long-running command that can regenerate framework-owned outputs such as `public/css/styles.css`, `settings/component-map.json`, `settings/files-list.json`, `__pycache__/`, and `.pyc` files.
85
+ Only use this when the current project's `package.json` actually defines `npm run dev`.
86
86
 
87
- Because runtime uploads write to `public/assets/file-manager/`, `settings/bs-config.ts` keeps that directory in `PUBLIC_IGNORE_DIRS` so uploads do not trigger BrowserSync reloads.
87
+ Long-running local stack commands can regenerate framework-owned outputs such as built CSS, generated component maps, route maps, `__pycache__/`, and `.pyc` files. Treat project-specific generated outputs as artifacts when those workflows intentionally run.
88
88
 
89
89
  ### Build generated assets for deployment
90
90
 
@@ -94,6 +94,8 @@ npm run build
94
94
 
95
95
  Use when preparing deployment or when the user explicitly asks for a build.
96
96
 
97
+ Only use this when the current project's `package.json` actually defines `npm run build`.
98
+
97
99
  Do not use `npm run build` as the default validation step for routine route, feature, or documentation edits.
98
100
 
99
101
  ### Regenerate ORM after schema changes
@@ -120,7 +122,7 @@ Use when `prisma/schema.prisma` changes and you need migrations, seed flow, and
120
122
  - Use `npm run build` only for deployment prep or an explicit build request.
121
123
  - Treat `public/css/styles.css`, `settings/component-map.json`, `settings/files-list.json`, `__pycache__/`, and `.pyc` files as generated outputs when a script intentionally runs.
122
124
  - Analyze `settings/component-map.json` and `settings/files-list.json` when needed, but do not hand-edit them. `settings/component-map.ts` and `settings/files-list.ts` regenerate them during the intentional dev and build flows.
123
- - Keep runtime upload directories such as `public/assets/file-manager` in `settings/bs-config.ts` `PUBLIC_IGNORE_DIRS` so BrowserSync does not reload on every uploaded blob.
125
+ - Keep any runtime upload directory that the project uses in the BrowserSync ignore list so uploads do not trigger reloads on every new blob.
124
126
  - Do not edit `__pycache__/` directories or `.pyc` files, and do not leave them in the final diff.
125
127
 
126
128
  ## 3. Supported Flags And Options
@@ -583,7 +585,7 @@ Result: parsing error because more than one version source was provided.
583
585
 
584
586
  ## 8. Prisma And Python ORM Regeneration
585
587
 
586
- The create and update commands above are not the whole maintenance story for this workspace. When `prisma/schema.prisma` changes, follow the ORM flow below so the TypeScript Prisma client, database state, and Python ORM layer stay aligned.
588
+ The create and update commands above are not the whole maintenance story for a Prisma-enabled Caspian project. When `prisma/schema.prisma` changes, follow the ORM flow below so the TypeScript Prisma client, database state, and Python ORM layer stay aligned.
587
589
 
588
590
  ### Required order after schema changes
589
591
 
@@ -663,7 +665,7 @@ If you exclude a file, the updater preserves it, but you are responsible for mer
663
665
  4. Starter kits still support later overrides via explicit CLI flags.
664
666
  5. Frontend-oriented flags are only fully meaningful when `backendOnly` is false.
665
667
 
666
- ## AI Routing Notes
668
+ ## AI Retrieval Notes
667
669
 
668
670
  If an AI agent is deciding which command flow to use, apply these rules first.
669
671
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Components
3
- description: Create reusable Caspian components as `@component` Python functions, import them into templates as `<MyComponent />`, and split interactive UI into same-name HTML templates when PulsePoint logic is involved.
3
+ description: Use this page when the task mentions `@component`, reusable UI, component imports, same-name `.html` templates, or where shared components belong in a Caspian project.
4
4
  related:
5
5
  title: Related docs
6
6
  description: Use the structure guide for file placement, the routing guide for route templates, the PulsePoint guide for browser-side scripts, and the data guide for component-owned RPC flows.
@@ -16,7 +16,7 @@ Components in Caspian are Python functions decorated with `@component`.
16
16
 
17
17
  Import them into a template with an `@import` comment, then render them with JSX-style tags such as `<MyComponent />` or `<MyComponent>...</MyComponent>`.
18
18
 
19
- For the current workspace, component tooling scans Python files under the paths listed in `caspian.config.json`. Right now that means `src/`, so `src/components/` is the clean default location for reusable UI, even though any scanned path under `src/` can work.
19
+ Component tooling scans Python files under the paths listed in `caspian.config.json`. When `componentScanDirs` includes `src/`, `src/components/` is the clean default location for reusable UI, even though any scanned path can work.
20
20
 
21
21
  As the app grows, treat `src/components/` as the default home for reusable application UI. Keep route-owned markup in `src/app/`, and keep non-UI helpers or services in `src/lib/`.
22
22
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Database
3
- description: Use Prisma in this workspace through `prisma/schema.prisma`, `prisma.config.ts`, migrations, seeding, and the generated client defined by the local schema.
3
+ description: Use this page when the task mentions Prisma, `schema.prisma`, `prisma.config.ts`, migrations, `seed.ts`, Prisma Client, or `ppy generate` in a Caspian project.
4
4
  related:
5
5
  title: Related docs
6
6
  description: Use the project structure guide to place database files correctly, then use the fetch-data guide when Prisma calls need to power route rendering or RPC actions.
@@ -12,9 +12,9 @@ related:
12
12
  - /docs/index
13
13
  ---
14
14
 
15
- This page documents the Prisma workflow present in this workspace.
15
+ This page documents the Prisma workflow for Caspian projects where `caspian.config.json` enables Prisma.
16
16
 
17
- This repo currently uses Prisma for schema management, migrations, and seed tooling on the Node side. The local `prisma/schema.prisma` uses `generator client { provider = "prisma-client-js" }`, `prisma.config.ts` seeds through `tsx prisma/seed.ts`, and this workspace already includes an app-owned Python database layer under `src/lib/prisma/`. If Python routes or RPC actions need database access, reuse that package instead of creating another helper.
17
+ When a project enables Prisma, use `prisma/schema.prisma` for schema management, `prisma.config.ts` for Prisma config and seed wiring, and reuse an app-owned `src/lib/prisma/` package when the project includes one.
18
18
 
19
19
  Treat `caspian.config.json` as the single source of truth for whether Prisma is enabled in a workspace. If `prisma` is false and the user wants Prisma, ask first, then update `caspian.config.json` and run `npx casp update project` before assuming Prisma-managed files exist.
20
20
 
@@ -102,7 +102,7 @@ model Post {
102
102
  }
103
103
  ```
104
104
 
105
- After changing the schema, use this order in the current workspace:
105
+ After changing the schema, use this order:
106
106
 
107
107
  1. Run `npx prisma migrate dev`.
108
108
  2. If seed data or the seed script needs the new schema, run `npx prisma generate` and then `npx prisma db seed`.
@@ -129,21 +129,21 @@ Default rule:
129
129
  - Use migrations for tracked application changes.
130
130
  - Use `db push` only when you intentionally want a faster, migration-free prototype loop.
131
131
 
132
- ## Prisma Files In This Workspace
132
+ ## Prisma Files To Inspect
133
133
 
134
- The current repo ships Prisma files in these locations:
134
+ In a Prisma-enabled Caspian project, inspect these locations:
135
135
 
136
136
  ### `prisma/schema.prisma`
137
137
 
138
- This file is the schema source of truth. It currently defines a `prisma-client-js` generator.
138
+ This file is the schema source of truth. Confirm the actual datasource and generator configuration in the current project.
139
139
 
140
140
  ### `prisma.config.ts`
141
141
 
142
- This file configures the schema path, migrations path, and the seed entry point. In this workspace it runs seeds through `tsx prisma/seed.ts`.
142
+ This file configures the schema path, migrations path, and the seed entry point. Confirm the actual seed command and import path in the current project.
143
143
 
144
144
  ### `prisma/seed.ts`
145
145
 
146
- This file is the current example of code that imports and uses the generated Prisma client.
146
+ This file is the project-local example of code that imports and uses the generated Prisma client.
147
147
 
148
148
  ### `node_modules/@prisma/client/`
149
149
 
@@ -151,13 +151,13 @@ After `npx prisma generate`, Prisma writes the generated JavaScript client into
151
151
 
152
152
  ### `src/lib/prisma/`
153
153
 
154
- This workspace already includes an app-owned async Python database package that exports `prisma`, `PrismaClient`, generated models, and helper types.
154
+ If the project includes an app-owned async Python database package here, it typically exports `prisma`, `PrismaClient`, generated models, and helper types.
155
155
 
156
156
  If Python route or RPC code needs database access, import from `src.lib.prisma` and keep that import path explicit in application code. Refresh generated classes with `npx ppy generate` instead of editing them manually.
157
157
 
158
158
  ## Python Route Usage
159
159
 
160
- This workspace already ships an app-owned Python Prisma-style layer under `src/lib/prisma/`. Treat it as async-first and reuse it from route and RPC code.
160
+ If the project ships an app-owned Python Prisma-style layer under `src/lib/prisma/`, treat it as async-first and reuse it from route and RPC code.
161
161
 
162
162
  Example:
163
163
 
@@ -338,7 +338,7 @@ Use raw SQL sparingly. Prefer the generated Prisma API when the query can be exp
338
338
  - Validate incoming mutation data before calling `create`, `update`, or `delete` operations.
339
339
  - Prefer Prisma queries over raw SQL, and prefer raw SQL over undocumented custom query helpers.
340
340
 
341
- ## AI Routing Notes
341
+ ## AI Retrieval Notes
342
342
 
343
343
  If an AI agent is working on a Caspian app with Prisma enabled, apply these rules first.
344
344
 
@@ -348,7 +348,7 @@ If an AI agent is working on a Caspian app with Prisma enabled, apply these rule
348
348
  - If the schema change requires seed data, run `npx prisma generate` and then `npx prisma db seed`.
349
349
  - Run `npx ppy generate` after schema changes to refresh the Python ORM classes.
350
350
  - Never hand-edit generated Prisma or Python ORM classes.
351
- - Read `prisma.config.ts` and `prisma/seed.ts` when you need the current workspace's Prisma tooling examples.
351
+ - Read `prisma.config.ts` and `prisma/seed.ts` when you need the current project's Prisma tooling examples.
352
352
  - Reuse the existing `src/lib/prisma/` package when the Python app needs database access.
353
353
  - For file managers and uploads, persist metadata in Prisma and keep blob storage separate. See [file-uploads.md](./file-uploads.md).
354
354
  - Put reusable database helpers in `src/lib/`; keep route and RPC orchestration in `src/app/`.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Fetch Data
3
- description: Fetch first-render and interactive data in Caspian with async route functions, `@rpc()` actions, `pp.rpc()`, streaming, and uploads, with RPC as the default browser-to-server data path.
3
+ description: Use this page when the task mentions `page()`, `layout()`, `@rpc()`, `pp.rpc()`, streaming, interactive fetches, uploads, or browser-triggered data loads in Caspian.
4
4
  related:
5
5
  title: Related docs
6
6
  description: Use the routing guide to place route logic correctly, then use the auth guide for protected actions, the MCP guide for AI-facing tools, the state guide for transient request-scoped mutation state, the cache guide for reusable first-render HTML, and the PulsePoint runtime guide for client-side `pp.rpc()` details.
@@ -21,7 +21,7 @@ This page explains how data fetching works in Caspian. Use route functions for i
21
21
 
22
22
  Treat RPC as the default way for browser code to talk to Python in Caspian. Do not reach for ad hoc fetch calls to custom JSON endpoints, alternate transport layers, or older helper names unless the task explicitly requires that shape.
23
23
 
24
- MCP is a separate integration surface. Do not place app-owned FastMCP tools in route `index.py` files or treat `@rpc()` actions as a replacement for MCP tools. Use `mcp.md` and `src/lib/mcp/` only when `caspian.config.json` has `mcp: true`. In this workspace, `mcp: false`, so do not assume those files exist.
24
+ MCP is a separate integration surface. Do not place app-owned FastMCP tools in route `index.py` files or treat `@rpc()` actions as a replacement for MCP tools. Use `mcp.md` and `src/lib/mcp/` only when `caspian.config.json` has `mcp: true`. If `mcp` is false, do not assume those files exist.
25
25
 
26
26
  ## Overview
27
27
 
@@ -74,7 +74,7 @@ Notes:
74
74
  - Put shared section-level props in `layout.py` when multiple child routes need the same synchronous payload. The current layout engine does not await `layout()`.
75
75
  - Keep reusable database or API clients under `src/lib/`; keep route-specific orchestration in `src/app/`.
76
76
 
77
- If the data source is Prisma, confirm `caspian.config.json` has `prisma: true`, then see `database.md` for the current workspace's schema, migration, and generation workflow. In this workspace, Prisma is enabled and the app-owned Python database layer lives under `src/lib/prisma/`.
77
+ If the data source is Prisma, confirm `caspian.config.json` has `prisma: true`, then see `database.md` for the project's schema, migration, and generation workflow. If the project includes an app-owned Python database layer under `src/lib/prisma/`, reuse it instead of creating another helper.
78
78
 
79
79
  ## Interactive Data With RPC
80
80
 
@@ -285,7 +285,7 @@ A common pattern is:
285
285
 
286
286
  If the first-render HTML is expensive to produce and safe to share between visitors, add route-level caching with [cache.md](./cache.md) and invalidate affected URIs after successful mutations.
287
287
 
288
- ## AI Routing Notes
288
+ ## AI Retrieval Notes
289
289
 
290
290
  If an AI agent is choosing how to load data in Caspian, apply these rules first.
291
291
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: File Uploads And File Managers
3
- description: Build Caspian file upload and file manager flows with route-local `@rpc()` actions, `pp.rpc()`, Prisma metadata, public asset storage, and BrowserSync-safe upload directories.
3
+ description: Use this page when the task mentions file uploads, file managers, file pickers, upload progress, public storage paths, or BrowserSync-safe upload directories in Caspian.
4
4
  related:
5
5
  title: Related docs
6
6
  description: Use fetch-data for the route versus RPC split, PulsePoint for client runtime behavior, database for Prisma persistence, project structure for file placement, validation for upload guards, and commands for local watcher behavior.
@@ -14,7 +14,7 @@ related:
14
14
  - /docs/index
15
15
  ---
16
16
 
17
- This page documents the recommended file upload and file manager pattern for this workspace and similar Caspian applications.
17
+ This page documents the recommended file upload and file manager pattern for Caspian projects.
18
18
 
19
19
  Treat uploads as normal route behavior. Keep the owning browser UI in the route template, keep upload and delete `@rpc()` actions in the owning route `index.py`, and move reusable storage or persistence helpers into `src/lib/`.
20
20
 
@@ -23,7 +23,7 @@ Treat uploads as normal route behavior. Keep the owning browser UI in the route
23
23
  - Keep first-render file manager data in `page()` so the initial HTML already contains the current asset list and storage summary.
24
24
  - Keep upload and delete actions in the route's `index.py`; do not move ordinary upload flows into `main.py`.
25
25
  - Keep reusable file-manager helpers in `src/lib/`.
26
- - Store uploaded blobs under `public/assets/file-manager/...` when the files should be browser-accessible.
26
+ - Store uploaded blobs under a project-owned public directory such as `public/storage/...` when the files should be browser-accessible.
27
27
  - Store durable metadata in Prisma, not in JSON manifests or ad hoc metadata files.
28
28
  - Use `pp.state(...)` plus `pp-for` to render and update the file list from returned server payloads.
29
29
  - Use `onUploadProgress` only for progress UI; let the RPC return refreshed manager data for the authoritative post-upload state.
@@ -36,8 +36,8 @@ Treat uploads as normal route behavior. Keep the owning browser UI in the route
36
36
  | Upload and delete `@rpc()` actions | `src/app/**/index.py` | Keep these route-local so they stay close to the owning page. |
37
37
  | Shared storage, normalization, and persistence helpers | `src/lib/**` | Reuse helpers across routes without pushing route behavior into app bootstrap. |
38
38
  | Upload metadata model | `prisma/schema.prisma` | Persist owner, file name, MIME type, path, size, collection, and timestamps in Prisma. |
39
- | Browser-accessible uploaded blobs | `public/assets/file-manager/**` | Keep the public path predictable and derived from stored metadata. |
40
- | BrowserSync upload ignore | `settings/bs-config.ts` | Keep `public/assets/file-manager` in `PUBLIC_IGNORE_DIRS`. |
39
+ | Browser-accessible uploaded blobs | `public/storage/**` or another app-owned public directory | Keep the public path predictable and derived from stored metadata. |
40
+ | BrowserSync upload ignore | `settings/bs-config.ts` | Keep the active public upload directory in `PUBLIC_IGNORE_DIRS`. |
41
41
 
42
42
  ## Route Flow
43
43
 
@@ -161,7 +161,7 @@ Match those entries against workspace-relative paths so nested uploads such as `
161
161
  - Do not manually repaint the file list with `innerHTML` when PulsePoint state can own the list.
162
162
  - Do not leave uploaded public directories out of BrowserSync ignore rules.
163
163
 
164
- ## AI Routing Notes
164
+ ## AI Retrieval Notes
165
165
 
166
166
  - Read this page first when the task mentions uploads, file pickers, file managers, media libraries, or upload progress UI.
167
167
  - Use `fetch-data.md` for the route-render versus RPC split.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Caspian Docs
3
- description: Caspian documentation with AI-aware routing to the right local docs before framework-specific code generation or project setup changes, with components, PulsePoint, RPC, and Validate as the default app stack.
3
+ description: Packaged Caspian documentation manifest for AI task routing, feature discovery, and file placement. Use this page when deciding which Caspian doc to read first or which feature guide applies.
4
4
  related:
5
5
  title: Next Steps
6
6
  description: Start with installation, review the CLI commands, then use the structure and component guides to place Caspian files correctly.
@@ -13,11 +13,13 @@ related:
13
13
  - /docs/components
14
14
  ---
15
15
 
16
- This directory contains the local Caspian documentation set for quick reference and AI-aware routing.
16
+ This directory contains the packaged Caspian documentation set for AI-aware feature discovery, task routing, and file-placement guidance.
17
17
 
18
- Before making feature, tooling, or file-placement decisions in a Caspian workspace, read `./caspian.config.json` almost immediately. That file is the project feature gate and tells you which capabilities are enabled, such as Prisma, MCP, TypeScript, Tailwind, backend-only mode, and component scan directories.
18
+ Treat these docs as reusable Caspian feature guidance. Treat `./caspian.config.json` as the single source of truth for which optional features are enabled in the project being analyzed.
19
19
 
20
- Treat `caspian.config.json` as the single source of truth for optional feature enablement. Use feature-specific docs only after the matching flag is confirmed as enabled. If a feature is disabled and the user wants it, ask whether they want to enable it first, then follow the update workflow in `commands.md`.
20
+ The docs can mention optional features even when those features are disabled in a project. Their job is to explain how a feature works, when a doc applies, and which files to inspect next once the feature is confirmed as relevant.
21
+
22
+ Before making feature, tooling, or file-placement decisions in a Caspian project, read `./caspian.config.json` almost immediately. That file tells you which optional capabilities are enabled, such as Prisma, MCP, TypeScript, Tailwind, backend-only mode, and component scan directories.
21
23
 
22
24
  ## Default Stack
23
25
 
@@ -29,11 +31,7 @@ When generating or editing a Caspian app, treat these as the default choices unl
29
31
 
30
32
  ## Docs Location
31
33
 
32
- The local AI-aware docs for this workspace live here:
33
-
34
- - `node_modules/caspian-utils/dist/docs/`
35
-
36
- The packaged Caspian docs distributed by the current toolchain also live here:
34
+ The packaged Caspian docs referenced by this index live here:
37
35
 
38
36
  - `node_modules/caspian-utils/dist/docs/`
39
37
 
@@ -41,8 +39,8 @@ The packaged Caspian docs distributed by the current toolchain also live here:
41
39
 
42
40
  - `installation.md` - First-time setup flow for creating a new Caspian application
43
41
  - `commands.md` - Main Caspian CLI workflows for project creation, generation, updates, and config-aware maintenance
44
- - `mcp.md` - MCP-specific layout, launch flow, and AI routing rules for workspaces where `caspian.config.json` enables MCP
45
- - `database.md` - Prisma schema, migration, seed, and client-generation workflow for workspaces where `caspian.config.json` enables Prisma, plus Python-side helper caveats
42
+ - `mcp.md` - MCP-specific layout, launch flow, and AI routing rules for projects where `caspian.config.json` enables MCP
43
+ - `database.md` - Prisma schema, migration, seed, and client-generation workflow for projects where `caspian.config.json` enables Prisma, plus Python-side helper caveats
46
44
  - `auth.md` - Session-backed authentication with `casp.auth`, centralized `auth_config.py`, public-vs-private route mode guidance, RPC-first signout guidance, RBAC, and OAuth provider helpers
47
45
  - `components.md` - Create reusable Python components, template-backed UI, JSX-style imports, and the single-parent root rule for component HTML files
48
46
  - `pulsepoint.md` - Default reactive frontend runtime contract for component scripts, state, effects, directives, and client-side behaviors
@@ -55,25 +53,19 @@ The packaged Caspian docs distributed by the current toolchain also live here:
55
53
  - `routing.md` - Next.js App Router-style file-based routing with `src/app`, dynamic segments, route groups, nested layouts, and single-root route templates
56
54
  - `project-structure.md` - Default Caspian layout and where route files, reusable UI in `src/components/`, reusable non-UI code in `src/lib/`, and database files belong
57
55
 
58
- ## AI Awareness Notes
56
+ ## AI Retrieval Notes
59
57
 
60
- If an AI tool needs Caspian project documentation, start with this directory and use this file as the manifest.
58
+ If an AI tool needs Caspian documentation, start with this directory and use this file as the manifest.
61
59
 
62
60
  Preferred lookup order:
63
61
 
64
62
  1. Read `node_modules/caspian-utils/dist/docs/index.md` to discover available local docs.
65
- 2. Read `./caspian.config.json` before making any feature assumption. Use it to confirm which project capabilities are enabled and which directories or tooling rules apply.
63
+ 2. Read `./caspian.config.json` before making any feature assumption. A doc existing in the package does not mean that feature is enabled in the current project.
66
64
  3. Treat `caspian.config.json` as the single source of truth for optional features. Use feature-specific docs only when the matching flag is enabled. If a feature is disabled and the user wants it, ask first, then update `caspian.config.json` and follow the update workflow in `commands.md`.
67
- 4. Read `commands.md` before running any `package.json` script. In this workspace, npm scripts are opt-in operational commands, not default validation steps. Do not run them unless the user explicitly asks, the task genuinely requires that exact script, or deployment preparation needs `npm run build`.
68
- 5. Treat generated outputs such as `public/css/styles.css`, `settings/component-map.json`, `settings/files-list.json`, `__pycache__/`, and `.pyc` files as framework-managed artifacts when the local stack is intentionally running. They are not authored source files and should not be kept in the final diff unless the task explicitly requires them.
69
- 6. Analyze `settings/component-map.json` and `settings/files-list.json` when you need the current generated view of components or routes, but do not hand-edit them. The framework regenerates them through `settings/component-map.ts` and `settings/files-list.ts` when the dev or build pipeline intentionally runs.
70
- 7. Read `database.md` only when `caspian.config.json` enables Prisma, read `mcp.md` only when `caspian.config.json` enables MCP, and use `auth.md`, `components.md`, `pulsepoint.md`, `fetch-data.md`, `state.md`, `cache.md`, and `validation.md` as the next routing docs for those non-flagged concerns.
71
- 8. Read `file-uploads.md` when the task mentions uploads, file pickers, file managers, media libraries, upload progress, or BrowserSync-safe public upload directories.
72
- 9. As the app grows, standardize on `src/app/` for route-owned files, `src/components/` for reusable rendered UI, and `src/lib/` for reusable non-UI support code such as services, validators, adapters, and shared helpers.
73
- 10. For authored component, route, and layout HTML files, generate exactly one top-level lowercase HTML element. Think React-style single parent wrapper: keep any owned PulsePoint logic in a plain `<script>` inside that root, do not handwrite `pp-component="..."` or `type="text/pp"` because Caspian injects those runtime attributes automatically, and treat `<!-- @import ... -->` comments as file-level directives that belong above the authored root element instead of inside `<div>`, `<section>`, or `<html>`. When several component tags come from one Python file, import them from that exact file path, for example `<!-- @import { Breadcrumb, BreadcrumbItem, BreadcrumbList } from "../components/Breadcrumb.py" -->`.
74
- 11. Prefer local docs before generating code, commands, or migration guidance.
75
- 12. Check `node_modules/caspian-utils/dist/docs/` for packaged Caspian docs when local docs need more detail.
76
- 13. Only fall back to upstream documentation when local and packaged markdown do not cover the topic.
65
+ 4. After the feature is confirmed, inspect the actual project files that decide behavior, such as `package.json`, `main.py`, `src/app/**`, `src/lib/**`, `settings/**`, `prisma/**`, and the installed `casp` runtime.
66
+ 5. Use `commands.md` for scaffold and update workflows, `project-structure.md` for placement decisions, and the feature docs such as `mcp.md`, `database.md`, `auth.md`, `fetch-data.md`, and `file-uploads.md` for task-specific guidance.
67
+ 6. Prefer packaged Caspian docs before upstream documentation when generating code, commands, or migration guidance.
68
+ 7. Keep `index.md` and cross-links aligned so AI can quickly discover the right doc.
77
69
 
78
70
  ## Maintenance
79
71
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Installation
3
- description: Learn how to create a new Caspian application so AI agents use the first-time setup flow instead of assuming an existing project is already in place.
3
+ description: Use this page when creating a new Caspian application, scaffolding a project, running first-time setup, or choosing optional features during install.
4
4
  related:
5
5
  title: Related docs
6
6
  description: Continue with the routing, structure, and MCP guides after scaffold so the new app follows Caspian conventions and keeps optional FastMCP files in the right place.
@@ -19,7 +19,7 @@ This page documents the first-time Caspian setup flow for new applications.
19
19
 
20
20
  Caspian provides a scaffold flow for new apps with a FastAPI backend and a PulsePoint-based reactive frontend workflow.
21
21
 
22
- In this workspace, the local `caspian-utils` package ships documentation only, so scaffold commands are resolved through external `npx` packages rather than project-local binaries.
22
+ These packaged docs can exist inside an already-created Caspian project, but scaffold commands themselves are typically resolved through external `npx` packages rather than from this docs directory.
23
23
 
24
24
  ## Default App Stack
25
25
 
@@ -61,7 +61,7 @@ After scaffold, read `caspian.config.json` and treat it as the single source of
61
61
 
62
62
  If a feature is disabled and the user wants it later, ask whether they want to enable it first, then update `caspian.config.json` and run `npx casp update project` so framework-managed files align with the new feature set.
63
63
 
64
- If the project enables MCP, use `mcp.md` after scaffold to place the app-owned FastMCP server and config files correctly for the current workspace conventions.
64
+ If the project enables MCP, use `mcp.md` after scaffold to place the app-owned FastMCP server and config files correctly for that project's conventions.
65
65
 
66
66
  ## Recommended VS Code Setup
67
67
 
@@ -85,7 +85,7 @@ cd my-app
85
85
  npm run dev
86
86
  ```
87
87
 
88
- In this workspace, `npm run dev` is backed by BrowserSync plus PostCSS watchers, not a Vite dev server.
88
+ Confirm what `npm run dev` does in the generated project's `package.json`. Many Caspian projects use BrowserSync plus PostCSS watchers rather than a Vite dev server, but the actual script wins.
89
89
 
90
90
  For AI agents and other automated helpers, this is an opt-in local-stack command, not a default validation step. Do not run `package.json` scripts just because a route, feature, or doc changed.
91
91
 
@@ -93,7 +93,7 @@ If `npm run dev` is intentionally running, let that stack own generated outputs
93
93
 
94
94
  Inspect `settings/component-map.json` and `settings/files-list.json` when you need the generated component or route inventory, but do not hand-edit them. The framework refreshes them from `settings/component-map.ts` and `settings/files-list.ts`.
95
95
 
96
- If runtime uploads write into `public/assets/file-manager/`, keep that directory in `settings/bs-config.ts` `PUBLIC_IGNORE_DIRS` so BrowserSync does not reload on every uploaded file.
96
+ If runtime uploads write into a public upload directory, keep that directory in `settings/bs-config.ts` `PUBLIC_IGNORE_DIRS` so BrowserSync does not reload on every uploaded file.
97
97
 
98
98
  ## After Setup
99
99
 
@@ -109,7 +109,7 @@ Once the project is scaffolded:
109
109
  - Read `routing.md` to learn how `src/app` folders map to URLs.
110
110
  - Read `project-structure.md` to place route code, shared libraries, config, and database files in the correct directories.
111
111
 
112
- ## AI Routing Notes
112
+ ## AI Retrieval Notes
113
113
 
114
114
  If an AI agent is reading this page, treat it as the source for new-project installation steps.
115
115
 
package/dist/docs/mcp.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: MCP
3
- description: Check `caspian.config.json` first. When it enables MCP, this page becomes the relevant guide for reviewing, fixing, launching, and extending the workspace MCP feature.
3
+ description: Check `caspian.config.json` first. Use this page when the task mentions MCP, FastMCP, `mcp_server.py`, `fastmcp.json`, tool servers, or enabling MCP in a Caspian project.
4
4
  related:
5
5
  title: Related docs
6
6
  description: Start with project structure for file placement, then use commands for feature enablement and local run flows, and index for documentation routing.
@@ -11,9 +11,9 @@ related:
11
11
  - /docs/index
12
12
  ---
13
13
 
14
- This page documents the Model Context Protocol workflow for Caspian workspaces.
14
+ This page documents the Model Context Protocol workflow for Caspian projects.
15
15
 
16
- Treat `caspian.config.json` as the single source of truth for whether MCP is enabled. If `caspian.config.json` confirms `"mcp": true`, this page is relevant, the MCP-specific files in the workspace are the correct files to analyze, and the feature can be reviewed, fixed, launched, or extended here.
16
+ Treat `caspian.config.json` as the single source of truth for whether MCP is enabled. If `caspian.config.json` confirms `"mcp": true`, this page is relevant, the MCP-specific files in the project are the correct files to analyze, and the feature can be reviewed, fixed, launched, or extended here.
17
17
 
18
18
  If `caspian.config.json` has `"mcp": false`, treat this page as reference material only. Do not assume `src/lib/mcp/**`, `settings/restart-mcp.ts`, or MCP-related npm scripts exist until the user chooses to enable MCP and the update workflow has run.
19
19
 
@@ -22,35 +22,35 @@ If `caspian.config.json` has `"mcp": false`, treat this page as reference materi
22
22
  1. Read `caspian.config.json` and confirm `mcp: true` before assuming MCP files or scripts should exist.
23
23
  2. If `mcp` is false and the user wants MCP, ask for confirmation first.
24
24
  3. After the user confirms, update `caspian.config.json` and run `npx casp update project` so framework-managed MCP files align with the new feature set.
25
- 4. After the update, inspect the actual `package.json`, `src/lib/mcp/`, and any launcher files that the workspace now contains.
25
+ 4. After the update, inspect the actual `package.json`, `src/lib/mcp/`, and any launcher files that the project now contains.
26
26
 
27
- ## MCP-Enabled Workspace Layout
27
+ ## MCP-Enabled Project Layout
28
28
 
29
29
  When `caspian.config.json` has `mcp: true`, these are the main MCP surfaces to inspect:
30
30
 
31
31
  - `src/lib/mcp/mcp_server.py` for the app-owned FastMCP server, tool definitions, instructions, and MCP-specific helper logic.
32
32
  - `src/lib/mcp/fastmcp.json` for the default FastMCP config, transport, host, port, path, and server entrypoint.
33
- - `settings/restart-mcp.ts` for workspace-specific launcher logic, discovery order, environment overrides, or log filtering when that file is present.
34
- - `package.json` for the actual MCP-related scripts that the current workspace defines.
33
+ - `settings/restart-mcp.ts` for project-specific launcher logic, discovery order, environment overrides, or log filtering when that file is present.
34
+ - `package.json` for the actual MCP-related scripts that the current project defines.
35
35
 
36
- If these files exist in the workspace, they are the right files to analyze when reviewing or fixing MCP behavior.
36
+ If these files exist in the project, they are the right files to analyze when reviewing or fixing MCP behavior.
37
37
 
38
38
  ## What To Review
39
39
 
40
40
  When `mcp: true` and an MCP issue needs investigation, inspect the files in this order:
41
41
 
42
42
  1. `caspian.config.json` to confirm the feature is enabled.
43
- 2. `package.json` to see which MCP scripts the workspace actually exposes.
43
+ 2. `package.json` to see which MCP scripts the project actually exposes.
44
44
  3. `src/lib/mcp/mcp_server.py` for tool implementation and server behavior.
45
45
  4. `src/lib/mcp/fastmcp.json` for config and entrypoint details.
46
- 5. `settings/restart-mcp.ts` when the workspace includes it and launcher behavior is part of the issue.
46
+ 5. `settings/restart-mcp.ts` when the project includes it and launcher behavior is part of the issue.
47
47
 
48
48
  ## Running MCP
49
49
 
50
- Only when `caspian.config.json` has `mcp: true` and the relevant files or scripts exist:
50
+ Only when `caspian.config.json` has `mcp: true` and the relevant files or scripts exist in the project:
51
51
 
52
- - Use the workspace-defined `npm run mcp` command when `package.json` provides it.
53
- - Use `npm run dev` only if the workspace wires MCP into the full local stack and the user explicitly wants that full stack running.
52
+ - Use the project-defined `npm run mcp` command when `package.json` provides it.
53
+ - Use `npm run dev` only if the project wires MCP into the full local stack and the user explicitly wants that full stack running.
54
54
  - Use direct FastMCP commands against `src/lib/mcp/fastmcp.json` when that config file exists, for example:
55
55
 
56
56
  ```powershell
@@ -58,18 +58,12 @@ Only when `caspian.config.json` has `mcp: true` and the relevant files or script
58
58
  .venv\Scripts\fastmcp.exe run src/lib/mcp/fastmcp.json --no-banner
59
59
  ```
60
60
 
61
- Because script names and launcher wiring can vary by workspace version, always confirm the actual scripts in `package.json` instead of assuming them from docs alone.
61
+ Because script names and launcher wiring can vary by project, always confirm the actual scripts in `package.json` instead of assuming them from docs alone.
62
62
 
63
- ## Current Workspace Status
64
-
65
- - `caspian.config.json` currently has `mcp: false`.
66
- - `package.json` does not currently define `npm run mcp`.
67
- - The current repo tree should not be treated as if `src/lib/mcp/**` is guaranteed to exist.
68
-
69
- ## AI Routing Notes
63
+ ## AI Retrieval Notes
70
64
 
71
65
  1. Read `caspian.config.json` first.
72
66
  2. If `mcp` is false, do not infer MCP files, scripts, or launch flow from generic Caspian examples.
73
67
  3. If the user wants MCP while it is disabled, ask first, then update `caspian.config.json` and use `npx casp update project` before continuing.
74
- 4. If `mcp` is true, this page becomes the relevant MCP guide and the MCP-specific files in the workspace become the correct analysis surface.
75
- 5. Inspect the actual generated files and scripts in the workspace before editing or starting anything.
68
+ 4. If `mcp` is true, this page becomes the relevant MCP guide and the MCP-specific files in the project become the correct analysis surface.
69
+ 5. Inspect the actual generated files and scripts in the project before editing or starting anything.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Metadata & SEO
3
- description: Define static and dynamic metadata in Caspian so titles, descriptions, and social cards inherit correctly from layouts to pages.
3
+ description: Use this page when the task mentions metadata, SEO, page titles, descriptions, Open Graph, Twitter cards, or layout-to-page metadata inheritance in Caspian.
4
4
  related:
5
5
  title: Related docs
6
6
  description: Use the routing guide to place layout.py and index.py files correctly, then use the structure guide when deciding where metadata defaults belong.
@@ -185,7 +185,7 @@ Keep visual layout data and SEO metadata separate.
185
185
  - Put page-specific static metadata in `index.py`.
186
186
  - Put dynamic metadata inside `page()` after you have route params or fetched data.
187
187
 
188
- ## AI Routing Notes
188
+ ## AI Retrieval Notes
189
189
 
190
190
  If an AI agent is deciding where to put SEO fields, apply these rules first.
191
191
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Project Structure
3
- description: Understand the default Caspian project layout so AI agents place routes, reusable components, PulsePoint templates, RPC actions, validation helpers, auth code, MCP files, configuration, and database changes in the correct directories.
3
+ description: Understand the default Caspian project layout so AI agents place routes, reusable components, `src/lib` helpers, auth code, MCP files, public assets, and database changes in the correct directories. Use when deciding where project files belong.
4
4
  related:
5
5
  title: Related docs
6
6
  description: Start with installation for new apps, then use the component guide for reusable UI, the auth guide for bootstrap and session wiring, the MCP guide for server layout, the routing guide to map URLs correctly, and the cache guide when route HTML should be reused safely.
@@ -18,6 +18,8 @@ related:
18
18
 
19
19
  This page explains the default layout of a Caspian application, where Caspian core files live, and which paths AI agents should treat as project code versus framework internals.
20
20
 
21
+ Treat it as a framework guide for Caspian projects. Use `caspian.config.json` and the actual repository tree to confirm which optional directories and files exist in the current project.
22
+
21
23
  ## Overview
22
24
 
23
25
  Caspian uses a lean project layout that keeps application code in `src`, database files in `prisma`, static assets in `public`, configuration in `caspian.config.json`, and framework internals in the installed package.
@@ -123,7 +125,7 @@ For component HTML files, follow the same one-parent rule as route HTML files: o
123
125
 
124
126
  Do not handwrite `pp-component="..."` or `type="text/pp"` in component source templates either. Write plain `<script>` inside the single root and let the render pipeline inject the runtime shape.
125
127
 
126
- This workspace's component tooling scans `src/` based on `caspian.config.json`, so `src/components/` is a conventionally clean location, not a hard-coded runtime requirement.
128
+ The directories listed in `componentScanDirs` determine where component tooling scans. When that list includes `src/`, `src/components/` is a conventionally clean location, not a hard-coded runtime requirement.
127
129
 
128
130
  ### `src/lib/`
129
131
 
@@ -133,15 +135,15 @@ If the code is primarily rendered UI that will be imported as a component tag, p
133
135
 
134
136
  For file upload and manager flows, keep route-owned `@rpc()` actions in `src/app/**/index.py` and keep shared storage, naming, filesystem, and Prisma-backed persistence helpers in `src/lib/`.
135
137
 
136
- This workspace already includes an app-owned Python database layer under `src/lib/prisma/`. Reuse that package for Python-side data access and keep any additional shared database helpers in `src/lib/`.
138
+ When a project includes an app-owned Python database layer under `src/lib/prisma/`, reuse that package for Python-side data access and keep any additional shared database helpers in `src/lib/`.
137
139
 
138
- When MCP is enabled in the current workspace, this folder also contains the app-owned FastMCP server under `src/lib/mcp/`.
140
+ When MCP is enabled for the project, this folder also contains the app-owned FastMCP server under `src/lib/mcp/`.
139
141
 
140
142
  ### Shared Database Helpers
141
143
 
142
144
  If your Python routes or RPC actions need reusable database access code, keep that helper layer under `src/lib/` and extend the existing `src/lib/prisma/` package.
143
145
 
144
- In this workspace, Prisma schema and seed files live under `prisma/`, while the Python-side adapter is application-owned code under `src/lib/prisma/`.
146
+ In a Prisma-enabled Caspian project, schema and seed files typically live under `prisma/`, while the Python-side adapter lives in application-owned code under `src/lib/prisma/` when that layer exists.
145
147
 
146
148
  ### `src/lib/auth/`
147
149
 
@@ -158,7 +160,7 @@ When `caspian.config.json` has `mcp: true`:
158
160
 
159
161
  Keep MCP tool definitions here instead of placing them in route files, `main.py`, or framework internals.
160
162
 
161
- In the current workspace, `mcp: false`, so do not assume this folder exists until the feature is enabled and the update workflow has run.
163
+ If `caspian.config.json` has `mcp: false`, do not assume this folder exists until the feature is enabled and the update workflow has run.
162
164
 
163
165
  ### `prisma/`
164
166
 
@@ -168,7 +170,7 @@ This folder contains your database model definitions in `schema.prisma` and any
168
170
 
169
171
  Store static assets here, including images, fonts, and generated frontend assets that should be served directly.
170
172
 
171
- Runtime-uploaded public blobs can also live here. In this workspace, file-manager uploads are stored under `public/assets/file-manager/`.
173
+ Runtime-uploaded public blobs can also live here. Confirm the actual upload path in the project code and keep that directory aligned with any BrowserSync ignore rules.
172
174
 
173
175
  If the local BrowserSync stack is running, keep that upload directory in `settings/bs-config.ts` `PUBLIC_IGNORE_DIRS` so new uploads do not force a full browser reload.
174
176
 
@@ -195,7 +197,7 @@ The core feature configuration file for the application.
195
197
 
196
198
  AI agents should read this file before making almost any feature-level decision. Use it to confirm which capabilities are enabled, which code generation paths make sense, and which directories should be scanned for components or other project assets.
197
199
 
198
- In the current workspace, `caspian.config.json` shows `backendOnly: false`, `tailwindcss: true`, `mcp: false`, `prisma: true`, `typescript: false`, and `componentScanDirs: ["src"]`.
200
+ Read the actual values in `caspian.config.json` instead of inferring feature state from this doc.
199
201
 
200
202
  ### `settings/bs-config.ts`
201
203
 
@@ -256,11 +258,11 @@ Notable internal files include:
256
258
 
257
259
  The packaged Caspian documentation location distributed with the current toolchain.
258
260
 
259
- ## AI Routing Notes
261
+ ## AI Retrieval Notes
260
262
 
261
263
  If an AI agent is deciding where to make changes, use these rules first.
262
264
 
263
- - Read `caspian.config.json` almost immediately before making feature, tooling, or file-placement decisions. It tells you which Caspian features are enabled in the current workspace.
265
+ - Read `caspian.config.json` almost immediately before making feature, tooling, or file-placement decisions. It tells you which Caspian features are enabled in the current project.
264
266
  - Treat `caspian.config.json` as the single source of truth for optional feature enablement. Use feature-specific docs and file paths only when the matching flag is enabled.
265
267
  - If an optional feature is disabled and the user wants it, ask first, then update `caspian.config.json` and use `npx casp update project` before assuming feature-managed files exist.
266
268
  - Treat `package.json` scripts as opt-in operations. Do not run `npm run dev` or `npm run build` unless the user explicitly asks, the task genuinely requires that exact script, or deployment prep needs `npm run build`.
@@ -282,7 +284,7 @@ If an AI agent is deciding where to make changes, use these rules first.
282
284
  - Use `@rpc()` in route/backend code and `pp.rpc()` in client code for browser-triggered data flows.
283
285
  - Use `casp.cache_handler` when a route's first-render HTML should be reused safely across requests.
284
286
  - Use `casp.validate` at route and RPC boundaries, and move reusable validators into `src/lib/` when multiple routes share them.
285
- - Use `database.md` when the task involves Prisma schema changes, migrations, seed logic, or workspace-specific database helper conventions.
287
+ - Use `database.md` when the task involves Prisma schema changes, migrations, seed logic, or project-specific database helper conventions.
286
288
  - Put authentication configuration in `src/lib/auth/auth_config.py`.
287
289
  - Put auth bootstrap, session middleware, and provider registration changes in `main.py`.
288
290
  - Put database models and seed logic in `prisma/`.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: PulsePoint Runtime Guide
3
- description: Learn how AI agents should author PulsePoint against the shipped browser runtime in `public/js/pp-reactive-v2.js` and the Caspian render pipeline that injects runtime attributes automatically.
3
+ description: Use this page when the task mentions PulsePoint, `pp.state`, `pp.effect`, `pp-ref`, `pp-for`, portals, SPA navigation, or `public/js/pp-reactive-v2.js`.
4
4
  related:
5
5
  title: Related docs
6
6
  description: Read the components, routing, data-fetching, and project-structure docs alongside the PulsePoint runtime contract.
@@ -14,19 +14,19 @@ related:
14
14
 
15
15
  ## Purpose
16
16
 
17
- This file documents the current PulsePoint contract for this workspace. Treat it as the AI-facing source of truth when generating or reviewing interactive Caspian UI.
17
+ This file documents the PulsePoint contract for the shipped Caspian browser runtime. Treat it as the AI-facing source of truth when generating or reviewing interactive Caspian UI.
18
18
 
19
19
  If a task involves `pp.state`, `pp.effect`, `pp.layoutEffect`, `pp-ref`, `pp-spread`, `pp-for`, context, portals, SPA navigation, or component boundary behavior, read this page first and keep generated code aligned with the runtime implemented in this repo.
20
20
 
21
- Use `components.md` for authoring Python `@component` files and same-name HTML templates. Use this page for the browser-side PulsePoint contract, the authoring rules that feed it, and the React-style mental model used by the current runtime.
21
+ Use `components.md` for authoring Python `@component` files and same-name HTML templates. Use this page for the browser-side PulsePoint contract, the authoring rules that feed it, and the React-style mental model used by the shipped runtime.
22
22
 
23
- PulsePoint is the default reactive frontend layer for Caspian. In this workspace it follows a React-like component pattern, but it is HTML-first rather than JSX-first.
23
+ PulsePoint is the default reactive frontend layer for Caspian. In the current runtime it follows a React-like component pattern, but it is HTML-first rather than JSX-first.
24
24
 
25
25
  Do not assume React, Vue, Svelte, JSX, Alpine, HTMX, or older PulsePoint docs unless the task explicitly asks for a different frontend contract.
26
26
 
27
27
  ## Source Of Truth
28
28
 
29
- For the current workspace, follow this order when documenting or generating PulsePoint code:
29
+ When documenting or generating PulsePoint code, follow this order:
30
30
 
31
31
  - `public/js/pp-reactive-v2.js` is the shipped browser runtime contract AI should follow.
32
32
  - `main.py` is the render-pipeline source of truth for how Caspian injects runtime attributes and rewrites scripts before the browser sees the HTML.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Routing
3
- description: Understand Caspian's Next.js App Router-style file-based routing, including src/app conventions, index files, dynamic segments, route groups, nested layouts, and component-friendly route templates.
3
+ description: Use this page when the task mentions `src/app`, `index.py`, `index.html`, `layout.py`, dynamic routes, route groups, nested layouts, or file-based routing in Caspian.
4
4
  related:
5
5
  title: Related docs
6
6
  description: Read the structure guide first, then use the components guide for reusable UI, the metadata guide for SEO fields, the cache guide for route-level HTML reuse, and the PulsePoint runtime guide for interactive route templates.
@@ -307,7 +307,7 @@ src/
307
307
  index.py
308
308
  ```
309
309
 
310
- ## AI Routing Notes
310
+ ## AI Retrieval Notes
311
311
 
312
312
  If an AI agent is choosing where to add or update route code, apply these rules first.
313
313
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: State Management
3
- description: Manage transient Caspian server state with `casp.state_manager` and `StateManager`, using request-scoped ContextVar storage, shallow AttributeDict reads, listener callbacks, and session-backed JSON persistence.
3
+ description: Use this page when the task mentions `StateManager`, `request.state.session`, request-scoped state, listeners, or session-backed JSON state in Caspian.
4
4
  related:
5
5
  title: Related docs
6
6
  description: Pair server request state with auth and RPC flows, then read the PulsePoint guide when the state really belongs in the browser instead of the request lifecycle.
@@ -64,7 +64,7 @@ Important implementation detail:
64
64
 
65
65
  In other words, cross-request persistence depends on the surrounding Caspian middleware keeping `request.state.session` available and in sync with session storage.
66
66
 
67
- In this workspace's current `main.py`, `SessionMiddleware` exposes `request.session`, but the middleware stack does not mirror that into `request.state.session`. Treat persistence as opt-in until you add that bridge explicitly.
67
+ Inspect the current project's `main.py`: if `SessionMiddleware` exposes `request.session` but the middleware stack does not mirror that into `request.state.session`, treat persistence as opt-in until you add that bridge explicitly.
68
68
 
69
69
  ## Request Lifecycle
70
70
 
@@ -251,7 +251,7 @@ Poor candidates are:
251
251
 
252
252
  For browser-triggered writes and route actions, pair this page with [fetch-data.md](./fetch-data.md). For middleware and session-aware auth flows, pair it with [auth.md](./auth.md).
253
253
 
254
- ## AI Routing Notes
254
+ ## AI Retrieval Notes
255
255
 
256
256
  If an AI agent is deciding how to use transient state in a Caspian app, apply these rules first.
257
257
 
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  title: Validation
3
- description: Validate and sanitize Caspian inputs with `casp.validate`, `Validate`, `Rule`, direct validators, rule-based checks, and file or date or ID validation before route or RPC logic persists data, with Validate as the default server-side validation layer.
3
+ description: Use this page when the task mentions `Validate`, `Rule`, sanitization, form validation, credential checks, or guarding route and RPC inputs in Caspian.
4
4
  related:
5
- title: Related docs
5
+ title: Related docs
6
6
  description: Use the auth guide for session and credential flows, the fetch-data guide when validation runs inside RPC actions, then use the structure guide to place reusable validators in the right layer.
7
- links:
7
+ links:
8
8
  - /docs/auth
9
- - /docs/fetch-data
10
- - /docs/routing
11
- - /docs/project-structure
12
- - /docs/index
9
+ - /docs/fetch-data
10
+ - /docs/routing
11
+ - /docs/project-structure
12
+ - /docs/index
13
13
  ---
14
14
 
15
15
  This page explains the current installed Caspian validation API for direct field checks, rule-based validation, sanitization, and reusable input guards.
@@ -278,7 +278,7 @@ def create_account(data: dict):
278
278
  return {"success": True}
279
279
  ```
280
280
 
281
- ## AI Routing Notes
281
+ ## AI Retrieval Notes
282
282
 
283
283
  If an AI agent is deciding how to validate input in Caspian, apply these rules first.
284
284
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "caspian-utils",
3
- "version": "0.0.15",
3
+ "version": "0.0.16",
4
4
  "description": "Caspian tooling",
5
5
  "main": "index.js",
6
6
  "scripts": {