@chrysb/alphaclaw 0.8.1 → 0.8.3-beta.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.
Files changed (219) hide show
  1. package/README.md +33 -24
  2. package/bin/alphaclaw.js +13 -2
  3. package/lib/public/css/chat.css +426 -0
  4. package/lib/public/css/explorer.css +101 -0
  5. package/lib/public/css/tailwind.generated.css +1 -0
  6. package/lib/public/css/tailwind.input.css +3 -0
  7. package/lib/public/css/theme.css +28 -0
  8. package/lib/public/css/vendor/xterm.css +218 -0
  9. package/lib/public/dist/app.bundle.js +10706 -0
  10. package/lib/public/dist/chunks/addon-fit-W4YZGRNV.js +1 -0
  11. package/lib/public/dist/chunks/chunk-72ZECFVW.js +1 -0
  12. package/lib/public/dist/chunks/xterm-KOX4YMOF.js +9 -0
  13. package/lib/public/js/app.js +38 -4
  14. package/lib/public/js/components/action-button.js +8 -8
  15. package/lib/public/js/components/add-channel-menu.js +2 -2
  16. package/lib/public/js/components/agent-send-modal.js +6 -6
  17. package/lib/public/js/components/agents-tab/agent-bindings-section/channel-item-trailing.js +7 -7
  18. package/lib/public/js/components/agents-tab/agent-bindings-section/index.js +3 -3
  19. package/lib/public/js/components/agents-tab/agent-bindings-section/use-agent-bindings.js +1 -1
  20. package/lib/public/js/components/agents-tab/agent-bindings-section/use-channel-items.js +4 -4
  21. package/lib/public/js/components/agents-tab/agent-detail-panel.js +5 -5
  22. package/lib/public/js/components/agents-tab/agent-identity-section.js +18 -18
  23. package/lib/public/js/components/agents-tab/agent-overview/index.js +2 -2
  24. package/lib/public/js/components/agents-tab/agent-overview/manage-card.js +2 -2
  25. package/lib/public/js/components/agents-tab/agent-overview/model-card.js +8 -8
  26. package/lib/public/js/components/agents-tab/agent-overview/tools-card.js +5 -5
  27. package/lib/public/js/components/agents-tab/agent-overview/use-model-card.js +1 -1
  28. package/lib/public/js/components/agents-tab/agent-overview/use-workspace-card.js +1 -1
  29. package/lib/public/js/components/agents-tab/agent-overview/workspace-card.js +4 -4
  30. package/lib/public/js/components/agents-tab/agent-pairing-section.js +4 -4
  31. package/lib/public/js/components/agents-tab/agent-tools/index.js +5 -5
  32. package/lib/public/js/components/agents-tab/agent-tools/use-agent-tools.js +1 -1
  33. package/lib/public/js/components/agents-tab/create-agent-modal.js +13 -13
  34. package/lib/public/js/components/agents-tab/create-channel-modal.js +34 -34
  35. package/lib/public/js/components/agents-tab/delete-agent-dialog.js +3 -3
  36. package/lib/public/js/components/agents-tab/edit-agent-modal.js +9 -9
  37. package/lib/public/js/components/agents-tab/index.js +3 -3
  38. package/lib/public/js/components/agents-tab/use-agents.js +1 -1
  39. package/lib/public/js/components/badge.js +6 -6
  40. package/lib/public/js/components/channel-account-status-badge.js +2 -2
  41. package/lib/public/js/components/channel-operations-panel.js +2 -2
  42. package/lib/public/js/components/channels.js +9 -9
  43. package/lib/public/js/components/confirm-dialog.js +5 -5
  44. package/lib/public/js/components/credentials-modal.js +22 -22
  45. package/lib/public/js/components/cron-tab/cron-calendar.js +6 -6
  46. package/lib/public/js/components/cron-tab/cron-insights-panel.js +10 -10
  47. package/lib/public/js/components/cron-tab/cron-job-detail.js +4 -4
  48. package/lib/public/js/components/cron-tab/cron-job-list.js +4 -4
  49. package/lib/public/js/components/cron-tab/cron-job-settings-card.js +15 -15
  50. package/lib/public/js/components/cron-tab/cron-job-trends-panel.js +5 -5
  51. package/lib/public/js/components/cron-tab/cron-job-usage.js +16 -16
  52. package/lib/public/js/components/cron-tab/cron-overview.js +10 -10
  53. package/lib/public/js/components/cron-tab/cron-prompt-editor.js +3 -3
  54. package/lib/public/js/components/cron-tab/cron-run-history-panel.js +39 -39
  55. package/lib/public/js/components/cron-tab/cron-runs-trend-card.js +4 -4
  56. package/lib/public/js/components/cron-tab/index.js +5 -5
  57. package/lib/public/js/components/cron-tab/use-cron-tab.js +1 -1
  58. package/lib/public/js/components/device-pairings.js +12 -12
  59. package/lib/public/js/components/doctor/findings-list.js +22 -22
  60. package/lib/public/js/components/doctor/fix-card-modal.js +2 -2
  61. package/lib/public/js/components/doctor/general-warning.js +5 -5
  62. package/lib/public/js/components/doctor/index.js +26 -26
  63. package/lib/public/js/components/doctor/summary-cards.js +5 -5
  64. package/lib/public/js/components/envars.js +16 -16
  65. package/lib/public/js/components/features.js +4 -4
  66. package/lib/public/js/components/file-tree.js +4 -4
  67. package/lib/public/js/components/file-viewer/diff-viewer.js +2 -2
  68. package/lib/public/js/components/file-viewer/editor-surface.js +2 -2
  69. package/lib/public/js/components/file-viewer/frontmatter-panel.js +2 -2
  70. package/lib/public/js/components/file-viewer/index.js +3 -3
  71. package/lib/public/js/components/file-viewer/markdown-split-view.js +2 -2
  72. package/lib/public/js/components/file-viewer/media-preview.js +2 -2
  73. package/lib/public/js/components/file-viewer/scroll-sync.js +1 -1
  74. package/lib/public/js/components/file-viewer/sqlite-viewer.js +2 -2
  75. package/lib/public/js/components/file-viewer/status-banners.js +2 -2
  76. package/lib/public/js/components/file-viewer/toolbar.js +2 -2
  77. package/lib/public/js/components/file-viewer/use-editor-line-number-sync.js +1 -1
  78. package/lib/public/js/components/file-viewer/use-editor-selection-restore.js +1 -1
  79. package/lib/public/js/components/file-viewer/use-file-diff.js +1 -1
  80. package/lib/public/js/components/file-viewer/use-file-loader.js +1 -1
  81. package/lib/public/js/components/file-viewer/use-file-viewer-draft-sync.js +1 -1
  82. package/lib/public/js/components/file-viewer/use-file-viewer-hotkeys.js +1 -1
  83. package/lib/public/js/components/file-viewer/use-file-viewer.js +2 -2
  84. package/lib/public/js/components/gateway.js +12 -12
  85. package/lib/public/js/components/general/index.js +7 -7
  86. package/lib/public/js/components/general/use-general-tab.js +1 -1
  87. package/lib/public/js/components/global-restart-banner.js +2 -2
  88. package/lib/public/js/components/google/account-row.js +7 -7
  89. package/lib/public/js/components/google/add-account-modal.js +8 -8
  90. package/lib/public/js/components/google/gmail-setup-wizard.js +24 -24
  91. package/lib/public/js/components/google/gmail-watch-toggle.js +5 -5
  92. package/lib/public/js/components/google/index.js +6 -6
  93. package/lib/public/js/components/google/use-gmail-watch.js +1 -1
  94. package/lib/public/js/components/google/use-google-accounts.js +1 -1
  95. package/lib/public/js/components/icons.js +2 -2
  96. package/lib/public/js/components/info-tooltip.js +3 -3
  97. package/lib/public/js/components/loading-spinner.js +2 -2
  98. package/lib/public/js/components/modal-shell.js +5 -5
  99. package/lib/public/js/components/models-tab/index.js +11 -11
  100. package/lib/public/js/components/models-tab/model-picker.js +9 -9
  101. package/lib/public/js/components/models-tab/provider-auth-card.js +12 -12
  102. package/lib/public/js/components/models-tab/use-models.js +1 -1
  103. package/lib/public/js/components/models.js +18 -18
  104. package/lib/public/js/components/nodes-tab/browser-attach/index.js +5 -5
  105. package/lib/public/js/components/nodes-tab/connected-nodes/index.js +34 -32
  106. package/lib/public/js/components/nodes-tab/connected-nodes/use-connected-nodes-card.js +18 -3
  107. package/lib/public/js/components/nodes-tab/exec-allowlist/index.js +10 -10
  108. package/lib/public/js/components/nodes-tab/exec-allowlist/use-exec-allowlist.js +1 -1
  109. package/lib/public/js/components/nodes-tab/exec-config/index.js +13 -13
  110. package/lib/public/js/components/nodes-tab/exec-config/use-exec-config.js +1 -1
  111. package/lib/public/js/components/nodes-tab/index.js +2 -2
  112. package/lib/public/js/components/nodes-tab/setup-wizard/index.js +14 -14
  113. package/lib/public/js/components/nodes-tab/setup-wizard/use-setup-wizard.js +1 -1
  114. package/lib/public/js/components/nodes-tab/use-nodes-tab.js +1 -1
  115. package/lib/public/js/components/onboarding/use-welcome-codex.js +1 -1
  116. package/lib/public/js/components/onboarding/use-welcome-pairing.js +1 -1
  117. package/lib/public/js/components/onboarding/use-welcome-storage.js +1 -1
  118. package/lib/public/js/components/onboarding/welcome-config.js +3 -3
  119. package/lib/public/js/components/onboarding/welcome-form-step.js +34 -34
  120. package/lib/public/js/components/onboarding/welcome-header.js +2 -2
  121. package/lib/public/js/components/onboarding/welcome-import-step.js +22 -22
  122. package/lib/public/js/components/onboarding/welcome-pairing-step.js +15 -15
  123. package/lib/public/js/components/onboarding/welcome-placeholder-review-step.js +7 -7
  124. package/lib/public/js/components/onboarding/welcome-pre-step.js +9 -9
  125. package/lib/public/js/components/onboarding/welcome-secret-review-step.js +15 -15
  126. package/lib/public/js/components/onboarding/welcome-setup-step.js +8 -8
  127. package/lib/public/js/components/overflow-menu.js +3 -3
  128. package/lib/public/js/components/page-header.js +2 -2
  129. package/lib/public/js/components/pairings.js +14 -14
  130. package/lib/public/js/components/pane-shell.js +2 -2
  131. package/lib/public/js/components/pill-tabs.js +4 -4
  132. package/lib/public/js/components/pop-actions.js +3 -3
  133. package/lib/public/js/components/providers.js +17 -17
  134. package/lib/public/js/components/routes/agents-route.js +2 -2
  135. package/lib/public/js/components/routes/browse-route.js +2 -2
  136. package/lib/public/js/components/routes/chat-route.js +1094 -0
  137. package/lib/public/js/components/routes/cron-route.js +2 -2
  138. package/lib/public/js/components/routes/doctor-route.js +2 -2
  139. package/lib/public/js/components/routes/envars-route.js +2 -2
  140. package/lib/public/js/components/routes/general-route.js +2 -2
  141. package/lib/public/js/components/routes/index.js +1 -0
  142. package/lib/public/js/components/routes/models-route.js +2 -2
  143. package/lib/public/js/components/routes/nodes-route.js +2 -2
  144. package/lib/public/js/components/routes/providers-route.js +2 -2
  145. package/lib/public/js/components/routes/route-redirect.js +2 -2
  146. package/lib/public/js/components/routes/telegram-route.js +2 -2
  147. package/lib/public/js/components/routes/usage-route.js +2 -2
  148. package/lib/public/js/components/routes/watchdog-route.js +2 -2
  149. package/lib/public/js/components/routes/webhooks-route.js +2 -2
  150. package/lib/public/js/components/scope-picker.js +9 -9
  151. package/lib/public/js/components/secret-input.js +5 -5
  152. package/lib/public/js/components/segmented-control.js +2 -2
  153. package/lib/public/js/components/session-select-field.js +7 -7
  154. package/lib/public/js/components/sidebar-git-panel.js +3 -3
  155. package/lib/public/js/components/sidebar.js +55 -3
  156. package/lib/public/js/components/summary-stat-card.js +3 -3
  157. package/lib/public/js/components/telegram-workspace/index.js +10 -10
  158. package/lib/public/js/components/telegram-workspace/manage.js +36 -36
  159. package/lib/public/js/components/telegram-workspace/onboarding.js +73 -73
  160. package/lib/public/js/components/toast.js +8 -8
  161. package/lib/public/js/components/toggle-switch.js +2 -2
  162. package/lib/public/js/components/tooltip.js +5 -5
  163. package/lib/public/js/components/update-action-button.js +2 -2
  164. package/lib/public/js/components/update-modal.js +9 -9
  165. package/lib/public/js/components/usage-tab/constants.js +2 -2
  166. package/lib/public/js/components/usage-tab/index.js +3 -3
  167. package/lib/public/js/components/usage-tab/overview-section.js +15 -15
  168. package/lib/public/js/components/usage-tab/sessions-section.js +19 -19
  169. package/lib/public/js/components/usage-tab/use-usage-tab.js +2 -2
  170. package/lib/public/js/components/watchdog-tab/console/index.js +22 -8
  171. package/lib/public/js/components/watchdog-tab/console/use-console.js +28 -2
  172. package/lib/public/js/components/watchdog-tab/helpers.js +35 -6
  173. package/lib/public/js/components/watchdog-tab/incidents/index.js +6 -6
  174. package/lib/public/js/components/watchdog-tab/incidents/use-incidents.js +1 -1
  175. package/lib/public/js/components/watchdog-tab/index.js +4 -2
  176. package/lib/public/js/components/watchdog-tab/resource-bar.js +5 -5
  177. package/lib/public/js/components/watchdog-tab/resources/index.js +14 -3
  178. package/lib/public/js/components/watchdog-tab/resources/use-resources.js +1 -1
  179. package/lib/public/js/components/watchdog-tab/settings/index.js +97 -30
  180. package/lib/public/js/components/watchdog-tab/settings/use-settings.js +1 -1
  181. package/lib/public/js/components/watchdog-tab/terminal/index.js +3 -3
  182. package/lib/public/js/components/watchdog-tab/terminal/use-terminal.js +41 -5
  183. package/lib/public/js/components/watchdog-tab/use-watchdog-tab.js +2 -0
  184. package/lib/public/js/components/webhooks/create-webhook-modal/index.js +17 -17
  185. package/lib/public/js/components/webhooks/helpers.js +3 -3
  186. package/lib/public/js/components/webhooks/index.js +4 -4
  187. package/lib/public/js/components/webhooks/request-history/index.js +14 -14
  188. package/lib/public/js/components/webhooks/request-history/use-request-history.js +1 -1
  189. package/lib/public/js/components/webhooks/webhook-detail/index.js +41 -41
  190. package/lib/public/js/components/webhooks/webhook-detail/use-webhook-detail.js +1 -1
  191. package/lib/public/js/components/webhooks/webhook-list/index.js +11 -11
  192. package/lib/public/js/components/webhooks/webhook-list/use-webhook-list.js +1 -1
  193. package/lib/public/js/components/welcome/index.js +3 -3
  194. package/lib/public/js/components/welcome/use-welcome.js +10 -10
  195. package/lib/public/js/hooks/use-app-shell-controller.js +1 -1
  196. package/lib/public/js/hooks/use-app-shell-ui.js +1 -1
  197. package/lib/public/js/hooks/use-browse-navigation.js +14 -3
  198. package/lib/public/js/hooks/use-cached-fetch.js +1 -1
  199. package/lib/public/js/hooks/use-destination-session-selection.js +1 -1
  200. package/lib/public/js/hooks/use-hash-location.js +1 -1
  201. package/lib/public/js/hooks/useAgentSessions.js +1 -1
  202. package/lib/public/js/hooks/usePolling.js +1 -1
  203. package/lib/public/js/lib/app-navigation.js +1 -0
  204. package/lib/public/js/lib/storage-keys.js +3 -0
  205. package/lib/public/js/tailwind-config.js +39 -0
  206. package/lib/public/login.html +3 -18
  207. package/lib/public/setup.html +3 -18
  208. package/lib/server/auth-profiles.js +1 -1
  209. package/lib/server/chat-ws.js +835 -0
  210. package/lib/server/init/register-server-routes.js +2 -0
  211. package/lib/server/onboarding/validation.js +15 -10
  212. package/lib/server/routes/nodes.js +10 -2
  213. package/lib/server/routes/pairings.js +5 -1
  214. package/lib/server/routes/system.js +5 -0
  215. package/lib/server/routes/watchdog.js +15 -0
  216. package/lib/server/watchdog-terminal-ws.js +14 -1
  217. package/lib/server/watchdog.js +137 -51
  218. package/lib/server.js +38 -0
  219. package/package.json +14 -3
