This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

tools.covibe: register sessions in the dashboard (remote mode)

+35 -38
+34 -37
tools/covibe/flake-module.nix
··· 1 - { self, ... }: 1 + { self, inputs, ... }: 2 2 { 3 3 perSystem = 4 4 { pkgs, system, ... }: 5 5 let 6 6 # Client omp carrying covibe's env-driven headless collab autostart 7 - # (OMP_COLLAB_*) -- the exact patch the neoprism covibe service uses. A 8 - # session started from any machine hosts natively against the covibe 9 - # relay and is immediately joinable / browser-viewable. It does NOT show 10 - # up in the covibe dashboard overview: that list is built from a local 11 - # spool dir + local pid liveness + a per-session unix socket, so it only 12 - # enumerates sessions running on the dashboard host. 7 + # (OMP_COLLAB_*) -- the exact patch the neoprism covibe service uses, so a 8 + # session hosts natively against the covibe relay. `covibe session` mints 9 + # the room and passes OMP_COLLAB_* to this omp. 13 10 ompCollab = self.legacyPackages.${system}.llm.omp.overrideAttrs (o: { 14 11 patches = (o.patches or [ ]) ++ [ ../../2configs/omp-collab-autostart.patch ]; 15 12 }); 13 + covibe = inputs.covibe.packages.${system}.covibe; 16 14 in 17 15 { 16 + # Launch omp as a co-vibing session from any machine: `covibe session 17 + # --dashboard` registers the session over the dashboard's REST API (with 18 + # heartbeat + pane push), so it shows up in the covibe.lassul.us overview 19 + # just like a session started locally on neoprism, and is joinable / 20 + # browser-viewable via the collab relay. 18 21 packages.covibe = 19 22 (pkgs.writeShellApplication { 20 23 name = "covibe"; 21 - runtimeInputs = [ 22 - pkgs.coreutils 23 - pkgs.qrencode 24 - ]; 24 + runtimeInputs = [ pkgs.coreutils ]; 25 25 text = '' 26 - relay="''${COVIBE_RELAY:-wss://covibe.lassul.us}" 27 - web="''${COVIBE_WEB:-https://covibe.lassul.us/c}" 26 + dashboard="''${COVIBE_DASHBOARD:-https://covibe.lassul.us}" 27 + relay="''${COVIBE_LOCAL_RELAY:-wss://covibe.lassul.us}" 28 + web="''${COVIBE_WEB_CLIENT:-https://covibe.lassul.us/c}" 28 29 host="''${COVIBE_RELAY_HOST:-covibe.lassul.us}" 30 + name="''${COVIBE_NAME:-$(basename "$PWD")}" 29 31 30 - # Mint an omp-compatible collab room, matching covibe's collablink: 31 - # room = base64url(16 random bytes) -> 22 chars 32 - # secret = base64url(32-byte AES key + 16-byte token) -> 64 chars 33 - # Handing these to omp via OMP_COLLAB_ROOM/KEY makes the shareable 34 - # link stable and known up front (no scraping the TUI). 35 - room="$(head -c 16 /dev/urandom | basenc --base64url -w0 | tr -d '=')" 36 - secret="$(head -c 48 /dev/urandom | basenc --base64url -w0 | tr -d '=')" 32 + # Dashboard API key: env, else the password store, else bail. 33 + api_key="''${COVIBE_API_KEY:-}" 34 + if [ -z "$api_key" ] && command -v pass >/dev/null 2>&1; then 35 + api_key="$(pass show covibe/api-key 2>/dev/null || true)" 36 + fi 37 + if [ -z "$api_key" ]; then 38 + echo "covibe: no API key. Set COVIBE_API_KEY or add 'covibe/api-key' to pass." >&2 39 + exit 1 40 + fi 37 41 38 - join="''${host}/r/''${room}.''${secret}" 39 - browser="''${web}/#''${join}" 40 - 41 - export OMP_COLLAB_RELAY="$relay" 42 - export OMP_COLLAB_WEB="$web" 43 - export OMP_COLLAB_ROOM="$room" 44 - export OMP_COLLAB_KEY="$secret" 45 - 46 - { 47 - printf '\n covibe: hosting this session on %s\n\n' "$host" 48 - printf ' omp join %s\n' "$join" 49 - printf ' browser %s\n\n' "$browser" 50 - qrencode -t UTF8 -m 2 "$browser" || true 51 - printf '\n' 52 - } >&2 53 - 54 - exec ${ompCollab}/bin/omp "$@" 42 + exec ${covibe}/bin/covibe session \ 43 + --dashboard "$dashboard" \ 44 + --api-key "$api_key" \ 45 + --relay-host "$host" \ 46 + --web-client "$web" \ 47 + --local-relay "$relay" \ 48 + --omp ${ompCollab}/bin/omp \ 49 + --name "$name" \ 50 + --dir "$PWD" \ 51 + -- "$@" 55 52 ''; 56 53 }).overrideAttrs 57 54 { passthru.usage = builtins.readFile ./usage.kdl; };
+1 -1
tools/covibe/usage.kdl
··· 1 1 bin "covibe" 2 - about "Launch omp as a co-vibing collab host on the covibe relay (joinable + browser-viewable from any machine)" 2 + about "Launch omp as a co-vibing session that registers in the covibe.lassul.us dashboard (joinable + browser-viewable from any machine)" 3 3 4 4 arg "[omp-args...]" help="Arguments passed through to omp"