diff --git a/CHANGELOG.md b/CHANGELOG.md index f16dbf1..eb00dbb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ user-facing notes live in [`docs/updates/`](docs/updates/) (English and ## Unreleased +## 2.3.0 — 2026-10-14 + ### Added - Editor: `sca cell ls|get|put|insert|rm|run` edits the open notebook's cells through the diff --git a/README.md b/README.md index 430b377..cacb76a 100644 --- a/README.md +++ b/README.md @@ -149,23 +149,20 @@ the full crank cycle sweeps clean in the same sim · --- -## Update Notes (2.2.2) +## Update Notes (2.3.0) > Validate generated definitions, assembly constraints, and manufacturing > geometry before production use. -- **Code completion from the SDK.** In the editor, `scad.` (and `scad.ql.`, - `scad.std.gear.`) lists the real functions with their signatures and - docstrings. Accepting one, or typing `(` after its name, writes the call with - every required parameter as `name=`, and Tab moves between them; inside a call - the parameters not given yet complete as `name=`. -- **New notebooks from the workspace tab.** A **new** action starts a part, or - an assembly that uses the first two parts, from the SDK's template; an empty - workspace opens on that form. -- **Fix.** The cell editors no longer rebuild their configuration on every - render, which dropped a snippet in progress. - -Full notes for this version: [`docs/updates/2.2.2.md`](docs/updates/2.2.2.md). +- **The editor takes in edits made to the notebook file.** An agent's saved change is applied + cell by cell (changed cells update and run again, no reload), and is no longer written over by + the editor. If a cell was edited in both places, the file's version is kept and your unsaved + text goes to the log. Notebooks added to the workspace appear in the list by themselves. +- **`sca cell` and `sca new`.** `sca cell ls|get|put|insert|rm|run` edits the open notebook's cells + through the running editor (the page updates live, each write prints the cell's status and + errors); `sca new NAME` creates a notebook the editor then lists. + +Full notes for this version: [`docs/updates/2.3.0.md`](docs/updates/2.3.0.md). Earlier versions: the [changelog](CHANGELOG.md) and [`docs/updates/`](docs/updates/). --- @@ -186,7 +183,7 @@ in a compact public API for creating solids, applying features, tagging semantic intent, querying topology, exporting manufacturing files, and translating recorded models into FreeCAD workflows. -Current release: `simplecadapi==2.2.2`. +Current release: `simplecadapi==2.3.0`. ## What It Provides @@ -701,6 +698,7 @@ and the [STEP reconstruction workflow](docs/skill/references/workflows/step-reco ## Documentation +- 2.3.0 update notes: [`docs/updates/2.3.0.md`](docs/updates/2.3.0.md) - 2.2.2 update notes: [`docs/updates/2.2.2.md`](docs/updates/2.2.2.md) - 2.2.1 update notes: [`docs/updates/2.2.1.md`](docs/updates/2.2.1.md) - 2.1.3b1 update notes: [`docs/updates/2.1.3b1.md`](docs/updates/2.1.3b1.md) diff --git a/README.zh-CN.md b/README.zh-CN.md index 801891d..aa93996 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -133,18 +133,18 @@ CalculiX 静力 FEM(边界面按保真的 `interface.*` 标签选取,仿真 --- -## 更新日志(2.2.2) +## 更新日志(2.3.0) > 投入生产前请验证生成的定义、装配约束和制造几何。 -- **来自 SDK 的代码补全。** 在编辑器里,输入 `scad.`(以及 `scad.ql.`、`scad.std.gear.`) - 会列出真实存在的函数、签名和文档说明。选中一个函数,或在函数名后输入 `(`,会把每个必填 - 参数写成 `name=`,Tab 在它们之间跳转;在调用括号内,还没写的参数会补全成 `name=`。 -- **在工作区页面创建 notebook。** 新增的 **new** 按 SDK 模板创建一个零件,或一个使用前两个 - 零件的装配;空工作区会直接打开这个表单。 -- **修复。** cell 编辑器不再每次渲染都重建配置,这会让进行中的占位跳转丢失。 +- **编辑器会接收对 notebook 文件的修改。** agent 保存的修改会按 cell 逐个应用(变化的 cell 更新并重新运行, + 不刷新页面),不再被编辑器覆盖。同一个 cell 两边都改时,保留文件里的版本,你未保存的文字记入日志。 + 工作区里新增的 notebook 会自动出现在列表中。 +- **`sca cell` 和 `sca new`。** `sca cell ls|get|put|insert|rm|run` 通过运行中的编辑器修改打开的 + notebook 的 cell(页面实时更新,每次写入都打印该 cell 的状态和错误);`sca new NAME` 创建一个 + 编辑器随即列出的 notebook。 -本版本的完整说明:[`docs/updates/2.2.2.zh-CN.md`](docs/updates/2.2.2.zh-CN.md)。 +本版本的完整说明:[`docs/updates/2.3.0.zh-CN.md`](docs/updates/2.3.0.zh-CN.md)。 更早的版本:见[更新日志](CHANGELOG.md)和 [`docs/updates/`](docs/updates/)。 --- @@ -162,7 +162,7 @@ CalculiX 静力 FEM(边界面按保真的 `interface.*` 标签选取,仿真 SimpleCADAPI 是一个基于 OCP 的 Python CAD SDK,提供清晰的函数式建模操作和可重放的模型图。它在 OpenCascade 几何内核之上提供精简的公共 API,可用于创建实体、应用特征、添加语义标签、查询拓扑、导出制造文件,以及将记录的模型转换为 FreeCAD 工作流。 -当前版本:`simplecadapi==2.2.2`。 +当前版本:`simplecadapi==2.3.0`。 ## 核心能力 @@ -588,6 +588,7 @@ uv run --extra fem python examples/ap242_gmsh_volume_mesh/run_calculix.py ## 文档 +- 2.3.0 更新说明:[`docs/updates/2.3.0.zh-CN.md`](docs/updates/2.3.0.zh-CN.md) - 2.2.2 更新说明:[`docs/updates/2.2.2.zh-CN.md`](docs/updates/2.2.2.zh-CN.md) - 2.2.1 更新说明:[`docs/updates/2.2.1.zh-CN.md`](docs/updates/2.2.1.zh-CN.md) - 2.1.3b1 更新说明:[`docs/updates/2.1.3b1.zh-CN.md`](docs/updates/2.1.3b1.zh-CN.md) diff --git a/docs/skill/SKILL.md b/docs/skill/SKILL.md index 7e2f597..2079717 100644 --- a/docs/skill/SKILL.md +++ b/docs/skill/SKILL.md @@ -4,9 +4,9 @@ description: Build, assemble, inspect, reconstruct, and export parametric CAD mo license: Apache-2.0 metadata: project: simplecadapi - version: 2.2.2 + version: 2.3.0 package-name: simplecadapi - package-version: 2.2.2 + package-version: 2.3.0 --- # SimpleCAD SDK Skill diff --git a/docs/updates/2.3.0.md b/docs/updates/2.3.0.md new file mode 100644 index 0000000..ce1a1f8 --- /dev/null +++ b/docs/updates/2.3.0.md @@ -0,0 +1,37 @@ +# 2.3.0 Update Notes + +The editor (`sca edit`) and an agent can now work on the same notebook without overwriting each other. + +## The editor takes in edits made to the file + +Before, the editor held the open notebook in memory and rewrote the file on each edit, so a change +an agent saved was overwritten by the editor's next save and never shown. Now the file is watched: +a saved change is compared with the editor's cells and applied cell by cell. Changed cells are +updated and run again, added or removed cells appear or go away, and the page does not reload or +flicker. A change to the setup cell or an `@app.function` cell restarts the kernel instead; a file +that does not parse is ignored until the next save that does. + +If a cell was edited in both places, **the file's version is kept** and the text you had not saved +goes to the log at the bottom. Notebooks added to or removed from the workspace appear in the list +by themselves. + +## `sca cell` and `sca new` + +```bash +sca cell ls [--code] # numbered cells with status, errors and output +sca cell get 3 +echo 'L = 90' | sca cell put 3 # replace a cell's code and run it +sca cell insert --after 3 -f new.py +sca cell rm 4 +sca cell run [CELL ...] +sca new bracket --kind part # a new notebook, listed by the running editor +``` + +These go through the running editor, found by `/.sca-editor/server.json`: the page shows +the change live and each write prints the touched cell's status, errors and output. With no editor +running, or another notebook open, `ls` and `get` read the file and the write commands refuse: edit +the file directly then. + +The skill (`editor-collaboration`) and `landing.md` now tell agents to work this way. + +See the [changelog](../../CHANGELOG.md) for the complete list. diff --git a/docs/updates/2.3.0.zh-CN.md b/docs/updates/2.3.0.zh-CN.md new file mode 100644 index 0000000..a130d6e --- /dev/null +++ b/docs/updates/2.3.0.zh-CN.md @@ -0,0 +1,33 @@ +# 2.3.0 更新说明 + +`sca edit` 编辑器和 agent 现在可以同时处理同一个 notebook,互不覆盖。 + +## 编辑器会接收对文件的修改 + +以前编辑器把打开的 notebook 放在内存里,每次编辑都重写文件,agent 保存的修改会被编辑器的下一次保存 +覆盖,也不会显示出来。现在编辑器会监视文件:保存后的修改会与编辑器里的 cell 对比,按 cell 逐个应用。 +变化的 cell 会更新并重新运行,新增或删除的 cell 会出现或消失,页面不会刷新或闪烁。setup cell 或 +`@app.function` cell 的修改会重启 kernel;无法解析的文件会被忽略,直到下一次可解析的保存。 + +如果同一个 cell 两边都改了,**保留文件里的版本**,你还没保存的文字会记在底部日志里。工作区里新增或删除的 +notebook 会自动出现在列表中。 + +## `sca cell` 和 `sca new` + +```bash +sca cell ls [--code] # 带编号的 cell,含状态、错误和输出 +sca cell get 3 +echo 'L = 90' | sca cell put 3 # 替换 cell 代码并运行 +sca cell insert --after 3 -f new.py +sca cell rm 4 +sca cell run [CELL ...] +sca new bracket --kind part # 新建 notebook,运行中的编辑器会列出它 +``` + +这些命令通过运行中的编辑器工作(由 `/.sca-editor/server.json` 找到):页面实时显示修改,每次写入 +都会打印被改 cell 的状态、错误和输出。没有运行中的编辑器,或编辑器打开的是别的 notebook 时,`ls` 和 `get` +读取文件,写命令会拒绝:这时直接编辑文件即可。 + +skill(`editor-collaboration`)和 `landing.md` 已让 agent 按这种方式工作。 + +完整列表见[更新日志](../../CHANGELOG.md)。 diff --git a/pyproject.toml b/pyproject.toml index 461392f..19247c2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "simplecadapi" -version = "2.2.2" +version = "2.3.0" description = "A simplified OCP-native CAD modeling Python API" readme = "README.md" license = { file = "LICENSE" } diff --git a/uv.lock b/uv.lock index 6650fff..c1a2235 100644 --- a/uv.lock +++ b/uv.lock @@ -3227,7 +3227,7 @@ wheels = [ [[package]] name = "simplecadapi" -version = "2.2.2" +version = "2.3.0" source = { editable = "." } dependencies = [ { name = "cadquery-ocp" },