havre /open: build Havre's own openvenice (upstream + openvenice/havre.py)
Generate works on every tab again: each model's spec decides steps, voices, formats, durations, lyrics and video inputs, and music/video results are fetched with model + queue_id. Adds a temporary chat, a light/dark switch shared with Havre's page (havre.theme), Havre's look, and the phone fixes (labeled New chat, no shortcut hints). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BQqGFv54JJTw7p3rgGjP7C
This commit is contained in:
1 parent
2d6d7c0970
commit
b5ce690709
3 files changed
+73
-16
No files matched your search
@@ -0,0 +1,22 @@
|
||||
openvenice by nikshepsvn (https://github.com/nikshepsvn/openvenice), MIT License.
|
||||
Havre's changes (havre.py) are under the same license.
|
||||
|
||||
MIT License
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1,36 @@
|
||||
# Havre's openvenice
|
||||
|
||||
/open is Havre's fork of [openvenice](https://github.com/nikshepsvn/openvenice) (MIT, by nikshepsvn):
|
||||
upstream at one pinned commit (`OV_REF` in `tools/open.sh`) plus Havre's changes, made by `havre.py`.
|
||||
`tools/open.sh` clones upstream, runs `havre.py` in it and builds the result into `open/` on every build.
|
||||
`havre.py` is a list of exact edits: each names the upstream text it replaces and stops the build if that text
|
||||
has changed, so a newer upstream shows exactly which change needs redoing.
|
||||
|
||||
## What it changes
|
||||
|
||||
- **Generate works on every tab.** What each model takes now comes from its spec in Venice's model list
|
||||
instead of fixed lists of old model ids:
|
||||
- Image: steps reset when the model changes, stay within its maximum, and are sent only to models that take them.
|
||||
- Audio: voices, formats and speed come from the model (e.g. Chatterbox only makes wav, with its own voices).
|
||||
- Music: durations come from the model (ACE-Step only takes 60–210s in steps of 30), as do lyrics,
|
||||
instrumental and voice. Music and video results are fetched with the model and queue_id Venice asks for,
|
||||
including a finished file sent back directly or left at a private download link.
|
||||
- Video: only models that take a prompt or one image are listed (not extend or video-to-video). A model
|
||||
with only one of the two modes uses that one.
|
||||
- Edit tools: the edit models come from Venice's list.
|
||||
- Workflows: the same fixes, and current default models.
|
||||
- Models stay in Venice's own order, so each tab starts on Venice's default rather than the alphabetically first.
|
||||
- **Temporary chat**: a toggle above the chat; those chats are never saved to history.
|
||||
- **Light and dark**, with Havre's look: Times and Courier, square corners, Havre's blue. The choice is
|
||||
`havre.theme` in localStorage, shared with Havre's own page ("light", "dark", or absent to follow the system).
|
||||
- **Phones**: a labeled "New chat" button, and no ⌘ shortcut hints.
|
||||
|
||||
## Changing it
|
||||
|
||||
git clone https://github.com/nikshepsvn/openvenice ov && cd ov
|
||||
git checkout <OV_REF from tools/open.sh>
|
||||
python3 <havre>/openvenice/havre.py
|
||||
npm ci && npx vite --base=/open/ # try it
|
||||
|
||||
Then add or change the edit in `havre.py` and run `sh tools/build.sh`. To take a newer upstream, bump `OV_REF`;
|
||||
if an edit no longer matches, the build names it.
|
||||
@@ -1,24 +1,21 @@
|
||||
#!/bin/sh
|
||||
# tools/open.sh: build openvenice (https://github.com/nikshepsvn/openvenice, MIT) into open/, served at /open/.
|
||||
# Pinned to one commit; bump OV_REF to take a newer one. Run by tools/build.sh. Needs git, node 20+ and npm.
|
||||
# tools/open.sh: build Havre's fork of openvenice into open/, served at /open/.
|
||||
# The fork is upstream openvenice (https://github.com/nikshepsvn/openvenice, MIT) at one pinned commit, plus
|
||||
# Havre's changes, made by openvenice/havre.py (see openvenice/README.md for how to change them).
|
||||
# Run by tools/build.sh. Needs git, python3, node 20+ and npm.
|
||||
set -eu
|
||||
cd "$(dirname "$0")/.."
|
||||
OV_REF=d983874a79810edaffb85721911630af29d09d95
|
||||
src=$(mktemp -d)
|
||||
git clone -q https://github.com/nikshepsvn/openvenice "$src"
|
||||
git -C "$src" checkout -q "$OV_REF"
|
||||
# Phone fixes: a labeled "New chat" button, and no ⌘ shortcut hints below md width
|
||||
f="$src/src/components/layout/sidebar.tsx"
|
||||
perl -0pi -e 's/aria-label="New chat"\n(\s*)className="/aria-label="New chat"\n$1className="flex items-center gap-1.5 px-2.5 py-1.5 text-[13px] border border-white\/[0.12] /' "$f"
|
||||
perl -0pi -e 's/(<line x1="5" y1="12" x2="19" y2="12" \/><\/svg>)(\n\s*<\/button>\n\s*<\/div>\n\s*\{conversations\.length > 5)/$1<span>New chat<\/span>$2/' "$f"
|
||||
perl -0pi -e 's/title="New chat \(⌘N\)"/title="New chat"/' "$f"
|
||||
perl -0pi -e 's/<div className="px-3 py-2\.5 border-t border-white\/\[0\.04\]">(\n\s*<div className="text-\[11px\] text-white\/35 space-y-0\.5">)/<div className="hidden md:block px-3 py-2.5 border-t border-white\/[0.04]">$1/' "$f"
|
||||
grep -q "<span>New chat</span>" "$f" && grep -q "hidden md:block px-3 py-2.5" "$f"
|
||||
here=$PWD
|
||||
(cd "$src" && python3 "$here/openvenice/havre.py")
|
||||
(cd "$src" && npm ci --silent --no-audit --no-fund >/dev/null && npx vite build --base=/open/ >/dev/null)
|
||||
rm -rf open
|
||||
cp -R "$src/dist" open
|
||||
# Havre's key, handed to openvenice: same origin, so it's only a copy between two storage slots in this browser
|
||||
cat > open/havre-key.js <<'EOF'
|
||||
cat > open/havre-key.js <<'JS'
|
||||
(function () {
|
||||
try {
|
||||
var h = localStorage.getItem("havre.handoff"), handed = "";
|
||||
@@ -34,12 +31,14 @@ cat > open/havre-key.js <<'EOF'
|
||||
if (typeof key === "string" && key) sessionStorage.setItem("venice-auth", key);
|
||||
} catch (e) { /* no key then */ }
|
||||
})();
|
||||
EOF
|
||||
JS
|
||||
sed -i.bak 's|<head>|<head><script src="/open/havre-key.js"></script>|' open/index.html && rm -f open/index.html.bak
|
||||
grep -q havre-key.js open/index.html
|
||||
cat > open/LICENSE.txt <<EOF
|
||||
openvenice by nikshepsvn, MIT License: https://github.com/nikshepsvn/openvenice
|
||||
Built into Havre at /open/ from commit $OV_REF, with two small phone fixes (see tools/open.sh).
|
||||
EOF
|
||||
grep -q theme-boot.js open/index.html
|
||||
cp openvenice/LICENSE open/LICENSE.txt
|
||||
cat >> open/LICENSE.txt <<TXT
|
||||
|
||||
Built into Havre at /open/ from openvenice commit $OV_REF, with Havre's changes (openvenice/havre.py).
|
||||
TXT
|
||||
rm -rf "$src"
|
||||
echo "open/: openvenice @ $OV_REF ($(find open -type f | wc -l | tr -d ' ') files)"
|
||||
echo "open/: openvenice @ $OV_REF + havre.py ($(find open -type f | wc -l | tr -d ' ') files)"
|
||||
Reference in new issue
Block a user