A programming framework for agentic AI
Merge project-oagents into agnext
Reuben Bondc5cec3afbde5
diff --cc dotnet/.editorconfigindex 000000000,000000000..1e3119741new file mode 100644--- /dev/null+++ b/dotnet/.editorconfig@@@ -1,0 -1,0 +1,478 @@@++; EditorConfig to support per-solution formatting.++; Use the EditorConfig VS add-in to make this work.++; http://editorconfig.org/++;++; Here are some resources for what's supported for .NET/C#++; https://kent-boogaart.com/blog/editorconfig-reference-for-c-developers++; https://learn.microsoft.com/visualstudio/ide/editorconfig-code-style-settings-reference++;++; Be **careful** editing this because some of the rules don't support adding a severity level++; For instance if you change to `dotnet_sort_system_directives_first = true:warning` (adding `:warning`)++; then the rule will be silently ignored.++++; This is the default for the codeline.++root = true++++[*]++indent_style = space++charset = utf-8++trim_trailing_whitespace = true++insert_final_newline = true++spelling_exclusion_path = spelling.dic++++[*.cs]++indent_size = 4++dotnet_sort_system_directives_first = true++++# Don't use this. qualifier++dotnet_style_qualification_for_field = false:suggestion++dotnet_style_qualification_for_property = false:suggestion++++# use int x = .. over Int32++dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion++++# use int.MaxValue over Int32.MaxValue++dotnet_style_predefined_type_for_member_access = true:suggestion++++# Require var all the time.++csharp_style_var_for_built_in_types = true:suggestion++csharp_style_var_when_type_is_apparent = true:suggestion++csharp_style_var_elsewhere = true:suggestion++++# Disallow throw expressions.++csharp_style_throw_expression = false:suggestion++++# Newline settings++csharp_new_line_before_open_brace = all++csharp_new_line_before_else = true++csharp_new_line_before_catch = true++csharp_new_line_before_finally = true++csharp_new_line_before_members_in_object_initializers = true++csharp_new_line_before_members_in_anonymous_types = true++++# Namespace settings++csharp_style_namespace_declarations = file_scoped++++# Brace settings++csharp_prefer_braces = true # Prefer curly braces even for one line of code++++# name all constant fields using PascalCase++dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = warning++dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields++dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style++dotnet_naming_symbols.constant_fields.applicable_kinds = field++dotnet_naming_symbols.constant_fields.required_modifiers = const++dotnet_naming_style.pascal_case_style.capitalization = pascal_case++++# static fields should have s_ prefix++dotnet_naming_rule.static_fields_should_have_prefix.severity = warning++dotnet_naming_rule.static_fields_should_have_prefix.symbols = static_fields++dotnet_naming_rule.static_fields_should_have_prefix.style = static_prefix_style++dotnet_naming_symbols.static_fields.applicable_kinds = field++dotnet_naming_symbols.static_fields.required_modifiers = static++dotnet_naming_symbols.static_fields.applicable_accessibilities = private, internal, private_protected++dotnet_naming_style.static_prefix_style.required_prefix = s_++dotnet_naming_style.static_prefix_style.capitalization = camel_case++++# internal and private fields should be _camelCase++dotnet_naming_rule.camel_case_for_private_internal_fields.severity = warning++dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields++dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style++dotnet_naming_symbols.private_internal_fields.applicable_kinds = field++dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal++dotnet_naming_style.camel_case_underscore_style.required_prefix = _++dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case++++[*.{xml,config,*proj,nuspec,props,resx,targets,yml,tasks}]++indent_size = 2++++# Xml config files++[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]++indent_size = 2++++[*.json]++indent_size = 2++++[*.{ps1,psm1}]++indent_size = 4++++[*.sh]++indent_size = 4++end_of_line = lf++++[*.{razor,cshtml}]++charset = utf-8-bom++++[*.{cs,vb}]++++# SYSLIB1054: Use 'LibraryImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time++dotnet_diagnostic.SYSLIB1054.severity = warning++++# CA1018: Mark attributes with AttributeUsageAttribute++dotnet_diagnostic.CA1018.severity = warning++++# CA1047: Do not declare protected member in sealed type++dotnet_diagnostic.CA1047.severity = warning++++# CA1305: Specify IFormatProvider++dotnet_diagnostic.CA1305.severity = warning++++# CA1507: Use nameof to express symbol names++dotnet_diagnostic.CA1507.severity = warning++++# CA1510: Use ArgumentNullException throw helper++dotnet_diagnostic.CA1510.severity = warning++++# CA1511: Use ArgumentException throw helper++dotnet_diagnostic.CA1511.severity = warning++++# CA1512: Use ArgumentOutOfRangeException throw helper++dotnet_diagnostic.CA1512.severity = warning++++# CA1513: Use ObjectDisposedException throw helper++dotnet_diagnostic.CA1513.severity = warning++++# CA1725: Parameter names should match base declaration++dotnet_diagnostic.CA1725.severity = suggestion++++# CA1802: Use literals where appropriate++dotnet_diagnostic.CA1802.severity = warning++++# CA1805: Do not initialize unnecessarily++dotnet_diagnostic.CA1805.severity = warning++++# CA1810: Do not initialize unnecessarily++dotnet_diagnostic.CA1810.severity = warning++++# CA1821: Remove empty Finalizers++dotnet_diagnostic.CA1821.severity = warning++++# CA1822: Make member static++dotnet_diagnostic.CA1822.severity = warning++dotnet_code_quality.CA1822.api_surface = private, internal++++# CA1823: Avoid unused private fields++dotnet_diagnostic.CA1823.severity = warning++++# CA1825: Avoid zero-length array allocations++dotnet_diagnostic.CA1825.severity = warning++++# CA1826: Do not use Enumerable methods on indexable collections. Instead use the collection directly++dotnet_diagnostic.CA1826.severity = warning++++# CA1827: Do not use Count() or LongCount() when Any() can be used++dotnet_diagnostic.CA1827.severity = warning++++# CA1828: Do not use CountAsync() or LongCountAsync() when AnyAsync() can be used++dotnet_diagnostic.CA1828.severity = warning++++# CA1829: Use Length/Count property instead of Count() when available++dotnet_diagnostic.CA1829.severity = warning++++# CA1830: Prefer strongly-typed Append and Insert method overloads on StringBuilder++dotnet_diagnostic.CA1830.severity = warning++++# CA1831: Use AsSpan or AsMemory instead of Range-based indexers when appropriate++dotnet_diagnostic.CA1831.severity = warning++++# CA1832: Use AsSpan or AsMemory instead of Range-based indexers when appropriate++dotnet_diagnostic.CA1832.severity = warning++++# CA1833: Use AsSpan or AsMemory instead of Range-based indexers when appropriate++dotnet_diagnostic.CA1833.severity = warning++++# CA1834: Consider using 'StringBuilder.Append(char)' when applicable++dotnet_diagnostic.CA1834.severity = warning++++# CA1835: Prefer the 'Memory'-based overloads for 'ReadAsync' and 'WriteAsync'++dotnet_diagnostic.CA1835.severity = warning++++# CA1836: Prefer IsEmpty over Count++dotnet_diagnostic.CA1836.severity = warning++++# CA1837: Use 'Environment.ProcessId'++dotnet_diagnostic.CA1837.severity = warning++++# CA1838: Avoid 'StringBuilder' parameters for P/Invokes++dotnet_diagnostic.CA1838.severity = warning++++# CA1839: Use 'Environment.ProcessPath'++dotnet_diagnostic.CA1839.severity = warning++++# CA1840: Use 'Environment.CurrentManagedThreadId'++dotnet_diagnostic.CA1840.severity = warning++++# CA1841: Prefer Dictionary.Contains methods++dotnet_diagnostic.CA1841.severity = warning++++# CA1842: Do not use 'WhenAll' with a single task++dotnet_diagnostic.CA1842.severity = warning++++# CA1843: Do not use 'WaitAll' with a single task++dotnet_diagnostic.CA1843.severity = warning++++# CA1844: Provide memory-based overrides of async methods when subclassing 'Stream'++dotnet_diagnostic.CA1844.severity = warning++++# CA1845: Use span-based 'string.Concat'++dotnet_diagnostic.CA1845.severity = warning++++# CA1846: Prefer AsSpan over Substring++dotnet_diagnostic.CA1846.severity = warning++++# CA1847: Use string.Contains(char) instead of string.Contains(string) with single characters++dotnet_diagnostic.CA1847.severity = warning++++# CA1852: Seal internal types++dotnet_diagnostic.CA1852.severity = warning++++# CA1854: Prefer the IDictionary.TryGetValue(TKey, out TValue) method++dotnet_diagnostic.CA1854.severity = warning++++# CA1855: Prefer 'Clear' over 'Fill'++dotnet_diagnostic.CA1855.severity = warning++++# CA1856: Incorrect usage of ConstantExpected attribute++dotnet_diagnostic.CA1856.severity = error++++# CA1857: A constant is expected for the parameter++dotnet_diagnostic.CA1857.severity = warning++++# CA1858: Use 'StartsWith' instead of 'IndexOf'++dotnet_diagnostic.CA1858.severity = warning++++# CA2007: Consider calling ConfigureAwait on the awaited task++dotnet_diagnostic.CA2007.severity = warning++++# CA2008: Do not create tasks without passing a TaskScheduler++dotnet_diagnostic.CA2008.severity = warning++++# CA2009: Do not call ToImmutableCollection on an ImmutableCollection value++dotnet_diagnostic.CA2009.severity = warning++++# CA2011: Avoid infinite recursion++dotnet_diagnostic.CA2011.severity = warning++++# CA2012: Use ValueTask correctly++dotnet_diagnostic.CA2012.severity = warning++++# CA2013: Do not use ReferenceEquals with value types++dotnet_diagnostic.CA2013.severity = warning++++# CA2014: Do not use stackalloc in loops.++dotnet_diagnostic.CA2014.severity = warning++++# CA2016: Forward the 'CancellationToken' parameter to methods that take one++dotnet_diagnostic.CA2016.severity = warning++++# CA2200: Rethrow to preserve stack details++dotnet_diagnostic.CA2200.severity = warning++++# CA2201: Do not raise reserved exception types++dotnet_diagnostic.CA2201.severity = warning++++# CA2208: Instantiate argument exceptions correctly++dotnet_diagnostic.CA2208.severity = warning++++# CA2245: Do not assign a property to itself++dotnet_diagnostic.CA2245.severity = warning++++# CA2246: Assigning symbol and its member in the same statement++dotnet_diagnostic.CA2246.severity = warning++++# CA2249: Use string.Contains instead of string.IndexOf to improve readability.++dotnet_diagnostic.CA2249.severity = warning++++# IDE0005: Remove unnecessary usings++dotnet_diagnostic.IDE0005.severity = warning++++# IDE0011: Curly braces to surround blocks of code++dotnet_diagnostic.IDE0011.severity = warning++++# IDE0020: Use pattern matching to avoid is check followed by a cast (with variable)++dotnet_diagnostic.IDE0020.severity = warning++++# IDE0029: Use coalesce expression (non-nullable types)++dotnet_diagnostic.IDE0029.severity = warning++++# IDE0030: Use coalesce expression (nullable types)++dotnet_diagnostic.IDE0030.severity = warning++++# IDE0031: Use null propagation++dotnet_diagnostic.IDE0031.severity = warning++++# IDE0035: Remove unreachable code++dotnet_diagnostic.IDE0035.severity = warning++++# IDE0036: Order modifiers++csharp_preferred_modifier_order = public,private,protected,internal,file,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion++dotnet_diagnostic.IDE0036.severity = warning++++# IDE0038: Use pattern matching to avoid is check followed by a cast (without variable)++dotnet_diagnostic.IDE0038.severity = warning++++# IDE0043: Format string contains invalid placeholder++dotnet_diagnostic.IDE0043.severity = warning++++# IDE0044: Make field readonly++dotnet_diagnostic.IDE0044.severity = warning++++# IDE0051: Remove unused private members++dotnet_diagnostic.IDE0051.severity = warning++++# IDE0055: All formatting rules++dotnet_diagnostic.IDE0055.severity = suggestion++++# IDE0059: Unnecessary assignment to a value++dotnet_diagnostic.IDE0059.severity = warning++++# IDE0060: Remove unused parameter++dotnet_code_quality_unused_parameters = non_public++dotnet_diagnostic.IDE0060.severity = warning++++# IDE0062: Make local function static++dotnet_diagnostic.IDE0062.severity = warning++++# IDE0073: File header++dotnet_diagnostic.IDE0073.severity = warning++file_header_template = Licensed to the .NET Foundation under one or more agreements.\nThe .NET Foundation licenses this file to you under the MIT license.++++# IDE1006: Required naming style++dotnet_diagnostic.IDE1006.severity = warning++++# IDE0161: Convert to file-scoped namespace++dotnet_diagnostic.IDE0161.severity = warning++++# IDE0200: Lambda expression can be removed++dotnet_diagnostic.IDE0200.severity = warning++++# IDE2000: Disallow multiple blank lines++dotnet_style_allow_multiple_blank_lines_experimental = false++dotnet_diagnostic.IDE2000.severity = warning++++[{eng/tools/**.cs,**/{test,testassets,samples,Samples,perf,benchmarkapps,scripts,stress}/**.cs,src/Hosting/Server.IntegrationTesting/**.cs,src/Servers/IIS/IntegrationTesting.IIS/**.cs,src/Shared/Http2cat/**.cs,src/Testing/**.cs}]++# CA1018: Mark attributes with AttributeUsageAttribute++dotnet_diagnostic.CA1018.severity = suggestion++# CA1507: Use nameof to express symbol names++dotnet_diagnostic.CA1507.severity = suggestion++# CA1510: Use ArgumentNullException throw helper++dotnet_diagnostic.CA1510.severity = suggestion++# CA1511: Use ArgumentException throw helper++dotnet_diagnostic.CA1511.severity = suggestion++# CA1512: Use ArgumentOutOfRangeException throw helper++dotnet_diagnostic.CA1512.severity = suggestion++# CA1513: Use ObjectDisposedException throw helper++dotnet_diagnostic.CA1513.severity = suggestion++# CA1802: Use literals where appropriate++dotnet_diagnostic.CA1802.severity = suggestion++# CA1805: Do not initialize unnecessarily++dotnet_diagnostic.CA1805.severity = suggestion++# CA1810: Do not initialize unnecessarily++dotnet_diagnostic.CA1810.severity = suggestion++# CA1822: Make member static++dotnet_diagnostic.CA1822.severity = suggestion++# CA1823: Avoid zero-length array allocations++dotnet_diagnostic.CA1825.severity = suggestion++# CA1826: Do not use Enumerable methods on indexable collections. Instead use the collection directly++dotnet_diagnostic.CA1826.severity = suggestion++# CA1827: Do not use Count() or LongCount() when Any() can be used++dotnet_diagnostic.CA1827.severity = suggestion++# CA1829: Use Length/Count property instead of Count() when available++dotnet_diagnostic.CA1829.severity = suggestion++# CA1831: Use AsSpan or AsMemory instead of Range-based indexers when appropriate++dotnet_diagnostic.CA1831.severity = suggestion++# CA1832: Use AsSpan or AsMemory instead of Range-based indexers when appropriate++dotnet_diagnostic.CA1832.severity = suggestion++# CA1833: Use AsSpan or AsMemory instead of Range-based indexers when appropriate++dotnet_diagnostic.CA1833.severity = suggestion++# CA1834: Consider using 'StringBuilder.Append(char)' when applicable++dotnet_diagnostic.CA1834.severity = suggestion++# CA1835: Prefer the 'Memory'-based overloads for 'ReadAsync' and 'WriteAsync'++dotnet_diagnostic.CA1835.severity = suggestion++# CA1837: Use 'Environment.ProcessId'++dotnet_diagnostic.CA1837.severity = suggestion++# CA1838: Avoid 'StringBuilder' parameters for P/Invokes++dotnet_diagnostic.CA1838.severity = suggestion++# CA1841: Prefer Dictionary.Contains methods++dotnet_diagnostic.CA1841.severity = suggestion++# CA1844: Provide memory-based overrides of async methods when subclassing 'Stream'++dotnet_diagnostic.CA1844.severity = suggestion++# CA1845: Use span-based 'string.Concat'++dotnet_diagnostic.CA1845.severity = suggestion++# CA1846: Prefer AsSpan over Substring++dotnet_diagnostic.CA1846.severity = suggestion++# CA1847: Use string.Contains(char) instead of string.Contains(string) with single characters++dotnet_diagnostic.CA1847.severity = suggestion++# CA1852: Seal internal types++dotnet_diagnostic.CA1852.severity = suggestion++# CA1854: Prefer the IDictionary.TryGetValue(TKey, out TValue) method++dotnet_diagnostic.CA1854.severity = suggestion++# CA1855: Prefer 'Clear' over 'Fill'++dotnet_diagnostic.CA1855.severity = suggestion++# CA1856: Incorrect usage of ConstantExpected attribute++dotnet_diagnostic.CA1856.severity = suggestion++# CA1857: A constant is expected for the parameter++dotnet_diagnostic.CA1857.severity = suggestion++# CA1858: Use 'StartsWith' instead of 'IndexOf'++dotnet_diagnostic.CA1858.severity = suggestion++# CA2007: Consider calling ConfigureAwait on the awaited task++dotnet_diagnostic.CA2007.severity = suggestion++# CA2008: Do not create tasks without passing a TaskScheduler++dotnet_diagnostic.CA2008.severity = suggestion++# CA2012: Use ValueTask correctly++dotnet_diagnostic.CA2012.severity = suggestion++# CA2201: Do not raise reserved exception types++dotnet_diagnostic.CA2201.severity = suggestion++# CA2249: Use string.Contains instead of string.IndexOf to improve readability.++dotnet_diagnostic.CA2249.severity = suggestion++# IDE0005: Remove unnecessary usings++dotnet_diagnostic.IDE0005.severity = suggestion++# IDE0020: Use pattern matching to avoid is check followed by a cast (with variable)++dotnet_diagnostic.IDE0020.severity = suggestion++# IDE0029: Use coalesce expression (non-nullable types)++dotnet_diagnostic.IDE0029.severity = suggestion++# IDE0030: Use coalesce expression (nullable types)++dotnet_diagnostic.IDE0030.severity = suggestion++# IDE0031: Use null propagation++dotnet_diagnostic.IDE0031.severity = suggestion++# IDE0038: Use pattern matching to avoid is check followed by a cast (without variable)++dotnet_diagnostic.IDE0038.severity = suggestion++# IDE0044: Make field readonly++dotnet_diagnostic.IDE0044.severity = suggestion++# IDE0051: Remove unused private members++dotnet_diagnostic.IDE0051.severity = suggestion++# IDE0059: Unnecessary assignment to a value++dotnet_diagnostic.IDE0059.severity = suggestion++# IDE0060: Remove unused parameters++dotnet_diagnostic.IDE0060.severity = suggestion++# IDE0062: Make local function static++dotnet_diagnostic.IDE0062.severity = suggestion++# IDE0200: Lambda expression can be removed++dotnet_diagnostic.IDE0200.severity = suggestion++++# CA2016: Forward the 'CancellationToken' parameter to methods that take one++dotnet_diagnostic.CA2016.severity = suggestion++++# Defaults for content in the shared src/ and shared runtime dir++++[{**/Shared/runtime/**.{cs,vb},src/Shared/test/Shared.Tests/runtime/**.{cs,vb},**/microsoft.extensions.hostfactoryresolver.sources/**.{cs,vb}}]++# CA1822: Make member static++dotnet_diagnostic.CA1822.severity = silent++# IDE0011: Use braces++dotnet_diagnostic.IDE0011.severity = silent++# IDE0055: Fix formatting++dotnet_diagnostic.IDE0055.severity = silent++# IDE0060: Remove unused parameters++dotnet_diagnostic.IDE0060.severity = silent++# IDE0062: Make local function static++dotnet_diagnostic.IDE0062.severity = silent++# IDE0161: Convert to file-scoped namespace++dotnet_diagnostic.IDE0161.severity = silent++++[{**/Shared/**.cs,**/microsoft.extensions.hostfactoryresolver.sources/**.{cs,vb}}]++# IDE0005: Remove unused usings. Ignore for shared src files since imports for those depend on the projects in which they are included.++dotnet_diagnostic.IDE0005.severity = silent++++[{*.razor.cs,src/Aspire.Dashboard/Components/**.cs}]++# CA2007: Consider calling ConfigureAwait on the awaited task++dotnet_diagnostic.CA2007.severity = silentdiff --cc dotnet/.gitattributesindex 000000000,000000000..671f86ba7new file mode 100644--- /dev/null+++ b/dotnet/.gitattributes@@@ -1,0 -1,0 +1,60 @@@++# Set default behavior to automatically normalize line endings.++* text=auto++++# Collapse these files in PRs by default++*.xlf linguist-generated=true++*.lcl linguist-generated=true++++*.jpg binary++*.png binary++*.gif binary++++# Force bash scripts to always use lf line endings so that if a repo is accessed++# in Unix via a file share from Windows, the scripts will work.++*.in text eol=lf++*.sh text eol=lf++++# Likewise, force cmd and batch scripts to always use crlf++*.cmd text eol=crlf++*.bat text eol=crlf++++*.cs text=auto diff=csharp++*.vb text=auto++*.resx text=auto++*.c text=auto++*.cpp text=auto++*.cxx text=auto++*.h text=auto++*.hxx text=auto++*.py text=auto++*.rb text=auto++*.java text=auto++*.html text=auto++*.htm text=auto++*.css text=auto++*.scss text=auto++*.sass text=auto++*.less text=auto++*.js text=auto++*.lisp text=auto++*.clj text=auto++*.sql text=auto++*.php text=auto++*.lua text=auto++*.m text=auto++*.asm text=auto++*.erl text=auto++*.fs text=auto++*.fsx text=auto++*.hs text=auto++++*.csproj text=auto++*.vbproj text=auto++*.fsproj text=auto++*.dbproj text=auto++*.sln text=auto eol=crlf++++# Set linguist language for .h files explicitly based on++# https://github.com/github/linguist/issues/1626#issuecomment-401442069++# this only affects the repo's language statistics++*.h linguist-language=Cdiff --cc dotnet/.gitignoreindex 000000000,000000000..b53c09b66new file mode 100644--- /dev/null+++ b/dotnet/.gitignore@@@ -1,0 -1,0 +1,146 @@@++syntax: glob++++### VisualStudio ###++++# Tools directory++.dotnet/++.packages/++.tools/++++# User-specific files++*.suo++*.user++*.userosscache++*.sln.docstates++++# Build results++++artifacts/++artifacts_stage_1/++[Dd]ebug/++[Rr]elease/++x64/ !eng/common/cross/x64/++x86/ !eng/common/cross/x86/++[Bb]in/++[Oo]bj/++msbuild.log++msbuild.err++msbuild.wrn++*.binlog++++# Visual Studio 2015++.vs/++++# Visual Studio 2015 Pre-CTP6++*.sln.ide++*.ide/++++# MSTest test Results++[Tt]est[Rr]esult*/++[Bb]uild[Ll]og.*++++#NUNIT++*.VisualState.xml++TestResult.xml++++# ReSharper is a .NET coding add-in++_ReSharper*/++*.[Rr]e[Ss]harper++*.DotSettings.user++++# DotCover is a Code Coverage Tool++*.dotCover++++# NuGet Packages++*.nuget.props++*.nuget.targets++*.nupkg++**/packages/*++++### Windows ###++++# Windows image file caches++Thumbs.db++ehthumbs.db++++# Folder config file++Desktop.ini++++# Recycle Bin used on file shares++$RECYCLE.BIN/++++# Windows Installer files++*.cab++*.msi++*.msm++*.msp++++# Windows shortcuts++*.lnk++++### Linux ###++++*~++++# KDE directory preferences++.directory++++### OSX ###++++.DS_Store++.AppleDouble++.LSOverride++++# Icon must end with two \r++Icon++++# Thumbnails++._*++++# Files that might appear on external disk++.Spotlight-V100++.Trashes++++# Directories potentially created on remote AFP share++.AppleDB++.AppleDesktop++Network Trash Folder++Temporary Items++.apdisk++++# vim temporary files++[._]*.s[a-w][a-z]++[._]s[a-w][a-z]++*.un~++Session.vim++.netrwhist++*~++++# Visual Studio Code++.vscode/++++# Private test configuration and binaries.++config.ps1++**/IISApplications++++++# Node.js modules++node_modules/++++# Python Compile Outputs++++*.pyc++++# IntelliJ++.idea/++++# vscode python env files++.env++++# Storage emulator storage files++**/.azurite/*++++# Azure Developer CLI files++/playground/**/.gitignore++/playground/**/azure.yaml++/playground/**/next-steps.mddiff --cc dotnet/AGNext.slnindex 000000000,e9be61c7b..f43a8caf4mode 000000,100644..100644--- a/dotnet/AGNext.sln+++ b/dotnet/AGNext.sln@@@ -1,0 -1,82 +1,82 @@@-Microsoft Visual Studio Solution File, Format Version 12.00-# Visual Studio Version 17-VisualStudioVersion = 17.0.31903.59-MinimumVisualStudioVersion = 10.0.40219.1-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{290F9824-BAD3-4703-B9B7-FE9C4BE3A1CF}"-EndProject-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AI.Agents", "src\Microsoft.AI.Agents\Microsoft.AI.Agents.csproj", "{B0BF1CD6-34E3-4ED4-9B2A-9B8781E9BE20}"-EndProject-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AI.Agents.Dapr", "src\Microsoft.AI.Agents.Dapr\Microsoft.AI.Agents.Dapr.csproj", "{1972846E-4C21-4E40-B448-D78B73806BD9}"-EndProject-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AI.Agents.Orleans", "src\Microsoft.AI.Agents.Orleans\Microsoft.AI.Agents.Orleans.csproj", "{A4AE4656-4919-45E2-9680-C317FBCF7693}"-EndProject-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{943853E7-513D-45EA-870F-549CFC0AF8E8}"-EndProject-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "gh-flow", "gh-flow", "{E0E93575-7187-4975-8D72-6F285CD01767}"-EndProject-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{50809508-F830-4553-9C4E-C802E0A0F690}"-EndProject-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AI.DevTeam", "samples\gh-flow\src\Microsoft.AI.DevTeam\Microsoft.AI.DevTeam.csproj", "{79981945-61F7-4E1A-8949-7808FD75471B}"-EndProject-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AI.DevTeam.Dapr", "samples\gh-flow\src\Microsoft.AI.DevTeam.Dapr\Microsoft.AI.DevTeam.Dapr.csproj", "{A7677950-18F1-42FF-8018-870395417465}"-EndProject-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "marketing", "marketing", "{1FF691E4-E27D-4A7E-861C-4D6291B6EE35}"-EndProject-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{4225F3BA-A39D-4680-945E-F2869E98AEA2}"-EndProject-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Marketing", "samples\marketing\src\backend\Marketing.csproj", "{62F276F3-9184-4908-A7FB-065B4E491BE2}"-EndProject-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "seed-memory", "samples\gh-flow\src\seed-memory\seed-memory.csproj", "{EF5DF177-F4F2-49D5-9E1C-2E37869238D8}"-EndProject-Global- GlobalSection(SolutionConfigurationPlatforms) = preSolution- Debug|Any CPU = Debug|Any CPU- Release|Any CPU = Release|Any CPU- EndGlobalSection- GlobalSection(ProjectConfigurationPlatforms) = postSolution- {B0BF1CD6-34E3-4ED4-9B2A-9B8781E9BE20}.Debug|Any CPU.ActiveCfg = Debug|Any CPU- {B0BF1CD6-34E3-4ED4-9B2A-9B8781E9BE20}.Debug|Any CPU.Build.0 = Debug|Any CPU- {B0BF1CD6-34E3-4ED4-9B2A-9B8781E9BE20}.Release|Any CPU.ActiveCfg = Release|Any CPU- {B0BF1CD6-34E3-4ED4-9B2A-9B8781E9BE20}.Release|Any CPU.Build.0 = Release|Any CPU- {1972846E-4C21-4E40-B448-D78B73806BD9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU- {1972846E-4C21-4E40-B448-D78B73806BD9}.Debug|Any CPU.Build.0 = Debug|Any CPU- {1972846E-4C21-4E40-B448-D78B73806BD9}.Release|Any CPU.ActiveCfg = Release|Any CPU- {1972846E-4C21-4E40-B448-D78B73806BD9}.Release|Any CPU.Build.0 = Release|Any CPU- {A4AE4656-4919-45E2-9680-C317FBCF7693}.Debug|Any CPU.ActiveCfg = Debug|Any CPU- {A4AE4656-4919-45E2-9680-C317FBCF7693}.Debug|Any CPU.Build.0 = Debug|Any CPU- {A4AE4656-4919-45E2-9680-C317FBCF7693}.Release|Any CPU.ActiveCfg = Release|Any CPU- {A4AE4656-4919-45E2-9680-C317FBCF7693}.Release|Any CPU.Build.0 = Release|Any CPU- {79981945-61F7-4E1A-8949-7808FD75471B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU- {79981945-61F7-4E1A-8949-7808FD75471B}.Debug|Any CPU.Build.0 = Debug|Any CPU- {79981945-61F7-4E1A-8949-7808FD75471B}.Release|Any CPU.ActiveCfg = Release|Any CPU- {79981945-61F7-4E1A-8949-7808FD75471B}.Release|Any CPU.Build.0 = Release|Any CPU- {A7677950-18F1-42FF-8018-870395417465}.Debug|Any CPU.ActiveCfg = Debug|Any CPU- {A7677950-18F1-42FF-8018-870395417465}.Debug|Any CPU.Build.0 = Debug|Any CPU- {A7677950-18F1-42FF-8018-870395417465}.Release|Any CPU.ActiveCfg = Release|Any CPU- {A7677950-18F1-42FF-8018-870395417465}.Release|Any CPU.Build.0 = Release|Any CPU- {62F276F3-9184-4908-A7FB-065B4E491BE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU- {62F276F3-9184-4908-A7FB-065B4E491BE2}.Debug|Any CPU.Build.0 = Debug|Any CPU- {62F276F3-9184-4908-A7FB-065B4E491BE2}.Release|Any CPU.ActiveCfg = Release|Any CPU- {62F276F3-9184-4908-A7FB-065B4E491BE2}.Release|Any CPU.Build.0 = Release|Any CPU- {EF5DF177-F4F2-49D5-9E1C-2E37869238D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU- {EF5DF177-F4F2-49D5-9E1C-2E37869238D8}.Debug|Any CPU.Build.0 = Debug|Any CPU- {EF5DF177-F4F2-49D5-9E1C-2E37869238D8}.Release|Any CPU.ActiveCfg = Release|Any CPU- {EF5DF177-F4F2-49D5-9E1C-2E37869238D8}.Release|Any CPU.Build.0 = Release|Any CPU- EndGlobalSection- GlobalSection(SolutionProperties) = preSolution- HideSolutionNode = FALSE- EndGlobalSection- GlobalSection(NestedProjects) = preSolution- {B0BF1CD6-34E3-4ED4-9B2A-9B8781E9BE20} = {290F9824-BAD3-4703-B9B7-FE9C4BE3A1CF}- {1972846E-4C21-4E40-B448-D78B73806BD9} = {290F9824-BAD3-4703-B9B7-FE9C4BE3A1CF}- {A4AE4656-4919-45E2-9680-C317FBCF7693} = {290F9824-BAD3-4703-B9B7-FE9C4BE3A1CF}- {E0E93575-7187-4975-8D72-6F285CD01767} = {943853E7-513D-45EA-870F-549CFC0AF8E8}- {50809508-F830-4553-9C4E-C802E0A0F690} = {E0E93575-7187-4975-8D72-6F285CD01767}- {79981945-61F7-4E1A-8949-7808FD75471B} = {50809508-F830-4553-9C4E-C802E0A0F690}- {A7677950-18F1-42FF-8018-870395417465} = {50809508-F830-4553-9C4E-C802E0A0F690}- {1FF691E4-E27D-4A7E-861C-4D6291B6EE35} = {943853E7-513D-45EA-870F-549CFC0AF8E8}- {4225F3BA-A39D-4680-945E-F2869E98AEA2} = {1FF691E4-E27D-4A7E-861C-4D6291B6EE35}- {62F276F3-9184-4908-A7FB-065B4E491BE2} = {4225F3BA-A39D-4680-945E-F2869E98AEA2}- {EF5DF177-F4F2-49D5-9E1C-2E37869238D8} = {943853E7-513D-45EA-870F-549CFC0AF8E8}- EndGlobalSection-EndGlobal++Microsoft Visual Studio Solution File, Format Version 12.00++# Visual Studio Version 17++VisualStudioVersion = 17.0.31903.59++MinimumVisualStudioVersion = 10.0.40219.1++Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "csharp\src", "{290F9824-BAD3-4703-B9B7-FE9C4BE3A1CF}"++EndProject++Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AI.Agents", "csharp\src\Microsoft.AI.Agents\Microsoft.AI.Agents.csproj", "{B0BF1CD6-34E3-4ED4-9B2A-9B8781E9BE20}"++EndProject++Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AI.Agents.Dapr", "csharp\src\Microsoft.AI.Agents.Dapr\Microsoft.AI.Agents.Dapr.csproj", "{1972846E-4C21-4E40-B448-D78B73806BD9}"++EndProject++Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AI.Agents.Orleans", "csharp\src\Microsoft.AI.Agents.Orleans\Microsoft.AI.Agents.Orleans.csproj", "{A4AE4656-4919-45E2-9680-C317FBCF7693}"++EndProject++Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "examples", "examples\csharp", "{943853E7-513D-45EA-870F-549CFC0AF8E8}"++EndProject++Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "gh-flow", "gh-flow", "{E0E93575-7187-4975-8D72-6F285CD01767}"++EndProject++Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "csharp\src", "{50809508-F830-4553-9C4E-C802E0A0F690}"++EndProject++Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AI.DevTeam", "examples\csharp\gh-flow\src\Microsoft.AI.DevTeam\Microsoft.AI.DevTeam.csproj", "{79981945-61F7-4E1A-8949-7808FD75471B}"++EndProject++Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AI.DevTeam.Dapr", "examples\csharp\gh-flow\src\Microsoft.AI.DevTeam.Dapr\Microsoft.AI.DevTeam.Dapr.csproj", "{A7677950-18F1-42FF-8018-870395417465}"++EndProject++Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "marketing", "marketing", "{1FF691E4-E27D-4A7E-861C-4D6291B6EE35}"++EndProject++Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "csharp\src", "{4225F3BA-A39D-4680-945E-F2869E98AEA2}"++EndProject++Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Marketing", "examples\csharp\marketing\src\backend\Marketing.csproj", "{62F276F3-9184-4908-A7FB-065B4E491BE2}"++EndProject++Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "seed-memory", "examples\csharp\gh-flow\src\seed-memory\seed-memory.csproj", "{EF5DF177-F4F2-49D5-9E1C-2E37869238D8}"++EndProject++Global++ GlobalSection(SolutionConfigurationPlatforms) = preSolution++ Debug|Any CPU = Debug|Any CPU++ Release|Any CPU = Release|Any CPU++ EndGlobalSection++ GlobalSection(ProjectConfigurationPlatforms) = postSolution++ {B0BF1CD6-34E3-4ED4-9B2A-9B8781E9BE20}.Debug|Any CPU.ActiveCfg = Debug|Any CPU++ {B0BF1CD6-34E3-4ED4-9B2A-9B8781E9BE20}.Debug|Any CPU.Build.0 = Debug|Any CPU++ {B0BF1CD6-34E3-4ED4-9B2A-9B8781E9BE20}.Release|Any CPU.ActiveCfg = Release|Any CPU++ {B0BF1CD6-34E3-4ED4-9B2A-9B8781E9BE20}.Release|Any CPU.Build.0 = Release|Any CPU++ {1972846E-4C21-4E40-B448-D78B73806BD9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU++ {1972846E-4C21-4E40-B448-D78B73806BD9}.Debug|Any CPU.Build.0 = Debug|Any CPU++ {1972846E-4C21-4E40-B448-D78B73806BD9}.Release|Any CPU.ActiveCfg = Release|Any CPU++ {1972846E-4C21-4E40-B448-D78B73806BD9}.Release|Any CPU.Build.0 = Release|Any CPU++ {A4AE4656-4919-45E2-9680-C317FBCF7693}.Debug|Any CPU.ActiveCfg = Debug|Any CPU++ {A4AE4656-4919-45E2-9680-C317FBCF7693}.Debug|Any CPU.Build.0 = Debug|Any CPU++ {A4AE4656-4919-45E2-9680-C317FBCF7693}.Release|Any CPU.ActiveCfg = Release|Any CPU++ {A4AE4656-4919-45E2-9680-C317FBCF7693}.Release|Any CPU.Build.0 = Release|Any CPU++ {79981945-61F7-4E1A-8949-7808FD75471B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU++ {79981945-61F7-4E1A-8949-7808FD75471B}.Debug|Any CPU.Build.0 = Debug|Any CPU++ {79981945-61F7-4E1A-8949-7808FD75471B}.Release|Any CPU.ActiveCfg = Release|Any CPU++ {79981945-61F7-4E1A-8949-7808FD75471B}.Release|Any CPU.Build.0 = Release|Any CPU++ {A7677950-18F1-42FF-8018-870395417465}.Debug|Any CPU.ActiveCfg = Debug|Any CPU++ {A7677950-18F1-42FF-8018-870395417465}.Debug|Any CPU.Build.0 = Debug|Any CPU++ {A7677950-18F1-42FF-8018-870395417465}.Release|Any CPU.ActiveCfg = Release|Any CPU++ {A7677950-18F1-42FF-8018-870395417465}.Release|Any CPU.Build.0 = Release|Any CPU++ {62F276F3-9184-4908-A7FB-065B4E491BE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU++ {62F276F3-9184-4908-A7FB-065B4E491BE2}.Debug|Any CPU.Build.0 = Debug|Any CPU++ {62F276F3-9184-4908-A7FB-065B4E491BE2}.Release|Any CPU.ActiveCfg = Release|Any CPU++ {62F276F3-9184-4908-A7FB-065B4E491BE2}.Release|Any CPU.Build.0 = Release|Any CPU++ {EF5DF177-F4F2-49D5-9E1C-2E37869238D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU++ {EF5DF177-F4F2-49D5-9E1C-2E37869238D8}.Debug|Any CPU.Build.0 = Debug|Any CPU++ {EF5DF177-F4F2-49D5-9E1C-2E37869238D8}.Release|Any CPU.ActiveCfg = Release|Any CPU++ {EF5DF177-F4F2-49D5-9E1C-2E37869238D8}.Release|Any CPU.Build.0 = Release|Any CPU++ EndGlobalSection++ GlobalSection(SolutionProperties) = preSolution++ HideSolutionNode = FALSE++ EndGlobalSection++ GlobalSection(NestedProjects) = preSolution++ {B0BF1CD6-34E3-4ED4-9B2A-9B8781E9BE20} = {290F9824-BAD3-4703-B9B7-FE9C4BE3A1CF}++ {1972846E-4C21-4E40-B448-D78B73806BD9} = {290F9824-BAD3-4703-B9B7-FE9C4BE3A1CF}++ {A4AE4656-4919-45E2-9680-C317FBCF7693} = {290F9824-BAD3-4703-B9B7-FE9C4BE3A1CF}++ {E0E93575-7187-4975-8D72-6F285CD01767} = {943853E7-513D-45EA-870F-549CFC0AF8E8}++ {50809508-F830-4553-9C4E-C802E0A0F690} = {E0E93575-7187-4975-8D72-6F285CD01767}++ {79981945-61F7-4E1A-8949-7808FD75471B} = {50809508-F830-4553-9C4E-C802E0A0F690}++ {A7677950-18F1-42FF-8018-870395417465} = {50809508-F830-4553-9C4E-C802E0A0F690}++ {1FF691E4-E27D-4A7E-861C-4D6291B6EE35} = {943853E7-513D-45EA-870F-549CFC0AF8E8}++ {4225F3BA-A39D-4680-945E-F2869E98AEA2} = {1FF691E4-E27D-4A7E-861C-4D6291B6EE35}++ {62F276F3-9184-4908-A7FB-065B4E491BE2} = {4225F3BA-A39D-4680-945E-F2869E98AEA2}++ {EF5DF177-F4F2-49D5-9E1C-2E37869238D8} = {943853E7-513D-45EA-870F-549CFC0AF8E8}++ EndGlobalSection++EndGlobaldiff --cc dotnet/samples/WorkflowsApp/.env_exampleindex 000000000,94c270052..94c270052mode 000000,100644..100644--- a/dotnet/samples/WorkflowsApp/.env_example+++ b/dotnet/samples/WorkflowsApp/.env_examplediff --cc dotnet/samples/WorkflowsApp/Activities/ActivityProviders/SemanticKernelSkillActivityProvider.csindex 000000000,4c8256994..4c8256994mode 000000,100644..100644--- a/dotnet/samples/WorkflowsApp/Activities/ActivityProviders/SemanticKernelSkillActivityProvider.cs+++ b/dotnet/samples/WorkflowsApp/Activities/ActivityProviders/SemanticKernelSkillActivityProvider.csdiff --cc dotnet/samples/WorkflowsApp/Activities/SemanticKernel.csindex 000000000,85ad789eb..85ad789ebmode 000000,100644..100644--- a/dotnet/samples/WorkflowsApp/Activities/SemanticKernel.cs+++ b/dotnet/samples/WorkflowsApp/Activities/SemanticKernel.csdiff --cc dotnet/samples/WorkflowsApp/Config/KernelSettings.csindex 000000000,7e549c9af..7e549c9afmode 000000,100644..100644--- a/dotnet/samples/WorkflowsApp/Config/KernelSettings.cs+++ b/dotnet/samples/WorkflowsApp/Config/KernelSettings.csdiff --cc dotnet/samples/WorkflowsApp/Config/PromptDefaults.csindex 000000000,6f5a16c75..6f5a16c75mode 000000,100644..100644--- a/dotnet/samples/WorkflowsApp/Config/PromptDefaults.cs+++ b/dotnet/samples/WorkflowsApp/Config/PromptDefaults.csdiff --cc dotnet/samples/WorkflowsApp/NuGet.Configindex 000000000,a89a1e8b5..a89a1e8b5mode 000000,100644..100644--- a/dotnet/samples/WorkflowsApp/NuGet.Config+++ b/dotnet/samples/WorkflowsApp/NuGet.Configdiff --cc dotnet/samples/WorkflowsApp/Pages/Index.cshtmlindex 000000000,b889d560a..b889d560amode 000000,100644..100644--- a/dotnet/samples/WorkflowsApp/Pages/Index.cshtml+++ b/dotnet/samples/WorkflowsApp/Pages/Index.cshtmldiff --cc dotnet/samples/WorkflowsApp/Pages/_ViewImports.cshtmlindex 000000000,251d63908..251d63908mode 000000,100644..100644--- a/dotnet/samples/WorkflowsApp/Pages/_ViewImports.cshtml+++ b/dotnet/samples/WorkflowsApp/Pages/_ViewImports.cshtmldiff --cc dotnet/samples/WorkflowsApp/Program.csindex 000000000,378a6f6c2..463bfda62mode 000000,100644..100644--- a/dotnet/samples/WorkflowsApp/Program.cs+++ b/dotnet/samples/WorkflowsApp/Program.cs@@@ -1,0 -1,54 +1,54 @@@-using Elsa.EntityFrameworkCore.Extensions;-using Elsa.EntityFrameworkCore.Modules.Management;-using Elsa.EntityFrameworkCore.Modules.Runtime;-using Elsa.Extensions;-using Elsa.SemanticKernel;--var builder = WebApplication.CreateBuilder(args);--// Add services to the container.-builder.Services.AddElsa(elsa =>-{- // Configure management feature to use EF Core.- elsa.UseWorkflowManagement(management => management.UseEntityFrameworkCore(ef => ef.UseSqlite()));-- elsa.UseWorkflowRuntime(runtime =>runtime.UseEntityFrameworkCore());-- // Expose API endpoints.- elsa.UseWorkflowsApi();-- // Add services for HTTP activities and workflow middleware.- elsa.UseHttp();-- // Configure identity so that we can create a default admin user.- elsa.UseIdentity(identity =>- {- identity.UseAdminUserProvider();- identity.TokenOptions = options => options.SigningKey = "secret-token-signing-key";- });-- // Use default authentication (JWT + API Key).- elsa.UseDefaultAuthentication(auth => auth.UseAdminApiKey());-- // Add Semantic Kernel skill.- elsa.AddActivity<SemanticKernelSkill>();--});--// Add dynamic Activity Provider for SK skills.-builder.Services.AddActivityProvider<SemanticKernelActivityProvider>();--// Add Razor pages.-builder.Services.AddRazorPages();--var app = builder.Build();--// Configure the HTTP request pipeline.-app.UseHttpsRedirection();-app.UseStaticFiles();-app.UseAuthentication();-app.UseAuthorization();-app.UseWorkflowsApi();-app.UseWorkflows();-app.MapRazorPages();-app.Run();++using Elsa.EntityFrameworkCore.Extensions;++using Elsa.EntityFrameworkCore.Modules.Management;++using Elsa.EntityFrameworkCore.Modules.Runtime;++using Elsa.Extensions;++using Elsa.SemanticKernel;++++var builder = WebApplication.CreateBuilder(args);++++// Add services to the container.++builder.Services.AddElsa(elsa =>++{++ // Configure management feature to use EF Core.++ elsa.UseWorkflowManagement(management => management.UseEntityFrameworkCore(ef => ef.UseSqlite()));++++ elsa.UseWorkflowRuntime(runtime =>runtime.UseEntityFrameworkCore());++++ // Expose API endpoints.++ elsa.UseWorkflowsApi();++++ // Add services for HTTP activities and workflow middleware.++ elsa.UseHttp();++++ // Configure identity so that we can create a default admin user.++ elsa.UseIdentity(identity =>++ {++ identity.UseAdminUserProvider();++ identity.TokenOptions = options => options.SigningKey = "secret-token-signing-key";++ });++++ // Use default authentication (JWT + API Key).++ elsa.UseDefaultAuthentication(auth => auth.UseAdminApiKey());++++ // Add Semantic Kernel skill.++ elsa.AddActivity<SemanticKernelSkill>();++++});++++// Add dynamic Activity Provider for SK skills.++builder.Services.AddActivityProvider<SemanticKernelActivityProvider>();++++// Add Razor pages.++builder.Services.AddRazorPages();++++var app = builder.Build();++++// Configure the HTTP request pipeline.++app.UseHttpsRedirection();++app.UseStaticFiles();++app.UseAuthentication();++app.UseAuthorization();++app.UseWorkflowsApi();++app.UseWorkflows();++app.MapRazorPages();++app.Run();diff --cc dotnet/samples/WorkflowsApp/Properties/launchSettings.jsonindex 000000000,aacf9bea6..b5db5f1ddmode 000000,100644..100644--- a/dotnet/samples/WorkflowsApp/Properties/launchSettings.json+++ b/dotnet/samples/WorkflowsApp/Properties/launchSettings.json@@@ -1,0 -1,37 +1,37 @@@-{- "iisSettings": {- "windowsAuthentication": false,- "anonymousAuthentication": true,- "iisExpress": {- "applicationUrl": "http://localhost:10492",- "sslPort": 44312- }- },- "profiles": {- "http": {- "commandName": "Project",- "dotnetRunMessages": true,- "launchBrowser": true,- "applicationUrl": "http://localhost:5181",- "environmentVariables": {- "ASPNETCORE_ENVIRONMENT": "Development"- }- },- "https": {- "commandName": "Project",- "dotnetRunMessages": true,- "launchBrowser": true,- "applicationUrl": "https://localhost:7077;http://localhost:5181",- "environmentVariables": {- "ASPNETCORE_ENVIRONMENT": "Development"- }- },- "IIS Express": {- "commandName": "IISExpress",- "launchBrowser": true,- "environmentVariables": {- "ASPNETCORE_ENVIRONMENT": "Development"- }- }- }-}++{++ "iisSettings": {++ "windowsAuthentication": false,++ "anonymousAuthentication": true,++ "iisExpress": {++ "applicationUrl": "http://localhost:10492",++ "sslPort": 44312++ }++ },++ "profiles": {++ "http": {++ "commandName": "Project",++ "dotnetRunMessages": true,++ "launchBrowser": true,++ "applicationUrl": "http://localhost:5181",++ "environmentVariables": {++ "ASPNETCORE_ENVIRONMENT": "Development"++ }++ },++ "https": {++ "commandName": "Project",++ "dotnetRunMessages": true,++ "launchBrowser": true,++ "applicationUrl": "https://localhost:7077;http://localhost:5181",++ "environmentVariables": {++ "ASPNETCORE_ENVIRONMENT": "Development"++ }++ },++ "IIS Express": {++ "commandName": "IISExpress",++ "launchBrowser": true,++ "environmentVariables": {++ "ASPNETCORE_ENVIRONMENT": "Development"++ }++ }++ }++}diff --cc dotnet/samples/WorkflowsApp/README.mdindex 000000000,d24e35852..d24e35852mode 000000,100644..100644--- a/dotnet/samples/WorkflowsApp/README.md+++ b/dotnet/samples/WorkflowsApp/README.mddiff --cc dotnet/samples/WorkflowsApp/Skills/DevLeadPrompts.csindex 000000000,4072a8a3f..4072a8a3fmode 000000,100644..100644--- a/dotnet/samples/WorkflowsApp/Skills/DevLeadPrompts.cs+++ b/dotnet/samples/WorkflowsApp/Skills/DevLeadPrompts.csdiff --cc dotnet/samples/WorkflowsApp/Skills/Developer.csindex 000000000,ed4ed5781..ed4ed5781mode 000000,100644..100644--- a/dotnet/samples/WorkflowsApp/Skills/Developer.cs+++ b/dotnet/samples/WorkflowsApp/Skills/Developer.csdiff --cc dotnet/samples/WorkflowsApp/Skills/PMPrompts.csindex 000000000,c8fb11883..c8fb11883mode 000000,100644..100644--- a/dotnet/samples/WorkflowsApp/Skills/PMPrompts.cs+++ b/dotnet/samples/WorkflowsApp/Skills/PMPrompts.csdiff --cc dotnet/samples/WorkflowsApp/Skills/SemanticFunctionConfig.csindex 000000000,1569962e2..1569962e2mode 000000,100644..100644--- a/dotnet/samples/WorkflowsApp/Skills/SemanticFunctionConfig.cs+++ b/dotnet/samples/WorkflowsApp/Skills/SemanticFunctionConfig.csdiff --cc dotnet/samples/WorkflowsApp/WorkflowsApp.csprojindex 000000000,6f874eb48..d0f32f3femode 000000,100644..100644--- a/dotnet/samples/WorkflowsApp/WorkflowsApp.csproj+++ b/dotnet/samples/WorkflowsApp/WorkflowsApp.csproj@@@ -1,0 -1,29 +1,29 @@@-<Project Sdk="Microsoft.NET.Sdk.Web">-- <PropertyGroup>- <TargetFramework>net8.0</TargetFramework>- <Nullable>enable</Nullable>- <ImplicitUsings>enable</ImplicitUsings>- </PropertyGroup>-- <ItemGroup>- <PackageReference Include="Elsa.EntityFrameworkCore" Version="3.0.6" />- <PackageReference Include="Elsa.EntityFrameworkCore.Sqlite" Version="3.0.6" />- <PackageReference Include="Elsa.Identity" Version="3.0.6" />- <PackageReference Include="Elsa" Version="3.0.6" />- <PackageReference Include="Elsa.Http" Version="3.0.6" />- <PackageReference Include="Elsa.Workflows.Api" Version="3.0.6" />- <PackageReference Include="Elsa.Workflows.Core" Version="3.0.6" />- <PackageReference Include="Elsa.Workflows.Management" Version="3.0.6" />- <PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.0" />- <PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />- <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />- <PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />- <PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="8.0.0" />- <PackageReference Include="AspNetCore.Authentication.ApiKey" Version="8.0.0" />- <PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="8.0.0" />- <PackageReference Include="Elsa.Workflows.Designer" Version="3.0.0-preview.727" />- <PackageReference Include="Microsoft.SemanticKernel" Version="1.6.2" />- </ItemGroup>--</Project>++<Project Sdk="Microsoft.NET.Sdk.Web">++++ <PropertyGroup>++ <TargetFramework>net8.0</TargetFramework>++ <Nullable>enable</Nullable>++ <ImplicitUsings>enable</ImplicitUsings>++ </PropertyGroup>++++ <ItemGroup>++ <PackageReference Include="Elsa.EntityFrameworkCore" Version="3.0.6" />++ <PackageReference Include="Elsa.EntityFrameworkCore.Sqlite" Version="3.0.6" />++ <PackageReference Include="Elsa.Identity" Version="3.0.6" />++ <PackageReference Include="Elsa" Version="3.0.6" />++ <PackageReference Include="Elsa.Http" Version="3.0.6" />++ <PackageReference Include="Elsa.Workflows.Api" Version="3.0.6" />++ <PackageReference Include="Elsa.Workflows.Core" Version="3.0.6" />++ <PackageReference Include="Elsa.Workflows.Management" Version="3.0.6" />++ <PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.0" />++ <PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />++ <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />++ <PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />++ <PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="8.0.0" />++ <PackageReference Include="AspNetCore.Authentication.ApiKey" Version="8.0.0" />++ <PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="8.0.0" />++ <PackageReference Include="Elsa.Workflows.Designer" Version="3.0.0-preview.727" />++ <PackageReference Include="Microsoft.SemanticKernel" Version="1.6.2" />++ </ItemGroup>++++</Project>diff --cc dotnet/samples/WorkflowsApp/appsettings.Development.jsonindex 000000000,ff66ba6b2..0c208ae91mode 000000,100644..100644--- a/dotnet/samples/WorkflowsApp/appsettings.Development.json+++ b/dotnet/samples/WorkflowsApp/appsettings.Development.json@@@ -1,0 -1,8 +1,8 @@@-{- "Logging": {- "LogLevel": {- "Default": "Information",- "Microsoft.AspNetCore": "Warning"- }- }-}++{++ "Logging": {++ "LogLevel": {++ "Default": "Information",++ "Microsoft.AspNetCore": "Warning"++ }++ }++}diff --cc dotnet/samples/gh-flow/README.mdindex 000000000,ff0aed310..ff0aed310mode 000000,100644..100644--- a/dotnet/samples/gh-flow/README.md+++ b/dotnet/samples/gh-flow/README.mddiff --cc dotnet/samples/gh-flow/azure.yamlindex 000000000,8553ba154..8553ba154mode 000000,100644..100644--- a/dotnet/samples/gh-flow/azure.yaml+++ b/dotnet/samples/gh-flow/azure.yamldiff --cc dotnet/samples/gh-flow/components/pubsub.yamlindex 000000000,5aec174af..5aec174afmode 000000,100644..100644--- a/dotnet/samples/gh-flow/components/pubsub.yaml+++ b/dotnet/samples/gh-flow/components/pubsub.yamldiff --cc dotnet/samples/gh-flow/components/statestore.yamlindex 000000000,9693888f2..9693888f2mode 000000,100644..100644--- a/dotnet/samples/gh-flow/components/statestore.yaml+++ b/dotnet/samples/gh-flow/components/statestore.yamldiff --cc dotnet/samples/gh-flow/docs/github-flow-getting-started.mdindex 000000000,ebfb16825..ebfb16825mode 000000,100644..100644--- a/dotnet/samples/gh-flow/docs/github-flow-getting-started.md+++ b/dotnet/samples/gh-flow/docs/github-flow-getting-started.mddiff --cc dotnet/samples/gh-flow/docs/images/github-sk-dev-team.pngindex 000000000,c70e4d87b..c70e4d87bmode 000000,100644..100644Binary files differdiff --cc dotnet/samples/gh-flow/docs/images/new-codespace.pngindex 000000000,928756830..928756830mode 000000,100644..100644Binary files differdiff --cc dotnet/samples/gh-flow/docs/images/overview.pngindex 000000000,cdb0c0a5c..cdb0c0a5cmode 000000,100644..100644Binary files differdiff --cc dotnet/samples/gh-flow/docs/images/solution-explorer.pngindex 000000000,48165f8dd..48165f8ddmode 000000,100644..100644Binary files differdiff --cc dotnet/samples/gh-flow/infra/abbreviations.jsonindex 000000000,fba689e2f..fba689e2fmode 000000,100644..100644--- a/dotnet/samples/gh-flow/infra/abbreviations.json+++ b/dotnet/samples/gh-flow/infra/abbreviations.jsondiff --cc dotnet/samples/gh-flow/infra/app/db.bicepindex 000000000,077bb7212..077bb7212mode 000000,100644..100644--- a/dotnet/samples/gh-flow/infra/app/db.bicep+++ b/dotnet/samples/gh-flow/infra/app/db.bicepdiff --cc dotnet/samples/gh-flow/infra/app/gh-flow.bicepindex 000000000,0a78aea50..0a78aea50mode 000000,100644..100644--- a/dotnet/samples/gh-flow/infra/app/gh-flow.bicep+++ b/dotnet/samples/gh-flow/infra/app/gh-flow.bicepdiff --cc dotnet/samples/gh-flow/infra/core/database/cosmos/cosmos-account.bicepindex 000000000,4c129b0f7..4c129b0f7mode 000000,100644..100644--- a/dotnet/samples/gh-flow/infra/core/database/cosmos/cosmos-account.bicep+++ b/dotnet/samples/gh-flow/infra/core/database/cosmos/cosmos-account.bicepdiff --cc dotnet/samples/gh-flow/infra/core/database/cosmos/sql/cosmos-sql-account.bicepindex 000000000,fee0f679e..fee0f679emode 000000,100644..100644--- a/dotnet/samples/gh-flow/infra/core/database/cosmos/sql/cosmos-sql-account.bicep+++ b/dotnet/samples/gh-flow/infra/core/database/cosmos/sql/cosmos-sql-account.bicepdiff --cc dotnet/samples/gh-flow/infra/core/database/cosmos/sql/cosmos-sql-db.bicepindex 000000000,3c79064ec..3c79064ecmode 000000,100644..100644--- a/dotnet/samples/gh-flow/infra/core/database/cosmos/sql/cosmos-sql-db.bicep+++ b/dotnet/samples/gh-flow/infra/core/database/cosmos/sql/cosmos-sql-db.bicepdiff --cc dotnet/samples/gh-flow/infra/core/database/cosmos/sql/cosmos-sql-role-assign.bicepindex 000000000,3949efef0..3949efef0mode 000000,100644..100644--- a/dotnet/samples/gh-flow/infra/core/database/cosmos/sql/cosmos-sql-role-assign.bicep+++ b/dotnet/samples/gh-flow/infra/core/database/cosmos/sql/cosmos-sql-role-assign.bicepdiff --cc dotnet/samples/gh-flow/infra/core/database/cosmos/sql/cosmos-sql-role-def.bicepindex 000000000,778d6dc47..778d6dc47mode 000000,100644..100644--- a/dotnet/samples/gh-flow/infra/core/database/cosmos/sql/cosmos-sql-role-def.bicep+++ b/dotnet/samples/gh-flow/infra/core/database/cosmos/sql/cosmos-sql-role-def.bicepdiff --cc dotnet/samples/gh-flow/infra/core/database/postgresql/flexibleserver.bicepindex 000000000,effda63de..effda63demode 000000,100644..100644--- a/dotnet/samples/gh-flow/infra/core/database/postgresql/flexibleserver.bicep+++ b/dotnet/samples/gh-flow/infra/core/database/postgresql/flexibleserver.bicepdiff --cc dotnet/samples/gh-flow/infra/core/database/qdrant/qdrant-aca.bicepindex 000000000,a5f1573eb..a5f1573ebmode 000000,100644..100644--- a/dotnet/samples/gh-flow/infra/core/database/qdrant/qdrant-aca.bicep+++ b/dotnet/samples/gh-flow/infra/core/database/qdrant/qdrant-aca.bicepdiff --cc dotnet/samples/gh-flow/infra/core/host/appservice-appsettings.bicepindex 000000000,574342a81..574342a81mode 000000,100644..100644--- a/dotnet/samples/gh-flow/infra/core/host/appservice-appsettings.bicep+++ b/dotnet/samples/gh-flow/infra/core/host/appservice-appsettings.bicepdiff --cc dotnet/samples/gh-flow/infra/core/host/appservice.bicepindex 000000000,9ecb2b082..9ecb2b082mode 000000,100644..100644--- a/dotnet/samples/gh-flow/infra/core/host/appservice.bicep+++ b/dotnet/samples/gh-flow/infra/core/host/appservice.bicepdiff --cc dotnet/samples/gh-flow/infra/core/host/appserviceplan.bicepindex 000000000,c444f4065..c444f4065mode 000000,100644..100644--- a/dotnet/samples/gh-flow/infra/core/host/appserviceplan.bicep+++ b/dotnet/samples/gh-flow/infra/core/host/appserviceplan.bicepdiff --cc dotnet/samples/gh-flow/infra/core/host/container-app-upsert.bicepindex 000000000,d9be752b0..d9be752b0mode 000000,100644..100644--- a/dotnet/samples/gh-flow/infra/core/host/container-app-upsert.bicep+++ b/dotnet/samples/gh-flow/infra/core/host/container-app-upsert.bicepdiff --cc dotnet/samples/gh-flow/infra/core/host/container-app.bicepindex 000000000,7781caa80..7781caa80mode 000000,100644..100644--- a/dotnet/samples/gh-flow/infra/core/host/container-app.bicep+++ b/dotnet/samples/gh-flow/infra/core/host/container-app.bicepdiff --cc dotnet/samples/gh-flow/infra/core/host/container-apps-environment.bicepindex 000000000,f29079a02..f29079a02mode 000000,100644..100644--- a/dotnet/samples/gh-flow/infra/core/host/container-apps-environment.bicep+++ b/dotnet/samples/gh-flow/infra/core/host/container-apps-environment.bicepdiff --cc dotnet/samples/gh-flow/infra/core/host/container-apps.bicepindex 000000000,38f47e068..38f47e068mode 000000,100644..100644--- a/dotnet/samples/gh-flow/infra/core/host/container-apps.bicep+++ b/dotnet/samples/gh-flow/infra/core/host/container-apps.bicepdiff --cc dotnet/samples/gh-flow/infra/core/host/container-registry.bicepindex 000000000,02af29925..02af29925mode 000000,100644..100644--- a/dotnet/samples/gh-flow/infra/core/host/container-registry.bicep+++ b/dotnet/samples/gh-flow/infra/core/host/container-registry.bicepdiff --cc dotnet/samples/gh-flow/infra/core/host/functions.bicepindex 000000000,9265c7919..9265c7919mode 000000,100644..100644--- a/dotnet/samples/gh-flow/infra/core/host/functions.bicep+++ b/dotnet/samples/gh-flow/infra/core/host/functions.bicepdiff --cc dotnet/samples/gh-flow/infra/core/monitor/applicationinsights-dashboard.bicepindex 000000000,b7af2c1a1..b7af2c1a1mode 000000,100644..100644--- a/dotnet/samples/gh-flow/infra/core/monitor/applicationinsights-dashboard.bicep+++ b/dotnet/samples/gh-flow/infra/core/monitor/applicationinsights-dashboard.bicepdiff --cc dotnet/samples/gh-flow/infra/core/monitor/applicationinsights.bicepindex 000000000,9cb814321..9cb814321mode 000000,100644..100644--- a/dotnet/samples/gh-flow/infra/core/monitor/applicationinsights.bicep+++ b/dotnet/samples/gh-flow/infra/core/monitor/applicationinsights.bicepdiff --cc dotnet/samples/gh-flow/infra/core/monitor/loganalytics.bicepindex 000000000,770544cca..770544ccamode 000000,100644..100644--- a/dotnet/samples/gh-flow/infra/core/monitor/loganalytics.bicep+++ b/dotnet/samples/gh-flow/infra/core/monitor/loganalytics.bicepdiff --cc dotnet/samples/gh-flow/infra/core/monitor/monitoring.bicepindex 000000000,a56f9ecb1..a56f9ecb1mode 000000,100644..100644--- a/dotnet/samples/gh-flow/infra/core/monitor/monitoring.bicep+++ b/dotnet/samples/gh-flow/infra/core/monitor/monitoring.bicepdiff --cc dotnet/samples/gh-flow/infra/core/security/registry-access.bicepindex 000000000,5335efabc..5335efabcmode 000000,100644..100644--- a/dotnet/samples/gh-flow/infra/core/security/registry-access.bicep+++ b/dotnet/samples/gh-flow/infra/core/security/registry-access.bicepdiff --cc dotnet/samples/gh-flow/infra/core/storage/storage-account.bicepindex 000000000,75461a654..75461a654mode 000000,100644..100644--- a/dotnet/samples/gh-flow/infra/core/storage/storage-account.bicep+++ b/dotnet/samples/gh-flow/infra/core/storage/storage-account.bicepdiff --cc dotnet/samples/gh-flow/infra/main.bicepindex 000000000,331ac6595..331ac6595mode 000000,100644..100644--- a/dotnet/samples/gh-flow/infra/main.bicep+++ b/dotnet/samples/gh-flow/infra/main.bicepdiff --cc dotnet/samples/gh-flow/infra/main.parameters.jsonindex 000000000,05edbfaae..05edbfaaemode 000000,100644..100644--- a/dotnet/samples/gh-flow/infra/main.parameters.json+++ b/dotnet/samples/gh-flow/infra/main.parameters.jsondiff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Agents/Architect/Architect.csindex 000000000,66812798a..66812798amode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Agents/Architect/Architect.cs+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Agents/Architect/Architect.csdiff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Agents/AzureGenie.csindex 000000000,c42ddaac1..15305a5e0mode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Agents/AzureGenie.cs+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Agents/AzureGenie.cs@@@ -1,0 -1,64 +1,64 @@@-using Dapr.Actors;-using Dapr.Actors.Runtime;-using Dapr.Client;-using Microsoft.AI.Agents.Abstractions;-using Microsoft.AI.Agents.Dapr;-using Microsoft.AI.DevTeam.Dapr.Events;--namespace Microsoft.AI.DevTeam.Dapr;--public class AzureGenie : Agent, IDaprAgent-{- private readonly IManageAzure _azureService;-- public AzureGenie(ActorHost host,DaprClient client, IManageAzure azureService) : base(host, client)- {- _azureService = azureService;- }-- public override async Task HandleEvent(Event item)- {- switch (item.Type)- {- case nameof(GithubFlowEventType.ReadmeCreated):- {- var context = item.ToGithubContext();- await Store(context.Org,context.Repo, context.ParentNumber.Value, context.IssueNumber, "readme", "md", "output", item.Data["readme"]);- await PublishEvent(Consts.PubSub, Consts.MainTopic, new Event- {- Type = nameof(GithubFlowEventType.ReadmeStored),- Subject = context.Subject,- Data = context.ToData()- });- }-- break;- case nameof(GithubFlowEventType.CodeCreated):- {- var context = item.ToGithubContext();- await Store(context.Org,context.Repo, context.ParentNumber.Value, context.IssueNumber, "run", "sh", "output", item.Data["code"]);- await RunInSandbox(context.Org,context.Repo, context.ParentNumber.Value, context.IssueNumber);- await PublishEvent(Consts.PubSub, Consts.MainTopic, new Event- {- Type = nameof(GithubFlowEventType.SandboxRunCreated),- Subject = context.Subject,- Data = context.ToData()- });- }-- break;- default:- break;- }- }-- public async Task Store(string org, string repo, long parentIssueNumber, long issueNumber, string filename, string extension, string dir, string output)- {- await _azureService.Store(org, repo, parentIssueNumber, issueNumber, filename, extension, dir, output);- }-- public async Task RunInSandbox(string org, string repo, long parentIssueNumber, long issueNumber)- {- await _azureService.RunInSandbox(org, repo, parentIssueNumber, issueNumber);- }-}++using Dapr.Actors;++using Dapr.Actors.Runtime;++using Dapr.Client;++using Microsoft.AI.Agents.Abstractions;++using Microsoft.AI.Agents.Dapr;++using Microsoft.AI.DevTeam.Dapr.Events;++++namespace Microsoft.AI.DevTeam.Dapr;++++public class AzureGenie : Agent, IDaprAgent++{++ private readonly IManageAzure _azureService;++++ public AzureGenie(ActorHost host,DaprClient client, IManageAzure azureService) : base(host, client)++ {++ _azureService = azureService;++ }++++ public override async Task HandleEvent(Event item)++ {++ switch (item.Type)++ {++ case nameof(GithubFlowEventType.ReadmeCreated):++ {++ var context = item.ToGithubContext();++ await Store(context.Org,context.Repo, context.ParentNumber.Value, context.IssueNumber, "readme", "md", "output", item.Data["readme"]);++ await PublishEvent(Consts.PubSub, Consts.MainTopic, new Event++ {++ Type = nameof(GithubFlowEventType.ReadmeStored),++ Subject = context.Subject,++ Data = context.ToData()++ });++ }++++ break;++ case nameof(GithubFlowEventType.CodeCreated):++ {++ var context = item.ToGithubContext();++ await Store(context.Org,context.Repo, context.ParentNumber.Value, context.IssueNumber, "run", "sh", "output", item.Data["code"]);++ await RunInSandbox(context.Org,context.Repo, context.ParentNumber.Value, context.IssueNumber);++ await PublishEvent(Consts.PubSub, Consts.MainTopic, new Event++ {++ Type = nameof(GithubFlowEventType.SandboxRunCreated),++ Subject = context.Subject,++ Data = context.ToData()++ });++ }++++ break;++ default:++ break;++ }++ }++++ public async Task Store(string org, string repo, long parentIssueNumber, long issueNumber, string filename, string extension, string dir, string output)++ {++ await _azureService.Store(org, repo, parentIssueNumber, issueNumber, filename, extension, dir, output);++ }++++ public async Task RunInSandbox(string org, string repo, long parentIssueNumber, long issueNumber)++ {++ await _azureService.RunInSandbox(org, repo, parentIssueNumber, issueNumber);++ }++}diff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Agents/Developer/Developer.csindex 000000000,8648cb602..8648cb602mode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Agents/Developer/Developer.cs+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Agents/Developer/Developer.csdiff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Agents/Developer/DeveloperPrompts.csindex 000000000,1e876ad9e..1e876ad9emode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Agents/Developer/DeveloperPrompts.cs+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Agents/Developer/DeveloperPrompts.csdiff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Agents/DeveloperLead/DevLeadPrompts.csindex 000000000,e5cdba5da..e5cdba5damode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Agents/DeveloperLead/DevLeadPrompts.cs+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Agents/DeveloperLead/DevLeadPrompts.csdiff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Agents/DeveloperLead/DeveloperLead.csindex 000000000,bae105962..bae105962mode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Agents/DeveloperLead/DeveloperLead.cs+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Agents/DeveloperLead/DeveloperLead.csdiff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Agents/Hubber.csindex 000000000,93285cb60..902ab210cmode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Agents/Hubber.cs+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Agents/Hubber.cs@@@ -1,0 -1,100 +1,100 @@@-using System.Text.Json;-using Dapr.Actors;-using Dapr.Actors.Runtime;-using Dapr.Client;-using Microsoft.AI.Agents.Abstractions;-using Microsoft.AI.Agents.Dapr;-using Microsoft.AI.DevTeam.Dapr.Events;--namespace Microsoft.AI.DevTeam.Dapr;--public class Hubber : Agent, IDaprAgent-{- private readonly IManageGithub _ghService;-- public Hubber(ActorHost host, DaprClient client, IManageGithub ghService) :base(host, client)- {- _ghService = ghService;- }-- public override async Task HandleEvent(Event item)- {- switch (item.Type)- {- case nameof(GithubFlowEventType.NewAsk):- {- var context = item.ToGithubContext();- var pmIssue = await CreateIssue(context.Org, context.Repo , item.Data["input"], "PM.Readme", context.IssueNumber);- var devLeadIssue = await CreateIssue(context.Org, context.Repo , item.Data["input"], "DevLead.Plan", context.IssueNumber);- await PostComment(context.Org, context.Repo, context.IssueNumber, $" - #{pmIssue} - tracks PM.Readme");- await PostComment(context.Org, context.Repo, context.IssueNumber, $" - #{devLeadIssue} - tracks DevLead.Plan");- await CreateBranch(context.Org, context.Repo, $"sk-{context.IssueNumber}");- }- break;- case nameof(GithubFlowEventType.ReadmeGenerated):- case nameof(GithubFlowEventType.DevPlanGenerated):- case nameof(GithubFlowEventType.CodeGenerated):- {- var context = item.ToGithubContext();- var result = item.Data["result"];- var contents = string.IsNullOrEmpty(result)? "Sorry, I got tired, can you try again please? ": result;- await PostComment(context.Org,context.Repo, context.IssueNumber, contents);- }-- break;- case nameof(GithubFlowEventType.DevPlanCreated):- {- var context = item.ToGithubContext();- var plan = JsonSerializer.Deserialize<DevLeadPlanResponse>(item.Data["plan"]);- var prompts = plan.steps.SelectMany(s => s.subtasks.Select(st => st.prompt));-- foreach (var prompt in prompts)- {- var functionName = "Developer.Implement";- var issue = await CreateIssue(context.Org, context.Repo, prompt, functionName, context.ParentNumber.Value);- var commentBody = $" - #{issue} - tracks {functionName}";- await PostComment(context.Org, context.Repo, context.ParentNumber.Value, commentBody);- }- }- break;- case nameof(GithubFlowEventType.ReadmeStored):- {- var context = item.ToGithubContext();- var branch = $"sk-{context.ParentNumber}";- await CommitToBranch(context.Org, context.Repo, context.ParentNumber.Value, context.IssueNumber, "output", branch);- await CreatePullRequest(context.Org, context.Repo, context.ParentNumber.Value, branch);- }- break;- case nameof(GithubFlowEventType.SandboxRunFinished):- {- var context = item.ToGithubContext();- var branch = $"sk-{context.ParentNumber}";- await CommitToBranch(context.Org, context.Repo, context.ParentNumber.Value, context.IssueNumber, "output", branch);- }- break;- default:- break;- }- }-- public async Task<int> CreateIssue(string org, string repo, string input, string function, long parentNumber)- {- return await _ghService.CreateIssue(org, repo, input, function, parentNumber);- }- public async Task PostComment(string org, string repo, long issueNumber, string comment)- {- await _ghService.PostComment(org, repo, issueNumber, comment);- }- public async Task CreateBranch(string org, string repo, string branch)- {- await _ghService.CreateBranch(org, repo, branch);- }- public async Task CreatePullRequest(string org, string repo, long issueNumber, string branch)- {- await _ghService.CreatePR(org, repo, issueNumber, branch);- }- public async Task CommitToBranch(string org, string repo, long parentNumber, long issueNumber, string rootDir, string branch)- {- await _ghService.CommitToBranch(org, repo, parentNumber, issueNumber, rootDir, branch);- }++using System.Text.Json;++using Dapr.Actors;++using Dapr.Actors.Runtime;++using Dapr.Client;++using Microsoft.AI.Agents.Abstractions;++using Microsoft.AI.Agents.Dapr;++using Microsoft.AI.DevTeam.Dapr.Events;++++namespace Microsoft.AI.DevTeam.Dapr;++++public class Hubber : Agent, IDaprAgent++{++ private readonly IManageGithub _ghService;++++ public Hubber(ActorHost host, DaprClient client, IManageGithub ghService) :base(host, client)++ {++ _ghService = ghService;++ }++++ public override async Task HandleEvent(Event item)++ {++ switch (item.Type)++ {++ case nameof(GithubFlowEventType.NewAsk):++ {++ var context = item.ToGithubContext();++ var pmIssue = await CreateIssue(context.Org, context.Repo , item.Data["input"], "PM.Readme", context.IssueNumber);++ var devLeadIssue = await CreateIssue(context.Org, context.Repo , item.Data["input"], "DevLead.Plan", context.IssueNumber);++ await PostComment(context.Org, context.Repo, context.IssueNumber, $" - #{pmIssue} - tracks PM.Readme");++ await PostComment(context.Org, context.Repo, context.IssueNumber, $" - #{devLeadIssue} - tracks DevLead.Plan");++ await CreateBranch(context.Org, context.Repo, $"sk-{context.IssueNumber}");++ }++ break;++ case nameof(GithubFlowEventType.ReadmeGenerated):++ case nameof(GithubFlowEventType.DevPlanGenerated):++ case nameof(GithubFlowEventType.CodeGenerated):++ {++ var context = item.ToGithubContext();++ var result = item.Data["result"];++ var contents = string.IsNullOrEmpty(result)? "Sorry, I got tired, can you try again please? ": result;++ await PostComment(context.Org,context.Repo, context.IssueNumber, contents);++ }++++ break;++ case nameof(GithubFlowEventType.DevPlanCreated):++ {++ var context = item.ToGithubContext();++ var plan = JsonSerializer.Deserialize<DevLeadPlanResponse>(item.Data["plan"]);++ var prompts = plan.steps.SelectMany(s => s.subtasks.Select(st => st.prompt));++++ foreach (var prompt in prompts)++ {++ var functionName = "Developer.Implement";++ var issue = await CreateIssue(context.Org, context.Repo, prompt, functionName, context.ParentNumber.Value);++ var commentBody = $" - #{issue} - tracks {functionName}";++ await PostComment(context.Org, context.Repo, context.ParentNumber.Value, commentBody);++ }++ }++ break;++ case nameof(GithubFlowEventType.ReadmeStored):++ {++ var context = item.ToGithubContext();++ var branch = $"sk-{context.ParentNumber}";++ await CommitToBranch(context.Org, context.Repo, context.ParentNumber.Value, context.IssueNumber, "output", branch);++ await CreatePullRequest(context.Org, context.Repo, context.ParentNumber.Value, branch);++ }++ break;++ case nameof(GithubFlowEventType.SandboxRunFinished):++ {++ var context = item.ToGithubContext();++ var branch = $"sk-{context.ParentNumber}";++ await CommitToBranch(context.Org, context.Repo, context.ParentNumber.Value, context.IssueNumber, "output", branch);++ }++ break;++ default:++ break;++ }++ }++++ public async Task<int> CreateIssue(string org, string repo, string input, string function, long parentNumber)++ {++ return await _ghService.CreateIssue(org, repo, input, function, parentNumber);++ }++ public async Task PostComment(string org, string repo, long issueNumber, string comment)++ {++ await _ghService.PostComment(org, repo, issueNumber, comment);++ }++ public async Task CreateBranch(string org, string repo, string branch)++ {++ await _ghService.CreateBranch(org, repo, branch);++ }++ public async Task CreatePullRequest(string org, string repo, long issueNumber, string branch)++ {++ await _ghService.CreatePR(org, repo, issueNumber, branch);++ }++ public async Task CommitToBranch(string org, string repo, long parentNumber, long issueNumber, string rootDir, string branch)++ {++ await _ghService.CommitToBranch(org, repo, parentNumber, issueNumber, rootDir, branch);++ }+ }diff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Agents/ProductManager/PMPrompts.csindex 000000000,a6b727a1b..a6b727a1bmode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Agents/ProductManager/PMPrompts.cs+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Agents/ProductManager/PMPrompts.csdiff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Agents/ProductManager/ProductManager.csindex 000000000,ce08c1d1a..ce08c1d1amode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Agents/ProductManager/ProductManager.cs+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Agents/ProductManager/ProductManager.csdiff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Agents/Sandbox.csindex 000000000,b75ed2ef9..e5b364978mode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Agents/Sandbox.cs+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Agents/Sandbox.cs@@@ -1,0 -1,106 +1,106 @@@-using Dapr.Actors.Runtime;-using Dapr.Client;-using Microsoft.AI.Agents.Abstractions;-using Microsoft.AI.Agents.Dapr;-using Microsoft.AI.DevTeam.Dapr.Events;--namespace Microsoft.AI.DevTeam.Dapr;-public class Sandbox : Agent, IDaprAgent, IRemindable-{- private const string ReminderName = "SandboxRunReminder";- public string StateStore = "agents-statestore";- private readonly IManageAzure _azService;-- public Sandbox(ActorHost host, DaprClient client, IManageAzure azService) : base(host, client)- {- _azService = azService;- }-- public override async Task HandleEvent(Event item)- {- switch(item.Type)- {- case nameof(GithubFlowEventType.SandboxRunCreated):- {- var context = item.ToGithubContext();- await ScheduleCommitSandboxRun(context.Org, context.Repo, context.ParentNumber.Value, context.IssueNumber);- }- break;-- default:- break;- }- }-- public async Task ScheduleCommitSandboxRun(string org, string repo, long parentIssueNumber, long issueNumber)- {- await StoreState(org, repo, parentIssueNumber, issueNumber);- await this.RegisterReminderAsync(- ReminderName,- null,- TimeSpan.Zero,- TimeSpan.FromMinutes(1));- }-- private async Task StoreState(string org, string repo, long parentIssueNumber, long issueNumber)- {- var state = new SandboxMetadata {- Org = org,- Repo = repo,- IssueNumber = issueNumber,- ParentIssueNumber = parentIssueNumber,- IsCompleted = false- };- await StateManager.SetStateAsync(- StateStore,- state);- }- private async Task Cleanup()- {- var agentState = await StateManager.GetStateAsync<SandboxMetadata>(StateStore);- agentState.IsCompleted = true;- await UnregisterReminderAsync(ReminderName);- await StateManager.SetStateAsync(- StateStore,- agentState);- }-- public async Task ReceiveReminderAsync(string reminderName, byte[] state, TimeSpan dueTime, TimeSpan period)- {- var agentState = await StateManager.GetStateAsync<SandboxMetadata>(StateStore);- if (!agentState.IsCompleted)- {- var sandboxId = $"sk-sandbox-{agentState.Org}-{agentState.Repo}-{agentState.ParentIssueNumber}-{agentState.IssueNumber}";- if (await _azService.IsSandboxCompleted(sandboxId))- {- await _azService.DeleteSandbox(sandboxId);- var data = new Dictionary<string, string> {- { "org", agentState.Org },- { "repo", agentState.Repo },- { "issueNumber", agentState.IssueNumber.ToString() },- { "parentNumber", agentState.ParentIssueNumber.ToString() }- };- var subject = $"{agentState.Org}-{agentState.Repo}-{agentState.IssueNumber}";- await PublishEvent(Consts.PubSub,Consts.MainTopic, new Event {- Type = nameof(GithubFlowEventType.SandboxRunFinished),- Subject = subject,- Data = data- });- await Cleanup();- }- }- else- {- await Cleanup();- }- }-}--public class SandboxMetadata-{- public string Org { get; set; }- public string Repo { get; set; }- public long ParentIssueNumber { get; set; }- public long IssueNumber { get; set; }- public bool IsCompleted { get; set; }++using Dapr.Actors.Runtime;++using Dapr.Client;++using Microsoft.AI.Agents.Abstractions;++using Microsoft.AI.Agents.Dapr;++using Microsoft.AI.DevTeam.Dapr.Events;++++namespace Microsoft.AI.DevTeam.Dapr;++public class Sandbox : Agent, IDaprAgent, IRemindable++{++ private const string ReminderName = "SandboxRunReminder";++ public string StateStore = "agents-statestore";++ private readonly IManageAzure _azService;++++ public Sandbox(ActorHost host, DaprClient client, IManageAzure azService) : base(host, client)++ {++ _azService = azService;++ }++++ public override async Task HandleEvent(Event item)++ {++ switch(item.Type)++ {++ case nameof(GithubFlowEventType.SandboxRunCreated):++ {++ var context = item.ToGithubContext();++ await ScheduleCommitSandboxRun(context.Org, context.Repo, context.ParentNumber.Value, context.IssueNumber);++ }++ break;++++ default:++ break;++ }++ }++++ public async Task ScheduleCommitSandboxRun(string org, string repo, long parentIssueNumber, long issueNumber)++ {++ await StoreState(org, repo, parentIssueNumber, issueNumber);++ await this.RegisterReminderAsync(++ ReminderName,++ null,++ TimeSpan.Zero,++ TimeSpan.FromMinutes(1));++ }++++ private async Task StoreState(string org, string repo, long parentIssueNumber, long issueNumber)++ {++ var state = new SandboxMetadata {++ Org = org,++ Repo = repo,++ IssueNumber = issueNumber,++ ParentIssueNumber = parentIssueNumber,++ IsCompleted = false++ };++ await StateManager.SetStateAsync(++ StateStore,++ state);++ }++ private async Task Cleanup()++ {++ var agentState = await StateManager.GetStateAsync<SandboxMetadata>(StateStore);++ agentState.IsCompleted = true;++ await UnregisterReminderAsync(ReminderName);++ await StateManager.SetStateAsync(++ StateStore,++ agentState);++ }++++ public async Task ReceiveReminderAsync(string reminderName, byte[] state, TimeSpan dueTime, TimeSpan period)++ {++ var agentState = await StateManager.GetStateAsync<SandboxMetadata>(StateStore);++ if (!agentState.IsCompleted)++ {++ var sandboxId = $"sk-sandbox-{agentState.Org}-{agentState.Repo}-{agentState.ParentIssueNumber}-{agentState.IssueNumber}";++ if (await _azService.IsSandboxCompleted(sandboxId))++ {++ await _azService.DeleteSandbox(sandboxId);++ var data = new Dictionary<string, string> {++ { "org", agentState.Org },++ { "repo", agentState.Repo },++ { "issueNumber", agentState.IssueNumber.ToString() },++ { "parentNumber", agentState.ParentIssueNumber.ToString() }++ };++ var subject = $"{agentState.Org}-{agentState.Repo}-{agentState.IssueNumber}";++ await PublishEvent(Consts.PubSub,Consts.MainTopic, new Event {++ Type = nameof(GithubFlowEventType.SandboxRunFinished),++ Subject = subject,++ Data = data++ });++ await Cleanup();++ }++ }++ else++ {++ await Cleanup();++ }++ }++}++++public class SandboxMetadata++{++ public string Org { get; set; }++ public string Repo { get; set; }++ public long ParentIssueNumber { get; set; }++ public long IssueNumber { get; set; }++ public bool IsCompleted { get; set; }+ }diff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Dockerfileindex 000000000,94041c3fa..94041c3famode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Dockerfile+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Dockerfilediff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Events/GithubFlowEventType.csindex 000000000,24b165711..24b165711mode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Events/GithubFlowEventType.cs+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Events/GithubFlowEventType.csdiff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Microsoft.AI.DevTeam.Dapr.csprojindex 000000000,3d04d93de..fb26c2709mode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Microsoft.AI.DevTeam.Dapr.csproj+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Microsoft.AI.DevTeam.Dapr.csproj@@@ -1,0 -1,44 +1,43 @@@+ <Project Sdk="Microsoft.NET.Sdk.Web">+- <ItemGroup>- <ProjectReference Include="..\..\..\..\src\Microsoft.AI.Agents.Dapr\Microsoft.AI.Agents.Dapr.csproj" />- </ItemGroup>-+ <PropertyGroup>+ <TargetFramework>net8.0</TargetFramework>+ <Nullable>enable</Nullable>+ <ImplicitUsings>enable</ImplicitUsings>+ <ServerGarbageCollection>true</ServerGarbageCollection>+ <ConcurrentGarbageCollection>true</ConcurrentGarbageCollection>+ <UserSecretsId>c073c86e-8483-4956-942f-331fd09172d4</UserSecretsId>+ <AnalysisMode>All</AnalysisMode>+ </PropertyGroup>++ <ItemGroup>+ <PackageReference Include="Octokit.Webhooks.AspNetCore" Version="2.0.3" />+ <PackageReference Include="Octokit" Version="10.0.0" />++ <PackageReference Include="Microsoft.SemanticKernel" Version="1.10.0" />+ <PackageReference Include="Microsoft.SemanticKernel.Connectors.Qdrant" Version="1.10.0-alpha" />+ <PackageReference Include="Microsoft.SemanticKernel.Plugins.Memory" Version="1.10.0-alpha" />++ <PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.21.0" />+ <PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />++ <PackageReference Include="Microsoft.Extensions.Azure" Version="1.7.2" />+ <PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="8.0.0" />+ <PackageReference Include="Azure.ResourceManager.ContainerInstance" Version="1.2.0" />+ <PackageReference Include="Azure.Storage.Files.Shares" Version="12.16.0-beta.1" />+ <PackageReference Include="Azure.Data.Tables" Version="12.8.1" />+ <PackageReference Include="Azure.Identity" Version="1.11.0-beta.1" />++ <PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="7.4.1" />+ <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />++ <PackageReference Include="Dapr.Actors.AspNetCore" Version="1.13.0" />+ <PackageReference Include="Dapr.AspNetCore" Version="1.13.0" />+ <PackageReference Include="CloudNative.CloudEvents.SystemTextJson" Version="2.7.1" />+ </ItemGroup>-+++ <ItemGroup>++ <ProjectReference Include="..\..\..\..\..\csharp\src\Microsoft.AI.Agents.Dapr\Microsoft.AI.Agents.Dapr.csproj" />++ </ItemGroup>+++ </Project>diff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Options/AzureOptions.csindex 000000000,2fcbcab78..2fcbcab78mode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Options/AzureOptions.cs+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Options/AzureOptions.csdiff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Options/Consts.csindex 000000000,cb97cf307..2531cbdc6mode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Options/Consts.cs+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Options/Consts.cs@@@ -1,0 -1,8 +1,8 @@@-namespace Microsoft.AI.DevTeam.Dapr;--public static class Consts-{- public const string MainTopic = "DevPersonas";- public const string PubSub = "agents-pubsub";- public const string AppId = "dev-agents";-}++namespace Microsoft.AI.DevTeam.Dapr;++++public static class Consts++{++ public const string MainTopic = "DevPersonas";++ public const string PubSub = "agents-pubsub";++ public const string AppId = "dev-agents";++}diff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Options/GithubOptions.csindex 000000000,a88480538..a88480538mode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Options/GithubOptions.cs+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Options/GithubOptions.csdiff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Options/OpenAIOptions.csindex 000000000,e69ebf59f..e69ebf59fmode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Options/OpenAIOptions.cs+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Options/OpenAIOptions.csdiff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Options/QdrantOptions.csindex 000000000,ea79a9557..ea79a9557mode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Options/QdrantOptions.cs+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Options/QdrantOptions.csdiff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Options/ServiceOptions.csindex 000000000,8c3b09c76..8c3b09c76mode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Options/ServiceOptions.cs+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Options/ServiceOptions.csdiff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Program.csindex 000000000,8c938d181..14a610c7cmode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Program.cs+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Program.cs@@@ -1,0 -1,205 +1,205 @@@-using System.Text.Json;-using Azure;-using Azure.AI.OpenAI;-using Microsoft.Extensions.Options;-using Microsoft.SemanticKernel;-using Octokit.Webhooks;-using Octokit.Webhooks.AspNetCore;-using Azure.Identity;-using Microsoft.Extensions.Azure;-using Microsoft.Extensions.Http.Resilience;-using Microsoft.SemanticKernel.Memory;-using Microsoft.SemanticKernel.Connectors.Qdrant;-using Microsoft.SemanticKernel.Connectors.OpenAI;-using Dapr;-using Dapr.Actors.Client;-using Dapr.Actors;-using Microsoft.AI.DevTeam.Dapr;-using Microsoft.AI.DevTeam.Dapr.Events;--var builder = WebApplication.CreateBuilder(args);-builder.Services.AddSingleton<WebhookEventProcessor, GithubWebHookProcessor>();-builder.Services.AddTransient(CreateKernel);-builder.Services.AddTransient(CreateMemory);-builder.Services.AddHttpClient();--builder.Services.AddSingleton(s =>-{- var ghOptions = s.GetService<IOptions<GithubOptions>>();- var logger = s.GetService<ILogger<GithubAuthService>>();- var ghService = new GithubAuthService(ghOptions, logger);- var client = ghService.GetGitHubClient();- return client;-});---builder.Services.AddAzureClients(clientBuilder =>-{- clientBuilder.UseCredential(new DefaultAzureCredential());- clientBuilder.AddArmClient(default);-});--builder.Services.AddDaprClient();--builder.Services.AddActors(- options =>- {- options.UseJsonSerialization = true;- options.JsonSerializerOptions = new JsonSerializerOptions(JsonSerializerDefaults.Web);- options.ReentrancyConfig = new ActorReentrancyConfig {- Enabled = true- };- options.Actors.RegisterActor<Dev>();- options.Actors.RegisterActor<DeveloperLead>();- options.Actors.RegisterActor<ProductManager>();- options.Actors.RegisterActor<AzureGenie>();- options.Actors.RegisterActor<Hubber>();- options.Actors.RegisterActor<Sandbox>();- });--builder.Services.AddSingleton<GithubAuthService>();--builder.Services.AddApplicationInsightsTelemetry();-builder.Services.AddOptions<GithubOptions>()- .Configure<IConfiguration>((settings, configuration) =>- {- configuration.GetSection(nameof(GithubOptions)).Bind(settings);- })- .ValidateDataAnnotations()- .ValidateOnStart();--builder.Services.AddOptions<AzureOptions>()- .Configure<IConfiguration>((settings, configuration) =>- {- configuration.GetSection(nameof(AzureOptions)).Bind(settings);- })- .ValidateDataAnnotations()- .ValidateOnStart();--builder.Services.AddOptions<OpenAIOptions>()- .Configure<IConfiguration>((settings, configuration) =>- {- configuration.GetSection(nameof(OpenAIOptions)).Bind(settings);- })- .ValidateDataAnnotations()- .ValidateOnStart();--builder.Services.AddOptions<QdrantOptions>()- .Configure<IConfiguration>((settings, configuration) =>- {- configuration.GetSection(nameof(QdrantOptions)).Bind(settings);- })- .ValidateDataAnnotations()- .ValidateOnStart();--builder.Services.AddOptions<ServiceOptions>()- .Configure<IConfiguration>((settings, configuration) =>- {- configuration.GetSection(nameof(ServiceOptions)).Bind(settings);- })- .ValidateDataAnnotations()- .ValidateOnStart();--builder.Services.AddSingleton<IManageAzure, AzureService>();-builder.Services.AddSingleton<IManageGithub, GithubService>();-builder.Services.AddSingleton<IAnalyzeCode, CodeAnalyzer>();---builder.Services.Configure<JsonSerializerOptions>(options =>-{- options.PropertyNamingPolicy = JsonNamingPolicy.CamelCase;-});-var app = builder.Build();--app.UseRouting()- .UseEndpoints(endpoints =>-{- var ghOptions = app.Services.GetService<IOptions<GithubOptions>>().Value;- endpoints.MapGitHubWebhooks(secret: ghOptions.WebhookSecret);- endpoints.MapActorsHandlers();- endpoints.MapSubscribeHandler();-});--app.UseCloudEvents();--app.MapPost("/developers", [Topic(Consts.PubSub, Consts.MainTopic,- $"(event.type ==\"{nameof(GithubFlowEventType.CodeGenerationRequested)}\") || (event.type ==\"{nameof(GithubFlowEventType.CodeGenerationRequested)}\")", 1)]- async (IActorProxyFactory proxyFactory, EventEnvelope evt) => await HandleEvent(proxyFactory,nameof(Dev), nameof(Dev.HandleEvent), evt));--app.MapPost("/devleads", [Topic(Consts.PubSub, Consts.MainTopic,-$"(event.type ==\"{nameof(GithubFlowEventType.DevPlanRequested)}\") || (event.type ==\"{nameof(GithubFlowEventType.DevPlanChainClosed)}\")", 2)]-async (IActorProxyFactory proxyFactory, EventEnvelope evt) => await HandleEvent(proxyFactory, nameof(DeveloperLead), nameof(DeveloperLead.HandleEvent), evt));--app.MapPost("/productmanagers", [Topic(Consts.PubSub, Consts.MainTopic,-$"(event.type ==\"{nameof(GithubFlowEventType.ReadmeRequested)}\") || (event.type ==\"{nameof(GithubFlowEventType.ReadmeChainClosed)}\")", 3)]-async (IActorProxyFactory proxyFactory, EventEnvelope evt) => await HandleEvent(proxyFactory, nameof(ProductManager), nameof(ProductManager.HandleEvent), evt));--app.MapPost("/hubbers", [Topic(Consts.PubSub, Consts.MainTopic,- $"(event.type ==\"{nameof(GithubFlowEventType.NewAsk)}\") || (event.type ==\"{nameof(GithubFlowEventType.ReadmeGenerated)}\") || (event.type ==\"{nameof(GithubFlowEventType.DevPlanGenerated)}\") || (event.type ==\"{nameof(GithubFlowEventType.CodeGenerated)}\") || (event.type ==\"{nameof(GithubFlowEventType.DevPlanCreated)}\") || (event.type ==\"{nameof(GithubFlowEventType.ReadmeStored)}\") || (event.type ==\"{nameof(GithubFlowEventType.SandboxRunFinished)}\")", 4)]- async (IActorProxyFactory proxyFactory, EventEnvelope evt) => await HandleEvent(proxyFactory, nameof(Hubber), nameof(Hubber.HandleEvent), evt));--app.MapPost("/azuregenies", [Topic(Consts.PubSub, Consts.MainTopic,-$"(event.type ==\"{nameof(GithubFlowEventType.ReadmeCreated)}\") || (event.type ==\"{nameof(GithubFlowEventType.CodeCreated)}\")", 5)]-async (IActorProxyFactory proxyFactory, EventEnvelope evt) => await HandleEvent(proxyFactory, nameof(AzureGenie), nameof(AzureGenie.HandleEvent), evt));--app.MapPost("/sandboxes", [Topic(Consts.PubSub, Consts.MainTopic,$"(event.type ==\"{nameof(GithubFlowEventType.SandboxRunCreated)}\")", 6)]-async (IActorProxyFactory proxyFactory, EventEnvelope evt) => await HandleEvent(proxyFactory, nameof(Sandbox), nameof(Sandbox.HandleEvent), evt));--app.Run();--static async Task HandleEvent(IActorProxyFactory proxyFactory, string type, string method, EventEnvelope evt)-{- try- {- var proxyOptions = new ActorProxyOptions- {- RequestTimeout = Timeout.InfiniteTimeSpan- };- var proxy = proxyFactory.Create(new ActorId(evt.Data.Subject), type, proxyOptions);- await proxy.InvokeMethodAsync(method, evt.Data);- }- catch (Exception ex)- {- throw;- }-}--static ISemanticTextMemory CreateMemory(IServiceProvider provider)-{- var openAiConfig = provider.GetService<IOptions<OpenAIOptions>>().Value;- var qdrantConfig = provider.GetService<IOptions<QdrantOptions>>().Value;-- var loggerFactory = LoggerFactory.Create(builder =>- {- builder- .SetMinimumLevel(LogLevel.Debug)- .AddConsole()- .AddDebug();- });-- var memoryBuilder = new MemoryBuilder();- return memoryBuilder.WithLoggerFactory(loggerFactory)- .WithQdrantMemoryStore(qdrantConfig.Endpoint, qdrantConfig.VectorSize)- .WithAzureOpenAITextEmbeddingGeneration(openAiConfig.EmbeddingDeploymentOrModelId, openAiConfig.Endpoint, openAiConfig.ApiKey)- .Build();-}--static Kernel CreateKernel(IServiceProvider provider)-{- var openAiConfig = provider.GetService<IOptions<OpenAIOptions>>().Value;- var clientOptions = new OpenAIClientOptions();- clientOptions.Retry.NetworkTimeout = TimeSpan.FromMinutes(5);- var openAIClient = new OpenAIClient(new Uri(openAiConfig.Endpoint), new AzureKeyCredential(openAiConfig.ApiKey), clientOptions);- var builder = Kernel.CreateBuilder();- builder.Services.AddLogging(c => c.AddConsole().AddDebug().SetMinimumLevel(LogLevel.Debug));- builder.Services.AddAzureOpenAIChatCompletion(openAiConfig.DeploymentOrModelId, openAIClient);- builder.Services.ConfigureHttpClientDefaults(c =>- {- c.AddStandardResilienceHandler().Configure(o =>- {- o.Retry.MaxRetryAttempts = 5;- o.Retry.BackoffType = Polly.DelayBackoffType.Exponential;- });- });- return builder.Build();++using System.Text.Json;++using Azure;++using Azure.AI.OpenAI;++using Microsoft.Extensions.Options;++using Microsoft.SemanticKernel;++using Octokit.Webhooks;++using Octokit.Webhooks.AspNetCore;++using Azure.Identity;++using Microsoft.Extensions.Azure;++using Microsoft.Extensions.Http.Resilience;++using Microsoft.SemanticKernel.Memory;++using Microsoft.SemanticKernel.Connectors.Qdrant;++using Microsoft.SemanticKernel.Connectors.OpenAI;++using Dapr;++using Dapr.Actors.Client;++using Dapr.Actors;++using Microsoft.AI.DevTeam.Dapr;++using Microsoft.AI.DevTeam.Dapr.Events;++++var builder = WebApplication.CreateBuilder(args);++builder.Services.AddSingleton<WebhookEventProcessor, GithubWebHookProcessor>();++builder.Services.AddTransient(CreateKernel);++builder.Services.AddTransient(CreateMemory);++builder.Services.AddHttpClient();++++builder.Services.AddSingleton(s =>++{++ var ghOptions = s.GetService<IOptions<GithubOptions>>();++ var logger = s.GetService<ILogger<GithubAuthService>>();++ var ghService = new GithubAuthService(ghOptions, logger);++ var client = ghService.GetGitHubClient();++ return client;++});++++++builder.Services.AddAzureClients(clientBuilder =>++{++ clientBuilder.UseCredential(new DefaultAzureCredential());++ clientBuilder.AddArmClient(default);++});++++builder.Services.AddDaprClient();++++builder.Services.AddActors(++ options =>++ {++ options.UseJsonSerialization = true;++ options.JsonSerializerOptions = new JsonSerializerOptions(JsonSerializerDefaults.Web);++ options.ReentrancyConfig = new ActorReentrancyConfig {++ Enabled = true++ };++ options.Actors.RegisterActor<Dev>();++ options.Actors.RegisterActor<DeveloperLead>();++ options.Actors.RegisterActor<ProductManager>();++ options.Actors.RegisterActor<AzureGenie>();++ options.Actors.RegisterActor<Hubber>();++ options.Actors.RegisterActor<Sandbox>();++ });++++builder.Services.AddSingleton<GithubAuthService>();++++builder.Services.AddApplicationInsightsTelemetry();++builder.Services.AddOptions<GithubOptions>()++ .Configure<IConfiguration>((settings, configuration) =>++ {++ configuration.GetSection(nameof(GithubOptions)).Bind(settings);++ })++ .ValidateDataAnnotations()++ .ValidateOnStart();++++builder.Services.AddOptions<AzureOptions>()++ .Configure<IConfiguration>((settings, configuration) =>++ {++ configuration.GetSection(nameof(AzureOptions)).Bind(settings);++ })++ .ValidateDataAnnotations()++ .ValidateOnStart();++++builder.Services.AddOptions<OpenAIOptions>()++ .Configure<IConfiguration>((settings, configuration) =>++ {++ configuration.GetSection(nameof(OpenAIOptions)).Bind(settings);++ })++ .ValidateDataAnnotations()++ .ValidateOnStart();++++builder.Services.AddOptions<QdrantOptions>()++ .Configure<IConfiguration>((settings, configuration) =>++ {++ configuration.GetSection(nameof(QdrantOptions)).Bind(settings);++ })++ .ValidateDataAnnotations()++ .ValidateOnStart();++++builder.Services.AddOptions<ServiceOptions>()++ .Configure<IConfiguration>((settings, configuration) =>++ {++ configuration.GetSection(nameof(ServiceOptions)).Bind(settings);++ })++ .ValidateDataAnnotations()++ .ValidateOnStart();++++builder.Services.AddSingleton<IManageAzure, AzureService>();++builder.Services.AddSingleton<IManageGithub, GithubService>();++builder.Services.AddSingleton<IAnalyzeCode, CodeAnalyzer>();++++++builder.Services.Configure<JsonSerializerOptions>(options =>++{++ options.PropertyNamingPolicy = JsonNamingPolicy.CamelCase;++});++var app = builder.Build();++++app.UseRouting()++ .UseEndpoints(endpoints =>++{++ var ghOptions = app.Services.GetService<IOptions<GithubOptions>>().Value;++ endpoints.MapGitHubWebhooks(secret: ghOptions.WebhookSecret);++ endpoints.MapActorsHandlers();++ endpoints.MapSubscribeHandler();++});++++app.UseCloudEvents();++++app.MapPost("/developers", [Topic(Consts.PubSub, Consts.MainTopic,++ $"(event.type ==\"{nameof(GithubFlowEventType.CodeGenerationRequested)}\") || (event.type ==\"{nameof(GithubFlowEventType.CodeGenerationRequested)}\")", 1)]++ async (IActorProxyFactory proxyFactory, EventEnvelope evt) => await HandleEvent(proxyFactory,nameof(Dev), nameof(Dev.HandleEvent), evt));++++app.MapPost("/devleads", [Topic(Consts.PubSub, Consts.MainTopic,++$"(event.type ==\"{nameof(GithubFlowEventType.DevPlanRequested)}\") || (event.type ==\"{nameof(GithubFlowEventType.DevPlanChainClosed)}\")", 2)]++async (IActorProxyFactory proxyFactory, EventEnvelope evt) => await HandleEvent(proxyFactory, nameof(DeveloperLead), nameof(DeveloperLead.HandleEvent), evt));++++app.MapPost("/productmanagers", [Topic(Consts.PubSub, Consts.MainTopic,++$"(event.type ==\"{nameof(GithubFlowEventType.ReadmeRequested)}\") || (event.type ==\"{nameof(GithubFlowEventType.ReadmeChainClosed)}\")", 3)]++async (IActorProxyFactory proxyFactory, EventEnvelope evt) => await HandleEvent(proxyFactory, nameof(ProductManager), nameof(ProductManager.HandleEvent), evt));++++app.MapPost("/hubbers", [Topic(Consts.PubSub, Consts.MainTopic,++ $"(event.type ==\"{nameof(GithubFlowEventType.NewAsk)}\") || (event.type ==\"{nameof(GithubFlowEventType.ReadmeGenerated)}\") || (event.type ==\"{nameof(GithubFlowEventType.DevPlanGenerated)}\") || (event.type ==\"{nameof(GithubFlowEventType.CodeGenerated)}\") || (event.type ==\"{nameof(GithubFlowEventType.DevPlanCreated)}\") || (event.type ==\"{nameof(GithubFlowEventType.ReadmeStored)}\") || (event.type ==\"{nameof(GithubFlowEventType.SandboxRunFinished)}\")", 4)]++ async (IActorProxyFactory proxyFactory, EventEnvelope evt) => await HandleEvent(proxyFactory, nameof(Hubber), nameof(Hubber.HandleEvent), evt));++++app.MapPost("/azuregenies", [Topic(Consts.PubSub, Consts.MainTopic,++$"(event.type ==\"{nameof(GithubFlowEventType.ReadmeCreated)}\") || (event.type ==\"{nameof(GithubFlowEventType.CodeCreated)}\")", 5)]++async (IActorProxyFactory proxyFactory, EventEnvelope evt) => await HandleEvent(proxyFactory, nameof(AzureGenie), nameof(AzureGenie.HandleEvent), evt));++++app.MapPost("/sandboxes", [Topic(Consts.PubSub, Consts.MainTopic,$"(event.type ==\"{nameof(GithubFlowEventType.SandboxRunCreated)}\")", 6)]++async (IActorProxyFactory proxyFactory, EventEnvelope evt) => await HandleEvent(proxyFactory, nameof(Sandbox), nameof(Sandbox.HandleEvent), evt));++++app.Run();++++static async Task HandleEvent(IActorProxyFactory proxyFactory, string type, string method, EventEnvelope evt)++{++ try++ {++ var proxyOptions = new ActorProxyOptions++ {++ RequestTimeout = Timeout.InfiniteTimeSpan++ };++ var proxy = proxyFactory.Create(new ActorId(evt.Data.Subject), type, proxyOptions);++ await proxy.InvokeMethodAsync(method, evt.Data);++ }++ catch (Exception ex)++ {++ throw;++ }++}++++static ISemanticTextMemory CreateMemory(IServiceProvider provider)++{++ var openAiConfig = provider.GetService<IOptions<OpenAIOptions>>().Value;++ var qdrantConfig = provider.GetService<IOptions<QdrantOptions>>().Value;++++ var loggerFactory = LoggerFactory.Create(builder =>++ {++ builder++ .SetMinimumLevel(LogLevel.Debug)++ .AddConsole()++ .AddDebug();++ });++++ var memoryBuilder = new MemoryBuilder();++ return memoryBuilder.WithLoggerFactory(loggerFactory)++ .WithQdrantMemoryStore(qdrantConfig.Endpoint, qdrantConfig.VectorSize)++ .WithAzureOpenAITextEmbeddingGeneration(openAiConfig.EmbeddingDeploymentOrModelId, openAiConfig.Endpoint, openAiConfig.ApiKey)++ .Build();++}++++static Kernel CreateKernel(IServiceProvider provider)++{++ var openAiConfig = provider.GetService<IOptions<OpenAIOptions>>().Value;++ var clientOptions = new OpenAIClientOptions();++ clientOptions.Retry.NetworkTimeout = TimeSpan.FromMinutes(5);++ var openAIClient = new OpenAIClient(new Uri(openAiConfig.Endpoint), new AzureKeyCredential(openAiConfig.ApiKey), clientOptions);++ var builder = Kernel.CreateBuilder();++ builder.Services.AddLogging(c => c.AddConsole().AddDebug().SetMinimumLevel(LogLevel.Debug));++ builder.Services.AddAzureOpenAIChatCompletion(openAiConfig.DeploymentOrModelId, openAIClient);++ builder.Services.ConfigureHttpClientDefaults(c =>++ {++ c.AddStandardResilienceHandler().Configure(o =>++ {++ o.Retry.MaxRetryAttempts = 5;++ o.Retry.BackoffType = Polly.DelayBackoffType.Exponential;++ });++ });++ return builder.Build();+ }diff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Properties/launchSettings.jsonindex 000000000,6970a78f6..373d72522mode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Properties/launchSettings.json+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Properties/launchSettings.json@@@ -1,0 -1,38 +1,38 @@@-{- "$schema": "http://json.schemastore.org/launchsettings.json",- "iisSettings": {- "windowsAuthentication": false,- "anonymousAuthentication": true,- "iisExpress": {- "applicationUrl": "http://localhost:59668",- "sslPort": 44354- }- },- "profiles": {- "http": {- "commandName": "Project",- "dotnetRunMessages": true,- "launchBrowser": true,- "applicationUrl": "http://localhost:5244",- "environmentVariables": {- "ASPNETCORE_ENVIRONMENT": "Development"- }- },- "https": {- "commandName": "Project",- "dotnetRunMessages": true,- "launchBrowser": true,- "applicationUrl": "https://localhost:7227;http://localhost:5244",- "environmentVariables": {- "ASPNETCORE_ENVIRONMENT": "Development"- }- },- "IIS Express": {- "commandName": "IISExpress",- "launchBrowser": true,- "environmentVariables": {- "ASPNETCORE_ENVIRONMENT": "Development"- }- }- }-}++{++ "$schema": "http://json.schemastore.org/launchsettings.json",++ "iisSettings": {++ "windowsAuthentication": false,++ "anonymousAuthentication": true,++ "iisExpress": {++ "applicationUrl": "http://localhost:59668",++ "sslPort": 44354++ }++ },++ "profiles": {++ "http": {++ "commandName": "Project",++ "dotnetRunMessages": true,++ "launchBrowser": true,++ "applicationUrl": "http://localhost:5244",++ "environmentVariables": {++ "ASPNETCORE_ENVIRONMENT": "Development"++ }++ },++ "https": {++ "commandName": "Project",++ "dotnetRunMessages": true,++ "launchBrowser": true,++ "applicationUrl": "https://localhost:7227;http://localhost:5244",++ "environmentVariables": {++ "ASPNETCORE_ENVIRONMENT": "Development"++ }++ },++ "IIS Express": {++ "commandName": "IISExpress",++ "launchBrowser": true,++ "environmentVariables": {++ "ASPNETCORE_ENVIRONMENT": "Development"++ }++ }++ }++}diff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Services/AzureService.csindex 000000000,5e8246b5e..5eef10dc2mode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Services/AzureService.cs+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Services/AzureService.cs@@@ -1,0 -1,160 +1,160 @@@-using System.Text;-using Azure;-using Azure.Core;-using Azure.ResourceManager;-using Azure.ResourceManager.ContainerInstance;-using Azure.ResourceManager.ContainerInstance.Models;-using Azure.ResourceManager.Resources;-using Azure.Storage.Files.Shares;-using Microsoft.Extensions.Options;---namespace Microsoft.AI.DevTeam.Dapr;--public class AzureService : IManageAzure-{- private readonly AzureOptions _azSettings;- private readonly ILogger<AzureService> _logger;- private readonly ArmClient _client;-- public AzureService(IOptions<AzureOptions> azOptions, ILogger<AzureService> logger, ArmClient client)- {- _azSettings = azOptions.Value;- _logger = logger;- _client = client;- }-- public async Task DeleteSandbox(string sandboxId)- {- try- {- var resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(_azSettings.SubscriptionId, _azSettings.ContainerInstancesResourceGroup);- var resourceGroupResource = _client.GetResourceGroupResource(resourceGroupResourceId);-- var collection = resourceGroupResource.GetContainerGroups();- var containerGroup = await collection.GetAsync(sandboxId);- await containerGroup.Value.DeleteAsync(WaitUntil.Started);- }- catch (Exception ex)- {- _logger.LogError(ex, "Error deleting sandbox");- throw;- }-- }-- public async Task<bool> IsSandboxCompleted(string sandboxId)- {- try- {- var resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(_azSettings.SubscriptionId, _azSettings.ContainerInstancesResourceGroup);- var resourceGroupResource = _client.GetResourceGroupResource(resourceGroupResourceId);-- var collection = resourceGroupResource.GetContainerGroups();- var containerGroup = await collection.GetAsync(sandboxId);- return containerGroup.Value.Data.ProvisioningState == "Succeeded"- && containerGroup.Value.Data.Containers.First().InstanceView.CurrentState.State == "Terminated";- }- catch (Exception ex)- {- _logger.LogError(ex, "Error checking sandbox status");- throw;- }- }-- public async Task RunInSandbox(string org, string repo, long parentIssueNumber, long issueNumber)- {- try- {- var runId = $"sk-sandbox-{org}-{repo}-{parentIssueNumber}-{issueNumber}";- var resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(_azSettings.SubscriptionId, _azSettings.ContainerInstancesResourceGroup);- var resourceGroupResource = _client.GetResourceGroupResource(resourceGroupResourceId);- var scriptPath = $"/azfiles/output/{org}-{repo}/{parentIssueNumber}/{issueNumber}/run.sh";- var collection = resourceGroupResource.GetContainerGroups();- var data = new ContainerGroupData(new AzureLocation(_azSettings.Location), new ContainerInstanceContainer[]- {- new ContainerInstanceContainer(runId,_azSettings.SandboxImage,new ContainerResourceRequirements(new ContainerResourceRequestsContent(1.5,1)))- {- Command = { "/bin/bash", $"{scriptPath}" },- VolumeMounts =- {- new ContainerVolumeMount("azfiles","/azfiles/")- {- IsReadOnly = false,- }- },- }}, ContainerInstanceOperatingSystemType.Linux)- {- Volumes =- {- new ContainerVolume("azfiles")- {- AzureFile = new ContainerInstanceAzureFileVolume(_azSettings.FilesShareName,_azSettings.FilesAccountName)- {- StorageAccountKey = _azSettings.FilesAccountKey- },- },- },- RestartPolicy = ContainerGroupRestartPolicy.Never,- Sku = ContainerGroupSku.Standard,- Priority = ContainerGroupPriority.Regular- };- await collection.CreateOrUpdateAsync(WaitUntil.Completed, runId, data);- }- catch (Exception ex)- {- _logger.LogError(ex, "Error running sandbox");- throw;- }-- }-- public async Task Store(string org, string repo, long parentIssueNumber, long issueNumber, string filename, string extension, string dir, string output)- {- try- {- var connectionString = $"DefaultEndpointsProtocol=https;AccountName={_azSettings.FilesAccountName};AccountKey={_azSettings.FilesAccountKey};EndpointSuffix=core.windows.net";- var parentDirName = $"{dir}/{org}-{repo}";-- var fileName = $"{filename}.{extension}";-- var share = new ShareClient(connectionString, _azSettings.FilesShareName);- await share.CreateIfNotExistsAsync();- await share.GetDirectoryClient($"{dir}").CreateIfNotExistsAsync(); ;-- var parentDir = share.GetDirectoryClient(parentDirName);- await parentDir.CreateIfNotExistsAsync();-- var parentIssueDir = parentDir.GetSubdirectoryClient($"{parentIssueNumber}");- await parentIssueDir.CreateIfNotExistsAsync();-- var directory = parentIssueDir.GetSubdirectoryClient($"{issueNumber}");- await directory.CreateIfNotExistsAsync();-- var file = directory.GetFileClient(fileName);- // hack to enable script to save files in the same directory- var cwdHack = "#!/bin/bash\n cd $(dirname $0)";- var contents = extension == "sh" ? output.Replace("#!/bin/bash", cwdHack) : output;- using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(contents)))- {- await file.CreateAsync(stream.Length);- await file.UploadRangeAsync(- new HttpRange(0, stream.Length),- stream);- }- }- catch (Exception ex)- {- _logger.LogError(ex, "Error storing output");- throw;- }- }-}--public interface IManageAzure-{- Task Store(string org, string repo, long parentIssueNumber, long issueNumber, string filename, string extension, string dir, string output);- Task RunInSandbox(string org, string repo, long parentIssueNumber, long issueNumber);- Task<bool> IsSandboxCompleted(string sandboxId);- Task DeleteSandbox(string sandboxId);++using System.Text;++using Azure;++using Azure.Core;++using Azure.ResourceManager;++using Azure.ResourceManager.ContainerInstance;++using Azure.ResourceManager.ContainerInstance.Models;++using Azure.ResourceManager.Resources;++using Azure.Storage.Files.Shares;++using Microsoft.Extensions.Options;++++++namespace Microsoft.AI.DevTeam.Dapr;++++public class AzureService : IManageAzure++{++ private readonly AzureOptions _azSettings;++ private readonly ILogger<AzureService> _logger;++ private readonly ArmClient _client;++++ public AzureService(IOptions<AzureOptions> azOptions, ILogger<AzureService> logger, ArmClient client)++ {++ _azSettings = azOptions.Value;++ _logger = logger;++ _client = client;++ }++++ public async Task DeleteSandbox(string sandboxId)++ {++ try++ {++ var resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(_azSettings.SubscriptionId, _azSettings.ContainerInstancesResourceGroup);++ var resourceGroupResource = _client.GetResourceGroupResource(resourceGroupResourceId);++++ var collection = resourceGroupResource.GetContainerGroups();++ var containerGroup = await collection.GetAsync(sandboxId);++ await containerGroup.Value.DeleteAsync(WaitUntil.Started);++ }++ catch (Exception ex)++ {++ _logger.LogError(ex, "Error deleting sandbox");++ throw;++ }++++ }++++ public async Task<bool> IsSandboxCompleted(string sandboxId)++ {++ try++ {++ var resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(_azSettings.SubscriptionId, _azSettings.ContainerInstancesResourceGroup);++ var resourceGroupResource = _client.GetResourceGroupResource(resourceGroupResourceId);++++ var collection = resourceGroupResource.GetContainerGroups();++ var containerGroup = await collection.GetAsync(sandboxId);++ return containerGroup.Value.Data.ProvisioningState == "Succeeded"++ && containerGroup.Value.Data.Containers.First().InstanceView.CurrentState.State == "Terminated";++ }++ catch (Exception ex)++ {++ _logger.LogError(ex, "Error checking sandbox status");++ throw;++ }++ }++++ public async Task RunInSandbox(string org, string repo, long parentIssueNumber, long issueNumber)++ {++ try++ {++ var runId = $"sk-sandbox-{org}-{repo}-{parentIssueNumber}-{issueNumber}";++ var resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(_azSettings.SubscriptionId, _azSettings.ContainerInstancesResourceGroup);++ var resourceGroupResource = _client.GetResourceGroupResource(resourceGroupResourceId);++ var scriptPath = $"/azfiles/output/{org}-{repo}/{parentIssueNumber}/{issueNumber}/run.sh";++ var collection = resourceGroupResource.GetContainerGroups();++ var data = new ContainerGroupData(new AzureLocation(_azSettings.Location), new ContainerInstanceContainer[]++ {++ new ContainerInstanceContainer(runId,_azSettings.SandboxImage,new ContainerResourceRequirements(new ContainerResourceRequestsContent(1.5,1)))++ {++ Command = { "/bin/bash", $"{scriptPath}" },++ VolumeMounts =++ {++ new ContainerVolumeMount("azfiles","/azfiles/")++ {++ IsReadOnly = false,++ }++ },++ }}, ContainerInstanceOperatingSystemType.Linux)++ {++ Volumes =++ {++ new ContainerVolume("azfiles")++ {++ AzureFile = new ContainerInstanceAzureFileVolume(_azSettings.FilesShareName,_azSettings.FilesAccountName)++ {++ StorageAccountKey = _azSettings.FilesAccountKey++ },++ },++ },++ RestartPolicy = ContainerGroupRestartPolicy.Never,++ Sku = ContainerGroupSku.Standard,++ Priority = ContainerGroupPriority.Regular++ };++ await collection.CreateOrUpdateAsync(WaitUntil.Completed, runId, data);++ }++ catch (Exception ex)++ {++ _logger.LogError(ex, "Error running sandbox");++ throw;++ }++++ }++++ public async Task Store(string org, string repo, long parentIssueNumber, long issueNumber, string filename, string extension, string dir, string output)++ {++ try++ {++ var connectionString = $"DefaultEndpointsProtocol=https;AccountName={_azSettings.FilesAccountName};AccountKey={_azSettings.FilesAccountKey};EndpointSuffix=core.windows.net";++ var parentDirName = $"{dir}/{org}-{repo}";++++ var fileName = $"{filename}.{extension}";++++ var share = new ShareClient(connectionString, _azSettings.FilesShareName);++ await share.CreateIfNotExistsAsync();++ await share.GetDirectoryClient($"{dir}").CreateIfNotExistsAsync(); ;++++ var parentDir = share.GetDirectoryClient(parentDirName);++ await parentDir.CreateIfNotExistsAsync();++++ var parentIssueDir = parentDir.GetSubdirectoryClient($"{parentIssueNumber}");++ await parentIssueDir.CreateIfNotExistsAsync();++++ var directory = parentIssueDir.GetSubdirectoryClient($"{issueNumber}");++ await directory.CreateIfNotExistsAsync();++++ var file = directory.GetFileClient(fileName);++ // hack to enable script to save files in the same directory++ var cwdHack = "#!/bin/bash\n cd $(dirname $0)";++ var contents = extension == "sh" ? output.Replace("#!/bin/bash", cwdHack) : output;++ using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(contents)))++ {++ await file.CreateAsync(stream.Length);++ await file.UploadRangeAsync(++ new HttpRange(0, stream.Length),++ stream);++ }++ }++ catch (Exception ex)++ {++ _logger.LogError(ex, "Error storing output");++ throw;++ }++ }++}++++public interface IManageAzure++{++ Task Store(string org, string repo, long parentIssueNumber, long issueNumber, string filename, string extension, string dir, string output);++ Task RunInSandbox(string org, string repo, long parentIssueNumber, long issueNumber);++ Task<bool> IsSandboxCompleted(string sandboxId);++ Task DeleteSandbox(string sandboxId);+ }diff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Services/CodeAnalyzer.csindex 000000000,392d44137..392d44137mode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Services/CodeAnalyzer.cs+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Services/CodeAnalyzer.csdiff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Services/GithubAuthService.csindex 000000000,12168ace2..12168ace2mode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Services/GithubAuthService.cs+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Services/GithubAuthService.csdiff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Services/GithubService.csindex 000000000,8aa88d37e..70853fe25mode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Services/GithubService.cs+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Services/GithubService.cs@@@ -1,0 -1,227 +1,227 @@@-using System.Text;-using Azure.Storage.Files.Shares;-using Microsoft.Extensions.Options;-using Octokit;-using Octokit.Helpers;---namespace Microsoft.AI.DevTeam.Dapr;--public class GithubService : IManageGithub-{- private readonly GitHubClient _ghClient;- private readonly AzureOptions _azSettings;- private readonly ILogger<GithubService> _logger;- private readonly HttpClient _httpClient;-- public GithubService(IOptions<AzureOptions> azOptions, GitHubClient ghClient, ILogger<GithubService> logger, HttpClient httpClient)- {- _ghClient = ghClient;- _azSettings = azOptions.Value;- _logger = logger;- _httpClient = httpClient;- }-- public async Task CommitToBranch(string org, string repo, long parentNumber, long issueNumber, string rootDir, string branch)- {- try- {- var connectionString = $"DefaultEndpointsProtocol=https;AccountName={_azSettings.FilesAccountName};AccountKey={_azSettings.FilesAccountKey};EndpointSuffix=core.windows.net";-- var dirName = $"{rootDir}/{org}-{repo}/{parentNumber}/{issueNumber}";- var share = new ShareClient(connectionString, _azSettings.FilesShareName);- var directory = share.GetDirectoryClient(dirName);-- var remaining = new Queue<ShareDirectoryClient>();- remaining.Enqueue(directory);- while (remaining.Count > 0)- {- var dir = remaining.Dequeue();- await foreach (var item in dir.GetFilesAndDirectoriesAsync())- {- if (!item.IsDirectory && item.Name != "run.sh") // we don't want the generated script in the PR- {- try- {- var file = dir.GetFileClient(item.Name);- var filePath = file.Path.Replace($"{_azSettings.FilesShareName}/", "")- .Replace($"{dirName}/", "");- var fileStream = await file.OpenReadAsync();- using (var reader = new StreamReader(fileStream, Encoding.UTF8))- {- var value = reader.ReadToEnd();-- await _ghClient.Repository.Content.CreateFile(- org, repo, filePath,- new CreateFileRequest($"Commit message", value, branch)); // TODO: add more meaningfull commit message- }- }- catch (Exception ex)- {- _logger.LogError(ex, $"Error while uploading file {item.Name}");- }- }- else if (item.IsDirectory)- {- remaining.Enqueue(dir.GetSubdirectoryClient(item.Name));- }- }- }- }- catch (Exception ex)- {- _logger.LogError(ex, "Error committing to branch");- throw;- }- }-- public async Task CreateBranch(string org, string repo, string branch)- {- try- {- var ghRepo = await _ghClient.Repository.Get(org, repo);- if (ghRepo.Size == 0)- {- // Create a new file and commit it to the repository- var createChangeSet = await _ghClient.Repository.Content.CreateFile(- org,- repo,- "README.md",- new CreateFileRequest("Initial commit", "# Readme")- );- }-- await _ghClient.Git.Reference.CreateBranch(org, repo, branch, ghRepo.DefaultBranch);- }- catch (Exception ex)- {- _logger.LogError(ex, "Error creating branch");- throw;- }- }-- public async Task<string> GetMainLanguage(string org, string repo)- {- try- {- var languages = await _ghClient.Repository.GetAllLanguages(org, repo);- var mainLanguage = languages.OrderByDescending(l => l.NumberOfBytes).First();- return mainLanguage.Name;- }- catch (Exception ex)- {- _logger.LogError(ex, "Error getting main language");- throw;- }- }-- public async Task<int> CreateIssue(string org, string repo, string input, string function, long parentNumber)- {- try- {- var newIssue = new NewIssue($"{function} chain for #{parentNumber}")- {- Body = input,- };- newIssue.Labels.Add(function);- newIssue.Labels.Add($"Parent.{parentNumber}");- var issue = await _ghClient.Issue.Create(org, repo, newIssue);- return issue.Number;- }- catch (Exception ex)- {- _logger.LogError(ex, "Error creating issue");- throw;- }- }-- public async Task CreatePR(string org, string repo, long number, string branch)- {- try- {- var ghRepo = await _ghClient.Repository.Get(org, repo);- await _ghClient.PullRequest.Create(org, repo, new NewPullRequest($"New app #{number}", branch, ghRepo.DefaultBranch));- }- catch (Exception ex)- {- _logger.LogError(ex, "Error creating PR");- throw;- }- }-- public async Task PostComment(string org, string repo, long issueNumber, string comment)- {- try- {- await _ghClient.Issue.Comment.Create(org, repo, (int)issueNumber, comment);- }- catch (Exception ex)- {- _logger.LogError(ex, "Error posting comment");- throw;- }- }-- public async Task<IEnumerable<FileResponse>> GetFiles(string org, string repo, string branch, Func<RepositoryContent, bool> filter)- {- try- {- var items = await _ghClient.Repository.Content.GetAllContentsByRef(org, repo, branch);- return await CollectFiles(org, repo, branch, items, filter);- }- catch (Exception ex)- {- _logger.LogError(ex, "Error getting files");- throw;- }- }-- private async Task<IEnumerable<FileResponse>> CollectFiles(string org, string repo, string branch, IReadOnlyList<RepositoryContent> items, Func<RepositoryContent, bool> filter)- {- try- {- var result = new List<FileResponse>();- foreach (var item in items)- {- if (item.Type == ContentType.File && filter(item))- {- var content = await _httpClient.GetStringAsync(item.DownloadUrl);- result.Add(new FileResponse- {- Name = item.Name,- Content = content- });- }- else if (item.Type == ContentType.Dir)- {- var subItems = await _ghClient.Repository.Content.GetAllContentsByRef(org, repo, item.Path, branch);- result.AddRange(await CollectFiles(org, repo, branch, subItems, filter));- }- }- return result;- }- catch (Exception ex)- {- _logger.LogError(ex, "Error collecting files");- throw;- }- }-}--public class FileResponse-{- public string Name { get; set; }- public string Content { get; set; }-}--public interface IManageGithub-{- Task<int> CreateIssue(string org, string repo, string input, string function, long parentNumber);- Task CreatePR(string org, string repo, long number, string branch);- Task CreateBranch(string org, string repo, string branch);- Task CommitToBranch(string org, string repo, long parentNumber, long issueNumber, string rootDir, string branch);-- Task PostComment(string org, string repo, long issueNumber, string comment);- Task<IEnumerable<FileResponse>> GetFiles(string org, string repo, string branch, Func<RepositoryContent, bool> filter);- Task<string> GetMainLanguage(string org, string repo);-}++using System.Text;++using Azure.Storage.Files.Shares;++using Microsoft.Extensions.Options;++using Octokit;++using Octokit.Helpers;++++++namespace Microsoft.AI.DevTeam.Dapr;++++public class GithubService : IManageGithub++{++ private readonly GitHubClient _ghClient;++ private readonly AzureOptions _azSettings;++ private readonly ILogger<GithubService> _logger;++ private readonly HttpClient _httpClient;++++ public GithubService(IOptions<AzureOptions> azOptions, GitHubClient ghClient, ILogger<GithubService> logger, HttpClient httpClient)++ {++ _ghClient = ghClient;++ _azSettings = azOptions.Value;++ _logger = logger;++ _httpClient = httpClient;++ }++++ public async Task CommitToBranch(string org, string repo, long parentNumber, long issueNumber, string rootDir, string branch)++ {++ try++ {++ var connectionString = $"DefaultEndpointsProtocol=https;AccountName={_azSettings.FilesAccountName};AccountKey={_azSettings.FilesAccountKey};EndpointSuffix=core.windows.net";++++ var dirName = $"{rootDir}/{org}-{repo}/{parentNumber}/{issueNumber}";++ var share = new ShareClient(connectionString, _azSettings.FilesShareName);++ var directory = share.GetDirectoryClient(dirName);++++ var remaining = new Queue<ShareDirectoryClient>();++ remaining.Enqueue(directory);++ while (remaining.Count > 0)++ {++ var dir = remaining.Dequeue();++ await foreach (var item in dir.GetFilesAndDirectoriesAsync())++ {++ if (!item.IsDirectory && item.Name != "run.sh") // we don't want the generated script in the PR++ {++ try++ {++ var file = dir.GetFileClient(item.Name);++ var filePath = file.Path.Replace($"{_azSettings.FilesShareName}/", "")++ .Replace($"{dirName}/", "");++ var fileStream = await file.OpenReadAsync();++ using (var reader = new StreamReader(fileStream, Encoding.UTF8))++ {++ var value = reader.ReadToEnd();++++ await _ghClient.Repository.Content.CreateFile(++ org, repo, filePath,++ new CreateFileRequest($"Commit message", value, branch)); // TODO: add more meaningfull commit message++ }++ }++ catch (Exception ex)++ {++ _logger.LogError(ex, $"Error while uploading file {item.Name}");++ }++ }++ else if (item.IsDirectory)++ {++ remaining.Enqueue(dir.GetSubdirectoryClient(item.Name));++ }++ }++ }++ }++ catch (Exception ex)++ {++ _logger.LogError(ex, "Error committing to branch");++ throw;++ }++ }++++ public async Task CreateBranch(string org, string repo, string branch)++ {++ try++ {++ var ghRepo = await _ghClient.Repository.Get(org, repo);++ if (ghRepo.Size == 0)++ {++ // Create a new file and commit it to the repository++ var createChangeSet = await _ghClient.Repository.Content.CreateFile(++ org,++ repo,++ "README.md",++ new CreateFileRequest("Initial commit", "# Readme")++ );++ }++++ await _ghClient.Git.Reference.CreateBranch(org, repo, branch, ghRepo.DefaultBranch);++ }++ catch (Exception ex)++ {++ _logger.LogError(ex, "Error creating branch");++ throw;++ }++ }++++ public async Task<string> GetMainLanguage(string org, string repo)++ {++ try++ {++ var languages = await _ghClient.Repository.GetAllLanguages(org, repo);++ var mainLanguage = languages.OrderByDescending(l => l.NumberOfBytes).First();++ return mainLanguage.Name;++ }++ catch (Exception ex)++ {++ _logger.LogError(ex, "Error getting main language");++ throw;++ }++ }++++ public async Task<int> CreateIssue(string org, string repo, string input, string function, long parentNumber)++ {++ try++ {++ var newIssue = new NewIssue($"{function} chain for #{parentNumber}")++ {++ Body = input,++ };++ newIssue.Labels.Add(function);++ newIssue.Labels.Add($"Parent.{parentNumber}");++ var issue = await _ghClient.Issue.Create(org, repo, newIssue);++ return issue.Number;++ }++ catch (Exception ex)++ {++ _logger.LogError(ex, "Error creating issue");++ throw;++ }++ }++++ public async Task CreatePR(string org, string repo, long number, string branch)++ {++ try++ {++ var ghRepo = await _ghClient.Repository.Get(org, repo);++ await _ghClient.PullRequest.Create(org, repo, new NewPullRequest($"New app #{number}", branch, ghRepo.DefaultBranch));++ }++ catch (Exception ex)++ {++ _logger.LogError(ex, "Error creating PR");++ throw;++ }++ }++++ public async Task PostComment(string org, string repo, long issueNumber, string comment)++ {++ try++ {++ await _ghClient.Issue.Comment.Create(org, repo, (int)issueNumber, comment);++ }++ catch (Exception ex)++ {++ _logger.LogError(ex, "Error posting comment");++ throw;++ }++ }++++ public async Task<IEnumerable<FileResponse>> GetFiles(string org, string repo, string branch, Func<RepositoryContent, bool> filter)++ {++ try++ {++ var items = await _ghClient.Repository.Content.GetAllContentsByRef(org, repo, branch);++ return await CollectFiles(org, repo, branch, items, filter);++ }++ catch (Exception ex)++ {++ _logger.LogError(ex, "Error getting files");++ throw;++ }++ }++++ private async Task<IEnumerable<FileResponse>> CollectFiles(string org, string repo, string branch, IReadOnlyList<RepositoryContent> items, Func<RepositoryContent, bool> filter)++ {++ try++ {++ var result = new List<FileResponse>();++ foreach (var item in items)++ {++ if (item.Type == ContentType.File && filter(item))++ {++ var content = await _httpClient.GetStringAsync(item.DownloadUrl);++ result.Add(new FileResponse++ {++ Name = item.Name,++ Content = content++ });++ }++ else if (item.Type == ContentType.Dir)++ {++ var subItems = await _ghClient.Repository.Content.GetAllContentsByRef(org, repo, item.Path, branch);++ result.AddRange(await CollectFiles(org, repo, branch, subItems, filter));++ }++ }++ return result;++ }++ catch (Exception ex)++ {++ _logger.LogError(ex, "Error collecting files");++ throw;++ }++ }++}++++public class FileResponse++{++ public string Name { get; set; }++ public string Content { get; set; }++}++++public interface IManageGithub++{++ Task<int> CreateIssue(string org, string repo, string input, string function, long parentNumber);++ Task CreatePR(string org, string repo, long number, string branch);++ Task CreateBranch(string org, string repo, string branch);++ Task CommitToBranch(string org, string repo, long parentNumber, long issueNumber, string rootDir, string branch);++++ Task PostComment(string org, string repo, long issueNumber, string comment);++ Task<IEnumerable<FileResponse>> GetFiles(string org, string repo, string branch, Func<RepositoryContent, bool> filter);++ Task<string> GetMainLanguage(string org, string repo);++}diff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Services/GithubWebHookProcessor.csindex 000000000,0bff68a51..0bff68a51mode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Services/GithubWebHookProcessor.cs+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/Services/GithubWebHookProcessor.csdiff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/appsettings.azure.template.jsonindex 000000000,2fc698845..26563297amode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/appsettings.azure.template.json+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/appsettings.azure.template.json@@@ -1,0 -1,45 +1,45 @@@-{- "Logging": {- "LogLevel": {- "Default": "Information",- "Microsoft.AspNetCore": "Information",- "Orleans.Streams": "Information"- }- },- "ApplicationInsights": {- "ConnectionString": ""- },- "AllowedHosts": "*",- "SANDBOX_IMAGE" : "mcr.microsoft.com/dotnet/sdk:7.0",- "GithubOptions" : {- "AppKey": "",- "AppId": "",- "InstallationId": "",- "WebhookSecret": ""- },- "AzureOptions" : {- "SubscriptionId":"",- "Location":"",- "ContainerInstancesResourceGroup":"",- "FilesShareName":"",- "FilesAccountName":"",- "FilesAccountKey":"",- "SandboxImage" : "mcr.microsoft.com/dotnet/sdk:7.0",- "ManagedIdentity": ""- },- "OpenAIOptions" : {- "ServiceType":"AzureOpenAI",- "ServiceId":"gpt-4",- "DeploymentOrModelId":"gpt-4",- "EmbeddingDeploymentOrModelId":"text-embedding-ada-002",- "Endpoint":"",- "ApiKey":""- },- "QdrantOptions" : {- "Endpoint" : "http://qdrant:6333",- "VectorSize" : "1536"- },- "ServiceOptions" : {- "IngesterUrl" : "http://localhost:7071"- }-}++{++ "Logging": {++ "LogLevel": {++ "Default": "Information",++ "Microsoft.AspNetCore": "Information",++ "Orleans.Streams": "Information"++ }++ },++ "ApplicationInsights": {++ "ConnectionString": ""++ },++ "AllowedHosts": "*",++ "SANDBOX_IMAGE" : "mcr.microsoft.com/dotnet/sdk:7.0",++ "GithubOptions" : {++ "AppKey": "",++ "AppId": "",++ "InstallationId": "",++ "WebhookSecret": ""++ },++ "AzureOptions" : {++ "SubscriptionId":"",++ "Location":"",++ "ContainerInstancesResourceGroup":"",++ "FilesShareName":"",++ "FilesAccountName":"",++ "FilesAccountKey":"",++ "SandboxImage" : "mcr.microsoft.com/dotnet/sdk:7.0",++ "ManagedIdentity": ""++ },++ "OpenAIOptions" : {++ "ServiceType":"AzureOpenAI",++ "ServiceId":"gpt-4",++ "DeploymentOrModelId":"gpt-4",++ "EmbeddingDeploymentOrModelId":"text-embedding-ada-002",++ "Endpoint":"",++ "ApiKey":""++ },++ "QdrantOptions" : {++ "Endpoint" : "http://qdrant:6333",++ "VectorSize" : "1536"++ },++ "ServiceOptions" : {++ "IngesterUrl" : "http://localhost:7071"++ }++}diff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/appsettings.local.template.jsonindex 000000000,2fc698845..26563297amode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/appsettings.local.template.json+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam.Dapr/appsettings.local.template.json@@@ -1,0 -1,45 +1,45 @@@-{- "Logging": {- "LogLevel": {- "Default": "Information",- "Microsoft.AspNetCore": "Information",- "Orleans.Streams": "Information"- }- },- "ApplicationInsights": {- "ConnectionString": ""- },- "AllowedHosts": "*",- "SANDBOX_IMAGE" : "mcr.microsoft.com/dotnet/sdk:7.0",- "GithubOptions" : {- "AppKey": "",- "AppId": "",- "InstallationId": "",- "WebhookSecret": ""- },- "AzureOptions" : {- "SubscriptionId":"",- "Location":"",- "ContainerInstancesResourceGroup":"",- "FilesShareName":"",- "FilesAccountName":"",- "FilesAccountKey":"",- "SandboxImage" : "mcr.microsoft.com/dotnet/sdk:7.0",- "ManagedIdentity": ""- },- "OpenAIOptions" : {- "ServiceType":"AzureOpenAI",- "ServiceId":"gpt-4",- "DeploymentOrModelId":"gpt-4",- "EmbeddingDeploymentOrModelId":"text-embedding-ada-002",- "Endpoint":"",- "ApiKey":""- },- "QdrantOptions" : {- "Endpoint" : "http://qdrant:6333",- "VectorSize" : "1536"- },- "ServiceOptions" : {- "IngesterUrl" : "http://localhost:7071"- }-}++{++ "Logging": {++ "LogLevel": {++ "Default": "Information",++ "Microsoft.AspNetCore": "Information",++ "Orleans.Streams": "Information"++ }++ },++ "ApplicationInsights": {++ "ConnectionString": ""++ },++ "AllowedHosts": "*",++ "SANDBOX_IMAGE" : "mcr.microsoft.com/dotnet/sdk:7.0",++ "GithubOptions" : {++ "AppKey": "",++ "AppId": "",++ "InstallationId": "",++ "WebhookSecret": ""++ },++ "AzureOptions" : {++ "SubscriptionId":"",++ "Location":"",++ "ContainerInstancesResourceGroup":"",++ "FilesShareName":"",++ "FilesAccountName":"",++ "FilesAccountKey":"",++ "SandboxImage" : "mcr.microsoft.com/dotnet/sdk:7.0",++ "ManagedIdentity": ""++ },++ "OpenAIOptions" : {++ "ServiceType":"AzureOpenAI",++ "ServiceId":"gpt-4",++ "DeploymentOrModelId":"gpt-4",++ "EmbeddingDeploymentOrModelId":"text-embedding-ada-002",++ "Endpoint":"",++ "ApiKey":""++ },++ "QdrantOptions" : {++ "Endpoint" : "http://qdrant:6333",++ "VectorSize" : "1536"++ },++ "ServiceOptions" : {++ "IngesterUrl" : "http://localhost:7071"++ }++}diff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Agents/Architect/Architect.csindex 000000000,5fa20dc5c..5fa20dc5cmode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Agents/Architect/Architect.cs+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Agents/Architect/Architect.csdiff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Agents/AzureGenie.csindex 000000000,76940f251..4becca3e8mode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Agents/AzureGenie.cs+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Agents/AzureGenie.cs@@@ -1,0 -1,70 +1,70 @@@-using Microsoft.AI.Agents.Abstractions;-using Microsoft.AI.Agents.Orleans;-using Microsoft.AI.DevTeam.Events;-using Microsoft.AI.DevTeam.Extensions;--namespace Microsoft.AI.DevTeam;--[ImplicitStreamSubscription(Consts.MainNamespace)]-public class AzureGenie : Agent-{- protected override string Namespace => Consts.MainNamespace;- private readonly IManageAzure _azureService;-- public AzureGenie(IManageAzure azureService)- {- _azureService = azureService;- }-- public override async Task HandleEvent(Event item)- {- if (item?.Type is null)- {- throw new ArgumentNullException(nameof(item));- }-- switch (item.Type)- {- case nameof(GithubFlowEventType.ReadmeCreated):- {- var context = item.ToGithubContext();- await Store(context.Org,context.Repo, context.ParentNumber.Value, context.IssueNumber, "readme", "md", "output", item.Data["readme"]);- await PublishEvent(Consts.MainNamespace, this.GetPrimaryKeyString(), new Event- {- Type = nameof(GithubFlowEventType.ReadmeStored),- Subject = context.Subject,- Data = context.ToData()- });- break;- }--- case nameof(GithubFlowEventType.CodeCreated):- {- var context = item.ToGithubContext();- await Store(context.Org,context.Repo, context.ParentNumber.Value, context.IssueNumber, "run", "sh", "output", item.Data["code"]);- await RunInSandbox(context.Org,context.Repo, context.ParentNumber.Value, context.IssueNumber);- await PublishEvent(Consts.MainNamespace, this.GetPrimaryKeyString(), new Event- {- Type = nameof(GithubFlowEventType.SandboxRunCreated),- Subject = context.Subject,- Data = context.ToData()- });- break;- }-- default:- break;- }- }-- public async Task Store(string org, string repo, long parentIssueNumber, long issueNumber, string filename, string extension, string dir, string output)- {- await _azureService.Store(org, repo, parentIssueNumber, issueNumber, filename, extension, dir, output);- }-- public async Task RunInSandbox(string org, string repo, long parentIssueNumber, long issueNumber)- {- await _azureService.RunInSandbox(org, repo, parentIssueNumber, issueNumber);- }++using Microsoft.AI.Agents.Abstractions;++using Microsoft.AI.Agents.Orleans;++using Microsoft.AI.DevTeam.Events;++using Microsoft.AI.DevTeam.Extensions;++++namespace Microsoft.AI.DevTeam;++++[ImplicitStreamSubscription(Consts.MainNamespace)]++public class AzureGenie : Agent++{++ protected override string Namespace => Consts.MainNamespace;++ private readonly IManageAzure _azureService;++++ public AzureGenie(IManageAzure azureService)++ {++ _azureService = azureService;++ }++++ public override async Task HandleEvent(Event item)++ {++ if (item?.Type is null)++ {++ throw new ArgumentNullException(nameof(item));++ }++++ switch (item.Type)++ {++ case nameof(GithubFlowEventType.ReadmeCreated):++ {++ var context = item.ToGithubContext();++ await Store(context.Org,context.Repo, context.ParentNumber.Value, context.IssueNumber, "readme", "md", "output", item.Data["readme"]);++ await PublishEvent(Consts.MainNamespace, this.GetPrimaryKeyString(), new Event++ {++ Type = nameof(GithubFlowEventType.ReadmeStored),++ Subject = context.Subject,++ Data = context.ToData()++ });++ break;++ }++++++ case nameof(GithubFlowEventType.CodeCreated):++ {++ var context = item.ToGithubContext();++ await Store(context.Org,context.Repo, context.ParentNumber.Value, context.IssueNumber, "run", "sh", "output", item.Data["code"]);++ await RunInSandbox(context.Org,context.Repo, context.ParentNumber.Value, context.IssueNumber);++ await PublishEvent(Consts.MainNamespace, this.GetPrimaryKeyString(), new Event++ {++ Type = nameof(GithubFlowEventType.SandboxRunCreated),++ Subject = context.Subject,++ Data = context.ToData()++ });++ break;++ }++++ default:++ break;++ }++ }++++ public async Task Store(string org, string repo, long parentIssueNumber, long issueNumber, string filename, string extension, string dir, string output)++ {++ await _azureService.Store(org, repo, parentIssueNumber, issueNumber, filename, extension, dir, output);++ }++++ public async Task RunInSandbox(string org, string repo, long parentIssueNumber, long issueNumber)++ {++ await _azureService.RunInSandbox(org, repo, parentIssueNumber, issueNumber);++ }+ }diff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Agents/Developer/Developer.csindex 000000000,40254e054..40254e054mode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Agents/Developer/Developer.cs+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Agents/Developer/Developer.csdiff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Agents/Developer/DeveloperPrompts.csindex 000000000,d9d666020..d9d666020mode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Agents/Developer/DeveloperPrompts.cs+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Agents/Developer/DeveloperPrompts.csdiff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Agents/DeveloperLead/DevLeadPrompts.csindex 000000000,2c20812a5..2c20812a5mode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Agents/DeveloperLead/DevLeadPrompts.cs+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Agents/DeveloperLead/DevLeadPrompts.csdiff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Agents/DeveloperLead/DeveloperLead.csindex 000000000,bb87db69c..bb87db69cmode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Agents/DeveloperLead/DeveloperLead.cs+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Agents/DeveloperLead/DeveloperLead.csdiff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Agents/Hubber.csindex 000000000,0069f2126..4737c8aeemode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Agents/Hubber.cs+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Agents/Hubber.cs@@@ -1,0 -1,102 +1,102 @@@-using System;-using System.Text.Json;-using Microsoft.AI.Agents.Abstractions;-using Microsoft.AI.Agents.Orleans;-using Microsoft.AI.DevTeam.Events;--namespace Microsoft.AI.DevTeam;--[ImplicitStreamSubscription(Consts.MainNamespace)]-public class Hubber : Agent-{- protected override string Namespace => Consts.MainNamespace;- private readonly IManageGithub _ghService;-- public Hubber(IManageGithub ghService)- {- _ghService = ghService;- }-- public override async Task HandleEvent(Event item)- {- ArgumentNullException.ThrowIfNull(item);- ArgumentNullException.ThrowIfNull(item.Data);-- switch (item.Type)- {- case nameof(GithubFlowEventType.NewAsk):- {- var context = item.ToGithubContext();- var pmIssue = await CreateIssue(context.Org, context.Repo , item.Data["input"], "PM.Readme", context.IssueNumber);- var devLeadIssue = await CreateIssue(context.Org, context.Repo , item.Data["input"], "DevLead.Plan", context.IssueNumber);- await PostComment(context.Org, context.Repo, context.IssueNumber, $" - #{pmIssue} - tracks PM.Readme");- await PostComment(context.Org, context.Repo, context.IssueNumber, $" - #{devLeadIssue} - tracks DevLead.Plan");- await CreateBranch(context.Org, context.Repo, $"sk-{context.IssueNumber}");- }- break;- case nameof(GithubFlowEventType.ReadmeGenerated):- case nameof(GithubFlowEventType.DevPlanGenerated):- case nameof(GithubFlowEventType.CodeGenerated):- {- var context = item.ToGithubContext();- var result = item.Data["result"];- var contents = string.IsNullOrEmpty(result)? "Sorry, I got tired, can you try again please? ": result;- await PostComment(context.Org,context.Repo, context.IssueNumber, contents);- }- break;- case nameof(GithubFlowEventType.DevPlanCreated):- {- var context = item.ToGithubContext();- var plan = JsonSerializer.Deserialize<DevLeadPlanResponse>(item.Data["plan"]);- var prompts = plan.steps.SelectMany(s => s.subtasks.Select(st => st.prompt));-- foreach (var prompt in prompts)- {- var functionName = "Developer.Implement";- var issue = await CreateIssue(context.Org, context.Repo, prompt, functionName, context.ParentNumber.Value);- var commentBody = $" - #{issue} - tracks {functionName}";- await PostComment(context.Org, context.Repo, context.ParentNumber.Value, commentBody);- }- }- break;- case nameof(GithubFlowEventType.ReadmeStored):- {- var context = item.ToGithubContext();- var branch = $"sk-{context.ParentNumber}";- await CommitToBranch(context.Org, context.Repo, context.ParentNumber.Value, context.IssueNumber, "output", branch);- await CreatePullRequest(context.Org, context.Repo, context.ParentNumber.Value, branch);- }- break;- case nameof(GithubFlowEventType.SandboxRunFinished):- {- var context = item.ToGithubContext();- var branch = $"sk-{context.ParentNumber}";- await CommitToBranch(context.Org, context.Repo, context.ParentNumber.Value, context.IssueNumber, "output", branch);- }- break;- default:- break;- }- }-- public async Task<int> CreateIssue(string org, string repo, string input, string function, long parentNumber)- {- return await _ghService.CreateIssue(org, repo, input, function, parentNumber);- }- public async Task PostComment(string org, string repo, long issueNumber, string comment)- {- await _ghService.PostComment(org, repo, issueNumber, comment);- }- public async Task CreateBranch(string org, string repo, string branch)- {- await _ghService.CreateBranch(org, repo, branch);- }- public async Task CreatePullRequest(string org, string repo, long issueNumber, string branch)- {- await _ghService.CreatePR(org, repo, issueNumber, branch);- }- public async Task CommitToBranch(string org, string repo, long parentNumber, long issueNumber, string rootDir, string branch)- {- await _ghService.CommitToBranch(org, repo, parentNumber, issueNumber, rootDir, branch);- }++using System;++using System.Text.Json;++using Microsoft.AI.Agents.Abstractions;++using Microsoft.AI.Agents.Orleans;++using Microsoft.AI.DevTeam.Events;++++namespace Microsoft.AI.DevTeam;++++[ImplicitStreamSubscription(Consts.MainNamespace)]++public class Hubber : Agent++{++ protected override string Namespace => Consts.MainNamespace;++ private readonly IManageGithub _ghService;++++ public Hubber(IManageGithub ghService)++ {++ _ghService = ghService;++ }++++ public override async Task HandleEvent(Event item)++ {++ ArgumentNullException.ThrowIfNull(item);++ ArgumentNullException.ThrowIfNull(item.Data);++++ switch (item.Type)++ {++ case nameof(GithubFlowEventType.NewAsk):++ {++ var context = item.ToGithubContext();++ var pmIssue = await CreateIssue(context.Org, context.Repo , item.Data["input"], "PM.Readme", context.IssueNumber);++ var devLeadIssue = await CreateIssue(context.Org, context.Repo , item.Data["input"], "DevLead.Plan", context.IssueNumber);++ await PostComment(context.Org, context.Repo, context.IssueNumber, $" - #{pmIssue} - tracks PM.Readme");++ await PostComment(context.Org, context.Repo, context.IssueNumber, $" - #{devLeadIssue} - tracks DevLead.Plan");++ await CreateBranch(context.Org, context.Repo, $"sk-{context.IssueNumber}");++ }++ break;++ case nameof(GithubFlowEventType.ReadmeGenerated):++ case nameof(GithubFlowEventType.DevPlanGenerated):++ case nameof(GithubFlowEventType.CodeGenerated):++ {++ var context = item.ToGithubContext();++ var result = item.Data["result"];++ var contents = string.IsNullOrEmpty(result)? "Sorry, I got tired, can you try again please? ": result;++ await PostComment(context.Org,context.Repo, context.IssueNumber, contents);++ }++ break;++ case nameof(GithubFlowEventType.DevPlanCreated):++ {++ var context = item.ToGithubContext();++ var plan = JsonSerializer.Deserialize<DevLeadPlanResponse>(item.Data["plan"]);++ var prompts = plan.steps.SelectMany(s => s.subtasks.Select(st => st.prompt));++++ foreach (var prompt in prompts)++ {++ var functionName = "Developer.Implement";++ var issue = await CreateIssue(context.Org, context.Repo, prompt, functionName, context.ParentNumber.Value);++ var commentBody = $" - #{issue} - tracks {functionName}";++ await PostComment(context.Org, context.Repo, context.ParentNumber.Value, commentBody);++ }++ }++ break;++ case nameof(GithubFlowEventType.ReadmeStored):++ {++ var context = item.ToGithubContext();++ var branch = $"sk-{context.ParentNumber}";++ await CommitToBranch(context.Org, context.Repo, context.ParentNumber.Value, context.IssueNumber, "output", branch);++ await CreatePullRequest(context.Org, context.Repo, context.ParentNumber.Value, branch);++ }++ break;++ case nameof(GithubFlowEventType.SandboxRunFinished):++ {++ var context = item.ToGithubContext();++ var branch = $"sk-{context.ParentNumber}";++ await CommitToBranch(context.Org, context.Repo, context.ParentNumber.Value, context.IssueNumber, "output", branch);++ }++ break;++ default:++ break;++ }++ }++++ public async Task<int> CreateIssue(string org, string repo, string input, string function, long parentNumber)++ {++ return await _ghService.CreateIssue(org, repo, input, function, parentNumber);++ }++ public async Task PostComment(string org, string repo, long issueNumber, string comment)++ {++ await _ghService.PostComment(org, repo, issueNumber, comment);++ }++ public async Task CreateBranch(string org, string repo, string branch)++ {++ await _ghService.CreateBranch(org, repo, branch);++ }++ public async Task CreatePullRequest(string org, string repo, long issueNumber, string branch)++ {++ await _ghService.CreatePR(org, repo, issueNumber, branch);++ }++ public async Task CommitToBranch(string org, string repo, long parentNumber, long issueNumber, string rootDir, string branch)++ {++ await _ghService.CommitToBranch(org, repo, parentNumber, issueNumber, rootDir, branch);++ }+ }diff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Agents/ProductManager/PMPrompts.csindex 000000000,7683010e4..7683010e4mode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Agents/ProductManager/PMPrompts.cs+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Agents/ProductManager/PMPrompts.csdiff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Agents/ProductManager/ProductManager.csindex 000000000,3ffbc8a59..3ffbc8a59mode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Agents/ProductManager/ProductManager.cs+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Agents/ProductManager/ProductManager.csdiff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Agents/Sandbox.csindex 000000000,6185af676..4802c3bafmode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Agents/Sandbox.cs+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Agents/Sandbox.cs@@@ -1,0 -1,108 +1,108 @@@-using Microsoft.AI.Agents.Abstractions;-using Microsoft.AI.Agents.Orleans;-using Microsoft.AI.DevTeam.Events;-using Orleans.Runtime;-using Orleans.Timers;--namespace Microsoft.AI.DevTeam;-[ImplicitStreamSubscription(Consts.MainNamespace)]-public class Sandbox : Agent, IRemindable-{- protected override string Namespace => Consts.MainNamespace;- private const string ReminderName = "SandboxRunReminder";- private readonly IManageAzure _azService;- private readonly IReminderRegistry _reminderRegistry;- private IGrainReminder? _reminder;-- protected readonly IPersistentState<SandboxMetadata> _state;-- public Sandbox([PersistentState("state", "messages")] IPersistentState<SandboxMetadata> state,- IReminderRegistry reminderRegistry, IManageAzure azService)- {- _reminderRegistry = reminderRegistry;- _azService = azService;- _state = state;- }- public override async Task HandleEvent(Event item)- {- switch (item.Type)- {- case nameof(GithubFlowEventType.SandboxRunCreated):- {- var context = item.ToGithubContext();- await ScheduleCommitSandboxRun(context.Org, context.Repo, context.ParentNumber.Value, context.IssueNumber);- break;- }-- default:- break;- }- }- public async Task ScheduleCommitSandboxRun(string org, string repo, long parentIssueNumber, long issueNumber)- {- await StoreState(org, repo, parentIssueNumber, issueNumber);- _reminder = await _reminderRegistry.RegisterOrUpdateReminder(- callingGrainId: this.GetGrainId(),- reminderName: ReminderName,- dueTime: TimeSpan.Zero,- period: TimeSpan.FromMinutes(1));- }-- async Task IRemindable.ReceiveReminder(string reminderName, TickStatus status)- {- if (!_state.State.IsCompleted)- {- var sandboxId = $"sk-sandbox-{_state.State.Org}-{_state.State.Repo}-{_state.State.ParentIssueNumber}-{_state.State.IssueNumber}".ToLower();-- if (await _azService.IsSandboxCompleted(sandboxId))- {- await _azService.DeleteSandbox(sandboxId);- await PublishEvent(Consts.MainNamespace, this.GetPrimaryKeyString(), new Event- {- Type = nameof(GithubFlowEventType.SandboxRunFinished),- Data = new Dictionary<string, string> {- { "org", _state.State.Org },- { "repo", _state.State.Repo },- { "issueNumber", _state.State.IssueNumber.ToString() },- { "parentNumber", _state.State.ParentIssueNumber.ToString() }- }- });- await Cleanup();- }- }- else- {- await Cleanup();- }- }-- private async Task StoreState(string org, string repo, long parentIssueNumber, long issueNumber)- {- _state.State.Org = org;- _state.State.Repo = repo;- _state.State.ParentIssueNumber = parentIssueNumber;- _state.State.IssueNumber = issueNumber;- _state.State.IsCompleted = false;- await _state.WriteStateAsync();- }-- private async Task Cleanup()- {- _state.State.IsCompleted = true;- await _reminderRegistry.UnregisterReminder(- this.GetGrainId(), _reminder);- await _state.WriteStateAsync();- }---}---public class SandboxMetadata-{- public string Org { get; set; }- public string Repo { get; set; }- public long ParentIssueNumber { get; set; }- public long IssueNumber { get; set; }- public bool IsCompleted { get; set; }++using Microsoft.AI.Agents.Abstractions;++using Microsoft.AI.Agents.Orleans;++using Microsoft.AI.DevTeam.Events;++using Orleans.Runtime;++using Orleans.Timers;++++namespace Microsoft.AI.DevTeam;++[ImplicitStreamSubscription(Consts.MainNamespace)]++public class Sandbox : Agent, IRemindable++{++ protected override string Namespace => Consts.MainNamespace;++ private const string ReminderName = "SandboxRunReminder";++ private readonly IManageAzure _azService;++ private readonly IReminderRegistry _reminderRegistry;++ private IGrainReminder? _reminder;++++ protected readonly IPersistentState<SandboxMetadata> _state;++++ public Sandbox([PersistentState("state", "messages")] IPersistentState<SandboxMetadata> state,++ IReminderRegistry reminderRegistry, IManageAzure azService)++ {++ _reminderRegistry = reminderRegistry;++ _azService = azService;++ _state = state;++ }++ public override async Task HandleEvent(Event item)++ {++ switch (item.Type)++ {++ case nameof(GithubFlowEventType.SandboxRunCreated):++ {++ var context = item.ToGithubContext();++ await ScheduleCommitSandboxRun(context.Org, context.Repo, context.ParentNumber.Value, context.IssueNumber);++ break;++ }++++ default:++ break;++ }++ }++ public async Task ScheduleCommitSandboxRun(string org, string repo, long parentIssueNumber, long issueNumber)++ {++ await StoreState(org, repo, parentIssueNumber, issueNumber);++ _reminder = await _reminderRegistry.RegisterOrUpdateReminder(++ callingGrainId: this.GetGrainId(),++ reminderName: ReminderName,++ dueTime: TimeSpan.Zero,++ period: TimeSpan.FromMinutes(1));++ }++++ async Task IRemindable.ReceiveReminder(string reminderName, TickStatus status)++ {++ if (!_state.State.IsCompleted)++ {++ var sandboxId = $"sk-sandbox-{_state.State.Org}-{_state.State.Repo}-{_state.State.ParentIssueNumber}-{_state.State.IssueNumber}".ToLower();++++ if (await _azService.IsSandboxCompleted(sandboxId))++ {++ await _azService.DeleteSandbox(sandboxId);++ await PublishEvent(Consts.MainNamespace, this.GetPrimaryKeyString(), new Event++ {++ Type = nameof(GithubFlowEventType.SandboxRunFinished),++ Data = new Dictionary<string, string> {++ { "org", _state.State.Org },++ { "repo", _state.State.Repo },++ { "issueNumber", _state.State.IssueNumber.ToString() },++ { "parentNumber", _state.State.ParentIssueNumber.ToString() }++ }++ });++ await Cleanup();++ }++ }++ else++ {++ await Cleanup();++ }++ }++++ private async Task StoreState(string org, string repo, long parentIssueNumber, long issueNumber)++ {++ _state.State.Org = org;++ _state.State.Repo = repo;++ _state.State.ParentIssueNumber = parentIssueNumber;++ _state.State.IssueNumber = issueNumber;++ _state.State.IsCompleted = false;++ await _state.WriteStateAsync();++ }++++ private async Task Cleanup()++ {++ _state.State.IsCompleted = true;++ await _reminderRegistry.UnregisterReminder(++ this.GetGrainId(), _reminder);++ await _state.WriteStateAsync();++ }++++++}++++++public class SandboxMetadata++{++ public string Org { get; set; }++ public string Repo { get; set; }++ public long ParentIssueNumber { get; set; }++ public long IssueNumber { get; set; }++ public bool IsCompleted { get; set; }+ }diff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Dockerfileindex 000000000,094d15016..094d15016mode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Dockerfile+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Dockerfilediff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Events/GithubFlowEventType.csindex 000000000,3aec523bc..3aec523bcmode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Events/GithubFlowEventType.cs+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Events/GithubFlowEventType.csdiff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Extensions/ParseExtensions.csindex 000000000,8c618c1a4..8c618c1a4mode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Extensions/ParseExtensions.cs+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Extensions/ParseExtensions.csdiff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Microsoft.AI.DevTeam.csprojindex 000000000,22c1acdd6..d299007eemode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Microsoft.AI.DevTeam.csproj+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Microsoft.AI.DevTeam.csproj@@@ -1,0 -1,50 +1,49 @@@+ <Project Sdk="Microsoft.NET.Sdk.Web">+- <ItemGroup>- <ProjectReference Include="..\..\..\..\src\Microsoft.AI.Agents.Orleans\Microsoft.AI.Agents.Orleans.csproj" />- </ItemGroup>-+ <PropertyGroup>+ <TargetFramework>net8.0</TargetFramework>+ <Nullable>enable</Nullable>+ <ImplicitUsings>enable</ImplicitUsings>+ <ServerGarbageCollection>true</ServerGarbageCollection>+ <ConcurrentGarbageCollection>true</ConcurrentGarbageCollection>+ <UserSecretsId>c073c86e-8483-4956-942f-331fd09172d4</UserSecretsId>+ <AnalysisMode>All</AnalysisMode>+ </PropertyGroup>++ <ItemGroup>+ <PackageReference Include="Octokit.Webhooks.AspNetCore" Version="2.0.3" />+ <PackageReference Include="Octokit" Version="10.0.0" />+ <PackageReference Include="Microsoft.SemanticKernel" Version="1.10.0" />+ <PackageReference Include="Microsoft.SemanticKernel.Connectors.Qdrant" Version="1.10.0-alpha" />+ <PackageReference Include="Microsoft.SemanticKernel.Plugins.Memory" Version="1.10.0-alpha" />++ <PackageReference Include="Microsoft.Orleans.Server" Version="8.1.0" />+ <PackageReference Include="Microsoft.Orleans.Sdk" Version="8.1.0" />+ <PackageReference Include="Microsoft.Orleans.Runtime" Version="8.1.0" />+ <PackageReference Include="Microsoft.Orleans.Persistence.Cosmos" Version="8.1.0" />+ <PackageReference Include="Microsoft.Orleans.Clustering.Cosmos" Version="8.1.0" />+ <PackageReference Include="Microsoft.Orleans.Reminders.Cosmos" Version="8.1.0" />+ <PackageReference Include="Microsoft.Orleans.Streaming.EventHubs" Version="8.1.0" />+ <PackageReference Include="Microsoft.Orleans.Reminders" Version="8.1.0" />+ <PackageReference Include="Microsoft.Orleans.Streaming" Version="8.1.0" />+ <PackageReference Include="OrleansDashboard" Version="8.0.0" />++ <PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.21.0" />+ <PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />++ <PackageReference Include="Microsoft.Extensions.Azure" Version="1.7.2" />+ <PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="8.0.0" />+ <PackageReference Include="Azure.ResourceManager.ContainerInstance" Version="1.2.0" />+ <PackageReference Include="Azure.Storage.Files.Shares" Version="12.16.0-beta.1" />+ <PackageReference Include="Azure.Data.Tables" Version="12.8.1" />+ <PackageReference Include="Azure.Identity" Version="1.11.0-beta.1" />++ <PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="7.4.1" />++ </ItemGroup>-++++ <ItemGroup>++ <ProjectReference Include="..\..\..\..\..\csharp\src\Microsoft.AI.Agents.Orleans\Microsoft.AI.Agents.Orleans.csproj" />++ </ItemGroup>++ </Project>diff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Options/AzureOptions.csindex 000000000,4f29ed8b7..4f29ed8b7mode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Options/AzureOptions.cs+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Options/AzureOptions.csdiff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Options/Consts.csindex 000000000,b956852c5..d8575e38emode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Options/Consts.cs+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Options/Consts.cs@@@ -1,0 -1,6 +1,6 @@@-namespace Microsoft.AI.DevTeam;--public static class Consts-{- public const string MainNamespace = "DevPersonas";-}++namespace Microsoft.AI.DevTeam;++++public static class Consts++{++ public const string MainNamespace = "DevPersonas";++}diff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Options/GithubOptions.csindex 000000000,c13fc1e67..c13fc1e67mode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Options/GithubOptions.cs+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Options/GithubOptions.csdiff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Options/OpenAIOptions.csindex 000000000,1b251c1fb..1b251c1fbmode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Options/OpenAIOptions.cs+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Options/OpenAIOptions.csdiff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Options/QdrantOptions.csindex 000000000,da292ce62..da292ce62mode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Options/QdrantOptions.cs+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Options/QdrantOptions.csdiff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Options/ServiceOptions.csindex 000000000,33228424e..33228424emode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Options/ServiceOptions.cs+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Options/ServiceOptions.csdiff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Program.csindex 000000000,03c77b5da..00e9ae586mode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Program.cs+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Program.cs@@@ -1,0 -1,205 +1,205 @@@-using System.Text.Json;-using Azure;-using Azure.AI.OpenAI;-using Microsoft.AI.DevTeam;-using Microsoft.Extensions.Options;-using Microsoft.SemanticKernel;-using Octokit.Webhooks;-using Octokit.Webhooks.AspNetCore;-using Azure.Identity;-using Microsoft.Extensions.Azure;-using Microsoft.Extensions.Http.Resilience;-using Microsoft.SemanticKernel.Memory;-using Microsoft.SemanticKernel.Connectors.Qdrant;-using Microsoft.SemanticKernel.Connectors.OpenAI;-using Orleans.Configuration;-using Orleans.Serialization;--var builder = WebApplication.CreateBuilder(args);-builder.Services.AddSingleton<WebhookEventProcessor, GithubWebHookProcessor>();-builder.Services.AddTransient(CreateKernel);-builder.Services.AddTransient(CreateMemory);-builder.Services.AddHttpClient();---builder.Services.AddTransient(s =>-{- var ghOptions = s.GetService<IOptions<GithubOptions>>();- var logger = s.GetService<ILogger<GithubAuthService>>();- var ghService = new GithubAuthService(ghOptions, logger);- var client = ghService.GetGitHubClient();- return client;-});--builder.Services.AddAzureClients(clientBuilder =>-{- clientBuilder.AddArmClient(default);- clientBuilder.UseCredential(new DefaultAzureCredential());-});--builder.Services.AddSingleton<GithubAuthService>();--builder.Services.AddApplicationInsightsTelemetry();-builder.Services.AddOptions<GithubOptions>()- .Configure<IConfiguration>((settings, configuration) =>- {- configuration.GetSection(nameof(GithubOptions)).Bind(settings);- })- .ValidateDataAnnotations()- .ValidateOnStart();--builder.Services.AddOptions<AzureOptions>()- .Configure<IConfiguration>((settings, configuration) =>- {- configuration.GetSection(nameof(AzureOptions)).Bind(settings);- })- .ValidateDataAnnotations()- .ValidateOnStart();--builder.Services.AddOptions<OpenAIOptions>()- .Configure<IConfiguration>((settings, configuration) =>- {- configuration.GetSection(nameof(OpenAIOptions)).Bind(settings);- })- .ValidateDataAnnotations()- .ValidateOnStart();--builder.Services.AddOptions<QdrantOptions>()- .Configure<IConfiguration>((settings, configuration) =>- {- configuration.GetSection(nameof(QdrantOptions)).Bind(settings);- })- .ValidateDataAnnotations()- .ValidateOnStart();--builder.Services.AddOptions<ServiceOptions>()- .Configure<IConfiguration>((settings, configuration) =>- {- configuration.GetSection(nameof(ServiceOptions)).Bind(settings);- })- .ValidateDataAnnotations()- .ValidateOnStart();--builder.Services.AddSingleton<IManageAzure, AzureService>();-builder.Services.AddSingleton<IManageGithub, GithubService>();-builder.Services.AddSingleton<IAnalyzeCode, CodeAnalyzer>();--builder.Host.UseOrleans(siloBuilder =>-{- siloBuilder.UseDashboard(x => x.HostSelf = true);- if (builder.Environment.IsDevelopment())- {- siloBuilder.UseLocalhostClustering()- .AddMemoryStreams("StreamProvider")- .AddMemoryGrainStorage("PubSubStore")- .AddMemoryGrainStorage("messages");-- siloBuilder.UseInMemoryReminderService();- siloBuilder.UseDashboard(x => x.HostSelf = true);-- siloBuilder.UseInMemoryReminderService();- }- else- {- var cosmosDbconnectionString = builder.Configuration.GetValue<string>("AzureOptions:CosmosConnectionString");- siloBuilder.Configure<ClusterOptions>(options =>- {- options.ClusterId = "ai-dev-cluster";- options.ServiceId = "ai-dev-cluster";- });- siloBuilder.Configure<SiloMessagingOptions>(options =>- {- options.ResponseTimeout = TimeSpan.FromMinutes(3);- options.SystemResponseTimeout = TimeSpan.FromMinutes(3);- });- siloBuilder.Configure<ClientMessagingOptions>(options =>- {- options.ResponseTimeout = TimeSpan.FromMinutes(3);- });- siloBuilder.UseCosmosClustering(o =>- {- o.ConfigureCosmosClient(cosmosDbconnectionString);- o.ContainerName = "devteam";- o.DatabaseName = "clustering";- o.IsResourceCreationEnabled = true;- });-- siloBuilder.UseCosmosReminderService(o =>- {- o.ConfigureCosmosClient(cosmosDbconnectionString);- o.ContainerName = "devteam";- o.DatabaseName = "reminders";- o.IsResourceCreationEnabled = true;- });- siloBuilder.AddCosmosGrainStorage(- name: "messages",- configureOptions: o =>- {- o.ConfigureCosmosClient(cosmosDbconnectionString);- o.ContainerName = "devteam";- o.DatabaseName = "persistence";- o.IsResourceCreationEnabled = true;- });- //TODO: replace with EventHub- siloBuilder- .AddMemoryStreams("StreamProvider")- .AddMemoryGrainStorage("PubSubStore");- }-});--builder.Services.Configure<JsonSerializerOptions>(options =>-{- options.PropertyNamingPolicy = JsonNamingPolicy.CamelCase;-});-var app = builder.Build();--app.UseRouting()- .UseEndpoints(endpoints =>-{- var ghOptions = app.Services.GetService<IOptions<GithubOptions>>().Value;- endpoints.MapGitHubWebhooks(secret: ghOptions.WebhookSecret);-});--app.Map("/dashboard", x => x.UseOrleansDashboard());--app.Run();--static ISemanticTextMemory CreateMemory(IServiceProvider provider)-{- var openAiConfig = provider.GetService<IOptions<OpenAIOptions>>().Value;- var qdrantConfig = provider.GetService<IOptions<QdrantOptions>>().Value;-- var loggerFactory = LoggerFactory.Create(builder =>- {- builder- .SetMinimumLevel(LogLevel.Debug)- .AddConsole()- .AddDebug();- });-- var memoryBuilder = new MemoryBuilder();- return memoryBuilder.WithLoggerFactory(loggerFactory)- .WithQdrantMemoryStore(qdrantConfig.Endpoint, qdrantConfig.VectorSize)- .WithAzureOpenAITextEmbeddingGeneration(openAiConfig.EmbeddingDeploymentOrModelId, openAiConfig.Endpoint, openAiConfig.ApiKey)- .Build();-}--static Kernel CreateKernel(IServiceProvider provider)-{- var openAiConfig = provider.GetService<IOptions<OpenAIOptions>>().Value;- var clientOptions = new OpenAIClientOptions();- clientOptions.Retry.NetworkTimeout = TimeSpan.FromMinutes(5);- var openAIClient = new OpenAIClient(new Uri(openAiConfig.Endpoint), new AzureKeyCredential(openAiConfig.ApiKey), clientOptions);- var builder = Kernel.CreateBuilder();- builder.Services.AddLogging(c => c.AddConsole().AddDebug().SetMinimumLevel(LogLevel.Debug));- builder.Services.AddAzureOpenAIChatCompletion(openAiConfig.DeploymentOrModelId, openAIClient);- builder.Services.ConfigureHttpClientDefaults(c =>- {- c.AddStandardResilienceHandler().Configure(o =>- {- o.Retry.MaxRetryAttempts = 5;- o.Retry.BackoffType = Polly.DelayBackoffType.Exponential;- });- });- return builder.Build();++using System.Text.Json;++using Azure;++using Azure.AI.OpenAI;++using Microsoft.AI.DevTeam;++using Microsoft.Extensions.Options;++using Microsoft.SemanticKernel;++using Octokit.Webhooks;++using Octokit.Webhooks.AspNetCore;++using Azure.Identity;++using Microsoft.Extensions.Azure;++using Microsoft.Extensions.Http.Resilience;++using Microsoft.SemanticKernel.Memory;++using Microsoft.SemanticKernel.Connectors.Qdrant;++using Microsoft.SemanticKernel.Connectors.OpenAI;++using Orleans.Configuration;++using Orleans.Serialization;++++var builder = WebApplication.CreateBuilder(args);++builder.Services.AddSingleton<WebhookEventProcessor, GithubWebHookProcessor>();++builder.Services.AddTransient(CreateKernel);++builder.Services.AddTransient(CreateMemory);++builder.Services.AddHttpClient();++++++builder.Services.AddTransient(s =>++{++ var ghOptions = s.GetService<IOptions<GithubOptions>>();++ var logger = s.GetService<ILogger<GithubAuthService>>();++ var ghService = new GithubAuthService(ghOptions, logger);++ var client = ghService.GetGitHubClient();++ return client;++});++++builder.Services.AddAzureClients(clientBuilder =>++{++ clientBuilder.AddArmClient(default);++ clientBuilder.UseCredential(new DefaultAzureCredential());++});++++builder.Services.AddSingleton<GithubAuthService>();++++builder.Services.AddApplicationInsightsTelemetry();++builder.Services.AddOptions<GithubOptions>()++ .Configure<IConfiguration>((settings, configuration) =>++ {++ configuration.GetSection(nameof(GithubOptions)).Bind(settings);++ })++ .ValidateDataAnnotations()++ .ValidateOnStart();++++builder.Services.AddOptions<AzureOptions>()++ .Configure<IConfiguration>((settings, configuration) =>++ {++ configuration.GetSection(nameof(AzureOptions)).Bind(settings);++ })++ .ValidateDataAnnotations()++ .ValidateOnStart();++++builder.Services.AddOptions<OpenAIOptions>()++ .Configure<IConfiguration>((settings, configuration) =>++ {++ configuration.GetSection(nameof(OpenAIOptions)).Bind(settings);++ })++ .ValidateDataAnnotations()++ .ValidateOnStart();++++builder.Services.AddOptions<QdrantOptions>()++ .Configure<IConfiguration>((settings, configuration) =>++ {++ configuration.GetSection(nameof(QdrantOptions)).Bind(settings);++ })++ .ValidateDataAnnotations()++ .ValidateOnStart();++++builder.Services.AddOptions<ServiceOptions>()++ .Configure<IConfiguration>((settings, configuration) =>++ {++ configuration.GetSection(nameof(ServiceOptions)).Bind(settings);++ })++ .ValidateDataAnnotations()++ .ValidateOnStart();++++builder.Services.AddSingleton<IManageAzure, AzureService>();++builder.Services.AddSingleton<IManageGithub, GithubService>();++builder.Services.AddSingleton<IAnalyzeCode, CodeAnalyzer>();++++builder.Host.UseOrleans(siloBuilder =>++{++ siloBuilder.UseDashboard(x => x.HostSelf = true);++ if (builder.Environment.IsDevelopment())++ {++ siloBuilder.UseLocalhostClustering()++ .AddMemoryStreams("StreamProvider")++ .AddMemoryGrainStorage("PubSubStore")++ .AddMemoryGrainStorage("messages");++++ siloBuilder.UseInMemoryReminderService();++ siloBuilder.UseDashboard(x => x.HostSelf = true);++++ siloBuilder.UseInMemoryReminderService();++ }++ else++ {++ var cosmosDbconnectionString = builder.Configuration.GetValue<string>("AzureOptions:CosmosConnectionString");++ siloBuilder.Configure<ClusterOptions>(options =>++ {++ options.ClusterId = "ai-dev-cluster";++ options.ServiceId = "ai-dev-cluster";++ });++ siloBuilder.Configure<SiloMessagingOptions>(options =>++ {++ options.ResponseTimeout = TimeSpan.FromMinutes(3);++ options.SystemResponseTimeout = TimeSpan.FromMinutes(3);++ });++ siloBuilder.Configure<ClientMessagingOptions>(options =>++ {++ options.ResponseTimeout = TimeSpan.FromMinutes(3);++ });++ siloBuilder.UseCosmosClustering(o =>++ {++ o.ConfigureCosmosClient(cosmosDbconnectionString);++ o.ContainerName = "devteam";++ o.DatabaseName = "clustering";++ o.IsResourceCreationEnabled = true;++ });++++ siloBuilder.UseCosmosReminderService(o =>++ {++ o.ConfigureCosmosClient(cosmosDbconnectionString);++ o.ContainerName = "devteam";++ o.DatabaseName = "reminders";++ o.IsResourceCreationEnabled = true;++ });++ siloBuilder.AddCosmosGrainStorage(++ name: "messages",++ configureOptions: o =>++ {++ o.ConfigureCosmosClient(cosmosDbconnectionString);++ o.ContainerName = "devteam";++ o.DatabaseName = "persistence";++ o.IsResourceCreationEnabled = true;++ });++ //TODO: replace with EventHub++ siloBuilder++ .AddMemoryStreams("StreamProvider")++ .AddMemoryGrainStorage("PubSubStore");++ }++});++++builder.Services.Configure<JsonSerializerOptions>(options =>++{++ options.PropertyNamingPolicy = JsonNamingPolicy.CamelCase;++});++var app = builder.Build();++++app.UseRouting()++ .UseEndpoints(endpoints =>++{++ var ghOptions = app.Services.GetService<IOptions<GithubOptions>>().Value;++ endpoints.MapGitHubWebhooks(secret: ghOptions.WebhookSecret);++});++++app.Map("/dashboard", x => x.UseOrleansDashboard());++++app.Run();++++static ISemanticTextMemory CreateMemory(IServiceProvider provider)++{++ var openAiConfig = provider.GetService<IOptions<OpenAIOptions>>().Value;++ var qdrantConfig = provider.GetService<IOptions<QdrantOptions>>().Value;++++ var loggerFactory = LoggerFactory.Create(builder =>++ {++ builder++ .SetMinimumLevel(LogLevel.Debug)++ .AddConsole()++ .AddDebug();++ });++++ var memoryBuilder = new MemoryBuilder();++ return memoryBuilder.WithLoggerFactory(loggerFactory)++ .WithQdrantMemoryStore(qdrantConfig.Endpoint, qdrantConfig.VectorSize)++ .WithAzureOpenAITextEmbeddingGeneration(openAiConfig.EmbeddingDeploymentOrModelId, openAiConfig.Endpoint, openAiConfig.ApiKey)++ .Build();++}++++static Kernel CreateKernel(IServiceProvider provider)++{++ var openAiConfig = provider.GetService<IOptions<OpenAIOptions>>().Value;++ var clientOptions = new OpenAIClientOptions();++ clientOptions.Retry.NetworkTimeout = TimeSpan.FromMinutes(5);++ var openAIClient = new OpenAIClient(new Uri(openAiConfig.Endpoint), new AzureKeyCredential(openAiConfig.ApiKey), clientOptions);++ var builder = Kernel.CreateBuilder();++ builder.Services.AddLogging(c => c.AddConsole().AddDebug().SetMinimumLevel(LogLevel.Debug));++ builder.Services.AddAzureOpenAIChatCompletion(openAiConfig.DeploymentOrModelId, openAIClient);++ builder.Services.ConfigureHttpClientDefaults(c =>++ {++ c.AddStandardResilienceHandler().Configure(o =>++ {++ o.Retry.MaxRetryAttempts = 5;++ o.Retry.BackoffType = Polly.DelayBackoffType.Exponential;++ });++ });++ return builder.Build();+ }diff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Properties/launchSettings.jsonindex 000000000,6970a78f6..373d72522mode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Properties/launchSettings.json+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Properties/launchSettings.json@@@ -1,0 -1,38 +1,38 @@@-{- "$schema": "http://json.schemastore.org/launchsettings.json",- "iisSettings": {- "windowsAuthentication": false,- "anonymousAuthentication": true,- "iisExpress": {- "applicationUrl": "http://localhost:59668",- "sslPort": 44354- }- },- "profiles": {- "http": {- "commandName": "Project",- "dotnetRunMessages": true,- "launchBrowser": true,- "applicationUrl": "http://localhost:5244",- "environmentVariables": {- "ASPNETCORE_ENVIRONMENT": "Development"- }- },- "https": {- "commandName": "Project",- "dotnetRunMessages": true,- "launchBrowser": true,- "applicationUrl": "https://localhost:7227;http://localhost:5244",- "environmentVariables": {- "ASPNETCORE_ENVIRONMENT": "Development"- }- },- "IIS Express": {- "commandName": "IISExpress",- "launchBrowser": true,- "environmentVariables": {- "ASPNETCORE_ENVIRONMENT": "Development"- }- }- }-}++{++ "$schema": "http://json.schemastore.org/launchsettings.json",++ "iisSettings": {++ "windowsAuthentication": false,++ "anonymousAuthentication": true,++ "iisExpress": {++ "applicationUrl": "http://localhost:59668",++ "sslPort": 44354++ }++ },++ "profiles": {++ "http": {++ "commandName": "Project",++ "dotnetRunMessages": true,++ "launchBrowser": true,++ "applicationUrl": "http://localhost:5244",++ "environmentVariables": {++ "ASPNETCORE_ENVIRONMENT": "Development"++ }++ },++ "https": {++ "commandName": "Project",++ "dotnetRunMessages": true,++ "launchBrowser": true,++ "applicationUrl": "https://localhost:7227;http://localhost:5244",++ "environmentVariables": {++ "ASPNETCORE_ENVIRONMENT": "Development"++ }++ },++ "IIS Express": {++ "commandName": "IISExpress",++ "launchBrowser": true,++ "environmentVariables": {++ "ASPNETCORE_ENVIRONMENT": "Development"++ }++ }++ }++}diff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Services/AzureService.csindex 000000000,78a9aade5..4ebead697mode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Services/AzureService.cs+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Services/AzureService.cs@@@ -1,0 -1,160 +1,160 @@@-using System.Text;-using Azure;-using Azure.Core;-using Azure.ResourceManager;-using Azure.ResourceManager.ContainerInstance;-using Azure.ResourceManager.ContainerInstance.Models;-using Azure.ResourceManager.Resources;-using Azure.Storage.Files.Shares;-using Microsoft.Extensions.Options;---namespace Microsoft.AI.DevTeam;--public class AzureService : IManageAzure-{- private readonly AzureOptions _azSettings;- private readonly ILogger<AzureService> _logger;- private readonly ArmClient _client;-- public AzureService(IOptions<AzureOptions> azOptions, ILogger<AzureService> logger, ArmClient client)- {- _azSettings = azOptions.Value;- _logger = logger;- _client = client;- }-- public async Task DeleteSandbox(string sandboxId)- {- try- {- var resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(_azSettings.SubscriptionId, _azSettings.ContainerInstancesResourceGroup);- var resourceGroupResource = _client.GetResourceGroupResource(resourceGroupResourceId);-- var collection = resourceGroupResource.GetContainerGroups();- var containerGroup = await collection.GetAsync(sandboxId);- await containerGroup.Value.DeleteAsync(WaitUntil.Started);- }- catch (Exception ex)- {- _logger.LogError(ex, "Error deleting sandbox");- throw;- }-- }-- public async Task<bool> IsSandboxCompleted(string sandboxId)- {- try- {- var resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(_azSettings.SubscriptionId, _azSettings.ContainerInstancesResourceGroup);- var resourceGroupResource = _client.GetResourceGroupResource(resourceGroupResourceId);-- var collection = resourceGroupResource.GetContainerGroups();- var containerGroup = await collection.GetAsync(sandboxId);- return containerGroup.Value.Data.ProvisioningState == "Succeeded"- && containerGroup.Value.Data.Containers.First().InstanceView.CurrentState.State == "Terminated";- }- catch (Exception ex)- {- _logger.LogError(ex, "Error checking sandbox status");- throw;- }- }-- public async Task RunInSandbox(string org, string repo, long parentIssueNumber, long issueNumber)- {- try- {- var runId = $"sk-sandbox-{org}-{repo}-{parentIssueNumber}-{issueNumber}".ToLower();- var resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(_azSettings.SubscriptionId, _azSettings.ContainerInstancesResourceGroup);- var resourceGroupResource = _client.GetResourceGroupResource(resourceGroupResourceId);- var scriptPath = $"/azfiles/output/{org}-{repo}/{parentIssueNumber}/{issueNumber}/run.sh";- var collection = resourceGroupResource.GetContainerGroups();- var data = new ContainerGroupData(new AzureLocation(_azSettings.Location), new ContainerInstanceContainer[]- {- new ContainerInstanceContainer(runId,_azSettings.SandboxImage,new ContainerResourceRequirements(new ContainerResourceRequestsContent(1.5,1)))- {- Command = { "/bin/bash", $"{scriptPath}" },- VolumeMounts =- {- new ContainerVolumeMount("azfiles","/azfiles/")- {- IsReadOnly = false,- }- },- }}, ContainerInstanceOperatingSystemType.Linux)- {- Volumes =- {- new ContainerVolume("azfiles")- {- AzureFile = new ContainerInstanceAzureFileVolume(_azSettings.FilesShareName,_azSettings.FilesAccountName)- {- StorageAccountKey = _azSettings.FilesAccountKey- },- },- },- RestartPolicy = ContainerGroupRestartPolicy.Never,- Sku = ContainerGroupSku.Standard,- Priority = ContainerGroupPriority.Regular- };- await collection.CreateOrUpdateAsync(WaitUntil.Completed, runId, data);- }- catch (Exception ex)- {- _logger.LogError(ex, "Error running sandbox");- throw;- }-- }-- public async Task Store(string org, string repo, long parentIssueNumber, long issueNumber, string filename, string extension, string dir, string output)- {- try- {- var connectionString = $"DefaultEndpointsProtocol=https;AccountName={_azSettings.FilesAccountName};AccountKey={_azSettings.FilesAccountKey};EndpointSuffix=core.windows.net";- var parentDirName = $"{dir}/{org}-{repo}";-- var fileName = $"{filename}.{extension}";-- var share = new ShareClient(connectionString, _azSettings.FilesShareName);- await share.CreateIfNotExistsAsync();- await share.GetDirectoryClient($"{dir}").CreateIfNotExistsAsync(); ;-- var parentDir = share.GetDirectoryClient(parentDirName);- await parentDir.CreateIfNotExistsAsync();-- var parentIssueDir = parentDir.GetSubdirectoryClient($"{parentIssueNumber}");- await parentIssueDir.CreateIfNotExistsAsync();-- var directory = parentIssueDir.GetSubdirectoryClient($"{issueNumber}");- await directory.CreateIfNotExistsAsync();-- var file = directory.GetFileClient(fileName);- // hack to enable script to save files in the same directory- var cwdHack = "#!/bin/bash\n cd $(dirname $0)";- var contents = extension == "sh" ? output.Replace("#!/bin/bash", cwdHack) : output;- using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(contents)))- {- await file.CreateAsync(stream.Length);- await file.UploadRangeAsync(- new HttpRange(0, stream.Length),- stream);- }- }- catch (Exception ex)- {- _logger.LogError(ex, "Error storing output");- throw;- }- }-}--public interface IManageAzure-{- Task Store(string org, string repo, long parentIssueNumber, long issueNumber, string filename, string extension, string dir, string output);- Task RunInSandbox(string org, string repo, long parentIssueNumber, long issueNumber);- Task<bool> IsSandboxCompleted(string sandboxId);- Task DeleteSandbox(string sandboxId);++using System.Text;++using Azure;++using Azure.Core;++using Azure.ResourceManager;++using Azure.ResourceManager.ContainerInstance;++using Azure.ResourceManager.ContainerInstance.Models;++using Azure.ResourceManager.Resources;++using Azure.Storage.Files.Shares;++using Microsoft.Extensions.Options;++++++namespace Microsoft.AI.DevTeam;++++public class AzureService : IManageAzure++{++ private readonly AzureOptions _azSettings;++ private readonly ILogger<AzureService> _logger;++ private readonly ArmClient _client;++++ public AzureService(IOptions<AzureOptions> azOptions, ILogger<AzureService> logger, ArmClient client)++ {++ _azSettings = azOptions.Value;++ _logger = logger;++ _client = client;++ }++++ public async Task DeleteSandbox(string sandboxId)++ {++ try++ {++ var resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(_azSettings.SubscriptionId, _azSettings.ContainerInstancesResourceGroup);++ var resourceGroupResource = _client.GetResourceGroupResource(resourceGroupResourceId);++++ var collection = resourceGroupResource.GetContainerGroups();++ var containerGroup = await collection.GetAsync(sandboxId);++ await containerGroup.Value.DeleteAsync(WaitUntil.Started);++ }++ catch (Exception ex)++ {++ _logger.LogError(ex, "Error deleting sandbox");++ throw;++ }++++ }++++ public async Task<bool> IsSandboxCompleted(string sandboxId)++ {++ try++ {++ var resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(_azSettings.SubscriptionId, _azSettings.ContainerInstancesResourceGroup);++ var resourceGroupResource = _client.GetResourceGroupResource(resourceGroupResourceId);++++ var collection = resourceGroupResource.GetContainerGroups();++ var containerGroup = await collection.GetAsync(sandboxId);++ return containerGroup.Value.Data.ProvisioningState == "Succeeded"++ && containerGroup.Value.Data.Containers.First().InstanceView.CurrentState.State == "Terminated";++ }++ catch (Exception ex)++ {++ _logger.LogError(ex, "Error checking sandbox status");++ throw;++ }++ }++++ public async Task RunInSandbox(string org, string repo, long parentIssueNumber, long issueNumber)++ {++ try++ {++ var runId = $"sk-sandbox-{org}-{repo}-{parentIssueNumber}-{issueNumber}".ToLower();++ var resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(_azSettings.SubscriptionId, _azSettings.ContainerInstancesResourceGroup);++ var resourceGroupResource = _client.GetResourceGroupResource(resourceGroupResourceId);++ var scriptPath = $"/azfiles/output/{org}-{repo}/{parentIssueNumber}/{issueNumber}/run.sh";++ var collection = resourceGroupResource.GetContainerGroups();++ var data = new ContainerGroupData(new AzureLocation(_azSettings.Location), new ContainerInstanceContainer[]++ {++ new ContainerInstanceContainer(runId,_azSettings.SandboxImage,new ContainerResourceRequirements(new ContainerResourceRequestsContent(1.5,1)))++ {++ Command = { "/bin/bash", $"{scriptPath}" },++ VolumeMounts =++ {++ new ContainerVolumeMount("azfiles","/azfiles/")++ {++ IsReadOnly = false,++ }++ },++ }}, ContainerInstanceOperatingSystemType.Linux)++ {++ Volumes =++ {++ new ContainerVolume("azfiles")++ {++ AzureFile = new ContainerInstanceAzureFileVolume(_azSettings.FilesShareName,_azSettings.FilesAccountName)++ {++ StorageAccountKey = _azSettings.FilesAccountKey++ },++ },++ },++ RestartPolicy = ContainerGroupRestartPolicy.Never,++ Sku = ContainerGroupSku.Standard,++ Priority = ContainerGroupPriority.Regular++ };++ await collection.CreateOrUpdateAsync(WaitUntil.Completed, runId, data);++ }++ catch (Exception ex)++ {++ _logger.LogError(ex, "Error running sandbox");++ throw;++ }++++ }++++ public async Task Store(string org, string repo, long parentIssueNumber, long issueNumber, string filename, string extension, string dir, string output)++ {++ try++ {++ var connectionString = $"DefaultEndpointsProtocol=https;AccountName={_azSettings.FilesAccountName};AccountKey={_azSettings.FilesAccountKey};EndpointSuffix=core.windows.net";++ var parentDirName = $"{dir}/{org}-{repo}";++++ var fileName = $"{filename}.{extension}";++++ var share = new ShareClient(connectionString, _azSettings.FilesShareName);++ await share.CreateIfNotExistsAsync();++ await share.GetDirectoryClient($"{dir}").CreateIfNotExistsAsync(); ;++++ var parentDir = share.GetDirectoryClient(parentDirName);++ await parentDir.CreateIfNotExistsAsync();++++ var parentIssueDir = parentDir.GetSubdirectoryClient($"{parentIssueNumber}");++ await parentIssueDir.CreateIfNotExistsAsync();++++ var directory = parentIssueDir.GetSubdirectoryClient($"{issueNumber}");++ await directory.CreateIfNotExistsAsync();++++ var file = directory.GetFileClient(fileName);++ // hack to enable script to save files in the same directory++ var cwdHack = "#!/bin/bash\n cd $(dirname $0)";++ var contents = extension == "sh" ? output.Replace("#!/bin/bash", cwdHack) : output;++ using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(contents)))++ {++ await file.CreateAsync(stream.Length);++ await file.UploadRangeAsync(++ new HttpRange(0, stream.Length),++ stream);++ }++ }++ catch (Exception ex)++ {++ _logger.LogError(ex, "Error storing output");++ throw;++ }++ }++}++++public interface IManageAzure++{++ Task Store(string org, string repo, long parentIssueNumber, long issueNumber, string filename, string extension, string dir, string output);++ Task RunInSandbox(string org, string repo, long parentIssueNumber, long issueNumber);++ Task<bool> IsSandboxCompleted(string sandboxId);++ Task DeleteSandbox(string sandboxId);+ }diff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Services/CodeAnalyzer.csindex 000000000,a56e9f5e5..a56e9f5e5mode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Services/CodeAnalyzer.cs+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Services/CodeAnalyzer.csdiff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Services/GithubAuthService.csindex 000000000,0c964d9db..0c964d9dbmode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Services/GithubAuthService.cs+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Services/GithubAuthService.csdiff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Services/GithubService.csindex 000000000,7a1316b9a..7fba64809mode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Services/GithubService.cs+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Services/GithubService.cs@@@ -1,0 -1,245 +1,245 @@@-using System.Text;-using Azure.Storage.Files.Shares;-using Microsoft.Extensions.Options;-using Octokit;-using Octokit.Helpers;---namespace Microsoft.AI.DevTeam;--public class GithubService : IManageGithub-{- private readonly GitHubClient _ghClient;- private readonly AzureOptions _azSettings;- private readonly ILogger<GithubService> _logger;- private readonly HttpClient _httpClient;-- public GithubService(IOptions<AzureOptions> azOptions, GitHubClient ghClient, ILogger<GithubService> logger, HttpClient httpClient)- {- _ghClient = ghClient;- _azSettings = azOptions.Value;- _logger = logger;- _httpClient = httpClient;- }-- public async Task CommitToBranch(string org, string repo, long parentNumber, long issueNumber, string rootDir, string branch)- {- try- {- var connectionString = $"DefaultEndpointsProtocol=https;AccountName={_azSettings.FilesAccountName};AccountKey={_azSettings.FilesAccountKey};EndpointSuffix=core.windows.net";-- var dirName = $"{rootDir}/{org}-{repo}/{parentNumber}/{issueNumber}";- var share = new ShareClient(connectionString, _azSettings.FilesShareName);- var directory = share.GetDirectoryClient(dirName);-- var remaining = new Queue<ShareDirectoryClient>();- remaining.Enqueue(directory);- while (remaining.Count > 0)- {- var dir = remaining.Dequeue();- await foreach (var item in dir.GetFilesAndDirectoriesAsync())- {- if (!item.IsDirectory && item.Name != "run.sh") // we don't want the generated script in the PR- {- try- {- var file = dir.GetFileClient(item.Name);- var filePath = file.Path.Replace($"{_azSettings.FilesShareName}/", "")- .Replace($"{dirName}/", "");- var fileStream = await file.OpenReadAsync();- using (var reader = new StreamReader(fileStream, Encoding.UTF8))- {- var value = reader.ReadToEnd();-- try- {- // Check if the file exists- var existingFiles = await _ghClient.Repository.Content.GetAllContentsByRef(org, repo, filePath, branch);- var existingFile = existingFiles.First();- // If the file exists, update it- var updateChangeSet = await _ghClient.Repository.Content.UpdateFile(- org, repo, filePath,- new UpdateFileRequest("Updated file via AI", value, existingFile.Sha, branch)); // TODO: add more meaningful commit message- }- catch (NotFoundException)- {- // If the file doesn't exist, create it- var createChangeSet = await _ghClient.Repository.Content.CreateFile(- org, repo, filePath,- new CreateFileRequest("Created file via AI", value, branch)); // TODO: add more meaningful commit message- }- catch (Exception ex)- {- _logger.LogError(ex, $"Error while uploading file {item.Name}");- }- }- }- catch (Exception ex)- {- _logger.LogError(ex, $"Error while uploading file {item.Name}");- }- }- else if (item.IsDirectory)- {- remaining.Enqueue(dir.GetSubdirectoryClient(item.Name));- }- }- }- }- catch (Exception ex)- {- _logger.LogError(ex, "Error committing to branch");- throw;- }- }-- public async Task CreateBranch(string org, string repo, string branch)- {- try- {- var ghRepo = await _ghClient.Repository.Get(org, repo);- var contents = await _ghClient.Repository.Content.GetAllContents(org, repo);- if (!contents.Any())- {- // Create a new file and commit it to the repository- var createChangeSet = await _ghClient.Repository.Content.CreateFile(- org,- repo,- "README.md",- new CreateFileRequest("Initial commit", "# Readme")- );- }- await _ghClient.Git.Reference.CreateBranch(org, repo, branch, ghRepo.DefaultBranch);- }- catch (Exception ex)- {- _logger.LogError(ex, "Error creating branch");- throw;- }- }-- public async Task<string> GetMainLanguage(string org, string repo)- {- try- {- var languages = await _ghClient.Repository.GetAllLanguages(org, repo);- var mainLanguage = languages.OrderByDescending(l => l.NumberOfBytes).First();- return mainLanguage.Name;- }- catch (Exception ex)- {- _logger.LogError(ex, "Error getting main language");- throw;- }- }-- public async Task<int> CreateIssue(string org, string repo, string input, string function, long parentNumber)- {- try- {- var newIssue = new NewIssue($"{function} chain for #{parentNumber}")- {- Body = input,- };- newIssue.Labels.Add(function);- newIssue.Labels.Add($"Parent.{parentNumber}");- var issue = await _ghClient.Issue.Create(org, repo, newIssue);- return issue.Number;- }- catch (Exception ex)- {- _logger.LogError(ex, "Error creating issue");- throw;- }- }-- public async Task CreatePR(string org, string repo, long number, string branch)- {- try- {- var ghRepo = await _ghClient.Repository.Get(org, repo);- await _ghClient.PullRequest.Create(org, repo, new NewPullRequest($"New app #{number}", branch, ghRepo.DefaultBranch));- }- catch (Exception ex)- {- _logger.LogError(ex, "Error creating PR");- throw;- }- }-- public async Task PostComment(string org, string repo, long issueNumber, string comment)- {- try- {- await _ghClient.Issue.Comment.Create(org, repo, (int)issueNumber, comment);- }- catch (Exception ex)- {- _logger.LogError(ex, "Error posting comment");- throw;- }- }-- public async Task<IEnumerable<FileResponse>> GetFiles(string org, string repo, string branch, Func<RepositoryContent, bool> filter)- {- try- {- var items = await _ghClient.Repository.Content.GetAllContentsByRef(org, repo, branch);- return await CollectFiles(org, repo, branch, items, filter);- }- catch (Exception ex)- {- _logger.LogError(ex, "Error getting files");- throw;- }- }-- private async Task<IEnumerable<FileResponse>> CollectFiles(string org, string repo, string branch, IReadOnlyList<RepositoryContent> items, Func<RepositoryContent, bool> filter)- {- try- {- var result = new List<FileResponse>();- foreach (var item in items)- {- if (item.Type == ContentType.File && filter(item))- {- var content = await _httpClient.GetStringAsync(item.DownloadUrl);- result.Add(new FileResponse- {- Name = item.Name,- Content = content- });- }- else if (item.Type == ContentType.Dir)- {- var subItems = await _ghClient.Repository.Content.GetAllContentsByRef(org, repo, item.Path, branch);- result.AddRange(await CollectFiles(org, repo, branch, subItems, filter));- }- }- return result;- }- catch (Exception ex)- {- _logger.LogError(ex, "Error collecting files");- throw;- }- }-}--public class FileResponse-{- public string Name { get; set; }- public string Content { get; set; }-}--public interface IManageGithub-{- Task<int> CreateIssue(string org, string repo, string input, string function, long parentNumber);- Task CreatePR(string org, string repo, long number, string branch);- Task CreateBranch(string org, string repo, string branch);- Task CommitToBranch(string org, string repo, long parentNumber, long issueNumber, string rootDir, string branch);-- Task PostComment(string org, string repo, long issueNumber, string comment);- Task<IEnumerable<FileResponse>> GetFiles(string org, string repo, string branch, Func<RepositoryContent, bool> filter);- Task<string> GetMainLanguage(string org, string repo);-}++using System.Text;++using Azure.Storage.Files.Shares;++using Microsoft.Extensions.Options;++using Octokit;++using Octokit.Helpers;++++++namespace Microsoft.AI.DevTeam;++++public class GithubService : IManageGithub++{++ private readonly GitHubClient _ghClient;++ private readonly AzureOptions _azSettings;++ private readonly ILogger<GithubService> _logger;++ private readonly HttpClient _httpClient;++++ public GithubService(IOptions<AzureOptions> azOptions, GitHubClient ghClient, ILogger<GithubService> logger, HttpClient httpClient)++ {++ _ghClient = ghClient;++ _azSettings = azOptions.Value;++ _logger = logger;++ _httpClient = httpClient;++ }++++ public async Task CommitToBranch(string org, string repo, long parentNumber, long issueNumber, string rootDir, string branch)++ {++ try++ {++ var connectionString = $"DefaultEndpointsProtocol=https;AccountName={_azSettings.FilesAccountName};AccountKey={_azSettings.FilesAccountKey};EndpointSuffix=core.windows.net";++++ var dirName = $"{rootDir}/{org}-{repo}/{parentNumber}/{issueNumber}";++ var share = new ShareClient(connectionString, _azSettings.FilesShareName);++ var directory = share.GetDirectoryClient(dirName);++++ var remaining = new Queue<ShareDirectoryClient>();++ remaining.Enqueue(directory);++ while (remaining.Count > 0)++ {++ var dir = remaining.Dequeue();++ await foreach (var item in dir.GetFilesAndDirectoriesAsync())++ {++ if (!item.IsDirectory && item.Name != "run.sh") // we don't want the generated script in the PR++ {++ try++ {++ var file = dir.GetFileClient(item.Name);++ var filePath = file.Path.Replace($"{_azSettings.FilesShareName}/", "")++ .Replace($"{dirName}/", "");++ var fileStream = await file.OpenReadAsync();++ using (var reader = new StreamReader(fileStream, Encoding.UTF8))++ {++ var value = reader.ReadToEnd();++++ try++ {++ // Check if the file exists++ var existingFiles = await _ghClient.Repository.Content.GetAllContentsByRef(org, repo, filePath, branch);++ var existingFile = existingFiles.First();++ // If the file exists, update it++ var updateChangeSet = await _ghClient.Repository.Content.UpdateFile(++ org, repo, filePath,++ new UpdateFileRequest("Updated file via AI", value, existingFile.Sha, branch)); // TODO: add more meaningful commit message++ }++ catch (NotFoundException)++ {++ // If the file doesn't exist, create it++ var createChangeSet = await _ghClient.Repository.Content.CreateFile(++ org, repo, filePath,++ new CreateFileRequest("Created file via AI", value, branch)); // TODO: add more meaningful commit message++ }++ catch (Exception ex)++ {++ _logger.LogError(ex, $"Error while uploading file {item.Name}");++ }++ }++ }++ catch (Exception ex)++ {++ _logger.LogError(ex, $"Error while uploading file {item.Name}");++ }++ }++ else if (item.IsDirectory)++ {++ remaining.Enqueue(dir.GetSubdirectoryClient(item.Name));++ }++ }++ }++ }++ catch (Exception ex)++ {++ _logger.LogError(ex, "Error committing to branch");++ throw;++ }++ }++++ public async Task CreateBranch(string org, string repo, string branch)++ {++ try++ {++ var ghRepo = await _ghClient.Repository.Get(org, repo);++ var contents = await _ghClient.Repository.Content.GetAllContents(org, repo);++ if (!contents.Any())++ {++ // Create a new file and commit it to the repository++ var createChangeSet = await _ghClient.Repository.Content.CreateFile(++ org,++ repo,++ "README.md",++ new CreateFileRequest("Initial commit", "# Readme")++ );++ }++ await _ghClient.Git.Reference.CreateBranch(org, repo, branch, ghRepo.DefaultBranch);++ }++ catch (Exception ex)++ {++ _logger.LogError(ex, "Error creating branch");++ throw;++ }++ }++++ public async Task<string> GetMainLanguage(string org, string repo)++ {++ try++ {++ var languages = await _ghClient.Repository.GetAllLanguages(org, repo);++ var mainLanguage = languages.OrderByDescending(l => l.NumberOfBytes).First();++ return mainLanguage.Name;++ }++ catch (Exception ex)++ {++ _logger.LogError(ex, "Error getting main language");++ throw;++ }++ }++++ public async Task<int> CreateIssue(string org, string repo, string input, string function, long parentNumber)++ {++ try++ {++ var newIssue = new NewIssue($"{function} chain for #{parentNumber}")++ {++ Body = input,++ };++ newIssue.Labels.Add(function);++ newIssue.Labels.Add($"Parent.{parentNumber}");++ var issue = await _ghClient.Issue.Create(org, repo, newIssue);++ return issue.Number;++ }++ catch (Exception ex)++ {++ _logger.LogError(ex, "Error creating issue");++ throw;++ }++ }++++ public async Task CreatePR(string org, string repo, long number, string branch)++ {++ try++ {++ var ghRepo = await _ghClient.Repository.Get(org, repo);++ await _ghClient.PullRequest.Create(org, repo, new NewPullRequest($"New app #{number}", branch, ghRepo.DefaultBranch));++ }++ catch (Exception ex)++ {++ _logger.LogError(ex, "Error creating PR");++ throw;++ }++ }++++ public async Task PostComment(string org, string repo, long issueNumber, string comment)++ {++ try++ {++ await _ghClient.Issue.Comment.Create(org, repo, (int)issueNumber, comment);++ }++ catch (Exception ex)++ {++ _logger.LogError(ex, "Error posting comment");++ throw;++ }++ }++++ public async Task<IEnumerable<FileResponse>> GetFiles(string org, string repo, string branch, Func<RepositoryContent, bool> filter)++ {++ try++ {++ var items = await _ghClient.Repository.Content.GetAllContentsByRef(org, repo, branch);++ return await CollectFiles(org, repo, branch, items, filter);++ }++ catch (Exception ex)++ {++ _logger.LogError(ex, "Error getting files");++ throw;++ }++ }++++ private async Task<IEnumerable<FileResponse>> CollectFiles(string org, string repo, string branch, IReadOnlyList<RepositoryContent> items, Func<RepositoryContent, bool> filter)++ {++ try++ {++ var result = new List<FileResponse>();++ foreach (var item in items)++ {++ if (item.Type == ContentType.File && filter(item))++ {++ var content = await _httpClient.GetStringAsync(item.DownloadUrl);++ result.Add(new FileResponse++ {++ Name = item.Name,++ Content = content++ });++ }++ else if (item.Type == ContentType.Dir)++ {++ var subItems = await _ghClient.Repository.Content.GetAllContentsByRef(org, repo, item.Path, branch);++ result.AddRange(await CollectFiles(org, repo, branch, subItems, filter));++ }++ }++ return result;++ }++ catch (Exception ex)++ {++ _logger.LogError(ex, "Error collecting files");++ throw;++ }++ }++}++++public class FileResponse++{++ public string Name { get; set; }++ public string Content { get; set; }++}++++public interface IManageGithub++{++ Task<int> CreateIssue(string org, string repo, string input, string function, long parentNumber);++ Task CreatePR(string org, string repo, long number, string branch);++ Task CreateBranch(string org, string repo, string branch);++ Task CommitToBranch(string org, string repo, long parentNumber, long issueNumber, string rootDir, string branch);++++ Task PostComment(string org, string repo, long issueNumber, string comment);++ Task<IEnumerable<FileResponse>> GetFiles(string org, string repo, string branch, Func<RepositoryContent, bool> filter);++ Task<string> GetMainLanguage(string org, string repo);++}diff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Services/GithubWebHookProcessor.csindex 000000000,4cda39249..4cda39249mode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Services/GithubWebHookProcessor.cs+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/Services/GithubWebHookProcessor.csdiff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/appsettings.azure.template.jsonindex 000000000,b0dd8a805..5ba110351mode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/appsettings.azure.template.json+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/appsettings.azure.template.json@@@ -1,0 -1,46 +1,46 @@@-{- "Logging": {- "LogLevel": {- "Default": "Information",- "Microsoft.AspNetCore": "Information",- "Orleans.Streams": "Information"- }- },- "ApplicationInsights": {- "ConnectionString": ""- },- "AllowedHosts": "*",- "SANDBOX_IMAGE" : "mcr.microsoft.com/dotnet/sdk:7.0",- "GithubOptions" : {- "AppKey": "",- "AppId": "",- "InstallationId": "",- "WebhookSecret": ""- },- "AzureOptions" : {- "SubscriptionId":"",- "Location":"",- "ContainerInstancesResourceGroup":"",- "FilesShareName":"",- "FilesAccountName":"",- "FilesAccountKey":"",- "SandboxImage" : "mcr.microsoft.com/dotnet/sdk:7.0",- "ManagedIdentity": "",- "CosmosConnectionString":""- },- "OpenAIOptions" : {- "ServiceType":"AzureOpenAI",- "ServiceId":"gpt-4",- "DeploymentOrModelId":"gpt-4",- "EmbeddingDeploymentOrModelId":"text-embedding-ada-002",- "Endpoint":"",- "ApiKey":""- },- "QdrantOptions" : {- "Endpoint" : "http://qdrant:6333",- "VectorSize" : "1536"- },- "ServiceOptions" : {- "IngesterUrl" : "http://localhost:7071"- }-}++{++ "Logging": {++ "LogLevel": {++ "Default": "Information",++ "Microsoft.AspNetCore": "Information",++ "Orleans.Streams": "Information"++ }++ },++ "ApplicationInsights": {++ "ConnectionString": ""++ },++ "AllowedHosts": "*",++ "SANDBOX_IMAGE" : "mcr.microsoft.com/dotnet/sdk:7.0",++ "GithubOptions" : {++ "AppKey": "",++ "AppId": "",++ "InstallationId": "",++ "WebhookSecret": ""++ },++ "AzureOptions" : {++ "SubscriptionId":"",++ "Location":"",++ "ContainerInstancesResourceGroup":"",++ "FilesShareName":"",++ "FilesAccountName":"",++ "FilesAccountKey":"",++ "SandboxImage" : "mcr.microsoft.com/dotnet/sdk:7.0",++ "ManagedIdentity": "",++ "CosmosConnectionString":""++ },++ "OpenAIOptions" : {++ "ServiceType":"AzureOpenAI",++ "ServiceId":"gpt-4",++ "DeploymentOrModelId":"gpt-4",++ "EmbeddingDeploymentOrModelId":"text-embedding-ada-002",++ "Endpoint":"",++ "ApiKey":""++ },++ "QdrantOptions" : {++ "Endpoint" : "http://qdrant:6333",++ "VectorSize" : "1536"++ },++ "ServiceOptions" : {++ "IngesterUrl" : "http://localhost:7071"++ }++}diff --cc dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/appsettings.local.template.jsonindex 000000000,2fc698845..26563297amode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/appsettings.local.template.json+++ b/dotnet/samples/gh-flow/src/Microsoft.AI.DevTeam/appsettings.local.template.json@@@ -1,0 -1,45 +1,45 @@@-{- "Logging": {- "LogLevel": {- "Default": "Information",- "Microsoft.AspNetCore": "Information",- "Orleans.Streams": "Information"- }- },- "ApplicationInsights": {- "ConnectionString": ""- },- "AllowedHosts": "*",- "SANDBOX_IMAGE" : "mcr.microsoft.com/dotnet/sdk:7.0",- "GithubOptions" : {- "AppKey": "",- "AppId": "",- "InstallationId": "",- "WebhookSecret": ""- },- "AzureOptions" : {- "SubscriptionId":"",- "Location":"",- "ContainerInstancesResourceGroup":"",- "FilesShareName":"",- "FilesAccountName":"",- "FilesAccountKey":"",- "SandboxImage" : "mcr.microsoft.com/dotnet/sdk:7.0",- "ManagedIdentity": ""- },- "OpenAIOptions" : {- "ServiceType":"AzureOpenAI",- "ServiceId":"gpt-4",- "DeploymentOrModelId":"gpt-4",- "EmbeddingDeploymentOrModelId":"text-embedding-ada-002",- "Endpoint":"",- "ApiKey":""- },- "QdrantOptions" : {- "Endpoint" : "http://qdrant:6333",- "VectorSize" : "1536"- },- "ServiceOptions" : {- "IngesterUrl" : "http://localhost:7071"- }-}++{++ "Logging": {++ "LogLevel": {++ "Default": "Information",++ "Microsoft.AspNetCore": "Information",++ "Orleans.Streams": "Information"++ }++ },++ "ApplicationInsights": {++ "ConnectionString": ""++ },++ "AllowedHosts": "*",++ "SANDBOX_IMAGE" : "mcr.microsoft.com/dotnet/sdk:7.0",++ "GithubOptions" : {++ "AppKey": "",++ "AppId": "",++ "InstallationId": "",++ "WebhookSecret": ""++ },++ "AzureOptions" : {++ "SubscriptionId":"",++ "Location":"",++ "ContainerInstancesResourceGroup":"",++ "FilesShareName":"",++ "FilesAccountName":"",++ "FilesAccountKey":"",++ "SandboxImage" : "mcr.microsoft.com/dotnet/sdk:7.0",++ "ManagedIdentity": ""++ },++ "OpenAIOptions" : {++ "ServiceType":"AzureOpenAI",++ "ServiceId":"gpt-4",++ "DeploymentOrModelId":"gpt-4",++ "EmbeddingDeploymentOrModelId":"text-embedding-ada-002",++ "Endpoint":"",++ "ApiKey":""++ },++ "QdrantOptions" : {++ "Endpoint" : "http://qdrant:6333",++ "VectorSize" : "1536"++ },++ "ServiceOptions" : {++ "IngesterUrl" : "http://localhost:7071"++ }++}diff --cc dotnet/samples/gh-flow/src/seed-memory/Dockerfileindex 000000000,3de5d1359..dab5c94abmode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/seed-memory/Dockerfile+++ b/dotnet/samples/gh-flow/src/seed-memory/Dockerfile@@@ -1,0 -1,18 +1,18 @@@-FROM mcr.microsoft.com/dotnet/runtime:7.0 AS base-WORKDIR /app--FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build-WORKDIR /src-COPY ["util/seed-memory/seed-memory.csproj", "util/seed-memory/"]-RUN dotnet restore "util/seed-memory/seed-memory.csproj"-COPY . .-WORKDIR "/src/util/seed-memory"-RUN dotnet build "seed-memory.csproj" -c Release -o /app/build--FROM build AS publish-RUN dotnet publish "seed-memory.csproj" -c Release -o /app/publish /p:UseAppHost=false--FROM base AS final-WORKDIR /app-COPY --from=publish /app/publish .-ENTRYPOINT ["dotnet", "seed-memory.dll"]++FROM mcr.microsoft.com/dotnet/runtime:7.0 AS base++WORKDIR /app++++FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build++WORKDIR /src++COPY ["util/seed-memory/seed-memory.csproj", "util/seed-memory/"]++RUN dotnet restore "util/seed-memory/seed-memory.csproj"++COPY . .++WORKDIR "/src/util/seed-memory"++RUN dotnet build "seed-memory.csproj" -c Release -o /app/build++++FROM build AS publish++RUN dotnet publish "seed-memory.csproj" -c Release -o /app/publish /p:UseAppHost=false++++FROM base AS final++WORKDIR /app++COPY --from=publish /app/publish .++ENTRYPOINT ["dotnet", "seed-memory.dll"]diff --cc dotnet/samples/gh-flow/src/seed-memory/Program.csindex 000000000,af9fc428c..1a557aaafmode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/seed-memory/Program.cs+++ b/dotnet/samples/gh-flow/src/seed-memory/Program.cs@@@ -1,0 -1,57 +1,57 @@@-using System.Reflection;-using Microsoft.Extensions.Logging;-using Microsoft.SemanticKernel.Connectors.OpenAI;-using Microsoft.SemanticKernel.Connectors.Qdrant;-using Microsoft.SemanticKernel.Memory;-using UglyToad.PdfPig;-using UglyToad.PdfPig.DocumentLayoutAnalysis.TextExtractor;--class Program-{- static string WafFileName = "azure-well-architected.pdf";- static async Task Main(string[] args)- {- var kernelSettings = KernelSettings.LoadSettings();-- using ILoggerFactory loggerFactory = LoggerFactory.Create(builder =>- {- builder- .SetMinimumLevel(kernelSettings.LogLevel ?? LogLevel.Warning)- .AddConsole()- .AddDebug();- });-- var memoryBuilder = new MemoryBuilder();- var memory = memoryBuilder.WithLoggerFactory(loggerFactory)- .WithQdrantMemoryStore(kernelSettings.QdrantEndpoint, 1536)- .WithAzureOpenAITextEmbeddingGeneration(kernelSettings.EmbeddingDeploymentOrModelId,kernelSettings.Endpoint, kernelSettings.ApiKey)- .Build();-- await ImportDocumentAsync(memory, WafFileName);- }-- public static async Task ImportDocumentAsync(ISemanticTextMemory memory, string filename)- {- var currentDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);- var filePath = Path.Combine(currentDirectory, filename);- using var pdfDocument = PdfDocument.Open(File.OpenRead(filePath));- var pages = pdfDocument.GetPages();- foreach (var page in pages)- {- try- {- var text = ContentOrderTextExtractor.GetText(page);- var descr = text.Take(100);- await memory.SaveInformationAsync(- collection: "waf",- text: text,- id: $"{Guid.NewGuid()}",- description: $"Document: {descr}");- }- catch(Exception ex)- {- Console.WriteLine(ex.Message);- }- }- }++using System.Reflection;++using Microsoft.Extensions.Logging;++using Microsoft.SemanticKernel.Connectors.OpenAI;++using Microsoft.SemanticKernel.Connectors.Qdrant;++using Microsoft.SemanticKernel.Memory;++using UglyToad.PdfPig;++using UglyToad.PdfPig.DocumentLayoutAnalysis.TextExtractor;++++class Program++{++ static string WafFileName = "azure-well-architected.pdf";++ static async Task Main(string[] args)++ {++ var kernelSettings = KernelSettings.LoadSettings();++++ using ILoggerFactory loggerFactory = LoggerFactory.Create(builder =>++ {++ builder++ .SetMinimumLevel(kernelSettings.LogLevel ?? LogLevel.Warning)++ .AddConsole()++ .AddDebug();++ });++++ var memoryBuilder = new MemoryBuilder();++ var memory = memoryBuilder.WithLoggerFactory(loggerFactory)++ .WithQdrantMemoryStore(kernelSettings.QdrantEndpoint, 1536)++ .WithAzureOpenAITextEmbeddingGeneration(kernelSettings.EmbeddingDeploymentOrModelId,kernelSettings.Endpoint, kernelSettings.ApiKey)++ .Build();++++ await ImportDocumentAsync(memory, WafFileName);++ }++++ public static async Task ImportDocumentAsync(ISemanticTextMemory memory, string filename)++ {++ var currentDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);++ var filePath = Path.Combine(currentDirectory, filename);++ using var pdfDocument = PdfDocument.Open(File.OpenRead(filePath));++ var pages = pdfDocument.GetPages();++ foreach (var page in pages)++ {++ try++ {++ var text = ContentOrderTextExtractor.GetText(page);++ var descr = text.Take(100);++ await memory.SaveInformationAsync(++ collection: "waf",++ text: text,++ id: $"{Guid.NewGuid()}",++ description: $"Document: {descr}");++ }++ catch(Exception ex)++ {++ Console.WriteLine(ex.Message);++ }++ }++ }+ }diff --cc dotnet/samples/gh-flow/src/seed-memory/README.mdindex 000000000,f87f5c14c..f87f5c14cmode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/seed-memory/README.md+++ b/dotnet/samples/gh-flow/src/seed-memory/README.mddiff --cc dotnet/samples/gh-flow/src/seed-memory/azure-well-architected.pdfindex 000000000,25dfc501a..25dfc501amode 000000,100644..100644Binary files differdiff --cc dotnet/samples/gh-flow/src/seed-memory/config/KernelSettings.csindex 000000000,18f956f50..18f956f50mode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/seed-memory/config/KernelSettings.cs+++ b/dotnet/samples/gh-flow/src/seed-memory/config/KernelSettings.csdiff --cc dotnet/samples/gh-flow/src/seed-memory/config/appsettings.template.jsonindex 000000000,a25ebd41a..a25ebd41amode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/seed-memory/config/appsettings.template.json+++ b/dotnet/samples/gh-flow/src/seed-memory/config/appsettings.template.jsondiff --cc dotnet/samples/gh-flow/src/seed-memory/seed-memory.csprojindex 000000000,ec8d3327c..0b4a7046bmode 000000,100644..100644--- a/dotnet/samples/gh-flow/src/seed-memory/seed-memory.csproj+++ b/dotnet/samples/gh-flow/src/seed-memory/seed-memory.csproj@@@ -1,0 -1,30 +1,30 @@@-<Project Sdk="Microsoft.NET.Sdk">-- <PropertyGroup>- <OutputType>Exe</OutputType>- <TargetFramework>net8.0</TargetFramework>- <RootNamespace>waf_import</RootNamespace>- <ImplicitUsings>enable</ImplicitUsings>- <Nullable>enable</Nullable>- </PropertyGroup>-- <ItemGroup>- <PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />- <PackageReference Include="Microsoft.SemanticKernel" Version="1.10.0" />- <PackageReference Include="Microsoft.SemanticKernel.Connectors.Qdrant" Version="1.10.0-alpha" />- <PackageReference Include="Microsoft.SemanticKernel.Plugins.Memory" Version="1.10.0-alpha" />- <PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />- <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />- <PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="8.0.0" />- <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />- <PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />- <PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.0" />- <PackageReference Include="PdfPig" Version="0.1.9-alpha-20240324-e7896" />- </ItemGroup>-- <ItemGroup>- <None Update="azure-well-architected.pdf">- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>- </None>- </ItemGroup>-</Project>++<Project Sdk="Microsoft.NET.Sdk">++++ <PropertyGroup>++ <OutputType>Exe</OutputType>++ <TargetFramework>net8.0</TargetFramework>++ <RootNamespace>waf_import</RootNamespace>++ <ImplicitUsings>enable</ImplicitUsings>++ <Nullable>enable</Nullable>++ </PropertyGroup>++++ <ItemGroup>++ <PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />++ <PackageReference Include="Microsoft.SemanticKernel" Version="1.10.0" />++ <PackageReference Include="Microsoft.SemanticKernel.Connectors.Qdrant" Version="1.10.0-alpha" />++ <PackageReference Include="Microsoft.SemanticKernel.Plugins.Memory" Version="1.10.0-alpha" />++ <PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />++ <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />++ <PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="8.0.0" />++ <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />++ <PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />++ <PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.0" />++ <PackageReference Include="PdfPig" Version="0.1.9-alpha-20240324-e7896" />++ </ItemGroup>++++ <ItemGroup>++ <None Update="azure-well-architected.pdf">++ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>++ </None>++ </ItemGroup>++</Project>diff --cc dotnet/samples/marketing/.gitignoreindex 000000000,8e8438024..8e8438024mode 000000,100644..100644--- a/dotnet/samples/marketing/.gitignore+++ b/dotnet/samples/marketing/.gitignorediff --cc dotnet/samples/marketing/README.mdindex 000000000,37e9baaf6..37e9baaf6mode 000000,100644..100644--- a/dotnet/samples/marketing/README.md+++ b/dotnet/samples/marketing/README.mddiff --cc dotnet/samples/marketing/azure.yamlindex 000000000,5f5888574..5f5888574mode 000000,100644..100644--- a/dotnet/samples/marketing/azure.yaml+++ b/dotnet/samples/marketing/azure.yamldiff --cc dotnet/samples/marketing/infra/abbreviations.jsonindex 000000000,dc62141f9..dc62141f9mode 000000,100644..100644--- a/dotnet/samples/marketing/infra/abbreviations.json+++ b/dotnet/samples/marketing/infra/abbreviations.jsondiff --cc dotnet/samples/marketing/infra/app/backend.bicepindex 000000000,8f36a473a..8f36a473amode 000000,100644..100644--- a/dotnet/samples/marketing/infra/app/backend.bicep+++ b/dotnet/samples/marketing/infra/app/backend.bicepdiff --cc dotnet/samples/marketing/infra/app/frontend.bicepindex 000000000,a872c23cf..a872c23cfmode 000000,100644..100644--- a/dotnet/samples/marketing/infra/app/frontend.bicep+++ b/dotnet/samples/marketing/infra/app/frontend.bicepdiff --cc dotnet/samples/marketing/infra/main.bicepindex 000000000,578f9c120..578f9c120mode 000000,100644..100644--- a/dotnet/samples/marketing/infra/main.bicep+++ b/dotnet/samples/marketing/infra/main.bicepdiff --cc dotnet/samples/marketing/infra/main.parameters.jsonindex 000000000,c7fc26a4a..c7fc26a4amode 000000,100644..100644--- a/dotnet/samples/marketing/infra/main.parameters.json+++ b/dotnet/samples/marketing/infra/main.parameters.jsondiff --cc dotnet/samples/marketing/infra/modules/fetch-container-image.bicepindex 000000000,78d1e7eeb..78d1e7eebmode 000000,100644..100644--- a/dotnet/samples/marketing/infra/modules/fetch-container-image.bicep+++ b/dotnet/samples/marketing/infra/modules/fetch-container-image.bicepdiff --cc dotnet/samples/marketing/infra/shared/apps-env.bicepindex 000000000,030b82331..030b82331mode 000000,100644..100644--- a/dotnet/samples/marketing/infra/shared/apps-env.bicep+++ b/dotnet/samples/marketing/infra/shared/apps-env.bicepdiff --cc dotnet/samples/marketing/infra/shared/dashboard-web.bicepindex 000000000,eccce0dbf..eccce0dbfmode 000000,100644..100644--- a/dotnet/samples/marketing/infra/shared/dashboard-web.bicep+++ b/dotnet/samples/marketing/infra/shared/dashboard-web.bicepdiff --cc dotnet/samples/marketing/infra/shared/keyvault.bicepindex 000000000,f84f7508d..f84f7508dmode 000000,100644..100644--- a/dotnet/samples/marketing/infra/shared/keyvault.bicep+++ b/dotnet/samples/marketing/infra/shared/keyvault.bicepdiff --cc dotnet/samples/marketing/infra/shared/monitoring.bicepindex 000000000,4ae9796cc..4ae9796ccmode 000000,100644..100644--- a/dotnet/samples/marketing/infra/shared/monitoring.bicep+++ b/dotnet/samples/marketing/infra/shared/monitoring.bicepdiff --cc dotnet/samples/marketing/infra/shared/registry.bicepindex 000000000,d6629f862..d6629f862mode 000000,100644..100644--- a/dotnet/samples/marketing/infra/shared/registry.bicep+++ b/dotnet/samples/marketing/infra/shared/registry.bicepdiff --cc dotnet/samples/marketing/next-steps.mdindex 000000000,daae17078..daae17078mode 000000,100644..100644--- a/dotnet/samples/marketing/next-steps.md+++ b/dotnet/samples/marketing/next-steps.mddiff --cc dotnet/samples/marketing/readme-media/agents.pngindex 000000000,0eb6203c6..0eb6203c6mode 000000,100644..100644Binary files differdiff --cc dotnet/samples/marketing/readme-media/screenshot.pngindex 000000000,3829a5b21..3829a5b21mode 000000,100644..100644Binary files differdiff --cc dotnet/samples/marketing/run.ps1index 000000000,878d00456..878d00456mode 000000,100644..100644--- a/dotnet/samples/marketing/run.ps1+++ b/dotnet/samples/marketing/run.ps1diff --cc dotnet/samples/marketing/run.shindex 000000000,0052cf859..0052cf859mode 000000,100644..100644--- a/dotnet/samples/marketing/run.sh+++ b/dotnet/samples/marketing/run.shdiff --cc dotnet/samples/marketing/src/backend/.gitignoreindex 000000000,494561e81..494561e81mode 000000,100644..100644--- a/dotnet/samples/marketing/src/backend/.gitignore+++ b/dotnet/samples/marketing/src/backend/.gitignorediff --cc dotnet/samples/marketing/src/backend/Agents/CommunityManager/CommunityManager.csindex 000000000,cd2416bf1..cd2416bf1mode 000000,100644..100644--- a/dotnet/samples/marketing/src/backend/Agents/CommunityManager/CommunityManager.cs+++ b/dotnet/samples/marketing/src/backend/Agents/CommunityManager/CommunityManager.csdiff --cc dotnet/samples/marketing/src/backend/Agents/CommunityManager/CommunityManagerPrompts.csindex 000000000,74365103a..74365103amode 000000,100644..100644--- a/dotnet/samples/marketing/src/backend/Agents/CommunityManager/CommunityManagerPrompts.cs+++ b/dotnet/samples/marketing/src/backend/Agents/CommunityManager/CommunityManagerPrompts.csdiff --cc dotnet/samples/marketing/src/backend/Agents/CommunityManager/CommunityManagerState.csindex 000000000,baed2a973..baed2a973mode 000000,100644..100644--- a/dotnet/samples/marketing/src/backend/Agents/CommunityManager/CommunityManagerState.cs+++ b/dotnet/samples/marketing/src/backend/Agents/CommunityManager/CommunityManagerState.csdiff --cc dotnet/samples/marketing/src/backend/Agents/GraphicDesigner/GraphicDesignedState.csindex 000000000,3add06873..3add06873mode 000000,100644..100644--- a/dotnet/samples/marketing/src/backend/Agents/GraphicDesigner/GraphicDesignedState.cs+++ b/dotnet/samples/marketing/src/backend/Agents/GraphicDesigner/GraphicDesignedState.csdiff --cc dotnet/samples/marketing/src/backend/Agents/GraphicDesigner/GraphicDesigner.csindex 000000000,8830f6d26..8830f6d26mode 000000,100644..100644--- a/dotnet/samples/marketing/src/backend/Agents/GraphicDesigner/GraphicDesigner.cs+++ b/dotnet/samples/marketing/src/backend/Agents/GraphicDesigner/GraphicDesigner.csdiff --cc dotnet/samples/marketing/src/backend/Agents/GraphicDesigner/GraphicDesignerPrompts.csindex 000000000,d17cf5f72..d17cf5f72mode 000000,100644..100644--- a/dotnet/samples/marketing/src/backend/Agents/GraphicDesigner/GraphicDesignerPrompts.cs+++ b/dotnet/samples/marketing/src/backend/Agents/GraphicDesigner/GraphicDesignerPrompts.csdiff --cc dotnet/samples/marketing/src/backend/Agents/SignalR/SignalR.csindex 000000000,8d4ee4ea9..8d4ee4ea9mode 000000,100644..100644--- a/dotnet/samples/marketing/src/backend/Agents/SignalR/SignalR.cs+++ b/dotnet/samples/marketing/src/backend/Agents/SignalR/SignalR.csdiff --cc dotnet/samples/marketing/src/backend/Agents/Writer/IWritter.csindex 000000000,63174839a..63174839amode 000000,100644..100644--- a/dotnet/samples/marketing/src/backend/Agents/Writer/IWritter.cs+++ b/dotnet/samples/marketing/src/backend/Agents/Writer/IWritter.csdiff --cc dotnet/samples/marketing/src/backend/Agents/Writer/Writer.csindex 000000000,ba13b1515..ba13b1515mode 000000,100644..100644--- a/dotnet/samples/marketing/src/backend/Agents/Writer/Writer.cs+++ b/dotnet/samples/marketing/src/backend/Agents/Writer/Writer.csdiff --cc dotnet/samples/marketing/src/backend/Agents/Writer/WriterPrompts.csindex 000000000,a3c54c936..a3c54c936mode 000000,100644..100644--- a/dotnet/samples/marketing/src/backend/Agents/Writer/WriterPrompts.cs+++ b/dotnet/samples/marketing/src/backend/Agents/Writer/WriterPrompts.csdiff --cc dotnet/samples/marketing/src/backend/Agents/Writer/WriterState.csindex 000000000,33f77d53b..33f77d53bmode 000000,100644..100644--- a/dotnet/samples/marketing/src/backend/Agents/Writer/WriterState.cs+++ b/dotnet/samples/marketing/src/backend/Agents/Writer/WriterState.csdiff --cc dotnet/samples/marketing/src/backend/Controller/Articles.csindex 000000000,78cd09fc3..78cd09fc3mode 000000,100644..100644--- a/dotnet/samples/marketing/src/backend/Controller/Articles.cs+++ b/dotnet/samples/marketing/src/backend/Controller/Articles.csdiff --cc dotnet/samples/marketing/src/backend/Dockerfileindex 000000000,c5a504512..c5a504512mode 000000,100644..100644--- a/dotnet/samples/marketing/src/backend/Dockerfile+++ b/dotnet/samples/marketing/src/backend/Dockerfilediff --cc dotnet/samples/marketing/src/backend/Events/EventTypes.csindex 000000000,1a645ad6a..1a645ad6amode 000000,100644..100644--- a/dotnet/samples/marketing/src/backend/Events/EventTypes.cs+++ b/dotnet/samples/marketing/src/backend/Events/EventTypes.csdiff --cc dotnet/samples/marketing/src/backend/Marketing.csprojindex 000000000,50c4ea535..e3c1366c1mode 000000,100644..100644--- a/dotnet/samples/marketing/src/backend/Marketing.csproj+++ b/dotnet/samples/marketing/src/backend/Marketing.csproj@@@ -1,0 -1,59 +1,59 @@@+ <Project Sdk="Microsoft.NET.Sdk.Web">++ <ItemGroup>+ <Compile Remove="Services\**" />+ <Content Remove="Services\**" />+ <EmbeddedResource Remove="Services\**" />+ <None Remove="Services\**" />+ </ItemGroup>+- <ItemGroup>- <ProjectReference Include="..\..\..\..\src\Microsoft.AI.Agents.Orleans\Microsoft.AI.Agents.Orleans.csproj" />- </ItemGroup>-+ <PropertyGroup>+ <TargetFramework>net8.0</TargetFramework>+ <Nullable>enable</Nullable>+ <ImplicitUsings>enable</ImplicitUsings>+ <ServerGarbageCollection>true</ServerGarbageCollection>+ <ConcurrentGarbageCollection>true</ConcurrentGarbageCollection>+ <UserSecretsId>c073c86e-8483-4956-942f-331fd09172d4</UserSecretsId>+ <AnalysisMode>All</AnalysisMode>+ </PropertyGroup>++ <ItemGroup>+ <PackageReference Include="Octokit.Webhooks.AspNetCore" Version="2.1.1" />+ <PackageReference Include="Octokit" Version="11.0.1" />++ <PackageReference Include="Microsoft.SemanticKernel" Version="1.10.0" />+ <PackageReference Include="Microsoft.SemanticKernel.Connectors.Qdrant" Version="1.10.0-alpha" />+ <PackageReference Include="Microsoft.SemanticKernel.Plugins.Memory" Version="1.10.0-alpha" />++ <PackageReference Include="Microsoft.Orleans.Server" Version="8.1.0" />+ <PackageReference Include="Microsoft.Orleans.Sdk" Version="8.1.0" />+ <PackageReference Include="Microsoft.Orleans.Runtime" Version="8.1.0" />+ <PackageReference Include="Microsoft.Orleans.Persistence.Cosmos" Version="8.1.0" />+ <PackageReference Include="Microsoft.Orleans.Clustering.Cosmos" Version="8.1.0" />+ <PackageReference Include="Microsoft.Orleans.Reminders.Cosmos" Version="8.1.0" />+ <PackageReference Include="Microsoft.Orleans.Streaming.EventHubs" Version="8.1.0" />+ <PackageReference Include="Microsoft.Orleans.Reminders" Version="8.1.0" />+ <PackageReference Include="Microsoft.Orleans.Streaming" Version="8.1.0" />+ <PackageReference Include="OrleansDashboard" Version="8.0.0" />++ <PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.22.0" />+ <PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />++ <PackageReference Include="Microsoft.Extensions.Azure" Version="1.7.3" />+ <PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="9.0.0-preview.3.24209.3" />+ <PackageReference Include="Azure.ResourceManager.ContainerInstance" Version="1.2.1" />+ <PackageReference Include="Azure.Storage.Files.Shares" Version="12.18.0-beta.2" />+ <PackageReference Include="Azure.Data.Tables" Version="12.8.3" />+ <PackageReference Include="Azure.Identity" Version="1.12.0-beta.1" />++ <PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="7.5.1" />+++ </ItemGroup>++++ <ItemGroup>++ <ProjectReference Include="..\..\..\..\..\csharp\src\Microsoft.AI.Agents.Orleans\Microsoft.AI.Agents.Orleans.csproj" />++ </ItemGroup>+++ </Project>diff --cc dotnet/samples/marketing/src/backend/Marketing.slnindex 000000000,032e60cf4..032e60cf4mode 000000,100644..100644--- a/dotnet/samples/marketing/src/backend/Marketing.sln+++ b/dotnet/samples/marketing/src/backend/Marketing.slndiff --cc dotnet/samples/marketing/src/backend/Options/Consts.csindex 000000000,7effc35f6..7effc35f6mode 000000,100644..100644--- a/dotnet/samples/marketing/src/backend/Options/Consts.cs+++ b/dotnet/samples/marketing/src/backend/Options/Consts.csdiff --cc dotnet/samples/marketing/src/backend/Options/OpenAIOptions.csindex 000000000,1c336855e..1c336855emode 000000,100644..100644--- a/dotnet/samples/marketing/src/backend/Options/OpenAIOptions.cs+++ b/dotnet/samples/marketing/src/backend/Options/OpenAIOptions.csdiff --cc dotnet/samples/marketing/src/backend/Options/QdrantOptions.csindex 000000000,ac1549875..ac1549875mode 000000,100644..100644--- a/dotnet/samples/marketing/src/backend/Options/QdrantOptions.cs+++ b/dotnet/samples/marketing/src/backend/Options/QdrantOptions.csdiff --cc dotnet/samples/marketing/src/backend/Options/Throw.csindex 000000000,ff6d672c8..ff6d672c8mode 000000,100644..100644--- a/dotnet/samples/marketing/src/backend/Options/Throw.cs+++ b/dotnet/samples/marketing/src/backend/Options/Throw.csdiff --cc dotnet/samples/marketing/src/backend/Program.csindex 000000000,2bba0d21a..2bba0d21amode 000000,100644..100644--- a/dotnet/samples/marketing/src/backend/Program.cs+++ b/dotnet/samples/marketing/src/backend/Program.csdiff --cc dotnet/samples/marketing/src/backend/Properties/launchSettings.jsonindex 000000000,d7d94b581..d7d94b581mode 000000,100644..100644--- a/dotnet/samples/marketing/src/backend/Properties/launchSettings.json+++ b/dotnet/samples/marketing/src/backend/Properties/launchSettings.jsondiff --cc dotnet/samples/marketing/src/backend/SignalRHub/AgentTypes.csindex 000000000,0591f59ec..0591f59ecmode 000000,100644..100644--- a/dotnet/samples/marketing/src/backend/SignalRHub/AgentTypes.cs+++ b/dotnet/samples/marketing/src/backend/SignalRHub/AgentTypes.csdiff --cc dotnet/samples/marketing/src/backend/SignalRHub/ArticleHub.csindex 000000000,f60876a2a..f60876a2amode 000000,100644..100644--- a/dotnet/samples/marketing/src/backend/SignalRHub/ArticleHub.cs+++ b/dotnet/samples/marketing/src/backend/SignalRHub/ArticleHub.csdiff --cc dotnet/samples/marketing/src/backend/SignalRHub/FrontEndMessage.csindex 000000000,7e1debaa7..7e1debaa7mode 000000,100644..100644--- a/dotnet/samples/marketing/src/backend/SignalRHub/FrontEndMessage.cs+++ b/dotnet/samples/marketing/src/backend/SignalRHub/FrontEndMessage.csdiff --cc dotnet/samples/marketing/src/backend/SignalRHub/IArticleHub.csindex 000000000,a9d8a4bb8..a9d8a4bb8mode 000000,100644..100644--- a/dotnet/samples/marketing/src/backend/SignalRHub/IArticleHub.cs+++ b/dotnet/samples/marketing/src/backend/SignalRHub/IArticleHub.csdiff --cc dotnet/samples/marketing/src/backend/SignalRHub/ISignalRService.csindex 000000000,7207e6df7..7207e6df7mode 000000,100644..100644--- a/dotnet/samples/marketing/src/backend/SignalRHub/ISignalRService.cs+++ b/dotnet/samples/marketing/src/backend/SignalRHub/ISignalRService.csdiff --cc dotnet/samples/marketing/src/backend/SignalRHub/SignalRConnectionsDB.csindex 000000000,172e8959a..172e8959amode 000000,100644..100644--- a/dotnet/samples/marketing/src/backend/SignalRHub/SignalRConnectionsDB.cs+++ b/dotnet/samples/marketing/src/backend/SignalRHub/SignalRConnectionsDB.csdiff --cc dotnet/samples/marketing/src/backend/SignalRHub/SignalRService.csindex 000000000,b1b771afc..b1b771afcmode 000000,100644..100644--- a/dotnet/samples/marketing/src/backend/SignalRHub/SignalRService.cs+++ b/dotnet/samples/marketing/src/backend/SignalRHub/SignalRService.csdiff --cc dotnet/samples/marketing/src/backend/appsettings.local.template.jsonindex 000000000,68a8effeb..68a8effebmode 000000,100644..100644--- a/dotnet/samples/marketing/src/backend/appsettings.local.template.json+++ b/dotnet/samples/marketing/src/backend/appsettings.local.template.jsondiff --cc dotnet/samples/marketing/src/frontend/.eslintrc.jsonindex 000000000,bffb357a7..bffb357a7mode 000000,100644..100644--- a/dotnet/samples/marketing/src/frontend/.eslintrc.json+++ b/dotnet/samples/marketing/src/frontend/.eslintrc.jsondiff --cc dotnet/samples/marketing/src/frontend/.gitignoreindex 000000000,6055b81e8..6055b81e8mode 000000,100644..100644--- a/dotnet/samples/marketing/src/frontend/.gitignore+++ b/dotnet/samples/marketing/src/frontend/.gitignorediff --cc dotnet/samples/marketing/src/frontend/.npmrcindex 000000000,5aec3916e..5aec3916emode 000000,100644..100644--- a/dotnet/samples/marketing/src/frontend/.npmrc+++ b/dotnet/samples/marketing/src/frontend/.npmrcdiff --cc dotnet/samples/marketing/src/frontend/Dockerfileindex 000000000,8fa873779..8fa873779mode 000000,100644..100644--- a/dotnet/samples/marketing/src/frontend/Dockerfile+++ b/dotnet/samples/marketing/src/frontend/Dockerfilediff --cc dotnet/samples/marketing/src/frontend/README.MDindex 000000000,79065783d..79065783dmode 000000,100644..100644--- a/dotnet/samples/marketing/src/frontend/README.MD+++ b/dotnet/samples/marketing/src/frontend/README.MDdiff --cc dotnet/samples/marketing/src/frontend/next.config.mjsindex 000000000,338e10b53..338e10b53mode 000000,100644..100644--- a/dotnet/samples/marketing/src/frontend/next.config.mjs+++ b/dotnet/samples/marketing/src/frontend/next.config.mjsdiff --cc dotnet/samples/marketing/src/frontend/package-lock.jsonindex 000000000,c281c7f99..c281c7f99mode 000000,100644..100644--- a/dotnet/samples/marketing/src/frontend/package-lock.json+++ b/dotnet/samples/marketing/src/frontend/package-lock.jsondiff --cc dotnet/samples/marketing/src/frontend/package.jsonindex 000000000,49b2bf6c0..49b2bf6c0mode 000000,100644..100644--- a/dotnet/samples/marketing/src/frontend/package.json+++ b/dotnet/samples/marketing/src/frontend/package.jsondiff --cc dotnet/samples/marketing/src/frontend/public/static/background1.webpindex 000000000,21226ba76..21226ba76mode 000000,100644..100644Binary files differdiff --cc dotnet/samples/marketing/src/frontend/public/static/check.pngindex 000000000,33965edb3..33965edb3mode 000000,100644..100644Binary files differdiff --cc dotnet/samples/marketing/src/frontend/public/static/face.jpgindex 000000000,a054f2e68..a054f2e68mode 000000,100644..100644Binary files differdiff --cc dotnet/samples/marketing/src/frontend/public/static/face2.jpgindex 000000000,20e994fb0..20e994fb0mode 000000,100644..100644Binary files differdiff --cc dotnet/samples/marketing/src/frontend/public/static/icons/docs.pngindex 000000000,b070e21dc..b070e21dcmode 000000,100644..100644Binary files differdiff --cc dotnet/samples/marketing/src/frontend/public/static/icons/edge.pngindex 000000000,eb345a753..eb345a753mode 000000,100644..100644Binary files differdiff --cc dotnet/samples/marketing/src/frontend/public/static/icons/pdf.pngindex 000000000,91160940e..91160940emode 000000,100644..100644Binary files differdiff --cc dotnet/samples/marketing/src/frontend/public/static/icons/xslx.pngindex 000000000,c3463f3d0..c3463f3d0mode 000000,100644..100644Binary files differdiff --cc dotnet/samples/marketing/src/frontend/public/static/x.pngindex 000000000,a7dfd8ef0..a7dfd8ef0mode 000000,100644..100644Binary files differdiff --cc dotnet/samples/marketing/src/frontend/src/app/forgot-password/page.tsxindex 000000000,72d4dbc0f..72d4dbc0fmode 000000,100644..100644--- a/dotnet/samples/marketing/src/frontend/src/app/forgot-password/page.tsx+++ b/dotnet/samples/marketing/src/frontend/src/app/forgot-password/page.tsxdiff --cc dotnet/samples/marketing/src/frontend/src/app/icon.icoindex 000000000,a3df394d6..a3df394d6mode 000000,100644..100644Binary files differdiff --cc dotnet/samples/marketing/src/frontend/src/app/layout.tsxindex 000000000,bb8334585..bb8334585mode 000000,100644..100644--- a/dotnet/samples/marketing/src/frontend/src/app/layout.tsx+++ b/dotnet/samples/marketing/src/frontend/src/app/layout.tsxdiff --cc dotnet/samples/marketing/src/frontend/src/app/login/page.tsxindex 000000000,cfe99c572..cfe99c572mode 000000,100644..100644--- a/dotnet/samples/marketing/src/frontend/src/app/login/page.tsx+++ b/dotnet/samples/marketing/src/frontend/src/app/login/page.tsxdiff --cc dotnet/samples/marketing/src/frontend/src/app/marketing/chat/chat.tsxindex 000000000,e8c99aead..e8c99aeadmode 000000,100644..100644--- a/dotnet/samples/marketing/src/frontend/src/app/marketing/chat/chat.tsx+++ b/dotnet/samples/marketing/src/frontend/src/app/marketing/chat/chat.tsxdiff --cc dotnet/samples/marketing/src/frontend/src/app/marketing/community-manager/community-manager.tsxindex 000000000,aa617fa5c..aa617fa5cmode 000000,100644..100644--- a/dotnet/samples/marketing/src/frontend/src/app/marketing/community-manager/community-manager.tsx+++ b/dotnet/samples/marketing/src/frontend/src/app/marketing/community-manager/community-manager.tsxdiff --cc dotnet/samples/marketing/src/frontend/src/app/marketing/costs/cost.tsxindex 000000000,4d1dec526..4d1dec526mode 000000,100644..100644--- a/dotnet/samples/marketing/src/frontend/src/app/marketing/costs/cost.tsx+++ b/dotnet/samples/marketing/src/frontend/src/app/marketing/costs/cost.tsxdiff --cc dotnet/samples/marketing/src/frontend/src/app/marketing/docs/docs.tsxindex 000000000,77d158331..77d158331mode 000000,100644..100644--- a/dotnet/samples/marketing/src/frontend/src/app/marketing/docs/docs.tsx+++ b/dotnet/samples/marketing/src/frontend/src/app/marketing/docs/docs.tsxdiff --cc dotnet/samples/marketing/src/frontend/src/app/marketing/page.tsxindex 000000000,c0b441f52..c0b441f52mode 000000,100644..100644--- a/dotnet/samples/marketing/src/frontend/src/app/marketing/page.tsx+++ b/dotnet/samples/marketing/src/frontend/src/app/marketing/page.tsxdiff --cc dotnet/samples/marketing/src/frontend/src/app/marketing/stakeholders/stakeholders.tsxindex 000000000,db2e75b8c..db2e75b8cmode 000000,100644..100644--- a/dotnet/samples/marketing/src/frontend/src/app/marketing/stakeholders/stakeholders.tsx+++ b/dotnet/samples/marketing/src/frontend/src/app/marketing/stakeholders/stakeholders.tsxdiff --cc dotnet/samples/marketing/src/frontend/src/app/not-found.tsxindex 000000000,58d73059d..58d73059dmode 000000,100644..100644--- a/dotnet/samples/marketing/src/frontend/src/app/not-found.tsx+++ b/dotnet/samples/marketing/src/frontend/src/app/not-found.tsxdiff --cc dotnet/samples/marketing/src/frontend/src/app/page.tsxindex 000000000,465054461..465054461mode 000000,100644..100644--- a/dotnet/samples/marketing/src/frontend/src/app/page.tsx+++ b/dotnet/samples/marketing/src/frontend/src/app/page.tsxdiff --cc dotnet/samples/marketing/src/frontend/src/app/register/page.tsxindex 000000000,bf26b7c12..bf26b7c12mode 000000,100644..100644--- a/dotnet/samples/marketing/src/frontend/src/app/register/page.tsx+++ b/dotnet/samples/marketing/src/frontend/src/app/register/page.tsxdiff --cc dotnet/samples/marketing/src/frontend/src/components/auth-page/index.tsxindex 000000000,76e46cced..76e46ccedmode 000000,100644..100644--- a/dotnet/samples/marketing/src/frontend/src/components/auth-page/index.tsx+++ b/dotnet/samples/marketing/src/frontend/src/components/auth-page/index.tsxdiff --cc dotnet/samples/marketing/src/frontend/src/components/header/index.tsxindex 000000000,ad6c003ab..ad6c003abmode 000000,100644..100644--- a/dotnet/samples/marketing/src/frontend/src/components/header/index.tsx+++ b/dotnet/samples/marketing/src/frontend/src/components/header/index.tsxdiff --cc dotnet/samples/marketing/src/frontend/src/components/themed-layout/index.tsxindex 000000000,bed034869..bed034869mode 000000,100644..100644--- a/dotnet/samples/marketing/src/frontend/src/components/themed-layout/index.tsx+++ b/dotnet/samples/marketing/src/frontend/src/components/themed-layout/index.tsxdiff --cc dotnet/samples/marketing/src/frontend/src/contexts/color-mode/index.tsxindex 000000000,f064de7b8..f064de7b8mode 000000,100644..100644--- a/dotnet/samples/marketing/src/frontend/src/contexts/color-mode/index.tsx+++ b/dotnet/samples/marketing/src/frontend/src/contexts/color-mode/index.tsxdiff --cc dotnet/samples/marketing/src/frontend/src/interfaces/theme.d.tsindex 000000000,9819aac10..9819aac10mode 000000,100644..100644--- a/dotnet/samples/marketing/src/frontend/src/interfaces/theme.d.ts+++ b/dotnet/samples/marketing/src/frontend/src/interfaces/theme.d.tsdiff --cc dotnet/samples/marketing/src/frontend/src/providers/auth-provider/auth-provider.server.tsindex 000000000,5f1f97431..5f1f97431mode 000000,100644..100644--- a/dotnet/samples/marketing/src/frontend/src/providers/auth-provider/auth-provider.server.ts+++ b/dotnet/samples/marketing/src/frontend/src/providers/auth-provider/auth-provider.server.tsdiff --cc dotnet/samples/marketing/src/frontend/src/providers/auth-provider/auth-provider.tsindex 000000000,2f626b2b4..2f626b2b4mode 000000,100644..100644--- a/dotnet/samples/marketing/src/frontend/src/providers/auth-provider/auth-provider.ts+++ b/dotnet/samples/marketing/src/frontend/src/providers/auth-provider/auth-provider.tsdiff --cc dotnet/samples/marketing/src/frontend/src/providers/auth-provider/index.tsindex 000000000,6734cd53b..6734cd53bmode 000000,100644..100644--- a/dotnet/samples/marketing/src/frontend/src/providers/auth-provider/index.ts+++ b/dotnet/samples/marketing/src/frontend/src/providers/auth-provider/index.tsdiff --cc dotnet/samples/marketing/src/frontend/src/providers/data-provider/index.tsindex 000000000,a049c0e10..a049c0e10mode 000000,100644..100644--- a/dotnet/samples/marketing/src/frontend/src/providers/data-provider/index.ts+++ b/dotnet/samples/marketing/src/frontend/src/providers/data-provider/index.tsdiff --cc dotnet/samples/marketing/src/frontend/src/providers/devtools/index.tsxindex 000000000,e039bf9dc..e039bf9dcmode 000000,100644..100644--- a/dotnet/samples/marketing/src/frontend/src/providers/devtools/index.tsx+++ b/dotnet/samples/marketing/src/frontend/src/providers/devtools/index.tsxdiff --cc dotnet/samples/marketing/src/frontend/tsconfig.jsonindex 000000000,ebdf6714c..ebdf6714cmode 000000,100644..100644--- a/dotnet/samples/marketing/src/frontend/tsconfig.json+++ b/dotnet/samples/marketing/src/frontend/tsconfig.jsondiff --cc dotnet/src/Microsoft.AI.Agents.Dapr/Agent.csindex 000000000,104bd0ed9..8d6d26f28mode 000000,100644..100644--- a/dotnet/src/Microsoft.AI.Agents.Dapr/Agent.cs+++ b/dotnet/src/Microsoft.AI.Agents.Dapr/Agent.cs@@@ -1,0 -1,27 +1,27 @@@-using Dapr.Actors.Runtime;-using Dapr.Client;-using Microsoft.AI.Agents.Abstractions;--namespace Microsoft.AI.Agents.Dapr;--public abstract class Agent : Actor, IAgent-{- private readonly DaprClient daprClient;-- protected Agent(ActorHost host, DaprClient daprClient) : base(host)- {- this.daprClient = daprClient;- }- public abstract Task HandleEvent(Event item);-- public async Task PublishEvent(string ns, string id, Event item)- {- var metadata = new Dictionary<string, string>() {- { "cloudevent.Type", item.Type },- { "cloudevent.Subject", item.Subject },- { "cloudevent.id", Guid.NewGuid().ToString()}- };-- await daprClient.PublishEventAsync(ns, id, item, metadata);- }-}++using Dapr.Actors.Runtime;++using Dapr.Client;++using Microsoft.AI.Agents.Abstractions;++++namespace Microsoft.AI.Agents.Dapr;++++public abstract class Agent : Actor, IAgent++{++ private readonly DaprClient daprClient;++++ protected Agent(ActorHost host, DaprClient daprClient) : base(host)++ {++ this.daprClient = daprClient;++ }++ public abstract Task HandleEvent(Event item);++++ public async Task PublishEvent(string ns, string id, Event item)++ {++ var metadata = new Dictionary<string, string>() {++ { "cloudevent.Type", item.Type },++ { "cloudevent.Subject", item.Subject },++ { "cloudevent.id", Guid.NewGuid().ToString()}++ };++++ await daprClient.PublishEventAsync(ns, id, item, metadata);++ }++}diff --cc dotnet/src/Microsoft.AI.Agents.Dapr/AiAgent.csindex 000000000,1537defb7..1537defb7mode 000000,100644..100644--- a/dotnet/src/Microsoft.AI.Agents.Dapr/AiAgent.cs+++ b/dotnet/src/Microsoft.AI.Agents.Dapr/AiAgent.csdiff --cc dotnet/src/Microsoft.AI.Agents.Dapr/IDaprAgent.csindex 000000000,228359fc6..228359fc6mode 000000,100644..100644--- a/dotnet/src/Microsoft.AI.Agents.Dapr/IDaprAgent.cs+++ b/dotnet/src/Microsoft.AI.Agents.Dapr/IDaprAgent.csdiff --cc dotnet/src/Microsoft.AI.Agents.Dapr/Microsoft.AI.Agents.Dapr.csprojindex 000000000,ed1eed20b..6e1d44f47mode 000000,100644..100644--- a/dotnet/src/Microsoft.AI.Agents.Dapr/Microsoft.AI.Agents.Dapr.csproj+++ b/dotnet/src/Microsoft.AI.Agents.Dapr/Microsoft.AI.Agents.Dapr.csproj@@@ -1,0 -1,18 +1,18 @@@-<Project Sdk="Microsoft.NET.Sdk">-- <PropertyGroup>- <TargetFramework>net8.0</TargetFramework>- <ImplicitUsings>enable</ImplicitUsings>- <Nullable>enable</Nullable>- </PropertyGroup>-- <ItemGroup>- <PackageReference Include="Dapr.Client" Version="1.13.0" />- <PackageReference Include="Dapr.Actors" Version="1.13.0" />- </ItemGroup>-- <ItemGroup>- <ProjectReference Include="..\Microsoft.AI.Agents\Microsoft.AI.Agents.csproj" />- </ItemGroup>--</Project>++<Project Sdk="Microsoft.NET.Sdk">++++ <PropertyGroup>++ <TargetFramework>net8.0</TargetFramework>++ <ImplicitUsings>enable</ImplicitUsings>++ <Nullable>enable</Nullable>++ </PropertyGroup>++++ <ItemGroup>++ <PackageReference Include="Dapr.Client" Version="1.13.0" />++ <PackageReference Include="Dapr.Actors" Version="1.13.0" />++ </ItemGroup>++++ <ItemGroup>++ <ProjectReference Include="..\Microsoft.AI.Agents\Microsoft.AI.Agents.csproj" />++ </ItemGroup>++++</Project>diff --cc dotnet/src/Microsoft.AI.Agents.Orleans/Agent.csindex 000000000,47da5755c..48fd318ffmode 000000,100644..100644--- a/dotnet/src/Microsoft.AI.Agents.Orleans/Agent.cs+++ b/dotnet/src/Microsoft.AI.Agents.Orleans/Agent.cs@@@ -1,0 -1,32 +1,32 @@@-using Microsoft.AI.Agents.Abstractions;-using Orleans.Runtime;-using Orleans.Streams;--namespace Microsoft.AI.Agents.Orleans;--public abstract class Agent : Grain, IGrainWithStringKey, IAgent-{- protected virtual string Namespace { get;set;}- public abstract Task HandleEvent(Event item);-- private async Task HandleEvent(Event item, StreamSequenceToken? token)- {- await HandleEvent(item);- }-- public async Task PublishEvent(string ns, string id, Event item)- {- var streamProvider = this.GetStreamProvider("StreamProvider");- var streamId = StreamId.Create(ns, id);- var stream = streamProvider.GetStream<Event>(streamId);- await stream.OnNextAsync(item);- }-- public async override Task OnActivateAsync(CancellationToken cancellationToken)- {- var streamProvider = this.GetStreamProvider("StreamProvider");- var streamId = StreamId.Create(Namespace, this.GetPrimaryKeyString());- var stream = streamProvider.GetStream<Event>(streamId);- await stream.SubscribeAsync(HandleEvent);- }-}++using Microsoft.AI.Agents.Abstractions;++using Orleans.Runtime;++using Orleans.Streams;++++namespace Microsoft.AI.Agents.Orleans;++++public abstract class Agent : Grain, IGrainWithStringKey, IAgent++{++ protected virtual string Namespace { get;set;}++ public abstract Task HandleEvent(Event item);++++ private async Task HandleEvent(Event item, StreamSequenceToken? token)++ {++ await HandleEvent(item);++ }++++ public async Task PublishEvent(string ns, string id, Event item)++ {++ var streamProvider = this.GetStreamProvider("StreamProvider");++ var streamId = StreamId.Create(ns, id);++ var stream = streamProvider.GetStream<Event>(streamId);++ await stream.OnNextAsync(item);++ }++++ public async override Task OnActivateAsync(CancellationToken cancellationToken)++ {++ var streamProvider = this.GetStreamProvider("StreamProvider");++ var streamId = StreamId.Create(Namespace, this.GetPrimaryKeyString());++ var stream = streamProvider.GetStream<Event>(streamId);++ await stream.SubscribeAsync(HandleEvent);++ }++}diff --cc dotnet/src/Microsoft.AI.Agents.Orleans/AiAgent.csindex 000000000,6d7294c60..6d7294c60mode 000000,100644..100644--- a/dotnet/src/Microsoft.AI.Agents.Orleans/AiAgent.cs+++ b/dotnet/src/Microsoft.AI.Agents.Orleans/AiAgent.csdiff --cc dotnet/src/Microsoft.AI.Agents.Orleans/EventSurrogate.csindex 000000000,451cd3391..451cd3391mode 000000,100644..100644--- a/dotnet/src/Microsoft.AI.Agents.Orleans/EventSurrogate.cs+++ b/dotnet/src/Microsoft.AI.Agents.Orleans/EventSurrogate.csdiff --cc dotnet/src/Microsoft.AI.Agents.Orleans/Microsoft.AI.Agents.Orleans.csprojindex 000000000,0d585cf2b..ce6deabf4mode 000000,100644..100644--- a/dotnet/src/Microsoft.AI.Agents.Orleans/Microsoft.AI.Agents.Orleans.csproj+++ b/dotnet/src/Microsoft.AI.Agents.Orleans/Microsoft.AI.Agents.Orleans.csproj@@@ -1,0 -1,15 +1,15 @@@-<Project Sdk="Microsoft.NET.Sdk">-- <PropertyGroup>- <TargetFramework>net8.0</TargetFramework>- <ImplicitUsings>enable</ImplicitUsings>- <Nullable>enable</Nullable>- </PropertyGroup>-- <ItemGroup>- <PackageReference Include="Microsoft.Orleans.Sdk" Version="8.1.0" />- <PackageReference Include="Microsoft.Orleans.Streaming" Version="8.1.0" />- <ProjectReference Include="..\Microsoft.AI.Agents\Microsoft.AI.Agents.csproj" />- </ItemGroup>--</Project>++<Project Sdk="Microsoft.NET.Sdk">++++ <PropertyGroup>++ <TargetFramework>net8.0</TargetFramework>++ <ImplicitUsings>enable</ImplicitUsings>++ <Nullable>enable</Nullable>++ </PropertyGroup>++++ <ItemGroup>++ <PackageReference Include="Microsoft.Orleans.Sdk" Version="8.1.0" />++ <PackageReference Include="Microsoft.Orleans.Streaming" Version="8.1.0" />++ <ProjectReference Include="..\Microsoft.AI.Agents\Microsoft.AI.Agents.csproj" />++ </ItemGroup>++++</Project>diff --cc dotnet/src/Microsoft.AI.Agents/Abstractions/AgentState.csindex 000000000,10bc212f9..10bc212f9mode 000000,100644..100644--- a/dotnet/src/Microsoft.AI.Agents/Abstractions/AgentState.cs+++ b/dotnet/src/Microsoft.AI.Agents/Abstractions/AgentState.csdiff --cc dotnet/src/Microsoft.AI.Agents/Abstractions/ChatHistoryItem.csindex 000000000,30d915254..30d915254mode 000000,100644..100644--- a/dotnet/src/Microsoft.AI.Agents/Abstractions/ChatHistoryItem.cs+++ b/dotnet/src/Microsoft.AI.Agents/Abstractions/ChatHistoryItem.csdiff --cc dotnet/src/Microsoft.AI.Agents/Abstractions/ChatUserType.csindex 000000000,4168b7bcd..4168b7bcdmode 000000,100644..100644--- a/dotnet/src/Microsoft.AI.Agents/Abstractions/ChatUserType.cs+++ b/dotnet/src/Microsoft.AI.Agents/Abstractions/ChatUserType.csdiff --cc dotnet/src/Microsoft.AI.Agents/Abstractions/Event.csindex 000000000,95b64ba2b..95b64ba2bmode 000000,100644..100644--- a/dotnet/src/Microsoft.AI.Agents/Abstractions/Event.cs+++ b/dotnet/src/Microsoft.AI.Agents/Abstractions/Event.csdiff --cc dotnet/src/Microsoft.AI.Agents/Abstractions/IAgent.csindex 000000000,d05c4c37a..d05c4c37amode 000000,100644..100644--- a/dotnet/src/Microsoft.AI.Agents/Abstractions/IAgent.cs+++ b/dotnet/src/Microsoft.AI.Agents/Abstractions/IAgent.csdiff --cc dotnet/src/Microsoft.AI.Agents/Abstractions/IAiAgent.csindex 000000000,54ea314eb..54ea314ebmode 000000,100644..100644--- a/dotnet/src/Microsoft.AI.Agents/Abstractions/IAiAgent.cs+++ b/dotnet/src/Microsoft.AI.Agents/Abstractions/IAiAgent.csdiff --cc dotnet/src/Microsoft.AI.Agents/Microsoft.AI.Agents.csprojindex 000000000,7ae7220d8..be26f7a58mode 000000,100644..100644--- a/dotnet/src/Microsoft.AI.Agents/Microsoft.AI.Agents.csproj+++ b/dotnet/src/Microsoft.AI.Agents/Microsoft.AI.Agents.csproj@@@ -1,0 -1,13 +1,13 @@@-<Project Sdk="Microsoft.NET.Sdk">-- <PropertyGroup>- <TargetFramework>net8.0</TargetFramework>- <ImplicitUsings>enable</ImplicitUsings>- <Nullable>enable</Nullable>- </PropertyGroup>-- <ItemGroup>- <PackageReference Include="Microsoft.SemanticKernel" Version="1.10.0" />- </ItemGroup>-++<Project Sdk="Microsoft.NET.Sdk">++++ <PropertyGroup>++ <TargetFramework>net8.0</TargetFramework>++ <ImplicitUsings>enable</ImplicitUsings>++ <Nullable>enable</Nullable>++ </PropertyGroup>++++ <ItemGroup>++ <PackageReference Include="Microsoft.SemanticKernel" Version="1.10.0" />++ </ItemGroup>+++ </Project>