Context MenuSAFE
An open-source, AI-integrated, cross-platform terminal for seamless workflows
Overview
An open-source, AI-integrated, cross-platform terminal for seamless workflows
63907843412fOBSERVED · 2026-10-03What it tells the agent
The instruction file, verbatim from the audited commit — this is the text the model reads, and the surface the audit's instruction layer examines. Quoted here so you can judge it without cloning anything.
---
name: context-menu
description: Guide for creating and displaying context menus in Wave Terminal. Use when implementing right-click menus, adding context menu items, creating submenus, or handling menu interactions with checkboxes and separators.
---
# Context Menu Quick Reference
This guide provides a quick overview of how to create and display a context menu using our system.
---
## ContextMenuItem Type
Define each menu item using the `ContextMenuItem` type:
```ts
type ContextMenuItem = {
label?: string;
type?: "separator" | "normal" | "submenu" | "checkbox" | "radio";
role?: string; // Electron role (optional)
click?: () => void; // Callback for item selection (not needed if role is set)
submenu?: ContextMenuItem[]; // For nested menus
checked?: boolean; // For checkbox or radio items
visible?: boolean;
enabled?: boolean;
sublabel?: string;
};
```
---
## Import and Show the Menu
Import the context menu module:
```ts
import { ContextMenuModel } from "@/app/store/contextmenu";
```
To display the context menu, call:
```ts
ContextMenuModel.getInstance().showContextMenu(menu, event);
```
- **menu**: An array of `ContextMenuItem`.
- **event**: The mouse event that triggered the context menu (typically from an onContextMenu handler).
---
## Basic Example
A simple context menu with a separator:
```ts
const menu: ContextMenuItem[] = [
{
label: "New File",
click: () => {
/* create a new file */
},
},
{
label: "New Folder",
click: () => {
/* create a new folder */
},
},
{ type: "separator" },
{
label: "Rename",
click: () => {
/* rename item */
},
},
];
ContextMenuModel.getInstance().showContextMenu(menu, e);
```
---
## Example with Submenu and Checkboxes
Toggle settings using a submenu with checkbox items:
```ts
const isClearOnStart = true; // Example setting
const menu: ContextMenuItem[] = [
{
label: "Clear Output On Restart",
submenu: [
{
label: "On",
type: "checkbox",
checked: isClearOnStart,
click: () => {
// Set the config to enable clear on restart
},
},
{
label: "Off",
type: "checkbox",
checked: !isClearOnStart,
click: () => {
// Set the config to disable clear on restart
},
},
],
},
];
ContextMenuModel.getInstance().showContextMenu(menu, e);
```
---
## Editing a Config File Example
Open a configuration file (e.g., `widgets.json`) in preview mode:
```ts
{
label: "Edit widgets.json",
click: () => {
fireAndForget(async () => {
const path = `${getApi().getConfigDir()}/widgets.json`;
const blockDef: BlockDef = {
meta: { view: "preview", file: path },
};
await createBlock(blockDef, false, true);
});
},
}
```
---
## Summary
- **Menu Definition**: Use the `ContextMenuItem` type.
- **Actions**: Use `click` for actions; use `submenu` for nested options.
- **Separators**: Use `type: "separator"` to group items.
- **Toggles**: Use `type: "checkbox"` or `"radio"` with the `checked` property.
- **Displaying**: Use `ContextMenuModel.getInstance().showContextMenu(menu, event)` to render the menu.
## Common Use Cases
### File/Folder Operations
Context menus are commonly used for file operations like creating, renaming, and deleting files or folders.
### Settings Toggles
Use checkbox menu items to toggle settings on and off, with the `checked` property reflecting the current state.
### Nested Options
Use `submenu` to organize related options hierarchically, keeping the top-level menu clean and organized.
### Conditional Items
Use the `visible` and `enabled` properties to dynamically show or disable menu items based on the current state.Trust audit
SAFEgrade B · trust 89/100 Nothing in the source contradicts what it says it does. Grade A is reserved for packages that have also passed the behavioural sandbox.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | NA |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | PASS |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- none-observed
- Network
- none-observed
- Shell
- none-observed
- Dependencies
- pinned
- Secrets in source
- none-found
Findings (0)
No findings outside the package's declared scope.
Gates applied: no_behavioural_pass.
63907843412ffull audit observations/trust-audit/skill/wavetermdev__context-menu.json · Report an issue / request a re-scanAudit history
Every audit this skill has had.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-03 | 63907843412f | SAFE | B | 89 | first audit |
Questions
What does the Context Menu skill do?
An open-source, AI-integrated, cross-platform terminal for seamless workflows
Is Context Menu safe to install?
The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean skill reads B.
What can Context Menu access on my machine?
The audit observed no filesystem, network or shell use at all in its source.
How current is this page?
The grade is for one exact copy of the source (63907843412f), read on 2026-10-03. The repository is watched, and a new audit runs when it changes — this is the first audit.