You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: Work on the A2API monorepo (protocol, runtime, chat-demo UI/APIJSON). Use when changing envelopes, BoundExecutor, chat-demo charts/tables/detail, account AI settings, or APIJSON Demo integration.
-`apps/chat-demo` — Hono API + Vite client (Bootstrap chat + steady-state UI)
13
+
-`conversations/` — git-managed chat examples
14
+
-`.cursor/skills/` — project skills (this file)
15
+
16
+
## Local run
17
+
18
+
```bash
19
+
cp .env.example .env
20
+
npm install && npm run dev
21
+
```
22
+
23
+
- Client http://localhost:5173 · API http://localhost:3000 · APIJSON Demo http://localhost:8080
24
+
25
+
## Product rules (locked)
26
+
27
+
- Steady-state filter/sort/page must not call the LLM (`usedLlm: false`).
28
+
- Sensitive writes (default `delete`) go to Admin approval; other writes auto-execute and store `auto_approved` audit rows (`apps/chat-demo/data/approvals.jsonl`).
29
+
- Chart field pool = all query tables × fields (not table visible-column config).
30
+
- UI copy is English; Chinese NLP matching may remain for intent only.
31
+
- Account menu (top-right) holds AI Model / Base URL / API Key; pass as `llm` on `/api/chat` and `/api/analyze`.
Copy file name to clipboardExpand all lines: README.md
+15-11Lines changed: 15 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,10 @@
1
1
# A2API
2
2
3
-
Agent-to-API protocol and MVP demo: generate a simple task UI, **tune an APIJSON request until it works**, then let users change filters/sort/paging by operating the UI — which calls APIJSON over HTTP **without going through the LLM again**.
3
+
Agent-to-API protocol and MVP demo: generate a simple task UI, **tune an APIJSON request until it works**, then let users change filters, sort, and paging from the UI — which calls APIJSON over HTTP **without going through the LLM again**.
4
4
5
-
No SQL execution path. Writes go through human approval (HITL).
5
+
No SQL execution path. **Sensitive writes** (default: `delete`) wait in the Admin approval queue; **other writes** auto-execute and leave an `auto_approved` audit record on the server.
6
+
7
+
Chinese documentation: [README-Chinese.md](./README-Chinese.md)
6
8
7
9
## Requirements
8
10
@@ -23,9 +25,11 @@ npm run dev
23
25
- Client (Vite): http://localhost:5173
24
26
- API (Hono): http://localhost:3000
25
27
26
-
Open the client URL. Try chips such as「查最近 3 条动态及作者」, then change sort/page and click **查询 / 刷新** — the right panel shows `usedLlm: false` and the exact APIJSON body.
28
+
Open the client URL. Use **Login** (top-right) to open the account menu and set **AI Model / Base URL / API Key** (APIAuto-style). Try chips such as **List the latest 3 moments with authors**, then change sort/page and click **Query / Refresh** — the right panel shows `usedLlm: false` and the exact APIJSON body.
29
+
30
+
Curated chat examples live in [`conversations/`](./conversations/); project Agent skills in [`.cursor/skills/`](./.cursor/skills/).
27
31
28
-
Optional: set `OPENAI_API_KEY` in `.env` to refine bootstrap with an LLM. Without it, built-in intent rules for User / Moment / Comment still work.
32
+
Optional: set `OPENAI_API_KEY` in `.env` to refine bootstrap with an LLM. Without it, built-in intent rules for User / Moment / Comment still work (English and Chinese phrases).
Ensure the Demo schema (User / Moment / Comment) is available on that server.
87
91
88
-
**Writes (POST/PUT/DELETE):** the Demo often requires a logged-in session (`@role` OWNER/LOGIN). The MVP still generates the request and shows the HITL Approve/Reject UI; if APIJSON returns「未登录」, log in via your Demo/APIAuto session cookies or relax Access for local testing. **Reads** work out of the box against the public Demo data.
92
+
**Writes (POST/PUT/DELETE):** the Demo often requires a logged-in session (`@role` OWNER/LOGIN). The MVP still generates the request and shows the HITL Approve/Reject UI; if APIJSON returns "not logged in", log in via your Demo/APIAuto session cookies or relax Access for local testing. **Reads** work out of the box against the public Demo data.
0 commit comments