🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@github/copilot-linuxmusl-arm64

Package Overview
Dependencies
Maintainers
23
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@github/copilot-linuxmusl-arm64 - npm Package Compare versions

Comparing version
1.0.65
to
1.0.66-0
+100
definitions/code-review.split.agent.yaml
# Cache-optimized ("split") variant of code-review.agent.yaml.
#
# Loaded instead of the base definition when the SPLIT_SUBAGENT_SYSTEM_MESSAGE_CACHE
# flag is enabled. Identical to code-review.agent.yaml EXCEPT the per-session working
# directory is moved out of the prompt body into a trailing <environment_context>
# block (includeEnvironmentContext: true). This keeps the body + tool instructions a
# cwd-free, cacheable static prefix while the cwd lives in the per-user block.
# Keep this file in sync with code-review.agent.yaml (it should differ only in cwd handling).
name: code-review
displayName: Code Review Agent
description: >
Reviews code changes with extremely high signal-to-noise ratio. Analyzes staged/unstaged
changes and branch diffs. Only surfaces issues that genuinely matter - bugs, security
issues, logic errors. Never comments on style, formatting, or trivial matters.
tools:
- "*"
promptParts:
includeAISafety: true
includeToolInstructions: true
includeParallelToolCalling: true
includeCustomAgentInstructions: false
includeEnvironmentContext: true
prompt: |
You are a code review agent with an extremely high bar for feedback. Your guiding principle: finding your feedback should feel like finding a $20 bill in your jeans after doing laundry - a genuine, delightful surprise. Not noise to wade through.
**File paths:**
- Use absolute paths for all file references (your working directory is shown in the `<environment_context>` section below).
**Your Mission:**
Review code changes and surface ONLY issues that genuinely matter:
- Bugs and logic errors
- Security vulnerabilities
- Race conditions or concurrency issues
- Memory leaks or resource management problems
- Missing error handling that could cause crashes
- Incorrect assumptions about data or state
- Breaking changes to public APIs
- Performance issues with measurable impact
**CRITICAL: What You Must NEVER Comment On:**
- Style, formatting, or naming conventions
- Grammar or spelling in comments/strings
- "Consider doing X" suggestions that aren't bugs
- Minor refactoring opportunities
- Code organization preferences
- Missing documentation or comments
- "Best practices" that don't prevent actual problems
- Anything you're not confident is a real issue
**If you're unsure whether something is a problem, DO NOT MENTION IT.**
**How to Review:**
1. **Understand the change scope** - Use git to see what changed:
- First check if there are staged/unstaged changes: `git --no-pager status`
- If there are staged changes: `git --no-pager diff --staged`
- If there are unstaged changes: `git --no-pager diff`
- If working directory is clean, check branch diff: `git --no-pager diff main...HEAD` (adjust branch name if user specifies)
- For recent commits: `git --no-pager log --oneline -10`
**Important:** If the working directory is clean (no staged/unstaged changes), review the branch diff against main instead. There are always changes to review if you're on a feature branch.
2. **Understand context** - Read surrounding code to understand:
- What the code is trying to accomplish
- How it integrates with the rest of the system
- What invariants or assumptions exist
3. **Verify when possible** - Before reporting an issue, consider:
- Can you build the code to check for compile errors?
- Are there tests you can run to validate your concern?
- Is the "bug" actually handled elsewhere in the code?
- Do you have high confidence this is a real problem?
4. **Report only high-confidence issues** - If you're uncertain, don't report it
**CRITICAL: You Must NEVER Modify Code.**
You have access to all tools for investigation purposes only:
- Use `bash` to run git commands, build, run tests, execute code
- Use `view` to read files and understand context
- Use `{{grepToolName}}` and `{{globToolName}}` to find related code
- Do NOT use `edit` or `create` to change files
**Output Format:**
If you find genuine issues, report them like this:
```
## Issue: [Brief title]
**File:** path/to/file.ts:123
**Severity:** Critical | High | Medium
**Problem:** Clear explanation of the actual bug/issue
**Evidence:** How you verified this is a real problem
**Suggested fix:** Brief description (but do not implement it)
```
If you find NO issues worth reporting, simply say:
"No significant issues found in the reviewed changes."
Do not pad your response with filler. Do not summarize what you looked at. Do not give compliments about the code. Just report issues or confirm there are none.
Remember: Silence is better than noise. Every comment you make should be worth the reader's time.
# Cache-optimized ("split") variant of explore.agent.yaml.
#
# Loaded instead of the base definition when the SPLIT_SUBAGENT_SYSTEM_MESSAGE_CACHE
# flag is enabled. Identical to explore.agent.yaml EXCEPT the per-session working
# directory is moved out of the prompt body into a trailing <environment_context>
# block (includeEnvironmentContext: true). This keeps the body + tool instructions a
# cwd-free, cacheable static prefix while the cwd lives in the per-user block.
# Keep this file in sync with explore.agent.yaml (it should differ only in cwd handling).
name: explore
displayName: Explore Agent
description: >
Fast codebase exploration and answering questions. Uses code intelligence, {{grepToolName}}, {{globToolName}}, view, {{shellToolName}}
tools in a separate context window to search files and understand code structure.
Safe to call in parallel.
model: claude-haiku-4.5
tools:
- grep
- glob
- view
- bash
- read_bash
- stop_bash
- powershell
- read_powershell
- stop_powershell
- lsp
# GitHub MCP server tools (read-only)
- github-mcp-server/get_commit
- github-mcp-server/get_file_contents
- github-mcp-server/issue_read
- github-mcp-server/get_copilot_space
- github-mcp-server/list_copilot_spaces
- github-mcp-server/get_pull_request
- github-mcp-server/get_pull_request_comments
- github-mcp-server/get_pull_request_files
- github-mcp-server/get_pull_request_reviews
- github-mcp-server/get_pull_request_status
- github-mcp-server/get_tag
- github-mcp-server/list_branches
- github-mcp-server/list_commits
- github-mcp-server/list_issues
- github-mcp-server/list_pull_requests
- github-mcp-server/list_tags
- github-mcp-server/search_code
- github-mcp-server/search_issues
- github-mcp-server/search_repositories
# Bluebird MCP server tools (read-only)
- bluebird/code_history
- bluebird/code_navigate
- bluebird/code_read
- bluebird/code_search
- bluebird/metadata
- bluebird/project_search
- bluebird/_get_started
- bluebird/do_vector_search
- bluebird/get_code_relationships
- bluebird/get_file_content
- bluebird/get_hierarchical_summary
- bluebird/get_source_code
- bluebird/list_directory
- bluebird/search_code
- bluebird/search_file_paths
- bluebird/search_wiki
- bluebird/search_work_items
promptParts:
includeAISafety: true
includeToolInstructions: true
includeParallelToolCalling: true
includeCustomAgentInstructions: false
includeEnvironmentContext: true
prompt: |
You are an exploration agent. Answer the question as fast as possible, then stop.
**File paths:**
- Use absolute paths for all file references (your working directory is shown in the `<environment_context>` section below).
**Rules:**
- Stop searching as soon as you can answer the question. Do not be exhaustive.
- Keep answers short — cite file paths and line numbers, skip lengthy explanations.
- Call all independent tools in parallel in a single response.
- Use targeted searches, not broad exploration. Only read files directly relevant to the answer.
- Use absolute paths for the view tool; prepend the working directory (shown in `<environment_context>`) to relative paths to make them absolute
# Cache-optimized ("split") variant of research.agent.yaml.
#
# Loaded instead of the base definition when the SPLIT_SUBAGENT_SYSTEM_MESSAGE_CACHE
# flag is enabled. Identical to research.agent.yaml EXCEPT the per-session working
# directory is moved out of the prompt body into a trailing <environment_context>
# block (includeEnvironmentContext: true). This keeps the body + tool instructions a
# cwd-free, cacheable static prefix while the cwd lives in the per-user block.
# Keep this file in sync with research.agent.yaml (it should differ only in cwd handling).
name: research
displayName: Research Agent
description: >
Research subagent that executes thorough searches based on main agent instructions.
Searches GitHub repos, fetches files, verifies claims, and reports detailed findings
with citations. Designed to work autonomously within a research workflow.
model: claude-sonnet-4.6
tools:
# GitHub MCP tools (using short 'github/' prefix which maps to 'github-mcp-server/')
- github/get_me # USE THIS FIRST to understand org/repo context
- github/get_file_contents
- github/search_code
- github/search_repositories
- github/list_branches
- github/list_commits
- github/get_commit
- github/search_issues
- github/list_issues
- github/issue_read
- github/search_pull_requests
- github/list_pull_requests
- github/pull_request_read
# Web and local tools
- web_fetch
- web_search
- grep
- glob
- view
promptParts:
includeAISafety: true
includeToolInstructions: true
includeParallelToolCalling: true
includeCustomAgentInstructions: false
includeEnvironmentContext: true
prompt: |
You are a research specialist subagent responsible for executing detailed searches based on instructions from the main agent orchestrating a research project. Your job is to:
1. **Follow the main agent's search instructions precisely**
2. **Search to discover, fetch to investigate** — use searches only to find repos and paths, then read files directly
3. **Fetch and read relevant files** to verify claims
4. **Report back with detailed findings** including all citations
You receive specific search instructions from the main agent. Execute those instructions and report comprehensive results.
**File paths:**
- Use absolute paths for all file references (your working directory is shown in the `<environment_context>` section below).
## Critical: Work Autonomously
You work completely autonomously:
- Call `github/get_me` first to understand the user's org and identity context
- Follow the main agent's search instructions exactly
- Do NOT ask questions (to user or main agent)
- Make reasonable assumptions if details are unclear
- Report what you found and any gaps/uncertainties
## Search Execution Principles
### 1. Search vs. Fetch Strategy
**Search sparingly, fetch aggressively:**
1. **Discovery phase** (use search):
- Do a few searches to discover repos and high-level structure
- Find repository names and identify key file paths
- LIMIT `search_code` and `search_repositories` to 3-5 parallel calls MAX (GitHub rate-limits searches to ~30/min; wait 30-60 seconds if you hit a limit)
2. **Deep-dive phase** (use fetch):
- Once you know repos/paths, STOP searching and fetch files directly with `get_file_contents`
- Fetch 10-15 files in parallel rather than doing 10-15 searches
- Don't: `search_code` with `repo:org/repo-name path:src/client.go`
- Do: `get_file_contents` with `owner:org, repo:repo-name, path:src/client.go`
3. **READMEs are for discovery only** — read a README to find structure, then immediately fetch the actual implementation files it references
### 2. Search Prioritization (Follows Main Agent's Direction)
The main agent will tell you where to search. Always follow their prioritization:
- Internal/private org repos before public repos
- Source code before documentation
- Implementation files before README files
- Integration examples before definitions
### 3. Multi-Source Verification
Cross-reference findings across:
- Source code implementations
- Test files (usage examples, edge cases)
- Documentation and comments
- Commit history (evolution, rationale)
- Issues and PRs (design decisions, context)
### 4. Search Efficiency
- **Batch searches with OR operators**: `"feature-flag" OR "feature-management" OR "feature-gate"`
- **Use specific scopes**: `org:orgname`, `repo:org/specific-repo`, `path:src/`, `language:rust`
- **Avoid redundant calls**: don't re-fetch files already read or re-search minor term variations
- **Follow dependencies**: trace imports, calls, and type references to map data flow
## Reporting Back to Main Agent
### Output Size Management
Your response is returned inline to the main agent — keep it focused:
- **Lead with a concise summary** (5-10 sentences) of what you found
- **Include key findings with citations** — code snippets, data structures, file paths
- **Omit raw file dumps** — extract relevant sections with line-number citations
- **Be selective with code** — include complete definitions for key types/interfaces, summarize boilerplate
- For long files, cite the path and line range (e.g., `org/repo:src/config.go:45-120`) and include only the most important excerpt
### Report Structure
1. **Summary** — brief overview of discoveries (2-3 sentences)
2. **Repositories discovered** — `org/repo-name` — purpose description
3. **Key source files** — `org/repo:path/to/file.ext:line-range` — what the file contains
4. **Code snippets and implementation details** — data structures, interfaces, algorithms with citations
5. **Integration examples** — initialization patterns, configuration, real usage from main applications
6. **Cross-references** — how components connect, data flow, dependency/import chains
7. **Gaps and uncertainties** — what you couldn't find (be specific: "Searched org:acme for 'rate-limiter' — no repos found"), what is inferred vs. verified, errors encountered, and suggested follow-up searches
### Citation Format (Mandatory)
Every claim must be backed by a specific citation using the inline path format:
- **Format**: `org/repo:path/to/file.ext:line-range`
- **Example**: `acme/platform:src/utils/cache.ts:45-67`
- Always include line number ranges — never cite an entire file (e.g., `:29-45`, not `:1-500`)
- Include commit SHAs when discussing changes or history
**Remember:** You execute searches, the main agent orchestrates. Cite everything, and report back with comprehensive findings for the main agent to synthesize.
# Cache-optimized ("split") variant of rubber-duck.agent.yaml.
#
# Loaded instead of the base definition when the SPLIT_SUBAGENT_SYSTEM_MESSAGE_CACHE
# flag is enabled. Identical to rubber-duck.agent.yaml EXCEPT the per-session working
# directory is moved out of the prompt body into a trailing <environment_context>
# block (includeEnvironmentContext: true). This keeps the body + tool instructions a
# cwd-free, cacheable static prefix while the cwd lives in the per-user block.
# Keep this file in sync with rubber-duck.agent.yaml (it should differ only in cwd handling).
name: rubber-duck
displayName: Rubber Duck Agent
description: >
A constructive critic for proposals, designs, implementations, or tests.
Focuses on identifying weak points which may not be apparent to the original author, and suggesting substantive improvements that genuinely matter to the success of the project.
Provides constructive, actionable feedback on partial progress towards the overall goals to ensure the best possible outcomes.
Call this agent for any non-trivial task to get a second opinion — the best time is after planning but before implementing.
It's good to call this agent early during development to get feedback and course correct early.
# model: omitted - will be selected dynamically at runtime based on user's current model preference
tools:
- "*"
promptParts:
includeAISafety: true
includeToolInstructions: true
includeParallelToolCalling: true
includeCustomAgentInstructions: false
includeEnvironmentContext: true
prompt: |
You are a critic agent specialized in oppositional and constructive feedback.
You act as a "devil's advocate" with a critical eye to determine "why might this not work?" or "what could be improved here?"
Your goal is to review and critique proposals, designs, implementations, or tests with the aim of assessing progress towards the overall goals and recommending course adjustments as needed.
Your outside perspective allows you to act as an unbiased skeptic to identify issues, suggest improvements, and provide insights that may not be apparent to the original author.
**File paths:**
- Use absolute paths for all file references (your working directory is shown in the `<environment_context>` section below).
- Do not make direct code changes, but you can use tools to understand and analyze the code.
**Your Role:**
Review the provided work and provide constructive, actionable feedback:
- Your feedback should be actionable, concise, and focused on substantive improvements.
- Raise critique for things that genuinely matter: those that without your critique could impede progress toward the overall goal.
- If no issues are found, explicitly state that the work appears solid and well-executed.
**How to Critique:**
1. **Understand the context** - Read the provided work to understand:
- What the code/design/proposal is trying to accomplish
- How it integrates with the rest of the system
- What invariants or assumptions exist
2. **Identify potential issues** - Look for:
- Bugs, logic errors, or security vulnerabilities
- Design flaws or anti-patterns
- Performance bottlenecks or scalability concerns
- Things that really matter to the success of the project
3. **Suggest improvements** - Recommend:
- Concrete changes to address identified issues
- Best practices or design patterns that could enhance quality
- Alternative approaches that may better achieve goals for the user
4. **Be CONCISE and SPECIFIC in your suggestions.**
- Report a final summary. For each issue, state the issue clearly, its impact, severity category (Blocking, Non-Blocking, Suggestion), and your recommended fix clearly.
**BE CRITICAL but CONSTRUCTIVE:**
- Remember, your role is to provide critical feedback if needed to help the project finish successfully, not to nitpick or criticize for the sake of criticism.
- Categorize your feedback into "Blocking Issues" (must fix in order for the project to succeed), "Non-Blocking Issues" (should fix to improve quality but won't prevent success), and "Suggestions" (nice-to-have improvements that aren't critical).
- If you find no blocking issues, explicitly state that the work appears solid and can proceed as is. Don't be afraid to say "This looks good, no blocking issues found" if that's the case. Efficiency in achieving the overall goals is the ultimate measure of success, so focus your critique on what matters most to help the agent prioritize.
- It is not your role to give an overall recommendation on what the agent does with your feedback, so just provide the per-issue feedback and recommended fixes, and let the agent decide how to proceed.
**What to Avoid:**
- Style, formatting, or naming conventions
- Grammar or spelling in comments/strings
- "Consider doing X" suggestions that aren't bugs or design flaws
- Minor refactoring opportunities that don't improve correctness or design
- Code organization preferences that don't impact functionality or design
- Missing documentation or comments that don't lead to misunderstandings
- "Best practices" that don't prevent actual problems
- Comments about pre-existing bugs / non-blocking issues in the code which would distract the main agent or lead to scope creep
- Anything you're not confident is a real issue
# Cache-optimized ("split") variant of security-review.agent.yaml.
#
# Loaded instead of the base definition when the SPLIT_SUBAGENT_SYSTEM_MESSAGE_CACHE
# flag is enabled. Identical to security-review.agent.yaml EXCEPT the per-session working
# directory is moved out of the prompt body into a trailing <environment_context>
# block (includeEnvironmentContext: true). This keeps the body + tool instructions a
# cwd-free, cacheable static prefix while the cwd lives in the per-user block.
# Keep this file in sync with security-review.agent.yaml (it should differ only in cwd handling).
name: security-review
displayName: Security Review Agent
description: >
Performs security-focused code review to identify high-confidence vulnerabilities.
Analyzes staged/unstaged changes and branch diffs for exploitable security issues
across 11 vulnerability categories. Minimizes false positives.
tools:
- "*"
promptParts:
includeAISafety: true
includeToolInstructions: true
includeParallelToolCalling: true
includeCustomAgentInstructions: false
includeEnvironmentContext: true
prompt: |
You are a senior security engineer conducting a thorough security review of code changes.
**File paths:**
- Use absolute paths for all file references (your working directory is shown in the `<environment_context>` section below).
OBJECTIVE:
Perform a security-focused code review to identify HIGH-CONFIDENCE security vulnerabilities that could have real exploitation potential. This is not a general code review — focus exclusively on security vulnerabilities present in the modified/added lines of code.
IMPORTANT: Flag vulnerabilities that exist in the changed code regions, even if the vulnerability was already present before these changes. The key requirement is that the vulnerable code appears in the diff.
CRITICAL INSTRUCTIONS:
1. MINIMIZE FALSE POSITIVES: Only flag issues where you're >80% confident of actual exploitability
2. AVOID NOISE: Skip theoretical issues, style concerns, or low-impact findings
3. FOCUS ON IMPACT: Prioritize vulnerabilities that could lead to unauthorized access, data breaches, or system compromise
4. EXCLUSIONS: Do NOT report the following issue types:
- Denial of Service (DOS) vulnerabilities, even if they allow service disruption
- Rate limiting or performance issues
- Secrets or sensitive data stored on disk
- Theoretical attacks without clear exploitation path
- Code style or maintainability concerns
- Issues in test code unless they indicate production vulnerabilities
- Memory consumption or CPU exhaustion issues
- Lack of input validation on non-security-critical fields
**How to Gather Context:**
1. **Understand the change scope** — Use git to see what changed:
- First check if there are staged/unstaged changes: `git --no-pager status`
- If there are staged changes: `git --no-pager diff --staged`
- If there are unstaged changes: `git --no-pager diff`
- If working directory is clean, check branch diff: `git --no-pager diff main...HEAD` (adjust branch name if user specifies)
- For recent commits: `git --no-pager log --oneline -10`
**Important:** If the working directory is clean (no staged/unstaged changes), review the branch diff against main instead. There are always changes to review if you're on a feature branch.
2. **Research repository context** (use file search tools):
- Identify existing security frameworks and libraries in use
- Look for established secure coding patterns in the codebase
- Examine existing sanitization and validation patterns
- Understand the project's security model and threat model
3. **Comparative analysis:**
- Compare new code changes against existing security patterns
- Identify deviations from established secure practices
- Look for inconsistent security implementations
- Flag vulnerable code patterns in the touched regions
4. **Vulnerability assessment:**
- Examine each modified file for security implications
- Trace data flow from user inputs to sensitive operations
- Look for privilege boundaries being crossed unsafely
- Identify injection points and unsafe deserialization
- Before dismissing a sink as safe, write down which guard applies; if you cannot name it, investigate further
**CRITICAL: You Must NEVER Modify Code.**
You have access to all tools for investigation purposes only:
- Use `bash` to run git commands, build, run tests, execute code
- Use `view` to read files and understand context
- Use `{{grepToolName}}` and `{{globToolName}}` to find related code
- Do NOT use `edit` or `create` to change files
<categories_to_examine>
1. `StringInjection`
Various APIs allow developers to construct code, database queries, shell commands, HTML/XML documents, JSON/YAML objects or other kinds of structured data from strings.
When using such APIs with untrusted input, it is important to either use safe-by-default APIs or to properly sanitize the untrusted data to prevent injection attacks.
- **Issues:**
- Unsafe use of string concatenation or formatting to build SQL queries, HTML, or shell commands where safer APIs are available.
- Absence of sanitization where it could lead to vulnerabilities.
- Insufficient escaping of metacharacters (e.g., forgetting to escape backslashes or backticks in shell commands, or ampersands in HTML), or escaping in the wrong order.
- Use of regular expressions to validate or sanitize untrusted data, which is error-prone and can lead to bypasses.
- **Non-Issues:**
- Safe-by-default APIs where escaping happens by default (e.g., HTML templating libraries, or command execution that avoids the operating system shell).
- Cases where there is not enough context to determine if a given input is untrusted.
- **Sources of Untrusted Data:**
- User input from HTTP request body, URL query parameters or CLI arguments.
- External data from databases, files, network requests or environment variables.
- Data that is safe in its original context but potentially unsafe in a different context.
2. `BadCrypto`
- **Issues:**
- Weak cryptographic algorithms (e.g., DES, MD5, SHA1, RC4).
- Insufficient key sizes (e.g., RSA < 2048 bits, AES < 128 bits).
- Use of pseudo-random number generators for cryptographic purposes.
- Unencrypted communication where encrypted alternatives are available.
- Storing passwords without strong hashing algorithms (e.g., bcrypt, scrypt, Argon2).
- **Non-Issues:**
- Use of weak cryptographic algorithms or insecure randomness for non-security relevant purposes (e.g., checksums, UUIDs).
- Local processing of sensitive data (e.g., in-memory encryption/decryption or password comparison).
3. `BrokenAccessControl`
- **Issues:**
- Path traversal via user-controlled data.
- Insufficient CSRF protection.
- Open redirects based on user input.
- **Non-Issues:**
- Issues involving trusted sources of user input, including command-line arguments, environment variables, local (non-web) user input.
- Only controlling the path, query or hash of a URL in an open redirect but not the host or protocol.
4. `HardcodedCredentials`
- **Issues:**
- Credentials, keys, or other sensitive data stored in cleartext in a source code file or a configuration file.
- **Non-Issues:**
- Sample or dummy credentials used for development or testing.
5. `SensitiveDataLeak`
- **Issues:**
- Storing sensitive data in cleartext in a file or database, or logging it to the console or a log file.
- Sending sensitive data over untrusted networks without encryption.
- **Non-Issues:**
- Leaks involving test data, example data or data that was read from a cleartext file/database.
- Leaks involving account names (rather than passwords), PII, HTTP headers (other than authentication), exception messages (not including stack traces).
- Leaks involving hashed, obfuscated or encrypted data.
6. `SecurityMisconfiguration`
- **Issues:**
- Unsafe default settings left unchanged.
- Overriding safe settings without justification (e.g., disabling CSP, HTTPS, or HttpOnly).
- Enabling unnecessary services or features (like CORS, debug settings, or external entity processing).
- Serving files from a directory that should not be public.
- Misconfigured error handling that could leak sensitive information.
- Using unsafe legacy APIs where a safer alternative is available.
- **Non-Issues:**
- Enabling unsafe features in development environments or debug builds.
- Enabling unsafe features for compatibility with external systems or older code.
7. `AuthenticationFailure`
- **Issues:**
- Insecure downloads using HTTP instead of HTTPS.
- Missing certificate validation.
- Insecure authentication mechanisms.
- Missing rate limiting or origin checks.
- Improper CORS configuration.
- Passwords read from plaintext configuration files.
- **Non-Issues:**
- HTTP links in documentation, comments, or user-configurable connections.
- Missing rate limiting or origin checks for non-sensitive operations.
8. `DataIntegrityFailure`
- **Issues:**
- Deserialization without integrity checks.
- Using HTTP instead of HTTPS for sensitive operations.
- Modifying or copying JavaScript objects without properly handling `__proto__` and `constructor` to prevent prototype pollution.
- Allowing execution of insecure content.
- **Non-Issues:**
- JSON deserialization for non-sensitive operations.
- Issues involving command-line arguments, configuration files, environment variables, local files, non-web user input.
- HTTP links in documentation, comments, or user-configurable connections.
9. `SSRF`
- **Issues:**
- Fetching data from a URL whose host or protocol may be controlled by an attacker.
- Attempts at preventing SSRF via deny lists or regular expressions.
- **Non-Issues:**
- Partial SSRF vulnerabilities (host is not controlled by the attacker, only the path/port/query/hash).
- URLs potentially leading to SSRF without clear evidence of attacker control.
10. `SupplyChainAttack`
- **Issues:**
- External third-party dependencies pinned only to mutable references (branches, tags such as `latest`) instead of immutable identifiers (commit SHAs, image digests, release hashes).
- Remote code or tooling downloaded and executed without integrity verification.
- Configurations where an attacker can influence which package, action, plugin, registry, or image reference is used.
- **Non-Issues:**
- Dependencies from explicitly officially maintained namespaces pinned to maintained branches or version tags.
- First-party dependencies from the same organization or monorepo.
- Dependencies already pinned to immutable references or vendored locally.
- Development-only tooling or local environments.
11. `XPIA` (Cross-Prompt Injection Attack)
- **Issues:**
- Untrusted data impacting LLM system/developer instructions/policy strings.
- Untrusted data impacting LLM tool selection, tool command-line construction, tool routing and tool availability.
- Untrusted data impacting LLM stage transitions/planning/"next step" logic.
- Untrusted data impacting an LLM prompt part instructing the model how to behave.
- Untrusted data impacting LLM override mechanisms (debug mode, eval flags, test bypasses).
- **Non-Issues:**
- Any issue not directly related to LLM usage is not an XPIA issue.
- If untrusted data is clearly sanitized before being used, it is not an issue.
- If untrusted data is clearly marked as untrusted when given to an LLM, it is not an issue.
</categories_to_examine>
<severity_and_confidence_guidelines>
SEVERITY GUIDELINES:
- **HIGH**: Directly exploitable vulnerabilities leading to RCE, data breach, or authentication bypass
- **MEDIUM**: Vulnerabilities requiring specific conditions but with significant impact
- **LOW**: Defense-in-depth issues or lower-impact vulnerabilities
CONFIDENCE SCORING:
- 9-10: Clear vulnerability with obvious exploitation path
- 8-9: High confidence vulnerability with well-understood attack vectors
- 7-8: Likely vulnerability requiring specific conditions to exploit
- 6-7: Potential security issue needing further investigation
- Below 6: Don't report (insufficient confidence)
IMPACT ASSESSMENT:
- **CRITICAL**: Remote code execution, full system compromise, data breach
- **HIGH**: Privilege escalation, authentication bypass, sensitive data access
- **MEDIUM**: Information disclosure, denial of service, limited data access
- **LOW**: Security control bypass, configuration issues
REPORTING THRESHOLDS:
- Report CRITICAL findings with confidence 6+
- Report HIGH findings with confidence 7+
- Report MEDIUM findings with confidence 8+
- Don't report LOW findings unless confidence 9+
</severity_and_confidence_guidelines>
**Output Format:**
If you find genuine security issues, report them like this:
```
## Security Findings
### Alert 1
**File:** path/to/file.ts:42
**Category:** StringInjection
**Severity: HIGH | Confidence: 9/10**
**Problem:** Clear explanation of the vulnerability and exploitation path
**Evidence:** How you verified this is a real, exploitable issue
**Suggested fix:** Brief description of the recommended fix (but do not implement it)
```
IMPORTANT: The severity line MUST use the format `**Severity: LEVEL | Confidence: N/10**` with the entire line in bold, where LEVEL is one of CRITICAL, HIGH, MEDIUM, or LOW.
If you find NO issues worth reporting, simply say:
"No security vulnerabilities found in the reviewed changes."
FINAL REMINDER:
You are looking for REAL security vulnerabilities that could be exploited by attackers. Focus on finding genuine security issues, not theoretical concerns.
Be thorough but precise. Better to find one real vulnerability than report ten false positives.
Do not pad your response with filler. Do not summarize what you looked at. Do not give compliments about the code. Just report findings or confirm there are none.
Remember: Silence is better than noise. Every comment you make should be worth the reader's time.
# Cache-optimized ("split") variant of task.agent.yaml.
#
# Loaded instead of the base definition when the SPLIT_SUBAGENT_SYSTEM_MESSAGE_CACHE
# flag is enabled. Identical to task.agent.yaml EXCEPT the per-session working
# directory is moved out of the prompt body into a trailing <environment_context>
# block (includeEnvironmentContext: true). This keeps the body + tool instructions a
# cwd-free, cacheable static prefix while the cwd lives in the per-user block.
# Keep this file in sync with task.agent.yaml (it should differ only in cwd handling).
name: task
displayName: Task Agent
description: >
Execute development commands like tests, builds, linters, and formatters.
Returns brief summary on success, full output on failure. Keeps main context
clean by minimizing verbose output.
model: claude-haiku-4.5
tools:
- "*"
promptParts:
includeAISafety: true
includeToolInstructions: true
includeParallelToolCalling: true
includeCustomAgentInstructions: false
includeEnvironmentContext: true
prompt: |
You are a command execution agent that runs development commands and reports results efficiently.
**Tools:**
- You have access to all CLI tools including bash, file editing, {{grepToolName}}, {{globToolName}}, etc. Your working directory is shown in the `<environment_context>` section below.
**Your role:**
Execute commands such as:
- Running tests (e.g., "npm run test", "pytest", "go test")
- Building code (e.g., "npm run build", "make", "cargo build")
- Linting code (e.g., "npm run lint", "eslint", "ruff")
- Installing dependencies (e.g., "npm install", "pip install")
- Running formatters (e.g., "npm run format", "prettier")
**CRITICAL - Output format to minimize context pollution:**
- On SUCCESS: Return brief one-line summary
* Examples: "All 247 tests passed", "Build succeeded in 45s", "No lint errors found", "Installed 42 packages"
- On FAILURE: Return full error output for debugging
* Include complete stack traces, compiler errors, lint issues
* Provide all information needed to diagnose the problem
- Do NOT attempt to fix errors, analyze issues, or make suggestions - just execute and report
- Do NOT retry on failure - execute once and report the result
**Best practices:**
- Use appropriate timeouts: tests/builds (200-300 seconds), lints (60 seconds)
- Execute the command exactly as requested
- Report concisely on success, verbosely on failure
Remember: Your job is to execute commands efficiently and minimize context pollution from verbose successful output while providing complete failure information for debugging.
+4
-0

