Commit graph

224 commits

Author SHA1 Message Date
Mike Sawka
98c374b8cd
quick updates to get apptype (#2969) 2026-03-03 15:19:23 -08:00
Copilot
df24959e23
Add native 2+ arg RPC support and wire a concrete TestMultiArgCommand through server, generated clients, and CLI (#2963)
This PR extends WSH RPC command signatures to support `ctx + 2+ typed
args` while preserving existing `ctx` and `ctx + 1 arg` behavior. It
also adds a concrete `TestMultiArgCommand` end-to-end so the generated
Go/TS client surfaces can be inspected and exercised from CLI.

- **RPC wire + dispatch model**
- Added `wshrpc.MultiArg` (`args []any`) as the over-the-wire envelope
for 2+ arg commands.
- Extended RPC metadata to track all command arg types
(`CommandDataTypes`) and exposed a helper for normalized access.
  - Updated server adapter unmarshalling to:
    - decode `MultiArg` for 2+ arg commands,
    - validate arg count,
- re-unmarshal each arg into its declared type before invoking typed
handlers.
  - Kept single-arg commands on the existing non-`MultiArg` path.

- **Code generation (Go + TS)**
- Go codegen now emits multi-parameter wrappers for 2+ arg methods and
packs payload as `wshrpc.MultiArg`.
- TS codegen now emits multi-parameter API methods and packs payload as
`{ args: [...] }`.
  - 0/1-arg generation remains unchanged to avoid wire/API churn.

- **Concrete command added for validation**
  - Added to `WshRpcInterface`:
- `TestMultiArgCommand(ctx context.Context, arg1 string, arg2 int, arg3
bool) (string, error)`
- Implemented in `wshserver` with deterministic formatted return output
including source + all args.
- Updated `wsh test` command to call `TestMultiArgCommand` and print the
returned string.

- **Focused coverage**
- Added/updated targeted tests around RPC metadata and Go/TS multi-arg
codegen behavior, including command declaration for `testmultiarg`.

Example generated call shape:

```go
func TestMultiArgCommand(w *wshutil.WshRpc, arg1 string, arg2 int, arg3 bool, opts *wshrpc.RpcOpts) (string, error) {
    return sendRpcRequestCallHelper[string](
        w,
        "testmultiarg",
        wshrpc.MultiArg{Args: []any{arg1, arg2, arg3}},
        opts,
    )
}
```

<!-- START COPILOT CODING AGENT TIPS -->
---

💡 You can make Copilot smarter by setting up custom instructions,
customizing its development environment and configuring Model Context
Protocol (MCP) servers. Learn more [Copilot coding agent
tips](https://gh.io/copilot-coding-agent-tips) in the docs.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: sawka <2722291+sawka@users.noreply.github.com>
Co-authored-by: sawka <mike@commandline.dev>
2026-03-02 12:29:04 -08:00
Mike Sawka
cff84773a6
minor changes (#2962) 2026-02-28 15:48:52 -08:00
Copilot
b2f3129aa0
Add wsh debugterm (#2947)
`wsh debugterm` currently decodes terminal bytes sourced from backend
block files. This extends it with a stdin-driven path so FE-emitted
payloads like `["...", "..."]` can be decoded directly without requiring
block lookup/RPC in that mode.

- **CLI surface**
  - Added new mode: `--mode stdin`
  - Updated mode help text to: `hex`, `decode`, `stdin`
  - Centralized mode validation via `getDebugTermMode()`

- **Execution path split**
  - Added mode-aware pre-run (`debugTermPreRun`):
    - `stdin` mode: skips RPC setup
    - `hex`/`decode`: keeps existing RPC setup behavior
  - `stdin` mode now:
    - reads all stdin
    - parses JSON as `[]string`
    - concatenates entries and runs existing decode formatter

- **Parsing support**
  - Added `parseDebugTermStdinData([]byte) ([]byte, error)`
  - Error messaging explicitly requires a JSON array of strings

- **Tests**
  - Added focused coverage for:
    - valid stdin JSON array parsing + decoded output
    - invalid stdin JSON input

```go
stdinData, _ := io.ReadAll(WrappedStdin)
termData, err := parseDebugTermStdinData(stdinData) // expects []string JSON
if err != nil { return err }
WriteStdout("%s", formatDebugTermDecode(termData))
```

<!-- START COPILOT CODING AGENT TIPS -->
---

 Let Copilot coding agent [set things up for
you](https://github.com/wavetermdev/waveterm/issues/new?title=+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: sawka <2722291+sawka@users.noreply.github.com>
Co-authored-by: sawka <mike@commandline.dev>
2026-02-27 10:24:26 -08:00
Copilot
195277de45
Generate WaveEvent as a typed discriminated union with explicit null payloads for no-data events (#2899)
This updates WaveEvent typing to be event-aware instead of `data?: any`,
while keeping safe fallback behavior for unmapped events. It also
codifies known no-payload events as `null` payloads and documents event
payload expectations alongside the Go event constants.

- **Event registry + payload documentation (Go)**
- Added `AllEvents` in `pkg/wps/wpstypes.go` as the canonical list of
Wave event names.
  - Added/updated inline payload annotations on `Event_*` constants.
- Marked confirmed no-payload events with `// type: none` (e.g.
`route:up`, `route:down`, `workspace:update`, `waveapp:appgoupdated`).

- **Dedicated WaveEvent TS generation path**
- Added `pkg/tsgen/tsgenevent.go` with `event -> reflect.Type` metadata
(`WaveEventDataTypes`).
  - Supports three cases:
    - mapped concrete type → strong TS payload type
    - mapped `nil` → `data?: null` (explicit no-data contract)
    - unmapped event → `data?: any` (non-breaking fallback)

- **Custom WaveEvent output and default suppression**
- Suppressed default struct-based `WaveEvent` emission in
`gotypes.d.ts`.
  - Added generated `frontend/types/waveevent.d.ts` containing:
    - `WaveEventName` string-literal union from `AllEvents`
    - discriminated `WaveEvent` union keyed by `event`.

- **Generator wiring + focused coverage**
- Hooked custom event generation into
`cmd/generatets/main-generatets.go`.
  - Added `pkg/tsgen/tsgenevent_test.go` assertions for:
    - typed mapped events
    - explicit `null` for known no-data events
    - `any` fallback for unmapped events.

```ts
type WaveEvent = {
  event: WaveEventName;
  scopes?: string[];
  sender?: string;
  persist?: number;
  data?: any;
} & (
  { event: "block:jobstatus"; data?: BlockJobStatusData } |
  { event: "route:up"; data?: null } |
  { event: "workspace:update"; data?: null } |
  { event: "some:future:event"; data?: any } // fallback if unmapped
);
```

<!-- START COPILOT CODING AGENT TIPS -->
---

💬 We'd love your input! Share your thoughts on Copilot coding agent in
our [2 minute survey](https://gh.io/copilot-coding-agent-survey).

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: sawka <2722291+sawka@users.noreply.github.com>
Co-authored-by: sawka <mike@commandline.dev>
2026-02-20 17:04:03 -08:00
Mike Sawka
f3b1c16882
improve the schema for widgets.json (#2913) 2026-02-20 16:59:38 -08:00
Mike Sawka
1840de4a13
New Context Menu Item + Wsh Command to Save Scrollback of a Terminal Widget (#2892)
This pull request adds a new command-line feature for exporting terminal
scrollback, improves the accuracy of scrollback extraction (especially
for wrapped lines), and introduces a "Save Session As..." menu option in
the frontend to make exporting session logs more user-friendly. The
changes touch both the backend CLI and the frontend, ensuring users can
easily capture and save terminal output for processing or archiving.
2026-02-19 12:49:57 -08:00
0xGingi
69435aedbb
feat: add NanoGPT as AI provider (#2746)
adds https://nano-gpt.com as a provider
2026-02-19 12:13:35 -08:00
Mike Sawka
facefdd12e
job events, terminal command types, connect error codes (#2855) 2026-02-10 20:23:06 -08:00
Mike Sawka
9ea1d24d6c
update logging for jobmanager. (#2854)
one directory, prune files in connserver, write keepalives every hour.
remove senddata log line.
2026-02-10 18:43:54 -08:00
Mike Sawka
16877fe433
Working on Test Harness for Remote Connections (#2829)
This pull request introduces a new `test-conn` command-line tool for
testing SSH connection flows and user input handling, along with
improvements to user input provider extensibility and several
configuration and validation enhancements.

* New `test-conn` CLI Tool
* User Input Provider Abstraction
* Refactored user input handling to use a pluggable `UserInputProvider`
interface, with a default `FrontendProvider` and the ability to set a
custom provider
* AI Configuration and Verbosity updates
* Enforced that a `SwapToken` must be present in `CommandOptsType` when
starting a remote shell with wsh, improving validation and error
handling. (`pkg/shellexec/shellexec.go`)
* Improved config directory watcher logic to log the config directory
path and avoid logging errors for non-existent subdirectories
2026-02-09 21:50:34 -08:00
Mike Sawka
458fcc2a5d
New ConnMonitor to Track "Stalled" Connection State for SSH Conns (#2846)
* ConnMonitor to track stalled connections
* New Stalled Overlay to show feedback when we think a connection is
stalled
* New Icon in ConnButton to show stalled connections
* Callbacks in domain socket and PTYs to track activity
2026-02-09 17:11:55 -08:00
Mike Sawka
f36187f619
stress test for the new RPC streaming primitives (+ bug fixes) (#2828)
This pull request introduces a new integration test tool for the
StreamManager streaming system, adding a standalone test binary with
supporting modules for simulating and verifying high-throughput data
transfer. The changes include a test driver, a configurable in-memory
delivery pipe for simulating network conditions, a data generator, a
verifier for end-to-end integrity, and a metrics tracker. Additionally,
several improvements are made to the circular buffer and StreamManager
for better handling of blocking writes and out-of-order acknowledgments.

**New StreamManager Integration Test Tool**

* Added a new test binary `cmd/test-streammanager` with a main driver
(`main-test-streammanager.go`) that orchestrates end-to-end streaming
tests, including configuration for data size, delivery delay/skew,
window size, slow reader simulation, and verbose logging.
* Implemented a configurable `DeliveryPipe` (`deliverypipe.go`) for
simulating network delivery with delay and skew, supporting separate
data and ack channels, out-of-order delivery, and high water mark
tracking.
* Added `WriterBridge` and `ReaderBridge` modules for interfacing
between brokers and the delivery pipe, enforcing correct directionality
of data and acks.
* Created a sequential test data generator (`generator.go`) and a
verifier (`verifier.go`) for checking data integrity and reporting
mismatches.
[[1]](diffhunk://#diff-3f2d6e0349089e3748c001791a383687b33a2c2391fd3baccfceb83e76e6ee0dR1-R40)
[[2]](diffhunk://#diff-cb3aab0bae9bec15ef0c06fe5d9e0e96094affcf4720680605a92054ab717575R1-R61)
* Introduced a metrics module (`metrics.go`) for tracking throughput,
packet counts, out-of-order events, and pipe usage, with a summary
report at test completion.

**StreamManager and CirBuf Improvements**

* Refactored circular buffer (`pkg/jobmanager/cirbuf.go`) to replace
blocking writes with a non-blocking `WriteAvailable` method, returning a
wait channel for buffer-full scenarios, and removed context-based
cancellation logic.
* Updated StreamManager (`pkg/jobmanager/streammanager.go`) to track the
maximum acknowledged sequence/rwnd tuple, ignoring stale or out-of-order
ACKs, and resetting this state on disconnect.
* Modified StreamManager's data handling to use the new non-blocking
buffer write logic, ensuring correct signaling and waiting for space
when needed.

**Minor Cleanup**

* Removed unused context import from `cirbuf.go`.
* Minor whitespace cleanup in `streambroker.go`.
2026-02-05 14:48:12 -08:00
Mike Sawka
0fb25daf24
Durable Session PR #5 (Icon Flyover, More Bug Fixes, Corner Cases) (#2825)
* Track wave version when job was created (for future backward compat)
* New Flyover Menu off of "shell durability" icon.  Help + Actions + UX
* Bug with conn typeahead not closing when clicking disconnect
* Auto-reconnect jobs that have been disconnected (check for "gone"
state)
* Disable tab indicator stuff (only indicates tab not block)
* Fix bug with dev logging path on connserver
* Fix bugs with restarting blockcontrollers on startup
* Fix bugs with getting HasExited status from job manager
* Fix startup files, quoting, tilde, etc in start job flow
* ...
2026-02-05 10:15:22 -08:00
Mike Sawka
a70c788ae6
More Durable Shell Bug Fixes (#2822)
* Lots of work on ResyncController, issues with stale data, and
connection switching
* Add+Fix termination messages for shell controller
* Prune done/detached jobs on a timer
* Remove circular dependencies from wcore, use blockclose event in both
jobcontroller and blockcontroller instead of direct calls
* Fix concurrency bugs with job termination
* Send object update events when modifying the block datastructure in
jobcontroller
2026-02-04 11:10:21 -08:00
Mike Sawka
ff9923f486
Session Durability Checkpoint (#2821)
Working on bug fixes and UX. Streams restarting, fixed lots of bugs,
timing issues, concurrency bugs. Get status shipped to the FE to drive
"shield" state display. Deal with stale streams.

Also big UX changes to the block headers. Specialize the terminal
headers to prioritize the connection (sense of place), remove old
terminal icon and word "Terminal" from the header. Also drop "Web" and
"Preview" labels on web/preview blocks.

Added `wsh focusblock` command.
2026-02-03 11:49:52 -08:00
Mike Sawka
73bb5beb3b
Tab Indicators, Confirm on Quit, etc (#2811)
* Adds a Confirm on Quit dialog (and new config to disable it)
* New MacOS keybinding for Cmd:ArrowLeft/Cmd:ArrowRight to send Ctrl-A
and Ctrl-E respectively
* Fix Ctrl-V regression on windows to allow config setting to override
* Remove questionnaire in bug template
* Full featured tab indicators -- icon, color, priority, clear features.
Can be manipulated by new `wsh tabindicator` command
* Hook up BEL to new tab indicator system. BEL can now play a sound
and/or set an indicator (controlled by two new config options)
2026-01-29 17:04:29 -08:00
Mike Sawka
93b7269304
Do not allow large/recursive file transfers (for now), remove s3 and wavefile fs implementations (#2808)
Big simplification. Remove the FileShare interface that abstracted
wsh://, s3://, and wavefile:// files.
It produced a lot of complexity for very little usage. We're just going
to focus on the wsh:// implementation since that's core to our remote
workflows.

* remove s3 implementation (and connections, and picker items for
preview)
* remove capabilities for FE
* remove wavefile backend impl as well
* simplify wsh file remote backend
* remove ability to copy/move/ls recursively
* limit file transfers to 32m

the longer term fix here is to use the new streaming RPC primitives.
they have full end-to-end flow-control built in and will not create
pipeline stalls, blocking other requests, and OOM issues.

these other impls had to be removed (or fixed) because transferring
large files could cause stalls or crashes with the new router
infrastructure.
2026-01-28 14:28:31 -08:00
Mike Sawka
01a26d59e6
Persistent Terminal Sessions (+ improvements and bug fixes) (#2806)
Lots of updates across all parts of the system to get this working. Big
changes to routing, streaming, connection management, etc.

* Persistent sessions behind a metadata flag for now
* New backlog queue in the router to prevent hanging
* Fix connection Close() issues that caused hangs when network was down
* Fix issue with random routeids (need to be generated fresh each time
the JWT is used and not fixed) so you can run multiple-wsh commands at
once
* Fix issue with domain sockets changing names across wave restarts
(added a symlink mechanism to resolve new names)
* ClientId caching in main server
* Quick reorder queue for input to prevent out of order delivery across
multiple hops
* Fix out-of-order event delivery in router (remove unnecessary go
routine creation)
* Environment testing and fix environment variables for remote jobs (get
from connserver, add to remote job starts)
* Add new ConnServerInit() remote method to call before marking
connection up
* TODO -- remote file transfer needs to be fixed to not create OOM
issues when transferring large files or directories
2026-01-28 13:30:48 -08:00
Mike Sawka
ae3e9f05b7
new job manager / framework for creating persistent remove sessions (#2779)
lots of stuff here.

introduces a streaming framework for the RPC system with flow control.
new authentication primitives for the RPC system. this is used to create
a persistent "job manager" process (via wsh) that can survive
disconnects. and then a jobcontroller in the main server that can
create, reconnect, and manage these new persistent jobs.

code is currently not actively hooked up to anything minus some new
debugging wsh commands, and a switch in the term block that lets me test
viewing the output.

after PRing this change the next steps are more testing and then
integrating this functionality into the product.
2026-01-21 16:54:18 -08:00
Mike Sawka
adc823fd3b
rip out osc 23198 and osc 9283 handlers (#2736) 2026-01-02 11:51:37 -08:00
Mike Sawka
2b243627c3
very large refactor of wshrouter (#2732)
the PR spiraled and ended up being much larger than anticipated.

it is a refactor of wshrouter to have it track "links" as opposed to
just routes. this lets us simplify a lot of things when it comes to
multi-level routing.

* now the router can handle unauthenticated links directly, instead of a
weird limbo in wshproxy
* no more wshmultiproxy
* no more "authtoken" weirdness
* more straightforward handling in connserver (when using router option)

also adds more debugging, more logging, some windows fixes, other wsl
fixes
2026-01-01 17:44:00 -08:00
Mike Sawka
3c3c665ac2
fix tool approval lifecycle to match SSE connection, not keep-alives (#2693)
tie the tool approvals to the lifecycle of the SSE connection, NOT FE
keepalive packets. this prevents timeouts when the FE hasn't rendered
the tools (or FE tool rendering lifecycle issues). also allows immediate
timeouts on refresh.

other small fixes: convert to use wshclient in wshcmd-*.go files,
cleanup in SSE code
2025-12-18 16:43:59 -08:00
Mike Sawka
667de56198
updates to allow wave ai panel to function without telemetry with BYOK/local models (#2685)
* lots of changes to how aimodes are shown on frontend
* backend now requires aimode to be sent with request
* diagnostic ping
2025-12-16 09:06:56 -08:00
Mike Sawka
a5599e9105
QoL and Layout Fixes for Windows (#2661)
* remove title bar on windows windows
* re-integrate native controls into our tab bar
* remove menu completely (weird "Alt" activation)
* actually fix Ctrl-V in terminal
* clamp zoom levels better (0.4 - 2.6)
* simplify macos / windows drag regions (keep responsive to zoom)
* fix settings schemas for windows
2025-12-11 17:50:02 -08:00
Mike Sawka
c9c6192fc9
minor v0.13 fixes (#2649) 2025-12-08 21:58:54 -08:00
Mike Sawka
ea68aec9f4
v0.13 Release Notes, Docs Updates, Onboarding Updates (#2642) 2025-12-08 16:29:19 -08:00
Copilot
4449895424
Add Google Gemini backend for AI chat (#2602)
- [x] Add new API type constant for Google Gemini in uctypes.go
- [x] Create gemini directory under pkg/aiusechat/
- [x] Implement gemini-backend.go with streaming chat support
- [x] Implement gemini-convertmessage.go for message conversion
- [x] Implement gemini-types.go for Google-specific types
- [x] Add gemini backend to usechat-backend.go
- [x] Support tool calling with structured arguments
- [x] Support image upload (base64 inline data)
- [x] Support PDF upload (base64 inline data)
- [x] Support file upload (text files, directory listings)
- [x] Build verification passed
- [x] Add documentation for Gemini backend usage
- [x] Security scan passed (CodeQL found 0 issues)
- [x] Code review passed with no comments
- [x] Revert tsunami demo go.mod/go.sum files (per feedback - twice)
- [x] Add `--gemini` flag to main-testai.go for testing
- [x] Fix schema validation for tool calling (clean unsupported fields)
- [x] Preserve non-map property values in schema cleaning

## Summary

Successfully implemented a complete Google Gemini backend for WaveTerm's
AI chat system. The implementation:

- **Follows existing patterns**: Matches the structure of OpenAI and
Anthropic backends
- **Fully featured**: Supports all required capabilities including tool
calling, images, PDFs, and files
- **Properly tested**: Builds successfully with no errors or warnings
- **Secure**: Passed CodeQL security scanning with 0 issues
- **Well documented**: Includes comprehensive package documentation with
usage examples
- **Minimal changes**: Only affects backend code under pkg/aiusechat
(tsunami demo files reverted twice)
- **Testable**: Added `--gemini` flag to main-testai.go for easy testing
with SSE output
- **Schema compatible**: Cleans JSON schemas to remove fields
unsupported by Gemini API while preserving valid structure

## Testing

To test the Gemini backend using main-testai.go:
```bash
export GOOGLE_APIKEY="your-api-key"
cd cmd/testai
go run main-testai.go --gemini 'What is 2+2?'
go run main-testai.go --gemini --model gemini-1.5-pro 'Explain quantum computing'
go run main-testai.go --gemini --tools 'Help me configure GitHub Actions monitoring'
```


Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: sawka <2722291+sawka@users.noreply.github.com>
2025-12-05 12:43:42 -08:00
Mike Sawka
2f92e23ece
more config updates (secrets, waveai, ai:provider) (#2631) 2025-12-05 10:10:43 -08:00
Mike Sawka
c32eb6690b
fixup macos zsh_history (merge wave history back to => ~/.zsh_history) (#2625) 2025-12-02 15:50:23 -08:00
Mike Sawka
d1ebcc9d07
new waveconfig widget, consolidate config/help in widget sidebar (#2604) 2025-11-28 11:56:59 -08:00
Mike Sawka
73e56193e7
implement openai chat completions api -- enables local model support (#2600) 2025-11-26 11:43:19 -08:00
Mike Sawka
d97ba477fc
add an "add" button when there are no secrets, also add wsh secret ui cli command (#2598) 2025-11-25 09:11:54 -08:00
Mike Sawka
d6578b7929
update to gpt-5.1 (#2552) 2025-11-13 21:10:28 -08:00
Mike Sawka
4b6a3ed330
secrets view (UI to manage wave secrets) (#2526) 2025-11-07 13:59:09 -08:00
Mike Sawka
58392f7601
new secret store impl (#2525)
adds a new secret store protected by electron's safeStorage API.
currently just hooked up to the CLI via a new wsh command: `wsh secret`.

will be used to power secrets in tsunami later (and for config +
connections)
2025-11-05 15:40:54 -08:00
Mike Sawka
49c9d70601
various fixes and enhancements for v0.12.2 (#2508) 2025-11-03 12:31:18 -08:00
Mike Sawka
a19cb6f300
Add Write File Tools to WaveAI (#2492)
also updates ROADMAP.md, and fixes a node pruning bug on the FE, and
adds a new diff viewer that we can view the write_text_file and
edit_text_file diffs in. adds a backup file system that can be used to restore AI edited files back to their original states.
2025-10-31 14:40:03 -07:00
Mike Sawka
5d4fa5ba4d
add env var to start pprof server (#2488) 2025-10-28 14:23:50 -07:00
Mike Sawka
ba573c4bcb
tsunami builder 3 (checkpoint) (#2487)
Got preview hooked up, log output hooked up, environment tab hooked
up... the controller, restarting the apps. it is actually working! still
lots to do and lots of hard coding to fix, but it is coming together...
2025-10-28 13:59:02 -07:00
Mike Sawka
edacd6580f
allow wsh ai to attach directory listings to the chat (#2469) 2025-10-22 09:47:58 -07:00
Mike Sawka
2e0b3d2569
implement more OSC 16162 for fish, pwsh, and bash (#2462) 2025-10-20 17:29:38 -07:00
Copilot
0d04b99b46
Add Google AI file summarization package (#2455)
- [x] Create new directory pkg/aiusechat/google
- [x] Implement SummarizeFile function with:
  - Context parameter for timeout
  - File validation (images, PDFs, text files only)
  - Use gemini-2.5-flash-lite model
  - Configurable API URL and prompt as constants
  - Return (string, usage, error)
- [x] Define Google-specific usage struct
- [x] Test the implementation (all tests pass)
- [x] Verify with existing linting and build
- [x] Run CodeQL security check (no issues found)
- [x] Revert unintended tsunami demo dependency changes

## Summary

Successfully implemented a new Google AI package at
`pkg/aiusechat/google` with:

1. **SummarizeFile function** - A simple request-response API (not
streaming, not SSE)
   - Takes context for timeout
   - Validates file types (images, PDFs, text only) 
   - Enforces file size limits matching wshcmd-ai.go
   - Uses gemini-2.5-flash-lite model
   - Returns (summary string, usage stats, error)

2. **GoogleUsage struct** - Tracks token consumption:
   - PromptTokenCount
   - CachedContentTokenCount  
   - CandidatesTokenCount
   - TotalTokenCount

3. **Configurable constants**:
   - GoogleAPIURL (for reference)
   - SummarizePrompt (customizable prompt)
   - SummarizeModel (gemini-2.5-flash-lite)

4. **Comprehensive tests** - 41.7% coverage with all tests passing
5. **Security verified** - No CodeQL alerts
6. **Package documentation** - doc.go with usage examples

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: sawka <2722291+sawka@users.noreply.github.com>
2025-10-17 17:24:06 -07:00
Mike Sawka
6a173a6227
working on more terminal context (#2444)
* add automatic OSC 7 support to bash and zsh
* add new wave OSC 16162 (planck length) to get up-to-date shell
information into blockrtinfo. currently implemented only for zsh. bash
will not support as rich of data as zsh, but we'll be able to do some.
* new rtinfo will be used to provide better context for AI in the
future, and to make sure AI is running safe commands.
* added a small local machine description to tab context (so AI knows
we're running on MacOS, Linux, or Windows)
2025-10-17 12:19:40 -07:00
Mike Sawka
af3279b411
handle reasoning deltas and display them in the UI (#2443) 2025-10-16 11:17:24 -07:00
Mike Sawka
0fd0daf134
Reimplement wsh ai, fix text file attaching format (#2435) 2025-10-15 17:28:56 -07:00
Mike Sawka
7451294f11
onboarding and polish for v0.12 (#2411) 2025-10-09 16:29:09 -07:00
Oleksandr Hreshchuk
7681214fa1
feat(cli): add blocks list with filtering and JSON output (#2337)
### What This Does
Adds a new `wsh blocks list` subcommand that lists all blocks in all or
specified workspace, window, or tab. Includes filtering options and JSON
output for automation.

### Motivation
Wave users had no simple way to programmatically discover block IDs for
scripting and automation. This feature:
- Enables workflows like syncing Preview widgets with `cd` changes.
- Simplifies debugging and introspection.
- Provides a foundation for future CLI enhancements (focus/close
blocks).

### Usage
```wsh blocks [list|ls|get] [--workspace=<workspace-id>] [--window=<window-id>] [--tab=<tab-id>] [--view=<view-type>] [--json]```

Where `<view-type>` can be one of: term, terminal, shell, console, web, browser, url, preview, edit, sysinfo, sys, system, waveai, ai, or assistant.

### Notes
- Fully backward compatible.
- Code follows existing CLI patterns.
2025-10-08 13:41:24 -07:00
Mike Sawka
d272a4ec03
New AIPanel (#2370)
Massive PR, over 13k LOC updated, 128 commits to implement the first pass at the new Wave AI panel.  Two backend adapters (OpenAI and Anthropic), layout changes to support the panel, keyboard shortcuts, and a huge focus/layout change to integrate the panel seamlessly into the UI.

Also fixes some small issues found during the Wave AI journey (zoom fixes, documentation, more scss removal, circular dependency issues, settings, etc)
2025-10-07 13:32:10 -07:00
Mike Sawka
6e3554407b
AI SDK Backend (#2336)
Working on AI SDK compatible backends for OpenAI and Anthropic. Thinking + ToolUse etc.  For use with AI SDK useChat on frontend.  Still needs more testing, WIP, but this is a good start.  Want to get this committed to so I can work on more integrations.
2025-09-12 12:56:24 -07:00