Skip to content
Open

Next ai #2402

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
81639e3
Initialize agents project
TheHadiAhmadi Nov 5, 2025
5df2735
Add AI Agent Management plugin with OpenRouter integration
pournasserian Nov 7, 2025
5e682a4
Merge branch 'next' of https://github.com/fluentcms/FluentCMS into ne…
TheHadiAhmadi Nov 8, 2025
d6d5de3
Add form components
TheHadiAhmadi Nov 8, 2025
1e50142
Merge commit '81639e38' into next-ai
TheHadiAhmadi Nov 9, 2025
f47ee02
first api call worked
TheHadiAhmadi Nov 9, 2025
d77eab9
add thread test page
TheHadiAhmadi Nov 9, 2025
0e41ca9
Add CRUD for Threads and Agents
TheHadiAhmadi Nov 11, 2025
0fa98f6
Initialize admin project
TheHadiAhmadi Nov 17, 2025
e2eb045
update styles
TheHadiAhmadi Nov 17, 2025
ec678f8
Update UI
TheHadiAhmadi Nov 18, 2025
a7c27ef
Update role
TheHadiAhmadi Nov 19, 2025
94b4ee8
Update api client usage
TheHadiAhmadi Nov 20, 2025
fab3036
Add pages
TheHadiAhmadi Nov 20, 2025
908fd53
Add Page and layout CRUD
TheHadiAhmadi Nov 22, 2025
63000cb
Update ui of site/page/layout cruds
TheHadiAhmadi Nov 23, 2025
fa22b44
Add Folder management UI
TheHadiAhmadi Nov 28, 2025
68f4c67
Implement File upload, file move and file delete
TheHadiAhmadi Nov 29, 2025
57a3f47
Add GetRoot and GetById apis in frontend
TheHadiAhmadi Nov 29, 2025
8f9f1f9
Add file and folder move
TheHadiAhmadi Dec 1, 2025
095d991
fix file move
TheHadiAhmadi Dec 1, 2025
691e76d
add site id for entities
TheHadiAhmadi Dec 3, 2025
e708f61
Merge branch 'next' into next-ai
TheHadiAhmadi Dec 4, 2025
82c002e
cleanuP
TheHadiAhmadi Dec 4, 2025
5c3a121
Merge branch 'next-ai' of https://github.com/fluentcms/FluentCMS into…
TheHadiAhmadi Dec 6, 2025
96447d0
fix profile page
TheHadiAhmadi Dec 6, 2025
3da187b
Update styles
TheHadiAhmadi Dec 6, 2025
6a76942
Cleanup
TheHadiAhmadi Dec 8, 2025
19792ba
Update design
TheHadiAhmadi Dec 9, 2025
729d4ed
Cleanup and format
TheHadiAhmadi Dec 10, 2025
0de315c
Update
TheHadiAhmadi Dec 11, 2025
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
21 changes: 21 additions & 0 deletions src/Api/Core/FluentCMS.Api.Core.Events/Block.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
namespace FluentCMS.Api.Core.Events;

public class BlockAddedEvent(Block block) : EventBase
{
public Block Block { get; } = block;
}

public class BlockUpdatedEvent(Block block) : EventBase
{
public Block Block { get; } = block;
}

public class BlockRemovedEvent(Block block) : EventBase
{
public Block Block { get; } = block;
}

public class BlocksRemovedBySiteEvent(IEnumerable<Block> blocks) : EventBase
{
public IEnumerable<Block> Block { get; } = blocks;
}
16 changes: 16 additions & 0 deletions src/Api/Core/FluentCMS.Api.Core.Events/Page.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace FluentCMS.Api.Core.Events;

public class PageAddedEvent(Page page) : EventBase
{
public Page Page { get; } = page;
}

public class PageUpdatedEvent(Page page) : EventBase
{
public Page Page { get; } = page;
}

public class PageRemovedEvent(Page page) : EventBase
{
public Page Page { get; } = page;
}
9 changes: 9 additions & 0 deletions src/Api/Core/FluentCMS.Api.Core.Models/Block.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace FluentCMS.Api.Core.Models;

public class Block : SiteAssociatedEntity
{
public string Name { get; set; } = string.Empty;
public string Category { get; set; } = string.Empty;
public string? Description { get; set; }
public string Content { get; set; } = string.Empty;
}
1 change: 1 addition & 0 deletions src/Api/Core/FluentCMS.Api.Core.Models/File.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ public class File : SiteAssociatedEntity
public string Name { get; set; } = default!;
public string NormalizedName { get; set; } = default!;
public Guid FolderId { get; set; }
public Guid SiteId { get; set; }
public string Extension { get; set; } = default!;
public string ContentType { get; set; } = default!;
public long Size { get; set; }
Expand Down
13 changes: 12 additions & 1 deletion src/Api/Core/FluentCMS.Api.Core.Models/Folder.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
namespace FluentCMS.Api.Core.Models;
using System.Text.Json.Serialization;