@@ -0,1 +1,5 @@

# NOTE: If you edit this agent, also update code-review.split.agent.yaml — the
# cache-optimized variant loaded when SPLIT_SUBAGENT_SYSTEM_MESSAGE_CACHE is on.
# The variant must stay identical to this file EXCEPT it moves the working
# directory out of the prompt body into a trailing <environment_context> block.
name: code-review

@@ -2,0 +6,0 @@ displayName: Code Review Agent

@@ -0,1 +1,5 @@

# NOTE: If you edit this agent, also update explore.split.agent.yaml — the
# cache-optimized variant loaded when SPLIT_SUBAGENT_SYSTEM_MESSAGE_CACHE is on.
# The variant must stay identical to this file EXCEPT it moves the working
# directory out of the prompt body into a trailing <environment_context> block.
name: explore

@@ -2,0 +6,0 @@ displayName: Explore Agent

@@ -0,1 +1,5 @@

# NOTE: If you edit this agent, also update research.split.agent.yaml — the
# cache-optimized variant loaded when SPLIT_SUBAGENT_SYSTEM_MESSAGE_CACHE is on.
# The variant must stay identical to this file EXCEPT it moves the working
# directory out of the prompt body into a trailing <environment_context> block.
name: research

@@ -2,0 +6,0 @@ displayName: Research Agent

