Nested directories in the embedded FS always expect a `/`, even on
Windows. This adds a fallback in `readConfigFileFS` to try swapping the
path separators if we get an "invalid argument" error from `Read`
The docsite path was being initialized as a global variable. This wasn't
an issue before we were caching and unsetting the env vars, but now that
`wavebase.GetWaveAppPath()` returns the contents of the cached variable,
we need to read its value at runtime, since it won't be set at the time
the global variable is initialized.
Renames defaultwidgets.json file in defaultconfig to widgets.json and
removes references to defaultwidgets in the codebase and documentation.
Going forward, users will see one unified list of widgets in the sidebar
with no separator between default and custom widgets. Users can manually
move any edits to their defaultwidgets.json file into their widgets.json
file to get back their overrides.
* Fix VDom url caching -- use regular requests
* new boilerplate to make writing apps easier
* render-blocking global styles (to prevent render flash)
* bug fixes and new functionality etc.
* get RefOperations and RefUpdates working.
* implement a <canvas> API that can be called using RefOperations
* prop to disable rehype/markdown (memory leak)
Lots of quality of life improvements (and bug fixes):
* Class(), ClassIf(), ClassIfElse() methods
* <wave:style> that can use a file vdom:/// url
* UseStateWithFn() to allow for functional setters
* If, IfElse, and ForEach for vdom construction
* batched updates for large updates -- streaming -- to get around packet size issues
* more flexible file sending code, for []byte, io.Reader, fs.File, and a fileName (with optional MimeType)
* fix the vdom:// protocol handler to work with fetch
* updated wshcmd-html for new best practices
* new vdomevents to support click, change, keydown, etc. easier type
signature
* can now pass a prop type instead of always converting to
map[string]any
* implement DefineComponent to allow easier vdom creation using a
component function directly
* separate vdomclient Make from Connect
* lots of bug fixes to get everything working again
* PStyle and special "style" attribute handling
This change will skip over match statements in the ssh config without
panicking. Note that this change still does not add match statement
parsing--it merely makes it possible to continue parsing if the match
keyword is present.
While matching [user@]host[:port], we previously did not allow capital
letters in host.
While this makes sense for a hostname, it does not make sense to make
that restriction for a host. Since this can match on both, we must widen
it to accept characters allowed in host.
Going forward for new installations, config and data files will be
stored at the platform default paths, as defined by
[env-paths](https://www.npmjs.com/package/env-paths).
For backwards compatibility, if the `~/.waveterm` or `WAVETERM_HOME`
directory exists and contains valid data, it will be used. If this check
fails, then `WAVETERM_DATA_HOME` and `WAVETERM_CONFIG_HOME` will be
used. If these are not defined, then `XDG_DATA_HOME` and
`XDG_CONFIG_HOME` will be used. Finally, if none of these are defined,
the [env-paths](https://www.npmjs.com/package/env-paths) defaults will
be used.
As with the existing app, dev instances will write to `waveterm-dev`
directories, while all others will write to `waveterm`.
Adds new functionality on the backend that will merge any file from the
config directory that matches `<partName>.json` or `<partName>/*.json`
into the corresponding config part (presets, termthemes, etc.). This
lets us separate the AI presets into `presets/ai.json` so that we can
add a dropdown in the AI preset selector that will directly open the
file so a user can edit it more easily. Right now, this will create a
preview block in the layout, but in the future we can look into making
this block disconnected from the layout.
If you put AI presets in the regular presets.json file, it will still
work, since all the presets get merged. Same for any other config part.
Fixes
[https://github.com/wavetermdev/waveterm/security/code-scanning/50](https://github.com/wavetermdev/waveterm/security/code-scanning/50)
To fix the problem, we need to ensure that the size computation for the
allocation does not overflow. This can be achieved by validating the
length of `barr` before performing the arithmetic operation. We will set
a maximum allowable size for `barr` to ensure that the sum of
`oscPrefixLen(oscNum)` and `len(barr)` does not exceed the maximum value
for an `int`.
1. Define a maximum allowable size for `barr` (e.g., 64 MB).
2. Check the length of `barr` against this maximum size before
performing the allocation.
3. If `barr` exceeds the maximum size, return an error.
_Suggested fixes powered by Copilot Autofix. Review carefully before
merging._
---------
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
If a user has changed the global AI settings and added a different base
url, the Wave Proxy preset would not work because it doesn't unset all
the AI settings.
This provides a checkbox when installing wsh that will prevent the
message from popping up in the future. It can also be disabled by adding
`"askbeforewshinstall": false` to the config file.
Removes global atoms dependency from emain by moving WOS to grab the
globalAtoms from window, if present. Also removes interdependency
between wshrpcutil and wps
Also adds showmenubar setting for Windows and Linux
This will print error messages to the chat when there is an error
getting an ai response. The actual content of the responses are not
forwarded to the models in future requests.
<img width="389" alt="Screenshot 2024-10-09 at 2 36 13 PM"
src="https://github.com/user-attachments/assets/e6c6b1c1-fa19-4456-be3b-596feaeaafed">
This adds a custom resolver to the docsite server to fall back to .html
addresses when it gets a not found for a given path. This fixes an issue
where subpages would return a 404 after a hard reload of the frontend. I
also added an effect that will run on startup to resolve the latest
docsite url and set it in the metadata, since the backend port changes
on every run of the app. I also made it so that setting the default
homepage in the webview widget will also unset any block-specific
homepage.
Adds a meta field `pinnedurl` that can be set to override the
`web:defaulturl` setting for a given block. Also adds a home button to
the webview to reset the block url to the homepage
The help view is now an extension of the webview with some of the chrome
removed.
Also updates the cookie dependency to resolve a vulnerability
This will take the latest artifact from the waveterm-docs repo and embed
it in the app binary. When the help view is launched, it will be served
from our backend. If the embedded copy doesn't exist, such as in
unpackaged versions of the app or in locally packaged versions, it will
use the hosted site instead.
There is a sibling PR in the docs repository to build the embedded
version of the app (strips out some external links, removes Algolia
DocSearch, updates the baseUrl)
https://github.com/wavetermdev/waveterm-docs/pull/46
Only affects windows builds:
Previously, the ~/.waveterm/bin had to exist for wsh to be installed
properly. This fixes it to work on a remote machine where that isn't
already set up.