Skip to content
Merged
Show file tree
Hide file tree
Changes from 43 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
da8a806
unifying json format
TalZaccai Apr 7, 2026
58c6d03
Add CommandResult
TalZaccai Apr 9, 2026
a4e5227
Handle CommandResult in ts/
TalZaccai Apr 9, 2026
1dfa55c
Migrating from Newtonsoft.Json to System.Text,Json
TalZaccai Apr 9, 2026
b056ca2
Phase 2: Schema-driven validation for action wiring
TalZaccai Apr 10, 2026
478022f
Phase 3: Registration-driven settings handlers
TalZaccai Apr 13, 2026
41ad8f6
Fix logic parity bugs found during audit
TalZaccai Apr 14, 2026
2483ab5
Address design review: guards, dedup, and AddSpecializedAction
TalZaccai Apr 14, 2026
3c678a6
Fix O(n) ValueMap lookup: use case-insensitive dictionary instead of …
TalZaccai Apr 14, 2026
962125d
Phase 4b: ActionHandlerBase, unified hierarchy, Command-to-Action rename
TalZaccai Apr 14, 2026
4ee7c3c
Migrate action handlers to strongly-typed parameter records
TalZaccai Apr 14, 2026
5df7a4a
Phase 4c: Source generator for typed action parameters
TalZaccai Apr 14, 2026
ec58a66
Update README with 'Adding a New Action' guide
TalZaccai Apr 14, 2026
fbe1b9e
Move .pas.json schemas under Schemas/ virtual folder, emit generated …
TalZaccai Apr 14, 2026
adb6ac9
Add generator project to sln, show Generated files in project
TalZaccai Apr 14, 2026
dc9b18c
Add source generator documentation to README
TalZaccai Apr 14, 2026
51cc3fa
Add error handling for deserialization, registry writes, and process …
TalZaccai Apr 14, 2026
6b186df
Migrate remaining handlers to typed params, add array support to gene…
TalZaccai Apr 14, 2026
f12c261
Add ApplyTheme and SystemThemeMode to TypeScript schemas
TalZaccai Apr 14, 2026
9082964
Add refreshRate to SetScreenResolution schema and migrate handler
TalZaccai Apr 14, 2026
8462159
Apply dotnet format code style fixes
TalZaccai Apr 14, 2026
c329818
Fix null deserialization and negative int-to-uint overflow
TalZaccai Apr 14, 2026
a7cc08c
Fix hardcoded exe path and narrow exception catches
TalZaccai Apr 14, 2026
8e4718e
Add tests for deserialization guards and input validation
TalZaccai Apr 14, 2026
4384df6
Add schema wiring integration tests
TalZaccai Apr 14, 2026
1dcb1c5
Fix E2E tests for ActionResult response format and stream race
TalZaccai Apr 15, 2026
7654cae
Rename CommandResult to ActionResult in connector.ts
TalZaccai Apr 15, 2026
5f1e70d
Address PR review: default params, Undefined guard, stdout error resp…
TalZaccai Apr 15, 2026
f191b22
Track .pas.json schema files and fix prettier formatting
TalZaccai Apr 15, 2026
84e0c83
Generate schemas in dotnet CI instead of committing them
TalZaccai Apr 15, 2026
fbbd944
Commit .pas.json schemas with CI freshness check
TalZaccai Apr 15, 2026
352fe31
Generate schemas in dotnet CI, don't commit .pas.json files
TalZaccai Apr 15, 2026
72250da
Extract FindMismatches from SchemaValidator for testability
TalZaccai Apr 15, 2026
5959fa3
Build asc compiler before generating schemas in CI
TalZaccai Apr 15, 2026
3338eb6
Update README with build prerequisites and new JSON format
TalZaccai Apr 15, 2026
b503a2f
Improve schema wiring test comments for path resolution
TalZaccai Apr 15, 2026
8a0e80f
Fix schema wiring tests to resolve correct path and fail on missing s…
TalZaccai Apr 15, 2026
c25302d
Add missing XML comment to AllRegisteredHandlers test
TalZaccai Apr 15, 2026
610a9b6
Restore missing Verify in LaunchProgram_WithWorkingDir test
TalZaccai Apr 15, 2026
061599b
Restore missing Verify in Volume_SavesCurrentVolumeBeforeSetting test
TalZaccai Apr 15, 2026
89ab643
Clean up test files: remove redundant casts and qualify usings
TalZaccai Apr 15, 2026
4bcfcce
Replace 'custom action' with 'specialized action' in comments
TalZaccai Apr 15, 2026
51e68b1
Add pre-build step to regenerate schemas on every build
TalZaccai Apr 15, 2026
5bf7853
Fix default value parity for TaskbarAlignment and BatterySaver
TalZaccai Apr 15, 2026
67a7b74
Address PR review: memory leaks, input validation, error handling
TalZaccai Apr 15, 2026
4130a46
Merge branch 'main' into talzacc/action_json_schema
TalZaccai Apr 15, 2026
085117e
Pre-build: run full TS desktop build instead of asc:all only
TalZaccai Apr 15, 2026
87071e2
CI: build full desktop-automation TS chain for pre-build tsc
TalZaccai Apr 15, 2026
506b8eb
Pre-build: use --filter desktop-automation... for full TS chain
TalZaccai Apr 15, 2026
d2ad1cf
Remove pre-build step, rely on developer to build TS side
TalZaccai Apr 15, 2026
b14f115
Add ToggleMouseSonar and AdjustVolume desktop actions (#2201)
TalZaccai Apr 16, 2026
2a75d73
Merge branch 'main' into talzacc/action_json_schema
TalZaccai Apr 16, 2026
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
19 changes: 19 additions & 0 deletions .github/workflows/build-dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,32 @@ jobs:
filters: |
dotnet:
- "dotnet/**"
- "ts/packages/agents/desktop/src/**Schema.ts"
- ".github/workflows/build-dotnet.yml"
- name: Setup MSBuild
if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.dotnet != 'false' }}
uses: microsoft/setup-msbuild@v2
- name: Setup NuGet
if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.dotnet != 'false' }}
uses: NuGet/setup-nuget@v2.0.0
- name: Install pnpm
if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.dotnet != 'false' }}
uses: pnpm/action-setup@v4
with:
package_json_file: ts/package.json
- name: Setup Node.js
if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.dotnet != 'false' }}
uses: actions/setup-node@v4
with:
node-version: 22
cache: "pnpm"
cache-dependency-path: ts/pnpm-lock.yaml
- name: Install TS dependencies
if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.dotnet != 'false' }}
working-directory: ts
run: |
pnpm install --frozen-lockfile --strict-peer-dependencies
pnpm run --filter @typeagent/action-schema-compiler... build
- name: Restore Packages (AutoShell)
if: ${{ github.event_name != 'pull_request' || steps.filter.outputs.dotnet != 'false' }}
working-directory: dotnet
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ bld/
# Visual Studio 2017 auto generated files
Generated\ Files/

