Compare commits

..
14 Commits
Author SHA1 Message Date
darmanandClaude Opus 5 9f1e62fdbf Remove hardcoded secrets; source credentials from configuration
The Telegram bot token was a const in AddChannels(), and the Mistral API
key was baked into the embedded Provider.Mistral.toml resource.

- Wire AddChannels() through the existing (previously unused)
  AddTelegramOptions(), which binds "Channels:Telegram" and validates on
  start. TelegramOptions is resolved from IOptions<> so TelegramAdapter
  and TelegramChannel are unchanged.
- Ship the embedded provider defaults with an empty ApiKey. Ollama's
  placeholder is now a non-secret literal.
- Re-apply AddEnvironmentVariables() last in AddLunaConfiguration() so
  env vars override the TOML sources; without this the embedded defaults
  would shadow injected credentials.

Credentials are now supplied via Providers__Mistral__ApiKey and
Channels__Telegram__BotToken, or via ~/.luna/providers/*.toml overrides.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-29 07:59:05 +02:00
darman 2a07e07180 Add user identity system with channel pairing and web /link command
Introduce Luna.Identity project with user identity service, pairing code
generation, and channel linking. Channels (Telegram, CLI) now verify link
status before routing messages and prompt users to pair via the web
interface. WebChannel handles /link <channel-type> <code> commands to
complete the pairing flow.

Fix inverted expiration check in IsPairingCodeExpired that caused codes
to be treated as expired immediately after creation.
2026-04-04 16:09:10 +02:00
darman 3138436965 Fixed some warnings 2026-04-04 05:01:51 +02:00
darman 6d6b2c1166 Added .env to .gitignore & removed redundant Luna.sln 2026-04-04 04:59:59 +02:00
darman 9929941748 Add project documentation and reference materials
Include Luna AI Assistant design docs covering channels, configuration,
core architecture, memory, scheduler, and skills. Add reference docs
from OpenClaw and ZeroClaw projects, plus Mistral and OpenAI API specs.
2026-04-04 04:14:06 +02:00
darman 969e4d6e37 Add React/TypeScript web interface with Chakra UI and SignalR integration
Implement web frontend using Vite + React + TypeScript with:
- Chakra UI component library for theming and styling
- SignalR bridge (lunaBridge) for real-time server communication
- Chat components (ChatPanel, ChatInput, ChatMessage)
- Layout components (AppLayout, Sidebar, StatusBar, SystemPanel)
- Custom useChat hook for conversation state management
- Dark/light theme support via ColorModeProvider
- Mock conversation data for development
2026-04-04 04:13:51 +02:00
darman 1d7ae158a4 Add CLI client application with SignalR connectivity
Implement standalone CLI client that connects to Luna.Core via SignalR
for interactive chat sessions. Includes ChatClientService for managing
the hub connection and streaming responses, with a hosted service
architecture using Microsoft.Extensions.Hosting.
2026-04-04 04:12:41 +02:00
darman f21d55d87d Add channel system unit and integration tests
Comprehensive NUnit test suite covering ChannelManager, CliChannel,
TelegramChannel, DI registration, and integration scenarios. Uses
Moq for mocking with test stubs for isolated unit testing.
2026-04-04 04:12:24 +02:00
darman 9a05bae4a9 Add channel system with CLI, Telegram, and Web channel implementations
Define channel abstractions (IChannel, IChannelManager) with event-driven
message and connection handling. Implement ChannelManager for multi-channel
orchestration, CliChannel for terminal I/O, TelegramChannel with adapter
pattern for bot API integration, and WebChannel stub. Includes DI
registration and channel type enumeration.
2026-04-04 04:12:11 +02:00
darman dd35e1dea6 Add Luna.Memory with SQLite-backed persistent memory store
Implement IMemoryStore interface and MemoryStore using EF Core with
SQLite for conversation and knowledge persistence. Includes DI
service registration extensions.
2026-04-04 04:11:08 +02:00
darman 2f5841a1b9 Add Luna.Core server with SignalR hub, session management, and tool system
Implement the core application server as an ASP.NET web host with:
- SignalR ChatHub for real-time client communication
- Session management with token estimation for context windowing
- Extensible tool system with attribute-based tool discovery
- Chat stream update builder for streaming AI responses
- App configuration with appsettings for development and production
2026-04-04 04:10:58 +02:00
darman 29eb3851c9 Add agent system with Core and Librarian agent implementations
Define IAgent interface and implement CoreAgent (main conversational
agent) and LibrarianAgent (knowledge retrieval agent). Includes DI
service collection extensions for agent registration.
2026-04-04 04:10:51 +02:00
darman 1c42c8c006 Add provider abstraction layer with Mistral and Ollama implementations
Define IProvider interface and implement concrete providers for Mistral
(with custom DTOs for chat completion API) and Ollama (via OllamaSharp).
Includes DI registration extensions using Microsoft.Extensions.AI.
2026-04-04 04:10:39 +02:00
darman a4ed65e452 Add Luna.Configuration with TOML-based agent and provider config
Implement configuration system with embedded TOML resources for agent
and provider definitions, custom IConfigurationSource/Provider for
agent and provider options, and DI extension methods. Includes config
models for agents, providers, sessions, and Telegram integration.
2026-04-04 04:09:57 +02:00
5 changed files with 16 additions and 10 deletions
@@ -1,25 +1,27 @@
using Luna.Channels.Abstractions;
using Luna.Channels.Telegram;
using Luna.Configuration;
using Luna.Configuration.Extensions;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Telegram.Bot;
namespace Luna.Channels.Extensions;
public static class ServiceCollectionExtensions
{
private const string TelegramBotToken = "8778257521:AAEt0ML88u2zx5AdZCi7XNKC1MhdngyCHJI";
extension(IServiceCollection services)
{
public IServiceCollection AddChannels()
{
services.AddSingleton<IChannelManager, ChannelManager>();
// Telegram
var telegramOptions = new TelegramOptions { BotToken = TelegramBotToken };
services.AddSingleton(telegramOptions);
services.AddSingleton<ITelegramBotClient>(_ => new TelegramBotClient(TelegramBotToken));
// Telegram — BotToken is bound from configuration ("Channels:Telegram"),
// supplied via the Channels__Telegram__BotToken environment variable.
services.AddTelegramOptions();
services.AddSingleton(provider => provider.GetRequiredService<IOptions<TelegramOptions>>().Value);
services.AddSingleton<ITelegramBotClient>(provider =>
new TelegramBotClient(provider.GetRequiredService<TelegramOptions>().BotToken));
services.AddHostedService<TelegramAdapter>();
return services;
@@ -34,6 +34,11 @@ public static class ConfigurationBuilderExtensions
builder.Add(new ProviderOptionsConfigurationSource(searchPath));
}
// Re-applied last so environment variables take precedence over the TOML
// sources above. This is how secrets (API keys, bot tokens) are supplied —
// the embedded defaults ship with empty credentials.
builder.AddEnvironmentVariables();
return builder;
}
}
@@ -7,6 +7,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="10.0.5" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.5" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="10.0.5" />
<PackageReference Include="Microsoft.Extensions.Options" Version="10.0.5" />
@@ -1,5 +1,4 @@
ApiKey = "1nv151T9Qd2Vi5p3PMrvNDQ3DIDDVmGy"
ApiKey = ""
ApiUrl = "https://api.mistral.ai/v1/"
Models = ["mistral-small-latest"]
@@ -1,5 +1,4 @@
ApiKey = "apfelkuchen"
ApiKey = "ollama"
ApiUrl = "http://localhost:11434/"
Models = ["mistral-nemo:12b"]