Debug pass: fix extract_text_keywords_mcp invalid-JS customScript, point Ollama delegation tools to shadow-death (real data, no simulation)
This commit is contained in:
@@ -38,7 +38,7 @@ export const MCPGuideTab: React.FC = () => {
|
||||
const sseEventSourceRef = useRef<EventSource | null>(null);
|
||||
|
||||
// Local Ollama / GPU Probe State
|
||||
const [ollamaEndpoint, setOllamaEndpoint] = useState<string>('http://localhost:11434');
|
||||
const [ollamaEndpoint, setOllamaEndpoint] = useState<string>('http://10.30.20.128:11434');
|
||||
const [probingOllama, setProbingOllama] = useState<boolean>(false);
|
||||
const [probeResult, setProbeResult] = useState<any>(null);
|
||||
|
||||
@@ -593,7 +593,7 @@ main();
|
||||
type="text"
|
||||
value={ollamaEndpoint}
|
||||
onChange={(e) => setOllamaEndpoint(e.target.value)}
|
||||
placeholder="http://localhost:11434"
|
||||
placeholder="http://10.30.20.128:11434"
|
||||
className="px-3 py-2 bg-slate-50 border border-slate-300 rounded-xl text-xs font-mono text-slate-800 w-48 sm:w-60 focus:outline-none focus:ring-2 focus:ring-emerald-500"
|
||||
/>
|
||||
<button
|
||||
|
||||
@@ -597,7 +597,7 @@ export const MCPHubTab: React.FC<MCPHubTabProps> = ({
|
||||
customScript: `
|
||||
const text = args.text || '';
|
||||
const words = text.toLowerCase().match(/\\b[a-z]{4,}\\b/g) || [];
|
||||
const freq: Record<string, number> = {};
|
||||
const freq = {};
|
||||
words.forEach(w => freq[w] = (freq[w] || 0) + 1);
|
||||
const topKeywords = Object.entries(freq).sort((a,b) => b[1] - a[1]).slice(0, 5).map(e => e[0]);
|
||||
return {
|
||||
|
||||
@@ -106,8 +106,8 @@ class MCPRegistryManager {
|
||||
enabled: true,
|
||||
roadSign: {
|
||||
isRoadSign: true,
|
||||
signpostTitle: 'LOCAL OLLAMA GPU WORKSTATION (localhost:11434)',
|
||||
targetHostLocation: 'http://localhost:11434',
|
||||
signpostTitle: 'LOCAL OLLAMA GPU WORKSTATION (shadow-death:11434)',
|
||||
targetHostLocation: 'http://10.30.20.128:11434',
|
||||
directionsInstructions: 'Connects directly to your local Ollama instance on port 11434. Start with: ollama serve',
|
||||
osPlatform: 'docker',
|
||||
},
|
||||
|
||||
@@ -16,7 +16,7 @@ export const LOCAL_MODEL_TOOLS: ToolDefinition[] = [
|
||||
description: 'Ollama model tag to invoke (e.g., "llama3.2:1b", "llama3.2:3b", "deepseek-r1:1.5b", "qwen2.5-coder:1.5b", "phi3.5", "mistral:7b"). Defaults to "llama3.2:1b".',
|
||||
},
|
||||
systemPrompt: { type: 'string', description: 'Optional system instructions for the sub-model.' },
|
||||
endpoint: { type: 'string', description: 'Ollama host endpoint URL. Defaults to "http://localhost:11434".' },
|
||||
endpoint: { type: 'string', description: 'Ollama host endpoint URL. Defaults to "http://10.30.20.128:11434".' },
|
||||
temperature: { type: 'number', description: 'Sampling temperature (0.0 to 1.0).' },
|
||||
format: { type: 'string', enum: ['json', 'text'], description: 'Optional output formatting (e.g. "json" for structured data).' },
|
||||
},
|
||||
@@ -38,7 +38,7 @@ export const LOCAL_MODEL_TOOLS: ToolDefinition[] = [
|
||||
type: 'string',
|
||||
description: 'Local vision model name (e.g., "llava", "llama3.2-vision", "minicpm-v", "bakllava", "qwen2-vl"). Defaults to "llama3.2-vision".',
|
||||
},
|
||||
endpoint: { type: 'string', description: 'Ollama host endpoint URL. Defaults to "http://localhost:11434".' },
|
||||
endpoint: { type: 'string', description: 'Ollama host endpoint URL. Defaults to "http://10.30.20.128:11434".' },
|
||||
},
|
||||
required: ['imageUrlOrBase64'],
|
||||
},
|
||||
@@ -58,7 +58,7 @@ export const LOCAL_MODEL_TOOLS: ToolDefinition[] = [
|
||||
type: 'string',
|
||||
description: 'Local embedding model name (e.g., "nomic-embed-text", "bge-m3", "all-minilm", "snowflake-arctic-embed", "mxbai-embed-large"). Defaults to "nomic-embed-text".',
|
||||
},
|
||||
endpoint: { type: 'string', description: 'Ollama host endpoint URL. Defaults to "http://localhost:11434".' },
|
||||
endpoint: { type: 'string', description: 'Ollama host endpoint URL. Defaults to "http://10.30.20.128:11434".' },
|
||||
},
|
||||
required: ['text'],
|
||||
},
|
||||
@@ -77,7 +77,7 @@ export const LOCAL_MODEL_TOOLS: ToolDefinition[] = [
|
||||
enum: ['list_models', 'running_vram_models', 'gpu_telemetry', 'ping_endpoint'],
|
||||
description: 'Management action to perform.',
|
||||
},
|
||||
endpoint: { type: 'string', description: 'Ollama host endpoint URL. Defaults to "http://localhost:11434".' },
|
||||
endpoint: { type: 'string', description: 'Ollama host endpoint URL. Defaults to "http://10.30.20.128:11434".' },
|
||||
},
|
||||
required: ['action'],
|
||||
},
|
||||
@@ -151,7 +151,7 @@ export async function executeLocalModelTool(toolName: string, args: any): Promis
|
||||
prompt,
|
||||
model = 'llama3.2:1b',
|
||||
systemPrompt,
|
||||
endpoint = 'http://localhost:11434',
|
||||
endpoint = 'http://10.30.20.128:11434',
|
||||
temperature = 0.7,
|
||||
format,
|
||||
} = args;
|
||||
@@ -228,7 +228,7 @@ export async function executeLocalModelTool(toolName: string, args: any): Promis
|
||||
imageUrlOrBase64,
|
||||
prompt = 'Describe this image in detail, extract any visible text, and detect key objects.',
|
||||
model = 'llama3.2-vision',
|
||||
endpoint = 'http://localhost:11434',
|
||||
endpoint = 'http://10.30.20.128:11434',
|
||||
} = args;
|
||||
|
||||
const cleanEndpoint = endpoint.replace(/\/+$/, '');
|
||||
@@ -308,7 +308,7 @@ export async function executeLocalModelTool(toolName: string, args: any): Promis
|
||||
text,
|
||||
compareText,
|
||||
model = 'nomic-embed-text',
|
||||
endpoint = 'http://localhost:11434',
|
||||
endpoint = 'http://10.30.20.128:11434',
|
||||
} = args;
|
||||
|
||||
const cleanEndpoint = endpoint.replace(/\/+$/, '');
|
||||
@@ -385,7 +385,7 @@ export async function executeLocalModelTool(toolName: string, args: any): Promis
|
||||
|
||||
// 4. OLLAMA GPU & MODEL MANAGER
|
||||
case 'ollama_gpu_model_manager': {
|
||||
const { action = 'list_models', endpoint = 'http://localhost:11434' } = args;
|
||||
const { action = 'list_models', endpoint = 'http://10.30.20.128:11434' } = args;
|
||||
const cleanEndpoint = endpoint.replace(/\/+$/, '');
|
||||
let isLive = false;
|
||||
let livePayload: any = null;
|
||||
|
||||
Reference in New Issue
Block a user