@yottagraph-app/aether-instructions 1.1.40 → 1.1.41

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/AGENTS.md ADDED
@@ -0,0 +1,240 @@
1
+ # AGENTS.md
2
+
3
+ Broadchurch tenant application built on Aether (Nuxt 3 + Vuetify).
4
+
5
+ ## Cursor Cloud specific instructions
6
+
7
+ If you are in Cursor Cloud, the `environment.json` install step runs
8
+ `init-project.js` and `npm install` automatically, and starts a dev server
9
+ on port 3000.
10
+
11
+ **Verify before starting:** check that `.env` exists and `node_modules/` is
12
+ present. If either is missing, run: `node init-project.js && npm install`
13
+
14
+ **Do NOT** manually run `nvm install` or `nvm use` — Node version is managed
15
+ by the environment.
16
+
17
+ ### Initial environment setup only
18
+
19
+ This subsection applies ONLY when first asked to "set up the development
20
+ environment" or "demonstrate that the environment is working." It does
21
+ **NOT** apply to ongoing development — once the app is built, use the
22
+ browser normally to test and verify UI changes.
23
+
24
+ **During initial setup**, skip browser/UI testing. The starter UI is a
25
+ placeholder template that will be replaced by `/build_my_app`. Do not
26
+ launch a browser, record videos, or take screenshots at this stage.
27
+ Verifying `npm run build` passes is sufficient.
28
+
29
+ 1. Check the "Dev Server" terminal output for a line containing
30
+ `Listening on` or `Local: http://localhost:3000`. If present, the
31
+ environment is working.
32
+ 2. If the dev server is NOT running, start it with `npm run dev` and wait
33
+ for the "Listening on" line.
34
+ 3. Run `npm run build` to verify the project compiles.
35
+ 4. Once confirmed, tell the user the environment is ready, then
36
+ immediately run the `/build_my_app` command.
37
+
38
+ ### MCP tools
39
+
40
+ Lovelace MCP servers (`lovelace-elemental`, `lovelace-stocks`, etc.)
41
+ should be available if configured at the org level. Check your tool list
42
+ for `elemental_*` tools. If they're not available, use the Elemental API
43
+ client (`useElementalClient()`) and the skill docs in
44
+ `.cursor/skills/elemental-api/` and `.cursor/skills/data-model/` for platform data access instead.
45
+
46
+ ### Technical details
47
+
48
+ Node 20 is the baseline (`.nvmrc`). The `environment.json` install step
49
+ handles this via `nvm install 20 && nvm alias default 20`. Newer Node
50
+ versions (22, 25) generally work but may produce `EBADENGINE` warnings
51
+ during install — safe to ignore.
52
+
53
+ The install step runs `node init-project.js --local` (creates `.env` if
54
+ absent) then `npm install` (triggers `postinstall` → `nuxt prepare`).
55
+ Auth0 is bypassed via `NUXT_PUBLIC_USER_NAME=dev-user`
56
+ in the generated `.env`.
57
+
58
+ **No automated test suite.** Verification is `npm run build` (compile
59
+ check) and `npm run format:check` (Prettier). See Verification Commands.
60
+
61
+ **Before committing:** always run `npm run format` — the husky pre-commit
62
+ hook runs `lint-staged` with `prettier --check` and will reject
63
+ unformatted files.
64
+
65
+ ## Manual / Local Setup
66
+
67
+ Node 20 is the baseline (pinned in `.nvmrc`). Newer versions generally work.
68
+
69
+ ```bash
70
+ npm run init -- --local # creates .env with dev defaults (no Auth0)
71
+ npm install # all deps are public on npmjs.com -- no tokens needed
72
+ npm run dev # dev server on port 3000
73
+ ```
74
+
75
+ For the full interactive wizard (project name, Auth0, query server, etc.):
76
+
77
+ ```bash
78
+ npm run init # interactive, or --non-interactive for CI (see --help)
79
+ ```
80
+
81
+ ## .env Essentials
82
+
83
+ | Variable | Purpose | Default |
84
+ | ---------------------------------- | -------------------------------- | --------------------------------------- |
85
+ | `NUXT_PUBLIC_APP_ID` | Unique app identifier | derived from directory name |
86
+ | `NUXT_PUBLIC_APP_NAME` | Display name | derived from directory name |
87
+ | `NUXT_PUBLIC_USER_NAME` | Set to any value to bypass Auth0 | `dev-user` in local mode |
88
+ | `NUXT_PUBLIC_QUERY_SERVER_ADDRESS` | Query Server URL | read from `broadchurch.yaml` if present |
89
+ | `NUXT_PUBLIC_GATEWAY_URL` | Portal Gateway for agent chat | read from `broadchurch.yaml` if present |
90
+ | `NUXT_PUBLIC_TENANT_ORG_ID` | Auth0 org ID for this tenant | read from `broadchurch.yaml` if present |
91
+
92
+ See `.env.example` for the full list.
93
+
94
+ ## Project Structure
95
+
96
+ | Directory | Contents | Deployed to |
97
+ | -------------- | ---------------------------------------------------- | ---------------------- |
98
+ | `pages/` | Nuxt pages (file-based routing) | Vercel (with app) |
99
+ | `components/` | Vue components | Vercel (with app) |
100
+ | `composables/` | Vue composables (auto-imported by Nuxt) | Vercel (with app) |
101
+ | `utils/` | Utility functions (NOT auto-imported) | Vercel (with app) |
102
+ | `server/` | Nitro API routes (KV storage, avatar proxy) | Vercel (with app) |
103
+ | `agents/` | Python ADK agents (each subdirectory is deployable) | Vertex AI Agent Engine |
104
+ | `mcp-servers/` | Python MCP servers (each subdirectory is deployable) | Cloud Run |
105
+
106
+ ### Cursor instructions (`.cursor/`)
107
+
108
+ Cursor rules, commands, and skills are installed from the
109
+ `@yottagraph-app/aether-instructions` npm package during project init.
110
+ `.cursor/skills/elemental-api/` contains API skill documentation (endpoint
111
+ reference, types, usage patterns). `.cursor/skills/data-model/` contains
112
+ Lovelace data model documentation (entity types, schemas per fetch source).
113
+ If these directories are missing, run `/update_instructions` to reinstall.
114
+
115
+ ### Agents
116
+
117
+ `agents/example_agent/` is a working starter agent that queries the Elemental
118
+ Knowledge Graph. It includes schema discovery, entity search, property lookup,
119
+ and optional MCP server integration. Use it as a starting point — customize the
120
+ instruction, add tools, and see the `agents` cursor rule for the full guide.
121
+
122
+ ## Configuration
123
+
124
+ `broadchurch.yaml` contains tenant-specific settings (GCP project, org ID,
125
+ service account, gateway URL, query server URL). It's generated during
126
+ provisioning and committed by the `tenant-init` workflow. Don't edit manually
127
+ unless you know what you're doing.
128
+
129
+ ## Storage
130
+
131
+ Two storage services are available. Check `.env` to see which are connected:
132
+
133
+ | Store | How to check | Env var | Utility file | Always available? |
134
+ | ---------------------- | --------------------------------------------------------------------------------- | --------------------------------------- | --------------------------------------------------------- | ----------------------------------- |
135
+ | **KV** (Upstash Redis) | `KV_REST_API_URL` in `.env` | `KV_REST_API_URL`, `KV_REST_API_TOKEN` | `server/utils/redis.ts` (pre-scaffolded) | Yes |
136
+ | **Neon Postgres** | `curl <gateway.url>/api/tenants/<tenant.org_id>` → `vercel.postgres_store_id` set | `DATABASE_URL`, `DATABASE_URL_UNPOOLED` | `server/utils/neon.ts` (create it if missing — see below) | Only if enabled at project creation |
137
+
138
+ ### Quick start
139
+
140
+ **KV** is ready to use out of the box. Use `getRedis()` from
141
+ `server/utils/redis.ts` in server routes, or `usePrefsStore()` on the client
142
+ (see `pref` rule for the `Pref<T>` pattern).
143
+
144
+ **Neon Postgres** — provisioning is determined by the portal, not by `.env`.
145
+ To check whether Neon is enabled for this tenant, pull `gateway.url` and
146
+ `tenant.org_id` out of `broadchurch.yaml` and query the portal:
147
+
148
+ ```bash
149
+ curl <gateway.url>/api/tenants/<tenant.org_id>
150
+ ```
151
+
152
+ If the response has `vercel.postgres_store_id` set, Neon is provisioned. The
153
+ `DATABASE_URL` is also present under `agent_secrets` in that response, but
154
+ you usually do not need to read it directly.
155
+
156
+ `DATABASE_URL` and `DATABASE_URL_UNPOOLED` are intentionally left commented
157
+ out in local `.env` — Neon does not work locally. On deploy, Vercel
158
+ auto-injects `DATABASE_URL` at runtime, so pushed builds connect
159
+ transparently.
160
+
161
+ Before writing Postgres code, bootstrap the two things the project does NOT
162
+ scaffold automatically:
163
+
164
+ - If `server/utils/neon.ts` is not present, create it (same `getDb()`
165
+ lazy-init pattern as `server/utils/redis.ts`).
166
+ - If `@neondatabase/serverless` is not in `package.json`, install it with
167
+ `npm install @neondatabase/serverless`.
168
+
169
+ Then use `getDb()` in server routes:
170
+
171
+ ```typescript
172
+ import { getDb } from '~/server/utils/neon';
173
+
174
+ export default defineEventHandler(async () => {
175
+ const sql = getDb();
176
+ if (!sql) throw createError({ statusCode: 503, statusMessage: 'Database not configured' });
177
+ return await sql`SELECT * FROM my_table`;
178
+ });
179
+ ```
180
+
181
+ ### Where credentials come from
182
+
183
+ **Deployed builds** (push to `main` → Vercel): storage env vars are
184
+ auto-injected and decrypted at runtime. Storage works with zero
185
+ configuration. **This is the primary development path** — push your code
186
+ and test on the deployed preview/production URL.
187
+
188
+ **Local dev / Cursor Cloud:** storage credentials are not yet available for
189
+ local use. `getRedis()` and `getDb()` will return `null`, and the app should
190
+ handle this gracefully (show a "not configured" state, use defaults, etc.).
191
+ KV preferences fall back to their default values. Postgres features should
192
+ check `getDb()` and show appropriate UI when it returns `null`.
193
+
194
+ This is a known platform limitation — the Broadchurch team is working on
195
+ making storage credentials available for local development.
196
+
197
+ See the `server` rule for detailed usage patterns for both KV and Postgres.
198
+
199
+ ## How Deployment Works
200
+
201
+ ### App (Nuxt UI + server routes)
202
+
203
+ Vercel auto-deploys on every push to `main`. Preview deployments are created for
204
+ other branches. The app is available at `{slug}.yottagraph.app`.
205
+
206
+ ### Agents (`agents/`)
207
+
208
+ Each subdirectory in `agents/` is a self-contained Python ADK agent. Deploy via
209
+ the Portal UI or `/deploy_agent` in Cursor.
210
+
211
+ ### MCP Servers (`mcp-servers/`)
212
+
213
+ Each subdirectory in `mcp-servers/` is a Python FastMCP server. Deploy via
214
+ the Portal UI or `/deploy_mcp` in Cursor.
215
+
216
+ ## Verification Commands
217
+
218
+ ```bash
219
+ npm run dev # dev server -- check browser at localhost:3000
220
+ npm run build # production build -- catches compile errors
221
+ npm run format # Prettier formatting (run before committing)
222
+ ```
223
+
224
+ ## Known Issues
225
+
226
+ ### Blank white page after `npm run dev`
227
+
228
+ If the server returns HTTP 200 but the page is blank, check the browser console
229
+ for `SyntaxError` about missing exports. This is caused by Nuxt's auto-import
230
+ scanner. **Fix:** verify the `imports:dirs` hook in `nuxt.config.ts` is present.
231
+
232
+ ### Port 3000 conflict
233
+
234
+ The dev server binds to port 3000 by default. If another service is already
235
+ using that port, start with `PORT=3001 npm run dev`.
236
+
237
+ ### Formatting
238
+
239
+ Pre-commit hook runs `lint-staged` with Prettier. Run `npm run format` before
240
+ committing to avoid failures.
@@ -71,13 +71,22 @@ The extracted content is in `$TEMP_DIR/package/`.
71
71
 
