@chrysb/alphaclaw 0.4.6-beta.4 → 0.4.6-beta.6

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.
Files changed (52) hide show
  1. package/lib/public/js/app.js +158 -1073
  2. package/lib/public/js/components/envars.js +146 -29
  3. package/lib/public/js/components/features.js +1 -1
  4. package/lib/public/js/components/general/index.js +155 -0
  5. package/lib/public/js/components/icons.js +52 -0
  6. package/lib/public/js/components/info-tooltip.js +4 -7
  7. package/lib/public/js/components/models-tab/index.js +286 -0
  8. package/lib/public/js/components/models-tab/provider-auth-card.js +369 -0
  9. package/lib/public/js/components/models-tab/use-models.js +262 -0
  10. package/lib/public/js/components/models.js +1 -1
  11. package/lib/public/js/components/providers.js +1 -1
  12. package/lib/public/js/components/routes/browse-route.js +35 -0
  13. package/lib/public/js/components/routes/doctor-route.js +21 -0
  14. package/lib/public/js/components/routes/envars-route.js +11 -0
  15. package/lib/public/js/components/routes/general-route.js +45 -0
  16. package/lib/public/js/components/routes/index.js +11 -0
  17. package/lib/public/js/components/routes/models-route.js +11 -0
  18. package/lib/public/js/components/routes/providers-route.js +11 -0
  19. package/lib/public/js/components/routes/route-redirect.js +10 -0
  20. package/lib/public/js/components/routes/telegram-route.js +11 -0
  21. package/lib/public/js/components/routes/usage-route.js +15 -0
  22. package/lib/public/js/components/routes/watchdog-route.js +32 -0
  23. package/lib/public/js/components/routes/webhooks-route.js +43 -0
  24. package/lib/public/js/components/sidebar.js +2 -3
  25. package/lib/public/js/components/tooltip.js +106 -0
  26. package/lib/public/js/components/usage-tab/constants.js +1 -1
  27. package/lib/public/js/components/usage-tab/overview-section.js +124 -50
  28. package/lib/public/js/components/usage-tab/use-usage-tab.js +42 -11
  29. package/lib/public/js/components/welcome.js +1 -1
  30. package/lib/public/js/hooks/use-app-shell-controller.js +230 -0
  31. package/lib/public/js/hooks/use-app-shell-ui.js +112 -0
  32. package/lib/public/js/hooks/use-browse-navigation.js +193 -0
  33. package/lib/public/js/hooks/use-hash-location.js +32 -0
  34. package/lib/public/js/lib/api.js +35 -0
  35. package/lib/public/js/lib/app-navigation.js +39 -0
  36. package/lib/public/js/lib/browse-restart-policy.js +28 -0
  37. package/lib/public/js/lib/browse-route.js +57 -0
  38. package/lib/public/js/lib/format.js +12 -0
  39. package/lib/public/js/lib/model-config.js +1 -0
  40. package/lib/server/auth-profiles.js +291 -53
  41. package/lib/server/constants.js +24 -8
  42. package/lib/server/doctor/service.js +0 -3
  43. package/lib/server/gateway.js +50 -31
  44. package/lib/server/onboarding/index.js +2 -0
  45. package/lib/server/onboarding/validation.js +2 -2
  46. package/lib/server/routes/models.js +214 -2
  47. package/lib/server/routes/onboarding.js +2 -0
  48. package/lib/server/routes/system.js +42 -1
  49. package/lib/server/watchdog.js +14 -1
  50. package/lib/server.js +6 -0
  51. package/lib/setup/env.template +1 -0
  52. package/package.json +1 -1
@@ -6,16 +6,44 @@ import { showToast } from "./toast.js";
6
6
  import { SecretInput } from "./secret-input.js";
7
7
  import { PageHeader } from "./page-header.js";
8
8
  import { ActionButton } from "./action-button.js";
