@chrysb/alphaclaw 0.1.24 → 0.2.0

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.
@@ -9,7 +9,7 @@ const kChannelMeta = {
9
9
  discord: { label: 'Discord', iconSrc: '/assets/icons/discord.svg' },
10
10
  };
11
11
 
12
- export function Channels({ channels, onSwitchTab }) {
12
+ export function Channels({ channels, onSwitchTab, onNavigate }) {
13
13
  return html`
14
14
  <div class="bg-surface border border-border rounded-xl p-4">
15
15
  <h2 class="card-label mb-3">Channels</h2>
@@ -17,6 +17,7 @@ export function Channels({ channels, onSwitchTab }) {
17
17
  ${channels ? ALL_CHANNELS.map(ch => {
18
18
  const info = channels[ch];
19
19
  const channelMeta = kChannelMeta[ch] || { label: ch.charAt(0).toUpperCase() + ch.slice(1), iconSrc: '' };
20
+ const isClickable = ch === 'telegram' && info && onNavigate;
20
21
  let badge;
21
22
  if (!info) {
22
23
  badge = html`<a
@@ -29,14 +30,24 @@ export function Channels({ channels, onSwitchTab }) {
29
30
  } else {
30
31
  badge = html`<${Badge} tone="warning">Awaiting pairing</${Badge}>`;
31
32
  }
32
- return html`<div class="flex justify-between items-center py-1.5">
33
+ return html`<div
34
+ class="flex justify-between items-center py-1.5 ${isClickable ? 'cursor-pointer hover:bg-white/5 -mx-2 px-2 rounded-lg transition-colors' : ''}"
35
+ onclick=${isClickable ? () => onNavigate('telegram') : undefined}
36
+ >
33
37
  <span class="font-medium text-sm flex items-center gap-2">
34
38
  ${channelMeta.iconSrc
35
39
  ? html`<img src=${channelMeta.iconSrc} alt="" class="w-4 h-4 rounded-sm" aria-hidden="true" />`
36
40
  : null}
37
41
  ${channelMeta.label}
38
42
  </span>
39
- ${badge}
43
+ <span class="flex items-center gap-2">
44
+ ${badge}
45
+ ${isClickable && html`
46
+ <svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor" class="text-gray-600">
47
+ <path d="M5.646 3.354a.5.5 0 01.708 0l4.5 4.5a.5.5 0 010 .708l-4.5 4.5a.5.5 0 01-.708-.708L9.793 8 5.646 3.854a.5.5 0 010-.5z"/>
48
+ </svg>
49
+ `}
50
+ </span>
40
51
  </div>`;
41
52
  }) : html`<div class="text-gray-500 text-sm text-center py-2">Loading...</div>`}
42
53
  </div>
@@ -55,8 +55,7 @@ export const Features = ({ onSwitchTab }) => {
55
55
  <${Badge} tone="success">Enabled</${Badge}>
56
56
  </span>
57
57
  `
58
- : feature.hasDefault
59
- ? html`
58
+ : html`
60
59
  <span class="flex items-center gap-2">
61
60
  <a
62
61
  href="#"
@@ -66,20 +65,7 @@ export const Features = ({ onSwitchTab }) => {
66
65
  }}
67
66
  class="text-xs text-gray-500 hover:text-gray-300"
68
67
  >Add provider</a>
69
- <${Badge} tone="success">Default</${Badge}>
70
- </span>
71
- `
72
- : html`
73
- <span class="flex items-center gap-2">
74
- <a
75
- href="#"
76
- onclick=${(e) => {
77
- e.preventDefault();
78
- onSwitchTab?.("providers");
79
- }}
80
- class="text-xs text-gray-500 hover:text-gray-300"
81
- >Add provider</a>
82
- <${Badge} tone="danger">Disabled</${Badge}>
68
+ <${Badge} tone=${feature.hasDefault ? "neutral" : "danger"}>Disabled</${Badge}>
83
69
  </span>
84
70
  `}
85
71
  </div>
@@ -23,6 +23,7 @@ import {
23
23
  kProviderLabels,
24
24
  kProviderOrder,
25
25
  kProviderFeatures,
26
+ kCoreProviders,
26
27
  } from "../lib/model-config.js";
27
28
 
28
29
  const html = htm.bind(h);
@@ -70,6 +71,7 @@ export const Providers = () => {
70
71
  const [savedAiValues, setSavedAiValues] = useState(() => kProvidersTabCache?.savedAiValues || {});
71
72
  const [restartRequired, setRestartRequired] = useState(false);
72
73
  const [restartingGateway, setRestartingGateway] = useState(false);
74
+ const [showMoreProviders, setShowMoreProviders] = useState(false);
73
75
  const codexPopupPollRef = useRef(null);
74
76
 
75
77
  const refresh = async () => {
@@ -490,7 +492,27 @@ export const Providers = () => {
490
492
  </div>
491
493
  </div>
492
494
 
493
- ${otherProviders.map((provider) => renderProviderCard(provider))}
495
+ ${otherProviders
496
+ .filter((p) => kCoreProviders.has(p))
497
+ .map((provider) => renderProviderCard(provider))}
498
+
499
+ ${showMoreProviders
500
+ ? otherProviders
501
+ .filter((p) => !kCoreProviders.has(p))
502
+ .map((provider) => renderProviderCard(provider))
503
+ : null}
504
+
505
+ ${otherProviders.some((p) => !kCoreProviders.has(p))
506
+ ? html`
507
+ <button
508
+ type="button"
509
+ onclick=${() => setShowMoreProviders((prev) => !prev)}
510
+ class="w-full text-xs text-gray-500 hover:text-gray-300 py-1"
511
+ >
512
+ ${showMoreProviders ? "Hide additional providers" : "More providers"}
513
+ </button>
514
+ `
515
+ : null}
494
516
 
495
517
  ${restartRequired
496
518
  ? html`<div