Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: CI

on:
push:
branches: [ master, main, feature/** ]
pull_request:
branches: [ master, main ]
workflow_dispatch:

env:
DOTNET_VERSION: '10.0.x'

jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --configuration Release --no-restore

- name: Test
run: dotnet test --configuration Release --no-build --verbosity normal

- name: Format Check
run: dotnet format --verify-no-changes --verbosity diagnostic
continue-on-error: true

pack-interfaces:
needs: build-and-test
runs-on: ubuntu-latest
strategy:
matrix:
project:
- Clawleash.Interfaces.WebRTC
- Clawleash.Interfaces.WebSocket
- Clawleash.Interfaces.Discord
- Clawleash.Interfaces.Slack
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-

- name: Restore dependencies
run: dotnet restore ${{ matrix.project }}/${{ matrix.project }}.csproj

- name: Pack
run: dotnet pack ${{ matrix.project }}/${{ matrix.project }}.csproj --configuration Release --output ./artifacts

- name: Upload package
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.project }}-package
path: artifacts/*.nupkg
retention-days: 7
if-no-files-found: ignore
50 changes: 50 additions & 0 deletions Clawleash.Interfaces.Slack/SlackChatInterface.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Collections.Concurrent;
using System.Text;
using System.Text.Json;
using System.Text.Json.Serialization;
using Clawleash.Abstractions.Services;
using Microsoft.Extensions.Logging;

Expand Down Expand Up @@ -538,78 +539,127 @@ private class ChannelInfo

internal class AuthTestResponse
{
[JsonPropertyName("ok")]
public bool Ok { get; set; }

[JsonPropertyName("user_id")]
public string? UserId { get; set; }

[JsonPropertyName("user")]
public string? User { get; set; }

[JsonPropertyName("team")]
public string? Team { get; set; }

[JsonPropertyName("error")]
public string? Error { get; set; }
}

internal class ChannelInfoResponse
{
[JsonPropertyName("ok")]
public bool Ok { get; set; }

public SlackChannelInfo? Channel { get; set; }
}

internal class SlackChannelInfo
{
[JsonPropertyName("id")]
public string Id { get; set; } = string.Empty;

[JsonPropertyName("name")]
public string Name { get; set; } = string.Empty;

[JsonPropertyName("is_private")]
public bool IsPrivate { get; set; }
}

internal class ConversationsHistoryResponse
{
[JsonPropertyName("ok")]
public bool Ok { get; set; }

public List<SlackMessage>? Messages { get; set; }
}

internal class SlackMessage
{
[JsonPropertyName("ts")]
public string Ts { get; set; } = string.Empty;

[JsonPropertyName("user")]
public string User { get; set; } = string.Empty;

[JsonPropertyName("text")]
public string Text { get; set; } = string.Empty;

[JsonPropertyName("thread_ts")]
public string? ThreadTs { get; set; }

[JsonPropertyName("subtype")]
public string? Subtype { get; set; }

[JsonPropertyName("bot_id")]
public string? BotId { get; set; }
}

internal class UserInfoResponse
{
[JsonPropertyName("ok")]
public bool Ok { get; set; }

public SlackUser? User { get; set; }
}

internal class SlackUser
{
[JsonPropertyName("id")]
public string Id { get; set; } = string.Empty;

[JsonPropertyName("name")]
public string Name { get; set; } = string.Empty;

public SlackUserProfile? Profile { get; set; }
}

internal class SlackUserProfile
{
[JsonPropertyName("display_name")]
public string? DisplayName { get; set; }

[JsonPropertyName("real_name")]
public string? RealName { get; set; }
}

internal class PostMessageResponse
{
[JsonPropertyName("ok")]
public bool Ok { get; set; }

[JsonPropertyName("ts")]
public string? Ts { get; set; }

[JsonPropertyName("error")]
public string? Error { get; set; }
}

internal class ImOpenResponse
{
[JsonPropertyName("ok")]
public bool Ok { get; set; }

public SlackChannelInfo? Channel { get; set; }

[JsonPropertyName("error")]
public string? Error { get; set; }
}

internal class ChannelsListResponse
{
[JsonPropertyName("ok")]
public bool Ok { get; set; }

public List<SlackChannelInfo>? Channels { get; set; }
}

Expand Down
32 changes: 32 additions & 0 deletions Clawleash.Interfaces.WebRTC/Clawleash.Interfaces.WebRTC.csproj
Original file line number Diff line number Diff line change
@@ -1,18 +1,50 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<!-- Target Framework -->
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>Clawleash.Interfaces.WebRTC</RootNamespace>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>

<!-- NuGet Package Metadata -->
<PackageId>Clawleash.Interfaces.WebRTC</PackageId>
<Version>0.1.0</Version>
<Authors>Clawleash</Authors>
<Description>WebRTC chat interface for Clawleash with native P2P communication support</Description>
<PackageTags>webrtc;p2p;chat;realtime;signalr;datachannel</PackageTags>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<RepositoryUrl>https://github.com/yourname/clowleash</RepositoryUrl>
<RepositoryType>git</RepositoryType>

<!-- NuGet Package Settings -->
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>

<!-- Native library embed settings -->
<EnableDynamicLoading>true</EnableDynamicLoading>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Clawleash.Abstractions\Clawleash.Abstractions.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Lucid.Rtc" Version="0.1.4" />
<PackageReference Include="Lucid.Rtc.Rust.All" Version="0.1.4" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="10.0.3" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
</ItemGroup>

<!-- README for NuGet -->
<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="" Condition="Exists('README.md')" />
</ItemGroup>

</Project>
Loading