Skip to content

Commit 8dca5ac

Browse files
committed
feat: align SDK version with Claude Code CLI
1 parent d7677e5 commit 8dca5ac

5 files changed

Lines changed: 22 additions & 2 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ jobs:
135135
- name: Validate semantic version
136136
run: |
137137
VERSION="${{ steps.version.outputs.version }}"
138-
if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?$ ]]; then
138+
if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?$ ]]; then
139139
echo "Version '$VERSION' is not a valid semantic version."
140140
exit 1
141141
fi

‎ClaudeCodeSharpSDK.Tests/Unit/ClaudeClientTests.cs‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using ManagedCode.ClaudeCodeSharpSDK.Client;
22
using ManagedCode.ClaudeCodeSharpSDK.Configuration;
33
using ManagedCode.ClaudeCodeSharpSDK.Execution;
4+
using ManagedCode.ClaudeCodeSharpSDK.Models;
45
using ManagedCode.ClaudeCodeSharpSDK.Tests.Shared;
56

67
namespace ManagedCode.ClaudeCodeSharpSDK.Tests.Unit;
@@ -10,6 +11,15 @@ public class ClaudeClientTests
1011
private const string CallStartAsyncFirstMessageFragment = "Call StartAsync first";
1112
private const string ExistingSessionId = "session-42";
1213

14+
[Test]
15+
public async Task CliCompatibilityTarget_MatchesPackageVersionPrefix()
16+
{
17+
var packageVersion = typeof(ClaudeClient).Assembly.GetName().Version;
18+
await Assert.That(packageVersion).IsNotNull();
19+
await Assert.That($"{packageVersion!.Major}.{packageVersion.Minor}.{packageVersion.Build}")
20+
.IsEqualTo(ClaudeCliCompatibility.TargetVersion);
21+
}
22+
1323
[Test]
1424
public async Task StartThread_WithAutoStartDisabled_Throws()
1525
{
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
namespace ManagedCode.ClaudeCodeSharpSDK.Models;
2+
3+
/// <summary>Identifies the upstream Claude Code CLI version targeted by this SDK release.</summary>
4+
public static class ClaudeCliCompatibility
5+
{
6+
/// <summary>The exact upstream CLI version compatible with this SDK package.</summary>
7+
public const string TargetVersion = "2.1.292";
8+
}

‎Directory.Build.props‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
1414
<AnalysisLevel>latest-recommended</AnalysisLevel>
1515
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
16-
<Version>1.1.10</Version>
16+
<Version>2.1.292.1</Version>
1717
<PackageVersion>$(Version)</PackageVersion>
1818

1919
</PropertyGroup>

‎docs/Features/cli-metadata.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Source of truth: local `claude` CLI behavior + upstream `anthropics/claude-code`
99

1010
## Purpose
1111

12+
The SDK package version mirrors the targeted Claude Code CLI version in its first three numeric components and uses the fourth component for an SDK hotfix. `ClaudeCliCompatibility.TargetVersion` exposes the exact compatible CLI target without starting a process. `GetCliUpdateStatus()` separately reports the latest version discovered from upstream.
13+
1214
Expose runtime Claude Code CLI metadata to SDK consumers:
1315

1416
- installed `claude` version

0 commit comments

Comments
 (0)