create-caspian-app 0.2.0-beta.39 → 0.2.0-beta.40
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/.github/copilot-instructions.md +9 -30
- package/dist/AGENTS.md +26 -26
- package/package.json +1 -1
|
@@ -5,14 +5,15 @@
|
|
|
5
5
|
|
|
6
6
|
## Global Rules
|
|
7
7
|
|
|
8
|
-
- Use this
|
|
8
|
+
- Use this decision order: `caspian.config.json` for optional feature enablement, app runtime and app-owned code for current project behavior, installed `casp` runtime for framework internals, and packaged markdown docs for Caspian feature discovery and task routing.
|
|
9
9
|
- As the app grows, prefer `src/components/` for reusable application UI and reserve `src/lib/` for reusable non-UI code such as services, validators, adapters, and shared helpers.
|
|
10
10
|
- Read `./caspian.config.json` almost immediately before making feature, tooling, scaffolding, or file-placement decisions. Treat it as the workspace feature gate for flags such as `backendOnly`, `tailwindcss`, `mcp`, `prisma`, `typescript`, and `componentScanDirs`.
|
|
11
11
|
- Treat `caspian.config.json` as the single source of truth for whether optional Caspian features are enabled in the current workspace. Use feature-specific docs, files, and commands only after the matching flag is confirmed as enabled.
|
|
12
12
|
- If a feature is disabled and the user wants it, ask whether they want to enable it first, then update `caspian.config.json` and follow `npx casp update project` so framework-managed files align with the new feature set.
|
|
13
|
+
- Treat `node_modules/caspian-utils/dist/docs/**` as packaged Caspian docs that teach AI how Caspian features work and where to look next. Their presence does not mean the feature is enabled in the current project.
|
|
13
14
|
- For current repo behavior, trust `main.py`, `src/lib/**`, `public/js/**`, `prisma/**`, and `src/app/**` over generic Caspian docs.
|
|
14
15
|
- For framework internals, trust `.venv/Lib/site-packages/casp/**` over generic or older upstream guidance.
|
|
15
|
-
- When docs
|
|
16
|
+
- When packaged docs conflict with project code or installed runtime, the project code, `caspian.config.json`, and installed runtime win. Keep the packaged docs feature-oriented and point AI back to the project files that decide actual enablement and behavior.
|
|
16
17
|
- When `prisma/schema.prisma` changes, follow this order: run `npx prisma migrate dev`; if the change affects seed flow or `prisma/seed.ts`, run `npx prisma generate` and then `npx prisma db seed`; then run `npx ppy generate` so the Python ORM stays aligned with the schema.
|
|
17
18
|
- Reuse the existing Python database layer in `src/lib/prisma/**`; do not create a second app-owned database abstraction unless the user explicitly asks for one.
|
|
18
19
|
- Treat `src/lib/prisma/__init__.py`, `src/lib/prisma/db.py`, `src/lib/prisma/models.py`, and `settings/prisma-schema.json` as generated outputs owned by `npx ppy generate`; do not create or hand-edit them manually.
|
|
@@ -103,34 +104,12 @@
|
|
|
103
104
|
|
|
104
105
|
### `node_modules/caspian-utils/dist/docs/**/*.md`
|
|
105
106
|
|
|
106
|
-
- These files are the
|
|
107
|
-
- Use
|
|
107
|
+
- These files are the packaged Caspian documentation layer, not the runtime and not the source of current workspace state.
|
|
108
|
+
- Use them to help AI answer three questions: which Caspian feature applies, which project files should be inspected next, and which workflow is appropriate once the feature is confirmed as enabled.
|
|
109
|
+
- Verify behavior claims in this order:
|
|
108
110
|
1. `caspian.config.json`, then `main.py`, `src/lib/**`, `public/js/**`, `prisma/**`, `src/app/**`
|
|
109
111
|
2. `.venv/Lib/site-packages/casp/**`
|
|
110
112
|
3. the markdown file being edited
|
|
111
|
-
- Keep
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
- this workspace already has `src/lib/prisma/**`
|
|
115
|
-
- this workspace currently has `mcp: false` in `caspian.config.json`, so do not assume `src/lib/mcp/**`, `settings/restart-mcp.ts`, or `npm run mcp` exist until MCP is explicitly enabled
|
|
116
|
-
- `package.json` currently defines `projectName`, `tailwind`, `tailwind:build`, `browserSync`, `browserSync:build`, `dev`, and `build`
|
|
117
|
-
- if a feature flag is false and the user wants that feature, ask before enabling it, then update `caspian.config.json` and use `npx casp update project` to refresh framework-managed files
|
|
118
|
-
- do not run `package.json` scripts by default for ordinary source edits; only use them when the user explicitly asks, the task requires them, or deployment prep needs `npm run build`
|
|
119
|
-
- `npm run dev` is a long-running local stack command that can regenerate `public/css/styles.css`, `settings/component-map.json`, `settings/files-list.json`, `__pycache__/`, and `.pyc` artifacts; those are generated outputs, not authored source files
|
|
120
|
-
- `node_modules/caspian-utils/dist/docs/file-uploads.md` is the source doc for route-local upload and file-manager guidance in this workspace
|
|
121
|
-
- uploaded public blobs live under `public/storage/**`, and `settings/bs-config.ts` should keep `public/storage` in `PUBLIC_IGNORE_DIRS`
|
|
122
|
-
- `settings/component-map.ts` and `settings/files-list.ts` own `settings/component-map.json` and `settings/files-list.json`; inspect the JSON when needed, but let the framework regenerate it instead of editing it by hand
|
|
123
|
-
- auth policy lives in `src/lib/auth/auth_config.py`
|
|
124
|
-
- the app-owned starter config in this workspace begins public-first with `is_all_routes_private=False`, so treat routes as public by default unless the app explicitly switches to all-private mode
|
|
125
|
-
- choose all-private mode in `src/lib/auth/auth_config.py` only when public routes are the minority; otherwise keep mixed mode and maintain `private_routes`
|
|
126
|
-
- `public_routes` is the exception list for all-private apps, while `auth_routes=["/signin", "/signup"]` stays public by default unless the app explicitly needs different auth endpoints
|
|
127
|
-
- `token_auto_refresh` is not the route-privacy switch in the current app; it only matters when `auth.refresh_session()` is called
|
|
128
|
-
- protect customized `src/lib/auth/auth_config.py` by adding `./src/lib/auth/auth_config.py` to `excludeFiles` in `caspian.config.json`
|
|
129
|
-
- prefer logout via `pp.rpc("signout")` plus `@rpc(require_auth=True)` from page or component UI; use a dedicated signout route only for form-post or no-JavaScript fallbacks
|
|
130
|
-
- PulsePoint runtime lives in `public/js/pp-reactive-v2.js`
|
|
131
|
-
- `pp-component` is injected by the Python render pipeline, and `main.py` rewrites authored body scripts to `type="text/pp"`; authored route, layout, and component templates should not add those attributes manually
|
|
132
|
-
- route, layout, and component templates must keep a single top-level lowercase HTML root for `pp-component` injection, with any owned plain `<script>` kept inside that same root
|
|
133
|
-
- dynamic route params are passed to `page()` as a single positional `dict`
|
|
134
|
-
- `layout()` is sync-only in the installed runtime
|
|
135
|
-
- `StateManager` persistence depends on `request.state.session`, which is not bridged from `request.session` in the current `main.py`
|
|
136
|
-
- Keep `index.md` and cross-links aligned when adding or changing pages.
|
|
113
|
+
- Do not encode the current project's feature flags, file inventory, script list, or temporary status inside the packaged docs. Keep those facts in `.github/copilot-instructions.md`, `AGENTS.md`, or the project code.
|
|
114
|
+
- When an optional feature doc is edited, phrase it as feature guidance, for example `when caspian.config.json has mcp: true`, instead of as a project snapshot such as `this workspace has mcp: false`.
|
|
115
|
+
- Keep `index.md` discoverable as the manifest, keep cross-links aligned, and make each feature page explicit about when it applies and what file AI should inspect next.
|
package/dist/AGENTS.md
CHANGED
|
@@ -2,37 +2,40 @@
|
|
|
2
2
|
|
|
3
3
|
## Purpose
|
|
4
4
|
|
|
5
|
-
This workspace is a Caspian application plus a
|
|
5
|
+
This workspace is a Caspian application plus a packaged copy of the Caspian docs.
|
|
6
6
|
|
|
7
|
-
When you work here, use the code that actually runs as the source of truth
|
|
7
|
+
When you work here, use `caspian.config.json` and the code that actually runs as the source of truth for this project. Use the packaged markdown docs under `node_modules/caspian-utils/dist/docs/` as the AI-facing Caspian feature and task-reference layer.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Do not treat the existence of a packaged doc as proof that the feature is enabled in this project.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
## Decision Order
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Use this order depending on the question being answered:
|
|
14
|
+
|
|
15
|
+
1. Optional feature enablement and generated surface area
|
|
16
|
+
- `caspian.config.json`
|
|
17
|
+
2. App runtime and app-owned code for current project behavior
|
|
14
18
|
- `main.py`
|
|
15
19
|
- `src/app/**`
|
|
16
20
|
- `src/lib/**`
|
|
17
21
|
- `public/js/**`
|
|
18
22
|
- `prisma/**`
|
|
19
|
-
|
|
20
|
-
2. Installed Caspian framework runtime
|
|
23
|
+
3. Installed Caspian framework runtime
|
|
21
24
|
- `.venv/Lib/site-packages/casp/**`
|
|
22
|
-
|
|
25
|
+
4. Packaged Caspian docs for feature discovery, file-placement guidance, and task routing
|
|
23
26
|
- `node_modules/caspian-utils/dist/docs/**`
|
|
24
27
|
|
|
25
28
|
If the task is about current repo behavior, prefer the app runtime.
|
|
26
29
|
|
|
27
30
|
If the task is about framework internals, prefer the installed `casp` package.
|
|
28
31
|
|
|
29
|
-
If docs differ from
|
|
32
|
+
If packaged docs differ from the project or installed runtime, the project and runtime win. Keep the packaged docs reusable across Caspian projects and move project-specific clarifications into this file or `.github/copilot-instructions.md`.
|
|
30
33
|
|
|
31
34
|
Before making feature, tooling, or scaffolding decisions, read `caspian.config.json` almost immediately. Treat it as the workspace feature gate for flags such as `backendOnly`, `tailwindcss`, `mcp`, `prisma`, `typescript`, and `componentScanDirs`.
|
|
32
35
|
|
|
33
36
|
Treat `caspian.config.json` as the single source of truth for whether an optional Caspian feature is enabled in the current workspace. 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 Caspian update workflow to refresh framework-managed files.
|
|
34
37
|
|
|
35
|
-
##
|
|
38
|
+
## Workspace Rules
|
|
36
39
|
|
|
37
40
|
- Local Caspian docs live under `node_modules/caspian-utils/dist/docs/`.
|
|
38
41
|
- `main.py` is the application entry point and owns auth bootstrap, FastAPI setup, static asset routes, route registration, error handlers, cache defaults, and middleware wiring.
|
|
@@ -47,13 +50,13 @@ Treat `caspian.config.json` as the single source of truth for whether an optiona
|
|
|
47
50
|
- Prefer logout via auth-protected RPC from page-level or component-level UI: `pp.rpc("signout")` backed by `@rpc(require_auth=True)`. Use a dedicated signout route only for plain form POST or no-JavaScript edge cases.
|
|
48
51
|
- Protect customized `src/lib/auth/auth_config.py` from framework updates by adding `./src/lib/auth/auth_config.py` to `excludeFiles` in `caspian.config.json`.
|
|
49
52
|
- This workspace already has an app-owned Python database layer in `src/lib/prisma/`.
|
|
50
|
-
-
|
|
51
|
-
- `package.json`
|
|
53
|
+
- Do not assume `src/lib/mcp/**`, `settings/restart-mcp.ts`, or MCP-related scripts exist unless `caspian.config.json` confirms MCP is enabled and the update workflow has run.
|
|
54
|
+
- Treat `package.json` scripts as opt-in operational commands, not default validation steps for ordinary source edits.
|
|
52
55
|
- Reuse `src/lib/prisma/prisma`, `PrismaClient`, generated models, and helper types instead of creating a second Python database abstraction.
|
|
53
56
|
- Prisma schema source of truth is `prisma/schema.prisma`.
|
|
54
|
-
- The schema-change workflow
|
|
57
|
+
- The schema-change workflow is: `npx prisma migrate dev`; if seed flow or `prisma/seed.ts` is involved, run `npx prisma generate` and then `npx prisma db seed`; then run `npx ppy generate`.
|
|
55
58
|
- `npx ppy generate` owns `src/lib/prisma/__init__.py`, `src/lib/prisma/db.py`, `src/lib/prisma/models.py`, and `settings/prisma-schema.json`; do not hand-edit those generated files.
|
|
56
|
-
- `caspian.config.json` is the first config file to check for enabled workspace features.
|
|
59
|
+
- `caspian.config.json` is the first config file to check for enabled workspace features. Read the actual values instead of inferring them from the docs.
|
|
57
60
|
- As the app grows, prefer `src/components/` for reusable rendered UI and `src/lib/` for reusable non-UI support code.
|
|
58
61
|
- PulsePoint runtime code is shipped in `public/js/pp-reactive-v2.js` and loaded from `public/js/main.js`.
|
|
59
62
|
- `pp-component` is injected by the Python render pipeline onto page, layout, and component roots; authored route and component templates should not add it manually.
|
|
@@ -123,18 +126,15 @@ Use this map before making changes.
|
|
|
123
126
|
- When a runtime change affects documentation, update the matching page in `node_modules/caspian-utils/dist/docs/`.
|
|
124
127
|
- When a repo-level rule changes, update this file too.
|
|
125
128
|
|
|
126
|
-
## Docs
|
|
127
|
-
|
|
128
|
-
The packaged docs in this workspace are already mostly aligned with the installed runtime, but keep these repo-specific clarifications in mind:
|
|
129
|
+
## Docs Maintenance Rules
|
|
129
130
|
|
|
130
|
-
- `
|
|
131
|
-
-
|
|
132
|
-
-
|
|
133
|
-
-
|
|
134
|
-
-
|
|
135
|
-
- `
|
|
136
|
-
- `
|
|
137
|
-
- `routing.md`, `components.md`, `auth.md`, `fetch-data.md`, `cache.md`, `pulsepoint.md`, and `validation.md` should continue to be validated against the installed `casp` package before any behavior claims are changed.
|
|
131
|
+
- Treat `node_modules/caspian-utils/dist/docs/**` as packaged Caspian feature docs and AI routing docs, not as a snapshot of the current project.
|
|
132
|
+
- Do not record this project's current feature flags, script inventory, or temporary file tree status inside the packaged docs.
|
|
133
|
+
- Gate optional docs with `caspian.config.json`. Use phrasing such as `when caspian.config.json enables MCP` instead of `this workspace has mcp: false`.
|
|
134
|
+
- Use the packaged docs to make AI aware of what Caspian can do, when a doc applies, and which project files should be inspected next.
|
|
135
|
+
- Keep repo-specific clarifications in this file or `.github/copilot-instructions.md` rather than embedding them in the packaged docs unless the behavior is truly framework-wide.
|
|
136
|
+
- Keep `index.md` and cross-links aligned so AI can discover the right task doc quickly.
|
|
137
|
+
- Continue validating `routing.md`, `components.md`, `auth.md`, `fetch-data.md`, `cache.md`, `pulsepoint.md`, `validation.md`, `database.md`, and `mcp.md` against the installed `casp` runtime before changing behavior claims.
|
|
138
138
|
|
|
139
139
|
## Maintenance Checklist
|
|
140
140
|
|
|
@@ -142,4 +142,4 @@ Before merging doc or runtime changes:
|
|
|
142
142
|
|
|
143
143
|
1. Compare the claim or behavior against `main.py`, `src/lib/**`, and `.venv/Lib/site-packages/casp/**`.
|
|
144
144
|
2. Update the matching packaged doc in `node_modules/caspian-utils/dist/docs/` if the running behavior changed.
|
|
145
|
-
3. Update this file if the repo-level
|
|
145
|
+
3. Update this file if the repo-level decision rules, workspace rules, or packaged-doc maintenance rules changed.
|