tachibot-mcp 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +260 -0
- package/CHANGELOG.md +54 -0
- package/CODE_OF_CONDUCT.md +56 -0
- package/CONTRIBUTING.md +54 -0
- package/Dockerfile +36 -0
- package/LICENSE +644 -0
- package/README.md +201 -0
- package/SECURITY.md +95 -0
- package/dist/personality/komaai-expressions.js +12 -0
- package/dist/profiles/balanced.json +33 -0
- package/dist/profiles/code_focus.json +33 -0
- package/dist/profiles/full.json +33 -0
- package/dist/profiles/minimal.json +33 -0
- package/dist/profiles/research_power.json +33 -0
- package/dist/scripts/build-profiles.js +46 -0
- package/dist/src/application/services/focus/FocusModeRegistry.js +46 -0
- package/dist/src/application/services/focus/FocusTool.service.js +109 -0
- package/dist/src/application/services/focus/ModeRegistry.js +46 -0
- package/dist/src/application/services/focus/modes/focus-deep.mode.js +27 -0
- package/dist/src/application/services/focus/modes/status.mode.js +50 -0
- package/dist/src/application/services/focus/modes/tachibot-status.mode.js +50 -0
- package/dist/src/collaborative-orchestrator.js +391 -0
- package/dist/src/config/model-constants.js +188 -0
- package/dist/src/config/model-defaults.js +57 -0
- package/dist/src/config/model-preferences.js +382 -0
- package/dist/src/config/timeout-config.js +130 -0
- package/dist/src/config.js +173 -0
- package/dist/src/domain/interfaces/IFocusMode.js +5 -0
- package/dist/src/domain/interfaces/IProvider.js +6 -0
- package/dist/src/domain/interfaces/ITool.js +5 -0
- package/dist/src/focus-deep.js +245 -0
- package/dist/src/infrastructure/ascii/art/robots.ascii.js +16 -0
- package/dist/src/mcp-client.js +90 -0
- package/dist/src/memory/index.js +17 -0
- package/dist/src/memory/memory-config.js +135 -0
- package/dist/src/memory/memory-interface.js +174 -0
- package/dist/src/memory/memory-manager.js +383 -0
- package/dist/src/memory/providers/devlog-provider.js +385 -0
- package/dist/src/memory/providers/hybrid-provider.js +399 -0
- package/dist/src/memory/providers/local-provider.js +388 -0
- package/dist/src/memory/providers/mem0-provider.js +337 -0
- package/dist/src/modes/architect.js +477 -0
- package/dist/src/modes/auditor.js +362 -0
- package/dist/src/modes/challenger.js +841 -0
- package/dist/src/modes/code-reviewer.js +382 -0
- package/dist/src/modes/commit-guardian.js +424 -0
- package/dist/src/modes/documentation-writer.js +572 -0
- package/dist/src/modes/scout.js +587 -0
- package/dist/src/modes/shared/helpers/challenger-helpers.js +454 -0
- package/dist/src/modes/shared/helpers/index.js +17 -0
- package/dist/src/modes/shared/helpers/scout-helpers.js +270 -0
- package/dist/src/modes/shared/helpers/verifier-helpers.js +332 -0
- package/dist/src/modes/test-architect.js +767 -0
- package/dist/src/modes/verifier.js +378 -0
- package/dist/src/monitoring/performance-monitor.js +435 -0
- package/dist/src/optimization/batch-executor.js +121 -0
- package/dist/src/optimization/context-pruner.js +196 -0
- package/dist/src/optimization/cost-monitor.js +338 -0
- package/dist/src/optimization/index.js +65 -0
- package/dist/src/optimization/model-router.js +264 -0
- package/dist/src/optimization/result-cache.js +114 -0
- package/dist/src/optimization/token-optimizer.js +257 -0
- package/dist/src/optimization/token-tracker.js +118 -0
- package/dist/src/orchestrator-instructions.js +128 -0
- package/dist/src/orchestrator-lite.js +139 -0
- package/dist/src/orchestrator.js +191 -0
- package/dist/src/orchestrators/collaborative/interfaces/IToolExecutionEngine.js +1 -0
- package/dist/src/orchestrators/collaborative/interfaces/IToolExecutionStrategy.js +5 -0
- package/dist/src/orchestrators/collaborative/interfaces/IVisualizationRenderer.js +1 -0
- package/dist/src/orchestrators/collaborative/registries/ModelProviderRegistry.js +95 -0
- package/dist/src/orchestrators/collaborative/registries/ToolAdapterRegistry.js +64 -0
- package/dist/src/orchestrators/collaborative/services/tool-execution/ToolExecutionService.js +502 -0
- package/dist/src/orchestrators/collaborative/services/visualization/VisualizationService.js +206 -0
- package/dist/src/orchestrators/collaborative/types/session-types.js +5 -0
- package/dist/src/profiles/balanced.js +37 -0
- package/dist/src/profiles/code_focus.js +37 -0
- package/dist/src/profiles/debug_intensive.js +59 -0
- package/dist/src/profiles/full.js +37 -0
- package/dist/src/profiles/minimal.js +37 -0
- package/dist/src/profiles/research_code.js +59 -0
- package/dist/src/profiles/research_power.js +37 -0
- package/dist/src/profiles/types.js +5 -0
- package/dist/src/profiles/workflow_builder.js +53 -0
- package/dist/src/prompt-engineer-lite.js +78 -0
- package/dist/src/prompt-engineer.js +399 -0
- package/dist/src/reasoning-chain.js +508 -0
- package/dist/src/sequential-thinking.js +291 -0
- package/dist/src/server-diagnostic.js +74 -0
- package/dist/src/server-raw.js +158 -0
- package/dist/src/server-simple.js +58 -0
- package/dist/src/server.js +514 -0
- package/dist/src/session/session-logger.js +617 -0
- package/dist/src/session/session-manager.js +571 -0
- package/dist/src/session/session-tools.js +400 -0
- package/dist/src/tools/advanced-modes.js +200 -0
- package/dist/src/tools/claude-integration.js +356 -0
- package/dist/src/tools/consolidated/ai-router.js +174 -0
- package/dist/src/tools/consolidated/ai-tool.js +48 -0
- package/dist/src/tools/consolidated/brainstorm-tool.js +87 -0
- package/dist/src/tools/consolidated/environment-detector.js +80 -0
- package/dist/src/tools/consolidated/index.js +50 -0
- package/dist/src/tools/consolidated/search-tool.js +110 -0
- package/dist/src/tools/consolidated/workflow-tool.js +238 -0
- package/dist/src/tools/gemini-tools.js +329 -0
- package/dist/src/tools/grok-enhanced.js +376 -0
- package/dist/src/tools/grok-tools.js +299 -0
- package/dist/src/tools/lmstudio-tools.js +223 -0
- package/dist/src/tools/openai-tools.js +498 -0
- package/dist/src/tools/openrouter-tools.js +317 -0
- package/dist/src/tools/optimized-wrapper.js +204 -0
- package/dist/src/tools/perplexity-tools.js +294 -0
- package/dist/src/tools/pingpong-tool.js +343 -0
- package/dist/src/tools/qwen-wrapper.js +74 -0
- package/dist/src/tools/tool-router.js +444 -0
- package/dist/src/tools/unified-ai-provider.js +260 -0
- package/dist/src/tools/workflow-runner.js +425 -0
- package/dist/src/tools/workflow-validator-tool.js +107 -0
- package/dist/src/types.js +23 -0
- package/dist/src/utils/input-validator.js +130 -0
- package/dist/src/utils/model-router.js +91 -0
- package/dist/src/utils/progress-stream.js +255 -0
- package/dist/src/utils/provider-router.js +88 -0
- package/dist/src/utils/smart-api-client.js +146 -0
- package/dist/src/utils/table-builder.js +218 -0
- package/dist/src/utils/timestamp-formatter.js +134 -0
- package/dist/src/utils/tool-compressor.js +257 -0
- package/dist/src/utils/tool-config.js +201 -0
- package/dist/src/validators/dependency-graph-validator.js +147 -0
- package/dist/src/validators/interpolation-validator.js +222 -0
- package/dist/src/validators/output-usage-validator.js +151 -0
- package/dist/src/validators/syntax-validator.js +102 -0
- package/dist/src/validators/tool-registry-validator.js +123 -0
- package/dist/src/validators/tool-types.js +97 -0
- package/dist/src/validators/types.js +8 -0
- package/dist/src/validators/workflow-validator.js +134 -0
- package/dist/src/visualizer-lite.js +42 -0
- package/dist/src/visualizer.js +179 -0
- package/dist/src/workflows/circuit-breaker.js +199 -0
- package/dist/src/workflows/custom-workflows.js +451 -0
- package/dist/src/workflows/engine/AutoSynthesizer.js +97 -0
- package/dist/src/workflows/engine/StepParameterResolver.js +74 -0
- package/dist/src/workflows/engine/VariableInterpolator.js +123 -0
- package/dist/src/workflows/engine/WorkflowDiscovery.js +125 -0
- package/dist/src/workflows/engine/WorkflowExecutionEngine.js +485 -0
- package/dist/src/workflows/engine/WorkflowExecutor.js +113 -0
- package/dist/src/workflows/engine/WorkflowFileManager.js +244 -0
- package/dist/src/workflows/engine/WorkflowHelpers.js +114 -0
- package/dist/src/workflows/engine/WorkflowOutputFormatter.js +83 -0
- package/dist/src/workflows/engine/events/WorkflowEventBus.js +132 -0
- package/dist/src/workflows/engine/events/interfaces/IEventBus.js +5 -0
- package/dist/src/workflows/engine/handlers/ErrorRecoveryHandler.js +162 -0
- package/dist/src/workflows/engine/handlers/PromptEnhancementHandler.js +115 -0
- package/dist/src/workflows/engine/handlers/SessionPersistenceHandler.js +167 -0
- package/dist/src/workflows/engine/handlers/StepExecutionHandler.js +231 -0
- package/dist/src/workflows/engine/handlers/ToolInvocationHandler.js +46 -0
- package/dist/src/workflows/engine/interfaces/IAutoSynthesizer.js +5 -0
- package/dist/src/workflows/engine/interfaces/IStepParameterResolver.js +5 -0
- package/dist/src/workflows/engine/interfaces/IVariableInterpolator.js +5 -0
- package/dist/src/workflows/engine/interfaces/IWorkflowDiscovery.js +4 -0
- package/dist/src/workflows/engine/interfaces/IWorkflowFileManager.js +5 -0
- package/dist/src/workflows/engine/interfaces/IWorkflowOutputFormatter.js +5 -0
- package/dist/src/workflows/engine/state/WorkflowStateMachine.js +194 -0
- package/dist/src/workflows/engine/state/interfaces/IStateMachine.js +17 -0
- package/dist/src/workflows/fallback-strategies.js +373 -0
- package/dist/src/workflows/message-queue.js +455 -0
- package/dist/src/workflows/model-router.js +189 -0
- package/dist/src/workflows/orchestrator-examples.js +174 -0
- package/dist/src/workflows/orchestrator-integration.js +200 -0
- package/dist/src/workflows/self-healing.js +524 -0
- package/dist/src/workflows/tool-mapper.js +407 -0
- package/dist/src/workflows/tool-orchestrator.js +796 -0
- package/dist/src/workflows/workflow-engine.js +573 -0
- package/dist/src/workflows/workflow-parser.js +283 -0
- package/dist/src/workflows/workflow-types.js +95 -0
- package/dist/src/workflows.js +568 -0
- package/dist/test-workflow-file-output.js +93 -0
- package/docs/API_KEYS.md +570 -0
- package/docs/CLAUDE_CODE_SETUP.md +181 -0
- package/docs/CLAUDE_DESKTOP_MANUAL.md +127 -0
- package/docs/CONFIGURATION.md +745 -0
- package/docs/FOCUS_MODES.md +240 -0
- package/docs/INSTALLATION_BOTH.md +145 -0
- package/docs/TERMS.md +352 -0
- package/docs/TOOLS_REFERENCE.md +1622 -0
- package/docs/TOOL_PARAMETERS.md +496 -0
- package/docs/TOOL_PROFILES.md +236 -0
- package/docs/WORKFLOWS.md +987 -0
- package/docs/WORKFLOW_OUTPUT.md +198 -0
- package/docs/WORKFLOW_PROGRESS_TRACKING.md +305 -0
- package/docs/workflows/design-brainstorm.md +335 -0
- package/package.json +97 -0
- package/profiles/balanced.json +37 -0
- package/profiles/code_focus.json +37 -0
- package/profiles/debug_intensive.json +34 -0
- package/profiles/full.json +37 -0
- package/profiles/minimal.json +37 -0
- package/profiles/research_power.json +37 -0
- package/profiles/workflow_builder.json +37 -0
- package/smithery.yaml +66 -0
- package/start.sh +8 -0
- package/tools.config.json +81 -0
- package/tsconfig.json +18 -0
- package/workflows/accessibility-code-audit.yaml +92 -0
- package/workflows/code-architecture-review.yaml +202 -0
- package/workflows/code-review.yaml +142 -0
- package/workflows/core/iterative-problem-solver.yaml +283 -0
- package/workflows/creative-brainstorm-yaml.yaml +215 -0
- package/workflows/pingpong.yaml +141 -0
- package/workflows/system/README.md +412 -0
- package/workflows/system/challenger.yaml +175 -0
- package/workflows/system/scout.yaml +164 -0
- package/workflows/system/verifier.yaml +133 -0
- package/workflows/ultra-creative-brainstorm.yaml +318 -0
- package/workflows/ux-research-flow.yaml +92 -0
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LM Studio Tools Implementation
|
|
3
|
+
* Provides local open-weight model capabilities
|
|
4
|
+
* Works with any model loaded in LM Studio
|
|
5
|
+
*/
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
import { config } from "dotenv";
|
|
8
|
+
import * as path from 'path';
|
|
9
|
+
import { fileURLToPath } from 'url';
|
|
10
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
11
|
+
const __dirname = path.dirname(__filename);
|
|
12
|
+
config({ path: path.resolve(__dirname, '../../../.env') });
|
|
13
|
+
// LM Studio configuration
|
|
14
|
+
const LMSTUDIO_BASE_URL = process.env.LMSTUDIO_BASE_URL || "http://localhost:1234/v1";
|
|
15
|
+
const LMSTUDIO_MODEL = process.env.LMSTUDIO_MODEL || "local-model";
|
|
16
|
+
/**
|
|
17
|
+
* Call LM Studio API (OpenAI compatible)
|
|
18
|
+
*/
|
|
19
|
+
async function callLMStudio(prompt, systemPrompt, temperature = 0.7, maxTokens = 2048) {
|
|
20
|
+
try {
|
|
21
|
+
const url = `${LMSTUDIO_BASE_URL}/chat/completions`;
|
|
22
|
+
const messages = [];
|
|
23
|
+
if (systemPrompt) {
|
|
24
|
+
messages.push({ role: "system", content: systemPrompt });
|
|
25
|
+
}
|
|
26
|
+
messages.push({ role: "user", content: prompt });
|
|
27
|
+
const requestBody = {
|
|
28
|
+
model: LMSTUDIO_MODEL,
|
|
29
|
+
messages,
|
|
30
|
+
temperature,
|
|
31
|
+
max_tokens: maxTokens,
|
|
32
|
+
stream: false
|
|
33
|
+
};
|
|
34
|
+
const response = await fetch(url, {
|
|
35
|
+
method: "POST",
|
|
36
|
+
headers: {
|
|
37
|
+
"Content-Type": "application/json",
|
|
38
|
+
},
|
|
39
|
+
body: JSON.stringify(requestBody)
|
|
40
|
+
});
|
|
41
|
+
if (!response.ok) {
|
|
42
|
+
throw new Error(`LM Studio API error: ${response.statusText}`);
|
|
43
|
+
}
|
|
44
|
+
const data = await response.json();
|
|
45
|
+
return data.choices?.[0]?.message?.content || "No response from LM Studio";
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
// Check if LM Studio is running
|
|
49
|
+
if (error instanceof Error && error.message.includes("ECONNREFUSED")) {
|
|
50
|
+
return `[LM Studio not running. Start LM Studio and load a model at ${LMSTUDIO_BASE_URL}]`;
|
|
51
|
+
}
|
|
52
|
+
return `[LM Studio error: ${error instanceof Error ? error.message : String(error)}]`;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* LM Studio Query Tool
|
|
57
|
+
* Direct querying of local models
|
|
58
|
+
*/
|
|
59
|
+
export const lmstudioQueryTool = {
|
|
60
|
+
name: "lmstudio_query",
|
|
61
|
+
description: "Query local open-weight models via LM Studio",
|
|
62
|
+
parameters: z.object({
|
|
63
|
+
prompt: z.string().describe("The prompt to send to the local model"),
|
|
64
|
+
temperature: z.number().optional().default(0.7).describe("Temperature for response generation"),
|
|
65
|
+
maxTokens: z.number().optional().default(2048).describe("Maximum tokens to generate")
|
|
66
|
+
}),
|
|
67
|
+
execute: async (args, { log }) => {
|
|
68
|
+
log?.info?.("LM Studio query", { model: LMSTUDIO_MODEL });
|
|
69
|
+
return await callLMStudio(args.prompt, undefined, args.temperature, args.maxTokens);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* LM Studio Code Tool
|
|
74
|
+
* Code generation and analysis with local models
|
|
75
|
+
*/
|
|
76
|
+
export const lmstudioCodeTool = {
|
|
77
|
+
name: "lmstudio_code",
|
|
78
|
+
description: "Generate or analyze code using local models",
|
|
79
|
+
parameters: z.object({
|
|
80
|
+
task: z.enum(["generate", "explain", "review", "fix", "optimize"]).describe("The code task to perform"),
|
|
81
|
+
code: z.string().optional().describe("Code to analyze (for explain/review/fix/optimize)"),
|
|
82
|
+
requirements: z.string().describe("Requirements or description for the task"),
|
|
83
|
+
language: z.string().optional().describe("Programming language")
|
|
84
|
+
}),
|
|
85
|
+
execute: async (args, { log }) => {
|
|
86
|
+
const systemPrompts = {
|
|
87
|
+
generate: `You are an expert programmer. Generate clean, efficient code based on requirements.`,
|
|
88
|
+
explain: `You are a code teacher. Explain the code clearly and concisely.`,
|
|
89
|
+
review: `You are a code reviewer. Analyze for bugs, performance, and best practices.`,
|
|
90
|
+
fix: `You are a debugging expert. Identify and fix issues in the code.`,
|
|
91
|
+
optimize: `You are a performance expert. Optimize the code for efficiency.`
|
|
92
|
+
};
|
|
93
|
+
const systemPrompt = systemPrompts[args.task];
|
|
94
|
+
let prompt = args.requirements;
|
|
95
|
+
if (args.code) {
|
|
96
|
+
prompt = `${args.requirements}\n\nCode:\n\`\`\`${args.language || ''}\n${args.code}\n\`\`\``;
|
|
97
|
+
}
|
|
98
|
+
return await callLMStudio(prompt, systemPrompt, 0.3, 4096);
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* LM Studio Reasoning Tool
|
|
103
|
+
* Complex reasoning with local models
|
|
104
|
+
*/
|
|
105
|
+
export const lmstudioReasoningTool = {
|
|
106
|
+
name: "lmstudio_reason",
|
|
107
|
+
description: "Perform step-by-step reasoning using local models",
|
|
108
|
+
parameters: z.object({
|
|
109
|
+
problem: z.string().describe("The problem to solve"),
|
|
110
|
+
approach: z.enum(["analytical", "creative", "systematic", "exploratory"])
|
|
111
|
+
.optional()
|
|
112
|
+
.default("systematic")
|
|
113
|
+
.describe("Reasoning approach"),
|
|
114
|
+
steps: z.number().optional().default(5).describe("Number of reasoning steps")
|
|
115
|
+
}),
|
|
116
|
+
execute: async (args, { log }) => {
|
|
117
|
+
const systemPrompt = `You are a logical reasoning system. Use ${args.approach} thinking.
|
|
118
|
+
Break down the problem into ${args.steps} clear steps.
|
|
119
|
+
For each step:
|
|
120
|
+
1. State what you're analyzing
|
|
121
|
+
2. Explain your reasoning
|
|
122
|
+
3. Draw conclusions
|
|
123
|
+
4. Connect to next step
|
|
124
|
+
|
|
125
|
+
Be thorough but concise.`;
|
|
126
|
+
return await callLMStudio(args.problem, systemPrompt, 0.5, 3000);
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
/**
|
|
130
|
+
* LM Studio Creative Tool
|
|
131
|
+
* Creative tasks with local models
|
|
132
|
+
*/
|
|
133
|
+
export const lmstudioCreativeTool = {
|
|
134
|
+
name: "lmstudio_creative",
|
|
135
|
+
description: "Creative writing and ideation with local models",
|
|
136
|
+
parameters: z.object({
|
|
137
|
+
task: z.enum(["story", "brainstorm", "names", "concepts", "scenarios"]).describe("Creative task type"),
|
|
138
|
+
prompt: z.string().describe("The creative prompt"),
|
|
139
|
+
style: z.string().optional().describe("Style or tone guidelines"),
|
|
140
|
+
count: z.number().optional().default(3).describe("Number of variations to generate")
|
|
141
|
+
}),
|
|
142
|
+
execute: async (args, { log }) => {
|
|
143
|
+
const taskPrompts = {
|
|
144
|
+
story: "Write a creative story",
|
|
145
|
+
brainstorm: "Generate creative ideas",
|
|
146
|
+
names: "Create unique names",
|
|
147
|
+
concepts: "Develop innovative concepts",
|
|
148
|
+
scenarios: "Imagine possible scenarios"
|
|
149
|
+
};
|
|
150
|
+
const systemPrompt = `You are a creative assistant. ${taskPrompts[args.task]}.
|
|
151
|
+
${args.style ? `Style: ${args.style}` : ''}
|
|
152
|
+
Generate ${args.count} unique variations.
|
|
153
|
+
Be imaginative and original.`;
|
|
154
|
+
return await callLMStudio(args.prompt, systemPrompt, 0.9, 2048);
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
/**
|
|
158
|
+
* LM Studio Chat Tool
|
|
159
|
+
* Conversational interaction with local models
|
|
160
|
+
*/
|
|
161
|
+
export const lmstudioChatTool = {
|
|
162
|
+
name: "lmstudio_chat",
|
|
163
|
+
description: "Have a conversation with local models",
|
|
164
|
+
parameters: z.object({
|
|
165
|
+
message: z.string().describe("Your message to the model"),
|
|
166
|
+
persona: z.enum(["assistant", "expert", "tutor", "friend", "advisor"])
|
|
167
|
+
.optional()
|
|
168
|
+
.default("assistant")
|
|
169
|
+
.describe("The persona for the model to adopt")
|
|
170
|
+
}),
|
|
171
|
+
execute: async (args, { log }) => {
|
|
172
|
+
const personas = {
|
|
173
|
+
assistant: "You are a helpful AI assistant. Be professional and informative.",
|
|
174
|
+
expert: "You are a subject matter expert. Provide detailed, authoritative answers.",
|
|
175
|
+
tutor: "You are a patient tutor. Explain concepts clearly with examples.",
|
|
176
|
+
friend: "You are a friendly companion. Be casual and engaging.",
|
|
177
|
+
advisor: "You are a wise advisor. Offer thoughtful guidance and perspectives."
|
|
178
|
+
};
|
|
179
|
+
const systemPrompt = personas[args.persona];
|
|
180
|
+
return await callLMStudio(args.message, systemPrompt, 0.7, 2048);
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
/**
|
|
184
|
+
* Check if LM Studio is available
|
|
185
|
+
*/
|
|
186
|
+
export async function isLMStudioAvailable() {
|
|
187
|
+
try {
|
|
188
|
+
const response = await fetch(`${LMSTUDIO_BASE_URL}/models`, {
|
|
189
|
+
method: "GET",
|
|
190
|
+
signal: AbortSignal.timeout(2000) // 2 second timeout
|
|
191
|
+
});
|
|
192
|
+
return response.ok;
|
|
193
|
+
}
|
|
194
|
+
catch {
|
|
195
|
+
return false;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Get current loaded model in LM Studio
|
|
200
|
+
*/
|
|
201
|
+
export async function getLMStudioModel() {
|
|
202
|
+
try {
|
|
203
|
+
const response = await fetch(`${LMSTUDIO_BASE_URL}/models`);
|
|
204
|
+
if (response.ok) {
|
|
205
|
+
const data = await response.json();
|
|
206
|
+
return data.data?.[0]?.id || "No model loaded";
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
catch { }
|
|
210
|
+
return "LM Studio not connected";
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Get all LM Studio tools
|
|
214
|
+
*/
|
|
215
|
+
export function getAllLMStudioTools() {
|
|
216
|
+
return [
|
|
217
|
+
lmstudioQueryTool,
|
|
218
|
+
lmstudioCodeTool,
|
|
219
|
+
lmstudioReasoningTool,
|
|
220
|
+
lmstudioCreativeTool,
|
|
221
|
+
lmstudioChatTool
|
|
222
|
+
];
|
|
223
|
+
}
|