Documentation Index

Fetch the complete documentation index at: https://help.mozenda.com/llms.txt

Use this file to discover all available pages before exploring further.

Zenda AI Assistant in JS Editor

Prev Next

Overview

The Zenda Assistant is a new, AI-powered conversational interface built directly into the Mozenda Agent Builder's JavaScript editor. Designed to streamline the process of writing, refactoring, and understanding code, the assistant acts as a copilot for users configuring JavaScript actions.

Image

Benefits and Main Features

Context-Aware Code Generation: The tool automatically reads the code in the editor as context. If you highlight a specific snippet, the AI will only send that selected block to the model. If nothing is selected, it sends the entire script

Mozenda API Integration: The AI has been specifically trained on Mozenda's native functionality. It knows how to write and format internal functions such as M_GetFieldValue, M_SetFieldValues, M_StopWithError, and M_StopWaiting.

Code Explanation: Users can ask the assistant to "Please explain the code" to generate a plain-text summary of what a specific script is doing. This is particularly useful for reverse-engineering convoluted code or understanding an agent built by another user.

Refactoring & Commenting: The assistant can refactor existing JavaScript to make it simpler, as well as automatically inject inline comments into the code to improve readability.

Targeted Insertion Options: Once code is generated, you can seamlessly push it into the editor. Options include replacing the entire script, replacing only the selected snippet, or appending the new function to the end of the existing code.

**Free-text Responses: **The assistant is capable of returning conversational free-text responses and explanations, meaning it does not force every response into a rigid code block.

Image

Step by Step Guide

Open the Mozenda Agent Builder and navigate to an Agent.

Add or open a Run JavaScript action step.

Locate the Zenda Assistant collapsible side panel on the right side of the editor.

To ask a general question or generate a new function, type your prompt in the chat box (e.g., "Create a fetch function with parameters") and submit.

To modify existing code, highlight the specific lines in the editor, type your request (e.g., "Add comments here"), and submit.

Review the generated code block in the chat panel.

Click Replace All, Replace Selected, or Append to End to insert the AI-generated code directly into your active workspace.

Save your JavaScript action.

User Interface & Workflow

Collapsible Side Panel: The assistant is housed in a newly designed collapsible side panel located right next to the JavaScript editor.

**Context-Aware Selection: **The tool automatically reads the code in the editor as context. If the user highlights a specific snippet of code on the left-hand side, the AI will only send that selected snippet to the model. If nothing is selected, it will send the entire script as context.

Image

Code Insertion Options: Once the AI generates code, the user is presented with options to safely push it into the editor. You can choose to "Replace" the entire script/selected snippet or use the "Append" option to drop the new function at the end of the existing code.

Image

Session-Based Chat History: The assistant remembers the conversation history so you can iterate on requests. This history is stored both on the backend and locally in the browser/Agent Builder. History is isolated per JavaScript action. However, the chat memory is reset completely whenever the overall Agent Builder session is closed and reopened.