feat(foreign): raw stdin, per-cell inputs and interrupt

Persistent Python/Node kernels receive raw program stdin per eval; foreign.session accepts an inputs table and view exposes per-cell stdin. Add session interrupt host API and view control.
This commit is contained in:
cflmy committed 2026-10-18 14:37:45 +08:00
1 parent c85f1a2829
commit 064522a338
9 files changed
+86 -2

No files matched your search

+8
View File
@@ -225,6 +225,14 @@ Kill and remove a session; returns whether it existed.
*> host_foreign_session_close id=`id`*
## session_interrupt
+ `id`
Interrupt the current evaluation of a persistent kernel. The session remains
usable for the next evaluation when the worker supports interruption.
*> host_foreign_session_interrupt id=`id`*
## session_list
List live sessions with id/lang/cmd/evals/alive/started_ms.
+7
View File
@@ -205,6 +205,13 @@ JSON 进 / JSON 出:把 `输入` 编码到 stdin,解析 stdout JSON 返回
*> host_foreign_session_get id=`标识` name=`名称`*
## 会话中断
+ `标识`
中断持久内核当前求值;worker 支持时,会话仍可用于下一次求值。
*> host_foreign_session_interrupt id=`标识`*
## 会话变量
+ `标识`