feat(foreign): own view sessions and clear outputs

foreign.session returns a handle from ordinary kernel/cell tables; view consumes only the 会话 binding. Sessions live in host foreign_doc. Without 会话, view cells run stateless one-shot. Add /api/session/clear and a Clear outputs button for every view page; clearing keeps persistent kernel state.
This commit is contained in:
cflmy committed 2026-10-18 12:42:15 +08:00
1 parent 01468ad976
commit fb28eee62f
21 files changed
+379 -75

No files matched your search

+5 -3
View File
@@ -150,14 +150,14 @@ print(json.dumps(value + 1))
Cells in view. Named kernels and a cell order are ordinary bound tables, not fence metadata or YAML config.
```text
`内核表` =
`分析内核` =
| 名称 | 语言 | 命令 | 说明 |
|------|------|------|------|
| 分析 | python | | shared analysis |
| 复核 | python | | isolated review |
`会话表` =
`分析单元` =
| 单元 | 内核 | 说明 |
|------|------|------|
@@ -166,7 +166,9 @@ Cells in view. Named kernels and a cell order are ordinary bound tables, not fen
| 独立复核 | 复核 | read the JSON report |
```
`marqdo view` renders these as cells with Run All, Step, per-cell kernel switching, a journal, dirty reload and a state panel. There is no separate interactive command; `marqdo run` still executes the same file as one program.
`会话` = > foreign.session kernels=`分析内核` cells=`分析单元`
`marqdo view` consumes the foreign-owned `会话` handle and renders Run All, Step, per-cell kernel switching, a journal, dirty reload and a state panel. Without that handle, cells are stateless one-shot runs. There is no separate interactive command; `marqdo run` still executes the same file as one program.
---
+5 -3
View File
@@ -150,14 +150,14 @@ print(json.dumps(value + 1))
view 中的单元。命名内核和单元顺序都是普通绑定表,不是 fence 元数据或 YAML 配置。
```text
`内核表` =
`分析内核` =
| 名称 | 语言 | 命令 | 说明 |
|------|------|------|------|
| 分析 | python | | 共享分析 |
| 复核 | python | | 独立复核 |
`会话表` =
`分析单元` =
| 单元 | 内核 | 说明 |
|------|------|------|
@@ -166,7 +166,9 @@ view 中的单元。命名内核和单元顺序都是普通绑定表,不是 fe
| 独立复核 | 复核 | 读取 JSON 报告 |
```
`marqdo view` 会把这些渲染成带 Run All、Step、切换内核、journal、dirty reload 和状态面板的单元。没有单独的交互命令;`marqdo run` 仍把同一份文件当单个程序执行。
`会话` = > foreign.session kernels=`分析内核` cells=`分析单元`
`marqdo view` 消费 foreign 拥有的 `会话` 句柄,渲染 Run All、Step、切换内核、journal、dirty reload 和状态面板。没有该句柄时,单元是无状态的一次性运行。没有单独的交互命令;`marqdo run` 仍把同一份文件当单个程序执行。
---