15 Commits

Author SHA1 Message Date
Fam Zheng
12cd831963 fix: slim Dockerfile — server needs no Python/torch (workers handle execution) 2026-04-06 13:53:53 +01:00
Fam Zheng
65fc67e01a fix: remove jwt-private.pem from Dockerfile (executor runs on worker) 2026-04-06 13:25:53 +01:00
Fam Zheng
b5cecec485 docs: update for worker mode (tori server / tori worker) 2026-04-06 12:56:50 +01:00
Fam Zheng
186d882f35 feat: JWT token generation API + auto-inject TORI_JWT in executor
- POST /tori/api/token — sign ES256 JWT with configurable private key
- exec.rs auto-generates and injects TORI_JWT env var for all commands
- Config: jwt_private_key field for PEM file path
2026-03-16 09:44:58 +00:00
Fam Zheng
728ab2e8fd Pre-install common Python packages in workspace venv and warm Docker cache
Install httpx, fastapi, uvicorn, requests, flask, pydantic, numpy, pandas,
matplotlib, pillow, jinja2, pyyaml and more on workspace creation. Also
pre-warm uv cache in Dockerfile so first project setup is near-instant.
uv's global cache (~/.cache/uv/) is shared across all project venvs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 09:19:48 +00:00
Fam Zheng
ee4a5dfc95 App-templates: LLM auto-selects project template based on user requirement
- Add webapp template (FastAPI + SQLite) with INSTRUCTIONS.md and setup.sh
- select_template() scans templates, asks LLM to match; apply_template() copies to workspace
- ensure_workspace() runs setup.sh if present, otherwise falls back to default venv
- INSTRUCTIONS.md injected into planning and execution prompts
- Fix pre-existing clippy warning in kb.rs (filter_map → map)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 21:33:40 +00:00
Fam Zheng
3d1c910c4a Switch Docker base from alpine to debian-slim for torch compatibility
torch/sentence-transformers only provide manylinux (glibc) wheels,
not musl. The musl-compiled tori binary is statically linked and
runs fine on glibc systems.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 08:38:49 +00:00
Fam Zheng
db8f6cb500 Fix: pin Python 3.12 for torch compatibility on aarch64
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 08:34:57 +00:00
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
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
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
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