Add minimal stock listing app: actions, Postgres schema, stocks page, Claude Agent SDK harness

- Add stocks table (server/db) with list/get/add/update/delete actions, scoped
  per user, backing both the chat agent and the /stocks UI via
  useActionQuery/useActionMutation
- Add mobile-first /stocks page (shadcn table/cards, watchlist, search) and
  wire it into the sidebar, navigation state, and view-screen context
- Install the platform's Claude Agent SDK harness (server/plugins,
  server/routes/api/claude-agent) so the app agent runs on the platform's own
  Claude subscription instead of the Builder.io gateway; fix the vendored
  turn.post.ts route to resolve the session and wrap it in
  runWithRequestContext, since custom /api/ routes aren't auto-wrapped in
  request context the way /_agent-native/actions/* are
- Add shadcn table/badge/dialog/select components (Tabler icons, not lucide)
This commit is contained in:
exe.dev user
2026-07-29 12:18:14 +00:00
parent 138d195e4c
commit e859245867
25 changed files with 14804 additions and 10 deletions
+28 -1
View File
@@ -43,10 +43,37 @@ workflow needs durable UI around the conversation.
- For new features, update UI, actions, skills/instructions, and application
state when applicable.
## What This App Does
A minimal stock listing app. Each user keeps a personal list of stock tickers
(symbol, company name, exchange, sector, price, change percent, market cap,
watchlisted) at the `/stocks` page. Chat remains the primary surface for
asking the agent to add, look up, or edit listings; `/stocks` is the durable
UI for browsing, searching, and managing the list at a glance.
## Actions
| Action | Method | Description |
| -------------- | ------ | ------------------------------------------------------------------------ |
| `list-stocks` | GET | List the current user's stock listings. Supports `search`, `exchange`, `watchlistedOnly`. |
| `get-stock` | GET | Get one listing by `id` or `symbol`. |
| `add-stock` | POST | Add a new listing (`symbol`, `companyName` required; fails if symbol already listed). |
| `update-stock` | PUT | Patch a listing by `id` — price, change percent, sector, `watchlisted` ("true"/"false"), etc. |
| `delete-stock` | DELETE | Delete a listing by `id`. |
| `hello` | GET | Starter example action. |
| `navigate` | agent-only | Navigate the UI to a view/path (adds `view: "stocks"` for `/stocks`).|
| `view-screen` | agent-only | Read current navigation state; when the user is on `/stocks`, also returns the full stock listing snapshot. |
Stocks are scoped per `ownerEmail` (the authenticated user). Data lives in
the `stocks` table in Postgres (`DATABASE_URL`) in this deployment, or SQLite
at `data/app.db` for local dev without a `DATABASE_URL` — see
`server/db/schema.ts` and `server/plugins/db.ts`.
## Application State
- `navigation` should describe the current view and selected entity ids. The
default chat view is `chat` at `/`.
default chat view is `chat` at `/`; the stock listing view is `stocks` at
`/stocks`.
- `navigate` may be used to move the UI when the app supports it.
- `view-screen` is the first tool to call when the user's visible context
matters.