Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| afcbf941a9 | |||
| 49b9778872 | |||
| 6d0dab4889 | |||
| dd509a75be | |||
| e0fc305832 | |||
| c120155170 | |||
| 0241130c2f | |||
| 889af65ae7 |
@@ -50,7 +50,11 @@ public sealed class OpenClawGatewayClient(HttpClient httpClient, IConfiguration
|
|||||||
if (string.IsNullOrWhiteSpace(json))
|
if (string.IsNullOrWhiteSpace(json))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
return JsonNode.Parse(json);
|
var node = JsonNode.Parse(json);
|
||||||
|
// Unwrap the { ok: true, result: ... } envelope
|
||||||
|
if (node?["ok"]?.GetValue<bool>() == true && node["result"] is not null)
|
||||||
|
return node["result"];
|
||||||
|
return node;
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
@@ -58,81 +62,91 @@ public sealed class OpenClawGatewayClient(HttpClient httpClient, IConfiguration
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Extracts useful data from a tool response that may embed JSON in content[0].text.
|
||||||
|
/// Returns the unwrapped "details" object if present, otherwise the raw result.
|
||||||
|
/// </summary>
|
||||||
|
private static JsonNode? ExtractToolData(JsonNode? result)
|
||||||
|
{
|
||||||
|
if (result is null) return null;
|
||||||
|
// Some tools return { details: {...}, content: [...] }
|
||||||
|
if (result["details"] is JsonNode details && details is not JsonValue)
|
||||||
|
return details;
|
||||||
|
// Some tools wrap in content[0].text as JSON string
|
||||||
|
if (result["content"] is JsonArray content && content.Count > 0)
|
||||||
|
{
|
||||||
|
var text = content[0]?["text"]?.GetValue<string>();
|
||||||
|
if (!string.IsNullOrWhiteSpace(text))
|
||||||
|
{
|
||||||
|
try { return JsonNode.Parse(text); }
|
||||||
|
catch { /* fall through */ }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
public async Task<List<DashboardAgentInfo>> GetAgentsAsync()
|
public async Task<List<DashboardAgentInfo>> GetAgentsAsync()
|
||||||
{
|
{
|
||||||
|
// Hardcoded agent list (known from OpenClaw config).
|
||||||
|
// Tools/invoke visibility is restricted to agent:main scope,
|
||||||
|
// so we can't enumerate Iris sessions programmatically.
|
||||||
|
var agentDefs = new[]
|
||||||
|
{
|
||||||
|
new { Id = "iris", Name = "Iris", Model = "GPT-5.4" },
|
||||||
|
new { Id = "programmer", Name = "Programmer", Model = "DeepSeek V4 Flash" },
|
||||||
|
new { Id = "reviewer", Name = "Reviewer", Model = "DeepSeek V4 Pro" },
|
||||||
|
new { Id = "architekt", Name = "DevOps", Model = "DeepSeek V4 Pro" },
|
||||||
|
new { Id = "executor", Name = "Executor", Model = "DeepSeek V4 Flash" },
|
||||||
|
new { Id = "researcher", Name = "Researcher", Model = "DeepSeek V4 Pro" },
|
||||||
|
};
|
||||||
|
|
||||||
var agents = new List<DashboardAgentInfo>();
|
var agents = new List<DashboardAgentInfo>();
|
||||||
|
foreach (var def in agentDefs)
|
||||||
|
{
|
||||||
|
var isActive = false;
|
||||||
|
string? currentTask = null;
|
||||||
|
|
||||||
// Get sessions list (active agents/sessions)
|
// Check workspace activity via file timestamps
|
||||||
var sessionsResult = await InvokeToolAsync("sessions_list");
|
var memDir = $"/mnt/workspace-{def.Id}/memory";
|
||||||
if (sessionsResult is not null)
|
try
|
||||||
{
|
{
|
||||||
var sessions = sessionsResult.AsArray();
|
if (Directory.Exists(memDir))
|
||||||
if (sessions is not null)
|
|
||||||
{
|
{
|
||||||
foreach (var session in sessions)
|
var latestFile = Directory.GetFiles(memDir, "*", SearchOption.AllDirectories)
|
||||||
|
.Select(f => new FileInfo(f))
|
||||||
|
.OrderByDescending(f => f.LastWriteTimeUtc)
|
||||||
|
.FirstOrDefault();
|
||||||
|
|
||||||
|
if (latestFile is not null)
|
||||||
{
|
{
|
||||||
if (session is null) continue;
|
var age = DateTime.UtcNow - latestFile.LastWriteTimeUtc;
|
||||||
var id = session["sessionKey"]?.GetValue<string>() ?? session["id"]?.GetValue<string>() ?? "";
|
isActive = age.TotalMinutes < 15;
|
||||||
var name = session["name"]?.GetValue<string>() ?? id;
|
if (isActive)
|
||||||
var model = session["model"]?.GetValue<string>() ?? "";
|
currentTask = $"Modified: {latestFile.Name}";
|
||||||
var status = session["status"]?.GetValue<string>() ?? "";
|
}
|
||||||
var isActive = status.Equals("active", StringComparison.OrdinalIgnoreCase);
|
}
|
||||||
|
}
|
||||||
|
catch { /* workspace not mounted or inaccessible */ }
|
||||||
|
|
||||||
agents.Add(new DashboardAgentInfo(
|
agents.Add(new DashboardAgentInfo(
|
||||||
Id: id,
|
Id: def.Id,
|
||||||
Name: name,
|
Name: def.Name,
|
||||||
Role: DeriveRole(id),
|
Role: DeriveRole(def.Id),
|
||||||
Model: model,
|
Model: def.Model,
|
||||||
IsActive: isActive,
|
IsActive: isActive,
|
||||||
CurrentTask: session["currentTask"]?.GetValue<string>()
|
CurrentTask: currentTask
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Also get subagents list
|
return agents;
|
||||||
var subagentsResult = await InvokeToolAsync("sub_agents_list");
|
|
||||||
if (subagentsResult is not null && subagentsResult is JsonArray subArray)
|
|
||||||
{
|
|
||||||
foreach (var sub in subArray)
|
|
||||||
{
|
|
||||||
if (sub is null) continue;
|
|
||||||
var id = sub["id"]?.GetValue<string>() ?? "";
|
|
||||||
if (agents.Any(a => a.Id == id)) continue;
|
|
||||||
|
|
||||||
var name = sub["name"]?.GetValue<string>() ?? id;
|
|
||||||
var model = sub["model"]?.GetValue<string>() ?? "";
|
|
||||||
var status = sub["status"]?.GetValue<string>() ?? "";
|
|
||||||
var isActive = status.Equals("active", StringComparison.OrdinalIgnoreCase) ||
|
|
||||||
status.Equals("running", StringComparison.OrdinalIgnoreCase);
|
|
||||||
|
|
||||||
agents.Add(new DashboardAgentInfo(
|
|
||||||
Id: id,
|
|
||||||
Name: name,
|
|
||||||
Role: DeriveRole(id),
|
|
||||||
Model: model,
|
|
||||||
IsActive: isActive,
|
|
||||||
CurrentTask: sub["currentTask"]?.GetValue<string>()
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return agents.Count > 0 ? agents : new List<DashboardAgentInfo>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<MessageEntry>> GetSessionHistoryAsync(string sessionKey, int limit = 50, int offset = 0)
|
public async Task<List<MessageEntry>> GetSessionHistoryAsync(string sessionKey, int limit = 50, int offset = 0)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var result = await InvokeToolAsync("sessions_history", new
|
var result = await InvokeToolAsync("sessions_history", new { sessionKey, limit, offset });
|
||||||
{
|
if (result is null) return new List<MessageEntry>();
|
||||||
sessionKey,
|
|
||||||
limit,
|
|
||||||
offset
|
|
||||||
});
|
|
||||||
|
|
||||||
if (result is null)
|
|
||||||
return new List<MessageEntry>();
|
|
||||||
|
|
||||||
var messages = new List<MessageEntry>();
|
var messages = new List<MessageEntry>();
|
||||||
var array = result as JsonArray ?? result.AsArray();
|
var array = result as JsonArray ?? result.AsArray();
|
||||||
@@ -163,19 +177,13 @@ public sealed class OpenClawGatewayClient(HttpClient httpClient, IConfiguration
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var result = await InvokeToolAsync("sessions_send", new
|
var result = await InvokeToolAsync("sessions_send", new { sessionKey, message });
|
||||||
{
|
if (result is null) return new ChatResponse(false, null, "Gateway nicht erreichbar");
|
||||||
sessionKey,
|
|
||||||
message
|
|
||||||
});
|
|
||||||
|
|
||||||
if (result is null)
|
var ok = result["ok"]?.GetValue<bool>() ?? false;
|
||||||
return new ChatResponse(false, null, "Gateway nicht erreichbar");
|
|
||||||
|
|
||||||
var ok = result["ok"]?.GetValue<bool>() ?? result["success"]?.GetValue<bool>() ?? false;
|
|
||||||
var reply = result["reply"]?.GetValue<string>()
|
var reply = result["reply"]?.GetValue<string>()
|
||||||
?? result["response"]?.GetValue<string>()
|
?? result["response"]?.GetValue<string>()
|
||||||
?? result["content"]?.GetValue<string>();
|
?? result["content"]?[0]?["text"]?.GetValue<string>();
|
||||||
var error = result["error"]?.GetValue<string>();
|
var error = result["error"]?.GetValue<string>();
|
||||||
|
|
||||||
return new ChatResponse(ok, reply, error);
|
return new ChatResponse(ok, reply, error);
|
||||||
@@ -190,24 +198,25 @@ public sealed class OpenClawGatewayClient(HttpClient httpClient, IConfiguration
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var result = await InvokeToolAsync("cron_list");
|
var result = await InvokeToolAsync("cron", new { action = "list" });
|
||||||
if (result is null)
|
var data = ExtractToolData(result);
|
||||||
return new List<QueueItem>();
|
if (data is null) return new List<QueueItem>();
|
||||||
|
|
||||||
var items = new List<QueueItem>();
|
var items = new List<QueueItem>();
|
||||||
var array = result as JsonArray ?? result.AsArray();
|
var jobs = data["jobs"] as JsonArray ?? data.AsArray();
|
||||||
if (array is null) return items;
|
if (jobs is null) return items;
|
||||||
|
|
||||||
foreach (var entry in array)
|
foreach (var j in jobs)
|
||||||
{
|
{
|
||||||
if (entry is null) continue;
|
if (j is null) continue;
|
||||||
var id = entry["id"]?.GetValue<string>() ?? "";
|
var id = j["id"]?.GetValue<string>() ?? "";
|
||||||
var name = entry["name"]?.GetValue<string>() ?? id;
|
var name = j["name"]?.GetValue<string>() ?? id;
|
||||||
var status = entry["status"]?.GetValue<string>() ?? "unknown";
|
var status = j["state"]?["lastStatus"]?.GetValue<string>()
|
||||||
|
?? j["status"]?.GetValue<string>()
|
||||||
|
?? "unknown";
|
||||||
|
|
||||||
items.Add(new QueueItem(id, name, status));
|
items.Add(new QueueItem(id, name, status));
|
||||||
}
|
}
|
||||||
|
|
||||||
return items;
|
return items;
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
@@ -223,35 +232,48 @@ public sealed class OpenClawGatewayClient(HttpClient httpClient, IConfiguration
|
|||||||
var activeAgents = 0;
|
var activeAgents = 0;
|
||||||
var pendingTasks = 0;
|
var pendingTasks = 0;
|
||||||
|
|
||||||
|
// Step 1: Health check (no auth needed)
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Check gateway health
|
using var pingRequest = new HttpRequestMessage(HttpMethod.Get, "/health");
|
||||||
using var pingRequest = new HttpRequestMessage(HttpMethod.Get, "/");
|
|
||||||
ApplyAuth(pingRequest);
|
|
||||||
using var pingResponse = await httpClient.SendAsync(pingRequest);
|
using var pingResponse = await httpClient.SendAsync(pingRequest);
|
||||||
gatewayOk = pingResponse.IsSuccessStatusCode;
|
gatewayOk = pingResponse.IsSuccessStatusCode;
|
||||||
|
|
||||||
if (gatewayOk)
|
|
||||||
{
|
|
||||||
// Get session status
|
|
||||||
var sessionResult = await InvokeToolAsync("session_status");
|
|
||||||
if (sessionResult is not null)
|
|
||||||
{
|
|
||||||
irisStatus = sessionResult["status"]?.GetValue<string>() ?? "Active";
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get agents for active count
|
|
||||||
var agents = await GetAgentsAsync();
|
|
||||||
activeAgents = agents.Count(a => a.IsActive);
|
|
||||||
|
|
||||||
// Get queue/cron for pending tasks
|
|
||||||
var queue = await GetQueueAsync();
|
|
||||||
pendingTasks = queue.Count;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
gatewayOk = false;
|
// gatewayOk stays false
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gatewayOk)
|
||||||
|
{
|
||||||
|
// Step 2: Session status
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var sessionResult = await InvokeToolAsync("session_status");
|
||||||
|
if (sessionResult is not null)
|
||||||
|
{
|
||||||
|
irisStatus = sessionResult["status"]?.GetValue<string>()
|
||||||
|
?? sessionResult["sessionKey"]?.GetValue<string>()
|
||||||
|
?? "Active";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
|
||||||
|
// Step 3: Active agents
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var agents = await GetAgentsAsync();
|
||||||
|
activeAgents = agents.Count(a => a.IsActive);
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
|
|
||||||
|
// Step 4: Queue items
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var queue = await GetQueueAsync();
|
||||||
|
pendingTasks = queue.Count;
|
||||||
|
}
|
||||||
|
catch { }
|
||||||
}
|
}
|
||||||
|
|
||||||
return new DashboardStatus(gatewayOk, irisStatus, activeAgents, pendingTasks);
|
return new DashboardStatus(gatewayOk, irisStatus, activeAgents, pendingTasks);
|
||||||
@@ -263,6 +285,8 @@ public sealed class OpenClawGatewayClient(HttpClient httpClient, IConfiguration
|
|||||||
"programmer" => "Developer",
|
"programmer" => "Developer",
|
||||||
"reviewer" => "Reviewer",
|
"reviewer" => "Reviewer",
|
||||||
"architekt" => "Architect",
|
"architekt" => "Architect",
|
||||||
|
"executor" => "Executor",
|
||||||
|
"researcher" => "Researcher",
|
||||||
"main" => "Assistant",
|
"main" => "Assistant",
|
||||||
_ => "Custom"
|
_ => "Custom"
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
import { ref, nextTick, watch } from 'vue'
|
import { ref, nextTick, watch } from 'vue'
|
||||||
import { Bot, Send, LoaderCircle, Maximize2, X } from '@lucide/vue'
|
import { Bot, Send, LoaderCircle, Maximize2, X } from '@lucide/vue'
|
||||||
import type { ChatMessage } from '../../composables/useDashboardData'
|
import type { ChatMessage } from '../../composables/useDashboardData'
|
||||||
|
import { useDashboardData } from '../../composables/useDashboardData'
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
messages: ChatMessage[]
|
messages: ChatMessage[]
|
||||||
@@ -9,9 +10,7 @@ const props = defineProps<{
|
|||||||
irisFocus: string
|
irisFocus: string
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const { sendChatMessage } = useDashboardData()
|
||||||
send: [text: string]
|
|
||||||
}>()
|
|
||||||
|
|
||||||
const inputText = ref('')
|
const inputText = ref('')
|
||||||
const chatListRef = ref<HTMLElement | null>(null)
|
const chatListRef = ref<HTMLElement | null>(null)
|
||||||
@@ -20,7 +19,7 @@ const chatModalOpen = ref(false)
|
|||||||
|
|
||||||
function sendMessage(): void {
|
function sendMessage(): void {
|
||||||
if (!inputText.value.trim()) return
|
if (!inputText.value.trim()) return
|
||||||
emit('send', inputText.value)
|
sendChatMessage(inputText.value)
|
||||||
inputText.value = ''
|
inputText.value = ''
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,13 @@
|
|||||||
import { ref, reactive, computed } from 'vue'
|
import { ref, computed } from 'vue'
|
||||||
|
|
||||||
|
// ── Shared State (singleton: same state regardless of how many times useDashboardData() is called) ──
|
||||||
|
const sessionStart = Date.now()
|
||||||
|
|
||||||
|
// Intervals registry for cleanup
|
||||||
|
const intervals: ReturnType<typeof setInterval>[] = []
|
||||||
|
let cleanupRegistered = false
|
||||||
|
|
||||||
|
// ── Interfaces (exported for components) ──
|
||||||
|
|
||||||
export interface AgentNodeData {
|
export interface AgentNodeData {
|
||||||
id: string
|
id: string
|
||||||
@@ -49,260 +58,392 @@ export interface QueueItem {
|
|||||||
waitTime: string
|
waitTime: string
|
||||||
}
|
}
|
||||||
|
|
||||||
const now = Date.now()
|
// ── API Response Interfaces ──
|
||||||
|
|
||||||
export function useDashboardData() {
|
interface DashboardStatusResponse {
|
||||||
const sessionStart = Date.now()
|
gatewayOk: boolean
|
||||||
|
irisStatus: string
|
||||||
|
activeAgents: number
|
||||||
|
pendingTasks: number
|
||||||
|
}
|
||||||
|
|
||||||
// Runtime counter
|
interface DashboardAgentInfo {
|
||||||
const runtimeSeconds = ref(0)
|
id: string
|
||||||
let runtimeInterval: ReturnType<typeof setInterval> | null = null
|
name: string
|
||||||
|
role: string
|
||||||
|
model: string
|
||||||
|
isActive: boolean
|
||||||
|
currentTask: string
|
||||||
|
}
|
||||||
|
|
||||||
function startRuntime() {
|
interface DashboardOperationEntry {
|
||||||
const startTs = sessionStart
|
agent: string
|
||||||
runtimeSeconds.value = Math.floor((Date.now() - startTs) / 1000)
|
action: string
|
||||||
runtimeInterval = setInterval(() => {
|
timestamp: string
|
||||||
runtimeSeconds.value = Math.floor((Date.now() - startTs) / 1000)
|
time: string
|
||||||
}, 1000)
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function stopRuntime() {
|
interface DashboardChatMessage {
|
||||||
if (runtimeInterval) {
|
role: 'user' | 'assistant'
|
||||||
clearInterval(runtimeInterval)
|
content: string
|
||||||
runtimeInterval = null
|
timestamp: string
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
const formatRuntime = (seconds: number): string => {
|
interface DashboardSendResponse {
|
||||||
const m = Math.floor(seconds / 60)
|
ok: boolean
|
||||||
const s = seconds % 60
|
reply?: string
|
||||||
return `${String(m).padStart(2, '0')}:${String(s).padStart(2, '0')}`
|
error?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
const irisRuntime = computed(() => formatRuntime(runtimeSeconds.value))
|
interface DashboardQueueItem {
|
||||||
|
id: string
|
||||||
|
name: string
|
||||||
|
status: string
|
||||||
|
}
|
||||||
|
|
||||||
// Agent runtimes (simulated)
|
// ── Agent Catalog (static enrichment) ──
|
||||||
const agentStartTimes = reactive<Record<string, number>>({
|
|
||||||
iris: now - 28800000,
|
|
||||||
developer: now - 3600000,
|
|
||||||
devops: now - 1800000,
|
|
||||||
researcher: now - 2700000,
|
|
||||||
reviewer: now - 900000,
|
|
||||||
})
|
|
||||||
|
|
||||||
const getAgentRuntime = (id: string): string => {
|
const AGENT_CATALOG: Record<string, Partial<AgentNodeData>> = {
|
||||||
const start = agentStartTimes[id]
|
iris: {
|
||||||
if (!start) return '00:00'
|
|
||||||
const secs = Math.floor((now - start) / 1000)
|
|
||||||
const m = Math.floor(secs / 60)
|
|
||||||
const s = secs % 60
|
|
||||||
return `${String(m).padStart(2, '0')}:${String(s).padStart(2, '0')}`
|
|
||||||
}
|
|
||||||
|
|
||||||
// Agents
|
|
||||||
const agents = ref<AgentNodeData[]>([
|
|
||||||
{
|
|
||||||
id: 'iris',
|
|
||||||
name: 'Iris',
|
|
||||||
role: 'Chief of Staff',
|
|
||||||
description: 'Koordiniert, delegiert, hält das Team tight. Die erste Anlaufstelle zwischen Boss und Maschine.',
|
description: 'Koordiniert, delegiert, hält das Team tight. Die erste Anlaufstelle zwischen Boss und Maschine.',
|
||||||
tags: ['Orchestration', 'Delegation', 'Approval'],
|
tags: ['Orchestration', 'Delegation', 'Approval'],
|
||||||
color: '#8b7cf6',
|
color: '#8b7cf6',
|
||||||
icon: 'bot',
|
icon: 'bot',
|
||||||
hero: true,
|
hero: true,
|
||||||
currentTask: 'Orchestrating Nexus Dashboard redesign',
|
|
||||||
goal: 'Complete Mission Control v3',
|
goal: 'Complete Mission Control v3',
|
||||||
progress: 85,
|
progress: 85,
|
||||||
workload: 55,
|
workload: 55,
|
||||||
active: true,
|
workingFeed: [],
|
||||||
runtimeSeconds: 28800,
|
thinkingStream: [],
|
||||||
model: 'GPT-5.4',
|
|
||||||
workingFeed: [
|
|
||||||
{ time: '22:38', text: 'Analyzed user feedback on Dashboard' },
|
|
||||||
{ time: '22:36', text: 'Delegated card redesign to Developer' },
|
|
||||||
{ time: '22:34', text: 'Verifying full-width layout deployment' },
|
|
||||||
{ time: '22:32', text: 'Reviewing AgentModal integration' },
|
|
||||||
],
|
|
||||||
thinkingStream: [
|
|
||||||
{ time: '22:24', text: 'Analysing constraint: full-width layout' },
|
|
||||||
{ time: '22:25', text: 'Removing max-width from global CSS' },
|
|
||||||
{ time: '22:26', text: 'Verifying Dashboard grid reflow' },
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
{
|
developer: {
|
||||||
id: 'developer',
|
|
||||||
name: 'Developer',
|
|
||||||
role: 'Backend & Frontend',
|
|
||||||
description: 'Implements features across the stack with TypeScript, C#, and Vue.',
|
description: 'Implements features across the stack with TypeScript, C#, and Vue.',
|
||||||
tags: ['Coding', 'Development', 'Builds'],
|
tags: ['Coding', 'Development', 'Builds'],
|
||||||
color: '#3b82f6',
|
color: '#3b82f6',
|
||||||
icon: 'code',
|
icon: 'code',
|
||||||
currentTask: 'Building Dungeon System API endpoints',
|
|
||||||
goal: 'Complete Dungeon CRUD + room generation',
|
goal: 'Complete Dungeon CRUD + room generation',
|
||||||
progress: 62,
|
progress: 62,
|
||||||
workload: 65,
|
workload: 65,
|
||||||
active: true,
|
workingFeed: [],
|
||||||
runtimeSeconds: 3600,
|
thinkingStream: [],
|
||||||
workingFeed: [
|
|
||||||
{ time: '22:30', text: 'Created DungeonController' },
|
|
||||||
{ time: '22:28', text: 'Defined dungeon schema' },
|
|
||||||
{ time: '22:26', text: 'Implementing room generation algorithm' },
|
|
||||||
{ time: '22:24', text: 'Writing unit tests for RoomFactory' },
|
|
||||||
],
|
|
||||||
thinkingStream: [
|
|
||||||
{ time: '22:22', text: 'Parsing dungeon spec from Iris' },
|
|
||||||
{ time: '22:23', text: 'Designing RoomFactory interface' },
|
|
||||||
{ time: '22:24', text: 'Implementing corridor connection logic' },
|
|
||||||
],
|
|
||||||
model: 'DeepSeek V4 Flash',
|
|
||||||
},
|
},
|
||||||
{
|
devops: {
|
||||||
id: 'devops',
|
|
||||||
name: 'DevOps',
|
|
||||||
role: 'Infrastructure & CI/CD',
|
|
||||||
description: 'Manages Docker, deployment pipelines, and system reliability.',
|
description: 'Manages Docker, deployment pipelines, and system reliability.',
|
||||||
tags: ['Deployment', 'Docker', 'CI/CD'],
|
tags: ['Deployment', 'Docker', 'CI/CD'],
|
||||||
color: '#eab308',
|
color: '#eab308',
|
||||||
icon: 'server',
|
icon: 'server',
|
||||||
currentTask: 'Optimizing Docker Compose caching',
|
|
||||||
goal: 'Reduce build times by 40%',
|
goal: 'Reduce build times by 40%',
|
||||||
progress: 45,
|
progress: 45,
|
||||||
workload: 40,
|
workload: 40,
|
||||||
active: false,
|
workingFeed: [],
|
||||||
runtimeSeconds: 1800,
|
thinkingStream: [],
|
||||||
workingFeed: [
|
|
||||||
{ time: '22:20', text: 'Analyzed Docker layer cache' },
|
|
||||||
{ time: '22:18', text: 'Optimized COPY order in Dockerfile' },
|
|
||||||
{ time: '22:16', text: 'Added .dockerignore for node_modules' },
|
|
||||||
{ time: '22:14', text: 'Testing incremental builds' },
|
|
||||||
],
|
|
||||||
thinkingStream: [
|
|
||||||
{ time: '22:20', text: 'Checking build cache hit rates' },
|
|
||||||
{ time: '22:21', text: 'Benchmarking multi-stage vs single-stage' },
|
|
||||||
{ time: '22:22', text: 'Calculating potential speedup from caching' },
|
|
||||||
],
|
|
||||||
model: 'DeepSeek V4 Pro',
|
|
||||||
},
|
},
|
||||||
{
|
researcher: {
|
||||||
id: 'researcher',
|
|
||||||
name: 'Researcher',
|
|
||||||
role: 'Analysis & Documentation',
|
|
||||||
description: 'Researches APIs, patterns, and best practices. Maintains docs.',
|
description: 'Researches APIs, patterns, and best practices. Maintains docs.',
|
||||||
tags: ['Research', 'Analysis', 'Docs'],
|
tags: ['Research', 'Analysis', 'Docs'],
|
||||||
color: '#22c55e',
|
color: '#22c55e',
|
||||||
icon: 'search',
|
icon: 'search',
|
||||||
currentTask: 'Analyzing WebSocket alternatives',
|
|
||||||
goal: 'Recommend real-time communication strategy',
|
goal: 'Recommend real-time communication strategy',
|
||||||
progress: 30,
|
progress: 30,
|
||||||
workload: 25,
|
workload: 25,
|
||||||
active: true,
|
workingFeed: [],
|
||||||
runtimeSeconds: 2700,
|
thinkingStream: [],
|
||||||
workingFeed: [
|
|
||||||
{ time: '22:18', text: 'Evaluated WebSocket vs SSE vs WebRTC' },
|
|
||||||
{ time: '22:17', text: 'Documented SignalR limitations' },
|
|
||||||
{ time: '22:16', text: 'Prototyping WebSocket fallback' },
|
|
||||||
],
|
|
||||||
thinkingStream: [
|
|
||||||
{ time: '22:18', text: 'Cross-referencing WebSocket latency benchmarks' },
|
|
||||||
{ time: '22:19', text: 'Checking SSE browser support matrix' },
|
|
||||||
{ time: '22:20', text: 'Drafting recommendation summary' },
|
|
||||||
],
|
|
||||||
model: 'DeepSeek V4 Pro',
|
|
||||||
},
|
},
|
||||||
{
|
reviewer: {
|
||||||
id: 'reviewer',
|
|
||||||
name: 'Reviewer',
|
|
||||||
role: 'Code Quality & Testing',
|
|
||||||
description: 'Reviews pull requests, enforces standards, runs test suites.',
|
description: 'Reviews pull requests, enforces standards, runs test suites.',
|
||||||
tags: ['Code Review', 'Testing', 'Quality'],
|
tags: ['Code Review', 'Testing', 'Quality'],
|
||||||
color: '#a855f7',
|
color: '#a855f7',
|
||||||
icon: 'shield',
|
icon: 'shield',
|
||||||
currentTask: 'Reviewing Dungeon System PR',
|
|
||||||
goal: 'Zero critical findings before merge',
|
goal: 'Zero critical findings before merge',
|
||||||
progress: 80,
|
progress: 80,
|
||||||
workload: 50,
|
workload: 50,
|
||||||
active: false,
|
workingFeed: [],
|
||||||
runtimeSeconds: 900,
|
thinkingStream: [],
|
||||||
workingFeed: [
|
|
||||||
{ time: '22:15', text: 'Reviewed DungeonController.cs' },
|
|
||||||
{ time: '22:14', text: 'Found 3 minor style issues' },
|
|
||||||
{ time: '22:13', text: 'Approved RoomValidator' },
|
|
||||||
{ time: '22:12', text: 'Running integration tests' },
|
|
||||||
],
|
|
||||||
thinkingStream: [
|
|
||||||
{ time: '22:15', text: 'Analyzing DungeonController PR diff' },
|
|
||||||
{ time: '22:16', text: 'Checking RoomValidator edge cases' },
|
|
||||||
{ time: '22:17', text: 'Verifying integration test coverage' },
|
|
||||||
],
|
|
||||||
model: 'DeepSeek V4 Pro',
|
|
||||||
},
|
},
|
||||||
])
|
}
|
||||||
|
|
||||||
// Open Tasks
|
function enrichAgent(api: DashboardAgentInfo): AgentNodeData {
|
||||||
const openTasks = ref<OpenTask[]>([
|
const catalog = AGENT_CATALOG[api.id] ?? AGENT_CATALOG['developer']
|
||||||
|
return {
|
||||||
|
id: api.id,
|
||||||
|
name: api.name,
|
||||||
|
role: api.role,
|
||||||
|
model: api.model,
|
||||||
|
currentTask: api.currentTask ?? 'Idle',
|
||||||
|
active: api.isActive,
|
||||||
|
description: catalog.description ?? '',
|
||||||
|
tags: catalog.tags ?? [],
|
||||||
|
color: catalog.color ?? '#6b7385',
|
||||||
|
icon: catalog.icon ?? 'bot',
|
||||||
|
hero: catalog.hero ?? false,
|
||||||
|
goal: catalog.goal ?? 'No goal set',
|
||||||
|
progress: catalog.progress ?? 0,
|
||||||
|
workload: catalog.workload ?? 0,
|
||||||
|
runtimeSeconds: 0,
|
||||||
|
workingFeed: catalog.workingFeed ?? [],
|
||||||
|
thinkingStream: catalog.thinkingStream ?? [],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ── Helper: API Fetch with auth ──
|
||||||
|
|
||||||
|
async function apiFetch(path: string, init: RequestInit = {}): Promise<Response> {
|
||||||
|
const base = '' // same-origin proxy
|
||||||
|
return fetch(`${base}${path}`, {
|
||||||
|
...init,
|
||||||
|
credentials: 'include',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
...(init.headers as Record<string, string> ?? {}),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// ── State ──
|
||||||
|
|
||||||
|
// Status
|
||||||
|
const gatewayOk = ref(true)
|
||||||
|
const irisStatus = ref('Active')
|
||||||
|
const activeAgents = ref(0)
|
||||||
|
const pendingTasks = ref(0)
|
||||||
|
|
||||||
|
// Agents
|
||||||
|
const agents = ref<AgentNodeData[]>([])
|
||||||
|
|
||||||
|
// Chat
|
||||||
|
const chatMessages = ref<ChatMessage[]>([])
|
||||||
|
const irisBusy = ref(false)
|
||||||
|
const irisFocus = ref('')
|
||||||
|
|
||||||
|
// Operations Feed
|
||||||
|
const feedEntries = ref<FeedEntry[]>([])
|
||||||
|
|
||||||
|
// Open Tasks (mock only – no API endpoint)
|
||||||
|
const openTasks = ref<OpenTask[]>([
|
||||||
{ id: 't1', title: 'Agent Thinking Panel visualisieren', detail: 'Live-Animation der Denkprozesse im AgentModal', source: 'iris', createdAt: '22:30' },
|
{ id: 't1', title: 'Agent Thinking Panel visualisieren', detail: 'Live-Animation der Denkprozesse im AgentModal', source: 'iris', createdAt: '22:30' },
|
||||||
{ id: 't2', title: 'CI/CD Pipeline Monitoring Dashboard', detail: 'Echtzeit-Status der Gitea Actions im Dashboard', source: 'iris', createdAt: '21:15' },
|
{ id: 't2', title: 'CI/CD Pipeline Monitoring Dashboard', detail: 'Echtzeit-Status der Gitea Actions im Dashboard', source: 'iris', createdAt: '21:15' },
|
||||||
{ id: 't3', title: 'Dungeon System Dokumentation', detail: 'API-Doku für Room-Generation-Endpunkte schreiben', source: 'bao', createdAt: '20:00' },
|
{ id: 't3', title: 'Dungeon System Dokumentation', detail: 'API-Doku für Room-Generation-Endpunkte schreiben', source: 'bao', createdAt: '20:00' },
|
||||||
])
|
])
|
||||||
|
|
||||||
// Feed
|
// Queue
|
||||||
const ts = (offset: number) => new Date(now + offset).toISOString()
|
const queue = ref<QueueItem[]>([])
|
||||||
const feedEntries = ref<FeedEntry[]>([
|
|
||||||
{ time: '22:50', agent: 'Developer', action: 'Created DungeonController endpoints', timestamp: ts(-120000) },
|
|
||||||
{ time: '22:46', agent: 'DevOps', action: 'Optimized Docker COPY order for layer caching', timestamp: ts(-360000) },
|
|
||||||
{ time: '22:42', agent: 'Iris', action: 'Delegated room generation to Developer with spec', timestamp: ts(-600000) },
|
|
||||||
{ time: '22:35', agent: 'Researcher', action: 'Documented WebSocket vs SSE analysis results', timestamp: ts(-960000) },
|
|
||||||
{ time: '22:28', agent: 'Reviewer', action: 'Approved RoomValidator PR with minor fixes', timestamp: ts(-1200000) },
|
|
||||||
{ time: '22:18', agent: 'DevOps', action: 'Added .dockerignore for node_modules and build artifacts', timestamp: ts(-1500000) },
|
|
||||||
{ time: '22:08', agent: 'Iris', action: 'Broke down Dungeon System tasks into sub-tasks', timestamp: ts(-1800000) },
|
|
||||||
{ time: '21:55', agent: 'Developer', action: 'Defined dungeon schema models with validation', timestamp: ts(-2400000) },
|
|
||||||
])
|
|
||||||
|
|
||||||
// Chat
|
// Runtime
|
||||||
const chatMessages = ref<ChatMessage[]>([
|
const runtimeSeconds = ref(0)
|
||||||
{ id: 'm1', sender: 'iris', text: 'Guten Abend, Bao. Ready to continue the Dungeon System?', timestamp: now - 600000 },
|
let runtimeInterval: ReturnType<typeof setInterval> | null = null
|
||||||
{ id: 'm2', sender: 'user', text: "Yes, what's the status?", timestamp: now - 540000 },
|
|
||||||
{ id: 'm3', sender: 'iris', text: "Developer is at 62% on room generation. Reviewer approved the schema. I'd recommend focusing on the room connection logic next.", timestamp: now - 480000 },
|
|
||||||
])
|
|
||||||
|
|
||||||
const irisBusy = ref(true)
|
// ── Fetch Functions ──
|
||||||
const irisFocus = ref('Breaking down Dungeon System for DevOps and Developer')
|
|
||||||
|
|
||||||
// Queue
|
async function fetchStatus(): Promise<void> {
|
||||||
const queue = ref<QueueItem[]>([
|
try {
|
||||||
{ id: 'q1', text: 'Deploy latest dashboard build to preview', priority: 'high', waitTime: '2 min' },
|
const res = await apiFetch('/api/dashboard/status')
|
||||||
{ id: 'q2', text: 'Review infrastructure cost analysis', priority: 'medium', waitTime: '8 min' },
|
if (!res.ok) return
|
||||||
{ id: 'q3', text: 'Schedule B2 German lesson review', priority: 'low', waitTime: '15 min' },
|
const data: DashboardStatusResponse = await res.json()
|
||||||
{ id: 'q4', text: 'Update project roadmap document', priority: 'medium', waitTime: '12 min' },
|
gatewayOk.value = data.gatewayOk
|
||||||
])
|
irisStatus.value = data.irisStatus
|
||||||
|
activeAgents.value = data.activeAgents
|
||||||
|
pendingTasks.value = data.pendingTasks
|
||||||
|
} catch {
|
||||||
|
// API unreachable – keep current values
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function sendChat(text: string): void {
|
async function fetchAgents(): Promise<void> {
|
||||||
|
try {
|
||||||
|
const res = await apiFetch('/api/dashboard/agents')
|
||||||
|
if (!res.ok) return
|
||||||
|
const data: DashboardAgentInfo[] = await res.json()
|
||||||
|
agents.value = data.map(enrichAgent)
|
||||||
|
} catch {
|
||||||
|
// API unreachable – keep current values
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function fetchOperations(): Promise<void> {
|
||||||
|
try {
|
||||||
|
const res = await apiFetch('/api/dashboard/operations?limit=20')
|
||||||
|
if (!res.ok) return
|
||||||
|
const data: DashboardOperationEntry[] = await res.json()
|
||||||
|
feedEntries.value = data.map((entry) => ({
|
||||||
|
time: entry.time,
|
||||||
|
agent: entry.agent,
|
||||||
|
action: entry.action,
|
||||||
|
timestamp: entry.timestamp,
|
||||||
|
}))
|
||||||
|
} catch {
|
||||||
|
// API unreachable – keep current values
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function fetchChatMessages(): Promise<void> {
|
||||||
|
try {
|
||||||
|
const res = await apiFetch('/api/dashboard/chat/messages?limit=50')
|
||||||
|
if (!res.ok) return
|
||||||
|
const data: DashboardChatMessage[] = await res.json()
|
||||||
|
chatMessages.value = data.map((msg, idx) => ({
|
||||||
|
id: `msg-${idx}`,
|
||||||
|
sender: msg.role === 'assistant' ? 'iris' : 'user',
|
||||||
|
text: msg.content,
|
||||||
|
timestamp: new Date(msg.timestamp).getTime(),
|
||||||
|
}))
|
||||||
|
} catch {
|
||||||
|
// API unreachable – keep current values
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function fetchQueue(): Promise<void> {
|
||||||
|
try {
|
||||||
|
const res = await apiFetch('/api/dashboard/queue')
|
||||||
|
if (!res.ok) return
|
||||||
|
const data: DashboardQueueItem[] = await res.json()
|
||||||
|
queue.value = data.map((item) => ({
|
||||||
|
id: item.id,
|
||||||
|
text: item.name,
|
||||||
|
priority: (item.status === 'high' || item.status === 'medium' || item.status === 'low')
|
||||||
|
? item.status as 'high' | 'medium' | 'low'
|
||||||
|
: 'medium',
|
||||||
|
waitTime: '--',
|
||||||
|
}))
|
||||||
|
} catch {
|
||||||
|
// API unreachable – keep current values
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ── Chat Send ──
|
||||||
|
|
||||||
|
async function sendChatMessage(text: string): Promise<void> {
|
||||||
if (!text.trim()) return
|
if (!text.trim()) return
|
||||||
|
|
||||||
|
// Optimistic add
|
||||||
chatMessages.value.push({
|
chatMessages.value.push({
|
||||||
id: `user-${Date.now()}`,
|
id: `user-${Date.now()}`,
|
||||||
sender: 'user',
|
sender: 'user',
|
||||||
text: text.trim(),
|
text: text.trim(),
|
||||||
timestamp: Date.now(),
|
timestamp: Date.now(),
|
||||||
})
|
})
|
||||||
}
|
|
||||||
|
|
||||||
function removeQueueItem(id: string): void {
|
irisBusy.value = true
|
||||||
|
|
||||||
|
try {
|
||||||
|
const res = await apiFetch('/api/dashboard/chat/send', {
|
||||||
|
method: 'POST',
|
||||||
|
body: JSON.stringify({ message: text.trim() }),
|
||||||
|
})
|
||||||
|
const data: DashboardSendResponse = await res.json()
|
||||||
|
|
||||||
|
if (data.ok && data.reply) {
|
||||||
|
chatMessages.value.push({
|
||||||
|
id: `iris-${Date.now()}`,
|
||||||
|
sender: 'iris',
|
||||||
|
text: data.reply,
|
||||||
|
timestamp: Date.now(),
|
||||||
|
})
|
||||||
|
} else if (data.error) {
|
||||||
|
chatMessages.value.push({
|
||||||
|
id: `error-${Date.now()}`,
|
||||||
|
sender: 'iris',
|
||||||
|
text: `⚠️ ${data.error}`,
|
||||||
|
timestamp: Date.now(),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
chatMessages.value.push({
|
||||||
|
id: `error-${Date.now()}`,
|
||||||
|
sender: 'iris',
|
||||||
|
text: '⚠️ Connection error. Please try again.',
|
||||||
|
timestamp: Date.now(),
|
||||||
|
})
|
||||||
|
} finally {
|
||||||
|
irisBusy.value = false
|
||||||
|
irisFocus.value = text.trim()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ── Queue Operations ──
|
||||||
|
|
||||||
|
function removeQueueItem(id: string): void {
|
||||||
const idx = queue.value.findIndex(q => q.id === id)
|
const idx = queue.value.findIndex(q => q.id === id)
|
||||||
if (idx !== -1) queue.value.splice(idx, 1)
|
if (idx !== -1) queue.value.splice(idx, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
function moveQueueItem(fromIdx: number, toIdx: number): void {
|
function moveQueueItem(fromIdx: number, toIdx: number): void {
|
||||||
if (toIdx < 0 || toIdx >= queue.value.length) return
|
if (toIdx < 0 || toIdx >= queue.value.length) return
|
||||||
const [item] = queue.value.splice(fromIdx, 1)
|
const [item] = queue.value.splice(fromIdx, 1)
|
||||||
queue.value.splice(toIdx, 0, item)
|
queue.value.splice(toIdx, 0, item)
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeQueuePriority(id: string, priority: QueueItem['priority']): void {
|
function changeQueuePriority(id: string, priority: QueueItem['priority']): void {
|
||||||
const item = queue.value.find(q => q.id === id)
|
const item = queue.value.find(q => q.id === id)
|
||||||
if (item) item.priority = priority
|
if (item) item.priority = priority
|
||||||
|
}
|
||||||
|
|
||||||
|
// ── Runtime ──
|
||||||
|
|
||||||
|
function startRuntime(): void {
|
||||||
|
const startTs = sessionStart
|
||||||
|
runtimeSeconds.value = Math.floor((Date.now() - startTs) / 1000)
|
||||||
|
runtimeInterval = setInterval(() => {
|
||||||
|
runtimeSeconds.value = Math.floor((Date.now() - startTs) / 1000)
|
||||||
|
}, 1000)
|
||||||
|
}
|
||||||
|
|
||||||
|
function stopRuntime(): void {
|
||||||
|
if (runtimeInterval) {
|
||||||
|
clearInterval(runtimeInterval)
|
||||||
|
runtimeInterval = null
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const formatRuntime = (seconds: number): string => {
|
||||||
|
const m = Math.floor(seconds / 60)
|
||||||
|
const s = seconds % 60
|
||||||
|
return `${String(m).padStart(2, '0')}:${String(s).padStart(2, '0')}`
|
||||||
|
}
|
||||||
|
|
||||||
|
const irisRuntime = computed(() => formatRuntime(runtimeSeconds.value))
|
||||||
|
|
||||||
|
const getAgentRuntime = (_id: string): string => {
|
||||||
|
// Could be extended to track per-agent runtimes from API
|
||||||
|
return formatRuntime(runtimeSeconds.value)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ── Polling starten (nur einmal) ──
|
||||||
|
|
||||||
|
function startPolling(): void {
|
||||||
|
if (cleanupRegistered) return
|
||||||
|
cleanupRegistered = true
|
||||||
|
|
||||||
|
// Initial fetches
|
||||||
|
fetchStatus()
|
||||||
|
fetchAgents()
|
||||||
|
fetchOperations()
|
||||||
|
fetchChatMessages()
|
||||||
|
fetchQueue()
|
||||||
|
|
||||||
|
// Polling intervals
|
||||||
|
intervals.push(setInterval(fetchStatus, 5000))
|
||||||
|
intervals.push(setInterval(fetchAgents, 10000))
|
||||||
|
intervals.push(setInterval(fetchOperations, 10000))
|
||||||
|
intervals.push(setInterval(fetchChatMessages, 3000))
|
||||||
|
intervals.push(setInterval(fetchQueue, 10000))
|
||||||
|
}
|
||||||
|
|
||||||
|
function stopPolling(): void {
|
||||||
|
for (const interval of intervals) {
|
||||||
|
clearInterval(interval)
|
||||||
|
}
|
||||||
|
intervals.length = 0
|
||||||
|
cleanupRegistered = false
|
||||||
|
}
|
||||||
|
|
||||||
|
// ── Composable Export ──
|
||||||
|
|
||||||
|
export function useDashboardData() {
|
||||||
|
// Start polling on first call
|
||||||
|
startPolling()
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
// State
|
||||||
agents,
|
agents,
|
||||||
openTasks,
|
openTasks,
|
||||||
feedEntries,
|
feedEntries,
|
||||||
@@ -311,14 +452,29 @@ export function useDashboardData() {
|
|||||||
irisFocus,
|
irisFocus,
|
||||||
irisRuntime,
|
irisRuntime,
|
||||||
queue,
|
queue,
|
||||||
|
gatewayOk,
|
||||||
|
irisStatus,
|
||||||
|
pendingTasks,
|
||||||
|
activeAgents,
|
||||||
|
|
||||||
|
// Runtime
|
||||||
runtimeSeconds,
|
runtimeSeconds,
|
||||||
getAgentRuntime,
|
getAgentRuntime,
|
||||||
startRuntime,
|
startRuntime,
|
||||||
stopRuntime,
|
stopRuntime,
|
||||||
formatRuntime,
|
formatRuntime,
|
||||||
sendChat,
|
|
||||||
|
// Actions
|
||||||
|
sendChatMessage,
|
||||||
removeQueueItem,
|
removeQueueItem,
|
||||||
moveQueueItem,
|
moveQueueItem,
|
||||||
changeQueuePriority,
|
changeQueuePriority,
|
||||||
|
|
||||||
|
// Fetch (for manual refresh)
|
||||||
|
fetchStatus,
|
||||||
|
fetchAgents,
|
||||||
|
fetchOperations,
|
||||||
|
fetchChatMessages,
|
||||||
|
fetchQueue,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ const {
|
|||||||
agents, openTasks, feedEntries, chatMessages,
|
agents, openTasks, feedEntries, chatMessages,
|
||||||
irisBusy, irisFocus, queue,
|
irisBusy, irisFocus, queue,
|
||||||
getAgentRuntime, startRuntime, stopRuntime,
|
getAgentRuntime, startRuntime, stopRuntime,
|
||||||
sendChat, removeQueueItem, moveQueueItem, changeQueuePriority,
|
sendChatMessage, removeQueueItem, moveQueueItem, changeQueuePriority,
|
||||||
} = useDashboardData()
|
} = useDashboardData()
|
||||||
|
|
||||||
const selectedAgent = ref<AgentNodeData | null>(null)
|
const selectedAgent = ref<AgentNodeData | null>(null)
|
||||||
@@ -26,8 +26,6 @@ function onAgentSelect(id: string) {
|
|||||||
onMounted(startRuntime)
|
onMounted(startRuntime)
|
||||||
onUnmounted(stopRuntime)
|
onUnmounted(stopRuntime)
|
||||||
|
|
||||||
function onChatSend(text: string): void { sendChat(text) }
|
|
||||||
|
|
||||||
function onQueueMoveUp(id: string): void {
|
function onQueueMoveUp(id: string): void {
|
||||||
const idx = queue.value.findIndex(q => q.id === id)
|
const idx = queue.value.findIndex(q => q.id === id)
|
||||||
if (idx > 0) moveQueueItem(idx, idx - 1)
|
if (idx > 0) moveQueueItem(idx, idx - 1)
|
||||||
@@ -88,7 +86,7 @@ function onQueueExecuteNow(id: string): void {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-right">
|
<div class="col-right">
|
||||||
<ChatPanel :messages="chatMessages" :iris-busy="irisBusy" :iris-focus="irisFocus" @send="onChatSend" />
|
<ChatPanel :messages="chatMessages" :iris-busy="irisBusy" :iris-focus="irisFocus" />
|
||||||
<QueuePanel :items="queue" @remove="removeQueueItem" @move-up="onQueueMoveUp" @move-down="onQueueMoveDown" @change-priority="changeQueuePriority" @execute-now="onQueueExecuteNow" />
|
<QueuePanel :items="queue" @remove="removeQueueItem" @move-up="onQueueMoveUp" @move-down="onQueueMoveDown" @change-priority="changeQueuePriority" @execute-now="onQueueExecuteNow" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user