Cyber Terminal: Architecture and Manual
We have upgraded the Cyber Terminal to a production-grade “Computational Cockpit”. This update restores IDE context tools, enables user-configurable formatting, and strictly enforces the “Zero Radius” design system globally.
01. Initialization
We are accustomed to two extremes: either a disposable browser console that resets on page refresh, or heavyweight IDEs requiring file creation, environment setup, and dependency installation.
The intermediate link — online sandboxes (CodePen, JSFiddle) — are often overloaded with UI noise, depend on internet speed, and do not provide a sense of control.
Cododel is the answer to the problem of lost context. It is not just a “Playground”. It is a Computational Cockpit for the engineer. A tool for complex calculations, hypothesis testing, and writing algorithms with zero latency.
02. Philosophy: “Complex Calculator”
At the core of the Terminal lies the concept of Reactive Memory.
- Locality: All code runs in an isolated Web Worker directly in your browser. No code sent to the server. Latency is zero.
- Persistence: Your code is saved to local storage (
localStorage) with every keystroke (if Auto-Sync is enabled). You can close the tab, restart the browser, or turn off the computer — upon return, you will continue from the same place. - Session Isolation: Instead of tabs, we use a system of Buffers. Each buffer is an isolated train of thought.
Reactive Memory in Practice
// Example: Reactive Memory in action
const systemName = 'Cododel'
const version = 2.0
const isLive = true
// Math operations show results immediately
const uptime = 1000 * 60 * 60 * 24 // Calculate milliseconds in a day
// → uptime: 86400000 [inline spy]
// Complex data structures persist across sessions
const techStack = {
frontend: 'Astro + React',
styling: 'Tailwind CSS',
theme: 'True Black',
modules: ['Cyber Terminal', 'Bento', 'Void'],
}
// → techStack: {"frontend":"Astro + React","styling":"Tailwind CSS"...} [inline spy]
// Close browser, reopen → all variables and state are preserved
03. Technical Capabilities
A. Smart Network Cache
When developing scripts that work with APIs, the main problem is spamming requests with every code restart.
The Terminal intercepts fetch() calls at the Web Worker level.
How it works:
- Generates a hash key from
[url, options]for each request - If a request was made previously in the session, returns a cloned cached response instantly
- Ensures idempotent-like behavior for rapid re-runs
- Allows iterating on data processing logic (
.map,.filter,.reduce) without waiting for the network
// First execution: real network request
async function fetchSystemStatus() {
const response = await fetch('https://api.example.com/data')
const data = await response.json()
return {
id: data.id,
title: data.title,
latency: '0ms (Cached)',
}
}
// Top-level await is supported out of the box
const apiStatus = await fetchSystemStatus()
// → apiStatus: {"id":1,"title":"...","latency":"0ms (Cached)"} [inline spy]
// Subsequent executions: instant cache hit
// No network delay, iterate on processing logic
const processed = apiStatus
.map((item) => ({ ...item, processed: true }))
.filter((item) => item.active)
.reduce((acc, item) => acc + item.value, 0)
Implementation: The Web Worker maintains a Map cache keyed by JSON.stringify({ url, options }). Responses are cloned before caching to allow multiple reads of the body stream.
B. AST Instrumentation (Inline Spy)
You don’t need to write console.log on every line.
The Terminal analyzes your code (via Abstract Syntax Tree), injects spies, and displays variable values right next to the line of code.
This turns the coding process into a live dialogue with the interpreter.
How it works:
- Parsing: Uses
acornto parse JavaScript into an AST - Traversal: Uses
acorn-walkto traverse the AST and find expressions - Instrumentation: Wraps expressions in
__spy(value, line)function calls - Code Generation: Uses
astringto convert the modified AST back to executable code - Execution: The
__spyfunction acts as a passthrough but reports values to the UI viapostMessage
Transformation Example:
Input:
const numbers = [1, 2, 3, 4, 5]
const doubled = numbers.map((n) => n * 2)
const sum = doubled.reduce((a, b) => a + b, 0)
Output (Internal):
const numbers = __spy([1, 2, 3, 4, 5], 1)
const doubled = __spy(
numbers.map((n) => n * 2),
2,
)
const sum = __spy(
doubled.reduce((a, b) => a + b, 0),
3,
)
Visual Result:
const numbers = [1, 2, 3, 4, 5]
// → numbers: [1, 2, 3, 4, 5] [inline spy]
const doubled = numbers.map((n) => n * 2)
// → doubled: [2, 4, 6, 8, 10] [inline spy]
const sum = doubled.reduce((a, b) => a + b, 0)
// → sum: 30 [inline spy]
Partial Execution Strategy (Error Recovery):
Standard JS engines fail completely on SyntaxError. To provide a debugger-like experience where previous context remains visible:
- Try: Parse and instrument the full code
- Catch (SyntaxError):
- Extract the line number of the error
- Slice the code before that line (Valid Prefix)
- Instrument and run the Valid Prefix (restoring inline values)
- Artificially throw the
SyntaxErrorat the end so the user is still notified
This means syntax errors at the end of the file do not wipe out values from valid preceding lines.
C. Vim Mode & Power Tools
For maximum operator efficiency, we have integrated support for Vim bindings and Prettier formatting. Code must be not only functional but also aesthetically perfect.
Vim Mode:
- Toggle:
[EXEC] -> VIM MODEor[VIEW & SYSTEM]menu - Status: Look for
VIMin the bottom status bar - Commands: Standard Vim keybindings are supported.
:wto save (sync buffer) - Implementation: Powered by
monaco-vimextension for Monaco Editor
Configurable Formatter:
- Access:
[EXEC] -> CONFIG FORMATTER - Persisted: Your configuration is saved to local storage
- Defaults: Sensible defaults for a clean, modern JavaScript style
- Implementation: Prettier with user-configurable JSON interface
04. Visual Language: Cyber Minimal
The system design is dictated by function. We abandoned modern “soft” web trends.
- #000000 (True Black): The only acceptable background for working with code. Reduces eye strain, increases contrast.
- Zero Radius: Rounded corners are decoration. Right angles are a data grid. All interface elements have
border-radius: 0. - Monospace: The
Geist Monofont is used not only in the editor but also in the interface. Data is more important than beauty.
/* Cyber Minimal Design System */
.cyber-terminal {
background: #000000;
border-radius: 0;
font-family: 'Geist Mono', monospace;
color: #ffffff;
border: 1px solid #2663eb; /* Electric Blue */
}
Design Philosophy: Every pixel serves a purpose. No decorative elements. No rounded corners. No gradients. Pure function over form. The interface disappears, leaving only the code and its execution results.
05. Usage Protocol
Keyboard Shortcuts
CMD + ENTER— Forced execution (if auto-run is disabled).CMD + S— Forced buffer synchronization.- F1 — Command Palette (access to theme switching, settings).
- F2 — Safe Rename Symbol.
Workflow Example
// [01] INSTANT FEEDBACK
// Modify these values and watch the right column update instantly.
const systemName = 'Cododel'
const version = 2.0
const isLive = true
// [02] COMPLEX DATA STRUCTURES
// Objects and Arrays are collapsed for readability but visible.
const techStack = {
frontend: 'Astro + React',
styling: 'Tailwind CSS',
theme: 'True Black',
modules: ['Cyber Terminal', 'Bento', 'Void'],
}
// [03] ASYNC & NETWORK (Smart Cache)
// We intercept fetch() requests. If the URL hasn't changed,
// we return a cached response instantly. No more waiting.
console.log('>>> Initiating Network Request...')
async function fetchSystemStatus() {
const response = await fetch('https://jsonplaceholder.typicode.com/todos/1')
const data = await response.json()
return {
id: data.id,
title: data.title,
latency: '0ms (Cached)',
}
}
// Top-level await is supported out of the box
const apiStatus = await fetchSystemStatus()
// [04] ALGORITHMS & LOGIC
// Standard logic works as expected.
const fibonacci = (n) => {
if (n <= 1) return n
return fibonacci(n - 1) + fibonacci(n - 2)
}
const sequenceResult = fibonacci(10)
06. v2.0 Updates
Smart Cache & Context Menu
The context menu has been restored and restyled to match the Cyber Minimal aesthetic. It is now black, square, and strictly utilitarian. Provides IDE-like context actions for code navigation and manipulation.
Configurable Formatter
Code formatting is now powered by Prettier with a user-configurable JSON interface.
- Access:
[EXEC] -> CONFIG FORMATTER - Persisted: Your configuration is saved to local storage
- Defaults: Sensible defaults for a clean, modern JavaScript style
Zero Radius Design System
We have enforced a strict “Zero Radius” policy across the entire platform. No rounded corners. Everything is sharp, precise, and digital. This extends beyond the Terminal to all UI components globally.
Technical Notes
Architecture:
- Execution Environment: Isolated Web Worker (prevents main thread blocking)
- Code Instrumentation: AST-based transformation using
acorn,acorn-walk,astring - Caching Strategy: In-memory Map cache for fetch requests (session-scoped)
- Storage: LocalStorage for buffer persistence and configuration
Dependencies:
monaco-vim— Vim keybindings for Monaco Editorprettier— Code formatting engineacorn— JavaScript parseracorn-walk— AST traversal utilitiesastring— Code generation from AST
Theme:
- Cyber Void (Custom Monaco Theme) — True black background with Electric Blue accents
Comparison with Industry Tools:
| Feature | Quokka.js | Cyber Terminal |
|---|---|---|
| Inline Values | ✅ Yes | ✅ Yes (via __spy) |
| Live Coverage | ✅ Yes (Gutter) | ❌ No (Visual only via values) |
| Value Explorer | ✅ Tree View | ⚠️ Basic JSON stringify |
| Heap Snapshots | ❌ No (Node process) | ❌ No (Browser limitation) |
| Memoization | ❌ (Manual config) | ✅ Auto Fetch Caching |
| Top-level await | ✅ Yes | ✅ Yes |
| Browser-native | ❌ No | ✅ Yes (Web Worker) |
System ready for operation.
[STATUS: ONLINE]