Repository navigation
apps desktop console
Active contributors: ferdiiskandar
The desktop console is the MyPrompt Electron application. It presents a terminal-style transcript where the user types an idea and receives a compiled Coding Brief or Super Prompt, watches the response stream in, and runs Transform, Evaluator, library, workspace, benchmark, and billing commands. The shell owns provider keys, the desktop session, and the local workspace store.
desktop/
bootstrap.ts entry: module alias shim + userData override
main.ts Electron main: env load, window, shell state, telemetry, grid fit
preload.ts context-isolated bridge (window.sentraDesktop)
ipc/ command routers (core, auth, workspace, library, provider-keys, ...)
renderer/
index.html
renderer.ts terminal console: parsing, rendering, streaming (~3,400 lines)
strings.ts import-free string table
| Abstraction | Role | Source |
|---|---|---|
bootstrap.ts |
Rewrites @/ imports to dist-electron, sets userData before main.ts loads |
desktop/bootstrap.ts |
main.ts |
Reads env, builds shell state and badges, sizes the frameless window, serves system:stats
|
desktop/main.ts |
preload.ts |
Exposes window.sentraDesktop with invoke, onStream, offStream, auth and workspace helpers |
desktop/preload.ts |
renderer.ts |
Parses input, runs commands, renders the transcript, decodes Optimizer streams | desktop/renderer/renderer.ts |
desktop:command envelope |
{ command, payload, accessToken } handled by registerCoreIpc
|
desktop/ipc/core.ts |
The window is frameless (frame: false). On Windows it is opaque in the console colour so ClearType sub-pixel antialiasing survives; elsewhere it is transparent so the CSS radius and shadow show. The window is sized in character columns and rows, not pixels: the renderer measures one monospace cell and reports it over window:fit-grid; main.ts converts columns × cell width plus padding into content size. The target floor is 80 × 20, applied on every launch, and the grid fit runs once per persisted-state version.
The renderer accepts two input shapes. Bare commands (brief, super, transform, lane, profile, effort, log, key, stat, mode, copy, clear, help, quit) are handled locally or dispatched as engine calls. Slash commands (/evaluate, /library, /draft, /benchmark, /templates, /provider, /usage, /subscription, /auth) map to the DesktopCommandId catalog. Text that is neither is treated as a prompt.
Despatch runs through one path. The renderer builds a DesktopInvocation, calls window.sentraDesktop.invoke('desktop:command', envelope), and the main-process router in core.ts resolves the command. Transform is pure and runs directly. Optimizer and Evaluator check the desktop session: a signed-in user gets tier quota, model access, and a stored provider key; a guest falls back to resolveGuestProvider and the environment key. optimize:run is special: the router starts streamOptimizeCommand in the background and returns { status: 'started', requestId }, then pushes optimize:status, optimize:chunk, optimize:done, and optimize:error events back over the preload bridge.
flowchart LR
R[renderer.ts input] --> P[preload invoke]
P --> E[desktop:command router core.ts]
E -->|transform:run| T[lib/transform/engine.ts]
E -->|optimize:run| S[streamOptimizeCommand]
E -->|evaluate:run| V[lib/evaluator/engine.ts]
S --> C[lib/optimizer/engine.ts]
C -->|status/chunk/done/error| P
P --> R
- Provider registry and readiness drive the model chip and badges in
app:get-shell-state; see LLM providers. - Workspace drafts, recent runs, and benchmarks live in
desktop/ipc/workspace-store.ts; see Workspace and library. - Provider keys and subscriptions route through
desktop/ipc/provider-keys.tsanddesktop/ipc/subscription.ts.
Add a command by extending DesktopCommandId and COMMAND_CATALOG in renderer.ts, then handling the id in handleDesktopCommand in core.ts. Add a shell field by widening the app:get-shell-state payload in main.ts and the DesktopShellState type in renderer.ts. Keep strings.ts import-free.
| File | Purpose |
|---|---|
desktop/bootstrap.ts |
Module alias shim and userData override |
desktop/main.ts |
Window, shell state, telemetry, grid fit |
desktop/preload.ts |
Context-isolated bridge |
desktop/ipc/core.ts |
desktop:command router and Optimizer streaming |
desktop/renderer/renderer.ts |
Terminal console |
desktop/renderer/strings.ts |
String table |
Open-source prompt engineering and multi-LLM tooling by Sentra Artificial Intelligence.
MyPrompt develops practical approaches to prompt engineering, multi-LLM optimisation, reusable prompt systems, and AI-native workflows — with an emphasis on structured, interoperable, and real-world AI use.
Built in Indonesia as part of the Sentra Artificial Intelligence ecosystem.
Sentra Artificial Intelligence · Source Repository · Official Website
Dr Ferdi Iskandar — Creator & Maintainer
LinkedIn ·
ORCID ·
Hugging Face ·
Kaggle ·
Medium ·
Substack ·
X ·
Threads
MyPrompt · Sentra Artificial Intelligence · Indonesia