@chrysb/alphaclaw 0.9.0-beta.6 → 0.9.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 (66) hide show
  1. package/bin/alphaclaw.js +25 -25
  2. package/lib/cli/git-runtime.js +97 -0
  3. package/lib/public/css/chat.css +0 -12
  4. package/lib/public/css/explorer.css +48 -0
  5. package/lib/public/css/shell.css +149 -0
  6. package/lib/public/css/tailwind.generated.css +1 -1
  7. package/lib/public/css/theme.css +265 -0
  8. package/lib/public/dist/app.bundle.js +2770 -2762
  9. package/lib/public/js/app.js +26 -14
  10. package/lib/public/js/components/agents-tab/create-channel-modal.js +259 -59
  11. package/lib/public/js/components/gateway.js +0 -286
  12. package/lib/public/js/components/general/index.js +0 -7
  13. package/lib/public/js/components/icons.js +26 -25
  14. package/lib/public/js/components/modal-shell.js +1 -1
  15. package/lib/public/js/components/models-tab/provider-auth-card.js +60 -49
  16. package/lib/public/js/components/models-tab/use-models.js +74 -9
  17. package/lib/public/js/components/models.js +52 -37
  18. package/lib/public/js/components/onboarding/use-welcome-codex.js +34 -24
  19. package/lib/public/js/components/onboarding/welcome-config.js +76 -10
  20. package/lib/public/js/components/onboarding/welcome-form-step.js +2 -7
  21. package/lib/public/js/components/onboarding/welcome-header.js +12 -14
  22. package/lib/public/js/components/onboarding/welcome-setup-step.js +3 -3
  23. package/lib/public/js/components/providers.js +53 -42
  24. package/lib/public/js/components/routes/chat-route.js +2 -9
  25. package/lib/public/js/components/routes/general-route.js +0 -6
  26. package/lib/public/js/components/routes/index.js +0 -1
  27. package/lib/public/js/components/routes/watchdog-route.js +0 -6
  28. package/lib/public/js/components/sidebar.js +21 -7
  29. package/lib/public/js/components/theme-toggle.js +113 -0
  30. package/lib/public/js/components/update-modal.js +174 -51
  31. package/lib/public/js/components/watchdog-tab/index.js +0 -6
  32. package/lib/public/js/components/welcome/index.js +0 -2
  33. package/lib/public/js/components/welcome/use-welcome.js +101 -36
  34. package/lib/public/js/hooks/use-app-shell-controller.js +16 -33
  35. package/lib/public/js/lib/api.js +0 -28
  36. package/lib/public/js/lib/app-navigation.js +0 -2
  37. package/lib/public/js/lib/channel-provider-availability.js +1 -2
  38. package/lib/public/js/lib/codex-oauth-window.js +22 -0
  39. package/lib/public/js/lib/model-catalog.js +20 -0
  40. package/lib/public/js/lib/storage-keys.js +1 -1
  41. package/lib/public/login.html +8 -4
  42. package/lib/public/setup.html +9 -0
  43. package/lib/scripts/git +47 -1
  44. package/lib/server/agents/channels.js +1 -4
  45. package/lib/server/alphaclaw-version.js +590 -132
  46. package/lib/server/constants.js +5 -0
  47. package/lib/server/db/webhooks/index.js +48 -8
  48. package/lib/server/exec-defaults-config.js +163 -0
  49. package/lib/server/init/register-server-routes.js +0 -8
  50. package/lib/server/init/server-lifecycle.js +2 -0
  51. package/lib/server/model-catalog-cache.js +251 -0
  52. package/lib/server/onboarding/index.js +5 -0
  53. package/lib/server/routes/models.js +14 -23
  54. package/lib/server/routes/nodes.js +9 -23
  55. package/lib/server/routes/system.js +3 -16
  56. package/lib/server/routes/webhooks.js +12 -1
  57. package/lib/server/startup.js +8 -0
  58. package/lib/server/watchdog-notify.js +172 -55
  59. package/lib/server.js +17 -2
  60. package/package.json +2 -2
  61. package/patches/openclaw+2026.4.9.patch +13 -0
  62. package/lib/public/js/components/mcp-tab/index.js +0 -237
  63. package/lib/public/js/components/routes/mcp-route.js +0 -7
  64. package/lib/server/mcp-bridge.js +0 -158
  65. package/lib/server/routes/mcp.js +0 -252
  66. package/patches/openclaw+2026.3.28.patch +0 -13
@@ -23,7 +23,6 @@ export const kNavSections = [
23
23
  { id: "envars", label: "Envars" },
24
24
  { id: "webhooks", label: "Webhooks" },
25
25
  { id: "nodes", label: "Nodes" },
26
- { id: "mcp", label: "MCP" },
27
26
  ],
28
27
  },
