@burdenoff/microfe-vibecontrols 2026.525.3 → 2026.525.5
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/dist/components/agent-manager/AgentManagerSessionItem.js +63 -62
- package/dist/components/agent-manager/AgentManagerSessionItem.js.map +1 -1
- package/dist/components/agent-manager/ProfilesPanel.js +105 -103
- package/dist/components/agent-manager/ProfilesPanel.js.map +1 -1
- package/dist/components/agents/OpenInBrowserEditorButton.js +24 -14
- package/dist/components/agents/OpenInBrowserEditorButton.js.map +1 -1
- package/dist/components/ai/AiSectionTabs.js +29 -0
- package/dist/components/ai/AiSectionTabs.js.map +1 -0
- package/dist/hooks/useActiveAgentProfile.js +33 -14
- package/dist/hooks/useActiveAgentProfile.js.map +1 -1
- package/dist/pages/ai/AIBookmarksPage.js +160 -155
- package/dist/pages/ai/AIBookmarksPage.js.map +1 -1
- package/dist/pages/ai/AgentManagerPage.js +115 -110
- package/dist/pages/ai/AgentManagerPage.js.map +1 -1
- package/dist/translations/en.js +1 -1
- package/dist/translations/en.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import { useTr as e } from "../../shared/hooks/useTr.js";
|
|
2
|
-
import {
|
|
2
|
+
import { useVibeNavigate as t } from "../../providers/VibeControlsProvider.js";
|
|
3
|
+
import { SelectionCheckbox as n } from "../shared/SelectionCheckbox.js";
|
|
3
4
|
import "../shared/index.js";
|
|
4
|
-
import { updateSessionConfig as
|
|
5
|
-
import { useAgentManagerStore as
|
|
6
|
-
import { relativeTime as
|
|
7
|
-
import { useState as
|
|
8
|
-
import { Pin as
|
|
9
|
-
import { motion as
|
|
10
|
-
import { jsx as
|
|
5
|
+
import { updateSessionConfig as r } from "../../services/aiApi.js";
|
|
6
|
+
import { useAgentManagerStore as i } from "../../store/agentManagerStore.js";
|
|
7
|
+
import { relativeTime as a } from "../../utils/relativeTime.js";
|
|
8
|
+
import { useState as o } from "react";
|
|
9
|
+
import { Pin as s, Tag as c, Trash2 as l } from "lucide-react";
|
|
10
|
+
import { motion as u } from "framer-motion";
|
|
11
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
11
12
|
//#region src/components/agent-manager/AgentManagerSessionItem.tsx
|
|
12
|
-
var
|
|
13
|
+
var p = {
|
|
13
14
|
active: "bg-status-success-bg",
|
|
14
15
|
idle: "bg-status-warning-bg",
|
|
15
16
|
error: "bg-status-error-bg",
|
|
16
17
|
terminated: "bg-border-default",
|
|
17
18
|
processing: "bg-status-info-bg"
|
|
18
19
|
};
|
|
19
|
-
function
|
|
20
|
-
let [
|
|
21
|
-
|
|
20
|
+
function m({ session: m, agent: h, isActive: g, isSelected: _, onDelete: v }) {
|
|
21
|
+
let [y, b] = o(!1), x = e(), S = t(), C = i((e) => e.openSession), w = i((e) => e.hydrateSessionConfig), T = i((e) => e.pinTab), E = i((e) => e.toggleSessionSelection), D = i((e) => e.tabs).find((e) => e.sessionId === m.id)?.pinned ?? !1, O = p[m.status] ?? "bg-border-default", k = m.config?.tags || [], A = () => {
|
|
22
|
+
w(m.id, m), C(m.id, m.name), S(`/ai/sessions/${m.id}`);
|
|
22
23
|
};
|
|
23
|
-
return /* @__PURE__ */
|
|
24
|
+
return /* @__PURE__ */ f(u.div, {
|
|
24
25
|
layout: !0,
|
|
25
26
|
initial: {
|
|
26
27
|
opacity: 0,
|
|
@@ -35,100 +36,100 @@ function p({ session: p, agent: m, isActive: h, isSelected: g, onDelete: _ }) {
|
|
|
35
36
|
y: -4
|
|
36
37
|
},
|
|
37
38
|
transition: { duration: .15 },
|
|
38
|
-
onMouseEnter: () =>
|
|
39
|
-
onMouseLeave: () =>
|
|
40
|
-
onClick:
|
|
41
|
-
className: `group flex items-center gap-2 px-3 py-2 cursor-pointer transition-colors ${
|
|
39
|
+
onMouseEnter: () => b(!0),
|
|
40
|
+
onMouseLeave: () => b(!1),
|
|
41
|
+
onClick: A,
|
|
42
|
+
className: `group flex items-center gap-2 px-3 py-2 cursor-pointer transition-colors ${g ? "bg-bg-elevated border-l-2 border-action-primary-bg" : "hover:bg-bg-sunken border-l-2 border-transparent"}`,
|
|
42
43
|
role: "button",
|
|
43
44
|
tabIndex: 0,
|
|
44
45
|
onKeyDown: (e) => {
|
|
45
|
-
(e.key === "Enter" || e.key === " ") &&
|
|
46
|
+
(e.key === "Enter" || e.key === " ") && A();
|
|
46
47
|
},
|
|
47
48
|
children: [
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
className: `flex-shrink-0 transition-opacity ${
|
|
49
|
+
/* @__PURE__ */ d("div", {
|
|
50
|
+
className: `flex-shrink-0 transition-opacity ${y || _ ? "opacity-100" : "opacity-0"}`,
|
|
50
51
|
onClick: (e) => {
|
|
51
|
-
e.stopPropagation(),
|
|
52
|
+
e.stopPropagation(), E(m.id);
|
|
52
53
|
},
|
|
53
|
-
children: /* @__PURE__ */
|
|
54
|
-
checked:
|
|
55
|
-
onChange: () =>
|
|
56
|
-
ariaLabel: `Select session ${
|
|
54
|
+
children: /* @__PURE__ */ d(n, {
|
|
55
|
+
checked: _,
|
|
56
|
+
onChange: () => E(m.id),
|
|
57
|
+
ariaLabel: `Select session ${m.name}`
|
|
57
58
|
})
|
|
58
59
|
}),
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
className: `flex-shrink-0 w-2 h-2 rounded-full ${
|
|
61
|
-
title:
|
|
60
|
+
/* @__PURE__ */ d("span", {
|
|
61
|
+
className: `flex-shrink-0 w-2 h-2 rounded-full ${O}`,
|
|
62
|
+
title: m.status
|
|
62
63
|
}),
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
+
/* @__PURE__ */ f("div", {
|
|
64
65
|
className: "flex-1 min-w-0",
|
|
65
66
|
children: [
|
|
66
|
-
/* @__PURE__ */
|
|
67
|
+
/* @__PURE__ */ f("div", {
|
|
67
68
|
className: "flex items-center gap-1.5",
|
|
68
|
-
children: [/* @__PURE__ */
|
|
69
|
+
children: [/* @__PURE__ */ d("span", {
|
|
69
70
|
className: "text-sm text-text-primary truncate font-medium",
|
|
70
|
-
children:
|
|
71
|
-
}),
|
|
71
|
+
children: m.name
|
|
72
|
+
}), D && /* @__PURE__ */ d(s, { className: "w-3 h-3 text-text-secondary flex-shrink-0" })]
|
|
72
73
|
}),
|
|
73
|
-
/* @__PURE__ */
|
|
74
|
+
/* @__PURE__ */ f("div", {
|
|
74
75
|
className: "flex items-center gap-1.5 mt-0.5",
|
|
75
76
|
children: [
|
|
76
|
-
/* @__PURE__ */
|
|
77
|
+
/* @__PURE__ */ d("span", {
|
|
77
78
|
className: "text-xs px-1.5 py-0.5 rounded bg-bg-sunken text-text-secondary font-mono",
|
|
78
|
-
children:
|
|
79
|
+
children: m.agentType
|
|
79
80
|
}),
|
|
80
|
-
typeof
|
|
81
|
+
typeof m.config?.mode == "string" && /* @__PURE__ */ d("span", {
|
|
81
82
|
className: "text-[10px] px-1 py-0.5 rounded bg-bg-elevated text-text-muted uppercase font-mono",
|
|
82
|
-
children:
|
|
83
|
+
children: m.config.mode
|
|
83
84
|
}),
|
|
84
|
-
|
|
85
|
+
m.createdAt && /* @__PURE__ */ d("span", {
|
|
85
86
|
className: "text-xs text-text-tertiary truncate",
|
|
86
|
-
children:
|
|
87
|
+
children: a(m.createdAt)
|
|
87
88
|
})
|
|
88
89
|
]
|
|
89
90
|
}),
|
|
90
|
-
|
|
91
|
+
k.length > 0 && /* @__PURE__ */ f("div", {
|
|
91
92
|
className: "flex gap-0.5 mt-0.5 flex-wrap",
|
|
92
|
-
children: [
|
|
93
|
+
children: [k.slice(0, 3).map((e) => /* @__PURE__ */ d("span", {
|
|
93
94
|
className: "px-1 py-0.5 text-[10px] bg-bg-elevated text-text-tertiary rounded",
|
|
94
95
|
children: e
|
|
95
|
-
}, e)),
|
|
96
|
+
}, e)), k.length > 3 && /* @__PURE__ */ f("span", {
|
|
96
97
|
className: "text-[10px] text-text-muted",
|
|
97
|
-
children: ["+",
|
|
98
|
+
children: ["+", k.length - 3]
|
|
98
99
|
})]
|
|
99
100
|
})
|
|
100
101
|
]
|
|
101
102
|
}),
|
|
102
|
-
|
|
103
|
+
y && /* @__PURE__ */ f("div", {
|
|
103
104
|
className: "flex items-center gap-0.5 flex-shrink-0",
|
|
104
105
|
children: [
|
|
105
|
-
/* @__PURE__ */
|
|
106
|
+
/* @__PURE__ */ d("button", {
|
|
106
107
|
onClick: (e) => {
|
|
107
|
-
e.stopPropagation(),
|
|
108
|
+
e.stopPropagation(), w(m.id, m), C(m.id, m.name), T(m.id);
|
|
108
109
|
},
|
|
109
|
-
className: `p-1 rounded transition-colors ${
|
|
110
|
-
title:
|
|
111
|
-
children: /* @__PURE__ */
|
|
110
|
+
className: `p-1 rounded transition-colors ${D ? "text-action-primary-bg hover:bg-bg-elevated" : "text-text-secondary hover:text-text-primary hover:bg-bg-elevated"}`,
|
|
111
|
+
title: D ? x("vibecontrols.agentManager.sessionItem.unpin", "Unpin") : x("vibecontrols.agentManager.sessionItem.pin", "Pin"),
|
|
112
|
+
children: /* @__PURE__ */ d(s, { className: "w-3.5 h-3.5" })
|
|
112
113
|
}),
|
|
113
|
-
/* @__PURE__ */
|
|
114
|
+
/* @__PURE__ */ d("button", {
|
|
114
115
|
onClick: (e) => {
|
|
115
116
|
e.stopPropagation();
|
|
116
|
-
let t =
|
|
117
|
-
if (
|
|
118
|
-
let i =
|
|
119
|
-
|
|
117
|
+
let t = k.join(", "), n = window.prompt("Enter tags (comma-separated):", t);
|
|
118
|
+
if (n === null) return;
|
|
119
|
+
let i = n.split(",").map((e) => e.trim()).filter(Boolean);
|
|
120
|
+
r(h, m.id, { tags: i });
|
|
120
121
|
},
|
|
121
122
|
className: "p-1 rounded text-text-secondary hover:text-text-primary hover:bg-bg-elevated transition-colors",
|
|
122
|
-
title:
|
|
123
|
-
children: /* @__PURE__ */
|
|
123
|
+
title: x("vibecontrols.agentManager.sessionItem.editTags", "Edit tags"),
|
|
124
|
+
children: /* @__PURE__ */ d(c, { className: "w-3.5 h-3.5" })
|
|
124
125
|
}),
|
|
125
|
-
/* @__PURE__ */
|
|
126
|
+
/* @__PURE__ */ d("button", {
|
|
126
127
|
onClick: (e) => {
|
|
127
|
-
e.stopPropagation(),
|
|
128
|
+
e.stopPropagation(), v(m.id);
|
|
128
129
|
},
|
|
129
130
|
className: "p-1 rounded text-text-secondary hover:text-status-error-text hover:bg-bg-elevated transition-colors",
|
|
130
|
-
title:
|
|
131
|
-
children: /* @__PURE__ */
|
|
131
|
+
title: x("vibecontrols.agentManager.sessionItem.deleteSession", "Delete session"),
|
|
132
|
+
children: /* @__PURE__ */ d(l, { className: "w-3.5 h-3.5" })
|
|
132
133
|
})
|
|
133
134
|
]
|
|
134
135
|
})
|
|
@@ -136,6 +137,6 @@ function p({ session: p, agent: m, isActive: h, isSelected: g, onDelete: _ }) {
|
|
|
136
137
|
});
|
|
137
138
|
}
|
|
138
139
|
//#endregion
|
|
139
|
-
export {
|
|
140
|
+
export { m as AgentManagerSessionItem };
|
|
140
141
|
|
|
141
142
|
//# sourceMappingURL=AgentManagerSessionItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentManagerSessionItem.js","names":[],"sources":["../../../src/components/agent-manager/AgentManagerSessionItem.tsx"],"sourcesContent":["/**\n * Single session row in the sidebar session list.\n *\n * Displays status dot, name, SDK badge, model badge, and relative timestamp.\n * Click opens the session as a tab; hover reveals pin/delete actions.\n */\n\nimport { useState } from 'react';\nimport { Pin, Trash2, Tag } from 'lucide-react';\nimport { motion } from 'framer-motion';\nimport type { AISession, AgentRef } from '@/services/aiApi';\nimport { updateSessionConfig } from '@/services/aiApi';\nimport { useAgentManagerStore } from '@/store/agentManagerStore';\nimport { SelectionCheckbox } from '@/components/shared';\nimport { relativeTime } from '@/utils/relativeTime';\nimport { useTr } from '../../shared/hooks/useTr';\n\ninterface AgentManagerSessionItemProps {\n session: AISession;\n agent: AgentRef;\n isActive: boolean;\n isSelected: boolean;\n onDelete: (sessionId: string) => void;\n}\n\nconst STATUS_DOT_COLORS: Record<string, string> = {\n active: 'bg-status-success-bg',\n idle: 'bg-status-warning-bg',\n error: 'bg-status-error-bg',\n terminated: 'bg-border-default',\n processing: 'bg-status-info-bg',\n};\n\nexport function AgentManagerSessionItem({\n session,\n agent,\n isActive,\n isSelected,\n onDelete,\n}: AgentManagerSessionItemProps) {\n const [hovered, setHovered] = useState(false);\n const tr = useTr();\n const openSession = useAgentManagerStore((s) => s.openSession);\n const hydrateSessionConfig = useAgentManagerStore((s) => s.hydrateSessionConfig);\n const pinTab = useAgentManagerStore((s) => s.pinTab);\n const toggleSessionSelection = useAgentManagerStore((s) => s.toggleSessionSelection);\n const tabs = useAgentManagerStore((s) => s.tabs);\n\n const isPinned = tabs.find((t) => t.sessionId === session.id)?.pinned ?? false;\n const dotColor = STATUS_DOT_COLORS[session.status] ?? 'bg-border-default';\n const tags: string[] = ((session.config as Record<string, unknown>)?.tags as string[]) || [];\n\n const handleClick = () => {\n hydrateSessionConfig(session.id, session);\n openSession(session.id, session.name);\n };\n\n const handlePin = (e: React.MouseEvent) => {\n e.stopPropagation();\n hydrateSessionConfig(session.id, session);\n openSession(session.id, session.name);\n pinTab(session.id);\n };\n\n const handleDelete = (e: React.MouseEvent) => {\n e.stopPropagation();\n onDelete(session.id);\n };\n\n const handleEditTags = (e: React.MouseEvent) => {\n e.stopPropagation();\n const currentTags = tags.join(', ');\n const input = window.prompt('Enter tags (comma-separated):', currentTags);\n if (input === null) return;\n const newTags = input\n .split(',')\n .map((t) => t.trim())\n .filter(Boolean);\n void updateSessionConfig(agent, session.id, { tags: newTags });\n };\n\n const handleCheckbox = (e: React.MouseEvent) => {\n e.stopPropagation();\n toggleSessionSelection(session.id);\n };\n\n return (\n <motion.div\n layout\n initial={{ opacity: 0, y: 4 }}\n animate={{ opacity: 1, y: 0 }}\n exit={{ opacity: 0, y: -4 }}\n transition={{ duration: 0.15 }}\n onMouseEnter={() => setHovered(true)}\n onMouseLeave={() => setHovered(false)}\n onClick={handleClick}\n className={`group flex items-center gap-2 px-3 py-2 cursor-pointer transition-colors ${\n isActive\n ? 'bg-bg-elevated border-l-2 border-action-primary-bg'\n : 'hover:bg-bg-sunken border-l-2 border-transparent'\n }`}\n role=\"button\"\n tabIndex={0}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') handleClick();\n }}\n >\n {/* Selection checkbox (on hover or when selected) */}\n <div\n className={`flex-shrink-0 transition-opacity ${hovered || isSelected ? 'opacity-100' : 'opacity-0'}`}\n onClick={handleCheckbox}\n >\n <SelectionCheckbox\n checked={isSelected}\n onChange={() => toggleSessionSelection(session.id)}\n ariaLabel={`Select session ${session.name}`}\n />\n </div>\n\n {/* Status dot */}\n <span className={`flex-shrink-0 w-2 h-2 rounded-full ${dotColor}`} title={session.status} />\n\n {/* Session info */}\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-center gap-1.5\">\n <span className=\"text-sm text-text-primary truncate font-medium\">{session.name}</span>\n {isPinned && <Pin className=\"w-3 h-3 text-text-secondary flex-shrink-0\" />}\n </div>\n <div className=\"flex items-center gap-1.5 mt-0.5\">\n <span className=\"text-xs px-1.5 py-0.5 rounded bg-bg-sunken text-text-secondary font-mono\">\n {session.agentType}\n </span>\n {typeof (session.config as Record<string, unknown>)?.mode === 'string' && (\n <span className=\"text-[10px] px-1 py-0.5 rounded bg-bg-elevated text-text-muted uppercase font-mono\">\n {(session.config as Record<string, string>).mode}\n </span>\n )}\n {session.createdAt && (\n <span className=\"text-xs text-text-tertiary truncate\">\n {relativeTime(session.createdAt)}\n </span>\n )}\n </div>\n {tags.length > 0 && (\n <div className=\"flex gap-0.5 mt-0.5 flex-wrap\">\n {tags.slice(0, 3).map((tag) => (\n <span\n key={tag}\n className=\"px-1 py-0.5 text-[10px] bg-bg-elevated text-text-tertiary rounded\"\n >\n {tag}\n </span>\n ))}\n {tags.length > 3 && (\n <span className=\"text-[10px] text-text-muted\">+{tags.length - 3}</span>\n )}\n </div>\n )}\n </div>\n\n {/* Hover actions */}\n {hovered && (\n <div className=\"flex items-center gap-0.5 flex-shrink-0\">\n <button\n onClick={handlePin}\n className={`p-1 rounded transition-colors ${\n isPinned\n ? 'text-action-primary-bg hover:bg-bg-elevated'\n : 'text-text-secondary hover:text-text-primary hover:bg-bg-elevated'\n }`}\n title={\n isPinned\n ? tr('vibecontrols.agentManager.sessionItem.unpin', 'Unpin')\n : tr('vibecontrols.agentManager.sessionItem.pin', 'Pin')\n }\n >\n <Pin className=\"w-3.5 h-3.5\" />\n </button>\n <button\n onClick={handleEditTags}\n className=\"p-1 rounded text-text-secondary hover:text-text-primary hover:bg-bg-elevated transition-colors\"\n title={tr('vibecontrols.agentManager.sessionItem.editTags', 'Edit tags')}\n >\n <Tag className=\"w-3.5 h-3.5\" />\n </button>\n <button\n onClick={handleDelete}\n className=\"p-1 rounded text-text-secondary hover:text-status-error-text hover:bg-bg-elevated transition-colors\"\n title={tr('vibecontrols.agentManager.sessionItem.deleteSession', 'Delete session')}\n >\n <Trash2 className=\"w-3.5 h-3.5\" />\n </button>\n </div>\n )}\n </motion.div>\n );\n}\n"],"mappings":";;;;;;;;;;;AAyBA,IAAM,IAA4C;CAChD,QAAQ;CACR,MAAM;CACN,OAAO;CACP,YAAY;CACZ,YAAY;CACb;AAED,SAAgB,EAAwB,EACtC,YACA,UACA,aACA,eACA,eAC+B;CAC/B,IAAM,CAAC,GAAS,KAAc,EAAS,GAAM,EACvC,IAAK,GAAO,EACZ,IAAc,GAAsB,MAAM,EAAE,YAAY,EACxD,IAAuB,GAAsB,MAAM,EAAE,qBAAqB,EAC1E,IAAS,GAAsB,MAAM,EAAE,OAAO,EAC9C,IAAyB,GAAsB,MAAM,EAAE,uBAAuB,EAG9E,IAFO,GAAsB,MAAM,EAAE,KAAK,CAE1B,MAAM,MAAM,EAAE,cAAc,EAAQ,GAAG,EAAE,UAAU,IACnE,IAAW,EAAkB,EAAQ,WAAW,qBAChD,IAAmB,EAAQ,QAAoC,QA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;gBAElF,kBAAC,GAAD,EAAQ,WAAU,eAAgB,CAAA;MAC3B,CAAA;KACL;;GAEG"}
|
|
1
|
+
{"version":3,"file":"AgentManagerSessionItem.js","names":[],"sources":["../../../src/components/agent-manager/AgentManagerSessionItem.tsx"],"sourcesContent":["/**\n * Single session row in the sidebar session list.\n *\n * Displays status dot, name, SDK badge, model badge, and relative timestamp.\n * Click opens the session as a tab; hover reveals pin/delete actions.\n */\n\nimport { useState } from 'react';\nimport { Pin, Trash2, Tag } from 'lucide-react';\nimport { motion } from 'framer-motion';\nimport type { AISession, AgentRef } from '@/services/aiApi';\nimport { updateSessionConfig } from '@/services/aiApi';\nimport { useAgentManagerStore } from '@/store/agentManagerStore';\nimport { SelectionCheckbox } from '@/components/shared';\nimport { relativeTime } from '@/utils/relativeTime';\nimport { useTr } from '../../shared/hooks/useTr';\nimport { useVibeNavigate } from '../../providers/VibeControlsProvider';\n\ninterface AgentManagerSessionItemProps {\n session: AISession;\n agent: AgentRef;\n isActive: boolean;\n isSelected: boolean;\n onDelete: (sessionId: string) => void;\n}\n\nconst STATUS_DOT_COLORS: Record<string, string> = {\n active: 'bg-status-success-bg',\n idle: 'bg-status-warning-bg',\n error: 'bg-status-error-bg',\n terminated: 'bg-border-default',\n processing: 'bg-status-info-bg',\n};\n\nexport function AgentManagerSessionItem({\n session,\n agent,\n isActive,\n isSelected,\n onDelete,\n}: AgentManagerSessionItemProps) {\n const [hovered, setHovered] = useState(false);\n const tr = useTr();\n const navigate = useVibeNavigate();\n const openSession = useAgentManagerStore((s) => s.openSession);\n const hydrateSessionConfig = useAgentManagerStore((s) => s.hydrateSessionConfig);\n const pinTab = useAgentManagerStore((s) => s.pinTab);\n const toggleSessionSelection = useAgentManagerStore((s) => s.toggleSessionSelection);\n const tabs = useAgentManagerStore((s) => s.tabs);\n\n const isPinned = tabs.find((t) => t.sessionId === session.id)?.pinned ?? false;\n const dotColor = STATUS_DOT_COLORS[session.status] ?? 'bg-border-default';\n const tags: string[] = ((session.config as Record<string, unknown>)?.tags as string[]) || [];\n\n const handleClick = () => {\n hydrateSessionConfig(session.id, session);\n openSession(session.id, session.name);\n // Reflect the opened session in the URL so it's deep-linkable / shareable\n // and back-button friendly. useVibeNavigate prepends the mount basePath, so\n // the path stays correct under any host mount or standalone `/`.\n // AgentManagerPage's sessionIdParam effect makes this idempotent\n // (openSession no-ops if the tab is already open).\n navigate(`/ai/sessions/${session.id}`);\n };\n\n const handlePin = (e: React.MouseEvent) => {\n e.stopPropagation();\n hydrateSessionConfig(session.id, session);\n openSession(session.id, session.name);\n pinTab(session.id);\n };\n\n const handleDelete = (e: React.MouseEvent) => {\n e.stopPropagation();\n onDelete(session.id);\n };\n\n const handleEditTags = (e: React.MouseEvent) => {\n e.stopPropagation();\n const currentTags = tags.join(', ');\n const input = window.prompt('Enter tags (comma-separated):', currentTags);\n if (input === null) return;\n const newTags = input\n .split(',')\n .map((t) => t.trim())\n .filter(Boolean);\n void updateSessionConfig(agent, session.id, { tags: newTags });\n };\n\n const handleCheckbox = (e: React.MouseEvent) => {\n e.stopPropagation();\n toggleSessionSelection(session.id);\n };\n\n return (\n <motion.div\n layout\n initial={{ opacity: 0, y: 4 }}\n animate={{ opacity: 1, y: 0 }}\n exit={{ opacity: 0, y: -4 }}\n transition={{ duration: 0.15 }}\n onMouseEnter={() => setHovered(true)}\n onMouseLeave={() => setHovered(false)}\n onClick={handleClick}\n className={`group flex items-center gap-2 px-3 py-2 cursor-pointer transition-colors ${\n isActive\n ? 'bg-bg-elevated border-l-2 border-action-primary-bg'\n : 'hover:bg-bg-sunken border-l-2 border-transparent'\n }`}\n role=\"button\"\n tabIndex={0}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') handleClick();\n }}\n >\n {/* Selection checkbox (on hover or when selected) */}\n <div\n className={`flex-shrink-0 transition-opacity ${hovered || isSelected ? 'opacity-100' : 'opacity-0'}`}\n onClick={handleCheckbox}\n >\n <SelectionCheckbox\n checked={isSelected}\n onChange={() => toggleSessionSelection(session.id)}\n ariaLabel={`Select session ${session.name}`}\n />\n </div>\n\n {/* Status dot */}\n <span className={`flex-shrink-0 w-2 h-2 rounded-full ${dotColor}`} title={session.status} />\n\n {/* Session info */}\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-center gap-1.5\">\n <span className=\"text-sm text-text-primary truncate font-medium\">{session.name}</span>\n {isPinned && <Pin className=\"w-3 h-3 text-text-secondary flex-shrink-0\" />}\n </div>\n <div className=\"flex items-center gap-1.5 mt-0.5\">\n <span className=\"text-xs px-1.5 py-0.5 rounded bg-bg-sunken text-text-secondary font-mono\">\n {session.agentType}\n </span>\n {typeof (session.config as Record<string, unknown>)?.mode === 'string' && (\n <span className=\"text-[10px] px-1 py-0.5 rounded bg-bg-elevated text-text-muted uppercase font-mono\">\n {(session.config as Record<string, string>).mode}\n </span>\n )}\n {session.createdAt && (\n <span className=\"text-xs text-text-tertiary truncate\">\n {relativeTime(session.createdAt)}\n </span>\n )}\n </div>\n {tags.length > 0 && (\n <div className=\"flex gap-0.5 mt-0.5 flex-wrap\">\n {tags.slice(0, 3).map((tag) => (\n <span\n key={tag}\n className=\"px-1 py-0.5 text-[10px] bg-bg-elevated text-text-tertiary rounded\"\n >\n {tag}\n </span>\n ))}\n {tags.length > 3 && (\n <span className=\"text-[10px] text-text-muted\">+{tags.length - 3}</span>\n )}\n </div>\n )}\n </div>\n\n {/* Hover actions */}\n {hovered && (\n <div className=\"flex items-center gap-0.5 flex-shrink-0\">\n <button\n onClick={handlePin}\n className={`p-1 rounded transition-colors ${\n isPinned\n ? 'text-action-primary-bg hover:bg-bg-elevated'\n : 'text-text-secondary hover:text-text-primary hover:bg-bg-elevated'\n }`}\n title={\n isPinned\n ? tr('vibecontrols.agentManager.sessionItem.unpin', 'Unpin')\n : tr('vibecontrols.agentManager.sessionItem.pin', 'Pin')\n }\n >\n <Pin className=\"w-3.5 h-3.5\" />\n </button>\n <button\n onClick={handleEditTags}\n className=\"p-1 rounded text-text-secondary hover:text-text-primary hover:bg-bg-elevated transition-colors\"\n title={tr('vibecontrols.agentManager.sessionItem.editTags', 'Edit tags')}\n >\n <Tag className=\"w-3.5 h-3.5\" />\n </button>\n <button\n onClick={handleDelete}\n className=\"p-1 rounded text-text-secondary hover:text-status-error-text hover:bg-bg-elevated transition-colors\"\n title={tr('vibecontrols.agentManager.sessionItem.deleteSession', 'Delete session')}\n >\n <Trash2 className=\"w-3.5 h-3.5\" />\n </button>\n </div>\n )}\n </motion.div>\n );\n}\n"],"mappings":";;;;;;;;;;;;AA0BA,IAAM,IAA4C;CAChD,QAAQ;CACR,MAAM;CACN,OAAO;CACP,YAAY;CACZ,YAAY;CACb;AAED,SAAgB,EAAwB,EACtC,YACA,UACA,aACA,eACA,eAC+B;CAC/B,IAAM,CAAC,GAAS,KAAc,EAAS,GAAM,EACvC,IAAK,GAAO,EACZ,IAAW,GAAiB,EAC5B,IAAc,GAAsB,MAAM,EAAE,YAAY,EACxD,IAAuB,GAAsB,MAAM,EAAE,qBAAqB,EAC1E,IAAS,GAAsB,MAAM,EAAE,OAAO,EAC9C,IAAyB,GAAsB,MAAM,EAAE,uBAAuB,EAG9E,IAFO,GAAsB,MAAM,EAAE,KAAK,CAE1B,MAAM,MAAM,EAAE,cAAc,EAAQ,GAAG,EAAE,UAAU,IACnE,IAAW,EAAkB,EAAQ,WAAW,qBAChD,IAAmB,EAAQ,QAAoC,QAAqB,EAAE,EAEtF,UAAoB;AAQxB,EAPA,EAAqB,EAAQ,IAAI,EAAQ,EACzC,EAAY,EAAQ,IAAI,EAAQ,KAAK,EAMrC,EAAS,gBAAgB,EAAQ,KAAK;;AAgCxC,QACE,kBAAC,EAAO,KAAR;EACE,QAAA;EACA,SAAS;GAAE,SAAS;GAAG,GAAG;GAAG;EAC7B,SAAS;GAAE,SAAS;GAAG,GAAG;GAAG;EAC7B,MAAM;GAAE,SAAS;GAAG,GAAG;GAAI;EAC3B,YAAY,EAAE,UAAU,KAAM;EAC9B,oBAAoB,E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;;GAGL,KACC,kBAAC,OAAD;IAAK,WAAU;cAAf;KACE,kBAAC,UAAD;MACE,UA3GS,MAAwB;AAIzC,OAHA,EAAE,iBAAiB,EACnB,EAAqB,EAAQ,IAAI,EAAQ,EACzC,EAAY,EAAQ,IAAI,EAAQ,KAAK,EACrC,EAAO,EAAQ,GAAG;;MAwGV,WAAW,iCACT,IACI,gDACA;MAEN,OACE,IACI,EAAG,+CAA+C,QAAQ,GAC1D,EAAG,6CAA6C,MAAM;gBAG5D,kBAAC,GAAD,EAAK,WAAU,eAAgB,CAAA;MACxB,CAAA;KACT,kBAAC,UAAD;MACE,UA9Gc,MAAwB;AAC9C,SAAE,iBAAiB;OACnB,IAAM,IAAc,EAAK,KAAK,KAAK,EAC7B,IAAQ,OAAO,OAAO,iCAAiC,EAAY;AACzE,WAAI,MAAU,KAAM;OACpB,IAAM,IAAU,EACb,MAAM,IAAI,CACV,KAAK,MAAM,EAAE,MAAM,CAAC,CACpB,OAAO,QAAQ;AACb,SAAoB,GAAO,EAAQ,IAAI,EAAE,MAAM,GAAS,CAAC;;MAsGtD,WAAU;MACV,OAAO,EAAG,kDAAkD,YAAY;gBAExE,kBAAC,GAAD,EAAK,WAAU,eAAgB,CAAA;MACxB,CAAA;KACT,kBAAC,UAAD;MACE,UA1HY,MAAwB;AAE5C,OADA,EAAE,iBAAiB,EACnB,EAAS,EAAQ,GAAG;;MAyHZ,WAAU;MACV,OAAO,EAAG,uDAAuD,iBAAiB;gBAElF,kBAAC,GAAD,EAAQ,WAAU,eAAgB,CAAA;MAC3B,CAAA;KACL;;GAEG"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Card as e } from "../shared/Card.js";
|
|
2
|
-
import {
|
|
2
|
+
import { isUsableProfile as t, useActiveAgentProfile as n } from "../../hooks/useActiveAgentProfile.js";
|
|
3
3
|
import "../shared/index.js";
|
|
4
|
-
import { useCallback as
|
|
5
|
-
import { CheckCircle2 as
|
|
6
|
-
import { gql as
|
|
7
|
-
import { useMutation as
|
|
8
|
-
import { jsx as
|
|
4
|
+
import { useCallback as r, useState as i } from "react";
|
|
5
|
+
import { CheckCircle2 as a, Loader2 as o, Plus as s, Star as c, Trash2 as l, X as u } from "lucide-react";
|
|
6
|
+
import { gql as d } from "@apollo/client";
|
|
7
|
+
import { useMutation as f } from "@apollo/client/react";
|
|
8
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
9
9
|
//#region src/components/agent-manager/ProfilesPanel.tsx
|
|
10
|
-
var
|
|
10
|
+
var h = d`
|
|
11
11
|
mutation CreateVibecontrolsAgentProfile($input: CreateVibecontrolsAgentProfileInput!) {
|
|
12
12
|
createVibecontrolsAgentProfile(input: $input) {
|
|
13
13
|
id
|
|
@@ -16,11 +16,11 @@ var m = u`
|
|
|
16
16
|
status
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
`,
|
|
19
|
+
`, g = d`
|
|
20
20
|
mutation DeleteVibecontrolsAgentProfile($id: ID!) {
|
|
21
21
|
deleteVibecontrolsAgentProfile(id: $id)
|
|
22
22
|
}
|
|
23
|
-
`,
|
|
23
|
+
`, _ = d`
|
|
24
24
|
mutation SetDefaultVibecontrolsAgentProfile($id: ID!) {
|
|
25
25
|
setDefaultVibecontrolsAgentProfile(id: $id) {
|
|
26
26
|
id
|
|
@@ -28,147 +28,147 @@ var m = u`
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
`;
|
|
31
|
-
function
|
|
31
|
+
function v(e) {
|
|
32
32
|
let t = (e ?? "").toLowerCase();
|
|
33
33
|
return t === "running" || t === "active" || t === "healthy" ? "bg-status-success-text" : t === "stopped" || t === "inactive" ? "bg-text-placeholder" : t === "error" || t === "failed" ? "bg-status-error-text" : "bg-status-warning-text";
|
|
34
34
|
}
|
|
35
|
-
function
|
|
36
|
-
let { profiles:
|
|
37
|
-
|
|
38
|
-
let e =
|
|
35
|
+
function y({ agentId: d }) {
|
|
36
|
+
let { profiles: y, active: b, setActive: x, loading: S, refetch: C } = n(d), [w, T] = i(!1), [E, D] = i("default"), [O, k] = i(""), [A, j] = i(null), [M, { loading: N }] = f(h), [P, { loading: F }] = f(g), [I, { loading: L }] = f(_), R = r(async () => {
|
|
37
|
+
j(null);
|
|
38
|
+
let e = E.trim();
|
|
39
39
|
if (!e) {
|
|
40
|
-
|
|
40
|
+
j("Profile name is required");
|
|
41
41
|
return;
|
|
42
42
|
}
|
|
43
|
-
let t =
|
|
44
|
-
if (
|
|
45
|
-
|
|
43
|
+
let t = O.trim() ? Number(O.trim()) : null;
|
|
44
|
+
if (O.trim() && (Number.isNaN(t) || t === null || t <= 0)) {
|
|
45
|
+
j("Port must be a positive number");
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
48
|
try {
|
|
49
|
-
await
|
|
50
|
-
agentId:
|
|
49
|
+
await M({ variables: { input: {
|
|
50
|
+
agentId: d,
|
|
51
51
|
name: e,
|
|
52
52
|
port: t
|
|
53
53
|
} } });
|
|
54
54
|
} catch (e) {
|
|
55
|
-
|
|
55
|
+
j(e instanceof Error ? e.message : "Failed to create profile");
|
|
56
56
|
return;
|
|
57
57
|
}
|
|
58
|
-
|
|
58
|
+
T(!1), D("default"), k(""), await C();
|
|
59
59
|
}, [
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
]),
|
|
66
|
-
if (
|
|
60
|
+
d,
|
|
61
|
+
M,
|
|
62
|
+
E,
|
|
63
|
+
O,
|
|
64
|
+
C
|
|
65
|
+
]), z = r(async (e) => {
|
|
66
|
+
if (j(null), window.confirm(`Delete profile "${e.name}"? This cannot be undone.`)) {
|
|
67
67
|
try {
|
|
68
|
-
await
|
|
68
|
+
await P({ variables: { id: e.id } });
|
|
69
69
|
} catch (e) {
|
|
70
|
-
|
|
70
|
+
j(e instanceof Error ? e.message : "Failed to delete profile");
|
|
71
71
|
return;
|
|
72
72
|
}
|
|
73
|
-
await
|
|
73
|
+
await C();
|
|
74
74
|
}
|
|
75
|
-
}, [
|
|
76
|
-
|
|
75
|
+
}, [P, C]), B = r(async (e) => {
|
|
76
|
+
j(null);
|
|
77
77
|
try {
|
|
78
|
-
await
|
|
78
|
+
await I({ variables: { id: e.id } });
|
|
79
79
|
} catch (e) {
|
|
80
|
-
|
|
80
|
+
j(e instanceof Error ? e.message : "Failed to set default profile");
|
|
81
81
|
return;
|
|
82
82
|
}
|
|
83
|
-
await
|
|
84
|
-
}, [
|
|
85
|
-
return /* @__PURE__ */
|
|
86
|
-
/* @__PURE__ */
|
|
83
|
+
await C();
|
|
84
|
+
}, [I, C]), V = N || F || L;
|
|
85
|
+
return /* @__PURE__ */ m(e, { children: [
|
|
86
|
+
/* @__PURE__ */ m("div", {
|
|
87
87
|
className: "p-4 border-b border-border-default flex items-center justify-between",
|
|
88
|
-
children: [/* @__PURE__ */
|
|
88
|
+
children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("h3", {
|
|
89
89
|
className: "font-semibold text-text-primary",
|
|
90
90
|
children: "Profiles"
|
|
91
|
-
}), /* @__PURE__ */
|
|
91
|
+
}), /* @__PURE__ */ m("p", {
|
|
92
92
|
className: "text-xs text-text-secondary mt-0.5",
|
|
93
93
|
children: [
|
|
94
94
|
"Each profile runs an isolated CLI on this agent. Active:",
|
|
95
95
|
" ",
|
|
96
|
-
/* @__PURE__ */
|
|
96
|
+
/* @__PURE__ */ p("code", {
|
|
97
97
|
className: "font-mono text-text-primary",
|
|
98
|
-
children:
|
|
98
|
+
children: b
|
|
99
99
|
})
|
|
100
100
|
]
|
|
101
|
-
})] }), /* @__PURE__ */
|
|
101
|
+
})] }), /* @__PURE__ */ m("div", {
|
|
102
102
|
className: "flex items-center gap-2",
|
|
103
|
-
children: [/* @__PURE__ */
|
|
103
|
+
children: [/* @__PURE__ */ p("button", {
|
|
104
104
|
type: "button",
|
|
105
|
-
onClick: () => void
|
|
105
|
+
onClick: () => void C(),
|
|
106
106
|
className: "px-2 py-1 text-xs text-text-secondary hover:text-text-primary",
|
|
107
107
|
children: "Refresh"
|
|
108
|
-
}), /* @__PURE__ */
|
|
108
|
+
}), /* @__PURE__ */ m("button", {
|
|
109
109
|
type: "button",
|
|
110
|
-
onClick: () =>
|
|
110
|
+
onClick: () => T((e) => !e),
|
|
111
111
|
className: "inline-flex items-center gap-1.5 px-3 py-1.5 text-sm bg-action-primary-bg text-action-primary-text rounded-md hover:opacity-90",
|
|
112
|
-
children: [/* @__PURE__ */
|
|
112
|
+
children: [/* @__PURE__ */ p(s, { className: "w-4 h-4" }), "New profile"]
|
|
113
113
|
})]
|
|
114
114
|
})]
|
|
115
115
|
}),
|
|
116
|
-
|
|
116
|
+
A && /* @__PURE__ */ p("div", {
|
|
117
117
|
className: "px-4 py-2 bg-status-error-bg/30 border-b border-status-error-text/20 text-sm text-status-error-text",
|
|
118
|
-
children:
|
|
118
|
+
children: A
|
|
119
119
|
}),
|
|
120
|
-
|
|
120
|
+
w && /* @__PURE__ */ m("div", {
|
|
121
121
|
className: "p-4 border-b border-border-default bg-bg-sunken/40 space-y-3",
|
|
122
|
-
children: [/* @__PURE__ */
|
|
122
|
+
children: [/* @__PURE__ */ m("div", {
|
|
123
123
|
className: "grid grid-cols-2 gap-3",
|
|
124
|
-
children: [/* @__PURE__ */
|
|
124
|
+
children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
125
125
|
className: "block text-xs font-medium text-text-secondary mb-1",
|
|
126
126
|
children: "Profile name"
|
|
127
|
-
}), /* @__PURE__ */
|
|
127
|
+
}), /* @__PURE__ */ p("input", {
|
|
128
128
|
type: "text",
|
|
129
|
-
value:
|
|
130
|
-
onChange: (e) =>
|
|
129
|
+
value: E,
|
|
130
|
+
onChange: (e) => D(e.target.value),
|
|
131
131
|
placeholder: "default",
|
|
132
132
|
className: "w-full px-3 py-1.5 text-sm bg-bg-surface border border-border-default rounded-md text-text-primary placeholder:text-text-placeholder focus:outline-none focus:ring-2 focus:ring-action-primary-bg font-mono",
|
|
133
133
|
autoFocus: !0
|
|
134
|
-
})] }), /* @__PURE__ */
|
|
134
|
+
})] }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
135
135
|
className: "block text-xs font-medium text-text-secondary mb-1",
|
|
136
136
|
children: "Port (optional)"
|
|
137
|
-
}), /* @__PURE__ */
|
|
137
|
+
}), /* @__PURE__ */ p("input", {
|
|
138
138
|
type: "number",
|
|
139
|
-
value:
|
|
140
|
-
onChange: (e) =>
|
|
139
|
+
value: O,
|
|
140
|
+
onChange: (e) => k(e.target.value),
|
|
141
141
|
placeholder: "auto",
|
|
142
142
|
className: "w-full px-3 py-1.5 text-sm bg-bg-surface border border-border-default rounded-md text-text-primary placeholder:text-text-placeholder focus:outline-none focus:ring-2 focus:ring-action-primary-bg font-mono"
|
|
143
143
|
})] })]
|
|
144
|
-
}), /* @__PURE__ */
|
|
144
|
+
}), /* @__PURE__ */ m("div", {
|
|
145
145
|
className: "flex items-center gap-2",
|
|
146
|
-
children: [/* @__PURE__ */
|
|
146
|
+
children: [/* @__PURE__ */ m("button", {
|
|
147
147
|
type: "button",
|
|
148
|
-
disabled:
|
|
149
|
-
onClick: () => void
|
|
148
|
+
disabled: N,
|
|
149
|
+
onClick: () => void R(),
|
|
150
150
|
className: "inline-flex items-center gap-1.5 px-3 py-1.5 text-sm bg-action-primary-bg text-action-primary-text rounded-md hover:opacity-90 disabled:opacity-50",
|
|
151
|
-
children: [
|
|
152
|
-
}), /* @__PURE__ */
|
|
151
|
+
children: [N ? /* @__PURE__ */ p(o, { className: "w-3.5 h-3.5 animate-spin" }) : /* @__PURE__ */ p(a, { className: "w-3.5 h-3.5" }), "Create"]
|
|
152
|
+
}), /* @__PURE__ */ m("button", {
|
|
153
153
|
type: "button",
|
|
154
154
|
onClick: () => {
|
|
155
|
-
|
|
155
|
+
T(!1), j(null);
|
|
156
156
|
},
|
|
157
157
|
className: "inline-flex items-center gap-1 px-3 py-1.5 text-sm text-text-secondary hover:text-text-primary",
|
|
158
|
-
children: [/* @__PURE__ */
|
|
158
|
+
children: [/* @__PURE__ */ p(u, { className: "w-3.5 h-3.5" }), "Cancel"]
|
|
159
159
|
})]
|
|
160
160
|
})]
|
|
161
161
|
}),
|
|
162
|
-
|
|
162
|
+
S && y.length === 0 ? /* @__PURE__ */ m("div", {
|
|
163
163
|
className: "p-6 text-center text-text-secondary",
|
|
164
|
-
children: [/* @__PURE__ */
|
|
165
|
-
}) :
|
|
164
|
+
children: [/* @__PURE__ */ p(o, { className: "w-5 h-5 mx-auto mb-2 animate-spin" }), "Loading profiles…"]
|
|
165
|
+
}) : y.length === 0 ? /* @__PURE__ */ m("div", {
|
|
166
166
|
className: "p-6 text-center text-text-secondary",
|
|
167
|
-
children: [/* @__PURE__ */
|
|
167
|
+
children: [/* @__PURE__ */ p("p", { children: "No profiles configured yet." }), /* @__PURE__ */ m("p", {
|
|
168
168
|
className: "text-xs mt-1",
|
|
169
169
|
children: [
|
|
170
170
|
"The agent will fall back to the implicit ",
|
|
171
|
-
/* @__PURE__ */
|
|
171
|
+
/* @__PURE__ */ p("code", {
|
|
172
172
|
className: "font-mono",
|
|
173
173
|
children: "default"
|
|
174
174
|
}),
|
|
@@ -176,36 +176,36 @@ function v({ agentId: u }) {
|
|
|
176
176
|
"profile until you create one."
|
|
177
177
|
]
|
|
178
178
|
})]
|
|
179
|
-
}) : /* @__PURE__ */
|
|
179
|
+
}) : /* @__PURE__ */ p("div", {
|
|
180
180
|
className: "divide-y divide-border-default",
|
|
181
|
-
children:
|
|
182
|
-
let
|
|
183
|
-
return /* @__PURE__ */
|
|
184
|
-
className: `p-4 flex items-center justify-between gap-4 ${
|
|
185
|
-
children: [/* @__PURE__ */
|
|
181
|
+
children: y.map((e) => {
|
|
182
|
+
let n = e.name === b, r = t(e);
|
|
183
|
+
return /* @__PURE__ */ m("div", {
|
|
184
|
+
className: `p-4 flex items-center justify-between gap-4 ${n ? "bg-action-primary-bg/5" : ""}`,
|
|
185
|
+
children: [/* @__PURE__ */ m("div", {
|
|
186
186
|
className: "flex items-center gap-3 min-w-0",
|
|
187
|
-
children: [/* @__PURE__ */
|
|
188
|
-
className: `h-2 w-2 rounded-full flex-shrink-0 ${
|
|
187
|
+
children: [/* @__PURE__ */ p("span", {
|
|
188
|
+
className: `h-2 w-2 rounded-full flex-shrink-0 ${v(e.status)}`,
|
|
189
189
|
"aria-hidden": !0
|
|
190
|
-
}), /* @__PURE__ */
|
|
190
|
+
}), /* @__PURE__ */ m("div", {
|
|
191
191
|
className: "min-w-0",
|
|
192
|
-
children: [/* @__PURE__ */
|
|
192
|
+
children: [/* @__PURE__ */ m("div", {
|
|
193
193
|
className: "flex items-center gap-2",
|
|
194
194
|
children: [
|
|
195
|
-
/* @__PURE__ */
|
|
195
|
+
/* @__PURE__ */ p("code", {
|
|
196
196
|
className: "font-mono font-medium text-text-primary truncate",
|
|
197
197
|
children: e.name
|
|
198
198
|
}),
|
|
199
|
-
e.isDefault && /* @__PURE__ */
|
|
199
|
+
e.isDefault && /* @__PURE__ */ m("span", {
|
|
200
200
|
className: "inline-flex items-center gap-0.5 px-1.5 py-0.5 text-[10px] uppercase tracking-wide bg-action-primary-bg/10 text-action-primary-bg rounded",
|
|
201
|
-
children: [/* @__PURE__ */
|
|
201
|
+
children: [/* @__PURE__ */ p(c, { className: "w-3 h-3" }), "Default"]
|
|
202
202
|
}),
|
|
203
|
-
|
|
203
|
+
n && /* @__PURE__ */ p("span", {
|
|
204
204
|
className: "px-1.5 py-0.5 text-[10px] uppercase tracking-wide bg-status-success-bg/40 text-status-success-text rounded",
|
|
205
205
|
children: "Active"
|
|
206
206
|
})
|
|
207
207
|
]
|
|
208
|
-
}), /* @__PURE__ */
|
|
208
|
+
}), /* @__PURE__ */ m("p", {
|
|
209
209
|
className: "text-xs text-text-secondary mt-0.5 truncate",
|
|
210
210
|
children: [
|
|
211
211
|
e.status ?? "unknown",
|
|
@@ -214,29 +214,31 @@ function v({ agentId: u }) {
|
|
|
214
214
|
]
|
|
215
215
|
})]
|
|
216
216
|
})]
|
|
217
|
-
}), /* @__PURE__ */
|
|
217
|
+
}), /* @__PURE__ */ m("div", {
|
|
218
218
|
className: "flex items-center gap-2 flex-shrink-0",
|
|
219
219
|
children: [
|
|
220
|
-
!
|
|
220
|
+
!n && /* @__PURE__ */ p("button", {
|
|
221
221
|
type: "button",
|
|
222
|
-
|
|
223
|
-
|
|
222
|
+
disabled: !r,
|
|
223
|
+
title: r ? "Make this the active profile" : "This profile hasn't been started yet (awaiting config), so it can't be the active profile.",
|
|
224
|
+
onClick: () => x(e.name),
|
|
225
|
+
className: "px-2 py-1 text-xs text-text-secondary hover:text-text-primary border border-border-default rounded disabled:opacity-50 disabled:cursor-not-allowed",
|
|
224
226
|
children: "Use"
|
|
225
227
|
}),
|
|
226
|
-
!e.isDefault && /* @__PURE__ */
|
|
228
|
+
!e.isDefault && /* @__PURE__ */ m("button", {
|
|
227
229
|
type: "button",
|
|
228
|
-
disabled:
|
|
229
|
-
onClick: () => void
|
|
230
|
+
disabled: V,
|
|
231
|
+
onClick: () => void B(e),
|
|
230
232
|
className: "inline-flex items-center gap-1 px-2 py-1 text-xs text-text-secondary hover:text-text-primary border border-border-default rounded disabled:opacity-50",
|
|
231
|
-
children: [/* @__PURE__ */
|
|
233
|
+
children: [/* @__PURE__ */ p(c, { className: "w-3 h-3" }), "Set default"]
|
|
232
234
|
}),
|
|
233
|
-
/* @__PURE__ */
|
|
235
|
+
/* @__PURE__ */ m("button", {
|
|
234
236
|
type: "button",
|
|
235
|
-
disabled:
|
|
237
|
+
disabled: V || e.isDefault,
|
|
236
238
|
title: e.isDefault ? "Cannot delete the default profile" : "Delete",
|
|
237
|
-
onClick: () => void
|
|
239
|
+
onClick: () => void z(e),
|
|
238
240
|
className: "inline-flex items-center gap-1 px-2 py-1 text-xs text-status-error-text hover:bg-status-error-bg/30 border border-status-error-text/20 rounded disabled:opacity-50",
|
|
239
|
-
children: [/* @__PURE__ */
|
|
241
|
+
children: [/* @__PURE__ */ p(l, { className: "w-3 h-3" }), "Delete"]
|
|
240
242
|
})
|
|
241
243
|
]
|
|
242
244
|
})]
|
|
@@ -246,6 +248,6 @@ function v({ agentId: u }) {
|
|
|
246
248
|
] });
|
|
247
249
|
}
|
|
248
250
|
//#endregion
|
|
249
|
-
export {
|
|
251
|
+
export { y as ProfilesPanel };
|
|
250
252
|
|
|
251
253
|
//# sourceMappingURL=ProfilesPanel.js.map
|