From 8739f8770a341ef79ad32410c958904377ca8252edc91b44354b03d42287cf0b Mon Sep 17 00:00:00 2001 From: Alphaeus Mote Date: Thu, 22 Oct 2026 20:26:51 -0400 Subject: [PATCH 01/72] build: pin patched System.Security.Cryptography.Pkcs/Xml (NU1902/NU1903) New advisories against the transitive 9.0.4/10.0.10 crypto packages turned the NuGet audit into a hard build failure under TreatWarningsAsErrors. Co-Authored-By: Claude Opus 5.5 --- Directory.Packages.props | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 9747d33..9e19478 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -6,7 +6,8 @@ - + + -- 2.52.0 From 0e2173fa96119aff5b430eb3c3330d1fb55b0e9b59de41500552e5ed7b3f8b7b Mon Sep 17 00:00:00 2001 From: Alphaeus Mote Date: Thu, 22 Oct 2026 20:37:34 -0400 Subject: [PATCH 02/72] feat(automation): edit, run now and preview schedules; named triggers - PUT /api/triggers/{id} edits a trigger in place (script, target, cadence, arguments, name) instead of delete-and-recreate. - POST /api/triggers/{id}/run fires a trigger now against its current target as one execution, leaving its cadence and enabled state alone. - POST /api/triggers/preview returns the next N fire times, evaluated server-side in the schedule's time zone (DST-aware). - Triggers carry an optional Name and the LastRunId of their last firing so the UI can drill straight into that execution. - Validation: bad time zones are reported as such (not as a cron error), enabled one-shots in the past are refused, never-firing crons rejected. - Device-scoped roles can only aim triggers inside their scope (a visible device or a group whose members they can all see; never "all devices"). - Event triggers now pass their captured arguments (they were dropped). - The sweep and run-now share TriggerExecutor; trigger changes are audited under a new "automation" category; deleting a trigger drops its once-per-device run records. Co-Authored-By: Claude Opus 5.5 --- src/Backend/Data/Entities.cs | 5 + ...03329_AddTriggerNameAndLastRun.Designer.cs | 739 ++++++++++++++++++ ...20261023003329_AddTriggerNameAndLastRun.cs | 39 + .../PostgresAppDbContextModelSnapshot.cs | 6 + ...03341_AddTriggerNameAndLastRun.Designer.cs | 739 ++++++++++++++++++ ...20261023003341_AddTriggerNameAndLastRun.cs | 39 + .../SqlServerAppDbContextModelSnapshot.cs | 6 + ...03317_AddTriggerNameAndLastRun.Designer.cs | 726 +++++++++++++++++ ...20261023003317_AddTriggerNameAndLastRun.cs | 39 + .../Sqlite/SqliteAppDbContextModelSnapshot.cs | 6 + src/Backend/Groups/ScriptTriggerService.cs | 2 +- src/Backend/Groups/TriggerEndpoints.cs | 303 +++++-- src/Backend/Jobs/ScheduleCron.cs | 6 + src/Backend/Jobs/ScheduleWorker.cs | 103 +-- src/Backend/Jobs/TriggerExecutor.cs | 120 +++ src/Backend/Program.cs | 1 + src/Backend/Security/AuditService.cs | 1 + src/Shared.Contracts/Api/ApiRoutes.cs | 3 + src/Shared.Contracts/Api/ResourceDtos.cs | 25 +- tests/Backend.Tests/TestClients.cs | 99 +++ tests/Backend.Tests/TriggerEndpointTests.cs | 146 ++++ 21 files changed, 2992 insertions(+), 161 deletions(-) create mode 100644 src/Backend/Data/Migrations/Postgres/20261023003329_AddTriggerNameAndLastRun.Designer.cs create mode 100644 src/Backend/Data/Migrations/Postgres/20261023003329_AddTriggerNameAndLastRun.cs create mode 100644 src/Backend/Data/Migrations/SqlServer/20261023003341_AddTriggerNameAndLastRun.Designer.cs create mode 100644 src/Backend/Data/Migrations/SqlServer/20261023003341_AddTriggerNameAndLastRun.cs create mode 100644 src/Backend/Data/Migrations/Sqlite/20261023003317_AddTriggerNameAndLastRun.Designer.cs create mode 100644 src/Backend/Data/Migrations/Sqlite/20261023003317_AddTriggerNameAndLastRun.cs create mode 100644 src/Backend/Jobs/TriggerExecutor.cs create mode 100644 tests/Backend.Tests/TestClients.cs create mode 100644 tests/Backend.Tests/TriggerEndpointTests.cs diff --git a/src/Backend/Data/Entities.cs b/src/Backend/Data/Entities.cs index c10889d..6ddc319 100644 --- a/src/Backend/Data/Entities.cs +++ b/src/Backend/Data/Entities.cs @@ -121,6 +121,9 @@ public sealed class ScriptTriggerEntity public Guid Id { get; set; } public Guid ScriptId { get; set; } + /// Operator label ("Nightly cleanup"); the script name stands in when unset. + public string? Name { get; set; } + // Target: a single device (ClientId), a group (GroupId), or all devices // when both are null. Event triggers historically used GroupId; scheduled // triggers can target either. @@ -148,6 +151,8 @@ public sealed class ScriptTriggerEntity public string? ArgumentsJson { get; set; } /// Human-readable outcome of the last scheduled firing. public string? LastResult { get; set; } + /// Execution (job RunId) the last firing created, for drill-in. + public Guid? LastRunId { get; set; } public DateTimeOffset CreatedUtc { get; set; } public string? CreatedBy { get; set; } diff --git a/src/Backend/Data/Migrations/Postgres/20261023003329_AddTriggerNameAndLastRun.Designer.cs b/src/Backend/Data/Migrations/Postgres/20261023003329_AddTriggerNameAndLastRun.Designer.cs new file mode 100644 index 0000000..d97b3b4 --- /dev/null +++ b/src/Backend/Data/Migrations/Postgres/20261023003329_AddTriggerNameAndLastRun.Designer.cs @@ -0,0 +1,739 @@ +// +using System; +using Backend.Data; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace Backend.Data.Migrations.Postgres +{ + [DbContext(typeof(PostgresAppDbContext))] + [Migration("20261023003329_AddTriggerNameAndLastRun")] + partial class AddTriggerNameAndLastRun + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "10.0.10") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("Backend.Data.AppSettingEntity", b => + { + b.Property("Key") + .HasColumnType("text"); + + b.Property("IsSecret") + .HasColumnType("boolean"); + + b.Property("UpdatedBy") + .HasColumnType("text"); + + b.Property("UpdatedUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("Value") + .HasColumnType("text"); + + b.HasKey("Key"); + + b.ToTable("AppSettings", (string)null); + }); + + modelBuilder.Entity("Backend.Data.AuditEventEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Action") + .IsRequired() + .HasColumnType("text"); + + b.Property("Actor") + .HasColumnType("text"); + + b.Property("Category") + .IsRequired() + .HasColumnType("text"); + + b.Property("ClientId") + .HasColumnType("text"); + + b.Property("Detail") + .HasColumnType("text"); + + b.Property("RemoteIp") + .HasColumnType("text"); + + b.Property("TimestampUtc") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("TimestampUtc"); + + b.ToTable("AuditEvents", (string)null); + }); + + modelBuilder.Entity("Backend.Data.BootstrapTokenEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("CreatedUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiresUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("MaxUses") + .HasColumnType("integer"); + + b.Property("Note") + .HasColumnType("text"); + + b.Property("Revoked") + .HasColumnType("boolean"); + + b.Property("TokenHash") + .IsRequired() + .HasColumnType("text"); + + b.Property("Uses") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("TokenHash") + .IsUnique(); + + b.ToTable("BootstrapTokens", (string)null); + }); + + modelBuilder.Entity("Backend.Data.DeviceEntity", b => + { + b.Property("ClientId") + .HasColumnType("text"); + + b.Property("AgentVersion") + .HasColumnType("text"); + + b.Property("EnrolledUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("EnrollmentId") + .HasColumnType("uuid"); + + b.Property("Hostname") + .IsRequired() + .HasColumnType("text"); + + b.Property("IpAddressesJson") + .HasColumnType("text"); + + b.Property("IsOrphaned") + .HasColumnType("boolean"); + + b.Property("LastSeenUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("Manufacturer") + .HasColumnType("text"); + + b.Property("Model") + .HasColumnType("text"); + + b.Property("NkeyPublic") + .IsRequired() + .HasColumnType("text"); + + b.Property("OrphanedUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("OsCaption") + .HasColumnType("text"); + + b.Property("OsVersion") + .HasColumnType("text"); + + b.Property("PublicIp") + .HasColumnType("text"); + + b.Property("ReadyUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("TagsJson") + .HasColumnType("text"); + + b.HasKey("ClientId"); + + b.HasIndex("Hostname"); + + b.ToTable("Devices", (string)null); + }); + + modelBuilder.Entity("Backend.Data.DeviceGroupEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CreatedUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("Kind") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("RulesJson") + .HasColumnType("text"); + + b.Property("UpdatedBy") + .HasColumnType("text"); + + b.Property("UpdatedUtc") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("DeviceGroups", (string)null); + }); + + modelBuilder.Entity("Backend.Data.DeviceGroupMemberEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AddedUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("text"); + + b.Property("GroupId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("GroupId", "ClientId") + .IsUnique(); + + b.ToTable("DeviceGroupMembers", (string)null); + }); + + modelBuilder.Entity("Backend.Data.DeviceInventoryEntity", b => + { + b.Property("ClientId") + .HasColumnType("text"); + + b.Property("ReportJson") + .IsRequired() + .HasColumnType("text"); + + b.Property("UpdatedUtc") + .HasColumnType("timestamp with time zone"); + + b.HasKey("ClientId"); + + b.ToTable("DeviceInventory", (string)null); + }); + + modelBuilder.Entity("Backend.Data.FunctionModuleEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Content") + .IsRequired() + .HasColumnType("text"); + + b.Property("CreatedUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("UpdatedBy") + .HasColumnType("text"); + + b.Property("UpdatedUtc") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("FunctionModules", (string)null); + }); + + modelBuilder.Entity("Backend.Data.JobEntity", b => + { + b.Property("JobId") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("text"); + + b.Property("CompletedUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("CreatedUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("ExitCode") + .HasColumnType("integer"); + + b.Property("OutputSummary") + .HasColumnType("text"); + + b.Property("RequestedBy") + .HasColumnType("text"); + + b.Property("RunId") + .HasColumnType("uuid"); + + b.Property("ScriptId") + .HasColumnType("uuid"); + + b.Property("ScriptName") + .IsRequired() + .HasColumnType("text"); + + b.Property("StartedUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("State") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("JobId"); + + b.HasIndex("ClientId"); + + b.HasIndex("CreatedUtc"); + + b.HasIndex("ScriptId", "RunId"); + + b.ToTable("Jobs", (string)null); + }); + + modelBuilder.Entity("Backend.Data.JobOutputEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("JobId") + .HasColumnType("uuid"); + + b.Property("Sequence") + .HasColumnType("bigint"); + + b.Property("Stream") + .IsRequired() + .HasColumnType("text"); + + b.Property("Text") + .IsRequired() + .HasColumnType("text"); + + b.Property("TimestampUtc") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("JobId", "Sequence") + .IsUnique(); + + b.ToTable("JobOutput", (string)null); + }); + + modelBuilder.Entity("Backend.Data.OidcProviderEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Authority") + .IsRequired() + .HasColumnType("text"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Enabled") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("OidcProviders", (string)null); + }); + + modelBuilder.Entity("Backend.Data.RoleEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CreatedUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("DeviceScopeGroupIdsJson") + .HasColumnType("text"); + + b.Property("IsSystem") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("OidcClaimValuesJson") + .HasColumnType("text"); + + b.Property("PermissionsJson") + .HasColumnType("text"); + + b.Property("UpdatedBy") + .HasColumnType("text"); + + b.Property("UpdatedUtc") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("Roles", (string)null); + }); + + modelBuilder.Entity("Backend.Data.ScriptEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Content") + .IsRequired() + .HasColumnType("text"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("CreatedUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("FileBindingsJson") + .HasColumnType("text"); + + b.Property("FunctionModuleIdsJson") + .HasColumnType("text"); + + b.Property("Language") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("ParametersJson") + .HasColumnType("text"); + + b.Property("SecretBindingsJson") + .HasColumnType("text"); + + b.Property("SecretsVariableName") + .HasColumnType("text"); + + b.Property("UpdatedBy") + .HasColumnType("text"); + + b.Property("UpdatedUtc") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("Scripts", (string)null); + }); + + modelBuilder.Entity("Backend.Data.ScriptTriggerEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ArgumentsJson") + .HasColumnType("text"); + + b.Property("ClientId") + .HasColumnType("text"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("CreatedUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("CronExpression") + .HasColumnType("text"); + + b.Property("Enabled") + .HasColumnType("boolean"); + + b.Property("GroupId") + .HasColumnType("uuid"); + + b.Property("LastResult") + .HasColumnType("text"); + + b.Property("LastRunId") + .HasColumnType("uuid"); + + b.Property("LastRunUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("NextRunUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("OncePerDevice") + .HasColumnType("boolean"); + + b.Property("RunOnceUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("ScriptId") + .HasColumnType("uuid"); + + b.Property("TimeZoneId") + .IsRequired() + .HasColumnType("text"); + + b.Property("TriggerType") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("NextRunUtc"); + + b.HasIndex("TriggerType"); + + b.ToTable("ScriptTriggers", (string)null); + }); + + modelBuilder.Entity("Backend.Data.ScriptTriggerRunEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("text"); + + b.Property("FiredUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("JobId") + .HasColumnType("uuid"); + + b.Property("TriggerId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("TriggerId", "ClientId") + .IsUnique(); + + b.ToTable("ScriptTriggerRuns", (string)null); + }); + + modelBuilder.Entity("Backend.Data.SecretsProviderEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ConfigProtected") + .IsRequired() + .HasColumnType("text"); + + b.Property("CreatedUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("Kind") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("UpdatedBy") + .HasColumnType("text"); + + b.Property("UpdatedUtc") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("SecretsProviders", (string)null); + }); + + modelBuilder.Entity("Backend.Data.ShellSessionEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("text"); + + b.Property("CloseReason") + .HasColumnType("text"); + + b.Property("ClosedUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("CreatedUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("RequestedBy") + .HasColumnType("text"); + + b.Property("State") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("ShellSessions", (string)null); + }); + + modelBuilder.Entity("Backend.Data.UserEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AuthProvider") + .IsRequired() + .HasColumnType("text"); + + b.Property("CreatedUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("DisplayName") + .HasColumnType("text"); + + b.Property("ExternalId") + .HasColumnType("text"); + + b.Property("LastLoginUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("MustChangePassword") + .HasColumnType("boolean"); + + b.Property("PasswordHash") + .HasColumnType("text"); + + b.Property("Role") + .IsRequired() + .HasColumnType("text"); + + b.Property("RoleId") + .HasColumnType("uuid"); + + b.Property("Username") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("Username") + .IsUnique(); + + b.ToTable("Users", (string)null); + }); + + modelBuilder.Entity("Backend.Data.DeviceInventoryEntity", b => + { + b.HasOne("Backend.Data.DeviceEntity", null) + .WithOne("Inventory") + .HasForeignKey("Backend.Data.DeviceInventoryEntity", "ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Backend.Data.DeviceEntity", b => + { + b.Navigation("Inventory"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/Backend/Data/Migrations/Postgres/20261023003329_AddTriggerNameAndLastRun.cs b/src/Backend/Data/Migrations/Postgres/20261023003329_AddTriggerNameAndLastRun.cs new file mode 100644 index 0000000..472ee76 --- /dev/null +++ b/src/Backend/Data/Migrations/Postgres/20261023003329_AddTriggerNameAndLastRun.cs @@ -0,0 +1,39 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Backend.Data.Migrations.Postgres +{ + /// + public partial class AddTriggerNameAndLastRun : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "LastRunId", + table: "ScriptTriggers", + type: "uuid", + nullable: true); + + migrationBuilder.AddColumn( + name: "Name", + table: "ScriptTriggers", + type: "text", + nullable: true); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "LastRunId", + table: "ScriptTriggers"); + + migrationBuilder.DropColumn( + name: "Name", + table: "ScriptTriggers"); + } + } +} diff --git a/src/Backend/Data/Migrations/Postgres/PostgresAppDbContextModelSnapshot.cs b/src/Backend/Data/Migrations/Postgres/PostgresAppDbContextModelSnapshot.cs index 624cffa..8075d6e 100644 --- a/src/Backend/Data/Migrations/Postgres/PostgresAppDbContextModelSnapshot.cs +++ b/src/Backend/Data/Migrations/Postgres/PostgresAppDbContextModelSnapshot.cs @@ -535,9 +535,15 @@ namespace Backend.Data.Migrations.Postgres b.Property("LastResult") .HasColumnType("text"); + b.Property("LastRunId") + .HasColumnType("uuid"); + b.Property("LastRunUtc") .HasColumnType("timestamp with time zone"); + b.Property("Name") + .HasColumnType("text"); + b.Property("NextRunUtc") .HasColumnType("timestamp with time zone"); diff --git a/src/Backend/Data/Migrations/SqlServer/20261023003341_AddTriggerNameAndLastRun.Designer.cs b/src/Backend/Data/Migrations/SqlServer/20261023003341_AddTriggerNameAndLastRun.Designer.cs new file mode 100644 index 0000000..f422f99 --- /dev/null +++ b/src/Backend/Data/Migrations/SqlServer/20261023003341_AddTriggerNameAndLastRun.Designer.cs @@ -0,0 +1,739 @@ +// +using System; +using Backend.Data; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace Backend.Data.Migrations.SqlServer +{ + [DbContext(typeof(SqlServerAppDbContext))] + [Migration("20261023003341_AddTriggerNameAndLastRun")] + partial class AddTriggerNameAndLastRun + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "10.0.10") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); + + modelBuilder.Entity("Backend.Data.AppSettingEntity", b => + { + b.Property("Key") + .HasColumnType("nvarchar(450)"); + + b.Property("IsSecret") + .HasColumnType("bit"); + + b.Property("UpdatedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("UpdatedUtc") + .HasColumnType("datetimeoffset"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Key"); + + b.ToTable("AppSettings", (string)null); + }); + + modelBuilder.Entity("Backend.Data.AuditEventEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Action") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Actor") + .HasColumnType("nvarchar(max)"); + + b.Property("Category") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("ClientId") + .HasColumnType("nvarchar(max)"); + + b.Property("Detail") + .HasColumnType("nvarchar(max)"); + + b.Property("RemoteIp") + .HasColumnType("nvarchar(max)"); + + b.Property("TimestampUtc") + .HasColumnType("datetimeoffset"); + + b.HasKey("Id"); + + b.HasIndex("TimestampUtc"); + + b.ToTable("AuditEvents", (string)null); + }); + + modelBuilder.Entity("Backend.Data.BootstrapTokenEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("CreatedUtc") + .HasColumnType("datetimeoffset"); + + b.Property("ExpiresUtc") + .HasColumnType("datetimeoffset"); + + b.Property("MaxUses") + .HasColumnType("int"); + + b.Property("Note") + .HasColumnType("nvarchar(max)"); + + b.Property("Revoked") + .HasColumnType("bit"); + + b.Property("TokenHash") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Uses") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("TokenHash") + .IsUnique(); + + b.ToTable("BootstrapTokens", (string)null); + }); + + modelBuilder.Entity("Backend.Data.DeviceEntity", b => + { + b.Property("ClientId") + .HasColumnType("nvarchar(450)"); + + b.Property("AgentVersion") + .HasColumnType("nvarchar(max)"); + + b.Property("EnrolledUtc") + .HasColumnType("datetimeoffset"); + + b.Property("EnrollmentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Hostname") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("IpAddressesJson") + .HasColumnType("nvarchar(max)"); + + b.Property("IsOrphaned") + .HasColumnType("bit"); + + b.Property("LastSeenUtc") + .HasColumnType("datetimeoffset"); + + b.Property("Manufacturer") + .HasColumnType("nvarchar(max)"); + + b.Property("Model") + .HasColumnType("nvarchar(max)"); + + b.Property("NkeyPublic") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("OrphanedUtc") + .HasColumnType("datetimeoffset"); + + b.Property("OsCaption") + .HasColumnType("nvarchar(max)"); + + b.Property("OsVersion") + .HasColumnType("nvarchar(max)"); + + b.Property("PublicIp") + .HasColumnType("nvarchar(max)"); + + b.Property("ReadyUtc") + .HasColumnType("datetimeoffset"); + + b.Property("TagsJson") + .HasColumnType("nvarchar(max)"); + + b.HasKey("ClientId"); + + b.HasIndex("Hostname"); + + b.ToTable("Devices", (string)null); + }); + + modelBuilder.Entity("Backend.Data.DeviceGroupEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedUtc") + .HasColumnType("datetimeoffset"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Kind") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("RulesJson") + .HasColumnType("nvarchar(max)"); + + b.Property("UpdatedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("UpdatedUtc") + .HasColumnType("datetimeoffset"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("DeviceGroups", (string)null); + }); + + modelBuilder.Entity("Backend.Data.DeviceGroupMemberEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("AddedUtc") + .HasColumnType("datetimeoffset"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("GroupId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("GroupId", "ClientId") + .IsUnique(); + + b.ToTable("DeviceGroupMembers", (string)null); + }); + + modelBuilder.Entity("Backend.Data.DeviceInventoryEntity", b => + { + b.Property("ClientId") + .HasColumnType("nvarchar(450)"); + + b.Property("ReportJson") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("UpdatedUtc") + .HasColumnType("datetimeoffset"); + + b.HasKey("ClientId"); + + b.ToTable("DeviceInventory", (string)null); + }); + + modelBuilder.Entity("Backend.Data.FunctionModuleEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Content") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("CreatedUtc") + .HasColumnType("datetimeoffset"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("UpdatedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("UpdatedUtc") + .HasColumnType("datetimeoffset"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("FunctionModules", (string)null); + }); + + modelBuilder.Entity("Backend.Data.JobEntity", b => + { + b.Property("JobId") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("CompletedUtc") + .HasColumnType("datetimeoffset"); + + b.Property("CreatedUtc") + .HasColumnType("datetimeoffset"); + + b.Property("ExitCode") + .HasColumnType("int"); + + b.Property("OutputSummary") + .HasColumnType("nvarchar(max)"); + + b.Property("RequestedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("RunId") + .HasColumnType("uniqueidentifier"); + + b.Property("ScriptId") + .HasColumnType("uniqueidentifier"); + + b.Property("ScriptName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("StartedUtc") + .HasColumnType("datetimeoffset"); + + b.Property("State") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("JobId"); + + b.HasIndex("ClientId"); + + b.HasIndex("CreatedUtc"); + + b.HasIndex("ScriptId", "RunId"); + + b.ToTable("Jobs", (string)null); + }); + + modelBuilder.Entity("Backend.Data.JobOutputEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("JobId") + .HasColumnType("uniqueidentifier"); + + b.Property("Sequence") + .HasColumnType("bigint"); + + b.Property("Stream") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Text") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("TimestampUtc") + .HasColumnType("datetimeoffset"); + + b.HasKey("Id"); + + b.HasIndex("JobId", "Sequence") + .IsUnique(); + + b.ToTable("JobOutput", (string)null); + }); + + modelBuilder.Entity("Backend.Data.OidcProviderEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Authority") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("OidcProviders", (string)null); + }); + + modelBuilder.Entity("Backend.Data.RoleEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedUtc") + .HasColumnType("datetimeoffset"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DeviceScopeGroupIdsJson") + .HasColumnType("nvarchar(max)"); + + b.Property("IsSystem") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("OidcClaimValuesJson") + .HasColumnType("nvarchar(max)"); + + b.Property("PermissionsJson") + .HasColumnType("nvarchar(max)"); + + b.Property("UpdatedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("UpdatedUtc") + .HasColumnType("datetimeoffset"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("Roles", (string)null); + }); + + modelBuilder.Entity("Backend.Data.ScriptEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Content") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("CreatedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("CreatedUtc") + .HasColumnType("datetimeoffset"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("FileBindingsJson") + .HasColumnType("nvarchar(max)"); + + b.Property("FunctionModuleIdsJson") + .HasColumnType("nvarchar(max)"); + + b.Property("Language") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("ParametersJson") + .HasColumnType("nvarchar(max)"); + + b.Property("SecretBindingsJson") + .HasColumnType("nvarchar(max)"); + + b.Property("SecretsVariableName") + .HasColumnType("nvarchar(max)"); + + b.Property("UpdatedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("UpdatedUtc") + .HasColumnType("datetimeoffset"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("Scripts", (string)null); + }); + + modelBuilder.Entity("Backend.Data.ScriptTriggerEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ArgumentsJson") + .HasColumnType("nvarchar(max)"); + + b.Property("ClientId") + .HasColumnType("nvarchar(max)"); + + b.Property("CreatedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("CreatedUtc") + .HasColumnType("datetimeoffset"); + + b.Property("CronExpression") + .HasColumnType("nvarchar(max)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("GroupId") + .HasColumnType("uniqueidentifier"); + + b.Property("LastResult") + .HasColumnType("nvarchar(max)"); + + b.Property("LastRunId") + .HasColumnType("uniqueidentifier"); + + b.Property("LastRunUtc") + .HasColumnType("datetimeoffset"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("NextRunUtc") + .HasColumnType("datetimeoffset"); + + b.Property("OncePerDevice") + .HasColumnType("bit"); + + b.Property("RunOnceUtc") + .HasColumnType("datetimeoffset"); + + b.Property("ScriptId") + .HasColumnType("uniqueidentifier"); + + b.Property("TimeZoneId") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("TriggerType") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("NextRunUtc"); + + b.HasIndex("TriggerType"); + + b.ToTable("ScriptTriggers", (string)null); + }); + + modelBuilder.Entity("Backend.Data.ScriptTriggerRunEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("FiredUtc") + .HasColumnType("datetimeoffset"); + + b.Property("JobId") + .HasColumnType("uniqueidentifier"); + + b.Property("TriggerId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("TriggerId", "ClientId") + .IsUnique(); + + b.ToTable("ScriptTriggerRuns", (string)null); + }); + + modelBuilder.Entity("Backend.Data.SecretsProviderEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConfigProtected") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("CreatedUtc") + .HasColumnType("datetimeoffset"); + + b.Property("Kind") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("UpdatedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("UpdatedUtc") + .HasColumnType("datetimeoffset"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("SecretsProviders", (string)null); + }); + + modelBuilder.Entity("Backend.Data.ShellSessionEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("CloseReason") + .HasColumnType("nvarchar(max)"); + + b.Property("ClosedUtc") + .HasColumnType("datetimeoffset"); + + b.Property("CreatedUtc") + .HasColumnType("datetimeoffset"); + + b.Property("RequestedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("State") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("ShellSessions", (string)null); + }); + + modelBuilder.Entity("Backend.Data.UserEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AuthProvider") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("CreatedUtc") + .HasColumnType("datetimeoffset"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("ExternalId") + .HasColumnType("nvarchar(max)"); + + b.Property("LastLoginUtc") + .HasColumnType("datetimeoffset"); + + b.Property("MustChangePassword") + .HasColumnType("bit"); + + b.Property("PasswordHash") + .HasColumnType("nvarchar(max)"); + + b.Property("Role") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("Username") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("Username") + .IsUnique(); + + b.ToTable("Users", (string)null); + }); + + modelBuilder.Entity("Backend.Data.DeviceInventoryEntity", b => + { + b.HasOne("Backend.Data.DeviceEntity", null) + .WithOne("Inventory") + .HasForeignKey("Backend.Data.DeviceInventoryEntity", "ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Backend.Data.DeviceEntity", b => + { + b.Navigation("Inventory"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/Backend/Data/Migrations/SqlServer/20261023003341_AddTriggerNameAndLastRun.cs b/src/Backend/Data/Migrations/SqlServer/20261023003341_AddTriggerNameAndLastRun.cs new file mode 100644 index 0000000..c9a0ed0 --- /dev/null +++ b/src/Backend/Data/Migrations/SqlServer/20261023003341_AddTriggerNameAndLastRun.cs @@ -0,0 +1,39 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Backend.Data.Migrations.SqlServer +{ + /// + public partial class AddTriggerNameAndLastRun : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "LastRunId", + table: "ScriptTriggers", + type: "uniqueidentifier", + nullable: true); + + migrationBuilder.AddColumn( + name: "Name", + table: "ScriptTriggers", + type: "nvarchar(max)", + nullable: true); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "LastRunId", + table: "ScriptTriggers"); + + migrationBuilder.DropColumn( + name: "Name", + table: "ScriptTriggers"); + } + } +} diff --git a/src/Backend/Data/Migrations/SqlServer/SqlServerAppDbContextModelSnapshot.cs b/src/Backend/Data/Migrations/SqlServer/SqlServerAppDbContextModelSnapshot.cs index ca89ef0..4acf21e 100644 --- a/src/Backend/Data/Migrations/SqlServer/SqlServerAppDbContextModelSnapshot.cs +++ b/src/Backend/Data/Migrations/SqlServer/SqlServerAppDbContextModelSnapshot.cs @@ -535,9 +535,15 @@ namespace Backend.Data.Migrations.SqlServer b.Property("LastResult") .HasColumnType("nvarchar(max)"); + b.Property("LastRunId") + .HasColumnType("uniqueidentifier"); + b.Property("LastRunUtc") .HasColumnType("datetimeoffset"); + b.Property("Name") + .HasColumnType("nvarchar(max)"); + b.Property("NextRunUtc") .HasColumnType("datetimeoffset"); diff --git a/src/Backend/Data/Migrations/Sqlite/20261023003317_AddTriggerNameAndLastRun.Designer.cs b/src/Backend/Data/Migrations/Sqlite/20261023003317_AddTriggerNameAndLastRun.Designer.cs new file mode 100644 index 0000000..de3c021 --- /dev/null +++ b/src/Backend/Data/Migrations/Sqlite/20261023003317_AddTriggerNameAndLastRun.Designer.cs @@ -0,0 +1,726 @@ +// +using System; +using Backend.Data; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace Backend.Data.Migrations.Sqlite +{ + [DbContext(typeof(SqliteAppDbContext))] + [Migration("20261023003317_AddTriggerNameAndLastRun")] + partial class AddTriggerNameAndLastRun + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder.HasAnnotation("ProductVersion", "10.0.10"); + + modelBuilder.Entity("Backend.Data.AppSettingEntity", b => + { + b.Property("Key") + .HasColumnType("TEXT"); + + b.Property("IsSecret") + .HasColumnType("INTEGER"); + + b.Property("UpdatedBy") + .HasColumnType("TEXT"); + + b.Property("UpdatedUtc") + .HasColumnType("INTEGER"); + + b.Property("Value") + .HasColumnType("TEXT"); + + b.HasKey("Key"); + + b.ToTable("AppSettings", (string)null); + }); + + modelBuilder.Entity("Backend.Data.AuditEventEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Action") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Actor") + .HasColumnType("TEXT"); + + b.Property("Category") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("ClientId") + .HasColumnType("TEXT"); + + b.Property("Detail") + .HasColumnType("TEXT"); + + b.Property("RemoteIp") + .HasColumnType("TEXT"); + + b.Property("TimestampUtc") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("TimestampUtc"); + + b.ToTable("AuditEvents", (string)null); + }); + + modelBuilder.Entity("Backend.Data.BootstrapTokenEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("CreatedBy") + .HasColumnType("TEXT"); + + b.Property("CreatedUtc") + .HasColumnType("INTEGER"); + + b.Property("ExpiresUtc") + .HasColumnType("INTEGER"); + + b.Property("MaxUses") + .HasColumnType("INTEGER"); + + b.Property("Note") + .HasColumnType("TEXT"); + + b.Property("Revoked") + .HasColumnType("INTEGER"); + + b.Property("TokenHash") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Uses") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("TokenHash") + .IsUnique(); + + b.ToTable("BootstrapTokens", (string)null); + }); + + modelBuilder.Entity("Backend.Data.DeviceEntity", b => + { + b.Property("ClientId") + .HasColumnType("TEXT"); + + b.Property("AgentVersion") + .HasColumnType("TEXT"); + + b.Property("EnrolledUtc") + .HasColumnType("INTEGER"); + + b.Property("EnrollmentId") + .HasColumnType("TEXT"); + + b.Property("Hostname") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("IpAddressesJson") + .HasColumnType("TEXT"); + + b.Property("IsOrphaned") + .HasColumnType("INTEGER"); + + b.Property("LastSeenUtc") + .HasColumnType("INTEGER"); + + b.Property("Manufacturer") + .HasColumnType("TEXT"); + + b.Property("Model") + .HasColumnType("TEXT"); + + b.Property("NkeyPublic") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("OrphanedUtc") + .HasColumnType("INTEGER"); + + b.Property("OsCaption") + .HasColumnType("TEXT"); + + b.Property("OsVersion") + .HasColumnType("TEXT"); + + b.Property("PublicIp") + .HasColumnType("TEXT"); + + b.Property("ReadyUtc") + .HasColumnType("INTEGER"); + + b.Property("TagsJson") + .HasColumnType("TEXT"); + + b.HasKey("ClientId"); + + b.HasIndex("Hostname"); + + b.ToTable("Devices", (string)null); + }); + + modelBuilder.Entity("Backend.Data.DeviceGroupEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("CreatedUtc") + .HasColumnType("INTEGER"); + + b.Property("Description") + .HasColumnType("TEXT"); + + b.Property("Kind") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("RulesJson") + .HasColumnType("TEXT"); + + b.Property("UpdatedBy") + .HasColumnType("TEXT"); + + b.Property("UpdatedUtc") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("DeviceGroups", (string)null); + }); + + modelBuilder.Entity("Backend.Data.DeviceGroupMemberEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("AddedUtc") + .HasColumnType("INTEGER"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("GroupId") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("GroupId", "ClientId") + .IsUnique(); + + b.ToTable("DeviceGroupMembers", (string)null); + }); + + modelBuilder.Entity("Backend.Data.DeviceInventoryEntity", b => + { + b.Property("ClientId") + .HasColumnType("TEXT"); + + b.Property("ReportJson") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("UpdatedUtc") + .HasColumnType("INTEGER"); + + b.HasKey("ClientId"); + + b.ToTable("DeviceInventory", (string)null); + }); + + modelBuilder.Entity("Backend.Data.FunctionModuleEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("Content") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("CreatedUtc") + .HasColumnType("INTEGER"); + + b.Property("Description") + .HasColumnType("TEXT"); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("UpdatedBy") + .HasColumnType("TEXT"); + + b.Property("UpdatedUtc") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("FunctionModules", (string)null); + }); + + modelBuilder.Entity("Backend.Data.JobEntity", b => + { + b.Property("JobId") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("CompletedUtc") + .HasColumnType("INTEGER"); + + b.Property("CreatedUtc") + .HasColumnType("INTEGER"); + + b.Property("ExitCode") + .HasColumnType("INTEGER"); + + b.Property("OutputSummary") + .HasColumnType("TEXT"); + + b.Property("RequestedBy") + .HasColumnType("TEXT"); + + b.Property("RunId") + .HasColumnType("TEXT"); + + b.Property("ScriptId") + .HasColumnType("TEXT"); + + b.Property("ScriptName") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("StartedUtc") + .HasColumnType("INTEGER"); + + b.Property("State") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("JobId"); + + b.HasIndex("ClientId"); + + b.HasIndex("CreatedUtc"); + + b.HasIndex("ScriptId", "RunId"); + + b.ToTable("Jobs", (string)null); + }); + + modelBuilder.Entity("Backend.Data.JobOutputEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("JobId") + .HasColumnType("TEXT"); + + b.Property("Sequence") + .HasColumnType("INTEGER"); + + b.Property("Stream") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Text") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("TimestampUtc") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("JobId", "Sequence") + .IsUnique(); + + b.ToTable("JobOutput", (string)null); + }); + + modelBuilder.Entity("Backend.Data.OidcProviderEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("Authority") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Enabled") + .HasColumnType("INTEGER"); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("OidcProviders", (string)null); + }); + + modelBuilder.Entity("Backend.Data.RoleEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("CreatedUtc") + .HasColumnType("INTEGER"); + + b.Property("Description") + .HasColumnType("TEXT"); + + b.Property("DeviceScopeGroupIdsJson") + .HasColumnType("TEXT"); + + b.Property("IsSystem") + .HasColumnType("INTEGER"); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("OidcClaimValuesJson") + .HasColumnType("TEXT"); + + b.Property("PermissionsJson") + .HasColumnType("TEXT"); + + b.Property("UpdatedBy") + .HasColumnType("TEXT"); + + b.Property("UpdatedUtc") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("Roles", (string)null); + }); + + modelBuilder.Entity("Backend.Data.ScriptEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("Content") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("CreatedBy") + .HasColumnType("TEXT"); + + b.Property("CreatedUtc") + .HasColumnType("INTEGER"); + + b.Property("Description") + .HasColumnType("TEXT"); + + b.Property("FileBindingsJson") + .HasColumnType("TEXT"); + + b.Property("FunctionModuleIdsJson") + .HasColumnType("TEXT"); + + b.Property("Language") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("ParametersJson") + .HasColumnType("TEXT"); + + b.Property("SecretBindingsJson") + .HasColumnType("TEXT"); + + b.Property("SecretsVariableName") + .HasColumnType("TEXT"); + + b.Property("UpdatedBy") + .HasColumnType("TEXT"); + + b.Property("UpdatedUtc") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("Scripts", (string)null); + }); + + modelBuilder.Entity("Backend.Data.ScriptTriggerEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("ArgumentsJson") + .HasColumnType("TEXT"); + + b.Property("ClientId") + .HasColumnType("TEXT"); + + b.Property("CreatedBy") + .HasColumnType("TEXT"); + + b.Property("CreatedUtc") + .HasColumnType("INTEGER"); + + b.Property("CronExpression") + .HasColumnType("TEXT"); + + b.Property("Enabled") + .HasColumnType("INTEGER"); + + b.Property("GroupId") + .HasColumnType("TEXT"); + + b.Property("LastResult") + .HasColumnType("TEXT"); + + b.Property("LastRunId") + .HasColumnType("TEXT"); + + b.Property("LastRunUtc") + .HasColumnType("INTEGER"); + + b.Property("Name") + .HasColumnType("TEXT"); + + b.Property("NextRunUtc") + .HasColumnType("INTEGER"); + + b.Property("OncePerDevice") + .HasColumnType("INTEGER"); + + b.Property("RunOnceUtc") + .HasColumnType("INTEGER"); + + b.Property("ScriptId") + .HasColumnType("TEXT"); + + b.Property("TimeZoneId") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("TriggerType") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("NextRunUtc"); + + b.HasIndex("TriggerType"); + + b.ToTable("ScriptTriggers", (string)null); + }); + + modelBuilder.Entity("Backend.Data.ScriptTriggerRunEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("FiredUtc") + .HasColumnType("INTEGER"); + + b.Property("JobId") + .HasColumnType("TEXT"); + + b.Property("TriggerId") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("TriggerId", "ClientId") + .IsUnique(); + + b.ToTable("ScriptTriggerRuns", (string)null); + }); + + modelBuilder.Entity("Backend.Data.SecretsProviderEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("ConfigProtected") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("CreatedUtc") + .HasColumnType("INTEGER"); + + b.Property("Kind") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("UpdatedBy") + .HasColumnType("TEXT"); + + b.Property("UpdatedUtc") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("SecretsProviders", (string)null); + }); + + modelBuilder.Entity("Backend.Data.ShellSessionEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("CloseReason") + .HasColumnType("TEXT"); + + b.Property("ClosedUtc") + .HasColumnType("INTEGER"); + + b.Property("CreatedUtc") + .HasColumnType("INTEGER"); + + b.Property("RequestedBy") + .HasColumnType("TEXT"); + + b.Property("State") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("ShellSessions", (string)null); + }); + + modelBuilder.Entity("Backend.Data.UserEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("AuthProvider") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("CreatedUtc") + .HasColumnType("INTEGER"); + + b.Property("DisplayName") + .HasColumnType("TEXT"); + + b.Property("ExternalId") + .HasColumnType("TEXT"); + + b.Property("LastLoginUtc") + .HasColumnType("INTEGER"); + + b.Property("MustChangePassword") + .HasColumnType("INTEGER"); + + b.Property("PasswordHash") + .HasColumnType("TEXT"); + + b.Property("Role") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("RoleId") + .HasColumnType("TEXT"); + + b.Property("Username") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("Username") + .IsUnique(); + + b.ToTable("Users", (string)null); + }); + + modelBuilder.Entity("Backend.Data.DeviceInventoryEntity", b => + { + b.HasOne("Backend.Data.DeviceEntity", null) + .WithOne("Inventory") + .HasForeignKey("Backend.Data.DeviceInventoryEntity", "ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Backend.Data.DeviceEntity", b => + { + b.Navigation("Inventory"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/Backend/Data/Migrations/Sqlite/20261023003317_AddTriggerNameAndLastRun.cs b/src/Backend/Data/Migrations/Sqlite/20261023003317_AddTriggerNameAndLastRun.cs new file mode 100644 index 0000000..a7e2eb7 --- /dev/null +++ b/src/Backend/Data/Migrations/Sqlite/20261023003317_AddTriggerNameAndLastRun.cs @@ -0,0 +1,39 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Backend.Data.Migrations.Sqlite +{ + /// + public partial class AddTriggerNameAndLastRun : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "LastRunId", + table: "ScriptTriggers", + type: "TEXT", + nullable: true); + + migrationBuilder.AddColumn( + name: "Name", + table: "ScriptTriggers", + type: "TEXT", + nullable: true); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "LastRunId", + table: "ScriptTriggers"); + + migrationBuilder.DropColumn( + name: "Name", + table: "ScriptTriggers"); + } + } +} diff --git a/src/Backend/Data/Migrations/Sqlite/SqliteAppDbContextModelSnapshot.cs b/src/Backend/Data/Migrations/Sqlite/SqliteAppDbContextModelSnapshot.cs index 089c2dc..f6fc93e 100644 --- a/src/Backend/Data/Migrations/Sqlite/SqliteAppDbContextModelSnapshot.cs +++ b/src/Backend/Data/Migrations/Sqlite/SqliteAppDbContextModelSnapshot.cs @@ -524,9 +524,15 @@ namespace Backend.Data.Migrations.Sqlite b.Property("LastResult") .HasColumnType("TEXT"); + b.Property("LastRunId") + .HasColumnType("TEXT"); + b.Property("LastRunUtc") .HasColumnType("INTEGER"); + b.Property("Name") + .HasColumnType("TEXT"); + b.Property("NextRunUtc") .HasColumnType("INTEGER"); diff --git a/src/Backend/Groups/ScriptTriggerService.cs b/src/Backend/Groups/ScriptTriggerService.cs index 64a00e9..60a7c1f 100644 --- a/src/Backend/Groups/ScriptTriggerService.cs +++ b/src/Backend/Groups/ScriptTriggerService.cs @@ -100,7 +100,7 @@ public sealed class ScriptTriggerService( } await runner.DispatchAsync( - prepared, job, arguments: null, + prepared, job, TriggerExecutor.ParseArguments(trigger.ArgumentsJson), $"Trigger ({triggerType}) queued “{script.Name}” for {device.Hostname}", cancellationToken); diff --git a/src/Backend/Groups/TriggerEndpoints.cs b/src/Backend/Groups/TriggerEndpoints.cs index 845a518..7dd960a 100644 --- a/src/Backend/Groups/TriggerEndpoints.cs +++ b/src/Backend/Groups/TriggerEndpoints.cs @@ -1,6 +1,8 @@ +using System.Security.Claims; using Backend.Auth; using Backend.Data; using Backend.Jobs; +using Backend.Security; using Microsoft.EntityFrameworkCore; using Shared.Contracts.Api; using Shared.Contracts.Models; @@ -10,12 +12,18 @@ namespace Backend.Groups; public static class TriggerEndpoints { + /// Clock skew tolerated for a one-shot time picked "a moment from now". + private static readonly TimeSpan OneShotGrace = TimeSpan.FromMinutes(1); + public static void Map(WebApplication app) { app.MapGet(ApiRoutes.Triggers, ListAsync).RequirePermission(Permissions.AutomationView); app.MapPost(ApiRoutes.Triggers, CreateAsync).RequirePermission(Permissions.AutomationManage); + app.MapPost(ApiRoutes.TriggerPreview, Preview).RequirePermission(Permissions.AutomationView); + app.MapPut(ApiRoutes.Trigger, UpdateAsync).RequirePermission(Permissions.AutomationManage); app.MapPatch(ApiRoutes.Trigger, SetEnabledAsync).RequirePermission(Permissions.AutomationManage); app.MapDelete(ApiRoutes.Trigger, DeleteAsync).RequirePermission(Permissions.AutomationManage); + app.MapPost(ApiRoutes.TriggerRun, RunNowAsync).RequirePermission(Permissions.JobsRun); } private static async Task ListAsync(AppDbContext db, CancellationToken cancellationToken) @@ -36,82 +44,91 @@ public static class TriggerEndpoints t.ClientId is null ? null : hostnames.GetValueOrDefault(t.ClientId, t.ClientId), t.TriggerType, t.Enabled, t.CronExpression, t.RunOnceUtc, t.TimeZoneId, t.NextRunUtc, t.LastRunUtc, t.LastResult, - t.CreatedUtc)).ToList()); + t.CreatedUtc, + Name: t.Name, + LastRunId: t.LastRunId, + Arguments: TriggerExecutor.ParseArguments(t.ArgumentsJson), + CreatedBy: t.CreatedBy)).ToList()); } private static async Task CreateAsync( - SaveScriptTriggerRequest request, AppDbContext db, HttpContext context, CancellationToken cancellationToken) + SaveScriptTriggerRequest request, AppDbContext db, DeviceScopeService scope, DeviceGroupService groups, + AuditService audit, HttpContext context, CancellationToken cancellationToken) { - if (!await db.Scripts.AnyAsync(s => s.Id == request.ScriptId, cancellationToken)) + if (await ValidateTargetAsync(request, db, scope, groups, context.User, cancellationToken) is { } invalid) { - return Results.NotFound(new { error = "Script not found." }); - } - - if (request.GroupId is not null && request.ClientId is not null) - { - return Results.BadRequest(new { error = "A trigger targets a group OR a device, not both." }); - } - - if (request.GroupId is not null - && !await db.DeviceGroups.AnyAsync(g => g.Id == request.GroupId, cancellationToken)) - { - return Results.NotFound(new { error = "Group not found." }); - } - - if (request.ClientId is not null - && !await db.Devices.AnyAsync(d => d.ClientId == request.ClientId, cancellationToken)) - { - return Results.NotFound(new { error = "Device not found." }); + return invalid; } var entity = new ScriptTriggerEntity { Id = Guid.NewGuid(), - ScriptId = request.ScriptId, - GroupId = request.GroupId, - ClientId = request.ClientId, - TriggerType = request.TriggerType, - Enabled = request.Enabled, - TimeZoneId = string.IsNullOrWhiteSpace(request.TimeZoneId) ? "UTC" : request.TimeZoneId!, - ArgumentsJson = request.Arguments is { Count: > 0 } ? JsonDefaults.Serialize(request.Arguments) : null, CreatedUtc = DateTimeOffset.UtcNow, CreatedBy = context.User.Identity?.Name, }; - if (request.TriggerType == ScriptTriggerType.Scheduled) + if (Apply(entity, request) is { } error) { - // Recurring (cron) or one-shot (runOnce); compute the first run. - if (!string.IsNullOrWhiteSpace(request.CronExpression)) - { - try - { - entity.CronExpression = request.CronExpression; - entity.NextRunUtc = ScheduleCron.NextOccurrence( - request.CronExpression!, entity.TimeZoneId, DateTimeOffset.UtcNow); - } - catch (Exception ex) - { - return Results.BadRequest(new { error = $"Invalid cron expression: {ex.Message}" }); - } - } - else if (request.RunOnceUtc is { } runOnce) - { - entity.RunOnceUtc = runOnce; - entity.NextRunUtc = runOnce; - } - else - { - return Results.BadRequest(new { error = "A scheduled trigger needs a cron expression or a one-shot time." }); - } + return Results.BadRequest(new { error }); } db.ScriptTriggers.Add(entity); await db.SaveChangesAsync(cancellationToken); + await audit.LogAsync(AuditCategories.Automation, "trigger-created", entity.CreatedBy, + clientId: entity.ClientId, detail: Describe(entity), cancellationToken: cancellationToken); return Results.Created(ApiRoutes.For.Trigger(entity.Id), new { id = entity.Id }); } + private static async Task UpdateAsync( + Guid id, SaveScriptTriggerRequest request, AppDbContext db, DeviceScopeService scope, + DeviceGroupService groups, AuditService audit, HttpContext context, CancellationToken cancellationToken) + { + var entity = await db.ScriptTriggers.SingleOrDefaultAsync(t => t.Id == id, cancellationToken); + if (entity is null) + { + return Results.NotFound(); + } + + if (await ValidateTargetAsync(request, db, scope, groups, context.User, cancellationToken) is { } invalid) + { + return invalid; + } + + if (Apply(entity, request) is { } error) + { + return Results.BadRequest(new { error }); + } + + await db.SaveChangesAsync(cancellationToken); + await audit.LogAsync(AuditCategories.Automation, "trigger-updated", context.User.Identity?.Name, + clientId: entity.ClientId, detail: Describe(entity), cancellationToken: cancellationToken); + return Results.NoContent(); + } + + /// Upcoming fire times of a cron cadence in its time zone (DST-aware). + private static IResult Preview(SchedulePreviewRequest request) + { + if (string.IsNullOrWhiteSpace(request.CronExpression)) + { + return Results.Ok(new SchedulePreviewDto([], "Enter a cron expression.")); + } + + var cron = request.CronExpression.Trim(); + var timeZone = string.IsNullOrWhiteSpace(request.TimeZoneId) ? "UTC" : request.TimeZoneId.Trim(); + if (ScheduleCron.Validate(cron, timeZone) is { } error) + { + return Results.Ok(new SchedulePreviewDto([], error)); + } + + var occurrences = ScheduleCron.NextOccurrences( + cron, timeZone, DateTimeOffset.UtcNow, Math.Clamp(request.Count, 1, 20)); + return Results.Ok(new SchedulePreviewDto( + occurrences, occurrences.Count == 0 ? "This expression never fires." : null)); + } + private static async Task SetEnabledAsync( - Guid id, SetTriggerEnabledRequest request, AppDbContext db, CancellationToken cancellationToken) + Guid id, SetTriggerEnabledRequest request, AppDbContext db, AuditService audit, HttpContext context, + CancellationToken cancellationToken) { var entity = await db.ScriptTriggers.SingleOrDefaultAsync(t => t.Id == id, cancellationToken); if (entity is null) @@ -140,10 +157,14 @@ public static class TriggerEndpoints } await db.SaveChangesAsync(cancellationToken); + await audit.LogAsync(AuditCategories.Automation, request.Enabled ? "trigger-enabled" : "trigger-disabled", + context.User.Identity?.Name, clientId: entity.ClientId, detail: Describe(entity), + cancellationToken: cancellationToken); return Results.NoContent(); } - private static async Task DeleteAsync(Guid id, AppDbContext db, CancellationToken cancellationToken) + private static async Task DeleteAsync( + Guid id, AppDbContext db, AuditService audit, HttpContext context, CancellationToken cancellationToken) { var entity = await db.ScriptTriggers.SingleOrDefaultAsync(t => t.Id == id, cancellationToken); if (entity is null) @@ -151,8 +172,182 @@ public static class TriggerEndpoints return Results.NotFound(); } + db.ScriptTriggerRuns.RemoveRange(db.ScriptTriggerRuns.Where(r => r.TriggerId == id)); db.ScriptTriggers.Remove(entity); await db.SaveChangesAsync(cancellationToken); + await audit.LogAsync(AuditCategories.Automation, "trigger-deleted", context.User.Identity?.Name, + clientId: entity.ClientId, detail: Describe(entity), cancellationToken: cancellationToken); return Results.NoContent(); } + + /// + /// Fires the trigger now against its current target, as one execution, + /// without touching its cadence (NextRunUtc) or enabled state. + /// + private static async Task RunNowAsync( + Guid id, AppDbContext db, TriggerExecutor executor, DeviceScopeService scope, DeviceGroupService groups, + AuditService audit, HttpContext context, CancellationToken cancellationToken) + { + var entity = await db.ScriptTriggers.SingleOrDefaultAsync(t => t.Id == id, cancellationToken); + if (entity is null) + { + return Results.NotFound(); + } + + var target = new SaveScriptTriggerRequest(entity.ScriptId, entity.TriggerType, entity.ClientId, entity.GroupId); + if (await ValidateTargetAsync(target, db, scope, groups, context.User, cancellationToken) is { } invalid) + { + return invalid; + } + + var actor = context.User.Identity?.Name; + var firing = await executor.FireAsync(entity, actor ?? "trigger", cancellationToken); + await db.SaveChangesAsync(cancellationToken); + await audit.LogAsync(AuditCategories.Automation, "trigger-run", actor, + clientId: entity.ClientId, detail: $"{Describe(entity)} result={firing.Message}", + cancellationToken: cancellationToken); + + return Results.Ok(new TriggerRunResultDto(firing.RunId, firing.Queued, firing.Message)); + } + + /// + /// Script and target exist, and a device-scoped role only aims inside its + /// scope: a device it can see, or a group whose members it can all see — + /// never "all devices", which would fire beyond the scope later. + /// + private static async Task ValidateTargetAsync( + SaveScriptTriggerRequest request, AppDbContext db, DeviceScopeService scope, DeviceGroupService groups, + ClaimsPrincipal user, CancellationToken cancellationToken) + { + if (!await db.Scripts.AnyAsync(s => s.Id == request.ScriptId, cancellationToken)) + { + return Results.NotFound(new { error = "Script not found." }); + } + + if (request.GroupId is not null && request.ClientId is not null) + { + return Results.BadRequest(new { error = "A trigger targets a group OR a device, not both." }); + } + + var group = request.GroupId is { } groupId + ? await db.DeviceGroups.AsNoTracking().SingleOrDefaultAsync(g => g.Id == groupId, cancellationToken) + : null; + if (request.GroupId is not null && group is null) + { + return Results.NotFound(new { error = "Group not found." }); + } + + if (request.ClientId is not null + && !await db.Devices.AnyAsync(d => d.ClientId == request.ClientId, cancellationToken)) + { + return Results.NotFound(new { error = "Device not found." }); + } + + var allowed = await scope.GetAllowedClientIdsAsync(user, cancellationToken); + if (allowed is null) + { + return null; + } + + if (request.ClientId is { } clientId) + { + return allowed.Contains(clientId) ? null : Results.NotFound(new { error = "Device not found." }); + } + + if (group is null) + { + return Results.Json( + new { error = "Your role is limited to specific devices; target a device or a group." }, + statusCode: StatusCodes.Status403Forbidden); + } + + var members = await groups.GetMembersAsync(group, cancellationToken); + return members.All(allowed.Contains) + ? null + : Results.Json( + new { error = "That group reaches devices outside your role's scope." }, + statusCode: StatusCodes.Status403Forbidden); + } + + /// Copies the request onto the entity and computes the first run; returns an error message. + private static string? Apply(ScriptTriggerEntity entity, SaveScriptTriggerRequest request) + { + var name = request.Name?.Trim(); + if (name is { Length: > 200 }) + { + return "Name must be 200 characters or fewer."; + } + + var timeZone = string.IsNullOrWhiteSpace(request.TimeZoneId) ? "UTC" : request.TimeZoneId.Trim(); + string? cron = null; + DateTimeOffset? runOnce = null; + DateTimeOffset? nextRun = null; + var now = DateTimeOffset.UtcNow; + + if (request.TriggerType == ScriptTriggerType.Scheduled) + { + if (!string.IsNullOrWhiteSpace(request.CronExpression)) + { + cron = request.CronExpression.Trim(); + if (ScheduleCron.Validate(cron, timeZone) is { } invalid) + { + return invalid; + } + + nextRun = ScheduleCron.NextOccurrence(cron, timeZone, now); + if (nextRun is null) + { + return "This cron expression never fires."; + } + } + else if (request.RunOnceUtc is { } at) + { + if (ScheduleCron.ValidateTimeZone(timeZone) is { } invalid) + { + return invalid; + } + + // An enabled one-shot in the past would fire the moment it is + // saved — almost always a mistake in the picker, so refuse it. + if (request.Enabled && at < now - OneShotGrace) + { + return "The one-shot time is in the past."; + } + + runOnce = at; + nextRun = at < now - OneShotGrace ? null : at; + } + else + { + return "A scheduled trigger needs a cron expression or a one-shot time."; + } + } + else + { + // Event triggers have no cadence; the time zone is meaningless. + timeZone = "UTC"; + } + + entity.Name = string.IsNullOrEmpty(name) ? null : name; + entity.ScriptId = request.ScriptId; + entity.GroupId = request.GroupId; + entity.ClientId = request.ClientId; + entity.TriggerType = request.TriggerType; + entity.Enabled = request.Enabled; + entity.TimeZoneId = timeZone; + entity.CronExpression = cron; + entity.RunOnceUtc = runOnce; + entity.NextRunUtc = nextRun; + entity.ArgumentsJson = request.Arguments is { Count: > 0 } ? JsonDefaults.Serialize(request.Arguments) : null; + return null; + } + + private static string Describe(ScriptTriggerEntity trigger) + { + var target = trigger.ClientId is { } clientId ? $"device={clientId}" + : trigger.GroupId is { } groupId ? $"group={groupId:D}" + : "target=all"; + var cadence = trigger.CronExpression ?? trigger.RunOnceUtc?.ToString("O") ?? trigger.TriggerType.ToString(); + return $"trigger={trigger.Id:D} name={trigger.Name ?? "-"} script={trigger.ScriptId:D} {target} when={cadence}"; + } } diff --git a/src/Backend/Jobs/ScheduleCron.cs b/src/Backend/Jobs/ScheduleCron.cs index 0533c1b..de9bab0 100644 --- a/src/Backend/Jobs/ScheduleCron.cs +++ b/src/Backend/Jobs/ScheduleCron.cs @@ -21,6 +21,12 @@ public static class ScheduleCron return $"Invalid cron expression: {ex.Message}"; } + return ValidateTimeZone(timeZoneId); + } + + /// Returns an error message, or null when the IANA/Windows zone id resolves. + public static string? ValidateTimeZone(string timeZoneId) + { try { TimeZoneInfo.FindSystemTimeZoneById(timeZoneId); diff --git a/src/Backend/Jobs/ScheduleWorker.cs b/src/Backend/Jobs/ScheduleWorker.cs index 69b7bbc..f6cc44b 100644 --- a/src/Backend/Jobs/ScheduleWorker.cs +++ b/src/Backend/Jobs/ScheduleWorker.cs @@ -1,10 +1,6 @@ -using System.Text.Json; using Backend.Data; -using Backend.Groups; -using Backend.Secrets; using Microsoft.EntityFrameworkCore; using Shared.Contracts.Models; -using Shared.Contracts.Serialization; namespace Backend.Jobs; @@ -53,8 +49,7 @@ public sealed class ScheduleWorker(IServiceScopeFactory scopeFactory, ILogger(); - var runner = scope.ServiceProvider.GetRequiredService(); - var groups = scope.ServiceProvider.GetRequiredService(); + var executor = scope.ServiceProvider.GetRequiredService(); var now = DateTimeOffset.UtcNow; var due = await db.ScriptTriggers @@ -66,7 +61,7 @@ public sealed class ScheduleWorker(IServiceScopeFactory scopeFactory, ILogger s.Id == trigger.ScriptId, cancellationToken); - if (script is null) - { - trigger.Enabled = false; - trigger.LastResult = "Disabled: the script no longer exists."; - return; - } - - var devices = await ResolveTargetsAsync(trigger, db, groups, cancellationToken); - if (devices.Count == 0) - { - trigger.LastResult = "No eligible devices at fire time."; - return; - } - - PreparedScript prepared; - try - { - prepared = await runner.PrepareAsync(script, cancellationToken); - } - catch (Exception ex) when (ex is SecretResolutionException or Backend.Files.FileResolutionException) - { - trigger.LastResult = ex.Message; - logger.LogWarning("Scheduled trigger {TriggerId}: {Message}", trigger.Id, ex.Message); - return; - } - - var arguments = string.IsNullOrWhiteSpace(trigger.ArgumentsJson) - ? null - : JsonDefaults.Deserialize>(trigger.ArgumentsJson); - - var queued = 0; - var runId = Guid.NewGuid(); - foreach (var device in devices) - { - var job = await runner.CreateJobAsync(script, device.ClientId, "schedule", cancellationToken, runId); - await runner.DispatchAsync( - prepared, job, arguments, - $"Scheduled trigger queued “{script.Name}” for {device.Hostname}", - cancellationToken); - queued++; - } - - trigger.LastResult = $"{queued} job(s) queued"; - logger.LogInformation( - "Scheduled trigger {TriggerId} queued {Count} job(s) of “{Script}”", trigger.Id, queued, script.Name); - } - - private static async Task> ResolveTargetsAsync( - ScriptTriggerEntity trigger, - AppDbContext db, - DeviceGroupService groups, - CancellationToken cancellationToken) - { - if (trigger.ClientId is { } clientId) - { - var device = await db.Devices.AsNoTracking() - .SingleOrDefaultAsync(d => d.ClientId == clientId && !d.IsOrphaned, cancellationToken); - return device is null ? [] : [device]; - } - - if (trigger.GroupId is { } groupId) - { - var group = await db.DeviceGroups.AsNoTracking() - .SingleOrDefaultAsync(g => g.Id == groupId, cancellationToken); - if (group is null) - { - return []; - } - - var memberIds = await groups.GetMembersAsync(group, cancellationToken); - return await db.Devices.AsNoTracking() - .Where(d => memberIds.Contains(d.ClientId) && !d.IsOrphaned) - .ToListAsync(cancellationToken); - } - - // No target = all devices. - return await db.Devices.AsNoTracking() - .Where(d => !d.IsOrphaned) - .ToListAsync(cancellationToken); - } - private static void Advance(ScriptTriggerEntity trigger) { - trigger.LastRunUtc = DateTimeOffset.UtcNow; - if (trigger.CronExpression is { } cron) { try diff --git a/src/Backend/Jobs/TriggerExecutor.cs b/src/Backend/Jobs/TriggerExecutor.cs new file mode 100644 index 0000000..e03b0ac --- /dev/null +++ b/src/Backend/Jobs/TriggerExecutor.cs @@ -0,0 +1,120 @@ +using System.Text.Json; +using Backend.Data; +using Backend.Groups; +using Backend.Secrets; +using Microsoft.EntityFrameworkCore; +using Shared.Contracts.Serialization; + +namespace Backend.Jobs; + +/// What one firing of a trigger did. +public sealed record TriggerFiring(Guid? RunId, int Queued, string Message); + +/// +/// Fires a trigger against its current target (device, group or all devices) +/// as one execution. The schedule sweep and the operator's "Run now" share +/// this, so both record the same LastResult/LastRunId and pass the trigger's +/// captured arguments. The caller owns saving the trigger entity. +/// +public sealed class TriggerExecutor( + AppDbContext db, + JobRunner runner, + DeviceGroupService groups, + ILogger logger) +{ + public async Task FireAsync( + ScriptTriggerEntity trigger, string requestedBy, CancellationToken cancellationToken) + { + trigger.LastRunUtc = DateTimeOffset.UtcNow; + + var script = await db.Scripts.AsNoTracking() + .SingleOrDefaultAsync(s => s.Id == trigger.ScriptId, cancellationToken); + if (script is null) + { + trigger.Enabled = false; + return Record(trigger, new TriggerFiring(null, 0, "Disabled: the script no longer exists.")); + } + + var devices = await ResolveTargetsAsync(trigger, cancellationToken); + if (devices.Count == 0) + { + return Record(trigger, new TriggerFiring(null, 0, "No eligible devices at fire time.")); + } + + PreparedScript prepared; + try + { + prepared = await runner.PrepareAsync(script, cancellationToken); + } + catch (Exception ex) when (ex is SecretResolutionException or Backend.Files.FileResolutionException) + { + logger.LogWarning("Trigger {TriggerId}: {Message}", trigger.Id, ex.Message); + return Record(trigger, new TriggerFiring(null, 0, ex.Message)); + } + + var arguments = ParseArguments(trigger.ArgumentsJson); + var label = string.IsNullOrWhiteSpace(trigger.Name) ? "Scheduled trigger" : $"Schedule “{trigger.Name}”"; + var runId = Guid.NewGuid(); + foreach (var device in devices) + { + var job = await runner.CreateJobAsync(script, device.ClientId, requestedBy, cancellationToken, runId); + await runner.DispatchAsync( + prepared, job, arguments, + $"{label} queued “{script.Name}” for {device.Hostname}", + cancellationToken); + } + + logger.LogInformation( + "Trigger {TriggerId} queued {Count} job(s) of “{Script}”", trigger.Id, devices.Count, script.Name); + return Record(trigger, new TriggerFiring(runId, devices.Count, $"{devices.Count} job(s) queued")); + } + + /// Captured argument values, or null when none were saved. + public static Dictionary? ParseArguments(string? argumentsJson) + => string.IsNullOrWhiteSpace(argumentsJson) + ? null + : JsonDefaults.Deserialize>(argumentsJson); + + private static TriggerFiring Record(ScriptTriggerEntity trigger, TriggerFiring firing) + { + trigger.LastResult = firing.Message; + if (firing.RunId is not null) + { + trigger.LastRunId = firing.RunId; + } + + return firing; + } + + /// Non-orphaned devices the trigger targets right now. + private async Task> ResolveTargetsAsync( + ScriptTriggerEntity trigger, CancellationToken cancellationToken) + { + if (trigger.ClientId is { } clientId) + { + var device = await db.Devices.AsNoTracking() + .SingleOrDefaultAsync(d => d.ClientId == clientId && !d.IsOrphaned, cancellationToken); + return device is null ? [] : [device]; + } + + if (trigger.GroupId is { } groupId) + { + var group = await db.DeviceGroups.AsNoTracking() + .SingleOrDefaultAsync(g => g.Id == groupId, cancellationToken); + if (group is null) + { + return []; + } + + var memberIds = await groups.GetMembersAsync(group, cancellationToken); + return await db.Devices.AsNoTracking() + .Where(d => memberIds.Contains(d.ClientId) && !d.IsOrphaned) + .ToListAsync(cancellationToken); + } + + // No target = all devices. + return await db.Devices.AsNoTracking() + .Where(d => !d.IsOrphaned) + .ToListAsync(cancellationToken); + } +} diff --git a/src/Backend/Program.cs b/src/Backend/Program.cs index 3717748..f43a3b9 100644 --- a/src/Backend/Program.cs +++ b/src/Backend/Program.cs @@ -146,6 +146,7 @@ builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddScoped(); +builder.Services.AddScoped(); // S3: environment values are the bootstrap defaults; anything saved from the // Settings UI overrides them, so these are resolved per-request. builder.Services.AddSingleton(S3Options.FromConfiguration(builder.Configuration)); diff --git a/src/Backend/Security/AuditService.cs b/src/Backend/Security/AuditService.cs index ea40494..5432983 100644 --- a/src/Backend/Security/AuditService.cs +++ b/src/Backend/Security/AuditService.cs @@ -38,4 +38,5 @@ public static class AuditCategories public const string Shell = "shell"; public const string Admin = "admin"; public const string Settings = "settings"; + public const string Automation = "automation"; } diff --git a/src/Shared.Contracts/Api/ApiRoutes.cs b/src/Shared.Contracts/Api/ApiRoutes.cs index eca15c1..5112e12 100644 --- a/src/Shared.Contracts/Api/ApiRoutes.cs +++ b/src/Shared.Contracts/Api/ApiRoutes.cs @@ -46,6 +46,8 @@ public static class ApiRoutes public const string Triggers = "/api/triggers"; public const string Trigger = "/api/triggers/{id}"; + public const string TriggerRun = "/api/triggers/{id}/run"; + public const string TriggerPreview = "/api/triggers/preview"; public const string SecretsProviders = "/api/secrets/providers"; public const string SecretsProvider = "/api/secrets/providers/{id}"; @@ -96,6 +98,7 @@ public static class ApiRoutes public static string GroupMembers(Guid id) => $"/api/groups/{id:D}/members"; public static string DeviceTags(string clientId) => $"/api/devices/{Uri.EscapeDataString(clientId)}/tags"; public static string Trigger(Guid id) => $"/api/triggers/{id:D}"; + public static string TriggerRun(Guid id) => $"/api/triggers/{id:D}/run"; public static string SecretsProvider(Guid id) => $"/api/secrets/providers/{id:D}"; public static string SecretsProviderNames(Guid id) => $"/api/secrets/providers/{id:D}/secret-names"; public static string Job(Guid jobId) => $"/api/jobs/{jobId:D}"; diff --git a/src/Shared.Contracts/Api/ResourceDtos.cs b/src/Shared.Contracts/Api/ResourceDtos.cs index 85fcbc5..e7dbadf 100644 --- a/src/Shared.Contracts/Api/ResourceDtos.cs +++ b/src/Shared.Contracts/Api/ResourceDtos.cs @@ -69,12 +69,17 @@ public sealed record ScriptTriggerDto( DateTimeOffset? NextRunUtc, DateTimeOffset? LastRunUtc, string? LastResult, - DateTimeOffset CreatedUtc); + DateTimeOffset CreatedUtc, + string? Name = null, + Guid? LastRunId = null, + IReadOnlyDictionary? Arguments = null, + string? CreatedBy = null); /// -/// POST /api/triggers. Target: exactly one of ClientId / GroupId, or neither -/// for all devices. For TriggerType=Scheduled, supply CronExpression (recurring) -/// or RunOnceUtc (one-shot) plus an optional TimeZoneId and Arguments. +/// POST /api/triggers and PUT /api/triggers/{id}. Target: exactly one of +/// ClientId / GroupId, or neither for all devices. For TriggerType=Scheduled, +/// supply CronExpression (recurring) or RunOnceUtc (one-shot) plus an optional +/// TimeZoneId and Arguments. /// public sealed record SaveScriptTriggerRequest( Guid ScriptId, @@ -85,7 +90,17 @@ public sealed record SaveScriptTriggerRequest( string? CronExpression = null, DateTimeOffset? RunOnceUtc = null, string? TimeZoneId = null, - IReadOnlyDictionary? Arguments = null); + IReadOnlyDictionary? Arguments = null, + string? Name = null); + +/// POST /api/triggers/preview — upcoming fire times of a cadence, evaluated server-side. +public sealed record SchedulePreviewRequest(string? CronExpression, string? TimeZoneId, int Count = 5); + +/// Upcoming occurrences (UTC), or the validation error that prevents any. +public sealed record SchedulePreviewDto(IReadOnlyList Occurrences, string? Error); + +/// POST /api/triggers/{id}/run — what a manual firing queued. +public sealed record TriggerRunResultDto(Guid? RunId, int Queued, string Message); /// PATCH /api/triggers/{id} — enable or disable a trigger without deleting it. public sealed record SetTriggerEnabledRequest(bool Enabled); diff --git a/tests/Backend.Tests/TestClients.cs b/tests/Backend.Tests/TestClients.cs new file mode 100644 index 0000000..13528aa --- /dev/null +++ b/tests/Backend.Tests/TestClients.cs @@ -0,0 +1,99 @@ +using System.Net.Http.Json; +using Backend.Data; +using Microsoft.EntityFrameworkCore; +using Shared.Contracts.Models; + +namespace Backend.Tests; + +/// Signed-in HTTP clients and seed helpers shared by the endpoint tests. +internal static class TestClients +{ + /// + /// A client signed in as a local user holding the named system role, with + /// the double-submit CSRF header that cookie-authenticated writes require. + /// + public static async Task SignedInAsync( + this BackendTestFixture fixture, string username, string roleName = "Admin", Guid? roleId = null) + { + await fixture.WithDbAsync(async db => + { + if (await db.Users.AnyAsync(u => u.Username == username)) + { + return; + } + + var role = roleId is { } id + ? await db.Roles.SingleAsync(r => r.Id == id) + : await db.Roles.SingleAsync(r => r.IsSystem && r.Name == roleName); + var user = new UserEntity + { + Id = Guid.NewGuid(), + Username = username, + DisplayName = username, + Role = UserRole.Admin, + RoleId = role.Id, + AuthProvider = "local", + CreatedUtc = DateTimeOffset.UtcNow, + }; + user.PasswordHash = new Microsoft.AspNetCore.Identity.PasswordHasher() + .HashPassword(user, $"{username}-pass"); + db.Users.Add(user); + await db.SaveChangesAsync(); + }); + + var client = fixture.CreateClient(); + var login = await client.PostAsJsonAsync( + "/api/auth/login", new { username, password = $"{username}-pass" }); + login.EnsureSuccessStatusCode(); + + if (login.Headers.TryGetValues("Set-Cookie", out var cookies)) + { + var csrf = cookies + .Select(c => c.Split(';')[0]) + .FirstOrDefault(c => c.StartsWith("csrf_token=", StringComparison.Ordinal)); + if (csrf is not null) + { + client.DefaultRequestHeaders.Add("X-CSRF-Token", csrf["csrf_token=".Length..]); + } + } + + return client; + } + + public static Task SeedScriptAsync(this BackendTestFixture fixture, string name) + => fixture.WithDbAsync(async db => + { + var script = new ScriptEntity + { + Id = Guid.NewGuid(), + Name = name, + Language = "PowerShell", + Content = "Write-Output 'hello'", + CreatedUtc = DateTimeOffset.UtcNow, + UpdatedUtc = DateTimeOffset.UtcNow, + }; + db.Scripts.Add(script); + await db.SaveChangesAsync(); + return script.Id; + }); + + public static Task SeedDeviceAsync( + this BackendTestFixture fixture, string hostname, bool online = false, bool orphaned = false, + IReadOnlyList? tags = null) + => fixture.WithDbAsync(async db => + { + var clientId = $"client-{Guid.NewGuid():N}"[..20]; + db.Devices.Add(new DeviceEntity + { + ClientId = clientId, + Hostname = hostname, + NkeyPublic = $"U{Guid.NewGuid():N}", + EnrolledUtc = DateTimeOffset.UtcNow, + LastSeenUtc = online ? DateTimeOffset.UtcNow : DateTimeOffset.UtcNow.AddDays(-2), + IsOrphaned = orphaned, + TagsJson = tags is { Count: > 0 } ? Shared.Contracts.Serialization.JsonDefaults.Serialize(tags) : null, + }); + await db.SaveChangesAsync(); + return clientId; + }); +} diff --git a/tests/Backend.Tests/TriggerEndpointTests.cs b/tests/Backend.Tests/TriggerEndpointTests.cs new file mode 100644 index 0000000..bc33ef5 --- /dev/null +++ b/tests/Backend.Tests/TriggerEndpointTests.cs @@ -0,0 +1,146 @@ +using Microsoft.Extensions.DependencyInjection; +using System.Net; +using System.Net.Http.Json; +using Microsoft.EntityFrameworkCore; +using Shared.Contracts.Api; +using Shared.Contracts.Models; +using Shared.Contracts.Serialization; +using Xunit; + +namespace Backend.Tests; + +public class TriggerEndpointTests(BackendTestFixture fixture) : IClassFixture +{ + [Fact] + public async Task OneShotInThePastIsRefused() + { + using var client = await fixture.SignedInAsync("trigger-admin"); + var scriptId = await fixture.SeedScriptAsync("past-one-shot"); + + var response = await client.PostAsJsonAsync(ApiRoutes.Triggers, new SaveScriptTriggerRequest( + scriptId, ScriptTriggerType.Scheduled, RunOnceUtc: DateTimeOffset.UtcNow.AddHours(-2)), + JsonDefaults.Options); + + Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode); + Assert.Contains("in the past", await response.Content.ReadAsStringAsync()); + } + + [Fact] + public async Task UnknownTimeZoneIsReportedAsATimeZoneError() + { + using var client = await fixture.SignedInAsync("trigger-admin"); + var scriptId = await fixture.SeedScriptAsync("bad-zone"); + + var response = await client.PostAsJsonAsync(ApiRoutes.Triggers, new SaveScriptTriggerRequest( + scriptId, ScriptTriggerType.Scheduled, CronExpression: "0 1 * * *", TimeZoneId: "Not/AZone"), + JsonDefaults.Options); + + Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode); + Assert.Contains("time zone", await response.Content.ReadAsStringAsync()); + } + + [Fact] + public async Task EditingChangesTheCadenceAndName() + { + using var client = await fixture.SignedInAsync("trigger-admin"); + var scriptId = await fixture.SeedScriptAsync("editable"); + var id = await CreateAsync(client, new SaveScriptTriggerRequest( + scriptId, ScriptTriggerType.Scheduled, CronExpression: "0 1 * * *")); + + var update = await client.PutAsJsonAsync(ApiRoutes.For.Trigger(id), new SaveScriptTriggerRequest( + scriptId, ScriptTriggerType.Scheduled, CronExpression: "*/10 * * * *", Name: " Every ten "), + JsonDefaults.Options); + Assert.Equal(HttpStatusCode.NoContent, update.StatusCode); + + var trigger = (await ListAsync(client)).Single(t => t.Id == id); + Assert.Equal("Every ten", trigger.Name); + Assert.Equal("*/10 * * * *", trigger.CronExpression); + Assert.True(trigger.NextRunUtc <= DateTimeOffset.UtcNow.AddMinutes(10)); + } + + [Fact] + public async Task RunNowQueuesOneExecutionAndKeepsTheCadence() + { + using var client = await fixture.SignedInAsync("trigger-admin"); + var scriptId = await fixture.SeedScriptAsync("run-now"); + var clientId = await fixture.SeedDeviceAsync("RUN-NOW-HOST"); + var id = await CreateAsync(client, new SaveScriptTriggerRequest( + scriptId, ScriptTriggerType.Scheduled, ClientId: clientId, CronExpression: "0 3 * * *")); + var before = (await ListAsync(client)).Single(t => t.Id == id).NextRunUtc; + + var response = await client.PostAsync(ApiRoutes.For.TriggerRun(id), null); + response.EnsureSuccessStatusCode(); + var result = await response.Content.ReadFromJsonAsync(JsonDefaults.Options); + + Assert.Equal(1, result!.Queued); + Assert.NotNull(result.RunId); + var after = (await ListAsync(client)).Single(t => t.Id == id); + Assert.Equal(before, after.NextRunUtc); + Assert.Equal(result.RunId, after.LastRunId); + Assert.True(after.Enabled); + Assert.Equal(1, await fixture.WithDbAsync(db => db.Jobs.CountAsync(j => j.RunId == result.RunId))); + } + + [Fact] + public async Task PreviewListsUpcomingRunsOrTheError() + { + using var client = await fixture.SignedInAsync("trigger-admin"); + + var ok = await (await client.PostAsJsonAsync(ApiRoutes.TriggerPreview, + new SchedulePreviewRequest("*/15 * * * *", "UTC", 3), JsonDefaults.Options)) + .Content.ReadFromJsonAsync(JsonDefaults.Options); + Assert.Null(ok!.Error); + Assert.Equal(3, ok.Occurrences.Count); + + var bad = await (await client.PostAsJsonAsync(ApiRoutes.TriggerPreview, + new SchedulePreviewRequest("nope", "UTC"), JsonDefaults.Options)) + .Content.ReadFromJsonAsync(JsonDefaults.Options); + Assert.NotNull(bad!.Error); + Assert.Empty(bad.Occurrences); + } + + [Fact] + public async Task ScopedRoleCannotScheduleAgainstAllDevices() + { + var scopedRoleId = await fixture.WithDbAsync(async db => + { + var group = new Backend.Data.DeviceGroupEntity + { + Id = Guid.NewGuid(), Name = "scope-group", Kind = GroupKind.Static, + CreatedUtc = DateTimeOffset.UtcNow, UpdatedUtc = DateTimeOffset.UtcNow, + }; + var role = new Backend.Data.RoleEntity + { + Id = Guid.NewGuid(), Name = $"scoped-{Guid.NewGuid():N}", + PermissionsJson = JsonDefaults.Serialize(new[] { "*" }), + DeviceScopeGroupIdsJson = JsonDefaults.Serialize(new[] { group.Id }), + CreatedUtc = DateTimeOffset.UtcNow, UpdatedUtc = DateTimeOffset.UtcNow, + }; + db.DeviceGroups.Add(group); + db.Roles.Add(role); + await db.SaveChangesAsync(); + return role.Id; + }); + // Roles are cached; a row seeded behind the API's back needs a reload. + fixture.Services.GetRequiredService().Invalidate(); + + using var client = await fixture.SignedInAsync("scoped-scheduler", roleId: scopedRoleId); + var scriptId = await fixture.SeedScriptAsync("scoped-script"); + + var response = await client.PostAsJsonAsync(ApiRoutes.Triggers, new SaveScriptTriggerRequest( + scriptId, ScriptTriggerType.Scheduled, CronExpression: "0 1 * * *"), JsonDefaults.Options); + + Assert.Equal(HttpStatusCode.Forbidden, response.StatusCode); + } + + private static async Task CreateAsync(HttpClient client, SaveScriptTriggerRequest request) + { + var response = await client.PostAsJsonAsync(ApiRoutes.Triggers, request, JsonDefaults.Options); + response.EnsureSuccessStatusCode(); + var body = await response.Content.ReadFromJsonAsync>(JsonDefaults.Options); + return body!["id"]; + } + + private static async Task> ListAsync(HttpClient client) + => (await client.GetFromJsonAsync>(ApiRoutes.Triggers, JsonDefaults.Options))!; +} -- 2.52.0 From 8627aac7982a0a25c3d0d71ccc59479a1ce5273332fef17bea6006593003b783 Mon Sep 17 00:00:00 2001 From: Alphaeus Mote Date: Thu, 22 Oct 2026 20:39:34 -0400 Subject: [PATCH 03/72] feat(jobs): run now on any mix of devices and groups as one execution POST /api/jobs takes ClientIds alongside ClientId/GroupId/GroupIds; the targets are deduplicated, scope-filtered and dispatched under one RunId, which the response now returns. OnlineOnly skips devices that are not online (reported in SkippedOffline) instead of queueing for their return. A lone ClientId keeps its original contract (201 + JobDto, 404/409). Fixes: - A GroupIds-only request was rejected ("Target exactly one of clientId or groupId"), so multi-group runs from the script page never started. - Execution summaries left Dispatched jobs out of every tally; they now count as pending. Co-Authored-By: Claude Opus 5.5 --- src/Backend/Jobs/JobEndpoints.cs | 257 +++++++++-------------- src/Shared.Contracts/Api/ResourceDtos.cs | 22 +- tests/Backend.Tests/JobRunTests.cs | 119 +++++++++++ 3 files changed, 234 insertions(+), 164 deletions(-) create mode 100644 tests/Backend.Tests/JobRunTests.cs diff --git a/src/Backend/Jobs/JobEndpoints.cs b/src/Backend/Jobs/JobEndpoints.cs index b8f50ff..1beea90 100644 --- a/src/Backend/Jobs/JobEndpoints.cs +++ b/src/Backend/Jobs/JobEndpoints.cs @@ -46,7 +46,7 @@ public static class JobEndpoints g.Count(), g.Count(j => j.State == JobState.Succeeded), g.Count(j => j.State is JobState.Failed or JobState.TimedOut), - g.Count(j => j.State is JobState.Queued or JobState.Running))) + g.Count(j => j.State is JobState.Queued or JobState.Dispatched or JobState.Running))) .OrderByDescending(e => e.StartedUtc) .Take(50) .ToList(); @@ -148,9 +148,22 @@ public static class JobEndpoints HttpContext context, CancellationToken cancellationToken) { - if ((request.ClientId is null) == (request.GroupId is null)) + var groupIds = (request.GroupIds ?? []) + .Concat(request.GroupId is { } single ? [single] : []) + .Distinct() + .ToList(); + var clientIds = (request.ClientIds ?? []) + .Concat(request.ClientId is { } one ? [one] : []) + .Distinct(StringComparer.Ordinal) + .ToList(); + if (groupIds.Count == 0 && clientIds.Count == 0) { - return Results.BadRequest(new { error = "Target exactly one of clientId or groupId." }); + return Results.BadRequest(new { error = "Choose at least one device or group to run on." }); + } + + if (clientIds.FirstOrDefault(id => !SubjectIdentifier.IsValid(id)) is not null) + { + return Results.BadRequest(new { error = "Invalid client id." }); } var script = await db.Scripts.AsNoTracking() @@ -160,6 +173,14 @@ public static class JobEndpoints return Results.NotFound(new { error = "Script not found." }); } + // The original single-device contract: 404/409 on the device itself + // and the created JobDto back (CLI and older UIs depend on it). + var singleDevice = groupIds.Count == 0 && clientIds.Count == 1 && request.ClientIds is not { Count: > 0 }; + if (singleDevice && await CheckSingleDeviceAsync(clientIds[0], db, scope, context, cancellationToken) is { } refused) + { + return refused; + } + var actor = context.User.Identity?.Name; // Secrets, file presigns and the prelude are prepared once, before any @@ -176,182 +197,102 @@ public static class JobEndpoints return Results.Problem(ex.Message, statusCode: StatusCodes.Status502BadGateway); } - if (request.GroupIds is { Count: > 0 } groupIds) + var selected = await db.DeviceGroups.AsNoTracking() + .Where(g => groupIds.Contains(g.Id)) + .ToListAsync(cancellationToken); + if (selected.Count < groupIds.Count) { - return await RunOnGroupsAsync( - groupIds, prepared, request, db, runner, groups, scope, audit, actor, context, cancellationToken); + return Results.NotFound(new { error = groupIds.Count == 1 ? "Group not found." : "Some groups no longer exist." }); } - if (request.GroupId is { } groupId) + var targetIds = new HashSet(clientIds, StringComparer.Ordinal); + foreach (var group in selected) { - return await RunOnGroupAsync( - groupId, prepared, request, db, runner, groups, scope, audit, actor, context, cancellationToken); + targetIds.UnionWith(await groups.GetMembersAsync(group, cancellationToken)); } - if (!SubjectIdentifier.IsValid(request.ClientId)) + // A scoped role only reaches the devices inside its own scope. + var allowed = await scope.GetAllowedClientIdsAsync(context.User, cancellationToken); + if (allowed is not null) { - return Results.BadRequest(new { error = "Invalid client id." }); + targetIds.IntersectWith(allowed); } - if (!await scope.IsAllowedAsync(context.User, request.ClientId!, cancellationToken)) + var devices = await db.Devices.AsNoTracking() + .Where(d => targetIds.Contains(d.ClientId)) + .OrderBy(d => d.Hostname) + .ToListAsync(cancellationToken); + + var now = DateTimeOffset.UtcNow; + var jobs = new List(); + var skippedOrphaned = new List(); + var skippedOffline = new List(); + var runId = Guid.NewGuid(); + var via = selected.Count == 1 && clientIds.Count == 0 ? $" (group “{selected[0].Name}”)" : string.Empty; + + // Devices currently offline still get a job unless OnlineOnly: dispatch + // is durable (JetStream holds it until they return). + foreach (var device in devices) + { + if (device.IsOrphaned) + { + skippedOrphaned.Add(device.Hostname); + continue; + } + + if (request.OnlineOnly && ProtocolDefaults.CalculateStatus(device.LastSeenUtc, now) != DeviceStatus.Online) + { + skippedOffline.Add(device.Hostname); + continue; + } + + var job = await runner.CreateJobAsync(script, device.ClientId, actor, cancellationToken, runId); + await runner.DispatchAsync( + prepared, job, request.Arguments, + $"Job “{script.Name}” queued for {device.Hostname}{via}", cancellationToken); + jobs.Add(ToDto(job, device.Hostname)); + } + + if (singleDevice && jobs.Count == 1) + { + await audit.LogAsync(AuditCategories.Jobs, "created", actor, + clientId: jobs[0].ClientId, detail: $"script={script.Name} job={jobs[0].JobId}", + cancellationToken: cancellationToken); + return Results.Created(ApiRoutes.For.Job(jobs[0].JobId), jobs[0]); + } + + await audit.LogAsync(AuditCategories.Jobs, "group-run", actor, + detail: $"script={script.Name} run={runId} groups={selected.Count} devices={clientIds.Count} " + + $"jobs={jobs.Count} skippedOrphaned={skippedOrphaned.Count} skippedOffline={skippedOffline.Count}", + cancellationToken: cancellationToken); + + return Results.Ok(new GroupRunDto( + jobs, skippedOrphaned, jobs.Count > 0 ? runId : null, skippedOffline)); + } + + /// Refusal for a single-device run (unknown, out of scope, orphaned), or null. + private static async Task CheckSingleDeviceAsync( + string clientId, AppDbContext db, DeviceScopeService scope, HttpContext context, + CancellationToken cancellationToken) + { + if (!await scope.IsAllowedAsync(context.User, clientId, cancellationToken)) { return Results.NotFound(new { error = "Device not found." }); } var device = await db.Devices.AsNoTracking() - .SingleOrDefaultAsync(d => d.ClientId == request.ClientId, cancellationToken); + .SingleOrDefaultAsync(d => d.ClientId == clientId, cancellationToken); if (device is null) { return Results.NotFound(new { error = "Device not found." }); } - if (device.IsOrphaned) - { - return Results.Conflict(new + return device.IsOrphaned + ? Results.Conflict(new { error = "Device is orphaned. Push a new bootstrap token to the endpoint so the agent re-enrolls.", - }); - } - - var job = await runner.CreateJobAsync(script, device.ClientId, actor, cancellationToken, Guid.NewGuid()); - await runner.DispatchAsync( - prepared, job, request.Arguments, - $"Job “{script.Name}” queued for {device.Hostname}", cancellationToken); - - await audit.LogAsync(AuditCategories.Jobs, "created", actor, - clientId: device.ClientId, detail: $"script={script.Name} job={job.JobId}", - cancellationToken: cancellationToken); - - return Results.Created(ApiRoutes.For.Job(job.JobId), ToDto(job, device.Hostname)); - } - - /// One job per non-orphaned member; devices currently offline still - /// get one because dispatch is durable (JetStream holds it until they return). - private static async Task RunOnGroupAsync( - Guid groupId, - PreparedScript prepared, - CreateJobRequest request, - AppDbContext db, - JobRunner runner, - Backend.Groups.DeviceGroupService groups, - DeviceScopeService scope, - AuditService audit, - string? actor, - HttpContext context, - CancellationToken cancellationToken) - { - var group = await db.DeviceGroups.AsNoTracking() - .SingleOrDefaultAsync(g => g.Id == groupId, cancellationToken); - if (group is null) - { - return Results.NotFound(new { error = "Group not found." }); - } - - var memberIds = await groups.GetMembersAsync(group, cancellationToken); - - // A scoped role can only reach the members inside its own device scope. - var allowed = await scope.GetAllowedClientIdsAsync(context.User, cancellationToken); - if (allowed is not null) - { - memberIds = memberIds.Where(allowed.Contains).ToList(); - } - - var devices = await db.Devices.AsNoTracking() - .Where(d => memberIds.Contains(d.ClientId)) - .ToListAsync(cancellationToken); - - var jobs = new List(); - var skipped = new List(); - var runId = Guid.NewGuid(); - - foreach (var device in devices) - { - if (device.IsOrphaned) - { - skipped.Add(device.Hostname); - continue; - } - - var job = await runner.CreateJobAsync(prepared.Script, device.ClientId, actor, cancellationToken, runId); - await runner.DispatchAsync( - prepared, job, request.Arguments, - $"Job “{prepared.Script.Name}” queued for {device.Hostname} (group “{group.Name}”)", - cancellationToken); - jobs.Add(ToDto(job, device.Hostname)); - } - - await audit.LogAsync(AuditCategories.Jobs, "group-run", actor, - detail: $"script={prepared.Script.Name} group={group.Name} jobs={jobs.Count} skipped={skipped.Count}", - cancellationToken: cancellationToken); - - return Results.Ok(new GroupRunDto(jobs, skipped)); - } - - /// Run across the deduped union of several groups' members, as one execution. - private static async Task RunOnGroupsAsync( - IReadOnlyList groupIds, - PreparedScript prepared, - CreateJobRequest request, - AppDbContext db, - JobRunner runner, - Backend.Groups.DeviceGroupService groups, - DeviceScopeService scope, - AuditService audit, - string? actor, - HttpContext context, - CancellationToken cancellationToken) - { - var selected = await db.DeviceGroups.AsNoTracking() - .Where(g => groupIds.Contains(g.Id)) - .ToListAsync(cancellationToken); - if (selected.Count == 0) - { - return Results.NotFound(new { error = "No matching groups." }); - } - - var memberIds = new HashSet(); - foreach (var group in selected) - { - foreach (var member in await groups.GetMembersAsync(group, cancellationToken)) - { - memberIds.Add(member); - } - } - - var allowed = await scope.GetAllowedClientIdsAsync(context.User, cancellationToken); - if (allowed is not null) - { - memberIds.IntersectWith(allowed); - } - - var devices = await db.Devices.AsNoTracking() - .Where(d => memberIds.Contains(d.ClientId)) - .ToListAsync(cancellationToken); - - var jobs = new List(); - var skipped = new List(); - var runId = Guid.NewGuid(); - - foreach (var device in devices) - { - if (device.IsOrphaned) - { - skipped.Add(device.Hostname); - continue; - } - - var job = await runner.CreateJobAsync(prepared.Script, device.ClientId, actor, cancellationToken, runId); - await runner.DispatchAsync( - prepared, job, request.Arguments, - $"Job “{prepared.Script.Name}” queued for {device.Hostname}", cancellationToken); - jobs.Add(ToDto(job, device.Hostname)); - } - - await audit.LogAsync(AuditCategories.Jobs, "group-run", actor, - detail: $"script={prepared.Script.Name} groups={selected.Count} jobs={jobs.Count} skipped={skipped.Count}", - cancellationToken: cancellationToken); - - return Results.Ok(new GroupRunDto(jobs, skipped)); + }) + : null; } private static JobDto ToDto(JobEntity job, string? hostname) => new( diff --git a/src/Shared.Contracts/Api/ResourceDtos.cs b/src/Shared.Contracts/Api/ResourceDtos.cs index e7dbadf..cac15e7 100644 --- a/src/Shared.Contracts/Api/ResourceDtos.cs +++ b/src/Shared.Contracts/Api/ResourceDtos.cs @@ -238,20 +238,30 @@ public sealed record JobDto( string? RequestedBy, string? OutputSummary); -/// POST /api/jobs request body. maps -/// parameter name → typed JSON value per the script's parameter schema. -/// Targets exactly one of ClientId (single device) or GroupId (fan-out). +/// +/// POST /api/jobs request body. maps parameter +/// name → typed JSON value per the script's parameter schema. Targets are any +/// mix of devices (ClientId/ClientIds) and groups +/// (GroupId/GroupIds), deduplicated into one execution. A lone +/// ClientId answers with the single ; anything else +/// with a . OnlineOnly skips devices that are +/// not online now instead of queueing for their return. +/// public sealed record CreateJobRequest( string? ClientId, Guid ScriptId, IReadOnlyDictionary? Arguments = null, Guid? GroupId = null, - IReadOnlyList? GroupIds = null); + IReadOnlyList? GroupIds = null, + IReadOnlyList? ClientIds = null, + bool OnlineOnly = false); -/// Result of a group fan-out run: one job per eligible member. +/// Result of a fan-out run: one job per eligible target, all sharing RunId. public sealed record GroupRunDto( IReadOnlyList Jobs, - IReadOnlyList SkippedOrphaned); + IReadOnlyList SkippedOrphaned, + Guid? RunId = null, + IReadOnlyList? SkippedOffline = null); /// A labeled count used by the dashboard charts. public sealed record CountPoint(string Label, int Count); diff --git a/tests/Backend.Tests/JobRunTests.cs b/tests/Backend.Tests/JobRunTests.cs new file mode 100644 index 0000000..0ae8b45 --- /dev/null +++ b/tests/Backend.Tests/JobRunTests.cs @@ -0,0 +1,119 @@ +using System.Net; +using System.Net.Http.Json; +using Backend.Data; +using Shared.Contracts.Api; +using Shared.Contracts.Models; +using Shared.Contracts.Serialization; +using Xunit; + +namespace Backend.Tests; + +public class JobRunTests(BackendTestFixture fixture) : IClassFixture +{ + [Fact] + public async Task DevicesAndGroupsRunAsOneDeduplicatedExecution() + { + using var client = await fixture.SignedInAsync("run-admin"); + var scriptId = await fixture.SeedScriptAsync("multi-target"); + var a = await fixture.SeedDeviceAsync("RUN-A"); + var b = await fixture.SeedDeviceAsync("RUN-B"); + var c = await fixture.SeedDeviceAsync("RUN-C"); + var orphan = await fixture.SeedDeviceAsync("RUN-ORPHAN", orphaned: true); + var groupId = await SeedStaticGroupAsync("run-group", b, c, orphan); + + var run = await RunAsync(client, new CreateJobRequest( + null, scriptId, GroupIds: [groupId], ClientIds: [a, b])); + + Assert.NotNull(run.RunId); + Assert.Equal(["RUN-A", "RUN-B", "RUN-C"], run.Jobs.Select(j => j.Hostname).Order()); + Assert.Equal(["RUN-ORPHAN"], run.SkippedOrphaned); + Assert.All(run.Jobs, j => Assert.Equal(scriptId, j.ScriptId)); + } + + [Fact] + public async Task OnlineOnlySkipsDevicesThatAreNotOnline() + { + using var client = await fixture.SignedInAsync("run-admin"); + var scriptId = await fixture.SeedScriptAsync("online-only"); + var up = await fixture.SeedDeviceAsync("ONLINE-HOST", online: true); + var down = await fixture.SeedDeviceAsync("OFFLINE-HOST"); + + var run = await RunAsync(client, new CreateJobRequest( + null, scriptId, ClientIds: [up, down], OnlineOnly: true)); + + Assert.Equal("ONLINE-HOST", Assert.Single(run.Jobs).Hostname); + Assert.Equal(["OFFLINE-HOST"], run.SkippedOffline); + } + + [Fact] + public async Task SeveralGroupsAloneAreAValidTarget() + { + using var client = await fixture.SignedInAsync("run-admin"); + var scriptId = await fixture.SeedScriptAsync("groups-only"); + var g1 = await SeedStaticGroupAsync("groups-only-1", await fixture.SeedDeviceAsync("G1-HOST")); + var g2 = await SeedStaticGroupAsync("groups-only-2", await fixture.SeedDeviceAsync("G2-HOST")); + + var run = await RunAsync(client, new CreateJobRequest(null, scriptId, GroupIds: [g1, g2])); + + Assert.Equal(2, run.Jobs.Count); + var runIds = await fixture.WithDbAsync(async db => await Task.FromResult(db.Jobs + .Where(j => run.Jobs.Select(r => r.JobId).Contains(j.JobId)) + .Select(j => j.RunId).Distinct().ToList())); + Assert.Equal([run.RunId], runIds); + } + + [Fact] + public async Task ASingleDeviceStillAnswersWithItsJob() + { + using var client = await fixture.SignedInAsync("run-admin"); + var scriptId = await fixture.SeedScriptAsync("single"); + var device = await fixture.SeedDeviceAsync("SINGLE-HOST"); + + var response = await client.PostAsJsonAsync( + ApiRoutes.Jobs, new CreateJobRequest(device, scriptId), JsonDefaults.Options); + + Assert.Equal(HttpStatusCode.Created, response.StatusCode); + var job = await response.Content.ReadFromJsonAsync(JsonDefaults.Options); + Assert.Equal("SINGLE-HOST", job!.Hostname); + } + + [Fact] + public async Task NoTargetIsABadRequest() + { + using var client = await fixture.SignedInAsync("run-admin"); + var scriptId = await fixture.SeedScriptAsync("no-target"); + + var response = await client.PostAsJsonAsync( + ApiRoutes.Jobs, new CreateJobRequest(null, scriptId), JsonDefaults.Options); + + Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode); + } + + private static async Task RunAsync(HttpClient client, CreateJobRequest request) + { + var response = await client.PostAsJsonAsync(ApiRoutes.Jobs, request, JsonDefaults.Options); + response.EnsureSuccessStatusCode(); + return (await response.Content.ReadFromJsonAsync(JsonDefaults.Options))!; + } + + private Task SeedStaticGroupAsync(string name, params string[] members) + => fixture.WithDbAsync(async db => + { + var group = new DeviceGroupEntity + { + Id = Guid.NewGuid(), Name = name, Kind = GroupKind.Static, + CreatedUtc = DateTimeOffset.UtcNow, UpdatedUtc = DateTimeOffset.UtcNow, + }; + db.DeviceGroups.Add(group); + foreach (var member in members) + { + db.DeviceGroupMembers.Add(new DeviceGroupMemberEntity + { + GroupId = group.Id, ClientId = member, AddedUtc = DateTimeOffset.UtcNow, + }); + } + + await db.SaveChangesAsync(); + return group.Id; + }); +} -- 2.52.0 From 9b141f9e551be155e32506744c0c0d1d6ccb87c2ca8d4fcbffd14b8fb98f9e16 Mon Sep 17 00:00:00 2001 From: Alphaeus Mote Date: Thu, 22 Oct 2026 20:47:11 -0400 Subject: [PATCH 04/72] feat(groups): nested groups and folders; one membership pass per request Groups now form a tree (ParentId, at most 8 levels) and gain a Folder kind that holds no devices of its own. A group's effective membership includes every group nested under it, so running, scheduling or scoping a role on a parent reaches its whole subtree. - POST /api/groups/{id}/move re-parents a group; moves into itself or its own subtree, or past the depth limit, are refused. - GroupMembership evaluates every group once per request (one read of groups, static members, devices and, only when needed, inventory) instead of re-reading the fleet per group on the list endpoint. - Group DTOs carry ParentId, DirectMemberCount and OnlineCount; device rows carry their direct GroupIds so the console can draw the tree and filter by node; a device's groups mark ancestors as Inherited. - Deleting a group lifts its children to its parent and disables triggers that targeted it (with the reason recorded). A group that scopes a role is refused: dropping it would silently widen the role to all devices. - Switching a static group to another kind drops its member rows; folders and dynamic groups refuse explicit members; member edits are batched, ignore unknown devices and are audited, as are updates and deletes. Co-Authored-By: Claude Opus 5.5 --- src/Backend/Api/DeviceEndpoints.cs | 33 +- src/Backend/Data/Entities.cs | 4 +- ...20261023004353_AddGroupNesting.Designer.cs | 742 ++++++++++++++++++ .../20261023004353_AddGroupNesting.cs | 29 + .../PostgresAppDbContextModelSnapshot.cs | 3 + ...20261023004406_AddGroupNesting.Designer.cs | 742 ++++++++++++++++++ .../20261023004406_AddGroupNesting.cs | 29 + .../SqlServerAppDbContextModelSnapshot.cs | 3 + ...20261023004330_AddGroupNesting.Designer.cs | 729 +++++++++++++++++ .../Sqlite/20261023004330_AddGroupNesting.cs | 29 + .../Sqlite/SqliteAppDbContextModelSnapshot.cs | 3 + src/Backend/Groups/DeviceGroupService.cs | 278 ++++++- src/Backend/Groups/GroupEndpoints.cs | 250 ++++-- src/Shared.Contracts/Api/ApiRoutes.cs | 2 + src/Shared.Contracts/Api/ResourceDtos.cs | 25 +- src/Shared.Contracts/Models/GroupRules.cs | 7 +- tests/Backend.Tests/GroupNestingTests.cs | 159 ++++ 17 files changed, 2961 insertions(+), 106 deletions(-) create mode 100644 src/Backend/Data/Migrations/Postgres/20261023004353_AddGroupNesting.Designer.cs create mode 100644 src/Backend/Data/Migrations/Postgres/20261023004353_AddGroupNesting.cs create mode 100644 src/Backend/Data/Migrations/SqlServer/20261023004406_AddGroupNesting.Designer.cs create mode 100644 src/Backend/Data/Migrations/SqlServer/20261023004406_AddGroupNesting.cs create mode 100644 src/Backend/Data/Migrations/Sqlite/20261023004330_AddGroupNesting.Designer.cs create mode 100644 src/Backend/Data/Migrations/Sqlite/20261023004330_AddGroupNesting.cs create mode 100644 tests/Backend.Tests/GroupNestingTests.cs diff --git a/src/Backend/Api/DeviceEndpoints.cs b/src/Backend/Api/DeviceEndpoints.cs index 2027cce..a71a01c 100644 --- a/src/Backend/Api/DeviceEndpoints.cs +++ b/src/Backend/Api/DeviceEndpoints.cs @@ -21,7 +21,8 @@ public static class DeviceEndpoints } private static async Task ListAsync( - AppDbContext db, DeviceScopeService scope, HttpContext context, CancellationToken cancellationToken) + AppDbContext db, Groups.DeviceGroupService groups, DeviceScopeService scope, HttpContext context, + CancellationToken cancellationToken) { var devices = await db.Devices.AsNoTracking() .OrderBy(d => d.Hostname) @@ -34,8 +35,31 @@ public static class DeviceEndpoints devices = devices.Where(d => allowed.Contains(d.ClientId)).ToList(); } + // Direct group memberships ride along so the console can draw the + // group tree's counts and filter by node without a call per group. + Dictionary>? groupIds = null; + if (await db.DeviceGroups.AnyAsync(cancellationToken)) + { + var membership = await groups.GetMembershipAsync(cancellationToken); + groupIds = new Dictionary>(StringComparer.Ordinal); + foreach (var group in membership.Groups) + { + foreach (var clientId in membership.Direct(group.Id)) + { + if (!groupIds.TryGetValue(clientId, out var list)) + { + groupIds[clientId] = list = []; + } + + list.Add(group.Id); + } + } + } + var now = DateTimeOffset.UtcNow; - return Results.Ok(devices.Select(d => ToDto(d, now)).ToList()); + return Results.Ok(devices + .Select(d => ToDto(d, now, groupIds is null ? null : groupIds.GetValueOrDefault(d.ClientId) ?? [])) + .ToList()); } private static async Task GetAsync( @@ -103,7 +127,7 @@ public static class DeviceEndpoints : Results.Problem(statusCode: StatusCodes.Status503ServiceUnavailable, title: "Messaging unavailable."); } - internal static DeviceDto ToDto(DeviceEntity device, DateTimeOffset now) + internal static DeviceDto ToDto(DeviceEntity device, DateTimeOffset now, IReadOnlyList? groupIds = null) { IReadOnlyList addresses = []; if (!string.IsNullOrEmpty(device.IpAddressesJson)) @@ -125,6 +149,7 @@ public static class DeviceEndpoints EnrolledUtc: device.EnrolledUtc, Tags: Groups.DeviceGroupService.ParseTags(device.TagsJson), IsOrphaned: device.IsOrphaned, - PublicIp: device.PublicIp); + PublicIp: device.PublicIp, + GroupIds: groupIds); } } diff --git a/src/Backend/Data/Entities.cs b/src/Backend/Data/Entities.cs index 6ddc319..87b7703 100644 --- a/src/Backend/Data/Entities.cs +++ b/src/Backend/Data/Entities.cs @@ -89,10 +89,12 @@ public sealed class DeviceEntity public DeviceInventoryEntity? Inventory { get; set; } } -/// A static or rule-based dynamic device group. +/// A static, rule-based dynamic, or folder device group; groups nest via ParentId. public sealed class DeviceGroupEntity { public Guid Id { get; set; } + /// Enclosing group; null for a top-level group. + public Guid? ParentId { get; set; } public required string Name { get; set; } public string? Description { get; set; } public GroupKind Kind { get; set; } diff --git a/src/Backend/Data/Migrations/Postgres/20261023004353_AddGroupNesting.Designer.cs b/src/Backend/Data/Migrations/Postgres/20261023004353_AddGroupNesting.Designer.cs new file mode 100644 index 0000000..a4017c5 --- /dev/null +++ b/src/Backend/Data/Migrations/Postgres/20261023004353_AddGroupNesting.Designer.cs @@ -0,0 +1,742 @@ +// +using System; +using Backend.Data; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace Backend.Data.Migrations.Postgres +{ + [DbContext(typeof(PostgresAppDbContext))] + [Migration("20261023004353_AddGroupNesting")] + partial class AddGroupNesting + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "10.0.10") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("Backend.Data.AppSettingEntity", b => + { + b.Property("Key") + .HasColumnType("text"); + + b.Property("IsSecret") + .HasColumnType("boolean"); + + b.Property("UpdatedBy") + .HasColumnType("text"); + + b.Property("UpdatedUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("Value") + .HasColumnType("text"); + + b.HasKey("Key"); + + b.ToTable("AppSettings", (string)null); + }); + + modelBuilder.Entity("Backend.Data.AuditEventEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Action") + .IsRequired() + .HasColumnType("text"); + + b.Property("Actor") + .HasColumnType("text"); + + b.Property("Category") + .IsRequired() + .HasColumnType("text"); + + b.Property("ClientId") + .HasColumnType("text"); + + b.Property("Detail") + .HasColumnType("text"); + + b.Property("RemoteIp") + .HasColumnType("text"); + + b.Property("TimestampUtc") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("TimestampUtc"); + + b.ToTable("AuditEvents", (string)null); + }); + + modelBuilder.Entity("Backend.Data.BootstrapTokenEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("CreatedUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiresUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("MaxUses") + .HasColumnType("integer"); + + b.Property("Note") + .HasColumnType("text"); + + b.Property("Revoked") + .HasColumnType("boolean"); + + b.Property("TokenHash") + .IsRequired() + .HasColumnType("text"); + + b.Property("Uses") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("TokenHash") + .IsUnique(); + + b.ToTable("BootstrapTokens", (string)null); + }); + + modelBuilder.Entity("Backend.Data.DeviceEntity", b => + { + b.Property("ClientId") + .HasColumnType("text"); + + b.Property("AgentVersion") + .HasColumnType("text"); + + b.Property("EnrolledUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("EnrollmentId") + .HasColumnType("uuid"); + + b.Property("Hostname") + .IsRequired() + .HasColumnType("text"); + + b.Property("IpAddressesJson") + .HasColumnType("text"); + + b.Property("IsOrphaned") + .HasColumnType("boolean"); + + b.Property("LastSeenUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("Manufacturer") + .HasColumnType("text"); + + b.Property("Model") + .HasColumnType("text"); + + b.Property("NkeyPublic") + .IsRequired() + .HasColumnType("text"); + + b.Property("OrphanedUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("OsCaption") + .HasColumnType("text"); + + b.Property("OsVersion") + .HasColumnType("text"); + + b.Property("PublicIp") + .HasColumnType("text"); + + b.Property("ReadyUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("TagsJson") + .HasColumnType("text"); + + b.HasKey("ClientId"); + + b.HasIndex("Hostname"); + + b.ToTable("Devices", (string)null); + }); + + modelBuilder.Entity("Backend.Data.DeviceGroupEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CreatedUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("Kind") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("ParentId") + .HasColumnType("uuid"); + + b.Property("RulesJson") + .HasColumnType("text"); + + b.Property("UpdatedBy") + .HasColumnType("text"); + + b.Property("UpdatedUtc") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("DeviceGroups", (string)null); + }); + + modelBuilder.Entity("Backend.Data.DeviceGroupMemberEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AddedUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("text"); + + b.Property("GroupId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("GroupId", "ClientId") + .IsUnique(); + + b.ToTable("DeviceGroupMembers", (string)null); + }); + + modelBuilder.Entity("Backend.Data.DeviceInventoryEntity", b => + { + b.Property("ClientId") + .HasColumnType("text"); + + b.Property("ReportJson") + .IsRequired() + .HasColumnType("text"); + + b.Property("UpdatedUtc") + .HasColumnType("timestamp with time zone"); + + b.HasKey("ClientId"); + + b.ToTable("DeviceInventory", (string)null); + }); + + modelBuilder.Entity("Backend.Data.FunctionModuleEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Content") + .IsRequired() + .HasColumnType("text"); + + b.Property("CreatedUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("UpdatedBy") + .HasColumnType("text"); + + b.Property("UpdatedUtc") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("FunctionModules", (string)null); + }); + + modelBuilder.Entity("Backend.Data.JobEntity", b => + { + b.Property("JobId") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("text"); + + b.Property("CompletedUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("CreatedUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("ExitCode") + .HasColumnType("integer"); + + b.Property("OutputSummary") + .HasColumnType("text"); + + b.Property("RequestedBy") + .HasColumnType("text"); + + b.Property("RunId") + .HasColumnType("uuid"); + + b.Property("ScriptId") + .HasColumnType("uuid"); + + b.Property("ScriptName") + .IsRequired() + .HasColumnType("text"); + + b.Property("StartedUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("State") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("JobId"); + + b.HasIndex("ClientId"); + + b.HasIndex("CreatedUtc"); + + b.HasIndex("ScriptId", "RunId"); + + b.ToTable("Jobs", (string)null); + }); + + modelBuilder.Entity("Backend.Data.JobOutputEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("JobId") + .HasColumnType("uuid"); + + b.Property("Sequence") + .HasColumnType("bigint"); + + b.Property("Stream") + .IsRequired() + .HasColumnType("text"); + + b.Property("Text") + .IsRequired() + .HasColumnType("text"); + + b.Property("TimestampUtc") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("JobId", "Sequence") + .IsUnique(); + + b.ToTable("JobOutput", (string)null); + }); + + modelBuilder.Entity("Backend.Data.OidcProviderEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Authority") + .IsRequired() + .HasColumnType("text"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Enabled") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("OidcProviders", (string)null); + }); + + modelBuilder.Entity("Backend.Data.RoleEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CreatedUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("DeviceScopeGroupIdsJson") + .HasColumnType("text"); + + b.Property("IsSystem") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("OidcClaimValuesJson") + .HasColumnType("text"); + + b.Property("PermissionsJson") + .HasColumnType("text"); + + b.Property("UpdatedBy") + .HasColumnType("text"); + + b.Property("UpdatedUtc") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("Roles", (string)null); + }); + + modelBuilder.Entity("Backend.Data.ScriptEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Content") + .IsRequired() + .HasColumnType("text"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("CreatedUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("FileBindingsJson") + .HasColumnType("text"); + + b.Property("FunctionModuleIdsJson") + .HasColumnType("text"); + + b.Property("Language") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("ParametersJson") + .HasColumnType("text"); + + b.Property("SecretBindingsJson") + .HasColumnType("text"); + + b.Property("SecretsVariableName") + .HasColumnType("text"); + + b.Property("UpdatedBy") + .HasColumnType("text"); + + b.Property("UpdatedUtc") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("Scripts", (string)null); + }); + + modelBuilder.Entity("Backend.Data.ScriptTriggerEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ArgumentsJson") + .HasColumnType("text"); + + b.Property("ClientId") + .HasColumnType("text"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("CreatedUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("CronExpression") + .HasColumnType("text"); + + b.Property("Enabled") + .HasColumnType("boolean"); + + b.Property("GroupId") + .HasColumnType("uuid"); + + b.Property("LastResult") + .HasColumnType("text"); + + b.Property("LastRunId") + .HasColumnType("uuid"); + + b.Property("LastRunUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("NextRunUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("OncePerDevice") + .HasColumnType("boolean"); + + b.Property("RunOnceUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("ScriptId") + .HasColumnType("uuid"); + + b.Property("TimeZoneId") + .IsRequired() + .HasColumnType("text"); + + b.Property("TriggerType") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("NextRunUtc"); + + b.HasIndex("TriggerType"); + + b.ToTable("ScriptTriggers", (string)null); + }); + + modelBuilder.Entity("Backend.Data.ScriptTriggerRunEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("text"); + + b.Property("FiredUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("JobId") + .HasColumnType("uuid"); + + b.Property("TriggerId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("TriggerId", "ClientId") + .IsUnique(); + + b.ToTable("ScriptTriggerRuns", (string)null); + }); + + modelBuilder.Entity("Backend.Data.SecretsProviderEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ConfigProtected") + .IsRequired() + .HasColumnType("text"); + + b.Property("CreatedUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("Kind") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("UpdatedBy") + .HasColumnType("text"); + + b.Property("UpdatedUtc") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("SecretsProviders", (string)null); + }); + + modelBuilder.Entity("Backend.Data.ShellSessionEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("text"); + + b.Property("CloseReason") + .HasColumnType("text"); + + b.Property("ClosedUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("CreatedUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("RequestedBy") + .HasColumnType("text"); + + b.Property("State") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("ShellSessions", (string)null); + }); + + modelBuilder.Entity("Backend.Data.UserEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AuthProvider") + .IsRequired() + .HasColumnType("text"); + + b.Property("CreatedUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("DisplayName") + .HasColumnType("text"); + + b.Property("ExternalId") + .HasColumnType("text"); + + b.Property("LastLoginUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("MustChangePassword") + .HasColumnType("boolean"); + + b.Property("PasswordHash") + .HasColumnType("text"); + + b.Property("Role") + .IsRequired() + .HasColumnType("text"); + + b.Property("RoleId") + .HasColumnType("uuid"); + + b.Property("Username") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("Username") + .IsUnique(); + + b.ToTable("Users", (string)null); + }); + + modelBuilder.Entity("Backend.Data.DeviceInventoryEntity", b => + { + b.HasOne("Backend.Data.DeviceEntity", null) + .WithOne("Inventory") + .HasForeignKey("Backend.Data.DeviceInventoryEntity", "ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Backend.Data.DeviceEntity", b => + { + b.Navigation("Inventory"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/Backend/Data/Migrations/Postgres/20261023004353_AddGroupNesting.cs b/src/Backend/Data/Migrations/Postgres/20261023004353_AddGroupNesting.cs new file mode 100644 index 0000000..f26f4b4 --- /dev/null +++ b/src/Backend/Data/Migrations/Postgres/20261023004353_AddGroupNesting.cs @@ -0,0 +1,29 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Backend.Data.Migrations.Postgres +{ + /// + public partial class AddGroupNesting : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "ParentId", + table: "DeviceGroups", + type: "uuid", + nullable: true); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "ParentId", + table: "DeviceGroups"); + } + } +} diff --git a/src/Backend/Data/Migrations/Postgres/PostgresAppDbContextModelSnapshot.cs b/src/Backend/Data/Migrations/Postgres/PostgresAppDbContextModelSnapshot.cs index 8075d6e..95f738a 100644 --- a/src/Backend/Data/Migrations/Postgres/PostgresAppDbContextModelSnapshot.cs +++ b/src/Backend/Data/Migrations/Postgres/PostgresAppDbContextModelSnapshot.cs @@ -203,6 +203,9 @@ namespace Backend.Data.Migrations.Postgres .IsRequired() .HasColumnType("text"); + b.Property("ParentId") + .HasColumnType("uuid"); + b.Property("RulesJson") .HasColumnType("text"); diff --git a/src/Backend/Data/Migrations/SqlServer/20261023004406_AddGroupNesting.Designer.cs b/src/Backend/Data/Migrations/SqlServer/20261023004406_AddGroupNesting.Designer.cs new file mode 100644 index 0000000..78c1fc3 --- /dev/null +++ b/src/Backend/Data/Migrations/SqlServer/20261023004406_AddGroupNesting.Designer.cs @@ -0,0 +1,742 @@ +// +using System; +using Backend.Data; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace Backend.Data.Migrations.SqlServer +{ + [DbContext(typeof(SqlServerAppDbContext))] + [Migration("20261023004406_AddGroupNesting")] + partial class AddGroupNesting + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "10.0.10") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); + + modelBuilder.Entity("Backend.Data.AppSettingEntity", b => + { + b.Property("Key") + .HasColumnType("nvarchar(450)"); + + b.Property("IsSecret") + .HasColumnType("bit"); + + b.Property("UpdatedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("UpdatedUtc") + .HasColumnType("datetimeoffset"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Key"); + + b.ToTable("AppSettings", (string)null); + }); + + modelBuilder.Entity("Backend.Data.AuditEventEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Action") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Actor") + .HasColumnType("nvarchar(max)"); + + b.Property("Category") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("ClientId") + .HasColumnType("nvarchar(max)"); + + b.Property("Detail") + .HasColumnType("nvarchar(max)"); + + b.Property("RemoteIp") + .HasColumnType("nvarchar(max)"); + + b.Property("TimestampUtc") + .HasColumnType("datetimeoffset"); + + b.HasKey("Id"); + + b.HasIndex("TimestampUtc"); + + b.ToTable("AuditEvents", (string)null); + }); + + modelBuilder.Entity("Backend.Data.BootstrapTokenEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("CreatedUtc") + .HasColumnType("datetimeoffset"); + + b.Property("ExpiresUtc") + .HasColumnType("datetimeoffset"); + + b.Property("MaxUses") + .HasColumnType("int"); + + b.Property("Note") + .HasColumnType("nvarchar(max)"); + + b.Property("Revoked") + .HasColumnType("bit"); + + b.Property("TokenHash") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Uses") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("TokenHash") + .IsUnique(); + + b.ToTable("BootstrapTokens", (string)null); + }); + + modelBuilder.Entity("Backend.Data.DeviceEntity", b => + { + b.Property("ClientId") + .HasColumnType("nvarchar(450)"); + + b.Property("AgentVersion") + .HasColumnType("nvarchar(max)"); + + b.Property("EnrolledUtc") + .HasColumnType("datetimeoffset"); + + b.Property("EnrollmentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Hostname") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("IpAddressesJson") + .HasColumnType("nvarchar(max)"); + + b.Property("IsOrphaned") + .HasColumnType("bit"); + + b.Property("LastSeenUtc") + .HasColumnType("datetimeoffset"); + + b.Property("Manufacturer") + .HasColumnType("nvarchar(max)"); + + b.Property("Model") + .HasColumnType("nvarchar(max)"); + + b.Property("NkeyPublic") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("OrphanedUtc") + .HasColumnType("datetimeoffset"); + + b.Property("OsCaption") + .HasColumnType("nvarchar(max)"); + + b.Property("OsVersion") + .HasColumnType("nvarchar(max)"); + + b.Property("PublicIp") + .HasColumnType("nvarchar(max)"); + + b.Property("ReadyUtc") + .HasColumnType("datetimeoffset"); + + b.Property("TagsJson") + .HasColumnType("nvarchar(max)"); + + b.HasKey("ClientId"); + + b.HasIndex("Hostname"); + + b.ToTable("Devices", (string)null); + }); + + modelBuilder.Entity("Backend.Data.DeviceGroupEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedUtc") + .HasColumnType("datetimeoffset"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Kind") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("RulesJson") + .HasColumnType("nvarchar(max)"); + + b.Property("UpdatedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("UpdatedUtc") + .HasColumnType("datetimeoffset"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("DeviceGroups", (string)null); + }); + + modelBuilder.Entity("Backend.Data.DeviceGroupMemberEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("AddedUtc") + .HasColumnType("datetimeoffset"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("GroupId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("GroupId", "ClientId") + .IsUnique(); + + b.ToTable("DeviceGroupMembers", (string)null); + }); + + modelBuilder.Entity("Backend.Data.DeviceInventoryEntity", b => + { + b.Property("ClientId") + .HasColumnType("nvarchar(450)"); + + b.Property("ReportJson") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("UpdatedUtc") + .HasColumnType("datetimeoffset"); + + b.HasKey("ClientId"); + + b.ToTable("DeviceInventory", (string)null); + }); + + modelBuilder.Entity("Backend.Data.FunctionModuleEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Content") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("CreatedUtc") + .HasColumnType("datetimeoffset"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("UpdatedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("UpdatedUtc") + .HasColumnType("datetimeoffset"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("FunctionModules", (string)null); + }); + + modelBuilder.Entity("Backend.Data.JobEntity", b => + { + b.Property("JobId") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("CompletedUtc") + .HasColumnType("datetimeoffset"); + + b.Property("CreatedUtc") + .HasColumnType("datetimeoffset"); + + b.Property("ExitCode") + .HasColumnType("int"); + + b.Property("OutputSummary") + .HasColumnType("nvarchar(max)"); + + b.Property("RequestedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("RunId") + .HasColumnType("uniqueidentifier"); + + b.Property("ScriptId") + .HasColumnType("uniqueidentifier"); + + b.Property("ScriptName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("StartedUtc") + .HasColumnType("datetimeoffset"); + + b.Property("State") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("JobId"); + + b.HasIndex("ClientId"); + + b.HasIndex("CreatedUtc"); + + b.HasIndex("ScriptId", "RunId"); + + b.ToTable("Jobs", (string)null); + }); + + modelBuilder.Entity("Backend.Data.JobOutputEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("JobId") + .HasColumnType("uniqueidentifier"); + + b.Property("Sequence") + .HasColumnType("bigint"); + + b.Property("Stream") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Text") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("TimestampUtc") + .HasColumnType("datetimeoffset"); + + b.HasKey("Id"); + + b.HasIndex("JobId", "Sequence") + .IsUnique(); + + b.ToTable("JobOutput", (string)null); + }); + + modelBuilder.Entity("Backend.Data.OidcProviderEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Authority") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("OidcProviders", (string)null); + }); + + modelBuilder.Entity("Backend.Data.RoleEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreatedUtc") + .HasColumnType("datetimeoffset"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DeviceScopeGroupIdsJson") + .HasColumnType("nvarchar(max)"); + + b.Property("IsSystem") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("OidcClaimValuesJson") + .HasColumnType("nvarchar(max)"); + + b.Property("PermissionsJson") + .HasColumnType("nvarchar(max)"); + + b.Property("UpdatedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("UpdatedUtc") + .HasColumnType("datetimeoffset"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("Roles", (string)null); + }); + + modelBuilder.Entity("Backend.Data.ScriptEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Content") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("CreatedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("CreatedUtc") + .HasColumnType("datetimeoffset"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("FileBindingsJson") + .HasColumnType("nvarchar(max)"); + + b.Property("FunctionModuleIdsJson") + .HasColumnType("nvarchar(max)"); + + b.Property("Language") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("ParametersJson") + .HasColumnType("nvarchar(max)"); + + b.Property("SecretBindingsJson") + .HasColumnType("nvarchar(max)"); + + b.Property("SecretsVariableName") + .HasColumnType("nvarchar(max)"); + + b.Property("UpdatedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("UpdatedUtc") + .HasColumnType("datetimeoffset"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("Scripts", (string)null); + }); + + modelBuilder.Entity("Backend.Data.ScriptTriggerEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ArgumentsJson") + .HasColumnType("nvarchar(max)"); + + b.Property("ClientId") + .HasColumnType("nvarchar(max)"); + + b.Property("CreatedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("CreatedUtc") + .HasColumnType("datetimeoffset"); + + b.Property("CronExpression") + .HasColumnType("nvarchar(max)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("GroupId") + .HasColumnType("uniqueidentifier"); + + b.Property("LastResult") + .HasColumnType("nvarchar(max)"); + + b.Property("LastRunId") + .HasColumnType("uniqueidentifier"); + + b.Property("LastRunUtc") + .HasColumnType("datetimeoffset"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("NextRunUtc") + .HasColumnType("datetimeoffset"); + + b.Property("OncePerDevice") + .HasColumnType("bit"); + + b.Property("RunOnceUtc") + .HasColumnType("datetimeoffset"); + + b.Property("ScriptId") + .HasColumnType("uniqueidentifier"); + + b.Property("TimeZoneId") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("TriggerType") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("NextRunUtc"); + + b.HasIndex("TriggerType"); + + b.ToTable("ScriptTriggers", (string)null); + }); + + modelBuilder.Entity("Backend.Data.ScriptTriggerRunEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("FiredUtc") + .HasColumnType("datetimeoffset"); + + b.Property("JobId") + .HasColumnType("uniqueidentifier"); + + b.Property("TriggerId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("TriggerId", "ClientId") + .IsUnique(); + + b.ToTable("ScriptTriggerRuns", (string)null); + }); + + modelBuilder.Entity("Backend.Data.SecretsProviderEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConfigProtected") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("CreatedUtc") + .HasColumnType("datetimeoffset"); + + b.Property("Kind") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("UpdatedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("UpdatedUtc") + .HasColumnType("datetimeoffset"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("SecretsProviders", (string)null); + }); + + modelBuilder.Entity("Backend.Data.ShellSessionEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("CloseReason") + .HasColumnType("nvarchar(max)"); + + b.Property("ClosedUtc") + .HasColumnType("datetimeoffset"); + + b.Property("CreatedUtc") + .HasColumnType("datetimeoffset"); + + b.Property("RequestedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("State") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("ShellSessions", (string)null); + }); + + modelBuilder.Entity("Backend.Data.UserEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AuthProvider") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("CreatedUtc") + .HasColumnType("datetimeoffset"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("ExternalId") + .HasColumnType("nvarchar(max)"); + + b.Property("LastLoginUtc") + .HasColumnType("datetimeoffset"); + + b.Property("MustChangePassword") + .HasColumnType("bit"); + + b.Property("PasswordHash") + .HasColumnType("nvarchar(max)"); + + b.Property("Role") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("Username") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("Username") + .IsUnique(); + + b.ToTable("Users", (string)null); + }); + + modelBuilder.Entity("Backend.Data.DeviceInventoryEntity", b => + { + b.HasOne("Backend.Data.DeviceEntity", null) + .WithOne("Inventory") + .HasForeignKey("Backend.Data.DeviceInventoryEntity", "ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Backend.Data.DeviceEntity", b => + { + b.Navigation("Inventory"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/Backend/Data/Migrations/SqlServer/20261023004406_AddGroupNesting.cs b/src/Backend/Data/Migrations/SqlServer/20261023004406_AddGroupNesting.cs new file mode 100644 index 0000000..9af70d8 --- /dev/null +++ b/src/Backend/Data/Migrations/SqlServer/20261023004406_AddGroupNesting.cs @@ -0,0 +1,29 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Backend.Data.Migrations.SqlServer +{ + /// + public partial class AddGroupNesting : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "ParentId", + table: "DeviceGroups", + type: "uniqueidentifier", + nullable: true); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "ParentId", + table: "DeviceGroups"); + } + } +} diff --git a/src/Backend/Data/Migrations/SqlServer/SqlServerAppDbContextModelSnapshot.cs b/src/Backend/Data/Migrations/SqlServer/SqlServerAppDbContextModelSnapshot.cs index 4acf21e..13c29a7 100644 --- a/src/Backend/Data/Migrations/SqlServer/SqlServerAppDbContextModelSnapshot.cs +++ b/src/Backend/Data/Migrations/SqlServer/SqlServerAppDbContextModelSnapshot.cs @@ -203,6 +203,9 @@ namespace Backend.Data.Migrations.SqlServer .IsRequired() .HasColumnType("nvarchar(450)"); + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + b.Property("RulesJson") .HasColumnType("nvarchar(max)"); diff --git a/src/Backend/Data/Migrations/Sqlite/20261023004330_AddGroupNesting.Designer.cs b/src/Backend/Data/Migrations/Sqlite/20261023004330_AddGroupNesting.Designer.cs new file mode 100644 index 0000000..1764efa --- /dev/null +++ b/src/Backend/Data/Migrations/Sqlite/20261023004330_AddGroupNesting.Designer.cs @@ -0,0 +1,729 @@ +// +using System; +using Backend.Data; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace Backend.Data.Migrations.Sqlite +{ + [DbContext(typeof(SqliteAppDbContext))] + [Migration("20261023004330_AddGroupNesting")] + partial class AddGroupNesting + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder.HasAnnotation("ProductVersion", "10.0.10"); + + modelBuilder.Entity("Backend.Data.AppSettingEntity", b => + { + b.Property("Key") + .HasColumnType("TEXT"); + + b.Property("IsSecret") + .HasColumnType("INTEGER"); + + b.Property("UpdatedBy") + .HasColumnType("TEXT"); + + b.Property("UpdatedUtc") + .HasColumnType("INTEGER"); + + b.Property("Value") + .HasColumnType("TEXT"); + + b.HasKey("Key"); + + b.ToTable("AppSettings", (string)null); + }); + + modelBuilder.Entity("Backend.Data.AuditEventEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Action") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Actor") + .HasColumnType("TEXT"); + + b.Property("Category") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("ClientId") + .HasColumnType("TEXT"); + + b.Property("Detail") + .HasColumnType("TEXT"); + + b.Property("RemoteIp") + .HasColumnType("TEXT"); + + b.Property("TimestampUtc") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("TimestampUtc"); + + b.ToTable("AuditEvents", (string)null); + }); + + modelBuilder.Entity("Backend.Data.BootstrapTokenEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("CreatedBy") + .HasColumnType("TEXT"); + + b.Property("CreatedUtc") + .HasColumnType("INTEGER"); + + b.Property("ExpiresUtc") + .HasColumnType("INTEGER"); + + b.Property("MaxUses") + .HasColumnType("INTEGER"); + + b.Property("Note") + .HasColumnType("TEXT"); + + b.Property("Revoked") + .HasColumnType("INTEGER"); + + b.Property("TokenHash") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Uses") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("TokenHash") + .IsUnique(); + + b.ToTable("BootstrapTokens", (string)null); + }); + + modelBuilder.Entity("Backend.Data.DeviceEntity", b => + { + b.Property("ClientId") + .HasColumnType("TEXT"); + + b.Property("AgentVersion") + .HasColumnType("TEXT"); + + b.Property("EnrolledUtc") + .HasColumnType("INTEGER"); + + b.Property("EnrollmentId") + .HasColumnType("TEXT"); + + b.Property("Hostname") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("IpAddressesJson") + .HasColumnType("TEXT"); + + b.Property("IsOrphaned") + .HasColumnType("INTEGER"); + + b.Property("LastSeenUtc") + .HasColumnType("INTEGER"); + + b.Property("Manufacturer") + .HasColumnType("TEXT"); + + b.Property("Model") + .HasColumnType("TEXT"); + + b.Property("NkeyPublic") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("OrphanedUtc") + .HasColumnType("INTEGER"); + + b.Property("OsCaption") + .HasColumnType("TEXT"); + + b.Property("OsVersion") + .HasColumnType("TEXT"); + + b.Property("PublicIp") + .HasColumnType("TEXT"); + + b.Property("ReadyUtc") + .HasColumnType("INTEGER"); + + b.Property("TagsJson") + .HasColumnType("TEXT"); + + b.HasKey("ClientId"); + + b.HasIndex("Hostname"); + + b.ToTable("Devices", (string)null); + }); + + modelBuilder.Entity("Backend.Data.DeviceGroupEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("CreatedUtc") + .HasColumnType("INTEGER"); + + b.Property("Description") + .HasColumnType("TEXT"); + + b.Property("Kind") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("ParentId") + .HasColumnType("TEXT"); + + b.Property("RulesJson") + .HasColumnType("TEXT"); + + b.Property("UpdatedBy") + .HasColumnType("TEXT"); + + b.Property("UpdatedUtc") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("DeviceGroups", (string)null); + }); + + modelBuilder.Entity("Backend.Data.DeviceGroupMemberEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("AddedUtc") + .HasColumnType("INTEGER"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("GroupId") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("GroupId", "ClientId") + .IsUnique(); + + b.ToTable("DeviceGroupMembers", (string)null); + }); + + modelBuilder.Entity("Backend.Data.DeviceInventoryEntity", b => + { + b.Property("ClientId") + .HasColumnType("TEXT"); + + b.Property("ReportJson") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("UpdatedUtc") + .HasColumnType("INTEGER"); + + b.HasKey("ClientId"); + + b.ToTable("DeviceInventory", (string)null); + }); + + modelBuilder.Entity("Backend.Data.FunctionModuleEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("Content") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("CreatedUtc") + .HasColumnType("INTEGER"); + + b.Property("Description") + .HasColumnType("TEXT"); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("UpdatedBy") + .HasColumnType("TEXT"); + + b.Property("UpdatedUtc") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("FunctionModules", (string)null); + }); + + modelBuilder.Entity("Backend.Data.JobEntity", b => + { + b.Property("JobId") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("CompletedUtc") + .HasColumnType("INTEGER"); + + b.Property("CreatedUtc") + .HasColumnType("INTEGER"); + + b.Property("ExitCode") + .HasColumnType("INTEGER"); + + b.Property("OutputSummary") + .HasColumnType("TEXT"); + + b.Property("RequestedBy") + .HasColumnType("TEXT"); + + b.Property("RunId") + .HasColumnType("TEXT"); + + b.Property("ScriptId") + .HasColumnType("TEXT"); + + b.Property("ScriptName") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("StartedUtc") + .HasColumnType("INTEGER"); + + b.Property("State") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("JobId"); + + b.HasIndex("ClientId"); + + b.HasIndex("CreatedUtc"); + + b.HasIndex("ScriptId", "RunId"); + + b.ToTable("Jobs", (string)null); + }); + + modelBuilder.Entity("Backend.Data.JobOutputEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("JobId") + .HasColumnType("TEXT"); + + b.Property("Sequence") + .HasColumnType("INTEGER"); + + b.Property("Stream") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Text") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("TimestampUtc") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("JobId", "Sequence") + .IsUnique(); + + b.ToTable("JobOutput", (string)null); + }); + + modelBuilder.Entity("Backend.Data.OidcProviderEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("Authority") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Enabled") + .HasColumnType("INTEGER"); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("OidcProviders", (string)null); + }); + + modelBuilder.Entity("Backend.Data.RoleEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("CreatedUtc") + .HasColumnType("INTEGER"); + + b.Property("Description") + .HasColumnType("TEXT"); + + b.Property("DeviceScopeGroupIdsJson") + .HasColumnType("TEXT"); + + b.Property("IsSystem") + .HasColumnType("INTEGER"); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("OidcClaimValuesJson") + .HasColumnType("TEXT"); + + b.Property("PermissionsJson") + .HasColumnType("TEXT"); + + b.Property("UpdatedBy") + .HasColumnType("TEXT"); + + b.Property("UpdatedUtc") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("Roles", (string)null); + }); + + modelBuilder.Entity("Backend.Data.ScriptEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("Content") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("CreatedBy") + .HasColumnType("TEXT"); + + b.Property("CreatedUtc") + .HasColumnType("INTEGER"); + + b.Property("Description") + .HasColumnType("TEXT"); + + b.Property("FileBindingsJson") + .HasColumnType("TEXT"); + + b.Property("FunctionModuleIdsJson") + .HasColumnType("TEXT"); + + b.Property("Language") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("ParametersJson") + .HasColumnType("TEXT"); + + b.Property("SecretBindingsJson") + .HasColumnType("TEXT"); + + b.Property("SecretsVariableName") + .HasColumnType("TEXT"); + + b.Property("UpdatedBy") + .HasColumnType("TEXT"); + + b.Property("UpdatedUtc") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("Scripts", (string)null); + }); + + modelBuilder.Entity("Backend.Data.ScriptTriggerEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("ArgumentsJson") + .HasColumnType("TEXT"); + + b.Property("ClientId") + .HasColumnType("TEXT"); + + b.Property("CreatedBy") + .HasColumnType("TEXT"); + + b.Property("CreatedUtc") + .HasColumnType("INTEGER"); + + b.Property("CronExpression") + .HasColumnType("TEXT"); + + b.Property("Enabled") + .HasColumnType("INTEGER"); + + b.Property("GroupId") + .HasColumnType("TEXT"); + + b.Property("LastResult") + .HasColumnType("TEXT"); + + b.Property("LastRunId") + .HasColumnType("TEXT"); + + b.Property("LastRunUtc") + .HasColumnType("INTEGER"); + + b.Property("Name") + .HasColumnType("TEXT"); + + b.Property("NextRunUtc") + .HasColumnType("INTEGER"); + + b.Property("OncePerDevice") + .HasColumnType("INTEGER"); + + b.Property("RunOnceUtc") + .HasColumnType("INTEGER"); + + b.Property("ScriptId") + .HasColumnType("TEXT"); + + b.Property("TimeZoneId") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("TriggerType") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("NextRunUtc"); + + b.HasIndex("TriggerType"); + + b.ToTable("ScriptTriggers", (string)null); + }); + + modelBuilder.Entity("Backend.Data.ScriptTriggerRunEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("FiredUtc") + .HasColumnType("INTEGER"); + + b.Property("JobId") + .HasColumnType("TEXT"); + + b.Property("TriggerId") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("TriggerId", "ClientId") + .IsUnique(); + + b.ToTable("ScriptTriggerRuns", (string)null); + }); + + modelBuilder.Entity("Backend.Data.SecretsProviderEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("ConfigProtected") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("CreatedUtc") + .HasColumnType("INTEGER"); + + b.Property("Kind") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("UpdatedBy") + .HasColumnType("TEXT"); + + b.Property("UpdatedUtc") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("SecretsProviders", (string)null); + }); + + modelBuilder.Entity("Backend.Data.ShellSessionEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("CloseReason") + .HasColumnType("TEXT"); + + b.Property("ClosedUtc") + .HasColumnType("INTEGER"); + + b.Property("CreatedUtc") + .HasColumnType("INTEGER"); + + b.Property("RequestedBy") + .HasColumnType("TEXT"); + + b.Property("State") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("ShellSessions", (string)null); + }); + + modelBuilder.Entity("Backend.Data.UserEntity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("AuthProvider") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("CreatedUtc") + .HasColumnType("INTEGER"); + + b.Property("DisplayName") + .HasColumnType("TEXT"); + + b.Property("ExternalId") + .HasColumnType("TEXT"); + + b.Property("LastLoginUtc") + .HasColumnType("INTEGER"); + + b.Property("MustChangePassword") + .HasColumnType("INTEGER"); + + b.Property("PasswordHash") + .HasColumnType("TEXT"); + + b.Property("Role") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("RoleId") + .HasColumnType("TEXT"); + + b.Property("Username") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("Username") + .IsUnique(); + + b.ToTable("Users", (string)null); + }); + + modelBuilder.Entity("Backend.Data.DeviceInventoryEntity", b => + { + b.HasOne("Backend.Data.DeviceEntity", null) + .WithOne("Inventory") + .HasForeignKey("Backend.Data.DeviceInventoryEntity", "ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Backend.Data.DeviceEntity", b => + { + b.Navigation("Inventory"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/Backend/Data/Migrations/Sqlite/20261023004330_AddGroupNesting.cs b/src/Backend/Data/Migrations/Sqlite/20261023004330_AddGroupNesting.cs new file mode 100644 index 0000000..fa5178c --- /dev/null +++ b/src/Backend/Data/Migrations/Sqlite/20261023004330_AddGroupNesting.cs @@ -0,0 +1,29 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Backend.Data.Migrations.Sqlite +{ + /// + public partial class AddGroupNesting : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "ParentId", + table: "DeviceGroups", + type: "TEXT", + nullable: true); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "ParentId", + table: "DeviceGroups"); + } + } +} diff --git a/src/Backend/Data/Migrations/Sqlite/SqliteAppDbContextModelSnapshot.cs b/src/Backend/Data/Migrations/Sqlite/SqliteAppDbContextModelSnapshot.cs index f6fc93e..a2b0d66 100644 --- a/src/Backend/Data/Migrations/Sqlite/SqliteAppDbContextModelSnapshot.cs +++ b/src/Backend/Data/Migrations/Sqlite/SqliteAppDbContextModelSnapshot.cs @@ -196,6 +196,9 @@ namespace Backend.Data.Migrations.Sqlite .IsRequired() .HasColumnType("TEXT"); + b.Property("ParentId") + .HasColumnType("TEXT"); + b.Property("RulesJson") .HasColumnType("TEXT"); diff --git a/src/Backend/Groups/DeviceGroupService.cs b/src/Backend/Groups/DeviceGroupService.cs index f8a9754..fb6f19f 100644 --- a/src/Backend/Groups/DeviceGroupService.cs +++ b/src/Backend/Groups/DeviceGroupService.cs @@ -11,13 +11,20 @@ namespace Backend.Groups; /// /// Resolves group membership. Static groups use the explicit member table; /// dynamic groups evaluate their rules against each device's field bag -/// (inventory + tags + status + identity). Inventory parsing goes through +/// (inventory + tags + status + identity); folders have no devices of their +/// own. Groups nest, and a group's effective membership also includes every +/// group nested under it. Inventory parsing goes through /// , so fleet-wide evaluation stays cheap at /// thousands of devices: snapshots are re-fetched and re-parsed only when /// their UpdatedUtc moved. /// public sealed class DeviceGroupService(AppDbContext db, InventoryReportCache inventoryCache) { + /// Deepest nesting allowed; keeps the tree navigable and evaluation bounded. + public const int MaxDepth = 8; + + private GroupMembership? membership; + /// Builds the rule field bag for one device. public static DeviceFieldBag BuildFields(DeviceEntity device, InventoryReport? inventory, DateTimeOffset now) => DeviceFieldBag.Build( @@ -118,24 +125,88 @@ public sealed class DeviceGroupService(AppDbContext db, InventoryReportCache inv } } - /// Client ids belonging to a group. + /// + /// Every group's direct and effective membership, evaluated once per + /// request (this service is scoped): one read of groups, static members, + /// devices and — only when a dynamic group exists — inventory. + /// + public async Task GetMembershipAsync(CancellationToken cancellationToken) + { + if (membership is not null) + { + return membership; + } + + var groups = await db.DeviceGroups.AsNoTracking().ToListAsync(cancellationToken); + var staticRows = await db.DeviceGroupMembers.AsNoTracking() + .Select(m => new { m.GroupId, m.ClientId }) + .ToListAsync(cancellationToken); + var devices = await db.Devices.AsNoTracking().ToListAsync(cancellationToken); + var known = devices.Select(d => d.ClientId).ToHashSet(StringComparer.Ordinal); + + var direct = groups.ToDictionary(g => g.Id, _ => new HashSet(StringComparer.Ordinal)); + var staticIds = groups.Where(g => g.Kind == GroupKind.Static).Select(g => g.Id).ToHashSet(); + foreach (var row in staticRows) + { + // Rows for deleted devices or non-static groups are ignored. + if (known.Contains(row.ClientId) && staticIds.Contains(row.GroupId)) + { + direct[row.GroupId].Add(row.ClientId); + } + } + + var dynamicGroups = groups + .Where(g => g.Kind == GroupKind.Dynamic) + .Select(g => (g.Id, Rules: ParseRules(g.RulesJson))) + .Where(g => g.Rules is not null) + .ToList(); + if (dynamicGroups.Count > 0) + { + var inventory = await GetAllInventoryAsync(cancellationToken); + var now = DateTimeOffset.UtcNow; + foreach (var device in devices) + { + var fields = BuildFields(device, inventory.GetValueOrDefault(device.ClientId), now); + foreach (var (id, rules) in dynamicGroups) + { + if (RuleEvaluator.Matches(rules!, fields)) + { + direct[id].Add(device.ClientId); + } + } + } + } + + return membership = new GroupMembership(groups, direct); + } + + /// Client ids belonging to a group, including its nested groups. public async Task> GetMembersAsync(DeviceGroupEntity group, CancellationToken cancellationToken) { - if (group.Kind == GroupKind.Static) + // Common case first: a leaf group needs no fleet-wide snapshot. + if (membership is null && !await db.DeviceGroups.AnyAsync(g => g.ParentId == group.Id, cancellationToken)) { - return await db.DeviceGroupMembers.AsNoTracking() - .Where(m => m.GroupId == group.Id) - .Select(m => m.ClientId) - .ToListAsync(cancellationToken); + return await GetDirectMembersAsync(group, cancellationToken); } - var rules = ParseRules(group.RulesJson); - if (rules is null) - { - return []; - } + return (await GetMembershipAsync(cancellationToken)).Effective(group.Id).ToList(); + } - return await EvaluateAsync(rules, cancellationToken); + private async Task> GetDirectMembersAsync( + DeviceGroupEntity group, CancellationToken cancellationToken) + { + switch (group.Kind) + { + case GroupKind.Static: + return await db.DeviceGroupMembers.AsNoTracking() + .Where(m => m.GroupId == group.Id && db.Devices.Any(d => d.ClientId == m.ClientId)) + .Select(m => m.ClientId) + .ToListAsync(cancellationToken); + case GroupKind.Dynamic when ParseRules(group.RulesJson) is { } rules: + return await EvaluateAsync(rules, cancellationToken); + default: + return []; + } } /// Evaluates a rule set against every enrolled device. @@ -152,7 +223,10 @@ public sealed class DeviceGroupService(AppDbContext db, InventoryReportCache inv .ToList(); } - /// Groups (static and dynamic) that a single device currently belongs to. + /// + /// Groups a single device belongs to: the ones it is directly in, plus + /// their ancestors (marked inherited, since nesting includes children). + /// public async Task> GetGroupsForDeviceAsync( string clientId, CancellationToken cancellationToken) { @@ -176,24 +250,37 @@ public sealed class DeviceGroupService(AppDbContext db, InventoryReportCache inv .ToListAsync(cancellationToken); var fields = BuildFields(device, inventory, DateTimeOffset.UtcNow); - var result = new List(); - - foreach (var group in groups) - { - var isMember = group.Kind == GroupKind.Static - ? staticGroupIds.Contains(group.Id) - : ParseRules(group.RulesJson) is { } rules && RuleEvaluator.Matches(rules, fields); - - if (isMember) + var directIds = groups + .Where(group => group.Kind switch { - result.Add(new DeviceGroupRefDto(group.Id, group.Name, group.Kind)); + GroupKind.Static => staticGroupIds.Contains(group.Id), + GroupKind.Dynamic => ParseRules(group.RulesJson) is { } rules && RuleEvaluator.Matches(rules, fields), + _ => false, + }) + .Select(g => g.Id) + .ToHashSet(); + + var byId = groups.ToDictionary(g => g.Id); + var inherited = new HashSet(); + foreach (var id in directIds) + { + foreach (var ancestor in GroupMembership.Ancestors(id, byId)) + { + if (!directIds.Contains(ancestor)) + { + inherited.Add(ancestor); + } } } - return result; + return groups + .Where(g => directIds.Contains(g.Id) || inherited.Contains(g.Id)) + .OrderBy(g => g.Name, StringComparer.OrdinalIgnoreCase) + .Select(g => new DeviceGroupRefDto(g.Id, g.Name, g.Kind, g.ParentId, inherited.Contains(g.Id))) + .ToList(); } - /// True when the device is in the group (null group means "all devices"). + /// True when the device is in the group or a group nested under it (null group means "all devices"). public async Task IsMemberAsync(Guid? groupId, string clientId, CancellationToken cancellationToken) { if (groupId is null) @@ -207,13 +294,18 @@ public sealed class DeviceGroupService(AppDbContext db, InventoryReportCache inv return false; } + if (await db.DeviceGroups.AnyAsync(g => g.ParentId == group.Id, cancellationToken)) + { + return (await GetMembershipAsync(cancellationToken)).Effective(group.Id).Contains(clientId); + } + if (group.Kind == GroupKind.Static) { return await db.DeviceGroupMembers.AsNoTracking() .AnyAsync(m => m.GroupId == group.Id && m.ClientId == clientId, cancellationToken); } - var rules = ParseRules(group.RulesJson); + var rules = group.Kind == GroupKind.Dynamic ? ParseRules(group.RulesJson) : null; if (rules is null) { return false; @@ -228,4 +320,136 @@ public sealed class DeviceGroupService(AppDbContext db, InventoryReportCache inv var inventory = await GetInventoryAsync(clientId, cancellationToken); return RuleEvaluator.Matches(rules, BuildFields(device, inventory, DateTimeOffset.UtcNow)); } + + /// + /// Why cannot hold + /// (missing, itself, inside its own subtree, too deep), or null when it can. + /// Pass a null for a group not yet created. + /// + public async Task ValidateParentAsync( + Guid? groupId, Guid? parentId, CancellationToken cancellationToken) + { + if (parentId is null) + { + return null; + } + + if (parentId == groupId) + { + return "A group cannot be nested inside itself."; + } + + var groups = await db.DeviceGroups.AsNoTracking() + .Select(g => new { g.Id, g.ParentId }) + .ToDictionaryAsync(g => g.Id, g => g.ParentId, cancellationToken); + if (!groups.ContainsKey(parentId.Value)) + { + return "The parent group no longer exists."; + } + + var depth = 1; + for (Guid? cursor = parentId; cursor is { } id; cursor = groups.GetValueOrDefault(id)) + { + if (id == groupId) + { + return "A group cannot be moved inside one of its own nested groups."; + } + + if (++depth > MaxDepth) + { + return $"Groups nest at most {MaxDepth} levels deep."; + } + } + + // The moved group's own subtree adds to the depth under its new parent. + if (groupId is { } moving) + { + var below = SubtreeHeight(moving, groups); + if (depth - 1 + below > MaxDepth) + { + return $"Groups nest at most {MaxDepth} levels deep."; + } + } + + return null; + } + + private static int SubtreeHeight(Guid id, Dictionary parents, int guard = 0) + { + if (guard > MaxDepth * 4) + { + return guard; + } + + var children = parents.Where(p => p.Value == id).Select(p => p.Key).ToList(); + return 1 + (children.Count == 0 ? 0 : children.Max(c => SubtreeHeight(c, parents, guard + 1))); + } +} + +/// +/// A point-in-time view of every group's membership: direct (the group's own +/// static list or rule matches) and effective (direct plus every nested +/// group's). Cycles — impossible past validation — are cut, not followed. +/// +public sealed class GroupMembership +{ + private readonly Dictionary groups; + private readonly Dictionary> direct; + private readonly Dictionary> children; + private readonly Dictionary> effective = []; + + public GroupMembership(IReadOnlyList groups, Dictionary> direct) + { + this.groups = groups.ToDictionary(g => g.Id); + this.direct = direct; + children = groups + .Where(g => g.ParentId is not null && this.groups.ContainsKey(g.ParentId.Value)) + .GroupBy(g => g.ParentId!.Value) + .ToDictionary(g => g.Key, g => g.Select(c => c.Id).ToList()); + } + + public IReadOnlyCollection Groups => groups.Values; + + public IReadOnlySet Direct(Guid groupId) + => direct.TryGetValue(groupId, out var set) ? set : new HashSet(); + + public IReadOnlySet Effective(Guid groupId) => Effective(groupId, []); + + private HashSet Effective(Guid groupId, HashSet visiting) + { + if (effective.TryGetValue(groupId, out var cached)) + { + return cached; + } + + var result = new HashSet(Direct(groupId), StringComparer.Ordinal); + if (visiting.Add(groupId)) + { + foreach (var child in children.GetValueOrDefault(groupId) ?? []) + { + result.UnionWith(Effective(child, visiting)); + } + + visiting.Remove(groupId); + } + + effective[groupId] = result; + return result; + } + + /// Groups the device is directly in (not inherited through nesting). + public IReadOnlyList DirectGroupsOf(string clientId) + => direct.Where(d => d.Value.Contains(clientId)).Select(d => d.Key).ToList(); + + /// Ancestors of a group, nearest first; stops on a cycle. + public static IEnumerable Ancestors(Guid groupId, IReadOnlyDictionary byId) + { + var seen = new HashSet { groupId }; + var cursor = byId.GetValueOrDefault(groupId)?.ParentId; + while (cursor is { } id && seen.Add(id) && byId.TryGetValue(id, out var parent)) + { + yield return id; + cursor = parent.ParentId; + } + } } diff --git a/src/Backend/Groups/GroupEndpoints.cs b/src/Backend/Groups/GroupEndpoints.cs index bbb59c9..5047d67 100644 --- a/src/Backend/Groups/GroupEndpoints.cs +++ b/src/Backend/Groups/GroupEndpoints.cs @@ -5,6 +5,7 @@ using Microsoft.EntityFrameworkCore; using Shared.Contracts.Api; using Shared.Contracts.Models; using Shared.Contracts.Serialization; +using Shared.Infrastructure.Constants; using Shared.Infrastructure.Nats; namespace Backend.Groups; @@ -18,6 +19,7 @@ public static class GroupEndpoints app.MapGet(ApiRoutes.Group, GetAsync).RequirePermission(Permissions.GroupsView); app.MapPut(ApiRoutes.Group, UpdateAsync).RequirePermission(Permissions.GroupsManage); app.MapDelete(ApiRoutes.Group, DeleteAsync).RequirePermission(Permissions.GroupsManage); + app.MapPost(ApiRoutes.GroupMove, MoveAsync).RequirePermission(Permissions.GroupsManage); app.MapGet(ApiRoutes.GroupMembers, MembersAsync).RequirePermission(Permissions.GroupsView); app.MapPost(ApiRoutes.GroupMembers, UpdateMembersAsync).RequirePermission(Permissions.GroupsManage); @@ -32,63 +34,58 @@ public static class GroupEndpoints private static async Task ListAsync( AppDbContext db, DeviceGroupService groups, CancellationToken cancellationToken) { - var entities = await db.DeviceGroups.AsNoTracking().OrderBy(g => g.Name).ToListAsync(cancellationToken); - var result = new List(entities.Count); - foreach (var entity in entities) - { - var members = await groups.GetMembersAsync(entity, cancellationToken); - result.Add(ToDto(entity, members.Count)); - } + var membership = await groups.GetMembershipAsync(cancellationToken); + var online = await OnlineClientIdsAsync(db, cancellationToken); - return Results.Ok(result); + return Results.Ok(membership.Groups + .OrderBy(g => g.Name, StringComparer.OrdinalIgnoreCase) + .Select(g => ToDto(g, membership, online)) + .ToList()); } private static async Task GetAsync( Guid id, AppDbContext db, DeviceGroupService groups, CancellationToken cancellationToken) { - var entity = await db.DeviceGroups.AsNoTracking().SingleOrDefaultAsync(g => g.Id == id, cancellationToken); - if (entity is null) - { - return Results.NotFound(); - } - - var members = await groups.GetMembersAsync(entity, cancellationToken); - return Results.Ok(ToDto(entity, members.Count)); + var membership = await groups.GetMembershipAsync(cancellationToken); + var entity = membership.Groups.FirstOrDefault(g => g.Id == id); + return entity is null + ? Results.NotFound() + : Results.Ok(ToDto(entity, membership, await OnlineClientIdsAsync(db, cancellationToken))); } private static async Task CreateAsync( - SaveDeviceGroupRequest request, AppDbContext db, AuditService audit, HttpContext context, CancellationToken cancellationToken) + SaveDeviceGroupRequest request, AppDbContext db, DeviceGroupService groups, AuditService audit, + HttpContext context, CancellationToken cancellationToken) { if (string.IsNullOrWhiteSpace(request.Name)) { return Results.BadRequest(new { error = "Group name is required." }); } + if (await groups.ValidateParentAsync(null, request.ParentId, cancellationToken) is { } parentError) + { + return Results.BadRequest(new { error = parentError }); + } + var now = DateTimeOffset.UtcNow; var entity = new DeviceGroupEntity { Id = Guid.NewGuid(), Name = request.Name.Trim(), - Description = request.Description, - Kind = request.Kind, - RulesJson = request.Kind == GroupKind.Dynamic && request.Rules is not null - ? JsonDefaults.Serialize(request.Rules) - : null, CreatedUtc = now, - UpdatedUtc = now, - UpdatedBy = context.User.Identity?.Name, }; + Apply(entity, request, context.User.Identity?.Name); db.DeviceGroups.Add(entity); await db.SaveChangesAsync(cancellationToken); await audit.LogAsync(AuditCategories.Admin, "group-created", entity.UpdatedBy, detail: $"{entity.Name} ({entity.Kind})", cancellationToken: cancellationToken); - return Results.Created(ApiRoutes.For.Group(entity.Id), ToDto(entity, 0)); + return Results.Created(ApiRoutes.For.Group(entity.Id), await DtoAsync(entity.Id, db, groups, cancellationToken)); } private static async Task UpdateAsync( - Guid id, SaveDeviceGroupRequest request, AppDbContext db, DeviceGroupService groups, + Guid id, SaveDeviceGroupRequest request, AppDbContext db, DeviceGroupService groups, AuditService audit, HttpContext context, CancellationToken cancellationToken) { var entity = await db.DeviceGroups.SingleOrDefaultAsync(g => g.Id == id, cancellationToken); @@ -102,21 +99,29 @@ public static class GroupEndpoints return Results.BadRequest(new { error = "Group name is required." }); } - entity.Name = request.Name.Trim(); - entity.Description = request.Description; - entity.Kind = request.Kind; - entity.RulesJson = request.Kind == GroupKind.Dynamic && request.Rules is not null - ? JsonDefaults.Serialize(request.Rules) - : null; - entity.UpdatedUtc = DateTimeOffset.UtcNow; - entity.UpdatedBy = context.User.Identity?.Name; + if (await groups.ValidateParentAsync(id, request.ParentId, cancellationToken) is { } parentError) + { + return Results.BadRequest(new { error = parentError }); + } + // Only static groups keep an explicit list; switching kind drops it so + // a later switch back does not resurrect stale members. + if (request.Kind != GroupKind.Static && entity.Kind == GroupKind.Static) + { + await db.DeviceGroupMembers.Where(m => m.GroupId == id).ExecuteDeleteAsync(cancellationToken); + } + + Apply(entity, request, context.User.Identity?.Name); await db.SaveChangesAsync(cancellationToken); - var members = await groups.GetMembersAsync(entity, cancellationToken); - return Results.Ok(ToDto(entity, members.Count)); + await audit.LogAsync(AuditCategories.Admin, "group-updated", entity.UpdatedBy, + detail: $"{entity.Name} ({entity.Kind})", cancellationToken: cancellationToken); + return Results.Ok(await DtoAsync(id, db, groups, cancellationToken)); } - private static async Task DeleteAsync(Guid id, AppDbContext db, CancellationToken cancellationToken) + /// Re-parents a group (drag and drop in the tree); null moves it to the top level. + private static async Task MoveAsync( + Guid id, MoveGroupRequest request, AppDbContext db, DeviceGroupService groups, AuditService audit, + HttpContext context, CancellationToken cancellationToken) { var entity = await db.DeviceGroups.SingleOrDefaultAsync(g => g.Id == id, cancellationToken); if (entity is null) @@ -124,13 +129,72 @@ public static class GroupEndpoints return Results.NotFound(); } - var members = db.DeviceGroupMembers.Where(m => m.GroupId == id); - db.DeviceGroupMembers.RemoveRange(members); + if (await groups.ValidateParentAsync(id, request.ParentId, cancellationToken) is { } error) + { + return Results.BadRequest(new { error }); + } + + entity.ParentId = request.ParentId; + entity.UpdatedUtc = DateTimeOffset.UtcNow; + entity.UpdatedBy = context.User.Identity?.Name; + await db.SaveChangesAsync(cancellationToken); + await audit.LogAsync(AuditCategories.Admin, "group-moved", entity.UpdatedBy, + detail: $"{entity.Name} -> {request.ParentId?.ToString("D") ?? "top level"}", + cancellationToken: cancellationToken); + return Results.Ok(await DtoAsync(id, db, groups, cancellationToken)); + } + + /// + /// Deletes a group. Its nested groups move up to its parent, triggers that + /// targeted it are disabled (with the reason recorded), and a group that + /// scopes a role is refused: dropping it from the scope would silently + /// widen that role to every device. + /// + private static async Task DeleteAsync( + Guid id, AppDbContext db, AuditService audit, HttpContext context, CancellationToken cancellationToken) + { + var entity = await db.DeviceGroups.SingleOrDefaultAsync(g => g.Id == id, cancellationToken); + if (entity is null) + { + return Results.NotFound(); + } + + var scopingRoles = (await db.Roles.AsNoTracking().ToListAsync(cancellationToken)) + .Where(r => RoleCache.ParseGuids(r.DeviceScopeGroupIdsJson).Contains(id)) + .Select(r => r.Name) + .ToList(); + if (scopingRoles.Count > 0) + { + return Results.Conflict(new + { + error = $"This group limits the devices of the role(s) {string.Join(", ", scopingRoles)}. " + + "Remove it from their device scope first.", + }); + } + + var children = await db.DeviceGroups.Where(g => g.ParentId == id).ToListAsync(cancellationToken); + foreach (var child in children) + { + child.ParentId = entity.ParentId; + } + + var triggers = await db.ScriptTriggers.Where(t => t.GroupId == id).ToListAsync(cancellationToken); + foreach (var trigger in triggers) + { + trigger.Enabled = false; + trigger.LastResult = $"Disabled: its target group “{entity.Name}” was deleted."; + } + + db.DeviceGroupMembers.RemoveRange(db.DeviceGroupMembers.Where(m => m.GroupId == id)); db.DeviceGroups.Remove(entity); await db.SaveChangesAsync(cancellationToken); + await audit.LogAsync(AuditCategories.Admin, "group-deleted", context.User.Identity?.Name, + detail: $"{entity.Name} children={children.Count} triggersDisabled={triggers.Count}", + cancellationToken: cancellationToken); return Results.NoContent(); } + /// Devices in the group, including those of its nested groups. private static async Task MembersAsync( Guid id, AppDbContext db, DeviceGroupService groups, CancellationToken cancellationToken) { @@ -143,6 +207,7 @@ public static class GroupEndpoints var clientIds = await groups.GetMembersAsync(entity, cancellationToken); var devices = await db.Devices.AsNoTracking() .Where(d => clientIds.Contains(d.ClientId)) + .OrderBy(d => d.Hostname) .ToListAsync(cancellationToken); var now = DateTimeOffset.UtcNow; @@ -150,7 +215,8 @@ public static class GroupEndpoints } private static async Task UpdateMembersAsync( - Guid id, UpdateGroupMembersRequest request, AppDbContext db, CancellationToken cancellationToken) + Guid id, UpdateGroupMembersRequest request, AppDbContext db, AuditService audit, HttpContext context, + CancellationToken cancellationToken) { var entity = await db.DeviceGroups.SingleOrDefaultAsync(g => g.Id == id, cancellationToken); if (entity is null) @@ -160,38 +226,49 @@ public static class GroupEndpoints if (entity.Kind != GroupKind.Static) { - return Results.BadRequest(new { error = "Membership of a dynamic group is determined by its rules." }); + return Results.BadRequest(new + { + error = entity.Kind == GroupKind.Dynamic + ? "Membership of a dynamic group is determined by its rules." + : "A folder holds groups, not devices. Add the devices to a static group inside it.", + }); } - foreach (var clientId in request.Remove ?? []) + var remove = (request.Remove ?? []).Distinct(StringComparer.Ordinal).ToList(); + var add = (request.Add ?? []).Where(SubjectIdentifier.IsValid).Distinct(StringComparer.Ordinal).ToList(); + + if (remove.Count > 0) { - var existing = await db.DeviceGroupMembers - .Where(m => m.GroupId == id && m.ClientId == clientId) + await db.DeviceGroupMembers + .Where(m => m.GroupId == id && remove.Contains(m.ClientId)) + .ExecuteDeleteAsync(cancellationToken); + } + + var added = 0; + if (add.Count > 0) + { + var existing = await db.DeviceGroupMembers.AsNoTracking() + .Where(m => m.GroupId == id && add.Contains(m.ClientId)) + .Select(m => m.ClientId) + .ToListAsync(cancellationToken); + var enrolled = await db.Devices.AsNoTracking() + .Where(d => add.Contains(d.ClientId)) + .Select(d => d.ClientId) .ToListAsync(cancellationToken); - db.DeviceGroupMembers.RemoveRange(existing); - } - foreach (var clientId in request.Add ?? []) - { - if (!SubjectIdentifier.IsValid(clientId)) + var now = DateTimeOffset.UtcNow; + foreach (var clientId in enrolled.Except(existing, StringComparer.Ordinal)) { - continue; - } - - var already = await db.DeviceGroupMembers - .AnyAsync(m => m.GroupId == id && m.ClientId == clientId, cancellationToken); - if (!already) - { - db.DeviceGroupMembers.Add(new DeviceGroupMemberEntity - { - GroupId = id, - ClientId = clientId, - AddedUtc = DateTimeOffset.UtcNow, - }); + db.DeviceGroupMembers.Add(new DeviceGroupMemberEntity { GroupId = id, ClientId = clientId, AddedUtc = now }); + added++; } } + entity.UpdatedUtc = DateTimeOffset.UtcNow; + entity.UpdatedBy = context.User.Identity?.Name; await db.SaveChangesAsync(cancellationToken); + await audit.LogAsync(AuditCategories.Admin, "group-members", entity.UpdatedBy, + detail: $"{entity.Name} added={added} removed={remove.Count}", cancellationToken: cancellationToken); return Results.NoContent(); } @@ -202,6 +279,7 @@ public static class GroupEndpoints var clientIds = await groups.EvaluateAsync(request.Rules, cancellationToken); var devices = await db.Devices.AsNoTracking() .Where(d => clientIds.Contains(d.ClientId)) + .OrderBy(d => d.Hostname) .ToListAsync(cancellationToken); var now = DateTimeOffset.UtcNow; @@ -233,8 +311,48 @@ public static class GroupEndpoints return Results.Ok(tags); } - private static DeviceGroupDto ToDto(DeviceGroupEntity entity, int memberCount) => new( - entity.Id, entity.Name, entity.Description, entity.Kind, - DeviceGroupService.ParseRules(entity.RulesJson), - memberCount, entity.CreatedUtc, entity.UpdatedUtc, entity.UpdatedBy); + private static void Apply(DeviceGroupEntity entity, SaveDeviceGroupRequest request, string? actor) + { + entity.Name = request.Name.Trim(); + entity.Description = string.IsNullOrWhiteSpace(request.Description) ? null : request.Description.Trim(); + entity.Kind = request.Kind; + entity.ParentId = request.ParentId; + entity.RulesJson = request.Kind == GroupKind.Dynamic && request.Rules is not null + ? JsonDefaults.Serialize(request.Rules) + : null; + entity.UpdatedUtc = DateTimeOffset.UtcNow; + entity.UpdatedBy = actor; + } + + private static async Task> OnlineClientIdsAsync(AppDbContext db, CancellationToken cancellationToken) + { + var now = DateTimeOffset.UtcNow; + var seen = await db.Devices.AsNoTracking() + .Select(d => new { d.ClientId, d.LastSeenUtc }) + .ToListAsync(cancellationToken); + return seen + .Where(d => ProtocolDefaults.CalculateStatus(d.LastSeenUtc, now) == DeviceStatus.Online) + .Select(d => d.ClientId) + .ToHashSet(StringComparer.Ordinal); + } + + /// DTO after a write; the snapshot is built lazily, so it already reflects the change. + private static async Task DtoAsync( + Guid id, AppDbContext db, DeviceGroupService groups, CancellationToken cancellationToken) + { + var membership = await groups.GetMembershipAsync(cancellationToken); + return ToDto(membership.Groups.First(g => g.Id == id), membership, await OnlineClientIdsAsync(db, cancellationToken)); + } + + private static DeviceGroupDto ToDto(DeviceGroupEntity entity, GroupMembership membership, IReadOnlySet online) + { + var effective = membership.Effective(entity.Id); + return new DeviceGroupDto( + entity.Id, entity.Name, entity.Description, entity.Kind, + DeviceGroupService.ParseRules(entity.RulesJson), + effective.Count, entity.CreatedUtc, entity.UpdatedUtc, entity.UpdatedBy, + ParentId: entity.ParentId, + DirectMemberCount: membership.Direct(entity.Id).Count, + OnlineCount: effective.Count(online.Contains)); + } } diff --git a/src/Shared.Contracts/Api/ApiRoutes.cs b/src/Shared.Contracts/Api/ApiRoutes.cs index 5112e12..d5d67ce 100644 --- a/src/Shared.Contracts/Api/ApiRoutes.cs +++ b/src/Shared.Contracts/Api/ApiRoutes.cs @@ -40,6 +40,7 @@ public static class ApiRoutes public const string Groups = "/api/groups"; public const string Group = "/api/groups/{id}"; public const string GroupMembers = "/api/groups/{id}/members"; + public const string GroupMove = "/api/groups/{id}/move"; public const string GroupPreview = "/api/groups/preview"; public const string GroupFields = "/api/groups/fields"; public const string DeviceTags = "/api/devices/{clientId}/tags"; @@ -96,6 +97,7 @@ public static class ApiRoutes public static string FunctionModule(Guid id) => $"/api/functions/{id:D}"; public static string Group(Guid id) => $"/api/groups/{id:D}"; public static string GroupMembers(Guid id) => $"/api/groups/{id:D}/members"; + public static string GroupMove(Guid id) => $"/api/groups/{id:D}/move"; public static string DeviceTags(string clientId) => $"/api/devices/{Uri.EscapeDataString(clientId)}/tags"; public static string Trigger(Guid id) => $"/api/triggers/{id:D}"; public static string TriggerRun(Guid id) => $"/api/triggers/{id:D}/run"; diff --git a/src/Shared.Contracts/Api/ResourceDtos.cs b/src/Shared.Contracts/Api/ResourceDtos.cs index cac15e7..b5ed688 100644 --- a/src/Shared.Contracts/Api/ResourceDtos.cs +++ b/src/Shared.Contracts/Api/ResourceDtos.cs @@ -17,9 +17,13 @@ public sealed record DeviceDto( DateTimeOffset EnrolledUtc, IReadOnlyList? Tags = null, bool IsOrphaned = false, - string? PublicIp = null); + string? PublicIp = null, + IReadOnlyList? GroupIds = null); -/// Device group resource. +/// +/// Device group resource. MemberCount/OnlineCount include the +/// devices of nested groups; DirectMemberCount is the group's own. +/// public sealed record DeviceGroupDto( Guid Id, string Name, @@ -29,14 +33,21 @@ public sealed record DeviceGroupDto( int MemberCount, DateTimeOffset CreatedUtc, DateTimeOffset UpdatedUtc, - string? UpdatedBy); + string? UpdatedBy, + Guid? ParentId = null, + int DirectMemberCount = 0, + int OnlineCount = 0); -/// POST/PUT /api/groups request body. +/// POST/PUT /api/groups request body. ParentId nests the group (null = top level). public sealed record SaveDeviceGroupRequest( string Name, string? Description, GroupKind Kind, - GroupRuleSet? Rules); + GroupRuleSet? Rules, + Guid? ParentId = null); + +/// POST /api/groups/{id}/move — re-parent a group (null = top level). +public sealed record MoveGroupRequest(Guid? ParentId); /// POST /api/groups/{id}/members request body (static groups). public sealed record UpdateGroupMembersRequest( @@ -143,8 +154,8 @@ public sealed record DeviceDetailDto( DateTimeOffset? InventoryUpdatedUtc, IReadOnlyList? Groups = null); -/// A group a device belongs to. -public sealed record DeviceGroupRefDto(Guid Id, string Name, GroupKind Kind); +/// A group a device belongs to; Inherited when only through a nested group. +public sealed record DeviceGroupRefDto(Guid Id, string Name, GroupKind Kind, Guid? ParentId = null, bool Inherited = false); /// Script resource. public sealed record ScriptDto( diff --git a/src/Shared.Contracts/Models/GroupRules.cs b/src/Shared.Contracts/Models/GroupRules.cs index 6903db2..148063a 100644 --- a/src/Shared.Contracts/Models/GroupRules.cs +++ b/src/Shared.Contracts/Models/GroupRules.cs @@ -1,10 +1,15 @@ namespace Shared.Contracts.Models; -/// Static groups hold an explicit member list; dynamic groups evaluate rules. +/// +/// Static groups hold an explicit member list; dynamic groups evaluate rules; +/// folders hold no devices of their own and only organize nested groups. +/// Every kind also includes the devices of the groups nested under it. +/// public enum GroupKind { Static, Dynamic, + Folder, } /// How sibling conditions (or sibling groups) combine. diff --git a/tests/Backend.Tests/GroupNestingTests.cs b/tests/Backend.Tests/GroupNestingTests.cs new file mode 100644 index 0000000..fdb6431 --- /dev/null +++ b/tests/Backend.Tests/GroupNestingTests.cs @@ -0,0 +1,159 @@ +using System.Net; +using System.Net.Http.Json; +using Backend.Data; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; +using Shared.Contracts.Api; +using Shared.Contracts.Models; +using Shared.Contracts.Serialization; +using Xunit; + +namespace Backend.Tests; + +public class GroupNestingTests(BackendTestFixture fixture) : IClassFixture +{ + [Fact] + public async Task AFolderIncludesTheDevicesOfItsNestedGroups() + { + using var client = await fixture.SignedInAsync("group-admin"); + var a = await fixture.SeedDeviceAsync("NEST-A"); + var b = await fixture.SeedDeviceAsync("NEST-B", tags: ["nest-web"]); + + var folder = await CreateAsync(client, new SaveDeviceGroupRequest("Sites", null, GroupKind.Folder, null)); + var office = await CreateAsync(client, new SaveDeviceGroupRequest("Office", null, GroupKind.Static, null, folder.Id)); + var web = await CreateAsync(client, new SaveDeviceGroupRequest("Web", null, GroupKind.Dynamic, + Rules("tags", RuleOperator.Equals, "nest-web"), office.Id)); + await AddMembersAsync(client, office.Id, a); + + var groups = await ListAsync(client); + Assert.Equal(2, groups.Single(g => g.Id == folder.Id).MemberCount); + Assert.Equal(0, groups.Single(g => g.Id == folder.Id).DirectMemberCount); + Assert.Equal(2, groups.Single(g => g.Id == office.Id).MemberCount); + Assert.Equal(1, groups.Single(g => g.Id == office.Id).DirectMemberCount); + Assert.Equal(office.Id, groups.Single(g => g.Id == web.Id).ParentId); + + var members = await client.GetFromJsonAsync>( + ApiRoutes.For.GroupMembers(folder.Id), JsonDefaults.Options); + Assert.Equal(["NEST-A", "NEST-B"], members!.Select(d => d.Hostname).Order()); + + var devices = await client.GetFromJsonAsync>(ApiRoutes.Devices, JsonDefaults.Options); + Assert.Equal([web.Id], devices!.Single(d => d.ClientId == b).GroupIds); + + var detail = await client.GetFromJsonAsync(ApiRoutes.For.Device(b), JsonDefaults.Options); + Assert.Contains(detail!.Groups!, g => g.Id == folder.Id && g.Inherited); + Assert.Contains(detail.Groups!, g => g.Id == web.Id && !g.Inherited); + } + + [Fact] + public async Task AGroupCannotMoveIntoItsOwnSubtree() + { + using var client = await fixture.SignedInAsync("group-admin"); + var parent = await CreateAsync(client, new SaveDeviceGroupRequest("Cycle-P", null, GroupKind.Folder, null)); + var child = await CreateAsync(client, new SaveDeviceGroupRequest("Cycle-C", null, GroupKind.Folder, null, parent.Id)); + + var intoChild = await client.PostAsJsonAsync( + ApiRoutes.For.GroupMove(parent.Id), new MoveGroupRequest(child.Id), JsonDefaults.Options); + var intoSelf = await client.PostAsJsonAsync( + ApiRoutes.For.GroupMove(parent.Id), new MoveGroupRequest(parent.Id), JsonDefaults.Options); + var toTop = await client.PostAsJsonAsync( + ApiRoutes.For.GroupMove(child.Id), new MoveGroupRequest(null), JsonDefaults.Options); + + Assert.Equal(HttpStatusCode.BadRequest, intoChild.StatusCode); + Assert.Equal(HttpStatusCode.BadRequest, intoSelf.StatusCode); + Assert.Equal(HttpStatusCode.OK, toTop.StatusCode); + Assert.Null((await ListAsync(client)).Single(g => g.Id == child.Id).ParentId); + } + + [Fact] + public async Task DeletingAGroupLiftsItsChildrenAndDisablesItsTriggers() + { + using var client = await fixture.SignedInAsync("group-admin"); + var top = await CreateAsync(client, new SaveDeviceGroupRequest("Del-Top", null, GroupKind.Folder, null)); + var doomed = await CreateAsync(client, new SaveDeviceGroupRequest("Del-Mid", null, GroupKind.Folder, null, top.Id)); + var child = await CreateAsync(client, new SaveDeviceGroupRequest("Del-Leaf", null, GroupKind.Static, null, doomed.Id)); + var scriptId = await fixture.SeedScriptAsync("del-script"); + var trigger = await client.PostAsJsonAsync(ApiRoutes.Triggers, new SaveScriptTriggerRequest( + scriptId, ScriptTriggerType.Scheduled, GroupId: doomed.Id, CronExpression: "0 1 * * *"), JsonDefaults.Options); + trigger.EnsureSuccessStatusCode(); + + var response = await client.DeleteAsync(ApiRoutes.For.Group(doomed.Id)); + + Assert.Equal(HttpStatusCode.NoContent, response.StatusCode); + Assert.Equal(top.Id, (await ListAsync(client)).Single(g => g.Id == child.Id).ParentId); + var triggers = await client.GetFromJsonAsync>(ApiRoutes.Triggers, JsonDefaults.Options); + var disabled = triggers!.Single(t => t.GroupId == doomed.Id); + Assert.False(disabled.Enabled); + Assert.Contains("was deleted", disabled.LastResult); + } + + [Fact] + public async Task AGroupThatScopesARoleCannotBeDeleted() + { + using var client = await fixture.SignedInAsync("group-admin"); + var group = await CreateAsync(client, new SaveDeviceGroupRequest("Scoping", null, GroupKind.Static, null)); + await fixture.WithDbAsync(async db => + { + db.Roles.Add(new RoleEntity + { + Id = Guid.NewGuid(), Name = $"scoped-by-{group.Id:N}", + PermissionsJson = JsonDefaults.Serialize(new[] { "devices.view" }), + DeviceScopeGroupIdsJson = JsonDefaults.Serialize(new[] { group.Id }), + CreatedUtc = DateTimeOffset.UtcNow, UpdatedUtc = DateTimeOffset.UtcNow, + }); + await db.SaveChangesAsync(); + }); + fixture.Services.GetRequiredService().Invalidate(); + + var response = await client.DeleteAsync(ApiRoutes.For.Group(group.Id)); + + Assert.Equal(HttpStatusCode.Conflict, response.StatusCode); + } + + [Fact] + public async Task SwitchingAStaticGroupToDynamicDropsItsList() + { + using var client = await fixture.SignedInAsync("group-admin"); + var device = await fixture.SeedDeviceAsync("SWITCH-HOST"); + var group = await CreateAsync(client, new SaveDeviceGroupRequest("Switch", null, GroupKind.Static, null)); + await AddMembersAsync(client, group.Id, device); + + var update = await client.PutAsJsonAsync(ApiRoutes.For.Group(group.Id), new SaveDeviceGroupRequest( + "Switch", null, GroupKind.Dynamic, Rules("hostname", RuleOperator.Equals, "nobody")), JsonDefaults.Options); + update.EnsureSuccessStatusCode(); + + Assert.Equal(0, await fixture.WithDbAsync(db => db.DeviceGroupMembers.CountAsync(m => m.GroupId == group.Id))); + } + + [Fact] + public async Task AFolderRefusesDevices() + { + using var client = await fixture.SignedInAsync("group-admin"); + var device = await fixture.SeedDeviceAsync("FOLDER-HOST"); + var folder = await CreateAsync(client, new SaveDeviceGroupRequest("Folder-only", null, GroupKind.Folder, null)); + + var response = await client.PostAsJsonAsync(ApiRoutes.For.GroupMembers(folder.Id), + new UpdateGroupMembersRequest([device], []), JsonDefaults.Options); + + Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode); + } + + private static GroupRuleSet Rules(string field, RuleOperator op, string value) + => new(RuleCombine.And, [new RuleGroup(RuleCombine.And, [new RuleCondition(field, op, value)])]); + + private static async Task CreateAsync(HttpClient client, SaveDeviceGroupRequest request) + { + var response = await client.PostAsJsonAsync(ApiRoutes.Groups, request, JsonDefaults.Options); + response.EnsureSuccessStatusCode(); + return (await response.Content.ReadFromJsonAsync(JsonDefaults.Options))!; + } + + private static async Task AddMembersAsync(HttpClient client, Guid groupId, params string[] clientIds) + { + var response = await client.PostAsJsonAsync(ApiRoutes.For.GroupMembers(groupId), + new UpdateGroupMembersRequest(clientIds, []), JsonDefaults.Options); + response.EnsureSuccessStatusCode(); + } + + private static async Task> ListAsync(HttpClient client) + => (await client.GetFromJsonAsync>(ApiRoutes.Groups, JsonDefaults.Options))!; +} -- 2.52.0 From c56b6d6f55464c4a01d12371c766aceb08acce33e648535dc15b17709b93942d Mon Sep 17 00:00:00 2001 From: Alphaeus Mote Date: Thu, 22 Oct 2026 21:04:58 -0400 Subject: [PATCH 05/72] feat(webui)!: move the console to React + MUI 9 on the Mantis Pro shell Replaces the SvelteKit app with a Vite/React 19 console built on the Mantis Pro 4.2.0 seed (MUI 9.0.1): its theme system, component overrides, drawer and header, restyled to the slate surfaces and blue accent of the house consoles, with light/dark/system modes on CSS variables. This commit is the shell; pages move over in the commits that follow (routes show a placeholder until then). - Session context with can(permission); navigation entries the session cannot use stay visible, disabled, and say why on hover. - One API module (cookie auth + CSRF double-submit; a 401 returns to sign-in with a safe returnUrl) and SWR for cached, shared reads. - The browser NATS client is unchanged apart from exposing its connection state to React; the header shows it as Live/Connecting/Offline. - Shared building blocks: PageHeader, DataTable (sort, paging, row selection, toolbar slot), TreeList (keyboard, context menu, drag and drop), ActionMenu (menus as data, greyed entries explain themselves), ConfirmDialog, Sheet, GatedButton, StatusChip and time/format helpers. - Sign-in keeps local, OIDC, auto-redirect, ?local=1 and the forced first-password change. Build/deploy: `vite build` writes dist/. The webui image now serves it with a dependency-free server.mjs (SPA fallback, immutable asset caching, traversal-safe) on the same port 3000, so compose/k8s/swarm and their health checks are unchanged; Package-Server embeds dist/ instead of the adapter-static output. `npm run check` is now typecheck + ESLint. Co-Authored-By: Claude Opus 5.5 --- .gitignore | 6 +- IaC/compose/docker-compose.yml | 2 +- README.md | 2 +- scripts/Package-Server.ps1 | 5 +- scripts/Test.ps1 | 2 +- src/Infra/webui/Dockerfile | 15 +- src/WebUI/.gitignore | 23 +- src/WebUI/.prettierrc | 9 + src/WebUI/README.md | 42 - src/WebUI/eslint.config.mjs | 96 + src/WebUI/index.html | 16 + src/WebUI/package-lock.json | 6242 +++++++++++------ src/WebUI/package.json | 99 +- src/WebUI/public/favicon.svg | 1 + src/WebUI/{static => public}/robots.txt | 0 src/WebUI/server.mjs | 93 + src/WebUI/src/App.tsx | 25 + src/WebUI/src/api/client.ts | 286 + src/WebUI/src/api/menu.ts | 37 + src/WebUI/src/api/types.ts | 677 ++ src/WebUI/src/app.css | 343 - src/WebUI/src/app.d.ts | 13 - src/WebUI/src/app.html | 22 - src/WebUI/src/assets/style.css | 0 src/WebUI/src/components/@extended/Avatar.tsx | 134 + src/WebUI/src/components/@extended/Dot.tsx | 32 + .../src/components/@extended/IconButton.tsx | 192 + .../src/components/@extended/Transitions.tsx | 113 + src/WebUI/src/components/ActionMenu.tsx | 96 + src/WebUI/src/components/ConfirmDialog.tsx | 94 + src/WebUI/src/components/CopyButton.tsx | 36 + src/WebUI/src/components/DataTable.tsx | 246 + src/WebUI/src/components/DateTime.tsx | 43 + src/WebUI/src/components/EmptyState.tsx | 36 + src/WebUI/src/components/GatedButton.tsx | 21 + src/WebUI/src/components/HoverHelp.tsx | 25 + src/WebUI/src/components/Loadable.tsx | 16 + src/WebUI/src/components/Loader.tsx | 13 + src/WebUI/src/components/MainCard.tsx | 112 + src/WebUI/src/components/OsIcon.tsx | 35 + src/WebUI/src/components/PageHeader.tsx | 75 + src/WebUI/src/components/ScrollTop.tsx | 18 + src/WebUI/src/components/Sheet.tsx | 65 + src/WebUI/src/components/StatusChip.tsx | 66 + src/WebUI/src/components/TreeList.tsx | 205 + src/WebUI/src/components/logo/LogoIcon.tsx | 18 + src/WebUI/src/components/logo/LogoMain.tsx | 19 + src/WebUI/src/components/logo/index.tsx | 26 + .../src/components/third-party/Notistack.tsx | 42 + src/WebUI/src/config.ts | 27 + src/WebUI/src/contexts/SessionContext.tsx | 73 + src/WebUI/src/hooks/useApi.ts | 13 + src/WebUI/src/hooks/useLiveRefresh.ts | 30 + src/WebUI/src/hooks/useNow.ts | 11 + src/WebUI/src/hooks/useSession.ts | 16 + src/WebUI/src/index.tsx | 16 + .../DrawerContent/Navigation/NavGroup.tsx | 43 + .../DrawerContent/Navigation/NavItem.tsx | 83 + .../Drawer/DrawerContent/Navigation/index.tsx | 18 + .../Dashboard/Drawer/DrawerContent/index.tsx | 28 + .../Drawer/DrawerHeader/DrawerHeaderStyled.ts | 21 + .../Dashboard/Drawer/DrawerHeader/index.tsx | 13 + .../Dashboard/Drawer/MiniDrawerStyled.ts | 56 + .../src/layout/Dashboard/Drawer/index.tsx | 68 + .../layout/Dashboard/Header/AppBarStyled.tsx | 41 + .../Dashboard/Header/HeaderContent/index.tsx | 148 + .../src/layout/Dashboard/Header/index.tsx | 64 + src/WebUI/src/layout/Dashboard/index.tsx | 41 + src/WebUI/src/lib/api/client.ts | 347 - src/WebUI/src/lib/api/types.ts | 626 -- src/WebUI/src/lib/assets/favicon.svg | 1 - src/WebUI/src/lib/auth/session.ts | 64 - .../src/lib/components/AddDeviceModal.svelte | 371 - .../src/lib/components/AuthSettings.svelte | 379 - .../lib/components/ConnectionIndicator.svelte | 56 - src/WebUI/src/lib/components/CopyChip.svelte | 86 - .../src/lib/components/EmptyState.svelte | 51 - .../lib/components/FileBindingsEditor.svelte | 109 - .../src/lib/components/JobStateBadge.svelte | 68 - src/WebUI/src/lib/components/OsIcon.svelte | 100 - .../src/lib/components/ParameterInputs.svelte | 268 - .../components/ParameterSchemaEditor.svelte | 170 - .../src/lib/components/RelativeTime.svelte | 27 - .../src/lib/components/RuleBuilder.svelte | 229 - .../src/lib/components/S3Settings.svelte | 347 - .../components/ScheduleCadenceEditor.svelte | 287 - .../components/SecretBindingsEditor.svelte | 310 - .../lib/components/SecretsProviders.svelte | 364 - .../src/lib/components/StatusBadge.svelte | 64 - .../src/lib/components/TriggersCard.svelte | 261 - .../src/lib/components/charts/BarList.svelte | 82 - .../src/lib/components/charts/Donut.svelte | 101 - .../components/charts/TimelineChart.svelte | 93 - .../src/lib/editor/powershell-completions.ts | 274 - src/WebUI/src/lib/index.ts | 1 - src/WebUI/src/lib/messaging/nats.ts | 209 - src/WebUI/src/lib/schedule/cron-describe.ts | 99 - src/WebUI/src/lib/theme/theme.ts | 25 - src/WebUI/src/menu-items/index.ts | 89 + src/WebUI/src/messaging/nats.ts | 224 + src/WebUI/src/pages/auth/login.tsx | 197 + src/WebUI/src/pages/maintenance/404.tsx | 30 + src/WebUI/src/pages/maintenance/pending.tsx | 13 + src/WebUI/src/routes/+layout.svelte | 262 - src/WebUI/src/routes/+layout.ts | 5 - src/WebUI/src/routes/+page.svelte | 525 -- src/WebUI/src/routes/access/+page.svelte | 613 -- src/WebUI/src/routes/devices/+page.svelte | 204 - .../routes/devices/[clientId]/+page.svelte | 859 --- .../devices/[clientId]/shell/+page.svelte | 231 - src/WebUI/src/routes/functions/+page.svelte | 254 - src/WebUI/src/routes/groups/+page.svelte | 433 -- src/WebUI/src/routes/index.tsx | 52 + src/WebUI/src/routes/jobs/+page.svelte | 256 - src/WebUI/src/routes/login/+page.svelte | 309 - src/WebUI/src/routes/scripts/+page.svelte | 85 - .../src/routes/scripts/[id]/+page.svelte | 973 --- src/WebUI/src/routes/settings/+page.svelte | 296 - .../src/sections/auth/AuthBackground.tsx | 42 + src/WebUI/src/sections/auth/AuthWrapper.tsx | 36 + src/WebUI/src/themes/GlobalStyles.tsx | 32 + src/WebUI/src/themes/custom-shadows.tsx | 30 + src/WebUI/src/themes/extend-theme-types.d.ts | 1 + src/WebUI/src/themes/index.tsx | 52 + src/WebUI/src/themes/overrides/Accordion.ts | 31 + .../src/themes/overrides/AccordionDetails.ts | 18 + .../src/themes/overrides/AccordionSummary.tsx | 36 + src/WebUI/src/themes/overrides/Alert.ts | 132 + src/WebUI/src/themes/overrides/AlertTitle.ts | 15 + .../src/themes/overrides/Autocomplete.ts | 23 + src/WebUI/src/themes/overrides/Badge.ts | 47 + src/WebUI/src/themes/overrides/Button.ts | 231 + src/WebUI/src/themes/overrides/ButtonBase.ts | 19 + src/WebUI/src/themes/overrides/ButtonGroup.ts | 11 + src/WebUI/src/themes/overrides/CardContent.ts | 16 + src/WebUI/src/themes/overrides/Checkbox.tsx | 102 + src/WebUI/src/themes/overrides/Chip.ts | 97 + src/WebUI/src/themes/overrides/Dialog.ts | 24 + .../src/themes/overrides/DialogContentText.ts | 17 + src/WebUI/src/themes/overrides/DialogTitle.ts | 14 + src/WebUI/src/themes/overrides/Drawer.ts | 13 + src/WebUI/src/themes/overrides/Fab.ts | 86 + .../src/themes/overrides/FormHelperText.ts | 14 + src/WebUI/src/themes/overrides/IconButton.ts | 38 + src/WebUI/src/themes/overrides/InputBase.ts | 13 + src/WebUI/src/themes/overrides/InputLabel.ts | 30 + .../src/themes/overrides/LinearProgress.ts | 17 + src/WebUI/src/themes/overrides/Link.ts | 11 + .../src/themes/overrides/ListItemButton.tsx | 22 + .../src/themes/overrides/ListItemIcon.tsx | 17 + .../src/themes/overrides/OutlinedInput.ts | 55 + src/WebUI/src/themes/overrides/Pagination.ts | 12 + .../src/themes/overrides/PaginationItem.ts | 120 + src/WebUI/src/themes/overrides/Popover.ts | 16 + src/WebUI/src/themes/overrides/Radio.tsx | 127 + src/WebUI/src/themes/overrides/Rating.tsx | 39 + src/WebUI/src/themes/overrides/Slider.ts | 78 + src/WebUI/src/themes/overrides/Switch.ts | 104 + src/WebUI/src/themes/overrides/Tab.ts | 30 + src/WebUI/src/themes/overrides/TableBody.ts | 25 + src/WebUI/src/themes/overrides/TableCell.ts | 68 + .../src/themes/overrides/TableContainer.ts | 13 + src/WebUI/src/themes/overrides/TableFooter.ts | 20 + src/WebUI/src/themes/overrides/TableHead.ts | 20 + .../src/themes/overrides/TablePagination.ts | 16 + src/WebUI/src/themes/overrides/TableRow.ts | 25 + src/WebUI/src/themes/overrides/Tabs.ts | 13 + .../src/themes/overrides/ToggleButton.ts | 23 + src/WebUI/src/themes/overrides/Tooltip.ts | 16 + src/WebUI/src/themes/overrides/Typography.ts | 13 + src/WebUI/src/themes/overrides/index.ts | 106 + src/WebUI/src/themes/palette.ts | 163 + src/WebUI/src/themes/typography.ts | 77 + src/WebUI/src/types/extended.ts | 19 + src/WebUI/src/types/menu.ts | 24 + src/WebUI/src/types/overrides/Alert.d.ts | 12 + src/WebUI/src/types/overrides/Badge.d.ts | 8 + src/WebUI/src/types/overrides/Button.d.ts | 14 + src/WebUI/src/types/overrides/Checkbox.d.ts | 8 + src/WebUI/src/types/overrides/Chip.d.ts | 12 + src/WebUI/src/types/overrides/Pagination.d.ts | 15 + src/WebUI/src/types/overrides/Radio.d.ts | 8 + src/WebUI/src/types/overrides/Slider.d.ts | 11 + src/WebUI/src/types/overrides/Switch.d.ts | 8 + .../src/types/overrides/createPalette.d.ts | 40 + .../src/types/overrides/createTheme.d.ts | 26 + src/WebUI/src/types/overrides/index.d.ts | 11 + src/WebUI/src/types/theme.ts | 34 + src/WebUI/src/utils/colorUtils.ts | 68 + src/WebUI/src/utils/format.ts | 47 + src/WebUI/src/utils/getColors.ts | 24 + src/WebUI/src/utils/getShadow.ts | 33 + .../src/utils/route-guard/RequireAuth.tsx | 19 + src/WebUI/src/vite-env.d.ts | 3 + src/WebUI/tsconfig.json | 41 +- src/WebUI/tsconfig.node.json | 8 + src/WebUI/vite.config.mts | 38 + src/WebUI/vite.config.ts | 38 - 198 files changed, 11588 insertions(+), 13470 deletions(-) create mode 100644 src/WebUI/.prettierrc delete mode 100644 src/WebUI/README.md create mode 100644 src/WebUI/eslint.config.mjs create mode 100644 src/WebUI/index.html create mode 100644 src/WebUI/public/favicon.svg rename src/WebUI/{static => public}/robots.txt (100%) create mode 100644 src/WebUI/server.mjs create mode 100644 src/WebUI/src/App.tsx create mode 100644 src/WebUI/src/api/client.ts create mode 100644 src/WebUI/src/api/menu.ts create mode 100644 src/WebUI/src/api/types.ts delete mode 100644 src/WebUI/src/app.css delete mode 100644 src/WebUI/src/app.d.ts delete mode 100644 src/WebUI/src/app.html create mode 100644 src/WebUI/src/assets/style.css create mode 100644 src/WebUI/src/components/@extended/Avatar.tsx create mode 100644 src/WebUI/src/components/@extended/Dot.tsx create mode 100644 src/WebUI/src/components/@extended/IconButton.tsx create mode 100644 src/WebUI/src/components/@extended/Transitions.tsx create mode 100644 src/WebUI/src/components/ActionMenu.tsx create mode 100644 src/WebUI/src/components/ConfirmDialog.tsx create mode 100644 src/WebUI/src/components/CopyButton.tsx create mode 100644 src/WebUI/src/components/DataTable.tsx create mode 100644 src/WebUI/src/components/DateTime.tsx create mode 100644 src/WebUI/src/components/EmptyState.tsx create mode 100644 src/WebUI/src/components/GatedButton.tsx create mode 100644 src/WebUI/src/components/HoverHelp.tsx create mode 100644 src/WebUI/src/components/Loadable.tsx create mode 100644 src/WebUI/src/components/Loader.tsx create mode 100644 src/WebUI/src/components/MainCard.tsx create mode 100644 src/WebUI/src/components/OsIcon.tsx create mode 100644 src/WebUI/src/components/PageHeader.tsx create mode 100644 src/WebUI/src/components/ScrollTop.tsx create mode 100644 src/WebUI/src/components/Sheet.tsx create mode 100644 src/WebUI/src/components/StatusChip.tsx create mode 100644 src/WebUI/src/components/TreeList.tsx create mode 100644 src/WebUI/src/components/logo/LogoIcon.tsx create mode 100644 src/WebUI/src/components/logo/LogoMain.tsx create mode 100644 src/WebUI/src/components/logo/index.tsx create mode 100644 src/WebUI/src/components/third-party/Notistack.tsx create mode 100644 src/WebUI/src/config.ts create mode 100644 src/WebUI/src/contexts/SessionContext.tsx create mode 100644 src/WebUI/src/hooks/useApi.ts create mode 100644 src/WebUI/src/hooks/useLiveRefresh.ts create mode 100644 src/WebUI/src/hooks/useNow.ts create mode 100644 src/WebUI/src/hooks/useSession.ts create mode 100644 src/WebUI/src/index.tsx create mode 100644 src/WebUI/src/layout/Dashboard/Drawer/DrawerContent/Navigation/NavGroup.tsx create mode 100644 src/WebUI/src/layout/Dashboard/Drawer/DrawerContent/Navigation/NavItem.tsx create mode 100644 src/WebUI/src/layout/Dashboard/Drawer/DrawerContent/Navigation/index.tsx create mode 100644 src/WebUI/src/layout/Dashboard/Drawer/DrawerContent/index.tsx create mode 100644 src/WebUI/src/layout/Dashboard/Drawer/DrawerHeader/DrawerHeaderStyled.ts create mode 100644 src/WebUI/src/layout/Dashboard/Drawer/DrawerHeader/index.tsx create mode 100644 src/WebUI/src/layout/Dashboard/Drawer/MiniDrawerStyled.ts create mode 100644 src/WebUI/src/layout/Dashboard/Drawer/index.tsx create mode 100644 src/WebUI/src/layout/Dashboard/Header/AppBarStyled.tsx create mode 100644 src/WebUI/src/layout/Dashboard/Header/HeaderContent/index.tsx create mode 100644 src/WebUI/src/layout/Dashboard/Header/index.tsx create mode 100644 src/WebUI/src/layout/Dashboard/index.tsx delete mode 100644 src/WebUI/src/lib/api/client.ts delete mode 100644 src/WebUI/src/lib/api/types.ts delete mode 100644 src/WebUI/src/lib/assets/favicon.svg delete mode 100644 src/WebUI/src/lib/auth/session.ts delete mode 100644 src/WebUI/src/lib/components/AddDeviceModal.svelte delete mode 100644 src/WebUI/src/lib/components/AuthSettings.svelte delete mode 100644 src/WebUI/src/lib/components/ConnectionIndicator.svelte delete mode 100644 src/WebUI/src/lib/components/CopyChip.svelte delete mode 100644 src/WebUI/src/lib/components/EmptyState.svelte delete mode 100644 src/WebUI/src/lib/components/FileBindingsEditor.svelte delete mode 100644 src/WebUI/src/lib/components/JobStateBadge.svelte delete mode 100644 src/WebUI/src/lib/components/OsIcon.svelte delete mode 100644 src/WebUI/src/lib/components/ParameterInputs.svelte delete mode 100644 src/WebUI/src/lib/components/ParameterSchemaEditor.svelte delete mode 100644 src/WebUI/src/lib/components/RelativeTime.svelte delete mode 100644 src/WebUI/src/lib/components/RuleBuilder.svelte delete mode 100644 src/WebUI/src/lib/components/S3Settings.svelte delete mode 100644 src/WebUI/src/lib/components/ScheduleCadenceEditor.svelte delete mode 100644 src/WebUI/src/lib/components/SecretBindingsEditor.svelte delete mode 100644 src/WebUI/src/lib/components/SecretsProviders.svelte delete mode 100644 src/WebUI/src/lib/components/StatusBadge.svelte delete mode 100644 src/WebUI/src/lib/components/TriggersCard.svelte delete mode 100644 src/WebUI/src/lib/components/charts/BarList.svelte delete mode 100644 src/WebUI/src/lib/components/charts/Donut.svelte delete mode 100644 src/WebUI/src/lib/components/charts/TimelineChart.svelte delete mode 100644 src/WebUI/src/lib/editor/powershell-completions.ts delete mode 100644 src/WebUI/src/lib/index.ts delete mode 100644 src/WebUI/src/lib/messaging/nats.ts delete mode 100644 src/WebUI/src/lib/schedule/cron-describe.ts delete mode 100644 src/WebUI/src/lib/theme/theme.ts create mode 100644 src/WebUI/src/menu-items/index.ts create mode 100644 src/WebUI/src/messaging/nats.ts create mode 100644 src/WebUI/src/pages/auth/login.tsx create mode 100644 src/WebUI/src/pages/maintenance/404.tsx create mode 100644 src/WebUI/src/pages/maintenance/pending.tsx delete mode 100644 src/WebUI/src/routes/+layout.svelte delete mode 100644 src/WebUI/src/routes/+layout.ts delete mode 100644 src/WebUI/src/routes/+page.svelte delete mode 100644 src/WebUI/src/routes/access/+page.svelte delete mode 100644 src/WebUI/src/routes/devices/+page.svelte delete mode 100644 src/WebUI/src/routes/devices/[clientId]/+page.svelte delete mode 100644 src/WebUI/src/routes/devices/[clientId]/shell/+page.svelte delete mode 100644 src/WebUI/src/routes/functions/+page.svelte delete mode 100644 src/WebUI/src/routes/groups/+page.svelte create mode 100644 src/WebUI/src/routes/index.tsx delete mode 100644 src/WebUI/src/routes/jobs/+page.svelte delete mode 100644 src/WebUI/src/routes/login/+page.svelte delete mode 100644 src/WebUI/src/routes/scripts/+page.svelte delete mode 100644 src/WebUI/src/routes/scripts/[id]/+page.svelte delete mode 100644 src/WebUI/src/routes/settings/+page.svelte create mode 100644 src/WebUI/src/sections/auth/AuthBackground.tsx create mode 100644 src/WebUI/src/sections/auth/AuthWrapper.tsx create mode 100644 src/WebUI/src/themes/GlobalStyles.tsx create mode 100644 src/WebUI/src/themes/custom-shadows.tsx create mode 100644 src/WebUI/src/themes/extend-theme-types.d.ts create mode 100644 src/WebUI/src/themes/index.tsx create mode 100644 src/WebUI/src/themes/overrides/Accordion.ts create mode 100644 src/WebUI/src/themes/overrides/AccordionDetails.ts create mode 100644 src/WebUI/src/themes/overrides/AccordionSummary.tsx create mode 100644 src/WebUI/src/themes/overrides/Alert.ts create mode 100644 src/WebUI/src/themes/overrides/AlertTitle.ts create mode 100644 src/WebUI/src/themes/overrides/Autocomplete.ts create mode 100644 src/WebUI/src/themes/overrides/Badge.ts create mode 100644 src/WebUI/src/themes/overrides/Button.ts create mode 100644 src/WebUI/src/themes/overrides/ButtonBase.ts create mode 100644 src/WebUI/src/themes/overrides/ButtonGroup.ts create mode 100644 src/WebUI/src/themes/overrides/CardContent.ts create mode 100644 src/WebUI/src/themes/overrides/Checkbox.tsx create mode 100644 src/WebUI/src/themes/overrides/Chip.ts create mode 100644 src/WebUI/src/themes/overrides/Dialog.ts create mode 100644 src/WebUI/src/themes/overrides/DialogContentText.ts create mode 100644 src/WebUI/src/themes/overrides/DialogTitle.ts create mode 100644 src/WebUI/src/themes/overrides/Drawer.ts create mode 100644 src/WebUI/src/themes/overrides/Fab.ts create mode 100644 src/WebUI/src/themes/overrides/FormHelperText.ts create mode 100644 src/WebUI/src/themes/overrides/IconButton.ts create mode 100644 src/WebUI/src/themes/overrides/InputBase.ts create mode 100644 src/WebUI/src/themes/overrides/InputLabel.ts create mode 100644 src/WebUI/src/themes/overrides/LinearProgress.ts create mode 100644 src/WebUI/src/themes/overrides/Link.ts create mode 100644 src/WebUI/src/themes/overrides/ListItemButton.tsx create mode 100644 src/WebUI/src/themes/overrides/ListItemIcon.tsx create mode 100644 src/WebUI/src/themes/overrides/OutlinedInput.ts create mode 100644 src/WebUI/src/themes/overrides/Pagination.ts create mode 100644 src/WebUI/src/themes/overrides/PaginationItem.ts create mode 100644 src/WebUI/src/themes/overrides/Popover.ts create mode 100644 src/WebUI/src/themes/overrides/Radio.tsx create mode 100644 src/WebUI/src/themes/overrides/Rating.tsx create mode 100644 src/WebUI/src/themes/overrides/Slider.ts create mode 100644 src/WebUI/src/themes/overrides/Switch.ts create mode 100644 src/WebUI/src/themes/overrides/Tab.ts create mode 100644 src/WebUI/src/themes/overrides/TableBody.ts create mode 100644 src/WebUI/src/themes/overrides/TableCell.ts create mode 100644 src/WebUI/src/themes/overrides/TableContainer.ts create mode 100644 src/WebUI/src/themes/overrides/TableFooter.ts create mode 100644 src/WebUI/src/themes/overrides/TableHead.ts create mode 100644 src/WebUI/src/themes/overrides/TablePagination.ts create mode 100644 src/WebUI/src/themes/overrides/TableRow.ts create mode 100644 src/WebUI/src/themes/overrides/Tabs.ts create mode 100644 src/WebUI/src/themes/overrides/ToggleButton.ts create mode 100644 src/WebUI/src/themes/overrides/Tooltip.ts create mode 100644 src/WebUI/src/themes/overrides/Typography.ts create mode 100644 src/WebUI/src/themes/overrides/index.ts create mode 100644 src/WebUI/src/themes/palette.ts create mode 100644 src/WebUI/src/themes/typography.ts create mode 100644 src/WebUI/src/types/extended.ts create mode 100644 src/WebUI/src/types/menu.ts create mode 100644 src/WebUI/src/types/overrides/Alert.d.ts create mode 100644 src/WebUI/src/types/overrides/Badge.d.ts create mode 100644 src/WebUI/src/types/overrides/Button.d.ts create mode 100644 src/WebUI/src/types/overrides/Checkbox.d.ts create mode 100644 src/WebUI/src/types/overrides/Chip.d.ts create mode 100644 src/WebUI/src/types/overrides/Pagination.d.ts create mode 100644 src/WebUI/src/types/overrides/Radio.d.ts create mode 100644 src/WebUI/src/types/overrides/Slider.d.ts create mode 100644 src/WebUI/src/types/overrides/Switch.d.ts create mode 100644 src/WebUI/src/types/overrides/createPalette.d.ts create mode 100644 src/WebUI/src/types/overrides/createTheme.d.ts create mode 100644 src/WebUI/src/types/overrides/index.d.ts create mode 100644 src/WebUI/src/types/theme.ts create mode 100644 src/WebUI/src/utils/colorUtils.ts create mode 100644 src/WebUI/src/utils/format.ts create mode 100644 src/WebUI/src/utils/getColors.ts create mode 100644 src/WebUI/src/utils/getShadow.ts create mode 100644 src/WebUI/src/utils/route-guard/RequireAuth.tsx create mode 100644 src/WebUI/src/vite-env.d.ts create mode 100644 src/WebUI/tsconfig.node.json create mode 100644 src/WebUI/vite.config.mts delete mode 100644 src/WebUI/vite.config.ts diff --git a/.gitignore b/.gitignore index 5c2eff5..fe1bae3 100644 --- a/.gitignore +++ b/.gitignore @@ -12,10 +12,9 @@ TestResults/ *.user *.suo -# Node / SvelteKit +# Node / WebUI (Vite) node_modules/ -.svelte-kit/ -src/WebUI/build/ +src/WebUI/dist/ npm-debug.log* # Local state @@ -43,4 +42,3 @@ Thumbs.db src/Infra/backend/agent-package/* !src/Infra/backend/agent-package/.gitkeep -src/WebUI/build-static/ diff --git a/IaC/compose/docker-compose.yml b/IaC/compose/docker-compose.yml index 04c72dc..7630104 100644 --- a/IaC/compose/docker-compose.yml +++ b/IaC/compose/docker-compose.yml @@ -1,6 +1,6 @@ #============================================================================= # ExecuteR - Windows endpoint management control plane -# Agent + NATS-over-WebSocket + ASP.NET Core backend + SvelteKit web UI +# Agent + NATS-over-WebSocket + ASP.NET Core backend + React (MUI) web console #============================================================================= # # CREDENTIALS: diff --git a/README.md b/README.md index 1195104..7fac613 100644 --- a/README.md +++ b/README.md @@ -224,7 +224,7 @@ Full script-execution, enrollment, and remote-shell sequence diagrams are in # Run tests ./scripts/Test.ps1 # unit -./scripts/Test.ps1 -IncludeWebUI # + svelte-check +./scripts/Test.ps1 -IncludeWebUI # + WebUI typecheck and lint ``` Run the stack: diff --git a/scripts/Package-Server.ps1 b/scripts/Package-Server.ps1 index 4126f66..afc8684 100644 --- a/scripts/Package-Server.ps1 +++ b/scripts/Package-Server.ps1 @@ -37,16 +37,15 @@ if (-not $SkipIcon) { Push-Location (Join-Path $repoRoot 'src/WebUI') try { if (-not (Test-Path 'node_modules')) { npm ci } - $env:ADAPTER = 'static' $env:PUBLIC_BUILD_VERSION = $Version npm run build if ($LASTEXITCODE -ne 0) { throw "WebUI static build failed ($LASTEXITCODE)." } } finally { - Remove-Item Env:\ADAPTER -ErrorAction SilentlyContinue + Remove-Item Env:\PUBLIC_BUILD_VERSION -ErrorAction SilentlyContinue Pop-Location } -$staticBuild = Join-Path $repoRoot 'src/WebUI/build-static' +$staticBuild = Join-Path $repoRoot 'src/WebUI/dist' if (-not (Test-Path (Join-Path $staticBuild 'index.html'))) { throw "Static WebUI build missing at $staticBuild" } diff --git a/scripts/Test.ps1 b/scripts/Test.ps1 index 2de817f..c30afd3 100644 --- a/scripts/Test.ps1 +++ b/scripts/Test.ps1 @@ -43,7 +43,7 @@ if ($IncludeWebUI) { if ($LASTEXITCODE -ne 0) { throw "npm ci failed ($LASTEXITCODE)." } } npm run check - if ($LASTEXITCODE -ne 0) { throw "svelte-check failed ($LASTEXITCODE)." } + if ($LASTEXITCODE -ne 0) { throw "WebUI check (typecheck + lint) failed ($LASTEXITCODE)." } } finally { Pop-Location diff --git a/src/Infra/webui/Dockerfile b/src/Infra/webui/Dockerfile index 1896e23..8aeb981 100644 --- a/src/Infra/webui/Dockerfile +++ b/src/Infra/webui/Dockerfile @@ -5,12 +5,12 @@ FROM node:24-alpine AS build ARG UNIFIED_VERSION=0.0.0.0 WORKDIR /app -COPY src/WebUI/package.json src/WebUI/package-lock.json ./ +COPY src/WebUI/package.json src/WebUI/package-lock.json src/WebUI/.npmrc ./ RUN npm ci COPY src/WebUI/ . ENV PUBLIC_BUILD_VERSION=${UNIFIED_VERSION} -RUN npm run build && npm prune --omit=dev +RUN npm run build FROM node:24-alpine ARG UNIFIED_VERSION=0.0.0.0 @@ -20,7 +20,7 @@ ARG GIT_COMMIT_SHORT="" ARG BUILD_DATE="" ARG SOURCE_URL="https://prod.git.gracesolution.info/gsadmin/ExecuteR" LABEL org.opencontainers.image.title="ExecuteR Control Plane WebUI" \ - org.opencontainers.image.description="ExecuteR web console: SvelteKit UI for devices, scripts, jobs and settings" \ + org.opencontainers.image.description="ExecuteR web console: React (MUI) UI for devices, groups, scripts, schedules and jobs" \ org.opencontainers.image.version="${UNIFIED_VERSION}" \ org.opencontainers.image.revision="${GIT_COMMIT}" \ executer.revision.short="${GIT_COMMIT_SHORT}" \ @@ -31,10 +31,11 @@ LABEL org.opencontainers.image.title="ExecuteR Control Plane WebUI" \ org.opencontainers.image.vendor="ExecuteR" \ org.opencontainers.image.licenses="AGPL-3.0" +# The console is a static SPA; server.mjs (no dependencies) serves dist/ with +# an index.html fallback for client-side routes. WORKDIR /app -COPY --from=build /app/build ./build -COPY --from=build /app/node_modules ./node_modules -COPY --from=build /app/package.json . +COPY --from=build /app/dist ./dist +COPY --from=build /app/server.mjs . ENV PORT=3000 \ NODE_ENV=production @@ -42,4 +43,4 @@ ENV PORT=3000 \ EXPOSE 3000 USER node -CMD ["node", "build"] +CMD ["node", "server.mjs"] diff --git a/src/WebUI/.gitignore b/src/WebUI/.gitignore index 079b463..48c15a5 100644 --- a/src/WebUI/.gitignore +++ b/src/WebUI/.gitignore @@ -1,23 +1,8 @@ node_modules - -# Output -.output -.vercel -.netlify -.wrangler -/.svelte-kit -/build - -# OS -.DS_Store -Thumbs.db - -# Env +# Vite output: the container image and the combined server binary both ship dist/ +/dist +*.tsbuildinfo +vite.config.mts.timestamp-* .env .env.* !.env.example -!.env.test - -# Vite -vite.config.js.timestamp-* -vite.config.ts.timestamp-* diff --git a/src/WebUI/.prettierrc b/src/WebUI/.prettierrc new file mode 100644 index 0000000..7bf6c1d --- /dev/null +++ b/src/WebUI/.prettierrc @@ -0,0 +1,9 @@ +{ + "bracketSpacing": true, + "printWidth": 140, + "singleQuote": true, + "trailingComma": "none", + "tabWidth": 2, + "useTabs": false, + "endOfLine": "lf" +} diff --git a/src/WebUI/README.md b/src/WebUI/README.md deleted file mode 100644 index c665ef0..0000000 --- a/src/WebUI/README.md +++ /dev/null @@ -1,42 +0,0 @@ -# sv - -Everything you need to build a Svelte project, powered by [`sv`](https://github.com/sveltejs/cli). - -## Creating a project - -If you're seeing this, you've probably already done this step. Congrats! - -```sh -# create a new project -npx sv create my-app -``` - -To recreate this project with the same configuration: - -```sh -# recreate this project -npx sv@0.17.0 create --template minimal --types ts --install npm src/WebUI -``` - -## Developing - -Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server: - -```sh -npm run dev - -# or start the server and open the app in a new browser tab -npm run dev -- --open -``` - -## Building - -To create a production version of your app: - -```sh -npm run build -``` - -You can preview the production build with `npm run preview`. - -> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment. diff --git a/src/WebUI/eslint.config.mjs b/src/WebUI/eslint.config.mjs new file mode 100644 index 0000000..8358075 --- /dev/null +++ b/src/WebUI/eslint.config.mjs @@ -0,0 +1,96 @@ +import { fixupConfigRules, fixupPluginRules } from '@eslint/compat'; +import prettier from 'eslint-plugin-prettier'; +import reactHooks from 'eslint-plugin-react-hooks'; +import typescriptEslint from '@typescript-eslint/eslint-plugin'; +import tsParser from '@typescript-eslint/parser'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; +import js from '@eslint/js'; +import { FlatCompat } from '@eslint/eslintrc'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all +}); + +export default [ + ...fixupConfigRules(compat.extends('prettier')), + + { + plugins: { + prettier, + '@typescript-eslint': typescriptEslint, + 'react-hooks': fixupPluginRules(reactHooks) + }, + + languageOptions: { + parser: tsParser, + ecmaVersion: 2020, + sourceType: 'module', + + parserOptions: { + project: './tsconfig.json', + tsconfigRootDir: __dirname, + warnOnUnsupportedTypeScriptVersion: false + } + }, + + settings: { + 'import/resolver': { + node: { + moduleDirectory: ['node_modules', 'src/'] + }, + + typescript: { + alwaysTryTypes: true + } + } + }, + + rules: { + 'react/no-unescaped-entities': 'off', + 'react/jsx-filename-extension': 'off', + 'no-param-reassign': 'off', + 'react/prop-types': 'off', + 'react/require-default-props': 'off', + 'react/no-array-index-key': 'off', + 'react/react-in-jsx-scope': 'off', + 'react/jsx-props-no-spreading': 'off', + 'import/order': 'off', + 'no-console': 'off', + 'no-shadow': 'off', + '@typescript-eslint/naming-convention': 'off', + '@typescript-eslint/no-shadow': 'off', + 'import/no-cycle': 'off', + 'import/no-extraneous-dependencies': 'off', + 'jsx-a11y/label-has-associated-control': 'off', + 'jsx-a11y/no-autofocus': 'off', + 'react-hooks/rules-of-hooks': 'error', // Enforces rules of Hooks + 'react-hooks/exhaustive-deps': 'warn', // Enforces effect dependencies + + 'no-restricted-imports': [ + 'error', + { + patterns: ['@mui/*/*/*', '!@mui/material/test-utils/*'] + } + ], + + '@typescript-eslint/no-unused-vars': [ + 'error', + { + vars: 'all', + args: 'none' + } + ], + + 'prettier/prettier': 'warn' + } + }, + { + ignores: ['node_modules/**'], // Make sure this doesn't match your files. + files: ['src/**/*.{js,jsx,ts,tsx}'] + } +]; \ No newline at end of file diff --git a/src/WebUI/index.html b/src/WebUI/index.html new file mode 100644 index 0000000..d036108 --- /dev/null +++ b/src/WebUI/index.html @@ -0,0 +1,16 @@ + + + + + + + + + ExecuteR Control + + + +
+ + + diff --git a/src/WebUI/package-lock.json b/src/WebUI/package-lock.json index 1962a6f..9f56390 100644 --- a/src/WebUI/package-lock.json +++ b/src/WebUI/package-lock.json @@ -1,2156 +1,4090 @@ { - "name": "webui", - "version": "0.0.1", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "webui", - "version": "0.0.1", - "dependencies": { - "@nats-io/nats-core": "^3.4.0", - "@nats-io/nkeys": "^2.0.3", - "@xterm/addon-fit": "^0.11.0", - "@xterm/xterm": "^6.0.0", - "monaco-editor": "^0.56.0" - }, - "devDependencies": { - "@sveltejs/adapter-node": "^5.5.7", - "@sveltejs/adapter-static": "^3.0.10", - "@sveltejs/kit": "^2.63.0", - "@sveltejs/vite-plugin-svelte": "^7.1.2", - "@types/node": "^26.1.2", - "svelte": "^5.56.1", - "svelte-check": "^4.6.0", - "typescript": "^6.0.3", - "vite": "^8.0.16" - } - }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.13", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", - "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.0", - "@jridgewell/trace-mapping": "^0.3.24" - } - }, - "node_modules/@jridgewell/remapping": { - "version": "2.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", - "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.24" - } - }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", - "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", - "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", - "dev": true, - "license": "MIT" - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.31", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", - "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" - } - }, - "node_modules/@napi-rs/lzma-linux-x64-gnu": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/@napi-rs/lzma-linux-x64-gnu/-/lzma-linux-x64-gnu-1.5.1.tgz", - "integrity": "sha512-oTXEIha4SsuXdTA4Iyskj0kpdx2yVXdhd75c2v3xGrHFfVMsbhTPZU/nMPL4sWKo4pBHm3aucLaqGlF696dTyQ==", - "cpu": [ - "x64" - ], - "dev": true, - "libc": [ - "glibc" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^22.20 || ^24.12 || >=25" - } - }, - "node_modules/@nats-io/nats-core": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/@nats-io/nats-core/-/nats-core-3.4.0.tgz", - "integrity": "sha512-QMDM86EUNm+wudlKC67HLar/KHHQUvJGLfb4jbahje3pUk3K9afeck9fwsxBZF0eUFox6T/TA6m/t+lQqf+QsQ==", - "license": "Apache-2.0", - "dependencies": { - "@nats-io/nkeys": "2.0.3", - "@nats-io/nuid": "3.0.0" - } - }, - "node_modules/@nats-io/nkeys": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@nats-io/nkeys/-/nkeys-2.0.3.tgz", - "integrity": "sha512-JVt56GuE6Z89KUkI4TXUbSI9fmIfAmk6PMPknijmuL72GcD+UgIomTcRWiNvvJKxA01sBbmIPStqJs5cMRBC3A==", - "license": "Apache-2.0", - "dependencies": { - "tweetnacl": "^1.0.3" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@nats-io/nuid": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@nats-io/nuid/-/nuid-3.0.0.tgz", - "integrity": "sha512-QbXZDrxmYlrn5AD06gYcUTmEHwxn96HBQMIk7XTjDlEcx6FPzVBBPjp4AMRh1lEv6B4iJ6Xb/Uz61JugPXFRQg==", - "license": "Apache-2.0", - "engines": { - "node": ">= 22.x" - } - }, - "node_modules/@oxc-project/types": { - "version": "0.143.0", - "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.143.0.tgz", - "integrity": "sha512-u6JZdLBTLotrNC9Vd6vPssINdzcCzleKAH6EJKImQb7GtYvX5keN2dxkoK44stCc4tffE6QQRtZTXVSzsLUlWA==", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/Boshen" - } - }, - "node_modules/@polka/url": { - "version": "1.0.0-next.29", - "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.29.tgz", - "integrity": "sha512-wwQAWhWSuHaag8c4q/KN/vCoeOJYshAIvMQwD4GpSb3OiZklFfvAgmj0VCBBImRpuF/aFgIRzllXlVX93Jevww==", - "dev": true, - "license": "MIT" - }, - "node_modules/@rolldown/binding-android-arm64": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.3.tgz", - "integrity": "sha512-zrJtHDcaZJ1Fp7xf4hNl+7seH9Cn/N5TwLYkhgXREtBwAd/jaqW3uqeHxpDugJLVICWg4eW44kOQEGJ1r6jCGw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@rolldown/binding-darwin-arm64": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.3.tgz", - "integrity": "sha512-ieIiibVCp0tX7TLu2cafoNPv8wJyYi01ekXpbf8q2j7F4rGAhhXb/eQh7ge9DRBY78GwmRQtvjZDux7EDbA8kA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@rolldown/binding-darwin-x64": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.3.tgz", - "integrity": "sha512-Zh9tCon19eDXJoihx0rqKhMUlMYqzwj3aPsSuHmI4RWZh62dWUL+DJN4C5YQya5TcQBJU/Fe8+rY0jhXTQITqA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@rolldown/binding-freebsd-x64": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.3.tgz", - "integrity": "sha512-nGbJWewA1wrXXZiQhjAT5rhibGfns5ZNkDVqxsO6zJ3f3YvpoDNNmGMSbbhLuXKjNScaBJVOAboztAWVespQMg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@rolldown/binding-linux-arm-gnueabihf": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.3.tgz", - "integrity": "sha512-QNniJr5Kml0kDEB98jiDOJjXNroxIIi0IXIbdYzY26Xt1pVbeP62+KnoIZLwirOymX/0jDk/2gI/bNUv7A7OIw==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@rolldown/binding-linux-arm64-gnu": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.3.tgz", - "integrity": "sha512-TkqEAcmmvH3I/q4114NB4RVt6241Dao48pF45uLcFGrwAaIn0iITgTAKP/dLjbN0R4buJjGb91+UHSoFmpgIWw==", - "cpu": [ - "arm64" - ], - "dev": true, - "libc": [ - "glibc" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@rolldown/binding-linux-arm64-musl": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.3.tgz", - "integrity": "sha512-NHqjnxpsndf4MPymxteFAWHHfkTL8HjWh1KB7z23ofZ6QO2euONuxDXjat69dKZRALnGypg8k8SsK8vZJoXv1Q==", - "cpu": [ - "arm64" - ], - "dev": true, - "libc": [ - "musl" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@rolldown/binding-linux-ppc64-gnu": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.3.tgz", - "integrity": "sha512-6tbrbwfz5GB9DQ4Jwo6hy9v+vR31xZlvzZ6n5Xut6Hhx5PvrA9q/HsK8KMaYQp063iqZGXwNvZtYNLD7EM/x0w==", - "cpu": [ - "ppc64" - ], - "dev": true, - "libc": [ - "glibc" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@rolldown/binding-linux-s390x-gnu": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.3.tgz", - "integrity": "sha512-oyuXxXmoZHjXC917IAPFAAv4wWAa0cM9afk8nx1+9/jNNOX1uPf8yDA6p7G0RypOfw/X0PQt5IfoquY1um+zSg==", - "cpu": [ - "s390x" - ], - "dev": true, - "libc": [ - "glibc" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@rolldown/binding-linux-x64-gnu": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.3.tgz", - "integrity": "sha512-TytMwF2KVGqP2tgd0I1OY0PAv78dZRAYcF5ssDzjM34SUXCED3uXvSd5+lHoC0bTD6eEdFz7LdQNCO1y0oVk9w==", - "cpu": [ - "x64" - ], - "dev": true, - "libc": [ - "glibc" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@rolldown/binding-linux-x64-musl": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.3.tgz", - "integrity": "sha512-/E9m3qstrJFVPoULV25mVQblSNExY2+kBsYe4sy0Tn0yOOgJ8wZbZt3KnRbF/XeU2Gl1STKUQnDNTqhIE5MD4A==", - "cpu": [ - "x64" - ], - "dev": true, - "libc": [ - "musl" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@rolldown/binding-openharmony-arm64": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.3.tgz", - "integrity": "sha512-Kr0OcsoQI816i6HOl3vFHpd1K0eZyh76zgfj4c1nTyaTsd5r2Mj1lwM4R90y/qaCfmTn9eHy0SKwi98eitRxug==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openharmony" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@rolldown/binding-win32-arm64-msvc": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.3.tgz", - "integrity": "sha512-hOtMwTqnME+/gJcH/PCZ0wn0zPUjiWOgkHpxbSJpfGKMezHltx1S7/k1SitzVa7Ww2cqrDDaFbZEhcJZO8o+Jw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@rolldown/binding-win32-x64-msvc": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.3.tgz", - "integrity": "sha512-ekcqMMkI2PlhYnfzQnB/cEdYUVVJViWvoUyLrbzgDoi3Snfc1mVBwdnc306ufA5ejy8JSPjT2RlW1nQSjW7efg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@rolldown/pluginutils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz", - "integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==", - "dev": true, - "license": "MIT" - }, - "node_modules/@rollup/plugin-commonjs": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-29.0.3.tgz", - "integrity": "sha512-ZaOxZceP7SOUW7Lqw5IRVweSQYWaeIPnXIGLiB690EBA3FGJTO40EEr2L5yZplJWsgTCogILRSpcAe7+U0Otdg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@rollup/pluginutils": "^5.0.1", - "commondir": "^1.0.1", - "estree-walker": "^2.0.2", - "fdir": "^6.2.0", - "is-reference": "1.2.1", - "magic-string": "^0.30.3", - "picomatch": "^4.0.2" - }, - "engines": { - "node": ">=16.0.0 || 14 >= 14.17" - }, - "peerDependencies": { - "rollup": "^2.68.0||^3.0.0||^4.0.0" - }, - "peerDependenciesMeta": { - "rollup": { - "optional": true - } - } - }, - "node_modules/@rollup/plugin-commonjs/node_modules/is-reference": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", - "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/estree": "*" - } - }, - "node_modules/@rollup/plugin-json": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-json/-/plugin-json-6.1.0.tgz", - "integrity": "sha512-EGI2te5ENk1coGeADSIwZ7G2Q8CJS2sF120T7jLw4xFw9n7wIOXHo+kIYRAoVpJAN+kmqZSoO3Fp4JtoNF4ReA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@rollup/pluginutils": "^5.1.0" - }, - "engines": { - "node": ">=14.0.0" - }, - "peerDependencies": { - "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" - }, - "peerDependenciesMeta": { - "rollup": { - "optional": true - } - } - }, - "node_modules/@rollup/plugin-node-resolve": { - "version": "16.0.3", - "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-16.0.3.tgz", - "integrity": "sha512-lUYM3UBGuM93CnMPG1YocWu7X802BrNF3jW2zny5gQyLQgRFJhV1Sq0Zi74+dh/6NBx1DxFC4b4GXg9wUCG5Qg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@rollup/pluginutils": "^5.0.1", - "@types/resolve": "1.20.2", - "deepmerge": "^4.2.2", - "is-module": "^1.0.0", - "resolve": "^1.22.1" - }, - "engines": { - "node": ">=14.0.0" - }, - "peerDependencies": { - "rollup": "^2.78.0||^3.0.0||^4.0.0" - }, - "peerDependenciesMeta": { - "rollup": { - "optional": true - } - } - }, - "node_modules/@rollup/plugin-replace": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/@rollup/plugin-replace/-/plugin-replace-6.0.3.tgz", - "integrity": "sha512-J4RZarRvQAm5IF0/LwUUg+obsm+xZhYnbMXmXROyoSE1ATJe3oXSb9L5MMppdxP2ylNSjv6zFBwKYjcKMucVfA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@rollup/pluginutils": "^5.0.1", - "magic-string": "^0.30.3" - }, - "engines": { - "node": ">=14.0.0" - }, - "peerDependencies": { - "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" - }, - "peerDependenciesMeta": { - "rollup": { - "optional": true - } - } - }, - "node_modules/@rollup/pluginutils": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.4.0.tgz", - "integrity": "sha512-MfPp06CjRLfXQ3wY0R8vJDYBy/MvVcc9OulEfR0B8Iv9ko+GCNaRZ+EpJYFl27LhKsZK0o420sYCRHCjfCgeUg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/estree": "^1.0.0", - "estree-walker": "^2.0.2", - "picomatch": "^4.0.2" - }, - "engines": { - "node": ">=14.0.0" - }, - "peerDependencies": { - "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" - }, - "peerDependenciesMeta": { - "rollup": { - "optional": true - } - } - }, - "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.62.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.62.4.tgz", - "integrity": "sha512-RrPokAb7dmbxFoeO3TloqHyOjgye8RkBhSqmp4aJMIex4c9r46ZstPnleDQOq1t46VOVjwIuwNogIqbodV1Vvg==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ] - }, - "node_modules/@rollup/rollup-android-arm64": { - "version": "4.62.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.62.4.tgz", - "integrity": "sha512-JKuJc+pnpks2pjy7L/N3v/cAkZxYlnmuZoD840ldbMI5KDbC4iO9NKwPKYdjYFCMAIIlBzYSFHxIJVYzRo2/8A==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ] - }, - "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.62.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.62.4.tgz", - "integrity": "sha512-krw5uS2STmvJ02x0uTXHbqQNuz+9eZ1iw+qXk9dmW2gvV4jV7O2hEoOnuhFrpOPiel1mBFtqbxYZZtC46hXLOw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.62.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.62.4.tgz", - "integrity": "sha512-wsTxtgApb4PrOsNJIm0FZ1h3WvCC+k9uxLJ4ad75hgoS4NiRes2SoJFlDAyMwiUY8IssDqGcHbXuN0sx1tfF1A==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.62.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.62.4.tgz", - "integrity": "sha512-GUOnQlyZe3yAXhWOtOMsn5Qkrv5E5mZXa0thbARWi5Ei2szlVXJFQhddZ4HbAzh8q92w5twp+CQvs/eFanz9YQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ] - }, - "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.62.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.62.4.tgz", - "integrity": "sha512-/Y7f3QuxjzPKsjA/rfEDa3+0vXqyjmJ50Ln8dPpCmWkKTrUoWHG1cWhTqaAMLob2m2nESWuC7yGrREz019Ztqg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ] - }, - "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.62.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.62.4.tgz", - "integrity": "sha512-81wiiX3v7aqy+T+bT61TJ78yJjRquqFFTTbAPt08imfQQzkPIW8t6aJbkTagtCCrXMNc9D66+geqlK7ydLPNqA==", - "cpu": [ - "arm" - ], - "dev": true, - "libc": [ - "glibc" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.62.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.62.4.tgz", - "integrity": "sha512-9kmDIvNZqdoHOBZgNtpTBeLWYO/LVipM3H/j62P8848/l/VPEQL6N3uxU9pvP1oZAsXyC2MEnFP3ovRjo7WYNQ==", - "cpu": [ - "arm" - ], - "dev": true, - "libc": [ - "musl" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.62.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.62.4.tgz", - "integrity": "sha512-CcnXHWnXg69g+DX5VWL3FHts3qMRN2uVEHX+BZvGLdd07/gXkn3ePjYtO1LDJvxkGKVHMclKBRa1QUTH+6toYQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "libc": [ - "glibc" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.62.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.62.4.tgz", - "integrity": "sha512-iFOibiHnTRuhrWLlRsOQFdZJJIa7S8OwkneJr4ocALP16u5yk6lWLINFwhHaEqBFMsKDUZofLkGos7+CPzGB3g==", - "cpu": [ - "arm64" - ], - "dev": true, - "libc": [ - "musl" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-loong64-gnu": { - "version": "4.62.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.62.4.tgz", - "integrity": "sha512-XnWYMI7euHlb5a871xPja+Gm7DRCFU+FGRrtS2sMq9N8FvqtpagUy6gD4YOemC5MRk9xbh8+jYMEJbigFQwsgA==", - "cpu": [ - "loong64" - ], - "dev": true, - "libc": [ - "glibc" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-loong64-musl": { - "version": "4.62.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.62.4.tgz", - "integrity": "sha512-qGDAlO0U8xedCcsdRm9oaoQY8DAx/QT7uIxJWhCdx0ceIWX783UC9QSYkdpzAe29wNiVfp24+bZdQmn49o45SQ==", - "cpu": [ - "loong64" - ], - "dev": true, - "libc": [ - "musl" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-ppc64-gnu": { - "version": "4.62.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.62.4.tgz", - "integrity": "sha512-ru4H6ezD7ysA5EiEK6qkkaEb4modH8CTej6kUy/gQi20u3kB3G7Zn8snXXkeJSCOFKG/rbPPtM/+9Wgas1961w==", - "cpu": [ - "ppc64" - ], - "dev": true, - "libc": [ - "glibc" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-ppc64-musl": { - "version": "4.62.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.62.4.tgz", - "integrity": "sha512-2W4MO5WQVJnbJaZdvDb9rhBDuFU1nKIepPFpJUBsTh2k1YY2g+ODViaWuyOAjQ5cOP7NvrvLzt3wvHOoiAvc7w==", - "cpu": [ - "ppc64" - ], - "dev": true, - "libc": [ - "musl" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.62.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.62.4.tgz", - "integrity": "sha512-+fxjfuoAmVMCYV5QyjoIpu0cp5DOiOTeqYFk1AVaxGr+/ravWLX89XfQmptsoWcaVy/TGf2hexzbUOrCQIL1CQ==", - "cpu": [ - "riscv64" - ], - "dev": true, - "libc": [ - "glibc" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-riscv64-musl": { - "version": "4.62.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.62.4.tgz", - "integrity": "sha512-jTn8JfHGL4djjFxPuM06LmNUJDsst2jeVlsd9OmIH6zc5sC9K6rIuO4YajXatLUpBmBKl6b35ro1QZocLi+tcA==", - "cpu": [ - "riscv64" - ], - "dev": true, - "libc": [ - "musl" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.62.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.62.4.tgz", - "integrity": "sha512-oCJCJL4pXsoDcP2QZ+JVlPTIRc6266zsIaeJJsWImmF7HO0W8nb6HuSgZlMWxJwaPf8ehbSw8yo0EUw925hKsA==", - "cpu": [ - "s390x" - ], - "dev": true, - "libc": [ - "glibc" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.62.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.62.4.tgz", - "integrity": "sha512-W69hukhZ3KKNRCaMIEzKvcFye42hh0FE1+YoYaf5+Ikacuftoco6yO/xouz0hc5d5W/s3yBro5jRiuEE/Q5vUw==", - "cpu": [ - "x64" - ], - "dev": true, - "libc": [ - "glibc" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.62.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.62.4.tgz", - "integrity": "sha512-qiXbGG2jkjXhzXpsFZSR2Xpb8DN/UaxYsbb/STbuR/6fpaDgRmmaq1B/LmtF2wQFOFOSsK2jdE0RZ3a0zHn4QA==", - "cpu": [ - "x64" - ], - "dev": true, - "libc": [ - "musl" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-openbsd-x64": { - "version": "4.62.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.62.4.tgz", - "integrity": "sha512-nWeM//hxv8mIo6jD7Hu4o48DVmV9pbV6gsKaWU+4NFyqHoPKwrkRiZGLKUhOBk8qNmDmpwFtPKg80Bo/Tn4xiQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ] - }, - "node_modules/@rollup/rollup-openharmony-arm64": { - "version": "4.62.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.62.4.tgz", - "integrity": "sha512-s62SQ/vgsRSvMwDkOEfTqfgASF0f26ZNaQuTA6Aok5lrikf89yI2W0gFHvZb2Jpgc6N8JnOKZgCK2iciO3CsxQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openharmony" - ] - }, - "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.62.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.62.4.tgz", - "integrity": "sha512-J6wGf8TVGbXJq+HH+ttTvrcfNKPbuZecV6KT1B8I18BC5IURUh5kl4Yl5OEP5eFIUoI5BWxCsyYMhFsDx8kekw==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.62.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.62.4.tgz", - "integrity": "sha512-zmfrQd/0wu6oJs8Vq8KwY/YtsKSsLtKe/HwAP4Wqy8LhWjeT55fHRAkOhYQ12wI3ayS4Tt12d5CDRD7N96SAYQ==", - "cpu": [ - "ia32" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rollup/rollup-win32-x64-gnu": { - "version": "4.62.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.62.4.tgz", - "integrity": "sha512-qPzHqdj9rfUD+w79dtE07zi/kFwKyCJqplp5K5ygeLTp7jLpAoc16OAH39HSmRC9UpozaecsleI8uAdEj6v2yw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.62.4", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.62.4.tgz", - "integrity": "sha512-zD6NdeWEByGE9QF9vCrlJ5YQB4oq9q91kPZS37Jwj5hOkvR1lTBSpsKhKDw4IJtbQ35LsTS1HD9DZYGKIshU1Q==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@standard-schema/spec": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz", - "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==", - "dev": true, - "license": "MIT" - }, - "node_modules/@sveltejs/acorn-typescript": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/@sveltejs/acorn-typescript/-/acorn-typescript-1.0.12.tgz", - "integrity": "sha512-J1jNYG23QWd67UfrQSFHtjhV37r9mVi0gdc12A3MWPldOjRK35Xk+um+qACPVjgw3AleiqoyEAhok8Wm3q46NA==", - "dev": true, - "license": "MIT", - "peerDependencies": { - "acorn": "^8.9.0" - } - }, - "node_modules/@sveltejs/adapter-node": { - "version": "5.5.7", - "resolved": "https://registry.npmjs.org/@sveltejs/adapter-node/-/adapter-node-5.5.7.tgz", - "integrity": "sha512-uOfc9eVlI3A37RRSaKcgrheBYPrfJwC9VMqDp8x/O6tlKdcLLvHThSWD0KNIbjQ/d+7bwLGx3vx6aowAcRfd2g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@rollup/plugin-commonjs": "^29.0.0", - "@rollup/plugin-json": "^6.1.0", - "@rollup/plugin-node-resolve": "^16.0.0", - "@rollup/plugin-replace": "^6.0.3", - "rollup": "^4.59.0" - }, - "peerDependencies": { - "@sveltejs/kit": "^2.4.0" - } - }, - "node_modules/@sveltejs/adapter-static": { - "version": "3.0.10", - "resolved": "https://registry.npmjs.org/@sveltejs/adapter-static/-/adapter-static-3.0.10.tgz", - "integrity": "sha512-7D9lYFWJmB7zxZyTE/qxjksvMqzMuYrrsyh1f4AlZqeZeACPRySjbC3aFiY55wb1tWUaKOQG9PVbm74JcN2Iew==", - "dev": true, - "license": "MIT", - "peerDependencies": { - "@sveltejs/kit": "^2.0.0" - } - }, - "node_modules/@sveltejs/kit": { - "version": "2.70.2", - "resolved": "https://registry.npmjs.org/@sveltejs/kit/-/kit-2.70.2.tgz", - "integrity": "sha512-RzRoRpuR2KXqc5yMO0akQHDZeT4AslOlznGITURsqHaVbtyYP4Wn3eE3gxj9JcDyNYO0crkxhdwFHc+2vkVm6w==", - "dev": true, - "license": "MIT", - "dependencies": { - "@standard-schema/spec": "^1.0.0", - "@sveltejs/acorn-typescript": "^1.0.9", - "@types/cookie": "^0.6.0", - "acorn": "^8.16.0", - "cookie": "^0.6.0", - "devalue": "^5.8.1", - "esm-env": "^1.2.2", - "kleur": "^4.1.5", - "magic-string": "^0.30.5", - "mrmime": "^2.0.0", - "set-cookie-parser": "^3.0.0", - "sirv": "^3.0.0" - }, - "bin": { - "svelte-kit": "svelte-kit.js" - }, - "engines": { - "node": ">=18.13" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.0.0", - "@sveltejs/vite-plugin-svelte": "^3.0.0 || ^4.0.0-next.1 || ^5.0.0 || ^6.0.0-next.0 || ^7.0.0", - "svelte": "^4.0.0 || ^5.0.0-next.0", - "typescript": "^5.3.3 || ^6.0.0", - "vite": "^5.0.3 || ^6.0.0 || ^7.0.0-beta.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "@opentelemetry/api": { - "optional": true - }, - "typescript": { - "optional": true - } - } - }, - "node_modules/@sveltejs/load-config": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@sveltejs/load-config/-/load-config-0.2.1.tgz", - "integrity": "sha512-5m3B2cbqQ4TbwW6Xkh66Ntw6dD7gNc77cCxABTTesWcq9jxIzMgTk97pZx5vEtvQx8iokgi7GIphqZe+PGwcZA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 18.0.0" - } - }, - "node_modules/@sveltejs/vite-plugin-svelte": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-7.2.0.tgz", - "integrity": "sha512-1SpkuMSRLfugrVX+IrKfE1RUegzo8AQzKQ6qQPfVzbcWi5IhuTPaKb5ZrLpucleFznkc4/RTeSPoRnGWFxX+EQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "deepmerge": "^4.3.1", - "magic-string": "^0.30.21", - "obug": "^2.1.0", - "vitefu": "^1.1.2" - }, - "engines": { - "node": "^20.19 || ^22.12 || >=24" - }, - "peerDependencies": { - "svelte": "^5.46.4", - "vite": "^8.0.0-beta.7 || ^8.0.0" - } - }, - "node_modules/@types/cookie": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.6.0.tgz", - "integrity": "sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/estree": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", - "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/node": { - "version": "26.1.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-26.1.2.tgz", - "integrity": "sha512-Vu4a5UFA9rIIFJ7rB/Vaafh9lrCQszopTCx6KjFboXTGQbPNasehVR5TEiithSDGyd1DEiUByggTZsg8jukeIg==", - "dev": true, - "license": "MIT", - "dependencies": { - "undici-types": "~8.3.0" - } - }, - "node_modules/@types/resolve": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.20.2.tgz", - "integrity": "sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/trusted-types": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", - "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==", - "devOptional": true, - "license": "MIT" - }, - "node_modules/@xterm/addon-fit": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@xterm/addon-fit/-/addon-fit-0.11.0.tgz", - "integrity": "sha512-jYcgT6xtVYhnhgxh3QgYDnnNMYTcf8ElbxxFzX0IZo+vabQqSPAjC3c1wJrKB5E19VwQei89QCiZZP86DCPF7g==", - "license": "MIT" - }, - "node_modules/@xterm/xterm": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/@xterm/xterm/-/xterm-6.0.0.tgz", - "integrity": "sha512-TQwDdQGtwwDt+2cgKDLn0IRaSxYu1tSUjgKarSDkUM0ZNiSRXFpjxEsvc/Zgc5kq5omJ+V0a8/kIM2WD3sMOYg==", - "license": "MIT", - "workspaces": [ - "addons/*" - ] - }, - "node_modules/acorn": { - "version": "8.18.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.18.0.tgz", - "integrity": "sha512-lGq+9yr1/GuAWaVYIHRjvvySG5/4VfKIvC8EWxStPdcDh/Ka7FG3twP6v4d5BkravUilhIAsG4Qj83t02LWUPQ==", - "dev": true, - "license": "MIT", - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/aria-query": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.1.tgz", - "integrity": "sha512-Z/ZeOgVl7bcSYZ/u/rh0fOpvEpq//LZmdbkXyc7syVzjPAhfOa9ebsdTSjEBDU4vs5nC98Kfduj1uFo0qyET3g==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/axobject-query": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.1.0.tgz", - "integrity": "sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/chokidar": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", - "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", - "dev": true, - "license": "MIT", - "dependencies": { - "readdirp": "^4.0.1" - }, - "engines": { - "node": ">= 14.16.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/clsx": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", - "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/commondir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", - "dev": true, - "license": "MIT" - }, - "node_modules/cookie": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", - "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/deepmerge": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", - "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/detect-libc": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", - "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=8" - } - }, - "node_modules/devalue": { - "version": "5.9.0", - "resolved": "https://registry.npmjs.org/devalue/-/devalue-5.9.0.tgz", - "integrity": "sha512-RWrqdArjvPbsATEhOPUo6Wndc/iWnkWKlhIrdlF3zMMYo/c3CVtoaVAyLtWxz5h8nSlkHzxnzV2uLydPXmtF+A==", - "dev": true, - "license": "MIT" - }, - "node_modules/dompurify": { - "version": "3.4.8", - "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.4.8.tgz", - "integrity": "sha512-yb1cEmaOum7wFvOCSQxyfgVlv5D47Rc30iZWoMpbDIWTnJ6grDDQyu2KFJzB2k7u0pMuJcQ1zphH//fFnw2tjQ==", - "license": "(MPL-2.0 OR Apache-2.0)", - "optionalDependencies": { - "@types/trusted-types": "^2.0.7" - } - }, - "node_modules/es-errors": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/esm-env": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/esm-env/-/esm-env-1.2.2.tgz", - "integrity": "sha512-Epxrv+Nr/CaL4ZcFGPJIYLWFom+YeV1DqMLHJoEd9SYRxNbaFruBwfEX/kkHUJf55j2+TUbmDcmuilbP1TmXHA==", - "dev": true, - "license": "MIT" - }, - "node_modules/esrap": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/esrap/-/esrap-2.3.1.tgz", - "integrity": "sha512-MXjVkrBAjuwIZ8xq9+a1MOOnLIwANZOx/4gtdWHfSJtXOrUh2QQK2I5mMC3urLli559jTlq2j+kSqht80uRgog==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.4.15" - }, - "peerDependencies": { - "@typescript-eslint/types": "^8.2.0" - }, - "peerDependenciesMeta": { - "@typescript-eslint/types": { - "optional": true - } - } - }, - "node_modules/estree-walker": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", - "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", - "dev": true, - "license": "MIT" - }, - "node_modules/fdir": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", - "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12.0.0" - }, - "peerDependencies": { - "picomatch": "^3 || ^4" - }, - "peerDependenciesMeta": { - "picomatch": { - "optional": true - } - } - }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/hasown": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", - "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", - "dev": true, - "license": "MIT", - "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/is-core-module": { - "version": "2.16.2", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.2.tgz", - "integrity": "sha512-evOr8xfXKxE6qSR0hSXL2r3sd7ALj8+7jQEUvPYcm5sgZFdJ+AYzT6yNmJenvIYQBgIGwfwz08sL8zoL7yq2BA==", - "dev": true, - "license": "MIT", - "dependencies": { - "hasown": "^2.0.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", - "integrity": "sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==", - "dev": true, - "license": "MIT" - }, - "node_modules/is-reference": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-3.0.3.tgz", - "integrity": "sha512-ixkJoqQvAP88E6wLydLGGqCJsrFUnqoH6HnaczB8XmDH1oaWU+xxdptvikTgaEhtZ53Ky6YXiBuUI2WXLMCwjw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/estree": "^1.0.6" - } - }, - "node_modules/kleur": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", - "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/lightningcss": { - "version": "1.33.0", - "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.33.0.tgz", - "integrity": "sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==", - "dev": true, - "license": "MPL-2.0", - "dependencies": { - "detect-libc": "^2.0.3" - }, - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - }, - "optionalDependencies": { - "lightningcss-android-arm64": "1.33.0", - "lightningcss-darwin-arm64": "1.33.0", - "lightningcss-darwin-x64": "1.33.0", - "lightningcss-freebsd-x64": "1.33.0", - "lightningcss-linux-arm-gnueabihf": "1.33.0", - "lightningcss-linux-arm64-gnu": "1.33.0", - "lightningcss-linux-arm64-musl": "1.33.0", - "lightningcss-linux-x64-gnu": "1.33.0", - "lightningcss-linux-x64-musl": "1.33.0", - "lightningcss-win32-arm64-msvc": "1.33.0", - "lightningcss-win32-x64-msvc": "1.33.0" - } - }, - "node_modules/lightningcss-android-arm64": { - "version": "1.33.0", - "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.33.0.tgz", - "integrity": "sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MPL-2.0", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/lightningcss-darwin-arm64": { - "version": "1.33.0", - "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.33.0.tgz", - "integrity": "sha512-Sciaz8eenNTKn9b3t7+xr0ipTp9YxKQY4npwQ3mrRuL0BAVHBLyZxofhaKBAVtzmtRZ/zTyo0/to4B1uWG/Djg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MPL-2.0", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/lightningcss-darwin-x64": { - "version": "1.33.0", - "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.33.0.tgz", - "integrity": "sha512-Z5UPAxzrjlWNNyGy6i65cJzzvgJ5D3T6wMvs+gWpY9d7qRhANrxqAp6LhxIgZhWEw18RfJTGcRxjuLIBr+m8XQ==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MPL-2.0", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/lightningcss-freebsd-x64": { - "version": "1.33.0", - "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.33.0.tgz", - "integrity": "sha512-QQM/Ti/hQajJwCY+RiWuCZ9sdtI/XQk7nDK5vC8kkdwixezOlDgvDx7+RT+QjK6FcFT4MpsuoBnHIo/O3StRRg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MPL-2.0", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/lightningcss-linux-arm-gnueabihf": { - "version": "1.33.0", - "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.33.0.tgz", - "integrity": "sha512-N7FVBe6iS24MlM6R/4RBTxGhQheZGs7tiQ9U32UtF75NzP5Q7xWPRqLBCKxlRQRk3rY1jCIPLzx7WzOhuUIRLQ==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "MPL-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/lightningcss-linux-arm64-gnu": { - "version": "1.33.0", - "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.33.0.tgz", - "integrity": "sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg==", - "cpu": [ - "arm64" - ], - "dev": true, - "libc": [ - "glibc" - ], - "license": "MPL-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/lightningcss-linux-arm64-musl": { - "version": "1.33.0", - "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.33.0.tgz", - "integrity": "sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "libc": [ - "musl" - ], - "license": "MPL-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/lightningcss-linux-x64-gnu": { - "version": "1.33.0", - "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.33.0.tgz", - "integrity": "sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==", - "cpu": [ - "x64" - ], - "dev": true, - "libc": [ - "glibc" - ], - "license": "MPL-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/lightningcss-linux-x64-musl": { - "version": "1.33.0", - "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.33.0.tgz", - "integrity": "sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==", - "cpu": [ - "x64" - ], - "dev": true, - "libc": [ - "musl" - ], - "license": "MPL-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/lightningcss-win32-arm64-msvc": { - "version": "1.33.0", - "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.33.0.tgz", - "integrity": "sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MPL-2.0", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/lightningcss-win32-x64-msvc": { - "version": "1.33.0", - "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.33.0.tgz", - "integrity": "sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "MPL-2.0", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/locate-character": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-character/-/locate-character-3.0.0.tgz", - "integrity": "sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==", - "dev": true, - "license": "MIT" - }, - "node_modules/magic-string": { - "version": "0.30.21", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", - "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.5" - } - }, - "node_modules/marked": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/marked/-/marked-14.0.0.tgz", - "integrity": "sha512-uIj4+faQ+MgHgwUW1l2PsPglZLOLOT1uErt06dAPtx2kjteLAkbsd/0FiYg/MGS+i7ZKLb7w2WClxHkzOOuryQ==", - "license": "MIT", - "bin": { - "marked": "bin/marked.js" - }, - "engines": { - "node": ">= 18" - } - }, - "node_modules/monaco-editor": { - "version": "0.56.0", - "resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.56.0.tgz", - "integrity": "sha512-sXboRm3BeBeLm938eaiyLMe0OxzfXIlZvbv4ir/jVgQy1zDhWjgmny0WoN45fuDKhCCQsYMbBJrv/A6jd8aCUg==", - "license": "MIT", - "dependencies": { - "dompurify": "3.4.8", - "marked": "14.0.0" - } - }, - "node_modules/mri": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", - "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/mrmime": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.1.tgz", - "integrity": "sha512-Y3wQdFg2Va6etvQ5I82yUhGdsKrcYox6p7FfL1LbK2J4V01F9TGlepTIhnK24t7koZibmg82KGglhA1XK5IsLQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - } - }, - "node_modules/nanoid": { - "version": "3.3.17", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.17.tgz", - "integrity": "sha512-xQLf0A3HOMlgHq0n247/LRuAOYmB7dXJ/DvAxGvsSBij45XtBSmQycu+F8ODbHwns/XyFZagyL1+J0Offw1E0g==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, - "node_modules/obug": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/obug/-/obug-2.1.4.tgz", - "integrity": "sha512-4a+OsYv9UktOJKE+l1A4OufDgdRF9PifWj+tJnHURo/P+WOxpG4GzUFL9qCalmWauao6ogiG+QvnCovwPoyAWA==", - "dev": true, - "funding": [ - "https://github.com/sponsors/sxzz", - "https://opencollective.com/debug" - ], - "license": "MIT", - "engines": { - "node": ">=12.20.0" - } - }, - "node_modules/path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true, - "license": "MIT" - }, - "node_modules/picocolors": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", - "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", - "dev": true, - "license": "ISC" - }, - "node_modules/picomatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz", - "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/postcss": { - "version": "8.5.26", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.26.tgz", - "integrity": "sha512-u82N74LFzG8ca+dD8puPnplTXoGH4fTPpVGuIbt36G3qvNlkvfD0lEAZSxaly3KX8TS/L1A1gsCEmvKmBcVbkQ==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/postcss" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "nanoid": "^3.3.17", - "picocolors": "^1.1.1", - "source-map-js": "^1.2.1" - }, - "engines": { - "node": "^10 || ^12 || >=14" - } - }, - "node_modules/readdirp": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", - "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 14.18.0" - }, - "funding": { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/resolve": { - "version": "1.22.12", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.12.tgz", - "integrity": "sha512-TyeJ1zif53BPfHootBGwPRYT1RUt6oGWsaQr8UyZW/eAm9bKoijtvruSDEmZHm92CwS9nj7/fWttqPCgzep8CA==", - "dev": true, - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "is-core-module": "^2.16.1", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/rolldown": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.3.tgz", - "integrity": "sha512-rn9wpmxplLf7NLNyCk9FyWh3FM43DbY8jOzCdEPzH7uflhTftRbCEpqi6Ly2osgoU8OwObtmavMbWLaWy4LX7A==", - "dev": true, - "license": "MIT", - "dependencies": { - "@oxc-project/types": "=0.143.0", - "@rolldown/pluginutils": "^1.0.0" - }, - "bin": { - "rolldown": "bin/cli.mjs" - }, - "engines": { - "node": "^20.19.0 || >=22.12.0" - }, - "optionalDependencies": { - "@rolldown/binding-android-arm64": "1.2.3", - "@rolldown/binding-darwin-arm64": "1.2.3", - "@rolldown/binding-darwin-x64": "1.2.3", - "@rolldown/binding-freebsd-x64": "1.2.3", - "@rolldown/binding-linux-arm-gnueabihf": "1.2.3", - "@rolldown/binding-linux-arm64-gnu": "1.2.3", - "@rolldown/binding-linux-arm64-musl": "1.2.3", - "@rolldown/binding-linux-ppc64-gnu": "1.2.3", - "@rolldown/binding-linux-s390x-gnu": "1.2.3", - "@rolldown/binding-linux-x64-gnu": "1.2.3", - "@rolldown/binding-linux-x64-musl": "1.2.3", - "@rolldown/binding-openharmony-arm64": "1.2.3", - "@rolldown/binding-win32-arm64-msvc": "1.2.3", - "@rolldown/binding-win32-x64-msvc": "1.2.3" - } - }, - "node_modules/rollup": { - "version": "4.62.4", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.62.4.tgz", - "integrity": "sha512-RXOqwaPsBGjMNMa4sQjDjHieHEZDFoj/Rdr46l2MU5DfEs16wHJPC2RPTPHWhNl+M3aI472LLqFkFKut4SblOg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/estree": "1.0.9" - }, - "bin": { - "rollup": "dist/bin/rollup" - }, - "engines": { - "node": ">=18.0.0", - "npm": ">=8.0.0" - }, - "optionalDependencies": { - "@napi-rs/lzma-linux-x64-gnu": "1.5.1", - "@rollup/rollup-android-arm-eabi": "4.62.4", - "@rollup/rollup-android-arm64": "4.62.4", - "@rollup/rollup-darwin-arm64": "4.62.4", - "@rollup/rollup-darwin-x64": "4.62.4", - "@rollup/rollup-freebsd-arm64": "4.62.4", - "@rollup/rollup-freebsd-x64": "4.62.4", - "@rollup/rollup-linux-arm-gnueabihf": "4.62.4", - "@rollup/rollup-linux-arm-musleabihf": "4.62.4", - "@rollup/rollup-linux-arm64-gnu": "4.62.4", - "@rollup/rollup-linux-arm64-musl": "4.62.4", - "@rollup/rollup-linux-loong64-gnu": "4.62.4", - "@rollup/rollup-linux-loong64-musl": "4.62.4", - "@rollup/rollup-linux-ppc64-gnu": "4.62.4", - "@rollup/rollup-linux-ppc64-musl": "4.62.4", - "@rollup/rollup-linux-riscv64-gnu": "4.62.4", - "@rollup/rollup-linux-riscv64-musl": "4.62.4", - "@rollup/rollup-linux-s390x-gnu": "4.62.4", - "@rollup/rollup-linux-x64-gnu": "4.62.4", - "@rollup/rollup-linux-x64-musl": "4.62.4", - "@rollup/rollup-openbsd-x64": "4.62.4", - "@rollup/rollup-openharmony-arm64": "4.62.4", - "@rollup/rollup-win32-arm64-msvc": "4.62.4", - "@rollup/rollup-win32-ia32-msvc": "4.62.4", - "@rollup/rollup-win32-x64-gnu": "4.62.4", - "@rollup/rollup-win32-x64-msvc": "4.62.4", - "fsevents": "~2.3.2" - } - }, - "node_modules/sade": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/sade/-/sade-1.8.1.tgz", - "integrity": "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==", - "dev": true, - "license": "MIT", - "dependencies": { - "mri": "^1.1.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/set-cookie-parser": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-3.1.2.tgz", - "integrity": "sha512-5/r/lTwbJ3zQ+qwdUFZYeRNqda7P5HD8zQKqlSjdGt1/S0cjLAphHusj4Y58ahDtWn/g32xrIS58/ikOvwl0Lw==", - "dev": true, - "license": "MIT" - }, - "node_modules/sirv": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/sirv/-/sirv-3.0.2.tgz", - "integrity": "sha512-2wcC/oGxHis/BoHkkPwldgiPSYcpZK3JU28WoMVv55yHJgcZ8rlXvuG9iZggz+sU1d4bRgIGASwyWqjxu3FM0g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@polka/url": "^1.0.0-next.24", - "mrmime": "^2.0.0", - "totalist": "^3.0.0" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/source-map-js": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", - "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/svelte": { - "version": "5.56.8", - "resolved": "https://registry.npmjs.org/svelte/-/svelte-5.56.8.tgz", - "integrity": "sha512-PY8LOw7xP6c8IOiVqdo0sbbZVYhXRSfklOQLAUyGBKqjTX0wx/z4l/9J+PmBpmlLnxzEb1NqltxQ5/wZme/Cmg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/remapping": "^2.3.4", - "@jridgewell/sourcemap-codec": "^1.5.0", - "@sveltejs/acorn-typescript": "^1.0.10", - "@types/estree": "^1.0.5", - "@types/trusted-types": "^2.0.7", - "acorn": "^8.12.1", - "aria-query": "5.3.1", - "axobject-query": "^4.1.0", - "clsx": "^2.1.1", - "devalue": "^5.8.1", - "esm-env": "^1.2.1", - "esrap": "^2.2.12", - "is-reference": "^3.0.3", - "locate-character": "^3.0.0", - "magic-string": "^0.30.11", - "zimmerframe": "^1.1.2" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/svelte-check": { - "version": "4.7.4", - "resolved": "https://registry.npmjs.org/svelte-check/-/svelte-check-4.7.4.tgz", - "integrity": "sha512-IW9ot9YqAoyv8FvyN+eb4ZTe8zgcKZrJLNYU6dzSKkGwEBsSPc4K7lmQ8bKn8W2YMXM6WDfZSSVOaGtekyUfOQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/trace-mapping": "^0.3.25", - "@sveltejs/load-config": "^0.2.1", - "chokidar": "^4.0.1", - "fdir": "^6.2.0", - "picocolors": "^1.0.0", - "sade": "^1.7.4" - }, - "bin": { - "svelte-check": "bin/svelte-check" - }, - "engines": { - "node": ">= 18.0.0" - }, - "peerDependencies": { - "svelte": "^4.0.0 || ^5.0.0-next.0", - "typescript": "^5.0.0 || ^6.0.0" - } - }, - "node_modules/tinyglobby": { - "version": "0.2.17", - "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", - "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", - "dev": true, - "license": "MIT", - "dependencies": { - "fdir": "^6.5.0", - "picomatch": "^4.0.4" - }, - "engines": { - "node": ">=12.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/SuperchupuDev" - } - }, - "node_modules/totalist": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/totalist/-/totalist-3.0.1.tgz", - "integrity": "sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/tweetnacl": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", - "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==", - "license": "Unlicense" - }, - "node_modules/typescript": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz", - "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==", - "dev": true, - "license": "Apache-2.0", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, - "node_modules/undici-types": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.3.0.tgz", - "integrity": "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/vite": { - "version": "8.2.1", - "resolved": "https://registry.npmjs.org/vite/-/vite-8.2.1.tgz", - "integrity": "sha512-EU/eS7BH3XROHh2YnBefjM6DBKA6ZeMZEYQbj7NLWg5wHYlhB8B/Mayd5XsgWq+NFYccDOTemRpdETWR6Ka/lw==", - "dev": true, - "license": "MIT", - "dependencies": { - "lightningcss": "^1.33.0", - "picomatch": "^4.0.5", - "postcss": "^8.5.25", - "rolldown": "~1.2.1", - "tinyglobby": "^0.2.17" - }, - "bin": { - "vite": "bin/vite.js" - }, - "engines": { - "node": "^20.19.0 || >=22.12.0" - }, - "funding": { - "url": "https://github.com/vitejs/vite?sponsor=1" - }, - "optionalDependencies": { - "fsevents": "~2.3.3" - }, - "peerDependencies": { - "@types/node": "^20.19.0 || >=22.12.0", - "@vitejs/devtools": "^0.4.0", - "esbuild": "^0.27.0 || ^0.28.0", - "jiti": ">=1.21.0", - "less": "^4.0.0", - "sass": "^1.70.0", - "sass-embedded": "^1.70.0", - "stylus": ">=0.54.8", - "sugarss": "^5.0.0", - "terser": "^5.16.0", - "tsx": "^4.8.1", - "yaml": "^2.4.2" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - }, - "@vitejs/devtools": { - "optional": true - }, - "esbuild": { - "optional": true - }, - "jiti": { - "optional": true - }, - "less": { - "optional": true - }, - "sass": { - "optional": true - }, - "sass-embedded": { - "optional": true - }, - "stylus": { - "optional": true - }, - "sugarss": { - "optional": true - }, - "terser": { - "optional": true - }, - "tsx": { - "optional": true - }, - "yaml": { - "optional": true - } - } - }, - "node_modules/vitefu": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/vitefu/-/vitefu-1.1.3.tgz", - "integrity": "sha512-ub4okH7Z5KLjb6hDyjqrGXqWtWvoYdU3IGm/NorpgHncKoLTCfRIbvlhBm7r0YstIaQRYlp4yEbFqDcKSzXSSg==", - "dev": true, - "license": "MIT", - "workspaces": [ - "tests/deps/*", - "tests/projects/*", - "tests/projects/workspace/packages/*" - ], - "peerDependencies": { - "vite": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "vite": { - "optional": true - } - } - }, - "node_modules/zimmerframe": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/zimmerframe/-/zimmerframe-1.1.4.tgz", - "integrity": "sha512-B58NGBEoc8Y9MWWCQGl/gq9xBCe4IiKM0a2x7GZdQKOW5Exr8S1W24J6OgM1njK8xCRGvAJIL/MxXHf6SkmQKQ==", - "dev": true, - "license": "MIT" - } - } + "name": "executer-webui", + "version": "0.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "executer-webui", + "version": "0.0.0", + "license": "AGPL-3.0-only", + "dependencies": { + "@ant-design/colors": "8.0.1", + "@ant-design/icons": "6.2.3", + "@emotion/react": "11.14.0", + "@emotion/styled": "11.14.1", + "@fontsource/public-sans": "5.2.7", + "@mui/material": "9.0.1", + "@nats-io/nats-core": "3.4.0", + "@nats-io/nkeys": "2.0.3", + "@xterm/addon-fit": "0.11.0", + "@xterm/xterm": "6.0.0", + "lodash-es": "4.18.1", + "monaco-editor": "0.56.0", + "notistack": "3.0.2", + "react": "19.2.6", + "react-dom": "19.2.6", + "react-router-dom": "7.15.0", + "swr": "2.4.1" + }, + "devDependencies": { + "@eslint/compat": "2.1.0", + "@eslint/eslintrc": "3.3.5", + "@eslint/js": "10.0.1", + "@types/lodash-es": "4.17.12", + "@types/node": "25.7.0", + "@types/react": "19.2.14", + "@types/react-dom": "19.2.3", + "@typescript-eslint/eslint-plugin": "8.59.3", + "@typescript-eslint/parser": "8.59.3", + "@vitejs/plugin-react": "6.0.1", + "eslint": "10.3.0", + "eslint-config-prettier": "10.1.8", + "eslint-plugin-prettier": "5.5.5", + "eslint-plugin-react-hooks": "7.1.1", + "prettier": "3.8.3", + "typescript": "6.0.3", + "vite": "8.2.1" + }, + "engines": { + "node": ">=22" + } + }, + "node_modules/@ant-design/colors": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/@ant-design/colors/-/colors-8.0.1.tgz", + "integrity": "sha512-foPVl0+SWIslGUtD/xBr1p9U4AKzPhNYEseXYRRo5QSzGACYZrQbe11AYJbYfAWnWSpGBx6JjBmSeugUsD9vqQ==", + "license": "MIT", + "dependencies": { + "@ant-design/fast-color": "^3.0.0" + } + }, + "node_modules/@ant-design/fast-color": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@ant-design/fast-color/-/fast-color-3.0.1.tgz", + "integrity": "sha512-esKJegpW4nckh0o6kV3Tkb7NPIZYbPnnFxmQDUmL08ukXZAvV85TZBr70eGuke/CIArLaP6aw8lt9KILjnWuOw==", + "license": "MIT", + "engines": { + "node": ">=8.x" + } + }, + "node_modules/@ant-design/icons": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/@ant-design/icons/-/icons-6.2.3.tgz", + "integrity": "sha512-Pl3aoAtxQeKryYnt6VvDJtOxMOtA8wrRSACe/pTjOAIG3fdHrWm6Ivb4ku9tsFjYroSXBKirvuxG4QkwBXD9gg==", + "license": "MIT", + "dependencies": { + "@ant-design/colors": "^8.0.1", + "@ant-design/icons-svg": "^4.4.2", + "@rc-component/util": "^1.10.1", + "clsx": "^2.1.1" + }, + "engines": { + "node": ">=8" + }, + "peerDependencies": { + "react": ">=16.0.0", + "react-dom": ">=16.0.0" + } + }, + "node_modules/@ant-design/icons-svg": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@ant-design/icons-svg/-/icons-svg-4.6.0.tgz", + "integrity": "sha512-PRomU725ABMf/lnQp5HiB7my1kjEbFY0D10N4lXYxK6TIB1gKjIVD5MRThpDaezLgw1D774J8eOeeDB0M6wHrQ==", + "license": "MIT" + }, + "node_modules/@babel/code-frame": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz", + "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==", + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.29.7", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.7.tgz", + "integrity": "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.7.tgz", + "integrity": "sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/generator": "^7.29.7", + "@babel/helper-compilation-targets": "^7.29.7", + "@babel/helper-module-transforms": "^7.29.7", + "@babel/helpers": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/template": "^7.29.7", + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7", + "@jridgewell/remapping": "^2.3.5", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/core/node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@babel/core/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/generator": { + "version": "7.29.8", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.8.tgz", + "integrity": "sha512-gZbepsdh3WDtgZKWL+vTPh71LSBrm/Y4/QDZBVCcYfmeTEEuoOYwlSy+G1StfJg+/Zy550u/3TATbm7qDbbMtg==", + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.8", + "@babel/types": "^7.29.8", + "@jridgewell/gen-mapping": "^0.3.12", + "@jridgewell/trace-mapping": "^0.3.28", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.29.7.tgz", + "integrity": "sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.29.7", + "@babel/helper-validator-option": "^7.29.7", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/helper-globals": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.29.7.tgz", + "integrity": "sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.29.7.tgz", + "integrity": "sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==", + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.29.7.tgz", + "integrity": "sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7", + "@babel/traverse": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz", + "integrity": "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz", + "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.29.7.tgz", + "integrity": "sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.29.10", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.10.tgz", + "integrity": "sha512-EMCx3AGZ3WfAl6ht7AyQoPm2Lh+BGYEMdc4Q6Hf7uSCDOZFuLq44qNwL+iaim8VlyYhRAo4X43+weadK8ZB4Yg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.29.7", + "@babel/types": "^7.29.8" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.29.9", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.9.tgz", + "integrity": "sha512-CjXrNHTnvqBVqHgdBysY3vk2T8tpJHb5/RMeHJBTyVa9xgugCB0CJTx/3oO8RV2QRQP391RWpB7D6hLjm8V9uA==", + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.8" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/runtime": { + "version": "7.29.10", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.10.tgz", + "integrity": "sha512-NpugTzbKgGrNe45Ui32cN8vCFFMxVtP/9rtfwv0nP5FRDAjvYBxJcLVpYA9mr1jxP6cnIT7x9LUzuDTbWYYNRA==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/template": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.29.7.tgz", + "integrity": "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.29.10", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.10.tgz", + "integrity": "sha512-B3lYAs2nkKskbgQ1nfy8Ma9ao9Q1rntTAQHrzzyDuj+TSO+X3le6PfWwqDvodsb+OumE10eMFfuMCTQSQ5iuIQ==", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/generator": "^7.29.8", + "@babel/helper-globals": "^7.29.7", + "@babel/parser": "^7.29.9", + "@babel/template": "^7.29.7", + "@babel/types": "^7.29.8", + "debug": "^4.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.29.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.8.tgz", + "integrity": "sha512-Vj1jF3cPfxg7OAfoI7QnVKLoILlm2JF9pnVHrX8qx7AHMiYWT+NDAA7jChlNgRS4WTLc/fD1lXLmPixluj+3Gg==", + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@emotion/babel-plugin": { + "version": "11.13.5", + "resolved": "https://registry.npmjs.org/@emotion/babel-plugin/-/babel-plugin-11.13.5.tgz", + "integrity": "sha512-pxHCpT2ex+0q+HH91/zsdHkw/lXd468DIN2zvfvLtPKLLMo6gQj7oLObq8PhkrxOZb/gGCq03S3Z7PDhS8pduQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.16.7", + "@babel/runtime": "^7.18.3", + "@emotion/hash": "^0.9.2", + "@emotion/memoize": "^0.9.0", + "@emotion/serialize": "^1.3.3", + "babel-plugin-macros": "^3.1.0", + "convert-source-map": "^1.5.0", + "escape-string-regexp": "^4.0.0", + "find-root": "^1.1.0", + "source-map": "^0.5.7", + "stylis": "4.2.0" + } + }, + "node_modules/@emotion/cache": { + "version": "11.14.0", + "resolved": "https://registry.npmjs.org/@emotion/cache/-/cache-11.14.0.tgz", + "integrity": "sha512-L/B1lc/TViYk4DcpGxtAVbx0ZyiKM5ktoIyafGkH6zg/tj+mA+NE//aPYKG0k8kCHSHVJrpLpcAlOBEXQ3SavA==", + "license": "MIT", + "dependencies": { + "@emotion/memoize": "^0.9.0", + "@emotion/sheet": "^1.4.0", + "@emotion/utils": "^1.4.2", + "@emotion/weak-memoize": "^0.4.0", + "stylis": "4.2.0" + } + }, + "node_modules/@emotion/hash": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/@emotion/hash/-/hash-0.9.2.tgz", + "integrity": "sha512-MyqliTZGuOm3+5ZRSaaBGP3USLw6+EGykkwZns2EPC5g8jJ4z9OrdZY9apkl3+UP9+sdz76YYkwCKP5gh8iY3g==", + "license": "MIT" + }, + "node_modules/@emotion/is-prop-valid": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-1.4.0.tgz", + "integrity": "sha512-QgD4fyscGcbbKwJmqNvUMSE02OsHUa+lAWKdEUIJKgqe5IwRSKd7+KhibEWdaKwgjLj0DRSHA9biAIqGBk05lw==", + "license": "MIT", + "dependencies": { + "@emotion/memoize": "^0.9.0" + } + }, + "node_modules/@emotion/memoize": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.9.0.tgz", + "integrity": "sha512-30FAj7/EoJ5mwVPOWhAyCX+FPfMDrVecJAM+Iw9NRoSl4BBAQeqj4cApHHUXOVvIPgLVDsCFoz/hGD+5QQD1GQ==", + "license": "MIT" + }, + "node_modules/@emotion/react": { + "version": "11.14.0", + "resolved": "https://registry.npmjs.org/@emotion/react/-/react-11.14.0.tgz", + "integrity": "sha512-O000MLDBDdk/EohJPFUqvnp4qnHeYkVP5B0xEG0D/L7cOKP9kefu2DXn8dj74cQfsEzUqh+sr1RzFqiL1o+PpA==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.18.3", + "@emotion/babel-plugin": "^11.13.5", + "@emotion/cache": "^11.14.0", + "@emotion/serialize": "^1.3.3", + "@emotion/use-insertion-effect-with-fallbacks": "^1.2.0", + "@emotion/utils": "^1.4.2", + "@emotion/weak-memoize": "^0.4.0", + "hoist-non-react-statics": "^3.3.1" + }, + "peerDependencies": { + "react": ">=16.8.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@emotion/serialize": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@emotion/serialize/-/serialize-1.3.3.tgz", + "integrity": "sha512-EISGqt7sSNWHGI76hC7x1CksiXPahbxEOrC5RjmFRJTqLyEK9/9hZvBbiYn70dw4wuwMKiEMCUlR6ZXTSWQqxA==", + "license": "MIT", + "dependencies": { + "@emotion/hash": "^0.9.2", + "@emotion/memoize": "^0.9.0", + "@emotion/unitless": "^0.10.0", + "@emotion/utils": "^1.4.2", + "csstype": "^3.0.2" + } + }, + "node_modules/@emotion/sheet": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@emotion/sheet/-/sheet-1.4.0.tgz", + "integrity": "sha512-fTBW9/8r2w3dXWYM4HCB1Rdp8NLibOw2+XELH5m5+AkWiL/KqYX6dc0kKYlaYyKjrQ6ds33MCdMPEwgs2z1rqg==", + "license": "MIT" + }, + "node_modules/@emotion/styled": { + "version": "11.14.1", + "resolved": "https://registry.npmjs.org/@emotion/styled/-/styled-11.14.1.tgz", + "integrity": "sha512-qEEJt42DuToa3gurlH4Qqc1kVpNq8wO8cJtDzU46TjlzWjDlsVyevtYCRijVq3SrHsROS+gVQ8Fnea108GnKzw==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.18.3", + "@emotion/babel-plugin": "^11.13.5", + "@emotion/is-prop-valid": "^1.3.0", + "@emotion/serialize": "^1.3.3", + "@emotion/use-insertion-effect-with-fallbacks": "^1.2.0", + "@emotion/utils": "^1.4.2" + }, + "peerDependencies": { + "@emotion/react": "^11.0.0-rc.0", + "react": ">=16.8.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@emotion/unitless": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.10.0.tgz", + "integrity": "sha512-dFoMUuQA20zvtVTuxZww6OHoJYgrzfKM1t52mVySDJnMSEa08ruEvdYQbhvyu6soU+NeLVd3yKfTfT0NeV6qGg==", + "license": "MIT" + }, + "node_modules/@emotion/use-insertion-effect-with-fallbacks": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@emotion/use-insertion-effect-with-fallbacks/-/use-insertion-effect-with-fallbacks-1.2.0.tgz", + "integrity": "sha512-yJMtVdH59sxi/aVJBpk9FQq+OR8ll5GT8oWd57UpeaKEVGab41JWaCFA7FRLoMLloOZF/c/wsPoe+bfGmRKgDg==", + "license": "MIT", + "peerDependencies": { + "react": ">=16.8.0" + } + }, + "node_modules/@emotion/utils": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-1.4.2.tgz", + "integrity": "sha512-3vLclRofFziIa3J2wDh9jjbkUz9qk5Vi3IZ/FSTKViB0k+ef0fPV7dYrUIugbgupYDx7v9ud/SjrtEP8Y4xLoA==", + "license": "MIT" + }, + "node_modules/@emotion/weak-memoize": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@emotion/weak-memoize/-/weak-memoize-0.4.0.tgz", + "integrity": "sha512-snKqtPW01tN0ui7yu9rGv69aJXr/a/Ywvl11sUjNtEcRc+ng/mQriFL0wLXMef74iHa/EkftbDzU9F8iFbH+zg==", + "license": "MIT" + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.10.1.tgz", + "integrity": "sha512-cuadcxVFE8sDK6iWJbs8Sn0av2Nrh2QSGQhVlBW9AaAHqHwjWsZHT8LJ4hFGPh7ASBV2deFdM7H/DPjulmh8rg==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/compat": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@eslint/compat/-/compat-2.1.0.tgz", + "integrity": "sha512-LgaSCymEpw7tF53xvDw9SNsraPb1IBHxpdABIOM0hW8UAlP8znrjYtuxfR58FSJ3L9BhwD+FaPRFQpZq84Nh6g==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^1.2.1" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "peerDependencies": { + "eslint": "^8.40 || 9 || 10" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } + } + }, + "node_modules/@eslint/config-array": { + "version": "0.23.5", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.23.5.tgz", + "integrity": "sha512-Y3kKLvC1dvTOT+oGlqNQ1XLqK6D1HU2YXPc52NmAlJZbMMWDzGYXMiPRJ8TYD39muD/OTjlZmNJ4ib7dvSrMBA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^3.0.5", + "debug": "^4.3.1", + "minimatch": "^10.2.4" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@eslint/config-array/node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/@eslint/config-array/node_modules/brace-expansion": { + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz", + "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/@eslint/config-array/node_modules/minimatch": { + "version": "10.2.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz", + "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "brace-expansion": "^5.0.8" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@eslint/config-helpers": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.5.5.tgz", + "integrity": "sha512-eIJYKTCECbP/nsKaaruF6LW967mtbQbsw4JTtSVkUQc9MneSkbrgPJAbKl9nWr0ZeowV8BfsarBmPpBzGelA2w==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^1.2.1" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@eslint/core": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-1.2.1.tgz", + "integrity": "sha512-MwcE1P+AZ4C6DWlpin/OmOA54mmIZ/+xZuJiQd4SyB29oAJjN30UW9wkKNptW2ctp4cEsvhlLY/CsQ1uoHDloQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.5.tgz", + "integrity": "sha512-4IlJx0X0qftVsN5E+/vGujTRIFtwuLbNsVUe7TO6zYPDR1O6nFwvwhIKEKSrl6dZchmYBITazxKoUYOjdtjlRg==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^6.14.0", + "debug": "^4.3.2", + "espree": "^10.0.1", + "globals": "^14.0.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.1", + "minimatch": "^3.1.5", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/js": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-10.0.1.tgz", + "integrity": "sha512-zeR9k5pd4gxjZ0abRoIaxdc7I3nDktoXZk2qOv9gCNWx3mVwEn32VRhyLaRsDiJjTs0xq/T8mfPtyuXu7GWBcA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "eslint": "^10.0.0" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } + } + }, + "node_modules/@eslint/object-schema": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-3.0.5.tgz", + "integrity": "sha512-vqTaUEgxzm+YDSdElad6PiRoX4t8VGDjCtt05zn4nU810UIx/uNEV7/lZJ6KwFThKZOzOxzXy48da+No7HZaMw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@eslint/plugin-kit": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.7.3.tgz", + "integrity": "sha512-IkO+/KEUvwbVpiURZg+P7zF74z5Jxe0UgJxVni+RtoHQ6IZieXaO02kmadomap/q+l6bc/jdPGGqTjhuZnuz1Q==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^1.2.1", + "levn": "^0.4.1" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + } + }, + "node_modules/@fontsource/public-sans": { + "version": "5.2.7", + "resolved": "https://registry.npmjs.org/@fontsource/public-sans/-/public-sans-5.2.7.tgz", + "integrity": "sha512-pVttDr3HvhVIt2x6sZJfZKksNEpq23C1JCHTQwT9KWJdmFRdNeRM8gQftq8uP72sPW+p3Ku9x8HPk2E392DFvg==", + "license": "OFL-1.1", + "funding": { + "url": "https://github.com/sponsors/ayuhito" + } + }, + "node_modules/@humanfs/core": { + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.2.tgz", + "integrity": "sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanfs/types": "^0.15.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node": { + "version": "0.16.8", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.8.tgz", + "integrity": "sha512-gE1eQNZ3R++kTzFUpdGlpmy8kDZD/MLyHqDwqjkVQI0JMdI1D51sy1H958PNXYkM2rAac7e5/CnIKZrHtPh3BQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanfs/core": "^0.19.2", + "@humanfs/types": "^0.15.0", + "@humanwhocodes/retry": "^0.4.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/types": { + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/@humanfs/types/-/types-0.15.0.tgz", + "integrity": "sha512-ZZ1w0aoQkwuUuC7Yf+7sdeaNfqQiiLcSRbfI08oAxqLtpXQr9AIVX7Ay7HLDuiLYAaFPu8oBYNq/QIi9URHJ3Q==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/retry": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", + "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", + "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@mui/core-downloads-tracker": { + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-9.5.0.tgz", + "integrity": "sha512-PErEpl3Lp+1ZqWYKI7GQU8XSiciAFmLbUAZ7IoaUL598HLy1UAFuEUMEJu8yAS1v8vkXYzWprMVZzky4UwXoOA==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui-org" + } + }, + "node_modules/@mui/material": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/@mui/material/-/material-9.0.1.tgz", + "integrity": "sha512-voyCpeUxcSWLN7KPZuq0pGCIt726T9K6kiVM3XUcywZDAlZSarLHaUxJVQpospbjjOzN53hwyjo8s6KoWl6utw==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.29.2", + "@mui/core-downloads-tracker": "^9.0.1", + "@mui/system": "^9.0.1", + "@mui/types": "^9.0.0", + "@mui/utils": "^9.0.1", + "@popperjs/core": "^2.11.8", + "@types/react-transition-group": "^4.4.12", + "clsx": "^2.1.1", + "csstype": "^3.2.3", + "prop-types": "^15.8.1", + "react-is": "^19.2.4", + "react-transition-group": "^4.4.5" + }, + "engines": { + "node": ">=14.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui-org" + }, + "peerDependencies": { + "@emotion/react": "^11.5.0", + "@emotion/styled": "^11.3.0", + "@mui/material-pigment-css": "^9.0.1", + "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0", + "react": "^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "@emotion/react": { + "optional": true + }, + "@emotion/styled": { + "optional": true + }, + "@mui/material-pigment-css": { + "optional": true + }, + "@types/react": { + "optional": true + } + } + }, + "node_modules/@mui/private-theming": { + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-9.5.0.tgz", + "integrity": "sha512-UHZKySlr4ZJeA5HEhe/Tq1fhsR5573ViKYn7JV80dCVJtgqRQIplRSer1DHPg2Yi22llX7QRhgM0Vtrx4kZHSA==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.29.7 || ^8.0.5", + "@mui/utils": "^9.5.0", + "prop-types": "^15.8.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui-org" + }, + "peerDependencies": { + "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0", + "react": "^17.0.0 || ^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@mui/styled-engine": { + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/@mui/styled-engine/-/styled-engine-9.5.0.tgz", + "integrity": "sha512-IX1ceHnZ0bJgzJRWO/Ayl4ME1rNmpWVYwV28yb089UAMR17rJkV1qfr7ApsWQXXPi1oi+2JapJrWQAiAnTlJHQ==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.29.7 || ^8.0.5", + "@emotion/cache": "^11.14.0", + "@emotion/serialize": "^1.3.3", + "@emotion/sheet": "^1.4.0", + "csstype": "^3.2.3", + "prop-types": "^15.8.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui-org" + }, + "peerDependencies": { + "@emotion/react": "^11.4.1", + "@emotion/styled": "^11.3.0", + "react": "^17.0.0 || ^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "@emotion/react": { + "optional": true + }, + "@emotion/styled": { + "optional": true + } + } + }, + "node_modules/@mui/system": { + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/@mui/system/-/system-9.5.0.tgz", + "integrity": "sha512-OZuAwvoiaaHpvn0a540VH1DUwwmojJubGfNmO2g+nb2ybNDP4/gF7t7aA6AMduELSuJ5yxwlzyFvUO3CfLv1Yg==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.29.7 || ^8.0.5", + "@mui/private-theming": "^9.5.0", + "@mui/styled-engine": "^9.5.0", + "@mui/types": "^9.5.0", + "@mui/utils": "^9.5.0", + "clsx": "^2.1.1", + "csstype": "^3.2.3", + "prop-types": "^15.8.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui-org" + }, + "peerDependencies": { + "@emotion/react": "^11.5.0", + "@emotion/styled": "^11.3.0", + "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0", + "react": "^17.0.0 || ^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "@emotion/react": { + "optional": true + }, + "@emotion/styled": { + "optional": true + }, + "@types/react": { + "optional": true + } + } + }, + "node_modules/@mui/types": { + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/@mui/types/-/types-9.5.0.tgz", + "integrity": "sha512-O0S6xS80qEQqW2CYNrd4GlBEQ1xpMOHZ5b4zO/DaLu6NZmtthM6smEg0Gz/u9gX5vL+8NB3EiBIxmxSCcG590Q==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.29.7 || ^8.0.5" + }, + "peerDependencies": { + "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@mui/utils": { + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-9.5.0.tgz", + "integrity": "sha512-8m0LfSgE2pj58znY3kZ+anwRKbnBkcu/7AJPA8L/77wEjN0QnpX4/zRAccyplp1VEUnMsUBADeTRin5Mkf7epA==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.29.7 || ^8.0.5", + "@mui/types": "^9.5.0", + "@types/prop-types": "^15.7.15", + "clsx": "^2.1.1", + "prop-types": "^15.8.1", + "react-is": "^19.3.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui-org" + }, + "peerDependencies": { + "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0", + "react": "^17.0.0 || ^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@nats-io/nats-core": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@nats-io/nats-core/-/nats-core-3.4.0.tgz", + "integrity": "sha512-QMDM86EUNm+wudlKC67HLar/KHHQUvJGLfb4jbahje3pUk3K9afeck9fwsxBZF0eUFox6T/TA6m/t+lQqf+QsQ==", + "license": "Apache-2.0", + "dependencies": { + "@nats-io/nkeys": "2.0.3", + "@nats-io/nuid": "3.0.0" + } + }, + "node_modules/@nats-io/nkeys": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@nats-io/nkeys/-/nkeys-2.0.3.tgz", + "integrity": "sha512-JVt56GuE6Z89KUkI4TXUbSI9fmIfAmk6PMPknijmuL72GcD+UgIomTcRWiNvvJKxA01sBbmIPStqJs5cMRBC3A==", + "license": "Apache-2.0", + "dependencies": { + "tweetnacl": "^1.0.3" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@nats-io/nuid": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@nats-io/nuid/-/nuid-3.0.0.tgz", + "integrity": "sha512-QbXZDrxmYlrn5AD06gYcUTmEHwxn96HBQMIk7XTjDlEcx6FPzVBBPjp4AMRh1lEv6B4iJ6Xb/Uz61JugPXFRQg==", + "license": "Apache-2.0", + "engines": { + "node": ">= 22.x" + } + }, + "node_modules/@oxc-project/types": { + "version": "0.155.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.155.0.tgz", + "integrity": "sha512-SeE8JPwW1xs1tHeNycjUtUBdhorRa8o4jlvjwk49R7/Z291i+4DQa7JJIgOm/TaYQZx+QrPQbVJ/9c8dMIZN8Q==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/oxc-project" + } + }, + "node_modules/@pkgr/core": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.3.6.tgz", + "integrity": "sha512-SEeaJLb3qBNF/OaXnaR1NmmBbFYk1zC0ZH/52fATcRPLFg/p791YrcyFFy44Bo9sLaGuSuLp5Q6axbb/O+v/RA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/pkgr" + } + }, + "node_modules/@popperjs/core": { + "version": "2.11.8", + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", + "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/popperjs" + } + }, + "node_modules/@rc-component/util": { + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/@rc-component/util/-/util-1.14.0.tgz", + "integrity": "sha512-qFpkGBCiyN3NNAU+FOnZdcdz7A/rXCg3JdQk+bujUKAExZgRqzf2yy1f4YN63Lwctic5FcK9rgjQ6aWbykqwEw==", + "license": "MIT", + "dependencies": { + "is-mobile": "^5.0.0", + "react-is": "^19.2.7" + }, + "peerDependencies": { + "react": ">=18.0.0", + "react-dom": ">=18.0.0" + } + }, + "node_modules/@rolldown/binding-android-arm-eabi": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.15.tgz", + "integrity": "sha512-aLcgK9gIJ3YRvrrtfSBbRa27F5WrpiTaPulnFpsHPxpUHgFlSgnU4854MHwoRGEBhfRJDWCS2WQ7lIjskE9Olw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-android-arm64": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.15.tgz", + "integrity": "sha512-xD7DdZCrbThKuxNg7ooQmvp07ys4J/pnSEMTG3/OdOWl6daC67m/Q4fL78sRHMxTH/N4fGUbYhcPM0MF5WFHkg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-arm64": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.15.tgz", + "integrity": "sha512-m2WuQ6r0B4OTYxyPpNLtXaMRbRDUbG8YQV2Q3KTdSSK8Th6KHCnC8jVCJt8bvYeSB5WivkkNbc85mKadaSdOxA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-x64": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.15.tgz", + "integrity": "sha512-5RtnsHM36nodM9WbMy+zip0LGS/G+y5wro5RHrpOlr4ac24+1zSi9kiV2MP1myZeZ/ifEHfulQcWjnAXzc2C2A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-freebsd-x64": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.15.tgz", + "integrity": "sha512-g3l09pyFqhu+135JKkbkwiKGQmwU5hUMUPJ4VdBADvuqR8d33L6H578rh8m7rtxbdp+VmX/+nzI7nvhSZlzpUQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm-gnueabihf": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.15.tgz", + "integrity": "sha512-nIe3VugI97nGQtspPxDqA4sXMUpeiocKIP/CqpY/u/vgbT+alX+cVxu1C/oVBPKg4feNTmYovE91v4DgXvXNwQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-gnu": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.15.tgz", + "integrity": "sha512-iTBjXx+B5QSvgI89lJfmqh4wTh8NabR1YZIIN3hNx4zSG0EVfVqkOvLulNpG4251pbd6/IAmZ/LefVk1Y4rPhw==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-musl": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.15.tgz", + "integrity": "sha512-uN26XOnVR7rqQupG3V9oAG2EGGatWjcJHOeDOHUFCh4TBWmP2tHTFoVN13aYbwfm0aHqJAEmcwhAu6sooIjfqQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-ppc64-gnu": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.15.tgz", + "integrity": "sha512-9nWkcdd+H+XhaA3fQIwpHnKIrfx/PQ6rO0pivr78Og07tXlUlctBBJoEYLPfhTmCR/QxEVdn6uPjHV5SymPhdw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-s390x-gnu": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.15.tgz", + "integrity": "sha512-Ggh0ciFjLwIusLSLz7LZYEaGdxOAUJXI+Qu5JCbhPJJHEt8vP+IjRATTJheiJsdzzTYgUiHUiw3X1Ea3ZpMBdA==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-gnu": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.15.tgz", + "integrity": "sha512-FHg60rS6DBePAYZ9X9F67x+JObFdmgn6tupA1C/a3B+CufFmTD4mX+e8M75tCiAO3foR/6xwVBI0KQiI7sn/rw==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-musl": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.15.tgz", + "integrity": "sha512-/cvV/7v5VGz/moiz0XKRj2dE8DzsKyhIu1KpOvJGPjRywg3yscON889UGvAe8zfiJLHup7VLjBduoGWi3HusWQ==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-openharmony-arm64": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.15.tgz", + "integrity": "sha512-MyzC5Hrv/sm+Z7TSGKP/j8001RO2xQm1zOpCNVL4j0cY/VhBZviludA2YFQ7i4lH6ZAXxQm0lcMdBzM+99mE7w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-arm64-msvc": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.15.tgz", + "integrity": "sha512-+PgYiS+AH5omy6L45ZLxybasauJaj3M8buoT83D+nzPmCayXlxUV9hydhciCKVyIg0B/v0BtXPDE1uGqNwCPpg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-x64-msvc": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.15.tgz", + "integrity": "sha512-HFZd2QNQYn1JbIi+Hpd7H+r/lkWxcfIu28nirZ6eCn2LafuvmExMlb/P96Sfx5tf7pPArw39IdhmCF8vmV+NhQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.0-rc.7", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-rc.7.tgz", + "integrity": "sha512-qujRfC8sFVInYSPPMLQByRh7zhwkGFS4+tyMQ83srV1qrxL4g8E2tyxVVyxd0+8QeBM1mIk9KbWxkegRr76XzA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/esrecurse": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@types/esrecurse/-/esrecurse-4.3.1.tgz", + "integrity": "sha512-xJBAbDifo5hpffDBuHl0Y8ywswbiAp/Wi7Y/GtAgSlZyIABppyurxVueOPE8LUQOxdlgi6Zqce7uoEpqNTeiUw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/estree": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", + "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/lodash": { + "version": "4.17.27", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.27.tgz", + "integrity": "sha512-VenMRv/eKNrspX9v3H4dbmjsrnCOYdYBG3kxXKk3dG6X+urBGcj2Prww3xw1U5K4FV/mE4h5GbWd0szEKf+9ew==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/lodash-es": { + "version": "4.17.12", + "resolved": "https://registry.npmjs.org/@types/lodash-es/-/lodash-es-4.17.12.tgz", + "integrity": "sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/lodash": "*" + } + }, + "node_modules/@types/node": { + "version": "25.7.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-25.7.0.tgz", + "integrity": "sha512-z+pdZyxE+RTQE9AcboAZCb4otwcrvgHD+GlBpPgn0emDVt0ohrTMhAwlr2Wd9nZ+nihhYFxO2pThz3C5qSu2Eg==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~7.21.0" + } + }, + "node_modules/@types/parse-json": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.2.tgz", + "integrity": "sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw==", + "license": "MIT" + }, + "node_modules/@types/prop-types": { + "version": "15.7.15", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.15.tgz", + "integrity": "sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw==", + "license": "MIT" + }, + "node_modules/@types/react": { + "version": "19.2.14", + "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.14.tgz", + "integrity": "sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w==", + "license": "MIT", + "dependencies": { + "csstype": "^3.2.2" + } + }, + "node_modules/@types/react-dom": { + "version": "19.2.3", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.2.3.tgz", + "integrity": "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@types/react": "^19.2.0" + } + }, + "node_modules/@types/react-transition-group": { + "version": "4.4.12", + "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.12.tgz", + "integrity": "sha512-8TV6R3h2j7a91c+1DXdJi3Syo69zzIZbz7Lg5tORM5LEJG7X/E6a1V3drRyBRZq7/utz7A+c4OgYLiLcYGHG6w==", + "license": "MIT", + "peerDependencies": { + "@types/react": "*" + } + }, + "node_modules/@types/trusted-types": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", + "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==", + "license": "MIT", + "optional": true + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.59.3.tgz", + "integrity": "sha512-PwFvSKsXGShKGW6n5bZOhGHEcCZXM8HofLK9fNsEwZXzFRjoY+XT1Vsf1zgyXdwTr0ZYz1/2tkZ0DBTT9jZjhw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/regexpp": "^4.12.2", + "@typescript-eslint/scope-manager": "8.59.3", + "@typescript-eslint/type-utils": "8.59.3", + "@typescript-eslint/utils": "8.59.3", + "@typescript-eslint/visitor-keys": "8.59.3", + "ignore": "^7.0.5", + "natural-compare": "^1.4.0", + "ts-api-utils": "^2.5.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^8.59.3", + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { + "version": "7.0.13", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.13.tgz", + "integrity": "sha512-2E8Q6rh+1RRSq/YdaGsNfXsEZy9FVqv6BSSrkmZJP7BnaoPnRfKL+YaofPvP+5rzdk144qSm6i4+hvPgUcbV4Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.59.3.tgz", + "integrity": "sha512-HPwA+hVkfcriajbNvTmZv4VRauibay+cWArYUYq7u7W7PmGShMxbPxLvrwDme55a6d5alG3nrYfhyJ/G28XlLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/scope-manager": "8.59.3", + "@typescript-eslint/types": "8.59.3", + "@typescript-eslint/typescript-estree": "8.59.3", + "@typescript-eslint/visitor-keys": "8.59.3", + "debug": "^4.4.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/project-service": { + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.59.3.tgz", + "integrity": "sha512-ECiUWa/KYRGDFUqTNehaRgzDshnJfkTABJxVemHk4ko22gcr0ukloKjWvyQ64g8YCV/UI47kN1dbmjf/GaQYng==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/tsconfig-utils": "^8.59.3", + "@typescript-eslint/types": "^8.59.3", + "debug": "^4.4.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.59.3.tgz", + "integrity": "sha512-t2LvZnoEfzKtnPjgeEu41xw5gxq9mQVfYy4OoZ4Vlt0sk3JwxmhCca/AR7DwOiHrjWgjAj6as4AhRLKSDfvZIA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.59.3", + "@typescript-eslint/visitor-keys": "8.59.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/tsconfig-utils": { + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.59.3.tgz", + "integrity": "sha512-PcIJHjmaREXLgIAIzLnSY9VucEzz8FKXsRgFa1DmdGCK/5tJpW03TKJF01Q6VZd1lLdz2sIKPWaDUZN9dp//dw==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.59.3.tgz", + "integrity": "sha512-g71d8QD8UaiHGvrJwyIS1hCX5r63w6Jll+4VEYhEAHXTDIqX1JgxhTAbEHtKntL9kuc4jRo7/GWw5xfCepSccQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.59.3", + "@typescript-eslint/typescript-estree": "8.59.3", + "@typescript-eslint/utils": "8.59.3", + "debug": "^4.4.3", + "ts-api-utils": "^2.5.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/types": { + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.59.3.tgz", + "integrity": "sha512-ePFoH0g4ludssdRFqqDxQePCxU4WQyRa9+XVwjm7yLn0FKhMeoetC+qBEEI1Eyb1pGSDveTIT09Bvw2WhlGayg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.59.3.tgz", + "integrity": "sha512-CbRjVRAf7Lr9Kr8RopKcbY45p2VfmmHrm0ygOCYFi7oU8q19m0Fs/6iHS7kNOmwpp+ob07ZVcAqlxUod9lYdmg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/project-service": "8.59.3", + "@typescript-eslint/tsconfig-utils": "8.59.3", + "@typescript-eslint/types": "8.59.3", + "@typescript-eslint/visitor-keys": "8.59.3", + "debug": "^4.4.3", + "minimatch": "^10.2.2", + "semver": "^7.7.3", + "tinyglobby": "^0.2.15", + "ts-api-utils": "^2.5.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz", + "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "10.2.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz", + "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "brace-expansion": "^5.0.8" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.59.3.tgz", + "integrity": "sha512-JAvT14goBzRzzzZyqq3P9BLArIxTtQURUtFgQ/V7FO+eU+Gg6ES+5ymOPP1wRxXcxAYeivCk4uS3jCKWI1K8Zg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.9.1", + "@typescript-eslint/scope-manager": "8.59.3", + "@typescript-eslint/types": "8.59.3", + "@typescript-eslint/typescript-estree": "8.59.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "8.59.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.59.3.tgz", + "integrity": "sha512-f1UQF7ggd42YiwI5wGrRaPsa+P0CINBlrkLPmGfpq/u/I/oVtecoEIfFR9ag/oa1sLOsRNZ6xehf6qMZhQGBDg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.59.3", + "eslint-visitor-keys": "^5.0.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz", + "integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@vitejs/plugin-react": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-6.0.1.tgz", + "integrity": "sha512-l9X/E3cDb+xY3SWzlG1MOGt2usfEHGMNIaegaUGFsLkb3RCn/k8/TOXBcab+OndDI4TBtktT8/9BwwW8Vi9KUQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rolldown/pluginutils": "1.0.0-rc.7" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "peerDependencies": { + "@rolldown/plugin-babel": "^0.1.7 || ^0.2.0", + "babel-plugin-react-compiler": "^1.0.0", + "vite": "^8.0.0" + }, + "peerDependenciesMeta": { + "@rolldown/plugin-babel": { + "optional": true + }, + "babel-plugin-react-compiler": { + "optional": true + } + } + }, + "node_modules/@xterm/addon-fit": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@xterm/addon-fit/-/addon-fit-0.11.0.tgz", + "integrity": "sha512-jYcgT6xtVYhnhgxh3QgYDnnNMYTcf8ElbxxFzX0IZo+vabQqSPAjC3c1wJrKB5E19VwQei89QCiZZP86DCPF7g==", + "license": "MIT" + }, + "node_modules/@xterm/xterm": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@xterm/xterm/-/xterm-6.0.0.tgz", + "integrity": "sha512-TQwDdQGtwwDt+2cgKDLn0IRaSxYu1tSUjgKarSDkUM0ZNiSRXFpjxEsvc/Zgc5kq5omJ+V0a8/kIM2WD3sMOYg==", + "license": "MIT", + "workspaces": [ + "addons/*" + ] + }, + "node_modules/acorn": { + "version": "8.19.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.19.0.tgz", + "integrity": "sha512-oJlA3XiRm7Cyk6qFD2Jn8ak9B7jSy0qy00ADO3+8dpT0LSjFihQYv4C02LFCSYJV3Q37xYwwRy5m+IpIiUzqWw==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.15.0.tgz", + "integrity": "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/babel-plugin-macros": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/babel-plugin-macros/-/babel-plugin-macros-3.1.0.tgz", + "integrity": "sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.12.5", + "cosmiconfig": "^7.0.0", + "resolve": "^1.19.0" + }, + "engines": { + "node": ">=10", + "npm": ">=6" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/baseline-browser-mapping": { + "version": "2.11.31", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.31.tgz", + "integrity": "sha512-b0k7wXlWjpuL/Uxb/pYlpjY0ej5BjAmurtPUk3eRGuloI4yjK32m8TiKUQ81l1ptcLjKS/KH2+uqIolZti1x4Q==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "baseline-browser-mapping": "dist/cli.cjs" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.21", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.21.tgz", + "integrity": "sha512-9zeA+KLZNNzglF2TPKRQEDyx6Yby7daAkuy8MiPzpXPsYDWi/DRM8jmwUDxokQjYqBpv5DgPiwD4h4ZZSy1Ujw==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/browserslist": { + "version": "4.29.4", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.4.tgz", + "integrity": "sha512-2TcbbiwXEq+N0kD36tykpCfyyQigUXmuwNQbnPp4Xk4PX9JOqVIKjJlIDjpH7uY6tmRGoAd+apeT1p60T8wsdA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "baseline-browser-mapping": "^2.11.29", + "caniuse-lite": "^1.0.30001816", + "electron-to-chromium": "^1.5.459", + "node-releases": "^2.0.59", + "update-browserslist-db": "^1.3.4" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001819", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001819.tgz", + "integrity": "sha512-LFUqIIAwpzsIuevnKnsR9qnStBcgzPShTX61lBwN9uFkkf8o8zLiebEjbW8AYtZiF+1YKDWfdt/pWDtMuG8Xwg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/clsx": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", + "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true, + "license": "MIT" + }, + "node_modules/convert-source-map": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", + "license": "MIT" + }, + "node_modules/cookie": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.1.1.tgz", + "integrity": "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/cosmiconfig": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz", + "integrity": "sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==", + "license": "MIT", + "dependencies": { + "@types/parse-json": "^4.0.0", + "import-fresh": "^3.2.1", + "parse-json": "^5.0.0", + "path-type": "^4.0.0", + "yaml": "^1.10.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/cosmiconfig/node_modules/yaml": { + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.3.tgz", + "integrity": "sha512-vIYeF1u3CjlhAFekPPAk2h/Kv4T3mAkMox5OymRiJQB0spDP10LHvt+K7G9Ny6NuuMAb25/6n1qyUjAcGNf/AA==", + "license": "ISC", + "engines": { + "node": ">= 6" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/csstype": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", + "license": "MIT" + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/dequal": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", + "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/dom-helpers": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-5.2.1.tgz", + "integrity": "sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.8.7", + "csstype": "^3.0.2" + } + }, + "node_modules/dompurify": { + "version": "3.4.8", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.4.8.tgz", + "integrity": "sha512-yb1cEmaOum7wFvOCSQxyfgVlv5D47Rc30iZWoMpbDIWTnJ6grDDQyu2KFJzB2k7u0pMuJcQ1zphH//fFnw2tjQ==", + "license": "(MPL-2.0 OR Apache-2.0)", + "optionalDependencies": { + "@types/trusted-types": "^2.0.7" + } + }, + "node_modules/electron-to-chromium": { + "version": "1.5.463", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.463.tgz", + "integrity": "sha512-nVWNU6ltFjopvOdD44J4zoBkgO0M+WZiFKKFV7EjebOH9z0KNphk6bCEjplXtJofL21ARIuuwWOCsFkBVklm6w==", + "dev": true, + "license": "ISC" + }, + "node_modules/error-ex": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.4.tgz", + "integrity": "sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ==", + "license": "MIT", + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-10.3.0.tgz", + "integrity": "sha512-XbEXaRva5cF0ZQB8w6MluHA0kZZfV2DuCMJ3ozyEOHLwDpZX2Lmm/7Pp0xdJmI0GL1W05VH5VwIFHEm1Vcw2gw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.8.0", + "@eslint-community/regexpp": "^4.12.2", + "@eslint/config-array": "^0.23.5", + "@eslint/config-helpers": "^0.5.5", + "@eslint/core": "^1.2.1", + "@eslint/plugin-kit": "^0.7.1", + "@humanfs/node": "^0.16.6", + "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.4.2", + "@types/estree": "^1.0.6", + "ajv": "^6.14.0", + "cross-spawn": "^7.0.6", + "debug": "^4.3.2", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^9.1.2", + "eslint-visitor-keys": "^5.0.1", + "espree": "^11.2.0", + "esquery": "^1.7.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^8.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "minimatch": "^10.2.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } + } + }, + "node_modules/eslint-config-prettier": { + "version": "10.1.8", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.1.8.tgz", + "integrity": "sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==", + "dev": true, + "license": "MIT", + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "funding": { + "url": "https://opencollective.com/eslint-config-prettier" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, + "node_modules/eslint-plugin-prettier": { + "version": "5.5.5", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.5.5.tgz", + "integrity": "sha512-hscXkbqUZ2sPithAuLm5MXL+Wph+U7wHngPBv9OMWwlP8iaflyxpjTYZkmdgB4/vPIhemRlBEoLrH7UC1n7aUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "prettier-linter-helpers": "^1.0.1", + "synckit": "^0.11.12" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint-plugin-prettier" + }, + "peerDependencies": { + "@types/eslint": ">=8.0.0", + "eslint": ">=8.0.0", + "eslint-config-prettier": ">= 7.0.0 <10.0.0 || >=10.1.0", + "prettier": ">=3.0.0" + }, + "peerDependenciesMeta": { + "@types/eslint": { + "optional": true + }, + "eslint-config-prettier": { + "optional": true + } + } + }, + "node_modules/eslint-plugin-react-hooks": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-7.1.1.tgz", + "integrity": "sha512-f2I7Gw6JbvCexzIInuSbZpfdQ44D7iqdWX01FKLvrPgqxoE7oMj8clOfto8U6vYiz4yd5oKu39rRSVOe1zRu0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.24.4", + "@babel/parser": "^7.24.4", + "hermes-parser": "^0.25.1", + "zod": "^3.25.0 || ^4.0.0", + "zod-validation-error": "^3.5.0 || ^4.0.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0 || ^10.0.0" + } + }, + "node_modules/eslint-scope": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-9.1.2.tgz", + "integrity": "sha512-xS90H51cKw0jltxmvmHy2Iai1LIqrfbw57b79w/J7MfvDfkIkFZ+kj6zC3BjtUwh150HsSSdxXZcsuv72miDFQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@types/esrecurse": "^4.3.1", + "@types/estree": "^1.0.8", + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/eslint/node_modules/brace-expansion": { + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz", + "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/eslint/node_modules/eslint-visitor-keys": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz", + "integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/espree": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-11.2.0.tgz", + "integrity": "sha512-7p3DrVEIopW1B1avAGLuCSh1jubc01H2JHc8B4qqGblmg5gI9yumBgACjWo4JlIc04ufug4xJ3SQI8HkS/Rgzw==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.16.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^5.0.1" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/minimatch": { + "version": "10.2.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz", + "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "brace-expansion": "^5.0.8" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/espree": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz", + "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.15.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.2.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree/node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.7.0.tgz", + "integrity": "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-diff": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", + "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/file-entry-cache": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^4.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/find-root": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz", + "integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==", + "license": "MIT" + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.4" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/flatted": { + "version": "3.4.4", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.4.tgz", + "integrity": "sha512-5+ybhBZANEJxaH3X5evAFatUxLfEHSr7n6kYJ+1Qd0mUqr4eu9gIf6GDbWHf8RJijHrjjO8G+la14SlL2SeS1Q==", + "dev": true, + "license": "ISC" + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/globals": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/goober": { + "version": "2.1.19", + "resolved": "https://registry.npmjs.org/goober/-/goober-2.1.19.tgz", + "integrity": "sha512-U7veizMqxyKlM58+Z5j2ngJBH/r9siDmxpvNxSw0PylF6WQvrASJEZrxh1hidRBJc2jqoBVSyOban5u8m+6Rxg==", + "license": "MIT", + "peerDependencies": { + "csstype": "^3.0.10" + } + }, + "node_modules/hasown": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", + "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/hermes-estree": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.25.1.tgz", + "integrity": "sha512-0wUoCcLp+5Ev5pDW2OriHC2MJCbwLwuRx+gAqMTOkGKJJiBCLjtrvy4PWUGn6MIVefecRpzoOZ/UV6iGdOr+Cw==", + "dev": true, + "license": "MIT" + }, + "node_modules/hermes-parser": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/hermes-parser/-/hermes-parser-0.25.1.tgz", + "integrity": "sha512-6pEjquH3rqaI6cYAXYPcz9MS4rY6R4ngRgrgfDshRptUZIc3lw0MCIJIGDj9++mfySOuPTHB4nrSW99BCvOPIA==", + "dev": true, + "license": "MIT", + "dependencies": { + "hermes-estree": "0.25.1" + } + }, + "node_modules/hoist-non-react-statics": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", + "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", + "license": "BSD-3-Clause", + "dependencies": { + "react-is": "^16.7.0" + } + }, + "node_modules/hoist-non-react-statics/node_modules/react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", + "license": "MIT" + }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", + "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", + "license": "MIT", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "license": "MIT" + }, + "node_modules/is-core-module": { + "version": "2.17.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.17.0.tgz", + "integrity": "sha512-J/vG0zBCbIKOQFfufSwyXdMrsohyJIUNkrnmo6WZGzoM7tr/lsbfW5b2BvisL6zsyMzK9UxV9L6c7AoFbyXHOA==", + "license": "MIT", + "dependencies": { + "hasown": "^2.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-mobile": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-mobile/-/is-mobile-5.0.0.tgz", + "integrity": "sha512-Tz/yndySvLAEXh+Uk8liFCxOwVH6YutuR74utvOcu7I9Di+DwM0mtdPVZNaVvvBUM2OXxne/NhOs1zAO7riusQ==", + "license": "MIT" + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "license": "MIT" + }, + "node_modules/js-yaml": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.2.tgz", + "integrity": "sha512-SFNOvSJ+Dgf/9An904Yx+CgSlIPCkIpao4qo51lpee25TIRejdH3rhR4EZMGoNx3/TP3O+wzWuiTFl4sqbltzA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/puzrin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/nodeca" + } + ], + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "license": "MIT" + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/lightningcss": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.33.0.tgz", + "integrity": "sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "detect-libc": "^2.0.3" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "lightningcss-android-arm64": "1.33.0", + "lightningcss-darwin-arm64": "1.33.0", + "lightningcss-darwin-x64": "1.33.0", + "lightningcss-freebsd-x64": "1.33.0", + "lightningcss-linux-arm-gnueabihf": "1.33.0", + "lightningcss-linux-arm64-gnu": "1.33.0", + "lightningcss-linux-arm64-musl": "1.33.0", + "lightningcss-linux-x64-gnu": "1.33.0", + "lightningcss-linux-x64-musl": "1.33.0", + "lightningcss-win32-arm64-msvc": "1.33.0", + "lightningcss-win32-x64-msvc": "1.33.0" + } + }, + "node_modules/lightningcss-android-arm64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.33.0.tgz", + "integrity": "sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-arm64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.33.0.tgz", + "integrity": "sha512-Sciaz8eenNTKn9b3t7+xr0ipTp9YxKQY4npwQ3mrRuL0BAVHBLyZxofhaKBAVtzmtRZ/zTyo0/to4B1uWG/Djg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-x64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.33.0.tgz", + "integrity": "sha512-Z5UPAxzrjlWNNyGy6i65cJzzvgJ5D3T6wMvs+gWpY9d7qRhANrxqAp6LhxIgZhWEw18RfJTGcRxjuLIBr+m8XQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-freebsd-x64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.33.0.tgz", + "integrity": "sha512-QQM/Ti/hQajJwCY+RiWuCZ9sdtI/XQk7nDK5vC8kkdwixezOlDgvDx7+RT+QjK6FcFT4MpsuoBnHIo/O3StRRg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm-gnueabihf": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.33.0.tgz", + "integrity": "sha512-N7FVBe6iS24MlM6R/4RBTxGhQheZGs7tiQ9U32UtF75NzP5Q7xWPRqLBCKxlRQRk3rY1jCIPLzx7WzOhuUIRLQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-gnu": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.33.0.tgz", + "integrity": "sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-musl": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.33.0.tgz", + "integrity": "sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-gnu": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.33.0.tgz", + "integrity": "sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-musl": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.33.0.tgz", + "integrity": "sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-arm64-msvc": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.33.0.tgz", + "integrity": "sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-x64-msvc": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.33.0.tgz", + "integrity": "sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "license": "MIT" + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash-es": { + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.18.1.tgz", + "integrity": "sha512-J8xewKD/Gk22OZbhpOVSwcs60zhd95ESDwezOFuA3/099925PdHJ7OFHNTGtajL3AlZkykD32HykiMo+BIBI8A==", + "license": "MIT" + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "license": "MIT", + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/marked": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-14.0.0.tgz", + "integrity": "sha512-uIj4+faQ+MgHgwUW1l2PsPglZLOLOT1uErt06dAPtx2kjteLAkbsd/0FiYg/MGS+i7ZKLb7w2WClxHkzOOuryQ==", + "license": "MIT", + "bin": { + "marked": "bin/marked.js" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/minimatch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/monaco-editor": { + "version": "0.56.0", + "resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.56.0.tgz", + "integrity": "sha512-sXboRm3BeBeLm938eaiyLMe0OxzfXIlZvbv4ir/jVgQy1zDhWjgmny0WoN45fuDKhCCQsYMbBJrv/A6jd8aCUg==", + "license": "MIT", + "dependencies": { + "dompurify": "3.4.8", + "marked": "14.0.0" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.3.20", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz", + "integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true, + "license": "MIT" + }, + "node_modules/node-releases": { + "version": "2.0.60", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.60.tgz", + "integrity": "sha512-OmO8+GM1JUZqXET720VrJCwkjUCXmCMQm0Z3UDDRbfNLHS4NEAvY60j5jiFv0tkKw2PNNlqOLhahVmwJIOLDIQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/notistack": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/notistack/-/notistack-3.0.2.tgz", + "integrity": "sha512-0R+/arLYbK5Hh7mEfR2adt0tyXJcCC9KkA2hc56FeWik2QN6Bm/S4uW+BjzDARsJth5u06nTjelSw/VSnB1YEA==", + "license": "MIT", + "dependencies": { + "clsx": "^1.1.0", + "goober": "^2.0.33" + }, + "engines": { + "node": ">=12.0.0", + "npm": ">=6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/notistack" + }, + "peerDependencies": { + "react": "^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/notistack/node_modules/clsx": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-1.2.1.tgz", + "integrity": "sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "license": "MIT", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "license": "MIT" + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz", + "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postcss": { + "version": "8.5.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.31.tgz", + "integrity": "sha512-YUbWYCgErwnMAVkjUnYa+KlMBzGpHwiIt/DE7f0G33AuX2LH9UcTk6KgWxd3zRU+pN3u/C+Xl3EnMLM4Hea7Sg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.20", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prettier": { + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.3.tgz", + "integrity": "sha512-7igPTM53cGHMW8xWuVTydi2KO233VFiTNyF5hLJqpilHfmn8C8gPf+PS7dUT64YcXFbiMGZxS9pCSxL/Dxm/Jw==", + "dev": true, + "license": "MIT", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/prettier-linter-helpers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.1.tgz", + "integrity": "sha512-SxToR7P8Y2lWmv/kTzVLC1t/GDI2WGjMwNhLLE9qtH8Q13C+aEmuRlzDst4Up4s0Wc8sF2M+J57iB3cMLqftfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-diff": "^1.1.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/prop-types": { + "version": "15.8.1", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", + "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.13.1" + } + }, + "node_modules/prop-types/node_modules/react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", + "license": "MIT" + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/react": { + "version": "19.2.6", + "resolved": "https://registry.npmjs.org/react/-/react-19.2.6.tgz", + "integrity": "sha512-sfWGGfavi0xr8Pg0sVsyHMAOziVYKgPLNrS7ig+ivMNb3wbCBw3KxtflsGBAwD3gYQlE/AEZsTLgToRrSCjb0Q==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "19.2.6", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.6.tgz", + "integrity": "sha512-0prMI+hvBbPjsWnxDLxlCGyM8PN6UuWjEUCYmZhO67xIV9Xasa/r/vDnq+Xyq4Lo27g8QSbO5YzARu0D1Sps3g==", + "license": "MIT", + "dependencies": { + "scheduler": "^0.27.0" + }, + "peerDependencies": { + "react": "^19.2.6" + } + }, + "node_modules/react-is": { + "version": "19.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-19.3.1.tgz", + "integrity": "sha512-RRieF6IyxQBkcK6pP8xOHprLTPW6QjRkbGdImtqNme+/hYVwCZkLQLdlZGOhUqXwkS9IEynaGvPJtv6XB/cz0Q==", + "license": "MIT" + }, + "node_modules/react-router": { + "version": "7.15.0", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.15.0.tgz", + "integrity": "sha512-HW9vYwuM8f4yx66Izy8xfrzCM+SBJluoZcCbww9A1TySax11S5Vgw6fi3ZjMONw9J4gQwngL7PzkyIpJJpJ7RQ==", + "license": "MIT", + "dependencies": { + "cookie": "^1.0.1", + "set-cookie-parser": "^2.6.0" + }, + "engines": { + "node": ">=20.0.0" + }, + "peerDependencies": { + "react": ">=18", + "react-dom": ">=18" + }, + "peerDependenciesMeta": { + "react-dom": { + "optional": true + } + } + }, + "node_modules/react-router-dom": { + "version": "7.15.0", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.15.0.tgz", + "integrity": "sha512-VcrVg64Fo8nwBvDscajG8gRTLIuTC6N50nb22l2HOOV4PTOHgoGp8mUjy9wLiHYoYTSYI36tUnXZgasSRFZorQ==", + "license": "MIT", + "dependencies": { + "react-router": "7.15.0" + }, + "engines": { + "node": ">=20.0.0" + }, + "peerDependencies": { + "react": ">=18", + "react-dom": ">=18" + } + }, + "node_modules/react-transition-group": { + "version": "4.4.5", + "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz", + "integrity": "sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==", + "license": "BSD-3-Clause", + "dependencies": { + "@babel/runtime": "^7.5.5", + "dom-helpers": "^5.0.1", + "loose-envify": "^1.4.0", + "prop-types": "^15.6.2" + }, + "peerDependencies": { + "react": ">=16.6.0", + "react-dom": ">=16.6.0" + } + }, + "node_modules/resolve": { + "version": "1.22.13", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.13.tgz", + "integrity": "sha512-Dj/cW9zBV2aRj6XzCxuGIs3ESZKv02jixne3q6jFZYZ3/Tg09gHHviSMDL4kObh9pqSahdRHEnDoaP2gn8YLhA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "is-core-module": "^2.17.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/rolldown": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.15.tgz", + "integrity": "sha512-6odND+fel5zVw3I4Yc2e69gvguDnX0CAAGiNDZSq4ik5WUcaLrkD2GLuog0XcODbor31hZ5ayEMgVDno+KPV5g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@oxc-project/types": "=0.155.0", + "@rolldown/pluginutils": "^1.0.0" + }, + "bin": { + "rolldown": "bin/cli.mjs" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "optionalDependencies": { + "@rolldown/binding-android-arm-eabi": "1.2.15", + "@rolldown/binding-android-arm64": "1.2.15", + "@rolldown/binding-darwin-arm64": "1.2.15", + "@rolldown/binding-darwin-x64": "1.2.15", + "@rolldown/binding-freebsd-x64": "1.2.15", + "@rolldown/binding-linux-arm-gnueabihf": "1.2.15", + "@rolldown/binding-linux-arm64-gnu": "1.2.15", + "@rolldown/binding-linux-arm64-musl": "1.2.15", + "@rolldown/binding-linux-ppc64-gnu": "1.2.15", + "@rolldown/binding-linux-s390x-gnu": "1.2.15", + "@rolldown/binding-linux-x64-gnu": "1.2.15", + "@rolldown/binding-linux-x64-musl": "1.2.15", + "@rolldown/binding-openharmony-arm64": "1.2.15", + "@rolldown/binding-win32-arm64-msvc": "1.2.15", + "@rolldown/binding-win32-x64-msvc": "1.2.15" + } + }, + "node_modules/rolldown/node_modules/@rolldown/pluginutils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz", + "integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==", + "dev": true, + "license": "MIT" + }, + "node_modules/scheduler": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz", + "integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==", + "license": "MIT" + }, + "node_modules/semver": { + "version": "7.8.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", + "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/set-cookie-parser": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.7.2.tgz", + "integrity": "sha512-oeM1lpU/UvhTxw+g3cIfxXHyJRc/uidd3yK1P242gzHds0udQBYzs3y8j4gCCW+ZJ7ad0yctld8RYO+bdurlvw==", + "license": "MIT" + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-js": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.2.tgz", + "integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/stylis": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.2.0.tgz", + "integrity": "sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw==", + "license": "MIT" + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/swr": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/swr/-/swr-2.4.1.tgz", + "integrity": "sha512-2CC6CiKQtEwaEeNiqWTAw9PGykW8SR5zZX8MZk6TeAvEAnVS7Visz8WzphqgtQ8v2xz/4Q5K+j+SeMaKXeeQIA==", + "license": "MIT", + "dependencies": { + "dequal": "^2.0.3", + "use-sync-external-store": "^1.6.0" + }, + "peerDependencies": { + "react": "^16.11.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/synckit": { + "version": "0.11.13", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.11.13.tgz", + "integrity": "sha512-eNRKgb3z66Yp3D2CixVujOUvXLFUTij/zVnV8KRyvFdQwpz7I5DS8UfRkTeLzb64u+dkzDSdelE24izu+zSSUg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@pkgr/core": "^0.3.6" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/synckit" + } + }, + "node_modules/tinyglobby": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/ts-api-utils": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.5.0.tgz", + "integrity": "sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.12" + }, + "peerDependencies": { + "typescript": ">=4.8.4" + } + }, + "node_modules/tweetnacl": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", + "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==", + "license": "Unlicense" + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/typescript": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz", + "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "7.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.21.0.tgz", + "integrity": "sha512-w9IMgQrz4O0YN1LtB7K5P63vhlIOvC7opSmouCJ+ZywlPAlO9gIkJ+otk6LvGpAs2wg4econaCz3TvQ9xPoyuQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/update-browserslist-db": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.4.tgz", + "integrity": "sha512-t8wonIOdQyOjtPd2VktlBu6QjTVTks6v8bSi7kd0r2Vll8TK1JYDZtRRdbmCHOAMphkZgrzK+L+vXK4pyZ8t4A==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/use-sync-external-store": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.7.0.tgz", + "integrity": "sha512-6L+EeigHMQhdaIPNIFUKwfWJSwWFQ8gJbJ2DLOs5sDIegTwR9fRxvnM3uciHKjIZhFz+KAv2emhWMRvDmMcY8A==", + "license": "MIT", + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/vite": { + "version": "8.2.1", + "resolved": "https://registry.npmjs.org/vite/-/vite-8.2.1.tgz", + "integrity": "sha512-EU/eS7BH3XROHh2YnBefjM6DBKA6ZeMZEYQbj7NLWg5wHYlhB8B/Mayd5XsgWq+NFYccDOTemRpdETWR6Ka/lw==", + "dev": true, + "license": "MIT", + "dependencies": { + "lightningcss": "^1.33.0", + "picomatch": "^4.0.5", + "postcss": "^8.5.25", + "rolldown": "~1.2.1", + "tinyglobby": "^0.2.17" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.0", + "@vitejs/devtools": "^0.4.0", + "esbuild": "^0.27.0 || ^0.28.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "@vitejs/devtools": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "license": "ISC" + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/zod": { + "version": "4.6.7", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.6.7.tgz", + "integrity": "sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, + "node_modules/zod-validation-error": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/zod-validation-error/-/zod-validation-error-4.0.2.tgz", + "integrity": "sha512-Q6/nZLe6jxuU80qb/4uJ4t5v2VEZ44lzQjPDhYJNztRQ4wyWc6VF3D3Kb/fAuPetZQnhS3hnajCf9CsWesghLQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "zod": "^3.25.0 || ^4.0.0" + } + } + } } diff --git a/src/WebUI/package.json b/src/WebUI/package.json index 57e622f..4ca369a 100644 --- a/src/WebUI/package.json +++ b/src/WebUI/package.json @@ -1,32 +1,71 @@ { - "name": "webui", - "private": true, - "version": "0.0.1", - "type": "module", - "scripts": { - "dev": "vite dev", - "build": "vite build", - "preview": "vite preview", - "prepare": "svelte-kit sync || echo ''", - "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", - "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch" - }, - "devDependencies": { - "@sveltejs/adapter-node": "^5.5.7", - "@sveltejs/adapter-static": "^3.0.10", - "@sveltejs/kit": "^2.63.0", - "@sveltejs/vite-plugin-svelte": "^7.1.2", - "@types/node": "^26.1.2", - "svelte": "^5.56.1", - "svelte-check": "^4.6.0", - "typescript": "^6.0.3", - "vite": "^8.0.16" - }, - "dependencies": { - "@nats-io/nats-core": "^3.4.0", - "@nats-io/nkeys": "^2.0.3", - "@xterm/addon-fit": "^0.11.0", - "@xterm/xterm": "^6.0.0", - "monaco-editor": "^0.56.0" - } + "name": "executer-webui", + "version": "0.0.0", + "private": true, + "license": "AGPL-3.0-only", + "type": "module", + "engines": { + "node": ">=22" + }, + "scripts": { + "dev": "vite", + "build": "npm run typecheck && vite build", + "typecheck": "tsc --noEmit && tsc -p tsconfig.node.json --noEmit", + "lint": "eslint \"src/**/*.{ts,tsx}\"", + "lint:fix": "eslint --fix \"src/**/*.{ts,tsx}\"", + "check": "npm run typecheck && npm run lint", + "prettier": "prettier --write \"src/**/*.{ts,tsx}\"", + "preview": "vite preview", + "start": "node server.mjs" + }, + "dependencies": { + "@ant-design/colors": "8.0.1", + "@ant-design/icons": "6.2.3", + "@emotion/react": "11.14.0", + "@emotion/styled": "11.14.1", + "@fontsource/public-sans": "5.2.7", + "@mui/material": "9.0.1", + "@nats-io/nats-core": "3.4.0", + "@nats-io/nkeys": "2.0.3", + "@xterm/addon-fit": "0.11.0", + "@xterm/xterm": "6.0.0", + "lodash-es": "4.18.1", + "monaco-editor": "0.56.0", + "notistack": "3.0.2", + "react": "19.2.6", + "react-dom": "19.2.6", + "react-router-dom": "7.15.0", + "swr": "2.4.1" + }, + "devDependencies": { + "@eslint/compat": "2.1.0", + "@eslint/eslintrc": "3.3.5", + "@eslint/js": "10.0.1", + "@types/lodash-es": "4.17.12", + "@types/node": "25.7.0", + "@types/react": "19.2.14", + "@types/react-dom": "19.2.3", + "@typescript-eslint/eslint-plugin": "8.59.3", + "@typescript-eslint/parser": "8.59.3", + "@vitejs/plugin-react": "6.0.1", + "eslint": "10.3.0", + "eslint-config-prettier": "10.1.8", + "eslint-plugin-prettier": "5.5.5", + "eslint-plugin-react-hooks": "7.1.1", + "prettier": "3.8.3", + "typescript": "6.0.3", + "vite": "8.2.1" + }, + "browserslist": { + "production": [ + ">0.2%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + } } diff --git a/src/WebUI/public/favicon.svg b/src/WebUI/public/favicon.svg new file mode 100644 index 0000000..7182e50 --- /dev/null +++ b/src/WebUI/public/favicon.svg @@ -0,0 +1 @@ + diff --git a/src/WebUI/static/robots.txt b/src/WebUI/public/robots.txt similarity index 100% rename from src/WebUI/static/robots.txt rename to src/WebUI/public/robots.txt diff --git a/src/WebUI/server.mjs b/src/WebUI/server.mjs new file mode 100644 index 0000000..96a2002 --- /dev/null +++ b/src/WebUI/server.mjs @@ -0,0 +1,93 @@ +// Static server for the webui container: serves the Vite build in dist/ and +// answers unknown paths with index.html so client-side routes deep-link. +// Zero dependencies; /api and /messaging are routed to the backend and NATS +// by the reverse proxy in front of this, never by this process. + +import { createServer } from 'node:http'; +import { createReadStream } from 'node:fs'; +import { stat } from 'node:fs/promises'; +import { extname, join, normalize, resolve, sep } from 'node:path'; +import { fileURLToPath } from 'node:url'; + +const root = resolve(fileURLToPath(new URL('.', import.meta.url)), 'dist'); +const port = Number(process.env.PORT ?? 3000); + +const TYPES = { + '.html': 'text/html; charset=utf-8', + '.js': 'text/javascript; charset=utf-8', + '.css': 'text/css; charset=utf-8', + '.json': 'application/json; charset=utf-8', + '.svg': 'image/svg+xml', + '.png': 'image/png', + '.ico': 'image/x-icon', + '.woff': 'font/woff', + '.woff2': 'font/woff2', + '.ttf': 'font/ttf', + '.txt': 'text/plain; charset=utf-8', + '.map': 'application/json; charset=utf-8' +}; + +const SECURITY_HEADERS = { + 'X-Content-Type-Options': 'nosniff', + 'Referrer-Policy': 'same-origin', + 'X-Frame-Options': 'DENY' +}; + +async function fileFor(urlPath) { + // Resolve inside dist/ only; anything escaping it is treated as not found. + const candidate = resolve(root, '.' + normalize(decodeURIComponent(urlPath))); + if (candidate !== root && !candidate.startsWith(root + sep)) return null; + try { + const info = await stat(candidate); + if (info.isFile()) return { path: candidate, size: info.size }; + if (info.isDirectory()) return fileFor(join(urlPath, 'index.html')); + } catch { + // Not found: fall through. + } + return null; +} + +const server = createServer(async (req, res) => { + if (req.method !== 'GET' && req.method !== 'HEAD') { + res.writeHead(405, { Allow: 'GET, HEAD', ...SECURITY_HEADERS }).end(); + return; + } + + let pathname; + try { + pathname = new URL(req.url ?? '/', 'http://localhost').pathname; + } catch { + res.writeHead(400, SECURITY_HEADERS).end(); + return; + } + + let file = await fileFor(pathname); + const isAsset = pathname.startsWith('/assets/'); + if (!file && !isAsset) { + // Client-side route (e.g. /devices/abc): hand over to the SPA. + file = await fileFor('/index.html'); + } + if (!file) { + res.writeHead(404, { 'Content-Type': 'text/plain; charset=utf-8', ...SECURITY_HEADERS }).end('Not found'); + return; + } + + res.writeHead(200, { + 'Content-Type': TYPES[extname(file.path)] ?? 'application/octet-stream', + 'Content-Length': file.size, + // Hashed bundles never change; the shell must always be re-checked. + 'Cache-Control': isAsset ? 'public, max-age=31536000, immutable' : 'no-cache', + ...SECURITY_HEADERS + }); + if (req.method === 'HEAD') { + res.end(); + return; + } + createReadStream(file.path).pipe(res); +}); + +server.listen(port, () => console.log(`ExecuteR console on :${port} (serving ${root})`)); + +for (const signal of ['SIGTERM', 'SIGINT']) { + process.on(signal, () => server.close(() => process.exit(0))); +} diff --git a/src/WebUI/src/App.tsx b/src/WebUI/src/App.tsx new file mode 100644 index 0000000..0a06036 --- /dev/null +++ b/src/WebUI/src/App.tsx @@ -0,0 +1,25 @@ +import { RouterProvider } from 'react-router-dom'; +import { SWRConfig } from 'swr'; + +// project imports +import Notistack from 'components/third-party/Notistack'; +import { SessionProvider } from 'contexts/SessionContext'; +import router from 'routes'; +import ThemeCustomization from 'themes'; + +// ==============================|| APP - THEME, SESSION, ROUTER ||============================== // + +export default function App() { + return ( + + {/* Live NATS events drive most refreshes; focus revalidation covers the rest. */} + + + + + + + + + ); +} diff --git a/src/WebUI/src/api/client.ts b/src/WebUI/src/api/client.ts new file mode 100644 index 0000000..11ec5ff --- /dev/null +++ b/src/WebUI/src/api/client.ts @@ -0,0 +1,286 @@ +import type { + AgentPackageStatusDto, + AuthConfigDto, + AuthSettingsDto, + AuthTestResultDto, + BootstrapTokenDto, + BrowserCredentialResponse, + CreateShellResponse, + DashboardDto, + DeviceDetailDto, + DeviceDto, + DeviceGroupDto, + ExecutionDetailDto, + ExecutionSummaryDto, + FunctionModuleDto, + GroupFieldDescriptor, + GroupRuleSet, + GroupRunDto, + JobDto, + JobOutputRecordDto, + PermissionGroupDto, + RoleDto, + RunScriptBody, + S3SettingsDto, + S3TestResultDto, + SaveGroupBody, + SaveRoleBody, + SaveTriggerBody, + SchedulePreviewDto, + ScriptDto, + ScriptFileBinding, + ScriptParameter, + ScriptTriggerDto, + SecretBinding, + SecretsProviderDto, + SecretsProvidersResponse, + SecretsTestResultDto, + ServerInfoDto, + SessionResponse, + TriggerRunResultDto, + UserAccountDto +} from './types'; + +export interface SaveScriptBody { + name: string; + description?: string; + content: string; + parameters?: ScriptParameter[]; + functionModuleIds?: string[]; + secretBindings?: SecretBinding[]; + secretsVariableName?: string; + engine?: string; + fileBindings?: ScriptFileBinding[]; +} + +export interface SaveSecretsProviderBody { + name: string; + kind: string; + config: Record; +} + +/** A failed API call: HTTP status plus the server's error message. */ +export class ApiError extends Error { + constructor( + public status: number, + message: string + ) { + super(message); + } +} + +/** The message to show for any thrown value. */ +export function errorMessage(error: unknown, fallback = 'Something went wrong.'): string { + return error instanceof Error && error.message ? error.message : fallback; +} + +function readCookie(name: string): string | undefined { + return document.cookie + .split('; ') + .find((c) => c.startsWith(`${name}=`)) + ?.split('=')[1]; +} + +/** Paths that must not bounce to sign-in on a 401 (they are how sign-in finds out). */ +const SESSION_PROBES = ['/api/auth/session', '/api/auth/login', '/api/auth/config', '/api/auth/change-password']; + +export async function request(path: string, init?: RequestInit): Promise { + const method = (init?.method ?? 'GET').toUpperCase(); + const headers: Record = {}; + if (init?.body) { + headers['Content-Type'] = 'application/json'; + } + // Double-submit CSRF token for state-changing cookie-authenticated calls. + if (!['GET', 'HEAD', 'OPTIONS'].includes(method)) { + const csrf = readCookie('csrf_token'); + if (csrf) headers['X-CSRF-Token'] = csrf; + } + + const response = await fetch(path, { + credentials: 'same-origin', + ...init, + headers: { ...headers, ...(init?.headers as Record) } + }); + + if (!response.ok) { + // Session expired: bounce to sign-in, then come back here. + if (response.status === 401 && !SESSION_PROBES.some((p) => path.startsWith(p)) && !window.location.pathname.startsWith('/login')) { + const back = encodeURIComponent(window.location.pathname + window.location.search); + window.location.href = `/login?returnUrl=${back}`; + } + + let detail = response.statusText; + try { + const body = await response.json(); + detail = body?.error ?? body?.detail ?? body?.title ?? detail; + } catch { + // Non-JSON error body. + } + throw new ApiError(response.status, detail); + } + + if (response.status === 204 || response.status === 202) { + return undefined as T; + } + + const text = await response.text(); + return (text ? JSON.parse(text) : undefined) as T; +} + +const json = (method: string, body?: unknown): RequestInit => ({ + method, + body: body === undefined ? undefined : JSON.stringify(body) +}); + +const qs = (params: Record) => { + const search = new URLSearchParams(); + for (const [key, value] of Object.entries(params)) { + if (value !== undefined && value !== '') search.set(key, String(value)); + } + return search.size > 0 ? `?${search}` : ''; +}; + +const enc = encodeURIComponent; + +/** Every REST call the console makes. Reads also have SWR keys (see `keys`). */ +export const api = { + // Auth + session: () => request('/api/auth/session'), + login: (username: string, password: string) => request('/api/auth/login', json('POST', { username, password })), + changePassword: (username: string, currentPassword: string, newPassword: string) => + request('/api/auth/change-password', json('POST', { username, currentPassword, newPassword })), + logout: () => request('/api/auth/logout', { method: 'POST' }), + authConfig: () => request('/api/auth/config'), + + // Devices + devices: () => request('/api/devices'), + device: (clientId: string) => request(`/api/devices/${enc(clientId)}`), + refreshInventory: (clientId: string) => request(`/api/devices/${enc(clientId)}/inventory`, { method: 'POST' }), + openShell: (clientId: string, body: { browserSessionId: string; cols: number; rows: number }) => + request(`/api/devices/${enc(clientId)}/shell`, json('POST', body)), + sendFile: (clientId: string, body: { objectKey: string; destinationPath: string; sha256?: string }) => + request(`/api/devices/${enc(clientId)}/files`, json('POST', body)), + updateDeviceTags: (clientId: string, tags: string[]) => request(`/api/devices/${enc(clientId)}/tags`, json('PUT', { tags })), + + // Scripts + scripts: () => request('/api/scripts'), + script: (id: string) => request(`/api/scripts/${id}`), + createScript: (body: SaveScriptBody) => request('/api/scripts', json('POST', body)), + updateScript: (id: string, body: SaveScriptBody) => request(`/api/scripts/${id}`, json('PUT', body)), + deleteScript: (id: string) => request(`/api/scripts/${id}`, { method: 'DELETE' }), + + // Function modules + functions: () => request('/api/functions'), + functionModule: (id: string) => request(`/api/functions/${id}`), + createFunction: (body: { name: string; description?: string; content: string }) => + request('/api/functions', json('POST', body)), + updateFunction: (id: string, body: { name: string; description?: string; content: string }) => + request(`/api/functions/${id}`, json('PUT', body)), + deleteFunction: (id: string) => request(`/api/functions/${id}`, { method: 'DELETE' }), + + // Jobs and executions + dashboard: () => request('/api/dashboard'), + jobs: (params: { clientId?: string; scriptId?: string; limit?: number } = {}) => request(`/api/jobs${qs(params)}`), + job: (jobId: string) => request(`/api/jobs/${jobId}`), + jobOutput: (jobId: string, afterSequence?: number) => request(`/api/jobs/${jobId}/output${qs({ afterSequence })}`), + scriptExecutions: (scriptId: string) => request(`/api/scripts/${scriptId}/executions`), + execution: (runId: string) => request(`/api/executions/${runId}`), + /** Runs a script on any mix of devices and groups as one execution. */ + runScript: (body: RunScriptBody) => request('/api/jobs', json('POST', body)), + + // Groups + groups: () => request('/api/groups'), + group: (id: string) => request(`/api/groups/${id}`), + createGroup: (body: SaveGroupBody) => request('/api/groups', json('POST', body)), + updateGroup: (id: string, body: SaveGroupBody) => request(`/api/groups/${id}`, json('PUT', body)), + moveGroup: (id: string, parentId: string | null) => request(`/api/groups/${id}/move`, json('POST', { parentId })), + deleteGroup: (id: string) => request(`/api/groups/${id}`, { method: 'DELETE' }), + groupMembers: (id: string) => request(`/api/groups/${id}/members`), + updateGroupMembers: (id: string, add: string[], remove: string[]) => + request(`/api/groups/${id}/members`, json('POST', { add, remove })), + previewGroup: (rules: GroupRuleSet) => request('/api/groups/preview', json('POST', { rules })), + groupFields: () => request('/api/groups/fields'), + + // Schedules and event triggers + triggers: () => request('/api/triggers'), + createTrigger: (body: SaveTriggerBody) => request<{ id: string }>('/api/triggers', json('POST', body)), + updateTrigger: (id: string, body: SaveTriggerBody) => request(`/api/triggers/${id}`, json('PUT', body)), + setTriggerEnabled: (id: string, enabled: boolean) => request(`/api/triggers/${id}`, json('PATCH', { enabled })), + deleteTrigger: (id: string) => request(`/api/triggers/${id}`, { method: 'DELETE' }), + runTrigger: (id: string) => request(`/api/triggers/${id}/run`, { method: 'POST' }), + previewSchedule: (cronExpression: string, timeZoneId: string, count = 5) => + request('/api/triggers/preview', json('POST', { cronExpression, timeZoneId, count })), + + // Messaging + messagingCredential: (nkeyPublic: string, browserSessionId?: string) => + request('/api/messaging/credential', json('POST', { nkeyPublic, browserSessionId })), + + // Access control + permissionCatalog: () => request('/api/admin/permissions'), + roles: () => request('/api/admin/roles'), + createRole: (body: SaveRoleBody) => request('/api/admin/roles', json('POST', body)), + updateRole: (id: string, body: SaveRoleBody) => request(`/api/admin/roles/${id}`, json('PUT', body)), + deleteRole: (id: string) => request(`/api/admin/roles/${id}`, { method: 'DELETE' }), + users: () => request('/api/admin/users'), + createUser: (body: { username: string; password: string; roleId: string; displayName?: string }) => + request('/api/admin/users', json('POST', body)), + updateUser: (id: string, body: { displayName?: string; roleId?: string; password?: string }) => + request(`/api/admin/users/${id}`, json('PUT', body)), + deleteUser: (id: string) => request(`/api/admin/users/${id}`, { method: 'DELETE' }), + + // Settings: authentication + authSettings: () => request('/api/settings/auth'), + saveAuthSettings: (body: AuthSettingsDto) => request('/api/settings/auth', json('PUT', body)), + testAuthSettings: (body: AuthSettingsDto) => request('/api/settings/auth/test', json('POST', body)), + + // Settings: S3 + agent package delivery + s3Settings: () => request('/api/settings/s3'), + saveS3Settings: (body: S3SettingsDto) => request('/api/settings/s3', json('PUT', body)), + testS3Settings: (body: S3SettingsDto) => request('/api/settings/s3/test', json('POST', body)), + agentPackage: (type: 'msi' | 'zip' = 'msi') => request(`/api/settings/agent-package?type=${type}`), + offloadAgentPackage: (type: 'msi' | 'zip' = 'msi') => + request<{ message: string; status: AgentPackageStatusDto }>(`/api/settings/agent-package/offload?type=${type}`, { method: 'POST' }), + + // Secrets providers + secretsProviders: () => request('/api/secrets/providers'), + createSecretsProvider: (body: SaveSecretsProviderBody) => request('/api/secrets/providers', json('POST', body)), + updateSecretsProvider: (id: string, body: SaveSecretsProviderBody) => + request(`/api/secrets/providers/${id}`, json('PUT', body)), + deleteSecretsProvider: (id: string) => request(`/api/secrets/providers/${id}`, { method: 'DELETE' }), + testSecretsProvider: (body: SaveSecretsProviderBody & { id?: string }) => + request('/api/secrets/providers/test', json('POST', body)), + secretNames: (providerId: string, path?: string) => request(`/api/secrets/providers/${providerId}/secret-names${qs({ path })}`), + secretFolders: (providerId: string, path?: string) => request(`/api/secrets/providers/${providerId}/folders${qs({ path })}`), + + // Server info (public base URL for generated commands) + serverInfo: () => request('/api/settings/server'), + + // Enrollment tokens + bootstrapTokens: () => request('/api/admin/bootstrap-tokens'), + createBootstrapToken: (body: { validMinutes?: number; maxUses?: number; note?: string }) => + request('/api/admin/bootstrap-tokens', json('POST', body)), + revokeBootstrapToken: (id: string) => request(`/api/admin/bootstrap-tokens/${id}`, { method: 'DELETE' }) +}; + +/** + * SWR keys for shared reads, so a write in one place can refresh every view + * of the same data with `mutate(keys.devices)`. + */ +export const keys = { + devices: '/api/devices', + device: (clientId: string) => `/api/devices/${enc(clientId)}`, + groups: '/api/groups', + groupFields: '/api/groups/fields', + groupMembers: (id: string) => `/api/groups/${id}/members`, + scripts: '/api/scripts', + script: (id: string) => `/api/scripts/${id}`, + functions: '/api/functions', + triggers: '/api/triggers', + dashboard: '/api/dashboard', + jobs: (params: { clientId?: string; scriptId?: string; limit?: number } = {}) => `/api/jobs${qs(params)}`, + scriptExecutions: (scriptId: string) => `/api/scripts/${scriptId}/executions`, + execution: (runId: string) => `/api/executions/${runId}`, + roles: '/api/admin/roles', + users: '/api/admin/users', + permissionCatalog: '/api/admin/permissions' +}; diff --git a/src/WebUI/src/api/menu.ts b/src/WebUI/src/api/menu.ts new file mode 100644 index 0000000..6ad0b96 --- /dev/null +++ b/src/WebUI/src/api/menu.ts @@ -0,0 +1,37 @@ +import useSWR, { mutate } from 'swr'; +import { useMemo } from 'react'; + +// ==============================|| MENU STATE (DRAWER OPEN/CLOSED) ||============================== // + +interface MenuMaster { + isDashboardDrawerOpened: boolean; +} + +const KEY = 'local/menu-master'; +const STORAGE_KEY = 'executer-drawer-open'; + +function initial(): MenuMaster { + try { + const saved = window.localStorage.getItem(STORAGE_KEY); + return { isDashboardDrawerOpened: saved === null ? true : saved === '1' }; + } catch { + return { isDashboardDrawerOpened: true }; + } +} + +export function useGetMenuMaster() { + const { data } = useSWR(KEY, initial, { revalidateIfStale: false, revalidateOnFocus: false, revalidateOnReconnect: false }); + return useMemo(() => ({ menuMaster: data ?? initial() }), [data]); +} + +/** Opens or collapses the drawer; desktop choices are remembered per browser. */ +export function handlerDrawerOpen(isDashboardDrawerOpened: boolean, remember = false) { + if (remember) { + try { + window.localStorage.setItem(STORAGE_KEY, isDashboardDrawerOpened ? '1' : '0'); + } catch { + // Storage unavailable (private window); the choice lasts for the tab. + } + } + void mutate(KEY, (current?: MenuMaster) => ({ ...current, isDashboardDrawerOpened }), false); +} diff --git a/src/WebUI/src/api/types.ts b/src/WebUI/src/api/types.ts new file mode 100644 index 0000000..7b01155 --- /dev/null +++ b/src/WebUI/src/api/types.ts @@ -0,0 +1,677 @@ +// DTO mirror of Shared.Contracts (camelCase wire format). + +export type DeviceStatus = 'online' | 'stale' | 'offline'; + +export type JobState = 'queued' | 'dispatched' | 'running' | 'succeeded' | 'failed' | 'cancelled' | 'timedOut'; + +export type OutputStreamKind = 'output' | 'error' | 'warning' | 'verbose' | 'debug' | 'information' | 'progress'; + +export type UserRole = 'admin' | 'operator' | 'viewer'; + +export interface DeviceDto { + clientId: string; + hostname: string; + manufacturer?: string; + model?: string; + osCaption?: string; + osVersion?: string; + agentVersion?: string; + ipAddresses: string[]; + status: DeviceStatus; + lastSeenUtc?: string; + enrolledUtc: string; + tags?: string[]; + /** Public IP the agent was last seen from (trusted headers at enroll/refresh). */ + publicIp?: string; + /** Orphaned devices refuse jobs until they re-enroll. */ + isOrphaned?: boolean; + /** Groups the device is directly in (absent when no groups exist). */ + groupIds?: string[]; +} + +// ── Device grouping ─────────────────────────────────────────────────── + +/** Folders hold no devices of their own; every kind includes its nested groups' devices. */ +export type GroupKind = 'static' | 'dynamic' | 'folder'; +export type RuleCombine = 'and' | 'or'; +export type RuleOperator = + | 'equals' + | 'notEquals' + | 'contains' + | 'notContains' + | 'startsWith' + | 'endsWith' + | 'regex' + | 'in' + | 'notIn' + | 'greaterThan' + | 'greaterOrEqual' + | 'lessThan' + | 'lessOrEqual' + | 'exists' + | 'notExists' + | 'inCidr' + | 'notInCidr'; + +export interface RuleCondition { + field: string; + operator: RuleOperator; + value?: string; + negate?: boolean; +} + +export interface RuleGroup { + combine: RuleCombine; + conditions?: RuleCondition[]; + groups?: RuleGroup[]; + negate?: boolean; +} + +export interface GroupRuleSet { + combine: RuleCombine; + groups?: RuleGroup[]; +} + +export interface GroupFieldDescriptor { + field: string; + displayName: string; + category: string; + numeric: boolean; + multiValue: boolean; +} + +export interface DeviceGroupDto { + id: string; + name: string; + description?: string; + kind: GroupKind; + rules?: GroupRuleSet; + /** Devices in the group including its nested groups. */ + memberCount: number; + createdUtc: string; + updatedUtc: string; + updatedBy?: string; + parentId?: string; + /** The group's own devices (static list or rule matches). */ + directMemberCount: number; + /** Online devices among memberCount. */ + onlineCount: number; +} + +export interface SaveGroupBody { + name: string; + description?: string; + kind: GroupKind; + rules?: GroupRuleSet; + parentId?: string | null; +} + +export interface DeviceGroupRefDto { + id: string; + name: string; + kind: GroupKind; + parentId?: string; + /** In the group only through one of its nested groups. */ + inherited?: boolean; +} + +export interface AuthConfigDto { + oidcAvailable: boolean; + showLocalFields: boolean; + autoRedirect: boolean; + providerName?: string; +} + +export type LoginMode = 'LocalOnly' | 'Both' | 'OidcOnly' | 'OidcAutoRedirect'; + +export interface AuthSettingsDto { + oidcEnabled: boolean; + authority?: string; + clientId?: string; + clientSecret?: string | null; + /** Friendly IdP name shown on the sign-in button (e.g. "Authentik", "Entra ID"). */ + providerName?: string; + scopes: string; + nameClaim?: string; + roleClaim?: string; + adminRole?: string; + operatorRole?: string; + viewerRole?: string; + defaultRole: UserRole; + requireMappedRole: boolean; + loginMode: LoginMode; + clientSecretIsSet: boolean; + forcedLocalByEnvironment: boolean; + callbackPath: string; + redirectUri: string; +} + +export interface AuthTestResultDto { + ok: boolean; + steps: S3TestStepDto[]; +} + +export interface S3SettingsDto { + enabled: boolean; + endpoint?: string; + region: string; + bucket?: string; + accessKey?: string; + secretKey?: string | null; + forcePathStyle: boolean; + presignExpirySeconds: number; + secretKeyIsSet: boolean; + agentOffloadEnabled: boolean; + lastTestUtc?: string; + fromEnvironment: boolean; +} + +export interface S3TestStepDto { + name: string; + ok: boolean; + detail?: string; +} + +export interface S3TestResultDto { + ok: boolean; + steps: S3TestStepDto[]; + elapsedMs: number; +} + +export interface AgentPackageStatusDto { + available: boolean; + /** image | volume | s3 | none */ + source: string; + fileName?: string; + sizeBytes?: number; + sha256?: string; + builtUtc?: string; + version?: string; + offloadEnabled: boolean; + offloadUploaded: boolean; +} + +export type ScriptTriggerType = 'onRegistration' | 'onAgentReady' | 'scheduled'; + +export interface ScriptTriggerDto { + id: string; + scriptId: string; + scriptName: string; + groupId?: string; + groupName?: string; + clientId?: string; + clientHostname?: string; + triggerType: ScriptTriggerType; + enabled: boolean; + cronExpression?: string; + runOnceUtc?: string; + timeZoneId: string; + nextRunUtc?: string; + lastRunUtc?: string; + lastResult?: string; + createdUtc: string; + name?: string; + /** Execution created by the last firing. */ + lastRunId?: string; + arguments?: Record; + createdBy?: string; +} + +/** POST /api/triggers and PUT /api/triggers/{id}. Target: clientId OR groupId, or neither for all devices. */ +export interface SaveTriggerBody { + scriptId: string; + triggerType: ScriptTriggerType; + name?: string; + clientId?: string; + groupId?: string; + enabled?: boolean; + cronExpression?: string; + runOnceUtc?: string; + timeZoneId?: string; + arguments?: Record; +} + +export interface SchedulePreviewDto { + occurrences: string[]; + error?: string; +} + +export interface TriggerRunResultDto { + runId?: string; + queued: number; + message: string; +} + +export interface InventoryReport { + identity: { + clientId: string; + hostname: string; + manufacturer?: string; + model?: string; + serialNumber?: string; + biosVersion?: string; + baseboardSerial?: string; + domainOrWorkgroup?: string; + partOfDomain: boolean; + systemType?: string; + systemUuid?: string; + baseboardManufacturer?: string; + baseboardProduct?: string; + }; + os: { + caption?: string; + version?: string; + build?: string; + architecture?: string; + installDateUtc?: string; + lastBootUtc?: string; + edition?: string; + releaseVersion?: string; + productType?: string; + }; + cpu: { name?: string; logicalProcessors: number; cores: number }; + memory: { + deviceLocator?: string; + capacityBytes: number; + manufacturer?: string; + speedMhz?: number; + }[]; + totalPhysicalMemoryBytes: number; + disks: { + model?: string; + serialNumber?: string; + sizeBytes: number; + busType?: string; + index?: number; + }[]; + volumes: { + driveLetter: string; + fileSystem?: string; + totalSizeBytes: number; + freeSpaceBytes: number; + diskIndex?: number; + }[]; + network: { + description?: string; + macAddress?: string; + ipv4Addresses: string[]; + ipv6Addresses: string[]; + gateways: string[]; + dnsServers: string[]; + /** OS interface name: "Ethernet0" on Windows, "eth0"/"en0" on unix. */ + interfaceName?: string; + }[]; + collectedUtc: string; +} + +export interface DeviceDetailDto { + device: DeviceDto; + inventory?: InventoryReport; + inventoryUpdatedUtc?: string; + groups?: DeviceGroupRefDto[]; +} + +export type PrimitiveType = 'string' | 'number' | 'boolean'; +export type ScriptParameterType = 'string' | 'number' | 'boolean' | 'array' | 'hashtable'; + +/** + * String values expand on the target device in the background by default + * (%VAR%, $env:VAR, $()); 'literal' passes the value through exactly as typed. + */ +export type ValueExpansion = 'auto' | 'literal'; + +/** + * An S3 object (or prefix) delivered to the device before the script runs. + * The destination expands on the device (%VAR%, $env:VAR, $(…)) and the + * resolved location reaches the script as $Files.Name — a FileInfo, or a + * DirectoryInfo when directory (recursive) is set. + */ +export interface ScriptFileBinding { + name: string; + objectKey: string; + destinationPath: string; + directory?: boolean; + continueOnFailure?: boolean; +} + +export interface ScriptParameter { + name: string; + type: ScriptParameterType; + required?: boolean; + description?: string; + elementType?: PrimitiveType; + defaultValue?: unknown; + expansion?: ValueExpansion; +} + +/** Result of a group fan-out run: one job per eligible member. */ +export interface GroupRunDto { + jobs: JobDto[]; + skippedOrphaned: string[]; + /** Shared by every job of the run; absent when nothing was queued. */ + runId?: string; + skippedOffline?: string[]; +} + +/** POST /api/jobs: any mix of devices and groups, run as one execution. */ +export interface RunScriptBody { + scriptId: string; + clientIds?: string[]; + groupIds?: string[]; + arguments?: Record; + /** Skip devices that are not online now instead of queueing for their return. */ + onlineOnly?: boolean; +} + +export interface CountPoint { + label: string; + count: number; +} + +export interface DayPoint { + date: string; + succeeded: number; + failed: number; + other: number; +} + +export interface DashboardDto { + devicesTotal: number; + devicesOnline: number; + devicesStale: number; + devicesOffline: number; + devicesByPlatform: CountPoint[]; + jobsTotal: number; + jobsSucceeded: number; + jobsFailed: number; + jobsInProgress: number; + successRate: number; + jobsByState: CountPoint[]; + jobsByExitCode: CountPoint[]; + jobsByEngine: CountPoint[]; + topTargets: CountPoint[]; + topScripts: CountPoint[]; + timeline: DayPoint[]; + recentRuns: JobDto[]; +} + +export interface ServerInfoDto { + baseUrl: string; + fromEnvironment: boolean; + /** + * The server is serving its managed self-signed chain directly (no proxy + * in between), so generated commands must skip TLS verification — the + * traffic is still encrypted; the roots just aren't distributed. + */ + selfSignedDirect: boolean; +} + +/** + * Script execution engine. PowerShell = embedded in-process PowerShell 7 + * (all platforms, full typed params/$Secrets/expansion). WindowsPowerShell = + * powershell.exe 5.1 (Windows devices). Bash = bash (unix devices, or + * Windows with Git Bash) — parameters/secrets arrive as environment variables. + */ +export type ScriptEngine = 'PowerShell' | 'WindowsPowerShell' | 'Bash'; + +/** One entry of a script's secrets dictionary, resolved server-side at dispatch. */ +export interface SecretBinding { + /** Key inside the injected dictionary (e.g. $Secrets.ApiKey). */ + name: string; + providerId: string; + secretName: string; + path?: string; +} + +export interface ScriptDto { + id: string; + name: string; + description?: string; + language: string; + content: string; + parameters: ScriptParameter[]; + functionModuleIds: string[]; + createdUtc: string; + updatedUtc: string; + createdBy?: string; + updatedBy?: string; + secretBindings?: SecretBinding[]; + secretsVariableName?: string; + fileBindings?: ScriptFileBinding[]; +} + +// ── Secrets providers ───────────────────────────────────────────────── + +export interface SecretsProviderDto { + id: string; + name: string; + kind: string; + /** Driver-specific non-secret settings. */ + config: Record; + /** Secret config fields that currently hold a value. */ + secretFieldsSet: string[]; + updatedUtc: string; + updatedBy?: string; +} + +export interface SecretsProviderKindDto { + kind: string; + displayName: string; + fields: { name: string; label: string; secret: boolean; placeholder?: string }[]; +} + +export interface SecretsProvidersResponse { + providers: SecretsProviderDto[]; + kinds: SecretsProviderKindDto[]; +} + +export interface SecretsTestResultDto { + ok: boolean; + steps: S3TestStepDto[]; +} + +export interface FunctionModuleDto { + id: string; + name: string; + description?: string; + content: string; + createdUtc: string; + updatedUtc: string; + updatedBy?: string; +} + +export interface JobDto { + jobId: string; + clientId: string; + hostname?: string; + scriptId: string; + scriptName: string; + state: JobState; + createdUtc: string; + startedUtc?: string; + completedUtc?: string; + exitCode?: number; + requestedBy?: string; + outputSummary?: string; +} + +export interface JobOutputRecordDto { + sequence: number; + stream: OutputStreamKind; + timestampUtc: string; + text: string; +} + +export interface ExecutionSummaryDto { + runId: string; + scriptId: string; + startedUtc: string; + requestedBy?: string; + total: number; + succeeded: number; + failed: number; + pending: number; +} + +export interface ExecutionTargetDto { + jobId: string; + clientId: string; + hostname?: string; + state: JobState; + exitCode?: number; + createdUtc: string; + startedUtc?: string; + completedUtc?: string; +} + +export interface ExecutionDetailDto { + runId: string; + scriptId: string; + scriptName: string; + startedUtc: string; + requestedBy?: string; + targets: ExecutionTargetDto[]; +} + +export interface SessionResponse { + authenticated: boolean; + username?: string; + displayName?: string; + role?: UserRole; + authProvider?: string; + /** Assigned role name (custom or system). */ + roleName?: string; + /** Effective permission keys; '*' grants everything. */ + permissions?: string[]; + /** Credentials were valid but a new password must be set before a session is issued. */ + mustChangePassword?: boolean; +} + +export interface RoleDto { + id: string; + name: string; + description?: string; + isSystem: boolean; + permissions: string[]; + oidcClaimValues: string[]; + deviceScopeGroupIds: string[]; + userCount: number; +} + +export interface SaveRoleBody { + name: string; + description?: string; + permissions: string[]; + oidcClaimValues?: string[]; + deviceScopeGroupIds?: string[]; +} + +export interface PermissionInfoDto { + key: string; + label: string; + description: string; +} + +export interface PermissionGroupDto { + group: string; + permissions: PermissionInfoDto[]; +} + +export interface UserAccountDto { + id: string; + username: string; + displayName?: string; + authProvider: string; + roleId?: string; + roleName: string; + createdUtc: string; + lastLoginUtc?: string; +} + +export interface BrowserCredentialResponse { + jwt: string; + expiresUtc: string; + browserSessionId: string; + webSocketPath: string; +} + +export interface BootstrapTokenDto { + id: string; + token?: string; + createdUtc: string; + expiresUtc: string; + maxUses: number; + uses: number; + revoked: boolean; + note?: string; + createdBy?: string; +} + +export interface CreateShellResponse { + shellSessionId: string; + clientId: string; + hostname: string; + expiresUtc: string; +} + +// ── Envelope + live payloads ────────────────────────────────────────── + +export interface MessageEnvelope { + messageId: string; + correlationId: string; + causationId?: string; + messageType: string; + schemaVersion: number; + timestampUtc: string; + source: { kind: string; id: string }; + target?: { kind: string; id: string }; + payload: T; +} + +export interface ActivityEventPayload { + kind: string; + text: string; + clientId?: string; + jobId?: string; + timestampUtc: string; +} + +export interface JobOutputPayload { + jobId: string; + clientId: string; + sequence: number; + stream: OutputStreamKind; + timestampUtc: string; + text: string; +} + +export interface JobProgressPayload { + jobId: string; + clientId: string; + activity: string; + statusDescription?: string; + percentComplete?: number; + secondsRemaining?: number; + timestampUtc: string; +} + +export interface JobStatePayload { + jobId: string; + clientId: string; + state: JobState; + exitCode?: number; + timestampUtc: string; + message?: string; +} + +export interface ShellOutputPayload { + sessionId: string; + sequence: number; + dataBase64: string; +} + +export interface ShellStatePayload { + sessionId: string; + state: 'requested' | 'open' | 'closed' | 'failed'; + message?: string; +} diff --git a/src/WebUI/src/app.css b/src/WebUI/src/app.css deleted file mode 100644 index ad0cea6..0000000 --- a/src/WebUI/src/app.css +++ /dev/null @@ -1,343 +0,0 @@ -/* ── Design tokens ─────────────────────────────────────────────────── */ -:root { - --font-sans: - 'Segoe UI Variable', 'Segoe UI', system-ui, -apple-system, 'Inter', Roboto, sans-serif; - --font-mono: 'Cascadia Code', 'Cascadia Mono', Consolas, 'JetBrains Mono', monospace; - - --radius-sm: 6px; - --radius-md: 10px; - --radius-lg: 14px; - - --space-1: 4px; - --space-2: 8px; - --space-3: 12px; - --space-4: 16px; - --space-5: 24px; - --space-6: 32px; - - --bg: #f4f6fa; - --bg-elevated: #ffffff; - --surface: #ffffff; - --surface-muted: #eef1f6; - --border: #dde3ec; - --border-strong: #c3ccd9; - --text: #16202e; - --text-muted: #5b6a7f; - --text-faint: #8b98ab; - - --accent: #2563eb; - --accent-hover: #1d4fd7; - --accent-soft: #dbe7ff; - --accent-contrast: #ffffff; - - --success: #16a34a; - --success-soft: #d7f2e0; - --warning: #d97706; - --warning-soft: #fdeed3; - --danger: #dc2626; - --danger-soft: #fde3e3; - --info: #0891b2; - --info-soft: #d8f1f7; - - --shadow-sm: 0 1px 2px rgb(15 23 42 / 0.06); - --shadow-md: 0 4px 16px rgb(15 23 42 / 0.08); - - color-scheme: light; -} - -@media (prefers-color-scheme: dark) { - :root:not([data-theme='light']) { - --bg: #0d1420; - --bg-elevated: #131c2b; - --surface: #17212f; - --surface-muted: #1d2938; - --border: #263447; - --border-strong: #35465e; - --text: #e6ecf5; - --text-muted: #9aabc2; - --text-faint: #64748c; - - --accent: #4c8dff; - --accent-hover: #6ba1ff; - --accent-soft: #1b2f52; - --accent-contrast: #0b1220; - - --success: #34d27b; - --success-soft: #12331f; - --warning: #f5a623; - --warning-soft: #3a2a10; - --danger: #f26565; - --danger-soft: #3d1717; - --info: #38c3dd; - --info-soft: #10303a; - - --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4); - --shadow-md: 0 4px 18px rgb(0 0 0 / 0.45); - - color-scheme: dark; - } -} - -:root[data-theme='dark'] { - --bg: #0d1420; - --bg-elevated: #131c2b; - --surface: #17212f; - --surface-muted: #1d2938; - --border: #263447; - --border-strong: #35465e; - --text: #e6ecf5; - --text-muted: #9aabc2; - --text-faint: #64748c; - - --accent: #4c8dff; - --accent-hover: #6ba1ff; - --accent-soft: #1b2f52; - --accent-contrast: #0b1220; - - --success: #34d27b; - --success-soft: #12331f; - --warning: #f5a623; - --warning-soft: #3a2a10; - --danger: #f26565; - --danger-soft: #3d1717; - --info: #38c3dd; - --info-soft: #10303a; - - --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4); - --shadow-md: 0 4px 18px rgb(0 0 0 / 0.45); - - color-scheme: dark; -} - -/* ── Base ──────────────────────────────────────────────────────────── */ -* { - box-sizing: border-box; -} - -html, -body { - margin: 0; - padding: 0; - height: 100%; -} - -body { - font-family: var(--font-sans); - font-size: 14px; - line-height: 1.5; - background: var(--bg); - color: var(--text); - -webkit-font-smoothing: antialiased; -} - -h1, -h2, -h3 { - margin: 0; - font-weight: 600; - letter-spacing: -0.01em; -} - -h1 { - font-size: 20px; -} - -h2 { - font-size: 16px; -} - -h3 { - font-size: 13px; - text-transform: uppercase; - letter-spacing: 0.06em; - color: var(--text-muted); - font-weight: 600; -} - -a { - color: var(--accent); - text-decoration: none; -} - -a:hover { - text-decoration: underline; -} - -code, -pre { - font-family: var(--font-mono); - font-size: 12.5px; -} - -button { - font-family: inherit; -} - -:focus-visible { - outline: 2px solid var(--accent); - outline-offset: 2px; - border-radius: var(--radius-sm); -} - -/* ── Shared primitives ─────────────────────────────────────────────── */ -.card { - background: var(--surface); - border: 1px solid var(--border); - border-radius: var(--radius-md); - box-shadow: var(--shadow-sm); -} - -.btn { - display: inline-flex; - align-items: center; - gap: var(--space-2); - padding: 7px 14px; - border-radius: var(--radius-sm); - border: 1px solid var(--border-strong); - background: var(--surface); - color: var(--text); - font-size: 13px; - font-weight: 500; - cursor: pointer; - transition: - background 0.12s ease, - border-color 0.12s ease, - opacity 0.12s ease; -} - -.btn:hover:not(:disabled) { - background: var(--surface-muted); -} - -.btn:disabled { - opacity: 0.5; - cursor: not-allowed; -} - -.btn.primary { - background: var(--accent); - border-color: var(--accent); - color: var(--accent-contrast); -} - -.btn.primary:hover:not(:disabled) { - background: var(--accent-hover); -} - -.btn.danger { - color: var(--danger); - border-color: var(--danger); -} - -.input, -.select, -textarea.input { - padding: 7px 10px; - border-radius: var(--radius-sm); - border: 1px solid var(--border-strong); - background: var(--bg-elevated); - color: var(--text); - font-size: 13px; - font-family: inherit; -} - -.input:focus, -.select:focus { - outline: 2px solid var(--accent); - outline-offset: 0; - border-color: transparent; -} - -/* ── Tables ────────────────────────────────────────────────────────── */ -.table-wrap { - overflow: auto; - border-radius: var(--radius-md); -} - -table.data { - width: 100%; - border-collapse: collapse; - font-size: 13px; -} - -table.data thead th { - position: sticky; - top: 0; - z-index: 1; - background: var(--surface-muted); - color: var(--text-muted); - font-weight: 600; - font-size: 12px; - text-transform: uppercase; - letter-spacing: 0.05em; - text-align: left; - padding: 10px 14px; - border-bottom: 1px solid var(--border); - white-space: nowrap; -} - -table.data tbody td { - padding: 10px 14px; - border-bottom: 1px solid var(--border); - vertical-align: middle; -} - -table.data tbody tr { - transition: background 0.1s ease; -} - -table.data tbody tr:hover { - background: var(--surface-muted); -} - -table.data tbody tr.clickable { - cursor: pointer; -} - -/* ── Utility ───────────────────────────────────────────────────────── */ -.muted { - color: var(--text-muted); -} - -.faint { - color: var(--text-faint); -} - -.mono { - font-family: var(--font-mono); -} - -.skeleton { - background: linear-gradient( - 100deg, - var(--surface-muted) 40%, - var(--border) 50%, - var(--surface-muted) 60% - ); - background-size: 200% 100%; - animation: shimmer 1.4s infinite linear; - border-radius: var(--radius-sm); - color: transparent; - user-select: none; -} - -@keyframes shimmer { - to { - background-position: -200% 0; - } -} - -@keyframes pulse-in { - from { - opacity: 0; - transform: translateY(-3px); - } - to { - opacity: 1; - transform: none; - } -} - -.pulse-in { - animation: pulse-in 0.22s ease; -} diff --git a/src/WebUI/src/app.d.ts b/src/WebUI/src/app.d.ts deleted file mode 100644 index 0dea0d9..0000000 --- a/src/WebUI/src/app.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -// See https://svelte.dev/docs/kit/types#app.d.ts -// for information about these interfaces -declare global { - namespace App { - // interface Error {} - // interface Locals {} - // interface PageData {} - // interface PageState {} - // interface Platform {} - } -} - -export {}; diff --git a/src/WebUI/src/app.html b/src/WebUI/src/app.html deleted file mode 100644 index 0d4f5db..0000000 --- a/src/WebUI/src/app.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - %sveltekit.head% - - -
%sveltekit.body%
- - diff --git a/src/WebUI/src/assets/style.css b/src/WebUI/src/assets/style.css new file mode 100644 index 0000000..473a0f4 diff --git a/src/WebUI/src/components/@extended/Avatar.tsx b/src/WebUI/src/components/@extended/Avatar.tsx new file mode 100644 index 0000000..bc86fcd --- /dev/null +++ b/src/WebUI/src/components/@extended/Avatar.tsx @@ -0,0 +1,134 @@ +import { ReactNode } from 'react'; + +// material-ui +import { styled } from '@mui/material/styles'; +import MuiAvatar, { AvatarProps } from '@mui/material/Avatar'; + +// project imports +import getColors from 'utils/getColors'; + +// types +import { AvatarTypeProps, ColorProps, ExtendedStyleProps, SizeProps } from 'types/extended'; + +// ==============================|| AVATAR - COLOR STYLE ||============================== // + +interface AvatarStyleProps extends ExtendedStyleProps { + type?: AvatarTypeProps; +} + +function getColorStyle({ theme, color, type }: AvatarStyleProps) { + const colors = getColors(theme, color); + const { lighter, light, main, contrastText } = colors; + + switch (type) { + case 'filled': + return { + color: contrastText, + background: main + }; + case 'outlined': + return { + color: main, + border: '1px solid', + borderColor: main, + background: 'transparent' + }; + case 'combined': + return { + color: main, + border: '1px solid', + borderColor: light, + background: lighter + }; + default: + return { + color: main, + background: lighter + }; + } +} + +// ==============================|| AVATAR - SIZE STYLE ||============================== // + +function getSizeStyle(size?: SizeProps) { + switch (size) { + case 'badge': + return { + border: '2px solid', + fontSize: '0.675rem', + width: 20, + height: 20 + }; + case 'xs': + return { + fontSize: '0.75rem', + width: 24, + height: 24 + }; + case 'sm': + return { + fontSize: '0.875rem', + width: 32, + height: 32 + }; + case 'lg': + return { + fontSize: '1.2rem', + width: 52, + height: 52 + }; + case 'xl': + return { + fontSize: '1.5rem', + width: 64, + height: 64 + }; + case 'md': + default: + return { + fontSize: '1rem', + width: 40, + height: 40 + }; + } +} + +// ==============================|| STYLED - AVATAR ||============================== // + +interface StyleProps { + color: ColorProps; + type?: AvatarTypeProps; + size?: SizeProps; +} + +const AvatarStyle = styled(MuiAvatar, { shouldForwardProp: (prop) => prop !== 'color' && prop !== 'type' && prop !== 'size' })( + ({ theme, size, color, type }) => ({ + ...getSizeStyle(size), + ...getColorStyle({ theme, color, type }), + variants: [ + { + props: { size: 'badge' }, + style: { + borderColor: theme.vars.palette.background.default + } + } + ] + }) +); + +// ==============================|| EXTENDED - AVATAR ||============================== // + +interface Props extends AvatarProps { + color?: ColorProps; + children?: ReactNode | string; + type?: AvatarTypeProps; + size?: SizeProps; +} + +export default function Avatar({ children, color = 'primary', type, size = 'md', ...others }: Props) { + return ( + + {children} + + ); +} diff --git a/src/WebUI/src/components/@extended/Dot.tsx b/src/WebUI/src/components/@extended/Dot.tsx new file mode 100644 index 0000000..0399376 --- /dev/null +++ b/src/WebUI/src/components/@extended/Dot.tsx @@ -0,0 +1,32 @@ +// material-ui +import { useTheme } from '@mui/material/styles'; +import Box, { BoxProps } from '@mui/material/Box'; + +// project imports +import { ColorProps } from 'types/extended'; +import getColors from 'utils/getColors'; + +interface Props extends BoxProps { + color?: ColorProps; + size?: number; + variant?: string; +} + +export default function Dot({ color, size, variant, sx, ...rest }: Props) { + const theme = useTheme(); + const colors = getColors(theme, color || 'primary'); + const { main } = colors; + + return ( + + ); +} diff --git a/src/WebUI/src/components/@extended/IconButton.tsx b/src/WebUI/src/components/@extended/IconButton.tsx new file mode 100644 index 0000000..0a1ccfb --- /dev/null +++ b/src/WebUI/src/components/@extended/IconButton.tsx @@ -0,0 +1,192 @@ +import { ReactNode } from 'react'; + +// material-ui +import { styled } from '@mui/material/styles'; +import MuiIconButton, { IconButtonProps } from '@mui/material/IconButton'; + +// project imports +import getColors from 'utils/getColors'; +import getShadow from 'utils/getShadow'; +import { withAlpha } from 'utils/colorUtils'; + +// types +import { ButtonVariantProps, ExtendedStyleProps, IconButtonShapeProps } from 'types/extended'; + +// ==============================|| ICON BUTTON - COLOR STYLE ||============================== // + +interface IconButtonStyleProps extends ExtendedStyleProps { + variant?: ButtonVariantProps; +} + +function getColorStyle({ variant, theme, color }: IconButtonStyleProps) { + const colors = getColors(theme, color); + const { lighter, light, dark, main, contrastText } = colors; + + const buttonShadow = `${color}Button`; + const shadows = getShadow(theme, buttonShadow); + + const commonShadow = { + '&::after': { + boxShadow: `0 0 6px 6px ${withAlpha(main, 0.9)}` + }, + '&:active::after': { + boxShadow: `0 0 0 0 ${withAlpha(main, 0.9)}` + }, + '&:focus-visible': { + outline: `2px solid ${dark}`, + outlineOffset: 2 + } + }; + + switch (variant) { + case 'contained': + return { + color: contrastText, + background: main, + '&:hover': { + background: dark + }, + ...commonShadow + }; + case 'light': + return { + color: main, + background: lighter, + '&:hover': { + background: withAlpha(light, 0.5) + }, + ...commonShadow + }; + case 'shadow': + return { + boxShadow: shadows, + color: contrastText, + background: main, + '&:hover': { + boxShadow: 'none', + background: dark + }, + ...commonShadow + }; + case 'outlined': + return { + '&:hover': { + background: 'transparent', + color: dark, + borderColor: dark + }, + ...commonShadow + }; + case 'dashed': + return { + background: lighter, + '&:hover': { + color: dark, + borderColor: dark + }, + ...commonShadow + }; + case 'text': + default: + return { + '&:hover': { + color: dark, + background: color === 'secondary' ? withAlpha(light, 0.1) : lighter + }, + ...commonShadow + }; + } +} + +// ==============================|| STYLED - ICON BUTTON ||============================== // + +interface StyleProps extends Omit { + shape?: IconButtonShapeProps; +} + +const IconButtonStyle = styled(MuiIconButton, { shouldForwardProp: (prop) => prop !== 'variant' && prop !== 'shape' })( + ({ theme, color, variant }) => ({ + position: 'relative', + '::after': { + content: '""', + display: 'block', + position: 'absolute', + left: 0, + top: 0, + width: '100%', + height: '100%', + borderRadius: 4, + opacity: 0, + transition: 'all 0.5s' + }, + + ':active::after': { + position: 'absolute', + borderRadius: 4, + left: 0, + top: 0, + opacity: 1, + transition: '0s' + }, + + ...getColorStyle({ variant, theme, color }), + + variants: [ + { + props: { shape: 'rounded' }, + style: { + borderRadius: '50%', + '::after': { borderRadius: '50%' }, + ':active::after': { borderRadius: '50%' } + } + }, + { + props: { variant: 'outlined' }, + style: { + border: '1px solid', + borderColor: 'inherit' + } + }, + { + props: { variant: 'dashed' }, + style: { + border: '1px dashed', + borderColor: 'inherit' + } + }, + { + props: ({ variant }) => variant !== 'text', + style: { + '&.Mui-disabled': { + background: theme.vars.palette.grey[200], + '&:hover': { + background: theme.vars.palette.grey[200], + color: theme.vars.palette.grey[300], + borderColor: 'inherit' + } + } + } + } + ] + }) +); + +// ==============================|| EXTENDED - ICON BUTTON ||============================== // + +interface Props extends IconButtonProps { + shape?: IconButtonShapeProps; + variant?: ButtonVariantProps; + children: ReactNode; +} + +function IconButton({ variant = 'text', shape = 'square', children, color = 'primary', ref, ...others }: Props) { + return ( + + {children} + + ); +} + +IconButton.displayName = 'IconButton'; + +export default IconButton; diff --git a/src/WebUI/src/components/@extended/Transitions.tsx b/src/WebUI/src/components/@extended/Transitions.tsx new file mode 100644 index 0000000..af7ee38 --- /dev/null +++ b/src/WebUI/src/components/@extended/Transitions.tsx @@ -0,0 +1,113 @@ +import { ReactElement, Ref } from 'react'; + +// material-ui +import Collapse from '@mui/material/Collapse'; +import Fade from '@mui/material/Fade'; +import Grow from '@mui/material/Grow'; +import Slide from '@mui/material/Slide'; +import Zoom, { ZoomProps } from '@mui/material/Zoom'; +import Box from '@mui/material/Box'; + +// ==============================|| TRANSITIONS ||============================== // + +interface Props { + children?: ReactElement; + position?: string; + in?: boolean; + type?: string; + direction?: 'up' | 'right' | 'left' | 'down'; + [others: string]: any; +} + +export default function Transitions({ children, position = 'top-left', type = 'grow', direction = 'up', ref, ...others }: Props) { + let positionSX = { + transformOrigin: '0 0 0' + }; + + switch (position) { + case 'top-right': + positionSX = { + transformOrigin: 'top right' + }; + break; + case 'top': + positionSX = { + transformOrigin: 'top' + }; + break; + case 'bottom-left': + positionSX = { + transformOrigin: 'bottom left' + }; + break; + case 'bottom-right': + positionSX = { + transformOrigin: 'bottom right' + }; + break; + case 'bottom': + positionSX = { + transformOrigin: 'bottom' + }; + break; + case 'top-left': + default: + positionSX = { + transformOrigin: '0 0 0' + }; + break; + } + + return ( + + {type === 'grow' && ( + + {children} + + )} + + {type === 'collapse' && ( + + {children} + + )} + + {type === 'fade' && ( + + {children} + + )} + + {type === 'slide' && ( + + {children} + + )} + + {type === 'zoom' && ( + + {children} + + )} + + ); +} + +export function PopupTransition({ ref, ...props }: ZoomProps & { ref?: Ref }) { + return ; +} diff --git a/src/WebUI/src/components/ActionMenu.tsx b/src/WebUI/src/components/ActionMenu.tsx new file mode 100644 index 0000000..4961ab6 --- /dev/null +++ b/src/WebUI/src/components/ActionMenu.tsx @@ -0,0 +1,96 @@ +import { ReactNode } from 'react'; + +// material-ui +import Divider from '@mui/material/Divider'; +import ListItemIcon from '@mui/material/ListItemIcon'; +import ListItemText from '@mui/material/ListItemText'; +import ListSubheader from '@mui/material/ListSubheader'; +import Menu from '@mui/material/Menu'; +import MenuItem from '@mui/material/MenuItem'; +import Tooltip from '@mui/material/Tooltip'; + +/** + * A menu described as data, so who-may-do-what lives in pure functions and + * one renderer serves row "…" menus, bulk Actions and tree context menus. + */ +export type MenuEntry = + | { + kind: 'item'; + id: string; + label: string; + icon?: ReactNode; + /** Greyed out but still focusable, explaining itself on hover. */ + disabledReason?: string; + destructive?: boolean; + onSelect: () => void; + } + | { kind: 'divider' } + | { kind: 'header'; label: string }; + +interface Props { + entries: MenuEntry[]; + onClose: () => void; + /** Anchor to an element (a "…" button) … */ + anchorEl?: HTMLElement | null; + /** … or to a point (a right-click). */ + anchorPosition?: { top: number; left: number } | null; +} + +// ==============================|| ACTION MENU ||============================== // + +export default function ActionMenu({ entries, onClose, anchorEl, anchorPosition }: Props) { + const open = Boolean(anchorEl || anchorPosition); + + return ( + event.stopPropagation()} + > + {entries.map((entry, index) => { + if (entry.kind === 'divider') return ; + if (entry.kind === 'header') { + return ( + + {entry.label} + + ); + } + + const disabled = Boolean(entry.disabledReason); + const item = ( + { + if (disabled) return; + onClose(); + entry.onSelect(); + }} + sx={{ + color: entry.destructive && !disabled ? 'error.main' : undefined, + ...(disabled && { opacity: 0.5, cursor: 'default', '&:hover': { bgcolor: 'transparent' } }) + }} + > + {entry.icon && {entry.icon}} + {entry.label} + + ); + + return disabled ? ( + + {item} + + ) : ( + item + ); + })} + + ); +} diff --git a/src/WebUI/src/components/ConfirmDialog.tsx b/src/WebUI/src/components/ConfirmDialog.tsx new file mode 100644 index 0000000..8445040 --- /dev/null +++ b/src/WebUI/src/components/ConfirmDialog.tsx @@ -0,0 +1,94 @@ +import { ReactNode, useState } from 'react'; + +// material-ui +import Alert from '@mui/material/Alert'; +import Button from '@mui/material/Button'; +import Dialog from '@mui/material/Dialog'; +import DialogActions from '@mui/material/DialogActions'; +import DialogContent from '@mui/material/DialogContent'; +import DialogTitle from '@mui/material/DialogTitle'; +import Typography from '@mui/material/Typography'; + +// project imports +import { errorMessage } from 'api/client'; + +interface Props { + open: boolean; + title: string; + /** One line on what happens. */ + message?: ReactNode; + confirmLabel?: string; + destructive?: boolean; + /** Disables Confirm (e.g. while a form inside is invalid). */ + confirmDisabled?: boolean; + maxWidth?: 'xs' | 'sm' | 'md' | 'lg'; + /** Runs on Confirm; the dialog stays open showing the error if it throws. */ + onConfirm: () => Promise | unknown; + onClose: () => void; + children?: ReactNode; +} + +// ==============================|| CONFIRM DIALOG ||============================== // + +export default function ConfirmDialog({ + open, + title, + message, + confirmLabel = 'Confirm', + destructive, + confirmDisabled, + maxWidth = 'xs', + onConfirm, + onClose, + children +}: Props) { + const [busy, setBusy] = useState(false); + const [error, setError] = useState(''); + + const close = () => { + if (busy) return; + setError(''); + onClose(); + }; + + const confirm = async () => { + setBusy(true); + setError(''); + try { + await onConfirm(); + setBusy(false); + onClose(); + } catch (e) { + setBusy(false); + setError(errorMessage(e)); + } + }; + + return ( + + {title} + + {message && ( + + {message} + + )} + {children} + {error && ( + + {error} + + )} + + + {/* Focus starts on Cancel so Enter never confirms by accident. */} + + + + + ); +} diff --git a/src/WebUI/src/components/CopyButton.tsx b/src/WebUI/src/components/CopyButton.tsx new file mode 100644 index 0000000..c32ae1d --- /dev/null +++ b/src/WebUI/src/components/CopyButton.tsx @@ -0,0 +1,36 @@ +import { MouseEvent, useState } from 'react'; + +// material-ui +import Tooltip from '@mui/material/Tooltip'; + +// project imports +import IconButton from 'components/@extended/IconButton'; + +// assets +import CheckOutlined from '@ant-design/icons/CheckOutlined'; +import CopyOutlined from '@ant-design/icons/CopyOutlined'; + +// ==============================|| COPY BUTTON ||============================== // + +export default function CopyButton({ value, label = 'Copy' }: { value: string; label?: string }) { + const [copied, setCopied] = useState(false); + + const copy = async (event: MouseEvent) => { + event.stopPropagation(); + try { + await navigator.clipboard.writeText(value); + setCopied(true); + window.setTimeout(() => setCopied(false), 1500); + } catch { + // Clipboard blocked (insecure context); nothing sensible to do. + } + }; + + return ( + + + {copied ? : } + + + ); +} diff --git a/src/WebUI/src/components/DataTable.tsx b/src/WebUI/src/components/DataTable.tsx new file mode 100644 index 0000000..e6be3d5 --- /dev/null +++ b/src/WebUI/src/components/DataTable.tsx @@ -0,0 +1,246 @@ +import { ReactNode, useEffect, useMemo, useState } from 'react'; + +// material-ui +import Alert from '@mui/material/Alert'; +import Box from '@mui/material/Box'; +import Checkbox from '@mui/material/Checkbox'; +import LinearProgress from '@mui/material/LinearProgress'; +import Skeleton from '@mui/material/Skeleton'; +import Table from '@mui/material/Table'; +import TableBody from '@mui/material/TableBody'; +import TableCell from '@mui/material/TableCell'; +import TableContainer from '@mui/material/TableContainer'; +import TableHead from '@mui/material/TableHead'; +import TablePagination from '@mui/material/TablePagination'; +import TableRow from '@mui/material/TableRow'; +import TableSortLabel from '@mui/material/TableSortLabel'; + +// project imports +import HoverHelp from 'components/HoverHelp'; + +export interface Column { + id: string; + header: ReactNode; + cell: (row: T) => ReactNode; + /** Value for sorting; columns without one are not sortable. */ + sortValue?: (row: T) => string | number | boolean | null | undefined; + width?: number | string; + align?: 'left' | 'right' | 'center'; + nowrap?: boolean; + help?: ReactNode; +} + +export interface Selection { + selected: ReadonlySet; + /** Called with the affected row ids and whether they are now chosen. */ + onChange: (ids: string[], on: boolean) => void; +} + +interface Props { + columns: Column[]; + rows: T[] | undefined; + rowId: (row: T) => string; + /** First load (skeleton rows) vs. background refresh (thin bar). */ + loading?: boolean; + refreshing?: boolean; + error?: string; + empty?: ReactNode; + onRowClick?: (row: T) => void; + selection?: Selection; + /** Filters and bulk actions, above the header row. */ + toolbar?: ReactNode; + defaultSort?: { id: string; direction: 'asc' | 'desc' }; + pageSize?: number; + /** Turn off paging for short, bounded lists. */ + paged?: boolean; + dense?: boolean; + /** Accessible name for the row checkboxes ("Choose WS-042"). */ + rowLabel?: (row: T) => string; + /** Marks the row currently open in a side panel. */ + activeRowId?: string; + minWidth?: number; +} + +const collator = new Intl.Collator(undefined, { numeric: true, sensitivity: 'base' }); + +function compare(a: unknown, b: unknown): number { + if (a == null && b == null) return 0; + if (a == null) return 1; + if (b == null) return -1; + if (typeof a === 'number' && typeof b === 'number') return a - b; + if (typeof a === 'boolean' && typeof b === 'boolean') return Number(a) - Number(b); + return collator.compare(String(a), String(b)); +} + +// ==============================|| DATA TABLE ||============================== // + +export default function DataTable({ + columns, + rows, + rowId, + loading, + refreshing, + error, + empty, + onRowClick, + selection, + toolbar, + defaultSort, + pageSize = 50, + paged = true, + dense = true, + rowLabel, + activeRowId, + minWidth = 720 +}: Props) { + const [sort, setSort] = useState(defaultSort); + const [page, setPage] = useState(0); + const [perPage, setPerPage] = useState(pageSize); + + const sorted = useMemo(() => { + const list = rows ?? []; + const column = sort && columns.find((c) => c.id === sort.id); + if (!column?.sortValue) return list; + const factor = sort!.direction === 'asc' ? 1 : -1; + return [...list].sort((a, b) => factor * compare(column.sortValue!(a), column.sortValue!(b))); + }, [rows, columns, sort]); + + // A filter that shrinks the list must not strand the view on an empty page. + const pageCount = Math.max(1, Math.ceil(sorted.length / perPage)); + useEffect(() => { + if (page > pageCount - 1) setPage(pageCount - 1); + }, [page, pageCount]); + + const visible = paged ? sorted.slice(page * perPage, page * perPage + perPage) : sorted; + + const allIds = useMemo(() => sorted.map(rowId), [sorted, rowId]); + const chosen = selection ? allIds.filter((id) => selection.selected.has(id)).length : 0; + + const toggleSort = (id: string) => { + setSort((current) => { + if (!current || current.id !== id) return { id, direction: 'asc' }; + if (current.direction === 'asc') return { id, direction: 'desc' }; + return defaultSort; // third click returns to the default order + }); + }; + + const colSpan = columns.length + (selection ? 1 : 0); + + return ( + + {toolbar && {toolbar}} + {refreshing && !loading && } + + + + + {selection && ( + + 0 && chosen < allIds.length} + checked={allIds.length > 0 && chosen === allIds.length} + onChange={(e) => selection.onChange(allIds, e.target.checked)} + slotProps={{ input: { 'aria-label': `Choose all ${allIds.length} rows` } }} + /> + + )} + {columns.map((column) => ( + + {column.sortValue ? ( + toggleSort(column.id)} + > + {column.header} + + ) : ( + column.header + )} + {column.help && } + + ))} + + + + {loading && + Array.from({ length: 6 }, (_, i) => ( + + {Array.from({ length: colSpan }, (_, j) => ( + + + + ))} + + ))} + {!loading && error && ( + + + {error} + + + )} + {!loading && !error && sorted.length === 0 && ( + + + {empty} + + + )} + {!loading && + !error && + visible.map((row) => { + const id = rowId(row); + const isChosen = selection?.selected.has(id) ?? false; + return ( + onRowClick(row) : undefined} + sx={{ cursor: onRowClick ? 'pointer' : 'default' }} + > + {selection && ( + e.stopPropagation()}> + selection.onChange([id], e.target.checked)} + slotProps={{ input: { 'aria-label': rowLabel ? `Choose ${rowLabel(row)}` : 'Choose row' } }} + /> + + )} + {columns.map((column) => ( + + {column.cell(row)} + + ))} + + ); + })} + +
+
+ {paged && !loading && sorted.length > perPage && ( + setPage(next)} + rowsPerPage={perPage} + onRowsPerPageChange={(e) => { + setPerPage(parseInt(e.target.value, 10)); + setPage(0); + }} + rowsPerPageOptions={[25, 50, 100, 250]} + /> + )} +
+ ); +} diff --git a/src/WebUI/src/components/DateTime.tsx b/src/WebUI/src/components/DateTime.tsx new file mode 100644 index 0000000..834fa66 --- /dev/null +++ b/src/WebUI/src/components/DateTime.tsx @@ -0,0 +1,43 @@ +// material-ui +import Tooltip from '@mui/material/Tooltip'; +import Typography, { TypographyProps } from '@mui/material/Typography'; + +// project imports +import useNow from 'hooks/useNow'; +import { formatAbsolute, formatRelative } from 'utils/format'; + +interface Props { + value?: string | null; + /** Shown when there is no value. */ + empty?: string; + variant?: TypographyProps['variant']; + color?: TypographyProps['color']; +} + +// ==============================|| DATE TIME (RELATIVE, ABSOLUTE ON HOVER) ||============================== // + +export function RelativeTime({ value, empty = '—', variant = 'body2', color }: Props) { + const now = useNow(); + if (!value) { + return ( + + {empty} + + ); + } + return ( + + + {formatRelative(value, now)} + + + ); +} + +export function AbsoluteTime({ value, empty = '—', variant = 'body2', color }: Props) { + return ( + + {value ? formatAbsolute(value) : empty} + + ); +} diff --git a/src/WebUI/src/components/EmptyState.tsx b/src/WebUI/src/components/EmptyState.tsx new file mode 100644 index 0000000..64094e2 --- /dev/null +++ b/src/WebUI/src/components/EmptyState.tsx @@ -0,0 +1,36 @@ +import { ReactNode } from 'react'; + +// material-ui +import Box from '@mui/material/Box'; +import Stack from '@mui/material/Stack'; +import Typography from '@mui/material/Typography'; + +// assets +import InboxOutlined from '@ant-design/icons/InboxOutlined'; + +interface Props { + title: string; + detail?: ReactNode; + icon?: ReactNode; + action?: ReactNode; + dense?: boolean; +} + +// ==============================|| EMPTY STATE ||============================== // + +export default function EmptyState({ title, detail, icon, action, dense }: Props) { + return ( + + {icon ?? } + + {title} + + {detail && ( + + {detail} + + )} + {action && {action}} + + ); +} diff --git a/src/WebUI/src/components/GatedButton.tsx b/src/WebUI/src/components/GatedButton.tsx new file mode 100644 index 0000000..dbb4aa4 --- /dev/null +++ b/src/WebUI/src/components/GatedButton.tsx @@ -0,0 +1,21 @@ +// material-ui +import Button, { ButtonProps } from '@mui/material/Button'; +import Tooltip from '@mui/material/Tooltip'; + +interface Props extends ButtonProps { + /** Why the button cannot be used; it stays visible, disabled, and explains on hover. */ + gate?: string; +} + +// ==============================|| GATED BUTTON ||============================== // + +export default function GatedButton({ gate, disabled, ...props }: Props) { + if (!gate) return - - -
- {#each platforms as p (p.id)} - - {/each} -
- -
- - - {#if scope === 'multi'} -
- - uses - -
- {/if} - {#if scope === 'multi'} - - {/if} -
- - {#if errorText} -

{errorText}

- {/if} - - {#if command} -
- -
- {#if platform === 'windows' && !busy} -

- Ensure that this command is executed from an elevated PowerShell terminal. -

- {/if} -

- {#if busy}Updating the token…{:else} - {shellHint} The token {noExpiry ? 'never expires' : 'expires in 24 hours'}; the agent - downloads from this server, installs as a - {platform === 'windows' ? 'Windows service' : platform === 'linux' ? 'systemd unit' : 'launchd daemon'} - and enrolls automatically. - {/if} -

- {:else} -

- Generating issues a bootstrap token ({scope === 'single' - ? 'one use' - : unlimited - ? 'unlimited uses' - : `up to ${effectiveUses} use${effectiveUses === 1 ? '' : 's'}`}, - {noExpiry ? 'no expiry' : '24-hour expiry'}) and builds the paste-ready install command - for the selected platform. -

- {/if} - -
- - {#if command} - - {:else} - - {/if} -
- - - - diff --git a/src/WebUI/src/lib/components/AuthSettings.svelte b/src/WebUI/src/lib/components/AuthSettings.svelte deleted file mode 100644 index 8301f94..0000000 --- a/src/WebUI/src/lib/components/AuthSettings.svelte +++ /dev/null @@ -1,379 +0,0 @@ - - -
-

Authentication

- - {#if settings?.forcedLocalByEnvironment} - - {/if} - - {#if !settings} -
loading…
- {:else} -
- Sign-in page -
- {#each modes as mode (mode.value)} - - {/each} -
- {#if ssoModeChosen && !settings.oidcEnabled} -

Enable and configure OIDC below, or saving will be rejected.

- {/if} -
- - - -
- - - - - - - -
- -
- Redirect URI to register at your provider: - {settings.redirectUri} - -
-

- This path is fixed. It must match the provider registration exactly, and letting it drift is - a common cause of sign-in failures with no clear error. -

- -

Group to role mapping

-

- Values from the group/role claim above. The first match wins, checked Admin → Operator → - Viewer. -

-
- - - - -
- - -
- - - {#if statusText}{statusText}{/if} -
- - {#if test} -
    - {#each test.steps as step (step.name)} -
  • - {step.ok ? '✔' : '✕'} - {step.name} - {step.detail ?? ''} -
  • - {/each} -
- {/if} - - - {/if} -
- - diff --git a/src/WebUI/src/lib/components/ConnectionIndicator.svelte b/src/WebUI/src/lib/components/ConnectionIndicator.svelte deleted file mode 100644 index 130335a..0000000 --- a/src/WebUI/src/lib/components/ConnectionIndicator.svelte +++ /dev/null @@ -1,56 +0,0 @@ - - - - - {labels[$live]} - - - diff --git a/src/WebUI/src/lib/components/CopyChip.svelte b/src/WebUI/src/lib/components/CopyChip.svelte deleted file mode 100644 index 4287b7f..0000000 --- a/src/WebUI/src/lib/components/CopyChip.svelte +++ /dev/null @@ -1,86 +0,0 @@ - - - - - diff --git a/src/WebUI/src/lib/components/EmptyState.svelte b/src/WebUI/src/lib/components/EmptyState.svelte deleted file mode 100644 index 1068862..0000000 --- a/src/WebUI/src/lib/components/EmptyState.svelte +++ /dev/null @@ -1,51 +0,0 @@ - - -
- -
{title}
- {#if detail} -
{detail}
- {/if} - {#if children} -
{@render children()}
- {/if} -
- - diff --git a/src/WebUI/src/lib/components/FileBindingsEditor.svelte b/src/WebUI/src/lib/components/FileBindingsEditor.svelte deleted file mode 100644 index 1f9fb73..0000000 --- a/src/WebUI/src/lib/components/FileBindingsEditor.svelte +++ /dev/null @@ -1,109 +0,0 @@ - - -

- Downloaded to the device before the script runs. Destinations expand on the device - (%TEMP%, $env:ProgramData, $(…)) and each entry reaches - the script as $Files.Name — a FileInfo, or a DirectoryInfo when the S3 key is a - prefix delivered recursively. Requires S3 (Settings → File delivery). -

- -{#each bindings as binding, i (i)} -
- - - - - - -
- {#if binding.directory && looksLikeFile(binding.destinationPath)} -

- A directory delivery unpacks into the destination — give a directory, not a file path. -

- {/if} -{/each} - - - - diff --git a/src/WebUI/src/lib/components/JobStateBadge.svelte b/src/WebUI/src/lib/components/JobStateBadge.svelte deleted file mode 100644 index 56060c0..0000000 --- a/src/WebUI/src/lib/components/JobStateBadge.svelte +++ /dev/null @@ -1,68 +0,0 @@ - - -{entry.label} - - diff --git a/src/WebUI/src/lib/components/OsIcon.svelte b/src/WebUI/src/lib/components/OsIcon.svelte deleted file mode 100644 index aa1e1d2..0000000 --- a/src/WebUI/src/lib/components/OsIcon.svelte +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - {#if platform === 'windows'} - - {:else if platform === 'macos'} - - {:else if platform === 'linux'} - - - {:else} - - {/if} - - - diff --git a/src/WebUI/src/lib/components/ParameterInputs.svelte b/src/WebUI/src/lib/components/ParameterInputs.svelte deleted file mode 100644 index 1548082..0000000 --- a/src/WebUI/src/lib/components/ParameterInputs.svelte +++ /dev/null @@ -1,268 +0,0 @@ - - -{#if parameters.length > 0} -
- {#each parameters as p (p.name)} -
- - {#if p.description}
{p.description}
{/if} - - {#if p.type === 'boolean'} - - {:else if p.type === 'number'} - - {:else if p.type === 'string'} - - {:else if p.type === 'array'} -
- {#each arrays[p.name] ?? [] as _, i (i)} -
- {#if p.elementType === 'boolean'} - - {:else} - - {/if} - -
- {/each} - -
- {:else if p.type === 'hashtable'} -
- {#each hashes[p.name] ?? [] as _, i (i)} -
- - {#if hashes[p.name][i].keyType === 'boolean'} - - {:else} - - {/if} - = - - {#if hashes[p.name][i].valueType === 'boolean'} - - {:else} - - {/if} - -
- {/each} - -
- {/if} -
- {/each} -
-{/if} - - diff --git a/src/WebUI/src/lib/components/ParameterSchemaEditor.svelte b/src/WebUI/src/lib/components/ParameterSchemaEditor.svelte deleted file mode 100644 index c71869e..0000000 --- a/src/WebUI/src/lib/components/ParameterSchemaEditor.svelte +++ /dev/null @@ -1,170 +0,0 @@ - - -
- {#if parameters.length === 0} -

No parameters yet. Each parameter becomes a typed input when the script runs.

- {:else} -
- Name - Type - Items - Description - - Literal - - Req. - -
- {#each parameters as param, i (i)} -
- - - -
- {#if param.type === 'array'} - - {:else if param.type === 'hashtable'} - - typed per entry - - {:else} - — - {/if} -
- - - {#if canExpand(param)} - - {:else} - — - {/if} - - -
- {/each} - {/if} - -
- -
-
- - diff --git a/src/WebUI/src/lib/components/RelativeTime.svelte b/src/WebUI/src/lib/components/RelativeTime.svelte deleted file mode 100644 index 70b243b..0000000 --- a/src/WebUI/src/lib/components/RelativeTime.svelte +++ /dev/null @@ -1,27 +0,0 @@ - - -{text} diff --git a/src/WebUI/src/lib/components/RuleBuilder.svelte b/src/WebUI/src/lib/components/RuleBuilder.svelte deleted file mode 100644 index f9e0741..0000000 --- a/src/WebUI/src/lib/components/RuleBuilder.svelte +++ /dev/null @@ -1,229 +0,0 @@ - - -
-
- Match - -
- -
- - {#if (rules.groups ?? []).length === 0} -

- No condition groups yet. A dynamic group with no rules matches no devices. -

- {:else} - {#each rules.groups ?? [] as group, gi (gi)} -
-
- Group {gi + 1} - - -
- - -
- - {#each group.conditions ?? [] as condition, ci (ci)} -
- - - - - {#if needsValue(condition.operator)} - - {:else} - - {/if} - - - -
- {/each} - - {#if (group.conditions ?? []).length === 0} -

No conditions — this group matches nothing.

- {/if} -
- {/each} - {/if} -
- - diff --git a/src/WebUI/src/lib/components/S3Settings.svelte b/src/WebUI/src/lib/components/S3Settings.svelte deleted file mode 100644 index b36c03c..0000000 --- a/src/WebUI/src/lib/components/S3Settings.svelte +++ /dev/null @@ -1,347 +0,0 @@ - - -
-

Object storage (S3)

-

- Used for pushing files to devices and, optionally, for serving the agent installer. Any - S3-compatible store works — AWS S3, MinIO, Backblaze B2. - {#if settings?.fromEnvironment} -
Environment variables provide the current defaults; saving here overrides them. - {/if} -

- - {#if !settings} -
loading…
- {:else} -
- - - - - - - - -
- -
- - - {#if statusText}{statusText}{/if} - {#if settings.lastTestUtc} - Last successful test {new Date(settings.lastTestUtc).toLocaleString()} - {/if} -
- - {#if test} -
    - {#each test.steps as step (step.name)} -
  • - {step.ok ? '✔' : '✕'} - {step.name} - {step.detail ?? ''} -
  • - {/each} -
- {/if} - {/if} -
- -
-

Agent installer delivery

-

- CI bakes the built installer into the backend image, so the URL install command works without - seeding anything. With S3 configured you can optionally offload it, and installs are redirected - to a presigned URL instead of streaming through the control plane. -

- - {#if !agent} -
loading…
- {:else} -
-
Status
-
- {#if agent.available} - Available - {:else} - Missing - {/if} - {sourceLabel[agent.source] ?? agent.source} -
-
File
-
{agent.fileName ?? '—'}{sizeMb ? ` · ${sizeMb} MB` : ''}
-
Version
-
{agent.version ?? '—'}
-
SHA-256
-
{agent.sha256 ?? '—'}
-
- - {#if !agent.available} -

- No installer present. It ships in images built by CI; for a local build run - scripts/Package-Agent.ps1 and mount the output at /data/agent. -

- {/if} - -
- - - {#if agent.offloadUploaded}Uploaded{/if} -
-

- Enabling the toggle takes effect after Save. Uploads are skipped when the same build is - already in the bucket. -

- {/if} -
- - diff --git a/src/WebUI/src/lib/components/ScheduleCadenceEditor.svelte b/src/WebUI/src/lib/components/ScheduleCadenceEditor.svelte deleted file mode 100644 index 5ad4ec2..0000000 --- a/src/WebUI/src/lib/components/ScheduleCadenceEditor.svelte +++ /dev/null @@ -1,287 +0,0 @@ - - - - -
- - - {#if freq === 'minutes' || freq === 'hours'} - - {:else if freq === 'daily' || freq === 'weekly' || freq === 'monthly'} - - {#if freq === 'weekly'} -
- {#each allDays as day (day)} - - {/each} -
- {:else if freq === 'monthly'} - - {/if} - {:else if freq === 'once'} - - {:else if freq === 'cron'} - - {/if} - - {#if freq !== 'once'} - - {/if} - -
- {description} -
-
- - diff --git a/src/WebUI/src/lib/components/SecretBindingsEditor.svelte b/src/WebUI/src/lib/components/SecretBindingsEditor.svelte deleted file mode 100644 index 849dd7f..0000000 --- a/src/WebUI/src/lib/components/SecretBindingsEditor.svelte +++ /dev/null @@ -1,310 +0,0 @@ - - -
- {#if providers.length === 0} -

- No secrets providers configured. Add one under Settings → Secrets providers first. -

- {:else} -
- -

- The server fetches each value at run time and injects them, in order, as a - case-insensitive dictionary: use ${effectiveVar}.{bindings[0]?.name || 'SecretName'} - anywhere in the script. Devices never contact the vault. -

-
- - {#if bindings.length > 0} -
- Key (${effectiveVar}.…) - Provider - Path - Secret - -
- {#each bindings as binding, i (i)} - {@const path = effectivePath(binding)} - {@const key = cacheKey(binding.providerId, path)} - {@const root = defaultPath(binding.providerId)} - {@const parent = parentOf(path, root)} - {@const listed = names[key]} - {@const failed = key in loadErrors} -
- - - - - - - {#if manual[i] || failed || (listed && listed.length === 0)} - - {#if listed && listed.length > 0} - - {/if} - {:else} - - - {/if} - - - -
- {#if failed} -

- Listing failed ({loadErrors[key]}) — type the path and secret name manually. -

- {/if} - {/each} - {/if} - -
- -
- {/if} -
- - diff --git a/src/WebUI/src/lib/components/SecretsProviders.svelte b/src/WebUI/src/lib/components/SecretsProviders.svelte deleted file mode 100644 index 997aeef..0000000 --- a/src/WebUI/src/lib/components/SecretsProviders.svelte +++ /dev/null @@ -1,364 +0,0 @@ - - -
-
-

Secrets providers

- {#if !formOpen} - - {/if} -
-

- External vaults scripts can pull secrets from. The server fetches values at dispatch time and - injects them as a dictionary variable (default $Secrets) — devices and browsers - never talk to the vault, and connection details are encrypted at rest. -

- - {#if providers.length === 0 && !formOpen} -

No providers configured.

- {:else if providers.length > 0} -
- - - - - - - - - - - - {#each providers as provider (provider.id)} - - - - - - - - {#if rowTests[provider.id]} - {@const rowTest = rowTests[provider.id]} - - - - {/if} - {/each} - -
NameKindCredentialsUpdated
{provider.name} - {kinds.find((k) => k.kind === provider.kind)?.displayName ?? provider.kind} - - {#if provider.secretFieldsSet.length > 0} - stored - {:else} - missing - {/if} - {new Date(provider.updatedUtc).toLocaleString()} - - - -
-
    - {#each rowTest?.steps ?? [] as step (step.name)} -
  • - {step.ok ? '✔' : '✕'} - {step.name} - {step.detail ?? ''} -
  • - {/each} -
-
-
- {/if} - - {#if formOpen} -
-

{editing ? `Edit “${editing.name}”` : 'New provider'}

-
- - - {#each kindDef?.fields ?? [] as field (field.name)} - - {/each} -
- -
- - - - {#if statusText}{statusText}{/if} -
- - {#if test} -
    - {#each test.steps as step (step.name)} -
  • - {step.ok ? '✔' : '✕'} - {step.name} - {step.detail ?? ''} -
  • - {/each} -
- {/if} -
- {/if} -
- - diff --git a/src/WebUI/src/lib/components/StatusBadge.svelte b/src/WebUI/src/lib/components/StatusBadge.svelte deleted file mode 100644 index 7c18a5e..0000000 --- a/src/WebUI/src/lib/components/StatusBadge.svelte +++ /dev/null @@ -1,64 +0,0 @@ - - - - - {labels[status]} - - - diff --git a/src/WebUI/src/lib/components/TriggersCard.svelte b/src/WebUI/src/lib/components/TriggersCard.svelte deleted file mode 100644 index e394dfd..0000000 --- a/src/WebUI/src/lib/components/TriggersCard.svelte +++ /dev/null @@ -1,261 +0,0 @@ - - -
-

Triggers

-

- Run this script automatically — on registration, when the agent becomes ready, or on a schedule - — against a chosen target. Add as many as you like: the same script can run at different times on - different targets. -

- -
- - - {#if when === 'scheduled'} -
- Schedule - -
- {/if} - - - - -
- - {#if errorText}

{errorText}

{/if} - - {#if mine.length === 0} -

No triggers yet.

- {:else} -
    - {#each mine as trigger (trigger.id)} -
  • -
    - {whenLabel(trigger)} - → {targetLabel(trigger)} - {#if !trigger.enabled} - Disabled - {:else if trigger.triggerType === 'scheduled' && trigger.nextRunUtc} - · next {new Date(trigger.nextRunUtc).toLocaleString()} - {/if} - {#if trigger.lastResult}· {trigger.lastResult}{/if} -
    -
    - - -
    -
  • - {/each} -
- {/if} -
- - diff --git a/src/WebUI/src/lib/components/charts/BarList.svelte b/src/WebUI/src/lib/components/charts/BarList.svelte deleted file mode 100644 index 7f03876..0000000 --- a/src/WebUI/src/lib/components/charts/BarList.svelte +++ /dev/null @@ -1,82 +0,0 @@ - - -{#if items.length === 0} -

{emptyText}

-{:else} -
    - {#each items as item (item.label)} -
  • - {item.label} - - - - {item.count} -
  • - {/each} -
-{/if} - - diff --git a/src/WebUI/src/lib/components/charts/Donut.svelte b/src/WebUI/src/lib/components/charts/Donut.svelte deleted file mode 100644 index 92ac445..0000000 --- a/src/WebUI/src/lib/components/charts/Donut.svelte +++ /dev/null @@ -1,101 +0,0 @@ - - -
- - - - {#each arcs as arc (arc.label)} - - {/each} - - -
-
{centerValue}
-
{centerLabel}
-
-
- - diff --git a/src/WebUI/src/lib/components/charts/TimelineChart.svelte b/src/WebUI/src/lib/components/charts/TimelineChart.svelte deleted file mode 100644 index d473433..0000000 --- a/src/WebUI/src/lib/components/charts/TimelineChart.svelte +++ /dev/null @@ -1,93 +0,0 @@ - - -{#if total === 0} -

No executions in the last 14 days.

-{:else} - -
- {days[0]?.date} - {days[days.length - 1]?.date} -
-{/if} - - diff --git a/src/WebUI/src/lib/editor/powershell-completions.ts b/src/WebUI/src/lib/editor/powershell-completions.ts deleted file mode 100644 index 5880a42..0000000 --- a/src/WebUI/src/lib/editor/powershell-completions.ts +++ /dev/null @@ -1,274 +0,0 @@ -/** - * Lightweight PowerShell IntelliSense for the Monaco editor: a curated set of - * common cmdlets, language keywords, automatic variables and snippets, plus - * dynamic entries for the script's own parameters and secret bindings. No - * language server involved — fast, offline and optional. - */ - -/* eslint-disable @typescript-eslint/no-explicit-any */ - -const CMDLETS = [ - 'Get-ChildItem', - 'Get-Content', - 'Set-Content', - 'Add-Content', - 'Get-Item', - 'Get-ItemProperty', - 'Set-ItemProperty', - 'New-Item', - 'New-ItemProperty', - 'Remove-Item', - 'Copy-Item', - 'Move-Item', - 'Rename-Item', - 'Test-Path', - 'Join-Path', - 'Split-Path', - 'Resolve-Path', - 'Get-Location', - 'Set-Location', - 'Get-Process', - 'Stop-Process', - 'Start-Process', - 'Wait-Process', - 'Get-Service', - 'Start-Service', - 'Stop-Service', - 'Restart-Service', - 'Set-Service', - 'Get-CimInstance', - 'Invoke-CimMethod', - 'Get-Date', - 'Start-Sleep', - 'Write-Output', - 'Write-Host', - 'Write-Error', - 'Write-Warning', - 'Write-Verbose', - 'Write-Debug', - 'Write-Progress', - 'Read-Host', - 'Out-String', - 'Out-Null', - 'Out-File', - 'ForEach-Object', - 'Where-Object', - 'Select-Object', - 'Sort-Object', - 'Group-Object', - 'Measure-Object', - 'Compare-Object', - 'Select-String', - 'ConvertTo-Json', - 'ConvertFrom-Json', - 'ConvertTo-Csv', - 'ConvertFrom-Csv', - 'Export-Csv', - 'Import-Csv', - 'Invoke-RestMethod', - 'Invoke-WebRequest', - 'Invoke-Expression', - 'Invoke-Command', - 'Test-Connection', - 'Test-NetConnection', - 'Resolve-DnsName', - 'Get-NetIPAddress', - 'Get-NetAdapter', - 'Compress-Archive', - 'Expand-Archive', - 'Get-FileHash', - 'New-Guid', - 'Get-Random', - 'Get-WinEvent', - 'Get-EventLog', - 'Get-HotFix', - 'Get-ComputerInfo', - 'Restart-Computer', - 'Stop-Computer', - 'Get-LocalUser', - 'Get-LocalGroup', - 'Add-LocalGroupMember', - 'Get-ScheduledTask', - 'Register-ScheduledTask', - 'Unregister-ScheduledTask', - 'Get-Module', - 'Import-Module', - 'Install-PSResource', - 'Find-PSResource', - 'Start-ThreadJob', - 'Get-Job', - 'Receive-Job', - 'Wait-Job', - 'Remove-Job', - 'Get-Variable', - 'Set-Variable', - 'Get-Command', - 'Get-Member', - 'Get-Help', - 'Get-Error', - 'New-Object', - 'Add-Type', - 'Get-Acl', - 'Set-Acl', - 'ConvertTo-SecureString', - 'ConvertFrom-SecureString' -]; - -const KEYWORDS = [ - 'if', - 'elseif', - 'else', - 'switch', - 'foreach', - 'for', - 'while', - 'do', - 'until', - 'break', - 'continue', - 'return', - 'function', - 'param', - 'begin', - 'process', - 'end', - 'try', - 'catch', - 'finally', - 'throw', - 'trap', - 'class', - 'enum', - 'using', - 'in', - 'exit' -]; - -const AUTOMATIC_VARIABLES = [ - '$_', - '$PSItem', - '$args', - '$error', - '$LASTEXITCODE', - '$PSVersionTable', - '$PSScriptRoot', - '$env:COMPUTERNAME', - '$env:USERNAME', - '$env:TEMP', - '$env:ProgramFiles', - '$true', - '$false', - '$null', - '$ErrorActionPreference', - '$ProgressPreference' -]; - -const SNIPPETS: { label: string; detail: string; insert: string }[] = [ - { - label: 'param block', - detail: 'Script parameter declaration', - insert: 'param(\n [string]$${1:Name}${2:,\n [int]$${3:Count} = ${4:1}}\n)\n' - }, - { - label: 'try / catch', - detail: 'Error handling block', - insert: 'try {\n ${1}\n}\ncatch {\n Write-Error "${2:Operation failed}: $_"\n}\n' - }, - { - label: 'foreach loop', - detail: 'Iterate a collection', - insert: 'foreach ($${1:item} in $${2:collection}) {\n ${3}\n}\n' - }, - { - label: 'progress loop', - detail: 'Loop reporting Write-Progress', - insert: - '1..${1:10} | ForEach-Object {\n Write-Progress -Activity \'${2:Working}\' -Status "Step $_ of ${1:10}" -PercentComplete ($_ * ${3:10})\n ${4}\n}\n' - } -]; - -export interface CompletionContext { - /** Names of the script's declared parameters. */ - parameterNames: () => string[]; - /** Names bound in the secrets dictionary. */ - secretNames: () => string[]; - /** The secrets variable name (default "Secrets"). */ - secretsVariable: () => string; - /** Names bound in the $Files dictionary, with directory flags. */ - fileBindings?: () => { name: string; directory: boolean }[]; -} - -/** Registers the provider for the given language; returns its disposable. */ -export function registerPowerShellCompletions( - monaco: any, - language: string, - context: CompletionContext -): { dispose(): void } { - return monaco.languages.registerCompletionItemProvider(language, { - triggerCharacters: ['-', '$', '.'], - provideCompletionItems(model: any, position: any) { - const word = model.getWordUntilPosition(position); - const range = { - startLineNumber: position.lineNumber, - endLineNumber: position.lineNumber, - startColumn: word.startColumn, - endColumn: word.endColumn - }; - const kinds = monaco.languages.CompletionItemKind; - - const suggestions: any[] = [ - ...CMDLETS.map((c) => ({ - label: c, - kind: kinds.Function, - insertText: c, - range - })), - ...KEYWORDS.map((k) => ({ - label: k, - kind: kinds.Keyword, - insertText: k, - range - })), - ...AUTOMATIC_VARIABLES.map((v) => ({ - label: v, - kind: kinds.Variable, - insertText: v, - range - })), - ...SNIPPETS.map((s) => ({ - label: s.label, - kind: kinds.Snippet, - detail: s.detail, - insertText: s.insert, - insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet, - range - })), - ...context.parameterNames().map((p) => ({ - label: `$${p}`, - kind: kinds.Variable, - detail: 'Script parameter', - insertText: `$${p}`, - range - })), - ...context.secretNames().map((s) => ({ - label: `$${context.secretsVariable()}.${s}`, - kind: kinds.Variable, - detail: 'Secret binding', - insertText: `$${context.secretsVariable()}.${s}`, - range - })), - ...(context.fileBindings?.() ?? []).map((f) => ({ - label: `$Files.${f.name}`, - kind: kinds.File, - detail: f.directory - ? 'Delivered directory (DirectoryInfo)' - : 'Delivered file (FileInfo)', - insertText: `$Files.${f.name}`, - range - })) - ]; - - return { suggestions }; - } - }); -} diff --git a/src/WebUI/src/lib/index.ts b/src/WebUI/src/lib/index.ts deleted file mode 100644 index 8ca99b4..0000000 --- a/src/WebUI/src/lib/index.ts +++ /dev/null @@ -1 +0,0 @@ -// place files you want to import through the `$lib` alias in this folder. diff --git a/src/WebUI/src/lib/messaging/nats.ts b/src/WebUI/src/lib/messaging/nats.ts deleted file mode 100644 index 8d4e68f..0000000 --- a/src/WebUI/src/lib/messaging/nats.ts +++ /dev/null @@ -1,209 +0,0 @@ -// Browser-side NATS-over-WebSocket connection. -// -// The NKey pair is generated in browser memory (the seed never leaves this -// tab). The backend issues a short-lived JWT restricted to this session's -// browser..> subjects; we refresh it before expiry while the -// backend auth session remains valid. - -import { writable, type Readable } from 'svelte/store'; -import { wsconnect, jwtAuthenticator, type NatsConnection, type Subscription } from '@nats-io/nats-core'; -import { createUser, type KeyPair } from '@nats-io/nkeys'; -import { api } from '$lib/api/client'; -import type { - ActivityEventPayload, - JobOutputPayload, - JobProgressPayload, - JobStatePayload, - MessageEnvelope, - ShellOutputPayload, - ShellStatePayload -} from '$lib/api/types'; - -export type LiveState = 'disconnected' | 'connecting' | 'connected'; - -export type JobEvent = - | { type: 'job.output'; payload: JobOutputPayload } - | { type: 'job.progress'; payload: JobProgressPayload } - | { type: 'job.state'; payload: JobStatePayload }; - -export type ShellEvent = - | { type: 'shell.output'; payload: ShellOutputPayload } - | { type: 'shell.state'; payload: ShellStatePayload }; - -type ActivityHandler = (event: ActivityEventPayload) => void; -type JobHandler = (jobId: string, event: JobEvent) => void; -type ShellHandler = (shellId: string, event: ShellEvent) => void; - -const liveState = writable('disconnected'); -export const live: Readable = liveState; - -class NatsService { - private connection: NatsConnection | null = null; - private keyPair: KeyPair | null = null; - private jwt = ''; - private sessionId = ''; - private refreshTimer: ReturnType | null = null; - private subscription: Subscription | null = null; - private starting: Promise | null = null; - - private activityHandlers = new Set(); - private jobHandlers = new Set(); - private shellHandlers = new Set(); - - get browserSessionId(): string { - return this.sessionId; - } - - onActivity(handler: ActivityHandler): () => void { - this.activityHandlers.add(handler); - return () => this.activityHandlers.delete(handler); - } - - onJobEvent(handler: JobHandler): () => void { - this.jobHandlers.add(handler); - return () => this.jobHandlers.delete(handler); - } - - onShellEvent(handler: ShellHandler): () => void { - this.shellHandlers.add(handler); - return () => this.shellHandlers.delete(handler); - } - - /** Publishes raw bytes to a subject inside this session's namespace. */ - publish(subject: string, data: Uint8Array): void { - this.connection?.publish(subject, data); - } - - shellInputSubject(shellId: string): string { - return `browser.${this.sessionId}.shell.${shellId}.input`; - } - - async start(): Promise { - this.starting ??= this.startCore().catch((error) => { - this.starting = null; - liveState.set('disconnected'); - throw error; - }); - return this.starting; - } - - private async startCore(): Promise { - liveState.set('connecting'); - - this.keyPair ??= createUser(); - const credential = await api.messagingCredential( - this.keyPair.getPublicKey(), - this.sessionId || undefined - ); - this.jwt = credential.jwt; - this.sessionId = credential.browserSessionId; - this.scheduleRefresh(credential.expiresUtc); - - const scheme = location.protocol === 'https:' ? 'wss' : 'ws'; - const url = `${scheme}://${location.host}${credential.webSocketPath}`; - - this.connection = await wsconnect({ - servers: [url], - name: `browser-${this.sessionId}`, - authenticator: jwtAuthenticator(() => this.jwt, this.keyPair.getSeed()), - maxReconnectAttempts: -1, - waitOnFirstConnect: true - }); - - liveState.set('connected'); - this.monitorStatus(); - this.subscribeSession(); - } - - private monitorStatus(): void { - if (!this.connection) return; - void (async () => { - for await (const status of this.connection!.status()) { - if (status.type === 'disconnect') { - liveState.set('connecting'); - } else if (status.type === 'reconnect') { - liveState.set('connected'); - } - } - })(); - } - - private subscribeSession(): void { - if (!this.connection) return; - this.subscription?.unsubscribe(); - this.subscription = this.connection.subscribe(`browser.${this.sessionId}.>`); - - void (async () => { - for await (const message of this.subscription!) { - try { - this.dispatch(message.subject, message.json()); - } catch { - // Ignore malformed payloads. - } - } - })(); - } - - private dispatch(subject: string, envelope: MessageEnvelope): void { - // browser..event | browser..job. | browser..shell. - const parts = subject.split('.'); - const kind = parts[2]; - - if (kind === 'event') { - const payload = envelope.payload as ActivityEventPayload; - for (const handler of this.activityHandlers) handler(payload); - return; - } - - if (kind === 'job' && parts.length >= 4) { - const jobId = parts[3]; - const event = { type: envelope.messageType, payload: envelope.payload } as JobEvent; - for (const handler of this.jobHandlers) handler(jobId, event); - return; - } - - if (kind === 'shell' && parts.length >= 4) { - const shellId = parts[3]; - const event = { type: envelope.messageType, payload: envelope.payload } as ShellEvent; - for (const handler of this.shellHandlers) handler(shellId, event); - } - } - - private scheduleRefresh(expiresUtc: string): void { - if (this.refreshTimer) clearTimeout(this.refreshTimer); - const msUntilRefresh = Math.max(new Date(expiresUtc).getTime() - Date.now() - 60_000, 15_000); - this.refreshTimer = setTimeout(() => void this.refreshCredential(), msUntilRefresh); - } - - private async refreshCredential(): Promise { - try { - if (!this.keyPair) return; - const credential = await api.messagingCredential(this.keyPair.getPublicKey(), this.sessionId); - this.jwt = credential.jwt; - if (credential.browserSessionId !== this.sessionId) { - // Session expired server-side; rebind subscriptions to the new one. - this.sessionId = credential.browserSessionId; - this.subscribeSession(); - } - this.scheduleRefresh(credential.expiresUtc); - } catch { - // Auth session likely gone; retry shortly (page will redirect on 401). - this.refreshTimer = setTimeout(() => void this.refreshCredential(), 30_000); - } - } - - async stop(): Promise { - if (this.refreshTimer) clearTimeout(this.refreshTimer); - this.refreshTimer = null; - this.subscription?.unsubscribe(); - this.subscription = null; - this.starting = null; - if (this.connection) { - await this.connection.close().catch(() => undefined); - this.connection = null; - } - liveState.set('disconnected'); - } -} - -export const nats = new NatsService(); diff --git a/src/WebUI/src/lib/schedule/cron-describe.ts b/src/WebUI/src/lib/schedule/cron-describe.ts deleted file mode 100644 index acf201b..0000000 --- a/src/WebUI/src/lib/schedule/cron-describe.ts +++ /dev/null @@ -1,99 +0,0 @@ -// Best-effort plain-English description of a 5-field cron expression. -// Covers everything the schedule builder generates plus common hand-written -// shapes; anything else returns null and the UI falls back to the raw cron -// (the server-computed next-run preview stays the ground truth either way). - -const dayNames: Record = { - '0': 'Sun', - '1': 'Mon', - '2': 'Tue', - '3': 'Wed', - '4': 'Thu', - '5': 'Fri', - '6': 'Sat', - '7': 'Sun', - SUN: 'Sun', - MON: 'Mon', - TUE: 'Tue', - WED: 'Wed', - THU: 'Thu', - FRI: 'Fri', - SAT: 'Sat' -}; - -function time(minute: string, hour: string): string | null { - const m = Number(minute); - const h = Number(hour); - if (!Number.isInteger(m) || !Number.isInteger(h) || m < 0 || m > 59 || h < 0 || h > 23) { - return null; - } - return `${String(h).padStart(2, '0')}:${String(m).padStart(2, '0')}`; -} - -function days(field: string): string | null { - const parts = field.split(',').map((d) => dayNames[d.trim().toUpperCase()]); - return parts.every(Boolean) ? parts.join(', ') : null; -} - -export function describeCron(expression: string): string | null { - const fields = expression.trim().split(/\s+/); - if (fields.length !== 5) return null; - const [minute, hour, dayOfMonth, month, dayOfWeek] = fields; - - if (month !== '*') return null; - - // */N * * * * — every N minutes - let match = /^\*\/(\d+)$/.exec(minute); - if (match && hour === '*' && dayOfMonth === '*' && dayOfWeek === '*') { - return match[1] === '1' ? 'Every minute' : `Every ${match[1]} minutes`; - } - - // M */N * * * — every N hours at minute M - match = /^\*\/(\d+)$/.exec(hour); - if (match && dayOfMonth === '*' && dayOfWeek === '*' && /^\d+$/.test(minute)) { - const at = minute === '0' ? '' : ` at :${minute.padStart(2, '0')}`; - return match[1] === '1' ? `Hourly${at}` : `Every ${match[1]} hours${at}`; - } - - // M * * * * — hourly at minute M - if (/^\d+$/.test(minute) && hour === '*' && dayOfMonth === '*' && dayOfWeek === '*') { - return minute === '0' ? 'Hourly' : `Hourly at :${minute.padStart(2, '0')}`; - } - - const at = time(minute, hour); - if (!at) return null; - - // M H * * * — daily - if (dayOfMonth === '*' && dayOfWeek === '*') { - return `Daily at ${at}`; - } - - // M H * * DAYS — weekly - if (dayOfMonth === '*' && dayOfWeek !== '*') { - const named = days(dayOfWeek); - return named ? `Weekly on ${named} at ${at}` : null; - } - - // M H D * * — monthly - if (dayOfWeek === '*' && /^\d+$/.test(dayOfMonth)) { - return `Monthly on day ${dayOfMonth} at ${at}`; - } - - return null; -} - -/** One-line cadence for a stored schedule or assignment (falls back to the raw cron). */ -export function scheduleCadence(schedule: { - cronExpression?: string; - runOnceUtc?: string; - timeZoneId: string; -}): string { - if (schedule.runOnceUtc) { - return `Once at ${new Date(schedule.runOnceUtc).toLocaleString()}`; - } - if (schedule.cronExpression) { - const text = describeCron(schedule.cronExpression) ?? schedule.cronExpression; - return schedule.timeZoneId === 'UTC' ? text : `${text} (${schedule.timeZoneId})`; - } - return '—'; -} diff --git a/src/WebUI/src/lib/theme/theme.ts b/src/WebUI/src/lib/theme/theme.ts deleted file mode 100644 index edfbc04..0000000 --- a/src/WebUI/src/lib/theme/theme.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { writable } from 'svelte/store'; -import { browser } from '$app/environment'; - -export type ThemePreference = 'system' | 'light' | 'dark'; - -function initial(): ThemePreference { - if (!browser) return 'system'; - const stored = localStorage.getItem('theme'); - return stored === 'light' || stored === 'dark' ? stored : 'system'; -} - -export const theme = writable(initial()); - -export function setTheme(preference: ThemePreference): void { - theme.set(preference); - if (!browser) return; - - if (preference === 'system') { - localStorage.removeItem('theme'); - document.documentElement.removeAttribute('data-theme'); - } else { - localStorage.setItem('theme', preference); - document.documentElement.setAttribute('data-theme', preference); - } -} diff --git a/src/WebUI/src/menu-items/index.ts b/src/WebUI/src/menu-items/index.ts new file mode 100644 index 0000000..fc298d6 --- /dev/null +++ b/src/WebUI/src/menu-items/index.ts @@ -0,0 +1,89 @@ +// assets +import ApartmentOutlined from '@ant-design/icons/ApartmentOutlined'; +import CalendarOutlined from '@ant-design/icons/CalendarOutlined'; +import CodeOutlined from '@ant-design/icons/CodeOutlined'; +import DashboardOutlined from '@ant-design/icons/DashboardOutlined'; +import DesktopOutlined from '@ant-design/icons/DesktopOutlined'; +import FunctionOutlined from '@ant-design/icons/FunctionOutlined'; +import HistoryOutlined from '@ant-design/icons/HistoryOutlined'; +import SafetyCertificateOutlined from '@ant-design/icons/SafetyCertificateOutlined'; +import SettingOutlined from '@ant-design/icons/SettingOutlined'; + +// types +import { NavGroupType, NavItemType } from 'types/menu'; + +// ==============================|| MENU ITEMS ||============================== // + +const menuItems: NavGroupType[] = [ + { + id: 'overview', + title: 'Overview', + children: [{ id: 'dashboard', title: 'Dashboard', url: '/', icon: DashboardOutlined, exact: true }] + }, + { + id: 'fleet', + title: 'Fleet', + children: [ + { + id: 'devices', + title: 'Devices', + url: '/devices', + icon: DesktopOutlined, + permission: 'devices.view', + permissionLabel: 'View Devices' + }, + { id: 'groups', title: 'Groups', url: '/groups', icon: ApartmentOutlined, permission: 'groups.view', permissionLabel: 'View Groups' } + ] + }, + { + id: 'automation', + title: 'Automation', + children: [ + { id: 'scripts', title: 'Scripts', url: '/scripts', icon: CodeOutlined, permission: 'scripts.view', permissionLabel: 'View Scripts' }, + { + id: 'functions', + title: 'Functions', + url: '/functions', + icon: FunctionOutlined, + permission: 'functions.view', + permissionLabel: 'View Functions' + }, + { + id: 'schedules', + title: 'Schedules', + url: '/schedules', + icon: CalendarOutlined, + permission: 'automation.view', + permissionLabel: 'View Automation' + }, + { id: 'jobs', title: 'Jobs', url: '/jobs', icon: HistoryOutlined, permission: 'jobs.view', permissionLabel: 'View Jobs' } + ] + }, + { + id: 'administration', + title: 'Administration', + children: [ + { + id: 'access', + title: 'Access', + url: '/access', + icon: SafetyCertificateOutlined, + permission: 'access.manage', + permissionLabel: 'Manage Access' + }, + { + id: 'settings', + title: 'Settings', + url: '/settings', + icon: SettingOutlined, + permission: 'settings.manage', + permissionLabel: 'Manage Settings' + } + ] + } +]; + +export default menuItems; + +/** Every navigable item, for titles and breadcrumbs. */ +export const allMenuItems: NavItemType[] = menuItems.flatMap((group) => group.children); diff --git a/src/WebUI/src/messaging/nats.ts b/src/WebUI/src/messaging/nats.ts new file mode 100644 index 0000000..f774887 --- /dev/null +++ b/src/WebUI/src/messaging/nats.ts @@ -0,0 +1,224 @@ +// Browser-side NATS-over-WebSocket connection. +// +// The NKey pair is generated in browser memory (the seed never leaves this +// tab). The backend issues a short-lived JWT restricted to this session's +// browser..> subjects; we refresh it before expiry while the +// backend auth session remains valid. + +import { useSyncExternalStore } from 'react'; +import { wsconnect, jwtAuthenticator, type NatsConnection, type Subscription } from '@nats-io/nats-core'; +import { createUser, type KeyPair } from '@nats-io/nkeys'; +import { api } from 'api/client'; +import type { + ActivityEventPayload, + JobOutputPayload, + JobProgressPayload, + JobStatePayload, + MessageEnvelope, + ShellOutputPayload, + ShellStatePayload +} from 'api/types'; + +export type LiveState = 'disconnected' | 'connecting' | 'connected'; + +export type JobEvent = + | { type: 'job.output'; payload: JobOutputPayload } + | { type: 'job.progress'; payload: JobProgressPayload } + | { type: 'job.state'; payload: JobStatePayload }; + +export type ShellEvent = { type: 'shell.output'; payload: ShellOutputPayload } | { type: 'shell.state'; payload: ShellStatePayload }; + +type ActivityHandler = (event: ActivityEventPayload) => void; +type JobHandler = (jobId: string, event: JobEvent) => void; +type ShellHandler = (shellId: string, event: ShellEvent) => void; + +/** Connection state with change listeners (read in React via useLiveState). */ +const liveState = (() => { + let value: LiveState = 'disconnected'; + const listeners = new Set<() => void>(); + return { + get: () => value, + set(next: LiveState) { + if (next === value) return; + value = next; + for (const listener of listeners) listener(); + }, + subscribe(listener: () => void) { + listeners.add(listener); + return () => void listeners.delete(listener); + } + }; +})(); + +/** The live (NATS WebSocket) connection state, re-rendering on change. */ +export function useLiveState(): LiveState { + return useSyncExternalStore(liveState.subscribe, liveState.get); +} + +class NatsService { + private connection: NatsConnection | null = null; + private keyPair: KeyPair | null = null; + private jwt = ''; + private sessionId = ''; + private refreshTimer: ReturnType | null = null; + private subscription: Subscription | null = null; + private starting: Promise | null = null; + + private activityHandlers = new Set(); + private jobHandlers = new Set(); + private shellHandlers = new Set(); + + get browserSessionId(): string { + return this.sessionId; + } + + onActivity(handler: ActivityHandler): () => void { + this.activityHandlers.add(handler); + return () => this.activityHandlers.delete(handler); + } + + onJobEvent(handler: JobHandler): () => void { + this.jobHandlers.add(handler); + return () => this.jobHandlers.delete(handler); + } + + onShellEvent(handler: ShellHandler): () => void { + this.shellHandlers.add(handler); + return () => this.shellHandlers.delete(handler); + } + + /** Publishes raw bytes to a subject inside this session's namespace. */ + publish(subject: string, data: Uint8Array): void { + this.connection?.publish(subject, data); + } + + shellInputSubject(shellId: string): string { + return `browser.${this.sessionId}.shell.${shellId}.input`; + } + + async start(): Promise { + this.starting ??= this.startCore().catch((error) => { + this.starting = null; + liveState.set('disconnected'); + throw error; + }); + return this.starting; + } + + private async startCore(): Promise { + liveState.set('connecting'); + + this.keyPair ??= createUser(); + const credential = await api.messagingCredential(this.keyPair.getPublicKey(), this.sessionId || undefined); + this.jwt = credential.jwt; + this.sessionId = credential.browserSessionId; + this.scheduleRefresh(credential.expiresUtc); + + const scheme = location.protocol === 'https:' ? 'wss' : 'ws'; + const url = `${scheme}://${location.host}${credential.webSocketPath}`; + + this.connection = await wsconnect({ + servers: [url], + name: `browser-${this.sessionId}`, + authenticator: jwtAuthenticator(() => this.jwt, this.keyPair.getSeed()), + maxReconnectAttempts: -1, + waitOnFirstConnect: true + }); + + liveState.set('connected'); + this.monitorStatus(); + this.subscribeSession(); + } + + private monitorStatus(): void { + if (!this.connection) return; + void (async () => { + for await (const status of this.connection!.status()) { + if (status.type === 'disconnect') { + liveState.set('connecting'); + } else if (status.type === 'reconnect') { + liveState.set('connected'); + } + } + })(); + } + + private subscribeSession(): void { + if (!this.connection) return; + this.subscription?.unsubscribe(); + this.subscription = this.connection.subscribe(`browser.${this.sessionId}.>`); + + void (async () => { + for await (const message of this.subscription!) { + try { + this.dispatch(message.subject, message.json()); + } catch { + // Ignore malformed payloads. + } + } + })(); + } + + private dispatch(subject: string, envelope: MessageEnvelope): void { + // browser..event | browser..job. | browser..shell. + const parts = subject.split('.'); + const kind = parts[2]; + + if (kind === 'event') { + const payload = envelope.payload as ActivityEventPayload; + for (const handler of this.activityHandlers) handler(payload); + return; + } + + if (kind === 'job' && parts.length >= 4) { + const jobId = parts[3]; + const event = { type: envelope.messageType, payload: envelope.payload } as JobEvent; + for (const handler of this.jobHandlers) handler(jobId, event); + return; + } + + if (kind === 'shell' && parts.length >= 4) { + const shellId = parts[3]; + const event = { type: envelope.messageType, payload: envelope.payload } as ShellEvent; + for (const handler of this.shellHandlers) handler(shellId, event); + } + } + + private scheduleRefresh(expiresUtc: string): void { + if (this.refreshTimer) clearTimeout(this.refreshTimer); + const msUntilRefresh = Math.max(new Date(expiresUtc).getTime() - Date.now() - 60_000, 15_000); + this.refreshTimer = setTimeout(() => void this.refreshCredential(), msUntilRefresh); + } + + private async refreshCredential(): Promise { + try { + if (!this.keyPair) return; + const credential = await api.messagingCredential(this.keyPair.getPublicKey(), this.sessionId); + this.jwt = credential.jwt; + if (credential.browserSessionId !== this.sessionId) { + // Session expired server-side; rebind subscriptions to the new one. + this.sessionId = credential.browserSessionId; + this.subscribeSession(); + } + this.scheduleRefresh(credential.expiresUtc); + } catch { + // Auth session likely gone; retry shortly (page will redirect on 401). + this.refreshTimer = setTimeout(() => void this.refreshCredential(), 30_000); + } + } + + async stop(): Promise { + if (this.refreshTimer) clearTimeout(this.refreshTimer); + this.refreshTimer = null; + this.subscription?.unsubscribe(); + this.subscription = null; + this.starting = null; + if (this.connection) { + await this.connection.close().catch(() => undefined); + this.connection = null; + } + liveState.set('disconnected'); + } +} + +export const nats = new NatsService(); diff --git a/src/WebUI/src/pages/auth/login.tsx b/src/WebUI/src/pages/auth/login.tsx new file mode 100644 index 0000000..812d095 --- /dev/null +++ b/src/WebUI/src/pages/auth/login.tsx @@ -0,0 +1,197 @@ +import { FormEvent, useEffect, useState } from 'react'; +import { useNavigate, useSearchParams } from 'react-router-dom'; + +// material-ui +import Alert from '@mui/material/Alert'; +import Button from '@mui/material/Button'; +import Divider from '@mui/material/Divider'; +import Link from '@mui/material/Link'; +import Stack from '@mui/material/Stack'; +import TextField from '@mui/material/TextField'; +import Typography from '@mui/material/Typography'; + +// project imports +import AuthWrapper from 'sections/auth/AuthWrapper'; +import { api, ApiError } from 'api/client'; +import useSession from 'hooks/useSession'; +import type { AuthConfigDto } from 'api/types'; + +// assets +import LoginOutlined from '@ant-design/icons/LoginOutlined'; + +/** Only same-site paths are followed after sign-in (no open redirects). */ +function safeReturnUrl(value: string | null): string { + return value && value.startsWith('/') && !value.startsWith('//') && !value.startsWith('/login') ? value : '/'; +} + +function signInError(e: unknown, unauthorized: string, fallback: string): string { + if (e instanceof ApiError && e.status === 401) return unauthorized; + if (e instanceof ApiError && e.status === 429) return 'Too many attempts. Try again in a minute.'; + return fallback; +} + +// ==============================|| SIGN IN ||============================== // + +export default function Login() { + const [params] = useSearchParams(); + const navigate = useNavigate(); + const { adopt, refresh } = useSession(); + + const [config, setConfig] = useState(null); + const [username, setUsername] = useState(''); + const [password, setPassword] = useState(''); + // A failed SSO round trip comes back as ?error= so the operator sees why. + const [error, setError] = useState(params.get('error') ?? ''); + const [busy, setBusy] = useState(false); + + // Forced first-sign-in reset (the defaulted admin/admin credentials). + const [mustChange, setMustChange] = useState(false); + const [newPassword, setNewPassword] = useState(''); + const [confirmPassword, setConfirmPassword] = useState(''); + + const returnUrl = safeReturnUrl(params.get('returnUrl')); + // ?local=1 always reveals the local form: the way back in when the identity provider is down. + const forceLocal = params.get('local') === '1'; + + useEffect(() => { + let cancelled = false; + void api + .authConfig() + .catch(() => ({ oidcAvailable: false, showLocalFields: true, autoRedirect: false }) as AuthConfigDto) + .then((loaded) => { + if (cancelled) return; + setConfig(loaded); + // Skip this page when configured to, unless we just came back from a + // failure or asked for local, which would otherwise loop forever. + if (loaded.autoRedirect && !params.get('error') && !forceLocal) { + window.location.href = '/api/auth/oidc/login'; + } + }); + return () => { + cancelled = true; + }; + }, [params, forceLocal]); + + const submit = async (event: FormEvent) => { + event.preventDefault(); + setError(''); + setBusy(true); + try { + const result = await api.login(username, password); + if (result.mustChangePassword) { + setMustChange(true); + return; + } + adopt(result); + navigate(returnUrl, { replace: true }); + } catch (e) { + setError(signInError(e, 'Invalid username or password.', 'Sign-in failed.')); + } finally { + setBusy(false); + } + }; + + const submitNewPassword = async (event: FormEvent) => { + event.preventDefault(); + setError(''); + if (newPassword.length < 8) return setError('The new password must be at least 8 characters.'); + if (newPassword !== confirmPassword) return setError('The passwords do not match.'); + setBusy(true); + try { + await api.changePassword(username, password, newPassword); + await refresh(); + navigate(returnUrl, { replace: true }); + } catch (e) { + setError(signInError(e, 'The current password no longer matches. Start over.', 'Could not set the new password.')); + } finally { + setBusy(false); + } + }; + + const showLocal = forceLocal || (config?.showLocalFields ?? true); + const showSso = config?.oidcAvailable ?? false; + const redirecting = config?.autoRedirect && !error && !forceLocal; + + return ( + + + {mustChange ? 'Set a New Password' : 'Sign In'} + + {error && {error}} + + {mustChange ? ( + + + This account still uses the default password. Choose a new one to finish signing in as {username}. + + setNewPassword(e.target.value)} + required + autoFocus + /> + setConfirmPassword(e.target.value)} + required + /> + + + ) : redirecting ? ( + Redirecting to single sign-on… + ) : ( + <> + {showLocal && ( + + setUsername(e.target.value)} + required + autoFocus + /> + setPassword(e.target.value)} + required + /> + + + )} + + {showLocal && showSso && or} + + {showSso && ( + + )} + + {config && !showLocal && !showSso && No sign-in method is configured.} + + {config && !showLocal && ( + // Local sign-in is never truly disabled; this keeps a way back in. + + Use a local account instead + + )} + + )} + + + ); +} diff --git a/src/WebUI/src/pages/maintenance/404.tsx b/src/WebUI/src/pages/maintenance/404.tsx new file mode 100644 index 0000000..c999afc --- /dev/null +++ b/src/WebUI/src/pages/maintenance/404.tsx @@ -0,0 +1,30 @@ +import { Link } from 'react-router-dom'; + +// material-ui +import Button from '@mui/material/Button'; + +// project imports +import EmptyState from 'components/EmptyState'; +import MainCard from 'components/MainCard'; + +// assets +import CompassOutlined from '@ant-design/icons/CompassOutlined'; + +// ==============================|| NOT FOUND ||============================== // + +export default function NotFound() { + return ( + + } + title="Page Not Found" + detail="The address does not match a page in the console." + action={ + + } + /> + + ); +} diff --git a/src/WebUI/src/pages/maintenance/pending.tsx b/src/WebUI/src/pages/maintenance/pending.tsx new file mode 100644 index 0000000..8cf592f --- /dev/null +++ b/src/WebUI/src/pages/maintenance/pending.tsx @@ -0,0 +1,13 @@ +// project imports +import EmptyState from 'components/EmptyState'; +import MainCard from 'components/MainCard'; + +// ==============================|| PAGE NOT YET MOVED TO THE NEW CONSOLE ||============================== // + +export default function Pending() { + return ( + + + + ); +} diff --git a/src/WebUI/src/routes/+layout.svelte b/src/WebUI/src/routes/+layout.svelte deleted file mode 100644 index af95152..0000000 --- a/src/WebUI/src/routes/+layout.svelte +++ /dev/null @@ -1,262 +0,0 @@ - - - - - ExecuteR Control - - -{#if isLoginPage} - {@render children()} -{:else} -
- - -
-
-

ExecuteR Control

-
- - - {#if $session.authenticated} - {$session.displayName ?? $session.username} - - {/if} -
-
-
- {@render children()} -
-
-
-{/if} - - diff --git a/src/WebUI/src/routes/+layout.ts b/src/WebUI/src/routes/+layout.ts deleted file mode 100644 index 42ac1a4..0000000 --- a/src/WebUI/src/routes/+layout.ts +++ /dev/null @@ -1,5 +0,0 @@ -// The app is fully client-driven (cookie auth + fetch + NATS WebSocket), so -// SSR adds nothing and disabling it lets the same codebase build both the -// node deployment and the static SPA embedded in the combined server binary. -export const ssr = false; -export const prerender = false; diff --git a/src/WebUI/src/routes/+page.svelte b/src/WebUI/src/routes/+page.svelte deleted file mode 100644 index 1ae7801..0000000 --- a/src/WebUI/src/routes/+page.svelte +++ /dev/null @@ -1,525 +0,0 @@ - - -{#if data === null} -
- {#each Array(4) as _, i (i)}
loading…
{/each} -
-{:else} - {#if liveActive} -
-
- - Deploying - {liveFinished} of {liveTotal} endpoints finished - -
-
-
-
-
- {/if} - -
- - - - -
- -
-
-

Job outcomes

-
- -
    - {#each data.jobsByState as s (s.label)} -
  • - - {s.label} - {s.count} -
  • - {/each} -
-
-
- -
-

Executions · 14 days

- -
- Succeeded - Failed - Other -
-
- -
-

Script engine

- -
- -
-

Exit codes

- -
- -
-

Top targets

- -
- -
-

Most-run scripts

- -
- -
-

Fleet platforms

-
- -
    - {#each data.devicesByPlatform as p (p.label)} -
  • - - {p.label} - {p.count} -
  • - {/each} -
-
-
- -
-

Latest executions

- {#if data.recentRuns.length === 0} - - {:else} -
    - {#each data.recentRuns as run (run.jobId)} -
  • - -
  • - {/each} -
- {/if} -
- -
-

Activity

- {#if activity.length === 0} - - {:else} -
    - {#each activity as a, i (a.timestampUtc + '-' + i)} -
  • - -
  • - {/each} -
- {/if} -
-
-{/if} - - diff --git a/src/WebUI/src/routes/access/+page.svelte b/src/WebUI/src/routes/access/+page.svelte deleted file mode 100644 index 80b386e..0000000 --- a/src/WebUI/src/routes/access/+page.svelte +++ /dev/null @@ -1,613 +0,0 @@ - - -
-
-

Access control

-

- Who can do what, over which devices. Roles bundle permissions (optionally limited to device - groups) and apply to local users and OIDC sign-ins alike — list a role's IdP claim values to - map identity-provider groups onto it. -

-
-
- -{#if errorText}

{errorText}

{/if} - -
-
-

Users

- {#if !userFormOpen} - - {/if} -
- - {#if userFormOpen} -
-

{editingUser ? `Edit “${editingUser.username}”` : 'New local user'}

-
- {#if !editingUser} - - {/if} - - - {#if !editingUser || editingUser.authProvider === 'local'} - - {/if} -
-
- - -
-
- {/if} - -
- {#if users === null} -
loading…
- {:else if users.length === 0} - - {:else} - - - - - - - - - - - - - {#each users as user (user.id)} - - - - - - - - - {/each} - -
UsernameDisplay nameProviderRoleLast sign-in
{user.username}{user.displayName ?? '—'}{user.authProvider}{user.roleName} - {#if user.lastLoginUtc} - - {:else} - never - {/if} - - - -
- {/if} -
-
- -
-
-

Roles

- {#if !roleFormOpen} - - {/if} -
- - {#if roleFormOpen} -
-

{editingRole ? `Edit “${editingRole.name}”` : 'New role'}

-
- - - -
- -
- Permissions -
- {#each catalog as group (group.group)} -
- {group.group} - {#each group.permissions as perm (perm.key)} - - {/each} -
- {/each} -
-
- -
- Device scope -

- Leave empty for all devices; otherwise members only see and target devices in the - selected groups. -

- {#if groups.length === 0} -

No device groups exist yet.

- {:else} -
- {#each groups as group (group.id)} - - {/each} -
- {/if} -
- -
- - -
-
- {/if} - -
- {#if roles === null} -
loading…
- {:else} - - - - - - - - - - - - - - {#each roles as role (role.id)} - - - - - - - - - - {/each} - -
NameDescriptionPermissionsDevice scopeOIDC claimsUsers
- {role.name} - {#if role.isSystem}system{/if} - {role.description ?? '—'} - {role.permissions.includes('*') - ? 'Everything' - : `${role.permissions.length} granted`} - {scopeSummary(role)} - {role.oidcClaimValues.length > 0 ? role.oidcClaimValues.join(', ') : '—'} - {role.userCount} - - {#if !role.isSystem} - - - {/if} -
- {/if} -
-
- - diff --git a/src/WebUI/src/routes/devices/+page.svelte b/src/WebUI/src/routes/devices/+page.svelte deleted file mode 100644 index 4a10161..0000000 --- a/src/WebUI/src/routes/devices/+page.svelte +++ /dev/null @@ -1,204 +0,0 @@ - - -
-

Devices

-
- - - {#if canAddDevice} - - {/if} -
-
- -{#if showAddDevice} - (showAddDevice = false)} /> -{/if} - -
- {#if devices === null} -
- {#each Array(4) as _, i (i)} -
loading device row…
- {/each} -
- {:else if filtered.length === 0} - - {:else} - - - - - - - - - - - - - - {#each filtered as device (device.clientId)} - goto(`/devices/${device.clientId}`)} - onkeydown={(e) => e.key === 'Enter' && goto(`/devices/${device.clientId}`)} - tabindex="0" - > - - - - - - - - - {/each} - -
StatusManufacturer / ModelAgentIP
- - - {device.hostname} - - - {[device.manufacturer, device.model].filter(Boolean).join(' · ') || '—'} - {device.osCaption ?? '—'}{device.agentVersion ?? '—'}{device.ipAddresses[0] ?? '—'}
- {/if} -
- - diff --git a/src/WebUI/src/routes/devices/[clientId]/+page.svelte b/src/WebUI/src/routes/devices/[clientId]/+page.svelte deleted file mode 100644 index ed37ccb..0000000 --- a/src/WebUI/src/routes/devices/[clientId]/+page.svelte +++ /dev/null @@ -1,859 +0,0 @@ - - -{#if error} - - Back to devices - -{:else if !device} -
loading device…
-{:else} -
-
-
Devices / {device.hostname}
-
- -

{device.hostname}

- -
-
- {[device.manufacturer, device.model].filter(Boolean).join(' · ')} -
-
- Client ID: - -
-
-
- - -
-
- - - - {#if tab === 'overview'} -
-
-

Identity

-
-
Hostname
-
{device.hostname}
-
Make / model
-
- {[inventory?.identity.manufacturer, inventory?.identity.model] - .filter(Boolean) - .join(' · ') || '—'} -
-
Serial number
-
{inventory?.identity.serialNumber ?? '—'}
-
System UUID
-
{inventory?.identity.systemUuid ?? '—'}
-
Domain / workgroup
-
{inventory?.identity.domainOrWorkgroup ?? '—'}
-
System type
-
{inventory?.identity.systemType ?? '—'}
-
-
-
-

Operating system

-
-
OS
-
{inventory?.os.caption ?? device.osCaption ?? '—'}
-
Edition
-
{inventory?.os.edition ?? '—'}
-
Product type
-
{inventory?.os.productType ?? '—'}
-
Release
-
{inventory?.os.releaseVersion ?? '—'}
-
Version
-
{inventory?.os.version ?? '—'}
-
Architecture
-
{inventory?.os.architecture ?? '—'}
-
Installed
-
{inventory?.os.installDateUtc ? new Date(inventory.os.installDateUtc).toLocaleDateString() : '—'}
-
Last boot
-
{inventory?.os.lastBootUtc ? new Date(inventory.os.lastBootUtc).toLocaleString() : '—'}
-
-
-
-

Agent

-
-
Version
-
{device.agentVersion ?? '—'}
-
Enrolled
-
{new Date(device.enrolledUtc).toLocaleString()}
-
-
-
-

Tags

-
- {#each device.tags ?? [] as tag (tag)} - - {tag} - - - {/each} - {#if (device.tags ?? []).length === 0} - No tags - {/if} -
-
- e.key === 'Enter' && addTag()} - /> - -
-
- -
-

Groups

-
- {#each detail?.groups ?? [] as g (g.id)} - {g.name} · {g.kind} - {/each} - {#if (detail?.groups ?? []).length === 0} - Not in any group - {/if} -
-
- -
-

Connectivity

-
-
Last seen
-
-
IP addresses
-
{device.ipAddresses.join(', ') || '—'}
-
Public IP
-
- {#if !device.publicIp} - — - {:else if showPublicIp} - - - - - {:else} - - •••.•••.•••.••• - - - {/if} -
-
Inventory updated
-
-
-
-
- {:else if tab === 'hardware'} - {#if !inventory} - - {:else} -
-
-

Processor

-
-
Name
-
{inventory.cpu.name ?? '—'}
-
Cores / logical
-
{inventory.cpu.cores} cores, {inventory.cpu.logicalProcessors} logical
-
-
-
-

Memory

-
-
Total
-
{formatBytes(inventory.totalPhysicalMemoryBytes)}
-
- {#each inventory.memory as dimm, i (i)} -
- {dimm.deviceLocator ?? `DIMM ${i + 1}`}: {formatBytes(dimm.capacityBytes)} - {dimm.speedMhz ? ` @ ${dimm.speedMhz} MHz` : ''} - {dimm.manufacturer ? ` (${dimm.manufacturer})` : ''} -
- {/each} -
-
-

Firmware & board

-
-
BIOS version
-
{inventory.identity.biosVersion ?? '—'}
-
Motherboard
-
- {[inventory.identity.baseboardManufacturer, inventory.identity.baseboardProduct] - .filter(Boolean) - .join(' · ') || '—'} -
-
Baseboard serial
-
{inventory.identity.baseboardSerial ?? '—'}
-
-
-
-

Storage

- {#each sortedDisks as { disk, diskIndex } (diskIndex)} - {@const diskVolumes = inventory.volumes.filter((v) => v.diskIndex === diskIndex)} -
-
- - 🖴 - {disk.model ?? `Disk ${diskIndex}`} - - - Disk {diskIndex} · {disk.busType ?? '?'} · {formatBytes(disk.sizeBytes)} - - {#if disk.serialNumber} - - {/if} -
- {#if diskVolumes.length === 0} -

No mapped volumes.

- {:else} -
- {#each diskVolumes as vol (vol.driveLetter)} - {@const used = vol.totalSizeBytes - vol.freeSpaceBytes} - {@const pct = vol.totalSizeBytes > 0 ? Math.round((used / vol.totalSizeBytes) * 100) : 0} -
-
- {vol.driveLetter} - {vol.fileSystem ?? '—'} - - {formatBytes(vol.freeSpaceBytes)} free of {formatBytes(vol.totalSizeBytes)} - -
-
-
= 85} style="width: {pct}%">
-
-
- {/each} -
- {/if} -
- {/each} - {#if unmappedVolumes.length > 0} -
-
- Volumes without a disk mapping -
-
- {#each unmappedVolumes as vol (vol.driveLetter)} - {@const used = vol.totalSizeBytes - vol.freeSpaceBytes} - {@const pct = vol.totalSizeBytes > 0 ? Math.round((used / vol.totalSizeBytes) * 100) : 0} -
-
- {vol.driveLetter} - {vol.fileSystem ?? '—'} - - {formatBytes(vol.freeSpaceBytes)} free of {formatBytes(vol.totalSizeBytes)} - -
-
-
= 85} style="width: {pct}%">
-
-
- {/each} -
-
- {/if} -
-
- {/if} - {:else if tab === 'network'} - {#if !inventory || inventory.network.length === 0} - - {:else} -
- {#each inventory.network as adapter, i (i)} -
-

- {adapter.interfaceName ?? adapter.description ?? `Adapter ${i + 1}`} - {#if adapter.interfaceName && adapter.description && adapter.interfaceName !== adapter.description} - · {adapter.description} - {/if} -

-
- {#each [{ label: 'Interface', values: adapter.interfaceName ? [adapter.interfaceName] : [] }, { label: 'MAC', values: adapter.macAddress ? [adapter.macAddress] : [] }, { label: 'IPv4', values: adapter.ipv4Addresses }, { label: 'IPv6', values: adapter.ipv6Addresses }, { label: 'Gateways', values: adapter.gateways }, { label: 'DNS', values: adapter.dnsServers }] as row (row.label)} -
- {row.label} -
- {#if row.values.length === 0} - — - {:else} - {#each row.values as value (value)} - - {/each} - {/if} -
-
- {/each} -
-
- {/each} -
- {/if} - {:else if tab === 'jobs'} -
- {#if jobs.length === 0} - - {:else} - {#each [...new Set(jobs.map((j) => j.scriptName))] as scriptName (scriptName)} -

{scriptName}

- - - - - - {#each jobs.filter((j) => j.scriptName === scriptName) as job (job.jobId)} - goto(`/jobs?job=${job.jobId}`)}> - - - - - - {/each} - -
StateStartedDurationExit
- {job.startedUtc && job.completedUtc - ? `${Math.round((new Date(job.completedUtc).getTime() - new Date(job.startedUtc).getTime()) / 1000)}s` - : '—'} - {job.exitCode ?? '—'}
- {/each} -

- Click an execution to open its output. Retention keeps the newest runs per device - (JOB_HISTORY_LIMIT, default 200). -

- {/if} -
- {:else if tab === 'actions'} -
-
-

Actions

-
- - ▶ Run script - -
- {#if actionMessage} -

{actionMessage}

- {/if} - {#if !online} -

Actions are disabled while the agent is offline.

- {/if} -
- -
-

Send file (S3)

-

- Delivers an object from the configured S3 store to the device using a short-lived - presigned URL. -

-
- - - - -
-
-
- {/if} -{/if} - - diff --git a/src/WebUI/src/routes/devices/[clientId]/shell/+page.svelte b/src/WebUI/src/routes/devices/[clientId]/shell/+page.svelte deleted file mode 100644 index 3ec9b7b..0000000 --- a/src/WebUI/src/routes/devices/[clientId]/shell/+page.svelte +++ /dev/null @@ -1,231 +0,0 @@ - - - - Shell · {hostname || clientId} · ExecuteR - - -
-
- -
-

Remote shell

- - {statusText} - -
-
- -
- -
- - diff --git a/src/WebUI/src/routes/functions/+page.svelte b/src/WebUI/src/routes/functions/+page.svelte deleted file mode 100644 index ae1398b..0000000 --- a/src/WebUI/src/routes/functions/+page.svelte +++ /dev/null @@ -1,254 +0,0 @@ - - -
-

Functions

- -
- -

- Reusable PowerShell functions. Attach a module to a script and its definitions are prepended at - run time — keeping individual scripts small and free of duplication. -

- -
-
- {#if modules === null} -
- {#each Array(3) as _, i (i)}
loading…
{/each} -
- {:else if modules.length === 0} - - {:else} -
    - {#each modules as m (m.id)} -
  • - -
  • - {/each} -
- {/if} -
- - {#if selected || creating} -
-
- - {#if statusText}{statusText}{/if} -
- {#if selected}{/if} - {#if selected}{/if} - -
- - -
- {:else} -
- -
- {/if} -
- - diff --git a/src/WebUI/src/routes/groups/+page.svelte b/src/WebUI/src/routes/groups/+page.svelte deleted file mode 100644 index 9823b46..0000000 --- a/src/WebUI/src/routes/groups/+page.svelte +++ /dev/null @@ -1,433 +0,0 @@ - - -
-

Device groups

- -
- -
-
- {#if groups === null} -
- {#each Array(3) as _, i (i)}
loading…
{/each} -
- {:else if groups.length === 0} - - {:else} -
    - {#each groups as g (g.id)} -
  • - -
  • - {/each} -
- {/if} -
- -
-
-
- - -
- {#if statusText}{statusText}{/if} - {#if selected}{/if} - {#if selected}{/if} - -
- -
- - {#if kind === 'dynamic'} -
-
-

Membership rules

- -
- - - {#if selected} -
-

Members — {members.length} device(s)

- {#if members.length > 0} -
    - {#each members as d (d.clientId)} -
  • {d.hostname}
  • - {/each} -
- {:else} -

No devices currently match. Adjust the rules and Save.

- {/if} -
- {/if} - - {#if preview !== null} -
-

Preview (unsaved rules) — {preview.length} device(s)

- {#if preview.length > 0} -
    - {#each preview as d (d.clientId)} -
  • {d.hostname}
  • - {/each} -
- {:else} -

No devices match these rules.

- {/if} -
- {/if} -
- {:else} -
-

Members

-

Tick devices to include them in this static group.

- {#if !selected} -

Save the group first, then choose members.

- {:else} -
    - {#each devices as d (d.clientId)} -
  • - -
  • - {/each} -
- {/if} -
- {/if} - -
-
- - diff --git a/src/WebUI/src/routes/index.tsx b/src/WebUI/src/routes/index.tsx new file mode 100644 index 0000000..c115661 --- /dev/null +++ b/src/WebUI/src/routes/index.tsx @@ -0,0 +1,52 @@ +import { lazy } from 'react'; +import { createBrowserRouter, Outlet } from 'react-router-dom'; + +// project imports +import Loadable from 'components/Loadable'; +import ScrollTop from 'components/ScrollTop'; +import DashboardLayout from 'layout/Dashboard'; + +const Login = Loadable(lazy(() => import('pages/auth/login'))); +const NotFound = Loadable(lazy(() => import('pages/maintenance/404'))); +const Pending = Loadable(lazy(() => import('pages/maintenance/pending'))); + +// ==============================|| ROUTING ||============================== // + +function Root() { + return ( + <> + + + + ); +} + +const router = createBrowserRouter([ + { + element: , + children: [ + { path: '/login', element: }, + { + path: '/', + element: , + children: [ + { index: true, element: }, + { path: 'devices', element: }, + { path: 'devices/:clientId', element: }, + { path: 'devices/:clientId/shell', element: }, + { path: 'groups', element: }, + { path: 'scripts', element: }, + { path: 'scripts/:id', element: }, + { path: 'functions', element: }, + { path: 'schedules', element: }, + { path: 'jobs', element: }, + { path: 'access', element: }, + { path: 'settings', element: }, + { path: '*', element: } + ] + } + ] + } +]); + +export default router; diff --git a/src/WebUI/src/routes/jobs/+page.svelte b/src/WebUI/src/routes/jobs/+page.svelte deleted file mode 100644 index ee2d34f..0000000 --- a/src/WebUI/src/routes/jobs/+page.svelte +++ /dev/null @@ -1,256 +0,0 @@ - - -
-

Jobs

- {#if stateFilter} - Filtered: {stateFilter} ✕ - {/if} -
- -
-
- {#if jobs === null} -
- {#each Array(4) as _, i (i)} -
loading…
- {/each} -
- {:else if jobs.length === 0} - - {:else if visibleJobs.length === 0} - - {:else} - - - - - - - - - - - - {#each visibleJobs as job (job.jobId)} - select(job)} - onkeydown={(e) => e.key === 'Enter' && select(job)} - tabindex="0" - > - - - - - - - {/each} - -
StateScriptDeviceCreatedDuration
{job.scriptName}{job.hostname ?? job.clientId.slice(0, 10)}{duration(job)}
- {/if} -
- - -
- - diff --git a/src/WebUI/src/routes/login/+page.svelte b/src/WebUI/src/routes/login/+page.svelte deleted file mode 100644 index c24422b..0000000 --- a/src/WebUI/src/routes/login/+page.svelte +++ /dev/null @@ -1,309 +0,0 @@ - - - - Sign in · ExecuteR - - -
-
-
- X - ExecuteR -
-

{mustChange ? 'Set a new password' : 'Sign in'}

- - {#if error} - - {/if} - - {#if mustChange} -

- This account still uses the default password. Choose a new one to finish signing in as - {username}. -

-
- - - -
- {:else if config?.autoRedirect && !error} -

Redirecting to single sign-on…

- {:else} - {#if showLocal} -
- - - -
- {/if} - - {#if showLocal && showSso} -
or
- {/if} - - {#if showSso} - - Authenticate using OIDC - Provider: {config?.providerName ?? 'OIDC'} - - {/if} - - {#if !showLocal && !showSso} -

No sign-in method is configured.

- {/if} - - {#if !showLocal} - - Use a local account instead - {/if} - {/if} -
-
- - diff --git a/src/WebUI/src/routes/scripts/+page.svelte b/src/WebUI/src/routes/scripts/+page.svelte deleted file mode 100644 index b111d13..0000000 --- a/src/WebUI/src/routes/scripts/+page.svelte +++ /dev/null @@ -1,85 +0,0 @@ - - -
-

Scripts

- + New script -
- -
- {#if scripts === null} -
- {#each Array(3) as _, i (i)} -
loading…
- {/each} -
- {:else if scripts.length === 0} - - Create script - - {:else} - - - - - - - - - - - - {#each scripts as script (script.id)} - goto(`/scripts/${script.id}`)} - onkeydown={(e) => e.key === 'Enter' && goto(`/scripts/${script.id}`)} - tabindex="0" - > - - - - - - - {/each} - -
NameDescriptionLanguageUpdatedBy
{script.name}{script.description ?? '—'}{script.language}{script.updatedBy ?? '—'}
- {/if} -
- - diff --git a/src/WebUI/src/routes/scripts/[id]/+page.svelte b/src/WebUI/src/routes/scripts/[id]/+page.svelte deleted file mode 100644 index 1a2914b..0000000 --- a/src/WebUI/src/routes/scripts/[id]/+page.svelte +++ /dev/null @@ -1,973 +0,0 @@ - - - { - if (e.key === 'Escape' && fullscreen) fullscreen = false; - }} -/> - -
-
-
Scripts / {isNew ? 'New' : name || '…'}
- - -
- - {engineHints[engine]} -
-
-
- {#if statusText} - {statusText} - {/if} - {#if !isNew} - - - {/if} - - -
-
- -
-
-
-

Script Configuration

- - {parameters.length === 0 - ? 'No parameters' - : `${parameters.length} parameter${parameters.length === 1 ? '' : 's'}`} - · {secretBindings.length} secret{secretBindings.length === 1 ? '' : 's'} - · {fileBindings.length} file{fileBindings.length === 1 ? '' : 's'} - · {functionModuleIds.length} function{functionModuleIds.length === 1 ? '' : 's'} - -
- -
- - {#if showParamEditor} -
-
-

Parameters

- -
- -
-

Secrets

- -
- -
-

Files (S3)

- -
- -
-

Functions

- {#if allFunctions.length === 0} -

Nothing here yet — create reusable Functions from the sidebar.

- {:else} -
- {#each allFunctions as fn (fn.id)} - - {/each} -
- {/if} -
-
- {/if} -
- -
-
- {engine === 'Bash' ? 'bash' : 'powershell'} -
- - -
-
- {#if !loaded} -
loading editor…
- {/if} -
-
- -
-
-

Run

- {#if allGroups.length === 0} -

- No groups yet — create one under Groups, then run this script against it. -

- {:else} -

- Select one or more groups. Each runs on every non-orphaned member; offline devices - receive the job when they reconnect. -

-
- {#each allGroups as group (group.id)} - - {/each} -
- {/if} - - {#if parameters.length > 0} -

Execution values

- - {/if} -
- - {#if !isNew && loaded} - - {/if} -
- -{#if !isNew} -
-
-

- - {#if currentRun} - › - - {/if} - {#if currentTarget} - › - {currentTarget.hostname ?? currentTarget.clientId} - {/if} -

- {#if !currentRun} - - {/if} -
- - {#if !currentRun} - - {#if executions.length === 0} -

No executions yet. Select a group above and Run.

- {:else} - - - - {#each executions as ex (ex.runId)} - openExecution(ex.runId)}> - - - - - - {/each} - -
StartedByTargetsResult
{new Date(ex.startedUtc).toLocaleString()}{ex.requestedBy ?? '—'}{ex.total} - {ex.succeeded}✓ - {#if ex.failed > 0}{ex.failed}✗{/if} - {#if ex.pending > 0}{ex.pending}…{/if} -
- {/if} - {:else if !currentTarget} - - - - - {#each currentRun.targets as t (t.jobId)} - openTarget(t)}> - - - - - - {/each} - -
DeviceStateExitFinished
{t.hostname ?? t.clientId}{t.exitCode ?? '—'}{t.completedUtc ? new Date(t.completedUtc).toLocaleString() : '—'}
- {:else} - -
- - {#if outputLines.length > 0} - - - {/if} -
-
- {#if outputLines.length === 0} - - {terminalStates.includes(currentTarget.state) ? 'No output.' : 'Waiting for output…'} - - {:else if filteredOutput.length === 0} - No lines match “{outputSearch}”. - {:else} - {#each filteredOutput as line (line.seq)} -
{line.text}
- {/each} - {/if} -
- {/if} -
-{/if} - - diff --git a/src/WebUI/src/routes/settings/+page.svelte b/src/WebUI/src/routes/settings/+page.svelte deleted file mode 100644 index 80cf1c0..0000000 --- a/src/WebUI/src/routes/settings/+page.svelte +++ /dev/null @@ -1,296 +0,0 @@ - - -
-

Settings

-
- -
-
-

Appearance

-
- {#each themes as option (option.value)} - - {/each} -
-
- -
-

Bootstrap tokens

-

- One-time tokens for agent enrollment. The token value is shown once at creation — install with - msiexec /i Agent.msi /qn SERVERURL=… BOOTSTRAPTOKEN=… -

- -
- - - - -
- - {#if newToken?.token} -
-
New token (copy it now — it will not be shown again):
-
{newToken.token}
- -
-
-
Deploy on a target device (run in an elevated PowerShell):
-
{installCommand}
- -
- Requires Agent.msi in the backend’s AGENT_PACKAGE_PATH. Also usable: - msiexec /i Agent.msi /qn SERVERURL=… BOOTSTRAPTOKEN=… -
-
- {/if} - - {#if tokens.length === 0} - - {:else} -
- - - - - - - - - - - - - {#each tokens as token (token.id)} - - - - - - - - - {/each} - -
CreatedExpiresUsesNoteStatus
{new Date(token.createdUtc).toLocaleString()}{new Date(token.expiresUtc).getFullYear() > 9000 - ? 'Never' - : new Date(token.expiresUtc).toLocaleString()}{token.uses} / {token.maxUses === 0 ? '∞' : token.maxUses}{token.note ?? '—'} - {#if token.revoked} - Revoked - {:else if new Date(token.expiresUtc) < new Date()} - Expired - {:else if token.maxUses > 0 && token.uses >= token.maxUses} - Consumed - {:else} - Active - {/if} - - {#if !token.revoked && (token.maxUses === 0 || token.uses < token.maxUses) && new Date(token.expiresUtc) > new Date()} - - {/if} -
-
- {/if} -
- - -
-
-
-
- - diff --git a/src/WebUI/src/sections/auth/AuthBackground.tsx b/src/WebUI/src/sections/auth/AuthBackground.tsx new file mode 100644 index 0000000..3d4b995 --- /dev/null +++ b/src/WebUI/src/sections/auth/AuthBackground.tsx @@ -0,0 +1,42 @@ +// material-ui +import { useColorScheme, useTheme } from '@mui/material/styles'; +import Box from '@mui/material/Box'; + +// project imports +import { ThemeMode } from 'config'; + +// ==============================|| AUTH BLUR BACK SVG ||============================== // + +export default function AuthBackground() { + const theme = useTheme(); + const { colorScheme } = useColorScheme(); + + return ( + + + + + + + + ); +} diff --git a/src/WebUI/src/sections/auth/AuthWrapper.tsx b/src/WebUI/src/sections/auth/AuthWrapper.tsx new file mode 100644 index 0000000..056bba0 --- /dev/null +++ b/src/WebUI/src/sections/auth/AuthWrapper.tsx @@ -0,0 +1,36 @@ +import { ReactNode } from 'react'; + +// material-ui +import Box from '@mui/material/Box'; +import Card from '@mui/material/Card'; +import Stack from '@mui/material/Stack'; + +// project imports +import AuthBackground from './AuthBackground'; +import LogoMain from 'components/logo/LogoMain'; + +// ==============================|| AUTHENTICATION - WRAPPER ||============================== // + +export default function AuthWrapper({ children }: { children: ReactNode }) { + return ( + + + + + ({ + width: 1, + maxWidth: 440, + p: { xs: 3, sm: 4 }, + border: '1px solid', + borderColor: 'divider', + boxShadow: theme.vars.customShadows.z1 + })} + > + {children} + + + + ); +} diff --git a/src/WebUI/src/themes/GlobalStyles.tsx b/src/WebUI/src/themes/GlobalStyles.tsx new file mode 100644 index 0000000..05cddeb --- /dev/null +++ b/src/WebUI/src/themes/GlobalStyles.tsx @@ -0,0 +1,32 @@ +// material-ui +import MuiGlobalStyles from '@mui/material/GlobalStyles'; + +// project imports +import { MONO_FONT_FAMILY } from 'config'; +import { CHART_COLORS } from './palette'; + +// ==============================|| THEME - GLOBAL STYLE ||============================== // + +const chartVars = (colors: readonly string[]) => Object.fromEntries(colors.map((c, i) => [`--chart-${i + 1}`, c])); + +export default function GlobalStyles() { + return ( + ({ + '*': { WebkitTapHighlightColor: 'transparent' }, + ':root': { ...chartVars(CHART_COLORS.light), '--font-mono': MONO_FONT_FAMILY }, + [theme.getColorSchemeSelector('dark')]: chartVars(CHART_COLORS.dark), + 'code, pre, kbd, samp': { fontFamily: MONO_FONT_FAMILY }, + // Thin, theme-aware scrollbars for the drawer, tables and output panes. + '*::-webkit-scrollbar': { width: 10, height: 10 }, + '*::-webkit-scrollbar-thumb': { + backgroundColor: theme.vars.palette.secondary.light, + borderRadius: 8, + border: '2px solid transparent', + backgroundClip: 'content-box' + }, + '*::-webkit-scrollbar-track': { background: 'transparent' } + })} + /> + ); +} diff --git a/src/WebUI/src/themes/custom-shadows.tsx b/src/WebUI/src/themes/custom-shadows.tsx new file mode 100644 index 0000000..e1cbc83 --- /dev/null +++ b/src/WebUI/src/themes/custom-shadows.tsx @@ -0,0 +1,30 @@ +// project imports +import { ThemeMode } from 'config'; +import { withAlpha } from 'utils/colorUtils'; + +// ==============================|| DEFAULT THEME - CUSTOM SHADOWS ||============================== // + +export default function CustomShadows(palette: any, mode: ThemeMode) { + return { + button: mode === ThemeMode.DARK ? `0 2px 0 rgb(0 0 0 / 5%)` : `0 2px #0000000b`, + text: `0 -1px 0 rgb(0 0 0 / 12%)`, + z1: + mode === ThemeMode.DARK + ? `0px 1px 1px rgb(0 0 0 / 14%), 0px 2px 1px rgb(0 0 0 / 12%), 0px 1px 3px rgb(0 0 0 / 20%)` + : `0px 1px 4px ${withAlpha(palette.grey[900], 0.08)}`, + primary: `0 0 0 2px ${withAlpha(palette.primary.main, 0.2)}`, + secondary: `0 0 0 2px ${withAlpha(palette.secondary.main, 0.2)}`, + error: `0 0 0 2px ${withAlpha(palette.error.main, 0.2)}`, + warning: `0 0 0 2px ${withAlpha(palette.warning.main, 0.2)}`, + info: `0 0 0 2px ${withAlpha(palette.info.main, 0.2)}`, + success: `0 0 0 2px ${withAlpha(palette.success.main, 0.2)}`, + grey: `0 0 0 2px ${withAlpha(palette.grey[500], 0.2)}`, + primaryButton: `0 14px 12px ${withAlpha(palette.primary.main, 0.2)}`, + secondaryButton: `0 14px 12px ${withAlpha(palette.secondary.main, 0.2)}`, + errorButton: `0 14px 12px ${withAlpha(palette.error.main, 0.2)}`, + warningButton: `0 14px 12px ${withAlpha(palette.warning.main, 0.2)}`, + infoButton: `0 14px 12px ${withAlpha(palette.info.main, 0.2)}`, + successButton: `0 14px 12px ${withAlpha(palette.success.main, 0.2)}`, + greyButton: `0 14px 12px ${withAlpha(palette.grey[500], 0.2)}` + }; +} diff --git a/src/WebUI/src/themes/extend-theme-types.d.ts b/src/WebUI/src/themes/extend-theme-types.d.ts new file mode 100644 index 0000000..362a666 --- /dev/null +++ b/src/WebUI/src/themes/extend-theme-types.d.ts @@ -0,0 +1 @@ +import type {} from '@mui/material/themeCssVarsAugmentation'; diff --git a/src/WebUI/src/themes/index.tsx b/src/WebUI/src/themes/index.tsx new file mode 100644 index 0000000..dddba92 --- /dev/null +++ b/src/WebUI/src/themes/index.tsx @@ -0,0 +1,52 @@ +import { ReactNode, useMemo } from 'react'; + +// material-ui +import { createTheme, StyledEngineProvider, ThemeOptions, ThemeProvider, Theme } from '@mui/material/styles'; +import CssBaseline from '@mui/material/CssBaseline'; + +// project imports +import { CSS_VAR_PREFIX, DEFAULT_THEME_MODE, FONT_FAMILY, ThemeMode } from 'config'; +import CustomShadows from './custom-shadows'; +import GlobalStyles from './GlobalStyles'; +import componentsOverride from './overrides'; +import { buildPalette } from './palette'; +import Typography from './typography'; + +// types +import type {} from './extend-theme-types'; + +// ==============================|| THEME - CUSTOMIZATION ||============================== // + +/** + * Light and dark color schemes on CSS variables, switched by the + * `data-color-scheme` attribute (system by default; persisted per browser). + */ +export default function ThemeCustomization({ children }: { children: ReactNode }) { + const theme: Theme = useMemo(() => { + const palette = buildPalette(); + const options: ThemeOptions = { + breakpoints: { values: { xs: 0, sm: 768, md: 1024, lg: 1266, xl: 1440 } }, + shape: { borderRadius: 8 }, + mixins: { toolbar: { minHeight: 60, paddingTop: 8, paddingBottom: 8 } }, + typography: Typography(FONT_FAMILY), + colorSchemes: { + light: { palette: palette.light, customShadows: CustomShadows(palette.light, ThemeMode.LIGHT) }, + dark: { palette: palette.dark, customShadows: CustomShadows(palette.dark, ThemeMode.DARK) } + }, + cssVariables: { cssVarPrefix: CSS_VAR_PREFIX, colorSchemeSelector: 'data-color-scheme' } + }; + const created = createTheme(options); + created.components = componentsOverride(created); + return created; + }, []); + + return ( + + + + + {children} + + + ); +} diff --git a/src/WebUI/src/themes/overrides/Accordion.ts b/src/WebUI/src/themes/overrides/Accordion.ts new file mode 100644 index 0000000..a507df9 --- /dev/null +++ b/src/WebUI/src/themes/overrides/Accordion.ts @@ -0,0 +1,31 @@ +// material-ui +import { Theme } from '@mui/material/styles'; + +// ==============================|| OVERRIDES - ALERT TITLE ||============================== // + +export default function Accordion(theme: Theme) { + return { + MuiAccordion: { + defaultProps: { + disableGutters: true, + square: true, + elevation: 0 + }, + styleOverrides: { + root: { + border: '1px solid', + borderColor: theme.vars.palette.secondary.light, + '&:not(:last-child)': { + borderBottom: 0 + }, + '&:before': { + display: 'none' + }, + '&.Mui-disabled': { + backgroundColor: theme.vars.palette.secondary.lighter + } + } + } + } + }; +} diff --git a/src/WebUI/src/themes/overrides/AccordionDetails.ts b/src/WebUI/src/themes/overrides/AccordionDetails.ts new file mode 100644 index 0000000..e755f03 --- /dev/null +++ b/src/WebUI/src/themes/overrides/AccordionDetails.ts @@ -0,0 +1,18 @@ +// material-ui +import { Theme } from '@mui/material/styles'; + +// ==============================|| OVERRIDES - ALERT TITLE ||============================== // + +export default function AccordionDetails(theme: Theme) { + return { + MuiAccordionDetails: { + styleOverrides: { + root: { + padding: theme.spacing(2), + borderTop: '1px solid', + borderTopColor: theme.vars.palette.secondary.light + } + } + } + }; +} diff --git a/src/WebUI/src/themes/overrides/AccordionSummary.tsx b/src/WebUI/src/themes/overrides/AccordionSummary.tsx new file mode 100644 index 0000000..5c4b671 --- /dev/null +++ b/src/WebUI/src/themes/overrides/AccordionSummary.tsx @@ -0,0 +1,36 @@ +// material-ui +import { Theme } from '@mui/material/styles'; + +// assets +import RightOutlined from '@ant-design/icons/RightOutlined'; + +// ==============================|| OVERRIDES - ALERT TITLE ||============================== // + +export default function AccordionSummary(theme: Theme) { + const { vars, spacing } = theme; + + return { + MuiAccordionSummary: { + defaultProps: { + expandIcon: + }, + styleOverrides: { + root: { + backgroundColor: vars.palette.secondary.lighter, + flexDirection: 'row-reverse', + minHeight: 46 + }, + expandIconWrapper: { + '&.Mui-expanded': { + transform: 'rotate(90deg)' + } + }, + content: { + marginTop: spacing(1.25), + marginBottom: spacing(1.25), + marginLeft: spacing(1) + } + } + } + }; +} diff --git a/src/WebUI/src/themes/overrides/Alert.ts b/src/WebUI/src/themes/overrides/Alert.ts new file mode 100644 index 0000000..ea2c45a --- /dev/null +++ b/src/WebUI/src/themes/overrides/Alert.ts @@ -0,0 +1,132 @@ +// material-ui +import { Palette, PaletteColor, Theme } from '@mui/material/styles'; +import { AlertProps } from '@mui/material/Alert'; + +// project imports +import { withAlpha } from 'utils/colorUtils'; +import getColors from 'utils/getColors'; + +// types +import { ExtendedStyleProps } from 'types/extended'; + +const ALERT_COLORS = ['primary', 'secondary', 'error', 'info', 'success', 'warning'] as const; + +// ==============================|| ALERT - COLORS ||============================== // + +function getColorStyle({ color, theme }: ExtendedStyleProps) { + const colors = getColors(theme, color); + const { lighter, light, main } = colors; + + return { + borderColor: withAlpha(light, 0.5), + backgroundColor: lighter, + '& .MuiAlert-icon': { color: main } + }; +} + +/** + * Generate color variant styles for border variant type + * @param theme - MUI theme object + * @returns Object with color-specific selectors and their styles + */ +function generateColorVariants(theme: Theme) { + return ALERT_COLORS.reduce( + (acc, color) => { + acc[`&.MuiAlert-color${color.charAt(0).toUpperCase() + color.slice(1)}`] = getColorStyle({ + color: color as any, + theme + }); + return acc; + }, + {} as Record + ); +} + +// ==============================|| OVERRIDES - ALERT ||============================== // + +export default function Alert(theme: Theme) { + const primaryDashed = getColorStyle({ color: 'primary', theme }); + + return { + MuiAlert: { + styleOverrides: { + root: { + color: theme.vars.palette.text.primary, + fontSize: '0.875rem', + variants: [ + { + props: { variant: 'standard' }, + style: ({ ownerState }: { ownerState: AlertProps }) => { + const paletteColor = theme.palette[ownerState.color as keyof Palette] as PaletteColor; + return { + position: 'relative', + backgroundColor: paletteColor.lighter, + '& .MuiAlert-icon': { + color: paletteColor.main + }, + ...theme.applyStyles('dark', { + backgroundColor: withAlpha(theme.vars.palette.background.default, 0.99), + '&:before': { + width: '100%', + height: '100%', + position: 'absolute', + content: '""', + backgroundColor: paletteColor.main, + top: 0, + left: 0, + opacity: 0.05 + } + }) + }; + } + }, + { + props: { variant: 'filled' }, + style: ({ ownerState }: { ownerState: AlertProps }) => { + const paletteColor = theme.palette[ownerState.color as keyof Palette] as PaletteColor; + return { + color: theme.vars.palette.grey[0], + backgroundColor: paletteColor.main, + ...theme.applyStyles('dark', { + backgroundColor: paletteColor.dark, + ...(ownerState.color === 'secondary' && { backgroundColor: paletteColor.main }) + }) + }; + } + } + ] + }, + icon: { + fontSize: '1rem' + }, + message: { + padding: 0, + marginTop: 3 + }, + border: { + padding: '10px 16px', + border: '1px solid', + ...primaryDashed, + ...generateColorVariants(theme) + }, + action: { + '& .MuiButton-root': { + padding: 2, + height: 'auto', + fontSize: '0.75rem', + marginTop: -2 + }, + '& .MuiIconButton-root': { + width: 'auto', + height: 'auto', + padding: 2, + marginRight: 6, + '& .MuiSvgIcon-root': { + fontSize: '1rem' + } + } + } + } + } + }; +} diff --git a/src/WebUI/src/themes/overrides/AlertTitle.ts b/src/WebUI/src/themes/overrides/AlertTitle.ts new file mode 100644 index 0000000..fd29f09 --- /dev/null +++ b/src/WebUI/src/themes/overrides/AlertTitle.ts @@ -0,0 +1,15 @@ +// ==============================|| OVERRIDES - ALERT TITLE ||============================== // + +export default function AlertTitle() { + return { + MuiAlertTitle: { + styleOverrides: { + root: { + marginBottom: 4, + marginTop: 0, + fontWeight: 400 + } + } + } + }; +} diff --git a/src/WebUI/src/themes/overrides/Autocomplete.ts b/src/WebUI/src/themes/overrides/Autocomplete.ts new file mode 100644 index 0000000..b1a547b --- /dev/null +++ b/src/WebUI/src/themes/overrides/Autocomplete.ts @@ -0,0 +1,23 @@ +// ==============================|| OVERRIDES - AUTOCOMPLETE ||============================== // + +export default function Autocomplete() { + return { + MuiAutocomplete: { + styleOverrides: { + root: { + '& .MuiOutlinedInput-root': { + padding: '3px 9px' + } + }, + popupIndicator: { + width: 'auto', + height: 'auto' + }, + clearIndicator: { + width: 'auto', + height: 'auto' + } + } + } + }; +} diff --git a/src/WebUI/src/themes/overrides/Badge.ts b/src/WebUI/src/themes/overrides/Badge.ts new file mode 100644 index 0000000..4ae7482 --- /dev/null +++ b/src/WebUI/src/themes/overrides/Badge.ts @@ -0,0 +1,47 @@ +// material-ui +import { Theme } from '@mui/material/styles'; + +// project imports +import getColors from 'utils/getColors'; + +// types +import { ExtendedStyleProps } from 'types/extended'; + +// ==============================|| BADGE - COLORS ||============================== // + +function getColorStyle({ color, theme }: ExtendedStyleProps) { + const colors = getColors(theme, color); + const { lighter, main } = colors; + + return { + color: main, + backgroundColor: lighter + }; +} + +// ==============================|| OVERRIDES - BADGE ||============================== // + +export default function Badge(theme: Theme) { + const defaultLightBadge = getColorStyle({ color: 'primary', theme }); + + return { + MuiBadge: { + styleOverrides: { + standard: { + minWidth: theme.spacing(2), + height: theme.spacing(2), + padding: theme.spacing(0.5) + }, + light: { + ...defaultLightBadge, + '&.MuiBadge-colorPrimary': getColorStyle({ color: 'primary', theme }), + '&.MuiBadge-colorSecondary': getColorStyle({ color: 'secondary', theme }), + '&.MuiBadge-colorError': getColorStyle({ color: 'error', theme }), + '&.MuiBadge-colorInfo': getColorStyle({ color: 'info', theme }), + '&.MuiBadge-colorSuccess': getColorStyle({ color: 'success', theme }), + '&.MuiBadge-colorWarning': getColorStyle({ color: 'warning', theme }) + } + } + } + }; +} diff --git a/src/WebUI/src/themes/overrides/Button.ts b/src/WebUI/src/themes/overrides/Button.ts new file mode 100644 index 0000000..99c36e7 --- /dev/null +++ b/src/WebUI/src/themes/overrides/Button.ts @@ -0,0 +1,231 @@ +// material-ui +import { Theme } from '@mui/material/styles'; + +// project imports +import { withAlpha } from 'utils/colorUtils'; +import getColors from 'utils/getColors'; +import getShadow from 'utils/getShadow'; + +// types +import { ButtonVariantProps, ExtendedStyleProps } from 'types/extended'; + +const BUTTON_COLORS = ['primary', 'secondary', 'error', 'info', 'success', 'warning'] as const; +const BUTTON_VARIANTS = ['contained', 'outlined', 'text', 'dashed', 'shadow'] as const; + +// ==============================|| BUTTON - COLORS ||============================== // + +interface ButtonStyleProps extends ExtendedStyleProps { + variant: ButtonVariantProps; +} + +function getColorStyle({ variant, color, theme }: ButtonStyleProps) { + const colors = getColors(theme, color); + const { lighter, main, dark, darker, contrastText } = colors; + + const buttonShadow = `${color}Button`; + const shadows = getShadow(theme, buttonShadow); + + const commonShadow = { + '&::after': { + boxShadow: `0 0 5px 5px ${withAlpha(main, 0.9)}` + }, + '&:active::after': { + boxShadow: `0 0 0 0 ${withAlpha(main, 0.9)}` + }, + '&:focus-visible': { + outline: `2px solid ${dark}`, + outlineOffset: 2 + } + }; + + switch (variant) { + case 'contained': + return { + '&:hover': { + backgroundColor: dark + }, + ...commonShadow + }; + case 'shadow': + return { + color: contrastText, + backgroundColor: main, + boxShadow: shadows, + '&:hover': { + boxShadow: 'none', + backgroundColor: dark + }, + ...commonShadow + }; + case 'outlined': + return { + borderColor: main, + '&:hover': { + color: dark, + backgroundColor: 'transparent', + borderColor: dark + }, + ...commonShadow + }; + case 'dashed': + return { + color: main, + borderColor: main, + backgroundColor: lighter, + '&:hover': { + color: dark, + borderColor: dark + }, + ...commonShadow + }; + case 'text': + default: + return { + color: dark, + '&:hover': { + color: darker, + backgroundColor: lighter + }, + ...commonShadow + }; + } +} + +/** + * Generate color variant styles for a given variant type + * @param theme - MUI theme object + * @param variantType - Type of variant (e.g., 'contained', 'outlined', 'text', 'dashed', 'shadow') + * @returns Object with color-specific selectors and their styles + */ +function generateColorVariants(theme: Theme, variantType: ButtonVariantProps) { + return BUTTON_COLORS.reduce( + (acc, color) => { + const capitalizedColor = color.charAt(0).toUpperCase() + color.slice(1); + const className = `&.MuiButton-${variantType}${capitalizedColor}`; + + acc[className] = getColorStyle({ variant: variantType, color: color as any, theme }); + return acc; + }, + {} as Record + ); +} + +// ==============================|| OVERRIDES - BUTTON ||============================== // + +export default function Button(theme: Theme) { + const disabledStyle = { + backgroundColor: theme.vars.palette.grey[200], + '&:hover': { + backgroundColor: theme.vars.palette.grey[200] + } + }; + + const iconStyle = { + '&>*:nth-of-type(1)': { + fontSize: 'inherit' + } + }; + + // Generate variants array programmatically + const variants = BUTTON_VARIANTS.flatMap((variant) => + BUTTON_COLORS.map((color) => ({ + props: { variant, color }, + style: getColorStyle({ variant: variant as ButtonVariantProps, color: color as any, theme }) + })) + ); + + return { + MuiButton: { + defaultProps: { + disableElevation: true + }, + styleOverrides: { + root: { + fontWeight: 400, + '&::after': { + content: '""', + display: 'block', + position: 'absolute', + left: 0, + top: 0, + width: '100%', + height: '100%', + borderRadius: 4, + opacity: 0, + transition: 'all 0.5s' + }, + + '&:active::after': { + position: 'absolute', + borderRadius: 4, + left: 0, + top: 0, + opacity: 1, + transition: '0s' + }, + + variants + }, + contained: { + '&.Mui-disabled': { + ...disabledStyle + } + }, + outlined: { + '&.Mui-disabled': { + ...disabledStyle, + '&:hover': { + backgroundColor: theme.vars.palette.grey[200], + color: `${theme.vars.palette.grey[300]} !important`, + borderColor: 'inherit' + } + } + }, + text: { + boxShadow: 'none', + '&:hover': { + boxShadow: 'none' + } + }, + endIcon: { + ...iconStyle + }, + startIcon: { + ...iconStyle + }, + dashed: { + border: '1px dashed', + ...generateColorVariants(theme, 'dashed'), + '&.Mui-disabled': { + color: `${theme.vars.palette.grey[300]} !important`, + borderColor: `${theme.vars.palette.grey[400]} !important`, + backgroundColor: `${theme.vars.palette.grey[200]} !important` + } + }, + shadow: { + ...generateColorVariants(theme, 'shadow'), + '&.Mui-disabled': { + color: `${theme.vars.palette.grey[300]} !important`, + borderColor: `${theme.vars.palette.grey[400]} !important`, + backgroundColor: `${theme.vars.palette.grey[200]} !important` + } + }, + sizeExtraSmall: { + minWidth: 56, + fontSize: '0.625rem', + padding: '2px 8px' + }, + loading: { + pointerEvents: 'none !important', + '& svg': { + width: 'inherit', + height: 'inherit' + }, + '&.MuiButton-loadingPositionCenter': { + color: 'transparent !important' + } + } + } + } + }; +} diff --git a/src/WebUI/src/themes/overrides/ButtonBase.ts b/src/WebUI/src/themes/overrides/ButtonBase.ts new file mode 100644 index 0000000..5c99d78 --- /dev/null +++ b/src/WebUI/src/themes/overrides/ButtonBase.ts @@ -0,0 +1,19 @@ +// ==============================|| OVERRIDES - BUTTON ||============================== // + +export default function ButtonBase() { + return { + MuiButtonBase: { + defaultProps: { + disableRipple: true + }, + styleOverrides: { + root: { + '&.MuiButtonBase-root:disabled': { + cursor: 'not-allowed', + pointerEvents: 'auto' + } + } + } + } + }; +} diff --git a/src/WebUI/src/themes/overrides/ButtonGroup.ts b/src/WebUI/src/themes/overrides/ButtonGroup.ts new file mode 100644 index 0000000..d9c851b --- /dev/null +++ b/src/WebUI/src/themes/overrides/ButtonGroup.ts @@ -0,0 +1,11 @@ +// ==============================|| OVERRIDES - BUTTON ||============================== // + +export default function ButtonGroup() { + return { + MuiButtonGroup: { + defaultProps: { + disableRipple: true + } + } + }; +} diff --git a/src/WebUI/src/themes/overrides/CardContent.ts b/src/WebUI/src/themes/overrides/CardContent.ts new file mode 100644 index 0000000..1c556b6 --- /dev/null +++ b/src/WebUI/src/themes/overrides/CardContent.ts @@ -0,0 +1,16 @@ +// ==============================|| OVERRIDES - CARD CONTENT ||============================== // + +export default function CardContent() { + return { + MuiCardContent: { + styleOverrides: { + root: { + padding: 20, + '&:last-child': { + paddingBottom: 20 + } + } + } + } + }; +} diff --git a/src/WebUI/src/themes/overrides/Checkbox.tsx b/src/WebUI/src/themes/overrides/Checkbox.tsx new file mode 100644 index 0000000..7b31a1e --- /dev/null +++ b/src/WebUI/src/themes/overrides/Checkbox.tsx @@ -0,0 +1,102 @@ +// material-ui +import { Theme } from '@mui/material/styles'; +import { CheckboxProps } from '@mui/material/Checkbox'; + +// project imports +import getColors from 'utils/getColors'; + +// assets +import BorderOutlined from '@ant-design/icons/BorderOutlined'; +import CheckSquareFilled from '@ant-design/icons/CheckSquareFilled'; +import MinusSquareFilled from '@ant-design/icons/MinusSquareFilled'; + +// types +import { ExtendedStyleProps } from 'types/extended'; + +// ==============================|| RADIO - COLORS ||============================== // + +function getColorStyle({ color, theme }: ExtendedStyleProps) { + const colors = getColors(theme, color); + const { lighter, main, dark } = colors; + + return { + '&:hover': { + backgroundColor: lighter, + '& .icon': { + borderColor: main + } + }, + '&.Mui-focusVisible': { + outline: `2px solid ${dark}`, + outlineOffset: -4 + } + }; +} + +// ==============================|| CHECKBOX - SIZE STYLE ||============================== // + +interface CheckboxSizeProps { + fontSize: number; +} + +function getSizeStyle(size?: CheckboxProps['size']): CheckboxSizeProps { + switch (size) { + case 'small': + return { fontSize: 1.15 }; + case 'large': + return { fontSize: 1.6 }; + case 'medium': + default: + return { fontSize: 1.35 }; + } +} + +// ==============================|| CHECKBOX - STYLE ||============================== // + +function checkboxStyle(size?: CheckboxProps['size']) { + const sizes: CheckboxSizeProps = getSizeStyle(size); + + return { + '& .icon': { + fontSize: `${sizes.fontSize}rem` + } + }; +} + +// ==============================|| OVERRIDES - CHECKBOX ||============================== // + +export default function Checkbox(theme: Theme) { + const { palette } = theme; + + return { + MuiCheckbox: { + defaultProps: { + className: 'size-small', + icon: , + checkedIcon: , + indeterminateIcon: + }, + styleOverrides: { + root: { + borderRadius: 0, + color: palette.secondary[300], + '&.size-small': { + ...checkboxStyle('small') + }, + '&.size-medium': { + ...checkboxStyle('medium') + }, + '&.size-large': { + ...checkboxStyle('large') + } + }, + colorPrimary: getColorStyle({ color: 'primary', theme }), + colorSecondary: getColorStyle({ color: 'secondary', theme }), + colorSuccess: getColorStyle({ color: 'success', theme }), + colorWarning: getColorStyle({ color: 'warning', theme }), + colorInfo: getColorStyle({ color: 'info', theme }), + colorError: getColorStyle({ color: 'error', theme }) + } + } + }; +} diff --git a/src/WebUI/src/themes/overrides/Chip.ts b/src/WebUI/src/themes/overrides/Chip.ts new file mode 100644 index 0000000..19ec35b --- /dev/null +++ b/src/WebUI/src/themes/overrides/Chip.ts @@ -0,0 +1,97 @@ +// material-ui +import { Theme } from '@mui/material/styles'; + +// project imports +import getColors from 'utils/getColors'; + +// types +import { ExtendedStyleProps } from 'types/extended'; + +const CHIP_COLORS = ['primary', 'secondary', 'error', 'info', 'success', 'warning'] as const; + +// ==============================|| CHIP - COLORS ||============================== // + +function getColor({ color, theme }: ExtendedStyleProps) { + const colors = getColors(theme, color); + const { dark } = colors; + + return { + '&.Mui-focusVisible': { + outline: `2px solid ${dark}`, + outlineOffset: 2 + } + }; +} + +function getColorStyle({ color, theme }: ExtendedStyleProps) { + const colors = getColors(theme, color); + const { light, lighter, main, darker } = colors; + + return { + color: main, + backgroundColor: lighter, + borderColor: light, + ...theme.applyStyles('dark', { color: darker }), + '& .MuiChip-deleteIcon': { + color: main, + '&:hover': { + color: light + } + } + }; +} + +/** + * Generate color variant styles for a given variant type + * @param theme - MUI theme object + * @param variantType - Type of variant ('root' or 'light' or 'combined') + * @returns Object with color-specific selectors and their styles + */ +function generateColorVariants(theme: Theme, variantType: 'root' | 'light' | 'combined') { + const styleBuilder = variantType === 'root' ? getColor : getColorStyle; + + return CHIP_COLORS.reduce( + (acc, color) => { + acc[`&.MuiChip-color${color.charAt(0).toUpperCase() + color.slice(1)}`] = styleBuilder({ + color: color as any, + theme + }); + return acc; + }, + {} as Record + ); +} + +// ==============================|| OVERRIDES - CHIP ||============================== // + +export default function Chip(theme: Theme) { + const defaultLightChip = getColorStyle({ color: 'secondary', theme }); + const colorVariants = generateColorVariants(theme, 'light'); + + return { + MuiChip: { + styleOverrides: { + root: { + borderRadius: 4, + '&:active': { + boxShadow: 'none' + }, + ...generateColorVariants(theme, 'root') + }, + sizeLarge: { + fontSize: '1rem', + height: 40 + }, + light: { + ...defaultLightChip, + ...colorVariants + }, + combined: { + border: '1px solid', + ...defaultLightChip, + ...colorVariants + } + } + } + }; +} diff --git a/src/WebUI/src/themes/overrides/Dialog.ts b/src/WebUI/src/themes/overrides/Dialog.ts new file mode 100644 index 0000000..f020923 --- /dev/null +++ b/src/WebUI/src/themes/overrides/Dialog.ts @@ -0,0 +1,24 @@ +// material-ui +import { Theme } from '@mui/material/styles'; + +// project imports +import { withAlpha } from 'utils/colorUtils'; + +// ==============================|| OVERRIDES - DIALOG ||============================== // + +export default function Dialog(theme: Theme) { + return { + MuiDialog: { + styleOverrides: { + root: { + '& .MuiBackdrop-root': { + backgroundColor: withAlpha(theme.vars.palette.common.black, 0.7) + } + }, + paper: { + backgroundImage: 'none' + } + } + } + }; +} diff --git a/src/WebUI/src/themes/overrides/DialogContentText.ts b/src/WebUI/src/themes/overrides/DialogContentText.ts new file mode 100644 index 0000000..1813481 --- /dev/null +++ b/src/WebUI/src/themes/overrides/DialogContentText.ts @@ -0,0 +1,17 @@ +// material-ui +import { Theme } from '@mui/material/styles'; + +// ==============================|| OVERRIDES - DIALOG CONTENT TEXT ||============================== // + +export default function DialogContentText(theme: Theme) { + return { + MuiDialogContentText: { + styleOverrides: { + root: { + fontSize: '0.875rem', + color: theme.vars.palette.text.primary + } + } + } + }; +} diff --git a/src/WebUI/src/themes/overrides/DialogTitle.ts b/src/WebUI/src/themes/overrides/DialogTitle.ts new file mode 100644 index 0000000..19f0f4c --- /dev/null +++ b/src/WebUI/src/themes/overrides/DialogTitle.ts @@ -0,0 +1,14 @@ +// ==============================|| OVERRIDES - DIALOG TITLE ||============================== // + +export default function DialogTitle() { + return { + MuiDialogTitle: { + styleOverrides: { + root: { + fontSize: '1rem', + fontWeight: 500 + } + } + } + }; +} diff --git a/src/WebUI/src/themes/overrides/Drawer.ts b/src/WebUI/src/themes/overrides/Drawer.ts new file mode 100644 index 0000000..e634190 --- /dev/null +++ b/src/WebUI/src/themes/overrides/Drawer.ts @@ -0,0 +1,13 @@ +// ==============================|| OVERRIDES - DRAWER ||============================== // + +export default function Drawer() { + return { + MuiDrawer: { + styleOverrides: { + paper: { + backgroundImage: 'none' + } + } + } + }; +} diff --git a/src/WebUI/src/themes/overrides/Fab.ts b/src/WebUI/src/themes/overrides/Fab.ts new file mode 100644 index 0000000..a14fae7 --- /dev/null +++ b/src/WebUI/src/themes/overrides/Fab.ts @@ -0,0 +1,86 @@ +// material-ui +import { Theme } from '@mui/material/styles'; + +// project imports +import getColors from 'utils/getColors'; +import { withAlpha } from 'utils/colorUtils'; +import getShadow from 'utils/getShadow'; + +// types +import { ExtendedStyleProps } from 'types/extended'; + +// ==============================|| BUTTON - COLORS ||============================== // + +function getColorStyle({ color, theme }: ExtendedStyleProps) { + const colors = getColors(theme, color); + const { main, dark, contrastText } = colors; + + const buttonShadow = `${color}Button`; + const shadows = getShadow(theme, buttonShadow); + + return { + color: contrastText, + backgroundColor: main, + boxShadow: shadows, + '&:hover': { + boxShadow: 'none', + backgroundColor: dark + }, + '&:focus-visible': { + outline: `2px solid ${dark}`, + outlineOffset: 2 + }, + '&::after': { + borderRadius: '50px', + boxShadow: `0 0 5px 5px ${withAlpha(main, 0.9)}` + }, + '&:active::after': { + borderRadius: '50px', + boxShadow: `0 0 0 0 ${withAlpha(main, 0.9)}` + } + }; +} + +// ==============================|| OVERRIDES - BUTTON ||============================== // + +export default function Button(theme: Theme) { + return { + MuiFab: { + styleOverrides: { + root: { + fontWeight: 400, + '&.Mui-disabled': { + backgroundColor: theme.vars.palette.grey[200] + }, + '&.MuiFab-primary': getColorStyle({ color: 'primary', theme }), + '&.MuiFab-secondary': getColorStyle({ color: 'secondary', theme }), + '&.Mui-error': getColorStyle({ color: 'error', theme }), + '&.MuiFab-success': getColorStyle({ color: 'success', theme }), + '&.MuiFab-info': getColorStyle({ color: 'info', theme }), + '&.MuiFab-warning': getColorStyle({ color: 'warning', theme }), + '&::after': { + content: '""', + display: 'block', + position: 'absolute', + left: 0, + top: 0, + width: '100%', + height: '100%', + borderRadius: 4, + opacity: 0, + transition: 'all 0.5s' + }, + + '&:active::after': { + position: 'absolute', + borderRadius: 4, + left: 0, + top: 0, + opacity: 1, + transition: '0s' + } + } + } + } + }; +} diff --git a/src/WebUI/src/themes/overrides/FormHelperText.ts b/src/WebUI/src/themes/overrides/FormHelperText.ts new file mode 100644 index 0000000..661626c --- /dev/null +++ b/src/WebUI/src/themes/overrides/FormHelperText.ts @@ -0,0 +1,14 @@ +// ==============================|| OVERRIDES - FORM HELPER TEXT ||============================== // + +export default function FormHelperText() { + return { + MuiFormHelperText: { + styleOverrides: { + root: { + marginTop: 4, + marginLeft: 0 + } + } + } + }; +} diff --git a/src/WebUI/src/themes/overrides/IconButton.ts b/src/WebUI/src/themes/overrides/IconButton.ts new file mode 100644 index 0000000..af6b4c0 --- /dev/null +++ b/src/WebUI/src/themes/overrides/IconButton.ts @@ -0,0 +1,38 @@ +// material-ui +import { Theme } from '@mui/material/styles'; + +// ==============================|| OVERRIDES - ICON BUTTON ||============================== // + +export default function IconButton(theme: Theme) { + return { + MuiIconButton: { + styleOverrides: { + root: { + borderRadius: 4, + '&.MuiIconButton-loading': { + pointerEvents: 'none !important', + '& svg': { + width: 'inherit !important', + height: 'inherit !important' + } + } + }, + sizeLarge: { + width: theme.spacing(5.5), + height: theme.spacing(5.5), + fontSize: '1.25rem' + }, + sizeMedium: { + width: theme.spacing(4.5), + height: theme.spacing(4.5), + fontSize: '1rem' + }, + sizeSmall: { + width: theme.spacing(3.75), + height: theme.spacing(3.75), + fontSize: '0.75rem' + } + } + } + }; +} diff --git a/src/WebUI/src/themes/overrides/InputBase.ts b/src/WebUI/src/themes/overrides/InputBase.ts new file mode 100644 index 0000000..0ab36c3 --- /dev/null +++ b/src/WebUI/src/themes/overrides/InputBase.ts @@ -0,0 +1,13 @@ +// ==============================|| OVERRIDES - INPUT BASE ||============================== // + +export default function InputBase() { + return { + MuiInputBase: { + styleOverrides: { + sizeSmall: { + fontSize: '0.75rem' + } + } + } + }; +} diff --git a/src/WebUI/src/themes/overrides/InputLabel.ts b/src/WebUI/src/themes/overrides/InputLabel.ts new file mode 100644 index 0000000..3c7876c --- /dev/null +++ b/src/WebUI/src/themes/overrides/InputLabel.ts @@ -0,0 +1,30 @@ +// material-ui +import { Theme } from '@mui/material/styles'; + +// ==============================|| OVERRIDES - INPUT LABEL ||============================== // + +export default function InputLabel(theme: Theme) { + return { + MuiInputLabel: { + styleOverrides: { + root: { + color: theme.vars.palette.grey[600] + }, + outlined: { + lineHeight: '1rem', + top: -4, + '&.MuiInputLabel-sizeSmall': { + lineHeight: '1em' + }, + '&.MuiInputLabel-shrink': { + background: theme.vars.palette.background.paper, + padding: '0 8px', + marginLeft: -6, + top: 2, + lineHeight: '1rem' + } + } + } + } + }; +} diff --git a/src/WebUI/src/themes/overrides/LinearProgress.ts b/src/WebUI/src/themes/overrides/LinearProgress.ts new file mode 100644 index 0000000..0e4a292 --- /dev/null +++ b/src/WebUI/src/themes/overrides/LinearProgress.ts @@ -0,0 +1,17 @@ +// ==============================|| OVERRIDES - LINER PROGRESS ||============================== // + +export default function LinearProgress() { + return { + MuiLinearProgress: { + styleOverrides: { + root: { + height: 6, + borderRadius: 100 + }, + bar: { + borderRadius: 100 + } + } + } + }; +} diff --git a/src/WebUI/src/themes/overrides/Link.ts b/src/WebUI/src/themes/overrides/Link.ts new file mode 100644 index 0000000..634875a --- /dev/null +++ b/src/WebUI/src/themes/overrides/Link.ts @@ -0,0 +1,11 @@ +// ==============================|| OVERRIDES - LINK ||============================== // + +export default function Link() { + return { + MuiLink: { + defaultProps: { + underline: 'hover' + } + } + }; +} diff --git a/src/WebUI/src/themes/overrides/ListItemButton.tsx b/src/WebUI/src/themes/overrides/ListItemButton.tsx new file mode 100644 index 0000000..a446583 --- /dev/null +++ b/src/WebUI/src/themes/overrides/ListItemButton.tsx @@ -0,0 +1,22 @@ +// material-ui +import { Theme } from '@mui/material/styles'; + +// ==============================|| OVERRIDES - LIST ITEM ICON ||============================== // + +export default function ListItemButton(theme: Theme) { + return { + MuiListItemButton: { + styleOverrides: { + root: { + '&.Mui-selected': { + color: theme.vars.palette.primary.main, + ...theme.applyStyles('dark', { color: theme.vars.palette.primary.darker }), + '& .MuiListItemIcon-root': { + color: theme.vars.palette.primary.main + } + } + } + } + } + }; +} diff --git a/src/WebUI/src/themes/overrides/ListItemIcon.tsx b/src/WebUI/src/themes/overrides/ListItemIcon.tsx new file mode 100644 index 0000000..f4a1316 --- /dev/null +++ b/src/WebUI/src/themes/overrides/ListItemIcon.tsx @@ -0,0 +1,17 @@ +// material-ui +import { Theme } from '@mui/material/styles'; + +// ==============================|| OVERRIDES - LIST ITEM ICON ||============================== // + +export default function ListItemIcon(theme: Theme) { + return { + MuiListItemIcon: { + styleOverrides: { + root: { + minWidth: 24, + color: theme.vars.palette.text.primary + } + } + } + }; +} diff --git a/src/WebUI/src/themes/overrides/OutlinedInput.ts b/src/WebUI/src/themes/overrides/OutlinedInput.ts new file mode 100644 index 0000000..3132506 --- /dev/null +++ b/src/WebUI/src/themes/overrides/OutlinedInput.ts @@ -0,0 +1,55 @@ +// material-ui +import { Theme } from '@mui/material/styles'; + +// project imports +import getColors from 'utils/getColors'; +import getShadow from 'utils/getShadow'; + +// types +import { ColorProps } from 'types/extended'; + +interface Props { + variant: ColorProps; + theme: Theme; +} + +// ==============================|| OVERRIDES - INPUT BORDER & SHADOWS ||============================== // + +function getColor({ variant, theme }: Props) { + const colors = getColors(theme, variant); + const { light } = colors; + + const shadows = getShadow(theme, `${variant}`); + + return { + '&:hover .MuiOutlinedInput-notchedOutline': { borderColor: light }, + '&.Mui-focused': { boxShadow: shadows, '& .MuiOutlinedInput-notchedOutline': { border: '1px solid', borderColor: light } } + }; +} + +// ==============================|| OVERRIDES - OUTLINED INPUT ||============================== // + +export default function OutlinedInput(theme: Theme) { + return { + MuiOutlinedInput: { + styleOverrides: { + input: { padding: 'var(--mantis-input-padding, 10.5px 14px 10.5px 12px)' }, + notchedOutline: { + borderColor: theme.vars.palette.grey[300], + ...theme.applyStyles('dark', { borderColor: theme.vars.palette.grey[200] }) + }, + root: { + ...getColor({ variant: 'primary', theme }), + '&.Mui-error': { ...getColor({ variant: 'error', theme }) } + }, + sizeSmall: { '& .MuiOutlinedInput-input': { padding: 'var(--mantis-input-padding-small, 7.5px 8px 7.5px 12px)' } }, + multiline: { '& .MuiOutlinedInput-input': { padding: 0 } }, + colorSecondary: getColor({ variant: 'secondary', theme }), + colorError: getColor({ variant: 'error', theme }), + colorWarning: getColor({ variant: 'warning', theme }), + colorInfo: getColor({ variant: 'info', theme }), + colorSuccess: getColor({ variant: 'success', theme }) + } + } + }; +} diff --git a/src/WebUI/src/themes/overrides/Pagination.ts b/src/WebUI/src/themes/overrides/Pagination.ts new file mode 100644 index 0000000..ea1ace4 --- /dev/null +++ b/src/WebUI/src/themes/overrides/Pagination.ts @@ -0,0 +1,12 @@ +// ==============================|| OVERRIDES - PAGINATION ||============================== // + +export default function Pagination() { + return { + MuiPagination: { + defaultProps: { + shape: 'rounded' + }, + styleOverrides: { ul: { rowGap: 6 } } + } + }; +} diff --git a/src/WebUI/src/themes/overrides/PaginationItem.ts b/src/WebUI/src/themes/overrides/PaginationItem.ts new file mode 100644 index 0000000..f812dc9 --- /dev/null +++ b/src/WebUI/src/themes/overrides/PaginationItem.ts @@ -0,0 +1,120 @@ +// material-ui +import { Theme } from '@mui/material/styles'; +import { PaginationProps } from '@mui/material/Pagination'; + +// project imports +import getColors from 'utils/getColors'; + +// ==============================|| PAGINATION ITEM - COLORS ||============================== // + +const PAGINATION_COLORS = ['primary', 'secondary', 'error', 'info', 'success', 'warning'] as const; + +function getColorStyle({ variant, color, theme }: { variant: PaginationProps['variant']; color: any; theme: Theme }) { + const colors = getColors(theme, color); + const { lighter, light, dark, main, contrastText } = colors; + const focusStyle = { + '&:focus-visible': { + outline: `2px solid ${dark}`, + outlineOffset: 2, + ...(variant === 'text' && { + backgroundColor: theme.vars.palette.background.paper + }) + } + }; + switch (variant) { + case 'combined': + return { + borderColor: main, + backgroundColor: lighter, + '&:hover': { + borderColor: light + }, + ...focusStyle + }; + case 'contained': + return { + color: contrastText, + backgroundColor: main, + '&:hover': { + backgroundColor: light + }, + ...focusStyle + }; + case 'outlined': + return { + borderColor: main, + '&:hover': { + backgroundColor: lighter, + borderColor: light + }, + ...focusStyle + }; + case 'text': + default: + return { + color: main, + '&:hover': { + backgroundColor: main, + color: lighter + }, + ...focusStyle + }; + } +} + +function generateColorVariants(theme: Theme, variant: PaginationProps['variant']) { + return PAGINATION_COLORS.reduce( + (acc, color) => { + acc[`&.MuiPaginationItem-color${color.charAt(0).toUpperCase() + color.slice(1)}`] = getColorStyle({ variant, color, theme }); + return acc; + }, + {} as Record + ); +} + +// ==============================|| OVERRIDES - PAGINATION ITEM ||============================== // + +export default function PaginationItem(theme: Theme) { + return { + MuiPaginationItem: { + styleOverrides: { + root: { + '&:focus-visible': { + outline: `2px solid ${theme.vars.palette.secondary.dark}`, + outlineOffset: 2 + } + }, + text: { + '&.Mui-selected': { + backgroundColor: 'transparent', + fontSize: '1rem', + fontWeight: 500, + ...generateColorVariants(theme, 'text') + } + }, + contained: { + '&.Mui-selected': { + ...generateColorVariants(theme, 'contained') + } + }, + combined: { + border: '1px solid', + borderColor: theme.vars.palette.divider, + '&.MuiPaginationItem-ellipsis': { + border: 'none' + }, + '&.Mui-selected': { + ...generateColorVariants(theme, 'combined') + } + }, + outlined: { + borderColor: theme.vars.palette.divider, + '&.Mui-selected': { + backgroundColor: 'transparent', + ...generateColorVariants(theme, 'outlined') + } + } + } + } + }; +} diff --git a/src/WebUI/src/themes/overrides/Popover.ts b/src/WebUI/src/themes/overrides/Popover.ts new file mode 100644 index 0000000..9a23df7 --- /dev/null +++ b/src/WebUI/src/themes/overrides/Popover.ts @@ -0,0 +1,16 @@ +// material-ui +import { Theme } from '@mui/material/styles'; + +// ==============================|| OVERRIDES - DIALOG CONTENT TEXT ||============================== // + +export default function Popover(theme: Theme) { + return { + MuiPopover: { + styleOverrides: { + paper: { + boxShadow: theme.vars.customShadows.z1 + } + } + } + }; +} diff --git a/src/WebUI/src/themes/overrides/Radio.tsx b/src/WebUI/src/themes/overrides/Radio.tsx new file mode 100644 index 0000000..4262e04 --- /dev/null +++ b/src/WebUI/src/themes/overrides/Radio.tsx @@ -0,0 +1,127 @@ +// material-ui +import { Theme } from '@mui/material/styles'; +import { CheckboxProps } from '@mui/material/Checkbox'; +import Box from '@mui/material/Box'; + +// project imports +import getColors from 'utils/getColors'; + +// types +import { ExtendedStyleProps } from 'types/extended'; + +// ==============================|| RADIO - COLORS ||============================== // + +function getColorStyle({ color, theme }: ExtendedStyleProps) { + const colors = getColors(theme, color); + const { lighter, main, dark } = colors; + + return { + '& .dot': { + backgroundColor: main + }, + '&:hover': { + backgroundColor: lighter + }, + '&.Mui-focusVisible': { + outline: `2px solid ${dark}`, + outlineOffset: -4 + } + }; +} + +// ==============================|| CHECKBOX - SIZE STYLE ||============================== // + +interface RadioSizeProps { + size: number; + dotSize: number; +} + +function getSizeStyle(size?: CheckboxProps['size']): RadioSizeProps { + switch (size) { + case 'small': + return { size: 16, dotSize: 8 }; + case 'large': + return { size: 24, dotSize: 12 }; + case 'medium': + default: + return { size: 20, dotSize: 10 }; + } +} + +// ==============================|| CHECKBOX - STYLE ||============================== // + +function radioStyle(size?: CheckboxProps['size']) { + const sizes: RadioSizeProps = getSizeStyle(size); + + return { + '& .icon': { + width: sizes.size, + height: sizes.size, + display: 'flex', + alignItems: 'center', + justifyContent: 'center', + '& .dot': { + width: sizes.dotSize, + height: sizes.dotSize + } + } + }; +} + +// ==============================|| OVERRIDES - CHECKBOX ||============================== // + +export default function Radio(theme: Theme) { + const { palette } = theme; + + return { + MuiRadio: { + defaultProps: { + className: 'size-small', + icon: , + checkedIcon: ( + + + + ) + }, + styleOverrides: { + root: { + color: palette.secondary[300], + '&.size-small': { + ...radioStyle('small') + }, + '&.size-medium': { + ...radioStyle('medium') + }, + '&.size-large': { + ...radioStyle('large') + } + }, + colorPrimary: getColorStyle({ color: 'primary', theme }), + colorSecondary: getColorStyle({ color: 'secondary', theme }), + colorSuccess: getColorStyle({ color: 'success', theme }), + colorWarning: getColorStyle({ color: 'warning', theme }), + colorInfo: getColorStyle({ color: 'info', theme }), + colorError: getColorStyle({ color: 'error', theme }) + } + } + }; +} diff --git a/src/WebUI/src/themes/overrides/Rating.tsx b/src/WebUI/src/themes/overrides/Rating.tsx new file mode 100644 index 0000000..32cd951 --- /dev/null +++ b/src/WebUI/src/themes/overrides/Rating.tsx @@ -0,0 +1,39 @@ +// material-ui +import { Theme } from '@mui/material/styles'; + +// assets +import StarFilled from '@ant-design/icons/StarFilled'; +import StarOutlined from '@ant-design/icons/StarOutlined'; + +// ==============================|| OVERRIDES - RATING ||============================== // + +export default function Rating(theme: Theme) { + return { + MuiRating: { + defaultProps: { + emptyIcon: , + icon: + }, + styleOverrides: { + root: { + color: theme.vars.palette.warning.main + }, + iconEmpty: { + color: theme.vars.palette.secondary[200] + }, + sizeSmall: { + gap: 4, + fontSize: 14 + }, + sizeMedium: { + gap: 6, + fontSize: 18 + }, + sizeLarge: { + gap: 8, + fontSize: 24 + } + } + } + }; +} diff --git a/src/WebUI/src/themes/overrides/Slider.ts b/src/WebUI/src/themes/overrides/Slider.ts new file mode 100644 index 0000000..3f7858f --- /dev/null +++ b/src/WebUI/src/themes/overrides/Slider.ts @@ -0,0 +1,78 @@ +// material-ui +import { Theme } from '@mui/material/styles'; + +// project imports +import getColors from 'utils/getColors'; + +// types +import { ExtendedStyleProps } from 'types/extended'; + +// ==============================|| OVERRIDES - TAB ||============================== // + +function getColorStyle({ color, theme }: ExtendedStyleProps) { + const colors = getColors(theme, color); + const { main } = colors; + + return { border: '2px solid', borderColor: main }; +} + +export default function Slider(theme: Theme) { + return { + MuiSlider: { + styleOverrides: { + track: { + height: '1px' + }, + thumb: { + width: 14, + height: 14, + border: '2px solid', + borderColor: theme.vars.palette.primary.main, + backgroundColor: theme.vars.palette.background.paper, + variants: [ + { props: { color: 'primary' }, style: getColorStyle({ color: 'primary', theme }) }, + { props: { color: 'secondary' }, style: getColorStyle({ color: 'secondary', theme }) }, + { props: { color: 'success' }, style: getColorStyle({ color: 'success', theme }) }, + { props: { color: 'warning' }, style: getColorStyle({ color: 'warning', theme }) }, + { props: { color: 'info' }, style: getColorStyle({ color: 'info', theme }) }, + { props: { color: 'error' }, style: getColorStyle({ color: 'error', theme }) } + ] + }, + mark: { + width: 4, + height: 4, + borderRadius: '50%', + border: '1px solid', + borderColor: theme.vars.palette.secondary.light, + backgroundColor: theme.vars.palette.background.paper, + '&.MuiSlider-markActive': { + opacity: 1, + borderColor: 'inherit', + borderWidth: 2 + } + }, + rail: { + color: theme.vars.palette.secondary.light + }, + root: { + '&.Mui-disabled': { + '.MuiSlider-rail': { + opacity: 0.25 + }, + '.MuiSlider-track': { + color: theme.vars.palette.secondary.lighter + }, + '.MuiSlider-thumb': { + border: '2px solid', + borderColor: theme.vars.palette.secondary.lighter + } + } + }, + valueLabel: { + backgroundColor: theme.vars.palette.grey[600], + color: theme.vars.palette.grey[0] + } + } + } + }; +} diff --git a/src/WebUI/src/themes/overrides/Switch.ts b/src/WebUI/src/themes/overrides/Switch.ts new file mode 100644 index 0000000..fee63df --- /dev/null +++ b/src/WebUI/src/themes/overrides/Switch.ts @@ -0,0 +1,104 @@ +// material-ui +import { Theme } from '@mui/material/styles'; +import { SwitchProps } from '@mui/material/Switch'; + +// ==============================|| SWITCH - SIZE STYLE ||============================== // + +interface SwitchSizeProps { + width: number; + height: number; + base: number; + thumb: number; + trackRadius: number; +} + +function getSizeStyle(size?: SwitchProps['size']): SwitchSizeProps { + switch (size) { + case 'small': + return { width: 28, height: 16, base: 12, thumb: 10, trackRadius: 8 }; + case 'large': + return { width: 52, height: 26, base: 26, thumb: 20, trackRadius: 24 }; + case 'medium': + default: + return { width: 44, height: 22, base: 22, thumb: 16, trackRadius: 16 }; + } +} + +function switchStyle(theme: Theme, size?: SwitchProps['size']) { + const sizes: SwitchSizeProps = getSizeStyle(size); + + return { + width: sizes.width, + height: sizes.height, + '& .MuiSwitch-switchBase': { + padding: 3, + '&.Mui-checked': { + transform: `translateX(${sizes.base}px)` + } + }, + '& .MuiSwitch-thumb': { + width: sizes.thumb, + height: sizes.thumb + }, + '& .MuiSwitch-track': { + borderRadius: sizes.trackRadius + } + }; +} + +// ==============================|| OVERRIDES - TAB ||============================== // + +export default function Switch(theme: Theme) { + return { + MuiSwitch: { + styleOverrides: { + track: { + opacity: 1, + backgroundColor: theme.vars.palette.secondary[400], + boxSizing: 'border-box' + }, + thumb: { + borderRadius: '50%', + transition: theme.transitions.create(['width'], { + duration: 200 + }) + }, + switchBase: { + '&.Mui-checked': { + color: '#fff', + '& + .MuiSwitch-track': { + opacity: 1 + }, + '&.Mui-disabled': { + color: theme.vars.palette.background.paper + } + }, + '&.Mui-disabled': { + color: theme.vars.palette.background.paper, + '+.MuiSwitch-track': { + opacity: 0.3 + } + } + // '&.Mui-focusVisible': { + // outline: `2px solid #000`, + // outlineOffset: -2 + // } + }, + root: { + color: theme.vars.palette.text.primary, + padding: 0, + margin: 8, + display: 'flex', + '& ~ .MuiFormControlLabel-label': { + margin: 6 + }, + ...switchStyle(theme, 'medium') + }, + sizeLarge: { ...switchStyle(theme, 'large') }, + sizeSmall: { + ...switchStyle(theme, 'small') + } + } + } + }; +} diff --git a/src/WebUI/src/themes/overrides/Tab.ts b/src/WebUI/src/themes/overrides/Tab.ts new file mode 100644 index 0000000..461fc40 --- /dev/null +++ b/src/WebUI/src/themes/overrides/Tab.ts @@ -0,0 +1,30 @@ +// material-ui +import { Theme } from '@mui/material/styles'; + +// project imports +import { withAlpha } from 'utils/colorUtils'; + +// ==============================|| OVERRIDES - TAB ||============================== // + +export default function Tab(theme: Theme) { + return { + MuiTab: { + styleOverrides: { + root: { + minHeight: 46, + color: theme.vars.palette.text.primary, + borderRadius: 4, + '&:hover': { + backgroundColor: withAlpha(theme.vars.palette.primary.lighter, 0.6), + color: theme.vars.palette.primary.main + }, + '&:focus-visible': { + borderRadius: 4, + outline: `2px solid ${theme.vars.palette.secondary.dark}`, + outlineOffset: -3 + } + } + } + } + }; +} diff --git a/src/WebUI/src/themes/overrides/TableBody.ts b/src/WebUI/src/themes/overrides/TableBody.ts new file mode 100644 index 0000000..b10350d --- /dev/null +++ b/src/WebUI/src/themes/overrides/TableBody.ts @@ -0,0 +1,25 @@ +// material-ui +import { Theme } from '@mui/material/styles'; + +// ==============================|| OVERRIDES - TABLE ROW ||============================== // + +export default function TableBody(theme: Theme) { + const hoverStyle = { + '&:hover': { + backgroundColor: theme.vars.palette.action.hover + } + }; + + return { + MuiTableBody: { + styleOverrides: { + root: { + backgroundColor: theme.vars.palette.background.paper, + '& .MuiTableRow-root': { + ...hoverStyle + } + } + } + } + }; +} diff --git a/src/WebUI/src/themes/overrides/TableCell.ts b/src/WebUI/src/themes/overrides/TableCell.ts new file mode 100644 index 0000000..034836f --- /dev/null +++ b/src/WebUI/src/themes/overrides/TableCell.ts @@ -0,0 +1,68 @@ +// material-ui +import { Theme } from '@mui/material/styles'; +import { TableCellProps } from '@mui/material/TableCell'; + +// ==============================|| OVERRIDES - TABLE CELL ||============================== // + +export default function TableCell(theme: Theme) { + const commonCell = { + fontSize: '0.75rem', + textTransform: 'uppercase', + '&:not(:last-of-type)': { + backgroundImage: `linear-gradient(${theme.vars.palette.divider}, ${theme.vars.palette.divider})`, + backgroundRepeat: 'no-repeat', + /* 1px wide, shorter than full height */ + backgroundSize: '1px calc(100% - 30px)', + /* 16px from top */ + backgroundPosition: 'right 16px' + } + }; + + return { + MuiTableCell: { + styleOverrides: { + root: ({ ownerState }: { ownerState: TableCellProps }) => { + const baseStyle = { + fontSize: '0.875rem', + padding: 12, + borderColor: theme.vars.palette.divider + }; + + const align = ownerState.align; + + if (align === 'right') { + return { + ...baseStyle, + justifyContent: 'flex-end', + textAlign: 'right', + '& > *': { + justifyContent: 'flex-end', + margin: '0 0 0 auto' + }, + '& .MuiOutlinedInput-input': { + textAlign: 'right' + } + }; + } + + if (align === 'center') { + return { + ...baseStyle, + justifyContent: 'center', + textAlign: 'center', + '& > *': { + justifyContent: 'center', + margin: '0 auto' + } + }; + } + + return baseStyle; + }, + sizeSmall: { padding: 8 }, + head: { fontWeight: 700, ...commonCell }, + footer: { ...commonCell } + } + } + }; +} diff --git a/src/WebUI/src/themes/overrides/TableContainer.ts b/src/WebUI/src/themes/overrides/TableContainer.ts new file mode 100644 index 0000000..366b8d3 --- /dev/null +++ b/src/WebUI/src/themes/overrides/TableContainer.ts @@ -0,0 +1,13 @@ +// ==============================|| OVERRIDES - TABLE CONTAINER ||============================== // + +export default function TableContainer() { + return { + MuiTableContainer: { + styleOverrides: { + root: { + borderRadius: 0 + } + } + } + }; +} diff --git a/src/WebUI/src/themes/overrides/TableFooter.ts b/src/WebUI/src/themes/overrides/TableFooter.ts new file mode 100644 index 0000000..9afe2a6 --- /dev/null +++ b/src/WebUI/src/themes/overrides/TableFooter.ts @@ -0,0 +1,20 @@ +// material-ui +import { Theme } from '@mui/material/styles'; + +// ==============================|| OVERRIDES - TABLE CELL ||============================== // + +export default function TableFooter(theme: Theme) { + return { + MuiTableFooter: { + styleOverrides: { + root: { + backgroundColor: theme.vars.palette.grey[50], + borderTop: '2px solid', + borderTopColor: theme.vars.palette.divider, + borderBottom: '1px solid', + borderBottomColor: theme.vars.palette.divider + } + } + } + }; +} diff --git a/src/WebUI/src/themes/overrides/TableHead.ts b/src/WebUI/src/themes/overrides/TableHead.ts new file mode 100644 index 0000000..1bf4754 --- /dev/null +++ b/src/WebUI/src/themes/overrides/TableHead.ts @@ -0,0 +1,20 @@ +// material-ui +import { Theme } from '@mui/material/styles'; + +// ==============================|| OVERRIDES - TABLE CELL ||============================== // + +export default function TableHead(theme: Theme) { + return { + MuiTableHead: { + styleOverrides: { + root: { + backgroundColor: theme.vars.palette.grey[50], + borderTop: '1px solid', + borderTopColor: theme.vars.palette.divider, + borderBottom: '2px solid', + borderBottomColor: theme.vars.palette.divider + } + } + } + }; +} diff --git a/src/WebUI/src/themes/overrides/TablePagination.ts b/src/WebUI/src/themes/overrides/TablePagination.ts new file mode 100644 index 0000000..812c266 --- /dev/null +++ b/src/WebUI/src/themes/overrides/TablePagination.ts @@ -0,0 +1,16 @@ +// ==============================|| OVERRIDES - TABLE PAGINATION ||============================== // + +export default function TablePagination() { + return { + MuiTablePagination: { + styleOverrides: { + selectLabel: { + fontSize: '0.875rem' + }, + displayedRows: { + fontSize: '0.875rem' + } + } + } + }; +} diff --git a/src/WebUI/src/themes/overrides/TableRow.ts b/src/WebUI/src/themes/overrides/TableRow.ts new file mode 100644 index 0000000..0ca61ca --- /dev/null +++ b/src/WebUI/src/themes/overrides/TableRow.ts @@ -0,0 +1,25 @@ +// ==============================|| OVERRIDES - TABLE ROW ||============================== // + +export default function TableRow() { + return { + MuiTableRow: { + styleOverrides: { + root: { + '&:last-of-type': { + '& .MuiTableCell-root': { + borderBottom: 'none' + } + }, + '& .MuiTableCell-root': { + '&:last-of-type': { + paddingRight: 24 + }, + '&:first-of-type': { + paddingLeft: 24 + } + } + } + } + } + }; +} diff --git a/src/WebUI/src/themes/overrides/Tabs.ts b/src/WebUI/src/themes/overrides/Tabs.ts new file mode 100644 index 0000000..91268d3 --- /dev/null +++ b/src/WebUI/src/themes/overrides/Tabs.ts @@ -0,0 +1,13 @@ +// ==============================|| OVERRIDES - TABS ||============================== // + +export default function Tabs() { + return { + MuiTabs: { + styleOverrides: { + vertical: { + overflow: 'visible' + } + } + } + }; +} diff --git a/src/WebUI/src/themes/overrides/ToggleButton.ts b/src/WebUI/src/themes/overrides/ToggleButton.ts new file mode 100644 index 0000000..9595c81 --- /dev/null +++ b/src/WebUI/src/themes/overrides/ToggleButton.ts @@ -0,0 +1,23 @@ +// material-ui +import { Theme } from '@mui/material/styles'; + +// ==============================|| OVERRIDES - TOGGLE BUTTON ||============================== // + +export default function ToggleButton(theme: Theme) { + return { + MuiToggleButton: { + styleOverrides: { + root: { + '&.Mui-disabled': { + borderColor: theme.vars.palette.divider, + color: theme.vars.palette.text.disabled + }, + '&:focus-visible': { + outline: `2px solid ${theme.vars.palette.secondary.dark}`, + outlineOffset: 2 + } + } + } + } + }; +} diff --git a/src/WebUI/src/themes/overrides/Tooltip.ts b/src/WebUI/src/themes/overrides/Tooltip.ts new file mode 100644 index 0000000..bdf2b36 --- /dev/null +++ b/src/WebUI/src/themes/overrides/Tooltip.ts @@ -0,0 +1,16 @@ +// material-ui +import { Theme } from '@mui/material/styles'; + +// ==============================|| OVERRIDES - TOOLTIP ||============================== // + +export default function Tooltip(theme: Theme) { + return { + MuiTooltip: { + styleOverrides: { + tooltip: { + color: theme.vars.palette.background.paper + } + } + } + }; +} diff --git a/src/WebUI/src/themes/overrides/Typography.ts b/src/WebUI/src/themes/overrides/Typography.ts new file mode 100644 index 0000000..1044c9a --- /dev/null +++ b/src/WebUI/src/themes/overrides/Typography.ts @@ -0,0 +1,13 @@ +// ==============================|| OVERRIDES - TYPOGRAPHY ||============================== // + +export default function Typography() { + return { + MuiTypography: { + styleOverrides: { + gutterBottom: { + marginBottom: 12 + } + } + } + }; +} diff --git a/src/WebUI/src/themes/overrides/index.ts b/src/WebUI/src/themes/overrides/index.ts new file mode 100644 index 0000000..315bba8 --- /dev/null +++ b/src/WebUI/src/themes/overrides/index.ts @@ -0,0 +1,106 @@ +// material-ui +import { Theme } from '@mui/material/styles'; + +// third-party +import { merge } from 'lodash-es'; + +// project imports +import Accordion from './Accordion'; +import AccordionDetails from './AccordionDetails'; +import AccordionSummary from './AccordionSummary'; +import Alert from './Alert'; +import AlertTitle from './AlertTitle'; +import Autocomplete from './Autocomplete'; +import Badge from './Badge'; +import Button from './Button'; +import ButtonBase from './ButtonBase'; +import ButtonGroup from './ButtonGroup'; +import CardContent from './CardContent'; +import Checkbox from './Checkbox'; +import Chip from './Chip'; +import Dialog from './Dialog'; +import DialogContentText from './DialogContentText'; +import DialogTitle from './DialogTitle'; +import Drawer from './Drawer'; +import Fab from './Fab'; +import FormHelperText from './FormHelperText'; +import IconButton from './IconButton'; +import InputBase from './InputBase'; +import InputLabel from './InputLabel'; +import LinearProgress from './LinearProgress'; +import Link from './Link'; +import ListItemButton from './ListItemButton'; +import ListItemIcon from './ListItemIcon'; +import OutlinedInput from './OutlinedInput'; +import Pagination from './Pagination'; +import PaginationItem from './PaginationItem'; +import Popover from './Popover'; +import Radio from './Radio'; +import Rating from './Rating'; +import Slider from './Slider'; +import Switch from './Switch'; +import Tab from './Tab'; +import TableBody from './TableBody'; +import TableCell from './TableCell'; +import TableContainer from './TableContainer'; +import TableFooter from './TableFooter'; +import TableHead from './TableHead'; +import TablePagination from './TablePagination'; +import TableRow from './TableRow'; +import Tabs from './Tabs'; +import ToggleButton from './ToggleButton'; +import Tooltip from './Tooltip'; +import Typography from './Typography'; + +// ==============================|| OVERRIDES - MAIN ||============================== // + +export default function ComponentsOverrides(theme: Theme) { + return merge( + Accordion(theme), + AccordionDetails(theme), + AccordionSummary(theme), + Alert(theme), + AlertTitle(), + Autocomplete(), + Badge(theme), + Button(theme), + ButtonBase(), + ButtonGroup(), + CardContent(), + Checkbox(theme), + Chip(theme), + Dialog(theme), + DialogContentText(theme), + DialogTitle(), + Drawer(), + Fab(theme), + FormHelperText(), + IconButton(theme), + InputBase(), + InputLabel(theme), + LinearProgress(), + Link(), + ListItemButton(theme), + ListItemIcon(theme), + OutlinedInput(theme), + Pagination(), + PaginationItem(theme), + Popover(theme), + Radio(theme), + Rating(theme), + Slider(theme), + Switch(theme), + Tab(theme), + TableBody(theme), + TableCell(theme), + TableContainer(), + TableFooter(theme), + TableHead(theme), + TablePagination(), + TableRow(), + Tabs(), + ToggleButton(theme), + Tooltip(theme), + Typography() + ); +} diff --git a/src/WebUI/src/themes/palette.ts b/src/WebUI/src/themes/palette.ts new file mode 100644 index 0000000..e2c433a --- /dev/null +++ b/src/WebUI/src/themes/palette.ts @@ -0,0 +1,163 @@ +// material-ui +import { PaletteMode } from '@mui/material/styles'; + +// third-party +import { generate } from '@ant-design/colors'; + +// project imports +import { ThemeMode } from 'config'; +import { extendPaletteWithChannels } from 'utils/colorUtils'; + +// types +import { PaletteThemeProps } from 'types/theme'; + +/** + * Seeds for the generated ramps. The accent is the console blue; status + * colors are tuned to stay readable on both slate surfaces. + */ +const SEEDS = { + primary: { light: '#2a63e6', dark: '#2f6bed' }, + success: { light: '#1c9a52', dark: '#22a55b' }, + warning: { light: '#d18f00', dark: '#e3a008' }, + error: { light: '#db383f', dark: '#e5484d' }, + info: { light: '#0b93b6', dark: '#0e9fc4' } +} as const; + +/** Slate surfaces: cool greys with a paper card on a slightly darker canvas. */ +const SURFACES = { + light: { + grey: { + 0: '#ffffff', + 50: '#f5f7fa', + 100: '#f1f5f9', + 200: '#dde4ed', + 300: '#c3cedb', + 400: '#94a3b8', + 500: '#64748b', + 600: '#475569', + 700: '#334155', + 800: '#1e293b', + 900: '#0f172a', + A50: '#e9edf2', + A100: '#ffffff', + A200: '#dde4ed', + A400: '#c3cedb', + A700: '#94a3b8', + A800: '#d5dce6' + }, + background: '#e9edf2', + paper: '#ffffff', + text: '#172033', + textSecondary: '#4b5b72', + textDisabled: '#7f8ea3', + divider: '#d5dce6' + }, + dark: { + grey: { + 0: '#0a101c', + 50: '#0e1524', + 100: '#121a2b', + 200: '#1b2537', + 300: '#2a3549', + 400: '#475569', + 500: '#64748b', + 600: '#94a3b8', + 700: '#cbd5e1', + 800: '#e2e8f0', + 900: '#f8fafc', + A50: '#0b111d', + A100: '#121a2b', + A200: '#334155', + A400: '#1e293b', + A700: '#0f172a', + A800: '#222d40' + }, + background: '#0b111d', + paper: '#121a2b', + text: '#e2e8f0', + textSecondary: '#94a3b8', + textDisabled: '#5b6b82', + divider: '#1f2a3d' + } +} as const; + +type Mode = 'light' | 'dark'; + +/** Ten-step ramp (lightest first) for a seed; dark mode blends toward the dark canvas. */ +function ramp(seed: string, mode: Mode): string[] { + return mode === 'dark' ? generate(seed, { theme: 'dark', backgroundColor: SURFACES.dark.background }) : generate(seed); +} + +function status(seed: string, mode: Mode, contrastText = '#fff') { + const r = ramp(seed, mode); + return { lighter: r[0], light: r[2], main: r[5], dark: r[7], darker: r[9], contrastText }; +} + +function buildMode(mode: Mode): PaletteThemeProps { + const g = SURFACES[mode].grey; + const p = ramp(SEEDS.primary[mode], mode); + + return { + primary: { + lighter: p[0], + 100: p[1], + 200: p[2], + light: p[3], + 400: p[4], + main: p[5], + dark: p[6], + 700: p[7], + darker: p[8], + 900: p[9], + contrastText: '#fff' + }, + secondary: { + lighter: g[100], + 100: g[100], + 200: g[200], + light: g[300], + 400: g[400], + main: g[500], + 600: g[600], + dark: g[700], + 800: g[800], + darker: g[900], + A100: g[0], + A200: g.A400, + A300: g.A700, + contrastText: g[0] + }, + error: status(SEEDS.error[mode], mode), + warning: status(SEEDS.warning[mode], mode, mode === 'dark' ? g[0] : '#fff'), + info: status(SEEDS.info[mode], mode), + success: status(SEEDS.success[mode], mode), + grey: { ...g } + }; +} + +// ==============================|| THEME - PALETTE ||============================== // + +export function buildPalette() { + const commonColor = extendPaletteWithChannels({ common: { black: '#000', white: '#fff' } }); + + const build = (mode: Mode) => { + const surfaces = SURFACES[mode]; + return { + mode: (mode === 'dark' ? ThemeMode.DARK : ThemeMode.LIGHT) as PaletteMode, + ...commonColor, + ...extendPaletteWithChannels(buildMode(mode)), + text: { primary: surfaces.text, secondary: surfaces.textSecondary, disabled: surfaces.textDisabled }, + action: { disabled: surfaces.textDisabled }, + divider: surfaces.divider, + background: { paper: surfaces.paper, default: surfaces.background } + }; + }; + + return { light: build('light'), dark: build('dark') }; +} + +/** Categorical chart colors per mode (CSS variables --chart-1..6 are set from these). */ +export const CHART_COLORS = { + light: ['#2a78d6', '#e0602c', '#13956a', '#c98500', '#d55181', '#7f8ea3'], + dark: ['#3987e5', '#d95926', '#199e70', '#c98500', '#d55181', '#64748b'] +} as const; diff --git a/src/WebUI/src/themes/typography.ts b/src/WebUI/src/themes/typography.ts new file mode 100644 index 0000000..5540529 --- /dev/null +++ b/src/WebUI/src/themes/typography.ts @@ -0,0 +1,77 @@ +// material-ui +import { TypographyVariantsOptions } from '@mui/material/styles'; + +// types +type FontFamily = string; + +// ==============================|| DEFAULT THEME - TYPOGRAPHY ||============================== // + +export default function Typography(fontFamily: FontFamily): TypographyVariantsOptions { + return { + htmlFontSize: 16, + fontFamily, + fontWeightLight: 300, + fontWeightRegular: 400, + fontWeightMedium: 500, + fontWeightBold: 600, + h1: { + fontWeight: 600, + fontSize: '2.375rem', + lineHeight: 1.21 + }, + h2: { + fontWeight: 600, + fontSize: '1.875rem', + lineHeight: 1.27 + }, + h3: { + fontWeight: 600, + fontSize: '1.5rem', + lineHeight: 1.33 + }, + h4: { + fontWeight: 600, + fontSize: '1.25rem', + lineHeight: 1.4 + }, + h5: { + fontWeight: 600, + fontSize: '1rem', + lineHeight: 1.5 + }, + h6: { + fontWeight: 400, + fontSize: '0.875rem', + lineHeight: 1.57 + }, + caption: { + fontWeight: 400, + fontSize: '0.75rem', + lineHeight: 1.66 + }, + body1: { + fontSize: '0.875rem', + lineHeight: 1.57 + }, + body2: { + fontSize: '0.75rem', + lineHeight: 1.66 + }, + subtitle1: { + fontSize: '0.875rem', + fontWeight: 600, + lineHeight: 1.57 + }, + subtitle2: { + fontSize: '0.75rem', + fontWeight: 500, + lineHeight: 1.66 + }, + overline: { + lineHeight: 1.66 + }, + button: { + textTransform: 'capitalize' + } + }; +} diff --git a/src/WebUI/src/types/extended.ts b/src/WebUI/src/types/extended.ts new file mode 100644 index 0000000..7d9aca2 --- /dev/null +++ b/src/WebUI/src/types/extended.ts @@ -0,0 +1,19 @@ +// material-ui +import { Theme } from '@mui/material/styles'; +import { ButtonProps } from '@mui/material/Button'; +import { ChipProps } from '@mui/material/Chip'; +import { IconButtonProps } from '@mui/material/IconButton'; +import { SliderProps } from '@mui/material/Slider'; + +// ==============================|| EXTENDED COMPONENT - TYPES ||============================== // + +export type ButtonVariantProps = 'contained' | 'light' | 'outlined' | 'dashed' | 'text' | 'shadow'; +export type IconButtonShapeProps = 'rounded' | 'square'; +type TooltipColor = 'primary' | 'secondary' | 'info' | 'success' | 'warning' | 'error' | 'default'; +export type ColorProps = ChipProps['color'] | ButtonProps['color'] | IconButtonProps['color'] | SliderProps['color'] | TooltipColor; +export type AvatarTypeProps = 'filled' | 'outlined' | 'combined'; +export type SizeProps = 'badge' | 'xs' | 'sm' | 'md' | 'lg' | 'xl'; +export type ExtendedStyleProps = { + color: ColorProps; + theme: Theme; +}; diff --git a/src/WebUI/src/types/menu.ts b/src/WebUI/src/types/menu.ts new file mode 100644 index 0000000..df097c9 --- /dev/null +++ b/src/WebUI/src/types/menu.ts @@ -0,0 +1,24 @@ +import { ComponentType, CSSProperties } from 'react'; + +// ==============================|| MENU TYPES ||============================== // + +export type NavIcon = ComponentType<{ style?: CSSProperties }>; + +export interface NavItemType { + id: string; + title: string; + url: string; + icon: NavIcon; + /** Permission needed to use the page; without it the entry stays visible but disabled. */ + permission?: string; + /** Human name of the permission for the hover reason. */ + permissionLabel?: string; + /** Match only the exact path (the dashboard at "/"). */ + exact?: boolean; +} + +export interface NavGroupType { + id: string; + title: string; + children: NavItemType[]; +} diff --git a/src/WebUI/src/types/overrides/Alert.d.ts b/src/WebUI/src/types/overrides/Alert.d.ts new file mode 100644 index 0000000..3784c2d --- /dev/null +++ b/src/WebUI/src/types/overrides/Alert.d.ts @@ -0,0 +1,12 @@ +// eslint-disable-next-line +import * as Alert from '@mui/material/Alert'; + +declare module '@mui/material/Alert' { + interface AlertPropsColorOverrides { + primary; + secondary; + } + interface AlertPropsVariantOverrides { + border; + } +} diff --git a/src/WebUI/src/types/overrides/Badge.d.ts b/src/WebUI/src/types/overrides/Badge.d.ts new file mode 100644 index 0000000..ce59b6e --- /dev/null +++ b/src/WebUI/src/types/overrides/Badge.d.ts @@ -0,0 +1,8 @@ +// eslint-disable-next-line +import * as Badge from '@mui/material/Badge'; + +declare module '@mui/material/Badge' { + interface BadgePropsVariantOverrides { + light; + } +} diff --git a/src/WebUI/src/types/overrides/Button.d.ts b/src/WebUI/src/types/overrides/Button.d.ts new file mode 100644 index 0000000..4ccebd4 --- /dev/null +++ b/src/WebUI/src/types/overrides/Button.d.ts @@ -0,0 +1,14 @@ +// eslint-disable-next-line +import * as Button from '@mui/material/Button'; + +declare module '@mui/material/Button' { + interface ButtonPropsVariantOverrides { + dashed; + shadow; + light; + } + + interface ButtonPropsSizeOverrides { + extraSmall; + } +} diff --git a/src/WebUI/src/types/overrides/Checkbox.d.ts b/src/WebUI/src/types/overrides/Checkbox.d.ts new file mode 100644 index 0000000..9f2b27b --- /dev/null +++ b/src/WebUI/src/types/overrides/Checkbox.d.ts @@ -0,0 +1,8 @@ +// eslint-disable-next-line +import * as Checkbox from '@mui/material/Checkbox'; + +declare module '@mui/material/Checkbox' { + interface CheckboxPropsSizeOverrides { + large; + } +} diff --git a/src/WebUI/src/types/overrides/Chip.d.ts b/src/WebUI/src/types/overrides/Chip.d.ts new file mode 100644 index 0000000..5e37bd0 --- /dev/null +++ b/src/WebUI/src/types/overrides/Chip.d.ts @@ -0,0 +1,12 @@ +// eslint-disable-next-line +import * as Chip from '@mui/material/Chip'; + +declare module '@mui/material/Chip' { + interface ChipPropsVariantOverrides { + light; + combined; + } + interface ChipPropsSizeOverrides { + large; + } +} diff --git a/src/WebUI/src/types/overrides/Pagination.d.ts b/src/WebUI/src/types/overrides/Pagination.d.ts new file mode 100644 index 0000000..071f14d --- /dev/null +++ b/src/WebUI/src/types/overrides/Pagination.d.ts @@ -0,0 +1,15 @@ +// eslint-disable-next-line +import * as Pagination from '@mui/material/Pagination'; + +declare module '@mui/material/Pagination' { + interface PaginationPropsColorOverrides { + error; + success; + warning; + info; + } + interface PaginationPropsVariantOverrides { + contained; + combined; + } +} diff --git a/src/WebUI/src/types/overrides/Radio.d.ts b/src/WebUI/src/types/overrides/Radio.d.ts new file mode 100644 index 0000000..c0c6ff3 --- /dev/null +++ b/src/WebUI/src/types/overrides/Radio.d.ts @@ -0,0 +1,8 @@ +// eslint-disable-next-line +import * as Radio from '@mui/material/Radio'; + +declare module '@mui/material/Radio' { + interface RadioPropsSizeOverrides { + large; + } +} diff --git a/src/WebUI/src/types/overrides/Slider.d.ts b/src/WebUI/src/types/overrides/Slider.d.ts new file mode 100644 index 0000000..0e68aed --- /dev/null +++ b/src/WebUI/src/types/overrides/Slider.d.ts @@ -0,0 +1,11 @@ +// eslint-disable-next-line +import * as Slider from '@mui/material/Slider'; + +declare module '@mui/material/Slider' { + interface SliderPropsColorOverrides { + error; + success; + warning; + info; + } +} diff --git a/src/WebUI/src/types/overrides/Switch.d.ts b/src/WebUI/src/types/overrides/Switch.d.ts new file mode 100644 index 0000000..937e936 --- /dev/null +++ b/src/WebUI/src/types/overrides/Switch.d.ts @@ -0,0 +1,8 @@ +// eslint-disable-next-line +import * as Switch from '@mui/material/Switch'; + +declare module '@mui/material/Switch' { + interface SwitchPropsSizeOverrides { + large; + } +} diff --git a/src/WebUI/src/types/overrides/createPalette.d.ts b/src/WebUI/src/types/overrides/createPalette.d.ts new file mode 100644 index 0000000..3776fe5 --- /dev/null +++ b/src/WebUI/src/types/overrides/createPalette.d.ts @@ -0,0 +1,40 @@ +// eslint-disable-next-line +import * as createPalette from '@mui/material/styles'; + +type ShadeKeys = { + 0?: string; + 50?: string; + 100?: string; + 200?: string; + 300?: string; + 400?: string; + 500?: string; + 600?: string; + 700?: string; + 800?: string; + 900?: string; + A50?: string; + A100?: string; + A200?: string; + A300?: string; + A400?: string; + A700?: string; + A800?: string; +}; + +declare module '@mui/material/styles' { + interface SimplePaletteColorOptions extends Partial { + lighter?: string; + darker?: string; + } + + interface PaletteColorOptions extends Partial { + lighter?: string; + darker?: string; + } + + interface PaletteColor extends ShadeKeys { + lighter: string; + darker: string; + } +} diff --git a/src/WebUI/src/types/overrides/createTheme.d.ts b/src/WebUI/src/types/overrides/createTheme.d.ts new file mode 100644 index 0000000..4eea294 --- /dev/null +++ b/src/WebUI/src/types/overrides/createTheme.d.ts @@ -0,0 +1,26 @@ +// material-ui +// eslint-disable-next-line +import * as Theme from '@mui/material/styles'; + +// project imports +import { CustomShadowProps } from 'types/theme'; + +declare module '@mui/material/styles' { + interface Theme { + customShadows: CustomShadowProps; + } + + interface ColorSystemOptions { + customShadows?: CustomShadowProps; + } + + interface ThemeOptions { + customShadows?: CustomShadowProps; + } + + interface ThemeVars { + customShadows: CustomShadowProps; + typography: Theme['typography']; + transitions: Theme['transitions']; + } +} diff --git a/src/WebUI/src/types/overrides/index.d.ts b/src/WebUI/src/types/overrides/index.d.ts new file mode 100644 index 0000000..836607c --- /dev/null +++ b/src/WebUI/src/types/overrides/index.d.ts @@ -0,0 +1,11 @@ +// material-ui +// eslint-disable-next-line +import Color from '@mui/material/Color'; + +declare module '@mui/material/styles' { + interface Color { + 0?: string; + A50?: string; + A800?: string; + } +} diff --git a/src/WebUI/src/types/theme.ts b/src/WebUI/src/types/theme.ts new file mode 100644 index 0000000..a5aac9d --- /dev/null +++ b/src/WebUI/src/types/theme.ts @@ -0,0 +1,34 @@ +// material-ui +import { SimplePaletteColorOptions, PaletteColorOptions } from '@mui/material/styles'; + +// ==============================|| DEFAULT THEME - TYPES ||============================== // + +export type PaletteThemeProps = { + primary: SimplePaletteColorOptions; + secondary: SimplePaletteColorOptions; + error: SimplePaletteColorOptions; + warning: SimplePaletteColorOptions; + info: SimplePaletteColorOptions; + success: SimplePaletteColorOptions; + grey: PaletteColorOptions; +}; + +export type CustomShadowProps = { + button: string; + text: string; + z1: string; + primary: string; + primaryButton: string; + secondary: string; + secondaryButton: string; + error: string; + errorButton: string; + warning: string; + warningButton: string; + info: string; + infoButton: string; + success: string; + successButton: string; + grey: string; + greyButton: string; +}; diff --git a/src/WebUI/src/utils/colorUtils.ts b/src/WebUI/src/utils/colorUtils.ts new file mode 100644 index 0000000..95f7fd0 --- /dev/null +++ b/src/WebUI/src/utils/colorUtils.ts @@ -0,0 +1,68 @@ +// material-ui +import { alpha } from '@mui/material/styles'; + +// ==============================|| CUSTOM FUNCTION - WITH ALPHA ||============================== // + +/** + * Converts a hex color string to an RGB channel string ("r g b"). + * + * @param hex - The hex color string (e.g. "#C8FAD6", "#FFF", "#FF00FFAA"). + * @returns The RGB channel string (e.g. "200 250 214"). + * @throws {Error} If the input is not a valid hex color. + */ +export function hexToRgbChannel(hex: string): string { + let cleaned = hex.replace(/^#/, ''); + + if (cleaned.length === 3) { + cleaned = cleaned + .split('') + .map((c) => c + c) + .join(''); + } + if (cleaned.length === 4) { + cleaned = cleaned + .split('') + .map((c) => c + c) + .join(''); + } + + if (cleaned.length !== 6 && cleaned.length !== 8) { + throw new Error(`Invalid hex color: ${hex}`); + } + + const r = parseInt(cleaned.substring(0, 2), 16); + const g = parseInt(cleaned.substring(2, 4), 16); + const b = parseInt(cleaned.substring(4, 6), 16); + + return `${r} ${g} ${b}`; +} + +export function extendPaletteWithChannels>(palette: T): T { + const result: Record = { ...palette }; + + Object.entries(palette).forEach(([k, v]) => { + if (typeof v === 'string' && v.startsWith('#')) { + result[`${k}Channel`] = hexToRgbChannel(v); + } else if (typeof v === 'object' && v !== null) { + result[k] = extendPaletteWithChannels(v as Record); + } + }); + + return result as T; +} + +export function withAlpha(color: string, opacity: number) { + // Case 1: normal color (hex, rgb, hsl…) + if (/^#|rgb|hsl|color/i.test(color)) { + return alpha(color, opacity); + } + + // Case 2: CSS Var: var(--mui-palette-xxx) or var(--palette-xxx, #hex) + if (color.startsWith('var(')) { + // inject "Channel" *before the closing parenthesis of the var name only* + return color.replace(/(--[a-zA-Z0-9-]+)(.*)\)/, `$1Channel$2)`).replace(/^var\((.+)\)$/, `rgba(var($1) / ${opacity})`); + } + + // Fallback + return color; +} diff --git a/src/WebUI/src/utils/format.ts b/src/WebUI/src/utils/format.ts new file mode 100644 index 0000000..13b628e --- /dev/null +++ b/src/WebUI/src/utils/format.ts @@ -0,0 +1,47 @@ +/** "3 minutes ago" / "in 2 hours" (Intl, so it reads naturally in the browser locale). */ +export function formatRelative(value: string | number | Date, now = Date.now()): string { + const time = new Date(value).getTime(); + if (Number.isNaN(time)) return '—'; + const seconds = Math.round((time - now) / 1000); + const abs = Math.abs(seconds); + const rtf = new Intl.RelativeTimeFormat(undefined, { numeric: 'auto' }); + if (abs < 45) return seconds <= 0 ? 'just now' : 'in a moment'; + if (abs < 3600) return rtf.format(Math.round(seconds / 60), 'minute'); + if (abs < 86_400) return rtf.format(Math.round(seconds / 3600), 'hour'); + if (abs < 86_400 * 30) return rtf.format(Math.round(seconds / 86_400), 'day'); + if (abs < 86_400 * 365) return rtf.format(Math.round(seconds / (86_400 * 30)), 'month'); + return rtf.format(Math.round(seconds / (86_400 * 365)), 'year'); +} + +export function formatAbsolute(value: string | number | Date): string { + const date = new Date(value); + return Number.isNaN(date.getTime()) ? '—' : date.toLocaleString(undefined, { dateStyle: 'medium', timeStyle: 'short' }); +} + +export function formatBytes(bytes?: number | null): string { + if (!bytes) return '—'; + const units = ['B', 'KB', 'MB', 'GB', 'TB']; + let value = bytes; + let unit = 0; + while (value >= 1024 && unit < units.length - 1) { + value /= 1024; + unit++; + } + return `${value.toFixed(value >= 100 ? 0 : 1)} ${units[unit]}`; +} + +/** "1 device" / "3 devices". */ +export function plural(count: number, singular: string, pluralForm = `${singular}s`): string { + return `${count.toLocaleString()} ${count === 1 ? singular : pluralForm}`; +} + +export function formatDuration(fromUtc?: string | null, toUtc?: string | null): string { + if (!fromUtc || !toUtc) return '—'; + const ms = new Date(toUtc).getTime() - new Date(fromUtc).getTime(); + if (ms < 0 || Number.isNaN(ms)) return '—'; + if (ms < 1000) return `${ms} ms`; + const s = ms / 1000; + if (s < 60) return `${s.toFixed(s < 10 ? 1 : 0)} s`; + const m = Math.floor(s / 60); + return m < 60 ? `${m} min ${Math.round(s % 60)} s` : `${Math.floor(m / 60)} h ${m % 60} min`; +} diff --git a/src/WebUI/src/utils/getColors.ts b/src/WebUI/src/utils/getColors.ts new file mode 100644 index 0000000..3dbdcc6 --- /dev/null +++ b/src/WebUI/src/utils/getColors.ts @@ -0,0 +1,24 @@ +// material-ui +import { Theme } from '@mui/material/styles'; + +// types +import { ColorProps } from 'types/extended'; + +// ==============================|| CUSTOM FUNCTION - COLORS ||============================== // + +export default function getColors(theme: Theme, color?: ColorProps) { + switch (color!) { + case 'secondary': + return theme.vars.palette.secondary; + case 'error': + return theme.vars.palette.error; + case 'warning': + return theme.vars.palette.warning; + case 'info': + return theme.vars.palette.info; + case 'success': + return theme.vars.palette.success; + default: + return theme.vars.palette.primary; + } +} diff --git a/src/WebUI/src/utils/getShadow.ts b/src/WebUI/src/utils/getShadow.ts new file mode 100644 index 0000000..345dc6a --- /dev/null +++ b/src/WebUI/src/utils/getShadow.ts @@ -0,0 +1,33 @@ +// material-ui +import { Theme } from '@mui/material/styles'; + +// ==============================|| CUSTOM FUNCTION - COLOR SHADOWS ||============================== // + +export default function getShadow(theme: Theme, shadow: string) { + switch (shadow) { + case 'secondary': + return theme.vars.customShadows.secondary; + case 'error': + return theme.vars.customShadows.error; + case 'warning': + return theme.vars.customShadows.warning; + case 'info': + return theme.vars.customShadows.info; + case 'success': + return theme.vars.customShadows.success; + case 'primaryButton': + return theme.vars.customShadows.primaryButton; + case 'secondaryButton': + return theme.vars.customShadows.secondaryButton; + case 'errorButton': + return theme.vars.customShadows.errorButton; + case 'warningButton': + return theme.vars.customShadows.warningButton; + case 'infoButton': + return theme.vars.customShadows.infoButton; + case 'successButton': + return theme.vars.customShadows.successButton; + default: + return theme.vars.customShadows.primary; + } +} diff --git a/src/WebUI/src/utils/route-guard/RequireAuth.tsx b/src/WebUI/src/utils/route-guard/RequireAuth.tsx new file mode 100644 index 0000000..c8f0422 --- /dev/null +++ b/src/WebUI/src/utils/route-guard/RequireAuth.tsx @@ -0,0 +1,19 @@ +import { ReactNode } from 'react'; +import { Navigate, useLocation } from 'react-router-dom'; + +// project imports +import Loader from 'components/Loader'; +import useSession from 'hooks/useSession'; + +/** Renders children for a signed-in session; otherwise sends the browser to sign-in and back. */ +export default function RequireAuth({ children }: { children: ReactNode }) { + const { session } = useSession(); + const location = useLocation(); + + if (session === null) return ; + if (!session.authenticated) { + const returnUrl = encodeURIComponent(location.pathname + location.search); + return ; + } + return <>{children}; +} diff --git a/src/WebUI/src/vite-env.d.ts b/src/WebUI/src/vite-env.d.ts new file mode 100644 index 0000000..db05183 --- /dev/null +++ b/src/WebUI/src/vite-env.d.ts @@ -0,0 +1,3 @@ +/// + +declare const __BUILD_VERSION__: string; diff --git a/src/WebUI/tsconfig.json b/src/WebUI/tsconfig.json index 7225a94..93f7282 100644 --- a/src/WebUI/tsconfig.json +++ b/src/WebUI/tsconfig.json @@ -1,20 +1,25 @@ { - "extends": "./.svelte-kit/tsconfig.json", - "compilerOptions": { - "rewriteRelativeImportExtensions": true, - "allowJs": true, - "checkJs": true, - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "resolveJsonModule": true, - "skipLibCheck": true, - "sourceMap": true, - "strict": true, - "moduleResolution": "bundler" - } - // Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias - // except $lib which is handled by https://svelte.dev/docs/kit/configuration#files - // - // To make changes to top-level options such as include and exclude, we recommend extending - // the generated config; see https://svelte.dev/docs/kit/configuration#typescript + "compilerOptions": { + "target": "ESNext", + "useDefineForClassFields": true, + "lib": ["DOM", "ESNext"], + "allowJs": false, + "skipLibCheck": true, + "strict": true, + "forceConsistentCasingInFileNames": true, + "module": "ESNext", + "moduleResolution": "bundler", + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react-jsx", + "types": ["node"], + "noUncheckedSideEffectImports": false, + "paths": { + "*": ["./src/*"] + } + }, + "exclude": ["node_modules"], + "include": ["src", "**/*.ts", "**/*.tsx", "src/**/*"], + "references": [{ "path": "./tsconfig.node.json" }] } diff --git a/src/WebUI/tsconfig.node.json b/src/WebUI/tsconfig.node.json new file mode 100644 index 0000000..1bb53d1 --- /dev/null +++ b/src/WebUI/tsconfig.node.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "composite": true, + "module": "ESNext", + "moduleResolution": "bundler" + }, + "include": ["vite.config.mts"] +} diff --git a/src/WebUI/vite.config.mts b/src/WebUI/vite.config.mts new file mode 100644 index 0000000..bd0a6b4 --- /dev/null +++ b/src/WebUI/vite.config.mts @@ -0,0 +1,38 @@ +import { defineConfig } from 'vite'; +import react from '@vitejs/plugin-react'; + +// The console is a static SPA: `vite build` writes dist/, which the webui +// container serves through server.mjs and the combined self-contained server +// binary embeds and serves itself (see scripts/Package-Server.ps1). +export default defineConfig({ + plugins: [react()], + resolve: { + tsconfigPaths: true + }, + define: { + // Shown in the drawer footer; CI passes the unified version. + __BUILD_VERSION__: JSON.stringify(process.env.PUBLIC_BUILD_VERSION || 'dev') + }, + server: { + port: 13080, + // Local development against `docker compose -f IaC/compose/docker-compose.yml -f IaC/compose/docker-compose.dev.yml up` + // (or a locally running backend + NATS). Production is same-origin via the reverse proxy. + proxy: { + '/api': { + target: process.env.DEV_BACKEND_URL ?? 'http://localhost:19080', + changeOrigin: false + }, + '/messaging': { + target: process.env.DEV_NATS_WS_URL ?? 'ws://localhost:19222', + ws: true + } + } + }, + build: { + outDir: 'dist', + chunkSizeWarningLimit: 4000 + }, + optimizeDeps: { + include: ['@mui/material/Tooltip', 'react', 'react-dom', 'react-router-dom'] + } +}); diff --git a/src/WebUI/vite.config.ts b/src/WebUI/vite.config.ts deleted file mode 100644 index 4b6a030..0000000 --- a/src/WebUI/vite.config.ts +++ /dev/null @@ -1,38 +0,0 @@ -import adapterNode from '@sveltejs/adapter-node'; -import adapterStatic from '@sveltejs/adapter-static'; -import { sveltekit } from '@sveltejs/kit/vite'; -import { defineConfig } from 'vite'; - -export default defineConfig({ - plugins: [ - sveltekit({ - compilerOptions: { - // Force runes mode for the project, except for libraries. Can be removed in svelte 6. - runes: ({ filename }) => - filename.split(/[/\\]/).includes('node_modules') ? undefined : true - }, - - // ADAPTER=static produces a SPA build (build-static/) that the - // combined self-contained server binary embeds and serves itself; - // the default node build backs the webui container. - adapter: - process.env.ADAPTER === 'static' - ? adapterStatic({ pages: 'build-static', assets: 'build-static', fallback: 'index.html' }) - : adapterNode() - }) - ], - server: { - // Local development against `docker compose -f IaC/compose/docker-compose.yml -f IaC/compose/docker-compose.dev.yml up` - // (or a locally running backend + NATS). Production is same-origin via the reverse proxy. - proxy: { - '/api': { - target: process.env.DEV_BACKEND_URL ?? 'http://localhost:19080', - changeOrigin: false - }, - '/messaging': { - target: process.env.DEV_NATS_WS_URL ?? 'ws://localhost:19222', - ws: true - } - } - } -}); -- 2.52.0 From 1c2b0c135f835951bcfa9832860434222d7e0d15439b2d1b2f69505d712bb95b Mon Sep 17 00:00:00 2001 From: Alphaeus Mote Date: Thu, 22 Oct 2026 21:34:17 -0400 Subject: [PATCH 06/72] fix(webui): alerts under MUI 9; readable selected navigation in dark mode - The Mantis Alert override read ownerState.color, which MUI 9 leaves unset when only `severity` is given, so any standard Alert threw while styling (the Settings page went to the router error boundary). Fall back to the severity. - The selected drawer entry used primary.900 in dark mode; generated dark ramps run darkest-first, so that was a light pill under white text. The subtle `lighter` tint with `main` text works in both schemes. Co-Authored-By: Claude Opus 5.5 --- .../Drawer/DrawerContent/Navigation/NavItem.tsx | 9 +++++---- src/WebUI/src/themes/overrides/Alert.ts | 9 +++++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/WebUI/src/layout/Dashboard/Drawer/DrawerContent/Navigation/NavItem.tsx b/src/WebUI/src/layout/Dashboard/Drawer/DrawerContent/Navigation/NavItem.tsx index 49921ee..9cc1ad4 100644 --- a/src/WebUI/src/layout/Dashboard/Drawer/DrawerContent/Navigation/NavItem.tsx +++ b/src/WebUI/src/layout/Dashboard/Drawer/DrawerContent/Navigation/NavItem.tsx @@ -41,7 +41,7 @@ export default function NavItem({ item }: { item: NavItemType }) { } if (downLG) handlerDrawerOpen(false); }} - sx={(theme) => ({ + sx={{ mx: drawerOpen ? 1.5 : 1, my: 0.25, borderRadius: 1.5, @@ -49,13 +49,14 @@ export default function NavItem({ item }: { item: NavItemType }) { px: drawerOpen ? 1.5 : 1.25, justifyContent: drawerOpen ? 'flex-start' : 'center', ...(gate && { opacity: 0.5, cursor: 'default', '&:hover': { bgcolor: 'transparent' } }), + // Both schemes: dark ramps run darkest-first, so "lighter" is the subtle + // tint there too and "main" stays readable on it. '&.Mui-selected': { bgcolor: 'primary.lighter', color: 'primary.main', - ...theme.applyStyles('dark', { bgcolor: 'primary.900', color: 'primary.light' }), - '&:hover': { bgcolor: 'primary.lighter', ...theme.applyStyles('dark', { bgcolor: 'primary.900' }) } + '&:hover': { bgcolor: 'primary.lighter' } } - })} + }} > diff --git a/src/WebUI/src/themes/overrides/Alert.ts b/src/WebUI/src/themes/overrides/Alert.ts index ea2c45a..c57ca1d 100644 --- a/src/WebUI/src/themes/overrides/Alert.ts +++ b/src/WebUI/src/themes/overrides/Alert.ts @@ -42,6 +42,11 @@ function generateColorVariants(theme: Theme) { ); } +/** MUI 9 leaves ownerState.color unset when only severity is given; fall back to it. */ +function alertColor(theme: Theme, ownerState: AlertProps): PaletteColor { + return theme.palette[(ownerState.color ?? ownerState.severity ?? 'success') as keyof Palette] as PaletteColor; +} + // ==============================|| OVERRIDES - ALERT ||============================== // export default function Alert(theme: Theme) { @@ -57,7 +62,7 @@ export default function Alert(theme: Theme) { { props: { variant: 'standard' }, style: ({ ownerState }: { ownerState: AlertProps }) => { - const paletteColor = theme.palette[ownerState.color as keyof Palette] as PaletteColor; + const paletteColor = alertColor(theme, ownerState); return { position: 'relative', backgroundColor: paletteColor.lighter, @@ -83,7 +88,7 @@ export default function Alert(theme: Theme) { { props: { variant: 'filled' }, style: ({ ownerState }: { ownerState: AlertProps }) => { - const paletteColor = theme.palette[ownerState.color as keyof Palette] as PaletteColor; + const paletteColor = alertColor(theme, ownerState); return { color: theme.vars.palette.grey[0], backgroundColor: paletteColor.main, -- 2.52.0 From f666c6ebd5772f45af109af87d87bc4d12b92482cd77a208d3c730a75223336c Mon Sep 17 00:00:00 2001 From: Alphaeus Mote Date: Thu, 22 Oct 2026 21:34:40 -0400 Subject: [PATCH 07/72] feat(webui): dashboard, jobs, functions, access, settings and shell on MUI Ports the remaining SvelteKit pages feature-for-feature onto the new shell: - Dashboard: KPI tiles, the 14-day execution timeline, outcome/platform/ engine/exit-code/target/script charts (dependency-free SVG on the theme's chart colors, with tooltips and screen-reader tables), recent runs, the live activity feed and deploy tracker. - Jobs: filters by device, script, state and execution (?runId= shows one run's targets until they finish); JobOutputDrawer is the shared output viewer (stored + live output, progress, stream filters, search, copy, download, polling fallback). - Functions: Monaco editing via a shared CodeEditor (lazy Monaco, PowerShell completions, follows light/dark), clone, deep links, unsaved prompts. - Access: users and roles in sheets; role device scopes pick groups by their nested path; system roles read-only with clone. - Settings: authentication (all sign-in modes), enrollment tokens, secrets providers, S3 and agent package, appearance; the Add Device dialog keeps the per-OS install commands and adds the MSI/portable ZIP choice the install endpoint already supported. - Remote shell: the same NATS shell protocol in xterm, sized to the page, with reconnect; output bytes go straight to xterm so split multi-byte characters no longer garble. Devices, groups, scripts and schedules follow in their own commits. Co-Authored-By: Claude Opus 5.5 --- src/WebUI/src/components/CodeEditor.tsx | 157 +++++++ src/WebUI/src/components/KpiCard.tsx | 74 +++ src/WebUI/src/components/charts/BarList.tsx | 83 ++++ .../src/components/charts/ChartTooltip.tsx | 37 ++ src/WebUI/src/components/charts/Donut.tsx | 156 +++++++ .../src/components/charts/TimelineChart.tsx | 227 +++++++++ src/WebUI/src/pages/access/index.tsx | 97 ++++ src/WebUI/src/pages/dashboard/index.tsx | 244 ++++++++++ src/WebUI/src/pages/devices/shell.tsx | 99 ++++ src/WebUI/src/pages/functions/index.tsx | 193 ++++++++ src/WebUI/src/pages/jobs/index.tsx | 333 +++++++++++++ src/WebUI/src/pages/settings/index.tsx | 76 +++ src/WebUI/src/routes/index.tsx | 18 +- src/WebUI/src/sections/access/RoleSheet.tsx | 289 ++++++++++++ src/WebUI/src/sections/access/RolesTab.tsx | 253 ++++++++++ src/WebUI/src/sections/access/UserSheet.tsx | 135 ++++++ src/WebUI/src/sections/access/UsersTab.tsx | 280 +++++++++++ src/WebUI/src/sections/access/groupPaths.ts | 22 + .../src/sections/dashboard/ActivityFeed.tsx | 98 ++++ .../src/sections/dashboard/LiveDeployment.tsx | 81 ++++ .../src/sections/dashboard/RecentRuns.tsx | 73 +++ .../src/sections/devices/AddDeviceDialog.tsx | 296 ++++++++++++ .../src/sections/functions/FunctionEditor.tsx | 230 +++++++++ .../src/sections/jobs/JobOutputDrawer.tsx | 442 ++++++++++++++++++ .../sections/settings/AppearanceSettings.tsx | 48 ++ .../settings/AuthenticationSettings.tsx | 390 ++++++++++++++++ .../sections/settings/EnrollmentTokens.tsx | 318 +++++++++++++ src/WebUI/src/sections/settings/Field.tsx | 31 ++ .../src/sections/settings/InstallControls.tsx | 102 ++++ .../sections/settings/SecretsProviders.tsx | 442 ++++++++++++++++++ .../src/sections/settings/StorageSettings.tsx | 386 +++++++++++++++ src/WebUI/src/sections/settings/TestSteps.tsx | 46 ++ .../src/sections/settings/installCommands.ts | 59 +++ src/WebUI/src/sections/settings/keys.ts | 16 + src/WebUI/src/sections/settings/useDraft.ts | 14 + .../src/sections/shell/useRemoteShell.ts | 221 +++++++++ src/WebUI/src/utils/powershell-completions.ts | 269 +++++++++++ 37 files changed, 6329 insertions(+), 6 deletions(-) create mode 100644 src/WebUI/src/components/CodeEditor.tsx create mode 100644 src/WebUI/src/components/KpiCard.tsx create mode 100644 src/WebUI/src/components/charts/BarList.tsx create mode 100644 src/WebUI/src/components/charts/ChartTooltip.tsx create mode 100644 src/WebUI/src/components/charts/Donut.tsx create mode 100644 src/WebUI/src/components/charts/TimelineChart.tsx create mode 100644 src/WebUI/src/pages/access/index.tsx create mode 100644 src/WebUI/src/pages/dashboard/index.tsx create mode 100644 src/WebUI/src/pages/devices/shell.tsx create mode 100644 src/WebUI/src/pages/functions/index.tsx create mode 100644 src/WebUI/src/pages/jobs/index.tsx create mode 100644 src/WebUI/src/pages/settings/index.tsx create mode 100644 src/WebUI/src/sections/access/RoleSheet.tsx create mode 100644 src/WebUI/src/sections/access/RolesTab.tsx create mode 100644 src/WebUI/src/sections/access/UserSheet.tsx create mode 100644 src/WebUI/src/sections/access/UsersTab.tsx create mode 100644 src/WebUI/src/sections/access/groupPaths.ts create mode 100644 src/WebUI/src/sections/dashboard/ActivityFeed.tsx create mode 100644 src/WebUI/src/sections/dashboard/LiveDeployment.tsx create mode 100644 src/WebUI/src/sections/dashboard/RecentRuns.tsx create mode 100644 src/WebUI/src/sections/devices/AddDeviceDialog.tsx create mode 100644 src/WebUI/src/sections/functions/FunctionEditor.tsx create mode 100644 src/WebUI/src/sections/jobs/JobOutputDrawer.tsx create mode 100644 src/WebUI/src/sections/settings/AppearanceSettings.tsx create mode 100644 src/WebUI/src/sections/settings/AuthenticationSettings.tsx create mode 100644 src/WebUI/src/sections/settings/EnrollmentTokens.tsx create mode 100644 src/WebUI/src/sections/settings/Field.tsx create mode 100644 src/WebUI/src/sections/settings/InstallControls.tsx create mode 100644 src/WebUI/src/sections/settings/SecretsProviders.tsx create mode 100644 src/WebUI/src/sections/settings/StorageSettings.tsx create mode 100644 src/WebUI/src/sections/settings/TestSteps.tsx create mode 100644 src/WebUI/src/sections/settings/installCommands.ts create mode 100644 src/WebUI/src/sections/settings/keys.ts create mode 100644 src/WebUI/src/sections/settings/useDraft.ts create mode 100644 src/WebUI/src/sections/shell/useRemoteShell.ts create mode 100644 src/WebUI/src/utils/powershell-completions.ts diff --git a/src/WebUI/src/components/CodeEditor.tsx b/src/WebUI/src/components/CodeEditor.tsx new file mode 100644 index 0000000..735f3ba --- /dev/null +++ b/src/WebUI/src/components/CodeEditor.tsx @@ -0,0 +1,157 @@ +import { useEffect, useRef, useState } from 'react'; + +// material-ui +import { useColorScheme } from '@mui/material/styles'; +import Box from '@mui/material/Box'; +import Skeleton from '@mui/material/Skeleton'; + +// project imports +import { MONO_FONT_FAMILY } from 'config'; +import { registerPowerShellCompletions, type CompletionContext } from 'utils/powershell-completions'; + +// assets +import EditorWorker from 'monaco-editor/editor/editor.worker.js?worker'; + +// types +import type * as Monaco from 'monaco-editor'; + +export type CodeLanguage = 'powershell' | 'shell' | 'plaintext'; + +interface Props { + value: string; + onChange?: (value: string) => void; + language: CodeLanguage; + readOnly?: boolean; + /** Editor height (CSS length or px); defaults to 480. */ + height?: number | string; + /** Curated PowerShell completions (cmdlets, keywords, snippets); on by default. */ + intellisense?: boolean; + /** Script-specific completions ($Param, $Secrets.X, $Files.X) offered with the curated ones. */ + completionContext?: CompletionContext; +} + +interface CompletionSource { + intellisense: boolean; + completionContext?: CompletionContext; +} + +/** Each mounted editor's completion settings, by model URI (one provider serves them all). */ +const completionSources = new Map(); + +let monacoLoading: Promise | null = null; + +/** Loads Monaco once (lazily, so pages without an editor never pay for it) and registers the PowerShell completions. */ +function loadMonaco(): Promise { + monacoLoading ??= import('monaco-editor').then((monaco) => { + self.MonacoEnvironment = { getWorker: () => new EditorWorker() }; + registerPowerShellCompletions(monaco, 'powershell', (model) => { + const source = completionSources.get(model.uri.toString())?.current; + return source?.intellisense ? (source.completionContext ?? {}) : null; + }); + return monaco; + }); + return monacoLoading; +} + +// ==============================|| CODE EDITOR (MONACO) ||============================== // + +export default function CodeEditor({ + value, + onChange, + language, + readOnly = false, + height = 480, + intellisense = true, + completionContext +}: Props) { + const { colorScheme } = useColorScheme(); + const hostRef = useRef(null); + const [instance, setInstance] = useState<{ monaco: typeof Monaco; editor: Monaco.editor.IStandaloneCodeEditor } | null>(null); + const [loadError, setLoadError] = useState(''); + + // Latest props for long-lived Monaco callbacks. + const onChangeRef = useRef(onChange); + const sourceRef = useRef({ intellisense, completionContext }); + const initialRef = useRef({ value, language, readOnly }); + useEffect(() => { + onChangeRef.current = onChange; + sourceRef.current = { intellisense, completionContext }; + }); + + useEffect(() => { + let cancelled = false; + let editor: Monaco.editor.IStandaloneCodeEditor | null = null; + let uri = ''; + + loadMonaco() + .then((monaco) => { + if (cancelled || !hostRef.current) return; + const initial = initialRef.current; + editor = monaco.editor.create(hostRef.current, { + value: initial.value, + language: initial.language, + readOnly: initial.readOnly, + automaticLayout: true, + minimap: { enabled: false }, + fontSize: 13, + fontFamily: MONO_FONT_FAMILY, + scrollBeyondLastLine: false, + renderWhitespace: 'selection' + }); + uri = editor.getModel()?.uri.toString() ?? ''; + completionSources.set(uri, sourceRef); + const current = editor; + current.onDidChangeModelContent(() => onChangeRef.current?.(current.getValue())); + setInstance({ monaco, editor: current }); + }) + .catch(() => { + if (!cancelled) setLoadError('The code editor could not be loaded.'); + }); + + return () => { + cancelled = true; + completionSources.delete(uri); + // Disposing the editor also disposes the model it created. + editor?.dispose(); + }; + }, []); + + // Theme is global to Monaco; follow the resolved MUI color scheme. + useEffect(() => { + instance?.monaco.editor.setTheme(colorScheme === 'dark' ? 'vs-dark' : 'vs'); + }, [instance, colorScheme]); + + useEffect(() => { + const model = instance?.editor.getModel(); + if (instance && model) instance.monaco.editor.setModelLanguage(model, language); + }, [instance, language]); + + useEffect(() => { + instance?.editor.updateOptions({ readOnly }); + }, [instance, readOnly]); + + // Adopt outside changes (e.g. a different document loaded) without echoing the editor's own edits. + useEffect(() => { + if (instance && instance.editor.getValue() !== value) instance.editor.setValue(value); + }, [instance, value]); + + return ( + + {!instance && ( + + {loadError || } + + )} + + + ); +} diff --git a/src/WebUI/src/components/KpiCard.tsx b/src/WebUI/src/components/KpiCard.tsx new file mode 100644 index 0000000..e1c5495 --- /dev/null +++ b/src/WebUI/src/components/KpiCard.tsx @@ -0,0 +1,74 @@ +import { ReactNode } from 'react'; +import { Link as RouterLink } from 'react-router-dom'; + +// material-ui +import CardActionArea from '@mui/material/CardActionArea'; +import Skeleton from '@mui/material/Skeleton'; +import Stack from '@mui/material/Stack'; +import Typography from '@mui/material/Typography'; + +// project imports +import Avatar from 'components/@extended/Avatar'; +import MainCard from 'components/MainCard'; + +export type KpiTone = 'primary' | 'secondary' | 'success' | 'warning' | 'error' | 'info'; + +interface Props { + title: string; + value: ReactNode; + /** One short line under the value ("3 online · 2 offline"). */ + caption?: ReactNode; + icon?: ReactNode; + /** Color of the icon badge; the value itself stays in text ink. */ + tone?: KpiTone; + /** Makes the whole card a link. */ + to?: string; + /** Shows skeletons in place of the value and caption. */ + loading?: boolean; +} + +// ==============================|| KPI CARD ||============================== // + +export default function KpiCard({ title, value, caption, icon, tone = 'primary', to, loading }: Props) { + const body = ( + + + + {title} + + + {loading ? : value} + + {(caption || loading) && ( + + {loading ? : caption} + + )} + + {icon && ( + + {icon} + + )} + + ); + + return ( + ({ + height: 1, + transition: 'border-color 0.15s', + ...(to && { '&:hover': { borderColor: theme.vars.palette.primary.main } }) + })} + > + {to ? ( + + {body} + + ) : ( + body + )} + + ); +} diff --git a/src/WebUI/src/components/charts/BarList.tsx b/src/WebUI/src/components/charts/BarList.tsx new file mode 100644 index 0000000..493c420 --- /dev/null +++ b/src/WebUI/src/components/charts/BarList.tsx @@ -0,0 +1,83 @@ +// material-ui +import Box from '@mui/material/Box'; +import Stack from '@mui/material/Stack'; +import Tooltip from '@mui/material/Tooltip'; +import Typography from '@mui/material/Typography'; + +// project imports +import ChartTooltip from './ChartTooltip'; + +// types +import type { CountPoint } from 'api/types'; + +interface Props { + items: CountPoint[]; + /** One hue for the whole list (a single series). */ + color?: string; + emptyText?: string; + /** Accessible name for the list ("Jobs by script engine"). */ + label: string; + /** Unit for the tooltip ("jobs"). */ + unit?: string; +} + +// ==============================|| CHART - BAR LIST ||============================== // + +/** Horizontal bars for ranked counts: label, proportional bar, value. */ +export default function BarList({ items, color = 'var(--chart-1)', emptyText = 'No data yet.', label, unit = 'jobs' }: Props) { + if (items.length === 0) { + return ( + + {emptyText} + + ); + } + + const max = Math.max(1, ...items.map((i) => i.count)); + const total = items.reduce((sum, i) => sum + i.count, 0); + + return ( + + {items.map((item) => { + const share = total > 0 ? Math.round((item.count / total) * 100) : 0; + return ( + } + > + ({ + display: 'grid', + gridTemplateColumns: 'minmax(0, 9rem) 1fr auto', + alignItems: 'center', + gap: 1.5, + py: 0.5, + px: 0.5, + borderRadius: 1, + outline: 'none', + '& .bar': { transition: 'opacity 0.15s' }, + '&:hover, &:focus-visible': { bgcolor: theme.vars.palette.action.hover }, + '&:hover .bar, &:focus-visible .bar': { opacity: 0.8 } + })} + > + + {item.label} + + + ({ fill: theme.vars.palette.divider })} /> + + + + {item.count.toLocaleString()} + + + + ); + })} + + ); +} diff --git a/src/WebUI/src/components/charts/ChartTooltip.tsx b/src/WebUI/src/components/charts/ChartTooltip.tsx new file mode 100644 index 0000000..2f8fae0 --- /dev/null +++ b/src/WebUI/src/components/charts/ChartTooltip.tsx @@ -0,0 +1,37 @@ +// material-ui +import Box from '@mui/material/Box'; +import Stack from '@mui/material/Stack'; +import Typography from '@mui/material/Typography'; + +export interface TooltipRow { + label: string; + value: number | string; + /** Series color, shown as a short line key. */ + color?: string; +} + +// ==============================|| CHART TOOLTIP CONTENT ||============================== // + +/** Tooltip body for chart marks: a heading, then value-first rows keyed by a short stroke of the series color. */ +export default function ChartTooltip({ heading, rows }: { heading?: string; rows: TooltipRow[] }) { + return ( + + {heading && ( + + {heading} + + )} + {rows.map((row) => ( + + {row.color && } + + {typeof row.value === 'number' ? row.value.toLocaleString() : row.value} + + + {row.label} + + + ))} + + ); +} diff --git a/src/WebUI/src/components/charts/Donut.tsx b/src/WebUI/src/components/charts/Donut.tsx new file mode 100644 index 0000000..26b87b3 --- /dev/null +++ b/src/WebUI/src/components/charts/Donut.tsx @@ -0,0 +1,156 @@ +import { useState } from 'react'; + +// material-ui +import Box from '@mui/material/Box'; +import Stack from '@mui/material/Stack'; +import Tooltip from '@mui/material/Tooltip'; +import Typography from '@mui/material/Typography'; + +// project imports +import ChartTooltip from './ChartTooltip'; + +export interface DonutSegment { + label: string; + value: number; + color: string; +} + +interface Props { + segments: DonutSegment[]; + /** Accessible name for the chart ("Job outcomes"). */ + label: string; + centerValue?: string; + centerLabel?: string; + size?: number; + thickness?: number; + /** Show the legend (label, count, share) beside the ring. */ + legend?: boolean; +} + +/** Surface gap between adjacent arcs, in px along the ring. */ +const GAP = 2; + +const percent = (value: number, total: number) => (total > 0 ? `${Math.round((value / total) * 100)}%` : '0%'); + +// ==============================|| CHART - DONUT ||============================== // + +/** A quiet donut: arcs proportional to value, a centered total, and a legend that highlights its arc. */ +export default function Donut({ segments, label, centerValue, centerLabel, size = 132, thickness = 16, legend = true }: Props) { + const [hovered, setHovered] = useState(null); + + const center = size / 2; + // Leave room for the hovered arc to thicken without clipping. + const radius = (size - thickness) / 2 - 2; + const circumference = 2 * Math.PI * radius; + const total = segments.reduce((sum, s) => sum + s.value, 0); + const visible = segments.filter((s) => s.value > 0); + const gap = visible.length > 1 ? GAP : 0; + + let offset = 0; + const arcs = visible.map((s) => { + const length = (s.value / total) * circumference; + const arc = { ...s, dash: Math.max(length - gap, 0.5), offset }; + offset += length; + return arc; + }); + + const summary = `${label}: ${segments.map((s) => `${s.label} ${s.value}`).join(', ') || 'no data'}`; + + return ( + + + + {summary} + + {arcs.length === 0 && ( + ({ fill: 'none', stroke: theme.vars.palette.divider, strokeWidth: thickness })} + /> + )} + {arcs.map((arc) => ( + + } + > + setHovered(arc.label)} + onMouseLeave={() => setHovered(null)} + style={{ + fill: 'none', + stroke: arc.color, + strokeWidth: hovered === arc.label ? thickness + 4 : thickness, + opacity: hovered && hovered !== arc.label ? 0.55 : 1, + transition: 'stroke-width 0.15s, opacity 0.15s', + cursor: 'default' + }} + /> + + ))} + + + + {centerValue && ( + + {centerValue} + + )} + {centerLabel && ( + + {centerLabel} + + )} + + + + {legend && ( + + {segments.map((s) => ( + setHovered(s.value > 0 ? s.label : null)} + onMouseLeave={() => setHovered(null)} + sx={(theme) => ({ + display: 'grid', + gridTemplateColumns: '10px minmax(0, 1fr) auto auto', + alignItems: 'center', + gap: 1, + px: 0.5, + py: 0.25, + borderRadius: 1, + ...(hovered === s.label && { bgcolor: theme.vars.palette.action.hover }) + })} + > + + + {s.label} + + + {s.value.toLocaleString()} + + + {percent(s.value, total)} + + + ))} + + )} + + ); +} diff --git a/src/WebUI/src/components/charts/TimelineChart.tsx b/src/WebUI/src/components/charts/TimelineChart.tsx new file mode 100644 index 0000000..c8f64e9 --- /dev/null +++ b/src/WebUI/src/components/charts/TimelineChart.tsx @@ -0,0 +1,227 @@ +import { useEffect, useRef, useState } from 'react'; + +// material-ui +import { useTheme } from '@mui/material/styles'; +import Box from '@mui/material/Box'; +import Stack from '@mui/material/Stack'; +import Tooltip from '@mui/material/Tooltip'; +import Typography from '@mui/material/Typography'; + +// project imports +import ChartTooltip from './ChartTooltip'; + +// types +import type { DayPoint } from 'api/types'; + +interface Props { + days: DayPoint[]; + height?: number; + /** Accessible name ("Executions over the last 14 days"). */ + label?: string; + emptyText?: string; +} + +type SeriesKey = 'succeeded' | 'failed' | 'other'; + +const AXIS_HEIGHT = 20; +const TOP_PAD = 14; +/** Surface gap between stacked segments. */ +const GAP = 2; +const RADIUS = 4; + +/** Off-screen but still read by assistive technology. */ +const visuallyHidden = { + position: 'absolute', + width: '1px', + height: '1px', + overflow: 'hidden', + clip: 'rect(0 0 0 0)', + whiteSpace: 'nowrap', + border: 0, + p: 0, + m: '-1px' +} as const; + +/** A rect with only its top corners rounded (the data end; the baseline end stays square). */ +function topRoundedRect(x: number, y: number, w: number, h: number, r: number) { + const radius = Math.min(r, h, w / 2); + return `M${x},${y + h} V${y + radius} Q${x},${y} ${x + radius},${y} H${x + w - radius} Q${x + w},${y} ${x + w},${y + radius} V${y + h} Z`; +} + +/** Tracks an element's content width. */ +function useWidth() { + const ref = useRef(null); + const [width, setWidth] = useState(0); + useEffect(() => { + const element = ref.current; + if (!element) return; + const observer = new ResizeObserver(([entry]) => setWidth(entry.contentRect.width)); + observer.observe(element); + return () => observer.disconnect(); + }, []); + return [ref, width] as const; +} + +// ==============================|| CHART - EXECUTIONS TIMELINE ||============================== // + +/** Stacked columns of executions per day (succeeded / failed / other) with a per-day hover readout. */ +export default function TimelineChart({ + days, + height = 150, + label = 'Executions over the last 14 days', + emptyText = 'No executions in the last 14 days.' +}: Props) { + const theme = useTheme(); + const [ref, width] = useWidth(); + const [hovered, setHovered] = useState(null); + + // Status colors: these segments are outcomes, so they wear the status palette. + const series: { key: SeriesKey; label: string; color: string }[] = [ + { key: 'succeeded', label: 'Succeeded', color: theme.vars.palette.success.main }, + { key: 'failed', label: 'Failed', color: theme.vars.palette.error.main }, + { key: 'other', label: 'Other', color: 'var(--chart-6)' } + ]; + + const sumOf = (d: DayPoint) => d.succeeded + d.failed + d.other; + const max = Math.max(1, ...days.map(sumOf)); + const total = days.reduce((sum, d) => sum + sumOf(d), 0); + + const plotHeight = height - AXIS_HEIGHT - TOP_PAD; + const baseline = TOP_PAD + plotHeight; + const slot = days.length > 0 ? width / days.length : 0; + const barWidth = Math.max(Math.min(slot * 0.62, 28), 2); + const labelStep = Math.max(1, Math.ceil((days.length * 52) / Math.max(width, 1))); + + return ( + + + {total === 0 ? ( + + {emptyText} + + ) : ( + width > 0 && ( + + {`${label}: ${total} in total`} + + {/* recessive grid: top line labelled with the scale maximum, and the baseline */} + + + {max} + + + + {days.map((day, i) => { + const x = i * slot + (slot - barWidth) / 2; + let y = baseline; + const stacked = series.filter((s) => day[s.key] > 0); + const segments = stacked.map((s, index) => { + const h = (day[s.key] / max) * plotHeight; + const top = y - h; + // Every segment above the first gives up GAP px at its bottom. + const drawn = index > 0 ? Math.max(h - GAP, 0.5) : Math.max(h, 1); + y = top; + return { ...s, top, drawn, last: index === stacked.length - 1 }; + }); + + const readout = ( + ({ label: s.label, value: day[s.key], color: s.color })), + { label: 'Total', value: sumOf(day) } + ]} + /> + ); + + return ( + + {segments.map((s) => + s.last ? ( + + ) : ( + + ) + )} + {i % labelStep === 0 && ( + + {day.date} + + )} + {/* the whole column is the hit target */} + + setHovered(i)} + onMouseLeave={() => setHovered(null)} + onFocus={() => setHovered(i)} + onBlur={() => setHovered(null)} + style={{ fill: 'transparent', outline: 'none' }} + /> + + + ); + })} + + ) + )} + + + {total > 0 && ( + <> + + {series.map((s) => ( + + + + {s.label} + + + ))} + + + {/* the same numbers as a table, for screen readers */} + + {label} + + + Day + {series.map((s) => ( + + {s.label} + + ))} + + + + {days.map((day) => ( + + {day.date} + {series.map((s) => ( + {day[s.key]} + ))} + + ))} + + + + )} + + ); +} diff --git a/src/WebUI/src/pages/access/index.tsx b/src/WebUI/src/pages/access/index.tsx new file mode 100644 index 0000000..d6f1106 --- /dev/null +++ b/src/WebUI/src/pages/access/index.tsx @@ -0,0 +1,97 @@ +import { useSearchParams } from 'react-router-dom'; + +// material-ui +import Chip from '@mui/material/Chip'; +import Stack from '@mui/material/Stack'; +import Tab from '@mui/material/Tab'; +import Tabs from '@mui/material/Tabs'; + +// project imports +import PageHeader from 'components/PageHeader'; +import RolesTab from 'sections/access/RolesTab'; +import UsersTab from 'sections/access/UsersTab'; +import { errorMessage, keys } from 'api/client'; +import useApi from 'hooks/useApi'; +import { useGate } from 'hooks/useSession'; + +// assets +import SafetyOutlined from '@ant-design/icons/SafetyOutlined'; +import TeamOutlined from '@ant-design/icons/TeamOutlined'; + +// types +import type { DeviceGroupDto, PermissionGroupDto, RoleDto, UserAccountDto } from 'api/types'; + +type AccessTab = 'users' | 'roles'; + +function TabLabel({ label, count }: { label: string; count?: number }) { + return ( + + {label} + {count !== undefined && } + + ); +} + +// ==============================|| ACCESS CONTROL ||============================== // + +export default function AccessPage() { + const [params, setParams] = useSearchParams(); + const tab: AccessTab = params.get('tab') === 'roles' ? 'roles' : 'users'; + const gate = useGate('access.manage', 'Manage Access'); + + const users = useApi(keys.users); + const roles = useApi(keys.roles); + const catalog = useApi(keys.permissionCatalog); + const groups = useApi(keys.groups); + + const setTab = (next: AccessTab) => + setParams( + (current) => { + const updated = new URLSearchParams(current); + updated.set('tab', next); + return updated; + }, + { replace: true } + ); + + return ( + + + + setTab(value)} sx={{ borderBottom: 1, borderColor: 'divider' }}> + } iconPosition="start" label={} /> + } iconPosition="start" label={} /> + + + {tab === 'users' ? ( + + ) : ( + + )} + + ); +} diff --git a/src/WebUI/src/pages/dashboard/index.tsx b/src/WebUI/src/pages/dashboard/index.tsx new file mode 100644 index 0000000..b8fbc9e --- /dev/null +++ b/src/WebUI/src/pages/dashboard/index.tsx @@ -0,0 +1,244 @@ +import { ReactNode } from 'react'; + +// material-ui +import { useTheme } from '@mui/material/styles'; +import Alert from '@mui/material/Alert'; +import Grid from '@mui/material/Grid'; +import Skeleton from '@mui/material/Skeleton'; +import Stack from '@mui/material/Stack'; + +// project imports +import BarList from 'components/charts/BarList'; +import Donut, { DonutSegment } from 'components/charts/Donut'; +import TimelineChart from 'components/charts/TimelineChart'; +import KpiCard from 'components/KpiCard'; +import MainCard from 'components/MainCard'; +import PageHeader from 'components/PageHeader'; +import useApi from 'hooks/useApi'; +import useLiveRefresh from 'hooks/useLiveRefresh'; +import { useGate } from 'hooks/useSession'; +import ActivityFeed from 'sections/dashboard/ActivityFeed'; +import LiveDeployment from 'sections/dashboard/LiveDeployment'; +import RecentRuns from 'sections/dashboard/RecentRuns'; +import { errorMessage, keys } from 'api/client'; +import type { CountPoint, DashboardDto } from 'api/types'; + +// assets +import CheckCircleOutlined from '@ant-design/icons/CheckCircleOutlined'; +import CloseCircleOutlined from '@ant-design/icons/CloseCircleOutlined'; +import DesktopOutlined from '@ant-design/icons/DesktopOutlined'; +import HistoryOutlined from '@ant-design/icons/HistoryOutlined'; +import SyncOutlined from '@ant-design/icons/SyncOutlined'; + +/** A slow poll keeps the aggregates current even without a live connection. */ +const POLL_MS = 15_000; + +/** Fleet platforms in a fixed categorical order, so a platform keeps its color as the mix changes. */ +const PLATFORMS: Record = { + windows: { label: 'Windows', color: 'var(--chart-1)' }, + linux: { label: 'Linux', color: 'var(--chart-2)' }, + macos: { label: 'macOS', color: 'var(--chart-3)' }, + unknown: { label: 'Unknown', color: 'var(--chart-6)' } +}; + +function ChartCard({ title, children }: { title: string; children: ReactNode }) { + return ( + + {children} + + ); +} + +// ==============================|| DASHBOARD ||============================== // + +export default function Dashboard() { + const theme = useTheme(); + // The dashboard aggregates fleet data, so the API asks for View Devices. + const gate = useGate('devices.view', 'View Devices'); + const { data, error, loading, mutate } = useApi(gate ? null : keys.dashboard, { refreshInterval: POLL_MS }); + + // Presence flaps are frequent and only move the device counts; the poll covers them. + useLiveRefresh( + () => mutate(), + (event) => event.kind !== 'device-presence' + ); + + /** Job states (the API sends JobState names, "TimedOut") wear the same tones as their status chips. */ + const jobStates: Record = { + queued: { label: 'Queued', color: theme.vars.palette.secondary.main }, + dispatched: { label: 'Dispatched', color: theme.vars.palette.info.main }, + running: { label: 'Running', color: theme.vars.palette.primary.main }, + succeeded: { label: 'Succeeded', color: theme.vars.palette.success.main }, + failed: { label: 'Failed', color: theme.vars.palette.error.main }, + cancelled: { label: 'Cancelled', color: theme.vars.palette.secondary.light }, + timedout: { label: 'Timed Out', color: theme.vars.palette.warning.main } + }; + + const toSegments = (points: CountPoint[], known: Record, fallback: string[]) => { + let next = 0; + return points.map((p) => { + const entry = known[p.label.toLowerCase()]; + return { + label: entry?.label ?? p.label, + value: p.count, + color: entry?.color ?? fallback[next++ % fallback.length] + }; + }); + }; + + const stateSegments = toSegments(data?.jobsByState ?? [], jobStates, ['var(--chart-4)', 'var(--chart-5)']); + const platformSegments = toSegments(data?.devicesByPlatform ?? [], PLATFORMS, ['var(--chart-4)', 'var(--chart-5)']); + + const pending = !data; + const header = ; + + if (gate) { + return ( + + {header} + {gate} Ask an administrator for access to see fleet and run statistics. + + ); + } + + return ( + + {header} + + {error && !data && {errorMessage(error, 'The dashboard could not be loaded.')}} + + void mutate()} /> + + + + } + tone="primary" + to="/devices" + loading={pending} + /> + + + } + tone="info" + to="/jobs" + loading={pending} + /> + + + } + tone="success" + to="/jobs" + loading={pending} + /> + + + 0} />} + tone="warning" + to="/jobs" + loading={pending} + /> + + + } + tone={data && data.jobsFailed > 0 ? 'error' : 'secondary'} + to="/jobs?state=failed" + loading={pending} + /> + + + + {pending ? ( + loading && ( + + {Array.from({ length: 4 }, (_, i) => ( + + + + ))} + + ) + ) : ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + )} + + ); +} diff --git a/src/WebUI/src/pages/devices/shell.tsx b/src/WebUI/src/pages/devices/shell.tsx new file mode 100644 index 0000000..5b39400 --- /dev/null +++ b/src/WebUI/src/pages/devices/shell.tsx @@ -0,0 +1,99 @@ +import { useParams } from 'react-router-dom'; + +// material-ui +import Alert from '@mui/material/Alert'; +import Box from '@mui/material/Box'; +import Button from '@mui/material/Button'; +import Stack from '@mui/material/Stack'; + +// project imports +import GatedButton from 'components/GatedButton'; +import MainCard from 'components/MainCard'; +import PageHeader from 'components/PageHeader'; +import StatusChip from 'components/StatusChip'; +import useApi from 'hooks/useApi'; +import useSession, { useGate } from 'hooks/useSession'; +import useRemoteShell, { ShellState, TERMINAL_THEME } from 'sections/shell/useRemoteShell'; +import { keys } from 'api/client'; +import type { DeviceDetailDto } from 'api/types'; + +// assets +import '@xterm/xterm/css/xterm.css'; +import PoweroffOutlined from '@ant-design/icons/PoweroffOutlined'; +import ReloadOutlined from '@ant-design/icons/ReloadOutlined'; + +/** Session state → status word (for the chip's tone) and label. */ +const STATUS: Record = { + connecting: { status: 'queued', label: 'Connecting' }, + opening: { status: 'dispatched', label: 'Opening Shell' }, + open: { status: 'online', label: 'Connected' }, + noResponse: { status: 'stale', label: 'No Response' }, + closed: { status: 'offline', label: 'Closed' }, + failed: { status: 'failed', label: 'Failed' }, + disconnected: { status: 'offline', label: 'Disconnected' } +}; + +/** States with a session that can still be closed from here. */ +const ACTIVE: ShellState[] = ['connecting', 'opening', 'open', 'noResponse']; + +function ShellView({ clientId }: { clientId: string }) { + const { can } = useSession(); + const gate = useGate('shell.use', 'Remote Shell'); + const allowed = !gate; + const { data: detail } = useApi(can('devices.view') ? keys.device(clientId) : null); + const { hostRef, state, message, hostname, close, reconnect } = useRemoteShell(clientId, allowed); + + const name = hostname || detail?.device.hostname || clientId.slice(0, 12); + const active = ACTIVE.includes(state); + const status = STATUS[state]; + + return ( + + {`Shell · ${name} · ExecuteR`} + } + primaryAction={ + active ? ( + + ) : ( + } onClick={reconnect} gate={gate}> + Reconnect + + ) + } + /> + + {gate ? ( + {gate} Ask an administrator for access to open shell sessions on devices. + ) : ( + <> + {(state === 'failed' || state === 'noResponse') && message && ( + {message} + )} + + + {/* xterm sizes itself to this element (the padding lives on the parent so fitting stays exact) */} + + + + + )} + + ); +} + +// ==============================|| DEVICE - REMOTE SHELL ||============================== // + +export default function DeviceShell() { + const { clientId = '' } = useParams(); + // A new device means a new terminal and session. + return ; +} diff --git a/src/WebUI/src/pages/functions/index.tsx b/src/WebUI/src/pages/functions/index.tsx new file mode 100644 index 0000000..c978a4c --- /dev/null +++ b/src/WebUI/src/pages/functions/index.tsx @@ -0,0 +1,193 @@ +import { useMemo, useState } from 'react'; +import { useSearchParams } from 'react-router-dom'; + +// material-ui +import Alert from '@mui/material/Alert'; +import Box from '@mui/material/Box'; +import Grid from '@mui/material/Grid'; +import InputAdornment from '@mui/material/InputAdornment'; +import List from '@mui/material/List'; +import ListItemButton from '@mui/material/ListItemButton'; +import ListItemText from '@mui/material/ListItemText'; +import Skeleton from '@mui/material/Skeleton'; +import Stack from '@mui/material/Stack'; +import TextField from '@mui/material/TextField'; + +// project imports +import ConfirmDialog from 'components/ConfirmDialog'; +import { RelativeTime } from 'components/DateTime'; +import EmptyState from 'components/EmptyState'; +import GatedButton from 'components/GatedButton'; +import MainCard from 'components/MainCard'; +import PageHeader from 'components/PageHeader'; +import FunctionEditor from 'sections/functions/FunctionEditor'; +import { errorMessage, keys } from 'api/client'; +import useApi from 'hooks/useApi'; +import { useGate } from 'hooks/useSession'; +import { plural } from 'utils/format'; + +// assets +import FunctionOutlined from '@ant-design/icons/FunctionOutlined'; +import PlusOutlined from '@ant-design/icons/PlusOutlined'; +import SearchOutlined from '@ant-design/icons/SearchOutlined'; + +// types +import type { FunctionModuleDto } from 'api/types'; + +const NEW = 'new'; + +// ==============================|| FUNCTIONS ||============================== // + +export default function FunctionsPage() { + const [params, setParams] = useSearchParams(); + const selectedId = params.get('id'); + const gate = useGate('functions.manage', 'Manage Functions'); + const { data: modules, error, loading } = useApi(keys.functions); + + const [search, setSearch] = useState(''); + const [dirty, setDirty] = useState(false); + // A switch waiting on "discard unsaved changes?" (undefined: none pending). + const [pending, setPending] = useState(undefined); + + const sorted = useMemo(() => [...(modules ?? [])].sort((a, b) => a.name.localeCompare(b.name)), [modules]); + const visible = useMemo(() => { + const needle = search.trim().toLowerCase(); + return needle ? sorted.filter((m) => m.name.toLowerCase().includes(needle) || m.description?.toLowerCase().includes(needle)) : sorted; + }, [sorted, search]); + + const selected = selectedId && selectedId !== NEW ? modules?.find((m) => m.id === selectedId) : undefined; + + const go = (id: string | null) => + setParams((current) => { + const next = new URLSearchParams(current); + if (id) next.set('id', id); + else next.delete('id'); + return next; + }); + + /** Switches module, asking first when the open one has unsaved edits. */ + const select = (id: string | null) => { + if (id === selectedId) return; + if (dirty) setPending(id); + else go(id); + }; + + let editor; + if (selectedId === NEW) { + editor = ( + m.name)} + gate={gate} + onSelect={go} + onDirtyChange={setDirty} + /> + ); + } else if (selected) { + editor = ( + m.name)} + gate={gate} + onSelect={go} + onDirtyChange={setDirty} + /> + ); + } else if (selectedId && loading) { + editor = ( + + + + ); + } else { + editor = ( + + } + title={selectedId ? 'Function Not Found' : 'No Function Selected'} + detail={selectedId ? 'It may have been deleted.' : 'Pick one from the list, or create a new one.'} + /> + + ); + } + + return ( + + } onClick={() => select(NEW)}> + New Function + + } + /> + + + + + + setSearch(e.target.value)} + slotProps={{ + input: { + startAdornment: ( + + + + ) + } + }} + /> + + {error && ( + + {errorMessage(error, 'Could not load functions.')} + + )} + {loading ? ( + + {Array.from({ length: 4 }, (_, i) => ( + + ))} + + ) : !error && sorted.length === 0 ? ( + + ) : !error && visible.length === 0 ? ( + + ) : ( + + {visible.map((m) => ( + select(m.id)} sx={{ borderRadius: 1 }}> + } + slotProps={{ primary: { noWrap: true, sx: { fontWeight: 600 } }, secondary: { component: 'div' } }} + /> + + ))} + + )} + + + {editor} + + + go(pending ?? null)} + onClose={() => setPending(undefined)} + /> + + ); +} diff --git a/src/WebUI/src/pages/jobs/index.tsx b/src/WebUI/src/pages/jobs/index.tsx new file mode 100644 index 0000000..ec11de7 --- /dev/null +++ b/src/WebUI/src/pages/jobs/index.tsx @@ -0,0 +1,333 @@ +import { MouseEvent, useCallback, useEffect, useMemo, useState } from 'react'; +import { Link as RouterLink, useSearchParams } from 'react-router-dom'; + +// material-ui +import Alert from '@mui/material/Alert'; +import Button from '@mui/material/Button'; +import Chip from '@mui/material/Chip'; +import InputAdornment from '@mui/material/InputAdornment'; +import Link from '@mui/material/Link'; +import MenuItem from '@mui/material/MenuItem'; +import Stack from '@mui/material/Stack'; +import TextField from '@mui/material/TextField'; +import Typography from '@mui/material/Typography'; + +// project imports +import DataTable, { Column } from 'components/DataTable'; +import { RelativeTime } from 'components/DateTime'; +import EmptyState from 'components/EmptyState'; +import HoverHelp from 'components/HoverHelp'; +import MainCard from 'components/MainCard'; +import PageHeader from 'components/PageHeader'; +import StatusChip, { JobStateChip, TERMINAL_JOB_STATES } from 'components/StatusChip'; +import JobOutputDrawer from 'sections/jobs/JobOutputDrawer'; +import { errorMessage, keys } from 'api/client'; +import useApi from 'hooks/useApi'; +import useLiveRefresh from 'hooks/useLiveRefresh'; +import { nats } from 'messaging/nats'; +import { formatDuration, plural } from 'utils/format'; + +// assets +import SearchOutlined from '@ant-design/icons/SearchOutlined'; + +// types +import type { ExecutionDetailDto, ExecutionTargetDto, JobDto, JobState } from 'api/types'; + +const STATES: { value: JobState; label: string }[] = [ + { value: 'queued', label: 'Queued' }, + { value: 'dispatched', label: 'Dispatched' }, + { value: 'running', label: 'Running' }, + { value: 'succeeded', label: 'Succeeded' }, + { value: 'failed', label: 'Failed' }, + { value: 'cancelled', label: 'Cancelled' }, + { value: 'timedOut', label: 'Timed Out' } +]; + +const LIMITS = [100, 250, 500]; + +/** A run's target as a job row (the run supplies script and requester). */ +const targetToJob = (target: ExecutionTargetDto, run: ExecutionDetailDto): JobDto => ({ + ...target, + scriptId: run.scriptId, + scriptName: run.scriptName, + requestedBy: run.requestedBy +}); + +const durationMs = (job: JobDto) => + job.startedUtc && job.completedUtc ? new Date(job.completedUtc).getTime() - new Date(job.startedUtc).getTime() : null; + +const stop = (event: MouseEvent) => event.stopPropagation(); + +// ==============================|| JOBS ||============================== // + +export default function JobsPage() { + const [params, setParams] = useSearchParams(); + const clientId = params.get('clientId') ?? undefined; + const scriptId = params.get('scriptId') ?? undefined; + const runId = params.get('runId') ?? undefined; + // Case-insensitive so links like ?state=failed (the dashboard's Failed tile) keep working. + const stateParam = params.get('state')?.toLowerCase() ?? ''; + const stateFilter = STATES.find((s) => s.value.toLowerCase() === stateParam)?.value ?? ''; + const openJobId = params.get('job'); + + const [limit, setLimit] = useState(100); + const [search, setSearch] = useState(''); + + // One run's jobs come from the execution itself; otherwise the (server-filtered) history. + const history = useApi(runId ? null : keys.jobs({ clientId, scriptId, limit })); + const execution = useApi(runId ? keys.execution(runId) : null, { + refreshInterval: (latest) => (latest && latest.targets.every((t) => TERMINAL_JOB_STATES.includes(t.state)) ? 0 : 5_000) + }); + const run = execution.data; + const source = runId ? execution : history; + const { mutate: mutateHistory } = history; + const { mutate: mutateExecution } = execution; + + const refresh = useCallback(() => (runId ? mutateExecution() : mutateHistory()), [runId, mutateExecution, mutateHistory]); + useLiveRefresh(refresh, (event) => Boolean(event.jobId)); + + // Job state changes arrive on the job channel too; coalesce bursts from group runs. + useEffect(() => { + let timer: number | undefined; + const off = nats.onJobEvent((_, event) => { + if (event.type !== 'job.state') return; + window.clearTimeout(timer); + timer = window.setTimeout(() => void refresh(), 500); + }); + return () => { + window.clearTimeout(timer); + off(); + }; + }, [refresh]); + + const allRows = useMemo(() => (runId ? run?.targets.map((t) => targetToJob(t, run)) : history.data), [runId, run, history.data]); + + const rows = useMemo(() => { + const needle = search.trim().toLowerCase(); + return allRows?.filter( + (job) => + (!stateFilter || job.state === stateFilter) && + // The run view filters locally; the history is already filtered by the server. + (!runId || ((!clientId || job.clientId === clientId) && (!scriptId || job.scriptId === scriptId))) && + (!needle || [job.scriptName, job.hostname, job.clientId, job.requestedBy, job.jobId].some((v) => v?.toLowerCase().includes(needle))) + ); + }, [allRows, stateFilter, runId, clientId, scriptId, search]); + + const setParam = (name: string, value: string | null, replace = true) => + setParams( + (current) => { + const next = new URLSearchParams(current); + if (value) next.set(name, value); + else next.delete(name); + return next; + }, + { replace } + ); + + const clearFilters = () => { + setSearch(''); + setParams((current) => { + const next = new URLSearchParams(); + const job = current.get('job'); + if (job) next.set('job', job); + return next; + }); + }; + + // Names for the filter chips, taken from the rows themselves. + const deviceName = clientId && (allRows?.find((j) => j.clientId === clientId)?.hostname ?? clientId); + const scriptName = scriptId && (allRows?.find((j) => j.scriptId === scriptId)?.scriptName ?? 'Script'); + const filtered = Boolean(stateFilter || clientId || scriptId || runId || search.trim()); + + const runCounts = useMemo(() => { + const counts = new Map(); + for (const target of run?.targets ?? []) counts.set(target.state, (counts.get(target.state) ?? 0) + 1); + return counts; + }, [run]); + + const columns: Column[] = [ + { + id: 'state', + header: 'State', + cell: (job) => , + sortValue: (job) => job.state, + width: 130 + }, + { + id: 'script', + header: 'Script', + cell: (job) => ( + + {job.scriptName} + + ), + sortValue: (job) => job.scriptName + }, + { + id: 'device', + header: 'Device', + cell: (job) => ( + + {job.hostname ?? job.clientId.slice(0, 10)} + + ), + sortValue: (job) => job.hostname ?? job.clientId + }, + { + id: 'requestedBy', + header: 'Requested By', + cell: (job) => ( + + {job.requestedBy ?? '—'} + + ), + sortValue: (job) => job.requestedBy + }, + { + id: 'created', + header: 'Created', + cell: (job) => , + sortValue: (job) => job.createdUtc, + nowrap: true + }, + { + id: 'duration', + header: 'Duration', + cell: (job) => formatDuration(job.startedUtc, job.completedUtc), + sortValue: durationMs, + nowrap: true + }, + { + id: 'exitCode', + header: 'Exit Code', + cell: (job) => {job.exitCode ?? '—'}, + sortValue: (job) => job.exitCode, + align: 'right', + width: 100 + } + ]; + + const toolbar = ( + + + setSearch(e.target.value)} + sx={{ width: { xs: '100%', sm: 260 } }} + slotProps={{ + input: { + startAdornment: ( + + + + ) + } + }} + /> + setParam('state', e.target.value || null)} + sx={{ minWidth: 160 }} + > + All States + {STATES.map((s) => ( + + {s.label} + + ))} + + {!runId && ( + setLimit(Number(e.target.value))} + sx={{ minWidth: 130 }} + > + {LIMITS.map((n) => ( + + Latest {n} + + ))} + + )} + {deviceName && setParam('clientId', null)} />} + {scriptName && setParam('scriptId', null)} />} + {runId && setParam('runId', null)} />} + {filtered && ( + + )} + + {run && ( + + + Started by {run.requestedBy ?? '—'} · {plural(run.targets.length, 'target')} + + {STATES.filter((s) => runCounts.has(s.value)).map((s) => ( + + ))} + + )} + + ); + + return ( + + + + + {runId ? 'Run Targets' : 'Job History'} + {!runId && } + + } + > + {runId && execution.error && !run ? ( + + {errorMessage(execution.error, 'Could not load the run.')} + + ) : ( + job.jobId} + loading={source.loading} + refreshing={source.validating} + error={source.error ? errorMessage(source.error, 'Could not load jobs.') : undefined} + toolbar={toolbar} + defaultSort={{ id: 'created', direction: 'desc' }} + onRowClick={(job) => setParam('job', job.jobId, false)} + activeRowId={openJobId ?? undefined} + empty={ + filtered && (allRows?.length ?? 0) > 0 ? ( + + Clear Filters + + } + /> + ) : ( + + ) + } + /> + )} + + + setParam('job', null)} /> + + ); +} diff --git a/src/WebUI/src/pages/settings/index.tsx b/src/WebUI/src/pages/settings/index.tsx new file mode 100644 index 0000000..9e25d39 --- /dev/null +++ b/src/WebUI/src/pages/settings/index.tsx @@ -0,0 +1,76 @@ +import { ComponentType, ReactElement, useState } from 'react'; +import { useSearchParams } from 'react-router-dom'; + +// material-ui +import Box from '@mui/material/Box'; +import Stack from '@mui/material/Stack'; +import Tab from '@mui/material/Tab'; +import Tabs from '@mui/material/Tabs'; + +// project imports +import PageHeader from 'components/PageHeader'; +import AppearanceSettings from 'sections/settings/AppearanceSettings'; +import AuthenticationSettings from 'sections/settings/AuthenticationSettings'; +import EnrollmentTokens from 'sections/settings/EnrollmentTokens'; +import SecretsProviders from 'sections/settings/SecretsProviders'; +import StorageSettings from 'sections/settings/StorageSettings'; + +// assets +import BgColorsOutlined from '@ant-design/icons/BgColorsOutlined'; +import CloudServerOutlined from '@ant-design/icons/CloudServerOutlined'; +import KeyOutlined from '@ant-design/icons/KeyOutlined'; +import LockOutlined from '@ant-design/icons/LockOutlined'; +import SafetyCertificateOutlined from '@ant-design/icons/SafetyCertificateOutlined'; + +const TABS: { id: string; label: string; icon: ReactElement; Section: ComponentType }[] = [ + { id: 'authentication', label: 'Authentication', icon: , Section: AuthenticationSettings }, + { id: 'enrollment', label: 'Enrollment Tokens', icon: , Section: EnrollmentTokens }, + { id: 'secrets', label: 'Secrets Providers', icon: , Section: SecretsProviders }, + { id: 'storage', label: 'Storage & Agent Package', icon: , Section: StorageSettings }, + { id: 'appearance', label: 'Appearance', icon: , Section: AppearanceSettings } +]; + +// ==============================|| SETTINGS ||============================== // + +export default function SettingsPage() { + const [params, setParams] = useSearchParams(); + const current = TABS.find((tab) => tab.id === params.get('tab')) ?? TABS[0]; + + // Sections stay mounted once visited, so unsaved edits survive a tab switch. + const [visited, setVisited] = useState([current.id]); + if (!visited.includes(current.id)) setVisited([...visited, current.id]); + + const select = (id: string) => + setParams( + (prev) => { + const next = new URLSearchParams(prev); + next.set('tab', id); + return next; + }, + { replace: true } + ); + + return ( + + + + select(id)} + variant="scrollable" + scrollButtons="auto" + aria-label="Settings sections" + > + {TABS.map((tab) => ( + + ))} + + + {TABS.filter((tab) => visited.includes(tab.id)).map(({ id, label, Section }) => ( +