Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
c5afeb8
simplify scrollbar code in terminal, simplify fit code (#2944)
sawka Feb 27, 2026
b2f3129
Add `wsh debugterm` (#2947)
Copilot Feb 27, 2026
aa7befb
Bump electron-builder from 26.8.0 to 26.8.1 in the electron-patch gro…
dependabot[bot] Feb 27, 2026
237dfa7
Bump google.golang.org/api from 0.267.0 to 0.269.0 (#2951)
dependabot[bot] Feb 27, 2026
27f77f2
Bump the dev-dependencies-minor group with 4 updates (#2953)
dependabot[bot] Feb 27, 2026
1ab58ea
Fix bugs with connection switching (#2957)
sawka Feb 27, 2026
e8ebe88
Fix for Claude Code Scroll to Top Bug (#2956)
sawka Feb 27, 2026
4956c92
Make Wave home config writes atomic and serialized to avoid watcher p…
Copilot Feb 27, 2026
350242d
Bump rollup from 4.50.1 to 4.59.0 (#2958)
dependabot[bot] Feb 27, 2026
b1d11f7
add noprofile/noninteractive to all powershell commands (#2959)
sawka Feb 27, 2026
9c3cf98
Make frontend CSS color validation Chromium-only (remove DOM style fa…
Copilot Feb 27, 2026
e8d6ff5
chore: bump package version to 0.14.1-beta.0
wave-builder[bot] Feb 28, 2026
cff8477
minor changes (#2962)
sawka Feb 28, 2026
95a97ca
Add Onboarding Flows to Preview Server (#2960)
Copilot Mar 2, 2026
4ec09cb
Centralize proxy HTTP client creation in aiutil and remove redundant …
Copilot Mar 2, 2026
9d89f43
Complete onboarding preview coverage for init/telemetry-star flow and…
Copilot Mar 2, 2026
df24959
Add native 2+ arg RPC support and wire a concrete `TestMultiArgComman…
Copilot Mar 2, 2026
b5d23e5
v0.14.1 Release Notes and Onboarding (#2966)
sawka Mar 3, 2026
e2b2498
UI component for vertical tab bar
Copilot Mar 3, 2026
c411df4
chore: bump package version to 0.14.1-beta.1
wave-builder[bot] Mar 3, 2026
98c374b
quick updates to get apptype (#2969)
sawka Mar 3, 2026
d47329d
chore: bump package version to 0.14.1
wave-builder[bot] Mar 3, 2026
f4acfc9
Add virtualized flat-list TreeView component and preview sandbox (#2972)
Copilot Mar 4, 2026
ceca94b
add funding.yml file (#2977)
sawka Mar 4, 2026
c65147d
add sponsor section to readme (#2978)
sawka Mar 4, 2026
73f7715
Bump immutable from 5.1.3 to 5.1.5 (#2980)
dependabot[bot] Mar 5, 2026
9d4acb7
Add builder-launch strip to AppsFloatingWindow (#2979)
Copilot Mar 5, 2026
edc20f7
Bring Anthropic usechat backend to OpenAI-level tool-use parity and s…
Copilot Mar 5, 2026
7f5487d
Remove mock-heavy OSC52 Vitest coverage (#2975)
Copilot Mar 5, 2026
0ab26ef
Add a mousedown handler to also signal user activity in the app (#2976)
Copilot Mar 5, 2026
1a1cd85
Add `wave:term` component with direct SSE output + `/api/terminput` i…
Copilot Mar 5, 2026
f59fdb5
Fix focusedWaveWindow (also fixes bug w/ save session as....) (#2987)
sawka Mar 5, 2026
aefd4da
Bump globals from 17.3.0 to 17.4.0 in the dev-dependencies-minor grou…
dependabot[bot] Mar 6, 2026
73b2fb6
Bump postcss from 8.5.6 to 8.5.8 in the dev-dependencies-patch group …
dependabot[bot] Mar 6, 2026
06bac33
handle second-instance events (auto-generated new window action on gn…
sawka Mar 6, 2026
5e6d33d
Bump github.com/shirou/gopsutil/v4 from 4.26.1 to 4.26.2 (#2993)
dependabot[bot] Mar 6, 2026
1b3c7c7
Bump tar from 7.5.9 to 7.5.10 (#2992)
dependabot[bot] Mar 6, 2026
0f60c70
broadcast zoom changed notifications (#2989)
sawka Mar 6, 2026
ff673e1
break out `wsh editor` and clarify behavior. also document -m flag..…
sawka Mar 6, 2026
f82845b
chore: bump package version to 0.14.2-beta.0
wave-builder[bot] Mar 6, 2026
c6f6124
update about, add sponsor and gradient (#3001)
sawka Mar 6, 2026
76f78f0
fix failing layout test (#2999)
sawka Mar 7, 2026
3f4484a
Remove dead “move block to new window” path and dependent unused APIs…
Copilot Mar 7, 2026
7ef0bcd
preview updates (mock electron api, wos checks) (#2986)
sawka Mar 7, 2026
56c1829
Update aiusechat read_dir tests for typed entry output (#3007)
Copilot Mar 7, 2026
46593b9
Add Release Notes entry to the settings menu (#3005)
Copilot Mar 7, 2026
6871998
Fix connparse handling for scheme-less `//...` WSH shorthand URIs (#3…
Copilot Mar 7, 2026
71f7e98
create a FE rpc mock (#3014)
sawka Mar 7, 2026
e41aabf
Block Level Indicators/Badges, Update TabBar Styling, Add Badges/Flag…
sawka Mar 9, 2026
e6e559c
New WaveEnv, for preview server + mocking (#3015)
sawka Mar 9, 2026
39b68fb
Remove invalid `forwardRef` from preview directory table row (#3018)
Copilot Mar 9, 2026
1aee6e2
Expand WaveEnv to cover all the deps in sysinfo.tsx (#3019)
sawka Mar 9, 2026
f5480cb
mock out settings better (use default config) (#3022)
sawka Mar 10, 2026
e087a4c
Expose platform metadata on WaveEnv and preview mocks (#3021)
Copilot Mar 10, 2026
7119970
flip bell-indicator to true by default (#3023)
sawka Mar 10, 2026
29f49dc
fix: search bar clipboard and focus improvements (#3025)
Shay12tg Mar 10, 2026
cb8166e
Expanding WaveEnv to cover all of frontend/app/block components (#3024)
sawka Mar 10, 2026
a327921
chore: bump package version to 0.14.2-beta.1
wave-builder[bot] Mar 10, 2026
fc96f49
add new skill to copilot-instructions (#3029)
sawka Mar 10, 2026
e3c46b7
update copilot instructions for how to run the preview server (#3030)
sawka Mar 10, 2026
568027d
add `wsh badge` documentation (#3031)
sawka Mar 10, 2026
ecccad6
TabBar full preview + much more FE mocking via WaveEnv to enable it (…
Copilot Mar 11, 2026
60cdf05
Do not minify preview builds, and fix HMR reload warning (#3036)
sawka Mar 11, 2026
2cf8c26
Share tab badge rendering with vertical tabs (#3034)
Copilot Mar 11, 2026
8762b47
Add full sysinfo block preview backed by mock WaveEnv/WOS data (#3033)
Copilot Mar 11, 2026
9ee654d
Preview Directory Updates (modtime format, zebra, default sort, yml, …
sawka Mar 11, 2026
8164ffc
v0.14.2 release notes and onboarding (#3039)
sawka Mar 12, 2026
82048b6
Add preview-native context menus and fix submenu rendering in `fronte…
Copilot Mar 12, 2026
52dd0a2
Add Claude Code Integration Guide + Fix Badge Priority Bug (#3040)
sawka Mar 12, 2026
59b8368
Block Header should use waveEnv for context menu (for mocking) (#3041)
sawka Mar 12, 2026
af6afc2
chore: bump package version to 0.14.2-beta.2
wave-builder[bot] Mar 12, 2026
896c89f
chore: bump package version to 0.14.2
wave-builder[bot] Mar 12, 2026
1ebc9a0
Add a realistic preview mock filesystem and file RPC support (#3042)
Copilot Mar 12, 2026
b6884b2
Add login and port override flags to `wsh ssh` (#3045)
Copilot Mar 12, 2026
cdb300a
fix issue with an undefined this in service code (#3048)
sawka Mar 12, 2026
129b353
chore: bump package version to 0.14.2
wave-builder[bot] Mar 12, 2026
91973e3
chore: bump package version to 0.14.3
wave-builder[bot] Mar 12, 2026
95dd2bf
getting vtabbar into shape, share mock between the tab bars (#3047)
sawka Mar 13, 2026
bfc44b0
Bump tar from 7.5.10 to 7.5.11 (#3037)
dependabot[bot] Mar 13, 2026
765c04f
Bump electron from 40.4.1 to 41.0.2 (#3055)
dependabot[bot] Mar 13, 2026
1b708ea
Bump golang.org/x/term from 0.40.0 to 0.41.0 (#3052)
dependabot[bot] Mar 13, 2026
4034526
fix electron v41 regression (webContents is null in destroyed hander)…
sawka Mar 13, 2026
f151313
Bump golang.org/x/crypto from 0.48.0 to 0.49.0 (#3051)
dependabot[bot] Mar 14, 2026
ac6b2f3
New Vertical Tab Bar Option (#3059)
sawka Mar 14, 2026
d0a5c29
Add preview-safe web widget preview (#3062)
Copilot Mar 14, 2026
a2e6f7b
Remove Config Errors from TabBar, move to Settings / WaveConfig (#3060)
sawka Mar 14, 2026
10fdf42
Add standalone preview for the `aifilediff` block view (#3063)
Copilot Mar 15, 2026
b1d7f42
Begin PreviewEnv narrowing for the preview widget (#3065)
Copilot Mar 15, 2026
b0d77a8
fix previewenv to use services.object instead of services.ObjectServi…
sawka Mar 15, 2026
9d3c783
feat: add native Mosh support for SSH connections
PhenixStar Mar 15, 2026
abf0cf5
feat: auto-detect mosh availability on SSH connect
PhenixStar Mar 15, 2026
3af603e
fix: file browser shows newest files first, bump limit to 5000
JustHereToHelp Feb 11, 2026
427ad6a
Show Caps Lock indicator in SSH password prompt
0John-Hong0 Feb 8, 2026
8601b40
feat: close window when last terminal exits (term:closeonlasttermclose)
apanchoo Mar 13, 2026
72a69b7
fix: return false on DB read errors in isLastShellBlockInWorkspace
apanchoo Mar 13, 2026
33b0a8d
Fix terminal state loss when switching workspaces
stevenvo Dec 25, 2025
34cd25c
Fix gibberish screen: remove cached views from DOM
stevenvo Jan 3, 2026
70b0462
Fix getWaveWindowByTabId to search cached tabs
stevenvo Jan 3, 2026
5490382
feat: implement per-block zsh history isolation
duerzy Mar 9, 2026
39500af
feat: add zle buffer readback over osc 16162
Copilot Mar 7, 2026
cbc2b0a
chore: finalize osc 16162 readback validation
Copilot Mar 7, 2026
ae93d7a
feat: cmd+click to open file paths in terminal
JustHereToHelp Feb 11, 2026
3125e5b
fix: dispose link provider on cleanup, support extensionless filenames
JustHereToHelp Feb 26, 2026
3adf86c
fix: improve sixel image positioning by propagating terminal pixel size
zouyonghe Feb 26, 2026
c570de5
refactor: dedupe termsize-to-pty winsize conversion
zouyonghe Feb 26, 2026
a4994b9
refactor: simplify resize error handling and termsize forwarding
zouyonghe Feb 26, 2026
53b0a48
Update pkg/util/ptyutil/ptyutil.go
zouyonghe Feb 27, 2026
5af0a02
chore: update package-lock.json for @xterm/addon-image dependency
PhenixStar Mar 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: wavetermdev
43 changes: 33 additions & 10 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,45 @@

## Project Rules

Read and follow all guidelines in [`.roo/rules/rules.md`](./.roo/rules/rules.md).
- See the overview of the project in `.kilocode/rules/overview.md`
- Read and follow all guidelines in `.kilocode/rules/rules.md`

---

## Skill Guides

This project uses a set of "skill" guides — focused how-to documents for common implementation tasks. When your task matches one of the descriptions below, **read the linked SKILL.md file before proceeding** and follow its instructions precisely.

| Skill | Description |
|-------|-------------|
| [add-config](./.kilocode/skills/add-config/SKILL.md) | Guide for adding new configuration settings to Wave Terminal. Use when adding a new setting to the configuration system, implementing a new config key, or adding user-customizable settings. |
| [add-rpc](./.kilocode/skills/add-rpc/SKILL.md) | Guide for adding new RPC calls to Wave Terminal. Use when implementing new RPC commands, adding server-client communication methods, or extending the RPC interface with new functionality. |
| [add-wshcmd](./.kilocode/skills/add-wshcmd/SKILL.md) | Guide for adding new wsh commands to Wave Terminal. Use when implementing new CLI commands, adding command-line functionality, or extending the wsh command interface. |
| [context-menu](./.kilocode/skills/context-menu/SKILL.md) | 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. |
| [create-view](./.kilocode/skills/create-view/SKILL.md) | Guide for implementing a new view type in Wave Terminal. Use when creating a new view component, implementing the ViewModel interface, registering a new view type in BlockRegistry, or adding a new content type to display within blocks. |
| [electron-api](./.kilocode/skills/electron-api/SKILL.md) | Guide for adding new Electron APIs to Wave Terminal. Use when implementing new frontend-to-electron communications via preload/IPC. |
| [wps-events](./.kilocode/skills/wps-events/SKILL.md) | Guide for working with Wave Terminal's WPS (Wave PubSub) event system. Use when implementing new event types, publishing events, subscribing to events, or adding asynchronous communication between components. |
| Skill | File | Description |
| ------------ | ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| add-config | `.kilocode/skills/add-config/SKILL.md` | Guide for adding new configuration settings to Wave Terminal. Use when adding a new setting to the configuration system, implementing a new config key, or adding user-customizable settings. |
| add-rpc | `.kilocode/skills/add-rpc/SKILL.md` | Guide for adding new RPC calls to Wave Terminal. Use when implementing new RPC commands, adding server-client communication methods, or extending the RPC interface with new functionality. |
| add-wshcmd | `.kilocode/skills/add-wshcmd/SKILL.md` | Guide for adding new wsh commands to Wave Terminal. Use when implementing new CLI commands, adding command-line functionality, or extending the wsh command interface. |
| context-menu | `.kilocode/skills/context-menu/SKILL.md` | 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. |
| create-view | `.kilocode/skills/create-view/SKILL.md` | Guide for implementing a new view type in Wave Terminal. Use when creating a new view component, implementing the ViewModel interface, registering a new view type in BlockRegistry, or adding a new content type to display within blocks. |
| electron-api | `.kilocode/skills/electron-api/SKILL.md` | Guide for adding new Electron APIs to Wave Terminal. Use when implementing new frontend-to-electron communications via preload/IPC. |
| waveenv | `.kilocode/skills/waveenv/SKILL.md` | Guide for creating WaveEnv narrowings in Wave Terminal. Use when writing a named subset type of WaveEnv for a component tree, documenting environmental dependencies, or enabling mock environments for preview/test server usage. |
| wps-events | `.kilocode/skills/wps-events/SKILL.md` | Guide for working with Wave Terminal's WPS (Wave PubSub) event system. Use when implementing new event types, publishing events, subscribing to events, or adding asynchronous communication between components. |

> **How skills work:** Each skill is a self-contained guide covering the exact files to edit, patterns to follow, and steps to take for a specific type of task in this codebase. If your task matches a skill's description, open that SKILL.md and treat it as your primary reference for the implementation.

---

## Preview Server

To run the standalone component preview (no Electron, no backend required):

```
task preview
```

This runs `cd frontend/preview && npx vite` and serves at **http://localhost:7007** (port configured in `frontend/preview/vite.config.ts`).

To build a static preview: `task build:preview`

**Do NOT use any of the following to start the preview — they all launch the full Electron app or serve the wrong content:**

- `npm run dev` — runs `electron-vite dev`, launches Electron
- `npm run start` — also launches Electron
- `npx vite` from the repo root — uses the Electron-Vite config, not the preview app
- Serving the `dist/` directory — the preview app is never built there; it has its own build output
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ out/
make/
artifacts/
mikework/
aiplans/
manifests/
.env
out
Expand All @@ -38,3 +39,4 @@ test-results.xml
docsite/

.kilo-format-temp-*
.ruvector/
4 changes: 2 additions & 2 deletions .kilocode/skills/add-rpc/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ RPC commands in Wave Terminal follow these conventions:

- **Method names** must end with `Command`
- **First parameter** must be `context.Context`
- **Second parameter** (optional) is the command data structure
- **Remaining parameters** are a regular Go parameter list (zero or more typed args)
- **Return values** can be either just an error, or one return value plus an error
- **Streaming commands** return a channel instead of a direct value

Expand All @@ -49,7 +49,7 @@ type WshRpcInterface interface {

- Method name must end with `Command`
- First parameter must be `ctx context.Context`
- Optional second parameter for input data
- Remaining parameters are a regular Go parameter list (zero or more)
- Return either `error` or `(ReturnType, error)`
- For streaming, return `chan RespOrErrorUnion[T]`

Expand Down
14 changes: 12 additions & 2 deletions .kilocode/skills/electron-api/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ description: Guide for adding new Electron APIs to Wave Terminal. Use when imple

Electron APIs allow the frontend to call Electron main process functionality directly via IPC.

## Three Files to Edit
## Four Files to Edit

1. [`frontend/types/custom.d.ts`](frontend/types/custom.d.ts) - TypeScript [`ElectronApi`](frontend/types/custom.d.ts:82) type
2. [`emain/preload.ts`](emain/preload.ts) - Expose method via `contextBridge`
3. [`emain/emain-ipc.ts`](emain/emain-ipc.ts) - Implement IPC handler
4. [`frontend/preview/preview-electron-api.ts`](frontend/preview/preview-electron-api.ts) - Add a no-op stub to keep the `previewElectronApi` object in sync with the `ElectronApi` type

## Three Communication Patterns

Expand Down Expand Up @@ -54,7 +55,15 @@ electron.ipcMain.handle("capture-screenshot", async (event, rect) => {
});
```

### 4. Call from Frontend
### 4. Add Preview Stub

In [`frontend/preview/preview-electron-api.ts`](frontend/preview/preview-electron-api.ts):

```typescript
captureScreenshot: (_rect: Electron.Rectangle) => Promise.resolve(""),
```

### 5. Call from Frontend

```typescript
import { getApi } from "@/store/global";
Expand Down Expand Up @@ -167,6 +176,7 @@ webContents.send("zoom-factor-change", newZoomFactor);
- [ ] Include IPC channel name in comment
- [ ] Expose in [`preload.ts`](emain/preload.ts)
- [ ] Implement in [`emain-ipc.ts`](emain/emain-ipc.ts)
- [ ] Add no-op stub to [`preview-electron-api.ts`](frontend/preview/preview-electron-api.ts)
- [ ] IPC channel names match exactly
- [ ] **For sync**: Set `event.returnValue` (or browser hangs!)
- [ ] Test end-to-end
130 changes: 130 additions & 0 deletions .kilocode/skills/waveenv/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
---
name: waveenv
description: Guide for creating WaveEnv narrowings in Wave Terminal. Use when writing a named subset type of WaveEnv for a component tree, documenting environmental dependencies, or enabling mock environments for preview/test server usage.
---

# WaveEnv Narrowing Skill

## Purpose

A WaveEnv narrowing creates a _named subset type_ of `WaveEnv` that:

1. Documents exactly which parts of the environment a component tree actually uses.
2. Forms a type contract so callers and tests know what to provide.
3. Enables mocking in the preview/test server — you only need to implement what's listed.

## When To Create One

Create a narrowing whenever you are writing a component (or group of components) that you want to test in the preview server, or when you want to make the environmental dependencies of a component tree explicit.

## Core Principle: Only Include What You Use

**Only list the fields, methods, atoms, and keys that the component tree actually accesses.** If you don't call `wos`, don't include `wos`. If you only call one RPC command, only list that one command. The narrowing is a precise dependency declaration — not a copy of `WaveEnv`.

## File Location

- **Separate file** (preferred for shared/complex envs): name it `<feature>env.ts` next to the component, e.g. `frontend/app/block/blockenv.ts`.
- **Inline** (acceptable for small, single-file components): export the type directly from the component file, e.g. `WidgetsEnv` in `frontend/app/workspace/widgets.tsx`.

## Imports Required

```ts
import {
BlockMetaKeyAtomFnType, // only if you use getBlockMetaKeyAtom
ConnConfigKeyAtomFnType, // only if you use getConnConfigKeyAtom
SettingsKeyAtomFnType, // only if you use getSettingsKeyAtom
WaveEnv,
WaveEnvSubset,
} from "@/app/waveenv/waveenv";
```

## The Shape

```ts
export type MyEnv = WaveEnvSubset<{
// --- Simple WaveEnv properties ---
// Copy the type verbatim from WaveEnv with WaveEnv["key"] syntax.
isDev: WaveEnv["isDev"];
createBlock: WaveEnv["createBlock"];
showContextMenu: WaveEnv["showContextMenu"];
platform: WaveEnv["platform"];

// --- electron: list only the methods you call ---
electron: {
openExternal: WaveEnv["electron"]["openExternal"];
};

// --- rpc: list only the commands you call ---
rpc: {
ActivityCommand: WaveEnv["rpc"]["ActivityCommand"];
ConnEnsureCommand: WaveEnv["rpc"]["ConnEnsureCommand"];
};

// --- atoms: list only the atoms you read ---
atoms: {
modalOpen: WaveEnv["atoms"]["modalOpen"];
fullConfigAtom: WaveEnv["atoms"]["fullConfigAtom"];
};

// --- wos: always take the whole thing, no sub-typing needed ---
wos: WaveEnv["wos"];

// --- services: list only the services you call; no method-level narrowing ---
services: {
block: WaveEnv["services"]["block"];
workspace: WaveEnv["services"]["workspace"];
};

// --- key-parameterized atom factories: enumerate the keys you use ---
getSettingsKeyAtom: SettingsKeyAtomFnType<"app:focusfollowscursor" | "window:magnifiedblockopacity">;
getBlockMetaKeyAtom: BlockMetaKeyAtomFnType<"view" | "frame:title" | "connection">;
getConnConfigKeyAtom: ConnConfigKeyAtomFnType<"conn:wshenabled">;

// --- other atom helpers: copy verbatim ---
getConnStatusAtom: WaveEnv["getConnStatusAtom"];
getLocalHostDisplayNameAtom: WaveEnv["getLocalHostDisplayNameAtom"];
}>;
```

### Automatically Included Fields

Every `WaveEnvSubset<T>` automatically includes the mock fields — you never need to declare them:

- `isMock: boolean`
- `mockSetWaveObj: <T extends WaveObj>(oref: string, obj: T) => void`
- `mockModels?: Map<any, any>`

### Rules for Each Section

| Section | Pattern | Notes |
| -------------------------- | ------------------------------------------------------ | -------------------------------------------------------------------------------------------------- |
| `electron` | `electron: { method: WaveEnv["electron"]["method"]; }` | List every method called; omit the rest. |
| `rpc` | `rpc: { Cmd: WaveEnv["rpc"]["Cmd"]; }` | List every RPC command called; omit the rest. |
| `atoms` | `atoms: { atom: WaveEnv["atoms"]["atom"]; }` | List every atom read; omit the rest. |
| `wos` | `wos: WaveEnv["wos"]` | Take the whole `wos` object (no sub-typing needed), but **only add it if `wos` is actually used**. |
| `services` | `services: { svc: WaveEnv["services"]["svc"]; }` | List each service used; take the whole service object (no method-level narrowing). |
| `getSettingsKeyAtom` | `SettingsKeyAtomFnType<"key1" \| "key2">` | Union all settings keys accessed. |
| `getBlockMetaKeyAtom` | `BlockMetaKeyAtomFnType<"key1" \| "key2">` | Union all block meta keys accessed. |
| `getConnConfigKeyAtom` | `ConnConfigKeyAtomFnType<"key1">` | Union all conn config keys accessed. |
| All other `WaveEnv` fields | `WaveEnv["fieldName"]` | Copy type verbatim. |

## Using the Narrowed Type in Components

```ts
import { useWaveEnv } from "@/app/waveenv/waveenv";
import { MyEnv } from "./myenv";

const MyComponent = memo(() => {
const env = useWaveEnv<MyEnv>();
// TypeScript now enforces you only access what's in MyEnv.
const val = useAtomValue(env.getSettingsKeyAtom("app:focusfollowscursor"));
...
});
```

The generic parameter on `useWaveEnv<MyEnv>()` casts the context to your narrowed type. The real production `WaveEnv` satisfies every narrowing; mock envs only need to implement the listed subset.

## Real Examples

- `BlockEnv` in `frontend/app/block/blockenv.ts` — complex narrowing with all section types, in a separate file.
- `WidgetsEnv` in `frontend/app/workspace/widgets.tsx` — smaller narrowing defined inline in the component file.
3 changes: 1 addition & 2 deletions .roo/rules/rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ The full API is defined in custom.d.ts as type ElectronApi.

- **CRITICAL: Completion format MUST be: "Done: [one-line description]"**
- **Keep your Task Completed summaries VERY short**
- **No lengthy pre-completion summaries** - Do not provide detailed explanations of implementation before using attempt_completion
- **No recaps of changes** - Skip explaining what was done before completion
- **No double-summarization** - Put your summary ONLY inside attempt_completion. Do not write a summary in the message body AND then repeat it in attempt_completion. One summary, one place.
- **Go directly to completion** - After making changes, proceed directly to attempt_completion without summarizing
- The project is currently an un-released POC / MVP. Do not worry about backward compatibility when making changes
- With React hooks, always complete all hook calls at the top level before any conditional returns (including jotai hook calls useAtom and useAtomValue); when a user explicitly tells you a function handles null inputs, trust them and stop trying to "protect" it with unnecessary checks or workarounds.
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,14 @@ Find more information in our [Contributions Guide](CONTRIBUTING.md), which inclu
- [Ways to contribute](CONTRIBUTING.md#contributing-to-wave-terminal)
- [Contribution guidelines](CONTRIBUTING.md#before-you-start)

### Sponsoring Wave ❤️

If Wave Terminal is useful to you or your company, consider sponsoring development.

Sponsorship helps support the time spent building and maintaining the project.

- https://github.com/sponsors/wavetermdev

## License

Wave Terminal is licensed under the Apache-2.0 License. For more information on our dependencies, see [here](./ACKNOWLEDGEMENTS.md).
Loading