namespace FluentCMS.Api.Core.Models;

public class Folder : SiteAssociatedEntity
{
public string Name { get; set; } = default!;
public string NormalizedName { get; set; } = default!;
public Guid SiteId { get; set; }
public Guid? ParentId { get; set; }
public long Size { get; set; }

public ICollection<File> Files { get; set; } = new List<File>();
public ICollection<Folder> Folders { get; set; } = new List<Folder>();


[JsonIgnore]
public Folder? ParentFolder { get; set; } = default!;
}
3 changes: 1 addition & 2 deletions src/Api/Core/FluentCMS.Api.Core.Models/Identity/Role.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace FluentCMS.Api.Core.Models.Identity;

public class Role : IdentityRole<Guid>, ISiteAssociatedEntity
public class Role : IdentityRole<Guid>, IEntity
{
public string Description { get; set; } = string.Empty;

Expand All @@ -12,7 +12,6 @@ public class Role : IdentityRole<Guid>, ISiteAssociatedEntity
public string? UpdatedBy { get; set; }
public DateTime? UpdatedAt { get; set; }
public int Version { get; set; }
public Guid SiteId { get; set; }

public Role()
{
Expand Down
3 changes: 1 addition & 2 deletions src/Api/Core/FluentCMS.Api.Core.Models/Identity/UserRole.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace FluentCMS.Api.Core.Models.Identity;

public class UserRole : IdentityUserRole<Guid>, ISiteAssociatedEntity
public class UserRole : IdentityUserRole<Guid>
{
// IAuditableEntity implementations
public Guid Id { get; set; }
Expand All @@ -9,5 +9,4 @@ public class UserRole : IdentityUserRole<Guid>, ISiteAssociatedEntity
public string? UpdatedBy { get; set; }
public DateTime? UpdatedAt { get; set; }
public int Version { get; set; }
public Guid SiteId { get; set; }
}
1 change: 1 addition & 0 deletions src/Api/Core/FluentCMS.Api.Core.Models/Layout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

public class Layout : SiteAssociatedEntity
{
public Guid SiteId { get; set; }
public string Name { get; set; } = default!;
public string Body { get; set; } = default!;
public string Head { get; set; } = default!;
Expand Down
15 changes: 11 additions & 4 deletions src/Api/Core/FluentCMS.Api.Core.Models/Page.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,18 @@
public class Page : SiteAssociatedEntity
{
public string Title { get; set; } = string.Empty;
public Guid? ParentId { get; set; }
public string Slug { get; set; } = string.Empty;
public int Order { get; set; }
public string Path { get; set; } = string.Empty; // URL path, only one segment without forward slash (/)
public Guid SiteId { get; set; }
public Guid? ParentId { get; set; }
public Guid? LayoutId { get; set; }
public Guid? EditLayoutId { get; set; }
public Guid? DetailLayoutId { get; set; }
public bool Locked { get; set; } = false;
}
public string? MetaTitle { get; set; }
public string? MetaDescription { get; set; }
public bool? RobotsIndex { get; set; }
public bool? RobotsFollow { get; set; }
public string? OgType { get; set; }
public string? Head { get; set; }
// public bool Locked { get; set; } = false;
}
16 changes: 12 additions & 4 deletions src/Api/Core/FluentCMS.Api.Core.Models/Site.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,17 @@
public class Site : AuditableEntity
{
public string Name { get; set; } = default!;
public string? Description { get; set; }
public List<string> Urls { get; set; } = [];
public Guid LayoutId { get; set; }
public Guid DetailLayoutId { get; set; }
public Guid EditLayoutId { get; set; }
public string? Description { get; set; }
public Guid? LayoutId { get; set; }
public Guid? DetailLayoutId { get; set; }
public Guid? EditLayoutId { get; set; }
public string? MetaTitle { get; set; }
public string? MetaDescription { get; set; }
public bool? RobotsIndex { get; set; }
public bool? RobotsFollow { get; set; }
public string? RobotsTxt { get; set; }
public string? GoogleTagsId { get; set; }
public string? OgType { get; set; }
public string? Head { get; set; }
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ public static class ServiceCollectionExtensions
public static IServiceCollection AddEntityFrameworkRpositories(this IServiceCollection services)
{
services.AddScoped<IApiTokenRepository, ApiTokenRepository>();
services.AddScoped<IFileRepository, FileRepository>();
services.AddScoped<IFolderRepository, FolderRepository>();
services.AddScoped<ILayoutRepository, LayoutRepository>();
services.AddScoped<IPageRepository, PageRepository>();
services.AddScoped<IPermissionRepository, PermissionRepository>();
services.AddScoped<IPluginDefinitionRepository, PluginDefinitionRepository>();
services.AddScoped<IPluginRepository, PluginRepository>();
Expand Down
1 change: 1 addition & 0 deletions src/Api/FluentCMS.Api/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
files
1 change: 1 addition & 0 deletions src/Api/FluentCMS.Api/FluentCMS.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<ProjectReference Include="..\..\Infrastructure\Providers\FluentCMS.Infrastructure.Providers\FluentCMS.Infrastructure.Providers.csproj" />
<ProjectReference Include="..\..\Infrastructure\Repositories\FluentCMS.Infrastructure.Repositories.EntityFramework.Sqlite\FluentCMS.Infrastructure.Repositories.EntityFramework.Sqlite.csproj" />
<ProjectReference Include="..\Core\FluentCMS.Api.Core.Repositories.EntityFramework\FluentCMS.Api.Core.Repositories.EntityFramework.csproj" />
<ProjectReference Include="..\Plugins\FluentCMS.Api.Plugins.AIAgentManagement\FluentCMS.Api.Plugins.AIAgentManagement.csproj" />
<ProjectReference Include="..\Plugins\FluentCMS.Api.Plugins.AuditTrailManagement\FluentCMS.Api.Plugins.AuditTrailManagement.csproj" />
<ProjectReference Include="..\Plugins\FluentCMS.Api.Plugins.CmsCoreManagement\FluentCMS.Api.Plugins.CmsCoreManagement.csproj" />
<ProjectReference Include="..\Plugins\FluentCMS.Api.Plugins.IdentityManagement\FluentCMS.Api.Plugins.IdentityManagement.csproj" />
Expand Down
17 changes: 16 additions & 1 deletion src/Api/FluentCMS.Api/Program.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using FluentCMS.Api.Core.Filters;
using FluentCMS.Api.Core.Repositories.EntityFramework;
using FluentCMS.Api.Plugins.TodoManagement.Repositories;
using FluentCMS.Api.Plugins.AIAgentManagement.Repositories;
using FluentCMS.Infrastructure.Configuration.EntityFramework;
using FluentCMS.Infrastructure.Configuration.EntityFramework.Sqlite;
using FluentCMS.Infrastructure.EventBus.InMemory;
Expand Down Expand Up @@ -54,6 +55,20 @@
validationOptions.IgnoreExceptions = false; // Fail fast on errors
validationOptions.Conditions.Add(new EnvironmentCondition(builder.Environment, e => e.IsDevelopment()));
});

// Specific database for Agent library
options.For<IAIAgentDatabaseMarker>()
.UseSqlite("DataSource=agent.db;Cache=Shared")
.EnableDataSeeding(seedingOptions =>
{
seedingOptions.IgnoreExceptions = false; // Fail fast on errors
seedingOptions.Conditions.Add(new EnvironmentCondition(builder.Environment, e => e.IsDevelopment()));
})
.EnableSchemaValidation(validationOptions =>
{
validationOptions.IgnoreExceptions = false; // Fail fast on errors
validationOptions.Conditions.Add(new EnvironmentCondition(builder.Environment, e => e.IsDevelopment()));
});
});

