Conversation
workspace.repl(name).eval(code) gives agents a durable JavaScript REPL: a session is a replayable log in the workspace DO SQLite, not a process. Every eval builds a fresh dynamic isolate (runtime eval is banned there), replays committed cells against recorded effects, and records the new cell. Failed cells never enter the log; sessions survive DO eviction with state rebuilt exactly and effects never re-fired. - acorn cell transform: top-level declarations persist via globalThis, value = explicit return or trailing expression - recorded nondeterminism (audited against a live dynamic isolate): Math.random, Date.now, no-arg new Date() / Date(), crypto.randomUUID, crypto.getRandomValues, performance.now; WeakRef/FinalizationRegistry/ caches removed so use fails loudly instead of silently diverging - result follows the common interpreter convention plus a structured "value" field; logs are one ordered stream with console levels kept (logs.entries + logs.dropped); unclonable successes render into results[] instead of failing - replay divergence is a hard, structured error (kind mismatch and unconsumed-effects both covered by tests); evals serialize per session; deny-by-default egress (globalOutbound: null); wall-clock timeout maps to a structured timeout error
|
|
Thanks for your interest in Cloudflare Computer. This repository does not accept unsolicited pull requests. Please use one of the accepted contribution paths instead:
If a maintainer asked you to open this pull request, they can add the |
Adds
workspace.repl(name): a persistent JavaScript session backed by the Workspace Durable Object.Date,Math.random,crypto) is recorded and replayed so state rebuilds identically.