29
28
  ];
@@ -42,6 +41,5 @@ export const getSelectedNavId = ({ isBrowseRoute = false, location = "" } = {})
42
41
  if (location.startsWith("/nodes")) return "nodes";
43
42
  if (location.startsWith("/envars")) return "envars";
44
43
  if (location.startsWith("/webhooks")) return "webhooks";
45
- if (location.startsWith("/mcp")) return "mcp";
46
44
  return kDefaultUiTab;
47
45
  };
@@ -1,4 +1,4 @@
1
- const kSingleAccountChannelProviders = new Set(["discord", "slack"]);
1
+ const kSingleAccountChannelProviders = new Set(["discord"]);
2
2
 
3
3
  const hasConfiguredAccounts = ({ configuredChannelMap, provider }) => {
4
4
  const channelEntry = configuredChannelMap instanceof Map
@@ -20,4 +20,3 @@ export const isChannelProviderDisabledForAdd = ({
20
20
  if (!isSingleAccountChannelProvider(provider)) return false;
21
21
  return hasConfiguredAccounts({ configuredChannelMap, provider });
22
22
  };
23
-
@@ -0,0 +1,22 @@
1
+ const kCodexAuthStartPath = "/auth/codex/start";
2
+ const kCodexAuthWindowName = "codex-auth";
3
+ const kCodexAuthPopupFeatures = "popup=yes,width=640,height=780";
4
+ const kCodexAuthCallbackMessageType = "callback-input";
5
+
6
+ export const openCodexAuthWindow = () => {
7
+ const popup = window.open(
8
+ kCodexAuthStartPath,
9
+ kCodexAuthWindowName,
10
+ kCodexAuthPopupFeatures,
11
+ );
12
+ if (!popup || popup.closed) {
13
+ window.location.href = kCodexAuthStartPath;
14
+ return null;
15
+ }
16
+ return popup;
17
+ };
18
+
19
+ export const isCodexAuthCallbackMessage = (value) =>
20
+ value?.codex === kCodexAuthCallbackMessageType &&
21
+ typeof value.input === "string" &&
22
+ value.input.trim().length > 0;
@@ -0,0 +1,20 @@
1
+ import { getFeaturedModels } from "./model-config.js";
2
+
3
+ export const kModelCatalogCacheKey = "/api/models";
4
+ export const kModelCatalogPollIntervalMs = 3000;
5
+
6
+ export const getModelCatalogModels = (payload) =>
7
+ Array.isArray(payload?.models) ? payload.models : [];
8
+
9
+ export const isModelCatalogRefreshing = (payload) =>
10
+ Boolean(payload?.refreshing);
11
+
12
+ export const getInitialOnboardingModelKey = ({
13
+ catalog = [],
14
+ currentModelKey = "",
15
+ } = {}) => {
16
+ const normalizedCurrent = String(currentModelKey || "").trim();
17
+ if (normalizedCurrent) return normalizedCurrent;
18
+ const featuredModels = getFeaturedModels(catalog);
19
+ return String(featuredModels[0]?.key || catalog[0]?.key || "");
20
+ };
@@ -6,6 +6,7 @@
6
6
 
7
7
  // --- UI settings (single JSON blob containing sub-keys) ---
8
8
  export const kUiSettingsStorageKey = "alphaclaw.ui.settings";
9
+ export const kThemeStorageKey = "alphaclaw.ui.theme";
9
10
 
10
11
  // --- Browse / file viewer ---
11
12
  export const kFileViewerModeStorageKey = "alphaclaw.browse.viewerMode";
@@ -30,4 +31,3 @@ export const kAgentLastSessionKey = "alphaclaw.agent.lastSessionKey";
30
31
 
31
32
  // --- Chat ---
32
33
  export const kChatSessionDraftsStorageKey = "alphaclaw.chat.sessionDrafts";
33
-
@@ -11,6 +11,14 @@
11
11
  <link rel="icon" type="image/svg+xml" href="./img/logo.svg" />
12
12
  <link rel="stylesheet" href="./css/theme.css" />
13
13
  <link rel="stylesheet" href="./css/tailwind.generated.css" />
14
+ <script>
15
+ try {
16
+ var t = localStorage.getItem("alphaclaw.ui.theme");
17
+ if (t === "system") t = window.matchMedia("(prefers-color-scheme: light)").matches ? "light" : "dark";
18
+ else if (t !== "dark" && t !== "light") t = "dark";
19
+ document.documentElement.dataset.theme = t;
20
+ } catch {}
21
+ </script>
14
22
  </head>
15
23
  <body class="min-h-screen flex items-center justify-center p-4">
16
24
  <div class="max-w-sm w-full relative z-10">
@@ -53,10 +61,6 @@
53
61
  </form>
54
62
  </div>
55
63
  <script>
56
- try {
57
- window.localStorage?.clear?.();
58
- } catch {}
59
-
60
64
  const formEl = document.getElementById("login-form");
61
65
  const passwordEl = document.getElementById("password");
62
66
  const submitButtonEl = document.getElementById("submit-btn");
@@ -16,6 +16,15 @@
16
16
  <link rel="stylesheet" href="./css/agents.css" />
17
17
  <link rel="stylesheet" href="./css/chat.css" />
18
18
  <link rel="stylesheet" href="./css/cron.css" />
19
+ <script>
20
+ // Apply saved theme before render to prevent flash.
21
+ try {
22
+ var t = localStorage.getItem("alphaclaw.ui.theme");
23
+ if (t === "system") t = window.matchMedia("(prefers-color-scheme: light)").matches ? "light" : "dark";
24
+ else if (t !== "dark" && t !== "light") t = "dark";
25
+ document.documentElement.dataset.theme = t;
26
+ } catch {}
27
+ </script>
19
28
  </head>
20
29
  <body>
21
30
  <div id="app"></div>
package/lib/scripts/git CHANGED
@@ -2,7 +2,7 @@
2
2
  # Git auth shim -- injects GITHUB_TOKEN credentials for network operations
3
3
  # inside the configured OpenClaw repo so the agent can use plain git commands.
4
4
 
5
- REAL_GIT="@@REAL_GIT@@"
5
+ REAL_GIT_HINT="@@REAL_GIT@@"
6
6
  OPENCLAW_REPO_ROOT="@@OPENCLAW_REPO_ROOT@@"
7
7
  ASKPASS_PATH="/tmp/alphaclaw-git-askpass.sh"
8
8
 
@@ -21,6 +21,46 @@ needs_auth() {
21
21
  esac
22
22
  }
23
23
 
24
+ same_path() {
25
+ local left_path right_path
26
+ left_path="$(readlink -f "$1" 2>/dev/null || printf '%s' "$1")"
27
+ right_path="$(readlink -f "$2" 2>/dev/null || printf '%s' "$2")"
28
+ [ "$left_path" = "$right_path" ]
29
+ }
30
+
31
+ resolve_real_git() {
32
+ local self_path candidate
33
+ self_path="$(readlink -f "$0" 2>/dev/null || printf '%s' "$0")"
34
+ for candidate in \
35
+ "${ALPHACLAW_REAL_GIT:-}" \
36
+ "$REAL_GIT_HINT" \
37
+ "/usr/bin/git" \
38
+ "/bin/git" \
39
+ "/usr/libexec/git-core/git" \
40
+ "/usr/local/bin/git.real"
41
+ do
42
+ [ -n "$candidate" ] || continue
43
+ [ -x "$candidate" ] || continue
44
+ same_path "$candidate" "$self_path" && continue
45
+ printf '%s\n' "$candidate"
46
+ return 0
47
+ done
48
+
49
+ if command -v which >/dev/null 2>&1; then
50
+ while IFS= read -r candidate; do
51
+ [ -n "$candidate" ] || continue
52
+ [ -x "$candidate" ] || continue
53
+ same_path "$candidate" "$self_path" && continue
54
+ printf '%s\n' "$candidate"
55
+ return 0
56
+ done <<EOF
57
+ $(which -a git 2>/dev/null || true)
58
+ EOF
59
+ fi
60
+
61
+ return 1
62
+ }
63
+
24
64
  in_openclaw_root() {
25
65
  if [ -z "$OPENCLAW_REPO_ROOT" ]; then
26
66
  return 1
@@ -31,6 +71,12 @@ in_openclaw_root() {
31
71
  esac
32
72
  }
33
73
 
74
+ REAL_GIT="$(resolve_real_git || true)"
75
+ if [ -z "$REAL_GIT" ]; then
76
+ echo "alphaclaw git shim: real git binary not found" >&2
77
+ exit 127
78
+ fi
79
+
34
80
  if [ "${ALPHACLAW_GIT_NO_AUTH:-}" = "1" ] || [ -z "${GITHUB_TOKEN:-}" ] || ! needs_auth || ! in_openclaw_root; then
35
81
  exec "$REAL_GIT" "$@"
36
82
  fi
@@ -143,10 +143,7 @@ const createChannelsDomain = ({
143
143
  `Channel account "${provider}/${accountId}" already exists`,
144
144
  );
145
145
  }
146
- if (
147
- (provider === "discord" || provider === "slack") &&
148
- Object.keys(existingAccounts).length > 0
149
- ) {
146
+ if (provider === "discord" && Object.keys(existingAccounts).length > 0) {
150
147
  throw new Error(
151
148
  `${kChannelLabels[provider] || "This provider"} supports a single channel account`,
152
149
  );