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

+2
View File
@@ -23,6 +23,8 @@ import foreign:lib/foreign.mq.md
| 生成报告 | 分析 | ASCII 图 + JSON 报告 |
| 独立复核 | 复核 | 另一个内核读取报告做校验 |
`会话` = > foreign.session kernels=`内核表` cells=`会话表`
`准备数据` =
```python
import math
+3
View File
@@ -1,5 +1,6 @@
---
title: notebook shared state
import foreign:lib/foreign.mq.md
---
# main
@@ -19,6 +20,8 @@ title: notebook shared state
| 读取 | 分析 | 读取共享变量 |
| 隔离 | 绘图 | 看不到 shared |
`会话` = > foreign.session kernels=`内核表` cells=`会话表`
`设置` =
```node
let shared = 41;