15 Commits

Author SHA1 Message Date
Fam Zheng
ddbe61818b Use uv venv for embedding, pre-download model in Docker build
- Use /app/venv with uv instead of system python/pip
- Pre-download all-MiniLM-L6-v2 model during Docker build

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 08:33:21 +00:00
Fam Zheng
fbf636868c Switch from fastembed to Python sentence-transformers for embedding
ort (ONNX Runtime) has no prebuilt binaries for aarch64-musl.
Use a Python subprocess with sentence-transformers instead:
- scripts/embed.py: reads JSON stdin, outputs embeddings
- kb.rs: calls Python script via tokio subprocess
- Dockerfile: install python3 + sentence-transformers

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 08:31:31 +00:00
Fam Zheng
8483359cbc Fix: use rustls instead of native-tls for fastembed
Avoids OpenSSL dependency which fails on musl cross-compilation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 08:17:44 +00:00
Fam Zheng
d9d3bc340c Add global knowledge base with RAG search
- KB module: fastembed (AllMiniLML6V2) for CPU embedding, SQLite for
  vector storage with brute-force cosine similarity search
- Chunking by ## headings, embeddings stored as BLOB in kb_chunks table
- API: GET/PUT /api/kb for full-text read/write with auto re-indexing
- Agent tools: kb_search (top-5 semantic search) and kb_read (full text)
  available in both planning and execution phases
- Frontend: Settings menu in sidebar footer, KB editor as independent
  view with markdown textarea and save button
- Also: extract shared db_err/ApiResult to api/mod.rs, add context
  management design doc

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 08:15:50 +00:00
Fam Zheng
1aa81896b5 Add project soft-delete with workspace archival
- Add delete button (×) to sidebar project list, shown on hover
- Soft-delete: mark projects as deleted in DB instead of hard delete
- Move workspace files to /app/data/deleted/ folder on deletion
- Filter deleted projects from list query
- Auto-select next project after deleting current one
- Also includes agent prompt improvements for reverse proxy paths

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 07:56:37 +00:00
Fam Zheng
2df4e12d30 Agent loop state machine refactor, unified LLM interface, and UI improvements
- Rewrite agent loop as Planning→Executing(N)→Completed state machine with
  per-step context isolation to prevent token explosion
- Split tools and prompts by phase (planning vs execution)
- Add advance_step/save_memo tools for step transitions and cross-step memory
- Unify LLM interface: remove duplicate types, single chat_with_tools path
- Add UTF-8 safe truncation (truncate_str) to prevent panics on Chinese text
- Extract CreateForm component, add auto-scroll to execution log
- Add report generation with app access URL, non-blocking title generation
- Add timer system, file serving, app proxy, exec module
- Update Dockerfile with uv, deployment config

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 22:35:33 +00:00
Fam Zheng
e2d5a6a7eb Use deploy.sh for make deploy target
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 18:02:10 +00:00
Fam Zheng
ed66d9ac73 Add deployment documentation and deploy script
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 10:56:51 +00:00
Fam Zheng
6481c9d386 Add imagePullSecrets for registry auth
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 10:53:40 +00:00
Fam Zheng
85ab93798b Simplify Dockerfile to use pre-built musl binary, add Ingress
- Dockerfile: drop Rust build stage, COPY static musl binary directly
- Add traefik Ingress for tori.oci.euphon.net with LE cert

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 10:51:14 +00:00
Fam Zheng
eb8f5173f3 Bump Rust image to 1.86 for edition2024 support
getrandom 0.4.1 requires edition2024 which needs Cargo >= 1.85.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 10:48:14 +00:00
Fam Zheng
a26950c432 Add OCI ARM64 deployment setup
- deploy.sh: local-to-OCI deploy script (rsync config, docker build, kubectl apply)
- deployment.yaml: namespace, PVC, Deployment with registry image, Service
- Dockerfile: COPY config.yaml directly into image, drop openssh-client

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 10:47:11 +00:00
Fam Zheng
67ef516462 Switch reqwest to rustls-tls for cross-platform builds
Removes openssl dependency, enabling clean builds on ARM/musl targets.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 10:42:34 +00:00
Fam Zheng
7edbbee471 Tori: AI agent workflow manager - initial implementation
Rust (Axum) + Vue 3 + SQLite. Features:
- Project CRUD REST API with proper error handling
- Per-project agent loop (mpsc + broadcast channels)
- LLM-driven plan generation and replan on user feedback
- SSH command execution with status streaming
- WebSocket real-time updates to frontend
- Four-zone UI: requirement, plan (left), execution (right), comment

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 10:36:50 +00:00
Fam Zheng
1122ab27dd Initial commit 2026-02-28 10:13:39 +00:00