CopilotShell.xml

<?xml version="1.0"?>
<doc>
    <assembly>
        <name>CopilotShell</name>
    </assembly>
    <members>
        <member name="T:CopilotShell.AgentFileParser">
            <summary>
            Parses .agent.md files (YAML frontmatter + markdown body) into <see cref="T:GitHub.Copilot.SDK.CustomAgentConfig"/> objects.
            The agent name is derived from the filename: e.g. "ado-team.agent.md" → "ado-team".
            </summary>
            <remarks>
            Expected file format:
            <code>
            ---
            description: 'Short description of the agent'
            tools: ['tool1', 'tool2']
            ---
            Markdown body used as the agent prompt.
            </code>
            </remarks>
        </member>
        <member name="M:CopilotShell.AgentFileParser.Parse(System.String)">
            <summary>
            Parse an .agent.md file into a <see cref="T:GitHub.Copilot.SDK.CustomAgentConfig"/>.
            </summary>
        </member>
        <member name="M:CopilotShell.AgentFileParser.ParseMany(System.Collections.Generic.IEnumerable{System.String})">
            <summary>
            Parse multiple agent files.
            </summary>
        </member>
        <member name="M:CopilotShell.AgentFileParser.ExtractAgentName(System.String)">
            <summary>
            Extract the agent name from a filename like "ado-team.agent.md" → "ado-team".
            Falls back to filename without extension if the pattern doesn't match.
            </summary>
        </member>
        <member name="M:CopilotShell.AgentFileParser.ParseFrontmatter(System.String,GitHub.Copilot.SDK.CustomAgentConfig)">
            <summary>
            Lightweight YAML frontmatter parser — handles description and tools fields.
            Avoids a full YAML dependency.
            </summary>
        </member>
        <member name="M:CopilotShell.AgentFileParser.ExtractStringValue(System.String)">
            <summary>
            Extract a string value, stripping surrounding quotes.
            </summary>
        </member>
        <member name="M:CopilotShell.AgentFileParser.ParseToolsList(System.String)">
            <summary>
            Parse an inline YAML list like ['tool1', 'tool2'] into a List&lt;string&gt;.
            </summary>
        </member>
        <member name="T:CopilotShell.AsyncPSCmdlet">
            <summary>
            Base cmdlet that bridges async/await into the PowerShell pipeline by
            pumping a single-threaded <see cref="T:System.Threading.SynchronizationContext"/> on the
            pipeline thread. This ensures that <c>WriteObject</c>, <c>WriteError</c>,
            etc. are always called from the correct thread.
            </summary>
        </member>
        <member name="M:CopilotShell.AsyncPSCmdlet.ResolvePSPath(System.String)">
            <summary>
            Resolve a user-supplied path (relative or absolute) against PowerShell's
            current working directory ($PWD) instead of .NET's Environment.CurrentDirectory.
            </summary>
        </member>
        <member name="M:CopilotShell.AsyncPSCmdlet.ProcessRecordAsync">
            <summary>Override this to implement async pipeline processing.</summary>
        </member>
        <member name="M:CopilotShell.AsyncPSCmdlet.EndProcessingAsync">
            <summary>Override this to implement async end processing.</summary>
        </member>
        <member name="M:CopilotShell.AsyncPSCmdlet.RunWithPump(System.Func{System.Threading.Tasks.Task})">
            <summary>
            Runs the async factory on a thread-pool thread while pumping
            continuations back onto the current (pipeline) thread.
            </summary>
        </member>
        <member name="T:CopilotShell.AsyncPSCmdlet.PipelineSyncContext">
            <summary>
            A <see cref="T:System.Threading.SynchronizationContext"/> that posts callbacks to a
            <see cref="T:System.Collections.Concurrent.BlockingCollection`1"/> so they execute on the pipeline thread.
            </summary>
        </member>
        <member name="T:CopilotShell.CliDownloader">
            <summary>
            Downloads the Copilot CLI binary from the npm registry on demand.
            The binary version is tightly coupled to the SDK version and is embedded
            in the assembly at build time via AssemblyMetadata("CopilotCliVersion", ...).
            </summary>
        </member>
        <member name="M:CopilotShell.CliDownloader.GetRequiredCliVersion">
            <summary>
            Gets the required CLI version from assembly metadata (stamped at build time
            from the GitHub.Copilot.SDK's CopilotCliVersion MSBuild property).
            </summary>
        </member>
        <member name="M:CopilotShell.CliDownloader.GetCacheDir(System.String,System.String)">
            <summary>
            Gets the user-local cache directory for a given CLI version and RID.
            Windows: %LOCALAPPDATA%\CopilotShell\cli\{version}\{rid}\
            macOS: ~/Library/Application Support/CopilotShell/cli/{version}/{rid}/
            Linux: ~/.local/share/CopilotShell/cli/{version}/{rid}/
            </summary>
        </member>
        <member name="M:CopilotShell.CliDownloader.FindCached(System.String,System.String)">
            <summary>
            Returns the path to the cached CLI binary if it exists, or null.
            </summary>
        </member>
        <member name="M:CopilotShell.CliDownloader.GetNpmPlatform(System.String)">
            <summary>
            Maps .NET RID to npm platform name used in the @github/copilot-{platform} package.
            </summary>
        </member>
        <member name="M:CopilotShell.CliDownloader.DownloadAsync(System.String,System.String,System.Action{System.String},System.Threading.CancellationToken)">
            <summary>
            Downloads and extracts the copilot CLI binary to the user cache.
            Returns the path to the binary, or null on failure.
            </summary>
            <param name="version">CLI version (e.g., "0.0.420")</param>
            <param name="rid">Runtime identifier (e.g., "win-x64")</param>
            <param name="log">Optional callback for progress messages (WriteVerbose)</param>
            <param name="cancellationToken">Cancellation token</param>
        </member>
        <member name="T:CopilotShell.NewCopilotClientCommand">
            <summary>
            Creates a new CopilotClient. The client manages the connection to the
            Copilot CLI server process.
            </summary>
            <example>
            <code>$client = New-CopilotClient</code>
            <code>$client = New-CopilotClient -Model gpt-5 -LogLevel debug</code>
            <code>$client = New-CopilotClient -GitHubToken $env:GITHUB_TOKEN</code>
            </example>
        </member>
        <member name="T:CopilotShell.StartCopilotClientCommand">
            <summary>
            Start a CopilotClient that was created with -AutoStart $false.
            </summary>
        </member>
        <member name="T:CopilotShell.StopCopilotClientCommand">
            <summary>
            Gracefully stop a CopilotClient.
            </summary>
        </member>
        <member name="T:CopilotShell.RemoveCopilotClientCommand">
            <summary>
            Dispose and remove a CopilotClient.
            </summary>
        </member>
        <member name="T:CopilotShell.TestCopilotClientCommand">
            <summary>
            Ping the Copilot server to test connectivity.
            </summary>
        </member>
        <member name="T:CopilotShell.CliPathResolver">
            <summary>
            Resolves the path to the Copilot CLI binary.
            Checks in order: bundled in module folder, user-local download cache.
            </summary>
        </member>
        <member name="M:CopilotShell.CliPathResolver.Resolve">
            <summary>
            Returns the full path to copilot(.exe), checking the module folder first,
            then the user-local cache. Returns null if not found anywhere.
            Call <see cref="M:CopilotShell.CliPathResolver.ResolveOrDownloadAsync(System.Action{System.String},System.Threading.CancellationToken)"/> to auto-download when missing.
            </summary>
        </member>
        <member name="M:CopilotShell.CliPathResolver.ResolveOrDownloadAsync(System.Action{System.String},System.Threading.CancellationToken)">
            <summary>
            Resolves the CLI path, downloading from npm if not found locally.
            </summary>
        </member>
        <member name="T:CopilotShell.InvokeCopilotCommand">
            <summary>
            One-shot convenience cmdlet: creates a client + session, sends a prompt,
            collects or streams the response, and cleans up. Ideal for scripting.
            </summary>
            <example>
            <code>Invoke-Copilot "What is 2+2?"</code>
            <code>Invoke-Copilot "Explain this code" -Model claude-sonnet-4.5 -Stream</code>
            <code>Invoke-Copilot "You are a pirate" -SystemMessage "Respond like a pirate." -SystemMessageMode Replace</code>
            <code>Invoke-Copilot "Refactor this" -TimeoutSeconds 120 -MaxTurns 5</code>
            <code>Invoke-Copilot "Help me" -Agent my-custom-agent</code>
            <code>
            # Define a custom agent and use it in one shot
            $agent = [GitHub.Copilot.SDK.CustomAgentConfig]@{ Name = 'reviewer'; Prompt = 'You are a code reviewer.' }
            Invoke-Copilot "Review this PR" -CustomAgents $agent -Agent reviewer
            </code>
            <code>
            # Load a custom agent from a .agent.md file
            Invoke-Copilot "Check the ADO pipeline" -CustomAgentFile .github\agents\ado-team.agent.md
            </code>
            <code>
            # Use a VS Code-compatible .prompt.md file
            Invoke-Copilot -PromptFile .github\prompts\get-work-items.prompt.md
            </code>
            <code>
            # Use a prompt file but override the agent
            Invoke-Copilot -PromptFile .github\prompts\get-work-items.prompt.md -Agent different-agent
            </code>
            </example>
        </member>
        <member name="T:CopilotShell.McpConfigLoader">
            <summary>
            Loads MCP server configurations from a JSON config file (e.g. mcp-config.json)
            and converts them into the SDK's <see cref="T:GitHub.Copilot.SDK.McpLocalServerConfig"/> /
            <see cref="T:GitHub.Copilot.SDK.McpRemoteServerConfig"/> objects for <see cref="P:GitHub.Copilot.SDK.SessionConfig.McpServers"/>.
            </summary>
        </member>
        <member name="M:CopilotShell.McpConfigLoader.Load(System.String)">
            <summary>
            Reads a JSON config file and returns a dictionary suitable for
            <see cref="P:GitHub.Copilot.SDK.SessionConfig.McpServers"/>.
            </summary>
            <remarks>
            Supports two formats (auto-detected):
            <para><b>Copilot CLI format</b> — top-level <c>"mcpServers"</c>:</para>
            <code>
            {
              "mcpServers": {
                "name": { "command": "...", "args": [...], "env": { ... }, "tools": ["*"] }
              }
            }
            </code>
            <para><b>VS Code format</b> (.vscode/mcp.json) — top-level <c>"servers"</c>:</para>
            <code>
            {
              "servers": {
                "name": { "command": "...", "args": [...], "env": { ... } }
              }
            }
            </code>
            Entries with <c>"url"</c> are treated as remote servers; entries with
            <c>"command"</c> are local. Entries with <c>"disabled": true</c> are skipped.
            When <c>"tools"</c> is absent, it defaults to <c>["*"]</c>.
            </remarks>
        </member>
        <member name="T:CopilotShell.ResetCopilotMcpDaemonCommand">
            <summary>
            Stops the MCP zombie daemon and all its managed MCP server processes.
            Use this when authentication tokens become stale and you need to force
            MCP servers to restart fresh (re-authenticate) on the next session.
            </summary>
            <example>
            <code>Reset-CopilotMcpDaemon</code>
            <para>Stops the daemon and all managed MCP servers. They restart automatically on next use.</para>
            </example>
            <example>
            <code>Reset-CopilotMcpDaemon -Force</code>
            <para>Force-kills the daemon process if the graceful shutdown signal fails.</para>
            </example>
        </member>
        <member name="T:CopilotShell.McpToolDiscovery">
            <summary>
            Discovers available tools from MCP servers by performing the MCP protocol handshake
            and calling <c>tools/list</c>. This enables dynamic tool discovery instead of relying
            on hardcoded tool registries in <see cref="T:CopilotShell.ToolFilterHelper"/>.
            </summary>
            <remarks>
            <para>For local/stdio MCP servers, this class:</para>
            <list type="number">
              <item>Starts the server process</item>
              <item>Sends the MCP <c>initialize</c> request</item>
              <item>Sends <c>notifications/initialized</c></item>
              <item>Sends <c>tools/list</c> request</item>
              <item>Parses the response and returns tool names in <c>{serverName}-{toolName}</c> format</item>
              <item>Kills the process</item>
            </list>
            <para>The server is started temporarily and killed after discovery. The actual session
            will start its own instance of the MCP server via the Copilot CLI.</para>
            </remarks>
        </member>
        <member name="M:CopilotShell.McpToolDiscovery.DiscoverToolsAsync(System.String,System.String,System.Collections.Generic.IList{System.String},System.Collections.Generic.IDictionary{System.String,System.String},System.String,System.Int32,System.Threading.CancellationToken)">
            <summary>
            Discover tools from a single local MCP server.
            </summary>
            <param name="serverName">The MCP server name (used as tool name prefix)</param>
            <param name="command">The command to start the server</param>
            <param name="args">Arguments for the command</param>
            <param name="env">Optional environment variables</param>
            <param name="cwd">Optional working directory</param>
            <param name="timeoutMs">Timeout in milliseconds for the entire operation (default 30s)</param>
            <param name="ct">Cancellation token</param>
            <returns>List of tool names in <c>{serverName}-{toolName}</c> format</returns>
        </member>
        <member name="M:CopilotShell.McpToolDiscovery.DiscoverToolsForServersAsync(System.Collections.Generic.Dictionary{System.String,System.Object},System.Collections.Generic.IEnumerable{System.String},System.Int32,System.Threading.CancellationToken)">
            <summary>
            Discover tools from specific servers in an MCP config dictionary.
            Only local/stdio servers are supported for discovery; remote servers are skipped.
            </summary>
            <param name="mcpServers">The MCP server config dictionary (from <see cref="T:CopilotShell.McpConfigLoader"/>)</param>
            <param name="serverNames">Server names to discover tools for</param>
            <param name="timeoutMs">Timeout per server in milliseconds</param>
            <param name="ct">Cancellation token</param>
            <returns>
            Dictionary mapping server name to list of discovered tool names.
            Servers that fail or time out will have empty lists.
            </returns>
        </member>
        <member name="P:CopilotShell.McpToolDiscovery.LastDiscoveryErrors">
            <summary>
            Errors from the most recent discovery operation, if any.
            Keys are server names, values are error messages.
            </summary>
        </member>
        <member name="M:CopilotShell.McpToolDiscovery.BuildProcessStartInfo(System.String,System.Collections.Generic.IList{System.String},System.Collections.Generic.IDictionary{System.String,System.String},System.String)">
            <summary>
            Build a <see cref="T:System.Diagnostics.ProcessStartInfo"/> for starting an MCP server.
            On Windows, commands without extensions (like <c>npx</c>, <c>uvx</c>) are
            run through <c>cmd.exe /c</c> to resolve <c>.cmd</c>/<c>.bat</c> scripts.
            </summary>
        </member>
        <member name="M:CopilotShell.McpToolDiscovery.SendJsonRpcAsync(System.IO.StreamWriter,System.Object,System.Threading.CancellationToken)">
            <summary>
            Send a JSON-RPC message to the MCP server's stdin (newline-delimited).
            </summary>
        </member>
        <member name="M:CopilotShell.McpToolDiscovery.ReadResponseAsync(System.IO.StreamReader,System.Int32,System.Threading.CancellationToken)">
            <summary>
            Read lines from stdout until we find a JSON-RPC response with the expected id.
            Skips notifications, non-JSON lines, and log output.
            </summary>
        </member>
        <member name="M:CopilotShell.McpToolDiscovery.KillProcess(System.Diagnostics.Process)">
            <summary>
            Kill the MCP server process and its process tree.
            </summary>
        </member>
        <member name="T:CopilotShell.McpWrapperHelper">
            <summary>
            Wraps MCP local server configurations to use the <c>mcp-wrapper</c> executable.
            The wrapper handles env var propagation and, for eligible servers, manages
            persistent "zombie" daemon connections that survive session boundaries.
            </summary>
            <remarks>
            <para>When wrapping is enabled (default), each <see cref="T:GitHub.Copilot.SDK.McpLocalServerConfig"/> is
            transformed so that <c>mcp-wrapper</c> becomes the command, and the original command,
            args, env vars, and cwd are passed as wrapper arguments:</para>
            <code>
            mcp-wrapper --env KEY1=VAL1 --env KEY2=VAL2 --cwd /path -- original-command arg1 arg2
            </code>
            <para>The wrapper internally decides whether to use zombie mode (persistent daemon
            with Unix domain socket) or direct proxy mode based on regex patterns matching
            the command and args. The <c>--no-zombie</c> flag can force direct mode.</para>
            </remarks>
        </member>
        <member name="M:CopilotShell.McpWrapperHelper.ResolveWrapperPath">
            <summary>
            Resolve the path to the <c>mcp-wrapper</c> executable bundled with this module.
            Expected in the same directory as the module assembly.
            </summary>
            <returns>Full path to the wrapper executable, or null if not found.</returns>
        </member>
        <member name="M:CopilotShell.McpWrapperHelper.WrapLocalServers(System.Collections.Generic.Dictionary{System.String,System.Object},System.String)">
            <summary>
            Wrap all local MCP server configs to use the <c>mcp-wrapper</c> executable.
            Remote server configs are passed through unchanged.
            </summary>
            <param name="mcpConfig">The MCP server config dictionary (from <see cref="T:CopilotShell.McpConfigLoader"/>)</param>
            <param name="wrapperPath">Full path to the mcp-wrapper executable</param>
            <returns>A new dictionary with wrapped local server configs</returns>
        </member>
        <member name="M:CopilotShell.McpWrapperHelper.NeedsWrapping(GitHub.Copilot.SDK.McpLocalServerConfig,System.String)">
            <summary>
            Check whether a local MCP server config needs wrapping.
            All local servers are wrapped so zombie-eligible ones get persistent daemon
            connections.
            </summary>
        </member>
        <member name="M:CopilotShell.McpWrapperHelper.WrapConfig(GitHub.Copilot.SDK.McpLocalServerConfig,System.String)">
            <summary>
            Transform a single <see cref="T:GitHub.Copilot.SDK.McpLocalServerConfig"/> to use the wrapper.
            The original command, args, env, and cwd become wrapper arguments.
            </summary>
        </member>
        <member name="T:CopilotShell.SendCopilotMessageCommand">
            <summary>
            Send a message to a Copilot session.
            With -Stream, emits session events to the pipeline in real time.
            Without -Stream, waits for the session to become idle and returns the
            final assistant message text.
            </summary>
            <example>
            <code>Send-CopilotMessage -Session $session -Prompt "Hello"</code>
            <code>Send-CopilotMessage $session "Explain this code" -Stream</code>
            <code>"Fix the bug" | Send-CopilotMessage -Session $session -Attachment ./file.cs</code>
            <code>Send-CopilotMessage $session "Use this agent" -Agent my-agent</code>
            <code>
            # Use a VS Code-compatible .prompt.md file
            Send-CopilotMessage $session -PromptFile .github\prompts\get-work-items.prompt.md
            </code>
            </example>
        </member>
        <member name="T:CopilotShell.WaitCopilotSessionCommand">
            <summary>
            Wait for a Copilot session to become idle.
            </summary>
        </member>
        <member name="T:CopilotShell.ModuleInitializer">
             <summary>
             PowerShell module lifecycle hooks.
            
             <b>Assembly isolation for dependency version conflicts:</b>
             The module bundles newer assemblies (e.g. System.Text.Json 10.x) than the
             PowerShell host provides (.NET 8's v8.x or .NET 9's v9.x). To avoid type
             identity conflicts, all module dependencies live in a <c>dependencies/</c>
             subdirectory and are loaded via an isolated <see cref="T:System.Runtime.Loader.AssemblyLoadContext"/>.
            
             <b>Critical timing:</b> The Resolving handler MUST be registered BEFORE
             PowerShell calls <c>GetTypes()</c> on this assembly (which triggers resolution
             of SDK types). Since <c>IModuleAssemblyInitializer.OnImport()</c> runs AFTER
             type enumeration begins, registration happens in <c>StartupCheck.ps1</c>
             (via <c>ScriptsToProcess</c> in the manifest) which runs before the
             binary module loads.
            
             This class provides the <see cref="T:System.Management.Automation.IModuleAssemblyCleanup"/> implementation
             to unregister the handler when the module is removed.
             </summary>
        </member>
        <member name="T:CopilotShell.PromptFileResult">
            <summary>
            Result of parsing a .prompt.md file.
            Contains the prompt body text and optional frontmatter metadata.
            </summary>
        </member>
        <member name="P:CopilotShell.PromptFileResult.Prompt">
            <summary>Prompt body text (everything after the frontmatter).</summary>
        </member>
        <member name="P:CopilotShell.PromptFileResult.Agent">
            <summary>Optional agent name from frontmatter (e.g. agent: 'my-agent').</summary>
        </member>
        <member name="P:CopilotShell.PromptFileResult.Description">
            <summary>Optional description from frontmatter.</summary>
        </member>
        <member name="T:CopilotShell.PromptFileParser">
             <summary>
             Parses .prompt.md files (YAML frontmatter + markdown body) into <see cref="T:CopilotShell.PromptFileResult"/> objects.
             Compatible with VS Code's .prompt.md format.
             </summary>
             <remarks>
             Expected file format:
             <code>
             ---
             agent: 'my-agent'
             description: 'Your goal is to help with specific tasks.'
             ---
             The actual prompt text sent to the model.
             Can span multiple lines with markdown formatting.
             </code>
            
             All frontmatter fields are optional. The body (after the frontmatter) becomes the prompt text.
             If no frontmatter is present, the entire file content is used as the prompt.
             </remarks>
        </member>
        <member name="M:CopilotShell.PromptFileParser.Parse(System.String)">
            <summary>
            Parse a .prompt.md file.
            </summary>
        </member>
        <member name="M:CopilotShell.PromptFileParser.ParseFrontmatter(System.String,CopilotShell.PromptFileResult)">
            <summary>
            Lightweight YAML frontmatter parser — handles agent and description fields.
            Avoids a full YAML dependency.
            </summary>
        </member>
        <member name="M:CopilotShell.PromptFileParser.ExtractStringValue(System.String)">
            <summary>
            Extract a string value, stripping surrounding quotes.
            </summary>
        </member>
        <member name="T:CopilotShell.NewCopilotSessionCommand">
            <summary>
            Create a new Copilot conversation session on a running client.
            </summary>
            <example>
            <code>$session = New-CopilotSession -Client $client -Model gpt-5</code>
            <code>$session = New-CopilotSession $client -Model gpt-5 -SystemMessage "You are a pirate." -SystemMessageMode Replace</code>
            <code>$session = New-CopilotSession $client -Model claude-sonnet-4.5 -Stream</code>
            <code>$session = New-CopilotSession $client -McpConfigFile C:\code\project\mcp-config.json</code>
            <code>$session = New-CopilotSession $client -Agent "my-custom-agent"</code>
            <code>
            # Define and use a custom agent inline
            $agent = [GitHub.Copilot.SDK.CustomAgentConfig]@{ Name = 'reviewer'; Prompt = 'You are a code reviewer.'; Description = 'Reviews code changes' }
            $session = New-CopilotSession $client -CustomAgents $agent -Agent reviewer
            </code>
            <code>
            # Load a custom agent from a .agent.md file
            $session = New-CopilotSession $client -CustomAgentFile .github\agents\ado-team.agent.md
            </code>
            </example>
        </member>
        <member name="T:CopilotShell.GetCopilotSessionCommand">
            <summary>
            List all sessions or return a specific session's metadata.
            </summary>
            <example>
            <code>Get-CopilotSession -Client $client</code>
            </example>
        </member>
        <member name="T:CopilotShell.ResumeCopilotSessionCommand">
            <summary>
            Resume an existing session by ID.
            </summary>
        </member>
        <member name="T:CopilotShell.RemoveCopilotSessionCommand">
            <summary>
            Delete a session by ID.
            </summary>
        </member>
        <member name="T:CopilotShell.GetCopilotSessionMessagesCommand">
            <summary>
            Get all messages/events from a session.
            </summary>
        </member>
        <member name="T:CopilotShell.StopCopilotSessionCommand">
            <summary>
            Abort the currently processing message in a session.
            </summary>
        </member>
        <member name="T:CopilotShell.DisconnectCopilotSessionCommand">
            <summary>
            Disconnect (dispose) a local session object to free resources without deleting
            the session from the server. The session can be resumed later with
            <c>Resume-CopilotSession</c> using the same session ID.
            </summary>
            <example>
            <code>
            $id = $session.SessionId
            Disconnect-CopilotSession $session
            # later...
            $session = Resume-CopilotSession $client $id
            </code>
            </example>
        </member>
        <member name="T:CopilotShell.ToolFilterHelper">
            <summary>
            Helper for managing tool filters.
            Supports wildcard patterns, bare MCP server name expansion, and dynamic MCP tool discovery.
            </summary>
            <remarks>
            <para>The copilot CLI does NOT support wildcards in <c>availableTools</c> — it requires exact tool names.
            MCP tools are named <c>{serverName}-{toolName}</c> (e.g., <c>kusto-mcp-kusto_query</c>).
            This helper expands wildcard patterns and bare server names against dynamically discovered
            MCP tools so that exact names are sent to the CLI.</para>
            <para>Supported patterns in <c>-AvailableTools</c>:</para>
            <list type="bullet">
              <item><c>"ado-*"</c> — wildcard: expands all discovered tools starting with <c>ado-</c></item>
              <item><c>"ado"</c> — bare server name: auto-detected and expanded like <c>ado-*</c></item>
              <item><c>"kusto-mcp"</c> — bare server name: expands to all <c>kusto-mcp-*</c> tools</item>
              <item><c>"kusto-mcp-kusto_query"</c> — exact tool name: passed through as-is</item>
              <item><c>"view"</c> — built-in tool: passed through as-is</item>
              <item><c>"powershell"</c> — shorthand: expands to all <c>*_powershell</c> core tools</item>
            </list>
            <para>Server name and wildcard patterns require <c>-McpConfigFile</c> so that the server
            can be started temporarily to discover its tools via the MCP <c>tools/list</c> protocol.</para>
            </remarks>
        </member>
        <member name="F:CopilotShell.ToolFilterHelper.CoreTools">
            <summary>
            Core Copilot CLI tools that are always included when <c>-AvailableTools</c> is specified.
            </summary>
        </member>
        <member name="F:CopilotShell.ToolFilterHelper.AgentCoreTools">
            <summary>
            Core CLI tools for agents — excludes agent orchestration tools (<c>task</c>,
            <c>read_agent</c>, <c>list_agents</c>) that cause recursive delegation loops
            when a model is already running as a specific agent.
            </summary>
        </member>
        <member name="F:CopilotShell.ToolFilterHelper.Shorthands">
            <summary>
            Shorthand expansions (e.g., "powershell" → all powershell tools).
            </summary>
        </member>
        <member name="M:CopilotShell.ToolFilterHelper.ExpandToolPatterns(System.String[],System.Collections.Generic.Dictionary{System.String,System.Collections.Generic.List{System.String}})">
            <summary>
            Expand user-specified tool patterns (wildcards, bare server names, shorthands)
            into exact tool names, always including core CLI tools.
            If userTools is null, returns null (allowing all tools).
            Wildcard patterns (e.g. "ado-*") and bare MCP server names (e.g. "ado", "kusto-mcp")
            are expanded against dynamically discovered MCP tools.
            Raw wildcard patterns are NOT passed to the CLI (it doesn't support them).
            </summary>
        </member>
        <member name="M:CopilotShell.ToolFilterHelper.GetServersNeedingDiscovery(System.String[],System.Collections.Generic.Dictionary{System.String,System.Object})">
            <summary>
            Identify MCP server names referenced in user-specified tools that exist in the MCP config.
            These servers need dynamic tool discovery via <see cref="T:CopilotShell.McpToolDiscovery"/>.
            </summary>
            <param name="userTools">User-specified tool patterns</param>
            <param name="mcpConfig">MCP server configuration dictionary (from <see cref="T:CopilotShell.McpConfigLoader"/>)</param>
            <returns>List of server names that need discovery</returns>
        </member>
        <member name="M:CopilotShell.ToolFilterHelper.IsMcpServerPrefix(System.String,System.Collections.Generic.IEnumerable{System.String})">
            <summary>
            Check if the given name matches a server prefix in the provided tool set.
            A name is considered a server prefix if any tool starts with "{name}-".
            </summary>
        </member>
        <member name="F:CopilotShell.ToolFilterHelper.VsCodeToolMappings">
            <summary>
            Maps VS Code Copilot agent tool names (from .agent.md files) to their
            Copilot CLI equivalents. These names use namespace/tool format in VS Code
            but have different names in the CLI.
            </summary>
        </member>
        <member name="M:CopilotShell.ToolFilterHelper.GetMcpToolRefsFromAgents(System.Collections.Generic.IEnumerable{GitHub.Copilot.SDK.CustomAgentConfig})">
            <summary>
            Extract MCP tool patterns from agent tool lists, suitable for use with
            <see cref="M:CopilotShell.ToolFilterHelper.ExpandToolPatterns(System.String[],System.Collections.Generic.Dictionary{System.String,System.Collections.Generic.List{System.String}})"/> at the session level. Filters out VS Code
            tool names, shorthands, and core tools — returns only MCP-relevant patterns
            (wildcards like <c>ado-*</c>, exact MCP tool names like <c>ev2-get_rollout_details</c>).
            </summary>
            <returns>Normalized MCP patterns, or null if no MCP patterns found.</returns>
        </member>
        <member name="M:CopilotShell.ToolFilterHelper.ExpandAgentTools(System.Collections.Generic.IEnumerable{GitHub.Copilot.SDK.CustomAgentConfig},System.Collections.Generic.Dictionary{System.String,System.Collections.Generic.List{System.String}})">
            <summary>
            Process each agent's <c>Tools</c> list to handle VS Code tool name mappings
            and MCP tool references. When agents reference MCP tools (wildcards, bare server
            names, or exact MCP tool names), the Tools list is cleared (<c>null</c>) so
            the agent inherits all session tools. The CLI's internal tool registry may use
            different names than our discovery — setting Tools to null avoids mismatches.
            Tool scoping is handled at the session level via <see cref="M:CopilotShell.ToolFilterHelper.ExpandToolPatterns(System.String[],System.Collections.Generic.Dictionary{System.String,System.Collections.Generic.List{System.String}})"/>
            using MCP patterns extracted by <see cref="M:CopilotShell.ToolFilterHelper.GetMcpToolRefsFromAgents(System.Collections.Generic.IEnumerable{GitHub.Copilot.SDK.CustomAgentConfig})"/>.
            </summary>
            <param name="agents">Custom agents whose tools may need processing</param>
            <param name="discoveredMcpTools">Discovered tools keyed by server name (from <see cref="T:CopilotShell.McpToolDiscovery"/>)</param>
        </member>
        <member name="M:CopilotShell.ToolFilterHelper.FilterMcpServers(System.Collections.Generic.Dictionary{System.String,System.Object},System.String[])">
            <summary>
            Filter the MCP server config to only include servers referenced in <c>-AvailableTools</c>.
            Matches bare names ("ado"), wildcards ("ado-*"), and exact tool names ("ev2-get_rollout_details").
            If <c>userTools</c> is null/empty, returns the full config (no filtering).
            </summary>
        </member>
    </members>
</doc>