A comprehensive, production-grade technical manual and operational guide for the modular web terminal toolset. This document provides step-by-step breakdowns, architecture blueprints, syntax rules, execution pipelines, and error handling for all registered tools.
The system operates as an interactive, multi-context web terminal. Each tool registers into a central command registry using registerTool() and controls context transitions through setMode().
┌─────────────────────────────────────────────────────────────────────────────────┐
│ CENTRAL TERMINAL RUNTIME │
│ (main.js) │
└───────┬───────────────┬─────────────────┬────────────────┬──────────────────────┘
│ │ │ │
▼ ▼ ▼ ▼ ▼
┌──────────────┐ ┌──────────────┐ ┌───────────────┐ ┌──────────────┐ ┌──────────────────┐
│ bhagvad │ │ bible │ │ calculator │ │ cat │ │ github │
└──────────────┘ └──────────────┘ └───────────────┘ └──────────────┘ └──────────────────┘
The Bhagavad Geeta Reader allows users to explore chapters and individual shloks (verses) from the Bhagavad Gita along with transliterations, translations, and commentaries by authorized scholars.
- Tool Keyword:
bhagvad - Default Prompt Context:
${username}/bhagvad/geeta>orbhagvad/geeta> - Upstream Data API:
https://vedicscriptures.github.io/slok/${chapter}/${shlok}
- Command:
bhagvad(invoked from main prompt) - Description: Enters the Bhagavad Geeta interactive sub-terminal mode.
- Step-by-Step Execution Flow:
onEnter()lifecycle hook is triggered by the terminal runtime.- Resolves the active user identity from
localStorage.getItem('github_username')(defaults to'guest'if null). - Updates prompt context via
setMode('bhagvad', getGeetaPrompt()). - Displays system initialization headers and usage instructions.
- Command Syntax:
[chapter]/[shlok](e.g.,1/1,2/47,18/66) - Description: Queries and renders a specific verse including original Sanskrit text, Roman transliteration, and filtered commentary.
- Step-by-Step Execution Flow:
- Input Normalization: Trims whitespace and extracts the command string.
- Sub-string Filter: Bypasses processing if input equals root keywords like
'geeta','bhagvad', or trailing slash variations. - Format Validation: Splits input by
/. Validates that exactly two numeric components exist using the regex/^\d+$/. - API Request: Performs an asynchronous
fetch()request tohttps://vedicscriptures.github.io/slok/${chapter}/${shlok}. - Payload Validation: Verifies HTTP response status (
res.ok) and confirms presence ofdata.slok. - Text Formatting Engine:
- Applies
cleanWrap()to format Sanskrit text and transliteration into clean, fixed-width blocks (max 74 characters wide) with uniform line indentation. - Applies
chunkAndWrap()to split long commentaries into continuous two-sentence readable paragraphs wrapped at 70 characters.
- Applies
- Scholar Filter Pipeline: Iterates through response keys and filters commentaries to display only authorized authors:
- Swami Adidevananda
- Shri Purohit Swami
- A.C. Bhaktivedanta Swami Prabhupada
- Terminal Render: Outputs structured ASCII banners separating original verse, transliteration, and author commentaries.
- Command:
help - Description: Outputs command maps and usage examples for the Bhagavad Geeta reader.
- Step-by-Step Execution Flow:
- Input is lowercased and matched against
'help'. - Invokes
printGeetaHelp(), which outputs formatted help lines to the terminal.
- Input is lowercased and matched against
- Command:
exit - Description: Leaves the Bhagavad Geeta sub-terminal and returns to the root context.
- Step-by-Step Execution Flow:
- Input matched against
'exit'. - Calls
setMode('main', getSystemPrompt())to reset the terminal prompt.
- Input matched against
The Holy Bible Reader enables fetching specific verses across various translations and books using a structured book/chapter:verse query format.
- Tool Keyword:
bible - Default Prompt Context:
${username}/bible>orbible> - Upstream Data API:
https://bible-api.com/${encodedBook}+${chapter}:${verse}
- Command:
bible - Description: Switches session context to the Bible Reader mode.
- Step-by-Step Execution Flow:
- Executes
onEnter()hook. - Fetches
github_usernamefrom local storage to generate the interactive prompt string. - Sets active mode using
setMode('bible', getBiblePrompt()). - Displays welcome banner and command help hints.
- Executes
- Command Syntax:
[book]/[chapter]:[verse](e.g.,john/3:16,genesis/1:1,psalms/23:1) - Description: Fetches and renders scripture text based on book name, chapter number, and verse number.
- Step-by-Step Execution Flow:
- Input Trimming & Guards: Trims leading/trailing whitespace. Ignores empty strings or standalone mode keywords (
'bible','scripture'). - Primary Split: Splits input string across the
/character intobookandchapter:versestring segments. - Secondary Partition: Splits the second segment across the
:character to isolatechapterandversenumbers. - Syntax Validation: Validates that both chapter and verse match numeric pattern
/^\d+$/. - URL Encoding: Encodes the book name using
encodeURIComponent()to safely handle multi-word books (e.g., "1 john"). - Network Request: Issues an HTTP GET request to
https://bible-api.com/${encodedBook}+${chapter}:${verse}. - Error Verification: Evaluates standard HTTP errors (e.g., 404 for invalid references) and gracefully logs status failures.
- Text Formatting & Rendering:
- Extracts reference string (
data.reference) and scripture passage (data.text). - Runs text through
cleanWrap()to ensure lines do not exceed 74 characters. - Renders scripture content inside an ASCII double-line border box.
- Extracts reference string (
- Input Trimming & Guards: Trims leading/trailing whitespace. Ignores empty strings or standalone mode keywords (
- Command:
help - Description: Prints interactive operational guide.
- Command:
exit - Description: Leaves Bible Reader context and restores primary system prompt.
A full scientific calculator emulator replicating the operations of the Casio fx-570ES Plus engineering calculator. Supports complex numbers, multi-base conversions, numerical calculus, matrix arithmetic, vector space operations, linear system solvers, statistical regression, and functional table generation.
- Prompt Context:
calc> - Storage Persistence:
calc_variables: Stores system registers (A,B,C,D,X,Y,M,ANS) as complex structure objects{ re: Number, im: Number }.calculator: Caches terminal input/output history buffers inlocalStorage.
- Syntax:
REGISTER = expression(e.g.,X = 5 * pi,A = 3 + 4i,B = sqrt(-16)) - Supported Registers:
A,B,C,D,X,Y,M,ANS - Step-by-Step Execution:
- Intercepts inputs matching pattern
/^([A-Za-z_][A-Za-z0-9_]*)\s*=\s*(.*)$/. - Verifies register name against system registers.
- Tokenizes and evaluates the right-hand expression using
parseAndEvaluate(). - Stores complex result
{ re, im }into variable register table and syncs tolocalStorage.
- Intercepts inputs matching pattern
-
Syntax Examples:
-
(2 + 3i) * (1 - 2i)-> Evaluates to8 - i -
sqrt(-4)-> Evaluates to2i -
i^i-> Evaluates to0.2078795764($e^{-\pi/2}$ ) -
pol(3, 4)-> Transforms rectangular coordinates$(3, 4)$ into polar representation ($r\angle\theta\text{ rad}$ )
-
-
Mathematical Operations:
- Complex Addition/Subtraction:
$(a + bi) \pm (c + di) = (a \pm c) + (b \pm d)i$ - Complex Multiplication:
$(a + bi)(c + di) = (ac - bd) + (ad + bc)i$ - Complex Division:
$\frac{a + bi}{c + di} = \frac{(ac + bd) + (bc - ad)i}{c^2 + d^2}$ - Complex Exponentiation:
$a^b = e^{b \ln(a)}$ where$\ln(z) = \ln|z| + i \arg(z)$
- Complex Addition/Subtraction:
-
Commands:
-
base:bin(expr): Evaluates expression and outputs 32-bit unsigned binary (0b...). -
base:hex(expr): Evaluates expression and outputs hexadecimal (0x...). -
base:oct(expr): Evaluates expression and outputs octal (0o...). -
base:dec(expr): Evaluates expression and outputs decimal integer string. -
base:and(valA, valB): Performs bitwise AND ($A \land B$ ). -
base:or(valA, valB): Performs bitwise OR ($A \lor B$ ). -
base:xor(valA, valB): Performs bitwise XOR ($A \oplus B$ ). -
base:not(val): Performs bitwise NOT ($\sim A$ ).
-
-
Step-by-Step Execution:
- Identifies
base:prefix. - Parses inner arguments and evaluates expression scalar real component.
- Truncates value to integer using
Math.floor(). - Performs bitwise shift/operation (
>>> 0for unsigned representations) and prints formatted string.
- Identifies
-
Syntax:
solve:quadratic(a, b, c) -
Mathematical Algorithm: Solves
$ax^2 + bx + c = 0$ using the quadratic formula:
-
Step-by-Step Execution:
- Extracts
$a, b, c$ values. - Computes discriminant
$\Delta = b^2 - 4ac$ . - If
$\Delta \ge 0$ , computes two real roots. - If
$\Delta < 0$ , computes complex conjugate pair$x = -\frac{b}{2a} \pm \frac{\sqrt{-\Delta}}{2a}i$ .
- Extracts
- 2x2 Linear Solver Syntax:
solve:linear([[a1,b1,c1], [a2,b2,c2]])- Solves system:
-
Applies Cramer's Rule:
$D = a_1 b_2 - b_1 a_2$ ,$X = \frac{c_1 b_2 - b_1 c_2}{D}$ ,$Y = \frac{a_1 c_2 - c_1 a_2}{D}$ . -
3x3 Linear Solver Syntax:
solve:linear([[a1,b1,c1,d1], [a2,b2,c2,d2], [a3,b3,c3,d3]])- Solves 3D spatial vector intersection system using 3x3 Cramer's Rule determinants.
-
Syntax:
table(algebraic_expression, start_X, end_X, incremental_step) -
Example:
table(X^2 + 1, 1, 3, 0.5) -
Step-by-Step Execution:
- Parses algebraic expression containing independent variable
X. - Evaluates start, end, and step scalar values.
- Loops
$x$ fromstart_Xtoend_Xincrementing byincremental_step. - Evaluates
$f(x)$ dynamically passing custom$X$ value context to the parser. - Renders formatted ASCII table grid.
- Parses algebraic expression containing independent variable
-
Descriptive Summary Syntax:
stat:summary([x1, x2, x3...])- Computes count (
$n$ ), mean ($\bar{x}$ ), sample standard deviation ($s$ ), minimum, and maximum.
- Computes count (
-
Linear Regression Syntax:
stat:reg([[x1, y1], [x2, y2]...])- Fits coordinate pairs to linear trendline
$Y = mX + b$ using least-squares formulas:
- Fits coordinate pairs to linear trendline
-
Numerical Differentiation:
-
Syntax:
diff(expression, target_value)(e.g.,diff(X^3, 2)) -
Algorithm: Central finite difference method with step size
$h = 10^{-5}$ :
-
Syntax:
-
Numerical Definite Integration:
-
Syntax:
int(expression, start, end)(e.g.,int(X^2, 0, 3)) -
Algorithm: Composite Simpson's
$1/3$ Rule over$N = 1000$ sub-intervals:
-
Syntax:
| Command Category | Command Syntax | Description & Operation |
| : | : | : |
| Matrix Determinant | mat:det([[a,b],[c,d]]) | Computes mat:inv([[a,b],[c,d]]) | Computes inverted matrix mat:add(matA, matB) | Performs element-wise sum mat:mul(matA, matB) | Computes matrix product vec:mag([x, y, z]) | Calculates Euclidean length vec:dot(vA, vB) | Computes scalar product vec:cross(vA, vB) | Computes 3D vector cross product
Provides access to random cat facts and paginated cat breed information using the CatFact Ninja API.
- Tool Keyword:
cat - Default Prompt Context:
cat> - Upstream Data API:
https://catfact.ninja
- Command:
cat - Step-by-Step Execution Flow:
- Triggers
onEnter()lifecycle event. - Displays system banner instructing user on valid subcommand formats.
- Triggers
- Command Syntax:
randomorcat/random - Step-by-Step Execution:
- Trims input and strips optional
cat/prefix. - Issues asynchronous GET request to
https://catfact.ninja/fact. - Parses JSON payload response object.
- Renders string value from
data.factkey.
- Trims input and strips optional
- Command Syntax:
breedsorbreeds/2orcat/breeds/3 - Step-by-Step Execution:
- Normalizes command string and extracts target page parameter (defaults to page
1if omitted). - Queries
https://catfact.ninja/breeds?page=${page}. - Iterates over returned array
data.data. - Renders each entry displaying breed name (
item.breed) and country of origin (item.country).
- Normalizes command string and extracts target page parameter (defaults to page
- Exits
cat>mode prompt.
A full virtual filesystem interface and cloud sync manager integrated with the official GitHub REST API. Supports remote workspace navigation, file editing, buffer management, repository provisioning, interactive deletions/renames, issue tracking, and sandbox application rendering.
-
Context Prompt:
${username}/github${repository}${path}> -
State Registers:
-
localStorage['user']: Stores GitHub Personal Access Authorization Token. -
localStorage['github_username']: Stores active GitHub account user handle. -
localStorage['repository']: Stores currently bound active workspace repository. -
fileBuffers: In-memory volatile dictionary caching active local file modifications. -
virtualDirectories: Set tracking locally created directory paths.
-
To prevent accidental data loss, structural modifications (deletion, renaming, visibility adjustments) trigger interactive confirmation states that pause routine command parsing.
┌────────────────────────────────────────────────────────┐
│ COMMAND ISSUED BY USER │
│ (e.g., delete/app.js or rename/old) │
└───────────────────────────┬────────────────────────────┘
│
▼
┌────────────────────────────────────────────────────────┐
│ SET INTERACTIVE STATE REGISTERS │
│ (pendingDeleteTarget, pendingRenameTarget) │
└───────────────────────────┬────────────────────────────┘
│
▼
┌────────────────────────────────────────────────────────┐
│ PROMPT MODIFIED TO: "> " │
│ Awaits administrative confirmation [Yes/no] │
└───────────────────────────┬────────────────────────────┘
│
┌───────────────┴───────────────┐
▼ ▼
User responds "Yes" User responds "No"
│ │
▼ ▼
Execute GitHub API operation Abort action sequence
Reset prompt mode context Reset prompt mode context
- Description: Descends into a sub-directory node within the workspace.
- Step-by-Step Execution:
- If no repository is active, verifies remote repository existence via
verifyRemotePath(targetRepo, ''). Sets active repository on success. - If inside a repository, checks directory existence via GitHub API (
/contents/${path}). - Appends directory segment to
currentPathand updates prompt.
- If no repository is active, verifies remote repository existence via
- Description: Pulls and displays a read-only preview of a target file.
- Step-by-Step Execution:
- Detects
.in target string. - Checks for cached version in
fileBuffers. - If missing, calls
pullFileFromGitHub(fullPath)to retrieve content. - Renders file text directly to console between ASCII boundaries.
- Detects
- Description: Ascends upward to parent directory or unbinds repository if at root level.
- Description: Instantly unbinds active repository and resets working directory to root GitHub workspace context.
- Description: Lists all repositories under the logged-in GitHub account when no repository is bound.
- Step-by-Step Execution:
- Fetches repository array from
https://api.github.com/user/repos?per_page=100&sort=updated. - Renders list indicating repository name and privacy status (
(private)).
- Fetches repository array from
- Description: Fetches remote directory contents.
- Step-by-Step Execution:
- Issues GET request to repository contents endpoint
/contents/${path}. - Renders subdirectories (
-- dir/) and files (-- file.ext). - Populates local
virtualDirectoriesandfileBufferscaches.
- Issues GET request to repository contents endpoint
- Description: Downloads and displays full raw file contents.
-
Syntax Examples:
-
create/my-new-repo(when no repo bound): Provisions a new private GitHub repository. -
create/index.html: Allocates a new file in active workspace. -
create/components: Creates a virtual directory with a.gitkeepplaceholder file.
-
-
Step-by-Step Execution (File Creation):
- Parses file extension against allowed format list (
VALID_EXTENSIONS). - Initializes local entry in
fileBuffers[target]. - Converts payload content string to UTF-8 base64 encoding.
- Issues HTTP
PUTrequest to/repos/${user}/${repo}/contents/${path}.
- Parses file extension against allowed format list (
- Description: Opens the target file in the universal plaintext editor.
- Step-by-Step Execution:
- Pulls remote contents from GitHub if not already cached in local memory.
- Splits text into line arrays stored in
fileBuffers[target]. - Switches mode to
editor.
- Description: Force-refreshes local workspace memory buffer with remote content from GitHub.
- Description: Serializes local line buffer and commits/pushes changes to GitHub.
- Step-by-Step Execution:
- Reads line buffer array from
fileBuffers[target]and joins with. - Encodes binary text string into Base64 format.
- Fetches target SHA hash from GitHub to determine if operation is an update or creation.
- Issues HTTP
PUTrequest with updated commit message and Base64 body.
- Reads line buffer array from
- Description: Triggers interactive deletion sequence for files, directories, or entire repositories.
- Step-by-Step Execution:
- Sets
pendingDeleteTargetandpendingDeleteType(repository,file, ordirectory). - Prompts user:
Are you sure you want to delete the [type] '[target]', [Yes/no]? - On user confirmation (
yes/y):- Repository: Unbinds local context and clears path state.
- File: Obtains file SHA hash via GET request, then issues HTTP
DELETEpayload request. - Directory: Executes recursive deletion by listing directory tree nodes and deleting each child file.
- Sets
- Description: Interactively renames a file, directory, or repository.
- Step-by-Step Execution (File Rename):
- Prompts for new file name and validates target extension.
- Reads source file content.
- Pushes file content to new path location (
pushFileToGitHub). - On successful creation, deletes original file node (
deletePathFromGitHub).
- Description: Packages workspace files and launches an isolated visual rendering tab in the browser.
- Step-by-Step Execution:
- Retrieves file text buffer from
fileBuffers[target]. - Base64 encodes content payload using
btoa(unescape(encodeURIComponent(code))). - Constructs sandbox HTML wrapper document:
- HTML Files (
.html): Wraps content inside a sandboxed<iframe>enforcing Content Security Policy (script-src 'none'). - Other Text Files: Wraps content in styled terminal preview code block.
- HTML Files (
- Generates dynamic Blob URL via
URL.createObjectURL(blob)and opens it in a new browser tab (window.open).
- Retrieves file text buffer from
| Command Syntax | Operation & Execution Flow |
| : | : |
| issues | Queries https://api.github.com/repos/.../issues?state=all. Renders list with state indicators (++ for open, -- for closed). |
| issues/[number_or_title] | Fetches detailed view for specific issue including body, author, and timestamp metadata. |
| issues/close/[number] | Sends PATCH request setting issue state to 'closed'. |
| issues/reopen/[number] | Sends PATCH request setting issue state to 'open'. |
| issues/comment/[num]/"msg" | Sends POST request to create a new comment on target issue. |
| issues/fixed/[num]/"msg" | Posts comment to target issue, then sends PATCH request marking it closed. |
- Renders settings command menu.
- Interactively prompts user and sends PATCH request updating repository
nameattribute.
- Sends PATCH request setting default repository branch (
default_branch).
- Issues DELETE request to
/interaction-limitsendpoint to remove interaction restrictions.
- Issues PUT request to
/interaction-limitssetting access restriction tocollaborators_onlyfor six months.
- Checks for
.github/FUNDING.ymlconfiguration and toggles funding file presence.
- Interactively prompts user, then sends PATCH request setting
private: true/false.
===================================================================================================
TOOL CONTEXT COMMAND SYNTAX DESCRIPTION / FUNCTION
===================================================================================================
bhagvad [chapter]/[shlok] Fetch Gita verse, transliteration & commentary
bhagvad help Display Gita command help menu
bhagvad exit Return to primary prompt
bible [book]/[chapter]:[verse] Fetch Bible passage by reference
bible help Display Bible command help menu
bible exit Return to primary prompt
calculator REGISTER = [expression] Assign expression result to register (A,B,C,X,Y,M)
calculator base:[bin|hex|oct|dec](expr) Evaluate expression in specified number base
calculator base:[and|or|xor](A, B) Bitwise binary operation between two values
calculator solve:quadratic(a, b, c) Solve quadratic polynomial roots
calculator solve:linear([matrix]) Solve 2x2 or 3x3 linear system via Cramer's Rule
calculator table(expr, start, end, step) Generate functional value trace grid
calculator stat:summary([data_array]) Compute mean, std dev, min, max summary
calculator stat:reg([[x1,y1], [x2,y2]]) Compute linear regression equation Y = mX + b
calculator diff(expr, value) Compute central difference numerical derivative
calculator int(expr, start, end) Compute definite integral via Simpson's Rule
calculator mat:[det|inv|add|mul](...) Matrix determinant, inverse, sum, or product
calculator vec:[mag|dot|cross](...) Vector length, dot product, or cross product
cat random Fetch random cat fact
cat breeds/[page_number] List cat breeds by catalog page
github github Enter GitHub workspace context mode
github fletch List user repositories or directory tree
github cd [dir|file|..] Navigate directory tree or preview file
github create/[target] Create repository, workspace file, or folder
github edit/[file_name] Open plaintext file editor
github save/[file_name] Commit and push local memory buffer to GitHub
github pull/[file_name] Refresh local buffer with remote GitHub content
github delete/[target] Interactively purge file, folder, or repo
github rename/[target] Interactively rename file, folder, or repo
github run/[file_name] Launch isolated sandbox visualizer tab
github issues List repository issues
github issues/fixed/[num]/"msg" Post comment and close issue
github settings/[action] Configure repository branch, visibility, etc.
github exit / [username]/ Unbind repository / exit workspace
===================================================================================================
| System Module | Error Condition / Log Message | Root Cause | Resolution Sequence |
|---|---|---|---|
| Bhagavad Geeta | error: invalid format. please use chapter/shlok |
Command string contains invalid parameters or non-numeric inputs. | Format as [chapter]/[shlok] using valid digits (e.g., 2/47). |
| Bhagavad Geeta | error: unable to retrieve chapter... status 404 |
Requested chapter or verse does not exist in the payload. | Verify parameters match bounds (18 chapters, valid verse count per chapter). |
| Bible Reader | error: invalid format. please use book/chapter:verse |
Missing colon (:) or missing chapter/verse segment. |
Format passage reference as [book]/[chapter]:[verse] (e.g., john/3:16). |
| Calculator | division by zero complex boundaries |
Attempted division where denominator magnitude equals zero ( |
Check input expression limits and complex boundary values. |
| Calculator | quadratic systems require exactly three scalar coefficient variables |
solve:quadratic() received an incorrect number of coefficients. |
Provide exactly three numeric coefficients: solve:quadratic(a, b, c). |
| GitHub | error: authentication token signature missing |
Authorization token is missing from local storage key 'user'. |
Authenticate by saving a valid GitHub token in login settings. |
| GitHub | error: layout configuration rejected. extension... breaks systemic syntax rule maps |
Target file extension is not listed in VALID_EXTENSIONS. |
Save or rename the file using a supported plaintext format extension. |