72
72
  ## Step 4: Delete Previously Installed Files
73
73
 
74
- Read the manifest and delete listed paths. **Skip blank lines** — an empty `rel` would run `rm -rf ".cursor/"` and wipe the whole directory.
74
+ Read the manifest and delete listed paths. **Skip blank lines** — an empty `rel` would run `rm -rf ".cursor/"` and wipe the whole directory. Entries prefixed with `root/` point at files at the repo root (currently just `AGENTS.md`); only remove **regular files** there, never directories.
75
75
 
76
76
  ```bash
77
77
  if [ -f .cursor/.aether-instructions-manifest ]; then
78
78
  while IFS= read -r rel || [ -n "$rel" ]; do
79
79
  [ -z "$rel" ] && continue
80
- rm -rf ".cursor/$rel"
80
+ case "$rel" in
81
+ root/*)
82
+ target="${rel#root/}"
83
+ case "$target" in ""|*..*) continue ;; esac
84
+ [ -f "$target" ] && rm -f "$target"
85
+ ;;
86
+ *)
87
+ rm -rf ".cursor/$rel"
88
+ ;;
89
+ esac
81
90
  done < .cursor/.aether-instructions-manifest
82
91
  fi
83
92
  ```
@@ -100,6 +109,12 @@ cp "$TEMP_DIR/package/commands/"* .cursor/commands/ 2>/dev/null || true
100
109
  cp -r "$TEMP_DIR/package/skills/"* .cursor/skills/ 2>/dev/null || true