@@ -1,5 +1,5 @@
1
- import { h } from "https://esm.sh/preact";
2
- import htm from "https://esm.sh/htm";
1
+ import { h } from "preact";
2
+ import htm from "htm";
3
3
  import { CronTab } from "../cron-tab/index.js";
4
4
 
5
5
  const html = htm.bind(h);
@@ -1,5 +1,5 @@
1
- import { h } from "https://esm.sh/preact";
2
- import htm from "https://esm.sh/htm";
1
+ import { h } from "preact";
2
+ import htm from "htm";
3
3
  import { DoctorTab } from "../doctor/index.js";
4
4
 
5
5
  const html = htm.bind(h);
@@ -1,5 +1,5 @@
1
- import { h } from "https://esm.sh/preact";
2
- import htm from "https://esm.sh/htm";
1
+ import { h } from "preact";
2
+ import htm from "htm";
3
3
  import { Envars } from "../envars.js";
4
4
 
5
5
  const html = htm.bind(h);
@@ -1,5 +1,5 @@
1
- import { h } from "https://esm.sh/preact";
2
- import htm from "https://esm.sh/htm";
1
+ import { h } from "preact";
2
+ import htm from "htm";
3
3
  import { GeneralTab } from "../general/index.js";
4
4
 
5
5
  const html = htm.bind(h);
