Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
185ab29
some small tw migration
sawka Sep 16, 2025
a71871a
togglable / resizeable wave ai panel, cmd-shift-a
sawka Sep 16, 2025
9606a4e
waveai mode for usechat
sawka Sep 16, 2025
3f6bfb8
add ai sdk
sawka Sep 16, 2025
43026f0
checkpoint
sawka Sep 16, 2025
c6ee5a2
fix endpoint
sawka Sep 16, 2025
c5afee5
move blockid to the non waveai case
sawka Sep 16, 2025
1d05961
work on errors
sawka Sep 16, 2025
056a199
rewriting for useChat
sawka Sep 16, 2025
6b2067d
working on wave ai component
sawka Sep 16, 2025
18b3690
widget access toggle
sawka Sep 17, 2025
fe82c3a
model, some tab atom funcs
sawka Sep 17, 2025
88b8d5f
breakpoints
sawka Sep 17, 2025
95666ef
use uuid instead of custom genid
sawka Sep 17, 2025
abc37c0
work on a new package for usechat...
sawka Sep 17, 2025
8ed8032
updates for new usechat pkg...
sawka Sep 17, 2025
52cda2d
better part conversion
sawka Sep 17, 2025
08121dd
fixing small issues
sawka Sep 18, 2025
6ba1789
completed refactor, removed old files. compiling and running again
sawka Sep 18, 2025
8f5dff0
pass through tools
sawka Sep 18, 2025
80824eb
more fixes
sawka Sep 18, 2025
5917d4e
more fixes
sawka Sep 18, 2025
fa1db6a
update window min width
sawka Sep 18, 2025
b5a2850
fixed workspace layout aipanel size
sawka Sep 18, 2025
2652bb6
add jotai rules
sawka Sep 18, 2025
316eb06
more backend fixes
sawka Sep 18, 2025
ef0b4f2
fixing so many bugs between usechat types and the spec
sawka Sep 19, 2025
15042b9
working on fixing UIMessage types
sawka Sep 19, 2025
fc07196
lots more conversion fixing
sawka Sep 19, 2025
f51d728
sources
sawka Sep 19, 2025
8250ed3
finish the conversion
sawka Sep 19, 2025
e9d3c57
mini refactor, add cont param
sawka Sep 19, 2025
cd9fc8f
finish removing legacy fields
sawka Sep 19, 2025
01dd985
update type names, remove more legacy, and align uctypes more to the …
sawka Sep 19, 2025
8a32776
working on new API
sawka Sep 19, 2025
069244e
working towards new API
sawka Sep 20, 2025
a23d90a
using new aichat interface in main-testai (for anthropic)
sawka Sep 20, 2025
961b4b7
getting there...
sawka Sep 20, 2025
00b21d6
got interface set for building rtn message
sawka Sep 20, 2025
42f8d4b
build text+thinking
sawka Sep 20, 2025
cf7ea88
chats working (capture thinking + text)
sawka Sep 20, 2025
c837ada
drag&drop of files
sawka Sep 21, 2025
43f3c13
expandable input
sawka Sep 21, 2025
f84ed02
more efficient space usage here
sawka Sep 21, 2025
98e72a8
file upload!
sawka Sep 21, 2025
1f95812
much better efficient horizontal space usage
sawka Sep 21, 2025
360fdc3
fix how thinking indicator works
sawka Sep 21, 2025
4cddf66
show user uploaded files
sawka Sep 21, 2025
c593e6d
clear chats
sawka Sep 21, 2025
3fef9a9
refocus after submit
sawka Sep 21, 2025
6f91c02
fix panel show/hide
sawka Sep 21, 2025
cf0f922
custom data... data-userfile...
sawka Sep 22, 2025
1ef8a5a
almost have a full tool use case working
sawka Sep 22, 2025
5e717ec
tool calling working e2e
sawka Sep 22, 2025
d4dd061
pass widgetaccess flag to backend
sawka Sep 22, 2025
b090a2a
adder can sum an array of numbers
sawka Sep 22, 2025
563a538
Merge remote-tracking branch 'origin/main' into sawka/aipanel
sawka Sep 22, 2025
a45869f
Merge remote-tracking branch 'origin/main' into sawka/aipanel
sawka Sep 22, 2025
e262cbb
bump version in package-lock
sawka Sep 22, 2025
4dbd00e
minor
sawka Sep 22, 2025
cba80c6
add tsunami:env meta
sawka Sep 22, 2025
d4825b0
checkpoint
sawka Sep 22, 2025
96f869c
wavechatopts
sawka Sep 22, 2025
434e2bc
working on AI widget context. also working on Tsunami context (AppSh…
sawka Sep 22, 2025
73a74be
ship the tsunami "rtinfo" back to the server
sawka Sep 23, 2025
668085c
got dynamic tsunami widget descriptions
sawka Sep 23, 2025
e02470e
inject tab state + tools into user message. better for caching and f…
sawka Sep 23, 2025
8a7a225
first tsunami data call working!
sawka Sep 23, 2025
6632365
3 tsunami tools, fix tsunami widget headers
sawka Sep 23, 2025
7c4041e
use new cf worker endpoint
sawka Sep 24, 2025
126a289
persist aipanel open + width
sawka Sep 24, 2025
7a42197
hook up open-ai "responses" api (text). tools are still unimplemente…
sawka Sep 25, 2025
bc86645
convert files
sawka Sep 25, 2025
ae3bd38
use wave proxy for openai
sawka Sep 25, 2025
ee1c0a8
update system prompts (much more strict with openai)
sawka Sep 25, 2025
1ddd5a4
remove default openai endpoint
sawka Sep 25, 2025
a83480b
AI button, panel width, other UI
sawka Sep 25, 2025
bd42c04
click to focus
sawka Sep 25, 2025
986e250
lots of focus work and keyboard shortcut work for aipanel
sawka Sep 25, 2025
ca81666
better nodeai focus / navigation
sawka Sep 26, 2025
09bcd15
try to fix some QoL go to definition issue in vscode
sawka Sep 26, 2025
c5c2589
fix drag target for just files
sawka Sep 26, 2025
10091e1
remove tabcontent.scss
sawka Sep 26, 2025
825573c
remove a lot of old scss mixins
sawka Sep 26, 2025
1ae2cdc
making progress on openai tool use
sawka Sep 27, 2025
16c47f1
might actually be working... openai tool calls!
sawka Sep 27, 2025
a018dcc
quick updates for openai
sawka Sep 27, 2025
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 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ out/
make/
artifacts/
mikework/
.env

# Yarn Modern
.pnp.*
Expand Down
10 changes: 10 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
linters:
disable:
- unused
- unusedfunc
- unusedparams
issues:
exclude-rules:
- linters:
- unused
text: "unused parameter"
69 changes: 68 additions & 1 deletion .roo/rules/rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ It has a TypeScript/React frontend and a Go backend. They talk together over `ws
### Styling

- We use **Tailwind v4** to style. Custom stuff is defined in frontend/tailwindsetup.css
- _never_ use cursor-help (it looks terrible)
- _never_ use cursor-help, or cursor-not-allowed (it looks terrible)
- We have custom CSS setup as well, so it is a hybrid system. For new code we prefer tailwind, and are working to migrate code to all use tailwind.

### Code Generation
Expand Down Expand Up @@ -78,6 +78,7 @@ These files provide step-by-step instructions, code examples, and best practices
- 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.
- **Match response length to question complexity** - For simple, direct questions in Ask mode (especially those that can be answered in 1-2 sentences), provide equally brief answers. Save detailed explanations for complex topics or when explicitly requested.
- **CRITICAL** - useAtomValue and useAtom are React HOOKS. They cannot be used inline in JSX code, they must appear at the top of a component in the hooks area of the react code.
- for simple functions, we prefer `if (!cond) { return }; functionality;` pattern overn `if (cond) { functionality }` because it produces less indentation and is easier to follow.

### Strict Comment Rules

Expand All @@ -98,6 +99,72 @@ These files provide step-by-step instructions, code examples, and best practices
- **When in doubt, leave it out**. No comment is better than a redundant comment.
- **Never add comments explaining code changes** - The code should speak for itself, and version control tracks changes. The one exception to this rule is if it is a very unobvious implementation. Something that someone would typically implement in a different (wrong) way. Then the comment helps us remember WHY we changed it to a less obvious implementation.

### Jotai Model Pattern (our rules)

- **Atoms live on the model.**
- **Simple atoms:** define as **field initializers**.
- **Atoms that depend on values/other atoms:** create in the **constructor**.
- Models **never use React hooks**; they use `globalStore.get/set`.
- It’s fine to call model methods from **event handlers** or **`useEffect`**.

```ts
// model/MyModel.ts
import { atom, type PrimitiveAtom } from "jotai";
import { globalStore } from "@/app/store/jotaiStore";

export class MyModel {
// simple atoms (field init)
statusAtom = atom<"idle" | "running" | "error">("idle");
outputAtom = atom("");

// ctor-built atoms (need types)
lengthAtom!: PrimitiveAtom<number>; // read-only derived via atom(get=>...)
thresholdedAtom!: PrimitiveAtom<boolean>;

constructor(initialThreshold = 20) {
this.lengthAtom = atom((get) => get(this.outputAtom).length);
this.thresholdedAtom = atom((get) => get(this.lengthAtom) > initialThreshold);
}

async doWork() {
globalStore.set(this.statusAtom, "running");
try {
for await (const chunk of this.stream()) {
globalStore.set(this.outputAtom, (prev) => prev + chunk);
}
globalStore.set(this.statusAtom, "idle");
} catch {
globalStore.set(this.statusAtom, "error");
}
}

private async *stream() {
/* ... */
}
}
```

```tsx
// component usage (events & effects OK)
import { useAtomValue } from "jotai";

function Panel({ model }: { model: MyModel }) {
const status = useAtomValue(model.statusAtom);
const isBig = useAtomValue(model.thresholdedAtom);

const onClick = () => model.doWork();
// useEffect(() => { model.doWork() }, [model])

return (
<div>
{status} • {String(isBig)}
</div>
);
}
```

**Remember:** atoms on the model, simple-as-fields, ctor for dependent/derived, updates via `globalStore.set/get`.

### Tool Use

Do NOT use write_to_file unless it is a new file or very short. Always prefer to use replace_in_file. Often your diffs fail when a file may be out of date in your cache vs the actual on-disk format. You should RE-READ the file and try to create diffs again if your diffs fail rather than fall back to write_to_file. If you feel like your ONLY option is to use write_to_file please ask first.
Expand Down
23 changes: 19 additions & 4 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ tasks:
- docsite:build:embedded
- build:backend
env:
WCLOUD_ENDPOINT: "https://api-dev.waveterm.dev/central"
WCLOUD_WS_ENDPOINT: "wss://wsapi-dev.waveterm.dev/"
WAVETERM_ENVFILE: "{{.ROOT_DIR}}/.env"
WCLOUD_ENDPOINT: "https://api-dev.waveterm.dev"
WCLOUD_WS_ENDPOINT: "wss://wsapi-dev.waveterm.dev"

electron:start:
desc: Run the Electron application directly.
Expand All @@ -39,6 +40,7 @@ tasks:
- docsite:build:embedded
- build:backend
env:
WAVETERM_ENVFILE: "{{.ROOT_DIR}}/.env"
WCLOUD_ENDPOINT: "https://api-dev.waveterm.dev"
WCLOUD_WS_ENDPOINT: "wss://wsapi-dev.waveterm.dev"

Expand All @@ -49,6 +51,7 @@ tasks:
- npm:install
- build:backend:quickdev
env:
WAVETERM_ENVFILE: "{{.ROOT_DIR}}/.env"
WCLOUD_ENDPOINT: "https://api-dev.waveterm.dev/central"
WCLOUD_WS_ENDPOINT: "wss://wsapi-dev.waveterm.dev/"

Expand Down Expand Up @@ -134,6 +137,12 @@ tasks:
- docsite:build:embedded
- build:backend

build:frontend:dev:
desc: Build the frontend in development mode.
cmd: npm run build:dev
deps:
- npm:install

build:backend:
desc: Build the wavesrv and wsh components.
cmds:
Expand All @@ -144,6 +153,14 @@ tasks:
desc: Build only the wavesrv component for quickdev (arm64 macOS only, no generate, no wsh).
cmds:
- task: build:server:quickdev
sources:
- go.mod
- go.sum
- pkg/**/*.go
- cmd/**/*.go
- tsunami/go.mod
- tsunami/go.sum
- tsunami/**/*.go

build:schema:
desc: Build the schema for configuration.
Expand Down Expand Up @@ -189,8 +206,6 @@ tasks:
desc: Build the wavesrv component for quickdev (arm64 macOS only, no generate).
platforms: [darwin]
cmds:
- cmd: "{{.RM}} dist/bin/wavesrv*"
ignore_error: true
- task: build:server:internal
vars:
ARCHS: arm64
Expand Down
Loading