diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2a39f18..f94ae10 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,7 +38,7 @@ jobs: run: | export PATH="/c/ProgramData/mingw64/mingw64/bin:/c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin:$PATH" cargo build --release - cargo build --release -p marqdo_plugin_agent -p marqdo_plugin_quantum -p marqdo_plugin_linalg + cargo build --release -p marqdo_plugin_agent -p marqdo_plugin_quantum -p marqdo_plugin_linalg -p marqdo_plugin_llm bash ./scripts/build-web-plugin.sh - name: Checkout extension sources (branch vscode-extension only) @@ -87,6 +87,7 @@ jobs: Copy-Item target/release/agent.dll "$stageNative/native/agent.dll" Copy-Item target/release/quantum.dll "$stageNative/native/quantum.dll" Copy-Item target/release/linalg.dll "$stageNative/native/linalg.dll" + Copy-Item target/release/llm.dll "$stageNative/native/llm.dll" if (Test-Path "dist/$nativeZip") { Remove-Item "dist/$nativeZip" -Force } Compress-Archive -Path "$stageNative/*" -DestinationPath "dist/$nativeZip" -Force $stage = "dist/stage-bundle" @@ -100,6 +101,7 @@ jobs: Copy-Item target/release/agent.dll "$stage/ext/native/agent.dll" Copy-Item target/release/quantum.dll "$stage/ext/native/quantum.dll" Copy-Item target/release/linalg.dll "$stage/ext/native/linalg.dll" + Copy-Item target/release/llm.dll "$stage/ext/native/llm.dll" if (Test-Path "dist/$zip") { Remove-Item "dist/$zip" -Force } Compress-Archive -Path "$stage/*" -DestinationPath "dist/$zip" -Force $stageLib = "dist/stage-stdlib" @@ -124,12 +126,12 @@ jobs: ## Marqdo ${{ github.ref_name }} ### 亮点 / Highlights - - **v1.1.0**:AI 原生闭环三件套——核心表面守卫(问题一)· 渐进式契约 + `marqdo check`(问题二)· **MLSP for AI**(`marqdo mlsp`:locate/syntax/validate/repair_targets/repair_apply/schema,AI 按需查语法而非背诵)(问题三)· `run --json` 结构化诊断 - - **v1.1.0**: AI-native loop — core-surface guard, progressive contracts + `marqdo check`, **MLSP for AI** (`marqdo mlsp`: query syntax on demand instead of memorizing), `run --json` structured diagnostics - - **v1.0.7**:WS/网络边界加固(同源握手、require_auth/需要登录、消息上限、HTTP 8 MiB 截断);`url_encode` `%20` - - **v1.0.3**:Ubuntu PPA + 扩展 CDN(ext.marqdo.com);CLI/扩展可分发;noble 捆绑 Rust 工具链 - - **v1.0.3**: Ubuntu PPA + extension CDN; independent CLI/ext packs; bundled Rust for noble - - **v1.0.1**:修复 Go `libweb` 动态路由 `{param}` 查询代入、详情 Markdown、CSS 数字误报 + - **v1.1.1**:AI 栈收口——llm `ask`/`stream`/`collect` · Metadata Binding · Skill Compilation + Adaptive Routing · MCP 客户端 + resume · 可选 `plugins/llm` + - **v1.1.1**: AI stack — llm ask/stream/collect, Metadata Binding, Skill Compilation + Adaptive Routing, MCP client + resume, optional plugins/llm + - **v1.1.0**:AI 原生闭环三件套——核心表面守卫 · 渐进式契约 + `marqdo check` · **MLSP for AI** · `run --json` + - **v1.1.0**: AI-native loop — core-surface guard, progressive contracts + `marqdo check`, **MLSP for AI**, `run --json` + - **v1.0.7**:WS/网络边界加固;`url_encode` `%20` + - **v1.0.3**:Ubuntu PPA + 扩展 CDN(ext.marqdo.com) - **Linux 包必出**:`*-native-x86_64-unknown-linux-gnu.zip` + Linux CLI bundle - Details: [CHANGELOG](https://github.com/cflmy/marqdo/blob/main/CHANGELOG.md) · [mapping v0.3](https://github.com/cflmy/marqdo/blob/main/doc/design/markdown-mapping-v0.3.md) @@ -139,7 +141,7 @@ jobs: |-------|----------| | `marqdo-*-windows-msvc.exe` | CLI with **embedded** official stdlib | | `marqdo-*-windows-msvc.zip` | `marqdo.exe` + `lib/` + `ext/`(含 native DLL) | - | `marqdo-*-native-*.zip` | 预编译 `web`/`agent`/`quantum`/`linalg`(Windows DLL + **Linux .so 必出**) | + | `marqdo-*-native-*.zip` | 预编译 `web`/`agent`/`quantum`/`linalg`/`llm`(Windows DLL + **Linux .so 必出**) | | `marqdo-*-unknown-linux-gnu.zip` | Linux CLI + `lib/` + `ext/` + native `.so` | | `marqdo-*-stdlib.zip` | `lib/` only | | `marqdo-*-ext.zip` | Official `ext/` L1 sources | @@ -184,7 +186,7 @@ jobs: run: | set -euo pipefail cargo build --release - cargo build --release -p marqdo_plugin_agent -p marqdo_plugin_quantum -p marqdo_plugin_linalg + cargo build --release -p marqdo_plugin_agent -p marqdo_plugin_quantum -p marqdo_plugin_linalg -p marqdo_plugin_llm bash ./scripts/build-web-plugin.sh - name: Package Linux native zip + CLI bundle @@ -193,7 +195,7 @@ jobs: VER="${GITHUB_REF_NAME#v}" TARGET="x86_64-unknown-linux-gnu" mkdir -p dist/stage-native/native - for lib in libweb.so libagent.so libquantum.so liblinalg.so; do + for lib in libweb.so libagent.so libquantum.so liblinalg.so libllm.so; do src="target/release/${lib}" if [[ ! -f "$src" && "$lib" == libweb.so ]]; then src="plugins/web/build/libweb.so" diff --git a/CHANGELOG.md b/CHANGELOG.md index b4498d1..7085587 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,12 +3,47 @@ ## Unreleased ### Added -- **`plugins/llm` Transport ABI** (`llm_chat_completions`): `ext/ai/llm/openai` prefers the native plugin when resolvable, else `lib/net` HTTP/SSE. -- **Agent MCP stdio client** (`agent_mcp_client` / `mcp_connect` / `mcp_client_list` / `mcp_client_call`) plus offline golden against a Python mock server. -- **Agent resume checkpoints** (`.marqdo/agent-resume/.json` — save/load/clear/list; `run` can set `resume_id=`). + +### Fixed ### Changed -- Adaptive Routing: `jev` is a **compat alias** of `small-llm` (no `MARQDO_JEV` first-class path). Decision surface is `router_model` (any llm handle). + +## v1.1.1 — 2026-09-24 + +### Highlights + +**AI 栈收口(agent + llm)**:语义 `ask`/`stream`/`collect`、Artifact Metadata Binding、Skill Compilation + Adaptive Routing、MCP 客户端与 resume 检查点、可选 `plugins/llm` Transport ABI。 +本版 CLI 与扩展包 **同步为 1.1.1**。 + +- **LLM 原语**:`ext/ai/llm` 从 OpenAI HTTP 客户端提升为 `ask`/`stream`/`collect` 智能原语(`complete` 保留兼容);`LLMResult.tool_calls`;可选原生 `llm_chat_completions`(无 `.so` 时回退 `lib/net`)。 +- **Metadata Binding**:frontmatter `${env|arg|sys|secret}` 加载期解析;Phase 2 将绑定键注入入口 env(正文禁止 `${…}`);`sys.meta` / `--bind`;llm ctor 优先 meta。 +- **Agent**:Skill Compilation(episode → llm_free skills)+ Adaptive Routing(`marqdo` / `small-llm` / `llm` / `auto`;`jev` 为 `small-llm` 兼容别名);MCP **stdio 客户端**;resume 检查点;零 LLM 金样路径。 +- **度量与后端**:`model_turn` usage、named handles(fast/reasoning)、`type:prompt` 加载、openai/ollama 分流。 + +```bash +# Ubuntu PPA / 源码 +sudo add-apt-repository ppa:cflmy/marqdo && sudo apt update && sudo apt install marqdo +git checkout v1.1.1 && cargo build --release +marqdo ext add llm && marqdo ext add agent +``` + +**核心表面 Δ(Core surface Δ)**:**无增删**——19 个核心构造不变。本版为 **Runtime**(Metadata Binding、LLM/agent 插件与扩展)变更,不触碰语言标记。 + +### Added +- **`ext/ai/llm` 语义表面**:`ask` / `stream` / `collect`(`complete` 兼容);`LLMResult.tool_calls`(OpenAI-shaped `choices[0].message.tool_calls`);`sys.module_source` + 入口文档 `prompt_body` 离线路径。 +- **`plugins/llm` Transport ABI**(`llm_chat_completions`):`ext/ai/llm/openai` 优先原生插件,否则 `lib/net` HTTP/SSE。 +- **Artifact Metadata Binding**:frontmatter `${env|arg|sys|secret}` → `Module.metadata`;Secret 掩码;`sys.meta` / `--bind`;Phase 2 入口 env 注入(正文拒绝 `${…}`;字节码 prologue 同源)。 +- **Agent Skill Compilation + Adaptive Routing**:episode → `maybe_learn` → llm_free skills;路由后端 `marqdo` / `small-llm` / `llm` / `auto`(`jev` = `small-llm` 兼容别名,不再探测 `MARQDO_JEV`)。 +- **Agent MCP stdio 客户端**(`agent_mcp_client` / `mcp_connect` / `mcp_client_list` / `mcp_client_call`)+ Python mock 离线金样。 +- **Agent resume 检查点**(`.marqdo/agent-resume/.json` — save/load/clear/list;`run` 可设 `resume_id=`)。 +- **AI 栈度量与后端**:`model_turn` usage、named handles(fast/reasoning)、`type:prompt` 加载、openai/ollama 分流、agent-zero-llm 金样。 + +### Fixed +- **plan force 不再冲掉已有 `resources` workbook**(保留 llm_free 资源;金样 `agent-plan-preserve`)。 +- **compiled-skill Marqdo 语法**:llm_free await 不再误落到 plan+HTTP。 + +### Changed +- Adaptive Routing:决策面为 `router_model`(任意 llm handle);`jev` 降为 `small-llm` 文档/兼容别名。 ## v1.1.0 — 2026-09-23 diff --git a/Cargo.lock b/Cargo.lock index add8e65..01d1995 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -572,7 +572,7 @@ checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad" [[package]] name = "marqdo" -version = "1.1.0" +version = "1.1.1" dependencies = [ "anyhow", "assert_cmd", @@ -603,7 +603,7 @@ dependencies = [ [[package]] name = "marqdo-wasm" -version = "1.1.0" +version = "1.1.1" dependencies = [ "marqdo", "serde_json", diff --git a/Cargo.toml b/Cargo.toml index b5c60b0..e1c364e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "marqdo" -version = "1.1.0" +version = "1.1.1" edition = "2021" license = "Apache-2.0" description = "Marqdo — Markdown markers as an interpreted programming language" diff --git a/README.md b/README.md index f9b2e1d..e0824ed 100644 --- a/README.md +++ b/README.md @@ -142,9 +142,10 @@ marqdo catalog public -o .marqdo --- -## 现状(v1.1.0) +## 现状(v1.1.1) -- **AI 原生闭环(v1.1.0 新增)**:核心表面守卫(19 构造,单边改动 CI 必红)· **渐进式契约**(文档内嵌 `参数`/`返回`/`字段` 表 + 四边界校验 + `marqdo check` 防漂移)· **MLSP for AI**(`marqdo mlsp`:`locate`/`syntax`/`validate`/`repair_targets`/`repair_apply`/`schema`,AI 按需查语法而非背诵)· **结构化诊断**(`run --json`,错误即数据);验证见 [perf-validation-report-2026-09-23.md](doc/roadmap/perf-validation-report-2026-09-23.md) +- **AI 栈(v1.1.1)**:`ext/ai/llm` 语义 `ask`/`stream`/`collect` · Artifact Metadata Binding(`${env|arg|sys|secret}`)· Agent Skill Compilation + Adaptive Routing · MCP stdio 客户端 + resume 检查点 · 可选 `plugins/llm` Transport ABI +- **AI 原生闭环(v1.1.0)**:核心表面守卫(19 构造,单边改动 CI 必红)· **渐进式契约**(文档内嵌 `参数`/`返回`/`字段` 表 + 四边界校验 + `marqdo check` 防漂移)· **MLSP for AI**(`marqdo mlsp`:`locate`/`syntax`/`validate`/`repair_targets`/`repair_apply`/`schema`,AI 按需查语法而非背诵)· **结构化诊断**(`run --json`,错误即数据);验证见 [perf-validation-report-2026-09-23.md](doc/roadmap/perf-validation-report-2026-09-23.md) - 映射与解释器:**v0.3 语法宪法**(`**` 代码 / `*` 返回 / 叙述声明);Phase I 树遍历 + 字节码后端;金样例在 `tests/` 与 `tests/markup-v03/` - **对象**:`#` = 类型/构造,`##`+ = 函数/方法;见 [objects.md](doc/design/objects.md) - **`marqdo view`**:文档浏览器(Structure + 函数大纲/搜索 + Execution + Variables 浮窗) @@ -156,16 +157,16 @@ marqdo catalog public -o .marqdo - **`web`**:W0–W7 + P3 + **W8**;**定制 C0–C4**;**宿主 H1–H2**(`proxy`/`invoke`,见 [ext-hosting.md](doc/roadmap/ext-hosting.md));**表驱动引言**(`compose_intro` / `引言装配`);原生层默认 **Go `libweb`**([ADR 0004](doc/adr/0004-web-plugin-go.md),`scripts/build-web-plugin.sh`);示例 [web-site](examples/web-site/) · [web-site-zh](examples/web-site-zh/) · [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 兼容对话 + - **`agent`**:A1–A4 + **MCP Server/Client stdio** + Skill Compilation + Adaptive Routing + resume;宿主缺口见 [ext-hosting.md](doc/roadmap/ext-hosting.md) · [agent-framework-gaps-after-a4.md](doc/research/agent-framework-gaps-after-a4.md) + - **`llm`**:语义 `ask`/`stream`/`collect`(OpenAI/Ollama;可选原生 `plugins/llm`) - 安装:`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}`(`web` 为 Go;其余为 Rust) +- **原生插件 ABI**:[`include/marqdo_abi.h`](include/marqdo_abi.h) · [ext-abi.md](doc/design/ext-abi.md);`plugins/{demo,agent,web,quantum,linalg,llm}`(`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(v1.1.0) +### 如何使用最新 Marqdo(v1.1.1) **安装解释器(任选其一)** @@ -180,7 +181,7 @@ marqdo catalog public -o .marqdo ```bash # 1) 源码安装(跟 tag 或 main) git clone https://github.com/cflmy/marqdo.git && cd marqdo -git checkout v1.1.0 # 或留在 main +git checkout v1.1.1 # 或留在 main cargo build --release export PATH="$PWD/target/release:$PATH" marqdo version @@ -193,7 +194,7 @@ marqdo view public --no-open marqdo debug public --no-open marqdo catalog public -o .marqdo -# 2b) AI 原生闭环(v1.1.0):契约检查 / 结构化诊断 / MLSP 查询 +# 2b) AI 原生闭环(v1.1.0+):契约检查 / 结构化诊断 / MLSP 查询 marqdo check tests/contracts/ok_contract.mq.md # 静态契约防漂移 marqdo run tests/structure/hello.mq.md --json # 结构化诊断(错误即数据) printf '{"id":1,"method":"syntax","params":{"query":"返回"}}\n' | marqdo mlsp @@ -203,8 +204,8 @@ marqdo ext add web # 或:网页 — 自动下载 L1 + 预编译 native( marqdo ext add agent # 或:智能体 marqdo ext add quantum # 或:量子 marqdo ext add linalg # 或:线性代数 -marqdo ext add llm # 或:大模型(纯 .mq.md) -# 开发者:cargo build --release -p marqdo_plugin_{agent,quantum,linalg} +marqdo ext add llm # 或:大模型(.mq.md + 可选 native llm) +# 开发者:cargo build --release -p marqdo_plugin_{agent,quantum,linalg,llm} # bash ./scripts/build-web-plugin.sh # 需 Go + cgo → libweb # 离线:解压 Windows zip(已含 ext/native)或手动放下 native zip;MARQDO_EXT_NO_DOWNLOAD=1 @@ -219,7 +220,7 @@ marqdo wasm build # → dist/wasm/ … 见 examples/browser-hello/ # 6) Releases:Windows exe/zip/vsix;Linux CLI zip + native `.so` zip -# https://github.com/cflmy/marqdo/releases/tag/v1.1.0 +# https://github.com/cflmy/marqdo/releases/tag/v1.1.1 ``` 开发期也可用 `cargo run -- …` 代替已安装的 `marqdo`: diff --git a/crates/marqdo-wasm/Cargo.toml b/crates/marqdo-wasm/Cargo.toml index 27aec97..43f2011 100644 --- a/crates/marqdo-wasm/Cargo.toml +++ b/crates/marqdo-wasm/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "marqdo-wasm" -version = "1.1.0" +version = "1.1.1" edition = "2021" license = "Apache-2.0" description = "Marqdo interpreter as WebAssembly (browser host bridge)" diff --git a/debian/changelog b/debian/changelog index 0f4e119..c3fe88e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +marqdo (1.1.1-1ppa1) noble; urgency=medium + + * Marqdo 1.1.1: AI stack closure — llm ask/stream/collect, Metadata Binding, + Skill Compilation + Adaptive Routing, MCP stdio client + resume checkpoints, + optional plugins/llm Transport ABI (fallback lib/net). + + -- cflmy Thu, 24 Sep 2026 20:32:00 +0800 + marqdo (1.1.0-1ppa1) noble; urgency=medium * Marqdo 1.1.0: core surface guard + progressive contracts + MLSP for AI. diff --git a/ext/VERSION b/ext/VERSION index 9084fa2..524cb55 100644 --- a/ext/VERSION +++ b/ext/VERSION @@ -1 +1 @@ -1.1.0 +1.1.1