@@ -1,5 +1,6 @@
1
1
  export { AgentsRoute } from "./agents-route.js";
2
2
  export { BrowseRoute } from "./browse-route.js";
3
+ export { ChatRoute } from "./chat-route.js";
3
4
  export { CronRoute } from "./cron-route.js";
4
5
  export { DoctorRoute } from "./doctor-route.js";
5
6
  export { EnvarsRoute } from "./envars-route.js";
@@ -1,5 +1,5 @@
1
- import { h } from "https://esm.sh/preact";
2
- import htm from "https://esm.sh/htm";
1
+ import { h } from "preact";
2
+ import htm from "htm";
3
3
  import { Models } from "../models-tab/index.js";
4
4
 
5
5
  const html = htm.bind(h);
@@ -1,5 +1,5 @@
1
- import { h } from "https://esm.sh/preact";
2
- import htm from "https://esm.sh/htm";
1
+ import { h } from "preact";
2
+ import htm from "htm";
3
3
  import { NodesTab } from "../nodes-tab/index.js";
4
4
 
5
5
  const html = htm.bind(h);
@@ -1,5 +1,5 @@
1
- import { h } from "https://esm.sh/preact";
2
- import htm from "https://esm.sh/htm";
1
+ import { h } from "preact";
2
+ import htm from "htm";
3
3
  import { Providers } from "../providers.js";
