Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/core-compat-audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
paths:
- 'bright_vision_core/**'
- 'cecli/**'
- 'brightdate-python/**'
- 'src/**'
- 'src-tauri/**'
- 'docs/**'
Expand All @@ -24,9 +25,10 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install bright_vision_core + cecli (editable)
- name: Install brightdate + cecli + bright_vision_core (editable)
run: |
python -m pip install -U pip
pip install -e brightdate-python
pip install -e cecli
pip install -e '.[dev]'
- name: workspace path migration tests
Expand Down
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[submodule "brightdate-python"]
path = brightdate-python
url = https://github.com/Digital-Defiance/brightdate-python.git
branch = main
[submodule "cecli"]
path = cecli
url = https://github.com/Digital-Defiance/cecli.git
Expand Down
12 changes: 12 additions & 0 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified .yarn/install-state.gz
Binary file not shown.
3 changes: 2 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Prioritize dogfoodable workflows: run `yarn dogfood:agent` (headless, no GUI req
| **`src-tauri/`** | Tauri v2 shell — spawn Vision API, git, local LLM (Ollama), file dialogs |
| **`bright_vision_core/`** | **Vision API** (parent repo) — `http_api`, `Session`, `git_workspace`, todos, SSE |
| **`cecli/`** | **Cecli** submodule — [Digital-Defiance/cecli](https://github.com/Digital-Defiance/cecli) |
| **`brightdate-python/`** | **brightdate** PyPI slice — [Digital-Defiance/brightdate-python](https://github.com/Digital-Defiance/brightdate-python) |
| **`scripts/vision_serve.py`** | Tauri spawn → `bright-vision-core-serve` on `:8741` |
| **`docs/`** | Architecture, ROADMAP, LOCAL_LLM |
| **`e2e/`** | Playwright (mocked `/api/core` + optional mocked Tauri) |
Expand All @@ -42,7 +43,7 @@ React (src/)
- **Do not** break `src/ipc/events.ts` without updating the shell in the same change — payloads must match `bright_vision_core` SSE (see `docs/IPC.md`).
- **Desktop:** Tauri `start_core_api` runs `scripts/vision_serve.py` (repo root) → `bright-vision-core-serve` on `127.0.0.1:8741`.
- **Web:** `bright-vision-core-serve` or Vite proxy `/api/core` → `:8741`.
- **Dev Python:** `source activate.sh` → `pip install -e` cecli submodule + parent `bright_vision_core` (`pip install -e .`).
- **Dev Python:** `source activate.sh` → `pip install -e` brightdate-python + cecli submodules + parent `bright_vision_core` (`pip install -e .`).

Deeper detail: `docs/ARCHITECTURE.md`, `docs/IPC.md`, `docs/DEVELOPMENT.md`, `docs/LOCAL_LLM.md`, `docs/TESTING_POLICY.md`.

Expand Down
53 changes: 48 additions & 5 deletions activate.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
#!/usr/bin/env sh
# Dev: editable Cecli (submodule) + bright_vision_core (parent package).
# Safe to source: does not enable set -e in your interactive shell.
# When sourced from scripts/lab.sh, $0 is lab.sh — use BRIGHT_VISION_ROOT / BV_ROOT / BASH_SOURCE.
# When sourced: zsh/BSH use %x; bash uses BASH_SOURCE; lab.sh sets BRIGHT_VISION_ROOT / BV_ROOT.
# BSH (https://bsh.digitaldefiance.org) is a zsh fork — exposes BSH_VERSION, not ZSH_VERSION.
_is_zsh_family() {
[ -n "${ZSH_VERSION:-}" ] || [ -n "${BSH_VERSION:-}" ]
}

_resolve_repo_root() {
if [ -n "${BRIGHT_VISION_ROOT:-}" ] && [ -d "${BRIGHT_VISION_ROOT}/bright_vision_core" ]; then
cd "${BRIGHT_VISION_ROOT}" && pwd
Expand All @@ -11,22 +16,51 @@ _resolve_repo_root() {
cd "${BV_ROOT}" && pwd
return 0
fi
if [ -n "${BASH_VERSION:-}" ] && [ -n "${BASH_SOURCE[0]:-}" ]; then
cd "$(dirname "${BASH_SOURCE[0]}")" && pwd
return 0
# zsh / BSH: $0 stays the interactive shell when sourced; %x is usually this file.
if _is_zsh_family; then
_zsh_src="${(%):-%x}"
case "$_zsh_src" in
bsh | zsh | bash | sh | ksh | dash | "" | -bsh | -zsh | -bash) _zsh_src="" ;;
esac
if [ -z "$_zsh_src" ] && [ -n "${funcfiletrace[1]:-}" ]; then
_zsh_src="${funcfiletrace[1]%%:*}"
fi
if [ -n "$_zsh_src" ]; then
_zsh_dir="$(cd "$(dirname "$_zsh_src")" 2>/dev/null && pwd)" || _zsh_dir=""
if [ -n "$_zsh_dir" ] && [ -d "${_zsh_dir}/bright_vision_core" ]; then
echo "$_zsh_dir"
return 0
fi
fi
fi
if [ -n "${BASH_SOURCE[0]:-}" ]; then
_bash_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" 2>/dev/null && pwd)" || _bash_dir=""
if [ -n "$_bash_dir" ] && [ -d "${_bash_dir}/bright_vision_core" ]; then
echo "$_bash_dir"
return 0
fi
fi
case "$0" in
*/activate.sh | ./activate.sh | activate.sh)
cd "$(dirname "$0")" && pwd
return 0
;;
esac
# sh/dash: executed as ./activate.sh (not sourced).
# Already in repo root (common when: cd BrightVision && source ./activate.sh).
if [ -d "./bright_vision_core" ] && [ -f "./pyproject.toml" ]; then
pwd
return 0
fi
return 1
}
ROOT="$(_resolve_repo_root)" || {
echo "activate.sh: set BRIGHT_VISION_ROOT to the repo root, or run: source ./activate.sh from that directory" >&2
echo "activate.sh: cd to the BrightVision repo root and run: source ./activate.sh" >&2
echo " (BSH/zsh/bash; or export BRIGHT_VISION_ROOT=/path/to/BrightVision)" >&2
return 1 2>/dev/null || exit 1
}
export BRIGHT_VISION_ROOT="$ROOT"
export BV_ROOT="$ROOT"
VENV="${ROOT}/.venv"

die() {
Expand Down Expand Up @@ -142,6 +176,15 @@ else
return 1
fi

if [ -f "${ROOT}/brightdate-python/pyproject.toml" ]; then
if ! "$PYTHON" -m pip install -q -e "${ROOT}/brightdate-python"; then
die "editable install failed: brightdate at ${ROOT}/brightdate-python (git submodule update --init brightdate-python)"
return 1
fi
else
echo "activate.sh: warning: brightdate-python missing — run: git submodule update --init brightdate-python" >&2
fi

if [ ! -f "${ROOT}/pyproject.toml" ]; then
die "missing ${ROOT}/pyproject.toml (bright_vision_core package)"
return 1
Expand Down
28 changes: 26 additions & 2 deletions apps/remote/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useCallback, useMemo, useState } from 'react'
import { RemoteChatPanel } from './RemoteChatPanel'
import {
ActivityIndicator,
Button,
Expand All @@ -23,6 +24,8 @@ export default function App() {
const [qrPaste, setQrPaste] = useState('')
const [health, setHealth] = useState<string | null>(null)
const [busy, setBusy] = useState(false)
const [tab, setTab] = useState<'connect' | 'chat'>('connect')
const [workspace, setWorkspace] = useState('')

const client = useMemo(
() => new CoreHttpClient(baseUrl.replace(/\/$/, ''), token.trim() || undefined),
Expand Down Expand Up @@ -63,9 +66,20 @@ export default function App() {
<ScrollView contentContainerStyle={styles.scroll}>
<Text style={styles.title}>BrightVision Remote</Text>
<Text style={styles.sub}>
R0: enter LAN URL from desktop Settings → BrightVision Remote (LAN Link), or paste QR
JSON.
LAN Link: Settings → BrightVision Remote. MVP: connect, chat, Stop, status line.
</Text>
<View style={styles.row}>
<Button title="Connect" onPress={() => setTab('connect')} />
<Button title="Chat" onPress={() => setTab('chat')} />
</View>
{tab === 'chat' ? (
<RemoteChatPanel
client={client}
defaultWorkspace={workspace}
defaultModel="ollama_chat/llama3.2"
/>
) : (
<>
<Text style={styles.label}>Vision API URL</Text>
<TextInput
style={styles.input}
Expand Down Expand Up @@ -98,6 +112,16 @@ export default function App() {
</View>
{busy ? <ActivityIndicator style={{ marginTop: 12 }} /> : null}
{health ? <Text style={styles.health}>{health}</Text> : null}
<Text style={styles.label}>Default workspace for Chat tab</Text>
<TextInput
style={styles.input}
value={workspace}
onChangeText={setWorkspace}
autoCapitalize="none"
placeholder="/path/on/laptop"
/>
</>
)}
</ScrollView>
</SafeAreaView>
)
Expand Down
122 changes: 122 additions & 0 deletions apps/remote/RemoteChatPanel.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
import { useState } from 'react'
import {
ActivityIndicator,
Button,
FlatList,
StyleSheet,
Text,
TextInput,
View,
} from 'react-native'
import type { CoreHttpClient } from '@brightvision/vision-client'
import { useRemoteSession } from './useRemoteSession'

interface RemoteChatPanelProps {
client: CoreHttpClient
defaultWorkspace: string
defaultModel: string
}

export function RemoteChatPanel({
client,
defaultWorkspace,
defaultModel,
}: RemoteChatPanelProps) {
const [workspace, setWorkspace] = useState(defaultWorkspace)
const [model, setModel] = useState(defaultModel)
const [draft, setDraft] = useState('')
const remote = useRemoteSession(client)

return (
<View style={styles.panel}>
{!remote.session ? (
<>
<Text style={styles.label}>Project workspace (absolute path on laptop)</Text>
<TextInput
style={styles.input}
value={workspace}
onChangeText={setWorkspace}
autoCapitalize="none"
placeholder="/Users/you/project"
/>
<Text style={styles.label}>Model</Text>
<TextInput
style={styles.input}
value={model}
onChangeText={setModel}
autoCapitalize="none"
placeholder="ollama_chat/…"
/>
<Button
title="Start session"
disabled={remote.busy || !workspace.trim()}
onPress={() => void remote.startSession(workspace, model)}
/>
</>
) : (
<>
<Text style={styles.status}>{remote.status}</Text>
<FlatList
style={styles.list}
data={remote.lines}
keyExtractor={(item) => String(item.id)}
renderItem={({ item }) => (
<Text
style={[
styles.line,
item.role === 'user' ? styles.user : item.role === 'assistant' ? styles.assistant : styles.system,
]}
>
{item.role === 'user' ? '› ' : item.role === 'assistant' ? '‹ ' : '• '}
{item.text}
</Text>
)}
/>
<TextInput
style={[styles.input, styles.multiline]}
value={draft}
onChangeText={setDraft}
multiline
placeholder="Message or /agent …"
editable={!remote.busy}
/>
<View style={styles.row}>
<Button
title="Send"
disabled={remote.busy || !draft.trim()}
onPress={() => {
const t = draft
setDraft('')
void remote.sendUserMessage(t)
}}
/>
<Button title="Stop" disabled={!remote.busy} onPress={() => void remote.stopTurn()} />
<Button title="End" onPress={() => void remote.endSession()} />
</View>
</>
)}
{remote.busy ? <ActivityIndicator style={{ marginTop: 8 }} /> : null}
</View>
)
}

const styles = StyleSheet.create({
panel: { flex: 1, minHeight: 320 },
label: { fontSize: 12, color: '#8b949e', marginTop: 8 },
input: {
borderWidth: 1,
borderColor: '#30363d',
borderRadius: 8,
padding: 10,
color: '#e6edf3',
backgroundColor: '#161b22',
},
multiline: { minHeight: 64, textAlignVertical: 'top', marginTop: 8 },
status: { color: '#79c0ff', fontSize: 12, marginBottom: 8, fontFamily: 'monospace' },
list: { flex: 1, marginVertical: 8 },
line: { fontSize: 14, marginBottom: 8, color: '#e6edf3' },
user: { color: '#a5d6ff' },
assistant: { color: '#d2a8ff' },
system: { color: '#8b949e', fontSize: 12 },
row: { flexDirection: 'row', gap: 8, justifyContent: 'space-between', marginTop: 8 },
})
Loading
Loading