<# .SYNOPSIS JINXAI RF-AI COMPUTE SYSTEM — 1-Line CLI + MCP Server + Agent Skills Installer Run: irm https://ai.dubwarz.live/install.ps1 | iex #> $ErrorActionPreference = "Stop" $BaseUrl = if ($env:JINXAI_API_URL) { $env:JINXAI_API_URL } else { "https://ai.dubwarz.live" } $InstallDir = Join-Path $env:USERPROFILE ".jinxai-cli" $SkillDir = Join-Path $env:USERPROFILE ".agents\skills\jinxai-rf-ai-compute-system" Write-Host "" Write-Host "=================================================================" -ForegroundColor Cyan Write-Host " JINXAI RF-AI COMPUTE SYSTEM — CLI + MCP + AGENT SKILLS SETUP" -ForegroundColor Cyan Write-Host " Endpoint : $BaseUrl" -ForegroundColor Gray Write-Host " Install : $InstallDir" -ForegroundColor Gray Write-Host "=================================================================" -ForegroundColor Cyan New-Item -ItemType Directory -Force -Path $InstallDir | Out-Null New-Item -ItemType Directory -Force -Path $SkillDir | Out-Null # 1. Install Python CLI (jinxai.py) — stdlib only, zero pip deps required $cliPy = @' #!/usr/bin/env python3 """JINXAI RF-AI COMPUTE SYSTEM CLI — talks to https://ai.dubwarz.live or local 127.0.0.1:8912.""" import json, os, sys, urllib.request, urllib.error BASE = os.environ.get("JINXAI_API_URL", "https://ai.dubwarz.live").rstrip("/") if "--local" in sys.argv: BASE = "http://127.0.0.1:8912" sys.argv.remove("--local") def call(path, payload=None): headers = {"Content-Type": "application/json", "User-Agent": "JINXAI-CLI/3.9"} body = json.dumps(payload).encode("utf-8") if payload is not None else None req = urllib.request.Request(BASE + path, data=body, headers=headers) with urllib.request.urlopen(req, timeout=60) as r: return r.read().decode("utf-8", "replace") def main(): args = sys.argv[1:] if not args or args[0] in ("-h", "--help", "help"): print("JINXAI RF-AI COMPUTE SYSTEM CLI (" + BASE + ")") print("Usage:") print(" jinxai status Show live system, swapper & proprietary models") print(" jinxai chat Stream 12D-aware Auto-Web Chat") print(" jinxai web Run zero-key Web RAG search") print(" jinxai rag Search workspace /rag index") print(" jinxai te16k Run 3-pass 16K VLM 2x Micro-Detailing") print(" jinxai superagent Run verified-answer | code-genius-ladder | code-auditor") print(" jinxai bio [wake|sleep|think] Run Bio-Latent GGUF v3 Brain cycle") print(" jinxai bitwise Run 0-Mul Bitwise Associative GGUF step") print(" jinxai workspaces List Collaborative Workspaces") return cmd = args[0].lower() rest = " ".join(args[1:]).strip() if cmd == "status": print(call("/api/swap/status")) elif cmd == "web": print(call("/api/web/search", {"query": rest})) elif cmd == "rag": print(call("/api/rag/search", {"query": rest, "limit": 6})) elif cmd == "te16k": print(call("/api/te/detail", {"prompt": rest, "passes": 3, "use_vlm": True})) elif cmd == "superagent": aid = args[1] if len(args) > 2 else "verified-answer" task = " ".join(args[2:]) if len(args) > 2 else rest print(call("/api/superagents/run", {"agent_id": aid, "task": task})) elif cmd == "bio": sub = args[1].lower() if len(args) > 1 else "status" if sub == "wake": print(call("/api/bio-brain/wake", {"steps": 15, "use_rf": True})) elif sub == "sleep": print(call("/api/bio-brain/sleep", {"replay_steps": 35})) elif sub == "think": print(call("/api/bio-brain/think", {"prompt": " ".join(args[2:]) or "pulse"})) else: print(call("/api/bio-brain/status")) elif cmd == "bitwise": print(call("/api/bitwise/run", {"prompt": rest or "bitwise pulse"})) elif cmd == "workspaces": print(call("/api/workspaces")) elif cmd == "chat": sse = call("/api/chat", {"messages": [{"role": "user", "content": rest}], "web_mode": "auto"}) for line in sse.splitlines(): if line.startswith("data:"): try: ev = json.loads(line[5:].strip()) if ev.get("type") == "token": sys.stdout.write(ev.get("text", "")) sys.stdout.flush() except Exception: pass print() else: print(f"Unknown command: {cmd}. Run `jinxai help`.") if __name__ == "__main__": main() '@ Set-Content -Path (Join-Path $InstallDir "jinxai.py") -Value $cliPy -Encoding UTF8 # 2. Install Windows wrapper jinxai.cmd $cliCmd = "@echo off`r`npython `"%~dp0jinxai.py`" %*`r`n" Set-Content -Path (Join-Path $InstallDir "jinxai.cmd") -Value $cliCmd -Encoding ASCII # 3. Install Stdio MCP Server (jinxai_mcp_server.py) — JSON-RPC 2.0 $mcpPy = @' #!/usr/bin/env python3 """JINXAI RF-AI COMPUTE SYSTEM — Stdio MCP Server (JSON-RPC 2.0, stdlib-only).""" import json, os, sys, urllib.request BASE = os.environ.get("JINXAI_API_URL", "https://ai.dubwarz.live").rstrip("/") TOOLS = [ {"name": "jinxai_web_search", "description": "Zero-key live Web RAG search with citations via JINXAI RF-AI COMPUTE SYSTEM", "inputSchema": {"type": "object", "properties": {"query": {"type": "string"}}, "required": ["query"]}}, {"name": "jinxai_rag_search", "description": "Search indexed workspace files & code via cAST RAG", "inputSchema": {"type": "object", "properties": {"query": {"type": "string"}}, "required": ["query"]}}, {"name": "jinxai_superagent", "description": "Run a promoted JINXAI SuperAgent (verified-answer, code-genius-ladder, code-auditor)", "inputSchema": {"type": "object", "properties": {"agent_id": {"type": "string"}, "task": {"type": "string"}}, "required": ["task"]}}, {"name": "jinxai_te_16k_detail", "description": "Run 16K Hierarchical Text Encoder + VLM 2x object-anchored micro-detailing passes", "inputSchema": {"type": "object", "properties": {"prompt": {"type": "string"}, "passes": {"type": "integer"}}, "required": ["prompt"]}}, {"name": "jinxai_bio_brain", "description": "Run JINXAI Bio-Latent GGUF v3 Brain (status, wake, sleep, think)", "inputSchema": {"type": "object", "properties": {"mode": {"type": "string"}, "prompt": {"type": "string"}}}}, {"name": "jinxai_bitwise_run", "description": "Run multiplication-free 0-Mul Bitwise Associative GGUF engine step", "inputSchema": {"type": "object", "properties": {"prompt": {"type": "string"}}}}, {"name": "jinxai_workspace_post", "description": "Post a message or pin a file in a Collaborative Workspace", "inputSchema": {"type": "object", "properties": {"ws_id": {"type": "string"}, "author": {"type": "string"}, "content": {"type": "string"}}, "required": ["content"]}}, ] def _post(path, payload=None): body = json.dumps(payload).encode("utf-8") if payload is not None else None req = urllib.request.Request(BASE + path, data=body, headers={"Content-Type": "application/json", "User-Agent": "JINXAI-MCP/3.9"}) with urllib.request.urlopen(req, timeout=60) as r: return r.read().decode("utf-8", "replace") def handle(msg): mid = msg.get("id") m = msg.get("method", "") if m == "initialize": return {"jsonrpc": "2.0", "id": mid, "result": {"protocolVersion": "2024-11-05", "capabilities": {"tools": {}}, "serverInfo": {"name": "jinxai-rf-ai-compute-system", "version": "3.9.0"}}} if m == "tools/list": return {"jsonrpc": "2.0", "id": mid, "result": {"tools": TOOLS}} if m == "tools/call": p = msg.get("params") or {} name = p.get("name", "") a = p.get("arguments") or {} try: if name == "jinxai_web_search": out = _post("/api/web/search", {"query": a.get("query", "")}) elif name == "jinxai_rag_search": out = _post("/api/rag/search", {"query": a.get("query", "")}) elif name == "jinxai_superagent": out = _post("/api/superagents/run", {"agent_id": a.get("agent_id", "verified-answer"), "task": a.get("task", "")}) elif name == "jinxai_te_16k_detail": out = _post("/api/te/detail", {"prompt": a.get("prompt", ""), "passes": int(a.get("passes", 3))}) elif name == "jinxai_bio_brain": md = (a.get("mode") or "status").lower() if md == "wake": out = _post("/api/bio-brain/wake", {"steps": 15}) elif md == "sleep": out = _post("/api/bio-brain/sleep", {"replay_steps": 35}) elif md == "think": out = _post("/api/bio-brain/think", {"prompt": a.get("prompt", "pulse")}) else: out = _post("/api/bio-brain/status") elif name == "jinxai_bitwise_run": out = _post("/api/bitwise/run", {"prompt": a.get("prompt", "pulse")}) elif name == "jinxai_workspace_post": out = _post(f"/api/workspaces/{a.get('ws_id', 'main')}/post", {"author": a.get("author", "MCP-Agent"), "content": a.get("content", "")}) else: out = json.dumps({"error": f"Unknown tool: {name}"}) return {"jsonrpc": "2.0", "id": mid, "result": {"content": [{"type": "text", "text": out}]}} except Exception as exc: return {"jsonrpc": "2.0", "id": mid, "result": {"content": [{"type": "text", "text": f"Error: {exc}"}], "isError": True}} return None for line in sys.stdin: line = line.strip() if not line: continue try: resp = handle(json.loads(line)) if resp is not None: sys.stdout.write(json.dumps(resp) + "\n") sys.stdout.flush() except Exception: pass '@ Set-Content -Path (Join-Path $InstallDir "jinxai_mcp_server.py") -Value $mcpPy -Encoding UTF8 # 4. Write ready-to-use MCP config snippet $mcpJson = @{ mcpServers = @{ "jinxai-rf-ai-compute-system" = @{ command = "python" args = @((Join-Path $InstallDir "jinxai_mcp_server.py")) env = @{ JINXAI_API_URL = $BaseUrl } } } } | ConvertTo-Json -Depth 5 Set-Content -Path (Join-Path $InstallDir "mcp_config.json") -Value $mcpJson -Encoding UTF8 # 5. Install Official Agent Skill (SKILL.md) $skillMd = @" --- name: jinxai-rf-ai-compute-system description: Operate JINXAI RF-AI COMPUTE SYSTEM ($BaseUrl) via CLI (`jinxai`) or stdio MCP (`jinxai_mcp_server.py`) for 12D-aware Chat, Auto-Web RAG, /rag file access, 16K VLM 2x Micro-Detailing, SuperAgents, Bio-Latent GGUF Brain, 0-Mul Bitwise Engine, and Collaborative Workspaces. --- # JINXAI RF-AI COMPUTE SYSTEM Skill - **Live Endpoint:** $BaseUrl - **CLI:** ``jinxai help`` (installed in ``$InstallDir``) - **MCP Server:** ``python "$InstallDir\jinxai_mcp_server.py"`` - **Key Endpoints:** ``/api/chat``, ``/api/web/search``, ``/api/rag/search``, ``/api/te/detail``, ``/api/superagents/run``, ``/api/bio-brain/wake``, ``/api/bitwise/run``, ``/api/workspaces``, ``/api/swap/status`` "@ Set-Content -Path (Join-Path $SkillDir "SKILL.md") -Value $skillMd -Encoding UTF8 # 6. Add InstallDir to User PATH if not already present $userPath = [Environment]::GetEnvironmentVariable("Path", "User") if ($userPath -notlike "*$InstallDir*") { [Environment]::SetEnvironmentVariable("Path", ($userPath.TrimEnd(";") + ";" + $InstallDir), "User") $env:Path = "$env:Path;$InstallDir" } Write-Host "" Write-Host "[OK] CLI installed : $InstallDir\jinxai.cmd" -ForegroundColor Green Write-Host "[OK] MCP server ready : $InstallDir\jinxai_mcp_server.py" -ForegroundColor Green Write-Host "[OK] MCP config snippet : $InstallDir\mcp_config.json" -ForegroundColor Green Write-Host "[OK] Agent Skill ready : $SkillDir\SKILL.md" -ForegroundColor Green Write-Host "" Write-Host "Try now: jinxai status" -ForegroundColor Yellow Write-Host " jinxai chat `"What can JINXAI RF-AI COMPUTE SYSTEM do?`"" -ForegroundColor Yellow