Skip to content

Merge the 1.0.0-preview.6 release branch back to main #399

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 24, 2025
Merged
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
4 changes: 2 additions & 2 deletions shell/AIShell.Integration/AIShell.psd1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@{
RootModule = 'AIShell.psm1'
NestedModules = @("AIShell.Integration.dll")
ModuleVersion = '1.0.5'
ModuleVersion = '1.0.6'
GUID = 'ECB8BEE0-59B9-4DAE-9D7B-A990B480279A'
Author = 'Microsoft Corporation'
CompanyName = 'Microsoft Corporation'
Expand All @@ -14,5 +14,5 @@
VariablesToExport = '*'
AliasesToExport = @('aish', 'askai', 'fixit', 'airun')
HelpInfoURI = 'https://aka.ms/aishell-help'
PrivateData = @{ PSData = @{ Prerelease = 'preview5'; ProjectUri = 'https://github.com/PowerShell/AIShell' } }
PrivateData = @{ PSData = @{ Prerelease = 'preview6'; ProjectUri = 'https://github.com/PowerShell/AIShell' } }
}
4 changes: 2 additions & 2 deletions shell/AIShell.Integration/AIShell.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ if ($IsMacOS -and $env:TERM_PROGRAM -ne "iTerm.app") {
}

$module = Get-Module -Name PSReadLine
if ($null -eq $module -or $module.Version -lt [version]"2.4.2") {
throw "The PSReadLine v2.4.2-beta2 or higher is required for the AIShell module to work properly."
if ($null -eq $module -or $module.Version -lt [version]"2.4.3") {
throw "The PSReadLine v2.4.3-beta3 or higher is required for the AIShell module to work properly."
}

$runspace = $Host.Runspace
Expand Down
7 changes: 6 additions & 1 deletion shell/AIShell.Kernel/MCP/BuiltInTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -447,10 +447,15 @@ internal static Dictionary<string, BuiltInTool> GetBuiltInTools(Shell shell)
{
ArgumentNullException.ThrowIfNull(shell);

int toolCount = (int)ToolType.NumberOfBuiltInTools;
Debug.Assert(s_toolDescription.Length == (int)ToolType.NumberOfBuiltInTools, "Number of tool descriptions doesn't match the number of tools.");
Debug.Assert(s_toolSchema.Length == (int)ToolType.NumberOfBuiltInTools, "Number of tool schemas doesn't match the number of tools.");

// TODO: 'run_command_in_terminal' and 'get_command_output' don't work on macOS yet.
// On macOS, we need to use the iTerm2's python API to send the 'Enter' key to accept the command.
int toolCount = OperatingSystem.IsWindows()
? (int)ToolType.NumberOfBuiltInTools
: (int)ToolType.run_command_in_terminal;

if (shell.Channel is null || !shell.Channel.Connected)
{
return null;
Expand Down
2 changes: 1 addition & 1 deletion shell/shell.common.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>12.0</LangVersion>
<Version>1.0.0-preview.5</Version>
<Version>1.0.0-preview.6</Version>

<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand Down
25 changes: 23 additions & 2 deletions tools/scripts/install-aishell.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ $Script:InstallLocation = $null
$Script:PackageURL = $null
$Script:ModuleVersion = $null
$Script:NewPSRLInstalled = $false
$Script:PSRLDependencyMap = @{ '1.0.4-preview4' = '2.4.2-beta2' }
$Script:PSRLDependencyMap = @{
'1.0.4-preview4' = '2.4.2-beta2'
'1.0.6-preview6' = '2.4.3-beta3'
}

function Resolve-Environment {
if ($PSVersionTable.PSVersion -lt [version]"7.4.6") {
Expand Down Expand Up @@ -211,7 +214,8 @@ function Install-AIShellModule {
Write-Host "Installing the PowerShell module 'AIShell' $modVersion ..."
Install-PSResource -Name AIShell -Repository PSGallery -Prerelease -TrustRepository -Version $modVersion -ErrorAction Stop -WarningAction SilentlyContinue

$psrldep = $Script:PSRLDependencyMap[$modVersion]
$psrldep = GetPSRLDependency -modVersion $modVersion

if ($psrldep) {
$psrlModule = Get-Module -Name PSReadLine
$psrlVer = $psrldep.Contains('-') ? $psrldep.Split('-')[0] : $psrldep
Expand All @@ -228,6 +232,23 @@ function Install-AIShellModule {
}
}

function GetPSRLDependency {
param([string] $modVersion)

$keys = $Script:PSRLDependencyMap.Keys
$curVer = [version]($modVersion.Contains('-') ? $modVersion.Split('-')[0] : $modVersion)

$psrldep = $null
foreach ($key in $keys) {
$ver = $key.Contains('-') ? $key.Split('-')[0] : $key
if ($curVer -ge [version]$ver) {
$psrldep = $Script:PSRLDependencyMap[$key]
}
}

return $psrldep
}

function Uninstall-AIShellModule {
if (Get-InstalledPSResource -Name "AIShell" -ErrorAction SilentlyContinue) {
try {
Expand Down
Loading