@@ -0,1 +1,5 @@

# NOTE: If you edit this agent, also update rubber-duck.split.agent.yaml — the
# cache-optimized variant loaded when SPLIT_SUBAGENT_SYSTEM_MESSAGE_CACHE is on.
# The variant must stay identical to this file EXCEPT it moves the working
# directory out of the prompt body into a trailing <environment_context> block.
name: rubber-duck

@@ -2,0 +6,0 @@ displayName: Rubber Duck Agent

@@ -0,1 +1,5 @@

# NOTE: If you edit this agent, also update security-review.split.agent.yaml — the
# cache-optimized variant loaded when SPLIT_SUBAGENT_SYSTEM_MESSAGE_CACHE is on.
# The variant must stay identical to this file EXCEPT it moves the working
# directory out of the prompt body into a trailing <environment_context> block.
name: security-review

@@ -262,2 +266,2 @@ displayName: Security Review Agent

Remember: Silence is better than noise. Every comment you make should be worth the reader's time.
Remember: Silence is better than noise. Every comment you make should be worth the reader's time.

@@ -18,2 +18,4 @@ name: github-context

- send_inbox
promptParts:
includeOutputChannelInstructions: inbox
prompt: |

@@ -20,0 +22,0 @@ You are the builtin GitHub context sidekick agent.

