Commit Graph

4 Commits

  • .NET: Restructure skill script schemas XML and remove resources from body (#6343)
    * Restore UTF-8 BOMs and fix BuildScriptSchemasBlock doc comment
    
    - Restore UTF-8 BOM on all changed files to match repo convention
    - Fix XML doc: <schema name=...> -> <schema script=...> to match emitted output
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Address PR review comments: fix doc remarks and rename tests
    
    - Update script doc remarks to clarify only parameter schemas are included
    - Fix grammar: 'arguments format' -> 'argument format'
    - Rename misleading test methods to match actual assertions
    - Clarify comment about removed wrapper element
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: SergeyMenshykh <SergeMenshikh@outlook.com>
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • .NET: [Breaking] Refactor AgentSkill API to async resource and script lookup (#6030)
    * .NET: Refactor AgentSkill API to async resource and script lookup
    
    Replace property-based AgentSkill.Content, Resources, and Scripts with
    async-by-name lookup methods plus boolean availability flags:
    
    - Content (string getter) -> GetContentAsync(CancellationToken)
    - Resources (full list) -> HasResources + GetResourceAsync(name, ct)
    - Scripts (full list) -> HasScripts + GetScriptAsync(name, ct)
    
    This makes the API friendlier for sources like MCP where enumerating all
    resources up front is expensive or impossible, and allows skill implementations
    to fetch content lazily.
    
    Subclass changes:
    - AgentFileSkill and AgentInlineSkill implement the new async API while
      preserving content caching.
    - AgentClassSkill<TSelf> keeps virtual Resources/Scripts properties for
      reflection-based discovery and seals the new HasResources/HasScripts/
      GetResourceAsync/GetScriptAsync overrides. Its previously non-thread-safe
      lazy initialization is replaced with Lazy<T> (default thread-safety) wired
      up in a new protected constructor, so concurrent first-access from multiple
      threads is safe.
    - AgentSkillsProvider calls the new async API and exposes 
    ead_skill_resource
      / load_skill / 
    un_skill_script tools that await the per-name lookups.
    
    Includes baseline CompatibilitySuppressions.xml entries for the removed
    property getters.
    
    Tests:
    - Direct coverage for HasResources, HasScripts, GetResourceAsync, and
      GetScriptAsync on all three skill implementations (positive, missing-name,
      and no-resources/no-scripts cases).
    - Thread-safety regression test for AgentClassSkill<TSelf> that exercises
      concurrent first-access to Resources, Scripts, and GetContentAsync from
      many tasks and asserts all observers see the same cached instance.
    - Provider-level coverage for the 
    ead_skill_resource tool (invocation +
      error paths) and for the previously untested error paths of load_skill
      and 
    un_skill_script (empty names, skill/resource/script not found).
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Address PR review comments
    
    - Move GetScriptAsync inside try/catch in RunSkillScriptAsync for error-handling parity
    - Remove dead _reflectedResources branch from AgentSkillTestExtensions
    - Fix XML docs to reference virtual Resources/Scripts properties (not sealed methods)
    - Add Async suffix to async test methods per naming convention
    - Make no-await tests synchronous to eliminate CS1998
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Fix formatting: add UTF-8 BOM and remove unused using
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Fix XML cref: Resources/Scripts are on AgentClassSkill<TSelf>
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Remove HasResources and HasScripts properties from AgentSkill
    
    Drop the virtual HasResources and HasScripts properties from AgentSkill
    and all concrete subclasses (AgentFileSkill, AgentInlineSkill,
    AgentClassSkill). AgentSkillsProvider now always includes all three
    tools (load_skill, read_skill_resource, run_skill_script) and both
    instruction blocks, since the tools already handle missing
    resources/scripts gracefully.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Add blank line for readability in file-based skills sample
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    * Fix HostedAgentSkillsPatternTests for always-included tools
    
    Update assertions to expect read_skill_resource and run_skill_script
    tools are always present, matching the new behavior.
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • .NET: [Breaking] Support string[] arguments for file-based skill scripts (#5475)
    * support arguments of string[] shape for file-based skill scripts
    
    * suppress breaking changes errors
    
    * address feedback
    
    * remove unnecessary usung directive
  • .NET: [Breaking] Restructure agent skills to use multi-source architecture (#4871)
    * initial commit
    
    * address comments
    
    * address comments
    
    * address comments
    
    * address  comments
    
    * rename executor to runner to align naming with python implementation
    
    * rename runner execute method to run method
    
    * remove poc leftovers and fix compilation issues
    
    * make script runner optional
    
    * remove unnecessary pragmas
    
    * make resources and scripts props virtual
    
    * address comments
    
    * update comment for name validation regex
    
    * address comments