Rename all Moltbot references to OpenClaw
- Renamed all project directories and files - Updated all namespaces and class names - Updated deep link scheme from moltbot:// to openclaw:// - Updated AppData directories to OpenClawTray - Updated README with OpenClaw references and added history note - Updated all configuration and build files - Kept mascot name "Molty" unchanged Co-authored-by: shanselman <2892+shanselman@users.noreply.github.com>
26
.github/workflows/ci.yml
vendored
@ -42,10 +42,10 @@ jobs:
|
||||
run: dotnet build src/Moltbot.Tray.WinUI -c Debug
|
||||
|
||||
- name: Build Tests
|
||||
run: dotnet build tests/Moltbot.Shared.Tests -c Debug
|
||||
run: dotnet build tests/OpenClaw.Shared.Tests -c Debug
|
||||
|
||||
- name: Run Tests
|
||||
run: dotnet test tests/Moltbot.Shared.Tests --no-build -c Debug --verbosity normal
|
||||
run: dotnet test tests/OpenClaw.Shared.Tests --no-build -c Debug --verbosity normal
|
||||
|
||||
outputs:
|
||||
semVer: ${{ steps.gitversion.outputs.semVer }}
|
||||
@ -167,8 +167,8 @@ jobs:
|
||||
# Create ZIP files for Updatum auto-update (needs "win-x64" in filename)
|
||||
- name: Create Release ZIPs
|
||||
run: |
|
||||
Compress-Archive -Path artifacts/tray-win-x64/* -DestinationPath MoltbotTray-${{ needs.test.outputs.majorMinorPatch }}-win-x64.zip
|
||||
Compress-Archive -Path artifacts/tray-win-arm64/* -DestinationPath MoltbotTray-${{ needs.test.outputs.majorMinorPatch }}-win-arm64.zip
|
||||
Compress-Archive -Path artifacts/tray-win-x64/* -DestinationPath OpenClawTray-${{ needs.test.outputs.majorMinorPatch }}-win-x64.zip
|
||||
Compress-Archive -Path artifacts/tray-win-arm64/* -DestinationPath OpenClawTray-${{ needs.test.outputs.majorMinorPatch }}-win-arm64.zip
|
||||
|
||||
# Inno Setup installer for x64
|
||||
- name: Install Inno Setup
|
||||
@ -225,18 +225,18 @@ jobs:
|
||||
with:
|
||||
generate_release_notes: true
|
||||
files: |
|
||||
Output/MoltbotTray-Setup-x64.exe
|
||||
Output/MoltbotTray-Setup-arm64.exe
|
||||
MoltbotTray-${{ needs.test.outputs.majorMinorPatch }}-win-x64.zip
|
||||
MoltbotTray-${{ needs.test.outputs.majorMinorPatch }}-win-arm64.zip
|
||||
Output/OpenClawTray-Setup-x64.exe
|
||||
Output/OpenClawTray-Setup-arm64.exe
|
||||
OpenClawTray-${{ needs.test.outputs.majorMinorPatch }}-win-x64.zip
|
||||
OpenClawTray-${{ needs.test.outputs.majorMinorPatch }}-win-arm64.zip
|
||||
body: |
|
||||
## Moltbot Windows Hub ${{ github.ref_name }}
|
||||
|
||||
### Downloads
|
||||
- **Installer (x64)**: `MoltbotTray-Setup-x64.exe` - Intel/AMD 64-bit
|
||||
- **Installer (ARM64)**: `MoltbotTray-Setup-arm64.exe` - Windows on ARM (Surface, etc.)
|
||||
- **Portable x64**: `MoltbotTray-${{ needs.test.outputs.majorMinorPatch }}-win-x64.zip`
|
||||
- **Portable ARM64**: `MoltbotTray-${{ needs.test.outputs.majorMinorPatch }}-win-arm64.zip`
|
||||
- **Installer (x64)**: `OpenClawTray-Setup-x64.exe` - Intel/AMD 64-bit
|
||||
- **Installer (ARM64)**: `OpenClawTray-Setup-arm64.exe` - Windows on ARM (Surface, etc.)
|
||||
- **Portable x64**: `OpenClawTray-${{ needs.test.outputs.majorMinorPatch }}-win-x64.zip`
|
||||
- **Portable ARM64**: `OpenClawTray-${{ needs.test.outputs.majorMinorPatch }}-win-arm64.zip`
|
||||
|
||||
### Features
|
||||
- 🦞 System tray integration with gateway status
|
||||
@ -247,7 +247,7 @@ jobs:
|
||||
### Requirements
|
||||
- Windows 10 version 1903 or later
|
||||
- [WebView2 Runtime](https://developer.microsoft.com/en-us/microsoft-edge/webview2/)
|
||||
- Moltbot gateway running locally
|
||||
- OpenClaw gateway running locally
|
||||
- PowerToys (for Command Palette extension)
|
||||
|
||||
### Quick Start
|
||||
|
||||
@ -1,15 +1,15 @@
|
||||
# Code Review - Moltbot Windows Hub
|
||||
# Code Review - OpenClaw Windows Hub
|
||||
|
||||
## Overview
|
||||
This document provides a comprehensive code review of the Moltbot Windows Hub repository, focusing on correctness, security, and best practices.
|
||||
This document provides a comprehensive code review of the OpenClaw Windows Hub repository, focusing on correctness, security, and best practices.
|
||||
|
||||
## Executive Summary
|
||||
✅ **Overall Assessment: Good** - The codebase is well-structured with proper separation of concerns, event-driven architecture, and correct async/await patterns. Some potential issues were identified around error handling, reconnection logic, and edge cases.
|
||||
|
||||
## Project Structure
|
||||
- **Moltbot.Shared**: WebSocket gateway client and data models (✅ Cross-platform compatible)
|
||||
- **Moltbot.Tray**: Windows system tray application (⚠️ Windows-only)
|
||||
- **Moltbot.CommandPalette**: PowerToys extension (⚠️ Windows-only)
|
||||
- **OpenClaw.Shared**: WebSocket gateway client and data models (✅ Cross-platform compatible)
|
||||
- **OpenClaw.Tray**: Windows system tray application (⚠️ Windows-only)
|
||||
- **OpenClaw.CommandPalette**: PowerToys extension (⚠️ Windows-only)
|
||||
|
||||
## Code Quality Analysis
|
||||
|
||||
@ -282,7 +282,7 @@ All display text generation in Models.cs is correct:
|
||||
|
||||
### ⚠️ Cross-Platform Compatibility
|
||||
|
||||
**Moltbot.Shared** is mostly cross-platform, but:
|
||||
**OpenClaw.Shared** is mostly cross-platform, but:
|
||||
- `SessionInfo.ShortKey` uses `Path.GetFileName()` which behaves differently on Windows vs Linux
|
||||
- On Linux, backslashes in paths are NOT treated as separators
|
||||
- **Recommendation**: Explicitly replace backslashes before using `Path.GetFileName()`
|
||||
@ -349,7 +349,7 @@ if (Key.Contains('/') || Key.Contains('\\'))
|
||||
|
||||
## Conclusion
|
||||
|
||||
The Moltbot Windows Hub codebase demonstrates good software engineering practices with proper async/await usage, event-driven architecture, and resource management. The main areas for improvement are:
|
||||
The OpenClaw Windows Hub codebase demonstrates good software engineering practices with proper async/await usage, event-driven architecture, and resource management. The main areas for improvement are:
|
||||
|
||||
1. **Testing**: Now addressed with 88 unit tests covering core functionality
|
||||
2. **Error Handling**: Could be more consistent
|
||||
|
||||
58
README.md
@ -1,6 +1,6 @@
|
||||
# 🦞 Moltbot Windows Hub
|
||||
# 🦞 OpenClaw Windows Hub
|
||||
|
||||
A Windows companion suite for [Moltbot](https://moltbot.com) - the AI-powered personal assistant.
|
||||
A Windows companion suite for [OpenClaw](https://moltbot.com) - the AI-powered personal assistant.
|
||||
|
||||
*Made with 🦞 love by Scott Hanselman and Molty*
|
||||
|
||||
@ -14,9 +14,9 @@ This monorepo contains three projects:
|
||||
|
||||
| Project | Description |
|
||||
|---------|-------------|
|
||||
| **Moltbot.Tray** | System tray application for quick access to Moltbot |
|
||||
| **Moltbot.Shared** | Shared gateway client library |
|
||||
| **Moltbot.CommandPalette** | PowerToys Command Palette extension |
|
||||
| **OpenClaw.Tray** | System tray application for quick access to OpenClaw |
|
||||
| **OpenClaw.Shared** | Shared gateway client library |
|
||||
| **OpenClaw.CommandPalette** | PowerToys Command Palette extension |
|
||||
|
||||
## 🚀 Quick Start
|
||||
|
||||
@ -32,12 +32,12 @@ dotnet build
|
||||
|
||||
### Run Tray App
|
||||
```bash
|
||||
dotnet run --project src/Moltbot.Tray
|
||||
dotnet run --project src/OpenClaw.Tray
|
||||
```
|
||||
|
||||
## 📦 Moltbot.Tray (Molty)
|
||||
## 📦 OpenClaw.Tray (Molty)
|
||||
|
||||
Modern Windows 11-style system tray companion that connects to your local Moltbot gateway.
|
||||
Modern Windows 11-style system tray companion that connects to your local OpenClaw gateway.
|
||||
|
||||
### Features
|
||||
- 🦞 **Lobster branding** - Pixel-art lobster tray icon with status colors
|
||||
@ -90,28 +90,28 @@ These features are available in Windows but not in the Mac app:
|
||||
| Toast notifications | Clickable Windows notifications |
|
||||
| Channel control | Start/stop Telegram & WhatsApp |
|
||||
| Modern flyout menu | Windows 11-style with dark/light mode |
|
||||
| Deep links | `moltbot://` URL scheme with IPC |
|
||||
| Deep links | `openclaw://` URL scheme with IPC |
|
||||
| First-run welcome | Guided onboarding for new users |
|
||||
| PowerToys integration | Command Palette extension |
|
||||
|
||||
### Deep Links
|
||||
|
||||
Moltbot registers the `moltbot://` URL scheme for automation and integration:
|
||||
OpenClaw registers the `openclaw://` URL scheme for automation and integration:
|
||||
|
||||
| Link | Description |
|
||||
|------|-------------|
|
||||
| `moltbot://settings` | Open Settings dialog |
|
||||
| `moltbot://chat` | Open Web Chat window |
|
||||
| `moltbot://dashboard` | Open Dashboard in browser |
|
||||
| `moltbot://dashboard/sessions` | Open specific dashboard page |
|
||||
| `moltbot://send?message=Hello` | Open Quick Send with pre-filled text |
|
||||
| `moltbot://agent?message=Hello` | Send message directly (with confirmation) |
|
||||
| `openclaw://settings` | Open Settings dialog |
|
||||
| `openclaw://chat` | Open Web Chat window |
|
||||
| `openclaw://dashboard` | Open Dashboard in browser |
|
||||
| `openclaw://dashboard/sessions` | Open specific dashboard page |
|
||||
| `openclaw://send?message=Hello` | Open Quick Send with pre-filled text |
|
||||
| `openclaw://agent?message=Hello` | Send message directly (with confirmation) |
|
||||
|
||||
Deep links work even when Molty is already running - they're forwarded via IPC.
|
||||
|
||||
## 📦 Moltbot.CommandPalette
|
||||
## 📦 OpenClaw.CommandPalette
|
||||
|
||||
PowerToys Command Palette extension for quick Moltbot access.
|
||||
PowerToys Command Palette extension for quick OpenClaw access.
|
||||
|
||||
### Commands
|
||||
- **🦞 Open Dashboard** - Launch web dashboard
|
||||
@ -125,13 +125,13 @@ PowerToys Command Palette extension for quick Moltbot access.
|
||||
1. Build the solution in Release mode
|
||||
2. Deploy the MSIX package via Visual Studio
|
||||
3. Open Command Palette (Win+Alt+Space)
|
||||
4. Type "Moltbot" to see commands
|
||||
4. Type "OpenClaw" to see commands
|
||||
|
||||
## 📦 Moltbot.Shared
|
||||
## 📦 OpenClaw.Shared
|
||||
|
||||
Shared library containing:
|
||||
- `MoltbotGatewayClient` - WebSocket client for gateway protocol
|
||||
- `IMoltbotLogger` - Logging interface
|
||||
- `OpenClawGatewayClient` - WebSocket client for gateway protocol
|
||||
- `IOpenClawLogger` - Logging interface
|
||||
- Data models (SessionInfo, ChannelHealth, etc.)
|
||||
- Channel control (start/stop channels via gateway)
|
||||
|
||||
@ -141,9 +141,9 @@ Shared library containing:
|
||||
```
|
||||
moltbot-windows-hub/
|
||||
├── src/
|
||||
│ ├── Moltbot.Shared/ # Shared gateway library
|
||||
│ ├── Moltbot.Tray/ # System tray app
|
||||
│ └── Moltbot.CommandPalette/ # PowerToys extension
|
||||
│ ├── OpenClaw.Shared/ # Shared gateway library
|
||||
│ ├── OpenClaw.Tray/ # System tray app
|
||||
│ └── OpenClaw.CommandPalette/ # PowerToys extension
|
||||
├── docs/
|
||||
│ └── molty1.png # Screenshot
|
||||
├── moltbot-windows-hub.sln
|
||||
@ -155,8 +155,8 @@ moltbot-windows-hub/
|
||||
### Configuration
|
||||
|
||||
Settings are stored in:
|
||||
- Settings: `%APPDATA%\MoltbotTray\settings.json`
|
||||
- Logs: `%LOCALAPPDATA%\MoltbotTray\moltbot-tray.log`
|
||||
- Settings: `%APPDATA%\OpenClawTray\settings.json`
|
||||
- Logs: `%LOCALAPPDATA%\OpenClawTray\openclaw-tray.log`
|
||||
|
||||
Default gateway: `ws://localhost:18789`
|
||||
|
||||
@ -170,3 +170,7 @@ On first run without a token, Molty displays a welcome dialog that:
|
||||
## License
|
||||
|
||||
MIT License - see [LICENSE](LICENSE)
|
||||
|
||||
---
|
||||
|
||||
*Formerly known as Moltbot, formerly known as Clawdbot*
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
; Moltbot Tray Inno Setup Script (WinUI version)
|
||||
#define MyAppName "Moltbot Tray"
|
||||
; OpenClaw Tray Inno Setup Script (WinUI version)
|
||||
#define MyAppName "OpenClaw Tray"
|
||||
#define MyAppPublisher "Scott Hanselman"
|
||||
#define MyAppURL "https://github.com/shanselman/moltbot-windows-hub"
|
||||
#define MyAppExeName "Moltbot.Tray.WinUI.exe"
|
||||
#define MyAppExeName "OpenClaw.Tray.WinUI.exe"
|
||||
|
||||
; MyAppArch should be passed via /DMyAppArch=x64 or /DMyAppArch=arm64
|
||||
#ifndef MyAppArch
|
||||
@ -17,15 +17,15 @@ AppPublisher={#MyAppPublisher}
|
||||
AppPublisherURL={#MyAppURL}
|
||||
AppSupportURL=https://github.com/shanselman/moltbot-windows-hub/issues
|
||||
AppUpdatesURL=https://github.com/shanselman/moltbot-windows-hub/releases
|
||||
DefaultDirName={localappdata}\MoltbotTray
|
||||
DefaultDirName={localappdata}\OpenClawTray
|
||||
DefaultGroupName={#MyAppName}
|
||||
DisableProgramGroupPage=yes
|
||||
OutputBaseFilename=MoltbotTray-Setup-{#MyAppArch}
|
||||
OutputBaseFilename=OpenClawTray-Setup-{#MyAppArch}
|
||||
Compression=lzma
|
||||
SolidCompression=yes
|
||||
WizardStyle=modern
|
||||
PrivilegesRequired=lowest
|
||||
SetupIconFile=src\Moltbot.Tray.WinUI\Assets\moltbot.ico
|
||||
SetupIconFile=src\OpenClaw.Tray.WinUI\Assets\openclaw.ico
|
||||
UninstallDisplayIcon={app}\{#MyAppExeName}
|
||||
#if MyAppArch == "arm64"
|
||||
ArchitecturesInstallIn64BitMode=arm64
|
||||
@ -45,7 +45,7 @@ Name: "english"; MessagesFile: "compiler:Default.isl"
|
||||
|
||||
[Tasks]
|
||||
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
|
||||
Name: "startupicon"; Description: "Start Moltbot Tray when Windows starts"; GroupDescription: "Startup:"; Flags: unchecked
|
||||
Name: "startupicon"; Description: "Start OpenClaw Tray when Windows starts"; GroupDescription: "Startup:"; Flags: unchecked
|
||||
Name: "cmdpalette"; Description: "Install PowerToys Command Palette extension"; GroupDescription: "Integrations:"; Flags: unchecked
|
||||
|
||||
[Files]
|
||||
@ -67,4 +67,4 @@ Filename: "powershell.exe"; Parameters: "-ExecutionPolicy Bypass -Command ""Add-
|
||||
|
||||
[UninstallRun]
|
||||
; Unregister Command Palette extension on uninstall
|
||||
Filename: "powershell.exe"; Parameters: "-ExecutionPolicy Bypass -Command ""Get-AppxPackage -Name '*Moltbot*' | Remove-AppxPackage"""; Flags: runhidden
|
||||
Filename: "powershell.exe"; Parameters: "-ExecutionPolicy Bypass -Command ""Get-AppxPackage -Name '*OpenClaw*' | Remove-AppxPackage"""; Flags: runhidden
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
<Solution>
|
||||
<Folder Name="/src/">
|
||||
<Project Path="src/Moltbot.CommandPalette/Moltbot.CommandPalette.csproj">
|
||||
<Project Path="src/OpenClaw.CommandPalette/OpenClaw.CommandPalette.csproj">
|
||||
<Platform Project="x64" />
|
||||
</Project>
|
||||
<Project Path="src/Moltbot.Shared/Moltbot.Shared.csproj" />
|
||||
<Project Path="src/Moltbot.Tray/Moltbot.Tray.csproj" />
|
||||
<Project Path="src/Moltbot.Tray.WinUI/Moltbot.Tray.WinUI.csproj" />
|
||||
<Project Path="src/OpenClaw.Shared/OpenClaw.Shared.csproj" />
|
||||
<Project Path="src/OpenClaw.Tray/OpenClaw.Tray.csproj" />
|
||||
<Project Path="src/OpenClaw.Tray.WinUI/OpenClaw.Tray.WinUI.csproj" />
|
||||
</Folder>
|
||||
</Solution>
|
||||
|
||||
|
Before Width: | Height: | Size: 454 B After Width: | Height: | Size: 454 B |
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 898 B After Width: | Height: | Size: 898 B |
|
Before Width: | Height: | Size: 291 B After Width: | Height: | Size: 291 B |
|
Before Width: | Height: | Size: 474 B After Width: | Height: | Size: 474 B |
@ -50,7 +50,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Moltbot.Shared\Moltbot.Shared.csproj" />
|
||||
<ProjectReference Include="..\OpenClaw.Shared\OpenClaw.Shared.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<!--
|
||||
@ -14,7 +14,7 @@ public sealed partial class Moltbot : IExtension, IDisposable
|
||||
{
|
||||
private readonly ManualResetEvent _extensionDisposedEvent;
|
||||
|
||||
private readonly MoltbotCommandsProvider _provider = new();
|
||||
private readonly OpenClawCommandsProvider _provider = new();
|
||||
|
||||
public Moltbot(ManualResetEvent extensionDisposedEvent)
|
||||
{
|
||||
@ -7,11 +7,11 @@ using Microsoft.CommandPalette.Extensions.Toolkit;
|
||||
|
||||
namespace Moltbot;
|
||||
|
||||
public partial class MoltbotCommandsProvider : CommandProvider
|
||||
public partial class OpenClawCommandsProvider : CommandProvider
|
||||
{
|
||||
private readonly ICommandItem[] _commands;
|
||||
|
||||
public MoltbotCommandsProvider()
|
||||
public OpenClawCommandsProvider()
|
||||
{
|
||||
DisplayName = "Moltbot";
|
||||
Icon = IconHelpers.FromRelativePath("Assets\\StoreLogo.png");
|
||||
@ -9,14 +9,14 @@
|
||||
IgnorableNamespaces="uap uap3 rescap">
|
||||
|
||||
<Identity
|
||||
Name="Moltbot"
|
||||
Name="OpenClaw"
|
||||
Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US"
|
||||
Version="0.0.1.0" />
|
||||
<!-- When you're ready to publish your extension, you'll need to change the
|
||||
Publisher= to match your own identity -->
|
||||
|
||||
<Properties>
|
||||
<DisplayName>Moltbot</DisplayName>
|
||||
<DisplayName>OpenClaw</DisplayName>
|
||||
<PublisherDisplayName>A Lone Developer</PublisherDisplayName>
|
||||
<Logo>Assets\StoreLogo.png</Logo>
|
||||
</Properties>
|
||||
@ -35,8 +35,8 @@
|
||||
Executable="$targetnametoken$.exe"
|
||||
EntryPoint="$targetentrypoint$">
|
||||
<uap:VisualElements
|
||||
DisplayName="Moltbot"
|
||||
Description="Moltbot"
|
||||
DisplayName="OpenClaw"
|
||||
Description="OpenClaw"
|
||||
BackgroundColor="transparent"
|
||||
AppListEntry="none"
|
||||
Square150x150Logo="Assets\Square150x150Logo.png"
|
||||
@ -47,8 +47,8 @@
|
||||
<Extensions>
|
||||
<com:Extension Category="windows.comServer">
|
||||
<com:ComServer>
|
||||
<com:ExeServer Executable="Moltbot.CommandPalette.exe" Arguments="-RegisterProcessAsComServer" DisplayName="Moltbot">
|
||||
<com:Class Id="b71e1e6d-20f4-4fd8-9d8e-cc5dc94ca8b5" DisplayName="Moltbot" />
|
||||
<com:ExeServer Executable="OpenClaw.CommandPalette.exe" Arguments="-RegisterProcessAsComServer" DisplayName="OpenClaw">
|
||||
<com:Class Id="b71e1e6d-20f4-4fd8-9d8e-cc5dc94ca8b5" DisplayName="OpenClaw" />
|
||||
</com:ExeServer>
|
||||
</com:ComServer>
|
||||
</com:Extension>
|
||||
@ -56,8 +56,8 @@
|
||||
<uap3:AppExtension Name="com.microsoft.commandpalette"
|
||||
Id="ID"
|
||||
PublicFolder="Public"
|
||||
DisplayName="Moltbot"
|
||||
Description="Moltbot">
|
||||
DisplayName="OpenClaw"
|
||||
Description="OpenClaw">
|
||||
<uap3:Properties>
|
||||
<CmdPalProvider>
|
||||
<Activation>
|
||||
@ -7,9 +7,9 @@ using Microsoft.CommandPalette.Extensions.Toolkit;
|
||||
|
||||
namespace Moltbot;
|
||||
|
||||
internal sealed partial class MoltbotPage : ListPage
|
||||
internal sealed partial class OpenClawPage : ListPage
|
||||
{
|
||||
public MoltbotPage()
|
||||
public OpenClawPage()
|
||||
{
|
||||
Icon = IconHelpers.FromRelativePath("Assets\\StoreLogo.png");
|
||||
Title = "Moltbot";
|
||||
@ -24,17 +24,17 @@ internal sealed partial class MoltbotPage : ListPage
|
||||
Title = "🦞 Open Dashboard",
|
||||
Subtitle = "Open Moltbot web dashboard"
|
||||
},
|
||||
new ListItem(new OpenUrlCommand("moltbot://chat"))
|
||||
new ListItem(new OpenUrlCommand("openclaw://chat"))
|
||||
{
|
||||
Title = "💬 Web Chat",
|
||||
Subtitle = "Open the Moltbot chat window"
|
||||
},
|
||||
new ListItem(new OpenUrlCommand("moltbot://send"))
|
||||
new ListItem(new OpenUrlCommand("openclaw://send"))
|
||||
{
|
||||
Title = "📝 Quick Send",
|
||||
Subtitle = "Send a message to Moltbot"
|
||||
},
|
||||
new ListItem(new OpenUrlCommand("moltbot://settings"))
|
||||
new ListItem(new OpenUrlCommand("openclaw://settings"))
|
||||
{
|
||||
Title = "⚙️ Settings",
|
||||
Subtitle = "Configure Moltbot Tray"
|
||||
@ -1,10 +1,10 @@
|
||||
{
|
||||
"profiles": {
|
||||
"Moltbot (Package)": {
|
||||
"OpenClaw (Package)": {
|
||||
"commandName": "MsixPackage",
|
||||
"doNotLaunchApp": true
|
||||
},
|
||||
"Moltbot (Unpackaged)": {
|
||||
"OpenClaw (Unpackaged)": {
|
||||
"commandName": "Project"
|
||||
}
|
||||
}
|
||||
@ -1,10 +1,10 @@
|
||||
namespace Moltbot.Shared;
|
||||
namespace OpenClaw.Shared;
|
||||
|
||||
/// <summary>
|
||||
/// Simple logger interface for the gateway client.
|
||||
/// Implementations can write to file, console, debug output, etc.
|
||||
/// </summary>
|
||||
public interface IMoltbotLogger
|
||||
public interface IOpenClawLogger
|
||||
{
|
||||
void Info(string message);
|
||||
void Warn(string message);
|
||||
@ -14,7 +14,7 @@ public interface IMoltbotLogger
|
||||
/// <summary>
|
||||
/// Default no-op logger for when logging isn't needed.
|
||||
/// </summary>
|
||||
public class NullLogger : IMoltbotLogger
|
||||
public class NullLogger : IOpenClawLogger
|
||||
{
|
||||
public static readonly NullLogger Instance = new();
|
||||
public void Info(string message) { }
|
||||
@ -25,7 +25,7 @@ public class NullLogger : IMoltbotLogger
|
||||
/// <summary>
|
||||
/// Console logger for simple debugging.
|
||||
/// </summary>
|
||||
public class ConsoleLogger : IMoltbotLogger
|
||||
public class ConsoleLogger : IOpenClawLogger
|
||||
{
|
||||
public void Info(string message) => Console.WriteLine($"[INFO] {message}");
|
||||
public void Warn(string message) => Console.WriteLine($"[WARN] {message}");
|
||||
@ -1,4 +1,4 @@
|
||||
namespace Moltbot.Shared;
|
||||
namespace OpenClaw.Shared;
|
||||
|
||||
public enum ConnectionStatus
|
||||
{
|
||||
@ -50,7 +50,7 @@ public class AgentActivity
|
||||
: $"{(IsMain ? "Main" : "Sub")} · {Glyph} {Label}";
|
||||
}
|
||||
|
||||
public class MoltbotNotification
|
||||
public class OpenClawNotification
|
||||
{
|
||||
public string Title { get; set; } = "";
|
||||
public string Message { get; set; } = "";
|
||||
@ -7,14 +7,14 @@ using System.Text.Json;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Moltbot.Shared;
|
||||
namespace OpenClaw.Shared;
|
||||
|
||||
public class MoltbotGatewayClient : IDisposable
|
||||
public class OpenClawGatewayClient : IDisposable
|
||||
{
|
||||
private ClientWebSocket? _webSocket;
|
||||
private readonly string _gatewayUrl;
|
||||
private readonly string _token;
|
||||
private readonly IMoltbotLogger _logger;
|
||||
private readonly IOpenClawLogger _logger;
|
||||
private CancellationTokenSource _cts;
|
||||
private bool _disposed;
|
||||
private int _reconnectAttempts;
|
||||
@ -26,13 +26,13 @@ public class MoltbotGatewayClient : IDisposable
|
||||
|
||||
// Events
|
||||
public event EventHandler<ConnectionStatus>? StatusChanged;
|
||||
public event EventHandler<MoltbotNotification>? NotificationReceived;
|
||||
public event EventHandler<OpenClawNotification>? NotificationReceived;
|
||||
public event EventHandler<AgentActivity>? ActivityChanged;
|
||||
public event EventHandler<ChannelHealth[]>? ChannelHealthUpdated;
|
||||
public event EventHandler<SessionInfo[]>? SessionsUpdated;
|
||||
public event EventHandler<GatewayUsageInfo>? UsageUpdated;
|
||||
|
||||
public MoltbotGatewayClient(string gatewayUrl, string token, IMoltbotLogger? logger = null)
|
||||
public OpenClawGatewayClient(string gatewayUrl, string token, IOpenClawLogger? logger = null)
|
||||
{
|
||||
_gatewayUrl = gatewayUrl;
|
||||
_token = token;
|
||||
@ -840,7 +840,7 @@ public class MoltbotGatewayClient : IDisposable
|
||||
private void EmitNotification(string text)
|
||||
{
|
||||
var (title, type) = ClassifyNotification(text);
|
||||
NotificationReceived?.Invoke(this, new MoltbotNotification
|
||||
NotificationReceived?.Invoke(this, new OpenClawNotification
|
||||
{
|
||||
Title = title,
|
||||
Message = text.Length > 200 ? text[..200] + "…" : text,
|
||||
@ -1,11 +1,11 @@
|
||||
using Microsoft.Toolkit.Uwp.Notifications;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Moltbot.Shared;
|
||||
using MoltbotTray.Dialogs;
|
||||
using MoltbotTray.Helpers;
|
||||
using MoltbotTray.Services;
|
||||
using MoltbotTray.Windows;
|
||||
using OpenClaw.Shared;
|
||||
using OpenClawTray.Dialogs;
|
||||
using OpenClawTray.Helpers;
|
||||
using OpenClawTray.Services;
|
||||
using OpenClawTray.Windows;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
@ -31,7 +31,7 @@ public partial class App : Application
|
||||
};
|
||||
|
||||
private TrayIcon? _trayIcon;
|
||||
private MoltbotGatewayClient? _gatewayClient;
|
||||
private OpenClawGatewayClient? _gatewayClient;
|
||||
private SettingsManager? _settings;
|
||||
private GlobalHotkeyService? _globalHotkey;
|
||||
private System.Timers.Timer? _healthCheckTimer;
|
||||
@ -63,7 +63,7 @@ public partial class App : Application
|
||||
private string[]? _startupArgs;
|
||||
private static readonly string CrashLogPath = Path.Combine(
|
||||
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
|
||||
"MoltbotTray", "crash.log");
|
||||
"OpenClawTray", "crash.log");
|
||||
|
||||
public App()
|
||||
{
|
||||
@ -112,11 +112,11 @@ public partial class App : Application
|
||||
_dispatcherQueue = Microsoft.UI.Dispatching.DispatcherQueue.GetForCurrentThread();
|
||||
|
||||
// Single instance check - keep mutex alive for app lifetime
|
||||
_mutex = new Mutex(true, "MoltbotTray", out bool createdNew);
|
||||
_mutex = new Mutex(true, "OpenClawTray", out bool createdNew);
|
||||
if (!createdNew)
|
||||
{
|
||||
// Forward deep link args to running instance
|
||||
if (_startupArgs.Length > 1 && _startupArgs[1].StartsWith("moltbot://", StringComparison.OrdinalIgnoreCase))
|
||||
if (_startupArgs.Length > 1 && _startupArgs[1].StartsWith("openclaw://", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
SendDeepLinkToRunningInstance(_startupArgs[1]);
|
||||
}
|
||||
@ -168,7 +168,7 @@ public partial class App : Application
|
||||
}
|
||||
|
||||
// Process startup deep link
|
||||
if (_startupArgs.Length > 1 && _startupArgs[1].StartsWith("moltbot://", StringComparison.OrdinalIgnoreCase))
|
||||
if (_startupArgs.Length > 1 && _startupArgs[1].StartsWith("openclaw://", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
HandleDeepLink(_startupArgs[1]);
|
||||
}
|
||||
@ -545,7 +545,7 @@ public partial class App : Application
|
||||
// Unsubscribe from old client if exists
|
||||
UnsubscribeGatewayEvents();
|
||||
|
||||
_gatewayClient = new MoltbotGatewayClient(_settings.GatewayUrl, _settings.Token, new AppLogger());
|
||||
_gatewayClient = new OpenClawGatewayClient(_settings.GatewayUrl, _settings.Token, new AppLogger());
|
||||
_gatewayClient.StatusChanged += OnConnectionStatusChanged;
|
||||
_gatewayClient.ActivityChanged += OnActivityChanged;
|
||||
_gatewayClient.NotificationReceived += OnNotificationReceived;
|
||||
@ -628,7 +628,7 @@ public partial class App : Application
|
||||
_lastUsage = usage;
|
||||
}
|
||||
|
||||
private void OnNotificationReceived(object? sender, MoltbotNotification notification)
|
||||
private void OnNotificationReceived(object? sender, OpenClawNotification notification)
|
||||
{
|
||||
if (_settings?.ShowNotifications != true) return;
|
||||
if (!ShouldShowNotification(notification)) return;
|
||||
@ -656,7 +656,7 @@ public partial class App : Application
|
||||
}
|
||||
}
|
||||
|
||||
private bool ShouldShowNotification(MoltbotNotification notification)
|
||||
private bool ShouldShowNotification(OpenClawNotification notification)
|
||||
{
|
||||
if (_settings == null) return true;
|
||||
|
||||
@ -1144,7 +1144,7 @@ public partial class App : Application
|
||||
Microsoft.UI.Dispatching.DispatcherQueue.GetForCurrentThread();
|
||||
}
|
||||
|
||||
internal class AppLogger : IMoltbotLogger
|
||||
internal class AppLogger : IOpenClawLogger
|
||||
{
|
||||
public void Info(string message) => Logger.Info(message);
|
||||
public void Warn(string message) => Logger.Warn(message);
|
||||
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
@ -3,7 +3,7 @@ using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
using Updatum;
|
||||
|
||||
namespace MoltbotTray.Dialogs;
|
||||
namespace OpenClawTray.Dialogs;
|
||||
|
||||
public sealed class DownloadProgressDialog
|
||||
{
|
||||
@ -2,27 +2,27 @@ using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Input;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
using Moltbot.Shared;
|
||||
using MoltbotTray.Helpers;
|
||||
using MoltbotTray.Services;
|
||||
using OpenClaw.Shared;
|
||||
using OpenClawTray.Helpers;
|
||||
using OpenClawTray.Services;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using WinUIEx;
|
||||
|
||||
namespace MoltbotTray.Dialogs;
|
||||
namespace OpenClawTray.Dialogs;
|
||||
|
||||
/// <summary>
|
||||
/// Quick send dialog for sending messages to Moltbot.
|
||||
/// </summary>
|
||||
public sealed class QuickSendDialog : WindowEx
|
||||
{
|
||||
private readonly MoltbotGatewayClient _client;
|
||||
private readonly OpenClawGatewayClient _client;
|
||||
private readonly TextBox _messageTextBox;
|
||||
private readonly Button _sendButton;
|
||||
private readonly TextBlock _statusText;
|
||||
private bool _isSending;
|
||||
|
||||
public QuickSendDialog(MoltbotGatewayClient client, string? prefillMessage = null)
|
||||
public QuickSendDialog(OpenClawGatewayClient client, string? prefillMessage = null)
|
||||
{
|
||||
_client = client;
|
||||
|
||||
@ -4,7 +4,7 @@ using Microsoft.UI.Xaml.Media;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MoltbotTray.Dialogs;
|
||||
namespace OpenClawTray.Dialogs;
|
||||
|
||||
public enum UpdateDialogResult
|
||||
{
|
||||
@ -5,7 +5,7 @@ using System;
|
||||
using System.Threading.Tasks;
|
||||
using WinUIEx;
|
||||
|
||||
namespace MoltbotTray.Dialogs;
|
||||
namespace OpenClawTray.Dialogs;
|
||||
|
||||
/// <summary>
|
||||
/// First-run welcome dialog for new users.
|
||||
@ -3,7 +3,7 @@ using Microsoft.UI.Xaml;
|
||||
using System.Runtime.InteropServices;
|
||||
using WinRT;
|
||||
|
||||
namespace MoltbotTray.Helpers;
|
||||
namespace OpenClawTray.Helpers;
|
||||
|
||||
/// <summary>
|
||||
/// Helper class to apply Mica backdrop with IsInputActive always true.
|
||||
@ -1,10 +1,10 @@
|
||||
using Moltbot.Shared;
|
||||
using OpenClaw.Shared;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace MoltbotTray.Helpers;
|
||||
namespace OpenClawTray.Helpers;
|
||||
|
||||
/// <summary>
|
||||
/// Provides icon resources for the tray application.
|
||||
@ -2,7 +2,7 @@ using Microsoft.UI.Xaml;
|
||||
using Microsoft.Win32;
|
||||
using Windows.UI;
|
||||
|
||||
namespace MoltbotTray.Helpers;
|
||||
namespace OpenClawTray.Helpers;
|
||||
|
||||
/// <summary>
|
||||
/// Helpers for detecting and applying Windows theme (dark/light mode).
|
||||
@ -8,7 +8,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<WindowsPackageType>None</WindowsPackageType>
|
||||
<EnableMsixTooling>true</EnableMsixTooling>
|
||||
<ApplicationIcon>Assets\moltbot.ico</ApplicationIcon>
|
||||
<ApplicationIcon>Assets\openclaw.ico</ApplicationIcon>
|
||||
<RootNamespace>MoltbotTray</RootNamespace>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
</PropertyGroup>
|
||||
@ -19,7 +19,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Moltbot.Shared\Moltbot.Shared.csproj" />
|
||||
<ProjectReference Include="..\OpenClaw.Shared\OpenClaw.Shared.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@ -1,7 +1,7 @@
|
||||
using Microsoft.Win32;
|
||||
using System;
|
||||
|
||||
namespace MoltbotTray.Services;
|
||||
namespace OpenClawTray.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Manages Windows auto-start registry entries.
|
||||
@ -9,7 +9,7 @@ namespace MoltbotTray.Services;
|
||||
public static class AutoStartManager
|
||||
{
|
||||
private const string RegistryKey = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Run";
|
||||
private const string AppName = "MoltbotTray";
|
||||
private const string AppName = "OpenClawTray";
|
||||
|
||||
public static bool IsAutoStartEnabled()
|
||||
{
|
||||
@ -2,10 +2,10 @@ using Microsoft.Win32;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MoltbotTray.Services;
|
||||
namespace OpenClawTray.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Handles moltbot:// deep link URI scheme registration and processing.
|
||||
/// Handles openclaw:// deep link URI scheme registration and processing.
|
||||
/// </summary>
|
||||
public static class DeepLinkHandler
|
||||
{
|
||||
@ -28,7 +28,7 @@ public static class DeepLinkHandler
|
||||
using var commandKey = key?.CreateSubKey(@"shell\open\command");
|
||||
commandKey?.SetValue("", $"\"{exePath}\" \"%1\"");
|
||||
|
||||
Logger.Info("URI scheme registered: moltbot://");
|
||||
Logger.Info("URI scheme registered: openclaw://");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@ -38,10 +38,10 @@ public static class DeepLinkHandler
|
||||
|
||||
public static void Handle(string uri, DeepLinkActions actions)
|
||||
{
|
||||
if (!uri.StartsWith("moltbot://", StringComparison.OrdinalIgnoreCase))
|
||||
if (!uri.StartsWith("openclaw://", StringComparison.OrdinalIgnoreCase))
|
||||
return;
|
||||
|
||||
var path = uri["moltbot://".Length..].TrimEnd('/');
|
||||
var path = uri["openclaw://".Length..].TrimEnd('/');
|
||||
var queryIndex = path.IndexOf('?');
|
||||
var query = queryIndex >= 0 ? path[(queryIndex + 1)..] : "";
|
||||
path = queryIndex >= 0 ? path[..queryIndex] : path;
|
||||
@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace MoltbotTray.Services;
|
||||
namespace OpenClawTray.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Registers and handles global hotkeys using P/Invoke.
|
||||
@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace MoltbotTray.Services;
|
||||
namespace OpenClawTray.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Simple file logger for the tray application.
|
||||
@ -16,10 +16,10 @@ public static class Logger
|
||||
{
|
||||
_logDirectory = Path.Combine(
|
||||
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
|
||||
"MoltbotTray");
|
||||
"OpenClawTray");
|
||||
|
||||
Directory.CreateDirectory(_logDirectory);
|
||||
_logFilePath = Path.Combine(_logDirectory, "moltbot-tray.log");
|
||||
_logFilePath = Path.Combine(_logDirectory, "openclaw-tray.log");
|
||||
|
||||
// Rotate log if too large (> 5MB)
|
||||
try
|
||||
@ -27,7 +27,7 @@ public static class Logger
|
||||
var fileInfo = new FileInfo(_logFilePath);
|
||||
if (fileInfo.Exists && fileInfo.Length > 5 * 1024 * 1024)
|
||||
{
|
||||
var backupPath = Path.Combine(_logDirectory, "moltbot-tray.log.old");
|
||||
var backupPath = Path.Combine(_logDirectory, "openclaw-tray.log.old");
|
||||
if (File.Exists(backupPath)) File.Delete(backupPath);
|
||||
File.Move(_logFilePath, backupPath);
|
||||
}
|
||||
@ -2,7 +2,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace MoltbotTray.Services;
|
||||
namespace OpenClawTray.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Stores notification history in memory with a configurable limit.
|
||||
@ -2,7 +2,7 @@ using System;
|
||||
using System.IO;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace MoltbotTray.Services;
|
||||
namespace OpenClawTray.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Manages application settings with JSON persistence.
|
||||
@ -11,7 +11,7 @@ public class SettingsManager
|
||||
{
|
||||
private static readonly string SettingsDirectory = Path.Combine(
|
||||
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
|
||||
"MoltbotTray");
|
||||
"OpenClawTray");
|
||||
|
||||
private static readonly string SettingsFilePath = Path.Combine(SettingsDirectory, "settings.json");
|
||||
|
||||
@ -1,15 +1,15 @@
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Moltbot.Shared;
|
||||
using MoltbotTray.Helpers;
|
||||
using MoltbotTray.Services;
|
||||
using OpenClaw.Shared;
|
||||
using OpenClawTray.Helpers;
|
||||
using OpenClawTray.Services;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using WinUIEx;
|
||||
|
||||
namespace MoltbotTray.Windows;
|
||||
namespace OpenClawTray.Windows;
|
||||
|
||||
public sealed partial class NotificationHistoryWindow : WindowEx
|
||||
{
|
||||
@ -1,13 +1,13 @@
|
||||
using Microsoft.Toolkit.Uwp.Notifications;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Moltbot.Shared;
|
||||
using MoltbotTray.Helpers;
|
||||
using MoltbotTray.Services;
|
||||
using OpenClaw.Shared;
|
||||
using OpenClawTray.Helpers;
|
||||
using OpenClawTray.Services;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using WinUIEx;
|
||||
|
||||
namespace MoltbotTray.Windows;
|
||||
namespace OpenClawTray.Windows;
|
||||
|
||||
public sealed partial class SettingsWindow : WindowEx
|
||||
{
|
||||
@ -96,7 +96,7 @@ public sealed partial class SettingsWindow : WindowEx
|
||||
|
||||
try
|
||||
{
|
||||
var client = new MoltbotGatewayClient(
|
||||
var client = new OpenClawGatewayClient(
|
||||
GatewayUrlTextBox.Text.Trim(),
|
||||
TokenTextBox.Text.Trim(),
|
||||
new TestLogger());
|
||||
@ -166,7 +166,7 @@ public sealed partial class SettingsWindow : WindowEx
|
||||
Close();
|
||||
}
|
||||
|
||||
private class TestLogger : IMoltbotLogger
|
||||
private class TestLogger : IOpenClawLogger
|
||||
{
|
||||
public void Info(string message) { }
|
||||
public void Warn(string message) { }
|
||||
@ -1,15 +1,15 @@
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
using Microsoft.UI;
|
||||
using Moltbot.Shared;
|
||||
using MoltbotTray.Helpers;
|
||||
using OpenClaw.Shared;
|
||||
using OpenClawTray.Helpers;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using WinUIEx;
|
||||
using Windows.UI;
|
||||
|
||||
namespace MoltbotTray.Windows;
|
||||
namespace OpenClawTray.Windows;
|
||||
|
||||
public sealed partial class StatusDetailWindow : WindowEx
|
||||
{
|
||||
@ -1,12 +1,12 @@
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Input;
|
||||
using MoltbotTray.Helpers;
|
||||
using OpenClawTray.Helpers;
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using WinUIEx;
|
||||
|
||||
namespace MoltbotTray.Windows;
|
||||
namespace OpenClawTray.Windows;
|
||||
|
||||
/// <summary>
|
||||
/// A popup window that displays the tray menu at the cursor position.
|
||||
@ -1,8 +1,8 @@
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.Web.WebView2.Core;
|
||||
using Moltbot.Shared;
|
||||
using MoltbotTray.Helpers;
|
||||
using MoltbotTray.Services;
|
||||
using OpenClaw.Shared;
|
||||
using OpenClawTray.Helpers;
|
||||
using OpenClawTray.Services;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
@ -10,7 +10,7 @@ using System.Threading.Tasks;
|
||||
using WinUIEx;
|
||||
using Windows.Foundation;
|
||||
|
||||
namespace MoltbotTray.Windows;
|
||||
namespace OpenClawTray.Windows;
|
||||
|
||||
public sealed partial class WebChatWindow : WindowEx
|
||||
{
|
||||
@ -64,7 +64,7 @@ public sealed partial class WebChatWindow : WindowEx
|
||||
// Set up user data folder via environment variable (WinUI 3 workaround)
|
||||
var userDataFolder = Path.Combine(
|
||||
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
|
||||
"MoltbotTray", "WebView2");
|
||||
"OpenClawTray", "WebView2");
|
||||
|
||||
Directory.CreateDirectory(userDataFolder);
|
||||
Environment.SetEnvironmentVariable("WEBVIEW2_USER_DATA_FOLDER", userDataFolder);
|
||||
@ -9,7 +9,7 @@ namespace MoltbotTray;
|
||||
public static class AutoStartManager
|
||||
{
|
||||
private const string RegistryKeyPath = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Run";
|
||||
private const string ApplicationName = "MoltbotTray";
|
||||
private const string ApplicationName = "OpenClawTray";
|
||||
|
||||
public static void SetAutoStart(bool enabled)
|
||||
{
|
||||
@ -1,5 +1,5 @@
|
||||
using Microsoft.Win32;
|
||||
using Moltbot.Shared;
|
||||
using OpenClaw.Shared;
|
||||
using System;
|
||||
using System.Collections.Specialized;
|
||||
using System.Threading.Tasks;
|
||||
@ -9,8 +9,8 @@ using System.Windows.Forms;
|
||||
namespace MoltbotTray;
|
||||
|
||||
/// <summary>
|
||||
/// Handles moltbot:// URI scheme registration and processing.
|
||||
/// Matches macOS deep link support (moltbot://agent?message=...)
|
||||
/// Handles openclaw:// URI scheme registration and processing.
|
||||
/// Matches macOS deep link support (openclaw://agent?message=...)
|
||||
/// </summary>
|
||||
public static class DeepLinkHandler
|
||||
{
|
||||
@ -18,7 +18,7 @@ public static class DeepLinkHandler
|
||||
private const string FriendlyName = "Moltbot Agent Command";
|
||||
|
||||
/// <summary>
|
||||
/// Registers the moltbot:// URI scheme in the Windows registry.
|
||||
/// Registers the openclaw:// URI scheme in the Windows registry.
|
||||
/// Requires elevation for HKCR, falls back to HKCU.
|
||||
/// </summary>
|
||||
public static void RegisterUriScheme()
|
||||
@ -72,15 +72,15 @@ public static class DeepLinkHandler
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Processes a moltbot:// deep link.
|
||||
/// Processes a openclaw:// deep link.
|
||||
/// Supports:
|
||||
/// moltbot://agent?message=...
|
||||
/// moltbot://send?message=... (opens Quick Send with pre-filled text)
|
||||
/// moltbot://dashboard
|
||||
/// moltbot://chat
|
||||
/// moltbot://settings
|
||||
/// openclaw://agent?message=...
|
||||
/// openclaw://send?message=... (opens Quick Send with pre-filled text)
|
||||
/// openclaw://dashboard
|
||||
/// openclaw://chat
|
||||
/// openclaw://settings
|
||||
/// </summary>
|
||||
public static async Task ProcessDeepLinkAsync(Uri uri, MoltbotGatewayClient client, Action<string>? openDashboard = null, Action? openChat = null, Action? openSettings = null, Action<string>? openQuickSend = null)
|
||||
public static async Task ProcessDeepLinkAsync(Uri uri, OpenClawGatewayClient client, Action<string>? openDashboard = null, Action? openChat = null, Action? openSettings = null, Action<string>? openQuickSend = null)
|
||||
{
|
||||
Logger.Info($"Processing deep link: {uri}");
|
||||
|
||||
@ -111,7 +111,7 @@ public static class DeepLinkHandler
|
||||
}
|
||||
}
|
||||
|
||||
private static async Task HandleAgentDeepLinkAsync(NameValueCollection query, MoltbotGatewayClient client)
|
||||
private static async Task HandleAgentDeepLinkAsync(NameValueCollection query, OpenClawGatewayClient client)
|
||||
{
|
||||
var message = query["message"];
|
||||
if (string.IsNullOrWhiteSpace(message))
|
||||
@ -1,26 +1,26 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using Moltbot.Shared;
|
||||
using OpenClaw.Shared;
|
||||
|
||||
namespace MoltbotTray;
|
||||
|
||||
/// <summary>
|
||||
/// Simple file + debug logger for troubleshooting.
|
||||
/// Writes to %LOCALAPPDATA%\MoltbotTray\moltbot-tray.log
|
||||
/// Writes to %LOCALAPPDATA%\MoltbotTray\openclaw-tray.log
|
||||
/// </summary>
|
||||
public static class Logger
|
||||
{
|
||||
private static readonly string LogDir = Path.Combine(
|
||||
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
|
||||
"MoltbotTray");
|
||||
private static readonly string LogPath = Path.Combine(LogDir, "moltbot-tray.log");
|
||||
"OpenClawTray");
|
||||
private static readonly string LogPath = Path.Combine(LogDir, "openclaw-tray.log");
|
||||
private static readonly object Lock = new();
|
||||
private static bool _initialized;
|
||||
private static StreamWriter? _writer;
|
||||
|
||||
/// <summary>Get a logger instance that implements IMoltbotLogger for the shared library.</summary>
|
||||
public static IMoltbotLogger Instance { get; } = new LoggerAdapter();
|
||||
/// <summary>Get a logger instance that implements IOpenClawLogger for the shared library.</summary>
|
||||
public static IOpenClawLogger Instance { get; } = new LoggerAdapter();
|
||||
|
||||
public static void Info(string message) => Write("INFO", message);
|
||||
public static void Warn(string message) => Write("WARN", message);
|
||||
@ -89,8 +89,8 @@ public static class Logger
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Adapter to make the static Logger work with IMoltbotLogger interface.</summary>
|
||||
private class LoggerAdapter : IMoltbotLogger
|
||||
/// <summary>Adapter to make the static Logger work with IOpenClawLogger interface.</summary>
|
||||
private class LoggerAdapter : IOpenClawLogger
|
||||
{
|
||||
public void Info(string message) => Logger.Info(message);
|
||||
public void Warn(string message) => Logger.Warn(message);
|
||||
@ -8,7 +8,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<EnableWindowsTargeting>true</EnableWindowsTargeting>
|
||||
<NoWarn>MSB3277</NoWarn>
|
||||
<ApplicationIcon>moltbot.ico</ApplicationIcon>
|
||||
<ApplicationIcon>openclaw.ico</ApplicationIcon>
|
||||
<AssemblyTitle>Moltbot Windows Tray</AssemblyTitle>
|
||||
<AssemblyDescription>Windows system tray companion app for Moltbot</AssemblyDescription>
|
||||
<AssemblyCompany>Scott Hanselman</AssemblyCompany>
|
||||
@ -23,7 +23,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Moltbot.Shared\Moltbot.Shared.csproj" />
|
||||
<ProjectReference Include="..\OpenClaw.Shared\OpenClaw.Shared.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@ -23,11 +23,11 @@ internal static class Program
|
||||
static void Main(string[] args)
|
||||
{
|
||||
// Single instance check
|
||||
using var mutex = new Mutex(true, "MoltbotTray", out bool createdNew);
|
||||
using var mutex = new Mutex(true, "OpenClawTray", out bool createdNew);
|
||||
if (!createdNew)
|
||||
{
|
||||
// Forward deep link args to running instance via named pipe
|
||||
if (args.Length > 0 && args[0].StartsWith("moltbot://", StringComparison.OrdinalIgnoreCase))
|
||||
if (args.Length > 0 && args[0].StartsWith("openclaw://", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
SendDeepLinkToRunningInstance(args[0]);
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
# Moltbot Windows Tray
|
||||
|
||||
A Windows system tray companion for [Moltbot](https://github.com/Moltbot/Moltbot) — the Windows equivalent of the macOS menu bar app. Provides desktop notifications, embedded chat, live agent activity monitoring, and gateway status tracking.
|
||||
A Windows system tray companion for [OpenClaw](https://moltbot.com) — the Windows equivalent of the macOS menu bar app. Provides desktop notifications, embedded chat, live agent activity monitoring, and gateway status tracking.
|
||||
|
||||
## Features
|
||||
|
||||
@ -91,7 +91,7 @@ A Windows system tray companion for [Moltbot](https://github.com/Moltbot/Moltbot
|
||||
|
||||
```bash
|
||||
# In WSL2:
|
||||
cat ~/.Moltbot/Moltbot.json | grep token
|
||||
cat ~/.Moltbot/OpenClaw.json | grep token
|
||||
# Or:
|
||||
Moltbot config get gateway.auth.token
|
||||
```
|
||||
@ -122,7 +122,7 @@ dotnet build -p:EnableWindowsTargeting=true -r win-x64
|
||||
```
|
||||
├── Program.cs # Entry point, single instance, deep link registration
|
||||
├── TrayApplication.cs # Tray icon, menu, event wiring, UI updates
|
||||
├── MoltbotGatewayClient.cs # WebSocket client, protocol v3, event parsing, state tracking
|
||||
├── OpenClawGatewayClient.cs # WebSocket client, protocol v3, event parsing, state tracking
|
||||
├── WebChatForm.cs # WebView2 chat panel (singleton, dark mode)
|
||||
├── QuickSendDialog.cs # Quick message input (Enter to send, TopMost)
|
||||
├── StatusDetailForm.cs # Rich status detail view (dark theme)
|
||||
@ -138,7 +138,7 @@ dotnet build -p:EnableWindowsTargeting=true -r win-x64
|
||||
|
||||
## macOS Parity Status
|
||||
|
||||
This Windows tray app aims for feature parity with the [Moltbot macOS menu bar app](https://github.com/Moltbot/Moltbot-macos).
|
||||
This Windows tray app aims for feature parity with the [Moltbot macOS menu bar app](https://moltbot.com-macos).
|
||||
|
||||
| Feature | macOS | Windows | Notes |
|
||||
|---------|:-----:|:-------:|-------|
|
||||
@ -196,7 +196,7 @@ Settings are stored in `%APPDATA%\MoltbotTray\settings.json`:
|
||||
|
||||
**Can't connect?**
|
||||
- Check gateway: `Moltbot gateway status` in WSL2
|
||||
- Verify token matches `~/.Moltbot/Moltbot.json`
|
||||
- Verify token matches `~/.Moltbot/OpenClaw.json`
|
||||
- Try WSL2 IP directly: `ws://<wsl-ip>:18789` (`wsl hostname -I`)
|
||||
|
||||
**No notifications?**
|
||||
@ -222,5 +222,5 @@ MIT
|
||||
|
||||
- Built with .NET 10, Windows Forms, and [WebView2](https://developer.microsoft.com/en-us/microsoft-edge/webview2/)
|
||||
- Toast notifications via [Microsoft.Toolkit.Uwp.Notifications](https://github.com/CommunityToolkit/WindowsCommunityToolkit)
|
||||
- Part of the [Moltbot](https://github.com/Moltbot/Moltbot) ecosystem
|
||||
- Part of the [Moltbot](https://moltbot.com) ecosystem
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
using Microsoft.Toolkit.Uwp.Notifications;
|
||||
using Moltbot.Shared;
|
||||
using OpenClaw.Shared;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
@ -282,7 +282,7 @@ public partial class SettingsDialog : ModernForm
|
||||
|
||||
try
|
||||
{
|
||||
var testClient = new MoltbotGatewayClient(
|
||||
var testClient = new OpenClawGatewayClient(
|
||||
_gatewayUrlTextBox.Text.Trim(),
|
||||
_tokenTextBox.Text.Trim());
|
||||
|
||||
@ -9,7 +9,7 @@ public class SettingsManager
|
||||
{
|
||||
private static readonly string SettingsDirectory = Path.Combine(
|
||||
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
|
||||
"MoltbotTray");
|
||||
"OpenClawTray");
|
||||
|
||||
private static readonly string SettingsFile = Path.Combine(SettingsDirectory, "settings.json");
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
using Moltbot.Shared;
|
||||
using OpenClaw.Shared;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
@ -14,13 +14,13 @@ public class StatusDetailForm : ModernForm
|
||||
private RichTextBox _textBox = null!;
|
||||
private Button _refreshButton = null!;
|
||||
private Button _closeButton = null!;
|
||||
private readonly MoltbotGatewayClient? _client;
|
||||
private readonly OpenClawGatewayClient? _client;
|
||||
private readonly SettingsManager? _settings;
|
||||
private readonly ConnectionStatus _status;
|
||||
|
||||
private static StatusDetailForm? _instance;
|
||||
|
||||
public static void ShowOrFocus(MoltbotGatewayClient? client, SettingsManager? settings, ConnectionStatus status)
|
||||
public static void ShowOrFocus(OpenClawGatewayClient? client, SettingsManager? settings, ConnectionStatus status)
|
||||
{
|
||||
if (_instance != null && !_instance.IsDisposed)
|
||||
{
|
||||
@ -33,7 +33,7 @@ public class StatusDetailForm : ModernForm
|
||||
_instance.Show();
|
||||
}
|
||||
|
||||
private StatusDetailForm(MoltbotGatewayClient? client, SettingsManager? settings, ConnectionStatus status)
|
||||
private StatusDetailForm(OpenClawGatewayClient? client, SettingsManager? settings, ConnectionStatus status)
|
||||
{
|
||||
_client = client;
|
||||
_settings = settings;
|
||||
@ -1,5 +1,5 @@
|
||||
using Microsoft.Toolkit.Uwp.Notifications;
|
||||
using Moltbot.Shared;
|
||||
using OpenClaw.Shared;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
@ -18,7 +18,7 @@ public class TrayApplication : ApplicationContext
|
||||
private NotifyIcon? _notifyIcon;
|
||||
private ContextMenuStrip? _contextMenu;
|
||||
private ModernTrayMenu? _modernMenu;
|
||||
private MoltbotGatewayClient? _gatewayClient;
|
||||
private OpenClawGatewayClient? _gatewayClient;
|
||||
private SettingsManager? _settings;
|
||||
private System.Windows.Forms.Timer? _healthCheckTimer;
|
||||
private System.Windows.Forms.Timer? _sessionPollTimer;
|
||||
@ -398,7 +398,7 @@ public class TrayApplication : ApplicationContext
|
||||
{
|
||||
try
|
||||
{
|
||||
_gatewayClient = new MoltbotGatewayClient(_settings!.GatewayUrl, _settings.Token, Logger.Instance);
|
||||
_gatewayClient = new OpenClawGatewayClient(_settings!.GatewayUrl, _settings.Token, Logger.Instance);
|
||||
_gatewayClient.StatusChanged += OnStatusChanged;
|
||||
_gatewayClient.NotificationReceived += OnNotificationReceived;
|
||||
_gatewayClient.ActivityChanged += OnActivityChanged;
|
||||
@ -469,7 +469,7 @@ public class TrayApplication : ApplicationContext
|
||||
_syncContext?.Post(_ => UpdateStatus(status), null);
|
||||
}
|
||||
|
||||
private void OnNotificationReceived(object? sender, MoltbotNotification n)
|
||||
private void OnNotificationReceived(object? sender, OpenClawNotification n)
|
||||
{
|
||||
_syncContext?.Post(_ => ShowNotificationToast(n.Title, n.Message, n.Type), null);
|
||||
}
|
||||
@ -1062,8 +1062,8 @@ public class TrayApplication : ApplicationContext
|
||||
{
|
||||
var logDir = System.IO.Path.Combine(
|
||||
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
|
||||
"MoltbotTray");
|
||||
var logPath = System.IO.Path.Combine(logDir, "moltbot-tray.log");
|
||||
"OpenClawTray");
|
||||
var logPath = System.IO.Path.Combine(logDir, "openclaw-tray.log");
|
||||
|
||||
if (System.IO.File.Exists(logPath))
|
||||
{
|
||||
@ -1090,7 +1090,7 @@ public class TrayApplication : ApplicationContext
|
||||
_gatewayClient.Dispose();
|
||||
}
|
||||
|
||||
_gatewayClient = new MoltbotGatewayClient(_settings!.GatewayUrl, _settings.Token, Logger.Instance);
|
||||
_gatewayClient = new OpenClawGatewayClient(_settings!.GatewayUrl, _settings.Token, Logger.Instance);
|
||||
_gatewayClient.StatusChanged += OnStatusChanged;
|
||||
_gatewayClient.NotificationReceived += OnNotificationReceived;
|
||||
_gatewayClient.ActivityChanged += OnActivityChanged;
|
||||
@ -122,7 +122,7 @@ public class WebChatForm : ModernForm
|
||||
{
|
||||
var userDataDir = Path.Combine(
|
||||
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
|
||||
"MoltbotTray", "WebView2");
|
||||
"OpenClawTray", "WebView2");
|
||||
|
||||
var env = await CoreWebView2Environment.CreateAsync(userDataFolder: userDataDir);
|
||||
await _webView!.EnsureCoreWebView2Async(env);
|
||||
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
@ -1,7 +1,7 @@
|
||||
using Xunit;
|
||||
using Moltbot.Shared;
|
||||
using OpenClaw.Shared;
|
||||
|
||||
namespace Moltbot.Shared.Tests;
|
||||
namespace OpenClaw.Shared.Tests;
|
||||
|
||||
public class AgentActivityTests
|
||||
{
|
||||
@ -19,7 +19,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\src\Moltbot.Shared\Moltbot.Shared.csproj" />
|
||||
<ProjectReference Include="..\..\src\OpenClaw.Shared\OpenClaw.Shared.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@ -2,25 +2,25 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Xunit;
|
||||
using Moltbot.Shared;
|
||||
using OpenClaw.Shared;
|
||||
|
||||
namespace Moltbot.Shared.Tests;
|
||||
namespace OpenClaw.Shared.Tests;
|
||||
|
||||
public class MoltbotGatewayClientTests
|
||||
public class OpenClawGatewayClientTests
|
||||
{
|
||||
// Test helper to access private methods through reflection
|
||||
private class GatewayClientTestHelper
|
||||
{
|
||||
private readonly MoltbotGatewayClient _client;
|
||||
private readonly OpenClawGatewayClient _client;
|
||||
|
||||
public GatewayClientTestHelper()
|
||||
{
|
||||
_client = new MoltbotGatewayClient("ws://localhost:18789", "test-token", new TestLogger());
|
||||
_client = new OpenClawGatewayClient("ws://localhost:18789", "test-token", new TestLogger());
|
||||
}
|
||||
|
||||
public string ClassifyNotification(string text)
|
||||
{
|
||||
var method = typeof(MoltbotGatewayClient).GetMethod("ClassifyNotification",
|
||||
var method = typeof(OpenClawGatewayClient).GetMethod("ClassifyNotification",
|
||||
System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static);
|
||||
var result = method!.Invoke(null, new object[] { text });
|
||||
var tuple = ((string title, string type))result!;
|
||||
@ -29,7 +29,7 @@ public class MoltbotGatewayClientTests
|
||||
|
||||
public string GetNotificationTitle(string text)
|
||||
{
|
||||
var method = typeof(MoltbotGatewayClient).GetMethod("ClassifyNotification",
|
||||
var method = typeof(OpenClawGatewayClient).GetMethod("ClassifyNotification",
|
||||
System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static);
|
||||
var result = method!.Invoke(null, new object[] { text });
|
||||
var tuple = ((string title, string type))result!;
|
||||
@ -38,7 +38,7 @@ public class MoltbotGatewayClientTests
|
||||
|
||||
public ActivityKind ClassifyTool(string toolName)
|
||||
{
|
||||
var method = typeof(MoltbotGatewayClient).GetMethod("ClassifyTool",
|
||||
var method = typeof(OpenClawGatewayClient).GetMethod("ClassifyTool",
|
||||
System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static);
|
||||
var result = method!.Invoke(null, new object[] { toolName });
|
||||
return (ActivityKind)result!;
|
||||
@ -46,7 +46,7 @@ public class MoltbotGatewayClientTests
|
||||
|
||||
public string ShortenPath(string path)
|
||||
{
|
||||
var method = typeof(MoltbotGatewayClient).GetMethod("ShortenPath",
|
||||
var method = typeof(OpenClawGatewayClient).GetMethod("ShortenPath",
|
||||
System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static);
|
||||
var result = method!.Invoke(null, new object[] { path });
|
||||
return (string)result!;
|
||||
@ -54,7 +54,7 @@ public class MoltbotGatewayClientTests
|
||||
|
||||
public string TruncateLabel(string text, int maxLen = 60)
|
||||
{
|
||||
var method = typeof(MoltbotGatewayClient).GetMethod("TruncateLabel",
|
||||
var method = typeof(OpenClawGatewayClient).GetMethod("TruncateLabel",
|
||||
System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static);
|
||||
var result = method!.Invoke(null, new object[] { text, maxLen });
|
||||
return (string)result!;
|
||||
@ -66,7 +66,7 @@ public class MoltbotGatewayClientTests
|
||||
}
|
||||
}
|
||||
|
||||
private class TestLogger : IMoltbotLogger
|
||||
private class TestLogger : IOpenClawLogger
|
||||
{
|
||||
public List<string> Logs { get; } = new();
|
||||
|
||||
@ -323,7 +323,7 @@ public class MoltbotGatewayClientTests
|
||||
public void Constructor_InitializesWithProvidedValues()
|
||||
{
|
||||
var logger = new TestLogger();
|
||||
var client = new MoltbotGatewayClient("ws://test:8080", "my-token", logger);
|
||||
var client = new OpenClawGatewayClient("ws://test:8080", "my-token", logger);
|
||||
|
||||
// Should not throw
|
||||
Assert.NotNull(client);
|
||||
@ -332,7 +332,7 @@ public class MoltbotGatewayClientTests
|
||||
[Fact]
|
||||
public void Constructor_UsesNullLogger_WhenNotProvided()
|
||||
{
|
||||
var client = new MoltbotGatewayClient("ws://test:8080", "my-token");
|
||||
var client = new OpenClawGatewayClient("ws://test:8080", "my-token");
|
||||
|
||||
// Should not throw
|
||||
Assert.NotNull(client);
|
||||
@ -1,10 +1,10 @@
|
||||
# Moltbot.Shared.Tests
|
||||
# OpenClaw.Shared.Tests
|
||||
|
||||
Unit test suite for the Moltbot.Shared library.
|
||||
Unit test suite for the OpenClaw.Shared library.
|
||||
|
||||
## Overview
|
||||
|
||||
This test project provides comprehensive coverage of the Moltbot.Shared library, focusing on:
|
||||
This test project provides comprehensive coverage of the OpenClaw.Shared library, focusing on:
|
||||
- Data model display text generation
|
||||
- Gateway client utility methods
|
||||
- Notification classification
|
||||
@ -59,7 +59,7 @@ dotnet test --filter "FullyQualifiedName~AgentActivityTests"
|
||||
- ✅ Combined field formatting
|
||||
- ✅ Empty state ("No usage data")
|
||||
|
||||
### MoltbotGatewayClientTests.cs (20 tests)
|
||||
### OpenClawGatewayClientTests.cs (20 tests)
|
||||
|
||||
#### Notification Classification (11 tests)
|
||||
- ✅ Health alerts (blood sugar, glucose, CGM, mg/dl)
|
||||
@ -141,7 +141,7 @@ Some functionality is Windows-only (Tray app, PowerToys extension), but the Shar
|
||||
|
||||
## Contributing
|
||||
|
||||
When adding new functionality to `Moltbot.Shared`:
|
||||
When adding new functionality to `OpenClaw.Shared`:
|
||||
1. Add corresponding unit tests
|
||||
2. Ensure tests are cross-platform compatible
|
||||
3. Test edge cases (empty strings, null values, very long inputs)
|
||||
@ -151,7 +151,7 @@ When adding new functionality to `Moltbot.Shared`:
|
||||
|
||||
- xUnit 2.9.3 - Test framework
|
||||
- .NET 9.0 - Runtime
|
||||
- Moltbot.Shared library
|
||||
- OpenClaw.Shared library
|
||||
|
||||
## License
|
||||
|
||||
@ -9,7 +9,7 @@ param(
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$RepoRoot = Split-Path -Parent $PSScriptRoot
|
||||
$ProjectPath = "$RepoRoot\src\Moltbot.CommandPalette"
|
||||
$ProjectPath = "$RepoRoot\src\OpenClaw.CommandPalette"
|
||||
|
||||
# Detect architecture
|
||||
$Arch = if ([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture -eq 'Arm64') { 'arm64' } else { 'x64' }
|
||||
@ -18,7 +18,7 @@ $OutputPath = "$ProjectPath\bin\$Arch\Debug\net10.0-windows10.0.26100.0\win-$Arc
|
||||
function Write-Step($msg) { Write-Host "`n>> $msg" -ForegroundColor Cyan }
|
||||
|
||||
function Get-InstalledPackage {
|
||||
Get-AppxPackage -Name "*Moltbot*" 2>$null
|
||||
Get-AppxPackage -Name "*OpenClaw*" 2>$null
|
||||
}
|
||||
|
||||
function Remove-ExtensionPackage {
|
||||
@ -35,7 +35,7 @@ function Remove-ExtensionPackage {
|
||||
function Build-Extension {
|
||||
Write-Step "Building Command Palette ($Arch)..."
|
||||
Push-Location $RepoRoot
|
||||
dotnet build src/Moltbot.CommandPalette -c Debug -p:Platform=$Arch
|
||||
dotnet build src/OpenClaw.CommandPalette -c Debug -p:Platform=$Arch
|
||||
if ($LASTEXITCODE -ne 0) { throw "Build failed" }
|
||||
Pop-Location
|
||||
Write-Host "Build succeeded!" -ForegroundColor Green
|
||||
@ -51,7 +51,7 @@ function Deploy-Extension {
|
||||
|
||||
# Register for development (loose files, no MSIX needed)
|
||||
Add-AppxPackage -Register $manifest -ForceApplicationShutdown
|
||||
Write-Host "Deployed! Open Command Palette, type 'Reload', then 'Moltbot'" -ForegroundColor Green
|
||||
Write-Host "Deployed! Open Command Palette, type 'Reload', then 'OpenClaw'" -ForegroundColor Green
|
||||
}
|
||||
|
||||
function Show-Status {
|
||||
@ -76,6 +76,6 @@ switch ($Action) {
|
||||
Remove-ExtensionPackage
|
||||
Build-Extension
|
||||
Deploy-Extension
|
||||
Write-Host "`n=== In Command Palette: type 'Reload' then 'Moltbot' ===" -ForegroundColor Magenta
|
||||
Write-Host "`n=== In Command Palette: type 'Reload' then 'OpenClaw' ===" -ForegroundColor Magenta
|
||||
}
|
||||
}
|
||||
|
||||