@@ -15,2 +15,3 @@ name: subconscious-agent

includeEnvironmentContext: false
includeOutputChannelInstructions: inbox
prompt: |

@@ -17,0 +18,0 @@ You are the builtin Copilot Subconscious sidekick agent.

@@ -9,2 +9,4 @@ name: test-sidekick-persistent

- send_inbox
promptParts:
includeOutputChannelInstructions: inbox
prompt: |

@@ -11,0 +13,0 @@ You are a test-only sidekick agent. Your sole purpose is to exercise the sidekick framework in automated tests.

@@ -9,2 +9,4 @@ name: test-sidekick-restart

- send_inbox
promptParts:
includeOutputChannelInstructions: inbox
prompt: |

@@ -11,0 +13,0 @@ You are a test-only sidekick agent. Your sole purpose is to exercise the sidekick framework in automated tests.

@@ -0,1 +1,5 @@

# NOTE: If you edit this agent, also update task.split.agent.yaml — the
# cache-optimized variant loaded when SPLIT_SUBAGENT_SYSTEM_MESSAGE_CACHE is on.
# The variant must stay identical to this file EXCEPT it moves the working
# directory out of the prompt body into a trailing <environment_context> block.
name: task

@@ -2,0 +6,0 @@ displayName: Task Agent

+7
-7

@@ -9,8 +9,8 @@ #!/usr/bin/env node

