From 919cf5bab2ac9b32d1f948a83aecdd9bdc9550a9 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Tue, 25 Feb 2025 12:32:53 -0800 Subject: [PATCH 1/5] Update build and fix a couple of things 1. Update to use .NET SDK 8.0.406 2. Set the execution permission to 'aish' on Linux and macOS before packaging 3. Sign Azure agent assembly with the 1st-party certificate --- build.psm1 | 2 +- global.json | 2 +- tools/packaging/packaging.psm1 | 9 +++++++++ 3 files changed, 11 insertions(+), 2 deletions(-) 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/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" From bfa4db96bc80f78199c6ced3da318e6f66b35cba Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Tue, 25 Feb 2025 14:15:15 -0800 Subject: [PATCH 2/5] Update semantic version to 1.0.0-preview.2 --- shell/shell.common.props | 2 +- tools/metadata.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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/metadata.json b/tools/metadata.json index 14857f91..54f4334f 100644 --- a/tools/metadata.json +++ b/tools/metadata.json @@ -1,3 +1,3 @@ { - "AgentsToInclude": "*" + "AgentsToInclude": ["msaz", "openai-gpt"] } From ed301847f3bd7301341fbba30b2fc57a8b5dfb92 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Tue, 25 Feb 2025 17:03:29 -0800 Subject: [PATCH 3/5] Update module version to 1.0.2-preview2 --- shell/AIShell.Integration/AIShell.Integration.csproj | 2 +- shell/AIShell.Integration/AIShell.psd1 | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) 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' } } } From 2ad685e760813b03027d064d3384a2b55105424d Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Wed, 26 Feb 2025 12:05:25 -0800 Subject: [PATCH 4/5] Fix AzCLI command parsing to handle long/short flags and when no parameter is present --- .../agents/Microsoft.Azure.Agent/DataRetriever.cs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) 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; From 9653de5d28c1afe9d00ede3809260610a61804a3 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Wed, 26 Feb 2025 16:59:48 -0800 Subject: [PATCH 5/5] Update .NET SDK used in GitHub Action and include all agents in build by default --- .github/workflows/dotnet.yml | 6 +++--- tools/metadata.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) 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/tools/metadata.json b/tools/metadata.json index 54f4334f..14857f91 100644 --- a/tools/metadata.json +++ b/tools/metadata.json @@ -1,3 +1,3 @@ { - "AgentsToInclude": ["msaz", "openai-gpt"] + "AgentsToInclude": "*" }