Commit Graph
25 Commits
Author SHA1 Message Date
imccyu c6ef2d17da fix(ptc): keep the runtime's own experimental warnings out of program output
The child filters Node's ExperimentalWarning for vm.USE_MAIN_CONTEXT_DEFAULT_LOADER
and stripTypeScriptTypes, which the runtime itself triggers; an environment
initializer that imports a module under the scoped REPL otherwise prints it into
the first call's output. Warnings that programs emit still print. The host strips
types without printing the stripTypeScriptTypes warning.
2026-11-10 18:52:20 +08:00
imccyu 1cf3217403 fix(ptc): align scoped REPL guidance and tests with inspect output
run_code now discards completion values for TypeScript runtimes, so the
scoped REPL guidance shares the inspect output sentence with the other
modes. Tests read the output field, cover environment initialization with
copied bindings, and the ptc-scoped-repl snapshot is re-recorded with
inspect output.
2026-11-10 18:52:19 +08:00
imccyu ba4d01126c feat(ptc): start scoped REPL var redeclarations from the earlier value
A call that declares an earlier name again only with var now gets a var
copy of the earlier value, so a var declaration that does not run, after
a throw or in an untaken branch, keeps that value as a global var does in
Node's REPL. var count = count + 1 consequently adds to the earlier value.
A function of the same name in one call takes precedence over the var.
Update the model guidance, Agent Note, READMEs, and the ptc-scoped-repl
snapshot schema.
2026-11-10 18:52:19 +08:00
imccyu 793ce790a6 feat(ptc): add scoped REPL execution with copied top-level bindings
With replScoped: true, persistent-in-memory runs each call as a separate
VM Script in one retained context. Each call starts with copies of the
top-level bindings left by earlier calls, so a later call may declare any
earlier name again with any keyword while earlier functions and
still-running code keep their values. Results, top-level await, errors
and asynchronous failures follow the existing REPL evaluator; modules
load only through dynamic import(), resolved from the environment's first
working directory.

The control protocol moves to version 3; the upgrade guide covers
preinstalled bootstraps and the new PtcProgramFormat member. The Agent
Note records the decision and its comparison with node:repl and
vm-script, and the ptc-scoped-repl snapshot pins the model guidance.
2026-11-10 18:52:19 +08:00
_Kerman 86984d8358 Merge branch 'feat/cua-run-code-standard' into xtr/ptc-inspect-output 2026-11-10 14:24:26 +08:00
turtle1999 26427a26e1 refactor(ptc): initialize each environment through a registered hook 2026-11-09 22:19:35 +08:00
_Kerman e1f0a36193 fix(ptc): preserve native console methods 2026-11-09 18:17:19 +08:00
turtle1999 b9966a12a6 feat(cua): expose persistent code tool outside PTC mode 2026-11-09 15:53:22 +08:00
_Kerman 724e56b286 feat(ptc): unify explicit text and image inspection 2026-11-09 15:06:09 +08:00
_Kerman c1783e9dff feat(ptc): select program output with Harness.inspect 2026-11-09 12:00:07 +08:00
Anlai Lu 4ac6a28e68 feat(ptc): 支持 embedded 模式启用 persistent PTC 2026-11-06 12:55:15 +08:00
Yixiang Tu e032300b4e fix(sandbox): use current grants after failed PTC startup 2026-11-04 15:11:17 +08:00
Yixiang Tu f5dea38671 feat(sandbox): add session-scoped writable directory effects 2026-11-04 15:11:17 +08:00
_Kerman 5cf9348314 refactor(ptc-runtime-node): reuse sequential RPC evaluation lifecycle 2026-10-30 20:55:23 +08:00
_Kerman adc54201f3 fix(ptc-runtime-node): preserve existing native output behavior 2026-10-30 20:54:53 +08:00
_Kerman 718f28ee9a refactor(ptc): simplify model-visible state and recovery messages 2026-10-30 11:30:37 +08:00
_Kerman 7d20d1c361 fix(ptc-runtime-node): contain teardown and validate bootstrap readiness 2026-10-29 21:58:51 +08:00
_Kerman 9800c764ef feat(ptc-runtime-node): preserve state after cooperative cancellation 2026-10-29 21:22:25 +08:00
_Kerman 67911ed176 fix(ptc): describe fresh Script failures without retained state 2026-10-21 19:51:52 +08:00
_Kerman 73a5e63894 fix(ptc-runtime-node): report clearing only for retained executions 2026-10-21 16:46:56 +08:00
_Kerman 2b7b2a0ee6 refactor(ptc): share the program format type 2026-10-21 15:59:56 +08:00
_Kerman 86fcf49a74 fix(ptc-runtime-node): validate Script evaluation and process lifecycle 2026-10-21 11:12:33 +08:00
_Kerman e82dddc45c fix(ptc-runtime-node): correct Script await handling and guidance 2026-10-21 00:37:56 +08:00
_Kerman c3473d1ea6 refactor(ptc-runtime-node): unify temporary and retained processes 2026-10-21 00:03:21 +08:00
_Kerman 7745b3b9da feat(ptc-runtime-node): add VM Script execution with optional retained state 2026-10-20 23:16:30 +08:00