101
110
  ```
102
111
 
112
+ Copy the root-level AGENTS.md from the package to the tenant repo root, if the package ships one:
113
+
114
+ ```bash
115
+ [ -f "$TEMP_DIR/package/AGENTS.md" ] && cp "$TEMP_DIR/package/AGENTS.md" ./AGENTS.md
116
+ ```
117
+
103
118
  ### Data-mode variant overlay
104
119
 
105
120
  If this project uses **mcp-only** (or another non-default mode), re-apply the same overlay `init-project.js` uses. Read the saved mode:
@@ -134,6 +149,7 @@ Build a manifest of all installed files (one relative path per line). **Do not**
134
149
  for f in .cursor/rules/*.mdc; do [ -f "$f" ] && echo "rules/$(basename "$f")"; done
135
150
  for f in .cursor/commands/*.md; do [ -f "$f" ] && echo "commands/$(basename "$f")"; done
136
151
  for d in .cursor/skills/*/; do [ -d "$d" ] && echo "skills/$(basename "$d")"; done
152
+ [ -f "$TEMP_DIR/package/AGENTS.md" ] && [ -f ./AGENTS.md ] && echo "root/AGENTS.md"
137
153
  } > .cursor/.aether-instructions-manifest
138
154
  ```
139
155
 
@@ -185,6 +201,7 @@ Commit the updated instruction files. A root `.gitignore` rule like `skills/` ca
185
201
  ```bash
186
202
  git add .cursor/rules/ .cursor/commands/ .cursor/.aether-instructions-version .cursor/.aether-instructions-manifest
187
203
  git add -f .cursor/skills/
204
+ [ -f AGENTS.md ] && git add AGENTS.md
188
205
  git commit -m "Update instructions to vX.Y.Z"
189
206
  ```