var Be=Object.create;var D=Object.defineProperty;var Ue=Object.getOwnPropertyDescriptor;var Ve=Object.getOwnPropertyNames;var Ge=Object.getPrototypeOf,We=Object.prototype.hasOwnProperty;var j=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var x=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}};var qe=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ve(t))!We.call(e,o)&&o!==r&&D(e,o,{get:()=>t[o],enumerable:!(n=Ue(t,o))||n.enumerable});return e};var Ye=(e,t,r)=>(r=e!=null?Be(Ge(e)):{},qe(t||!e||!e.__esModule?D(r,"default",{value:e,enumerable:!0}):r,e));var z=x((Kt,X)=>{"use strict";var J=()=>process.platform==="linux",w=null,Ze=()=>{if(!w)if(J()&&process.report){let e=process.report.excludeNetwork;process.report.excludeNetwork=!0,w=process.report.getReport(),process.report.excludeNetwork=e}else w={};return w};X.exports={isLinux:J,getReport:Ze}});var Z=x((Jt,Q)=>{"use strict";var b=j("fs"),et="/usr/bin/ldd",tt="/proc/self/exe",S=2048,rt=e=>{let t=b.openSync(e,"r"),r=Buffer.alloc(S),n=b.readSync(t,r,0,S,0);return b.close(t,()=>{}),r.subarray(0,n)},nt=e=>new Promise((t,r)=>{b.open(e,"r",(n,o)=>{if(n)r(n);else{let s=Buffer.alloc(S);b.read(o,s,0,S,0,(i,a)=>{t(s.subarray(0,a)),b.close(o,()=>{})})}})});Q.exports={LDD_PATH:et,SELF_PATH:tt,readFileSync:rt,readFile:nt}});var te=x((Xt,ee)=>{"use strict";var ot=e=>{if(e.length<64||e.readUInt32BE(0)!==2135247942||e.readUInt8(4)!==2||e.readUInt8(5)!==1)return null;let t=e.readUInt32LE(32),r=e.readUInt16LE(54),n=e.readUInt16LE(56);for(let o=0;o<n;o++){let s=t+o*r;if(e.readUInt32LE(s)===3){let a=e.readUInt32LE(s+8),h=e.readUInt32LE(s+32);return e.subarray(a,a+h).toString().replace(/\0.*$/g,"")}}return null};ee.exports={interpreterPath:ot}});var xe=x((zt,Ee)=>{"use strict";var ne=j("child_process"),{isLinux:y,getReport:oe}=z(),{LDD_PATH:C,SELF_PATH:se,readFile:P,readFileSync:T}=Z(),{interpreterPath:ie}=te(),l,f,d,ae="getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",m="",ce=()=>m||new Promise(e=>{ne.exec(ae,(t,r)=>{m=t?" ":r,e(m)})}),ue=()=>{if(!m)try{m=ne.execSync(ae,{encoding:"utf8"})}catch{m=" "}return m},p="glibc",le=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,g="musl",st=e=>e.includes("libc.musl-")||e.includes("ld-musl-"),fe=()=>{let e=oe();return e.header&&e.header.glibcVersionRuntime?p:Array.isArray(e.sharedObjects)&&e.sharedObjects.some(st)?g:null},de=e=>{let[t,r]=e.split(/[\r\n]+/);return t&&t.includes(p)?p:r&&r.includes(g)?g:null},pe=e=>{if(e){if(e.includes("/ld-musl-"))return g;if(e.includes("/ld-linux-"))return p}return null},me=e=>(e=e.toString(),e.includes("musl")?g:e.includes("GNU C Library")?p:null),it=async()=>{if(f!==void 0)return f;f=null;try{let e=await P(C);f=me(e)}catch{}return f},at=()=>{if(f!==void 0)return f;f=null;try{let e=T(C);f=me(e)}catch{}return f},ct=async()=>{if(l!==void 0)return l;l=null;try{let e=await P(se),t=ie(e);l=pe(t)}catch{}return l},ut=()=>{if(l!==void 0)return l;l=null;try{let e=T(se),t=ie(e);l=pe(t)}catch{}return l},ge=async()=>{let e=null;if(y()&&(e=await ct(),!e&&(e=await it(),e||(e=fe()),!e))){let t=await ce();e=de(t)}return e},he=()=>{let e=null;if(y()&&(e=ut(),!e&&(e=at(),e||(e=fe()),!e))){let t=ue();e=de(t)}return e},lt=async()=>y()&&await ge()!==p,ft=()=>y()&&he()!==p,dt=async()=>{if(d!==void 0)return d;d=null;try{let t=(await P(C)).match(le);t&&(d=t[1])}catch{}return d},pt=()=>{if(d!==void 0)return d;d=null;try{let t=T(C).match(le);t&&(d=t[1])}catch{}return d},be=()=>{let e=oe();return e.header&&e.header.glibcVersionRuntime?e.header.glibcVersionRuntime:null},re=e=>e.trim().split(/\s+/)[1],ye=e=>{let[t,r,n]=e.split(/[\r\n]+/);return t&&t.includes(p)?re(t):r&&n&&r.includes(g)?re(n):null},mt=async()=>{let e=null;if(y()&&(e=await dt(),e||(e=be()),!e)){let t=await ce();e=ye(t)}return e},gt=()=>{let e=null;if(y()&&(e=pt(),e||(e=be()),!e)){let t=ue();e=ye(t)}return e};Ee.exports={GLIBC:p,MUSL:g,family:ge,familySync:he,isNonGlibcLinux:lt,isNonGlibcLinuxSync:ft,version:mt,versionSync:gt}});import $t from"node:module";import{dirname as Mt,join as Dt}from"node:path";import*as je from"node:sea";import{fileURLToPath as jt,pathToFileURL as F}from"node:url";import{basename as ht,join as I}from"node:path";var B="0.0.1";import{readdir as Ke,access as Je,constants as Xe}from"node:fs/promises";import{join as c,basename as U}from"node:path";import{homedir as v}from"node:os";function G(){return process.env.XDG_CACHE_HOME||c(v(),".cache")}function W(){if(process.argv.includes("--no-auto-update")||process.argv.includes("--prefer-version"))return!1;let e=process.env.COPILOT_AUTO_UPDATE;return!(e&&e.toLowerCase()==="false")}function q(){let e=process.argv.indexOf("--prefer-version");if(!(e===-1||e+1>=process.argv.length))return process.argv[e+1]}function ze(){if(process.platform==="darwin")return c(v(),"Library","Caches","copilot");if(process.platform==="win32"){let e=process.env.LOCALAPPDATA||c(v(),".cache");return c(e,"copilot")}return c(G(),"copilot")}function Y(){let e=[];return process.env.COPILOT_CACHE_HOME&&e.push(c(process.env.COPILOT_CACHE_HOME,"pkg")),e.push(c(ze(),"pkg")),e.push(c(G(),"copilot","pkg")),process.env.COPILOT_HOME&&e.push(c(process.env.COPILOT_HOME,"pkg")),e.push(c(v(),".copilot","pkg")),[...new Set(e)]}function V(e){let t=e.match(/^(\d+)\.(\d+)\.(\d+)/);if(t)return[Number(t[1]),Number(t[2]),Number(t[3])]}function Qe(e,t){let r=V(e),n=V(t);if(!r&&!n)return 0;if(!r)return-1;if(!n)return 1;for(let i=0;i<3;i++)if(r[i]!==n[i])return r[i]-n[i];let o=e.includes("-"),s=t.includes("-");return o!==s?o?-1:1:e.localeCompare(t)}async function K(e,...t){let r=[];for(let n of t){let o;try{o=await Ke(n)}catch{continue}for(let s of o){let i=c(n,s);try{await Je(c(i,e),Xe.R_OK),r.push(i)}catch{continue}}}return r.sort((n,o)=>{let s=Qe(U(o),U(n));return s!==0?s:n.localeCompare(o)}),r}import{join as we}from"node:path";var _=Ye(xe(),1);function O(e={}){return(e.platform??process.platform)!=="linux"?"gnu":(e.detectLibcFamily??_.familySync)()===_.MUSL?"musl":"gnu"}function A(e=process.platform,t){let r=t??(e==="linux"?O():"gnu");return e==="linux"&&r==="musl"?"linuxmusl":e}function ve(e=process.platform,t,r=process.arch){return`${A(e,t)}-${r}`}function Se(){let e=ve();return Y().flatMap(t=>[we(t,"universal"),we(t,e)])}function bt(){return process.env.COPILOT_CLI_VERSION?process.env.COPILOT_CLI_VERSION:"1.0.65"}async function Ce(e,t){let r=I(e,"app.js"),n=bt()===B,o=q();if(t&&(o||W()&&!n)){let s=Se(),i=await K("app.js",...s);if(o){let a=i.find(h=>ht(h)===o);a?r=I(a,"app.js"):process.stderr.write(`Warning: preferred version ${o} not found in package cache, using built-in version
`)}else i.length>0&&(r=I(i[0],"app.js"))}return r}import{existsSync as yt}from"node:fs";import{basename as Et,resolve as xt}from"node:path";var _e="extension_bootstrap.mjs";function Oe(e,t,r=yt){let n=e.find(i=>Et(i)===_e);if(!n)return;process.stderr.write(`[extension-fork] resolveBootstrapPath: __dir=${t}, argv-bootstrap=${n}
`);let o=xt(t,"preloads",_e),s=r(o);if(process.stderr.write(`[extension-fork] resolveBootstrapPath: localBootstrap=${o}, localExists=${s}
`),s)return o}var vt=new Set(["--server","--headless","--acp"]),wt=new Set(["completion","help","init","login","mcp","plugin","update","version"]);function St(e){return e==="--prompt"||e.startsWith("--prompt=")||e==="-p"||e.startsWith("-p")&&e.length>2}function Ct(e){if(e.some(r=>vt.has(r)||St(r)))return!0;let t=e.find(r=>!r.startsWith("-"));return t!==void 0&&wt.has(t)}function ke(e){return!Ct(e)}var _t="github.copilot.cli.typeahead.capture",Le=Symbol.for(_t);function N(){let e=globalThis,t=e[Le];return t||(t={buffer:[],capturing:!1,listener:null,exitHandler:null},e[Le]=t),t}var R=class{detachListener(t){t.listener&&(process.stdin.removeListener("data",t.listener),t.listener=null)}clearExitHandler(t){t.exitHandler&&(process.removeListener("exit",t.exitHandler),t.exitHandler=null)}start(){let t=N();if(!process.stdin.isTTY||typeof process.stdin.setRawMode!="function"||t.capturing)return;try{process.stdin.setRawMode(!0)}catch{return}if(!t.exitHandler){let n=()=>{if(t.capturing)try{process.stdin.setRawMode(!1)}catch{}};t.exitHandler=n,process.once("exit",n)}let r=n=>{if(n.length===1&&n[0]===3){this.dispose(),process.kill(process.pid,"SIGINT");return}t.buffer.push(Buffer.from(n))};t.listener=r,process.stdin.on("data",r),process.stdin.unref(),t.capturing=!0}drain(){let t=N();if(this.detachListener(t),this.clearExitHandler(t),t.capturing=!1,t.buffer.length===0)return null;let r=Buffer.concat(t.buffer);return t.buffer=[],r}dispose(){let t=N();if(this.detachListener(t),this.clearExitHandler(t),t.buffer=[],!!t.capturing){try{process.stdin.setRawMode(!1)}catch{}process.stdin.pause(),t.capturing=!1}}},Pe=new R;import He from"node:path";import{fileURLToPath as Ht}from"node:url";function Ot(e){if(e.includes("<!DOCTYPE")||e.includes("<html")){let t=Math.min(e.indexOf("<!DOCTYPE")!==-1?e.indexOf("<!DOCTYPE"):1/0,e.indexOf("<html")!==-1?e.indexOf("<html"):1/0),r=e.substring(0,t).trim();return r?`${r} [HTML error page omitted]`:"[HTML error page omitted]"}return e}function Te(e){let t;if(e instanceof Error)t=String(e);else if(typeof e=="object"&&e!==null)try{t=JSON.stringify(e)??"[object]"}catch{return"[object with circular reference]"}else t=String(e);return Ot(t)}import{createRequire as kt}from"node:module";import{platform as Lt,type as Pt}from"node:os";import{join as Ae,resolve as Tt}from"node:path";import{fileURLToPath as At}from"node:url";function It(){let e=Ne(),t=e==="linux"?O({platform:e}):"gnu";return`${A(e,t)}-${process.arch}`}function Nt(){let e=Ne(),{arch:t}=process;switch(e){case"win32":return`win32-${t}-msvc`;case"darwin":return`darwin-${t}`;case"linux":return`linux-${t}-${O({platform:e})}`;default:throw new Error(`Unsupported platform: ${e}/${t}`)}}var u;function Ne(){if(u!==void 0)return u;switch(Pt()){case"Windows_NT":u="win32";break;case"Darwin":u="darwin";break;case"Linux":u="linux";break;case"AIX":u="aix";break;case"FreeBSD":case"DragonFly":u="freebsd";break;case"OpenBSD":u="openbsd";break;case"NetBSD":u="netbsd";break;case"SunOS":u="sunos";break;default:u=Lt();break}return u}function Re(e,t){let r=It(),n=`${e}.node`,o=`${e}.${Nt()}.node`,s=[];for(let a of t){let h=Tt(a),$=Ae(h,"prebuilds",r,n),k=Ie($);if(k.ok)return k.value;s.push({path:$,err:k.err});let M=Ae(h,o),L=Ie(M);if(L.ok)return L.value;s.push({path:M,err:L.err})}let i=s.map(a=>` ${a.path}: ${Rt(a.err)}`).join(`
`);throw new Error(`Native addon "${e}" not found for ${r}. Tried:
${i}`)}function Rt(e){if(e instanceof Error)return e.message;if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return Object.prototype.toString.call(e)}}function Ie(e){try{return{ok:!0,value:Ft(e)}}catch(t){return{ok:!1,err:t}}}function Ft(e){return kt(At(import.meta.url))(e)}var E,Fe=He.dirname(Ht(import.meta.url));function $e(){if(E){if(E.kind==="ok")return E.addon;throw E.error}try{let e=Re("cli-native",[Fe,He.resolve(Fe,"..","native","cli")]);return E={kind:"ok",addon:e},e}catch(e){let t=e instanceof Error?e:new Error(`Failed to load cli-native addon: ${Te(e)}`);throw E={kind:"error",error:t},t}}function Me(){if(process.platform==="win32")return $e()}try{$t.enableCompileCache?.()}catch{}var H=Mt(jt(import.meta.url)),Bt=je.isSea();process.report.reportOnFatalError=!0;process.report.excludeEnv=!0;if(process.platform==="win32")try{let e=Me();if(!e)throw new Error("loadWin32NativeAddon returned undefined on win32");e.enableCrashReporting(),e.installExceptionFilter()}catch{}var De=Oe(process.argv,H);if(De)await import(F(De).href);else if(process.env.COPILOT_VOICE_SERVER_MODE==="1"){let e=Dt(H,"voice-server.js");try{let{runVoiceServer:t}=await import(F(e).href);await t()}catch(t){process.stderr.write(`voice server: fatal at ${e}: ${t.stack??String(t)}
`),process.exit(1)}}else if(process.env.COPILOT_SHUTDOWN_FLUSH){try{let{url:e,headers:t,body:r}=JSON.parse(process.env.COPILOT_SHUTDOWN_FLUSH);await fetch(e,{method:"POST",headers:t,body:r,signal:AbortSignal.timeout(3e4)})}catch{}process.exit(0)}else{ke(process.argv.slice(2))&&Pe.start();let e=await Ce(H,Bt);await import(F(e).href)}
var Ve=Object.create;var B=Object.defineProperty;var Ue=Object.getOwnPropertyDescriptor;var je=Object.getOwnPropertyNames;var We=Object.getPrototypeOf,qe=Object.prototype.hasOwnProperty;var M=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(r,t)=>(typeof require<"u"?require:r)[t]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var x=(e,r)=>()=>{try{return r||e((r={exports:{}}).exports,r),r.exports}catch(t){throw r=0,t}};var Ge=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of je(r))!qe.call(e,o)&&o!==t&&B(e,o,{get:()=>r[o],enumerable:!(n=Ue(r,o))||n.enumerable});return e};var Ke=(e,r,t)=>(t=e!=null?Ve(We(e)):{},Ge(r||!e||!e.__esModule?B(t,"default",{value:e,enumerable:!0}):t,e));var X=x((Jr,z)=>{"use strict";var Y=()=>process.platform==="linux",L=null,Ze=()=>{if(!L)if(Y()&&process.report){let e=process.report.excludeNetwork;process.report.excludeNetwork=!0,L=process.report.getReport(),process.report.excludeNetwork=e}else L={};return L};z.exports={isLinux:Y,getReport:Ze}});var Z=x((Yr,Q)=>{"use strict";var y=M("fs"),er="/usr/bin/ldd",rr="/proc/self/exe",S=2048,tr=e=>{let r=y.openSync(e,"r"),t=Buffer.alloc(S),n=y.readSync(r,t,0,S,0);return y.close(r,()=>{}),t.subarray(0,n)},nr=e=>new Promise((r,t)=>{y.open(e,"r",(n,o)=>{if(n)t(n);else{let i=Buffer.alloc(S);y.read(o,i,0,S,0,(s,c)=>{r(i.subarray(0,c)),y.close(o,()=>{})})}})});Q.exports={LDD_PATH:er,SELF_PATH:rr,readFileSync:tr,readFile:nr}});var re=x((zr,ee)=>{"use strict";var or=e=>{if(e.length<64||e.readUInt32BE(0)!==2135247942||e.readUInt8(4)!==2||e.readUInt8(5)!==1)return null;let r=e.readUInt32LE(32),t=e.readUInt16LE(54),n=e.readUInt16LE(56);for(let o=0;o<n;o++){let i=r+o*t;if(e.readUInt32LE(i)===3){let c=e.readUInt32LE(i+8),h=e.readUInt32LE(i+32);return e.subarray(c,c+h).toString().replace(/\0.*$/g,"")}}return null};ee.exports={interpreterPath:or}});var xe=x((Xr,ve)=>{"use strict";var ne=M("child_process"),{isLinux:b,getReport:oe}=X(),{LDD_PATH:C,SELF_PATH:ie,readFile:w,readFileSync:I}=Z(),{interpreterPath:se}=re(),u,f,d,ce="getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",m="",ae=()=>m||new Promise(e=>{ne.exec(ce,(r,t)=>{m=r?" ":t,e(m)})}),le=()=>{if(!m)try{m=ne.execSync(ce,{encoding:"utf8"})}catch{m=" "}return m},p="glibc",ue=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,g="musl",ir=e=>e.includes("libc.musl-")||e.includes("ld-musl-"),fe=()=>{let e=oe();return e.header&&e.header.glibcVersionRuntime?p:Array.isArray(e.sharedObjects)&&e.sharedObjects.some(ir)?g:null},de=e=>{let[r,t]=e.split(/[\r\n]+/);return r&&r.includes(p)?p:t&&t.includes(g)?g:null},pe=e=>{if(e){if(e.includes("/ld-musl-"))return g;if(e.includes("/ld-linux-"))return p}return null},me=e=>(e=e.toString(),e.includes("musl")?g:e.includes("GNU C Library")?p:null),sr=async()=>{if(f!==void 0)return f;f=null;try{let e=await w(C);f=me(e)}catch{}return f},cr=()=>{if(f!==void 0)return f;f=null;try{let e=I(C);f=me(e)}catch{}return f},ar=async()=>{if(u!==void 0)return u;u=null;try{let e=await w(ie),r=se(e);u=pe(r)}catch{}return u},lr=()=>{if(u!==void 0)return u;u=null;try{let e=I(ie),r=se(e);u=pe(r)}catch{}return u},ge=async()=>{let e=null;if(b()&&(e=await ar(),!e&&(e=await sr(),e||(e=fe()),!e))){let r=await ae();e=de(r)}return e},he=()=>{let e=null;if(b()&&(e=lr(),!e&&(e=cr(),e||(e=fe()),!e))){let r=le();e=de(r)}return e},ur=async()=>b()&&await ge()!==p,fr=()=>b()&&he()!==p,dr=async()=>{if(d!==void 0)return d;d=null;try{let r=(await w(C)).match(ue);r&&(d=r[1])}catch{}return d},pr=()=>{if(d!==void 0)return d;d=null;try{let r=I(C).match(ue);r&&(d=r[1])}catch{}return d},ye=()=>{let e=oe();return e.header&&e.header.glibcVersionRuntime?e.header.glibcVersionRuntime:null},te=e=>e.trim().split(/\s+/)[1],be=e=>{let[r,t,n]=e.split(/[\r\n]+/);return r&&r.includes(p)?te(r):t&&n&&t.includes(g)?te(n):null},mr=async()=>{let e=null;if(b()&&(e=await dr(),e||(e=ye()),!e)){let r=await ae();e=be(r)}return e},gr=()=>{let e=null;if(b()&&(e=pr(),e||(e=ye()),!e)){let r=le();e=be(r)}return e};ve.exports={GLIBC:p,MUSL:g,family:ge,familySync:he,isNonGlibcLinux:ur,isNonGlibcLinuxSync:fr,version:mr,versionSync:gr}});import Dr from"node:module";import{dirname as $r,join as Br}from"node:path";import*as Me from"node:sea";import{fileURLToPath as Mr,pathToFileURL as k}from"node:url";import{basename as hr,join as A}from"node:path";var V="0.0.1";import{readdir as Je,access as Ye,constants as ze}from"node:fs/promises";import{join as a,basename as U}from"node:path";import{homedir as E}from"node:os";function W(){return process.env.XDG_CACHE_HOME||a(E(),".cache")}function q(){if(process.argv.includes("--no-auto-update")||process.argv.includes("--prefer-version"))return!1;let e=process.env.COPILOT_AUTO_UPDATE;return!(e&&e.toLowerCase()==="false")}function G(){let e=process.argv.indexOf("--prefer-version");if(!(e===-1||e+1>=process.argv.length))return process.argv[e+1]}function Xe(){if(process.platform==="darwin")return a(E(),"Library","Caches","copilot");if(process.platform==="win32"){let e=process.env.LOCALAPPDATA||a(E(),".cache");return a(e,"copilot")}return a(W(),"copilot")}function K(){let e=[];return process.env.COPILOT_CACHE_HOME&&e.push(a(process.env.COPILOT_CACHE_HOME,"pkg")),e.push(a(Xe(),"pkg")),e.push(a(W(),"copilot","pkg")),process.env.COPILOT_HOME&&e.push(a(process.env.COPILOT_HOME,"pkg")),e.push(a(E(),".copilot","pkg")),[...new Set(e)]}function j(e){let r=e.match(/^(\d+)\.(\d+)\.(\d+)/);if(r)return[Number(r[1]),Number(r[2]),Number(r[3])]}function Qe(e,r){let t=j(e),n=j(r);if(!t&&!n)return 0;if(!t)return-1;if(!n)return 1;for(let s=0;s<3;s++)if(t[s]!==n[s])return t[s]-n[s];let o=e.includes("-"),i=r.includes("-");return o!==i?o?-1:1:e.localeCompare(r)}async function J(e,...r){let t=[];for(let n of r){let o;try{o=await Je(n)}catch{continue}for(let i of o){let s=a(n,i);try{await Ye(a(s,e),ze.R_OK),t.push(s)}catch{continue}}}return t.sort((n,o)=>{let i=Qe(U(o),U(n));return i!==0?i:n.localeCompare(o)}),t}import{join as Le}from"node:path";var P=Ke(xe(),1);function T(e={}){return(e.platform??process.platform)!=="linux"?"gnu":(e.detectLibcFamily??P.familySync)()===P.MUSL?"musl":"gnu"}function N(e=process.platform,r){let t=r??(e==="linux"?T():"gnu");return e==="linux"&&t==="musl"?"linuxmusl":e}function Ee(e=process.platform,r,t=process.arch){return`${N(e,r)}-${t}`}function Se(){let e=Ee();return K().flatMap(r=>[Le(r,"universal"),Le(r,e)])}function yr(){return process.env.COPILOT_CLI_VERSION?process.env.COPILOT_CLI_VERSION:"1.0.66-0"}async function Ce(e,r){let t=A(e,"app.js"),n=yr()===V,o=G();if(r&&(o||q()&&!n)){let i=Se(),s=await J("app.js",...i);if(o){let c=s.find(h=>hr(h)===o);c?t=A(c,"app.js"):process.stderr.write(`Warning: preferred version ${o} not found in package cache, using built-in version
`)}else s.length>0&&(t=A(s[0],"app.js"))}return t}import{existsSync as br}from"node:fs";import{basename as vr,resolve as xr}from"node:path";var Pe="extension_bootstrap.mjs";function Te(e,r,t=br){let n=e.find(s=>vr(s)===Pe);if(!n)return;process.stderr.write(`[extension-fork] resolveBootstrapPath: __dir=${r}, argv-bootstrap=${n}
`);let o=xr(r,"preloads",Pe),i=t(o);if(process.stderr.write(`[extension-fork] resolveBootstrapPath: localBootstrap=${o}, localExists=${i}
`),i)return o}var Er=new Set(["--server","--headless","--acp"]),Lr=new Set(["completion","help","init","login","mcp","plugin","update","version"]);function Sr(e){return e==="--prompt"||e.startsWith("--prompt=")||e==="-p"||e.startsWith("-p")&&e.length>2}function Cr(e){if(e.some(t=>Er.has(t)||Sr(t)))return!0;let r=e.find(t=>!t.startsWith("-"));return r!==void 0&&Lr.has(r)}function Oe(e){return!Cr(e)}var Pr="github.copilot.cli.typeahead.capture",_e=Symbol.for(Pr);function F(){let e=globalThis,r=e[_e];return r||(r={buffer:[],capturing:!1,listener:null,exitHandler:null},e[_e]=r),r}var H=class{detachListener(r){r.listener&&(process.stdin.removeListener("data",r.listener),r.listener=null)}clearExitHandler(r){r.exitHandler&&(process.removeListener("exit",r.exitHandler),r.exitHandler=null)}start(){let r=F();if(!process.stdin.isTTY||typeof process.stdin.setRawMode!="function"||r.capturing)return;try{process.stdin.setRawMode(!0)}catch{return}if(!r.exitHandler){let n=()=>{if(r.capturing)try{process.stdin.setRawMode(!1)}catch{}};r.exitHandler=n,process.once("exit",n)}let t=n=>{if(n.length===1&&n[0]===3){this.dispose(),process.kill(process.pid,"SIGINT");return}r.buffer.push(Buffer.from(n))};r.listener=t,process.stdin.on("data",t),process.stdin.unref(),r.capturing=!0}drain(){let r=F();if(this.detachListener(r),this.clearExitHandler(r),r.capturing=!1,r.buffer.length===0)return null;let t=Buffer.concat(r.buffer);return r.buffer=[],t}dispose(){let r=F();if(this.detachListener(r),this.clearExitHandler(r),r.buffer=[],!!r.capturing){try{process.stdin.setRawMode(!1)}catch{}process.stdin.pause(),r.capturing=!1}}},we=new H;import Re from"node:path";import{fileURLToPath as Rr}from"node:url";function Tr(e){if(e.includes("<!DOCTYPE")||e.includes("<html")){let r=Math.min(e.indexOf("<!DOCTYPE")!==-1?e.indexOf("<!DOCTYPE"):1/0,e.indexOf("<html")!==-1?e.indexOf("<html"):1/0),t=e.substring(0,r).trim();return t?`${t} [HTML error page omitted]`:"[HTML error page omitted]"}return e}function Ie(e){let r;if(e instanceof Error)r=String(e);else if(typeof e=="object"&&e!==null)try{r=JSON.stringify(e)??"[object]"}catch{return"[object with circular reference]"}else r=String(e);return Tr(r)}import{createRequire as Or}from"node:module";import{platform as _r,type as wr}from"node:os";import{join as Ne,resolve as Ir}from"node:path";import{fileURLToPath as Nr}from"node:url";function Ar(){let e=Fe(),r=e==="linux"?T({platform:e}):"gnu";return`${N(e,r)}-${process.arch}`}function Fr(){let e=Fe(),{arch:r}=process;switch(e){case"win32":return`win32-${r}-msvc`;case"darwin":return`darwin-${r}`;case"linux":return`linux-${r}-${T({platform:e})}`;default:throw new Error(`Unsupported platform: ${e}/${r}`)}}var l;function Fe(){if(l!==void 0)return l;switch(wr()){case"Windows_NT":l="win32";break;case"Darwin":l="darwin";break;case"Linux":l="linux";break;case"AIX":l="aix";break;case"FreeBSD":case"DragonFly":l="freebsd";break;case"OpenBSD":l="openbsd";break;case"NetBSD":l="netbsd";break;case"SunOS":l="sunos";break;default:l=_r();break}return l}function He(e,r){let t=Ar(),n=`${e}.node`,o=`${e}.${Fr()}.node`,i=[];for(let c of r){let h=Ir(c),D=Ne(h,"prebuilds",t,n),O=Ae(D);if(O.ok)return O.value;i.push({path:D,err:O.err});let $=Ne(h,o),_=Ae($);if(_.ok)return _.value;i.push({path:$,err:_.err})}let s=i.map(c=>` ${c.path}: ${Hr(c.err)}`).join(`
`);throw new Error(`Native addon "${e}" not found for ${t}. Tried:
${s}`)}function Hr(e){if(e instanceof Error)return e.message;if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return Object.prototype.toString.call(e)}}function Ae(e){try{return{ok:!0,value:kr(e)}}catch(r){return{ok:!1,err:r}}}function kr(e){return Or(Nr(import.meta.url))(e)}var v,ke=Re.dirname(Rr(import.meta.url));function De(){if(v){if(v.kind==="ok")return v.addon;throw v.error}try{let e=He("cli-native",[ke,Re.resolve(ke,"..","native","cli")]);return v={kind:"ok",addon:e},e}catch(e){let r=e instanceof Error?e:new Error(`Failed to load cli-native addon: ${Ie(e)}`);throw v={kind:"error",error:r},r}}function $e(){if(process.platform==="win32")return De()}try{Dr.enableCompileCache?.()}catch{}var R=$r(Mr(import.meta.url)),Vr=Me.isSea();process.report.reportOnFatalError=!0;process.report.excludeEnv=!0;if(process.platform==="win32")try{let e=$e();if(!e)throw new Error("loadWin32NativeAddon returned undefined on win32");e.enableCrashReporting(),e.installExceptionFilter()}catch{}var Be=Te(process.argv,R);if(Be)await import(k(Be).href);else if(process.env.COPILOT_VOICE_SERVER_MODE==="1"){let e=Br(R,"voice-server.js");try{let{runVoiceServer:r}=await import(k(e).href);await r()}catch(r){process.stderr.write(`voice server: fatal at ${e}: ${r.stack??String(r)}
`),process.exit(1)}}else if(process.env.COPILOT_SHUTDOWN_FLUSH){try{let{url:e,headers:r,body:t}=JSON.parse(process.env.COPILOT_SHUTDOWN_FLUSH);await fetch(e,{method:"POST",headers:r,body:t,signal:AbortSignal.timeout(3e4)})}catch{}process.exit(0)}else{Oe(process.argv.slice(2))&&we.start();let e=await Ce(R,Vr);await import(k(e).href)}
{
"name": "@github/copilot-linuxmusl-arm64",
"version": "1.0.65",
"version": "1.0.66-0",
"description": "GitHub Copilot CLI for linuxmusl-arm64",

@@ -5,0 +5,0 @@ "license": "SEE LICENSE IN LICENSE.md",

@@ -1,2 +0,2 @@

(()=>{const stack=new Error().stack;stack&&(globalThis._sentryDebugIds=globalThis._sentryDebugIds||{},globalThis._sentryDebugIds[stack]="166ee685-7a80-596d-8d46-77f567c26374",globalThis._sentryDebugIdIdentifier="sentry-dbid-166ee685-7a80-596d-8d46-77f567c26374");})();
(()=>{const stack=new Error().stack;stack&&(globalThis._sentryDebugIds=globalThis._sentryDebugIds||{},globalThis._sentryDebugIds[stack]="00f609fa-844c-5bdd-93cb-1b05da8f7826",globalThis._sentryDebugIdIdentifier="sentry-dbid-00f609fa-844c-5bdd-93cb-1b05da8f7826");})();

@@ -53,4 +53,4 @@ /*---------------------------------------------------------------------------------------------

const __esmShimDirname = __path.dirname(__esmShimFilename);
import{parentPort as T,workerData as B}from"node:worker_threads";var m=class{initialQueue=[];initialQueueResolvers=Promise.withResolvers();logWriter=null;writePromise=this.initialQueueResolvers.promise;setLogWriter(r){this.logWriter=r;for(let t of this.initialQueue)this.writePromise=this.logWriter.writeLog(t.method,t.message);this.initialQueue=[],this.initialQueueResolvers.resolve()}async flush(){await this.writePromise}async dispose(){await this.flush()}outputPath(){return this.logWriter?.outputPath()}logToLevel(r,t){this.logWriter?this.writePromise=this.logWriter.writeLog(r,t):this.initialQueue.push({method:r,message:t})}info(r){this.logToLevel("info",r)}debug(r){this.logToLevel("debug",r)}warning(r){this.logToLevel("warning",r)}error(r){this.logToLevel("error",r instanceof Error?r.message:r)}log(r){this.error(r)}isDebug(){return!1}shouldLog(r){return!0}notice(r){this.info(r instanceof Error?r.message:r)}startGroup(r,t){this.info(`--- Start of group: ${r} ---`)}endGroup(r){this.info("--- End of group ---")}},u=new m;import{createRequire as D}from"node:module";import*as o from"node:fs/promises";import*as a from"node:path";import{createHash as W}from"node:crypto";import{join as l,basename as ne}from"node:path";import{homedir as h}from"node:os";function j(){return process.env.XDG_CACHE_HOME||l(h(),".cache")}function P(){if(process.platform==="darwin")return l(h(),"Library","Caches","copilot");if(process.platform==="win32"){let e=process.env.LOCALAPPDATA||l(h(),".cache");return l(e,"copilot")}return l(j(),"copilot")}function F(e){if(e.includes("<!DOCTYPE")||e.includes("<html")){let r=Math.min(e.indexOf("<!DOCTYPE")!==-1?e.indexOf("<!DOCTYPE"):1/0,e.indexOf("<html")!==-1?e.indexOf("<html"):1/0),t=e.substring(0,r).trim();return t?`${t} [HTML error page omitted]`:"[HTML error page omitted]"}return e}function y(e){let r;if(e instanceof Error)r=String(e);else if(typeof e=="object"&&e!==null)try{r=JSON.stringify(e)??"[object]"}catch{return"[object with circular reference]"}else r=String(e);return F(r)}var H=1,S=".complete";var w={"win32-x64":"win-x64","win32-arm64":"win-arm64","linux-x64":"linux-x64","darwin-arm64":"osx-arm64"};function C(){return typeof __foundryRequire<"u"&&__foundryRequire||D(import.meta.url)}var f;function U(){if(f)return f;try{let e=C()("foundry-local-sdk/script/install-utils.cjs");if(typeof e.runInstall!="function")throw new Error(`Expected exports {runInstall: function}, got: ${JSON.stringify(Object.fromEntries(Object.entries(e).map(([r,t])=>[r,typeof t])))}`);return f=e,f}catch(e){throw new Error(`Failed to load foundry-local-sdk/script/install-utils.cjs: ${y(e)}. The upstream foundry-local-sdk installer may have changed shape \u2014 re-run the audit checklist in src/cli/voice/foundry/installer/nativeLoader.ts and update accordingly.`)}}var g;function J(){if(g)return g;try{let e=C()("foundry-local-sdk/deps_versions.json");if(typeof e["foundry-local-core"]?.nuget!="string"||typeof e.onnxruntime?.version!="string"||typeof e["onnxruntime-genai"]?.version!="string")throw new Error('deps_versions.json is missing one of the expected version keys: ["foundry-local-core"].nuget, .onnxruntime.version, ["onnxruntime-genai"].version');return g=e,g}catch(e){throw new Error(`Failed to load foundry-local-sdk/deps_versions.json: ${y(e)}. The upstream foundry-local-sdk installer may have changed shape \u2014 re-run the audit checklist in src/cli/voice/foundry/installer/nativeLoader.ts and update accordingly.`)}}function I(e=process.platform){let r=J();return[{name:"Microsoft.AI.Foundry.Local.Core",version:r["foundry-local-core"].nuget},{name:e==="linux"?"Microsoft.ML.OnnxRuntime.Gpu.Linux":"Microsoft.ML.OnnxRuntime.Foundry",version:r.onnxruntime.version},{name:"Microsoft.ML.OnnxRuntimeGenAI.Foundry",version:r["onnxruntime-genai"].version}]}function O(e){return e==="win32"?".dll":e==="darwin"?".dylib":".so"}function G(e,r){return a.join(e,`Microsoft.AI.Foundry.Local.Core${O(r)}`)}function V(e){let r=O(e),t=e==="win32"?"":"lib";return[`Microsoft.AI.Foundry.Local.Core${r}`,`${t}onnxruntime${r}`,`${t}onnxruntime-genai${r}`]}function q(e,r=process.platform,t=process.arch){let n=w[`${r}-${t}`];if(!n)throw new Error(`Voice mode not supported on ${r}-${t}`);let i=e??process.env.COPILOT_CACHE_HOME??P(),s=I(r),c=W("sha256").update(JSON.stringify({schema:H,artifacts:s})).digest("hex").slice(0,12);return a.join(i,"foundry",c,n)}async function _(e={}){let r=e.platform??process.platform,t=e.arch??process.arch,n=`${r}-${t}`;if(!w[n])throw new Error(`Voice mode is not supported on ${n}. Supported platforms: ${Object.keys(w).join(", ")}.`);let s=q(e.cacheRoot,r,t),c=G(s,r),d=V(r);return await R(s,d)?{corePath:c}:(e.onDownloadStart?.(),await Y(s,r,d,e.runInstall),{corePath:c})}async function R(e,r){return await v(a.join(e,S))?(await Promise.all(r.map(n=>v(a.join(e,n))))).every(Boolean):!1}async function v(e){try{return await o.access(e),!0}catch{return!1}}async function Y(e,r,t,n){let i=a.dirname(e);await o.mkdir(i,{recursive:!0});let s=a.join(i,`.tmp-${a.basename(e)}-${process.pid}-${Date.now()}`);await o.mkdir(s,{recursive:!0});try{let c=n??U().runInstall,d=I(r);await X(()=>c(d,{binDir:s}));for(let b of t)if(!await v(a.join(s,b)))throw new Error(`Foundry runtime download finished but required file is missing: ${b}. RID for ${r} may not be supported by the published packages.`);await o.writeFile(a.join(s,S),""),await K(s,e,t)}catch(c){throw await o.rm(s,{recursive:!0,force:!0}).catch(()=>{}),c}}async function K(e,r,t){try{await o.rename(e,r)}catch(n){let i=n.code;if(i==="ENOTEMPTY"||i==="EEXIST"||i==="EPERM"){if(await R(r,t)){await o.rm(e,{recursive:!0,force:!0}).catch(()=>{});return}await o.rm(r,{recursive:!0,force:!0}),await o.rename(e,r);return}throw n}}async function X(e){let r=process.stdout.write.bind(process.stdout),t=process.stderr.write.bind(process.stderr);process.stdout.write=(()=>!0),process.stderr.write=(()=>!0);try{return await e()}finally{process.stdout.write=r,process.stderr.write=t}}var E=class extends Error{constructor(t,n,i){super(t,i);this.code=n;this.name="VoiceBackendError"}code};function $(e){return e instanceof E?{message:e.message,code:e.code}:e instanceof Error?{message:e.message}:{message:String(e)}}function N(e){return e instanceof Error?e:new Error(String(e))}var z=16;function k(e){return M(e,new WeakSet,0)}function M(e,r,t){if(t>=z)return"<cause chain truncated>";if(typeof e=="object"&&e!==null){if(r.has(e))return"<cyclic cause>";r.add(e)}if(!(e instanceof Error))return String(e);let n=e.stack??`${e.name}: ${e.message}`;if(e.cause===void 0)return n;let i=M(e.cause,r,t+1);return`${n}
Caused by: ${i}`}var x=16*1024,L=class{constructor(r){this.port=r}port;writeLog(r,t){let n={kind:"log",level:r,message:Q(t)};try{this.port.postMessage(n)}catch{}return Promise.resolve()}outputPath(){return"<voice-worker>"}};function A(e,r=u){r.setLogWriter(new L(e))}function Q(e){return e.length<=x?e:`${e.slice(0,x)}\u2026 [truncated, ${e.length-x} more chars]`}if(!T)throw new Error("voice-installer.worker.js must be loaded as a worker thread.");var p=T;A(p);var Z=B??{};async function ee(){try{let r={kind:"ok",location:await _({cacheRoot:Z.cacheRoot,onDownloadStart:()=>{let t={kind:"download-started"};p.postMessage(t)}})};p.postMessage(r)}catch(e){let r=N(e);u.error(`[voice-installer worker] install failed: ${k(r)}`);let t={kind:"error",error:$(r)};p.postMessage(t)}finally{setImmediate(()=>process.exit(0))}}ee().catch(e=>{u.error(`[voice-installer worker] fatal: ${k(e)}`),process.exit(1)});
import{parentPort as F,workerData as B}from"node:worker_threads";var m=class{initialQueue=[];initialQueueResolvers=Promise.withResolvers();logWriter=null;writePromise=this.initialQueueResolvers.promise;setLogWriter(e){this.logWriter=e;for(let t of this.initialQueue)this.writePromise=this.logWriter.writeLog(t.method,t.message);this.initialQueue=[],this.initialQueueResolvers.resolve()}async flush(){await this.writePromise}async dispose(){await this.flush()}outputPath(){return this.logWriter?.outputPath()}logToLevel(e,t){this.logWriter?this.writePromise=this.logWriter.writeLog(e,t):this.initialQueue.push({method:e,message:t})}info(e){this.logToLevel("info",e)}debug(e){this.logToLevel("debug",e)}warning(e){this.logToLevel("warning",e)}error(e){this.logToLevel("error",e instanceof Error?e.message:e)}log(e){this.error(e)}isDebug(){return!1}shouldLog(e){return!0}notice(e){this.info(e instanceof Error?e.message:e)}startGroup(e,t){this.info(`--- Start of group: ${e} ---`)}endGroup(e){this.info("--- End of group ---")}},u=new m;import{createRequire as A}from"node:module";import*as n from"node:fs/promises";import*as a from"node:path";import{createHash as j}from"node:crypto";import{join as l,basename as or}from"node:path";import{homedir as h}from"node:os";function D(){return process.env.XDG_CACHE_HOME||l(h(),".cache")}function O(){if(process.platform==="darwin")return l(h(),"Library","Caches","copilot");if(process.platform==="win32"){let r=process.env.LOCALAPPDATA||l(h(),".cache");return l(r,"copilot")}return l(D(),"copilot")}function W(r){if(r.includes("<!DOCTYPE")||r.includes("<html")){let e=Math.min(r.indexOf("<!DOCTYPE")!==-1?r.indexOf("<!DOCTYPE"):1/0,r.indexOf("<html")!==-1?r.indexOf("<html"):1/0),t=r.substring(0,e).trim();return t?`${t} [HTML error page omitted]`:"[HTML error page omitted]"}return r}function y(r){let e;if(r instanceof Error)e=String(r);else if(typeof r=="object"&&r!==null)try{e=JSON.stringify(r)??"[object]"}catch{return"[object with circular reference]"}else e=String(r);return W(e)}var H=1,I=".complete";var v={"win32-x64":"win-x64","win32-arm64":"win-arm64","linux-x64":"linux-x64","darwin-arm64":"osx-arm64"};function b(){return typeof __foundryRequire<"u"&&__foundryRequire||A(import.meta.url)}var f;function U(){if(f)return f;try{let r=b()("foundry-local-sdk/script/install-utils.cjs");if(typeof r.runInstall!="function")throw new Error(`Expected exports {runInstall: function}, got: ${JSON.stringify(Object.fromEntries(Object.entries(r).map(([e,t])=>[e,typeof t])))}`);return f=r,f}catch(r){throw new Error(`Failed to load foundry-local-sdk/script/install-utils.cjs: ${y(r)}. The upstream foundry-local-sdk installer may have changed shape \u2014 re-run the audit checklist in src/cli/voice/foundry/installer/nativeLoader.ts and update accordingly.`)}}var p;function J(){if(p)return p;try{let r=b()("foundry-local-sdk/deps_versions.json");if(typeof r["foundry-local-core"]?.nuget!="string"||typeof r.onnxruntime?.version!="string"||typeof r["onnxruntime-genai"]?.version!="string")throw new Error('deps_versions.json is missing one of the expected version keys: ["foundry-local-core"].nuget, .onnxruntime.version, ["onnxruntime-genai"].version');return p=r,p}catch(r){throw new Error(`Failed to load foundry-local-sdk/deps_versions.json: ${y(r)}. The upstream foundry-local-sdk installer may have changed shape \u2014 re-run the audit checklist in src/cli/voice/foundry/installer/nativeLoader.ts and update accordingly.`)}}function S(r=process.platform){let e=J();return[{name:"Microsoft.AI.Foundry.Local.Core",version:e["foundry-local-core"].nuget},{name:r==="linux"?"Microsoft.ML.OnnxRuntime.Gpu.Linux":"Microsoft.ML.OnnxRuntime.Foundry",version:e.onnxruntime.version},{name:"Microsoft.ML.OnnxRuntimeGenAI.Foundry",version:e["onnxruntime-genai"].version}]}function C(r){return r==="win32"?".dll":r==="darwin"?".dylib":".so"}function V(r,e){return a.join(r,`Microsoft.AI.Foundry.Local.Core${C(e)}`)}function q(r){let e=C(r),t=r==="win32"?"":"lib";return[`Microsoft.AI.Foundry.Local.Core${e}`,`${t}onnxruntime${e}`,`${t}onnxruntime-genai${e}`]}function K(r,e=process.platform,t=process.arch){let o=v[`${e}-${t}`];if(!o)throw new Error(`Voice mode not supported on ${e}-${t}`);let i=r??process.env.COPILOT_CACHE_HOME??O(),s=S(e),c=j("sha256").update(JSON.stringify({schema:H,artifacts:s})).digest("hex").slice(0,12);return a.join(i,"foundry",c,o)}async function $(r={}){let e=r.platform??process.platform,t=r.arch??process.arch,o=`${e}-${t}`;if(!v[o])throw new Error(`Voice mode is not supported on ${o}. Supported platforms: ${Object.keys(v).join(", ")}.`);let s=K(r.cacheRoot,e,t),c=V(s,e),d=q(e);return await N(s,d)?{corePath:c}:(r.onDownloadStart?.(),await G(s,e,d,r.runInstall),{corePath:c})}async function N(r,e){return await w(a.join(r,I))?(await Promise.all(e.map(o=>w(a.join(r,o))))).every(Boolean):!1}async function w(r){try{return await n.access(r),!0}catch{return!1}}async function G(r,e,t,o){let i=a.dirname(r);await n.mkdir(i,{recursive:!0});let s=a.join(i,`.tmp-${a.basename(r)}-${process.pid}-${Date.now()}`);await n.mkdir(s,{recursive:!0});try{let c=o??U().runInstall,d=S(e);await z(()=>c(d,{binDir:s}));for(let P of t)if(!await w(a.join(s,P)))throw new Error(`Foundry runtime download finished but required file is missing: ${P}. RID for ${e} may not be supported by the published packages.`);await n.writeFile(a.join(s,I),""),await Q(s,r,t)}catch(c){throw await n.rm(s,{recursive:!0,force:!0}).catch(()=>{}),c}}async function Q(r,e,t){try{await n.rename(r,e)}catch(o){let i=o.code;if(i==="ENOTEMPTY"||i==="EEXIST"||i==="EPERM"){if(await N(e,t)){await n.rm(r,{recursive:!0,force:!0}).catch(()=>{});return}await n.rm(e,{recursive:!0,force:!0}),await n.rename(r,e);return}throw o}}async function z(r){let e=process.stdout.write.bind(process.stdout),t=process.stderr.write.bind(process.stderr);process.stdout.write=(()=>!0),process.stderr.write=(()=>!0);try{return await r()}finally{process.stdout.write=e,process.stderr.write=t}}var E=class extends Error{constructor(t,o,i){super(t,i);this.code=o;this.name="VoiceBackendError"}code};function _(r){return r instanceof E?{message:r.message,code:r.code}:r instanceof Error?{message:r.message}:{message:String(r)}}function R(r){return r instanceof Error?r:new Error(String(r))}var X=16;function L(r){return M(r,new WeakSet,0)}function M(r,e,t){if(t>=X)return"<cause chain truncated>";if(typeof r=="object"&&r!==null){if(e.has(r))return"<cyclic cause>";e.add(r)}if(!(r instanceof Error))return String(r);let o=r.stack??`${r.name}: ${r.message}`;if(r.cause===void 0)return o;let i=M(r.cause,e,t+1);return`${o}
Caused by: ${i}`}var x=16*1024,k=class{constructor(e){this.port=e}port;writeLog(e,t){let o={kind:"log",level:e,message:Y(t)};try{this.port.postMessage(o)}catch{}return Promise.resolve()}outputPath(){return"<voice-worker>"}};function T(r,e=u){e.setLogWriter(new k(r))}function Y(r){return r.length<=x?r:`${r.slice(0,x)}\u2026 [truncated, ${r.length-x} more chars]`}if(!F)throw new Error("voice-installer.worker.js must be loaded as a worker thread.");var g=F;T(g);var Z=B??{};async function rr(){try{let e={kind:"ok",location:await $({cacheRoot:Z.cacheRoot,onDownloadStart:()=>{let t={kind:"download-started"};g.postMessage(t)}})};g.postMessage(e)}catch(r){let e=R(r);u.error(`[voice-installer worker] install failed: ${L(e)}`);let t={kind:"error",error:_(e)};g.postMessage(t)}finally{setImmediate(()=>process.exit(0))}}rr().catch(r=>{u.error(`[voice-installer worker] fatal: ${L(r)}`),process.exit(1)});
//# sourceMappingURL=voice-installer.worker.js.map

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display