From e13468dc4307587b09c0c600702132cded35f2b6 Mon Sep 17 00:00:00 2001 From: cflmy Date: Sun, 13 Sep 2026 15:09:45 +0800 Subject: [PATCH] =?UTF-8?q?release:=20v0.4.0=20=E2=80=94=20Go=20libweb=20d?= =?UTF-8?q?efault=20and=20anlian-mq?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- .github/workflows/release.yml | 8 ++++---- CHANGELOG.md | 26 +++++++++++++++++++++++++- Cargo.toml | 2 +- README.md | 20 +++++++++++--------- crates/marqdo-wasm/Cargo.toml | 2 +- doc/design/ext-web-go-rewrite.md | 4 ++-- public/features/05-extensions.mq.md | 2 +- public/features/05-扩展.mq.md | 2 +- 8 files changed, 46 insertions(+), 20 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 68673b0..b6ae797 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -124,10 +124,10 @@ jobs: ## Marqdo ${{ github.ref_name }} ### 亮点 / Highlights - - **GAP-06–10**:解析恢复 · invoke Null · exec capture · SSE 反缓冲头 - - **GAP-06–10**: parser recovery, invoke Null, exec capture, SSE anti-buffer headers - - **修复**:嵌套插件调用后恢复 `GLOBAL_HOST`(listen/invoke) - - Details: [CHANGELOG](https://github.com/cflmy/marqdo/blob/main/CHANGELOG.md) · [stdlib-mid2.md](https://github.com/cflmy/marqdo/blob/main/doc/roadmap/stdlib-mid2.md) + - **Go libweb 默认(W-G0–W-G14)**:网页原生插件 Go 重写;anlian-mq 验收;Release 含预编译 web.dll/libweb.so + - **Go libweb default (W-G0–W-G14)**: web plugin rewritten in Go; anlian-mq acceptance; prebuilt natives in Release + - **GAP-11/12**:表单插槽 · `MARQDO_EXT` 导入提示 + - Details: [CHANGELOG](https://github.com/cflmy/marqdo/blob/main/CHANGELOG.md) · [ADR 0004](https://github.com/cflmy/marqdo/blob/main/doc/adr/0004-web-plugin-go.md) ### Downloads diff --git a/CHANGELOG.md b/CHANGELOG.md index 696bd77..1e7d654 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,12 +3,36 @@ ## Unreleased ### Added -- **GAP-11**:`compose_form` / `表单装配` 支持 `target` / `表单插槽`(如 `#id`),把表单注入引言 HTML 内的挂载点,而不是始终作为 `.main-intro` 的兄弟节点。 + +### Fixed + +### Changed + +## v0.4.0 — 2026-09-13 + +### Highlights + +**Go `libweb` 默认落地(W-G0–W-G14)**:官方网页原生插件改为 Go C ABI;CLI / gold / Release 走 `scripts/build-web-plugin.sh`;Rust 源码归档。另附 **anlian-mq** 验收站与表单插槽 / `MARQDO_EXT` 提示修复。 + +```bash +git checkout v0.4.0 +# 构建 web 原生插件(需 Go + cgo): +bash ./scripts/build-web-plugin.sh +marqdo ext add web +marqdo run examples/anlian-mq/index.mq.md +``` + +### Added +- **`plugins/web` Go 全量重写(W-G0–W-G13)**:C ABI 对等装配/DB/表单/listen/鉴权/上传/SEO/WS/驱动/proxy·invoke/定制壳;`scripts/build-web-plugin.sh` → `libweb.so` / `web.dll`;ADR [0004](doc/adr/0004-web-plugin-go.md) · 施工 [ext-web-go-rewrite.md](doc/design/ext-web-go-rewrite.md)。 +- **W-G14 验收**:`examples/anlian-mq/`(暗恋见君风格论坛:路由/登录/粉玻璃主题/片段 API;SQLite 本地可跑)。 +- **GAP-11**:`compose_form` / `表单装配` 支持 `target` / `表单插槽`(如 `#id`),把表单注入引言 HTML 内的挂载点。 ### Fixed - **GAP-12**:`ext/…` import 解析失败且未设置 `MARQDO_EXT` 时,错误附带 `hint: set MARQDO_EXT to the directory that contains web/`。 +- **listen 会话 / CSRF**:登录后 `IssueCookie` 不再误设 `Max-Age=0`;页面 ABIs(`query`/`order`/`link_prefix`/`css`/`detail`)与 `web_page_chrome`、`invoke return=html` 对齐 anlian 需求。 ### Changed +- **默认 `libweb` 为 Go**:Release / gold / `ext add web` 不再构建 Rust `marqdo_plugin_web`;旧 Rust 树移至 `plugins/web-rust-archive/`(非 workspace 成员)。作者面 `ext/web` ABI 名保持兼容。 ## v0.3.9 — 2026-09-09 diff --git a/Cargo.toml b/Cargo.toml index 01f2ad9..355892d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "marqdo" -version = "0.3.9" +version = "0.4.0" edition = "2021" license = "Apache-2.0" description = "Marqdo — Markdown markers as an interpreted programming language" diff --git a/README.md b/README.md index 95466f4..6dccc8b 100644 --- a/README.md +++ b/README.md @@ -99,7 +99,7 @@ marqdo catalog public -o .marqdo --- -## 现状(v0.3.9) +## 现状(v0.4.0) - 映射与解释器:Phase I 树遍历 + 字节码后端可用;金样例在 `tests/` - **对象**:`#` = 类型/构造,`##`+ = 函数/方法;见 [objects.md](doc/design/objects.md) @@ -109,24 +109,24 @@ marqdo catalog public -o .marqdo - **`marqdo version --check`**:与 GitHub 最新 release 对比 - 标准库:**内置于二进制**(v0.1.2+);磁盘 `lib/` 或 `MARQDO_LIB` 可覆盖。模块含文本、表、**浏览器效应**、文件、系统、时间、JSON、网络、数学、外联、插件、**自写回**、**子任务**;**中层 Mid M1–M6** + **Mid2 M7–M10**(datetime/url/toml/html/fs++/stats/log.fields 等,见 [stdlib-mid.md](doc/design/stdlib-mid.md) · [stdlib-mid2.md](doc/design/stdlib-mid2.md)) - **官方扩展库 `ext/`**(**非** stdlib,本版收口): - - **`web`**:W0–W7 + P3 + **W8**;**定制 C0–C4**;**宿主 H1–H2**(`proxy`/`invoke`,见 [ext-hosting.md](doc/roadmap/ext-hosting.md));示例 [marqdo-blog](examples/marqdo-blog/);生产路径见 [web-asgi-servers-and-marqdo.md](doc/design/web-asgi-servers-and-marqdo.md) + - **`web`**:W0–W7 + P3 + **W8**;**定制 C0–C4**;**宿主 H1–H2**(`proxy`/`invoke`,见 [ext-hosting.md](doc/roadmap/ext-hosting.md));原生层默认 **Go `libweb`**([ADR 0004](doc/adr/0004-web-plugin-go.md),`scripts/build-web-plugin.sh`);示例 [marqdo-blog](examples/marqdo-blog/) · [anlian-mq](examples/anlian-mq/);生产路径见 [web-asgi-servers-and-marqdo.md](doc/design/web-asgi-servers-and-marqdo.md) - **`quantum`**:Q0–Q7 + Q8a/b 主题 SVG;示例 [quantum-entanglement](examples/quantum-entanglement/) - **`linalg`**:L0–L6 + 公式文档面(中缀 / `declare` / 展示化简);示例 [linalg-transpose](examples/linalg-transpose/) · [linalg-svd](examples/linalg-svd/) · [linalg-least-squares](examples/linalg-least-squares/) - **`agent`**:A1–A4 + **MCP Server stdio**(`mcp_server`);宿主缺口见 [ext-hosting.md](doc/roadmap/ext-hosting.md) · [agent-framework-gaps-after-a4.md](doc/research/agent-framework-gaps-after-a4.md) - **`llm`**:OpenAI 兼容对话 - 安装:`marqdo ext list` / `add …` / `remove`([ext-cli.md](doc/design/ext-cli.md);默认 `~/.marqdo/ext`)。原生插件先 `cargo build -p marqdo_plugin_*` 再 `ext add` -- **原生插件 ABI**:[`include/marqdo_abi.h`](include/marqdo_abi.h) · [ext-abi.md](doc/design/ext-abi.md);`plugins/{demo,agent,web,quantum,linalg}` +- **原生插件 ABI**:[`include/marqdo_abi.h`](include/marqdo_abi.h) · [ext-abi.md](doc/design/ext-abi.md);`plugins/{demo,agent,web,quantum,linalg}`(`web` 为 Go;其余为 Rust) - **用户静态站**:`public/` → `view output` → CI 发布 [gh-pages](https://cflmy.github.io/marqdo/) - **VS Code 扩展**:分支 **`vscode-extension`**(`main` 不跟踪源码;见 [vscode-extension-commit.md](doc/design/vscode-extension-commit.md));Release 附带 `.vsix` - **浏览器 Marqdo(WASM)**:`marqdo wasm build` + 官方 bridge 自启(作者零业务 JS;桥内可含列表/路由/storage/ws/文件/Canvas/音频/Observer/拖放);`lib/browser` + GFM;`web.client_embed`;示例 [browser-hello](examples/browser-hello/) · [browser-app](examples/browser-app/) · [browser-media](examples/browser-media/) · [web-client-site](examples/web-client-site/)([ADR 0002](doc/adr/0002-browser-marqdo-wasm.md) · [D](doc/roadmap/browser-wasm-d.md) · [E](doc/roadmap/browser-wasm-e.md) · [F](doc/roadmap/browser-wasm-f.md)) - 选型:[ADR 0001 — Rust](doc/adr/0001-implementation-language.md) · [ADR 0002 — 浏览器 WASM](doc/adr/0002-browser-marqdo-wasm.md)(C0–C5 完结,见 [roadmap/browser-wasm.md](doc/roadmap/browser-wasm.md))· [ADR 0003 — 异步效应](doc/adr/0003-browser-async-effects.md) -### 如何使用最新 Marqdo(v0.3.9) +### 如何使用最新 Marqdo(v0.4.0) ```bash # 1) 源码安装(跟 tag 或 main) git clone https://github.com/cflmy/marqdo.git && cd marqdo -git checkout v0.3.9 # 或留在 main +git checkout v0.4.0 # 或留在 main cargo build --release export PATH="$PWD/target/release:$PATH" marqdo version @@ -139,17 +139,19 @@ marqdo view public --no-open marqdo debug public --no-open marqdo catalog public -o .marqdo -# 3) 安装官方扩展(Release 用户:无需本机 Rust) -marqdo ext add web # 或:网页 — 自动下载 L1 + 预编译 native +# 3) 安装官方扩展(Release 用户:无需本机 Rust/Go) +marqdo ext add web # 或:网页 — 自动下载 L1 + 预编译 native(Go libweb) marqdo ext add agent # 或:智能体 marqdo ext add quantum # 或:量子 marqdo ext add linalg # 或:线性代数 marqdo ext add llm # 或:大模型(纯 .mq.md) -# 开发者也可:cargo build --release -p marqdo_plugin_* 后在本机 target/ 安装 +# 开发者:cargo build --release -p marqdo_plugin_{agent,quantum,linalg} +# bash ./scripts/build-web-plugin.sh # 需 Go + cgo → libweb # 离线:解压 Windows zip(已含 ext/native)或手动放下 native zip;MARQDO_EXT_NO_DOWNLOAD=1 # 4) 动态站示例(扩展装好后) marqdo run examples/marqdo-blog/index.mq.md +marqdo run examples/anlian-mq/index.mq.md # W-G14 验收站 # 浏览器打开终端打印的 listen 地址;/favicon.ico 与 logo 装配见 W8 # 5) 浏览器 WASM(可选) @@ -157,7 +159,7 @@ marqdo wasm build # → dist/wasm/ … 见 examples/browser-hello/ # 6) Windows:也可从 GitHub Releases 下载 exe / zip / vsix -# https://github.com/cflmy/marqdo/releases/tag/v0.3.9 +# https://github.com/cflmy/marqdo/releases/tag/v0.4.0 ``` 开发期也可用 `cargo run -- …` 代替已安装的 `marqdo`: diff --git a/crates/marqdo-wasm/Cargo.toml b/crates/marqdo-wasm/Cargo.toml index 33b7872..9843eb3 100644 --- a/crates/marqdo-wasm/Cargo.toml +++ b/crates/marqdo-wasm/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "marqdo-wasm" -version = "0.3.9" +version = "0.4.0" edition = "2021" license = "Apache-2.0" description = "Marqdo interpreter as WebAssembly (browser host bridge)" diff --git a/doc/design/ext-web-go-rewrite.md b/doc/design/ext-web-go-rewrite.md index 558ef85..fa9f5fc 100644 --- a/doc/design/ext-web-go-rewrite.md +++ b/doc/design/ext-web-go-rewrite.md @@ -2,7 +2,7 @@ | | | |---|---| -| 状态 | **Accepted · 实现进行中(W-G0…W-G4 ✅)** | +| 状态 | **Completed(W-G0…W-G14 · v0.4.0)** | | 日期 | 2026-09-10 | | 相关 | [ext-web.md](ext-web.md) · [ext-web-net.md](ext-web-net.md) · [web-net-capabilities.md](web-net-capabilities.md) · [ext-web-drivers.md](ext-web-drivers.md) · [web-assets-and-images.md](web-assets-and-images.md) · [ext-hosting-fill.md](ext-hosting-fill.md) · [ext-abi.md](ext-abi.md) · [ext-cli.md](ext-cli.md) · [web-asgi-servers-and-marqdo.md](web-asgi-servers-and-marqdo.md) | | 实现目录 | `plugins/web/`(**Go module**;产物仍为 `libweb.so` / `web.dll` / `libweb.dylib`) | @@ -399,7 +399,7 @@ scripts/build-web-plugin.sh # go build -buildmode=c-shared -o …/libweb.so | **W-G11** | 定制 C2–C4 shell/layout/style/nav | ✅ `web-c2`–`c4` | | **W-G12** | G 增强 WS rooms + Redis session/pubsub + API key 原语 | ✅ 单测 + `web-g12-api-key-smoke` | | **W-G13** | 默认切换 Go `libweb`;归档 Rust;更新发版与 ext CLI | ✅ 离线+live gold(7 个 `*_live`)对 Go 全绿;`ext add`/`gold`/`release` 走 `scripts/build-web-plugin.sh`;Rust 移出 workspace;gold 强制 `MARQDO_WEB_PLUGIN` 避免 `~/.marqdo` 旧 so | -| **W-G14** | anlian Marqdo 重写主路径(可分仓或 `examples/anlian-mq/`) | §8 矩阵主路径可演示 | +| **W-G14** | anlian Marqdo 重写主路径(可分仓或 `examples/anlian-mq/`) | ✅ `examples/anlian-mq/`(本地 SQLite + 粉玻璃主题 + 主路由/登录/片段;外接 PG/Redis 仍为增强路径) | 每波次:**先补 Go 实现 → 跑对应 gold → 再进入下一波**。禁止跨波次留下「注册了但返回 stub 错误」的 ABI(除 W-G0 明确的未实现探测)。 diff --git a/public/features/05-extensions.mq.md b/public/features/05-extensions.mq.md index 4a4c3a7..e7683c8 100644 --- a/public/features/05-extensions.mq.md +++ b/public/features/05-extensions.mq.md @@ -34,7 +34,7 @@ ext/llm — OpenAI-compatible chat. Design: doc/design/ext-llm.md ext/agent — agent framework + native plugin. Design: doc/design/ext-agent.md -ext/web — HTTP / SQLite·Postgres site helpers + native plugin. **W0–W7 + P3 + W8** + **customization C0–C4**. **Browser embed (routes D/E/F, v0.3.4)**: `web.client_embed` auto-mounts WASM — zero author JS; `lib/browser` + GFM tables; build with `marqdo wasm build`; examples: browser-hello · browser-app · browser-media · web-client-site. Design: doc/design/ext-web.md · WASM: doc/adr/0002-browser-marqdo-wasm.md · roadmaps D/E/F. +ext/web — HTTP / SQLite·Postgres site helpers + native plugin (default **Go libweb**, v0.4.0). **W0–W7 + P3 + W8** + **customization C0–C4**; acceptance example `examples/anlian-mq/`. **Browser embed (routes D/E/F, v0.3.4)**: `web.client_embed` auto-mounts WASM — zero author JS; `lib/browser` + GFM tables; build with `marqdo wasm build`; examples: browser-hello · browser-app · browser-media · web-client-site. Design: doc/design/ext-web.md · WASM: doc/adr/0002-browser-marqdo-wasm.md · roadmaps D/E/F. ext/quantum — circuits, draw, noise, formula matrix custom gates, Q7 density/viz, Q8 themed SVG (`theme=dark|light|bw`). Design: doc/design/ext-quantum.md · doc/design/ext-quantum-viz-style.md diff --git a/public/features/05-扩展.mq.md b/public/features/05-扩展.mq.md index 81edd41..640170e 100644 --- a/public/features/05-扩展.mq.md +++ b/public/features/05-扩展.mq.md @@ -34,7 +34,7 @@ ext/llm(大模型)— OpenAI 兼容聊天。设计:doc/design/ext-llm.md ext/agent(智能体)— 智能体框架 + 原生插件。设计:doc/design/ext-agent.md -ext/web(网页)— HTTP / SQLite 站点助手 + 原生插件。**W0–W7 + P3 + W8** + **定制 C0–C4**。**浏览器挂载(路线 D/E/F,v0.3.4)**:`网页.客户端挂载` / `web.client_embed` 自动 mount(作者零业务 JS);`lib/浏览器` + GFM;先 `marqdo wasm build`;示例 examples/browser-hello/ · examples/browser-app/ · examples/browser-media/ · examples/web-client-site/。设计:doc/design/ext-web.md · WASM:doc/adr/0002-browser-marqdo-wasm.md · 路线 D/E/F:doc/roadmap/browser-wasm-*.md +ext/web(网页)— HTTP / SQLite 站点助手 + 原生插件(默认 **Go libweb**,v0.4.0)。**W0–W7 + P3 + W8** + **定制 C0–C4**;验收示例 `examples/anlian-mq/`。**浏览器挂载(路线 D/E/F,v0.3.4)**:`网页.客户端挂载` / `web.client_embed` 自动 mount(作者零业务 JS);`lib/浏览器` + GFM;先 `marqdo wasm build`;示例 examples/browser-hello/ · examples/browser-app/ · examples/browser-media/ · examples/web-client-site/。设计:doc/design/ext-web.md · WASM:doc/adr/0002-browser-marqdo-wasm.md · 路线 D/E/F:doc/roadmap/browser-wasm-*.md ext/quantum(量子)— 电路、绘图、噪声、公式矩阵自定义门、Q7 密度/高级图、Q8 主题 SVG(`主题=dark|light|bw`)。设计:doc/design/ext-quantum.md · doc/design/ext-quantum-viz-style.md