190
207
 
@@ -208,13 +225,13 @@ If you get permission errors:
208
225
 
209
226
  > Try running with appropriate permissions, or check that `.cursor/` is writable.
210
227
 
211
- ### Want to customize a rule or command?
228
+ ### Want to customize a rule, command, or AGENTS.md?
212
229
 
213
- If you need to modify a package-provided file:
230
+ If you need to modify a package-provided file (including the root `AGENTS.md`):
214
231
 
215
232
  1. Edit it directly — your changes will persist until the next update
216
- 2. To preserve changes across updates, copy it to a new name first
217
- 3. Remove the original's entry from `.cursor/.aether-instructions-manifest` so it won't be deleted on update
233
+ 2. To preserve changes across updates, copy it to a new name first (e.g. `cp AGENTS.md AGENTS.local.md`)
234
+ 3. Remove the original's entry from `.cursor/.aether-instructions-manifest` so it won't be deleted on update (for `AGENTS.md`, remove the `root/AGENTS.md` line)
218
235
 
219
236
  ### Blank line in manifest deleted `.cursor/`
220
237
 
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@yottagraph-app/aether-instructions",
3
- "version": "1.1.40",
3
+ "version": "1.1.41",
4
4
  "description": "Cursor rules, commands, and skills for Aether development",