9
+ import {
10
+ Brain2LineIcon,
11
+ ChatVoiceLineIcon,
12
+ ChevronDownIcon,
13
+ ImageAiLineIcon,
14
+ TextToSpeechLineIcon,
15
+ } from "./icons.js";
16
+ import { Tooltip } from "./tooltip.js";
9
17
  const html = htm.bind(h);
10
18
 
11
19
  const kGroupLabels = {
20
+ ai: "AI Provider Keys",
12
21
  github: "GitHub",
13
22
  channels: "Channels",
14
23
  tools: "Tools",
15
24
  custom: "Custom",
16
25
  };
17
26
 
18
- const kGroupOrder = ["github", "channels", "tools", "custom"];
27
+ const kGroupOrder = ["ai", "github", "channels", "tools", "custom"];
28
+ const kDefaultVisibleAiKeys = new Set(["OPENAI_API_KEY", "GEMINI_API_KEY"]);
29
+ const kFeatureIconByName = {
30
+ Embeddings: {
31
+ Icon: Brain2LineIcon,
32
+ label: "Memory embeddings",
33
+ },
34
+ Image: {
35
+ Icon: ImageAiLineIcon,
36
+ label: "Image generation",
37
+ },
38
+ TTS: {
39
+ Icon: TextToSpeechLineIcon,
40
+ label: "Text to speech",
41
+ },
42
+ STT: {
43
+ Icon: ChatVoiceLineIcon,
44
+ label: "Speech to text",
45
+ },
46
+ };
19
47
  const normalizeEnvVarKey = (raw) => raw.trim().toUpperCase().replace(/[^A-Z0-9_]/g, "_");