# Roslyn source generator output
**/Generated/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
Expand Down
54 changes: 54 additions & 0 deletions dotnet/autoShell.Generators/ActionParamsGenerator.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using System.IO;
using Microsoft.CodeAnalysis;

namespace autoShell.Generators;

/// <summary>
/// Roslyn incremental source generator that reads .pas.json schema files
/// and generates strongly-typed C# parameter records for each action.
/// </summary>
[Generator]
public class ActionParamsGenerator : IIncrementalGenerator
{
public void Initialize(IncrementalGeneratorInitializationContext context)
{
// Filter AdditionalFiles to only .pas.json files
var schemaFiles = context.AdditionalTextsProvider
.Where(static file => file.Path.EndsWith(".pas.json"));

// Transform each schema file into generated source
var sources = schemaFiles.Select(static (file, cancellationToken) =>
{
var text = file.GetText(cancellationToken);
if (text == null)
{
return (FileName: (string)null, Source: (string)null);
}

var json = text.ToString();
var actions = SchemaParser.Parse(json);

if (actions.Count == 0)
{
return (FileName: (string)null, Source: (string)null);
}

string fileName = Path.GetFileNameWithoutExtension(file.Path);
string source = RecordEmitter.Emit(actions, Path.GetFileName(file.Path));

return (FileName: fileName, Source: source);
});

// Register each generated source
context.RegisterSourceOutput(sources, static (ctx, result) =>
{
if (result.FileName != null && result.Source != null)
{
ctx.AddSource($"{result.FileName}.g.cs", result.Source);
}
});
}
}
62 changes: 62 additions & 0 deletions dotnet/autoShell.Generators/RecordEmitter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using System.Collections.Generic;
using System.Text;

namespace autoShell.Generators;

/// <summary>
/// Emits C# source code for action parameter record classes.
/// </summary>
internal static class RecordEmitter
{
/// <summary>
/// Generates a single C# source file containing all action parameter records.
/// </summary>
public static string Emit(List<ActionDefinition> actions, string schemaFileName)
{
var sb = new StringBuilder();

sb.AppendLine("// <auto-generated/>");
sb.AppendLine($"// Generated from {schemaFileName}");
sb.AppendLine();
sb.AppendLine("using System.Text.Json.Serialization;");
sb.AppendLine();
sb.AppendLine("namespace autoShell.Handlers.Generated;");
sb.AppendLine();

foreach (var action in actions)
{
EmitRecord(sb, action);
sb.AppendLine();
}

return sb.ToString();
}

private static void EmitRecord(StringBuilder sb, ActionDefinition action)
{
sb.AppendLine($"/// <summary>");
sb.AppendLine($"/// Parameters for the {action.ActionName} action.");
sb.AppendLine($"/// </summary>");

if (action.Parameters.Count == 0)
{
sb.AppendLine($"internal record {action.TypeName};");
return;
}

sb.AppendLine($"internal record {action.TypeName}");
sb.AppendLine("{");

foreach (var param in action.Parameters)
{
sb.AppendLine($" [JsonPropertyName(\"{param.JsonName}\")]");
sb.AppendLine($" public {param.CSharpType} {param.CSharpName} {{ get; init; }} = {param.DefaultValue};");
sb.AppendLine();
}

sb.AppendLine("}");
}
}
Loading
Loading