Extend network stack: session/auth, WebSocket, cookie/multipart primitives

Add the network-extension wave to lib/net and the web ABI plugin:
- lib/net cookie_parse / multipart_parse host primitives (EN/ZH)
- plugins/web session store + /admin login gate + WebSocket client/server
- ext/web author surface (EN/ZH) for session, auth, ws
- form update flow and page-level validation echo tests
- fix string escapes: \xHH, \u{...}, unknown escapes kept verbatim
- map Chinese component slots (导航/侧栏/页脚) so sidebar renders
- resolve relative static/db paths against the entry script dir (entry_dir)
- new tutorial chapter 14, EN/ZH example sites, and gold tests

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cflmyandCursor committed 2026-08-25 14:58:46 +08:00
1 parent 7dfa161422
commit 7645dd4c1f
47 files changed
+3380 -75

No files matched your search

+16
View File
@@ -55,3 +55,19 @@ Optional `body=` / `content_type=` / `headers=`.
+ `text`
**> host_url_encode text=`text`**
## cookie_parse
+ `text`
+ `is_response`=False
Parse a `Cookie` request header (default) or one or more `Set-Cookie` response headers (`is_response=True`) into a list of `{name, value, path, domain, expires, max_age, secure, http_only, same_site}`.
**> host_cookie_parse text=`text` is_response=`is_response`**
## multipart_parse
+ `body`
+ `boundary`
Parse a `multipart/form-data` request body (given its `boundary`) into a list of `{name, filename?, content_type?, value}` parts.
**> host_multipart_parse body=`body` boundary=`boundary`**
+16
View File
@@ -55,3 +55,19 @@ POST 并消费 OpenAI 兼容 SSE。返回 `{status, events}`(`delta` / `done`
+ `内容`
**> host_url_encode text=`内容`**
## 解析Cookie
+ `内容`
+ `是响应头`=False
解析 `Cookie` 请求头(默认)或一个/多个 `Set-Cookie` 响应头(`是响应头=真`)为 `{name, value, path, domain, expires, max_age, secure, http_only, same_site}` 列表。
**> host_cookie_parse text=`内容` is_response=`是响应头`**
## 解析多部分
+ `正文`
+ `边界`
解析 `multipart/form-data` 请求体(给定 `boundary`)为 `{name, filename?, content_type?, value}` 部件列表。
**> host_multipart_parse body=`正文` boundary=`边界`**