services.AddDbConfiguration();
Expand All @@ -72,7 +87,7 @@
// Add plugin system
services.AddPluginSystem(builder.Configuration, options =>
{
options.ScanAssemblyPatterns = ["FluentCMS.*"];
options.ScanAssemblyPatterns = ["FluentCMS.Api.Plugins.*"];
options.LoggerFactory = loggerFactory;
});

Expand Down
7 changes: 7 additions & 0 deletions src/Api/FluentCMS.Api/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
"ConnectionStrings": {
"DefaultConnection": "DataSource=app.db;Cache=Shared"
},
"OpenRouter": {
"ApiKey": "",
"Model": "openai/gpt-4.1-nano",
"AttributionReferer": "https://fluentcms.com",
"AttributionTitle": "FluentCMS",
"IncludeStandardReferrerHeader": true
},
"Providers": {
"Caching": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
namespace FluentCMS.Api.Plugins.AIAgentManagement;

[Plugin]
public class AIAgentPlugin : IPluginStartup
{
public void Configure(IApplicationBuilder app)
{
}

public void ConfigureServices(IServiceCollection services, IConfiguration? configuration)
{
services.AddDatabaseContext<AIDbContext, IAIAgentDatabaseMarker>();
services.AddDataSeeder<AgentDataSeeder, IAIAgentDatabaseMarker>();
services.AddSchemaValidator<AgentSchemaValidator, IAIAgentDatabaseMarker>();
services.AddScoped<Tools>();
services.AddScoped<IAgentRepository, AgentRepository>();
services.AddScoped<IThreadRepository, ThreadRepository>();
services.AddOpenRouterChatClient(configuration);
}
}
Loading