diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 5e83eedd..8e8dc3cc 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -20,7 +20,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: 8.0.403 + dotnet-version: 8.0.406 - name: Build shell: pwsh run: | @@ -37,7 +37,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: 8.0.403 + dotnet-version: 8.0.406 - name: Build shell: pwsh run: | @@ -54,7 +54,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: 8.0.403 + dotnet-version: 8.0.406 - name: Build shell: pwsh run: | diff --git a/build.psm1 b/build.psm1 index 702c41e4..b521571c 100644 --- a/build.psm1 +++ b/build.psm1 @@ -336,7 +336,7 @@ function Copy-1PFilesToSign [string] $TargetRoot ) - $pattern = "*.ps*1", "AIShell.*.dll", "aish.dll", "aish.exe", "Markdown.VT.dll", "ReadLine.dll" + $pattern = "*.ps*1", "AIShell.*.dll", "aish.dll", "aish.exe", "Markdown.VT.dll", "ReadLine.dll", "Microsoft.Azure.Agent.dll" if (Test-Path $TargetRoot) { Remove-Item -Path $TargetRoot -Recurse -Force diff --git a/global.json b/global.json index ff3b5e09..d7a025e6 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "8.0.403" + "version": "8.0.406" } } diff --git a/shell/AIShell.Integration/AIShell.Integration.csproj b/shell/AIShell.Integration/AIShell.Integration.csproj index e036f83a..b5a7b371 100644 --- a/shell/AIShell.Integration/AIShell.Integration.csproj +++ b/shell/AIShell.Integration/AIShell.Integration.csproj @@ -10,7 +10,7 @@ - + contentFiles All diff --git a/shell/AIShell.Integration/AIShell.psd1 b/shell/AIShell.Integration/AIShell.psd1 index c83dc464..d9dd85e0 100644 --- a/shell/AIShell.Integration/AIShell.psd1 +++ b/shell/AIShell.Integration/AIShell.psd1 @@ -1,17 +1,17 @@ @{ RootModule = 'AIShell.psm1' NestedModules = @("AIShell.Integration.dll") - ModuleVersion = '1.0.1' + ModuleVersion = '1.0.2' GUID = 'ECB8BEE0-59B9-4DAE-9D7B-A990B480279A' Author = 'Microsoft Corporation' CompanyName = 'Microsoft Corporation' Copyright = '(c) Microsoft Corporation. All rights reserved.' Description = 'Integration with the AIShell to provide intelligent shell experience' - PowerShellVersion = '7.4.5' + PowerShellVersion = '7.4.6' FunctionsToExport = @() CmdletsToExport = @('Start-AIShell','Invoke-AIShell','Resolve-Error') VariablesToExport = '*' AliasesToExport = @('aish', 'askai', 'fixit') HelpInfoURI = 'https://aka.ms/aishell-help' - PrivateData = @{ PSData = @{ Prerelease = 'preview1'; ProjectUri = 'https://github.com/PowerShell/AIShell' } } + PrivateData = @{ PSData = @{ Prerelease = 'preview2'; ProjectUri = 'https://github.com/PowerShell/AIShell' } } } diff --git a/shell/agents/Microsoft.Azure.Agent/DataRetriever.cs b/shell/agents/Microsoft.Azure.Agent/DataRetriever.cs index 7ac3eee9..0809ca94 100644 --- a/shell/agents/Microsoft.Azure.Agent/DataRetriever.cs +++ b/shell/agents/Microsoft.Azure.Agent/DataRetriever.cs @@ -485,8 +485,11 @@ private void PairPlaceholdersForCLICode(ResponseData data) { if (!cmds.TryGetValue(script, out command)) { - int firstParamIndex = script.IndexOf("--"); - command = script.AsSpan(0, firstParamIndex).Trim().ToString(); + // The generated command may contain both long (--xxx) and short (-x) flag forms for its parameters. + int firstParamIndex = script.IndexOf(" -"); + command = firstParamIndex is -1 + ? script.Trim() + : script.AsSpan(0, firstParamIndex).Trim().ToString(); cmds.Add(script, command); } @@ -502,12 +505,8 @@ private void PairPlaceholdersForCLICode(ResponseData data) argIndex--; } - // The generated AzCLI command may contain both long (--xxx) and short (-x) flag forms - // for its parameters. So we need to properly handle it when looking for the parameter - // right before the placeholder value. - int paramIndex = 1 + Math.Max( - script.LastIndexOf(" --", argIndex), - script.LastIndexOf(" -", argIndex)); + // The parameter for this argument may use either long (--xxx) or short (-x) flag forms. + int paramIndex = script.LastIndexOf(" -", argIndex); parameter = script.AsSpan(paramIndex, argIndex - paramIndex).Trim().ToString(); placeholderFound = true; diff --git a/shell/shell.common.props b/shell/shell.common.props index 9bce8b9f..4e26a76e 100644 --- a/shell/shell.common.props +++ b/shell/shell.common.props @@ -8,7 +8,7 @@ net8.0 enable 12.0 - 1.0.0-preview.1 + 1.0.0-preview.2 true true diff --git a/tools/packaging/packaging.psm1 b/tools/packaging/packaging.psm1 index 671fa410..bf9de28f 100644 --- a/tools/packaging/packaging.psm1 +++ b/tools/packaging/packaging.psm1 @@ -148,6 +148,15 @@ function New-TarballPackage } } + if (Get-Command -Name chmod -CommandType Application -ErrorAction Ignore) { + Write-Verbose "Add the execution permission to 'aish'" -Verbose + $executable = Join-Path $PackageSourcePath 'aish' + chmod +x $executable + + $permission = Get-ChildItem $executable | ForEach-Object UnixFileMode + Write-Verbose "File permission: $permission" -Verbose + } + if (Get-Command -Name tar -CommandType Application -ErrorAction Ignore) { Write-Verbose "Create tarball package" -Verbose $options = "-czf"