chore: Fix lint warnings in SetupWizard and add AI API docs

- Fixed unused variables in wizard components
- Fixed invalid aiEnabled field in FeaturesStep (AI uses separate API)
- Added AI endpoints section to API.md
This commit is contained in:
rcourtman 2025-12-13 15:36:40 +00:00
parent 9632441e1d
commit e470fbec83
5 changed files with 40 additions and 9 deletions

View file

@ -140,6 +140,37 @@ Initiate OIDC login flow.
--- ---
## 🤖 Pulse AI *(New in 5.0)*
### Get AI Settings
`GET /api/settings/ai`
Returns current AI configuration (providers, models, patrol status).
### Update AI Settings
`PUT /api/settings/ai`
Configure AI providers, API keys, and preferences.
### Chat
`POST /api/ai/chat`
Send a message to the AI assistant.
```json
{ "message": "What VMs are using the most CPU?", "context": ["vm-100", "vm-101"] }
```
### Patrol Status
`GET /api/ai/patrol/status`
Get current patrol status and recent findings.
### Patrol Findings
`GET /api/ai/patrol/findings`
List all patrol findings with severity and recommendations.
### Cost Tracking
`GET /api/ai/cost?period=30d`
Get AI usage statistics and costs.
---
## 🤖 Agent Endpoints ## 🤖 Agent Endpoints
### Unified Agent (Recommended) ### Unified Agent (Recommended)

View file

@ -1,4 +1,4 @@
import { Component, createSignal, Show, onMount } from 'solid-js'; import { Component, createSignal, Show } from 'solid-js';
import { WelcomeStep } from './steps/WelcomeStep'; import { WelcomeStep } from './steps/WelcomeStep';
import { SecurityStep } from './steps/SecurityStep'; import { SecurityStep } from './steps/SecurityStep';
import { ConnectStep } from './steps/ConnectStep'; import { ConnectStep } from './steps/ConnectStep';

View file

@ -28,7 +28,7 @@ export const ConnectStep: Component<ConnectStepProps> = (props) => {
// Manual form fields // Manual form fields
const [host, setHost] = createSignal(''); const [host, setHost] = createSignal('');
const [port, setPort] = createSignal('8006'); const [port, _setPort] = createSignal('8006');
const [tokenId, setTokenId] = createSignal(''); const [tokenId, setTokenId] = createSignal('');
const [tokenSecret, setTokenSecret] = createSignal(''); const [tokenSecret, setTokenSecret] = createSignal('');
@ -69,7 +69,7 @@ export const ConnectStep: Component<ConnectStepProps> = (props) => {
if (discoveredNodes().length === 0) { if (discoveredNodes().length === 0) {
showSuccess('Scan complete - no nodes found. Try manual setup.'); showSuccess('Scan complete - no nodes found. Try manual setup.');
} }
} catch (error) { } catch (_error) {
showError('Discovery failed. Try manual setup.'); showError('Discovery failed. Try manual setup.');
} finally { } finally {
setIsScanning(false); setIsScanning(false);

View file

@ -40,9 +40,9 @@ export const FeaturesStep: Component<FeaturesStepProps> = (props) => {
setIsSaving(true); setIsSaving(true);
try { try {
// Save feature preferences // Only save auto-update setting through SystemConfig
// AI settings are configured separately via Settings → AI
await SettingsAPI.updateSystemSettings({ await SettingsAPI.updateSystemSettings({
aiEnabled: aiEnabled(),
autoUpdateEnabled: autoUpdates(), autoUpdateEnabled: autoUpdates(),
}); });
@ -53,7 +53,7 @@ export const FeaturesStep: Component<FeaturesStepProps> = (props) => {
showSuccess('Preferences saved!'); showSuccess('Preferences saved!');
props.onNext(); props.onNext();
} catch (error) { } catch (_error) {
// Continue anyway - settings can be changed later // Continue anyway - settings can be changed later
props.onNext(); props.onNext();
} finally { } finally {
@ -73,8 +73,8 @@ export const FeaturesStep: Component<FeaturesStepProps> = (props) => {
<button <button
onClick={() => feature.setEnabled(!feature.enabled())} onClick={() => feature.setEnabled(!feature.enabled())}
class={`w-full p-4 rounded-xl border transition-all text-left flex items-start gap-4 ${feature.enabled() class={`w-full p-4 rounded-xl border transition-all text-left flex items-start gap-4 ${feature.enabled()
? 'bg-blue-500/20 border-blue-400/40' ? 'bg-blue-500/20 border-blue-400/40'
: 'bg-white/5 border-white/10 hover:bg-white/10' : 'bg-white/5 border-white/10 hover:bg-white/10'
}`} }`}
> >
<div class="text-3xl">{feature.icon}</div> <div class="text-3xl">{feature.icon}</div>

View file

@ -58,7 +58,7 @@ export const WelcomeStep: Component<WelcomeStepProps> = (props) => {
props.setIsUnlocked(true); props.setIsUnlocked(true);
showSuccess('Token verified!'); showSuccess('Token verified!');
props.onNext(); props.onNext();
} catch (error) { } catch (_error) {
showError('Invalid bootstrap token. Please check and try again.'); showError('Invalid bootstrap token. Please check and try again.');
} finally { } finally {
setIsValidating(false); setIsValidating(false);