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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ txc

These five groups are deliberately small. Adding a sixth top-level group requires a strong justification — if a new piece of functionality fits under an existing noun, put it there.

`ui` is the current justified exception. Browser-session automation for model-driven apps is not configuration, workspace authoring, environment deployment, data migration, or documentation. It is an interactive runtime surface that spans auth reuse, navigation, inspection, and recovery inside a live browser, so it would be misleading to hide it under one of the existing nouns.

### `config` sub-nouns

The `config` group has four sub-nouns, each owning one aspect of the resolution pipeline:
Expand Down
60 changes: 60 additions & 0 deletions TALXIS.CLI.sln
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TALXIS.CLI.Analyzers", "src
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TALXIS.CLI.Abstractions", "src\TALXIS.CLI.Abstractions\TALXIS.CLI.Abstractions.csproj", "{C15B8E89-AD5F-4F61-AD7B-2DAFD43B10DD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TALXIS.CLI.Platform.Playwright", "src\TALXIS.CLI.Platform.Playwright\TALXIS.CLI.Platform.Playwright.csproj", "{79FB065D-060D-4580-809D-EA65E9FDA07A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TALXIS.CLI.Features.Ui", "src\TALXIS.CLI.Features.Ui\TALXIS.CLI.Features.Ui.csproj", "{AB2ACAC4-1DDD-4677-ADFA-02B0DDD7E771}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TALXIS.CLI.Platform.Playwright.Tests", "tests\TALXIS.CLI.Platform.Playwright.Tests\TALXIS.CLI.Platform.Playwright.Tests.csproj", "{230EE734-7BDF-4DE0-AEFA-85CBE8635599}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TALXIS.CLI.Features.Ui.Tests", "tests\TALXIS.CLI.Features.Ui.Tests\TALXIS.CLI.Features.Ui.Tests.csproj", "{F709E6E7-D9B3-49A7-AA9A-470CBE89D4CA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -283,6 +291,54 @@ Global
{C15B8E89-AD5F-4F61-AD7B-2DAFD43B10DD}.Release|x64.Build.0 = Release|Any CPU
{C15B8E89-AD5F-4F61-AD7B-2DAFD43B10DD}.Release|x86.ActiveCfg = Release|Any CPU
{C15B8E89-AD5F-4F61-AD7B-2DAFD43B10DD}.Release|x86.Build.0 = Release|Any CPU
{79FB065D-060D-4580-809D-EA65E9FDA07A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{79FB065D-060D-4580-809D-EA65E9FDA07A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{79FB065D-060D-4580-809D-EA65E9FDA07A}.Debug|x64.ActiveCfg = Debug|Any CPU
{79FB065D-060D-4580-809D-EA65E9FDA07A}.Debug|x64.Build.0 = Debug|Any CPU
{79FB065D-060D-4580-809D-EA65E9FDA07A}.Debug|x86.ActiveCfg = Debug|Any CPU
{79FB065D-060D-4580-809D-EA65E9FDA07A}.Debug|x86.Build.0 = Debug|Any CPU
{79FB065D-060D-4580-809D-EA65E9FDA07A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{79FB065D-060D-4580-809D-EA65E9FDA07A}.Release|Any CPU.Build.0 = Release|Any CPU
{79FB065D-060D-4580-809D-EA65E9FDA07A}.Release|x64.ActiveCfg = Release|Any CPU
{79FB065D-060D-4580-809D-EA65E9FDA07A}.Release|x64.Build.0 = Release|Any CPU
{79FB065D-060D-4580-809D-EA65E9FDA07A}.Release|x86.ActiveCfg = Release|Any CPU
{79FB065D-060D-4580-809D-EA65E9FDA07A}.Release|x86.Build.0 = Release|Any CPU
{AB2ACAC4-1DDD-4677-ADFA-02B0DDD7E771}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AB2ACAC4-1DDD-4677-ADFA-02B0DDD7E771}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AB2ACAC4-1DDD-4677-ADFA-02B0DDD7E771}.Debug|x64.ActiveCfg = Debug|Any CPU
{AB2ACAC4-1DDD-4677-ADFA-02B0DDD7E771}.Debug|x64.Build.0 = Debug|Any CPU
{AB2ACAC4-1DDD-4677-ADFA-02B0DDD7E771}.Debug|x86.ActiveCfg = Debug|Any CPU
{AB2ACAC4-1DDD-4677-ADFA-02B0DDD7E771}.Debug|x86.Build.0 = Debug|Any CPU
{AB2ACAC4-1DDD-4677-ADFA-02B0DDD7E771}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AB2ACAC4-1DDD-4677-ADFA-02B0DDD7E771}.Release|Any CPU.Build.0 = Release|Any CPU
{AB2ACAC4-1DDD-4677-ADFA-02B0DDD7E771}.Release|x64.ActiveCfg = Release|Any CPU
{AB2ACAC4-1DDD-4677-ADFA-02B0DDD7E771}.Release|x64.Build.0 = Release|Any CPU
{AB2ACAC4-1DDD-4677-ADFA-02B0DDD7E771}.Release|x86.ActiveCfg = Release|Any CPU
{AB2ACAC4-1DDD-4677-ADFA-02B0DDD7E771}.Release|x86.Build.0 = Release|Any CPU
{230EE734-7BDF-4DE0-AEFA-85CBE8635599}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{230EE734-7BDF-4DE0-AEFA-85CBE8635599}.Debug|Any CPU.Build.0 = Debug|Any CPU
{230EE734-7BDF-4DE0-AEFA-85CBE8635599}.Debug|x64.ActiveCfg = Debug|Any CPU
{230EE734-7BDF-4DE0-AEFA-85CBE8635599}.Debug|x64.Build.0 = Debug|Any CPU
{230EE734-7BDF-4DE0-AEFA-85CBE8635599}.Debug|x86.ActiveCfg = Debug|Any CPU
{230EE734-7BDF-4DE0-AEFA-85CBE8635599}.Debug|x86.Build.0 = Debug|Any CPU
{230EE734-7BDF-4DE0-AEFA-85CBE8635599}.Release|Any CPU.ActiveCfg = Release|Any CPU
{230EE734-7BDF-4DE0-AEFA-85CBE8635599}.Release|Any CPU.Build.0 = Release|Any CPU
{230EE734-7BDF-4DE0-AEFA-85CBE8635599}.Release|x64.ActiveCfg = Release|Any CPU
{230EE734-7BDF-4DE0-AEFA-85CBE8635599}.Release|x64.Build.0 = Release|Any CPU
{230EE734-7BDF-4DE0-AEFA-85CBE8635599}.Release|x86.ActiveCfg = Release|Any CPU
{230EE734-7BDF-4DE0-AEFA-85CBE8635599}.Release|x86.Build.0 = Release|Any CPU
{F709E6E7-D9B3-49A7-AA9A-470CBE89D4CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F709E6E7-D9B3-49A7-AA9A-470CBE89D4CA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F709E6E7-D9B3-49A7-AA9A-470CBE89D4CA}.Debug|x64.ActiveCfg = Debug|Any CPU
{F709E6E7-D9B3-49A7-AA9A-470CBE89D4CA}.Debug|x64.Build.0 = Debug|Any CPU
{F709E6E7-D9B3-49A7-AA9A-470CBE89D4CA}.Debug|x86.ActiveCfg = Debug|Any CPU
{F709E6E7-D9B3-49A7-AA9A-470CBE89D4CA}.Debug|x86.Build.0 = Debug|Any CPU
{F709E6E7-D9B3-49A7-AA9A-470CBE89D4CA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F709E6E7-D9B3-49A7-AA9A-470CBE89D4CA}.Release|Any CPU.Build.0 = Release|Any CPU
{F709E6E7-D9B3-49A7-AA9A-470CBE89D4CA}.Release|x64.ActiveCfg = Release|Any CPU
{F709E6E7-D9B3-49A7-AA9A-470CBE89D4CA}.Release|x64.Build.0 = Release|Any CPU
{F709E6E7-D9B3-49A7-AA9A-470CBE89D4CA}.Release|x86.ActiveCfg = Release|Any CPU
{F709E6E7-D9B3-49A7-AA9A-470CBE89D4CA}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -307,6 +363,10 @@ Global
{145543D7-2369-460F-AC41-5B48A28616F6} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
{7DFD9789-0399-4C36-BFC9-091CDA8DE4E2} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
{C15B8E89-AD5F-4F61-AD7B-2DAFD43B10DD} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
{79FB065D-060D-4580-809D-EA65E9FDA07A} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
{AB2ACAC4-1DDD-4677-ADFA-02B0DDD7E771} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
{230EE734-7BDF-4DE0-AEFA-85CBE8635599} = {0AB3BF05-4346-4AA6-1389-037BE0695223}
{F709E6E7-D9B3-49A7-AA9A-470CBE89D4CA} = {0AB3BF05-4346-4AA6-1389-037BE0695223}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {53733BD6-A32A-41B7-9472-E377AF68151F}
Expand Down
26 changes: 26 additions & 0 deletions docs/MIGRATION-CP1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# CP1 migration notes for BDD agents

When CP1 is available in the CLI, the CP0 BDD agents should stop launching raw Playwright sessions themselves and delegate browser-session lifecycle to `txc`.

## What to change in `bdd-agent-v2`

1. Replace raw Playwright browser launch in `Hooks.cs` with:

```bash
txc ui session open --type AppModule --param name=WarehouseApp --profile <profile>
```

2. Have agents call `txc ui session open` from shell steps instead of owning Playwright bootstrap logic directly.
3. Keep using `guide_testing` to discover binding signatures and available steps.
4. Point follow-up browser inspection to:

```bash
txc ui session status
txc ui browser eval --eval "<javascript>"
```

## Expected impact

- Agent instructions become shorter because Playwright launch, recovery, and auth reuse move into the CLI.
- Session reuse becomes profile-scoped and consistent with the rest of `txc`.
- Mid-session recovery logic stays centralized in the CLI instead of being duplicated across agent prompts.
9 changes: 9 additions & 0 deletions src/TALXIS.CLI.Core/Browser/BrowserLaunchOptions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace TALXIS.CLI.Core.Browser;

public sealed record BrowserLaunchOptions(
string ProfileName,
string? AppUrl = null,
bool Headless = false,
int SlowMo = 0,
string BrowserType = "chromium"
);
13 changes: 13 additions & 0 deletions src/TALXIS.CLI.Core/Browser/BrowserSession.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace TALXIS.CLI.Core.Browser;

public sealed record BrowserSession(
string Id,
string ProfileName,
string CdpEndpoint,
string? AppUrl,
DateTime CreatedAt,
int Pid,
bool Headless,
string BrowserType,
string UserDataDir
);
13 changes: 13 additions & 0 deletions src/TALXIS.CLI.Core/Browser/IBrowserSessionManager.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace TALXIS.CLI.Core.Browser;

public interface IBrowserSessionManager
{
Task<BrowserSession> LaunchAsync(BrowserLaunchOptions options, CancellationToken ct);
Task<BrowserSession?> AttachAsync(string cdpEndpoint, CancellationToken ct);
Task CloseAsync(string sessionId, CancellationToken ct);
Task<BrowserSession?> GetActiveSessionAsync(CancellationToken ct);
Task<BrowserSession?> GetSessionAsync(string sessionId, CancellationToken ct);
Task<IReadOnlyList<BrowserSession>> ListSessionsAsync(CancellationToken ct);
Task<string?> GetCurrentUrlAsync(string sessionId, CancellationToken ct);
Task<System.Text.Json.JsonElement> EvaluateAsync(string sessionId, string script, CancellationToken ct);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace TALXIS.CLI.Features.Environment.Component.Browse;
namespace TALXIS.CLI.Core.Component.Browse;

/// <summary>
/// Shared constants for browse URL construction.
Expand All @@ -16,7 +16,7 @@ public static string NormalizeOrgUrl(string orgUrl)
{
if (Uri.TryCreate(orgUrl, UriKind.Absolute, out var uri))
return uri.Host;
// Already a bare hostname

return orgUrl.TrimEnd('/');
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace TALXIS.CLI.Features.Environment.Component.Browse;
namespace TALXIS.CLI.Core.Component.Browse;

/// <summary>
/// URL builders for the Power Apps canvas app player (<c>apps.powerapps.com/play</c>).
Expand All @@ -11,8 +11,13 @@ public static class CanvasAppUrls
/// <summary>
/// Open a canvas app in the Power Apps player.
/// </summary>
public static Uri Play(Guid environmentId, Guid appId, string? tenantId,
string? screenName = null, IDictionary<string, string>? customParams = null, bool hideNavbar = false)
public static Uri Play(
Guid environmentId,
Guid appId,
string? tenantId,
string? screenName = null,
IDictionary<string, string>? customParams = null,
bool hideNavbar = false)
{
var qs = new List<string>();
if (!string.IsNullOrWhiteSpace(tenantId))
Expand All @@ -22,10 +27,12 @@ public static Uri Play(Guid environmentId, Guid appId, string? tenantId,
if (hideNavbar)
qs.Add("hidenavbar=true");
if (customParams != null)
{
foreach (var (key, value) in customParams)
qs.Add($"{Uri.EscapeDataString(key)}={Uri.EscapeDataString(value)}");
}

var query = qs.Count > 0 ? "?" + string.Join("&", qs) : "";
var query = qs.Count > 0 ? "?" + string.Join("&", qs) : string.Empty;
return new Uri($"{Base}/e/{environmentId}/a/{appId}{query}");
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace TALXIS.CLI.Features.Environment.Component.Browse;
namespace TALXIS.CLI.Core.Component.Browse;

/// <summary>
/// URL builders for Copilot Studio (<c>copilotstudio.microsoft.com</c>).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace TALXIS.CLI.Features.Environment.Component.Browse;
namespace TALXIS.CLI.Core.Component.Browse;

/// <summary>
/// URL builders for the Power Apps maker portal (<c>make.powerapps.com</c>).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace TALXIS.CLI.Features.Environment.Component.Browse;
namespace TALXIS.CLI.Core.Component.Browse;

/// <summary>
/// URL builders for the Power Apps UCI runtime (<c>{org}.crm{N}.dynamics.com/main.aspx</c>).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace TALXIS.CLI.Features.Environment.Component.Browse;
namespace TALXIS.CLI.Core.Component.Browse;

/// <summary>
/// URL builders for the Power Automate maker portal (<c>make.powerautomate.com</c>).
Expand Down
Loading