4
4
 
5
5
  const html = htm.bind(h);
@@ -1,5 +1,5 @@
1
- import { useEffect } from "https://esm.sh/preact/hooks";
2
- import { useLocation } from "https://esm.sh/wouter-preact";
1
+ import { useEffect } from "preact/hooks";
2
+ import { useLocation } from "wouter-preact";
3
3
 
4
4
  export const RouteRedirect = ({ to }) => {
5
5
  const [, setLocation] = useLocation();
@@ -1,5 +1,5 @@
1
- import { h } from "https://esm.sh/preact";
2
- import htm from "https://esm.sh/htm";
1
+ import { h } from "preact";
2
+ import htm from "htm";
3
3
  import { TelegramWorkspace } from "../telegram-workspace/index.js";
4
4
 
5
5
  const html = htm.bind(h);
@@ -1,5 +1,5 @@
1
- import { h } from "https://esm.sh/preact";
2
- import htm from "https://esm.sh/htm";
1
+ import { h } from "preact";
2
+ import htm from "htm";
3
3
  import { UsageTab } from "../usage-tab/index.js";
4
4
 
5
5
  const html = htm.bind(h);
@@ -1,5 +1,5 @@
1
- import { h } from "https://esm.sh/preact";
2
- import htm from "https://esm.sh/htm";
1
+ import { h } from "preact";
2
+ import htm from "htm";
3
3
  import { WatchdogTab } from "../watchdog-tab/index.js";
4
4
 
5
5
  const html = htm.bind(h);
@@ -1,5 +1,5 @@
1
- import { h } from "https://esm.sh/preact";
2
- import htm from "https://esm.sh/htm";
1
+ import { h } from "preact";
2
+ import htm from "htm";
3
3
  import { Webhooks } from "../webhooks/index.js";
4
4
 
5
5
  const html = htm.bind(h);
@@ -1,6 +1,6 @@
1
- import { h } from 'https://esm.sh/preact';
2
- import { useState } from 'https://esm.sh/preact/hooks';
3
- import htm from 'https://esm.sh/htm';
1
+ import { h } from 'preact';
2
+ import { useState } from 'preact/hooks';
3
+ import htm from 'htm';
4
4
  const html = htm.bind(h);
5
5
 
6
6
  export const SERVICES = [
@@ -43,19 +43,19 @@ export function ScopePicker({ scopes, onToggle, apiStatus, loading }) {
43
43
  const api = status[s.key];
44
44
  let apiIndicator = null;
45
45
  if (loading && !api && (readOn || writeOn)) {
46
- apiIndicator = html`<span class="text-gray-500 text-xs flex items-center gap-1"><span class="inline-block w-3 h-3 border-2 border-gray-500 border-t-transparent rounded-full ac-spinner"></span></span>`;
46
+ apiIndicator = html`<span class="text-fg-muted text-xs flex items-center gap-1"><span class="inline-block w-3 h-3 border-2 border-fg-muted border-t-transparent rounded-full ac-spinner"></span></span>`;
47
47
  } else if (api) {
48
48
  if (api.status === 'ok') {
49
- apiIndicator = html`<a href=${api.enableUrl || getApiEnableUrl(s.key)} target="_blank" class="text-green-500 hover:text-green-300 text-xs px-1.5 py-0.5 rounded bg-green-500/10">API ✓</a>`;
49
+ apiIndicator = html`<a href=${api.enableUrl || getApiEnableUrl(s.key)} target="_blank" class="text-status-success-muted hover:text-status-success text-xs px-1.5 py-0.5 rounded bg-green-500/10">API ✓</a>`;
50
50
  } else if (api.status === 'not_enabled') {
51
- apiIndicator = html`<a href=${api.enableUrl} target="_blank" class="text-red-400 hover:text-red-300 text-xs underline">Enable API</a>`;
51
+ apiIndicator = html`<a href=${api.enableUrl} target="_blank" class="text-status-error-muted hover:text-status-error text-xs underline">Enable API</a>`;
52
52
  } else if (api.status === 'error') {
53
- apiIndicator = html`<a href=${api.enableUrl || getApiEnableUrl(s.key)} target="_blank" class="text-yellow-500 hover:text-yellow-300 text-xs underline">Enable API</a>`;
53
+ apiIndicator = html`<a href=${api.enableUrl || getApiEnableUrl(s.key)} target="_blank" class="text-status-warning-muted hover:text-status-warning text-xs underline">Enable API</a>`;
54
54
  }
55
55
  }
56
56
 
57
57
  return html`
58
- <div class="flex items-center justify-between bg-black/30 rounded-lg px-3 py-2">
58
+ <div class="flex items-center justify-between bg-field rounded-lg px-3 py-2">
59
59
  <span class="text-sm">${s.icon} ${s.label}</span>
60
60
  <div class="flex items-center gap-2">
61
61
  ${apiIndicator}
@@ -68,7 +68,7 @@ export function ScopePicker({ scopes, onToggle, apiStatus, loading }) {
68
68
  <button
69
69
  type="button"
70
70
  onclick=${() => setShowAll((prev) => !prev)}
71
- class="ml-3 text-xs text-gray-500 hover:text-gray-300"
71
+ class="ml-3 text-xs text-fg-muted hover:text-body"
72
72
  >
73
73
  ${showAll ? 'Show fewer services' : `Show more services (${SERVICES.length - kVisibleCount})`}
74
74
  </button>
@@ -1,6 +1,6 @@
1
- import { h } from "https://esm.sh/preact";
2
- import { useState } from "https://esm.sh/preact/hooks";
3
- import htm from "https://esm.sh/htm";
1
+ import { h } from "preact";
2
+ import { useState } from "preact/hooks";
3
+ import htm from "htm";
4
4
  import { LoadingSpinner } from "./loading-spinner.js";
5
5
  const html = htm.bind(h);
6
6
 
@@ -38,14 +38,14 @@ export const SecretInput = ({
38
38
  autocomplete="off"
39
39
  />
40
40
  ${loading
41
- ? html`<${LoadingSpinner} className="h-3 w-3 text-gray-500 shrink-0" />`
41
+ ? html`<${LoadingSpinner} className="h-3 w-3 text-fg-muted shrink-0" />`
42
42
  : null}
43
43
  ${showToggle
44
44
  ? html`<button
45
45
  type="button"
46
46
  onclick=${() => setVisible((v) => !v)}
47
47
  disabled=${isDisabled}
48
- class="text-gray-500 hover:text-gray-300 px-1 text-xs shrink-0"
48
+ class="text-fg-muted hover:text-body px-1 text-xs shrink-0"
49
49
  >
50
50
  ${visible ? "Hide" : "Show"}
51
51
  </button>`
@@ -1,5 +1,5 @@
1
- import { h } from "https://esm.sh/preact";
2
- import htm from "https://esm.sh/htm";
1
+ import { h } from "preact";
2
+ import htm from "htm";
3
3
  import { Tooltip } from "./tooltip.js";
4
4
 
5
5
  const html = htm.bind(h);
@@ -1,5 +1,5 @@
1
- import { h } from "https://esm.sh/preact";
2
- import htm from "https://esm.sh/htm";
1
+ import { h } from "preact";
2
+ import htm from "htm";
3
3
  import { getSessionRowKey } from "../lib/session-keys.js";
4
4
 
5
5
  const html = htm.bind(h);
@@ -20,11 +20,11 @@ export const SessionSelectField = ({
20
20
  emptyStateText = "",
21
21
  loadingLabel = "Loading sessions...",
22
22
  containerClassName = "space-y-2",
23
- labelClassName = "text-xs text-gray-500",
24
- selectClassName = "w-full bg-black/30 border border-border rounded-lg px-3 py-2 text-xs text-gray-200 focus:border-gray-500",
25
- helperClassName = "text-xs text-gray-500",
26
- statusClassName = "text-xs text-gray-500",
27
- errorClassName = "text-xs text-red-400",
23
+ labelClassName = "text-xs text-fg-muted",
24
+ selectClassName = "w-full bg-field border border-border rounded-lg px-3 py-2 text-xs text-body focus:border-fg-muted",
25
+ helperClassName = "text-xs text-fg-muted",
26
+ statusClassName = "text-xs text-fg-muted",
27
+ errorClassName = "text-xs text-status-error-muted",
28
28
  }) => {
29
29
  const resolvedValue = selectedSessionKey || (allowNone ? noneValue : "");
30
30
  const isDisabled = disabled || loading;
@@ -1,6 +1,6 @@
1
- import { h } from "https://esm.sh/preact";
2
- import { useEffect, useState } from "https://esm.sh/preact/hooks";
3
- import htm from "https://esm.sh/htm";
1
+ import { h } from "preact";
2
+ import { useEffect, useState } from "preact/hooks";
3
+ import htm from "htm";
4
4
  import { fetchBrowseGitSummary, syncBrowseChanges } from "../lib/api.js";
5
5
  import { formatLocaleDateTime } from "../lib/format.js";
6
6
  import { ActionButton } from "./action-button.js";
@@ -1,12 +1,13 @@
1
- import { h } from "https://esm.sh/preact";
2
- import { useEffect, useRef, useState } from "https://esm.sh/preact/hooks";
3
- import htm from "https://esm.sh/htm";
1
+ import { h } from "preact";
2
+ import { useEffect, useRef, useState } from "preact/hooks";
3
+ import htm from "htm";
4
4
  import {
5
5
  AddLineIcon,
6
6
  AlarmLineIcon,
7
7
  BarChartLineIcon,
8
8
  Brain2LineIcon,
9
9
  BracesLineIcon,
10
+ ChatVoiceLineIcon,
10
11
  ComputerLineIcon,
11
12
  EyeLineIcon,
12
13
  FolderLineIcon,
@@ -93,6 +94,10 @@ export const AppSidebar = ({
93
94
  selectedAgentId = "",
94
95
  onSelectAgent = () => {},
95
96
  onAddAgent = () => {},
97
+ chatSessions = [],
98
+ selectedChatSessionKey = "",
99
+ onSelectChatSession = () => {},
100
+ onStartChat = () => {},
96
101
  }) => {
97
102
  const browseLayoutRef = useRef(null);
98
103
  const browseBottomPanelRef = useRef(null);
@@ -208,6 +213,14 @@ export const AppSidebar = ({
208
213
  >
209
214
  <${FolderLineIcon} className="sidebar-tab-icon" />
210
215
  </button>
216
+ <button
217
+ class=${`sidebar-tab ${sidebarTab === "chat" ? "active" : ""}`}
218
+ aria-label="Chat tab"
219
+ title="Chat"
220
+ onclick=${() => onSelectSidebarTab("chat")}
221
+ >
222
+ <${ChatVoiceLineIcon} className="sidebar-tab-icon" />
223
+ </button>
211
224
  </div>
212
225
  <div
213
226
  style=${{
@@ -283,6 +296,45 @@ export const AppSidebar = ({
283
296
  : null}
284
297
  </div>
285
298
  </div>
299
+ <div
300
+ style=${{
301
+ display: sidebarTab === "chat" ? "flex" : "none",
302
+ flexDirection: "column",
303
+ flex: "1 1 auto",
304
+ minHeight: 0,
305
+ }}
306
+ >
307
+ <div class="sidebar-chat-header">
308
+ <div class="sidebar-label sidebar-chat-label">Sessions</div>
309
+ <button
310
+ type="button"
311
+ class="sidebar-chat-new-button"
312
+ onclick=${onStartChat}
313
+ title="New chat"
314
+ aria-label="New chat"
315
+ >
316
+ <${AddLineIcon} className="sidebar-chat-new-icon" />
317
+ </button>
318
+ </div>
319
+ <div class="sidebar-chat-sessions-list">
320
+ ${chatSessions.length === 0
321
+ ? html`<div class="sidebar-chat-empty">No sessions found</div>`
322
+ : chatSessions.map(
323
+ (sessionRow) => html`
324
+ <button
325
+ key=${sessionRow.key}
326
+ class=${`sidebar-chat-session-item ${selectedChatSessionKey === sessionRow.key ? "active" : ""}`}
327
+ onclick=${() => onSelectChatSession(sessionRow.key)}
328
+ title=${sessionRow.label || sessionRow.key}
329
+ >
330
+ <span class="sidebar-chat-session-name"
331
+ >${sessionRow.label || sessionRow.key}</span
332
+ >
333
+ </button>
334
+ `,
335
+ )}
336
+ </div>
337
+ </div>
286
338
  <div
287
339
  style=${{
288
340
  display: sidebarTab === "browse" ? "flex" : "none",
@@ -1,5 +1,5 @@
1
- import { h } from "https://esm.sh/preact";
2
- import htm from "https://esm.sh/htm";
1
+ import { h } from "preact";
2
+ import htm from "htm";
3
3
 
4
4
  const html = htm.bind(h);
5
5
 
@@ -7,7 +7,7 @@ export const SummaryStatCard = ({
7
7
  title = "",
8
8
  value = "—",
9
9
  toneClassName = "",
10
- valueClassName = "text-lg font-semibold text-gray-200",
10
+ valueClassName = "text-lg font-semibold text-body",
11
11
  monospace = false,
12
12
  } = {}) => html`
13
13
  <div class="bg-surface border border-border rounded-xl p-4">
@@ -1,6 +1,6 @@
1
- import { h } from "https://esm.sh/preact";
2
- import { useState, useEffect } from "https://esm.sh/preact/hooks";
3
- import htm from "https://esm.sh/htm";
1
+ import { h } from "preact";
2
+ import { useState, useEffect } from "preact/hooks";
3
+ import htm from "htm";
4
4
  import { showToast } from "../toast.js";
5
5
  import * as api from "../../lib/telegram-api.js";
6
6
  import {
@@ -86,7 +86,7 @@ const removeTelegramWorkspaceCache = (accountId) => {
86
86
  const BackButton = ({ onBack }) => html`
87
87
  <button
88
88
  onclick=${onBack}
89
- class="flex items-center gap-1.5 text-sm text-gray-500 hover:text-gray-300 transition-colors mb-4"
89
+ class="flex items-center gap-1.5 text-sm text-fg-muted hover:text-body transition-colors mb-4"
90
90
  >
91
91
  <svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
92
92
  <path
@@ -121,20 +121,20 @@ const MultiGroupView = ({
121
121
  >
122
122
  <button
123
123
  onclick=${() => toggle(g.groupId)}
124
- class="w-full flex items-center justify-between px-3 py-2.5 bg-black/20 hover:bg-black/30 transition-colors text-left"
124
+ class="w-full flex items-center justify-between px-3 py-2.5 bg-field hover:bg-field transition-colors text-left"
125
125
  >
126
126
  <div>
127
- <p class="text-sm text-gray-300 font-medium">
127
+ <p class="text-sm text-body font-medium">
128
128
  ${g.groupName || g.groupId}
129
129
  </p>
130
- <p class="text-[11px] text-gray-500 font-mono">${g.groupId}</p>
130
+ <p class="text-[11px] text-fg-muted font-mono">${g.groupId}</p>
131
131
  </div>
132
132
  <svg
133
133
  width="16"
134
134
  height="16"
135
135
  viewBox="0 0 16 16"
136
136
  fill="currentColor"
137
- class="text-gray-500 transition-transform ${expandedGroupId ===
137
+ class="text-fg-muted transition-transform ${expandedGroupId ===
138
138
  g.groupId
139
139
  ? "rotate-180"
140
140
  : ""}"
@@ -339,7 +339,7 @@ export const TelegramWorkspace = ({ accountId = "default", onBack }) => {
339
339
  ${!workspaceConfig.ready
340
340
  ? html`
341
341
  <div class="min-h-[220px] flex items-center justify-center">
342
- <p class="text-sm text-gray-500">Loading workspace...</p>
342
+ <p class="text-sm text-fg-muted">Loading workspace...</p>
343
343
  </div>
344
344
  `
345
345
  : workspaceConfig.configured
@@ -393,7 +393,7 @@ export const TelegramWorkspace = ({ accountId = "default", onBack }) => {
393
393
  Set Up Telegram Workspace
394
394
  </h2>
395
395
  </div>
396
- <span class="text-xs text-gray-500"
396
+ <span class="text-xs text-fg-muted"
397
397
  >Step ${step + 1} of ${kSteps.length}</span
398
398
  >
399
399
  </div>
@@ -1,6 +1,6 @@
1
- import { h } from "https://esm.sh/preact";
2
- import { useState, useEffect } from "https://esm.sh/preact/hooks";
3
- import htm from "https://esm.sh/htm";
1
+ import { h } from "preact";
2
+ import { useState, useEffect } from "preact/hooks";
3
+ import htm from "htm";
4
4
  import { showToast } from "../toast.js";
5
5
  import { ActionButton } from "../action-button.js";
6
6
  import { ConfirmDialog } from "../confirm-dialog.js";
@@ -13,7 +13,7 @@ const AgentSelect = ({ value, agents, onChange, className = "" }) => html`
13
13
  <select
14
14
  value=${value}
15
15
  onChange=${(e) => onChange(e.target.value)}
16
- class="bg-black/30 border border-border rounded-lg px-2 py-1.5 text-xs text-gray-200 focus:outline-none focus:border-gray-500 ${className}"
16
+ class="bg-field border border-border rounded-lg px-2 py-1.5 text-xs text-body focus:outline-none focus:border-fg-muted ${className}"
17
17
  >
18
18
  <option value="">Default</option>
19
19
  ${agents.map(
@@ -174,15 +174,15 @@ export const ManageTelegramWorkspace = ({
174
174
  <div class="flex justify-end">
175
175
  <button
176
176
  onclick=${onResetOnboarding}
177
- class="text-xs px-3 py-1.5 rounded-lg border border-border text-gray-400 hover:text-gray-200 hover:border-gray-500 transition-colors"
177
+ class="text-xs px-3 py-1.5 rounded-lg border border-border text-fg-muted hover:text-body hover:border-fg-muted transition-colors"
178
178
  >
179
179
  Reset onboarding
180
180
  </button>
181
181
  </div>
182
182
  `}
183
- <div class="bg-black/20 border border-border rounded-lg p-3 space-y-1">
184
- <p class="text-sm text-gray-300 font-medium">${groupName || groupId}</p>
185
- <p class="text-xs text-gray-500 font-mono">${groupId}</p>
183
+ <div class="bg-field border border-border rounded-lg p-3 space-y-1">
184
+ <p class="text-sm text-body font-medium">${groupName || groupId}</p>
185
+ <p class="text-xs text-fg-muted font-mono">${groupId}</p>
186
186
  </div>
187
187
 
188
188
  <div class="space-y-2">
@@ -190,23 +190,23 @@ export const ManageTelegramWorkspace = ({
190
190
  ${topicEntries.length > 0
191
191
  ? html`
192
192
  <div
193
- class="bg-black/20 border border-border rounded-lg overflow-hidden"
193
+ class="bg-field border border-border rounded-lg overflow-hidden"
194
194
  >
195
195
  <table class="w-full text-xs table-fixed">
196
196
  <thead>
197
197
  <tr class="border-b border-border">
198
- <th class="text-left px-3 py-2 text-gray-500 font-medium">
198
+ <th class="text-left px-3 py-2 text-fg-muted font-medium">
199
199
  Topic
200
200
  </th>
201
201
  <th
202
- class="text-left px-3 py-2 text-gray-500 font-medium w-36"
202
+ class="text-left px-3 py-2 text-fg-muted font-medium w-36"
203
203
  >
204
204
  Thread ID
205
205
  </th>
206
206
  ${agents.length > 0 &&
207
207
  html`
208
208
  <th
209
- class="text-left px-3 py-2 text-gray-500 font-medium w-32"
209
+ class="text-left px-3 py-2 text-fg-muted font-medium w-32"
210
210
  >
211
211
  Agent
212
212
  </th>
@@ -233,7 +233,7 @@ export const ManageTelegramWorkspace = ({
233
233
  if (e.key === "Enter") saveRename(id);
234
234
  if (e.key === "Escape") cancelRename();
235
235
  }}
236
- class="w-full bg-black/30 border border-border rounded-lg px-2 py-1.5 text-xs text-gray-200 placeholder-gray-600 focus:outline-none focus:border-gray-500"
236
+ class="w-full bg-field border border-border rounded-lg px-2 py-1.5 text-xs text-body placeholder-fg-dim focus:outline-none focus:border-fg-muted"
237
237
  />
238
238
  <textarea
239
239
  value=${editingTopicInstructions}
@@ -243,12 +243,12 @@ export const ManageTelegramWorkspace = ({
243
243
  )}
244
244
  placeholder="System instructions (optional)"
245
245
  rows="6"
246
- class="w-full bg-black/30 border border-border rounded-lg px-2 py-1.5 text-xs text-gray-200 placeholder-gray-600 focus:outline-none focus:border-gray-500 resize-y"
246
+ class="w-full bg-field border border-border rounded-lg px-2 py-1.5 text-xs text-body placeholder-fg-dim focus:outline-none focus:border-fg-muted resize-y"
247
247
  />
248
248
  ${agents.length > 0 &&
249
249
  html`
250
250
  <div class="flex items-center gap-2">
251
- <label class="text-xs text-gray-500">Agent:</label>
251
+ <label class="text-xs text-fg-muted">Agent:</label>
252
252
  <${AgentSelect}
253
253
  value=${editingTopicAgentId}
254
254
  agents=${agents}
@@ -270,7 +270,7 @@ export const ManageTelegramWorkspace = ({
270
270
  </button>
271
271
  <button
272
272
  onclick=${cancelRename}
273
- class="text-xs px-2 py-1 rounded border border-border text-gray-400 hover:text-gray-200 hover:border-gray-500"
273
+ class="text-xs px-2 py-1 rounded border border-border text-fg-muted hover:text-body hover:border-fg-muted"
274
274
  >
275
275
  Cancel
276
276
  </button>
@@ -283,7 +283,7 @@ export const ManageTelegramWorkspace = ({
283
283
  <tr
284
284
  class="border-b border-border last:border-0 align-middle"
285
285
  >
286
- <td class="px-3 py-2 text-gray-300">
286
+ <td class="px-3 py-2 text-body">
287
287
  <div class="flex items-center gap-2">
288
288
  <span>${topic.name}</span>
289
289
  <button
@@ -314,23 +314,23 @@ export const ManageTelegramWorkspace = ({
314
314
  ${topic.systemInstructions &&
315
315
  html`
316
316
  <p
317
- class="text-[11px] text-gray-500 mt-1 line-clamp-1"
317
+ class="text-[11px] text-fg-muted mt-1 line-clamp-1"
318
318
  >
319
319
  ${topic.systemInstructions}
320
320
  </p>
321
321
  `}
322
322
  </td>
323
323
  <td
324
- class="px-3 py-2 text-gray-500 font-mono w-36"
324
+ class="px-3 py-2 text-fg-muted font-mono w-36"
325
325
  >
326
326
  ${id}
327
327
  </td>
328
328
  ${agents.length > 0 &&
329
329
  html`
330
- <td class="px-3 py-2 text-gray-400 w-32">
330
+ <td class="px-3 py-2 text-fg-muted w-32">
331
331
  ${topic.agentId
332
- ? html`<span class="text-gray-300">${agents.find((a) => a.id === topic.agentId)?.name || topic.agentId}</span>`
333
- : html`<span class="text-gray-600">default</span>`}
332
+ ? html`<span class="text-body">${agents.find((a) => a.id === topic.agentId)?.name || topic.agentId}</span>`
333
+ : html`<span class="text-fg-dim">default</span>`}
334
334
  </td>
335
335
  `}
336
336
  <td class="px-3 py-2">
@@ -344,7 +344,7 @@ export const ManageTelegramWorkspace = ({
344
344
  name: String(topic.name || ""),
345
345
  })}
346
346
  disabled=${deleting === id}
347
- class="text-xs px-2 py-1 rounded border border-border text-gray-500 hover:text-red-300 hover:border-red-500 ${deleting ===
347
+ class="text-xs px-2 py-1 rounded border border-border text-fg-muted hover:text-status-error hover:border-red-500 ${deleting ===
348
348
  id
349
349
  ? "opacity-50 cursor-not-allowed"
350
350
  : ""}"
@@ -362,13 +362,13 @@ export const ManageTelegramWorkspace = ({
362
362
  </table>
363
363
  </div>
364
364
  `
365
- : html`<p class="text-xs text-gray-500">No topics yet.</p>`}
365
+ : html`<p class="text-xs text-fg-muted">No topics yet.</p>`}
366
366
  </div>
367
367
 
368
368
  ${showCreateTopic &&
369
369
  html`
370
- <div class="space-y-2 bg-black/20 border border-border rounded-lg p-3">
371
- <label class="text-xs text-gray-500">Create new topic</label>
370
+ <div class="space-y-2 bg-field border border-border rounded-lg p-3">
371
+ <label class="text-xs text-fg-muted">Create new topic</label>
372
372
  <div class="space-y-2">
373
373
  <input
374
374
  type="text"
@@ -378,19 +378,19 @@ export const ManageTelegramWorkspace = ({
378
378
  if (e.key === "Enter") createSingle();
379
379
  }}
380
380
  placeholder="Topic name"
381
- class="w-full bg-black/30 border border-border rounded-lg px-3 py-2 text-sm text-gray-200 placeholder-gray-600 focus:outline-none focus:border-gray-500"
381
+ class="w-full bg-field border border-border rounded-lg px-3 py-2 text-sm text-body placeholder-fg-dim focus:outline-none focus:border-fg-muted"
382
382
  />
383
383
  <textarea
384
384
  value=${newTopicInstructions}
385
385
  onInput=${(e) => setNewTopicInstructions(e.target.value)}
386
386
  placeholder="System instructions (optional)"
387
387
  rows="5"
388
- class="w-full bg-black/30 border border-border rounded-lg px-3 py-2 text-sm text-gray-200 placeholder-gray-600 focus:outline-none focus:border-gray-500 resize-y"
388
+ class="w-full bg-field border border-border rounded-lg px-3 py-2 text-sm text-body placeholder-fg-dim focus:outline-none focus:border-fg-muted resize-y"
389
389
  />
390
390
  ${agents.length > 0 &&
391
391
  html`
392
392
  <div class="flex items-center gap-2">
393
- <label class="text-xs text-gray-500">Agent:</label>
393
+ <label class="text-xs text-fg-muted">Agent:</label>
394
394
  <${AgentSelect}
395
395
  value=${newTopicAgentId}
396
396
  agents=${agents}
@@ -415,7 +415,7 @@ export const ManageTelegramWorkspace = ({
415
415
  ${error &&
416
416
  html`
417
417
  <div class="bg-red-500/10 border border-red-500/20 rounded-lg p-3">
418
- <p class="text-sm text-red-400">${error}</p>
418
+ <p class="text-sm text-status-error-muted">${error}</p>
419
419
  </div>
420
420
  `}
421
421
 
@@ -423,7 +423,7 @@ export const ManageTelegramWorkspace = ({
423
423
  <button
424
424
  onclick=${() => setShowCreateTopic((v) => !v)}
425
425
  class="${showCreateTopic
426
- ? "w-auto text-sm font-medium px-4 py-2 rounded-xl transition-all border border-border text-gray-300 hover:border-gray-500"
426
+ ? "w-auto text-sm font-medium px-4 py-2 rounded-xl transition-all border border-border text-body hover:border-fg-muted"
427
427
  : "w-auto text-sm font-medium px-4 py-2 rounded-xl transition-all ac-btn-cyan"}"
428
428
  >
429
429
  ${showCreateTopic ? "Close create topic" : "Create topic"}
@@ -432,13 +432,13 @@ export const ManageTelegramWorkspace = ({
432
432
 
433
433
  <div class="border-t border-white/10" />
434
434
 
435
- <p class="text-xs text-gray-500">
435
+ <p class="text-xs text-fg-muted">
436
436
  Concurrency is auto-scaled to support your group:
437
- <span class="text-gray-300"> agent ${maxConcurrent}</span>,
438
- <span class="text-gray-300"> subagent ${subagentMaxConcurrent}</span>
439
- <span class="text-gray-600"> (${topicCount} topics)</span>.
437
+ <span class="text-body"> agent ${maxConcurrent}</span>,
438
+ <span class="text-body"> subagent ${subagentMaxConcurrent}</span>
439
+ <span class="text-fg-dim"> (${topicCount} topics)</span>.
440
440
  </p>
441
- <p class="text-[11px] text-gray-500">
441
+ <p class="text-[11px] text-fg-muted">
442
442
  This registry can drift if topics are created, renamed, or removed
443
443
  outside this page. Your agent will update the registry if it notices a
444
444
  discrepancy.