20
48
  const stripSurroundingQuotes = (raw) => {
21
49
  const value = String(raw || "").trim();
@@ -57,27 +85,80 @@ const kHintByKey = {
57
85
  ANTHROPIC_TOKEN: html`from <code class="text-xs bg-black/30 px-1 rounded">claude setup-token</code>`,
58
86
  OPENAI_API_KEY: html`from <a href="https://platform.openai.com" target="_blank" class="hover:underline" style="color: var(--accent-link)">platform.openai.com</a>`,
59
87
  GEMINI_API_KEY: html`from <a href="https://aistudio.google.com" target="_blank" class="hover:underline" style="color: var(--accent-link)">aistudio.google.com</a>`,
88
+ ELEVENLABS_API_KEY: html`from <a href="https://elevenlabs.io" target="_blank" class="hover:underline" style="color: var(--accent-link)">elevenlabs.io</a> · <code class="text-xs bg-black/30 px-1 rounded">XI_API_KEY</code> also supported`,
60
89
  GITHUB_TOKEN: html`classic PAT · <code class="text-xs bg-black/30 px-1 rounded">repo</code> scope · <a href="https://github.com/settings/tokens" target="_blank" class="hover:underline" style="color: var(--accent-link)">github settings</a>`,
61
90
  GITHUB_WORKSPACE_REPO: html`use <code class="text-xs bg-black/30 px-1 rounded">owner/repo</code> or <code class="text-xs bg-black/30 px-1 rounded">https://github.com/owner/repo</code>`,
62
91
  TELEGRAM_BOT_TOKEN: html`from <a href="https://t.me/BotFather" target="_blank" class="hover:underline" style="color: var(--accent-link)">@BotFather</a> · <a href="https://docs.openclaw.ai/channels/telegram" target="_blank" class="hover:underline" style="color: var(--accent-link)">full guide</a>`,
63
92
  DISCORD_BOT_TOKEN: html`from <a href="https://discord.com/developers/applications" target="_blank" class="hover:underline" style="color: var(--accent-link)">developer portal</a> · <a href="https://docs.openclaw.ai/channels/discord" target="_blank" class="hover:underline" style="color: var(--accent-link)">full guide</a>`,
93
+ MISTRAL_API_KEY: html`from <a href="https://console.mistral.ai" target="_blank" class="hover:underline" style="color: var(--accent-link)">console.mistral.ai</a>`,
94
+ VOYAGE_API_KEY: html`from <a href="https://dash.voyageai.com" target="_blank" class="hover:underline" style="color: var(--accent-link)">dash.voyageai.com</a>`,
95
+ GROQ_API_KEY: html`from <a href="https://console.groq.com" target="_blank" class="hover:underline" style="color: var(--accent-link)">console.groq.com</a>`,
96
+ DEEPGRAM_API_KEY: html`from <a href="https://console.deepgram.com" target="_blank" class="hover:underline" style="color: var(--accent-link)">console.deepgram.com</a>`,
64
97
  BRAVE_API_KEY: html`from <a href="https://brave.com/search/api/" target="_blank" class="hover:underline" style="color: var(--accent-link)">brave.com/search/api</a> — free tier available`,
65
98
  };
66
99
 
67
100
  const getHintContent = (envVar) => kHintByKey[envVar.key] || envVar.hint || "";
68
101
 
102
+ const getVisibleFeatureIcons = (envVar) =>
103
+ (Array.isArray(envVar?.features) ? envVar.features : []).filter(
104
+ (feature) => !!kFeatureIconByName[feature],
105
+ );
106
+
107
+ const splitAiVars = (items) => {
108
+ const visible = [];
109
+ const hidden = [];
110
+ (items || []).forEach((item) => {
111
+ const hasValue = !!String(item?.value || "").trim();
112
+ if (kDefaultVisibleAiKeys.has(item?.key) || hasValue) {
113
+ visible.push(item);
114
+ return;
115
+ }
116
+ hidden.push(item);
117
+ });
118
+ return { visible, hidden };
119
+ };
120
+
121
+ const FeatureIcon = ({ feature }) => {
122
+ const entry = kFeatureIconByName[feature];
123
+ if (!entry) return null;
124
+ const { Icon, label } = entry;
125
+ return html`
126
+ <${Tooltip} text=${label} widthClass="w-auto" tooltipClassName="whitespace-nowrap">
127
+ <span
128
+ class="inline-flex items-center justify-center text-gray-500 hover:text-gray-300 focus-within:text-gray-300"
129
+ tabindex="0"
130
+ aria-label=${label}
131
+ >
132
+ <${Icon} className="w-3.5 h-3.5" />
133
+ </span>
134
+ </${Tooltip}>
135
+ `;
136
+ };
137
+
69
138
  const EnvRow = ({ envVar, onChange, onDelete, disabled }) => {
70
139
  const hint = getHintContent(envVar);
140
+ const featureIcons = getVisibleFeatureIcons(envVar);
71
141
 
72
142
  return html`
73
143
  <div class="flex items-start gap-4 px-4 py-3">
74
- <div class="shrink-0 flex items-center gap-2 pt-1.5" style="width: 200px">
75
- <span
76
- class="inline-block w-1.5 h-1.5 rounded-full shrink-0 ${envVar.value
77
- ? "bg-green-500"
78
- : "bg-gray-600"}"
79
- />
80
- <code class="text-sm truncate">${envVar.key}</code>
144
+ <div class="shrink-0" style="width: 200px">
145
+ <div class="flex items-center gap-2 pt-1.5">
146
+ <span
147
+ class="inline-block w-1.5 h-1.5 rounded-full shrink-0 ${envVar.value
148
+ ? "bg-green-500"
149
+ : "bg-gray-600"}"
150
+ />
151
+ <code class="text-sm truncate">${envVar.key}</code>
152
+ </div>
153
+ ${featureIcons.length > 0
154
+ ? html`
155
+ <div class="flex items-center gap-2 mt-1 pl-3.5">
156
+ ${featureIcons.map(
157
+ (feature) => html`<${FeatureIcon} key=${feature} feature=${feature} />`,
158
+ )}
159
+ </div>
160
+ `
161
+ : null}
81
162
  </div>
82
163
  <div class="flex-1 min-w-0">
83
164
  <div class="flex items-center gap-1">
@@ -114,6 +195,7 @@ export const Envars = ({ onRestartRequired = () => {} }) => {
114
195
  const [secretMaskEpoch, setSecretMaskEpoch] = useState(0);
115
196
  const [dirty, setDirty] = useState(false);
116
197
  const [saving, setSaving] = useState(false);
198
+ const [showAllAiKeys, setShowAllAiKeys] = useState(false);
117
199
  const [newKey, setNewKey] = useState("");
118
200
  const baselineSignatureRef = useRef("[]");
119
201
 
@@ -310,6 +392,61 @@ export const Envars = ({ onRestartRequired = () => {} }) => {
310
392
  const pendingAtBottom = grouped.custom.filter((item) => pending.has(item.key));
311
393
  grouped.custom = [...nonPending, ...pendingAtBottom];
312
394
  }
395
+ const aiSplit = splitAiVars(grouped.ai || []);
396
+ const renderEnvRows = (items) =>
397
+ items.map(
398
+ (v) =>
399
+ html`<${EnvRow}
400
+ key=${`${secretMaskEpoch}:${v.key}`}
401
+ envVar=${v}
402
+ onChange=${handleChange}
403
+ onDelete=${handleDelete}
404
+ disabled=${saving}
405
+ />`,
406
+ );
407
+ const renderGroupCard = (groupKey) => {
408
+ const items = grouped[groupKey] || [];
409
+ if (!items.length) return null;
410
+ if (groupKey === "ai") {
411
+ const { visible, hidden } = aiSplit;
412
+ const expanded = showAllAiKeys && hidden.length > 0;
413
+ return html`
414
+ <div class="bg-surface border border-border rounded-xl overflow-hidden">
415
+ <h3 class="card-label text-xs px-4 pt-3 pb-2">
416
+ ${kGroupLabels[groupKey] || groupKey}
417
+ </h3>
418
+ <div class="divide-y divide-border">${renderEnvRows(visible)}</div>
419
+ ${hidden.length > 0
420
+ ? html`
421
+ <div class="border-t border-border px-4 py-2">
422
+ <button
423
+ type="button"
424
+ onclick=${() => setShowAllAiKeys((prev) => !prev)}
425
+ class="inline-flex items-center gap-1.5 text-xs text-gray-500 hover:text-gray-300"
426
+ >
427
+ <${ChevronDownIcon}
428
+ className=${`transition-transform ${expanded ? "rotate-180" : ""}`}
429
+ />
430
+ ${expanded ? "Show fewer" : `Show more (${hidden.length})`}
431
+ </button>
432
+ </div>
433
+ `
434
+ : null}
435
+ ${expanded
436
+ ? html`<div class="divide-y divide-border border-t border-border">${renderEnvRows(hidden)}</div>`
437
+ : null}
438
+ </div>
439
+ `;
440
+ }
441
+ return html`
442
+ <div class="bg-surface border border-border rounded-xl overflow-hidden">
443
+ <h3 class="card-label text-xs px-4 pt-3 pb-2">
444
+ ${kGroupLabels[groupKey] || groupKey}
445
+ </h3>
446
+ <div class="divide-y divide-border">${renderEnvRows(items)}</div>
447
+ </div>
448
+ `;
449
+ };
313
450
 
314
451
  return html`
315
452
  <div class="space-y-4">
@@ -331,27 +468,7 @@ export const Envars = ({ onRestartRequired = () => {} }) => {
331
468
 
332
469
  ${kGroupOrder
333
470
  .filter((g) => grouped[g]?.length)
334
- .map(
335
- (g) => html`
336
- <div class="bg-surface border border-border rounded-xl overflow-hidden">
337
- <h3 class="card-label text-xs px-4 pt-3 pb-2">
338
- ${kGroupLabels[g] || g}
339
- </h3>
340
- <div class="divide-y divide-border">
341
- ${grouped[g].map(
342
- (v) =>
343
- html`<${EnvRow}
344
- key=${`${secretMaskEpoch}:${v.key}`}
345
- envVar=${v}
346
- onChange=${handleChange}
347
- onDelete=${handleDelete}
348
- disabled=${saving}
349
- />`,
350
- )}
351
- </div>
352
- </div>
353
- `,
354
- )}
471
+ .map((g) => renderGroupCard(g))}
355
472
 
356
473
  <div class="bg-surface border border-border rounded-xl overflow-hidden">
357
474
  <div class="flex items-center justify-between px-4 pt-3 pb-2">
@@ -61,7 +61,7 @@ export const Features = ({ onSwitchTab }) => {
61
61
  href="#"
62
62
  onclick=${(e) => {
63
63
  e.preventDefault();
64
- onSwitchTab?.("providers");
64
+ onSwitchTab?.("envars");
65
65
  }}
66
66
  class="text-xs px-2 py-1 rounded-lg ac-btn-ghost"
67
67
  >Add provider</a>
@@ -0,0 +1,155 @@
1
+ import { h } from "https://esm.sh/preact";
2
+ import htm from "https://esm.sh/htm";
3
+ import { Gateway } from "../gateway.js";
4
+ import { Channels } from "../channels.js";
5
+ import { Pairings } from "../pairings.js";
6
+ import { DevicePairings } from "../device-pairings.js";
7
+ import { Google } from "../google/index.js";
8
+ import { Features } from "../features.js";
9
+ import { GeneralDoctorWarning } from "../doctor/general-warning.js";
10
+ import { ChevronDownIcon } from "../icons.js";
11
+ import { UpdateActionButton } from "../update-action-button.js";
12
+ import { useGeneralTab } from "./use-general-tab.js";
13
+
14
+ const html = htm.bind(h);
15
+
16
+ export const GeneralTab = ({
17
+ statusData = null,
18
+ watchdogData = null,
19
+ doctorStatusData = null,
20
+ doctorWarningDismissedUntilMs = 0,
21
+ onRefreshStatuses = () => {},
22
+ onSwitchTab = () => {},
23
+ onNavigate = () => {},
24
+ onOpenGmailWebhook = () => {},
25
+ isActive = false,
26
+ restartingGateway = false,
27
+ onRestartGateway = () => {},
28
+ restartSignal = 0,
29
+ openclawUpdateInProgress = false,
30
+ onOpenclawVersionActionComplete = () => {},
31
+ onOpenclawUpdate = () => {},
32
+ onRestartRequired = () => {},
33
+ onDismissDoctorWarning = () => {},
34
+ }) => {
35
+ const { state, actions } = useGeneralTab({
36
+ statusData,
37
+ watchdogData,
38
+ doctorStatusData,
39
+ onRefreshStatuses,
40
+ isActive,
41
+ restartSignal,
42
+ });
43
+
44
+ return html`
45
+ <div class="space-y-4">
46
+ <${Gateway}
47
+ status=${state.gatewayStatus}
48
+ openclawVersion=${state.openclawVersion}
49
+ restarting=${restartingGateway}
50
+ onRestart=${onRestartGateway}
51
+ watchdogStatus=${state.watchdogStatus}
52
+ onOpenWatchdog=${() => onSwitchTab("watchdog")}
53
+ onRepair=${actions.handleWatchdogRepair}
54
+ repairing=${state.repairingWatchdog}
55
+ openclawUpdateInProgress=${openclawUpdateInProgress}
56
+ onOpenclawVersionActionComplete=${onOpenclawVersionActionComplete}
57
+ onOpenclawUpdate=${onOpenclawUpdate}
58
+ />
59
+ <${GeneralDoctorWarning}
60
+ doctorStatus=${state.doctorStatus}
61
+ dismissedUntilMs=${doctorWarningDismissedUntilMs}
62
+ onOpenDoctor=${() => onSwitchTab("doctor")}
63
+ onDismiss=${onDismissDoctorWarning}
64
+ />
65
+ <${Channels}
66
+ channels=${state.channels}
67
+ onSwitchTab=${onSwitchTab}
68
+ onNavigate=${onNavigate}
69
+ />
70
+ <${Pairings}
71
+ pending=${state.pending}
72
+ channels=${state.channels}
73
+ visible=${state.hasUnpaired}
74
+ onApprove=${actions.handleApprove}
75
+ onReject=${actions.handleReject}
76
+ />
77
+ <${Features} onSwitchTab=${onSwitchTab} />
78
+ <${Google}
79
+ gatewayStatus=${state.gatewayStatus}
80
+ onRestartRequired=${onRestartRequired}
81
+ onOpenGmailWebhook=${onOpenGmailWebhook}
82
+ />
83
+
84
+ ${state.repo &&
85
+ html`
86
+ <div class="bg-surface border border-border rounded-xl p-4">
87
+ <div class="flex items-center justify-between gap-3">
88
+ <div class="flex items-center gap-2 min-w-0">
89
+ <svg
90
+ class="w-4 h-4 text-gray-400"
91
+ viewBox="0 0 16 16"
92
+ fill="currentColor"
93
+ >
94
+ <path
95
+ d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"
96
+ />
97
+ </svg>
98
+ <a
99
+ href="https://github.com/${state.repo}"
100
+ target="_blank"
101
+ class="text-sm text-gray-400 hover:text-gray-200 transition-colors truncate"
102
+ >${state.repo}</a
103
+ >
104
+ </div>
105
+ <div class="flex items-center gap-2 shrink-0">
106
+ <span class="text-xs text-gray-400">Auto-sync</span>
107
+ <div class="relative">
108
+ <select
109
+ value=${state.syncCronChoice}
110
+ onchange=${(event) =>
111
+ actions.handleSyncCronChoiceChange(event.target.value)}
112
+ disabled=${state.savingSyncCron}
113
+ class="appearance-none bg-black/30 border border-border rounded-lg pl-2.5 pr-9 py-1.5 text-xs text-gray-300 ${state.savingSyncCron
114
+ ? "opacity-50 cursor-not-allowed"
115
+ : ""}"
116
+ title=${state.syncCron?.installed === false
117
+ ? "Not Installed Yet"
118
+ : state.syncCronStatusText}
119
+ >
120
+ <option value="disabled">Disabled</option>
121
+ <option value="*/30 * * * *">Every 30 min</option>
122
+ <option value="0 * * * *">Hourly</option>
123
+ <option value="0 0 * * *">Daily</option>
124
+ </select>
125
+ <${ChevronDownIcon}
126
+ className="pointer-events-none absolute right-2.5 top-1/2 -translate-y-1/2 text-gray-500"
127
+ />
128
+ </div>
129
+ </div>
130
+ </div>
131
+ </div>
132
+ `}
133
+
134
+ <div class="bg-surface border border-border rounded-xl p-4">
135
+ <div class="flex items-center justify-between">
136
+ <div>
137
+ <h2 class="font-semibold text-sm">OpenClaw Gateway Dashboard</h2>
138
+ </div>
139
+ <${UpdateActionButton}
140
+ onClick=${actions.handleOpenDashboard}
141
+ loading=${state.dashboardLoading}
142
+ warning=${false}
143
+ idleLabel="Open"
144
+ loadingLabel="Opening..."
145
+ />
146
+ </div>
147
+ <${DevicePairings}
148
+ pending=${state.devicePending}
149
+ onApprove=${actions.handleDeviceApprove}
150
+ onReject=${actions.handleDeviceReject}
151
+ />
152
+ </div>
153
+ </div>
154
+ `;
155
+ };
@@ -119,6 +119,58 @@ export const Image2FillIcon = ({ className = "" }) => html`
119
119
  </svg>
120
120
  `;
121
121
 
122
+ export const ImageAiLineIcon = ({ className = "" }) => html`
123
+ <svg
124
+ class=${className}
125
+ viewBox="0 0 24 24"
126
+ fill="currentColor"
127
+ aria-hidden="true"
128
+ >
129
+ <path
130
+ d="M20.7134 8.12811L20.4668 8.69379C20.2864 9.10792 19.7136 9.10792 19.5331 8.69379L19.2866 8.12811C18.8471 7.11947 18.0555 6.31641 17.0677 5.87708L16.308 5.53922C15.8973 5.35653 15.8973 4.75881 16.308 4.57612L17.0252 4.25714C18.0384 3.80651 18.8442 2.97373 19.2761 1.93083L19.5293 1.31953C19.7058 0.893489 20.2942 0.893489 20.4706 1.31953L20.7238 1.93083C21.1558 2.97373 21.9616 3.80651 22.9748 4.25714L23.6919 4.57612C24.1027 4.75881 24.1027 5.35653 23.6919 5.53922L22.9323 5.87708C21.9445 6.31641 21.1529 7.11947 20.7134 8.12811ZM2.9918 3H14V5H4V19L14 9L20 15V11H22V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918C2.44405 21 2 20.5551 2 20.0066V3.9934C2 3.44476 2.45531 3 2.9918 3ZM20 17.8284L14 11.8284L6.82843 19H20V17.8284ZM8 11C6.89543 11 6 10.1046 6 9C6 7.89543 6.89543 7 8 7C9.10457 7 10 7.89543 10 9C10 10.1046 9.10457 11 8 11Z"
131
+ />
132
+ </svg>
133
+ `;
134
+
135
+ export const Brain2LineIcon = ({ className = "" }) => html`
136
+ <svg
137
+ class=${className}
138
+ viewBox="0 0 24 24"
139
+ fill="currentColor"
140
+ aria-hidden="true"
141
+ >
142
+ <path
143
+ d="M7 6C7 6.23676 7.04072 6.46184 7.11469 6.66999C7.22686 6.98559 7.17357 7.33638 6.97276 7.60444C6.77194 7.8725 6.45026 8.02222 6.11585 8.00327C6.0776 8.0011 6.03898 8 6 8C4.89543 8 4 8.89543 4 10C4 10.5129 4.19174 10.9786 4.50903 11.3331C4.84885 11.7128 4.84885 12.2872 4.50903 12.6669C4.19174 13.0214 4 13.4871 4 14C4 14.8842 4.57447 15.6369 5.37327 15.9001C5.84924 16.057 6.1356 16.5419 6.04308 17.0345C6.01489 17.1846 6 17.3401 6 17.5C6 18.8807 7.11929 20 8.5 20C9.75862 20 10.8015 19.069 10.9746 17.8583C10.9806 17.8165 10.9891 17.7756 11 17.7358V6C11 4.89543 10.1046 4 9 4C7.89543 4 7 4.89543 7 6ZM13 17.7358C13.0109 17.7756 13.0194 17.8165 13.0254 17.8583C13.1985 19.069 14.2414 20 15.5 20C16.8807 20 18 18.8807 18 17.5C18 17.3401 17.9851 17.1846 17.9569 17.0345C17.8644 16.5419 18.1508 16.057 18.6267 15.9001C19.4255 15.6369 20 14.8842 20 14C20 13.4871 19.8083 13.0214 19.491 12.6669C19.1511 12.2872 19.1511 11.7128 19.491 11.3331C19.8083 10.9786 20 10.5129 20 10C20 8.89543 19.1046 8 18 8C17.961 8 17.9224 8.0011 17.8841 8.00327C17.5497 8.02222 17.2281 7.8725 17.0272 7.60444C16.8264 7.33638 16.7731 6.98559 16.8853 6.66999C16.9593 6.46184 17 6.23676 17 6C17 4.89543 16.1046 4 15 4C13.8954 4 13 4.89543 13 6V17.7358ZM9 2C10.1947 2 11.2671 2.52376 12 3.35418C12.7329 2.52376 13.8053 2 15 2C17.2091 2 19 3.79086 19 6C19 6.04198 18.9994 6.08382 18.9981 6.12552C20.7243 6.56889 22 8.13546 22 10C22 10.728 21.8049 11.4116 21.4646 12C21.8049 12.5884 22 13.272 22 14C22 15.4817 21.1949 16.7734 19.9999 17.4646L20 17.5C20 19.9853 17.9853 22 15.5 22C14.0859 22 12.8248 21.3481 12 20.3285C11.1752 21.3481 9.91405 22 8.5 22C6.01472 22 4 19.9853 4 17.5L4.00014 17.4646C2.80512 16.7734 2 15.4817 2 14C2 13.272 2.19513 12.5884 2.53536 12C2.19513 11.4116 2 10.728 2 10C2 8.13546 3.27573 6.56889 5.00194 6.12552C5.00065 6.08382 5 6.04198 5 6C5 3.79086 6.79086 2 9 2Z"
144
+ />
145
+ </svg>
146
+ `;
147
+
148
+ export const TextToSpeechLineIcon = ({ className = "" }) => html`
149
+ <svg
150
+ class=${className}
151
+ viewBox="0 0 24 24"
152
+ fill="currentColor"
153
+ aria-hidden="true"
154
+ >
155
+ <path
156
+ d="M14.5 5H6C4.89543 5 4 5.89543 4 7V17C4 18.1046 4.89543 19 6 19H18C19.1046 19 20 18.1046 20 17V14.5H22V17C22 19.2091 20.2091 21 18 21H6C3.79086 21 2 19.2091 2 17V7C2 4.79086 3.79086 3 6 3H14.5V5ZM14 11H11V17H9V11H6V9H14V11ZM20.6572 1.34277C22.1049 2.79049 23 4.79086 23 7C23 9.20914 22.1049 11.2095 20.6572 12.6572L19.2422 11.2422C20.328 10.1564 21 8.65685 21 7C21 5.34315 20.328 3.8436 19.2422 2.75781L20.6572 1.34277ZM17.8281 4.17188C18.552 4.89573 19 5.89543 19 7C19 8.10457 18.552 9.10427 17.8281 9.82812L16.4141 8.41406C16.776 8.05213 17 7.55228 17 7C17 6.44772 16.776 5.94787 16.4141 5.58594L17.8281 4.17188Z"
157
+ />
158
+ </svg>
159
+ `;
160
+
161
+ export const ChatVoiceLineIcon = ({ className = "" }) => html`
162
+ <svg
163
+ class=${className}
164
+ viewBox="0 0 24 24"
165
+ fill="currentColor"
166
+ aria-hidden="true"
167
+ >
168
+ <path
169
+ d="M2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22H2L4.92893 19.0711C3.11929 17.2614 2 14.7614 2 12ZM6.82843 20H12C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 14.1524 4.85124 16.1649 6.34315 17.6569L7.75736 19.0711L6.82843 20ZM11 6H13V18H11V6ZM7 9H9V15H7V9ZM15 9H17V15H15V9Z"
170
+ />
171
+ </svg>
172
+ `;
173
+
122
174
  export const FileMusicLineIcon = ({ className = "" }) => html`
123
175
  <svg
124
176
  class=${className}
@@ -1,18 +1,15 @@
1
1
  import { h } from "https://esm.sh/preact";
2
2
  import htm from "https://esm.sh/htm";
3
+ import { Tooltip } from "./tooltip.js";
3
4
 
4
5
  const html = htm.bind(h);
5
6
 
6
7
  export const InfoTooltip = ({ text = "", widthClass = "w-64" }) => html`
7
- <span class="relative group inline-flex items-center cursor-default select-none">
8
+ <${Tooltip} text=${text} widthClass=${widthClass}>
8
9
  <span
9
- class="inline-flex h-4 w-4 items-center justify-center rounded-full border border-gray-500 text-[10px] text-gray-400 cursor-default"
10
+ class="inline-flex h-4 w-4 items-center justify-center rounded-full border border-gray-500 text-[10px] text-gray-400 cursor-default select-none"
10
11
  aria-label=${text}
11
12
  >?</span
12
13
  >
13
- <span
14
- class=${`pointer-events-none absolute left-1/2 top-full z-10 mt-2 hidden -translate-x-1/2 rounded-md border border-border bg-modal px-2 py-1 text-[11px] text-gray-300 shadow-lg group-hover:block ${widthClass}`}
15
- >${text}</span
16
- >
17
- </span>
14
+ </${Tooltip}>
18
15
  `;