Skip to content

Agent Runtime Execution

The Agent can execute JavaScript or TypeScript without a Runtime Module. Guidance and the user task tell the Agent what to do; the Agent writes or selects code and runs it through pedelec-ts-runtime inside the Workspace.

Guidance / user task
↓
Agent
↓
writes or selects JS/TS
↓
pedelec-ts-runtime
↓
Workspace

Pedelec Desktop manages a pinned Deno runtime. Users do not need to install Node.js, Bun, or Deno themselves. pedelec-ts-runtime is the canonical Agent-facing JS/TS runtime. If it is unavailable, the Agent should report the failure instead of silently falling back to Node.js, Bun, raw Deno, or another runtime. Execution stays within the Workspace security boundary.

Terminal window
pedelec-ts-runtime --thread-id <thread-id> run scripts/task.ts

A file-backed script fits multi-step work, code worth inspecting or retaining, and existing Workspace scripts. For example, an Agent might scan project files and generate a manifest, generate files from a template, or perform a one-time file migration.

Terminal window
pedelec-ts-runtime --thread-id <thread-id> run -

Provide the script on stdin. This suits short glue or one-off transformations without a disposable source file. Examples include normalizing several JSON files, combining selected fields from structured files, or validating data before the Agent continues. The exact shell template can vary by Agent host.

When repeated or domain-specific logic deserves a stable API, move its implementation into a Runtime Module and let the Agent author only orchestration code.

pedelec-deno is a supported legacy alias with identical validation and Thread mode:

Terminal window
pedelec-deno --thread-id <thread-id> run scripts/task.ts
printf 'console.log("stdin-ok");' | pedelec-ts-runtime --thread-id <thread-id> run -
printf 'console.log("stdin-ok");' | pedelec-deno --thread-id <thread-id> run -

PowerShell stdin example (works with either command name):

Terminal window
'console.log("stdin-ok");' | pedelec-ts-runtime --thread-id <thread-id> run -

Neither command permits eval, permission flags, or shell syntax inside its argument list. The Thread’s stored mode controls permissions for both file and stdin execution.