diff --git a/ventures/havre/openvenice/LICENSE b/ventures/havre/openvenice/LICENSE new file mode 100644 index 0000000..9b09e71 --- /dev/null +++ b/ventures/havre/openvenice/LICENSE @@ -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. diff --git a/ventures/havre/openvenice/README.md b/ventures/havre/openvenice/README.md new file mode 100644 index 0000000..6de2c61 --- /dev/null +++ b/ventures/havre/openvenice/README.md @@ -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 + python3 /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. diff --git a/ventures/havre/tools/open.sh b/ventures/havre/tools/open.sh index 2b4a3a7..866c40d 100644 --- a/ventures/havre/tools/open.sh +++ b/ventures/havre/tools/open.sh @@ -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/(<\/svg>)(\n\s*<\/button>\n\s*<\/div>\n\s*\{conversations\.length > 5)/$1New chat<\/span>$2/' "$f" -perl -0pi -e 's/title="New chat \(⌘N\)"/title="New chat"/' "$f" -perl -0pi -e 's/
(\n\s*
)/
$1/' "$f" -grep -q "New chat" "$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|||' open/index.html && rm -f open/index.html.bak grep -q havre-key.js open/index.html -cat > open/LICENSE.txt <> open/LICENSE.txt <