mirror of
https://github.com/tinyhumansai/openhuman.git
synced 2026-07-28 13:32:23 +00:00
Replace hardcoded mock data (4 tools) with dynamic discovery system that generates TOOLS.md from actual V8 skills runtime (152+ tools). Key Features: - Real-time tool discovery via runtime_all_tools() command - Auto-generates comprehensive documentation with examples - Throttled updates (10s limit) to prevent excessive calls - Vite file watching exclusion to prevent reload loops - Manual update capability via dev mode button - OpenClaw-compliant formatting for AI context injection Technical Implementation: - New auto-update.ts module with discovery, grouping & markdown generation - Enhanced Tauri write_ai_config_file command for secure file operations - Removed auto-trigger from skill activation for better performance - Added ai/ directory to Vite ignore list Result: TOOLS.md now shows real tools from telegram (48), gmail (7), notion (25), github (72) instead of 4 hardcoded examples. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
58 lines
1.4 KiB
TypeScript
58 lines
1.4 KiB
TypeScript
import { defineConfig } from "vite";
|
|
import react from "@vitejs/plugin-react";
|
|
|
|
import { nodePolyfills } from "vite-plugin-node-polyfills";
|
|
|
|
const host = process.env.TAURI_DEV_HOST;
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig(async () => ({
|
|
plugins: [
|
|
nodePolyfills({
|
|
include: ["buffer", "process", "util", "os", "crypto", "stream"],
|
|
globals: {
|
|
Buffer: true,
|
|
process: true,
|
|
global: true,
|
|
},
|
|
}),
|
|
react(),
|
|
],
|
|
|
|
// Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`
|
|
//
|
|
// 1. prevent Vite from obscuring rust errors
|
|
clearScreen: false,
|
|
// 2. tauri expects a fixed port, fail if that port is not available
|
|
server: {
|
|
port: 1420,
|
|
strictPort: true,
|
|
host: host || false,
|
|
allowedHosts: [
|
|
"frontend-runner-alphahuman-git-main-vezuresxyz.vercel.app",
|
|
],
|
|
hmr: host
|
|
? {
|
|
protocol: "ws",
|
|
host,
|
|
port: 1421,
|
|
}
|
|
: undefined,
|
|
watch: {
|
|
// 3. tell Vite to ignore watching `src-tauri` and `ai` directories
|
|
ignored: ["**/src-tauri/**", "**/ai/**"],
|
|
},
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
buffer: "buffer",
|
|
process: "process/browser",
|
|
util: "util",
|
|
os: "os-browserify/browser",
|
|
},
|
|
},
|
|
optimizeDeps: {
|
|
include: ["buffer", "process", "util", "os-browserify", "telegram"],
|
|
},
|
|
}));
|