feat(chat): route retail lifestone commands

Separate retail client actions, ACE server commands, and ordinary chat at the shared router. Port lifestone/lif/ls from the named retail registry through a typed App controller to game action 0x0063, keep unknown verbs on ACE Talk, and cover both UI backends plus exact outbound bytes.

Co-Authored-By: Codex <codex@openai.com>
This commit is contained in:
Erik 2026-07-13 11:43:19 +02:00
parent 5090aa7217
commit 5a45a7ac7f
19 changed files with 604 additions and 78 deletions

View file

@ -0,0 +1,28 @@
using AcDream.App.UI;
using AcDream.UI.Abstractions;
namespace AcDream.App.Tests.UI;
public sealed class ClientCommandControllerTests
{
[Fact]
public void LifestoneRecall_ExecutesSuppliedSessionActionOnce()
{
int recalls = 0;
var controller = new ClientCommandController(() => recalls++);
controller.Execute(new ExecuteClientCommandCmd(
ClientCommandId.LifestoneRecall, Arguments: string.Empty));
Assert.Equal(1, recalls);
}
[Fact]
public void UnknownCommandId_FailsAtApplicationBoundary()
{
var controller = new ClientCommandController(() => { });
var command = new ExecuteClientCommandCmd((ClientCommandId)999, string.Empty);
Assert.Throws<ArgumentOutOfRangeException>(() => controller.Execute(command));
}
}

View file

@ -198,6 +198,21 @@ public class ChatWindowControllerTests
Assert.Equal("hello world", cmd.Text);
}
[Fact]
public void Bind_LifestoneSubmit_PublishesTypedClientCommand()
{
var (rootInfo, layout, vm) = BuildTestTree();
var bus = new CaptureBus();
var ctrl = ChatWindowController.Bind(rootInfo, layout, vm, () => bus, null, null, NoTex);
Assert.NotNull(ctrl);
ctrl!.Input.OnSubmit!.Invoke("/ls");
var command = Assert.IsType<ExecuteClientCommandCmd>(Assert.Single(bus.Published));
Assert.Equal(ClientCommandId.LifestoneRecall, command.Command);
}
// ── Test 5: Channel change updates the channel used by subsequent submits ─
[Fact]