5
5
  "files": [
6
6
  "rules",
7
7
  "commands",
8
8
  "skills",
9
- "variants"
9
+ "variants",
10
+ "AGENTS.md"
10
11
  ],
11
12
  "repository": {
12
13
  "type": "git",
@@ -10,32 +10,43 @@ alwaysApply: false
10
10
  Package-managed files are tracked by `.cursor/.aether-instructions-manifest`.
11
11
  They will be **overwritten** when you run `/update_instructions`.
12
12
 
13
+ This includes files under `.cursor/rules/`, `.cursor/commands/`,
14
+ `.cursor/skills/`, **and the root `AGENTS.md`** (tracked as `root/AGENTS.md`
15
+ in the manifest).
16
+
13
17
  ## Do Not
14
18
 
15
19
  - Modify files listed in the manifest directly (changes will be lost on update)
16
20
 
17
21
  ## To Customize
18
22
 
19
- If you need to modify a package-provided rule or command:
23
+ If you need to modify a package-provided rule, command, or the root `AGENTS.md`:
20
24
 
21
25
  1. **Copy** the file to a new name
22
26
  2. Make your changes to the copy
23
27
  3. Remove the original's entry from `.cursor/.aether-instructions-manifest`
24
28
  so it won't be replaced on update
25
29
 
26
- Example:
30
+ Examples:
27
31
 
28
32
  ```bash
29
- # Copy the rule you want to customize
33
+ # Customize a rule
30
34
  cp .cursor/rules/data.mdc .cursor/rules/data_custom.mdc
31
35
 
36
+ # Customize AGENTS.md
37
+ cp AGENTS.md AGENTS.local.md
38
+ # then remove the `root/AGENTS.md` line from
39
+ # .cursor/.aether-instructions-manifest
40
+
32
41
  # Edit your copy — it won't be affected by instruction updates
33
42
  ```
34
43
 
35
44
  ## How It Works
36
45
 
37
46
  - `.cursor/.aether-instructions-manifest` lists every file installed by the
38
- package (one relative path per line, e.g. `rules/data.mdc`)
47
+ package (one relative path per line, e.g. `rules/data.mdc`). Entries
48
+ prefixed with `root/` refer to files at the tenant repo root
49
+ (currently only `root/AGENTS.md`).
39
50
  - `/update_instructions` deletes manifest entries, extracts fresh files from
40
51
  the latest package, and writes a new manifest
41
52
  - Files not in the manifest are never touched