diff --git a/.github/agents/custom-engine-implementation.agent.md b/.github/agents/custom-engine-implementation.agent.md
index 58058a919e..fbc97acdae 100644
--- a/.github/agents/custom-engine-implementation.agent.md
+++ b/.github/agents/custom-engine-implementation.agent.md
@@ -542,7 +542,6 @@ func NewEngineRegistry() *EngineRegistry {
registry.Register(NewClaudeEngine())
registry.Register(NewCodexEngine())
registry.Register(NewCopilotEngine())
- registry.Register(NewCopilotSDKEngine())
registry.Register(NewCustomEngine())
registry.Register(NewMyEngine()) // Add your engine here
diff --git a/.github/workflows/copilot-sdk-ci.yml b/.github/workflows/copilot-sdk-ci.yml
deleted file mode 100644
index c4c218a399..0000000000
--- a/.github/workflows/copilot-sdk-ci.yml
+++ /dev/null
@@ -1,145 +0,0 @@
-name: Copilot SDK CI
-
-on:
- workflow_dispatch:
- pull_request:
- paths:
- - 'copilot-client/**'
- - '.github/workflows/copilot-sdk-ci.yml'
-
-permissions:
- contents: read
-
-concurrency:
- group: copilot-sdk-ci-${{ github.ref }}
- cancel-in-progress: true
-
-jobs:
- test:
- runs-on: ubuntu-latest
- steps:
- - name: Checkout code
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
-
- - name: Setup Node.js
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6
- with:
- node-version: '24'
- cache: 'npm'
- cache-dependency-path: copilot-client/package-lock.json
-
- - name: Install Copilot CLI
- run: |
- # Read version from constants.go (skip commented lines)
- COPILOT_VERSION=$(grep 'DefaultCopilotVersion Version = "' pkg/constants/constants.go | grep -v '^//' | grep -oP '"\K[^"]+')
- echo "Installing Copilot CLI version: $COPILOT_VERSION"
- npm install -g @github/copilot@$COPILOT_VERSION
-
- - name: Start Copilot CLI as headless server
- id: copilot_server
- run: |
- mkdir -p /tmp/copilot-logs
- mkdir -p /tmp/copilot-server
-
- # Start copilot in server mode
- copilot --server --port 8080 --log-level all --log-dir /tmp/copilot-logs > /tmp/copilot-server/output.log 2>&1 &
- SERVER_PID=$!
- echo "SERVER_PID=$SERVER_PID" >> $GITHUB_ENV
-
- # Wait for server to be ready
- sleep 5
-
- # Check if server is running
- if ! kill -0 $SERVER_PID 2>/dev/null; then
- echo "Failed to start copilot server"
- cat /tmp/copilot-server/output.log
- exit 1
- fi
-
- echo "Copilot server started with PID: $SERVER_PID"
- env:
- COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
- GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
-
- - name: Install copilot-client dependencies
- run: |
- cd copilot-client
- npm ci
-
- - name: Build copilot-client
- run: |
- cd copilot-client
- npm run build
-
- - name: Run copilot-client tests
- run: |
- cd copilot-client
- npm test
- env:
- COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
-
- - name: Test copilot-client integration
- run: |
- cd copilot-client
-
- # Create test prompt
- mkdir -p /tmp/test
- echo "What is 2+2? Answer briefly." > /tmp/test/prompt.txt
-
- # Create configuration JSON for environment variable
- export GH_AW_COPILOT_CONFIG='{
- "promptFile": "/tmp/test/prompt.txt",
- "eventLogFile": "/tmp/test/events.jsonl",
- "cliUrl": "localhost:8080",
- "session": {
- "model": "gpt-5"
- }
- }'
-
- # Run the client with configuration from environment variable
- DEBUG=copilot-client node -e "import('./dist/index.js').then(m => m.main())"
-
- # Verify event log was created
- if [ ! -f /tmp/test/events.jsonl ]; then
- echo "Event log file was not created"
- exit 1
- fi
-
- # Check that events were logged
- EVENT_COUNT=$(wc -l < /tmp/test/events.jsonl)
- echo "Number of events logged: $EVENT_COUNT"
-
- if [ "$EVENT_COUNT" -lt 3 ]; then
- echo "Expected at least 3 events, got $EVENT_COUNT"
- cat /tmp/test/events.jsonl
- exit 1
- fi
-
- echo "✓ Integration test passed"
- env:
- COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
-
- - name: Stop Copilot server
- if: always()
- run: |
- if [ -n "$SERVER_PID" ]; then
- echo "Stopping copilot server (PID: $SERVER_PID)"
- kill $SERVER_PID || true
- sleep 2
- fi
-
- - name: Upload copilot logs
- if: always()
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
- with:
- name: copilot-logs
- path: /tmp/copilot-logs/
- if-no-files-found: ignore
-
- - name: Upload test artifacts
- if: always()
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
- with:
- name: test-artifacts
- path: /tmp/test/
- if-no-files-found: ignore
diff --git a/.github/workflows/dev.lock.yml b/.github/workflows/dev.lock.yml
index 5b04a8e6d8..4ac56a129c 100644
--- a/.github/workflows/dev.lock.yml
+++ b/.github/workflows/dev.lock.yml
@@ -27,7 +27,7 @@
# Imports:
# - shared/mood.md
#
-# gh-aw-metadata: {"schema_version":"v1","frontmatter_hash":"49266e50774d7e6a8b1c50f64b2f790c214dcdcf7b75b6bc8478bb43257b9863"}
+# gh-aw-metadata: {"schema_version":"v1","frontmatter_hash":"d1c2843f04957800681bf9f176ca8c8f87c0e51f6e69f9328ea661d9e086fee5"}
name: "Dev"
"on":
@@ -245,7 +245,7 @@ jobs:
issues: read
pull-requests: read
concurrency:
- group: "gh-aw-copilot-sdk-${{ github.workflow }}"
+ group: "gh-aw-copilot-${{ github.workflow }}"
env:
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
GH_AW_ASSETS_ALLOWED_EXTS: ""
@@ -313,13 +313,13 @@ jobs:
const fs = require('fs');
const awInfo = {
- engine_id: "copilot-sdk",
- engine_name: "GitHub Copilot SDK",
- model: process.env.GH_AW_MODEL_AGENT_CUSTOM || "",
+ engine_id: "copilot",
+ engine_name: "GitHub Copilot CLI",
+ model: process.env.GH_AW_MODEL_AGENT_COPILOT || "",
version: "",
- agent_version: "",
+ agent_version: "0.0.410",
workflow_name: "Dev",
- experimental: true,
+ experimental: false,
supports_tools_allowlist: true,
run_id: context.runId,
run_number: context.runNumber,
@@ -331,8 +331,8 @@ jobs:
event_name: context.eventName,
staged: false,
allowed_domains: ["defaults"],
- firewall_enabled: false,
- awf_version: "",
+ firewall_enabled: true,
+ awf_version: "v0.20.0",
awmg_version: "v0.1.4",
steps: {
firewall: "squid"
@@ -620,7 +620,7 @@ jobs:
mkdir -p "${MCP_GATEWAY_PAYLOAD_DIR}"
export DEBUG="*"
- export GH_AW_ENGINE="copilot-sdk"
+ export GH_AW_ENGINE="copilot"
export MCP_GATEWAY_DOCKER_COMMAND='docker run -i --rm --network host -v /var/run/docker.sock:/var/run/docker.sock -e MCP_GATEWAY_PORT -e MCP_GATEWAY_DOMAIN -e MCP_GATEWAY_API_KEY -e MCP_GATEWAY_PAYLOAD_DIR -e DEBUG -e MCP_GATEWAY_LOG_DIR -e GH_AW_MCP_LOG_DIR -e GH_AW_SAFE_OUTPUTS -e GH_AW_SAFE_OUTPUTS_CONFIG_PATH -e GH_AW_SAFE_OUTPUTS_TOOLS_PATH -e GH_AW_ASSETS_BRANCH -e GH_AW_ASSETS_MAX_SIZE_KB -e GH_AW_ASSETS_ALLOWED_EXTS -e DEFAULT_BRANCH -e GITHUB_MCP_SERVER_TOKEN -e GITHUB_MCP_LOCKDOWN -e GITHUB_REPOSITORY -e GITHUB_SERVER_URL -e GITHUB_SHA -e GITHUB_WORKSPACE -e GITHUB_TOKEN -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RUN_ATTEMPT -e GITHUB_JOB -e GITHUB_ACTION -e GITHUB_EVENT_NAME -e GITHUB_EVENT_PATH -e GITHUB_ACTOR -e GITHUB_ACTOR_ID -e GITHUB_TRIGGERING_ACTOR -e GITHUB_WORKFLOW -e GITHUB_WORKFLOW_REF -e GITHUB_WORKFLOW_SHA -e GITHUB_REF -e GITHUB_REF_NAME -e GITHUB_REF_TYPE -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GH_AW_SAFE_OUTPUTS_PORT -e GH_AW_SAFE_OUTPUTS_API_KEY -v /tmp/gh-aw/mcp-payloads:/tmp/gh-aw/mcp-payloads:rw -v /opt:/opt:ro -v /tmp:/tmp:rw -v '"${GITHUB_WORKSPACE}"':'"${GITHUB_WORKSPACE}"':rw ghcr.io/github/gh-aw-mcpg:v0.1.4'
mkdir -p /home/runner/.copilot
@@ -666,46 +666,26 @@ jobs:
path: /tmp/gh-aw/aw-prompts
- name: Clean git credentials
run: bash /opt/gh-aw/actions/clean_git_credentials.sh
- - name: Start Copilot CLI in headless mode
- run: |
- # Start Copilot CLI in headless mode on port 10002
- copilot --headless --port 10002 &
- COPILOT_PID=$!
- echo "COPILOT_PID=${COPILOT_PID}" >> $GITHUB_ENV
-
- # Wait for Copilot to be ready
- sleep 5
-
- # Verify Copilot is running
- if ! kill -0 ${COPILOT_PID} 2>/dev/null; then
- echo "::error::Copilot CLI failed to start"
- exit 1
- fi
-
- echo "✓ Copilot CLI started in headless mode on port 10002"
- - name: Configure Copilot SDK client
- run: |
- # Create directory for event log
- mkdir -p /tmp/gh-aw/copilot-sdk/
-
- # Set configuration via environment variable
- echo 'GH_AW_COPILOT_CONFIG={"cliUrl":"http://host.docker.internal:10002","eventLogFile":"/tmp/gh-aw/copilot-sdk/event-log.jsonl","githubToken":"${{ secrets.COPILOT_GITHUB_TOKEN }}","logLevel":"info","promptFile":"/tmp/gh-aw/aw-prompts/prompt.txt"}' >> $GITHUB_ENV
- - name: Execute Copilot SDK client
+ - name: Execute GitHub Copilot CLI
id: agentic_execution
+ # Copilot CLI tool arguments (sorted):
+ timeout-minutes: 30
run: |
- # Execute copilot-client.js with Node.js
- # Configuration is read from GH_AW_COPILOT_CONFIG environment variable
- node /opt/gh-aw/copilot/copilot-client.js
-
- # Check exit code
- if [ $? -ne 0 ]; then
- echo "::error::Copilot SDK client execution failed"
- exit 1
- fi
-
- echo "✓ Copilot SDK client execution completed"
+ set -o pipefail
+ sudo -E awf --env-all --container-workdir "${GITHUB_WORKSPACE}" --allow-domains api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.individual.githubcopilot.com,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,github.com,host.docker.internal,json-schema.org,json.schemastore.org,keyserver.ubuntu.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,ppa.launchpad.net,raw.githubusercontent.com,registry.npmjs.org,s.symcb.com,s.symcd.com,security.ubuntu.com,telemetry.enterprise.githubcopilot.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com --log-level info --proxy-logs-dir /tmp/gh-aw/sandbox/firewall/logs --enable-host-access --image-tag 0.20.0 --skip-pull --enable-api-proxy \
+ -- /bin/bash -c '/usr/local/bin/copilot --add-dir /tmp/gh-aw/ --log-level all --log-dir /tmp/gh-aw/sandbox/agent/logs/ --add-dir "${GITHUB_WORKSPACE}" --disable-builtin-mcps --allow-all-tools --allow-all-paths --share /tmp/gh-aw/sandbox/agent/logs/conversation.md --prompt "$(cat /tmp/gh-aw/aw-prompts/prompt.txt)"${GH_AW_MODEL_AGENT_COPILOT:+ --model "$GH_AW_MODEL_AGENT_COPILOT"}' 2>&1 | tee -a /tmp/gh-aw/agent-stdio.log
env:
- GH_AW_COPILOT_CONFIG: ${{ env.GH_AW_COPILOT_CONFIG }}
+ COPILOT_AGENT_RUNNER_TYPE: STANDALONE
+ COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
+ GH_AW_MCP_CONFIG: /home/runner/.copilot/mcp-config.json
+ GH_AW_MODEL_AGENT_COPILOT: ${{ vars.GH_AW_MODEL_AGENT_COPILOT || '' }}
+ GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
+ GH_AW_SAFE_OUTPUTS: ${{ env.GH_AW_SAFE_OUTPUTS }}
+ GITHUB_HEAD_REF: ${{ github.head_ref }}
+ GITHUB_REF_NAME: ${{ github.ref_name }}
+ GITHUB_STEP_SUMMARY: ${{ env.GITHUB_STEP_SUMMARY }}
+ GITHUB_WORKSPACE: ${{ github.workspace }}
+ XDG_CONFIG_HOME: /home/runner
- name: Configure Git credentials
env:
REPO_NAME: ${{ github.repository }}
@@ -717,6 +697,23 @@ jobs:
SERVER_URL_STRIPPED="${SERVER_URL#https://}"
git remote set-url origin "https://x-access-token:${{ github.token }}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git"
echo "Git configured with standard GitHub Actions identity"
+ - name: Copy Copilot session state files to logs
+ if: always()
+ continue-on-error: true
+ run: |
+ # Copy Copilot session state files to logs folder for artifact collection
+ # This ensures they are in /tmp/gh-aw/ where secret redaction can scan them
+ SESSION_STATE_DIR="$HOME/.copilot/session-state"
+ LOGS_DIR="/tmp/gh-aw/sandbox/agent/logs"
+
+ if [ -d "$SESSION_STATE_DIR" ]; then
+ echo "Copying Copilot session state files from $SESSION_STATE_DIR to $LOGS_DIR"
+ mkdir -p "$LOGS_DIR"
+ cp -v "$SESSION_STATE_DIR"/*.jsonl "$LOGS_DIR/" 2>/dev/null || true
+ echo "Session state files copied successfully"
+ else
+ echo "No session-state directory found at $SESSION_STATE_DIR"
+ fi
- name: Stop MCP Gateway
if: always()
continue-on-error: true
@@ -754,7 +751,7 @@ jobs:
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
env:
GH_AW_SAFE_OUTPUTS: ${{ env.GH_AW_SAFE_OUTPUTS }}
- GH_AW_ALLOWED_DOMAINS: "api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,json-schema.org,json.schemastore.org,keyserver.ubuntu.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,ppa.launchpad.net,s.symcb.com,s.symcd.com,security.ubuntu.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com"
+ GH_AW_ALLOWED_DOMAINS: "api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.individual.githubcopilot.com,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,github.com,host.docker.internal,json-schema.org,json.schemastore.org,keyserver.ubuntu.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,ppa.launchpad.net,raw.githubusercontent.com,registry.npmjs.org,s.symcb.com,s.symcd.com,security.ubuntu.com,telemetry.enterprise.githubcopilot.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com"
GITHUB_SERVER_URL: ${{ github.server_url }}
GITHUB_API_URL: ${{ github.api_url }}
with:
@@ -775,19 +772,19 @@ jobs:
with:
name: agent_outputs
path: |
- /tmp/gh-aw/copilot-sdk/event-log.jsonl
+ /tmp/gh-aw/sandbox/agent/logs/
/tmp/gh-aw/redacted-urls.log
if-no-files-found: ignore
- name: Parse agent logs for step summary
if: always()
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
env:
- GH_AW_AGENT_OUTPUT: /tmp/gh-aw/copilot-sdk/event-log.jsonl
+ GH_AW_AGENT_OUTPUT: /tmp/gh-aw/sandbox/agent/logs/
with:
script: |
const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
setupGlobals(core, github, context, exec, io);
- const { main } = require('/opt/gh-aw/actions/parse-copilot-log.cjs');
+ const { main } = require('/opt/gh-aw/actions/parse_copilot_log.cjs');
await main();
- name: Parse MCP Gateway logs for step summary
if: always()
@@ -798,6 +795,21 @@ jobs:
setupGlobals(core, github, context, exec, io);
const { main } = require('/opt/gh-aw/actions/parse_mcp_gateway_log.cjs');
await main();
+ - name: Print firewall logs
+ if: always()
+ continue-on-error: true
+ env:
+ AWF_LOGS_DIR: /tmp/gh-aw/sandbox/firewall/logs
+ run: |
+ # Fix permissions on firewall logs so they can be uploaded as artifacts
+ # AWF runs with sudo, creating files owned by root
+ sudo chmod -R a+r /tmp/gh-aw/sandbox/firewall/logs 2>/dev/null || true
+ # Only run awf logs summary if awf command exists (it may not be installed if workflow failed before install step)
+ if command -v awf &> /dev/null; then
+ awf logs summary | tee -a "$GITHUB_STEP_SUMMARY"
+ else
+ echo 'AWF binary not installed, skipping firewall log summary'
+ fi
- name: Upload agent artifacts
if: always()
continue-on-error: true
@@ -808,6 +820,7 @@ jobs:
/tmp/gh-aw/aw-prompts/prompt.txt
/tmp/gh-aw/aw_info.json
/tmp/gh-aw/mcp-logs/
+ /tmp/gh-aw/sandbox/firewall/logs/
/tmp/gh-aw/agent-stdio.log
/tmp/gh-aw/agent/
if-no-files-found: ignore
@@ -919,7 +932,7 @@ jobs:
permissions:
contents: read
concurrency:
- group: "gh-aw-copilot-sdk-${{ github.workflow }}"
+ group: "gh-aw-copilot-${{ github.workflow }}"
timeout-minutes: 10
outputs:
success: ${{ steps.parse_results.outputs.success }}
@@ -974,46 +987,35 @@ jobs:
COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
- name: Install GitHub Copilot CLI
run: /opt/gh-aw/actions/install_copilot_cli.sh 0.0.410
- - name: Start Copilot CLI in headless mode
- run: |
- # Start Copilot CLI in headless mode on port 10002
- copilot --headless --port 10002 &
- COPILOT_PID=$!
- echo "COPILOT_PID=${COPILOT_PID}" >> $GITHUB_ENV
-
- # Wait for Copilot to be ready
- sleep 5
-
- # Verify Copilot is running
- if ! kill -0 ${COPILOT_PID} 2>/dev/null; then
- echo "::error::Copilot CLI failed to start"
- exit 1
- fi
-
- echo "✓ Copilot CLI started in headless mode on port 10002"
- - name: Configure Copilot SDK client
- run: |
- # Create directory for event log
- mkdir -p /tmp/gh-aw/copilot-sdk/
-
- # Set configuration via environment variable
- echo 'GH_AW_COPILOT_CONFIG={"cliUrl":"http://host.docker.internal:10002","eventLogFile":"/tmp/gh-aw/copilot-sdk/event-log.jsonl","githubToken":"${{ secrets.COPILOT_GITHUB_TOKEN }}","logLevel":"info","promptFile":"/tmp/gh-aw/aw-prompts/prompt.txt"}' >> $GITHUB_ENV
- - name: Execute Copilot SDK client
+ - name: Execute GitHub Copilot CLI
id: agentic_execution
+ # Copilot CLI tool arguments (sorted):
+ # --allow-tool shell(cat)
+ # --allow-tool shell(grep)
+ # --allow-tool shell(head)
+ # --allow-tool shell(jq)
+ # --allow-tool shell(ls)
+ # --allow-tool shell(tail)
+ # --allow-tool shell(wc)
+ timeout-minutes: 20
run: |
- # Execute copilot-client.js with Node.js
- # Configuration is read from GH_AW_COPILOT_CONFIG environment variable
- node /opt/gh-aw/copilot/copilot-client.js
-
- # Check exit code
- if [ $? -ne 0 ]; then
- echo "::error::Copilot SDK client execution failed"
- exit 1
- fi
-
- echo "✓ Copilot SDK client execution completed"
+ set -o pipefail
+ COPILOT_CLI_INSTRUCTION="$(cat /tmp/gh-aw/aw-prompts/prompt.txt)"
+ mkdir -p /tmp/
+ mkdir -p /tmp/gh-aw/
+ mkdir -p /tmp/gh-aw/agent/
+ mkdir -p /tmp/gh-aw/sandbox/agent/logs/
+ copilot --add-dir /tmp/ --add-dir /tmp/gh-aw/ --add-dir /tmp/gh-aw/agent/ --log-level all --log-dir /tmp/gh-aw/sandbox/agent/logs/ --disable-builtin-mcps --allow-tool 'shell(cat)' --allow-tool 'shell(grep)' --allow-tool 'shell(head)' --allow-tool 'shell(jq)' --allow-tool 'shell(ls)' --allow-tool 'shell(tail)' --allow-tool 'shell(wc)' --share /tmp/gh-aw/sandbox/agent/logs/conversation.md --prompt "$COPILOT_CLI_INSTRUCTION"${GH_AW_MODEL_DETECTION_COPILOT:+ --model "$GH_AW_MODEL_DETECTION_COPILOT"} 2>&1 | tee /tmp/gh-aw/threat-detection/detection.log
env:
- GH_AW_COPILOT_CONFIG: ${{ env.GH_AW_COPILOT_CONFIG }}
+ COPILOT_AGENT_RUNNER_TYPE: STANDALONE
+ COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
+ GH_AW_MODEL_DETECTION_COPILOT: ${{ vars.GH_AW_MODEL_DETECTION_COPILOT || '' }}
+ GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
+ GITHUB_HEAD_REF: ${{ github.head_ref }}
+ GITHUB_REF_NAME: ${{ github.ref_name }}
+ GITHUB_STEP_SUMMARY: ${{ env.GITHUB_STEP_SUMMARY }}
+ GITHUB_WORKSPACE: ${{ github.workspace }}
+ XDG_CONFIG_HOME: /home/runner
- name: Parse threat detection results
id: parse_results
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
@@ -1042,7 +1044,7 @@ jobs:
issues: write
timeout-minutes: 15
env:
- GH_AW_ENGINE_ID: "copilot-sdk"
+ GH_AW_ENGINE_ID: "copilot"
GH_AW_WORKFLOW_ID: "dev"
GH_AW_WORKFLOW_NAME: "Dev"
outputs:
diff --git a/.github/workflows/dev.md b/.github/workflows/dev.md
index 8e09b1de4b..6bad36ca53 100644
--- a/.github/workflows/dev.md
+++ b/.github/workflows/dev.md
@@ -7,7 +7,7 @@ name: Dev
description: Daily status report for gh-aw project
timeout-minutes: 30
strict: false
-engine: copilot-sdk
+engine: copilot
permissions:
contents: read
diff --git a/.github/workflows/smoke-copilot-sdk.lock.yml b/.github/workflows/smoke-copilot-sdk.lock.yml
deleted file mode 100644
index 59a7f3eaa7..0000000000
--- a/.github/workflows/smoke-copilot-sdk.lock.yml
+++ /dev/null
@@ -1,1544 +0,0 @@
-#
-# ___ _ _
-# / _ \ | | (_)
-# | |_| | __ _ ___ _ __ | |_ _ ___
-# | _ |/ _` |/ _ \ '_ \| __| |/ __|
-# | | | | (_| | __/ | | | |_| | (__
-# \_| |_/\__, |\___|_| |_|\__|_|\___|
-# __/ |
-# _ _ |___/
-# | | | | / _| |
-# | | | | ___ _ __ _ __| |_| | _____ ____
-# | |/\| |/ _ \ '__| |/ /| _| |/ _ \ \ /\ / / ___|
-# \ /\ / (_) | | | | ( | | | | (_) \ V V /\__ \
-# \/ \/ \___/|_| |_|\_\|_| |_|\___/ \_/\_/ |___/
-#
-# This file was automatically generated by gh-aw. DO NOT EDIT.
-#
-# To update this file, edit the corresponding .md file and run:
-# gh aw compile
-# Not all edits will cause changes to this file.
-#
-# For more information: https://github.github.com/gh-aw/introduction/overview/
-#
-# Smoke Copilot SDK
-#
-# Resolved workflow manifest:
-# Imports:
-# - shared/gh.md
-# - shared/reporting.md
-#
-# gh-aw-metadata: {"schema_version":"v1","frontmatter_hash":"2fe2e88f7c0c250f4af942d0e27adb3a94debf0c772c24b5c18ec17f16b93602"}
-
-name: "Smoke Copilot SDK"
-"on":
- pull_request:
- # names: # Label filtering applied via job conditions
- # - smoke # Label filtering applied via job conditions
- types:
- - labeled
- workflow_dispatch: null
-
-permissions: {}
-
-concurrency:
- group: "gh-aw-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}"
- cancel-in-progress: true
-
-run-name: "Smoke Copilot SDK"
-
-jobs:
- activation:
- needs: pre_activation
- if: >
- (needs.pre_activation.outputs.activated == 'true') && (((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.id == github.repository_id)) &&
- ((github.event_name != 'pull_request') || ((github.event.action != 'labeled') || (github.event.label.name == 'smoke'))))
- runs-on: ubuntu-slim
- permissions:
- contents: read
- discussions: write
- issues: write
- pull-requests: write
- outputs:
- body: ${{ steps.sanitized.outputs.body }}
- comment_id: ${{ steps.add-comment.outputs.comment-id }}
- comment_repo: ${{ steps.add-comment.outputs.comment-repo }}
- comment_url: ${{ steps.add-comment.outputs.comment-url }}
- text: ${{ steps.sanitized.outputs.text }}
- title: ${{ steps.sanitized.outputs.title }}
- steps:
- - name: Checkout actions folder
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- with:
- sparse-checkout: |
- actions
- persist-credentials: false
- - name: Setup Scripts
- uses: ./actions/setup
- with:
- destination: /opt/gh-aw/actions
- - name: Validate context variables
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
- with:
- script: |
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
- setupGlobals(core, github, context, exec, io);
- const { main } = require('/opt/gh-aw/actions/validate_context_variables.cjs');
- await main();
- - name: Checkout .github and .agents folders
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- with:
- sparse-checkout: |
- .github
- .agents
- fetch-depth: 1
- persist-credentials: false
- - name: Check workflow file timestamps
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
- env:
- GH_AW_WORKFLOW_FILE: "smoke-copilot-sdk.lock.yml"
- with:
- script: |
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
- setupGlobals(core, github, context, exec, io);
- const { main } = require('/opt/gh-aw/actions/check_workflow_timestamp_api.cjs');
- await main();
- - name: Compute current body text
- id: sanitized
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
- with:
- script: |
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
- setupGlobals(core, github, context, exec, io);
- const { main } = require('/opt/gh-aw/actions/compute_text.cjs');
- await main();
- - name: Add comment with workflow run link
- id: add-comment
- if: github.event_name == 'issues' || github.event_name == 'issue_comment' || github.event_name == 'pull_request_review_comment' || github.event_name == 'discussion' || github.event_name == 'discussion_comment' || (github.event_name == 'pull_request') && (github.event.pull_request.head.repo.id == github.repository_id)
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
- env:
- GH_AW_WORKFLOW_NAME: "Smoke Copilot SDK"
- with:
- script: |
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
- setupGlobals(core, github, context, exec, io);
- const { main } = require('/opt/gh-aw/actions/add_workflow_run_comment.cjs');
- await main();
- - name: Create prompt with built-in context
- env:
- GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
- GH_AW_SAFE_OUTPUTS: ${{ env.GH_AW_SAFE_OUTPUTS }}
- GH_AW_GITHUB_ACTOR: ${{ github.actor }}
- GH_AW_GITHUB_EVENT_COMMENT_ID: ${{ github.event.comment.id }}
- GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER: ${{ github.event.discussion.number }}
- GH_AW_GITHUB_EVENT_ISSUE_NUMBER: ${{ github.event.issue.number }}
- GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
- GH_AW_GITHUB_REPOSITORY: ${{ github.repository }}
- GH_AW_GITHUB_RUN_ID: ${{ github.run_id }}
- GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }}
- run: |
- bash /opt/gh-aw/actions/create_prompt_first.sh
- cat << 'GH_AW_PROMPT_EOF' > "$GH_AW_PROMPT"
-
- GH_AW_PROMPT_EOF
- cat "/opt/gh-aw/prompts/xpia.md" >> "$GH_AW_PROMPT"
- cat "/opt/gh-aw/prompts/temp_folder_prompt.md" >> "$GH_AW_PROMPT"
- cat "/opt/gh-aw/prompts/markdown.md" >> "$GH_AW_PROMPT"
- cat "/opt/gh-aw/prompts/cache_memory_prompt.md" >> "$GH_AW_PROMPT"
- cat << 'GH_AW_PROMPT_EOF' >> "$GH_AW_PROMPT"
-
- GitHub API Access Instructions
-
- The gh CLI is NOT authenticated. Do NOT use gh commands for GitHub operations.
-
-
- To create or modify GitHub resources (issues, discussions, pull requests, etc.), you MUST call the appropriate safe output tool. Simply writing content will NOT work - the workflow requires actual tool calls.
-
- Temporary IDs: Some safe output tools support a temporary ID field (usually named temporary_id) so you can reference newly-created items elsewhere in the SAME agent output (for example, using #aw_abc1 in a later body).
-
- **IMPORTANT - temporary_id format rules:**
- - If you DON'T need to reference the item later, OMIT the temporary_id field entirely (it will be auto-generated if needed)
- - If you DO need cross-references/chaining, you MUST match this EXACT validation regex: /^aw_[A-Za-z0-9]{3,8}$/i
- - Format: aw_ prefix followed by 3 to 8 alphanumeric characters (A-Z, a-z, 0-9, case-insensitive)
- - Valid alphanumeric characters: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
- - INVALID examples: aw_ab (too short), aw_123456789 (too long), aw_test-id (contains hyphen), aw_id_123 (contains underscore)
- - VALID examples: aw_abc, aw_abc1, aw_Test123, aw_A1B2C3D4, aw_12345678
- - To generate valid IDs: use 3-8 random alphanumeric characters or omit the field to let the system auto-generate
-
- Do NOT invent other aw_* formats — downstream steps will reject them with validation errors matching against /^aw_[A-Za-z0-9]{3,8}$/i.
-
- Discover available tools from the safeoutputs MCP server.
-
- **Critical**: Tool calls write structured data that downstream jobs process. Without tool calls, follow-up actions will be skipped.
-
- **Note**: If you made no other safe output tool calls during this workflow execution, call the "noop" tool to provide a status message indicating completion or that no actions were needed.
-
-
-
- The following GitHub context information is available for this workflow:
- {{#if __GH_AW_GITHUB_ACTOR__ }}
- - **actor**: __GH_AW_GITHUB_ACTOR__
- {{/if}}
- {{#if __GH_AW_GITHUB_REPOSITORY__ }}
- - **repository**: __GH_AW_GITHUB_REPOSITORY__
- {{/if}}
- {{#if __GH_AW_GITHUB_WORKSPACE__ }}
- - **workspace**: __GH_AW_GITHUB_WORKSPACE__
- {{/if}}
- {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }}
- - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__
- {{/if}}
- {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }}
- - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__
- {{/if}}
- {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }}
- - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__
- {{/if}}
- {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }}
- - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__
- {{/if}}
- {{#if __GH_AW_GITHUB_RUN_ID__ }}
- - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__
- {{/if}}
-
-
- GH_AW_PROMPT_EOF
- cat << 'GH_AW_PROMPT_EOF' >> "$GH_AW_PROMPT"
-
- GH_AW_PROMPT_EOF
- cat << 'GH_AW_PROMPT_EOF' >> "$GH_AW_PROMPT"
- {{#runtime-import .github/workflows/shared/gh.md}}
- GH_AW_PROMPT_EOF
- cat << 'GH_AW_PROMPT_EOF' >> "$GH_AW_PROMPT"
- {{#runtime-import .github/workflows/shared/reporting.md}}
- GH_AW_PROMPT_EOF
- cat << 'GH_AW_PROMPT_EOF' >> "$GH_AW_PROMPT"
- {{#runtime-import .github/workflows/smoke-copilot-sdk.md}}
- GH_AW_PROMPT_EOF
- - name: Interpolate variables and render templates
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
- env:
- GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
- with:
- script: |
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
- setupGlobals(core, github, context, exec, io);
- const { main } = require('/opt/gh-aw/actions/interpolate_prompt.cjs');
- await main();
- - name: Substitute placeholders
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
- env:
- GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
- GH_AW_ALLOWED_EXTENSIONS: ''
- GH_AW_CACHE_DESCRIPTION: ''
- GH_AW_CACHE_DIR: '/tmp/gh-aw/cache-memory/'
- GH_AW_GITHUB_ACTOR: ${{ github.actor }}
- GH_AW_GITHUB_EVENT_COMMENT_ID: ${{ github.event.comment.id }}
- GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER: ${{ github.event.discussion.number }}
- GH_AW_GITHUB_EVENT_ISSUE_NUMBER: ${{ github.event.issue.number }}
- GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
- GH_AW_GITHUB_REPOSITORY: ${{ github.repository }}
- GH_AW_GITHUB_RUN_ID: ${{ github.run_id }}
- GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }}
- GH_AW_NEEDS_PRE_ACTIVATION_OUTPUTS_ACTIVATED: ${{ needs.pre_activation.outputs.activated }}
- GH_AW_NEEDS_PRE_ACTIVATION_OUTPUTS_MATCHED_COMMAND: ${{ needs.pre_activation.outputs.matched_command }}
- with:
- script: |
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
- setupGlobals(core, github, context, exec, io);
-
- const substitutePlaceholders = require('/opt/gh-aw/actions/substitute_placeholders.cjs');
-
- // Call the substitution function
- return await substitutePlaceholders({
- file: process.env.GH_AW_PROMPT,
- substitutions: {
- GH_AW_ALLOWED_EXTENSIONS: process.env.GH_AW_ALLOWED_EXTENSIONS,
- GH_AW_CACHE_DESCRIPTION: process.env.GH_AW_CACHE_DESCRIPTION,
- GH_AW_CACHE_DIR: process.env.GH_AW_CACHE_DIR,
- GH_AW_GITHUB_ACTOR: process.env.GH_AW_GITHUB_ACTOR,
- GH_AW_GITHUB_EVENT_COMMENT_ID: process.env.GH_AW_GITHUB_EVENT_COMMENT_ID,
- GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER: process.env.GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER,
- GH_AW_GITHUB_EVENT_ISSUE_NUMBER: process.env.GH_AW_GITHUB_EVENT_ISSUE_NUMBER,
- GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER: process.env.GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER,
- GH_AW_GITHUB_REPOSITORY: process.env.GH_AW_GITHUB_REPOSITORY,
- GH_AW_GITHUB_RUN_ID: process.env.GH_AW_GITHUB_RUN_ID,
- GH_AW_GITHUB_WORKSPACE: process.env.GH_AW_GITHUB_WORKSPACE,
- GH_AW_NEEDS_PRE_ACTIVATION_OUTPUTS_ACTIVATED: process.env.GH_AW_NEEDS_PRE_ACTIVATION_OUTPUTS_ACTIVATED,
- GH_AW_NEEDS_PRE_ACTIVATION_OUTPUTS_MATCHED_COMMAND: process.env.GH_AW_NEEDS_PRE_ACTIVATION_OUTPUTS_MATCHED_COMMAND
- }
- });
- - name: Validate prompt placeholders
- env:
- GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
- run: bash /opt/gh-aw/actions/validate_prompt_placeholders.sh
- - name: Print prompt
- env:
- GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
- run: bash /opt/gh-aw/actions/print_prompt_summary.sh
- - name: Upload prompt artifact
- if: success()
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
- with:
- name: prompt
- path: /tmp/gh-aw/aw-prompts/prompt.txt
- retention-days: 1
-
- agent:
- needs: activation
- runs-on: ubuntu-latest
- permissions:
- actions: read
- contents: read
- discussions: read
- issues: read
- pull-requests: read
- env:
- DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
- GH_AW_ASSETS_ALLOWED_EXTS: ""
- GH_AW_ASSETS_BRANCH: ""
- GH_AW_ASSETS_MAX_SIZE_KB: 0
- GH_AW_MCP_LOG_DIR: /tmp/gh-aw/mcp-logs/safeoutputs
- GH_AW_SAFE_OUTPUTS: /opt/gh-aw/safeoutputs/outputs.jsonl
- GH_AW_SAFE_OUTPUTS_CONFIG_PATH: /opt/gh-aw/safeoutputs/config.json
- GH_AW_SAFE_OUTPUTS_TOOLS_PATH: /opt/gh-aw/safeoutputs/tools.json
- GH_AW_WORKFLOW_ID_SANITIZED: smokecopilotsdk
- outputs:
- checkout_pr_success: ${{ steps.checkout-pr.outputs.checkout_pr_success || 'true' }}
- has_patch: ${{ steps.collect_output.outputs.has_patch }}
- model: ${{ steps.generate_aw_info.outputs.model }}
- output: ${{ steps.collect_output.outputs.output }}
- output_types: ${{ steps.collect_output.outputs.output_types }}
- secret_verification_result: ${{ steps.validate-secret.outputs.verification_result }}
- steps:
- - name: Checkout actions folder
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- with:
- sparse-checkout: |
- actions
- persist-credentials: false
- - name: Setup Scripts
- uses: ./actions/setup
- with:
- destination: /opt/gh-aw/actions
- - name: Checkout repository
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- with:
- persist-credentials: false
- - name: Setup Go for CLI build
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
- with:
- go-version-file: go.mod
- cache: true
- - name: Build gh-aw CLI
- run: |
- echo "Building gh-aw CLI for linux/amd64..."
- mkdir -p dist
- VERSION=$(git describe --tags --always --dirty)
- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \
- -ldflags "-s -w -X main.version=${VERSION}" \
- -o dist/gh-aw-linux-amd64 \
- ./cmd/gh-aw
- # Copy binary to root for direct execution in user-defined steps
- cp dist/gh-aw-linux-amd64 ./gh-aw
- chmod +x ./gh-aw
- echo "✓ Built gh-aw CLI successfully"
- - name: Setup Docker Buildx
- uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
- - name: Build gh-aw Docker image
- uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2
- with:
- context: .
- platforms: linux/amd64
- push: false
- load: true
- tags: localhost/gh-aw:dev
- build-args: |
- BINARY=dist/gh-aw-linux-amd64
- - name: Create gh-aw temp directory
- run: bash /opt/gh-aw/actions/create_gh_aw_tmp_dir.sh
- # Cache memory file share configuration from frontmatter processed below
- - name: Create cache-memory directory
- run: bash /opt/gh-aw/actions/create_cache_memory_dir.sh
- - name: Restore cache-memory file share data
- uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
- with:
- key: memory-${{ env.GH_AW_WORKFLOW_ID_SANITIZED }}-${{ github.run_id }}
- path: /tmp/gh-aw/cache-memory
- restore-keys: |
- memory-${{ env.GH_AW_WORKFLOW_ID_SANITIZED }}-
- - name: Configure Git credentials
- env:
- REPO_NAME: ${{ github.repository }}
- SERVER_URL: ${{ github.server_url }}
- run: |
- git config --global user.email "github-actions[bot]@users.noreply.github.com"
- git config --global user.name "github-actions[bot]"
- # Re-authenticate git with GitHub token
- SERVER_URL_STRIPPED="${SERVER_URL#https://}"
- git remote set-url origin "https://x-access-token:${{ github.token }}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git"
- echo "Git configured with standard GitHub Actions identity"
- - name: Checkout PR branch
- id: checkout-pr
- if: |
- github.event.pull_request
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
- env:
- GH_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
- with:
- github-token: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
- script: |
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
- setupGlobals(core, github, context, exec, io);
- const { main } = require('/opt/gh-aw/actions/checkout_pr_branch.cjs');
- await main();
- - name: Generate agentic run info
- id: generate_aw_info
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
- with:
- script: |
- const fs = require('fs');
-
- const awInfo = {
- engine_id: "copilot-sdk",
- engine_name: "GitHub Copilot SDK",
- model: process.env.GH_AW_MODEL_AGENT_CUSTOM || "",
- version: "",
- agent_version: "",
- workflow_name: "Smoke Copilot SDK",
- experimental: true,
- supports_tools_allowlist: true,
- run_id: context.runId,
- run_number: context.runNumber,
- run_attempt: process.env.GITHUB_RUN_ATTEMPT,
- repository: context.repo.owner + '/' + context.repo.repo,
- ref: context.ref,
- sha: context.sha,
- actor: context.actor,
- event_name: context.eventName,
- staged: false,
- allowed_domains: ["defaults"],
- firewall_enabled: false,
- awf_version: "",
- awmg_version: "v0.1.4",
- steps: {
- firewall: "squid"
- },
- created_at: new Date().toISOString()
- };
-
- // Write to /tmp/gh-aw directory to avoid inclusion in PR
- const tmpPath = '/tmp/gh-aw/aw_info.json';
- fs.writeFileSync(tmpPath, JSON.stringify(awInfo, null, 2));
- console.log('Generated aw_info.json at:', tmpPath);
- console.log(JSON.stringify(awInfo, null, 2));
-
- // Set model as output for reuse in other steps/jobs
- core.setOutput('model', awInfo.model);
- - name: Validate COPILOT_GITHUB_TOKEN secret
- id: validate-secret
- run: /opt/gh-aw/actions/validate_multi_secret.sh COPILOT_GITHUB_TOKEN 'GitHub Copilot CLI' https://github.github.com/gh-aw/reference/engines/#github-copilot-default
- env:
- COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
- - name: Install GitHub Copilot CLI
- run: /opt/gh-aw/actions/install_copilot_cli.sh 0.0.410
- - name: Install awf binary
- run: bash /opt/gh-aw/actions/install_awf_binary.sh v0.20.0
- - name: Determine automatic lockdown mode for GitHub MCP Server
- id: determine-automatic-lockdown
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
- env:
- GH_AW_GITHUB_TOKEN: ${{ secrets.GH_AW_GITHUB_TOKEN }}
- GH_AW_GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN }}
- with:
- script: |
- const determineAutomaticLockdown = require('/opt/gh-aw/actions/determine_automatic_lockdown.cjs');
- await determineAutomaticLockdown(github, context, core);
- - name: Download container images
- run: bash /opt/gh-aw/actions/download_docker_images.sh ghcr.io/github/gh-aw-firewall/agent:0.20.0 ghcr.io/github/gh-aw-firewall/api-proxy:0.20.0 ghcr.io/github/gh-aw-firewall/squid:0.20.0 ghcr.io/github/gh-aw-mcpg:v0.1.4 ghcr.io/github/github-mcp-server:v0.30.3 node:lts-alpine
- - name: Install gh-aw extension
- env:
- GH_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
- run: |
- # Check if gh-aw extension is already installed
- if gh extension list | grep -q "github/gh-aw"; then
- echo "gh-aw extension already installed, upgrading..."
- gh extension upgrade gh-aw || true
- else
- echo "Installing gh-aw extension..."
- gh extension install github/gh-aw
- fi
- gh aw --version
- # Copy the gh-aw binary to /opt/gh-aw for MCP server containerization
- mkdir -p /opt/gh-aw
- GH_AW_BIN=$(which gh-aw 2>/dev/null || find ~/.local/share/gh/extensions/gh-aw -name 'gh-aw' -type f 2>/dev/null | head -1)
- if [ -n "$GH_AW_BIN" ] && [ -f "$GH_AW_BIN" ]; then
- cp "$GH_AW_BIN" /opt/gh-aw/gh-aw
- chmod +x /opt/gh-aw/gh-aw
- echo "Copied gh-aw binary to /opt/gh-aw/gh-aw"
- else
- echo "::error::Failed to find gh-aw binary for MCP server"
- exit 1
- fi
- - name: Write Safe Outputs Config
- run: |
- mkdir -p /opt/gh-aw/safeoutputs
- mkdir -p /tmp/gh-aw/safeoutputs
- mkdir -p /tmp/gh-aw/mcp-logs/safeoutputs
- cat > /opt/gh-aw/safeoutputs/config.json << 'GH_AW_SAFE_OUTPUTS_CONFIG_EOF'
- {"add_comment":{"allowed_repos":["github/gh-aw"],"max":2},"add_labels":{"allowed":["smoke-copilot-sdk"],"allowed_repos":["github/gh-aw"],"max":3},"create_issue":{"expires":2,"group":true,"max":1},"missing_data":{},"missing_tool":{},"noop":{"max":1},"remove_labels":{"allowed":["smoke"],"max":3}}
- GH_AW_SAFE_OUTPUTS_CONFIG_EOF
- cat > /opt/gh-aw/safeoutputs/tools.json << 'GH_AW_SAFE_OUTPUTS_TOOLS_EOF'
- [
- {
- "description": "Create a new GitHub issue for tracking bugs, feature requests, or tasks. Use this for actionable work items that need assignment, labeling, and status tracking. For reports, announcements, or status updates that don't require task tracking, use create_discussion instead. CONSTRAINTS: Maximum 1 issue(s) can be created.",
- "inputSchema": {
- "additionalProperties": false,
- "properties": {
- "body": {
- "description": "Detailed issue description in Markdown. Do NOT repeat the title as a heading since it already appears as the issue's h1. Include context, reproduction steps, or acceptance criteria as appropriate.",
- "type": "string"
- },
- "labels": {
- "description": "Labels to categorize the issue (e.g., 'bug', 'enhancement'). Labels must exist in the repository.",
- "items": {
- "type": "string"
- },
- "type": "array"
- },
- "parent": {
- "description": "Parent issue number for creating sub-issues. This is the numeric ID from the GitHub URL (e.g., 42 in github.com/owner/repo/issues/42). Can also be a temporary_id (e.g., 'aw_abc123', 'aw_Test123') from a previously created issue in the same workflow run.",
- "type": [
- "number",
- "string"
- ]
- },
- "temporary_id": {
- "description": "Unique temporary identifier for referencing this issue before it's created. Format: 'aw_' followed by 3 to 8 alphanumeric characters (e.g., 'aw_abc1', 'aw_Test123'). Use '#aw_ID' in body text to reference other issues by their temporary_id; these are replaced with actual issue numbers after creation.",
- "pattern": "^aw_[A-Za-z0-9]{3,8}$",
- "type": "string"
- },
- "title": {
- "description": "Concise issue title summarizing the bug, feature, or task. The title appears as the main heading, so keep it brief and descriptive.",
- "type": "string"
- }
- },
- "required": [
- "title",
- "body"
- ],
- "type": "object"
- },
- "name": "create_issue"
- },
- {
- "description": "Add a comment to an existing GitHub issue, pull request, or discussion. Use this to provide feedback, answer questions, or add information to an existing conversation. For creating new items, use create_issue, create_discussion, or create_pull_request instead. IMPORTANT: Comments are subject to validation constraints enforced by the MCP server - maximum 65536 characters for the complete comment (including footer which is added automatically), 10 mentions (@username), and 50 links. Exceeding these limits will result in an immediate error with specific guidance. CONSTRAINTS: Maximum 2 comment(s) can be added.",
- "inputSchema": {
- "additionalProperties": false,
- "properties": {
- "body": {
- "description": "The comment text in Markdown format. This is the 'body' field - do not use 'comment_body' or other variations. Provide helpful, relevant information that adds value to the conversation. CONSTRAINTS: The complete comment (your body text + automatically added footer) must not exceed 65536 characters total. Maximum 10 mentions (@username), maximum 50 links (http/https URLs). A footer (~200-500 characters) is automatically appended with workflow attribution, so leave adequate space. If these limits are exceeded, the tool call will fail with a detailed error message indicating which constraint was violated.",
- "type": "string"
- },
- "item_number": {
- "description": "The issue, pull request, or discussion number to comment on. This is the numeric ID from the GitHub URL (e.g., 123 in github.com/owner/repo/issues/123). If omitted, the tool will attempt to resolve the target from the current workflow context (triggering issue, PR, or discussion).",
- "type": "number"
- },
- "repo": {
- "description": "Target repository for this operation in 'owner/repo' format. Must be the target-repo or in the allowed-repos list.",
- "type": "string"
- }
- },
- "required": [
- "body"
- ],
- "type": "object"
- },
- "name": "add_comment"
- },
- {
- "description": "Add labels to an existing GitHub issue or pull request for categorization and filtering. Labels must already exist in the repository. For creating new issues with labels, use create_issue with the labels property instead. CONSTRAINTS: Only these labels are allowed: [smoke-copilot-sdk].",
- "inputSchema": {
- "additionalProperties": false,
- "properties": {
- "item_number": {
- "description": "Issue or PR number to add labels to. This is the numeric ID from the GitHub URL (e.g., 456 in github.com/owner/repo/issues/456). If omitted, adds labels to the item that triggered this workflow.",
- "type": "number"
- },
- "labels": {
- "description": "Label names to add (e.g., ['bug', 'priority-high']). Labels must exist in the repository.",
- "items": {
- "type": "string"
- },
- "type": "array"
- },
- "repo": {
- "description": "Target repository for this operation in 'owner/repo' format. Must be the target-repo or in the allowed-repos list.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "name": "add_labels"
- },
- {
- "description": "Remove labels from an existing GitHub issue or pull request. Silently skips labels that don't exist on the item. Use this to clean up labels or manage label lifecycles (e.g., removing 'needs-review' after review is complete). CONSTRAINTS: Only these labels can be removed: [smoke].",
- "inputSchema": {
- "additionalProperties": false,
- "properties": {
- "item_number": {
- "description": "Issue or PR number to remove labels from. This is the numeric ID from the GitHub URL (e.g., 456 in github.com/owner/repo/issues/456). If omitted, removes labels from the item that triggered this workflow.",
- "type": "number"
- },
- "labels": {
- "description": "Label names to remove (e.g., ['smoke', 'needs-triage']). Non-existent labels are silently skipped.",
- "items": {
- "type": "string"
- },
- "type": "array"
- }
- },
- "required": [
- "labels"
- ],
- "type": "object"
- },
- "name": "remove_labels"
- },
- {
- "description": "Report that a tool or capability needed to complete the task is not available, or share any information you deem important about missing functionality or limitations. Use this when you cannot accomplish what was requested because the required functionality is missing or access is restricted.",
- "inputSchema": {
- "additionalProperties": false,
- "properties": {
- "alternatives": {
- "description": "Any workarounds, manual steps, or alternative approaches the user could take (max 256 characters).",
- "type": "string"
- },
- "reason": {
- "description": "Explanation of why this tool is needed or what information you want to share about the limitation (max 256 characters).",
- "type": "string"
- },
- "tool": {
- "description": "Optional: Name or description of the missing tool or capability (max 128 characters). Be specific about what functionality is needed.",
- "type": "string"
- }
- },
- "required": [
- "reason"
- ],
- "type": "object"
- },
- "name": "missing_tool"
- },
- {
- "description": "Log a transparency message when no significant actions are needed. Use this to confirm workflow completion and provide visibility when analysis is complete but no changes or outputs are required (e.g., 'No issues found', 'All checks passed'). This ensures the workflow produces human-visible output even when no other actions are taken.",
- "inputSchema": {
- "additionalProperties": false,
- "properties": {
- "message": {
- "description": "Status or completion message to log. Should explain what was analyzed and the outcome (e.g., 'Code review complete - no issues found', 'Analysis complete - all tests passing').",
- "type": "string"
- }
- },
- "required": [
- "message"
- ],
- "type": "object"
- },
- "name": "noop"
- },
- {
- "description": "Report that data or information needed to complete the task is not available. Use this when you cannot accomplish what was requested because required data, context, or information is missing.",
- "inputSchema": {
- "additionalProperties": false,
- "properties": {
- "alternatives": {
- "description": "Any workarounds, manual steps, or alternative approaches the user could take (max 256 characters).",
- "type": "string"
- },
- "context": {
- "description": "Additional context about the missing data or where it should come from (max 256 characters).",
- "type": "string"
- },
- "data_type": {
- "description": "Type or description of the missing data or information (max 128 characters). Be specific about what data is needed.",
- "type": "string"
- },
- "reason": {
- "description": "Explanation of why this data is needed to complete the task (max 256 characters).",
- "type": "string"
- }
- },
- "required": [],
- "type": "object"
- },
- "name": "missing_data"
- }
- ]
- GH_AW_SAFE_OUTPUTS_TOOLS_EOF
- cat > /opt/gh-aw/safeoutputs/validation.json << 'GH_AW_SAFE_OUTPUTS_VALIDATION_EOF'
- {
- "add_comment": {
- "defaultMax": 1,
- "fields": {
- "body": {
- "required": true,
- "type": "string",
- "sanitize": true,
- "maxLength": 65000
- },
- "item_number": {
- "issueOrPRNumber": true
- }
- }
- },
- "add_labels": {
- "defaultMax": 5,
- "fields": {
- "item_number": {
- "issueOrPRNumber": true
- },
- "labels": {
- "required": true,
- "type": "array",
- "itemType": "string",
- "itemSanitize": true,
- "itemMaxLength": 128
- }
- }
- },
- "create_issue": {
- "defaultMax": 1,
- "fields": {
- "body": {
- "required": true,
- "type": "string",
- "sanitize": true,
- "maxLength": 65000
- },
- "labels": {
- "type": "array",
- "itemType": "string",
- "itemSanitize": true,
- "itemMaxLength": 128
- },
- "parent": {
- "issueOrPRNumber": true
- },
- "repo": {
- "type": "string",
- "maxLength": 256
- },
- "temporary_id": {
- "type": "string"
- },
- "title": {
- "required": true,
- "type": "string",
- "sanitize": true,
- "maxLength": 128
- }
- }
- },
- "missing_tool": {
- "defaultMax": 20,
- "fields": {
- "alternatives": {
- "type": "string",
- "sanitize": true,
- "maxLength": 512
- },
- "reason": {
- "required": true,
- "type": "string",
- "sanitize": true,
- "maxLength": 256
- },
- "tool": {
- "type": "string",
- "sanitize": true,
- "maxLength": 128
- }
- }
- },
- "noop": {
- "defaultMax": 1,
- "fields": {
- "message": {
- "required": true,
- "type": "string",
- "sanitize": true,
- "maxLength": 65000
- }
- }
- }
- }
- GH_AW_SAFE_OUTPUTS_VALIDATION_EOF
- - name: Generate Safe Outputs MCP Server Config
- id: safe-outputs-config
- run: |
- # Generate a secure random API key (360 bits of entropy, 40+ chars)
- # Mask immediately to prevent timing vulnerabilities
- API_KEY=$(openssl rand -base64 45 | tr -d '/+=')
- echo "::add-mask::${API_KEY}"
-
- PORT=3001
-
- # Set outputs for next steps
- {
- echo "safe_outputs_api_key=${API_KEY}"
- echo "safe_outputs_port=${PORT}"
- } >> "$GITHUB_OUTPUT"
-
- echo "Safe Outputs MCP server will run on port ${PORT}"
-
- - name: Start Safe Outputs MCP HTTP Server
- id: safe-outputs-start
- env:
- DEBUG: '*'
- GH_AW_SAFE_OUTPUTS_PORT: ${{ steps.safe-outputs-config.outputs.safe_outputs_port }}
- GH_AW_SAFE_OUTPUTS_API_KEY: ${{ steps.safe-outputs-config.outputs.safe_outputs_api_key }}
- GH_AW_SAFE_OUTPUTS_TOOLS_PATH: /opt/gh-aw/safeoutputs/tools.json
- GH_AW_SAFE_OUTPUTS_CONFIG_PATH: /opt/gh-aw/safeoutputs/config.json
- GH_AW_MCP_LOG_DIR: /tmp/gh-aw/mcp-logs/safeoutputs
- run: |
- # Environment variables are set above to prevent template injection
- export DEBUG
- export GH_AW_SAFE_OUTPUTS_PORT
- export GH_AW_SAFE_OUTPUTS_API_KEY
- export GH_AW_SAFE_OUTPUTS_TOOLS_PATH
- export GH_AW_SAFE_OUTPUTS_CONFIG_PATH
- export GH_AW_MCP_LOG_DIR
-
- bash /opt/gh-aw/actions/start_safe_outputs_server.sh
-
- - name: Setup Safe Inputs Config
- run: |
- mkdir -p /opt/gh-aw/safe-inputs/logs
- cat > /opt/gh-aw/safe-inputs/tools.json << 'GH_AW_SAFE_INPUTS_TOOLS_EOF'
- {
- "serverName": "safeinputs",
- "version": "1.0.0",
- "logDir": "/opt/gh-aw/safe-inputs/logs",
- "tools": [
- {
- "name": "gh",
- "description": "Execute any gh CLI command. This tool is accessible as 'safeinputs-gh'. Provide the full command after 'gh' (e.g., args: 'pr list --limit 5'). The tool will run: gh \u003cargs\u003e. Use single quotes ' for complex args to avoid shell interpretation issues.",
- "inputSchema": {
- "properties": {
- "args": {
- "description": "Arguments to pass to gh CLI (without the 'gh' prefix). Examples: 'pr list --limit 5', 'issue view 123', 'api repos/{owner}/{repo}'",
- "type": "string"
- }
- },
- "required": [
- "args"
- ],
- "type": "object"
- },
- "handler": "gh.sh",
- "env": {
- "GH_AW_GH_TOKEN": "GH_AW_GH_TOKEN",
- "GH_DEBUG": "GH_DEBUG"
- },
- "timeout": 60
- }
- ]
- }
- GH_AW_SAFE_INPUTS_TOOLS_EOF
- cat > /opt/gh-aw/safe-inputs/mcp-server.cjs << 'GH_AW_SAFE_INPUTS_SERVER_EOF'
- const path = require("path");
- const { startHttpServer } = require("./safe_inputs_mcp_server_http.cjs");
- const configPath = path.join(__dirname, "tools.json");
- const port = parseInt(process.env.GH_AW_SAFE_INPUTS_PORT || "3000", 10);
- const apiKey = process.env.GH_AW_SAFE_INPUTS_API_KEY || "";
- startHttpServer(configPath, {
- port: port,
- stateless: true,
- logDir: "/opt/gh-aw/safe-inputs/logs"
- }).catch(error => {
- console.error("Failed to start safe-inputs HTTP server:", error);
- process.exit(1);
- });
- GH_AW_SAFE_INPUTS_SERVER_EOF
- chmod +x /opt/gh-aw/safe-inputs/mcp-server.cjs
-
- - name: Setup Safe Inputs Tool Files
- run: |
- cat > /opt/gh-aw/safe-inputs/gh.sh << 'GH_AW_SAFE_INPUTS_SH_GH_EOF'
- #!/bin/bash
- # Auto-generated safe-input tool: gh
- # Execute any gh CLI command. This tool is accessible as 'safeinputs-gh'. Provide the full command after 'gh' (e.g., args: 'pr list --limit 5'). The tool will run: gh . Use single quotes ' for complex args to avoid shell interpretation issues.
-
- set -euo pipefail
-
- echo "gh $INPUT_ARGS"
- echo " token: ${GH_AW_GH_TOKEN:0:6}..."
- GH_TOKEN="$GH_AW_GH_TOKEN" gh $INPUT_ARGS
-
- GH_AW_SAFE_INPUTS_SH_GH_EOF
- chmod +x /opt/gh-aw/safe-inputs/gh.sh
-
- - name: Generate Safe Inputs MCP Server Config
- id: safe-inputs-config
- run: |
- # Generate a secure random API key (360 bits of entropy, 40+ chars)
- # Mask immediately to prevent timing vulnerabilities
- API_KEY=$(openssl rand -base64 45 | tr -d '/+=')
- echo "::add-mask::${API_KEY}"
-
- PORT=3000
-
- # Set outputs for next steps
- {
- echo "safe_inputs_api_key=${API_KEY}"
- echo "safe_inputs_port=${PORT}"
- } >> "$GITHUB_OUTPUT"
-
- echo "Safe Inputs MCP server will run on port ${PORT}"
-
- - name: Start Safe Inputs MCP HTTP Server
- id: safe-inputs-start
- env:
- DEBUG: '*'
- GH_AW_SAFE_INPUTS_PORT: ${{ steps.safe-inputs-config.outputs.safe_inputs_port }}
- GH_AW_SAFE_INPUTS_API_KEY: ${{ steps.safe-inputs-config.outputs.safe_inputs_api_key }}
- GH_AW_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- GH_DEBUG: 1
- run: |
- # Environment variables are set above to prevent template injection
- export DEBUG
- export GH_AW_SAFE_INPUTS_PORT
- export GH_AW_SAFE_INPUTS_API_KEY
-
- bash /opt/gh-aw/actions/start_safe_inputs_server.sh
-
- - name: Start MCP Gateway
- id: start-mcp-gateway
- env:
- GH_AW_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- GH_AW_SAFE_INPUTS_API_KEY: ${{ steps.safe-inputs-start.outputs.api_key }}
- GH_AW_SAFE_INPUTS_PORT: ${{ steps.safe-inputs-start.outputs.port }}
- GH_AW_SAFE_OUTPUTS: ${{ env.GH_AW_SAFE_OUTPUTS }}
- GH_AW_SAFE_OUTPUTS_API_KEY: ${{ steps.safe-outputs-start.outputs.api_key }}
- GH_AW_SAFE_OUTPUTS_PORT: ${{ steps.safe-outputs-start.outputs.port }}
- GH_DEBUG: 1
- GITHUB_MCP_LOCKDOWN: ${{ steps.determine-automatic-lockdown.outputs.lockdown == 'true' && '1' || '0' }}
- GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: |
- set -eo pipefail
- mkdir -p /tmp/gh-aw/mcp-config
-
- # Export gateway environment variables for MCP config and gateway script
- export MCP_GATEWAY_PORT="80"
- export MCP_GATEWAY_DOMAIN="host.docker.internal"
- MCP_GATEWAY_API_KEY=$(openssl rand -base64 45 | tr -d '/+=')
- echo "::add-mask::${MCP_GATEWAY_API_KEY}"
- export MCP_GATEWAY_API_KEY
- export MCP_GATEWAY_PAYLOAD_DIR="/tmp/gh-aw/mcp-payloads"
- mkdir -p "${MCP_GATEWAY_PAYLOAD_DIR}"
- export DEBUG="*"
-
- export GH_AW_ENGINE="copilot-sdk"
- export MCP_GATEWAY_DOCKER_COMMAND='docker run -i --rm --network host -v /var/run/docker.sock:/var/run/docker.sock -e MCP_GATEWAY_PORT -e MCP_GATEWAY_DOMAIN -e MCP_GATEWAY_API_KEY -e MCP_GATEWAY_PAYLOAD_DIR -e DEBUG -e MCP_GATEWAY_LOG_DIR -e GH_AW_MCP_LOG_DIR -e GH_AW_SAFE_OUTPUTS -e GH_AW_SAFE_OUTPUTS_CONFIG_PATH -e GH_AW_SAFE_OUTPUTS_TOOLS_PATH -e GH_AW_ASSETS_BRANCH -e GH_AW_ASSETS_MAX_SIZE_KB -e GH_AW_ASSETS_ALLOWED_EXTS -e DEFAULT_BRANCH -e GITHUB_MCP_SERVER_TOKEN -e GITHUB_MCP_LOCKDOWN -e GITHUB_REPOSITORY -e GITHUB_SERVER_URL -e GITHUB_SHA -e GITHUB_WORKSPACE -e GITHUB_TOKEN -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RUN_ATTEMPT -e GITHUB_JOB -e GITHUB_ACTION -e GITHUB_EVENT_NAME -e GITHUB_EVENT_PATH -e GITHUB_ACTOR -e GITHUB_ACTOR_ID -e GITHUB_TRIGGERING_ACTOR -e GITHUB_WORKFLOW -e GITHUB_WORKFLOW_REF -e GITHUB_WORKFLOW_SHA -e GITHUB_REF -e GITHUB_REF_NAME -e GITHUB_REF_TYPE -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GH_AW_SAFE_INPUTS_PORT -e GH_AW_SAFE_INPUTS_API_KEY -e GH_AW_SAFE_OUTPUTS_PORT -e GH_AW_SAFE_OUTPUTS_API_KEY -e GH_AW_GH_TOKEN -e GH_DEBUG -v /tmp/gh-aw/mcp-payloads:/tmp/gh-aw/mcp-payloads:rw -v /opt:/opt:ro -v /tmp:/tmp:rw -v '"${GITHUB_WORKSPACE}"':'"${GITHUB_WORKSPACE}"':rw ghcr.io/github/gh-aw-mcpg:v0.1.4'
-
- mkdir -p /home/runner/.copilot
- cat << GH_AW_MCP_CONFIG_EOF | bash /opt/gh-aw/actions/start_mcp_gateway.sh
- {
- "mcpServers": {
- "agenticworkflows": {
- "type": "stdio",
- "container": "host.docker.internal/gh-aw:dev",
- "mounts": ["\${GITHUB_WORKSPACE}:\${GITHUB_WORKSPACE}:rw", "/tmp/gh-aw:/tmp/gh-aw:rw"],
- "args": ["--network", "host", "-w", "\${GITHUB_WORKSPACE}"],
- "env": {
- "DEBUG": "*",
- "GITHUB_TOKEN": "\${GITHUB_TOKEN}",
- "GITHUB_ACTOR": "\${GITHUB_ACTOR}",
- "GITHUB_REPOSITORY": "\${GITHUB_REPOSITORY}"
- }
- },
- "github": {
- "type": "stdio",
- "container": "ghcr.io/github/github-mcp-server:v0.30.3",
- "env": {
- "GITHUB_LOCKDOWN_MODE": "$GITHUB_MCP_LOCKDOWN",
- "GITHUB_PERSONAL_ACCESS_TOKEN": "\${GITHUB_MCP_SERVER_TOKEN}",
- "GITHUB_READ_ONLY": "1",
- "GITHUB_TOOLSETS": "context,repos,issues,pull_requests"
- }
- },
- "safeinputs": {
- "type": "http",
- "url": "http://host.docker.internal:$GH_AW_SAFE_INPUTS_PORT",
- "headers": {
- "Authorization": "\${GH_AW_SAFE_INPUTS_API_KEY}"
- }
- },
- "safeoutputs": {
- "type": "http",
- "url": "http://host.docker.internal:$GH_AW_SAFE_OUTPUTS_PORT",
- "headers": {
- "Authorization": "\${GH_AW_SAFE_OUTPUTS_API_KEY}"
- }
- }
- },
- "gateway": {
- "port": $MCP_GATEWAY_PORT,
- "domain": "${MCP_GATEWAY_DOMAIN}",
- "apiKey": "${MCP_GATEWAY_API_KEY}",
- "payloadDir": "${MCP_GATEWAY_PAYLOAD_DIR}"
- }
- }
- GH_AW_MCP_CONFIG_EOF
- - name: Generate workflow overview
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
- with:
- script: |
- const { generateWorkflowOverview } = require('/opt/gh-aw/actions/generate_workflow_overview.cjs');
- await generateWorkflowOverview(core);
- - name: Download prompt artifact
- uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6
- with:
- name: prompt
- path: /tmp/gh-aw/aw-prompts
- - name: Clean git credentials
- run: bash /opt/gh-aw/actions/clean_git_credentials.sh
- - name: Start Copilot CLI in headless mode
- run: |
- # Start Copilot CLI in headless mode on port 10002
- copilot --headless --port 10002 &
- COPILOT_PID=$!
- echo "COPILOT_PID=${COPILOT_PID}" >> $GITHUB_ENV
-
- # Wait for Copilot to be ready
- sleep 5
-
- # Verify Copilot is running
- if ! kill -0 ${COPILOT_PID} 2>/dev/null; then
- echo "::error::Copilot CLI failed to start"
- exit 1
- fi
-
- echo "✓ Copilot CLI started in headless mode on port 10002"
- - name: Configure Copilot SDK client
- run: |
- # Create directory for event log
- mkdir -p /tmp/gh-aw/copilot-sdk/
-
- # Set configuration via environment variable
- echo 'GH_AW_COPILOT_CONFIG={"cliUrl":"http://host.docker.internal:10002","eventLogFile":"/tmp/gh-aw/copilot-sdk/event-log.jsonl","githubToken":"${{ secrets.COPILOT_GITHUB_TOKEN }}","logLevel":"info","promptFile":"/tmp/gh-aw/aw-prompts/prompt.txt"}' >> $GITHUB_ENV
- - name: Execute Copilot SDK client
- id: agentic_execution
- run: |
- # Execute copilot-client.js with Node.js
- # Configuration is read from GH_AW_COPILOT_CONFIG environment variable
- node /opt/gh-aw/copilot/copilot-client.js
-
- # Check exit code
- if [ $? -ne 0 ]; then
- echo "::error::Copilot SDK client execution failed"
- exit 1
- fi
-
- echo "✓ Copilot SDK client execution completed"
- env:
- GH_AW_COPILOT_CONFIG: ${{ env.GH_AW_COPILOT_CONFIG }}
- - name: Configure Git credentials
- env:
- REPO_NAME: ${{ github.repository }}
- SERVER_URL: ${{ github.server_url }}
- run: |
- git config --global user.email "github-actions[bot]@users.noreply.github.com"
- git config --global user.name "github-actions[bot]"
- # Re-authenticate git with GitHub token
- SERVER_URL_STRIPPED="${SERVER_URL#https://}"
- git remote set-url origin "https://x-access-token:${{ github.token }}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git"
- echo "Git configured with standard GitHub Actions identity"
- - name: Stop MCP Gateway
- if: always()
- continue-on-error: true
- env:
- MCP_GATEWAY_PORT: ${{ steps.start-mcp-gateway.outputs.gateway-port }}
- MCP_GATEWAY_API_KEY: ${{ steps.start-mcp-gateway.outputs.gateway-api-key }}
- GATEWAY_PID: ${{ steps.start-mcp-gateway.outputs.gateway-pid }}
- run: |
- bash /opt/gh-aw/actions/stop_mcp_gateway.sh "$GATEWAY_PID"
- - name: Redact secrets in logs
- if: always()
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
- with:
- script: |
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
- setupGlobals(core, github, context, exec, io);
- const { main } = require('/opt/gh-aw/actions/redact_secrets.cjs');
- await main();
- env:
- GH_AW_SECRET_NAMES: 'COPILOT_GITHUB_TOKEN,GH_AW_GITHUB_MCP_SERVER_TOKEN,GH_AW_GITHUB_TOKEN,GITHUB_TOKEN'
- SECRET_COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
- SECRET_GH_AW_GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN }}
- SECRET_GH_AW_GITHUB_TOKEN: ${{ secrets.GH_AW_GITHUB_TOKEN }}
- SECRET_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- - name: Upload Safe Outputs
- if: always()
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
- with:
- name: safe-output
- path: ${{ env.GH_AW_SAFE_OUTPUTS }}
- if-no-files-found: warn
- - name: Ingest agent output
- id: collect_output
- if: always()
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
- env:
- GH_AW_SAFE_OUTPUTS: ${{ env.GH_AW_SAFE_OUTPUTS }}
- GH_AW_ALLOWED_DOMAINS: "api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,json-schema.org,json.schemastore.org,keyserver.ubuntu.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,ppa.launchpad.net,s.symcb.com,s.symcd.com,security.ubuntu.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com"
- GITHUB_SERVER_URL: ${{ github.server_url }}
- GITHUB_API_URL: ${{ github.api_url }}
- with:
- script: |
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
- setupGlobals(core, github, context, exec, io);
- const { main } = require('/opt/gh-aw/actions/collect_ndjson_output.cjs');
- await main();
- - name: Upload sanitized agent output
- if: always() && env.GH_AW_AGENT_OUTPUT
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
- with:
- name: agent-output
- path: ${{ env.GH_AW_AGENT_OUTPUT }}
- if-no-files-found: warn
- - name: Upload engine output files
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
- with:
- name: agent_outputs
- path: |
- /tmp/gh-aw/copilot-sdk/event-log.jsonl
- /tmp/gh-aw/redacted-urls.log
- if-no-files-found: ignore
- - name: Parse agent logs for step summary
- if: always()
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
- env:
- GH_AW_AGENT_OUTPUT: /tmp/gh-aw/copilot-sdk/event-log.jsonl
- with:
- script: |
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
- setupGlobals(core, github, context, exec, io);
- const { main } = require('/opt/gh-aw/actions/parse-copilot-log.cjs');
- await main();
- - name: Parse safe-inputs logs for step summary
- if: always()
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
- with:
- script: |
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
- setupGlobals(core, github, context, exec, io);
- const { main } = require('/opt/gh-aw/actions/parse_safe_inputs_logs.cjs');
- await main();
- - name: Parse MCP Gateway logs for step summary
- if: always()
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
- with:
- script: |
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
- setupGlobals(core, github, context, exec, io);
- const { main } = require('/opt/gh-aw/actions/parse_mcp_gateway_log.cjs');
- await main();
- - name: Upload cache-memory data as artifact
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
- if: always()
- with:
- name: cache-memory
- path: /tmp/gh-aw/cache-memory
- - name: Upload agent artifacts
- if: always()
- continue-on-error: true
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
- with:
- name: agent-artifacts
- path: |
- /tmp/gh-aw/aw-prompts/prompt.txt
- /tmp/gh-aw/aw_info.json
- /tmp/gh-aw/mcp-logs/
- /tmp/gh-aw/safe-inputs/logs/
- /tmp/gh-aw/agent-stdio.log
- /tmp/gh-aw/agent/
- if-no-files-found: ignore
-
- conclusion:
- needs:
- - activation
- - agent
- - detection
- - safe_outputs
- - update_cache_memory
- if: (always()) && (needs.agent.result != 'skipped')
- runs-on: ubuntu-slim
- permissions:
- contents: read
- discussions: write
- issues: write
- pull-requests: write
- outputs:
- noop_message: ${{ steps.noop.outputs.noop_message }}
- tools_reported: ${{ steps.missing_tool.outputs.tools_reported }}
- total_count: ${{ steps.missing_tool.outputs.total_count }}
- steps:
- - name: Checkout actions folder
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- with:
- sparse-checkout: |
- actions
- persist-credentials: false
- - name: Setup Scripts
- uses: ./actions/setup
- with:
- destination: /opt/gh-aw/actions
- - name: Download agent output artifact
- continue-on-error: true
- uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6
- with:
- name: agent-output
- path: /tmp/gh-aw/safeoutputs/
- - name: Setup agent output environment variable
- run: |
- mkdir -p /tmp/gh-aw/safeoutputs/
- find "/tmp/gh-aw/safeoutputs/" -type f -print
- echo "GH_AW_AGENT_OUTPUT=/tmp/gh-aw/safeoutputs/agent_output.json" >> "$GITHUB_ENV"
- - name: Process No-Op Messages
- id: noop
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
- env:
- GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_NOOP_MAX: 1
- GH_AW_WORKFLOW_NAME: "Smoke Copilot SDK"
- with:
- github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
- script: |
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
- setupGlobals(core, github, context, exec, io);
- const { main } = require('/opt/gh-aw/actions/noop.cjs');
- await main();
- - name: Record Missing Tool
- id: missing_tool
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
- env:
- GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_WORKFLOW_NAME: "Smoke Copilot SDK"
- with:
- github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
- script: |
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
- setupGlobals(core, github, context, exec, io);
- const { main } = require('/opt/gh-aw/actions/missing_tool.cjs');
- await main();
- - name: Handle Agent Failure
- id: handle_agent_failure
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
- env:
- GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_WORKFLOW_NAME: "Smoke Copilot SDK"
- GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
- GH_AW_AGENT_CONCLUSION: ${{ needs.agent.result }}
- GH_AW_WORKFLOW_ID: "smoke-copilot-sdk"
- GH_AW_SECRET_VERIFICATION_RESULT: ${{ needs.agent.outputs.secret_verification_result }}
- GH_AW_CHECKOUT_PR_SUCCESS: ${{ needs.agent.outputs.checkout_pr_success }}
- with:
- github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
- script: |
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
- setupGlobals(core, github, context, exec, io);
- const { main } = require('/opt/gh-aw/actions/handle_agent_failure.cjs');
- await main();
- - name: Handle No-Op Message
- id: handle_noop_message
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
- env:
- GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_WORKFLOW_NAME: "Smoke Copilot SDK"
- GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
- GH_AW_AGENT_CONCLUSION: ${{ needs.agent.result }}
- GH_AW_NOOP_MESSAGE: ${{ steps.noop.outputs.noop_message }}
- GH_AW_NOOP_REPORT_AS_ISSUE: "true"
- with:
- github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
- script: |
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
- setupGlobals(core, github, context, exec, io);
- const { main } = require('/opt/gh-aw/actions/handle_noop_message.cjs');
- await main();
- - name: Update reaction comment with completion status
- id: conclusion
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
- env:
- GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_COMMENT_ID: ${{ needs.activation.outputs.comment_id }}
- GH_AW_COMMENT_REPO: ${{ needs.activation.outputs.comment_repo }}
- GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
- GH_AW_WORKFLOW_NAME: "Smoke Copilot SDK"
- GH_AW_AGENT_CONCLUSION: ${{ needs.agent.result }}
- GH_AW_DETECTION_CONCLUSION: ${{ needs.detection.result }}
- with:
- github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
- script: |
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
- setupGlobals(core, github, context, exec, io);
- const { main } = require('/opt/gh-aw/actions/notify_comment_error.cjs');
- await main();
-
- detection:
- needs: agent
- if: needs.agent.outputs.output_types != '' || needs.agent.outputs.has_patch == 'true'
- runs-on: ubuntu-latest
- permissions:
- contents: read
- timeout-minutes: 10
- outputs:
- success: ${{ steps.parse_results.outputs.success }}
- steps:
- - name: Checkout actions folder
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- with:
- sparse-checkout: |
- actions
- persist-credentials: false
- - name: Setup Scripts
- uses: ./actions/setup
- with:
- destination: /opt/gh-aw/actions
- - name: Download agent artifacts
- continue-on-error: true
- uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6
- with:
- name: agent-artifacts
- path: /tmp/gh-aw/threat-detection/
- - name: Download agent output artifact
- continue-on-error: true
- uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6
- with:
- name: agent-output
- path: /tmp/gh-aw/threat-detection/
- - name: Echo agent output types
- env:
- AGENT_OUTPUT_TYPES: ${{ needs.agent.outputs.output_types }}
- run: |
- echo "Agent output-types: $AGENT_OUTPUT_TYPES"
- - name: Setup threat detection
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
- env:
- WORKFLOW_NAME: "Smoke Copilot SDK"
- WORKFLOW_DESCRIPTION: "Smoke Copilot SDK"
- HAS_PATCH: ${{ needs.agent.outputs.has_patch }}
- with:
- script: |
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
- setupGlobals(core, github, context, exec, io);
- const { main } = require('/opt/gh-aw/actions/setup_threat_detection.cjs');
- await main();
- - name: Ensure threat-detection directory and log
- run: |
- mkdir -p /tmp/gh-aw/threat-detection
- touch /tmp/gh-aw/threat-detection/detection.log
- - name: Validate COPILOT_GITHUB_TOKEN secret
- id: validate-secret
- run: /opt/gh-aw/actions/validate_multi_secret.sh COPILOT_GITHUB_TOKEN 'GitHub Copilot CLI' https://github.github.com/gh-aw/reference/engines/#github-copilot-default
- env:
- COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
- - name: Install GitHub Copilot CLI
- run: /opt/gh-aw/actions/install_copilot_cli.sh 0.0.410
- - name: Start Copilot CLI in headless mode
- run: |
- # Start Copilot CLI in headless mode on port 10002
- copilot --headless --port 10002 &
- COPILOT_PID=$!
- echo "COPILOT_PID=${COPILOT_PID}" >> $GITHUB_ENV
-
- # Wait for Copilot to be ready
- sleep 5
-
- # Verify Copilot is running
- if ! kill -0 ${COPILOT_PID} 2>/dev/null; then
- echo "::error::Copilot CLI failed to start"
- exit 1
- fi
-
- echo "✓ Copilot CLI started in headless mode on port 10002"
- - name: Configure Copilot SDK client
- run: |
- # Create directory for event log
- mkdir -p /tmp/gh-aw/copilot-sdk/
-
- # Set configuration via environment variable
- echo 'GH_AW_COPILOT_CONFIG={"cliUrl":"http://host.docker.internal:10002","eventLogFile":"/tmp/gh-aw/copilot-sdk/event-log.jsonl","githubToken":"${{ secrets.COPILOT_GITHUB_TOKEN }}","logLevel":"info","promptFile":"/tmp/gh-aw/aw-prompts/prompt.txt"}' >> $GITHUB_ENV
- - name: Execute Copilot SDK client
- id: agentic_execution
- run: |
- # Execute copilot-client.js with Node.js
- # Configuration is read from GH_AW_COPILOT_CONFIG environment variable
- node /opt/gh-aw/copilot/copilot-client.js
-
- # Check exit code
- if [ $? -ne 0 ]; then
- echo "::error::Copilot SDK client execution failed"
- exit 1
- fi
-
- echo "✓ Copilot SDK client execution completed"
- env:
- GH_AW_COPILOT_CONFIG: ${{ env.GH_AW_COPILOT_CONFIG }}
- - name: Parse threat detection results
- id: parse_results
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
- with:
- script: |
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
- setupGlobals(core, github, context, exec, io);
- const { main } = require('/opt/gh-aw/actions/parse_threat_detection_results.cjs');
- await main();
- - name: Upload threat detection log
- if: always()
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
- with:
- name: threat-detection.log
- path: /tmp/gh-aw/threat-detection/detection.log
- if-no-files-found: ignore
-
- pre_activation:
- if: >
- ((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.id == github.repository_id)) &&
- ((github.event_name != 'pull_request') || ((github.event.action != 'labeled') || (github.event.label.name == 'smoke')))
- runs-on: ubuntu-slim
- permissions:
- contents: read
- discussions: write
- issues: write
- pull-requests: write
- outputs:
- activated: ${{ steps.check_membership.outputs.is_team_member == 'true' }}
- steps:
- - name: Checkout actions folder
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- with:
- sparse-checkout: |
- actions
- persist-credentials: false
- - name: Setup Scripts
- uses: ./actions/setup
- with:
- destination: /opt/gh-aw/actions
- - name: Add eyes reaction for immediate feedback
- id: react
- if: github.event_name == 'issues' || github.event_name == 'issue_comment' || github.event_name == 'pull_request_review_comment' || github.event_name == 'discussion' || github.event_name == 'discussion_comment' || (github.event_name == 'pull_request') && (github.event.pull_request.head.repo.id == github.repository_id)
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
- env:
- GH_AW_REACTION: "eyes"
- with:
- github-token: ${{ secrets.GITHUB_TOKEN }}
- script: |
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
- setupGlobals(core, github, context, exec, io);
- const { main } = require('/opt/gh-aw/actions/add_reaction.cjs');
- await main();
- - name: Check team membership for workflow
- id: check_membership
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
- env:
- GH_AW_REQUIRED_ROLES: admin,maintainer,write
- with:
- github-token: ${{ secrets.GITHUB_TOKEN }}
- script: |
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
- setupGlobals(core, github, context, exec, io);
- const { main } = require('/opt/gh-aw/actions/check_membership.cjs');
- await main();
-
- safe_outputs:
- needs:
- - agent
- - detection
- if: ((!cancelled()) && (needs.agent.result != 'skipped')) && (needs.detection.outputs.success == 'true')
- runs-on: ubuntu-slim
- permissions:
- contents: read
- discussions: write
- issues: write
- pull-requests: write
- timeout-minutes: 15
- env:
- GH_AW_ENGINE_ID: "copilot-sdk"
- GH_AW_WORKFLOW_ID: "smoke-copilot-sdk"
- GH_AW_WORKFLOW_NAME: "Smoke Copilot SDK"
- outputs:
- create_discussion_error_count: ${{ steps.process_safe_outputs.outputs.create_discussion_error_count }}
- create_discussion_errors: ${{ steps.process_safe_outputs.outputs.create_discussion_errors }}
- process_safe_outputs_processed_count: ${{ steps.process_safe_outputs.outputs.processed_count }}
- process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }}
- steps:
- - name: Checkout actions folder
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- with:
- sparse-checkout: |
- actions
- persist-credentials: false
- - name: Setup Scripts
- uses: ./actions/setup
- with:
- destination: /opt/gh-aw/actions
- - name: Download agent output artifact
- continue-on-error: true
- uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6
- with:
- name: agent-output
- path: /tmp/gh-aw/safeoutputs/
- - name: Setup agent output environment variable
- run: |
- mkdir -p /tmp/gh-aw/safeoutputs/
- find "/tmp/gh-aw/safeoutputs/" -type f -print
- echo "GH_AW_AGENT_OUTPUT=/tmp/gh-aw/safeoutputs/agent_output.json" >> "$GITHUB_ENV"
- - name: Process Safe Outputs
- id: process_safe_outputs
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
- env:
- GH_AW_AGENT_OUTPUT: ${{ env.GH_AW_AGENT_OUTPUT }}
- GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"add_comment\":{\"allowed_repos\":[\"github/gh-aw\"],\"hide_older_comments\":true,\"max\":2},\"add_labels\":{\"allowed\":[\"smoke-copilot-sdk\"],\"allowed_repos\":[\"github/gh-aw\"]},\"create_issue\":{\"close_older_issues\":true,\"expires\":2,\"group\":true,\"max\":1},\"missing_data\":{},\"missing_tool\":{},\"remove_labels\":{\"allowed\":[\"smoke\"]}}"
- with:
- github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
- script: |
- const { setupGlobals } = require('/opt/gh-aw/actions/setup_globals.cjs');
- setupGlobals(core, github, context, exec, io);
- const { main } = require('/opt/gh-aw/actions/safe_output_handler_manager.cjs');
- await main();
-
- update_cache_memory:
- needs:
- - agent
- - detection
- if: always() && needs.detection.outputs.success == 'true'
- runs-on: ubuntu-latest
- permissions:
- contents: read
- steps:
- - name: Checkout actions folder
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- with:
- sparse-checkout: |
- actions
- persist-credentials: false
- - name: Setup Scripts
- uses: ./actions/setup
- with:
- destination: /opt/gh-aw/actions
- - name: Download cache-memory artifact (default)
- uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6
- continue-on-error: true
- with:
- name: cache-memory
- path: /tmp/gh-aw/cache-memory
- - name: Save cache-memory to cache (default)
- uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
- with:
- key: memory-${{ env.GH_AW_WORKFLOW_ID_SANITIZED }}-${{ github.run_id }}
- path: /tmp/gh-aw/cache-memory
-
diff --git a/.github/workflows/smoke-copilot-sdk.md b/.github/workflows/smoke-copilot-sdk.md
deleted file mode 100644
index 04a5311ff1..0000000000
--- a/.github/workflows/smoke-copilot-sdk.md
+++ /dev/null
@@ -1,68 +0,0 @@
----
-description: Smoke Copilot SDK
-on:
- workflow_dispatch:
- pull_request:
- types: [labeled]
- names: ["smoke"]
- reaction: "eyes"
- status-comment: true
-permissions:
- contents: read
- pull-requests: read
- issues: read
- discussions: read
- actions: read
-name: Smoke Copilot SDK
-engine: copilot-sdk
-imports:
- - shared/gh.md
- - shared/reporting.md
-tools:
- agentic-workflows:
- cache-memory: true
- edit:
- bash:
- - "*"
- github:
-safe-outputs:
- add-comment:
- allowed-repos: ["github/gh-aw"]
- hide-older-comments: true
- max: 2
- create-issue:
- expires: 2h
- group: true
- close-older-issues: true
- add-labels:
- allowed: [smoke-copilot-sdk]
- allowed-repos: ["github/gh-aw"]
- remove-labels:
- allowed: [smoke]
----
-
-# Smoke Test for Copilot SDK Engine
-
-This is a smoke test workflow for the experimental `copilot-sdk` engine.
-
-## Test Requirements
-
-The copilot-sdk engine should:
-1. Successfully start Copilot CLI in headless mode on port 3312
-2. Configure the SDK client via the GH_AW_COPILOT_CONFIG environment variable
-3. Execute the copilot-client.js wrapper successfully
-4. Handle basic tasks (file analysis, issue creation, etc.)
-5. Support the GitHub MCP toolset
-6. Use host.docker.internal for MCP server connections
-
-## Task
-
-Please perform the following smoke test:
-
-1. Analyze the current repository structure and identify key files
-2. Create a test issue with a summary of what you found
-3. Add the label "smoke-copilot-sdk" to the issue
-4. Remove the "smoke" label from the pull request that triggered this workflow
-5. Add a comment to the pull request confirming the smoke test completed
-
-Keep your responses concise and focused on validating that the copilot-sdk engine is working correctly.
diff --git a/DEVGUIDE.md b/DEVGUIDE.md
index 357211fca2..2e9cd31545 100644
--- a/DEVGUIDE.md
+++ b/DEVGUIDE.md
@@ -227,7 +227,6 @@ The project has several test targets optimized for different scenarios:
| `test-integration-workflow` | Varies | Workflow package integration | Testing workflow compilation end-to-end |
| `test-all` | ~30s | Go + JavaScript tests | Complete test coverage |
| `test-js` | Varies | JavaScript-only tests | Testing JS action code |
-| `test-copilot-client` | Varies | Copilot SDK client tests | Testing TypeScript copilot client |
| `test-security` | Varies | Security regression tests | Validating security fixes |
| `test-coverage` | Varies | Tests with coverage report | Analyzing test coverage |
| `test-perf` | Varies | All tests + timing analysis | Finding slow tests |
@@ -237,7 +236,6 @@ The project has several test targets optimized for different scenarios:
- **Ready to commit?** → `make test` or `make agent-finish`
- **Changed compiler code?** → `make test-integration-compile`
- **Working on JavaScript?** → `make test-js`
-- **Working on copilot-client?** → `make test-copilot-client`
- **Security-sensitive change?** → `make test-security`
### Expected Output and Timing
@@ -402,105 +400,6 @@ make install
gh aw --help
```
-## Copilot SDK Client
-
-The `copilot-client` directory contains a TypeScript client for programmatic control of GitHub Copilot CLI via the `@github/copilot-sdk` Node.js package.
-
-### Overview
-
-The copilot-client provides:
-- **TypeScript implementation** with ES6/ESM support for Node.js 24+
-- **Async/await** programming model for handling Copilot sessions
-- **JSONL event logging** with timestamps for debugging and auditing
-- **Stdin configuration** for easy testing and integration
-- **Debug logging** using the `debug` npm package
-
-### Building the Client
-
-```bash
-# Install dependencies and build
-make copilot-client
-
-# Or manually:
-cd copilot-client
-npm ci
-npm run build
-```
-
-The compiled JavaScript will be in `copilot-client/dist/`.
-
-### Running Tests
-
-```bash
-# Run unit tests
-make test-copilot-client
-
-# Or manually:
-cd copilot-client
-npm test
-
-# Run integration tests locally (requires COPILOT_GITHUB_TOKEN)
-export COPILOT_GITHUB_TOKEN=ghp_your_token_here
-./test-local.sh
-```
-
-### Usage Example
-
-The client accepts configuration via stdin:
-
-```bash
-cat > config.json << 'EOF'
-{
- "promptFile": "/tmp/prompt.txt",
- "eventLogFile": "/tmp/events.jsonl",
- "githubToken": "ghp_...",
- "session": {
- "model": "gpt-5"
- }
-}
-EOF
-
-node copilot-client/dist/cli.js < config.json
-```
-
-### Configuration Options
-
-See `copilot-client/src/types.ts` for complete configuration schema:
-
-- `promptFile` (required): Path to prompt text file
-- `eventLogFile` (required): Path for JSONL event output
-- `githubToken`: GitHub token for authentication
-- `cliPath`: Custom copilot CLI path
-- `cliUrl`: Connect to existing server (e.g., "localhost:8080")
-- `session.model`: Model selection ("gpt-5", "claude-sonnet-4.5", etc.)
-- `session.reasoningEffort`: Effort level ("low", "medium", "high", "xhigh")
-- `logLevel`: Debug level ("none", "error", "warning", "info", "debug", "all")
-
-### Debugging
-
-Enable debug output:
-
-```bash
-DEBUG=copilot-client node copilot-client/dist/cli.js < config.json
-```
-
-### CI Integration
-
-The client is tested in CI via `.github/workflows/copilot-sdk-ci.yml`:
-1. Starts Copilot CLI as headless server
-2. Builds and tests the TypeScript client
-3. Runs integration tests with event logging verification
-4. Uploads logs and artifacts
-
-### Development Workflow
-
-1. **Make changes** to TypeScript files in `copilot-client/src/`
-2. **Build**: `make copilot-client`
-3. **Test**: `make test-copilot-client`
-4. **Integration test**: Run `./test-local.sh` with token
-
-For more details, see `copilot-client/README.md`.
-
## Testing
### Test Structure
diff --git a/Makefile b/Makefile
index 837a3c872f..890a1aa702 100644
--- a/Makefile
+++ b/Makefile
@@ -221,26 +221,9 @@ bundle-js:
@echo "✓ bundle-js tool built"
@echo "To bundle a JavaScript file: ./bundle-js [output-file]"
-# Install copilot-client dependencies
-.PHONY: deps-copilot-client
-deps-copilot-client: check-node-version
- cd copilot-client && npm ci
-
-# Build copilot-client TypeScript project
-.PHONY: copilot-client
-copilot-client: deps-copilot-client
- @echo "Building copilot-client..."
- cd copilot-client && npm run build
- @echo "✓ Copilot client built"
-
-# Test copilot-client
-.PHONY: test-copilot-client
-test-copilot-client: copilot-client
- cd copilot-client && npm test
-
-# Test all code (Go, JavaScript, and copilot-client)
+# Test all code (Go and JavaScript)
.PHONY: test-all
-test-all: test test-js test-copilot-client
+test-all: test test-js
# Run tests with coverage
.PHONY: test-coverage
@@ -669,7 +652,7 @@ sync-action-scripts:
# Recompile all workflow files
.PHONY: recompile
-recompile: build copilot-client
+recompile: build
./$(BINARY_NAME) init --codespaces
./$(BINARY_NAME) compile --validate --verbose --purge --stats
# ./$(BINARY_NAME) compile --dir pkg/cli/workflows --validate --verbose --purge
diff --git a/actions/setup/js/copilot-client.js b/actions/setup/js/copilot-client.js
deleted file mode 100644
index cd84947382..0000000000
--- a/actions/setup/js/copilot-client.js
+++ /dev/null
@@ -1,5476 +0,0 @@
-import { spawn } from 'child_process';
-import { mkdirSync, readFileSync, appendFileSync, existsSync } from 'fs';
-import { Socket } from 'net';
-import { dirname, join } from 'path';
-import { fileURLToPath } from 'url';
-
-var __create = Object.create;
-var __defProp = Object.defineProperty;
-var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
-var __getOwnPropNames = Object.getOwnPropertyNames;
-var __getProtoOf = Object.getPrototypeOf;
-var __hasOwnProp = Object.prototype.hasOwnProperty;
-var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
-}) : x)(function(x) {
- if (typeof require !== "undefined") return require.apply(this, arguments);
- throw Error('Dynamic require of "' + x + '" is not supported');
-});
-var __commonJS = (cb, mod) => function __require2() {
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
-};
-var __copyProps = (to, from, except, desc) => {
- if (from && typeof from === "object" || typeof from === "function") {
- for (let key of __getOwnPropNames(from))
- if (!__hasOwnProp.call(to, key) && key !== except)
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
- }
- return to;
-};
-var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
- // If the importer is in node compatibility mode or this is not an ESM
- // file that has been converted to a CommonJS file using a Babel-
- // compatible transform (i.e. "__esModule" has not been set), then set
- // "default" to the CommonJS "module.exports" for node compatibility.
- __defProp(target, "default", { value: mod, enumerable: true }) ,
- mod
-));
-
-// node_modules/vscode-jsonrpc/lib/common/is.js
-var require_is = __commonJS({
- "node_modules/vscode-jsonrpc/lib/common/is.js"(exports$1) {
- Object.defineProperty(exports$1, "__esModule", { value: true });
- exports$1.stringArray = exports$1.array = exports$1.func = exports$1.error = exports$1.number = exports$1.string = exports$1.boolean = void 0;
- function boolean(value) {
- return value === true || value === false;
- }
- exports$1.boolean = boolean;
- function string(value) {
- return typeof value === "string" || value instanceof String;
- }
- exports$1.string = string;
- function number(value) {
- return typeof value === "number" || value instanceof Number;
- }
- exports$1.number = number;
- function error(value) {
- return value instanceof Error;
- }
- exports$1.error = error;
- function func(value) {
- return typeof value === "function";
- }
- exports$1.func = func;
- function array(value) {
- return Array.isArray(value);
- }
- exports$1.array = array;
- function stringArray(value) {
- return array(value) && value.every((elem) => string(elem));
- }
- exports$1.stringArray = stringArray;
- }
-});
-
-// node_modules/vscode-jsonrpc/lib/common/messages.js
-var require_messages = __commonJS({
- "node_modules/vscode-jsonrpc/lib/common/messages.js"(exports$1) {
- Object.defineProperty(exports$1, "__esModule", { value: true });
- exports$1.Message = exports$1.NotificationType9 = exports$1.NotificationType8 = exports$1.NotificationType7 = exports$1.NotificationType6 = exports$1.NotificationType5 = exports$1.NotificationType4 = exports$1.NotificationType3 = exports$1.NotificationType2 = exports$1.NotificationType1 = exports$1.NotificationType0 = exports$1.NotificationType = exports$1.RequestType9 = exports$1.RequestType8 = exports$1.RequestType7 = exports$1.RequestType6 = exports$1.RequestType5 = exports$1.RequestType4 = exports$1.RequestType3 = exports$1.RequestType2 = exports$1.RequestType1 = exports$1.RequestType = exports$1.RequestType0 = exports$1.AbstractMessageSignature = exports$1.ParameterStructures = exports$1.ResponseError = exports$1.ErrorCodes = void 0;
- var is = require_is();
- var ErrorCodes;
- (function(ErrorCodes2) {
- ErrorCodes2.ParseError = -32700;
- ErrorCodes2.InvalidRequest = -32600;
- ErrorCodes2.MethodNotFound = -32601;
- ErrorCodes2.InvalidParams = -32602;
- ErrorCodes2.InternalError = -32603;
- ErrorCodes2.jsonrpcReservedErrorRangeStart = -32099;
- ErrorCodes2.serverErrorStart = -32099;
- ErrorCodes2.MessageWriteError = -32099;
- ErrorCodes2.MessageReadError = -32098;
- ErrorCodes2.PendingResponseRejected = -32097;
- ErrorCodes2.ConnectionInactive = -32096;
- ErrorCodes2.ServerNotInitialized = -32002;
- ErrorCodes2.UnknownErrorCode = -32001;
- ErrorCodes2.jsonrpcReservedErrorRangeEnd = -32e3;
- ErrorCodes2.serverErrorEnd = -32e3;
- })(ErrorCodes || (exports$1.ErrorCodes = ErrorCodes = {}));
- var ResponseError = class _ResponseError extends Error {
- constructor(code, message, data) {
- super(message);
- this.code = is.number(code) ? code : ErrorCodes.UnknownErrorCode;
- this.data = data;
- Object.setPrototypeOf(this, _ResponseError.prototype);
- }
- toJson() {
- const result = {
- code: this.code,
- message: this.message
- };
- if (this.data !== void 0) {
- result.data = this.data;
- }
- return result;
- }
- };
- exports$1.ResponseError = ResponseError;
- var ParameterStructures = class _ParameterStructures {
- constructor(kind) {
- this.kind = kind;
- }
- static is(value) {
- return value === _ParameterStructures.auto || value === _ParameterStructures.byName || value === _ParameterStructures.byPosition;
- }
- toString() {
- return this.kind;
- }
- };
- exports$1.ParameterStructures = ParameterStructures;
- ParameterStructures.auto = new ParameterStructures("auto");
- ParameterStructures.byPosition = new ParameterStructures("byPosition");
- ParameterStructures.byName = new ParameterStructures("byName");
- var AbstractMessageSignature = class {
- constructor(method, numberOfParams) {
- this.method = method;
- this.numberOfParams = numberOfParams;
- }
- get parameterStructures() {
- return ParameterStructures.auto;
- }
- };
- exports$1.AbstractMessageSignature = AbstractMessageSignature;
- var RequestType0 = class extends AbstractMessageSignature {
- constructor(method) {
- super(method, 0);
- }
- };
- exports$1.RequestType0 = RequestType0;
- var RequestType = class extends AbstractMessageSignature {
- constructor(method, _parameterStructures = ParameterStructures.auto) {
- super(method, 1);
- this._parameterStructures = _parameterStructures;
- }
- get parameterStructures() {
- return this._parameterStructures;
- }
- };
- exports$1.RequestType = RequestType;
- var RequestType1 = class extends AbstractMessageSignature {
- constructor(method, _parameterStructures = ParameterStructures.auto) {
- super(method, 1);
- this._parameterStructures = _parameterStructures;
- }
- get parameterStructures() {
- return this._parameterStructures;
- }
- };
- exports$1.RequestType1 = RequestType1;
- var RequestType2 = class extends AbstractMessageSignature {
- constructor(method) {
- super(method, 2);
- }
- };
- exports$1.RequestType2 = RequestType2;
- var RequestType3 = class extends AbstractMessageSignature {
- constructor(method) {
- super(method, 3);
- }
- };
- exports$1.RequestType3 = RequestType3;
- var RequestType4 = class extends AbstractMessageSignature {
- constructor(method) {
- super(method, 4);
- }
- };
- exports$1.RequestType4 = RequestType4;
- var RequestType5 = class extends AbstractMessageSignature {
- constructor(method) {
- super(method, 5);
- }
- };
- exports$1.RequestType5 = RequestType5;
- var RequestType6 = class extends AbstractMessageSignature {
- constructor(method) {
- super(method, 6);
- }
- };
- exports$1.RequestType6 = RequestType6;
- var RequestType7 = class extends AbstractMessageSignature {
- constructor(method) {
- super(method, 7);
- }
- };
- exports$1.RequestType7 = RequestType7;
- var RequestType8 = class extends AbstractMessageSignature {
- constructor(method) {
- super(method, 8);
- }
- };
- exports$1.RequestType8 = RequestType8;
- var RequestType9 = class extends AbstractMessageSignature {
- constructor(method) {
- super(method, 9);
- }
- };
- exports$1.RequestType9 = RequestType9;
- var NotificationType = class extends AbstractMessageSignature {
- constructor(method, _parameterStructures = ParameterStructures.auto) {
- super(method, 1);
- this._parameterStructures = _parameterStructures;
- }
- get parameterStructures() {
- return this._parameterStructures;
- }
- };
- exports$1.NotificationType = NotificationType;
- var NotificationType0 = class extends AbstractMessageSignature {
- constructor(method) {
- super(method, 0);
- }
- };
- exports$1.NotificationType0 = NotificationType0;
- var NotificationType1 = class extends AbstractMessageSignature {
- constructor(method, _parameterStructures = ParameterStructures.auto) {
- super(method, 1);
- this._parameterStructures = _parameterStructures;
- }
- get parameterStructures() {
- return this._parameterStructures;
- }
- };
- exports$1.NotificationType1 = NotificationType1;
- var NotificationType2 = class extends AbstractMessageSignature {
- constructor(method) {
- super(method, 2);
- }
- };
- exports$1.NotificationType2 = NotificationType2;
- var NotificationType3 = class extends AbstractMessageSignature {
- constructor(method) {
- super(method, 3);
- }
- };
- exports$1.NotificationType3 = NotificationType3;
- var NotificationType4 = class extends AbstractMessageSignature {
- constructor(method) {
- super(method, 4);
- }
- };
- exports$1.NotificationType4 = NotificationType4;
- var NotificationType5 = class extends AbstractMessageSignature {
- constructor(method) {
- super(method, 5);
- }
- };
- exports$1.NotificationType5 = NotificationType5;
- var NotificationType6 = class extends AbstractMessageSignature {
- constructor(method) {
- super(method, 6);
- }
- };
- exports$1.NotificationType6 = NotificationType6;
- var NotificationType7 = class extends AbstractMessageSignature {
- constructor(method) {
- super(method, 7);
- }
- };
- exports$1.NotificationType7 = NotificationType7;
- var NotificationType8 = class extends AbstractMessageSignature {
- constructor(method) {
- super(method, 8);
- }
- };
- exports$1.NotificationType8 = NotificationType8;
- var NotificationType9 = class extends AbstractMessageSignature {
- constructor(method) {
- super(method, 9);
- }
- };
- exports$1.NotificationType9 = NotificationType9;
- var Message;
- (function(Message2) {
- function isRequest(message) {
- const candidate = message;
- return candidate && is.string(candidate.method) && (is.string(candidate.id) || is.number(candidate.id));
- }
- Message2.isRequest = isRequest;
- function isNotification(message) {
- const candidate = message;
- return candidate && is.string(candidate.method) && message.id === void 0;
- }
- Message2.isNotification = isNotification;
- function isResponse(message) {
- const candidate = message;
- return candidate && (candidate.result !== void 0 || !!candidate.error) && (is.string(candidate.id) || is.number(candidate.id) || candidate.id === null);
- }
- Message2.isResponse = isResponse;
- })(Message || (exports$1.Message = Message = {}));
- }
-});
-
-// node_modules/vscode-jsonrpc/lib/common/linkedMap.js
-var require_linkedMap = __commonJS({
- "node_modules/vscode-jsonrpc/lib/common/linkedMap.js"(exports$1) {
- var _a;
- Object.defineProperty(exports$1, "__esModule", { value: true });
- exports$1.LRUCache = exports$1.LinkedMap = exports$1.Touch = void 0;
- var Touch;
- (function(Touch2) {
- Touch2.None = 0;
- Touch2.First = 1;
- Touch2.AsOld = Touch2.First;
- Touch2.Last = 2;
- Touch2.AsNew = Touch2.Last;
- })(Touch || (exports$1.Touch = Touch = {}));
- var LinkedMap = class {
- constructor() {
- this[_a] = "LinkedMap";
- this._map = /* @__PURE__ */ new Map();
- this._head = void 0;
- this._tail = void 0;
- this._size = 0;
- this._state = 0;
- }
- clear() {
- this._map.clear();
- this._head = void 0;
- this._tail = void 0;
- this._size = 0;
- this._state++;
- }
- isEmpty() {
- return !this._head && !this._tail;
- }
- get size() {
- return this._size;
- }
- get first() {
- return this._head?.value;
- }
- get last() {
- return this._tail?.value;
- }
- has(key) {
- return this._map.has(key);
- }
- get(key, touch = Touch.None) {
- const item = this._map.get(key);
- if (!item) {
- return void 0;
- }
- if (touch !== Touch.None) {
- this.touch(item, touch);
- }
- return item.value;
- }
- set(key, value, touch = Touch.None) {
- let item = this._map.get(key);
- if (item) {
- item.value = value;
- if (touch !== Touch.None) {
- this.touch(item, touch);
- }
- } else {
- item = { key, value, next: void 0, previous: void 0 };
- switch (touch) {
- case Touch.None:
- this.addItemLast(item);
- break;
- case Touch.First:
- this.addItemFirst(item);
- break;
- case Touch.Last:
- this.addItemLast(item);
- break;
- default:
- this.addItemLast(item);
- break;
- }
- this._map.set(key, item);
- this._size++;
- }
- return this;
- }
- delete(key) {
- return !!this.remove(key);
- }
- remove(key) {
- const item = this._map.get(key);
- if (!item) {
- return void 0;
- }
- this._map.delete(key);
- this.removeItem(item);
- this._size--;
- return item.value;
- }
- shift() {
- if (!this._head && !this._tail) {
- return void 0;
- }
- if (!this._head || !this._tail) {
- throw new Error("Invalid list");
- }
- const item = this._head;
- this._map.delete(item.key);
- this.removeItem(item);
- this._size--;
- return item.value;
- }
- forEach(callbackfn, thisArg) {
- const state = this._state;
- let current = this._head;
- while (current) {
- if (thisArg) {
- callbackfn.bind(thisArg)(current.value, current.key, this);
- } else {
- callbackfn(current.value, current.key, this);
- }
- if (this._state !== state) {
- throw new Error(`LinkedMap got modified during iteration.`);
- }
- current = current.next;
- }
- }
- keys() {
- const state = this._state;
- let current = this._head;
- const iterator = {
- [Symbol.iterator]: () => {
- return iterator;
- },
- next: () => {
- if (this._state !== state) {
- throw new Error(`LinkedMap got modified during iteration.`);
- }
- if (current) {
- const result = { value: current.key, done: false };
- current = current.next;
- return result;
- } else {
- return { value: void 0, done: true };
- }
- }
- };
- return iterator;
- }
- values() {
- const state = this._state;
- let current = this._head;
- const iterator = {
- [Symbol.iterator]: () => {
- return iterator;
- },
- next: () => {
- if (this._state !== state) {
- throw new Error(`LinkedMap got modified during iteration.`);
- }
- if (current) {
- const result = { value: current.value, done: false };
- current = current.next;
- return result;
- } else {
- return { value: void 0, done: true };
- }
- }
- };
- return iterator;
- }
- entries() {
- const state = this._state;
- let current = this._head;
- const iterator = {
- [Symbol.iterator]: () => {
- return iterator;
- },
- next: () => {
- if (this._state !== state) {
- throw new Error(`LinkedMap got modified during iteration.`);
- }
- if (current) {
- const result = { value: [current.key, current.value], done: false };
- current = current.next;
- return result;
- } else {
- return { value: void 0, done: true };
- }
- }
- };
- return iterator;
- }
- [(_a = Symbol.toStringTag, Symbol.iterator)]() {
- return this.entries();
- }
- trimOld(newSize) {
- if (newSize >= this.size) {
- return;
- }
- if (newSize === 0) {
- this.clear();
- return;
- }
- let current = this._head;
- let currentSize = this.size;
- while (current && currentSize > newSize) {
- this._map.delete(current.key);
- current = current.next;
- currentSize--;
- }
- this._head = current;
- this._size = currentSize;
- if (current) {
- current.previous = void 0;
- }
- this._state++;
- }
- addItemFirst(item) {
- if (!this._head && !this._tail) {
- this._tail = item;
- } else if (!this._head) {
- throw new Error("Invalid list");
- } else {
- item.next = this._head;
- this._head.previous = item;
- }
- this._head = item;
- this._state++;
- }
- addItemLast(item) {
- if (!this._head && !this._tail) {
- this._head = item;
- } else if (!this._tail) {
- throw new Error("Invalid list");
- } else {
- item.previous = this._tail;
- this._tail.next = item;
- }
- this._tail = item;
- this._state++;
- }
- removeItem(item) {
- if (item === this._head && item === this._tail) {
- this._head = void 0;
- this._tail = void 0;
- } else if (item === this._head) {
- if (!item.next) {
- throw new Error("Invalid list");
- }
- item.next.previous = void 0;
- this._head = item.next;
- } else if (item === this._tail) {
- if (!item.previous) {
- throw new Error("Invalid list");
- }
- item.previous.next = void 0;
- this._tail = item.previous;
- } else {
- const next = item.next;
- const previous = item.previous;
- if (!next || !previous) {
- throw new Error("Invalid list");
- }
- next.previous = previous;
- previous.next = next;
- }
- item.next = void 0;
- item.previous = void 0;
- this._state++;
- }
- touch(item, touch) {
- if (!this._head || !this._tail) {
- throw new Error("Invalid list");
- }
- if (touch !== Touch.First && touch !== Touch.Last) {
- return;
- }
- if (touch === Touch.First) {
- if (item === this._head) {
- return;
- }
- const next = item.next;
- const previous = item.previous;
- if (item === this._tail) {
- previous.next = void 0;
- this._tail = previous;
- } else {
- next.previous = previous;
- previous.next = next;
- }
- item.previous = void 0;
- item.next = this._head;
- this._head.previous = item;
- this._head = item;
- this._state++;
- } else if (touch === Touch.Last) {
- if (item === this._tail) {
- return;
- }
- const next = item.next;
- const previous = item.previous;
- if (item === this._head) {
- next.previous = void 0;
- this._head = next;
- } else {
- next.previous = previous;
- previous.next = next;
- }
- item.next = void 0;
- item.previous = this._tail;
- this._tail.next = item;
- this._tail = item;
- this._state++;
- }
- }
- toJSON() {
- const data = [];
- this.forEach((value, key) => {
- data.push([key, value]);
- });
- return data;
- }
- fromJSON(data) {
- this.clear();
- for (const [key, value] of data) {
- this.set(key, value);
- }
- }
- };
- exports$1.LinkedMap = LinkedMap;
- var LRUCache = class extends LinkedMap {
- constructor(limit, ratio = 1) {
- super();
- this._limit = limit;
- this._ratio = Math.min(Math.max(0, ratio), 1);
- }
- get limit() {
- return this._limit;
- }
- set limit(limit) {
- this._limit = limit;
- this.checkTrim();
- }
- get ratio() {
- return this._ratio;
- }
- set ratio(ratio) {
- this._ratio = Math.min(Math.max(0, ratio), 1);
- this.checkTrim();
- }
- get(key, touch = Touch.AsNew) {
- return super.get(key, touch);
- }
- peek(key) {
- return super.get(key, Touch.None);
- }
- set(key, value) {
- super.set(key, value, Touch.Last);
- this.checkTrim();
- return this;
- }
- checkTrim() {
- if (this.size > this._limit) {
- this.trimOld(Math.round(this._limit * this._ratio));
- }
- }
- };
- exports$1.LRUCache = LRUCache;
- }
-});
-
-// node_modules/vscode-jsonrpc/lib/common/disposable.js
-var require_disposable = __commonJS({
- "node_modules/vscode-jsonrpc/lib/common/disposable.js"(exports$1) {
- Object.defineProperty(exports$1, "__esModule", { value: true });
- exports$1.Disposable = void 0;
- var Disposable;
- (function(Disposable2) {
- function create(func) {
- return {
- dispose: func
- };
- }
- Disposable2.create = create;
- })(Disposable || (exports$1.Disposable = Disposable = {}));
- }
-});
-
-// node_modules/vscode-jsonrpc/lib/common/ral.js
-var require_ral = __commonJS({
- "node_modules/vscode-jsonrpc/lib/common/ral.js"(exports$1) {
- Object.defineProperty(exports$1, "__esModule", { value: true });
- var _ral;
- function RAL() {
- if (_ral === void 0) {
- throw new Error(`No runtime abstraction layer installed`);
- }
- return _ral;
- }
- (function(RAL2) {
- function install(ral) {
- if (ral === void 0) {
- throw new Error(`No runtime abstraction layer provided`);
- }
- _ral = ral;
- }
- RAL2.install = install;
- })(RAL || (RAL = {}));
- exports$1.default = RAL;
- }
-});
-
-// node_modules/vscode-jsonrpc/lib/common/events.js
-var require_events = __commonJS({
- "node_modules/vscode-jsonrpc/lib/common/events.js"(exports$1) {
- Object.defineProperty(exports$1, "__esModule", { value: true });
- exports$1.Emitter = exports$1.Event = void 0;
- var ral_1 = require_ral();
- var Event;
- (function(Event2) {
- const _disposable = { dispose() {
- } };
- Event2.None = function() {
- return _disposable;
- };
- })(Event || (exports$1.Event = Event = {}));
- var CallbackList = class {
- add(callback, context = null, bucket) {
- if (!this._callbacks) {
- this._callbacks = [];
- this._contexts = [];
- }
- this._callbacks.push(callback);
- this._contexts.push(context);
- if (Array.isArray(bucket)) {
- bucket.push({ dispose: () => this.remove(callback, context) });
- }
- }
- remove(callback, context = null) {
- if (!this._callbacks) {
- return;
- }
- let foundCallbackWithDifferentContext = false;
- for (let i = 0, len = this._callbacks.length; i < len; i++) {
- if (this._callbacks[i] === callback) {
- if (this._contexts[i] === context) {
- this._callbacks.splice(i, 1);
- this._contexts.splice(i, 1);
- return;
- } else {
- foundCallbackWithDifferentContext = true;
- }
- }
- }
- if (foundCallbackWithDifferentContext) {
- throw new Error("When adding a listener with a context, you should remove it with the same context");
- }
- }
- invoke(...args) {
- if (!this._callbacks) {
- return [];
- }
- const ret = [], callbacks = this._callbacks.slice(0), contexts = this._contexts.slice(0);
- for (let i = 0, len = callbacks.length; i < len; i++) {
- try {
- ret.push(callbacks[i].apply(contexts[i], args));
- } catch (e) {
- (0, ral_1.default)().console.error(e);
- }
- }
- return ret;
- }
- isEmpty() {
- return !this._callbacks || this._callbacks.length === 0;
- }
- dispose() {
- this._callbacks = void 0;
- this._contexts = void 0;
- }
- };
- var Emitter = class _Emitter {
- constructor(_options) {
- this._options = _options;
- }
- /**
- * For the public to allow to subscribe
- * to events from this Emitter
- */
- get event() {
- if (!this._event) {
- this._event = (listener, thisArgs, disposables) => {
- if (!this._callbacks) {
- this._callbacks = new CallbackList();
- }
- if (this._options && this._options.onFirstListenerAdd && this._callbacks.isEmpty()) {
- this._options.onFirstListenerAdd(this);
- }
- this._callbacks.add(listener, thisArgs);
- const result = {
- dispose: () => {
- if (!this._callbacks) {
- return;
- }
- this._callbacks.remove(listener, thisArgs);
- result.dispose = _Emitter._noop;
- if (this._options && this._options.onLastListenerRemove && this._callbacks.isEmpty()) {
- this._options.onLastListenerRemove(this);
- }
- }
- };
- if (Array.isArray(disposables)) {
- disposables.push(result);
- }
- return result;
- };
- }
- return this._event;
- }
- /**
- * To be kept private to fire an event to
- * subscribers
- */
- fire(event) {
- if (this._callbacks) {
- this._callbacks.invoke.call(this._callbacks, event);
- }
- }
- dispose() {
- if (this._callbacks) {
- this._callbacks.dispose();
- this._callbacks = void 0;
- }
- }
- };
- exports$1.Emitter = Emitter;
- Emitter._noop = function() {
- };
- }
-});
-
-// node_modules/vscode-jsonrpc/lib/common/cancellation.js
-var require_cancellation = __commonJS({
- "node_modules/vscode-jsonrpc/lib/common/cancellation.js"(exports$1) {
- Object.defineProperty(exports$1, "__esModule", { value: true });
- exports$1.CancellationTokenSource = exports$1.CancellationToken = void 0;
- var ral_1 = require_ral();
- var Is = require_is();
- var events_1 = require_events();
- var CancellationToken;
- (function(CancellationToken2) {
- CancellationToken2.None = Object.freeze({
- isCancellationRequested: false,
- onCancellationRequested: events_1.Event.None
- });
- CancellationToken2.Cancelled = Object.freeze({
- isCancellationRequested: true,
- onCancellationRequested: events_1.Event.None
- });
- function is(value) {
- const candidate = value;
- return candidate && (candidate === CancellationToken2.None || candidate === CancellationToken2.Cancelled || Is.boolean(candidate.isCancellationRequested) && !!candidate.onCancellationRequested);
- }
- CancellationToken2.is = is;
- })(CancellationToken || (exports$1.CancellationToken = CancellationToken = {}));
- var shortcutEvent = Object.freeze(function(callback, context) {
- const handle = (0, ral_1.default)().timer.setTimeout(callback.bind(context), 0);
- return { dispose() {
- handle.dispose();
- } };
- });
- var MutableToken = class {
- constructor() {
- this._isCancelled = false;
- }
- cancel() {
- if (!this._isCancelled) {
- this._isCancelled = true;
- if (this._emitter) {
- this._emitter.fire(void 0);
- this.dispose();
- }
- }
- }
- get isCancellationRequested() {
- return this._isCancelled;
- }
- get onCancellationRequested() {
- if (this._isCancelled) {
- return shortcutEvent;
- }
- if (!this._emitter) {
- this._emitter = new events_1.Emitter();
- }
- return this._emitter.event;
- }
- dispose() {
- if (this._emitter) {
- this._emitter.dispose();
- this._emitter = void 0;
- }
- }
- };
- var CancellationTokenSource = class {
- get token() {
- if (!this._token) {
- this._token = new MutableToken();
- }
- return this._token;
- }
- cancel() {
- if (!this._token) {
- this._token = CancellationToken.Cancelled;
- } else {
- this._token.cancel();
- }
- }
- dispose() {
- if (!this._token) {
- this._token = CancellationToken.None;
- } else if (this._token instanceof MutableToken) {
- this._token.dispose();
- }
- }
- };
- exports$1.CancellationTokenSource = CancellationTokenSource;
- }
-});
-
-// node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js
-var require_sharedArrayCancellation = __commonJS({
- "node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js"(exports$1) {
- Object.defineProperty(exports$1, "__esModule", { value: true });
- exports$1.SharedArrayReceiverStrategy = exports$1.SharedArraySenderStrategy = void 0;
- var cancellation_1 = require_cancellation();
- var CancellationState;
- (function(CancellationState2) {
- CancellationState2.Continue = 0;
- CancellationState2.Cancelled = 1;
- })(CancellationState || (CancellationState = {}));
- var SharedArraySenderStrategy = class {
- constructor() {
- this.buffers = /* @__PURE__ */ new Map();
- }
- enableCancellation(request) {
- if (request.id === null) {
- return;
- }
- const buffer = new SharedArrayBuffer(4);
- const data = new Int32Array(buffer, 0, 1);
- data[0] = CancellationState.Continue;
- this.buffers.set(request.id, buffer);
- request.$cancellationData = buffer;
- }
- async sendCancellation(_conn, id) {
- const buffer = this.buffers.get(id);
- if (buffer === void 0) {
- return;
- }
- const data = new Int32Array(buffer, 0, 1);
- Atomics.store(data, 0, CancellationState.Cancelled);
- }
- cleanup(id) {
- this.buffers.delete(id);
- }
- dispose() {
- this.buffers.clear();
- }
- };
- exports$1.SharedArraySenderStrategy = SharedArraySenderStrategy;
- var SharedArrayBufferCancellationToken = class {
- constructor(buffer) {
- this.data = new Int32Array(buffer, 0, 1);
- }
- get isCancellationRequested() {
- return Atomics.load(this.data, 0) === CancellationState.Cancelled;
- }
- get onCancellationRequested() {
- throw new Error(`Cancellation over SharedArrayBuffer doesn't support cancellation events`);
- }
- };
- var SharedArrayBufferCancellationTokenSource = class {
- constructor(buffer) {
- this.token = new SharedArrayBufferCancellationToken(buffer);
- }
- cancel() {
- }
- dispose() {
- }
- };
- var SharedArrayReceiverStrategy = class {
- constructor() {
- this.kind = "request";
- }
- createCancellationTokenSource(request) {
- const buffer = request.$cancellationData;
- if (buffer === void 0) {
- return new cancellation_1.CancellationTokenSource();
- }
- return new SharedArrayBufferCancellationTokenSource(buffer);
- }
- };
- exports$1.SharedArrayReceiverStrategy = SharedArrayReceiverStrategy;
- }
-});
-
-// node_modules/vscode-jsonrpc/lib/common/semaphore.js
-var require_semaphore = __commonJS({
- "node_modules/vscode-jsonrpc/lib/common/semaphore.js"(exports$1) {
- Object.defineProperty(exports$1, "__esModule", { value: true });
- exports$1.Semaphore = void 0;
- var ral_1 = require_ral();
- var Semaphore = class {
- constructor(capacity = 1) {
- if (capacity <= 0) {
- throw new Error("Capacity must be greater than 0");
- }
- this._capacity = capacity;
- this._active = 0;
- this._waiting = [];
- }
- lock(thunk) {
- return new Promise((resolve, reject) => {
- this._waiting.push({ thunk, resolve, reject });
- this.runNext();
- });
- }
- get active() {
- return this._active;
- }
- runNext() {
- if (this._waiting.length === 0 || this._active === this._capacity) {
- return;
- }
- (0, ral_1.default)().timer.setImmediate(() => this.doRunNext());
- }
- doRunNext() {
- if (this._waiting.length === 0 || this._active === this._capacity) {
- return;
- }
- const next = this._waiting.shift();
- this._active++;
- if (this._active > this._capacity) {
- throw new Error(`To many thunks active`);
- }
- try {
- const result = next.thunk();
- if (result instanceof Promise) {
- result.then((value) => {
- this._active--;
- next.resolve(value);
- this.runNext();
- }, (err) => {
- this._active--;
- next.reject(err);
- this.runNext();
- });
- } else {
- this._active--;
- next.resolve(result);
- this.runNext();
- }
- } catch (err) {
- this._active--;
- next.reject(err);
- this.runNext();
- }
- }
- };
- exports$1.Semaphore = Semaphore;
- }
-});
-
-// node_modules/vscode-jsonrpc/lib/common/messageReader.js
-var require_messageReader = __commonJS({
- "node_modules/vscode-jsonrpc/lib/common/messageReader.js"(exports$1) {
- Object.defineProperty(exports$1, "__esModule", { value: true });
- exports$1.ReadableStreamMessageReader = exports$1.AbstractMessageReader = exports$1.MessageReader = void 0;
- var ral_1 = require_ral();
- var Is = require_is();
- var events_1 = require_events();
- var semaphore_1 = require_semaphore();
- var MessageReader;
- (function(MessageReader2) {
- function is(value) {
- let candidate = value;
- return candidate && Is.func(candidate.listen) && Is.func(candidate.dispose) && Is.func(candidate.onError) && Is.func(candidate.onClose) && Is.func(candidate.onPartialMessage);
- }
- MessageReader2.is = is;
- })(MessageReader || (exports$1.MessageReader = MessageReader = {}));
- var AbstractMessageReader = class {
- constructor() {
- this.errorEmitter = new events_1.Emitter();
- this.closeEmitter = new events_1.Emitter();
- this.partialMessageEmitter = new events_1.Emitter();
- }
- dispose() {
- this.errorEmitter.dispose();
- this.closeEmitter.dispose();
- }
- get onError() {
- return this.errorEmitter.event;
- }
- fireError(error) {
- this.errorEmitter.fire(this.asError(error));
- }
- get onClose() {
- return this.closeEmitter.event;
- }
- fireClose() {
- this.closeEmitter.fire(void 0);
- }
- get onPartialMessage() {
- return this.partialMessageEmitter.event;
- }
- firePartialMessage(info) {
- this.partialMessageEmitter.fire(info);
- }
- asError(error) {
- if (error instanceof Error) {
- return error;
- } else {
- return new Error(`Reader received error. Reason: ${Is.string(error.message) ? error.message : "unknown"}`);
- }
- }
- };
- exports$1.AbstractMessageReader = AbstractMessageReader;
- var ResolvedMessageReaderOptions;
- (function(ResolvedMessageReaderOptions2) {
- function fromOptions(options) {
- let charset;
- let contentDecoder;
- const contentDecoders = /* @__PURE__ */ new Map();
- let contentTypeDecoder;
- const contentTypeDecoders = /* @__PURE__ */ new Map();
- if (options === void 0 || typeof options === "string") {
- charset = options ?? "utf-8";
- } else {
- charset = options.charset ?? "utf-8";
- if (options.contentDecoder !== void 0) {
- contentDecoder = options.contentDecoder;
- contentDecoders.set(contentDecoder.name, contentDecoder);
- }
- if (options.contentDecoders !== void 0) {
- for (const decoder of options.contentDecoders) {
- contentDecoders.set(decoder.name, decoder);
- }
- }
- if (options.contentTypeDecoder !== void 0) {
- contentTypeDecoder = options.contentTypeDecoder;
- contentTypeDecoders.set(contentTypeDecoder.name, contentTypeDecoder);
- }
- if (options.contentTypeDecoders !== void 0) {
- for (const decoder of options.contentTypeDecoders) {
- contentTypeDecoders.set(decoder.name, decoder);
- }
- }
- }
- if (contentTypeDecoder === void 0) {
- contentTypeDecoder = (0, ral_1.default)().applicationJson.decoder;
- contentTypeDecoders.set(contentTypeDecoder.name, contentTypeDecoder);
- }
- return { charset, contentDecoder, contentDecoders, contentTypeDecoder, contentTypeDecoders };
- }
- ResolvedMessageReaderOptions2.fromOptions = fromOptions;
- })(ResolvedMessageReaderOptions || (ResolvedMessageReaderOptions = {}));
- var ReadableStreamMessageReader = class extends AbstractMessageReader {
- constructor(readable, options) {
- super();
- this.readable = readable;
- this.options = ResolvedMessageReaderOptions.fromOptions(options);
- this.buffer = (0, ral_1.default)().messageBuffer.create(this.options.charset);
- this._partialMessageTimeout = 1e4;
- this.nextMessageLength = -1;
- this.messageToken = 0;
- this.readSemaphore = new semaphore_1.Semaphore(1);
- }
- set partialMessageTimeout(timeout) {
- this._partialMessageTimeout = timeout;
- }
- get partialMessageTimeout() {
- return this._partialMessageTimeout;
- }
- listen(callback) {
- this.nextMessageLength = -1;
- this.messageToken = 0;
- this.partialMessageTimer = void 0;
- this.callback = callback;
- const result = this.readable.onData((data) => {
- this.onData(data);
- });
- this.readable.onError((error) => this.fireError(error));
- this.readable.onClose(() => this.fireClose());
- return result;
- }
- onData(data) {
- try {
- this.buffer.append(data);
- while (true) {
- if (this.nextMessageLength === -1) {
- const headers = this.buffer.tryReadHeaders(true);
- if (!headers) {
- return;
- }
- const contentLength = headers.get("content-length");
- if (!contentLength) {
- this.fireError(new Error(`Header must provide a Content-Length property.
-${JSON.stringify(Object.fromEntries(headers))}`));
- return;
- }
- const length = parseInt(contentLength);
- if (isNaN(length)) {
- this.fireError(new Error(`Content-Length value must be a number. Got ${contentLength}`));
- return;
- }
- this.nextMessageLength = length;
- }
- const body = this.buffer.tryReadBody(this.nextMessageLength);
- if (body === void 0) {
- this.setPartialMessageTimer();
- return;
- }
- this.clearPartialMessageTimer();
- this.nextMessageLength = -1;
- this.readSemaphore.lock(async () => {
- const bytes = this.options.contentDecoder !== void 0 ? await this.options.contentDecoder.decode(body) : body;
- const message = await this.options.contentTypeDecoder.decode(bytes, this.options);
- this.callback(message);
- }).catch((error) => {
- this.fireError(error);
- });
- }
- } catch (error) {
- this.fireError(error);
- }
- }
- clearPartialMessageTimer() {
- if (this.partialMessageTimer) {
- this.partialMessageTimer.dispose();
- this.partialMessageTimer = void 0;
- }
- }
- setPartialMessageTimer() {
- this.clearPartialMessageTimer();
- if (this._partialMessageTimeout <= 0) {
- return;
- }
- this.partialMessageTimer = (0, ral_1.default)().timer.setTimeout((token, timeout) => {
- this.partialMessageTimer = void 0;
- if (token === this.messageToken) {
- this.firePartialMessage({ messageToken: token, waitingTime: timeout });
- this.setPartialMessageTimer();
- }
- }, this._partialMessageTimeout, this.messageToken, this._partialMessageTimeout);
- }
- };
- exports$1.ReadableStreamMessageReader = ReadableStreamMessageReader;
- }
-});
-
-// node_modules/vscode-jsonrpc/lib/common/messageWriter.js
-var require_messageWriter = __commonJS({
- "node_modules/vscode-jsonrpc/lib/common/messageWriter.js"(exports$1) {
- Object.defineProperty(exports$1, "__esModule", { value: true });
- exports$1.WriteableStreamMessageWriter = exports$1.AbstractMessageWriter = exports$1.MessageWriter = void 0;
- var ral_1 = require_ral();
- var Is = require_is();
- var semaphore_1 = require_semaphore();
- var events_1 = require_events();
- var ContentLength = "Content-Length: ";
- var CRLF = "\r\n";
- var MessageWriter;
- (function(MessageWriter2) {
- function is(value) {
- let candidate = value;
- return candidate && Is.func(candidate.dispose) && Is.func(candidate.onClose) && Is.func(candidate.onError) && Is.func(candidate.write);
- }
- MessageWriter2.is = is;
- })(MessageWriter || (exports$1.MessageWriter = MessageWriter = {}));
- var AbstractMessageWriter = class {
- constructor() {
- this.errorEmitter = new events_1.Emitter();
- this.closeEmitter = new events_1.Emitter();
- }
- dispose() {
- this.errorEmitter.dispose();
- this.closeEmitter.dispose();
- }
- get onError() {
- return this.errorEmitter.event;
- }
- fireError(error, message, count) {
- this.errorEmitter.fire([this.asError(error), message, count]);
- }
- get onClose() {
- return this.closeEmitter.event;
- }
- fireClose() {
- this.closeEmitter.fire(void 0);
- }
- asError(error) {
- if (error instanceof Error) {
- return error;
- } else {
- return new Error(`Writer received error. Reason: ${Is.string(error.message) ? error.message : "unknown"}`);
- }
- }
- };
- exports$1.AbstractMessageWriter = AbstractMessageWriter;
- var ResolvedMessageWriterOptions;
- (function(ResolvedMessageWriterOptions2) {
- function fromOptions(options) {
- if (options === void 0 || typeof options === "string") {
- return { charset: options ?? "utf-8", contentTypeEncoder: (0, ral_1.default)().applicationJson.encoder };
- } else {
- return { charset: options.charset ?? "utf-8", contentEncoder: options.contentEncoder, contentTypeEncoder: options.contentTypeEncoder ?? (0, ral_1.default)().applicationJson.encoder };
- }
- }
- ResolvedMessageWriterOptions2.fromOptions = fromOptions;
- })(ResolvedMessageWriterOptions || (ResolvedMessageWriterOptions = {}));
- var WriteableStreamMessageWriter = class extends AbstractMessageWriter {
- constructor(writable, options) {
- super();
- this.writable = writable;
- this.options = ResolvedMessageWriterOptions.fromOptions(options);
- this.errorCount = 0;
- this.writeSemaphore = new semaphore_1.Semaphore(1);
- this.writable.onError((error) => this.fireError(error));
- this.writable.onClose(() => this.fireClose());
- }
- async write(msg) {
- return this.writeSemaphore.lock(async () => {
- const payload = this.options.contentTypeEncoder.encode(msg, this.options).then((buffer) => {
- if (this.options.contentEncoder !== void 0) {
- return this.options.contentEncoder.encode(buffer);
- } else {
- return buffer;
- }
- });
- return payload.then((buffer) => {
- const headers = [];
- headers.push(ContentLength, buffer.byteLength.toString(), CRLF);
- headers.push(CRLF);
- return this.doWrite(msg, headers, buffer);
- }, (error) => {
- this.fireError(error);
- throw error;
- });
- });
- }
- async doWrite(msg, headers, data) {
- try {
- await this.writable.write(headers.join(""), "ascii");
- return this.writable.write(data);
- } catch (error) {
- this.handleError(error, msg);
- return Promise.reject(error);
- }
- }
- handleError(error, msg) {
- this.errorCount++;
- this.fireError(error, msg, this.errorCount);
- }
- end() {
- this.writable.end();
- }
- };
- exports$1.WriteableStreamMessageWriter = WriteableStreamMessageWriter;
- }
-});
-
-// node_modules/vscode-jsonrpc/lib/common/messageBuffer.js
-var require_messageBuffer = __commonJS({
- "node_modules/vscode-jsonrpc/lib/common/messageBuffer.js"(exports$1) {
- Object.defineProperty(exports$1, "__esModule", { value: true });
- exports$1.AbstractMessageBuffer = void 0;
- var CR = 13;
- var LF = 10;
- var CRLF = "\r\n";
- var AbstractMessageBuffer = class {
- constructor(encoding = "utf-8") {
- this._encoding = encoding;
- this._chunks = [];
- this._totalLength = 0;
- }
- get encoding() {
- return this._encoding;
- }
- append(chunk) {
- const toAppend = typeof chunk === "string" ? this.fromString(chunk, this._encoding) : chunk;
- this._chunks.push(toAppend);
- this._totalLength += toAppend.byteLength;
- }
- tryReadHeaders(lowerCaseKeys = false) {
- if (this._chunks.length === 0) {
- return void 0;
- }
- let state = 0;
- let chunkIndex = 0;
- let offset = 0;
- let chunkBytesRead = 0;
- row: while (chunkIndex < this._chunks.length) {
- const chunk = this._chunks[chunkIndex];
- offset = 0;
- while (offset < chunk.length) {
- const value = chunk[offset];
- switch (value) {
- case CR:
- switch (state) {
- case 0:
- state = 1;
- break;
- case 2:
- state = 3;
- break;
- default:
- state = 0;
- }
- break;
- case LF:
- switch (state) {
- case 1:
- state = 2;
- break;
- case 3:
- state = 4;
- offset++;
- break row;
- default:
- state = 0;
- }
- break;
- default:
- state = 0;
- }
- offset++;
- }
- chunkBytesRead += chunk.byteLength;
- chunkIndex++;
- }
- if (state !== 4) {
- return void 0;
- }
- const buffer = this._read(chunkBytesRead + offset);
- const result = /* @__PURE__ */ new Map();
- const headers = this.toString(buffer, "ascii").split(CRLF);
- if (headers.length < 2) {
- return result;
- }
- for (let i = 0; i < headers.length - 2; i++) {
- const header = headers[i];
- const index = header.indexOf(":");
- if (index === -1) {
- throw new Error(`Message header must separate key and value using ':'
-${header}`);
- }
- const key = header.substr(0, index);
- const value = header.substr(index + 1).trim();
- result.set(lowerCaseKeys ? key.toLowerCase() : key, value);
- }
- return result;
- }
- tryReadBody(length) {
- if (this._totalLength < length) {
- return void 0;
- }
- return this._read(length);
- }
- get numberOfBytes() {
- return this._totalLength;
- }
- _read(byteCount) {
- if (byteCount === 0) {
- return this.emptyBuffer();
- }
- if (byteCount > this._totalLength) {
- throw new Error(`Cannot read so many bytes!`);
- }
- if (this._chunks[0].byteLength === byteCount) {
- const chunk = this._chunks[0];
- this._chunks.shift();
- this._totalLength -= byteCount;
- return this.asNative(chunk);
- }
- if (this._chunks[0].byteLength > byteCount) {
- const chunk = this._chunks[0];
- const result2 = this.asNative(chunk, byteCount);
- this._chunks[0] = chunk.slice(byteCount);
- this._totalLength -= byteCount;
- return result2;
- }
- const result = this.allocNative(byteCount);
- let resultOffset = 0;
- let chunkIndex = 0;
- while (byteCount > 0) {
- const chunk = this._chunks[chunkIndex];
- if (chunk.byteLength > byteCount) {
- const chunkPart = chunk.slice(0, byteCount);
- result.set(chunkPart, resultOffset);
- resultOffset += byteCount;
- this._chunks[chunkIndex] = chunk.slice(byteCount);
- this._totalLength -= byteCount;
- byteCount -= byteCount;
- } else {
- result.set(chunk, resultOffset);
- resultOffset += chunk.byteLength;
- this._chunks.shift();
- this._totalLength -= chunk.byteLength;
- byteCount -= chunk.byteLength;
- }
- }
- return result;
- }
- };
- exports$1.AbstractMessageBuffer = AbstractMessageBuffer;
- }
-});
-
-// node_modules/vscode-jsonrpc/lib/common/connection.js
-var require_connection = __commonJS({
- "node_modules/vscode-jsonrpc/lib/common/connection.js"(exports$1) {
- Object.defineProperty(exports$1, "__esModule", { value: true });
- exports$1.createMessageConnection = exports$1.ConnectionOptions = exports$1.MessageStrategy = exports$1.CancellationStrategy = exports$1.CancellationSenderStrategy = exports$1.CancellationReceiverStrategy = exports$1.RequestCancellationReceiverStrategy = exports$1.IdCancellationReceiverStrategy = exports$1.ConnectionStrategy = exports$1.ConnectionError = exports$1.ConnectionErrors = exports$1.LogTraceNotification = exports$1.SetTraceNotification = exports$1.TraceFormat = exports$1.TraceValues = exports$1.Trace = exports$1.NullLogger = exports$1.ProgressType = exports$1.ProgressToken = void 0;
- var ral_1 = require_ral();
- var Is = require_is();
- var messages_1 = require_messages();
- var linkedMap_1 = require_linkedMap();
- var events_1 = require_events();
- var cancellation_1 = require_cancellation();
- var CancelNotification;
- (function(CancelNotification2) {
- CancelNotification2.type = new messages_1.NotificationType("$/cancelRequest");
- })(CancelNotification || (CancelNotification = {}));
- var ProgressToken;
- (function(ProgressToken2) {
- function is(value) {
- return typeof value === "string" || typeof value === "number";
- }
- ProgressToken2.is = is;
- })(ProgressToken || (exports$1.ProgressToken = ProgressToken = {}));
- var ProgressNotification;
- (function(ProgressNotification2) {
- ProgressNotification2.type = new messages_1.NotificationType("$/progress");
- })(ProgressNotification || (ProgressNotification = {}));
- var ProgressType = class {
- constructor() {
- }
- };
- exports$1.ProgressType = ProgressType;
- var StarRequestHandler;
- (function(StarRequestHandler2) {
- function is(value) {
- return Is.func(value);
- }
- StarRequestHandler2.is = is;
- })(StarRequestHandler || (StarRequestHandler = {}));
- exports$1.NullLogger = Object.freeze({
- error: () => {
- },
- warn: () => {
- },
- info: () => {
- },
- log: () => {
- }
- });
- var Trace;
- (function(Trace2) {
- Trace2[Trace2["Off"] = 0] = "Off";
- Trace2[Trace2["Messages"] = 1] = "Messages";
- Trace2[Trace2["Compact"] = 2] = "Compact";
- Trace2[Trace2["Verbose"] = 3] = "Verbose";
- })(Trace || (exports$1.Trace = Trace = {}));
- var TraceValues;
- (function(TraceValues2) {
- TraceValues2.Off = "off";
- TraceValues2.Messages = "messages";
- TraceValues2.Compact = "compact";
- TraceValues2.Verbose = "verbose";
- })(TraceValues || (exports$1.TraceValues = TraceValues = {}));
- (function(Trace2) {
- function fromString(value) {
- if (!Is.string(value)) {
- return Trace2.Off;
- }
- value = value.toLowerCase();
- switch (value) {
- case "off":
- return Trace2.Off;
- case "messages":
- return Trace2.Messages;
- case "compact":
- return Trace2.Compact;
- case "verbose":
- return Trace2.Verbose;
- default:
- return Trace2.Off;
- }
- }
- Trace2.fromString = fromString;
- function toString(value) {
- switch (value) {
- case Trace2.Off:
- return "off";
- case Trace2.Messages:
- return "messages";
- case Trace2.Compact:
- return "compact";
- case Trace2.Verbose:
- return "verbose";
- default:
- return "off";
- }
- }
- Trace2.toString = toString;
- })(Trace || (exports$1.Trace = Trace = {}));
- var TraceFormat;
- (function(TraceFormat2) {
- TraceFormat2["Text"] = "text";
- TraceFormat2["JSON"] = "json";
- })(TraceFormat || (exports$1.TraceFormat = TraceFormat = {}));
- (function(TraceFormat2) {
- function fromString(value) {
- if (!Is.string(value)) {
- return TraceFormat2.Text;
- }
- value = value.toLowerCase();
- if (value === "json") {
- return TraceFormat2.JSON;
- } else {
- return TraceFormat2.Text;
- }
- }
- TraceFormat2.fromString = fromString;
- })(TraceFormat || (exports$1.TraceFormat = TraceFormat = {}));
- var SetTraceNotification;
- (function(SetTraceNotification2) {
- SetTraceNotification2.type = new messages_1.NotificationType("$/setTrace");
- })(SetTraceNotification || (exports$1.SetTraceNotification = SetTraceNotification = {}));
- var LogTraceNotification;
- (function(LogTraceNotification2) {
- LogTraceNotification2.type = new messages_1.NotificationType("$/logTrace");
- })(LogTraceNotification || (exports$1.LogTraceNotification = LogTraceNotification = {}));
- var ConnectionErrors;
- (function(ConnectionErrors2) {
- ConnectionErrors2[ConnectionErrors2["Closed"] = 1] = "Closed";
- ConnectionErrors2[ConnectionErrors2["Disposed"] = 2] = "Disposed";
- ConnectionErrors2[ConnectionErrors2["AlreadyListening"] = 3] = "AlreadyListening";
- })(ConnectionErrors || (exports$1.ConnectionErrors = ConnectionErrors = {}));
- var ConnectionError = class _ConnectionError extends Error {
- constructor(code, message) {
- super(message);
- this.code = code;
- Object.setPrototypeOf(this, _ConnectionError.prototype);
- }
- };
- exports$1.ConnectionError = ConnectionError;
- var ConnectionStrategy;
- (function(ConnectionStrategy2) {
- function is(value) {
- const candidate = value;
- return candidate && Is.func(candidate.cancelUndispatched);
- }
- ConnectionStrategy2.is = is;
- })(ConnectionStrategy || (exports$1.ConnectionStrategy = ConnectionStrategy = {}));
- var IdCancellationReceiverStrategy;
- (function(IdCancellationReceiverStrategy2) {
- function is(value) {
- const candidate = value;
- return candidate && (candidate.kind === void 0 || candidate.kind === "id") && Is.func(candidate.createCancellationTokenSource) && (candidate.dispose === void 0 || Is.func(candidate.dispose));
- }
- IdCancellationReceiverStrategy2.is = is;
- })(IdCancellationReceiverStrategy || (exports$1.IdCancellationReceiverStrategy = IdCancellationReceiverStrategy = {}));
- var RequestCancellationReceiverStrategy;
- (function(RequestCancellationReceiverStrategy2) {
- function is(value) {
- const candidate = value;
- return candidate && candidate.kind === "request" && Is.func(candidate.createCancellationTokenSource) && (candidate.dispose === void 0 || Is.func(candidate.dispose));
- }
- RequestCancellationReceiverStrategy2.is = is;
- })(RequestCancellationReceiverStrategy || (exports$1.RequestCancellationReceiverStrategy = RequestCancellationReceiverStrategy = {}));
- var CancellationReceiverStrategy;
- (function(CancellationReceiverStrategy2) {
- CancellationReceiverStrategy2.Message = Object.freeze({
- createCancellationTokenSource(_) {
- return new cancellation_1.CancellationTokenSource();
- }
- });
- function is(value) {
- return IdCancellationReceiverStrategy.is(value) || RequestCancellationReceiverStrategy.is(value);
- }
- CancellationReceiverStrategy2.is = is;
- })(CancellationReceiverStrategy || (exports$1.CancellationReceiverStrategy = CancellationReceiverStrategy = {}));
- var CancellationSenderStrategy;
- (function(CancellationSenderStrategy2) {
- CancellationSenderStrategy2.Message = Object.freeze({
- sendCancellation(conn, id) {
- return conn.sendNotification(CancelNotification.type, { id });
- },
- cleanup(_) {
- }
- });
- function is(value) {
- const candidate = value;
- return candidate && Is.func(candidate.sendCancellation) && Is.func(candidate.cleanup);
- }
- CancellationSenderStrategy2.is = is;
- })(CancellationSenderStrategy || (exports$1.CancellationSenderStrategy = CancellationSenderStrategy = {}));
- var CancellationStrategy;
- (function(CancellationStrategy2) {
- CancellationStrategy2.Message = Object.freeze({
- receiver: CancellationReceiverStrategy.Message,
- sender: CancellationSenderStrategy.Message
- });
- function is(value) {
- const candidate = value;
- return candidate && CancellationReceiverStrategy.is(candidate.receiver) && CancellationSenderStrategy.is(candidate.sender);
- }
- CancellationStrategy2.is = is;
- })(CancellationStrategy || (exports$1.CancellationStrategy = CancellationStrategy = {}));
- var MessageStrategy;
- (function(MessageStrategy2) {
- function is(value) {
- const candidate = value;
- return candidate && Is.func(candidate.handleMessage);
- }
- MessageStrategy2.is = is;
- })(MessageStrategy || (exports$1.MessageStrategy = MessageStrategy = {}));
- var ConnectionOptions;
- (function(ConnectionOptions2) {
- function is(value) {
- const candidate = value;
- return candidate && (CancellationStrategy.is(candidate.cancellationStrategy) || ConnectionStrategy.is(candidate.connectionStrategy) || MessageStrategy.is(candidate.messageStrategy));
- }
- ConnectionOptions2.is = is;
- })(ConnectionOptions || (exports$1.ConnectionOptions = ConnectionOptions = {}));
- var ConnectionState;
- (function(ConnectionState2) {
- ConnectionState2[ConnectionState2["New"] = 1] = "New";
- ConnectionState2[ConnectionState2["Listening"] = 2] = "Listening";
- ConnectionState2[ConnectionState2["Closed"] = 3] = "Closed";
- ConnectionState2[ConnectionState2["Disposed"] = 4] = "Disposed";
- })(ConnectionState || (ConnectionState = {}));
- function createMessageConnection2(messageReader, messageWriter, _logger, options) {
- const logger = _logger !== void 0 ? _logger : exports$1.NullLogger;
- let sequenceNumber = 0;
- let notificationSequenceNumber = 0;
- let unknownResponseSequenceNumber = 0;
- const version = "2.0";
- let starRequestHandler = void 0;
- const requestHandlers = /* @__PURE__ */ new Map();
- let starNotificationHandler = void 0;
- const notificationHandlers = /* @__PURE__ */ new Map();
- const progressHandlers = /* @__PURE__ */ new Map();
- let timer;
- let messageQueue = new linkedMap_1.LinkedMap();
- let responsePromises = /* @__PURE__ */ new Map();
- let knownCanceledRequests = /* @__PURE__ */ new Set();
- let requestTokens = /* @__PURE__ */ new Map();
- let trace = Trace.Off;
- let traceFormat = TraceFormat.Text;
- let tracer;
- let state = ConnectionState.New;
- const errorEmitter = new events_1.Emitter();
- const closeEmitter = new events_1.Emitter();
- const unhandledNotificationEmitter = new events_1.Emitter();
- const unhandledProgressEmitter = new events_1.Emitter();
- const disposeEmitter = new events_1.Emitter();
- const cancellationStrategy = options && options.cancellationStrategy ? options.cancellationStrategy : CancellationStrategy.Message;
- function createRequestQueueKey(id) {
- if (id === null) {
- throw new Error(`Can't send requests with id null since the response can't be correlated.`);
- }
- return "req-" + id.toString();
- }
- function createResponseQueueKey(id) {
- if (id === null) {
- return "res-unknown-" + (++unknownResponseSequenceNumber).toString();
- } else {
- return "res-" + id.toString();
- }
- }
- function createNotificationQueueKey() {
- return "not-" + (++notificationSequenceNumber).toString();
- }
- function addMessageToQueue(queue, message) {
- if (messages_1.Message.isRequest(message)) {
- queue.set(createRequestQueueKey(message.id), message);
- } else if (messages_1.Message.isResponse(message)) {
- queue.set(createResponseQueueKey(message.id), message);
- } else {
- queue.set(createNotificationQueueKey(), message);
- }
- }
- function cancelUndispatched(_message) {
- return void 0;
- }
- function isListening() {
- return state === ConnectionState.Listening;
- }
- function isClosed() {
- return state === ConnectionState.Closed;
- }
- function isDisposed() {
- return state === ConnectionState.Disposed;
- }
- function closeHandler() {
- if (state === ConnectionState.New || state === ConnectionState.Listening) {
- state = ConnectionState.Closed;
- closeEmitter.fire(void 0);
- }
- }
- function readErrorHandler(error) {
- errorEmitter.fire([error, void 0, void 0]);
- }
- function writeErrorHandler(data) {
- errorEmitter.fire(data);
- }
- messageReader.onClose(closeHandler);
- messageReader.onError(readErrorHandler);
- messageWriter.onClose(closeHandler);
- messageWriter.onError(writeErrorHandler);
- function triggerMessageQueue() {
- if (timer || messageQueue.size === 0) {
- return;
- }
- timer = (0, ral_1.default)().timer.setImmediate(() => {
- timer = void 0;
- processMessageQueue();
- });
- }
- function handleMessage(message) {
- if (messages_1.Message.isRequest(message)) {
- handleRequest(message);
- } else if (messages_1.Message.isNotification(message)) {
- handleNotification(message);
- } else if (messages_1.Message.isResponse(message)) {
- handleResponse(message);
- } else {
- handleInvalidMessage(message);
- }
- }
- function processMessageQueue() {
- if (messageQueue.size === 0) {
- return;
- }
- const message = messageQueue.shift();
- try {
- const messageStrategy = options?.messageStrategy;
- if (MessageStrategy.is(messageStrategy)) {
- messageStrategy.handleMessage(message, handleMessage);
- } else {
- handleMessage(message);
- }
- } finally {
- triggerMessageQueue();
- }
- }
- const callback = (message) => {
- try {
- if (messages_1.Message.isNotification(message) && message.method === CancelNotification.type.method) {
- const cancelId = message.params.id;
- const key = createRequestQueueKey(cancelId);
- const toCancel = messageQueue.get(key);
- if (messages_1.Message.isRequest(toCancel)) {
- const strategy = options?.connectionStrategy;
- const response = strategy && strategy.cancelUndispatched ? strategy.cancelUndispatched(toCancel, cancelUndispatched) : cancelUndispatched(toCancel);
- if (response && (response.error !== void 0 || response.result !== void 0)) {
- messageQueue.delete(key);
- requestTokens.delete(cancelId);
- response.id = toCancel.id;
- traceSendingResponse(response, message.method, Date.now());
- messageWriter.write(response).catch(() => logger.error(`Sending response for canceled message failed.`));
- return;
- }
- }
- const cancellationToken = requestTokens.get(cancelId);
- if (cancellationToken !== void 0) {
- cancellationToken.cancel();
- traceReceivedNotification(message);
- return;
- } else {
- knownCanceledRequests.add(cancelId);
- }
- }
- addMessageToQueue(messageQueue, message);
- } finally {
- triggerMessageQueue();
- }
- };
- function handleRequest(requestMessage) {
- if (isDisposed()) {
- return;
- }
- function reply(resultOrError, method, startTime2) {
- const message = {
- jsonrpc: version,
- id: requestMessage.id
- };
- if (resultOrError instanceof messages_1.ResponseError) {
- message.error = resultOrError.toJson();
- } else {
- message.result = resultOrError === void 0 ? null : resultOrError;
- }
- traceSendingResponse(message, method, startTime2);
- messageWriter.write(message).catch(() => logger.error(`Sending response failed.`));
- }
- function replyError(error, method, startTime2) {
- const message = {
- jsonrpc: version,
- id: requestMessage.id,
- error: error.toJson()
- };
- traceSendingResponse(message, method, startTime2);
- messageWriter.write(message).catch(() => logger.error(`Sending response failed.`));
- }
- function replySuccess(result, method, startTime2) {
- if (result === void 0) {
- result = null;
- }
- const message = {
- jsonrpc: version,
- id: requestMessage.id,
- result
- };
- traceSendingResponse(message, method, startTime2);
- messageWriter.write(message).catch(() => logger.error(`Sending response failed.`));
- }
- traceReceivedRequest(requestMessage);
- const element = requestHandlers.get(requestMessage.method);
- let type;
- let requestHandler;
- if (element) {
- type = element.type;
- requestHandler = element.handler;
- }
- const startTime = Date.now();
- if (requestHandler || starRequestHandler) {
- const tokenKey = requestMessage.id ?? String(Date.now());
- const cancellationSource = IdCancellationReceiverStrategy.is(cancellationStrategy.receiver) ? cancellationStrategy.receiver.createCancellationTokenSource(tokenKey) : cancellationStrategy.receiver.createCancellationTokenSource(requestMessage);
- if (requestMessage.id !== null && knownCanceledRequests.has(requestMessage.id)) {
- cancellationSource.cancel();
- }
- if (requestMessage.id !== null) {
- requestTokens.set(tokenKey, cancellationSource);
- }
- try {
- let handlerResult;
- if (requestHandler) {
- if (requestMessage.params === void 0) {
- if (type !== void 0 && type.numberOfParams !== 0) {
- replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InvalidParams, `Request ${requestMessage.method} defines ${type.numberOfParams} params but received none.`), requestMessage.method, startTime);
- return;
- }
- handlerResult = requestHandler(cancellationSource.token);
- } else if (Array.isArray(requestMessage.params)) {
- if (type !== void 0 && type.parameterStructures === messages_1.ParameterStructures.byName) {
- replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InvalidParams, `Request ${requestMessage.method} defines parameters by name but received parameters by position`), requestMessage.method, startTime);
- return;
- }
- handlerResult = requestHandler(...requestMessage.params, cancellationSource.token);
- } else {
- if (type !== void 0 && type.parameterStructures === messages_1.ParameterStructures.byPosition) {
- replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InvalidParams, `Request ${requestMessage.method} defines parameters by position but received parameters by name`), requestMessage.method, startTime);
- return;
- }
- handlerResult = requestHandler(requestMessage.params, cancellationSource.token);
- }
- } else if (starRequestHandler) {
- handlerResult = starRequestHandler(requestMessage.method, requestMessage.params, cancellationSource.token);
- }
- const promise = handlerResult;
- if (!handlerResult) {
- requestTokens.delete(tokenKey);
- replySuccess(handlerResult, requestMessage.method, startTime);
- } else if (promise.then) {
- promise.then((resultOrError) => {
- requestTokens.delete(tokenKey);
- reply(resultOrError, requestMessage.method, startTime);
- }, (error) => {
- requestTokens.delete(tokenKey);
- if (error instanceof messages_1.ResponseError) {
- replyError(error, requestMessage.method, startTime);
- } else if (error && Is.string(error.message)) {
- replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed with message: ${error.message}`), requestMessage.method, startTime);
- } else {
- replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed unexpectedly without providing any details.`), requestMessage.method, startTime);
- }
- });
- } else {
- requestTokens.delete(tokenKey);
- reply(handlerResult, requestMessage.method, startTime);
- }
- } catch (error) {
- requestTokens.delete(tokenKey);
- if (error instanceof messages_1.ResponseError) {
- reply(error, requestMessage.method, startTime);
- } else if (error && Is.string(error.message)) {
- replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed with message: ${error.message}`), requestMessage.method, startTime);
- } else {
- replyError(new messages_1.ResponseError(messages_1.ErrorCodes.InternalError, `Request ${requestMessage.method} failed unexpectedly without providing any details.`), requestMessage.method, startTime);
- }
- }
- } else {
- replyError(new messages_1.ResponseError(messages_1.ErrorCodes.MethodNotFound, `Unhandled method ${requestMessage.method}`), requestMessage.method, startTime);
- }
- }
- function handleResponse(responseMessage) {
- if (isDisposed()) {
- return;
- }
- if (responseMessage.id === null) {
- if (responseMessage.error) {
- logger.error(`Received response message without id: Error is:
-${JSON.stringify(responseMessage.error, void 0, 4)}`);
- } else {
- logger.error(`Received response message without id. No further error information provided.`);
- }
- } else {
- const key = responseMessage.id;
- const responsePromise = responsePromises.get(key);
- traceReceivedResponse(responseMessage, responsePromise);
- if (responsePromise !== void 0) {
- responsePromises.delete(key);
- try {
- if (responseMessage.error) {
- const error = responseMessage.error;
- responsePromise.reject(new messages_1.ResponseError(error.code, error.message, error.data));
- } else if (responseMessage.result !== void 0) {
- responsePromise.resolve(responseMessage.result);
- } else {
- throw new Error("Should never happen.");
- }
- } catch (error) {
- if (error.message) {
- logger.error(`Response handler '${responsePromise.method}' failed with message: ${error.message}`);
- } else {
- logger.error(`Response handler '${responsePromise.method}' failed unexpectedly.`);
- }
- }
- }
- }
- }
- function handleNotification(message) {
- if (isDisposed()) {
- return;
- }
- let type = void 0;
- let notificationHandler;
- if (message.method === CancelNotification.type.method) {
- const cancelId = message.params.id;
- knownCanceledRequests.delete(cancelId);
- traceReceivedNotification(message);
- return;
- } else {
- const element = notificationHandlers.get(message.method);
- if (element) {
- notificationHandler = element.handler;
- type = element.type;
- }
- }
- if (notificationHandler || starNotificationHandler) {
- try {
- traceReceivedNotification(message);
- if (notificationHandler) {
- if (message.params === void 0) {
- if (type !== void 0) {
- if (type.numberOfParams !== 0 && type.parameterStructures !== messages_1.ParameterStructures.byName) {
- logger.error(`Notification ${message.method} defines ${type.numberOfParams} params but received none.`);
- }
- }
- notificationHandler();
- } else if (Array.isArray(message.params)) {
- const params = message.params;
- if (message.method === ProgressNotification.type.method && params.length === 2 && ProgressToken.is(params[0])) {
- notificationHandler({ token: params[0], value: params[1] });
- } else {
- if (type !== void 0) {
- if (type.parameterStructures === messages_1.ParameterStructures.byName) {
- logger.error(`Notification ${message.method} defines parameters by name but received parameters by position`);
- }
- if (type.numberOfParams !== message.params.length) {
- logger.error(`Notification ${message.method} defines ${type.numberOfParams} params but received ${params.length} arguments`);
- }
- }
- notificationHandler(...params);
- }
- } else {
- if (type !== void 0 && type.parameterStructures === messages_1.ParameterStructures.byPosition) {
- logger.error(`Notification ${message.method} defines parameters by position but received parameters by name`);
- }
- notificationHandler(message.params);
- }
- } else if (starNotificationHandler) {
- starNotificationHandler(message.method, message.params);
- }
- } catch (error) {
- if (error.message) {
- logger.error(`Notification handler '${message.method}' failed with message: ${error.message}`);
- } else {
- logger.error(`Notification handler '${message.method}' failed unexpectedly.`);
- }
- }
- } else {
- unhandledNotificationEmitter.fire(message);
- }
- }
- function handleInvalidMessage(message) {
- if (!message) {
- logger.error("Received empty message.");
- return;
- }
- logger.error(`Received message which is neither a response nor a notification message:
-${JSON.stringify(message, null, 4)}`);
- const responseMessage = message;
- if (Is.string(responseMessage.id) || Is.number(responseMessage.id)) {
- const key = responseMessage.id;
- const responseHandler = responsePromises.get(key);
- if (responseHandler) {
- responseHandler.reject(new Error("The received response has neither a result nor an error property."));
- }
- }
- }
- function stringifyTrace(params) {
- if (params === void 0 || params === null) {
- return void 0;
- }
- switch (trace) {
- case Trace.Verbose:
- return JSON.stringify(params, null, 4);
- case Trace.Compact:
- return JSON.stringify(params);
- default:
- return void 0;
- }
- }
- function traceSendingRequest(message) {
- if (trace === Trace.Off || !tracer) {
- return;
- }
- if (traceFormat === TraceFormat.Text) {
- let data = void 0;
- if ((trace === Trace.Verbose || trace === Trace.Compact) && message.params) {
- data = `Params: ${stringifyTrace(message.params)}
-
-`;
- }
- tracer.log(`Sending request '${message.method} - (${message.id})'.`, data);
- } else {
- logLSPMessage("send-request", message);
- }
- }
- function traceSendingNotification(message) {
- if (trace === Trace.Off || !tracer) {
- return;
- }
- if (traceFormat === TraceFormat.Text) {
- let data = void 0;
- if (trace === Trace.Verbose || trace === Trace.Compact) {
- if (message.params) {
- data = `Params: ${stringifyTrace(message.params)}
-
-`;
- } else {
- data = "No parameters provided.\n\n";
- }
- }
- tracer.log(`Sending notification '${message.method}'.`, data);
- } else {
- logLSPMessage("send-notification", message);
- }
- }
- function traceSendingResponse(message, method, startTime) {
- if (trace === Trace.Off || !tracer) {
- return;
- }
- if (traceFormat === TraceFormat.Text) {
- let data = void 0;
- if (trace === Trace.Verbose || trace === Trace.Compact) {
- if (message.error && message.error.data) {
- data = `Error data: ${stringifyTrace(message.error.data)}
-
-`;
- } else {
- if (message.result) {
- data = `Result: ${stringifyTrace(message.result)}
-
-`;
- } else if (message.error === void 0) {
- data = "No result returned.\n\n";
- }
- }
- }
- tracer.log(`Sending response '${method} - (${message.id})'. Processing request took ${Date.now() - startTime}ms`, data);
- } else {
- logLSPMessage("send-response", message);
- }
- }
- function traceReceivedRequest(message) {
- if (trace === Trace.Off || !tracer) {
- return;
- }
- if (traceFormat === TraceFormat.Text) {
- let data = void 0;
- if ((trace === Trace.Verbose || trace === Trace.Compact) && message.params) {
- data = `Params: ${stringifyTrace(message.params)}
-
-`;
- }
- tracer.log(`Received request '${message.method} - (${message.id})'.`, data);
- } else {
- logLSPMessage("receive-request", message);
- }
- }
- function traceReceivedNotification(message) {
- if (trace === Trace.Off || !tracer || message.method === LogTraceNotification.type.method) {
- return;
- }
- if (traceFormat === TraceFormat.Text) {
- let data = void 0;
- if (trace === Trace.Verbose || trace === Trace.Compact) {
- if (message.params) {
- data = `Params: ${stringifyTrace(message.params)}
-
-`;
- } else {
- data = "No parameters provided.\n\n";
- }
- }
- tracer.log(`Received notification '${message.method}'.`, data);
- } else {
- logLSPMessage("receive-notification", message);
- }
- }
- function traceReceivedResponse(message, responsePromise) {
- if (trace === Trace.Off || !tracer) {
- return;
- }
- if (traceFormat === TraceFormat.Text) {
- let data = void 0;
- if (trace === Trace.Verbose || trace === Trace.Compact) {
- if (message.error && message.error.data) {
- data = `Error data: ${stringifyTrace(message.error.data)}
-
-`;
- } else {
- if (message.result) {
- data = `Result: ${stringifyTrace(message.result)}
-
-`;
- } else if (message.error === void 0) {
- data = "No result returned.\n\n";
- }
- }
- }
- if (responsePromise) {
- const error = message.error ? ` Request failed: ${message.error.message} (${message.error.code}).` : "";
- tracer.log(`Received response '${responsePromise.method} - (${message.id})' in ${Date.now() - responsePromise.timerStart}ms.${error}`, data);
- } else {
- tracer.log(`Received response ${message.id} without active response promise.`, data);
- }
- } else {
- logLSPMessage("receive-response", message);
- }
- }
- function logLSPMessage(type, message) {
- if (!tracer || trace === Trace.Off) {
- return;
- }
- const lspMessage = {
- isLSPMessage: true,
- type,
- message,
- timestamp: Date.now()
- };
- tracer.log(lspMessage);
- }
- function throwIfClosedOrDisposed() {
- if (isClosed()) {
- throw new ConnectionError(ConnectionErrors.Closed, "Connection is closed.");
- }
- if (isDisposed()) {
- throw new ConnectionError(ConnectionErrors.Disposed, "Connection is disposed.");
- }
- }
- function throwIfListening() {
- if (isListening()) {
- throw new ConnectionError(ConnectionErrors.AlreadyListening, "Connection is already listening");
- }
- }
- function throwIfNotListening() {
- if (!isListening()) {
- throw new Error("Call listen() first.");
- }
- }
- function undefinedToNull(param) {
- if (param === void 0) {
- return null;
- } else {
- return param;
- }
- }
- function nullToUndefined(param) {
- if (param === null) {
- return void 0;
- } else {
- return param;
- }
- }
- function isNamedParam(param) {
- return param !== void 0 && param !== null && !Array.isArray(param) && typeof param === "object";
- }
- function computeSingleParam(parameterStructures, param) {
- switch (parameterStructures) {
- case messages_1.ParameterStructures.auto:
- if (isNamedParam(param)) {
- return nullToUndefined(param);
- } else {
- return [undefinedToNull(param)];
- }
- case messages_1.ParameterStructures.byName:
- if (!isNamedParam(param)) {
- throw new Error(`Received parameters by name but param is not an object literal.`);
- }
- return nullToUndefined(param);
- case messages_1.ParameterStructures.byPosition:
- return [undefinedToNull(param)];
- default:
- throw new Error(`Unknown parameter structure ${parameterStructures.toString()}`);
- }
- }
- function computeMessageParams(type, params) {
- let result;
- const numberOfParams = type.numberOfParams;
- switch (numberOfParams) {
- case 0:
- result = void 0;
- break;
- case 1:
- result = computeSingleParam(type.parameterStructures, params[0]);
- break;
- default:
- result = [];
- for (let i = 0; i < params.length && i < numberOfParams; i++) {
- result.push(undefinedToNull(params[i]));
- }
- if (params.length < numberOfParams) {
- for (let i = params.length; i < numberOfParams; i++) {
- result.push(null);
- }
- }
- break;
- }
- return result;
- }
- const connection = {
- sendNotification: (type, ...args) => {
- throwIfClosedOrDisposed();
- let method;
- let messageParams;
- if (Is.string(type)) {
- method = type;
- const first = args[0];
- let paramStart = 0;
- let parameterStructures = messages_1.ParameterStructures.auto;
- if (messages_1.ParameterStructures.is(first)) {
- paramStart = 1;
- parameterStructures = first;
- }
- let paramEnd = args.length;
- const numberOfParams = paramEnd - paramStart;
- switch (numberOfParams) {
- case 0:
- messageParams = void 0;
- break;
- case 1:
- messageParams = computeSingleParam(parameterStructures, args[paramStart]);
- break;
- default:
- if (parameterStructures === messages_1.ParameterStructures.byName) {
- throw new Error(`Received ${numberOfParams} parameters for 'by Name' notification parameter structure.`);
- }
- messageParams = args.slice(paramStart, paramEnd).map((value) => undefinedToNull(value));
- break;
- }
- } else {
- const params = args;
- method = type.method;
- messageParams = computeMessageParams(type, params);
- }
- const notificationMessage = {
- jsonrpc: version,
- method,
- params: messageParams
- };
- traceSendingNotification(notificationMessage);
- return messageWriter.write(notificationMessage).catch((error) => {
- logger.error(`Sending notification failed.`);
- throw error;
- });
- },
- onNotification: (type, handler) => {
- throwIfClosedOrDisposed();
- let method;
- if (Is.func(type)) {
- starNotificationHandler = type;
- } else if (handler) {
- if (Is.string(type)) {
- method = type;
- notificationHandlers.set(type, { type: void 0, handler });
- } else {
- method = type.method;
- notificationHandlers.set(type.method, { type, handler });
- }
- }
- return {
- dispose: () => {
- if (method !== void 0) {
- notificationHandlers.delete(method);
- } else {
- starNotificationHandler = void 0;
- }
- }
- };
- },
- onProgress: (_type, token, handler) => {
- if (progressHandlers.has(token)) {
- throw new Error(`Progress handler for token ${token} already registered`);
- }
- progressHandlers.set(token, handler);
- return {
- dispose: () => {
- progressHandlers.delete(token);
- }
- };
- },
- sendProgress: (_type, token, value) => {
- return connection.sendNotification(ProgressNotification.type, { token, value });
- },
- onUnhandledProgress: unhandledProgressEmitter.event,
- sendRequest: (type, ...args) => {
- throwIfClosedOrDisposed();
- throwIfNotListening();
- let method;
- let messageParams;
- let token = void 0;
- if (Is.string(type)) {
- method = type;
- const first = args[0];
- const last = args[args.length - 1];
- let paramStart = 0;
- let parameterStructures = messages_1.ParameterStructures.auto;
- if (messages_1.ParameterStructures.is(first)) {
- paramStart = 1;
- parameterStructures = first;
- }
- let paramEnd = args.length;
- if (cancellation_1.CancellationToken.is(last)) {
- paramEnd = paramEnd - 1;
- token = last;
- }
- const numberOfParams = paramEnd - paramStart;
- switch (numberOfParams) {
- case 0:
- messageParams = void 0;
- break;
- case 1:
- messageParams = computeSingleParam(parameterStructures, args[paramStart]);
- break;
- default:
- if (parameterStructures === messages_1.ParameterStructures.byName) {
- throw new Error(`Received ${numberOfParams} parameters for 'by Name' request parameter structure.`);
- }
- messageParams = args.slice(paramStart, paramEnd).map((value) => undefinedToNull(value));
- break;
- }
- } else {
- const params = args;
- method = type.method;
- messageParams = computeMessageParams(type, params);
- const numberOfParams = type.numberOfParams;
- token = cancellation_1.CancellationToken.is(params[numberOfParams]) ? params[numberOfParams] : void 0;
- }
- const id = sequenceNumber++;
- let disposable;
- if (token) {
- disposable = token.onCancellationRequested(() => {
- const p = cancellationStrategy.sender.sendCancellation(connection, id);
- if (p === void 0) {
- logger.log(`Received no promise from cancellation strategy when cancelling id ${id}`);
- return Promise.resolve();
- } else {
- return p.catch(() => {
- logger.log(`Sending cancellation messages for id ${id} failed`);
- });
- }
- });
- }
- const requestMessage = {
- jsonrpc: version,
- id,
- method,
- params: messageParams
- };
- traceSendingRequest(requestMessage);
- if (typeof cancellationStrategy.sender.enableCancellation === "function") {
- cancellationStrategy.sender.enableCancellation(requestMessage);
- }
- return new Promise(async (resolve, reject) => {
- const resolveWithCleanup = (r) => {
- resolve(r);
- cancellationStrategy.sender.cleanup(id);
- disposable?.dispose();
- };
- const rejectWithCleanup = (r) => {
- reject(r);
- cancellationStrategy.sender.cleanup(id);
- disposable?.dispose();
- };
- const responsePromise = { method, timerStart: Date.now(), resolve: resolveWithCleanup, reject: rejectWithCleanup };
- try {
- responsePromises.set(id, responsePromise);
- await messageWriter.write(requestMessage);
- } catch (error) {
- responsePromises.delete(id);
- responsePromise.reject(new messages_1.ResponseError(messages_1.ErrorCodes.MessageWriteError, error.message ? error.message : "Unknown reason"));
- logger.error(`Sending request failed.`);
- throw error;
- }
- });
- },
- onRequest: (type, handler) => {
- throwIfClosedOrDisposed();
- let method = null;
- if (StarRequestHandler.is(type)) {
- method = void 0;
- starRequestHandler = type;
- } else if (Is.string(type)) {
- method = null;
- if (handler !== void 0) {
- method = type;
- requestHandlers.set(type, { handler, type: void 0 });
- }
- } else {
- if (handler !== void 0) {
- method = type.method;
- requestHandlers.set(type.method, { type, handler });
- }
- }
- return {
- dispose: () => {
- if (method === null) {
- return;
- }
- if (method !== void 0) {
- requestHandlers.delete(method);
- } else {
- starRequestHandler = void 0;
- }
- }
- };
- },
- hasPendingResponse: () => {
- return responsePromises.size > 0;
- },
- trace: async (_value, _tracer, sendNotificationOrTraceOptions) => {
- let _sendNotification = false;
- let _traceFormat = TraceFormat.Text;
- if (sendNotificationOrTraceOptions !== void 0) {
- if (Is.boolean(sendNotificationOrTraceOptions)) {
- _sendNotification = sendNotificationOrTraceOptions;
- } else {
- _sendNotification = sendNotificationOrTraceOptions.sendNotification || false;
- _traceFormat = sendNotificationOrTraceOptions.traceFormat || TraceFormat.Text;
- }
- }
- trace = _value;
- traceFormat = _traceFormat;
- if (trace === Trace.Off) {
- tracer = void 0;
- } else {
- tracer = _tracer;
- }
- if (_sendNotification && !isClosed() && !isDisposed()) {
- await connection.sendNotification(SetTraceNotification.type, { value: Trace.toString(_value) });
- }
- },
- onError: errorEmitter.event,
- onClose: closeEmitter.event,
- onUnhandledNotification: unhandledNotificationEmitter.event,
- onDispose: disposeEmitter.event,
- end: () => {
- messageWriter.end();
- },
- dispose: () => {
- if (isDisposed()) {
- return;
- }
- state = ConnectionState.Disposed;
- disposeEmitter.fire(void 0);
- const error = new messages_1.ResponseError(messages_1.ErrorCodes.PendingResponseRejected, "Pending response rejected since connection got disposed");
- for (const promise of responsePromises.values()) {
- promise.reject(error);
- }
- responsePromises = /* @__PURE__ */ new Map();
- requestTokens = /* @__PURE__ */ new Map();
- knownCanceledRequests = /* @__PURE__ */ new Set();
- messageQueue = new linkedMap_1.LinkedMap();
- if (Is.func(messageWriter.dispose)) {
- messageWriter.dispose();
- }
- if (Is.func(messageReader.dispose)) {
- messageReader.dispose();
- }
- },
- listen: () => {
- throwIfClosedOrDisposed();
- throwIfListening();
- state = ConnectionState.Listening;
- messageReader.listen(callback);
- },
- inspect: () => {
- (0, ral_1.default)().console.log("inspect");
- }
- };
- connection.onNotification(LogTraceNotification.type, (params) => {
- if (trace === Trace.Off || !tracer) {
- return;
- }
- const verbose = trace === Trace.Verbose || trace === Trace.Compact;
- tracer.log(params.message, verbose ? params.verbose : void 0);
- });
- connection.onNotification(ProgressNotification.type, (params) => {
- const handler = progressHandlers.get(params.token);
- if (handler) {
- handler(params.value);
- } else {
- unhandledProgressEmitter.fire(params);
- }
- });
- return connection;
- }
- exports$1.createMessageConnection = createMessageConnection2;
- }
-});
-
-// node_modules/vscode-jsonrpc/lib/common/api.js
-var require_api = __commonJS({
- "node_modules/vscode-jsonrpc/lib/common/api.js"(exports$1) {
- Object.defineProperty(exports$1, "__esModule", { value: true });
- exports$1.ProgressType = exports$1.ProgressToken = exports$1.createMessageConnection = exports$1.NullLogger = exports$1.ConnectionOptions = exports$1.ConnectionStrategy = exports$1.AbstractMessageBuffer = exports$1.WriteableStreamMessageWriter = exports$1.AbstractMessageWriter = exports$1.MessageWriter = exports$1.ReadableStreamMessageReader = exports$1.AbstractMessageReader = exports$1.MessageReader = exports$1.SharedArrayReceiverStrategy = exports$1.SharedArraySenderStrategy = exports$1.CancellationToken = exports$1.CancellationTokenSource = exports$1.Emitter = exports$1.Event = exports$1.Disposable = exports$1.LRUCache = exports$1.Touch = exports$1.LinkedMap = exports$1.ParameterStructures = exports$1.NotificationType9 = exports$1.NotificationType8 = exports$1.NotificationType7 = exports$1.NotificationType6 = exports$1.NotificationType5 = exports$1.NotificationType4 = exports$1.NotificationType3 = exports$1.NotificationType2 = exports$1.NotificationType1 = exports$1.NotificationType0 = exports$1.NotificationType = exports$1.ErrorCodes = exports$1.ResponseError = exports$1.RequestType9 = exports$1.RequestType8 = exports$1.RequestType7 = exports$1.RequestType6 = exports$1.RequestType5 = exports$1.RequestType4 = exports$1.RequestType3 = exports$1.RequestType2 = exports$1.RequestType1 = exports$1.RequestType0 = exports$1.RequestType = exports$1.Message = exports$1.RAL = void 0;
- exports$1.MessageStrategy = exports$1.CancellationStrategy = exports$1.CancellationSenderStrategy = exports$1.CancellationReceiverStrategy = exports$1.ConnectionError = exports$1.ConnectionErrors = exports$1.LogTraceNotification = exports$1.SetTraceNotification = exports$1.TraceFormat = exports$1.TraceValues = exports$1.Trace = void 0;
- var messages_1 = require_messages();
- Object.defineProperty(exports$1, "Message", { enumerable: true, get: function() {
- return messages_1.Message;
- } });
- Object.defineProperty(exports$1, "RequestType", { enumerable: true, get: function() {
- return messages_1.RequestType;
- } });
- Object.defineProperty(exports$1, "RequestType0", { enumerable: true, get: function() {
- return messages_1.RequestType0;
- } });
- Object.defineProperty(exports$1, "RequestType1", { enumerable: true, get: function() {
- return messages_1.RequestType1;
- } });
- Object.defineProperty(exports$1, "RequestType2", { enumerable: true, get: function() {
- return messages_1.RequestType2;
- } });
- Object.defineProperty(exports$1, "RequestType3", { enumerable: true, get: function() {
- return messages_1.RequestType3;
- } });
- Object.defineProperty(exports$1, "RequestType4", { enumerable: true, get: function() {
- return messages_1.RequestType4;
- } });
- Object.defineProperty(exports$1, "RequestType5", { enumerable: true, get: function() {
- return messages_1.RequestType5;
- } });
- Object.defineProperty(exports$1, "RequestType6", { enumerable: true, get: function() {
- return messages_1.RequestType6;
- } });
- Object.defineProperty(exports$1, "RequestType7", { enumerable: true, get: function() {
- return messages_1.RequestType7;
- } });
- Object.defineProperty(exports$1, "RequestType8", { enumerable: true, get: function() {
- return messages_1.RequestType8;
- } });
- Object.defineProperty(exports$1, "RequestType9", { enumerable: true, get: function() {
- return messages_1.RequestType9;
- } });
- Object.defineProperty(exports$1, "ResponseError", { enumerable: true, get: function() {
- return messages_1.ResponseError;
- } });
- Object.defineProperty(exports$1, "ErrorCodes", { enumerable: true, get: function() {
- return messages_1.ErrorCodes;
- } });
- Object.defineProperty(exports$1, "NotificationType", { enumerable: true, get: function() {
- return messages_1.NotificationType;
- } });
- Object.defineProperty(exports$1, "NotificationType0", { enumerable: true, get: function() {
- return messages_1.NotificationType0;
- } });
- Object.defineProperty(exports$1, "NotificationType1", { enumerable: true, get: function() {
- return messages_1.NotificationType1;
- } });
- Object.defineProperty(exports$1, "NotificationType2", { enumerable: true, get: function() {
- return messages_1.NotificationType2;
- } });
- Object.defineProperty(exports$1, "NotificationType3", { enumerable: true, get: function() {
- return messages_1.NotificationType3;
- } });
- Object.defineProperty(exports$1, "NotificationType4", { enumerable: true, get: function() {
- return messages_1.NotificationType4;
- } });
- Object.defineProperty(exports$1, "NotificationType5", { enumerable: true, get: function() {
- return messages_1.NotificationType5;
- } });
- Object.defineProperty(exports$1, "NotificationType6", { enumerable: true, get: function() {
- return messages_1.NotificationType6;
- } });
- Object.defineProperty(exports$1, "NotificationType7", { enumerable: true, get: function() {
- return messages_1.NotificationType7;
- } });
- Object.defineProperty(exports$1, "NotificationType8", { enumerable: true, get: function() {
- return messages_1.NotificationType8;
- } });
- Object.defineProperty(exports$1, "NotificationType9", { enumerable: true, get: function() {
- return messages_1.NotificationType9;
- } });
- Object.defineProperty(exports$1, "ParameterStructures", { enumerable: true, get: function() {
- return messages_1.ParameterStructures;
- } });
- var linkedMap_1 = require_linkedMap();
- Object.defineProperty(exports$1, "LinkedMap", { enumerable: true, get: function() {
- return linkedMap_1.LinkedMap;
- } });
- Object.defineProperty(exports$1, "LRUCache", { enumerable: true, get: function() {
- return linkedMap_1.LRUCache;
- } });
- Object.defineProperty(exports$1, "Touch", { enumerable: true, get: function() {
- return linkedMap_1.Touch;
- } });
- var disposable_1 = require_disposable();
- Object.defineProperty(exports$1, "Disposable", { enumerable: true, get: function() {
- return disposable_1.Disposable;
- } });
- var events_1 = require_events();
- Object.defineProperty(exports$1, "Event", { enumerable: true, get: function() {
- return events_1.Event;
- } });
- Object.defineProperty(exports$1, "Emitter", { enumerable: true, get: function() {
- return events_1.Emitter;
- } });
- var cancellation_1 = require_cancellation();
- Object.defineProperty(exports$1, "CancellationTokenSource", { enumerable: true, get: function() {
- return cancellation_1.CancellationTokenSource;
- } });
- Object.defineProperty(exports$1, "CancellationToken", { enumerable: true, get: function() {
- return cancellation_1.CancellationToken;
- } });
- var sharedArrayCancellation_1 = require_sharedArrayCancellation();
- Object.defineProperty(exports$1, "SharedArraySenderStrategy", { enumerable: true, get: function() {
- return sharedArrayCancellation_1.SharedArraySenderStrategy;
- } });
- Object.defineProperty(exports$1, "SharedArrayReceiverStrategy", { enumerable: true, get: function() {
- return sharedArrayCancellation_1.SharedArrayReceiverStrategy;
- } });
- var messageReader_1 = require_messageReader();
- Object.defineProperty(exports$1, "MessageReader", { enumerable: true, get: function() {
- return messageReader_1.MessageReader;
- } });
- Object.defineProperty(exports$1, "AbstractMessageReader", { enumerable: true, get: function() {
- return messageReader_1.AbstractMessageReader;
- } });
- Object.defineProperty(exports$1, "ReadableStreamMessageReader", { enumerable: true, get: function() {
- return messageReader_1.ReadableStreamMessageReader;
- } });
- var messageWriter_1 = require_messageWriter();
- Object.defineProperty(exports$1, "MessageWriter", { enumerable: true, get: function() {
- return messageWriter_1.MessageWriter;
- } });
- Object.defineProperty(exports$1, "AbstractMessageWriter", { enumerable: true, get: function() {
- return messageWriter_1.AbstractMessageWriter;
- } });
- Object.defineProperty(exports$1, "WriteableStreamMessageWriter", { enumerable: true, get: function() {
- return messageWriter_1.WriteableStreamMessageWriter;
- } });
- var messageBuffer_1 = require_messageBuffer();
- Object.defineProperty(exports$1, "AbstractMessageBuffer", { enumerable: true, get: function() {
- return messageBuffer_1.AbstractMessageBuffer;
- } });
- var connection_1 = require_connection();
- Object.defineProperty(exports$1, "ConnectionStrategy", { enumerable: true, get: function() {
- return connection_1.ConnectionStrategy;
- } });
- Object.defineProperty(exports$1, "ConnectionOptions", { enumerable: true, get: function() {
- return connection_1.ConnectionOptions;
- } });
- Object.defineProperty(exports$1, "NullLogger", { enumerable: true, get: function() {
- return connection_1.NullLogger;
- } });
- Object.defineProperty(exports$1, "createMessageConnection", { enumerable: true, get: function() {
- return connection_1.createMessageConnection;
- } });
- Object.defineProperty(exports$1, "ProgressToken", { enumerable: true, get: function() {
- return connection_1.ProgressToken;
- } });
- Object.defineProperty(exports$1, "ProgressType", { enumerable: true, get: function() {
- return connection_1.ProgressType;
- } });
- Object.defineProperty(exports$1, "Trace", { enumerable: true, get: function() {
- return connection_1.Trace;
- } });
- Object.defineProperty(exports$1, "TraceValues", { enumerable: true, get: function() {
- return connection_1.TraceValues;
- } });
- Object.defineProperty(exports$1, "TraceFormat", { enumerable: true, get: function() {
- return connection_1.TraceFormat;
- } });
- Object.defineProperty(exports$1, "SetTraceNotification", { enumerable: true, get: function() {
- return connection_1.SetTraceNotification;
- } });
- Object.defineProperty(exports$1, "LogTraceNotification", { enumerable: true, get: function() {
- return connection_1.LogTraceNotification;
- } });
- Object.defineProperty(exports$1, "ConnectionErrors", { enumerable: true, get: function() {
- return connection_1.ConnectionErrors;
- } });
- Object.defineProperty(exports$1, "ConnectionError", { enumerable: true, get: function() {
- return connection_1.ConnectionError;
- } });
- Object.defineProperty(exports$1, "CancellationReceiverStrategy", { enumerable: true, get: function() {
- return connection_1.CancellationReceiverStrategy;
- } });
- Object.defineProperty(exports$1, "CancellationSenderStrategy", { enumerable: true, get: function() {
- return connection_1.CancellationSenderStrategy;
- } });
- Object.defineProperty(exports$1, "CancellationStrategy", { enumerable: true, get: function() {
- return connection_1.CancellationStrategy;
- } });
- Object.defineProperty(exports$1, "MessageStrategy", { enumerable: true, get: function() {
- return connection_1.MessageStrategy;
- } });
- var ral_1 = require_ral();
- exports$1.RAL = ral_1.default;
- }
-});
-
-// node_modules/vscode-jsonrpc/lib/node/ril.js
-var require_ril = __commonJS({
- "node_modules/vscode-jsonrpc/lib/node/ril.js"(exports$1) {
- Object.defineProperty(exports$1, "__esModule", { value: true });
- var util_1 = __require("util");
- var api_1 = require_api();
- var MessageBuffer = class _MessageBuffer extends api_1.AbstractMessageBuffer {
- constructor(encoding = "utf-8") {
- super(encoding);
- }
- emptyBuffer() {
- return _MessageBuffer.emptyBuffer;
- }
- fromString(value, encoding) {
- return Buffer.from(value, encoding);
- }
- toString(value, encoding) {
- if (value instanceof Buffer) {
- return value.toString(encoding);
- } else {
- return new util_1.TextDecoder(encoding).decode(value);
- }
- }
- asNative(buffer, length) {
- if (length === void 0) {
- return buffer instanceof Buffer ? buffer : Buffer.from(buffer);
- } else {
- return buffer instanceof Buffer ? buffer.slice(0, length) : Buffer.from(buffer, 0, length);
- }
- }
- allocNative(length) {
- return Buffer.allocUnsafe(length);
- }
- };
- MessageBuffer.emptyBuffer = Buffer.allocUnsafe(0);
- var ReadableStreamWrapper = class {
- constructor(stream) {
- this.stream = stream;
- }
- onClose(listener) {
- this.stream.on("close", listener);
- return api_1.Disposable.create(() => this.stream.off("close", listener));
- }
- onError(listener) {
- this.stream.on("error", listener);
- return api_1.Disposable.create(() => this.stream.off("error", listener));
- }
- onEnd(listener) {
- this.stream.on("end", listener);
- return api_1.Disposable.create(() => this.stream.off("end", listener));
- }
- onData(listener) {
- this.stream.on("data", listener);
- return api_1.Disposable.create(() => this.stream.off("data", listener));
- }
- };
- var WritableStreamWrapper = class {
- constructor(stream) {
- this.stream = stream;
- }
- onClose(listener) {
- this.stream.on("close", listener);
- return api_1.Disposable.create(() => this.stream.off("close", listener));
- }
- onError(listener) {
- this.stream.on("error", listener);
- return api_1.Disposable.create(() => this.stream.off("error", listener));
- }
- onEnd(listener) {
- this.stream.on("end", listener);
- return api_1.Disposable.create(() => this.stream.off("end", listener));
- }
- write(data, encoding) {
- return new Promise((resolve, reject) => {
- const callback = (error) => {
- if (error === void 0 || error === null) {
- resolve();
- } else {
- reject(error);
- }
- };
- if (typeof data === "string") {
- this.stream.write(data, encoding, callback);
- } else {
- this.stream.write(data, callback);
- }
- });
- }
- end() {
- this.stream.end();
- }
- };
- var _ril = Object.freeze({
- messageBuffer: Object.freeze({
- create: (encoding) => new MessageBuffer(encoding)
- }),
- applicationJson: Object.freeze({
- encoder: Object.freeze({
- name: "application/json",
- encode: (msg, options) => {
- try {
- return Promise.resolve(Buffer.from(JSON.stringify(msg, void 0, 0), options.charset));
- } catch (err) {
- return Promise.reject(err);
- }
- }
- }),
- decoder: Object.freeze({
- name: "application/json",
- decode: (buffer, options) => {
- try {
- if (buffer instanceof Buffer) {
- return Promise.resolve(JSON.parse(buffer.toString(options.charset)));
- } else {
- return Promise.resolve(JSON.parse(new util_1.TextDecoder(options.charset).decode(buffer)));
- }
- } catch (err) {
- return Promise.reject(err);
- }
- }
- })
- }),
- stream: Object.freeze({
- asReadableStream: (stream) => new ReadableStreamWrapper(stream),
- asWritableStream: (stream) => new WritableStreamWrapper(stream)
- }),
- console,
- timer: Object.freeze({
- setTimeout(callback, ms, ...args) {
- const handle = setTimeout(callback, ms, ...args);
- return { dispose: () => clearTimeout(handle) };
- },
- setImmediate(callback, ...args) {
- const handle = setImmediate(callback, ...args);
- return { dispose: () => clearImmediate(handle) };
- },
- setInterval(callback, ms, ...args) {
- const handle = setInterval(callback, ms, ...args);
- return { dispose: () => clearInterval(handle) };
- }
- })
- });
- function RIL() {
- return _ril;
- }
- (function(RIL2) {
- function install() {
- api_1.RAL.install(_ril);
- }
- RIL2.install = install;
- })(RIL || (RIL = {}));
- exports$1.default = RIL;
- }
-});
-
-// node_modules/vscode-jsonrpc/lib/node/main.js
-var require_main = __commonJS({
- "node_modules/vscode-jsonrpc/lib/node/main.js"(exports$1) {
- var __createBinding = exports$1 && exports$1.__createBinding || (Object.create ? (function(o, m, k, k2) {
- if (k2 === void 0) k2 = k;
- var desc = Object.getOwnPropertyDescriptor(m, k);
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
- desc = { enumerable: true, get: function() {
- return m[k];
- } };
- }
- Object.defineProperty(o, k2, desc);
- }) : (function(o, m, k, k2) {
- if (k2 === void 0) k2 = k;
- o[k2] = m[k];
- }));
- var __exportStar = exports$1 && exports$1.__exportStar || function(m, exports2) {
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) __createBinding(exports2, m, p);
- };
- Object.defineProperty(exports$1, "__esModule", { value: true });
- exports$1.createMessageConnection = exports$1.createServerSocketTransport = exports$1.createClientSocketTransport = exports$1.createServerPipeTransport = exports$1.createClientPipeTransport = exports$1.generateRandomPipeName = exports$1.StreamMessageWriter = exports$1.StreamMessageReader = exports$1.SocketMessageWriter = exports$1.SocketMessageReader = exports$1.PortMessageWriter = exports$1.PortMessageReader = exports$1.IPCMessageWriter = exports$1.IPCMessageReader = void 0;
- var ril_1 = require_ril();
- ril_1.default.install();
- var path = __require("path");
- var os = __require("os");
- var crypto_1 = __require("crypto");
- var net_1 = __require("net");
- var api_1 = require_api();
- __exportStar(require_api(), exports$1);
- var IPCMessageReader = class extends api_1.AbstractMessageReader {
- constructor(process2) {
- super();
- this.process = process2;
- let eventEmitter = this.process;
- eventEmitter.on("error", (error) => this.fireError(error));
- eventEmitter.on("close", () => this.fireClose());
- }
- listen(callback) {
- this.process.on("message", callback);
- return api_1.Disposable.create(() => this.process.off("message", callback));
- }
- };
- exports$1.IPCMessageReader = IPCMessageReader;
- var IPCMessageWriter = class extends api_1.AbstractMessageWriter {
- constructor(process2) {
- super();
- this.process = process2;
- this.errorCount = 0;
- const eventEmitter = this.process;
- eventEmitter.on("error", (error) => this.fireError(error));
- eventEmitter.on("close", () => this.fireClose);
- }
- write(msg) {
- try {
- if (typeof this.process.send === "function") {
- this.process.send(msg, void 0, void 0, (error) => {
- if (error) {
- this.errorCount++;
- this.handleError(error, msg);
- } else {
- this.errorCount = 0;
- }
- });
- }
- return Promise.resolve();
- } catch (error) {
- this.handleError(error, msg);
- return Promise.reject(error);
- }
- }
- handleError(error, msg) {
- this.errorCount++;
- this.fireError(error, msg, this.errorCount);
- }
- end() {
- }
- };
- exports$1.IPCMessageWriter = IPCMessageWriter;
- var PortMessageReader = class extends api_1.AbstractMessageReader {
- constructor(port) {
- super();
- this.onData = new api_1.Emitter();
- port.on("close", () => this.fireClose);
- port.on("error", (error) => this.fireError(error));
- port.on("message", (message) => {
- this.onData.fire(message);
- });
- }
- listen(callback) {
- return this.onData.event(callback);
- }
- };
- exports$1.PortMessageReader = PortMessageReader;
- var PortMessageWriter = class extends api_1.AbstractMessageWriter {
- constructor(port) {
- super();
- this.port = port;
- this.errorCount = 0;
- port.on("close", () => this.fireClose());
- port.on("error", (error) => this.fireError(error));
- }
- write(msg) {
- try {
- this.port.postMessage(msg);
- return Promise.resolve();
- } catch (error) {
- this.handleError(error, msg);
- return Promise.reject(error);
- }
- }
- handleError(error, msg) {
- this.errorCount++;
- this.fireError(error, msg, this.errorCount);
- }
- end() {
- }
- };
- exports$1.PortMessageWriter = PortMessageWriter;
- var SocketMessageReader = class extends api_1.ReadableStreamMessageReader {
- constructor(socket, encoding = "utf-8") {
- super((0, ril_1.default)().stream.asReadableStream(socket), encoding);
- }
- };
- exports$1.SocketMessageReader = SocketMessageReader;
- var SocketMessageWriter = class extends api_1.WriteableStreamMessageWriter {
- constructor(socket, options) {
- super((0, ril_1.default)().stream.asWritableStream(socket), options);
- this.socket = socket;
- }
- dispose() {
- super.dispose();
- this.socket.destroy();
- }
- };
- exports$1.SocketMessageWriter = SocketMessageWriter;
- var StreamMessageReader2 = class extends api_1.ReadableStreamMessageReader {
- constructor(readable, encoding) {
- super((0, ril_1.default)().stream.asReadableStream(readable), encoding);
- }
- };
- exports$1.StreamMessageReader = StreamMessageReader2;
- var StreamMessageWriter2 = class extends api_1.WriteableStreamMessageWriter {
- constructor(writable, options) {
- super((0, ril_1.default)().stream.asWritableStream(writable), options);
- }
- };
- exports$1.StreamMessageWriter = StreamMessageWriter2;
- var XDG_RUNTIME_DIR = process.env["XDG_RUNTIME_DIR"];
- var safeIpcPathLengths = /* @__PURE__ */ new Map([
- ["linux", 107],
- ["darwin", 103]
- ]);
- function generateRandomPipeName() {
- const randomSuffix = (0, crypto_1.randomBytes)(21).toString("hex");
- if (process.platform === "win32") {
- return `\\\\.\\pipe\\vscode-jsonrpc-${randomSuffix}-sock`;
- }
- let result;
- if (XDG_RUNTIME_DIR) {
- result = path.join(XDG_RUNTIME_DIR, `vscode-ipc-${randomSuffix}.sock`);
- } else {
- result = path.join(os.tmpdir(), `vscode-${randomSuffix}.sock`);
- }
- const limit = safeIpcPathLengths.get(process.platform);
- if (limit !== void 0 && result.length > limit) {
- (0, ril_1.default)().console.warn(`WARNING: IPC handle "${result}" is longer than ${limit} characters.`);
- }
- return result;
- }
- exports$1.generateRandomPipeName = generateRandomPipeName;
- function createClientPipeTransport(pipeName, encoding = "utf-8") {
- let connectResolve;
- const connected = new Promise((resolve, _reject) => {
- connectResolve = resolve;
- });
- return new Promise((resolve, reject) => {
- let server = (0, net_1.createServer)((socket) => {
- server.close();
- connectResolve([
- new SocketMessageReader(socket, encoding),
- new SocketMessageWriter(socket, encoding)
- ]);
- });
- server.on("error", reject);
- server.listen(pipeName, () => {
- server.removeListener("error", reject);
- resolve({
- onConnected: () => {
- return connected;
- }
- });
- });
- });
- }
- exports$1.createClientPipeTransport = createClientPipeTransport;
- function createServerPipeTransport(pipeName, encoding = "utf-8") {
- const socket = (0, net_1.createConnection)(pipeName);
- return [
- new SocketMessageReader(socket, encoding),
- new SocketMessageWriter(socket, encoding)
- ];
- }
- exports$1.createServerPipeTransport = createServerPipeTransport;
- function createClientSocketTransport(port, encoding = "utf-8") {
- let connectResolve;
- const connected = new Promise((resolve, _reject) => {
- connectResolve = resolve;
- });
- return new Promise((resolve, reject) => {
- const server = (0, net_1.createServer)((socket) => {
- server.close();
- connectResolve([
- new SocketMessageReader(socket, encoding),
- new SocketMessageWriter(socket, encoding)
- ]);
- });
- server.on("error", reject);
- server.listen(port, "127.0.0.1", () => {
- server.removeListener("error", reject);
- resolve({
- onConnected: () => {
- return connected;
- }
- });
- });
- });
- }
- exports$1.createClientSocketTransport = createClientSocketTransport;
- function createServerSocketTransport(port, encoding = "utf-8") {
- const socket = (0, net_1.createConnection)(port, "127.0.0.1");
- return [
- new SocketMessageReader(socket, encoding),
- new SocketMessageWriter(socket, encoding)
- ];
- }
- exports$1.createServerSocketTransport = createServerSocketTransport;
- function isReadableStream(value) {
- const candidate = value;
- return candidate.read !== void 0 && candidate.addListener !== void 0;
- }
- function isWritableStream(value) {
- const candidate = value;
- return candidate.write !== void 0 && candidate.addListener !== void 0;
- }
- function createMessageConnection2(input, output, logger, options) {
- if (!logger) {
- logger = api_1.NullLogger;
- }
- const reader = isReadableStream(input) ? new StreamMessageReader2(input) : input;
- const writer = isWritableStream(output) ? new StreamMessageWriter2(output) : output;
- if (api_1.ConnectionStrategy.is(options)) {
- options = { connectionStrategy: options };
- }
- return (0, api_1.createMessageConnection)(reader, writer, logger, options);
- }
- exports$1.createMessageConnection = createMessageConnection2;
- }
-});
-
-// node_modules/vscode-jsonrpc/node.js
-var require_node = __commonJS({
- "node_modules/vscode-jsonrpc/node.js"(exports$1, module) {
- module.exports = require_main();
- }
-});
-
-// node_modules/ms/index.js
-var require_ms = __commonJS({
- "node_modules/ms/index.js"(exports$1, module) {
- var s = 1e3;
- var m = s * 60;
- var h = m * 60;
- var d = h * 24;
- var w = d * 7;
- var y = d * 365.25;
- module.exports = function(val, options) {
- options = options || {};
- var type = typeof val;
- if (type === "string" && val.length > 0) {
- return parse(val);
- } else if (type === "number" && isFinite(val)) {
- return options.long ? fmtLong(val) : fmtShort(val);
- }
- throw new Error(
- "val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
- );
- };
- function parse(str) {
- str = String(str);
- if (str.length > 100) {
- return;
- }
- var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
- str
- );
- if (!match) {
- return;
- }
- var n = parseFloat(match[1]);
- var type = (match[2] || "ms").toLowerCase();
- switch (type) {
- case "years":
- case "year":
- case "yrs":
- case "yr":
- case "y":
- return n * y;
- case "weeks":
- case "week":
- case "w":
- return n * w;
- case "days":
- case "day":
- case "d":
- return n * d;
- case "hours":
- case "hour":
- case "hrs":
- case "hr":
- case "h":
- return n * h;
- case "minutes":
- case "minute":
- case "mins":
- case "min":
- case "m":
- return n * m;
- case "seconds":
- case "second":
- case "secs":
- case "sec":
- case "s":
- return n * s;
- case "milliseconds":
- case "millisecond":
- case "msecs":
- case "msec":
- case "ms":
- return n;
- default:
- return void 0;
- }
- }
- function fmtShort(ms) {
- var msAbs = Math.abs(ms);
- if (msAbs >= d) {
- return Math.round(ms / d) + "d";
- }
- if (msAbs >= h) {
- return Math.round(ms / h) + "h";
- }
- if (msAbs >= m) {
- return Math.round(ms / m) + "m";
- }
- if (msAbs >= s) {
- return Math.round(ms / s) + "s";
- }
- return ms + "ms";
- }
- function fmtLong(ms) {
- var msAbs = Math.abs(ms);
- if (msAbs >= d) {
- return plural(ms, msAbs, d, "day");
- }
- if (msAbs >= h) {
- return plural(ms, msAbs, h, "hour");
- }
- if (msAbs >= m) {
- return plural(ms, msAbs, m, "minute");
- }
- if (msAbs >= s) {
- return plural(ms, msAbs, s, "second");
- }
- return ms + " ms";
- }
- function plural(ms, msAbs, n, name) {
- var isPlural = msAbs >= n * 1.5;
- return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
- }
- }
-});
-
-// node_modules/debug/src/common.js
-var require_common = __commonJS({
- "node_modules/debug/src/common.js"(exports$1, module) {
- function setup(env) {
- createDebug.debug = createDebug;
- createDebug.default = createDebug;
- createDebug.coerce = coerce;
- createDebug.disable = disable;
- createDebug.enable = enable;
- createDebug.enabled = enabled;
- createDebug.humanize = require_ms();
- createDebug.destroy = destroy;
- Object.keys(env).forEach((key) => {
- createDebug[key] = env[key];
- });
- createDebug.names = [];
- createDebug.skips = [];
- createDebug.formatters = {};
- function selectColor(namespace) {
- let hash = 0;
- for (let i = 0; i < namespace.length; i++) {
- hash = (hash << 5) - hash + namespace.charCodeAt(i);
- hash |= 0;
- }
- return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
- }
- createDebug.selectColor = selectColor;
- function createDebug(namespace) {
- let prevTime;
- let enableOverride = null;
- let namespacesCache;
- let enabledCache;
- function debug2(...args) {
- if (!debug2.enabled) {
- return;
- }
- const self = debug2;
- const curr = Number(/* @__PURE__ */ new Date());
- const ms = curr - (prevTime || curr);
- self.diff = ms;
- self.prev = prevTime;
- self.curr = curr;
- prevTime = curr;
- args[0] = createDebug.coerce(args[0]);
- if (typeof args[0] !== "string") {
- args.unshift("%O");
- }
- let index = 0;
- args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
- if (match === "%%") {
- return "%";
- }
- index++;
- const formatter = createDebug.formatters[format];
- if (typeof formatter === "function") {
- const val = args[index];
- match = formatter.call(self, val);
- args.splice(index, 1);
- index--;
- }
- return match;
- });
- createDebug.formatArgs.call(self, args);
- const logFn = self.log || createDebug.log;
- logFn.apply(self, args);
- }
- debug2.namespace = namespace;
- debug2.useColors = createDebug.useColors();
- debug2.color = createDebug.selectColor(namespace);
- debug2.extend = extend;
- debug2.destroy = createDebug.destroy;
- Object.defineProperty(debug2, "enabled", {
- enumerable: true,
- configurable: false,
- get: () => {
- if (enableOverride !== null) {
- return enableOverride;
- }
- if (namespacesCache !== createDebug.namespaces) {
- namespacesCache = createDebug.namespaces;
- enabledCache = createDebug.enabled(namespace);
- }
- return enabledCache;
- },
- set: (v) => {
- enableOverride = v;
- }
- });
- if (typeof createDebug.init === "function") {
- createDebug.init(debug2);
- }
- return debug2;
- }
- function extend(namespace, delimiter) {
- const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
- newDebug.log = this.log;
- return newDebug;
- }
- function enable(namespaces) {
- createDebug.save(namespaces);
- createDebug.namespaces = namespaces;
- createDebug.names = [];
- createDebug.skips = [];
- const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean);
- for (const ns of split) {
- if (ns[0] === "-") {
- createDebug.skips.push(ns.slice(1));
- } else {
- createDebug.names.push(ns);
- }
- }
- }
- function matchesTemplate(search, template) {
- let searchIndex = 0;
- let templateIndex = 0;
- let starIndex = -1;
- let matchIndex = 0;
- while (searchIndex < search.length) {
- if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
- if (template[templateIndex] === "*") {
- starIndex = templateIndex;
- matchIndex = searchIndex;
- templateIndex++;
- } else {
- searchIndex++;
- templateIndex++;
- }
- } else if (starIndex !== -1) {
- templateIndex = starIndex + 1;
- matchIndex++;
- searchIndex = matchIndex;
- } else {
- return false;
- }
- }
- while (templateIndex < template.length && template[templateIndex] === "*") {
- templateIndex++;
- }
- return templateIndex === template.length;
- }
- function disable() {
- const namespaces = [
- ...createDebug.names,
- ...createDebug.skips.map((namespace) => "-" + namespace)
- ].join(",");
- createDebug.enable("");
- return namespaces;
- }
- function enabled(name) {
- for (const skip of createDebug.skips) {
- if (matchesTemplate(name, skip)) {
- return false;
- }
- }
- for (const ns of createDebug.names) {
- if (matchesTemplate(name, ns)) {
- return true;
- }
- }
- return false;
- }
- function coerce(val) {
- if (val instanceof Error) {
- return val.stack || val.message;
- }
- return val;
- }
- function destroy() {
- console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
- }
- createDebug.enable(createDebug.load());
- return createDebug;
- }
- module.exports = setup;
- }
-});
-
-// node_modules/debug/src/browser.js
-var require_browser = __commonJS({
- "node_modules/debug/src/browser.js"(exports$1, module) {
- exports$1.formatArgs = formatArgs;
- exports$1.save = save;
- exports$1.load = load;
- exports$1.useColors = useColors;
- exports$1.storage = localstorage();
- exports$1.destroy = /* @__PURE__ */ (() => {
- let warned = false;
- return () => {
- if (!warned) {
- warned = true;
- console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
- }
- };
- })();
- exports$1.colors = [
- "#0000CC",
- "#0000FF",
- "#0033CC",
- "#0033FF",
- "#0066CC",
- "#0066FF",
- "#0099CC",
- "#0099FF",
- "#00CC00",
- "#00CC33",
- "#00CC66",
- "#00CC99",
- "#00CCCC",
- "#00CCFF",
- "#3300CC",
- "#3300FF",
- "#3333CC",
- "#3333FF",
- "#3366CC",
- "#3366FF",
- "#3399CC",
- "#3399FF",
- "#33CC00",
- "#33CC33",
- "#33CC66",
- "#33CC99",
- "#33CCCC",
- "#33CCFF",
- "#6600CC",
- "#6600FF",
- "#6633CC",
- "#6633FF",
- "#66CC00",
- "#66CC33",
- "#9900CC",
- "#9900FF",
- "#9933CC",
- "#9933FF",
- "#99CC00",
- "#99CC33",
- "#CC0000",
- "#CC0033",
- "#CC0066",
- "#CC0099",
- "#CC00CC",
- "#CC00FF",
- "#CC3300",
- "#CC3333",
- "#CC3366",
- "#CC3399",
- "#CC33CC",
- "#CC33FF",
- "#CC6600",
- "#CC6633",
- "#CC9900",
- "#CC9933",
- "#CCCC00",
- "#CCCC33",
- "#FF0000",
- "#FF0033",
- "#FF0066",
- "#FF0099",
- "#FF00CC",
- "#FF00FF",
- "#FF3300",
- "#FF3333",
- "#FF3366",
- "#FF3399",
- "#FF33CC",
- "#FF33FF",
- "#FF6600",
- "#FF6633",
- "#FF9900",
- "#FF9933",
- "#FFCC00",
- "#FFCC33"
- ];
- function useColors() {
- if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
- return true;
- }
- if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
- return false;
- }
- let m;
- return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
- typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
- // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
- typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
- typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
- }
- function formatArgs(args) {
- args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module.exports.humanize(this.diff);
- if (!this.useColors) {
- return;
- }
- const c = "color: " + this.color;
- args.splice(1, 0, c, "color: inherit");
- let index = 0;
- let lastC = 0;
- args[0].replace(/%[a-zA-Z%]/g, (match) => {
- if (match === "%%") {
- return;
- }
- index++;
- if (match === "%c") {
- lastC = index;
- }
- });
- args.splice(lastC, 0, c);
- }
- exports$1.log = console.debug || console.log || (() => {
- });
- function save(namespaces) {
- try {
- if (namespaces) {
- exports$1.storage.setItem("debug", namespaces);
- } else {
- exports$1.storage.removeItem("debug");
- }
- } catch (error) {
- }
- }
- function load() {
- let r;
- try {
- r = exports$1.storage.getItem("debug") || exports$1.storage.getItem("DEBUG");
- } catch (error) {
- }
- if (!r && typeof process !== "undefined" && "env" in process) {
- r = process.env.DEBUG;
- }
- return r;
- }
- function localstorage() {
- try {
- return localStorage;
- } catch (error) {
- }
- }
- module.exports = require_common()(exports$1);
- var { formatters } = module.exports;
- formatters.j = function(v) {
- try {
- return JSON.stringify(v);
- } catch (error) {
- return "[UnexpectedJSONParseError]: " + error.message;
- }
- };
- }
-});
-
-// node_modules/debug/src/node.js
-var require_node2 = __commonJS({
- "node_modules/debug/src/node.js"(exports$1, module) {
- var tty = __require("tty");
- var util = __require("util");
- exports$1.init = init;
- exports$1.log = log;
- exports$1.formatArgs = formatArgs;
- exports$1.save = save;
- exports$1.load = load;
- exports$1.useColors = useColors;
- exports$1.destroy = util.deprecate(
- () => {
- },
- "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."
- );
- exports$1.colors = [6, 2, 3, 4, 5, 1];
- try {
- const supportsColor = __require("supports-color");
- if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
- exports$1.colors = [
- 20,
- 21,
- 26,
- 27,
- 32,
- 33,
- 38,
- 39,
- 40,
- 41,
- 42,
- 43,
- 44,
- 45,
- 56,
- 57,
- 62,
- 63,
- 68,
- 69,
- 74,
- 75,
- 76,
- 77,
- 78,
- 79,
- 80,
- 81,
- 92,
- 93,
- 98,
- 99,
- 112,
- 113,
- 128,
- 129,
- 134,
- 135,
- 148,
- 149,
- 160,
- 161,
- 162,
- 163,
- 164,
- 165,
- 166,
- 167,
- 168,
- 169,
- 170,
- 171,
- 172,
- 173,
- 178,
- 179,
- 184,
- 185,
- 196,
- 197,
- 198,
- 199,
- 200,
- 201,
- 202,
- 203,
- 204,
- 205,
- 206,
- 207,
- 208,
- 209,
- 214,
- 215,
- 220,
- 221
- ];
- }
- } catch (error) {
- }
- exports$1.inspectOpts = Object.keys(process.env).filter((key) => {
- return /^debug_/i.test(key);
- }).reduce((obj, key) => {
- const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => {
- return k.toUpperCase();
- });
- let val = process.env[key];
- if (/^(yes|on|true|enabled)$/i.test(val)) {
- val = true;
- } else if (/^(no|off|false|disabled)$/i.test(val)) {
- val = false;
- } else if (val === "null") {
- val = null;
- } else {
- val = Number(val);
- }
- obj[prop] = val;
- return obj;
- }, {});
- function useColors() {
- return "colors" in exports$1.inspectOpts ? Boolean(exports$1.inspectOpts.colors) : tty.isatty(process.stderr.fd);
- }
- function formatArgs(args) {
- const { namespace: name, useColors: useColors2 } = this;
- if (useColors2) {
- const c = this.color;
- const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c);
- const prefix = ` ${colorCode};1m${name} \x1B[0m`;
- args[0] = prefix + args[0].split("\n").join("\n" + prefix);
- args.push(colorCode + "m+" + module.exports.humanize(this.diff) + "\x1B[0m");
- } else {
- args[0] = getDate() + name + " " + args[0];
- }
- }
- function getDate() {
- if (exports$1.inspectOpts.hideDate) {
- return "";
- }
- return (/* @__PURE__ */ new Date()).toISOString() + " ";
- }
- function log(...args) {
- return process.stderr.write(util.formatWithOptions(exports$1.inspectOpts, ...args) + "\n");
- }
- function save(namespaces) {
- if (namespaces) {
- process.env.DEBUG = namespaces;
- } else {
- delete process.env.DEBUG;
- }
- }
- function load() {
- return process.env.DEBUG;
- }
- function init(debug2) {
- debug2.inspectOpts = {};
- const keys = Object.keys(exports$1.inspectOpts);
- for (let i = 0; i < keys.length; i++) {
- debug2.inspectOpts[keys[i]] = exports$1.inspectOpts[keys[i]];
- }
- }
- module.exports = require_common()(exports$1);
- var { formatters } = module.exports;
- formatters.o = function(v) {
- this.inspectOpts.colors = this.useColors;
- return util.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
- };
- formatters.O = function(v) {
- this.inspectOpts.colors = this.useColors;
- return util.inspect(v, this.inspectOpts);
- };
- }
-});
-
-// node_modules/debug/src/index.js
-var require_src = __commonJS({
- "node_modules/debug/src/index.js"(exports$1, module) {
- if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
- module.exports = require_browser();
- } else {
- module.exports = require_node2();
- }
- }
-});
-
-// node_modules/@github/copilot-sdk/dist/client.js
-var import_node = __toESM(require_node());
-
-// node_modules/@github/copilot-sdk/dist/sdkProtocolVersion.js
-var SDK_PROTOCOL_VERSION = 2;
-function getSdkProtocolVersion() {
- return SDK_PROTOCOL_VERSION;
-}
-
-// node_modules/@github/copilot-sdk/dist/session.js
-var CopilotSession = class {
- /**
- * Creates a new CopilotSession instance.
- *
- * @param sessionId - The unique identifier for this session
- * @param connection - The JSON-RPC message connection to the Copilot CLI
- * @param workspacePath - Path to the session workspace directory (when infinite sessions enabled)
- * @internal This constructor is internal. Use {@link CopilotClient.createSession} to create sessions.
- */
- constructor(sessionId, connection, _workspacePath) {
- this.sessionId = sessionId;
- this.connection = connection;
- this._workspacePath = _workspacePath;
- }
- eventHandlers = /* @__PURE__ */ new Set();
- typedEventHandlers = /* @__PURE__ */ new Map();
- toolHandlers = /* @__PURE__ */ new Map();
- permissionHandler;
- userInputHandler;
- hooks;
- /**
- * Path to the session workspace directory when infinite sessions are enabled.
- * Contains checkpoints/, plan.md, and files/ subdirectories.
- * Undefined if infinite sessions are disabled.
- */
- get workspacePath() {
- return this._workspacePath;
- }
- /**
- * Sends a message to this session and waits for the response.
- *
- * The message is processed asynchronously. Subscribe to events via {@link on}
- * to receive streaming responses and other session events.
- *
- * @param options - The message options including the prompt and optional attachments
- * @returns A promise that resolves with the message ID of the response
- * @throws Error if the session has been destroyed or the connection fails
- *
- * @example
- * ```typescript
- * const messageId = await session.send({
- * prompt: "Explain this code",
- * attachments: [{ type: "file", path: "./src/index.ts" }]
- * });
- * ```
- */
- async send(options) {
- const response = await this.connection.sendRequest("session.send", {
- sessionId: this.sessionId,
- prompt: options.prompt,
- attachments: options.attachments,
- mode: options.mode
- });
- return response.messageId;
- }
- /**
- * Sends a message to this session and waits until the session becomes idle.
- *
- * This is a convenience method that combines {@link send} with waiting for
- * the `session.idle` event. Use this when you want to block until the
- * assistant has finished processing the message.
- *
- * Events are still delivered to handlers registered via {@link on} while waiting.
- *
- * @param options - The message options including the prompt and optional attachments
- * @param timeout - Timeout in milliseconds (default: 60000). Controls how long to wait; does not abort in-flight agent work.
- * @returns A promise that resolves with the final assistant message when the session becomes idle,
- * or undefined if no assistant message was received
- * @throws Error if the timeout is reached before the session becomes idle
- * @throws Error if the session has been destroyed or the connection fails
- *
- * @example
- * ```typescript
- * // Send and wait for completion with default 60s timeout
- * const response = await session.sendAndWait({ prompt: "What is 2+2?" });
- * console.log(response?.data.content); // "4"
- * ```
- */
- async sendAndWait(options, timeout) {
- const effectiveTimeout = timeout ?? 6e4;
- let resolveIdle;
- let rejectWithError;
- const idlePromise = new Promise((resolve, reject) => {
- resolveIdle = resolve;
- rejectWithError = reject;
- });
- let lastAssistantMessage;
- const unsubscribe = this.on((event) => {
- if (event.type === "assistant.message") {
- lastAssistantMessage = event;
- } else if (event.type === "session.idle") {
- resolveIdle();
- } else if (event.type === "session.error") {
- const error = new Error(event.data.message);
- error.stack = event.data.stack;
- rejectWithError(error);
- }
- });
- let timeoutId;
- try {
- await this.send(options);
- const timeoutPromise = new Promise((_, reject) => {
- timeoutId = setTimeout(
- () => reject(
- new Error(
- `Timeout after ${effectiveTimeout}ms waiting for session.idle`
- )
- ),
- effectiveTimeout
- );
- });
- await Promise.race([idlePromise, timeoutPromise]);
- return lastAssistantMessage;
- } finally {
- if (timeoutId !== void 0) {
- clearTimeout(timeoutId);
- }
- unsubscribe();
- }
- }
- on(eventTypeOrHandler, handler) {
- if (typeof eventTypeOrHandler === "string" && handler) {
- const eventType = eventTypeOrHandler;
- if (!this.typedEventHandlers.has(eventType)) {
- this.typedEventHandlers.set(eventType, /* @__PURE__ */ new Set());
- }
- const storedHandler = handler;
- this.typedEventHandlers.get(eventType).add(storedHandler);
- return () => {
- const handlers = this.typedEventHandlers.get(eventType);
- if (handlers) {
- handlers.delete(storedHandler);
- }
- };
- }
- const wildcardHandler = eventTypeOrHandler;
- this.eventHandlers.add(wildcardHandler);
- return () => {
- this.eventHandlers.delete(wildcardHandler);
- };
- }
- /**
- * Dispatches an event to all registered handlers.
- *
- * @param event - The session event to dispatch
- * @internal This method is for internal use by the SDK.
- */
- _dispatchEvent(event) {
- const typedHandlers = this.typedEventHandlers.get(event.type);
- if (typedHandlers) {
- for (const handler of typedHandlers) {
- try {
- handler(event);
- } catch (_error) {
- }
- }
- }
- for (const handler of this.eventHandlers) {
- try {
- handler(event);
- } catch (_error) {
- }
- }
- }
- /**
- * Registers custom tool handlers for this session.
- *
- * Tools allow the assistant to execute custom functions. When the assistant
- * invokes a tool, the corresponding handler is called with the tool arguments.
- *
- * @param tools - An array of tool definitions with their handlers, or undefined to clear all tools
- * @internal This method is typically called internally when creating a session with tools.
- */
- registerTools(tools) {
- this.toolHandlers.clear();
- if (!tools) {
- return;
- }
- for (const tool of tools) {
- this.toolHandlers.set(tool.name, tool.handler);
- }
- }
- /**
- * Retrieves a registered tool handler by name.
- *
- * @param name - The name of the tool to retrieve
- * @returns The tool handler if found, or undefined
- * @internal This method is for internal use by the SDK.
- */
- getToolHandler(name) {
- return this.toolHandlers.get(name);
- }
- /**
- * Registers a handler for permission requests.
- *
- * When the assistant needs permission to perform certain actions (e.g., file operations),
- * this handler is called to approve or deny the request.
- *
- * @param handler - The permission handler function, or undefined to remove the handler
- * @internal This method is typically called internally when creating a session.
- */
- registerPermissionHandler(handler) {
- this.permissionHandler = handler;
- }
- /**
- * Registers a user input handler for ask_user requests.
- *
- * When the agent needs input from the user (via ask_user tool),
- * this handler is called to provide the response.
- *
- * @param handler - The user input handler function, or undefined to remove the handler
- * @internal This method is typically called internally when creating a session.
- */
- registerUserInputHandler(handler) {
- this.userInputHandler = handler;
- }
- /**
- * Registers hook handlers for session lifecycle events.
- *
- * Hooks allow custom logic to be executed at various points during
- * the session lifecycle (before/after tool use, session start/end, etc.).
- *
- * @param hooks - The hook handlers object, or undefined to remove all hooks
- * @internal This method is typically called internally when creating a session.
- */
- registerHooks(hooks) {
- this.hooks = hooks;
- }
- /**
- * Handles a permission request from the Copilot CLI.
- *
- * @param request - The permission request data from the CLI
- * @returns A promise that resolves with the permission decision
- * @internal This method is for internal use by the SDK.
- */
- async _handlePermissionRequest(request) {
- if (!this.permissionHandler) {
- return { kind: "denied-no-approval-rule-and-could-not-request-from-user" };
- }
- try {
- const result = await this.permissionHandler(request, {
- sessionId: this.sessionId
- });
- return result;
- } catch (_error) {
- return { kind: "denied-no-approval-rule-and-could-not-request-from-user" };
- }
- }
- /**
- * Handles a user input request from the Copilot CLI.
- *
- * @param request - The user input request data from the CLI
- * @returns A promise that resolves with the user's response
- * @internal This method is for internal use by the SDK.
- */
- async _handleUserInputRequest(request) {
- if (!this.userInputHandler) {
- throw new Error("User input requested but no handler registered");
- }
- try {
- const result = await this.userInputHandler(request, {
- sessionId: this.sessionId
- });
- return result;
- } catch (error) {
- throw error;
- }
- }
- /**
- * Handles a hooks invocation from the Copilot CLI.
- *
- * @param hookType - The type of hook being invoked
- * @param input - The input data for the hook
- * @returns A promise that resolves with the hook output, or undefined
- * @internal This method is for internal use by the SDK.
- */
- async _handleHooksInvoke(hookType, input) {
- if (!this.hooks) {
- return void 0;
- }
- const handlerMap = {
- preToolUse: this.hooks.onPreToolUse,
- postToolUse: this.hooks.onPostToolUse,
- userPromptSubmitted: this.hooks.onUserPromptSubmitted,
- sessionStart: this.hooks.onSessionStart,
- sessionEnd: this.hooks.onSessionEnd,
- errorOccurred: this.hooks.onErrorOccurred
- };
- const handler = handlerMap[hookType];
- if (!handler) {
- return void 0;
- }
- try {
- const result = await handler(input, { sessionId: this.sessionId });
- return result;
- } catch (_error) {
- return void 0;
- }
- }
- /**
- * Retrieves all events and messages from this session's history.
- *
- * This returns the complete conversation history including user messages,
- * assistant responses, tool executions, and other session events.
- *
- * @returns A promise that resolves with an array of all session events
- * @throws Error if the session has been destroyed or the connection fails
- *
- * @example
- * ```typescript
- * const events = await session.getMessages();
- * for (const event of events) {
- * if (event.type === "assistant.message") {
- * console.log("Assistant:", event.data.content);
- * }
- * }
- * ```
- */
- async getMessages() {
- const response = await this.connection.sendRequest("session.getMessages", {
- sessionId: this.sessionId
- });
- return response.events;
- }
- /**
- * Destroys this session and releases all associated resources.
- *
- * After calling this method, the session can no longer be used. All event
- * handlers and tool handlers are cleared. To continue the conversation,
- * use {@link CopilotClient.resumeSession} with the session ID.
- *
- * @returns A promise that resolves when the session is destroyed
- * @throws Error if the connection fails
- *
- * @example
- * ```typescript
- * // Clean up when done
- * await session.destroy();
- * ```
- */
- async destroy() {
- await this.connection.sendRequest("session.destroy", {
- sessionId: this.sessionId
- });
- this.eventHandlers.clear();
- this.typedEventHandlers.clear();
- this.toolHandlers.clear();
- this.permissionHandler = void 0;
- }
- /**
- * Aborts the currently processing message in this session.
- *
- * Use this to cancel a long-running request. The session remains valid
- * and can continue to be used for new messages.
- *
- * @returns A promise that resolves when the abort request is acknowledged
- * @throws Error if the session has been destroyed or the connection fails
- *
- * @example
- * ```typescript
- * // Start a long-running request
- * const messagePromise = session.send({ prompt: "Write a very long story..." });
- *
- * // Abort after 5 seconds
- * setTimeout(async () => {
- * await session.abort();
- * }, 5000);
- * ```
- */
- async abort() {
- await this.connection.sendRequest("session.abort", {
- sessionId: this.sessionId
- });
- }
-};
-
-// node_modules/@github/copilot-sdk/dist/client.js
-function isZodSchema(value) {
- return value != null && typeof value === "object" && "toJSONSchema" in value && typeof value.toJSONSchema === "function";
-}
-function toJsonSchema(parameters) {
- if (!parameters) return void 0;
- if (isZodSchema(parameters)) {
- return parameters.toJSONSchema();
- }
- return parameters;
-}
-function getBundledCliPath() {
- const sdkUrl = import.meta.resolve("@github/copilot/sdk");
- const sdkPath = fileURLToPath(sdkUrl);
- return join(dirname(dirname(sdkPath)), "index.js");
-}
-var CopilotClient = class {
- cliProcess = null;
- connection = null;
- socket = null;
- actualPort = null;
- actualHost = "localhost";
- state = "disconnected";
- sessions = /* @__PURE__ */ new Map();
- options;
- isExternalServer = false;
- forceStopping = false;
- modelsCache = null;
- modelsCacheLock = Promise.resolve();
- sessionLifecycleHandlers = /* @__PURE__ */ new Set();
- typedLifecycleHandlers = /* @__PURE__ */ new Map();
- /**
- * Creates a new CopilotClient instance.
- *
- * @param options - Configuration options for the client
- * @throws Error if mutually exclusive options are provided (e.g., cliUrl with useStdio or cliPath)
- *
- * @example
- * ```typescript
- * // Default options - spawns CLI server using stdio
- * const client = new CopilotClient();
- *
- * // Connect to an existing server
- * const client = new CopilotClient({ cliUrl: "localhost:3000" });
- *
- * // Custom CLI path with specific log level
- * const client = new CopilotClient({
- * cliPath: "/usr/local/bin/copilot",
- * logLevel: "debug"
- * });
- * ```
- */
- constructor(options = {}) {
- if (options.cliUrl && (options.useStdio === true || options.cliPath)) {
- throw new Error("cliUrl is mutually exclusive with useStdio and cliPath");
- }
- if (options.cliUrl && (options.githubToken || options.useLoggedInUser !== void 0)) {
- throw new Error(
- "githubToken and useLoggedInUser cannot be used with cliUrl (external server manages its own auth)"
- );
- }
- if (options.cliUrl) {
- const { host, port } = this.parseCliUrl(options.cliUrl);
- this.actualHost = host;
- this.actualPort = port;
- this.isExternalServer = true;
- }
- this.options = {
- cliPath: options.cliPath || getBundledCliPath(),
- cliArgs: options.cliArgs ?? [],
- cwd: options.cwd ?? process.cwd(),
- port: options.port || 0,
- useStdio: options.cliUrl ? false : options.useStdio ?? true,
- // Default to stdio unless cliUrl is provided
- cliUrl: options.cliUrl,
- logLevel: options.logLevel || "debug",
- autoStart: options.autoStart ?? true,
- autoRestart: options.autoRestart ?? true,
- env: options.env ?? process.env,
- githubToken: options.githubToken,
- // Default useLoggedInUser to false when githubToken is provided, otherwise true
- useLoggedInUser: options.useLoggedInUser ?? (options.githubToken ? false : true)
- };
- }
- /**
- * Parse CLI URL into host and port
- * Supports formats: "host:port", "http://host:port", "https://host:port", or just "port"
- */
- parseCliUrl(url) {
- let cleanUrl = url.replace(/^https?:\/\//, "");
- if (/^\d+$/.test(cleanUrl)) {
- return { host: "localhost", port: parseInt(cleanUrl, 10) };
- }
- const parts = cleanUrl.split(":");
- if (parts.length !== 2) {
- throw new Error(
- `Invalid cliUrl format: ${url}. Expected "host:port", "http://host:port", or "port"`
- );
- }
- const host = parts[0] || "localhost";
- const port = parseInt(parts[1], 10);
- if (isNaN(port) || port <= 0 || port > 65535) {
- throw new Error(`Invalid port in cliUrl: ${url}`);
- }
- return { host, port };
- }
- /**
- * Starts the CLI server and establishes a connection.
- *
- * If connecting to an external server (via cliUrl), only establishes the connection.
- * Otherwise, spawns the CLI server process and then connects.
- *
- * This method is called automatically when creating a session if `autoStart` is true (default).
- *
- * @returns A promise that resolves when the connection is established
- * @throws Error if the server fails to start or the connection fails
- *
- * @example
- * ```typescript
- * const client = new CopilotClient({ autoStart: false });
- * await client.start();
- * // Now ready to create sessions
- * ```
- */
- async start() {
- if (this.state === "connected") {
- return;
- }
- this.state = "connecting";
- try {
- if (!this.isExternalServer) {
- await this.startCLIServer();
- }
- await this.connectToServer();
- await this.verifyProtocolVersion();
- this.state = "connected";
- } catch (error) {
- this.state = "error";
- throw error;
- }
- }
- /**
- * Stops the CLI server and closes all active sessions.
- *
- * This method performs graceful cleanup:
- * 1. Destroys all active sessions with retry logic
- * 2. Closes the JSON-RPC connection
- * 3. Terminates the CLI server process (if spawned by this client)
- *
- * @returns A promise that resolves with an array of errors encountered during cleanup.
- * An empty array indicates all cleanup succeeded.
- *
- * @example
- * ```typescript
- * const errors = await client.stop();
- * if (errors.length > 0) {
- * console.error("Cleanup errors:", errors);
- * }
- * ```
- */
- async stop() {
- const errors = [];
- for (const session of this.sessions.values()) {
- const sessionId = session.sessionId;
- let lastError = null;
- for (let attempt = 1; attempt <= 3; attempt++) {
- try {
- await session.destroy();
- lastError = null;
- break;
- } catch (error) {
- lastError = error instanceof Error ? error : new Error(String(error));
- if (attempt < 3) {
- const delay = 100 * Math.pow(2, attempt - 1);
- await new Promise((resolve) => setTimeout(resolve, delay));
- }
- }
- }
- if (lastError) {
- errors.push(
- new Error(
- `Failed to destroy session ${sessionId} after 3 attempts: ${lastError.message}`
- )
- );
- }
- }
- this.sessions.clear();
- if (this.connection) {
- try {
- this.connection.dispose();
- } catch (error) {
- errors.push(
- new Error(
- `Failed to dispose connection: ${error instanceof Error ? error.message : String(error)}`
- )
- );
- }
- this.connection = null;
- }
- this.modelsCache = null;
- if (this.socket) {
- try {
- this.socket.end();
- } catch (error) {
- errors.push(
- new Error(
- `Failed to close socket: ${error instanceof Error ? error.message : String(error)}`
- )
- );
- }
- this.socket = null;
- }
- if (this.cliProcess && !this.isExternalServer) {
- try {
- this.cliProcess.kill();
- } catch (error) {
- errors.push(
- new Error(
- `Failed to kill CLI process: ${error instanceof Error ? error.message : String(error)}`
- )
- );
- }
- this.cliProcess = null;
- }
- this.state = "disconnected";
- this.actualPort = null;
- return errors;
- }
- /**
- * Forcefully stops the CLI server without graceful cleanup.
- *
- * Use this when {@link stop} fails or takes too long. This method:
- * - Clears all sessions immediately without destroying them
- * - Force closes the connection
- * - Sends SIGKILL to the CLI process (if spawned by this client)
- *
- * @returns A promise that resolves when the force stop is complete
- *
- * @example
- * ```typescript
- * // If normal stop hangs, force stop
- * const stopPromise = client.stop();
- * const timeout = new Promise((_, reject) =>
- * setTimeout(() => reject(new Error("Timeout")), 5000)
- * );
- *
- * try {
- * await Promise.race([stopPromise, timeout]);
- * } catch {
- * await client.forceStop();
- * }
- * ```
- */
- async forceStop() {
- this.forceStopping = true;
- this.sessions.clear();
- if (this.connection) {
- try {
- this.connection.dispose();
- } catch {
- }
- this.connection = null;
- }
- this.modelsCache = null;
- if (this.socket) {
- try {
- this.socket.destroy();
- } catch {
- }
- this.socket = null;
- }
- if (this.cliProcess && !this.isExternalServer) {
- try {
- this.cliProcess.kill("SIGKILL");
- } catch {
- }
- this.cliProcess = null;
- }
- this.state = "disconnected";
- this.actualPort = null;
- }
- /**
- * Creates a new conversation session with the Copilot CLI.
- *
- * Sessions maintain conversation state, handle events, and manage tool execution.
- * If the client is not connected and `autoStart` is enabled, this will automatically
- * start the connection.
- *
- * @param config - Optional configuration for the session
- * @returns A promise that resolves with the created session
- * @throws Error if the client is not connected and autoStart is disabled
- *
- * @example
- * ```typescript
- * // Basic session
- * const session = await client.createSession();
- *
- * // Session with model and tools
- * const session = await client.createSession({
- * model: "gpt-4",
- * tools: [{
- * name: "get_weather",
- * description: "Get weather for a location",
- * parameters: { type: "object", properties: { location: { type: "string" } } },
- * handler: async (args) => ({ temperature: 72 })
- * }]
- * });
- * ```
- */
- async createSession(config = {}) {
- if (!this.connection) {
- if (this.options.autoStart) {
- await this.start();
- } else {
- throw new Error("Client not connected. Call start() first.");
- }
- }
- const response = await this.connection.sendRequest("session.create", {
- model: config.model,
- sessionId: config.sessionId,
- reasoningEffort: config.reasoningEffort,
- tools: config.tools?.map((tool) => ({
- name: tool.name,
- description: tool.description,
- parameters: toJsonSchema(tool.parameters)
- })),
- systemMessage: config.systemMessage,
- availableTools: config.availableTools,
- excludedTools: config.excludedTools,
- provider: config.provider,
- requestPermission: !!config.onPermissionRequest,
- requestUserInput: !!config.onUserInputRequest,
- hooks: !!(config.hooks && Object.values(config.hooks).some(Boolean)),
- workingDirectory: config.workingDirectory,
- streaming: config.streaming,
- mcpServers: config.mcpServers,
- customAgents: config.customAgents,
- configDir: config.configDir,
- skillDirectories: config.skillDirectories,
- disabledSkills: config.disabledSkills,
- infiniteSessions: config.infiniteSessions
- });
- const { sessionId, workspacePath } = response;
- const session = new CopilotSession(sessionId, this.connection, workspacePath);
- session.registerTools(config.tools);
- if (config.onPermissionRequest) {
- session.registerPermissionHandler(config.onPermissionRequest);
- }
- if (config.onUserInputRequest) {
- session.registerUserInputHandler(config.onUserInputRequest);
- }
- if (config.hooks) {
- session.registerHooks(config.hooks);
- }
- this.sessions.set(sessionId, session);
- return session;
- }
- /**
- * Resumes an existing conversation session by its ID.
- *
- * This allows you to continue a previous conversation, maintaining all
- * conversation history. The session must have been previously created
- * and not deleted.
- *
- * @param sessionId - The ID of the session to resume
- * @param config - Optional configuration for the resumed session
- * @returns A promise that resolves with the resumed session
- * @throws Error if the session does not exist or the client is not connected
- *
- * @example
- * ```typescript
- * // Resume a previous session
- * const session = await client.resumeSession("session-123");
- *
- * // Resume with new tools
- * const session = await client.resumeSession("session-123", {
- * tools: [myNewTool]
- * });
- * ```
- */
- async resumeSession(sessionId, config = {}) {
- if (!this.connection) {
- if (this.options.autoStart) {
- await this.start();
- } else {
- throw new Error("Client not connected. Call start() first.");
- }
- }
- const response = await this.connection.sendRequest("session.resume", {
- sessionId,
- model: config.model,
- reasoningEffort: config.reasoningEffort,
- systemMessage: config.systemMessage,
- availableTools: config.availableTools,
- excludedTools: config.excludedTools,
- tools: config.tools?.map((tool) => ({
- name: tool.name,
- description: tool.description,
- parameters: toJsonSchema(tool.parameters)
- })),
- provider: config.provider,
- requestPermission: !!config.onPermissionRequest,
- requestUserInput: !!config.onUserInputRequest,
- hooks: !!(config.hooks && Object.values(config.hooks).some(Boolean)),
- workingDirectory: config.workingDirectory,
- configDir: config.configDir,
- streaming: config.streaming,
- mcpServers: config.mcpServers,
- customAgents: config.customAgents,
- skillDirectories: config.skillDirectories,
- disabledSkills: config.disabledSkills,
- infiniteSessions: config.infiniteSessions,
- disableResume: config.disableResume
- });
- const { sessionId: resumedSessionId, workspacePath } = response;
- const session = new CopilotSession(resumedSessionId, this.connection, workspacePath);
- session.registerTools(config.tools);
- if (config.onPermissionRequest) {
- session.registerPermissionHandler(config.onPermissionRequest);
- }
- if (config.onUserInputRequest) {
- session.registerUserInputHandler(config.onUserInputRequest);
- }
- if (config.hooks) {
- session.registerHooks(config.hooks);
- }
- this.sessions.set(resumedSessionId, session);
- return session;
- }
- /**
- * Gets the current connection state of the client.
- *
- * @returns The current connection state: "disconnected", "connecting", "connected", or "error"
- *
- * @example
- * ```typescript
- * if (client.getState() === "connected") {
- * const session = await client.createSession();
- * }
- * ```
- */
- getState() {
- return this.state;
- }
- /**
- * Sends a ping request to the server to verify connectivity.
- *
- * @param message - Optional message to include in the ping
- * @returns A promise that resolves with the ping response containing the message and timestamp
- * @throws Error if the client is not connected
- *
- * @example
- * ```typescript
- * const response = await client.ping("health check");
- * console.log(`Server responded at ${new Date(response.timestamp)}`);
- * ```
- */
- async ping(message) {
- if (!this.connection) {
- throw new Error("Client not connected");
- }
- const result = await this.connection.sendRequest("ping", { message });
- return result;
- }
- /**
- * Get CLI status including version and protocol information
- */
- async getStatus() {
- if (!this.connection) {
- throw new Error("Client not connected");
- }
- const result = await this.connection.sendRequest("status.get", {});
- return result;
- }
- /**
- * Get current authentication status
- */
- async getAuthStatus() {
- if (!this.connection) {
- throw new Error("Client not connected");
- }
- const result = await this.connection.sendRequest("auth.getStatus", {});
- return result;
- }
- /**
- * List available models with their metadata.
- *
- * Results are cached after the first successful call to avoid rate limiting.
- * The cache is cleared when the client disconnects.
- *
- * @throws Error if not authenticated
- */
- async listModels() {
- if (!this.connection) {
- throw new Error("Client not connected");
- }
- await this.modelsCacheLock;
- let resolveLock;
- this.modelsCacheLock = new Promise((resolve) => {
- resolveLock = resolve;
- });
- try {
- if (this.modelsCache !== null) {
- return [...this.modelsCache];
- }
- const result = await this.connection.sendRequest("models.list", {});
- const response = result;
- const models = response.models;
- this.modelsCache = models;
- return [...models];
- } finally {
- resolveLock();
- }
- }
- /**
- * Verify that the server's protocol version matches the SDK's expected version
- */
- async verifyProtocolVersion() {
- const expectedVersion = getSdkProtocolVersion();
- const pingResult = await this.ping();
- const serverVersion = pingResult.protocolVersion;
- if (serverVersion === void 0) {
- throw new Error(
- `SDK protocol version mismatch: SDK expects version ${expectedVersion}, but server does not report a protocol version. Please update your server to ensure compatibility.`
- );
- }
- if (serverVersion !== expectedVersion) {
- throw new Error(
- `SDK protocol version mismatch: SDK expects version ${expectedVersion}, but server reports version ${serverVersion}. Please update your SDK or server to ensure compatibility.`
- );
- }
- }
- /**
- * Gets the ID of the most recently updated session.
- *
- * This is useful for resuming the last conversation when the session ID
- * was not stored.
- *
- * @returns A promise that resolves with the session ID, or undefined if no sessions exist
- * @throws Error if the client is not connected
- *
- * @example
- * ```typescript
- * const lastId = await client.getLastSessionId();
- * if (lastId) {
- * const session = await client.resumeSession(lastId);
- * }
- * ```
- */
- async getLastSessionId() {
- if (!this.connection) {
- throw new Error("Client not connected");
- }
- const response = await this.connection.sendRequest("session.getLastId", {});
- return response.sessionId;
- }
- /**
- * Deletes a session and its data from disk.
- *
- * This permanently removes the session and all its conversation history.
- * The session cannot be resumed after deletion.
- *
- * @param sessionId - The ID of the session to delete
- * @returns A promise that resolves when the session is deleted
- * @throws Error if the session does not exist or deletion fails
- *
- * @example
- * ```typescript
- * await client.deleteSession("session-123");
- * ```
- */
- async deleteSession(sessionId) {
- if (!this.connection) {
- throw new Error("Client not connected");
- }
- const response = await this.connection.sendRequest("session.delete", {
- sessionId
- });
- const { success, error } = response;
- if (!success) {
- throw new Error(`Failed to delete session ${sessionId}: ${error || "Unknown error"}`);
- }
- this.sessions.delete(sessionId);
- }
- /**
- * Lists all available sessions known to the server.
- *
- * Returns metadata about each session including ID, timestamps, and summary.
- *
- * @returns A promise that resolves with an array of session metadata
- * @throws Error if the client is not connected
- *
- * @example
- * ```typescript
- * const sessions = await client.listSessions();
- * for (const session of sessions) {
- * console.log(`${session.sessionId}: ${session.summary}`);
- * }
- * ```
- */
- async listSessions() {
- if (!this.connection) {
- throw new Error("Client not connected");
- }
- const response = await this.connection.sendRequest("session.list", {});
- const { sessions } = response;
- return sessions.map((s) => ({
- sessionId: s.sessionId,
- startTime: new Date(s.startTime),
- modifiedTime: new Date(s.modifiedTime),
- summary: s.summary,
- isRemote: s.isRemote
- }));
- }
- /**
- * Gets the foreground session ID in TUI+server mode.
- *
- * This returns the ID of the session currently displayed in the TUI.
- * Only available when connecting to a server running in TUI+server mode (--ui-server).
- *
- * @returns A promise that resolves with the foreground session ID, or undefined if none
- * @throws Error if the client is not connected
- *
- * @example
- * ```typescript
- * const sessionId = await client.getForegroundSessionId();
- * if (sessionId) {
- * console.log(`TUI is displaying session: ${sessionId}`);
- * }
- * ```
- */
- async getForegroundSessionId() {
- if (!this.connection) {
- throw new Error("Client not connected");
- }
- const response = await this.connection.sendRequest("session.getForeground", {});
- return response.sessionId;
- }
- /**
- * Sets the foreground session in TUI+server mode.
- *
- * This requests the TUI to switch to displaying the specified session.
- * Only available when connecting to a server running in TUI+server mode (--ui-server).
- *
- * @param sessionId - The ID of the session to display in the TUI
- * @returns A promise that resolves when the session is switched
- * @throws Error if the client is not connected or if the operation fails
- *
- * @example
- * ```typescript
- * // Switch the TUI to display a specific session
- * await client.setForegroundSessionId("session-123");
- * ```
- */
- async setForegroundSessionId(sessionId) {
- if (!this.connection) {
- throw new Error("Client not connected");
- }
- const response = await this.connection.sendRequest("session.setForeground", { sessionId });
- const result = response;
- if (!result.success) {
- throw new Error(result.error || "Failed to set foreground session");
- }
- }
- on(eventTypeOrHandler, handler) {
- if (typeof eventTypeOrHandler === "string" && handler) {
- const eventType = eventTypeOrHandler;
- if (!this.typedLifecycleHandlers.has(eventType)) {
- this.typedLifecycleHandlers.set(eventType, /* @__PURE__ */ new Set());
- }
- const storedHandler = handler;
- this.typedLifecycleHandlers.get(eventType).add(storedHandler);
- return () => {
- const handlers = this.typedLifecycleHandlers.get(eventType);
- if (handlers) {
- handlers.delete(storedHandler);
- }
- };
- }
- const wildcardHandler = eventTypeOrHandler;
- this.sessionLifecycleHandlers.add(wildcardHandler);
- return () => {
- this.sessionLifecycleHandlers.delete(wildcardHandler);
- };
- }
- /**
- * Start the CLI server process
- */
- async startCLIServer() {
- return new Promise((resolve, reject) => {
- const args = [
- ...this.options.cliArgs,
- "--headless",
- "--no-auto-update",
- "--log-level",
- this.options.logLevel
- ];
- if (this.options.useStdio) {
- args.push("--stdio");
- } else if (this.options.port > 0) {
- args.push("--port", this.options.port.toString());
- }
- if (this.options.githubToken) {
- args.push("--auth-token-env", "COPILOT_SDK_AUTH_TOKEN");
- }
- if (!this.options.useLoggedInUser) {
- args.push("--no-auto-login");
- }
- const envWithoutNodeDebug = { ...this.options.env };
- delete envWithoutNodeDebug.NODE_DEBUG;
- if (this.options.githubToken) {
- envWithoutNodeDebug.COPILOT_SDK_AUTH_TOKEN = this.options.githubToken;
- }
- if (!existsSync(this.options.cliPath)) {
- throw new Error(
- `Copilot CLI not found at ${this.options.cliPath}. Ensure @github/copilot is installed.`
- );
- }
- const stdioConfig = this.options.useStdio ? ["pipe", "pipe", "pipe"] : ["ignore", "pipe", "pipe"];
- const isJsFile = this.options.cliPath.endsWith(".js");
- if (isJsFile) {
- this.cliProcess = spawn(process.execPath, [this.options.cliPath, ...args], {
- stdio: stdioConfig,
- cwd: this.options.cwd,
- env: envWithoutNodeDebug
- });
- } else {
- this.cliProcess = spawn(this.options.cliPath, args, {
- stdio: stdioConfig,
- cwd: this.options.cwd,
- env: envWithoutNodeDebug
- });
- }
- let stdout = "";
- let resolved = false;
- if (this.options.useStdio) {
- resolved = true;
- resolve();
- } else {
- this.cliProcess.stdout?.on("data", (data) => {
- stdout += data.toString();
- const match = stdout.match(/listening on port (\d+)/i);
- if (match && !resolved) {
- this.actualPort = parseInt(match[1], 10);
- resolved = true;
- resolve();
- }
- });
- }
- this.cliProcess.stderr?.on("data", (data) => {
- const lines = data.toString().split("\n");
- for (const line of lines) {
- if (line.trim()) {
- process.stderr.write(`[CLI subprocess] ${line}
-`);
- }
- }
- });
- this.cliProcess.on("error", (error) => {
- if (!resolved) {
- resolved = true;
- reject(new Error(`Failed to start CLI server: ${error.message}`));
- }
- });
- this.cliProcess.on("exit", (code) => {
- if (!resolved) {
- resolved = true;
- reject(new Error(`CLI server exited with code ${code}`));
- } else if (this.options.autoRestart && this.state === "connected") {
- void this.reconnect();
- }
- });
- setTimeout(() => {
- if (!resolved) {
- resolved = true;
- reject(new Error("Timeout waiting for CLI server to start"));
- }
- }, 1e4);
- });
- }
- /**
- * Connect to the CLI server (via socket or stdio)
- */
- async connectToServer() {
- if (this.options.useStdio) {
- return this.connectViaStdio();
- } else {
- return this.connectViaTcp();
- }
- }
- /**
- * Connect via stdio pipes
- */
- async connectViaStdio() {
- if (!this.cliProcess) {
- throw new Error("CLI process not started");
- }
- this.cliProcess.stdin?.on("error", (err) => {
- if (!this.forceStopping) {
- throw err;
- }
- });
- this.connection = (0, import_node.createMessageConnection)(
- new import_node.StreamMessageReader(this.cliProcess.stdout),
- new import_node.StreamMessageWriter(this.cliProcess.stdin)
- );
- this.attachConnectionHandlers();
- this.connection.listen();
- }
- /**
- * Connect to the CLI server via TCP socket
- */
- async connectViaTcp() {
- if (!this.actualPort) {
- throw new Error("Server port not available");
- }
- return new Promise((resolve, reject) => {
- this.socket = new Socket();
- this.socket.connect(this.actualPort, this.actualHost, () => {
- this.connection = (0, import_node.createMessageConnection)(
- new import_node.StreamMessageReader(this.socket),
- new import_node.StreamMessageWriter(this.socket)
- );
- this.attachConnectionHandlers();
- this.connection.listen();
- resolve();
- });
- this.socket.on("error", (error) => {
- reject(new Error(`Failed to connect to CLI server: ${error.message}`));
- });
- });
- }
- attachConnectionHandlers() {
- if (!this.connection) {
- return;
- }
- this.connection.onNotification("session.event", (notification) => {
- this.handleSessionEventNotification(notification);
- });
- this.connection.onNotification("session.lifecycle", (notification) => {
- this.handleSessionLifecycleNotification(notification);
- });
- this.connection.onRequest(
- "tool.call",
- async (params) => await this.handleToolCallRequest(params)
- );
- this.connection.onRequest(
- "permission.request",
- async (params) => await this.handlePermissionRequest(params)
- );
- this.connection.onRequest(
- "userInput.request",
- async (params) => await this.handleUserInputRequest(params)
- );
- this.connection.onRequest(
- "hooks.invoke",
- async (params) => await this.handleHooksInvoke(params)
- );
- this.connection.onClose(() => {
- if (this.state === "connected" && this.options.autoRestart) {
- void this.reconnect();
- }
- });
- this.connection.onError((_error) => {
- });
- }
- handleSessionEventNotification(notification) {
- if (typeof notification !== "object" || !notification || !("sessionId" in notification) || typeof notification.sessionId !== "string" || !("event" in notification)) {
- return;
- }
- const session = this.sessions.get(notification.sessionId);
- if (session) {
- session._dispatchEvent(notification.event);
- }
- }
- handleSessionLifecycleNotification(notification) {
- if (typeof notification !== "object" || !notification || !("type" in notification) || typeof notification.type !== "string" || !("sessionId" in notification) || typeof notification.sessionId !== "string") {
- return;
- }
- const event = notification;
- const typedHandlers = this.typedLifecycleHandlers.get(event.type);
- if (typedHandlers) {
- for (const handler of typedHandlers) {
- try {
- handler(event);
- } catch {
- }
- }
- }
- for (const handler of this.sessionLifecycleHandlers) {
- try {
- handler(event);
- } catch {
- }
- }
- }
- async handleToolCallRequest(params) {
- if (!params || typeof params.sessionId !== "string" || typeof params.toolCallId !== "string" || typeof params.toolName !== "string") {
- throw new Error("Invalid tool call payload");
- }
- const session = this.sessions.get(params.sessionId);
- if (!session) {
- throw new Error(`Unknown session ${params.sessionId}`);
- }
- const handler = session.getToolHandler(params.toolName);
- if (!handler) {
- return { result: this.buildUnsupportedToolResult(params.toolName) };
- }
- return await this.executeToolCall(handler, params);
- }
- async executeToolCall(handler, request) {
- try {
- const invocation = {
- sessionId: request.sessionId,
- toolCallId: request.toolCallId,
- toolName: request.toolName,
- arguments: request.arguments
- };
- const result = await handler(request.arguments, invocation);
- return { result: this.normalizeToolResult(result) };
- } catch (error) {
- const message = error instanceof Error ? error.message : String(error);
- return {
- result: {
- // Don't expose detailed error information to the LLM for security reasons
- textResultForLlm: "Invoking this tool produced an error. Detailed information is not available.",
- resultType: "failure",
- error: message,
- toolTelemetry: {}
- }
- };
- }
- }
- async handlePermissionRequest(params) {
- if (!params || typeof params.sessionId !== "string" || !params.permissionRequest) {
- throw new Error("Invalid permission request payload");
- }
- const session = this.sessions.get(params.sessionId);
- if (!session) {
- throw new Error(`Session not found: ${params.sessionId}`);
- }
- try {
- const result = await session._handlePermissionRequest(params.permissionRequest);
- return { result };
- } catch (_error) {
- return {
- result: {
- kind: "denied-no-approval-rule-and-could-not-request-from-user"
- }
- };
- }
- }
- async handleUserInputRequest(params) {
- if (!params || typeof params.sessionId !== "string" || typeof params.question !== "string") {
- throw new Error("Invalid user input request payload");
- }
- const session = this.sessions.get(params.sessionId);
- if (!session) {
- throw new Error(`Session not found: ${params.sessionId}`);
- }
- const result = await session._handleUserInputRequest({
- question: params.question,
- choices: params.choices,
- allowFreeform: params.allowFreeform
- });
- return result;
- }
- async handleHooksInvoke(params) {
- if (!params || typeof params.sessionId !== "string" || typeof params.hookType !== "string") {
- throw new Error("Invalid hooks invoke payload");
- }
- const session = this.sessions.get(params.sessionId);
- if (!session) {
- throw new Error(`Session not found: ${params.sessionId}`);
- }
- const output = await session._handleHooksInvoke(params.hookType, params.input);
- return { output };
- }
- normalizeToolResult(result) {
- if (result === void 0 || result === null) {
- return {
- textResultForLlm: "Tool returned no result",
- resultType: "failure",
- error: "tool returned no result",
- toolTelemetry: {}
- };
- }
- if (this.isToolResultObject(result)) {
- return result;
- }
- const textResult = typeof result === "string" ? result : JSON.stringify(result);
- return {
- textResultForLlm: textResult,
- resultType: "success",
- toolTelemetry: {}
- };
- }
- isToolResultObject(value) {
- return typeof value === "object" && value !== null && "textResultForLlm" in value && typeof value.textResultForLlm === "string" && "resultType" in value;
- }
- buildUnsupportedToolResult(toolName) {
- return {
- textResultForLlm: `Tool '${toolName}' is not supported by this client instance.`,
- resultType: "failure",
- error: `tool '${toolName}' not supported`,
- toolTelemetry: {}
- };
- }
- /**
- * Attempt to reconnect to the server
- */
- async reconnect() {
- this.state = "disconnected";
- try {
- await this.stop();
- await this.start();
- } catch (_error) {
- }
- }
-};
-
-// src/index.ts
-var import_debug = __toESM(require_src());
-var debug = (0, import_debug.default)("copilot-client");
-async function runCopilotSession(config) {
- debug("Starting Copilot session with config:", config);
- mkdirSync(dirname(config.eventLogFile), { recursive: true });
- const logEvent = (type, data, sessionId) => {
- const event = {
- timestamp: (/* @__PURE__ */ new Date()).toISOString(),
- type,
- sessionId,
- data
- };
- appendFileSync(config.eventLogFile, JSON.stringify(event) + "\n", "utf-8");
- debug("Event logged:", type);
- };
- debug("Loading prompt from:", config.promptFile);
- const prompt = readFileSync(config.promptFile, "utf-8");
- logEvent("prompt.loaded", { file: config.promptFile, length: prompt.length });
- debug("Creating Copilot client");
- const clientOptions = {
- logLevel: config.logLevel ?? "info",
- githubToken: config.githubToken,
- useLoggedInUser: config.useLoggedInUser
- };
- if (config.cliUrl) {
- clientOptions.cliUrl = config.cliUrl;
- } else {
- clientOptions.cliPath = config.cliPath;
- clientOptions.cliArgs = config.cliArgs;
- clientOptions.port = config.port;
- clientOptions.useStdio = config.useStdio ?? true;
- clientOptions.autoStart = config.autoStart ?? true;
- clientOptions.autoRestart = config.autoRestart ?? true;
- }
- const client = new CopilotClient(clientOptions);
- logEvent("client.created", {
- cliPath: config.cliPath,
- useStdio: config.useStdio,
- logLevel: config.logLevel
- });
- debug("Starting Copilot client");
- await client.start();
- logEvent("client.started", {});
- let session = null;
- try {
- debug("Creating Copilot session");
- session = await client.createSession({
- model: config.session?.model,
- reasoningEffort: config.session?.reasoningEffort,
- systemMessage: config.session?.systemMessage ? {
- mode: "replace",
- content: config.session.systemMessage
- } : void 0,
- mcpServers: config.session?.mcpServers
- });
- logEvent("session.created", {
- sessionId: session.sessionId,
- model: config.session?.model
- }, session.sessionId);
- debug("Setting up event handlers");
- session.on((event) => {
- logEvent(`session.${event.type}`, event.data, session.sessionId);
- debug("Session event:", event.type, event.data);
- });
- const done = new Promise((resolve, reject) => {
- let lastAssistantMessage = null;
- session.on("assistant.message", (event) => {
- lastAssistantMessage = event.data;
- debug("Assistant message:", event.data.content);
- });
- session.on("session.idle", () => {
- debug("Session became idle");
- resolve();
- });
- session.on("session.error", (event) => {
- debug("Session error:", event.data);
- reject(new Error(event.data.message || "Session error"));
- });
- });
- debug("Sending prompt");
- await session.send({ prompt });
- logEvent("prompt.sent", { prompt }, session.sessionId);
- debug("Waiting for session to complete");
- await done;
- debug("Session completed successfully");
- logEvent("session.completed", {}, session.sessionId);
- } catch (error) {
- const errorMessage = error instanceof Error ? error.message : String(error);
- debug("Error during session:", errorMessage);
- logEvent("session.error", { error: errorMessage }, session?.sessionId);
- throw error;
- } finally {
- if (session) {
- debug("Destroying session");
- try {
- await session.destroy();
- logEvent("session.destroyed", {}, session.sessionId);
- } catch (error) {
- debug("Error destroying session:", error);
- }
- }
- debug("Stopping client");
- try {
- const errors = await client.stop();
- if (errors.length > 0) {
- debug("Errors during client stop:", errors);
- logEvent("client.stopped", { errors: errors.map((e) => e.message) });
- } else {
- logEvent("client.stopped", {});
- }
- } catch (error) {
- debug("Error stopping client:", error);
- }
- }
-}
-async function main() {
- debug("Reading configuration from GH_AW_COPILOT_CONFIG environment variable");
- const configJson = process.env.GH_AW_COPILOT_CONFIG;
- if (!configJson) {
- console.error("Error: GH_AW_COPILOT_CONFIG environment variable is not set");
- console.error("Please set the GH_AW_COPILOT_CONFIG environment variable with JSON configuration");
- process.exit(1);
- }
- let config;
- try {
- config = JSON.parse(configJson);
- } catch (error) {
- console.error("Failed to parse configuration JSON:", error);
- process.exit(1);
- }
- debug("Parsed config:", config);
- try {
- await runCopilotSession(config);
- debug("Session completed successfully");
- process.exit(0);
- } catch (error) {
- console.error("Error running Copilot session:", error);
- process.exit(1);
- }
-}
-
-export { main, runCopilotSession };
-//# sourceMappingURL=index.js.map
-//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/cmd/gh-aw/main_entry_test.go b/cmd/gh-aw/main_entry_test.go
index 99cd696430..7d99c5d649 100644
--- a/cmd/gh-aw/main_entry_test.go
+++ b/cmd/gh-aw/main_entry_test.go
@@ -40,11 +40,6 @@ func TestValidateEngine(t *testing.T) {
engine: "copilot",
expectErr: false,
},
- {
- name: "valid copilot-sdk engine",
- engine: "copilot-sdk",
- expectErr: false,
- },
{
name: "valid custom engine",
engine: "custom",
@@ -94,7 +89,7 @@ func TestValidateEngine(t *testing.T) {
// Check that error message contains the expected format
// Error may include "Did you mean" suggestions, so we check if it starts with the base message
- expectedMsg := fmt.Sprintf("invalid engine value '%s'. Must be 'claude', 'codex', 'copilot', 'copilot-sdk', or 'custom'", tt.engine)
+ expectedMsg := fmt.Sprintf("invalid engine value '%s'. Must be 'claude', 'codex', 'copilot', or 'custom'", tt.engine)
if tt.errMessage != "" && !strings.HasPrefix(err.Error(), expectedMsg) {
t.Errorf("validateEngine(%q) error message = %v, want to start with %v", tt.engine, err.Error(), expectedMsg)
}
diff --git a/copilot-client/.gitignore b/copilot-client/.gitignore
deleted file mode 100644
index 31a084d742..0000000000
--- a/copilot-client/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-node_modules/
-dist/
-test-output/
-*.log
-.DS_Store
diff --git a/copilot-client/README.md b/copilot-client/README.md
deleted file mode 100644
index 098e57a23d..0000000000
--- a/copilot-client/README.md
+++ /dev/null
@@ -1,144 +0,0 @@
-# Copilot SDK Client
-
-TypeScript client for running GitHub Copilot agentic sessions using the `@github/copilot-sdk` Node.js package.
-
-## Features
-
-- ES6 JavaScript with TypeScript annotations
-- Async/await for Node 24
-- ESM module format
-- Fully bundled with all dependencies included
-- JSONL event logging with timestamps
-- Debug package for logging
-- Configuration from stdin for testability
-
-## Building
-
-```bash
-npm install
-npm run build
-```
-
-The build uses [tsup](https://tsup.egoist.dev/) to bundle the TypeScript source into a single ESM JavaScript file targeting Node 24 (ES2024). All dependencies are bundled into the output. The compiled output will be in the `dist/` directory:
-
-- `dist/index.js` - Main library entry point (fully bundled, ~190KB)
-- `dist/index.d.ts` - TypeScript type declarations
-
-## Usage
-
-Create a configuration file and pipe it to the client:
-
-```bash
-echo '{
- "promptFile": "/path/to/prompt.txt",
- "eventLogFile": "/tmp/events.jsonl",
- "githubToken": "ghp_...",
- "session": {
- "model": "gpt-5"
- }
-}' | node dist/cli.js
-```
-
-## Configuration
-
-The client accepts a JSON configuration object with the following properties:
-
-- `promptFile` (required): Path to the file containing the prompt
-- `eventLogFile` (required): Path where events will be logged in JSONL format
-- `githubToken` (optional): GitHub token for authentication
-- `cliPath` (optional): Path to copilot CLI executable (mutually exclusive with `cliUrl`)
-- `cliUrl` (optional): URL of existing CLI server (mutually exclusive with `cliPath`/`useStdio`)
-- `useStdio` (optional): Use stdio transport instead of TCP (default: true, mutually exclusive with `cliUrl`)
-- `session` (optional): Session configuration
- - `model` (optional): Model to use (e.g., "gpt-5", "claude-sonnet-4.5")
- - `reasoningEffort` (optional): "low" | "medium" | "high" | "xhigh"
- - `systemMessage` (optional): Custom system message
- - `mcpServers` (optional): MCP server configurations (see example below)
-
-### MCP Server Configuration
-
-You can configure MCP servers to provide additional tools to the Copilot session:
-
-```json
-{
- "promptFile": "/path/to/prompt.txt",
- "eventLogFile": "/tmp/events.jsonl",
- "session": {
- "model": "gpt-5",
- "mcpServers": {
- "myserver": {
- "type": "http",
- "url": "https://example.com/mcp",
- "tools": ["*"],
- "headers": {
- "Authorization": "Bearer token"
- }
- },
- "localserver": {
- "type": "local",
- "command": "/path/to/server",
- "args": ["--port", "8080"],
- "tools": ["tool1", "tool2"],
- "env": {
- "API_KEY": "secret"
- }
- }
- }
- }
-}
-```
-
-**Note:** When using `cliUrl` to connect to an existing server, do not specify `cliPath`, `useStdio`, `autoStart`, or `autoRestart`. These options are mutually exclusive.
-
-## Testing
-
-```bash
-npm test
-```
-
-Integration tests require `COPILOT_GITHUB_TOKEN` environment variable.
-
-### Running Tests Locally
-
-The copilot-client includes a test script that can be run locally:
-
-```bash
-# Set your GitHub token
-export COPILOT_GITHUB_TOKEN=ghp_your_token_here
-
-# Run the local test script
-cd copilot-client
-./test-local.sh
-```
-
-This script:
-1. Builds the copilot-client
-2. Creates a test prompt
-3. Runs the client with the copilot CLI
-4. Verifies event logging
-
-You can also run tests through Make:
-
-```bash
-cd ..
-make test-copilot-client
-```
-
-## Debugging
-
-Enable debug logging:
-
-```bash
-DEBUG=copilot-client npm run build
-DEBUG=copilot-client node dist/cli.js < config.json
-```
-
-## Event Logging
-
-All events are logged to the specified JSONL file with timestamps:
-
-```jsonl
-{"timestamp":"2026-02-14T03:50:00.000Z","type":"prompt.loaded","data":{"file":"/path/to/prompt.txt","length":123}}
-{"timestamp":"2026-02-14T03:50:01.000Z","type":"client.created","data":{"cliPath":"copilot","useStdio":true}}
-{"timestamp":"2026-02-14T03:50:02.000Z","type":"session.created","sessionId":"abc123","data":{"model":"gpt-5"}}
-```
diff --git a/copilot-client/package-lock.json b/copilot-client/package-lock.json
deleted file mode 100644
index d796a2ae27..0000000000
--- a/copilot-client/package-lock.json
+++ /dev/null
@@ -1,2136 +0,0 @@
-{
- "name": "@github/gh-aw-copilot-client",
- "version": "0.0.1",
- "lockfileVersion": 3,
- "requires": true,
- "packages": {
- "": {
- "name": "@github/gh-aw-copilot-client",
- "version": "0.0.1",
- "dependencies": {
- "@github/copilot-sdk": "^0.1.23",
- "debug": "^4.4.0"
- },
- "bin": {
- "copilot-client": "dist/cli.js"
- },
- "devDependencies": {
- "@types/debug": "^4.1.12",
- "@types/node": "^24.0.0",
- "tsup": "^8.5.1",
- "typescript": "^5.9.3",
- "vitest": "^4.0.18"
- },
- "engines": {
- "node": ">=24.0.0"
- }
- },
- "node_modules/@esbuild/aix-ppc64": {
- "version": "0.27.3",
- "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.3.tgz",
- "integrity": "sha512-9fJMTNFTWZMh5qwrBItuziu834eOCUcEqymSH7pY+zoMVEZg3gcPuBNxH1EvfVYe9h0x/Ptw8KBzv7qxb7l8dg==",
- "cpu": [
- "ppc64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "aix"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/android-arm": {
- "version": "0.27.3",
- "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.3.tgz",
- "integrity": "sha512-i5D1hPY7GIQmXlXhs2w8AWHhenb00+GxjxRncS2ZM7YNVGNfaMxgzSGuO8o8SJzRc/oZwU2bcScvVERk03QhzA==",
- "cpu": [
- "arm"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "android"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/android-arm64": {
- "version": "0.27.3",
- "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.3.tgz",
- "integrity": "sha512-YdghPYUmj/FX2SYKJ0OZxf+iaKgMsKHVPF1MAq/P8WirnSpCStzKJFjOjzsW0QQ7oIAiccHdcqjbHmJxRb/dmg==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "android"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/android-x64": {
- "version": "0.27.3",
- "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.3.tgz",
- "integrity": "sha512-IN/0BNTkHtk8lkOM8JWAYFg4ORxBkZQf9zXiEOfERX/CzxW3Vg1ewAhU7QSWQpVIzTW+b8Xy+lGzdYXV6UZObQ==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "android"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/darwin-arm64": {
- "version": "0.27.3",
- "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.3.tgz",
- "integrity": "sha512-Re491k7ByTVRy0t3EKWajdLIr0gz2kKKfzafkth4Q8A5n1xTHrkqZgLLjFEHVD+AXdUGgQMq+Godfq45mGpCKg==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "darwin"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/darwin-x64": {
- "version": "0.27.3",
- "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.3.tgz",
- "integrity": "sha512-vHk/hA7/1AckjGzRqi6wbo+jaShzRowYip6rt6q7VYEDX4LEy1pZfDpdxCBnGtl+A5zq8iXDcyuxwtv3hNtHFg==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "darwin"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/freebsd-arm64": {
- "version": "0.27.3",
- "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.3.tgz",
- "integrity": "sha512-ipTYM2fjt3kQAYOvo6vcxJx3nBYAzPjgTCk7QEgZG8AUO3ydUhvelmhrbOheMnGOlaSFUoHXB6un+A7q4ygY9w==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "freebsd"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/freebsd-x64": {
- "version": "0.27.3",
- "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.3.tgz",
- "integrity": "sha512-dDk0X87T7mI6U3K9VjWtHOXqwAMJBNN2r7bejDsc+j03SEjtD9HrOl8gVFByeM0aJksoUuUVU9TBaZa2rgj0oA==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "freebsd"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/linux-arm": {
- "version": "0.27.3",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.3.tgz",
- "integrity": "sha512-s6nPv2QkSupJwLYyfS+gwdirm0ukyTFNl3KTgZEAiJDd+iHZcbTPPcWCcRYH+WlNbwChgH2QkE9NSlNrMT8Gfw==",
- "cpu": [
- "arm"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/linux-arm64": {
- "version": "0.27.3",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.3.tgz",
- "integrity": "sha512-sZOuFz/xWnZ4KH3YfFrKCf1WyPZHakVzTiqji3WDc0BCl2kBwiJLCXpzLzUBLgmp4veFZdvN5ChW4Eq/8Fc2Fg==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/linux-ia32": {
- "version": "0.27.3",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.3.tgz",
- "integrity": "sha512-yGlQYjdxtLdh0a3jHjuwOrxQjOZYD/C9PfdbgJJF3TIZWnm/tMd/RcNiLngiu4iwcBAOezdnSLAwQDPqTmtTYg==",
- "cpu": [
- "ia32"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/linux-loong64": {
- "version": "0.27.3",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.3.tgz",
- "integrity": "sha512-WO60Sn8ly3gtzhyjATDgieJNet/KqsDlX5nRC5Y3oTFcS1l0KWba+SEa9Ja1GfDqSF1z6hif/SkpQJbL63cgOA==",
- "cpu": [
- "loong64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/linux-mips64el": {
- "version": "0.27.3",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.3.tgz",
- "integrity": "sha512-APsymYA6sGcZ4pD6k+UxbDjOFSvPWyZhjaiPyl/f79xKxwTnrn5QUnXR5prvetuaSMsb4jgeHewIDCIWljrSxw==",
- "cpu": [
- "mips64el"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/linux-ppc64": {
- "version": "0.27.3",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.3.tgz",
- "integrity": "sha512-eizBnTeBefojtDb9nSh4vvVQ3V9Qf9Df01PfawPcRzJH4gFSgrObw+LveUyDoKU3kxi5+9RJTCWlj4FjYXVPEA==",
- "cpu": [
- "ppc64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/linux-riscv64": {
- "version": "0.27.3",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.3.tgz",
- "integrity": "sha512-3Emwh0r5wmfm3ssTWRQSyVhbOHvqegUDRd0WhmXKX2mkHJe1SFCMJhagUleMq+Uci34wLSipf8Lagt4LlpRFWQ==",
- "cpu": [
- "riscv64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/linux-s390x": {
- "version": "0.27.3",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.3.tgz",
- "integrity": "sha512-pBHUx9LzXWBc7MFIEEL0yD/ZVtNgLytvx60gES28GcWMqil8ElCYR4kvbV2BDqsHOvVDRrOxGySBM9Fcv744hw==",
- "cpu": [
- "s390x"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/linux-x64": {
- "version": "0.27.3",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.3.tgz",
- "integrity": "sha512-Czi8yzXUWIQYAtL/2y6vogER8pvcsOsk5cpwL4Gk5nJqH5UZiVByIY8Eorm5R13gq+DQKYg0+JyQoytLQas4dA==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/netbsd-arm64": {
- "version": "0.27.3",
- "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.3.tgz",
- "integrity": "sha512-sDpk0RgmTCR/5HguIZa9n9u+HVKf40fbEUt+iTzSnCaGvY9kFP0YKBWZtJaraonFnqef5SlJ8/TiPAxzyS+UoA==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "netbsd"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/netbsd-x64": {
- "version": "0.27.3",
- "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.3.tgz",
- "integrity": "sha512-P14lFKJl/DdaE00LItAukUdZO5iqNH7+PjoBm+fLQjtxfcfFE20Xf5CrLsmZdq5LFFZzb5JMZ9grUwvtVYzjiA==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "netbsd"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/openbsd-arm64": {
- "version": "0.27.3",
- "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.3.tgz",
- "integrity": "sha512-AIcMP77AvirGbRl/UZFTq5hjXK+2wC7qFRGoHSDrZ5v5b8DK/GYpXW3CPRL53NkvDqb9D+alBiC/dV0Fb7eJcw==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "openbsd"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/openbsd-x64": {
- "version": "0.27.3",
- "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.3.tgz",
- "integrity": "sha512-DnW2sRrBzA+YnE70LKqnM3P+z8vehfJWHXECbwBmH/CU51z6FiqTQTHFenPlHmo3a8UgpLyH3PT+87OViOh1AQ==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "openbsd"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/openharmony-arm64": {
- "version": "0.27.3",
- "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.3.tgz",
- "integrity": "sha512-NinAEgr/etERPTsZJ7aEZQvvg/A6IsZG/LgZy+81wON2huV7SrK3e63dU0XhyZP4RKGyTm7aOgmQk0bGp0fy2g==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "openharmony"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/sunos-x64": {
- "version": "0.27.3",
- "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.3.tgz",
- "integrity": "sha512-PanZ+nEz+eWoBJ8/f8HKxTTD172SKwdXebZ0ndd953gt1HRBbhMsaNqjTyYLGLPdoWHy4zLU7bDVJztF5f3BHA==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "sunos"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/win32-arm64": {
- "version": "0.27.3",
- "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.3.tgz",
- "integrity": "sha512-B2t59lWWYrbRDw/tjiWOuzSsFh1Y/E95ofKz7rIVYSQkUYBjfSgf6oeYPNWHToFRr2zx52JKApIcAS/D5TUBnA==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "win32"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/win32-ia32": {
- "version": "0.27.3",
- "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.3.tgz",
- "integrity": "sha512-QLKSFeXNS8+tHW7tZpMtjlNb7HKau0QDpwm49u0vUp9y1WOF+PEzkU84y9GqYaAVW8aH8f3GcBck26jh54cX4Q==",
- "cpu": [
- "ia32"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "win32"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@esbuild/win32-x64": {
- "version": "0.27.3",
- "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.3.tgz",
- "integrity": "sha512-4uJGhsxuptu3OcpVAzli+/gWusVGwZZHTlS63hh++ehExkVT8SgiEf7/uC/PclrPPkLhZqGgCTjd0VWLo6xMqA==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "win32"
- ],
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@github/copilot": {
- "version": "0.0.403",
- "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-0.0.403.tgz",
- "integrity": "sha512-v5jUdtGJReLmE1rmff/LZf+50nzmYQYAaSRNtVNr9g0j0GkCd/noQExe31i1+PudvWU0ZJjltR0B8pUfDRdA9Q==",
- "license": "SEE LICENSE IN LICENSE.md",
- "bin": {
- "copilot": "npm-loader.js"
- },
- "optionalDependencies": {
- "@github/copilot-darwin-arm64": "0.0.403",
- "@github/copilot-darwin-x64": "0.0.403",
- "@github/copilot-linux-arm64": "0.0.403",
- "@github/copilot-linux-x64": "0.0.403",
- "@github/copilot-win32-arm64": "0.0.403",
- "@github/copilot-win32-x64": "0.0.403"
- }
- },
- "node_modules/@github/copilot-darwin-arm64": {
- "version": "0.0.403",
- "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-0.0.403.tgz",
- "integrity": "sha512-dOw8IleA0d1soHnbr/6wc6vZiYWNTKMgfTe/NET1nCfMzyKDt/0F0I7PT5y+DLujJknTla/ZeEmmBUmliTW4Cg==",
- "cpu": [
- "arm64"
- ],
- "license": "SEE LICENSE IN LICENSE.md",
- "optional": true,
- "os": [
- "darwin"
- ],
- "bin": {
- "copilot-darwin-arm64": "copilot"
- }
- },
- "node_modules/@github/copilot-darwin-x64": {
- "version": "0.0.403",
- "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-0.0.403.tgz",
- "integrity": "sha512-aK2jSNWgY8eiZ+TmrvGhssMCPDTKArc0ip6Ul5OaslpytKks8hyXoRbxGD0N9sKioSUSbvKUf+1AqavbDpJO+w==",
- "cpu": [
- "x64"
- ],
- "license": "SEE LICENSE IN LICENSE.md",
- "optional": true,
- "os": [
- "darwin"
- ],
- "bin": {
- "copilot-darwin-x64": "copilot"
- }
- },
- "node_modules/@github/copilot-linux-arm64": {
- "version": "0.0.403",
- "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-0.0.403.tgz",
- "integrity": "sha512-KhoR2iR70O6vCkzf0h8/K+p82qAgOvMTgAPm9bVEHvbdGFR7Py9qL5v03bMbPxsA45oNaZAkzDhfTAqWhIAZsQ==",
- "cpu": [
- "arm64"
- ],
- "license": "SEE LICENSE IN LICENSE.md",
- "optional": true,
- "os": [
- "linux"
- ],
- "bin": {
- "copilot-linux-arm64": "copilot"
- }
- },
- "node_modules/@github/copilot-linux-x64": {
- "version": "0.0.403",
- "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-0.0.403.tgz",
- "integrity": "sha512-eoswUc9vo4TB+/9PgFJLVtzI4dPjkpJXdCsAioVuoqPdNxHxlIHFe9HaVcqMRZxUNY1YHEBZozy+IpUEGjgdfQ==",
- "cpu": [
- "x64"
- ],
- "license": "SEE LICENSE IN LICENSE.md",
- "optional": true,
- "os": [
- "linux"
- ],
- "bin": {
- "copilot-linux-x64": "copilot"
- }
- },
- "node_modules/@github/copilot-sdk": {
- "version": "0.1.23",
- "resolved": "https://registry.npmjs.org/@github/copilot-sdk/-/copilot-sdk-0.1.23.tgz",
- "integrity": "sha512-0by81bsBQlDKE5VbcegZfUMvPyPm1aXwSGS2rGaMAFxv3ps+dACf1Voruxik7hQTae0ziVFJjuVrlxZoRaXBLw==",
- "license": "MIT",
- "dependencies": {
- "@github/copilot": "^0.0.403",
- "vscode-jsonrpc": "^8.2.1",
- "zod": "^4.3.6"
- },
- "engines": {
- "node": ">=24.0.0"
- }
- },
- "node_modules/@github/copilot-win32-arm64": {
- "version": "0.0.403",
- "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-0.0.403.tgz",
- "integrity": "sha512-djWjzCsp2xPNafMyOZ/ivU328/WvWhdroGie/DugiJBTgQL2SP0quWW1fhTlDwE81a3g9CxfJonaRgOpFTJTcg==",
- "cpu": [
- "arm64"
- ],
- "license": "SEE LICENSE IN LICENSE.md",
- "optional": true,
- "os": [
- "win32"
- ],
- "bin": {
- "copilot-win32-arm64": "copilot.exe"
- }
- },
- "node_modules/@github/copilot-win32-x64": {
- "version": "0.0.403",
- "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-0.0.403.tgz",
- "integrity": "sha512-lju8cHy2E6Ux7R7tWyLZeksYC2MVZu9i9ocjiBX/qfG2/pNJs7S5OlkwKJ0BSXSbZEHQYq7iHfEWp201bVfk9A==",
- "cpu": [
- "x64"
- ],
- "license": "SEE LICENSE IN LICENSE.md",
- "optional": true,
- "os": [
- "win32"
- ],
- "bin": {
- "copilot-win32-x64": "copilot.exe"
- }
- },
- "node_modules/@jridgewell/gen-mapping": {
- "version": "0.3.13",
- "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz",
- "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "@jridgewell/sourcemap-codec": "^1.5.0",
- "@jridgewell/trace-mapping": "^0.3.24"
- }
- },
- "node_modules/@jridgewell/resolve-uri": {
- "version": "3.1.2",
- "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",
- "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=6.0.0"
- }
- },
- "node_modules/@jridgewell/sourcemap-codec": {
- "version": "1.5.5",
- "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz",
- "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==",
- "dev": true,
- "license": "MIT"
- },
- "node_modules/@jridgewell/trace-mapping": {
- "version": "0.3.31",
- "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz",
- "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "@jridgewell/resolve-uri": "^3.1.0",
- "@jridgewell/sourcemap-codec": "^1.4.14"
- }
- },
- "node_modules/@rollup/rollup-android-arm-eabi": {
- "version": "4.57.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.57.1.tgz",
- "integrity": "sha512-A6ehUVSiSaaliTxai040ZpZ2zTevHYbvu/lDoeAteHI8QnaosIzm4qwtezfRg1jOYaUmnzLX1AOD6Z+UJjtifg==",
- "cpu": [
- "arm"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "android"
- ]
- },
- "node_modules/@rollup/rollup-android-arm64": {
- "version": "4.57.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.57.1.tgz",
- "integrity": "sha512-dQaAddCY9YgkFHZcFNS/606Exo8vcLHwArFZ7vxXq4rigo2bb494/xKMMwRRQW6ug7Js6yXmBZhSBRuBvCCQ3w==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "android"
- ]
- },
- "node_modules/@rollup/rollup-darwin-arm64": {
- "version": "4.57.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.57.1.tgz",
- "integrity": "sha512-crNPrwJOrRxagUYeMn/DZwqN88SDmwaJ8Cvi/TN1HnWBU7GwknckyosC2gd0IqYRsHDEnXf328o9/HC6OkPgOg==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "darwin"
- ]
- },
- "node_modules/@rollup/rollup-darwin-x64": {
- "version": "4.57.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.57.1.tgz",
- "integrity": "sha512-Ji8g8ChVbKrhFtig5QBV7iMaJrGtpHelkB3lsaKzadFBe58gmjfGXAOfI5FV0lYMH8wiqsxKQ1C9B0YTRXVy4w==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "darwin"
- ]
- },
- "node_modules/@rollup/rollup-freebsd-arm64": {
- "version": "4.57.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.57.1.tgz",
- "integrity": "sha512-R+/WwhsjmwodAcz65guCGFRkMb4gKWTcIeLy60JJQbXrJ97BOXHxnkPFrP+YwFlaS0m+uWJTstrUA9o+UchFug==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "freebsd"
- ]
- },
- "node_modules/@rollup/rollup-freebsd-x64": {
- "version": "4.57.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.57.1.tgz",
- "integrity": "sha512-IEQTCHeiTOnAUC3IDQdzRAGj3jOAYNr9kBguI7MQAAZK3caezRrg0GxAb6Hchg4lxdZEI5Oq3iov/w/hnFWY9Q==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "freebsd"
- ]
- },
- "node_modules/@rollup/rollup-linux-arm-gnueabihf": {
- "version": "4.57.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.57.1.tgz",
- "integrity": "sha512-F8sWbhZ7tyuEfsmOxwc2giKDQzN3+kuBLPwwZGyVkLlKGdV1nvnNwYD0fKQ8+XS6hp9nY7B+ZeK01EBUE7aHaw==",
- "cpu": [
- "arm"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ]
- },
- "node_modules/@rollup/rollup-linux-arm-musleabihf": {
- "version": "4.57.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.57.1.tgz",
- "integrity": "sha512-rGfNUfn0GIeXtBP1wL5MnzSj98+PZe/AXaGBCRmT0ts80lU5CATYGxXukeTX39XBKsxzFpEeK+Mrp9faXOlmrw==",
- "cpu": [
- "arm"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ]
- },
- "node_modules/@rollup/rollup-linux-arm64-gnu": {
- "version": "4.57.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.57.1.tgz",
- "integrity": "sha512-MMtej3YHWeg/0klK2Qodf3yrNzz6CGjo2UntLvk2RSPlhzgLvYEB3frRvbEF2wRKh1Z2fDIg9KRPe1fawv7C+g==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ]
- },
- "node_modules/@rollup/rollup-linux-arm64-musl": {
- "version": "4.57.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.57.1.tgz",
- "integrity": "sha512-1a/qhaaOXhqXGpMFMET9VqwZakkljWHLmZOX48R0I/YLbhdxr1m4gtG1Hq7++VhVUmf+L3sTAf9op4JlhQ5u1Q==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ]
- },
- "node_modules/@rollup/rollup-linux-loong64-gnu": {
- "version": "4.57.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.57.1.tgz",
- "integrity": "sha512-QWO6RQTZ/cqYtJMtxhkRkidoNGXc7ERPbZN7dVW5SdURuLeVU7lwKMpo18XdcmpWYd0qsP1bwKPf7DNSUinhvA==",
- "cpu": [
- "loong64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ]
- },
- "node_modules/@rollup/rollup-linux-loong64-musl": {
- "version": "4.57.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.57.1.tgz",
- "integrity": "sha512-xpObYIf+8gprgWaPP32xiN5RVTi/s5FCR+XMXSKmhfoJjrpRAjCuuqQXyxUa/eJTdAE6eJ+KDKaoEqjZQxh3Gw==",
- "cpu": [
- "loong64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ]
- },
- "node_modules/@rollup/rollup-linux-ppc64-gnu": {
- "version": "4.57.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.57.1.tgz",
- "integrity": "sha512-4BrCgrpZo4hvzMDKRqEaW1zeecScDCR+2nZ86ATLhAoJ5FQ+lbHVD3ttKe74/c7tNT9c6F2viwB3ufwp01Oh2w==",
- "cpu": [
- "ppc64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ]
- },
- "node_modules/@rollup/rollup-linux-ppc64-musl": {
- "version": "4.57.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.57.1.tgz",
- "integrity": "sha512-NOlUuzesGauESAyEYFSe3QTUguL+lvrN1HtwEEsU2rOwdUDeTMJdO5dUYl/2hKf9jWydJrO9OL/XSSf65R5+Xw==",
- "cpu": [
- "ppc64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ]
- },
- "node_modules/@rollup/rollup-linux-riscv64-gnu": {
- "version": "4.57.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.57.1.tgz",
- "integrity": "sha512-ptA88htVp0AwUUqhVghwDIKlvJMD/fmL/wrQj99PRHFRAG6Z5nbWoWG4o81Nt9FT+IuqUQi+L31ZKAFeJ5Is+A==",
- "cpu": [
- "riscv64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ]
- },
- "node_modules/@rollup/rollup-linux-riscv64-musl": {
- "version": "4.57.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.57.1.tgz",
- "integrity": "sha512-S51t7aMMTNdmAMPpBg7OOsTdn4tySRQvklmL3RpDRyknk87+Sp3xaumlatU+ppQ+5raY7sSTcC2beGgvhENfuw==",
- "cpu": [
- "riscv64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ]
- },
- "node_modules/@rollup/rollup-linux-s390x-gnu": {
- "version": "4.57.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.57.1.tgz",
- "integrity": "sha512-Bl00OFnVFkL82FHbEqy3k5CUCKH6OEJL54KCyx2oqsmZnFTR8IoNqBF+mjQVcRCT5sB6yOvK8A37LNm/kPJiZg==",
- "cpu": [
- "s390x"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ]
- },
- "node_modules/@rollup/rollup-linux-x64-gnu": {
- "version": "4.57.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.57.1.tgz",
- "integrity": "sha512-ABca4ceT4N+Tv/GtotnWAeXZUZuM/9AQyCyKYyKnpk4yoA7QIAuBt6Hkgpw8kActYlew2mvckXkvx0FfoInnLg==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ]
- },
- "node_modules/@rollup/rollup-linux-x64-musl": {
- "version": "4.57.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.57.1.tgz",
- "integrity": "sha512-HFps0JeGtuOR2convgRRkHCekD7j+gdAuXM+/i6kGzQtFhlCtQkpwtNzkNj6QhCDp7DRJ7+qC/1Vg2jt5iSOFw==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ]
- },
- "node_modules/@rollup/rollup-openbsd-x64": {
- "version": "4.57.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.57.1.tgz",
- "integrity": "sha512-H+hXEv9gdVQuDTgnqD+SQffoWoc0Of59AStSzTEj/feWTBAnSfSD3+Dql1ZruJQxmykT/JVY0dE8Ka7z0DH1hw==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "openbsd"
- ]
- },
- "node_modules/@rollup/rollup-openharmony-arm64": {
- "version": "4.57.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.57.1.tgz",
- "integrity": "sha512-4wYoDpNg6o/oPximyc/NG+mYUejZrCU2q+2w6YZqrAs2UcNUChIZXjtafAiiZSUc7On8v5NyNj34Kzj/Ltk6dQ==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "openharmony"
- ]
- },
- "node_modules/@rollup/rollup-win32-arm64-msvc": {
- "version": "4.57.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.57.1.tgz",
- "integrity": "sha512-O54mtsV/6LW3P8qdTcamQmuC990HDfR71lo44oZMZlXU4tzLrbvTii87Ni9opq60ds0YzuAlEr/GNwuNluZyMQ==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "win32"
- ]
- },
- "node_modules/@rollup/rollup-win32-ia32-msvc": {
- "version": "4.57.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.57.1.tgz",
- "integrity": "sha512-P3dLS+IerxCT/7D2q2FYcRdWRl22dNbrbBEtxdWhXrfIMPP9lQhb5h4Du04mdl5Woq05jVCDPCMF7Ub0NAjIew==",
- "cpu": [
- "ia32"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "win32"
- ]
- },
- "node_modules/@rollup/rollup-win32-x64-gnu": {
- "version": "4.57.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.57.1.tgz",
- "integrity": "sha512-VMBH2eOOaKGtIJYleXsi2B8CPVADrh+TyNxJ4mWPnKfLB/DBUmzW+5m1xUrcwWoMfSLagIRpjUFeW5CO5hyciQ==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "win32"
- ]
- },
- "node_modules/@rollup/rollup-win32-x64-msvc": {
- "version": "4.57.1",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.57.1.tgz",
- "integrity": "sha512-mxRFDdHIWRxg3UfIIAwCm6NzvxG0jDX/wBN6KsQFTvKFqqg9vTrWUE68qEjHt19A5wwx5X5aUi2zuZT7YR0jrA==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "win32"
- ]
- },
- "node_modules/@standard-schema/spec": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz",
- "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==",
- "dev": true,
- "license": "MIT"
- },
- "node_modules/@types/chai": {
- "version": "5.2.3",
- "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz",
- "integrity": "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "@types/deep-eql": "*",
- "assertion-error": "^2.0.1"
- }
- },
- "node_modules/@types/debug": {
- "version": "4.1.12",
- "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz",
- "integrity": "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "@types/ms": "*"
- }
- },
- "node_modules/@types/deep-eql": {
- "version": "4.0.2",
- "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz",
- "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==",
- "dev": true,
- "license": "MIT"
- },
- "node_modules/@types/estree": {
- "version": "1.0.8",
- "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz",
- "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==",
- "dev": true,
- "license": "MIT"
- },
- "node_modules/@types/ms": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/@types/ms/-/ms-2.1.0.tgz",
- "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==",
- "dev": true,
- "license": "MIT"
- },
- "node_modules/@types/node": {
- "version": "24.10.13",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.13.tgz",
- "integrity": "sha512-oH72nZRfDv9lADUBSo104Aq7gPHpQZc4BTx38r9xf9pg5LfP6EzSyH2n7qFmmxRQXh7YlUXODcYsg6PuTDSxGg==",
- "dev": true,
- "license": "MIT",
- "peer": true,
- "dependencies": {
- "undici-types": "~7.16.0"
- }
- },
- "node_modules/@vitest/expect": {
- "version": "4.0.18",
- "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-4.0.18.tgz",
- "integrity": "sha512-8sCWUyckXXYvx4opfzVY03EOiYVxyNrHS5QxX3DAIi5dpJAAkyJezHCP77VMX4HKA2LDT/Jpfo8i2r5BE3GnQQ==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "@standard-schema/spec": "^1.0.0",
- "@types/chai": "^5.2.2",
- "@vitest/spy": "4.0.18",
- "@vitest/utils": "4.0.18",
- "chai": "^6.2.1",
- "tinyrainbow": "^3.0.3"
- },
- "funding": {
- "url": "https://opencollective.com/vitest"
- }
- },
- "node_modules/@vitest/mocker": {
- "version": "4.0.18",
- "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-4.0.18.tgz",
- "integrity": "sha512-HhVd0MDnzzsgevnOWCBj5Otnzobjy5wLBe4EdeeFGv8luMsGcYqDuFRMcttKWZA5vVO8RFjexVovXvAM4JoJDQ==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "@vitest/spy": "4.0.18",
- "estree-walker": "^3.0.3",
- "magic-string": "^0.30.21"
- },
- "funding": {
- "url": "https://opencollective.com/vitest"
- },
- "peerDependencies": {
- "msw": "^2.4.9",
- "vite": "^6.0.0 || ^7.0.0-0"
- },
- "peerDependenciesMeta": {
- "msw": {
- "optional": true
- },
- "vite": {
- "optional": true
- }
- }
- },
- "node_modules/@vitest/pretty-format": {
- "version": "4.0.18",
- "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-4.0.18.tgz",
- "integrity": "sha512-P24GK3GulZWC5tz87ux0m8OADrQIUVDPIjjj65vBXYG17ZeU3qD7r+MNZ1RNv4l8CGU2vtTRqixrOi9fYk/yKw==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "tinyrainbow": "^3.0.3"
- },
- "funding": {
- "url": "https://opencollective.com/vitest"
- }
- },
- "node_modules/@vitest/runner": {
- "version": "4.0.18",
- "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-4.0.18.tgz",
- "integrity": "sha512-rpk9y12PGa22Jg6g5M3UVVnTS7+zycIGk9ZNGN+m6tZHKQb7jrP7/77WfZy13Y/EUDd52NDsLRQhYKtv7XfPQw==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "@vitest/utils": "4.0.18",
- "pathe": "^2.0.3"
- },
- "funding": {
- "url": "https://opencollective.com/vitest"
- }
- },
- "node_modules/@vitest/snapshot": {
- "version": "4.0.18",
- "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-4.0.18.tgz",
- "integrity": "sha512-PCiV0rcl7jKQjbgYqjtakly6T1uwv/5BQ9SwBLekVg/EaYeQFPiXcgrC2Y7vDMA8dM1SUEAEV82kgSQIlXNMvA==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "@vitest/pretty-format": "4.0.18",
- "magic-string": "^0.30.21",
- "pathe": "^2.0.3"
- },
- "funding": {
- "url": "https://opencollective.com/vitest"
- }
- },
- "node_modules/@vitest/spy": {
- "version": "4.0.18",
- "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-4.0.18.tgz",
- "integrity": "sha512-cbQt3PTSD7P2OARdVW3qWER5EGq7PHlvE+QfzSC0lbwO+xnt7+XH06ZzFjFRgzUX//JmpxrCu92VdwvEPlWSNw==",
- "dev": true,
- "license": "MIT",
- "funding": {
- "url": "https://opencollective.com/vitest"
- }
- },
- "node_modules/@vitest/utils": {
- "version": "4.0.18",
- "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-4.0.18.tgz",
- "integrity": "sha512-msMRKLMVLWygpK3u2Hybgi4MNjcYJvwTb0Ru09+fOyCXIgT5raYP041DRRdiJiI3k/2U6SEbAETB3YtBrUkCFA==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "@vitest/pretty-format": "4.0.18",
- "tinyrainbow": "^3.0.3"
- },
- "funding": {
- "url": "https://opencollective.com/vitest"
- }
- },
- "node_modules/acorn": {
- "version": "8.15.0",
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz",
- "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==",
- "dev": true,
- "license": "MIT",
- "bin": {
- "acorn": "bin/acorn"
- },
- "engines": {
- "node": ">=0.4.0"
- }
- },
- "node_modules/any-promise": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz",
- "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==",
- "dev": true,
- "license": "MIT"
- },
- "node_modules/assertion-error": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz",
- "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/bundle-require": {
- "version": "5.1.0",
- "resolved": "https://registry.npmjs.org/bundle-require/-/bundle-require-5.1.0.tgz",
- "integrity": "sha512-3WrrOuZiyaaZPWiEt4G3+IffISVC9HYlWueJEBWED4ZH4aIAC2PnkdnuRrR94M+w6yGWn4AglWtJtBI8YqvgoA==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "load-tsconfig": "^0.2.3"
- },
- "engines": {
- "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
- },
- "peerDependencies": {
- "esbuild": ">=0.18"
- }
- },
- "node_modules/cac": {
- "version": "6.7.14",
- "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz",
- "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/chai": {
- "version": "6.2.2",
- "resolved": "https://registry.npmjs.org/chai/-/chai-6.2.2.tgz",
- "integrity": "sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/chokidar": {
- "version": "4.0.3",
- "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz",
- "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "readdirp": "^4.0.1"
- },
- "engines": {
- "node": ">= 14.16.0"
- },
- "funding": {
- "url": "https://paulmillr.com/funding/"
- }
- },
- "node_modules/commander": {
- "version": "4.1.1",
- "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz",
- "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">= 6"
- }
- },
- "node_modules/confbox": {
- "version": "0.1.8",
- "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.8.tgz",
- "integrity": "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==",
- "dev": true,
- "license": "MIT"
- },
- "node_modules/consola": {
- "version": "3.4.2",
- "resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz",
- "integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": "^14.18.0 || >=16.10.0"
- }
- },
- "node_modules/debug": {
- "version": "4.4.3",
- "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
- "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
- "license": "MIT",
- "dependencies": {
- "ms": "^2.1.3"
- },
- "engines": {
- "node": ">=6.0"
- },
- "peerDependenciesMeta": {
- "supports-color": {
- "optional": true
- }
- }
- },
- "node_modules/es-module-lexer": {
- "version": "1.7.0",
- "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.7.0.tgz",
- "integrity": "sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==",
- "dev": true,
- "license": "MIT"
- },
- "node_modules/esbuild": {
- "version": "0.27.3",
- "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.3.tgz",
- "integrity": "sha512-8VwMnyGCONIs6cWue2IdpHxHnAjzxnw2Zr7MkVxB2vjmQ2ivqGFb4LEG3SMnv0Gb2F/G/2yA8zUaiL1gywDCCg==",
- "dev": true,
- "hasInstallScript": true,
- "license": "MIT",
- "peer": true,
- "bin": {
- "esbuild": "bin/esbuild"
- },
- "engines": {
- "node": ">=18"
- },
- "optionalDependencies": {
- "@esbuild/aix-ppc64": "0.27.3",
- "@esbuild/android-arm": "0.27.3",
- "@esbuild/android-arm64": "0.27.3",
- "@esbuild/android-x64": "0.27.3",
- "@esbuild/darwin-arm64": "0.27.3",
- "@esbuild/darwin-x64": "0.27.3",
- "@esbuild/freebsd-arm64": "0.27.3",
- "@esbuild/freebsd-x64": "0.27.3",
- "@esbuild/linux-arm": "0.27.3",
- "@esbuild/linux-arm64": "0.27.3",
- "@esbuild/linux-ia32": "0.27.3",
- "@esbuild/linux-loong64": "0.27.3",
- "@esbuild/linux-mips64el": "0.27.3",
- "@esbuild/linux-ppc64": "0.27.3",
- "@esbuild/linux-riscv64": "0.27.3",
- "@esbuild/linux-s390x": "0.27.3",
- "@esbuild/linux-x64": "0.27.3",
- "@esbuild/netbsd-arm64": "0.27.3",
- "@esbuild/netbsd-x64": "0.27.3",
- "@esbuild/openbsd-arm64": "0.27.3",
- "@esbuild/openbsd-x64": "0.27.3",
- "@esbuild/openharmony-arm64": "0.27.3",
- "@esbuild/sunos-x64": "0.27.3",
- "@esbuild/win32-arm64": "0.27.3",
- "@esbuild/win32-ia32": "0.27.3",
- "@esbuild/win32-x64": "0.27.3"
- }
- },
- "node_modules/estree-walker": {
- "version": "3.0.3",
- "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz",
- "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "@types/estree": "^1.0.0"
- }
- },
- "node_modules/expect-type": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.3.0.tgz",
- "integrity": "sha512-knvyeauYhqjOYvQ66MznSMs83wmHrCycNEN6Ao+2AeYEfxUIkuiVxdEa1qlGEPK+We3n0THiDciYSsCcgW/DoA==",
- "dev": true,
- "license": "Apache-2.0",
- "engines": {
- "node": ">=12.0.0"
- }
- },
- "node_modules/fdir": {
- "version": "6.5.0",
- "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz",
- "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=12.0.0"
- },
- "peerDependencies": {
- "picomatch": "^3 || ^4"
- },
- "peerDependenciesMeta": {
- "picomatch": {
- "optional": true
- }
- }
- },
- "node_modules/fix-dts-default-cjs-exports": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/fix-dts-default-cjs-exports/-/fix-dts-default-cjs-exports-1.0.1.tgz",
- "integrity": "sha512-pVIECanWFC61Hzl2+oOCtoJ3F17kglZC/6N94eRWycFgBH35hHx0Li604ZIzhseh97mf2p0cv7vVrOZGoqhlEg==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "magic-string": "^0.30.17",
- "mlly": "^1.7.4",
- "rollup": "^4.34.8"
- }
- },
- "node_modules/fsevents": {
- "version": "2.3.3",
- "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
- "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
- "dev": true,
- "hasInstallScript": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "darwin"
- ],
- "engines": {
- "node": "^8.16.0 || ^10.6.0 || >=11.0.0"
- }
- },
- "node_modules/joycon": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/joycon/-/joycon-3.1.1.tgz",
- "integrity": "sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=10"
- }
- },
- "node_modules/lilconfig": {
- "version": "3.1.3",
- "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz",
- "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=14"
- },
- "funding": {
- "url": "https://github.com/sponsors/antonk52"
- }
- },
- "node_modules/lines-and-columns": {
- "version": "1.2.4",
- "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz",
- "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==",
- "dev": true,
- "license": "MIT"
- },
- "node_modules/load-tsconfig": {
- "version": "0.2.5",
- "resolved": "https://registry.npmjs.org/load-tsconfig/-/load-tsconfig-0.2.5.tgz",
- "integrity": "sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
- }
- },
- "node_modules/magic-string": {
- "version": "0.30.21",
- "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz",
- "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "@jridgewell/sourcemap-codec": "^1.5.5"
- }
- },
- "node_modules/mlly": {
- "version": "1.8.0",
- "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.8.0.tgz",
- "integrity": "sha512-l8D9ODSRWLe2KHJSifWGwBqpTZXIXTeo8mlKjY+E2HAakaTeNpqAyBZ8GSqLzHgw4XmHmC8whvpjJNMbFZN7/g==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "acorn": "^8.15.0",
- "pathe": "^2.0.3",
- "pkg-types": "^1.3.1",
- "ufo": "^1.6.1"
- }
- },
- "node_modules/ms": {
- "version": "2.1.3",
- "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
- "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
- "license": "MIT"
- },
- "node_modules/mz": {
- "version": "2.7.0",
- "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz",
- "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "any-promise": "^1.0.0",
- "object-assign": "^4.0.1",
- "thenify-all": "^1.0.0"
- }
- },
- "node_modules/nanoid": {
- "version": "3.3.11",
- "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz",
- "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==",
- "dev": true,
- "funding": [
- {
- "type": "github",
- "url": "https://github.com/sponsors/ai"
- }
- ],
- "license": "MIT",
- "bin": {
- "nanoid": "bin/nanoid.cjs"
- },
- "engines": {
- "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
- }
- },
- "node_modules/object-assign": {
- "version": "4.1.1",
- "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
- "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/obug": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/obug/-/obug-2.1.1.tgz",
- "integrity": "sha512-uTqF9MuPraAQ+IsnPf366RG4cP9RtUi7MLO1N3KEc+wb0a6yKpeL0lmk2IB1jY5KHPAlTc6T/JRdC/YqxHNwkQ==",
- "dev": true,
- "funding": [
- "https://github.com/sponsors/sxzz",
- "https://opencollective.com/debug"
- ],
- "license": "MIT"
- },
- "node_modules/pathe": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz",
- "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==",
- "dev": true,
- "license": "MIT"
- },
- "node_modules/picocolors": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
- "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",
- "dev": true,
- "license": "ISC"
- },
- "node_modules/picomatch": {
- "version": "4.0.3",
- "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz",
- "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=12"
- },
- "funding": {
- "url": "https://github.com/sponsors/jonschlinkert"
- }
- },
- "node_modules/pirates": {
- "version": "4.0.7",
- "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz",
- "integrity": "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">= 6"
- }
- },
- "node_modules/pkg-types": {
- "version": "1.3.1",
- "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.3.1.tgz",
- "integrity": "sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "confbox": "^0.1.8",
- "mlly": "^1.7.4",
- "pathe": "^2.0.1"
- }
- },
- "node_modules/postcss": {
- "version": "8.5.6",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz",
- "integrity": "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==",
- "dev": true,
- "funding": [
- {
- "type": "opencollective",
- "url": "https://opencollective.com/postcss/"
- },
- {
- "type": "tidelift",
- "url": "https://tidelift.com/funding/github/npm/postcss"
- },
- {
- "type": "github",
- "url": "https://github.com/sponsors/ai"
- }
- ],
- "license": "MIT",
- "dependencies": {
- "nanoid": "^3.3.11",
- "picocolors": "^1.1.1",
- "source-map-js": "^1.2.1"
- },
- "engines": {
- "node": "^10 || ^12 || >=14"
- }
- },
- "node_modules/postcss-load-config": {
- "version": "6.0.1",
- "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-6.0.1.tgz",
- "integrity": "sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==",
- "dev": true,
- "funding": [
- {
- "type": "opencollective",
- "url": "https://opencollective.com/postcss/"
- },
- {
- "type": "github",
- "url": "https://github.com/sponsors/ai"
- }
- ],
- "license": "MIT",
- "dependencies": {
- "lilconfig": "^3.1.1"
- },
- "engines": {
- "node": ">= 18"
- },
- "peerDependencies": {
- "jiti": ">=1.21.0",
- "postcss": ">=8.0.9",
- "tsx": "^4.8.1",
- "yaml": "^2.4.2"
- },
- "peerDependenciesMeta": {
- "jiti": {
- "optional": true
- },
- "postcss": {
- "optional": true
- },
- "tsx": {
- "optional": true
- },
- "yaml": {
- "optional": true
- }
- }
- },
- "node_modules/readdirp": {
- "version": "4.1.2",
- "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz",
- "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">= 14.18.0"
- },
- "funding": {
- "type": "individual",
- "url": "https://paulmillr.com/funding/"
- }
- },
- "node_modules/resolve-from": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz",
- "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/rollup": {
- "version": "4.57.1",
- "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.57.1.tgz",
- "integrity": "sha512-oQL6lgK3e2QZeQ7gcgIkS2YZPg5slw37hYufJ3edKlfQSGGm8ICoxswK15ntSzF/a8+h7ekRy7k7oWc3BQ7y8A==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "@types/estree": "1.0.8"
- },
- "bin": {
- "rollup": "dist/bin/rollup"
- },
- "engines": {
- "node": ">=18.0.0",
- "npm": ">=8.0.0"
- },
- "optionalDependencies": {
- "@rollup/rollup-android-arm-eabi": "4.57.1",
- "@rollup/rollup-android-arm64": "4.57.1",
- "@rollup/rollup-darwin-arm64": "4.57.1",
- "@rollup/rollup-darwin-x64": "4.57.1",
- "@rollup/rollup-freebsd-arm64": "4.57.1",
- "@rollup/rollup-freebsd-x64": "4.57.1",
- "@rollup/rollup-linux-arm-gnueabihf": "4.57.1",
- "@rollup/rollup-linux-arm-musleabihf": "4.57.1",
- "@rollup/rollup-linux-arm64-gnu": "4.57.1",
- "@rollup/rollup-linux-arm64-musl": "4.57.1",
- "@rollup/rollup-linux-loong64-gnu": "4.57.1",
- "@rollup/rollup-linux-loong64-musl": "4.57.1",
- "@rollup/rollup-linux-ppc64-gnu": "4.57.1",
- "@rollup/rollup-linux-ppc64-musl": "4.57.1",
- "@rollup/rollup-linux-riscv64-gnu": "4.57.1",
- "@rollup/rollup-linux-riscv64-musl": "4.57.1",
- "@rollup/rollup-linux-s390x-gnu": "4.57.1",
- "@rollup/rollup-linux-x64-gnu": "4.57.1",
- "@rollup/rollup-linux-x64-musl": "4.57.1",
- "@rollup/rollup-openbsd-x64": "4.57.1",
- "@rollup/rollup-openharmony-arm64": "4.57.1",
- "@rollup/rollup-win32-arm64-msvc": "4.57.1",
- "@rollup/rollup-win32-ia32-msvc": "4.57.1",
- "@rollup/rollup-win32-x64-gnu": "4.57.1",
- "@rollup/rollup-win32-x64-msvc": "4.57.1",
- "fsevents": "~2.3.2"
- }
- },
- "node_modules/siginfo": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz",
- "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==",
- "dev": true,
- "license": "ISC"
- },
- "node_modules/source-map": {
- "version": "0.7.6",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.6.tgz",
- "integrity": "sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ==",
- "dev": true,
- "license": "BSD-3-Clause",
- "engines": {
- "node": ">= 12"
- }
- },
- "node_modules/source-map-js": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz",
- "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==",
- "dev": true,
- "license": "BSD-3-Clause",
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/stackback": {
- "version": "0.0.2",
- "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz",
- "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==",
- "dev": true,
- "license": "MIT"
- },
- "node_modules/std-env": {
- "version": "3.10.0",
- "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.10.0.tgz",
- "integrity": "sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==",
- "dev": true,
- "license": "MIT"
- },
- "node_modules/sucrase": {
- "version": "3.35.1",
- "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.35.1.tgz",
- "integrity": "sha512-DhuTmvZWux4H1UOnWMB3sk0sbaCVOoQZjv8u1rDoTV0HTdGem9hkAZtl4JZy8P2z4Bg0nT+YMeOFyVr4zcG5Tw==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "@jridgewell/gen-mapping": "^0.3.2",
- "commander": "^4.0.0",
- "lines-and-columns": "^1.1.6",
- "mz": "^2.7.0",
- "pirates": "^4.0.1",
- "tinyglobby": "^0.2.11",
- "ts-interface-checker": "^0.1.9"
- },
- "bin": {
- "sucrase": "bin/sucrase",
- "sucrase-node": "bin/sucrase-node"
- },
- "engines": {
- "node": ">=16 || 14 >=14.17"
- }
- },
- "node_modules/thenify": {
- "version": "3.3.1",
- "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz",
- "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "any-promise": "^1.0.0"
- }
- },
- "node_modules/thenify-all": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz",
- "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "thenify": ">= 3.1.0 < 4"
- },
- "engines": {
- "node": ">=0.8"
- }
- },
- "node_modules/tinybench": {
- "version": "2.9.0",
- "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz",
- "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==",
- "dev": true,
- "license": "MIT"
- },
- "node_modules/tinyexec": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.0.2.tgz",
- "integrity": "sha512-W/KYk+NFhkmsYpuHq5JykngiOCnxeVL8v8dFnqxSD8qEEdRfXk1SDM6JzNqcERbcGYj9tMrDQBYV9cjgnunFIg==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/tinyglobby": {
- "version": "0.2.15",
- "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz",
- "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "fdir": "^6.5.0",
- "picomatch": "^4.0.3"
- },
- "engines": {
- "node": ">=12.0.0"
- },
- "funding": {
- "url": "https://github.com/sponsors/SuperchupuDev"
- }
- },
- "node_modules/tinyrainbow": {
- "version": "3.0.3",
- "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-3.0.3.tgz",
- "integrity": "sha512-PSkbLUoxOFRzJYjjxHJt9xro7D+iilgMX/C9lawzVuYiIdcihh9DXmVibBe8lmcFrRi/VzlPjBxbN7rH24q8/Q==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=14.0.0"
- }
- },
- "node_modules/tree-kill": {
- "version": "1.2.2",
- "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz",
- "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==",
- "dev": true,
- "license": "MIT",
- "bin": {
- "tree-kill": "cli.js"
- }
- },
- "node_modules/ts-interface-checker": {
- "version": "0.1.13",
- "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz",
- "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==",
- "dev": true,
- "license": "Apache-2.0"
- },
- "node_modules/tsup": {
- "version": "8.5.1",
- "resolved": "https://registry.npmjs.org/tsup/-/tsup-8.5.1.tgz",
- "integrity": "sha512-xtgkqwdhpKWr3tKPmCkvYmS9xnQK3m3XgxZHwSUjvfTjp7YfXe5tT3GgWi0F2N+ZSMsOeWeZFh7ZZFg5iPhing==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "bundle-require": "^5.1.0",
- "cac": "^6.7.14",
- "chokidar": "^4.0.3",
- "consola": "^3.4.0",
- "debug": "^4.4.0",
- "esbuild": "^0.27.0",
- "fix-dts-default-cjs-exports": "^1.0.0",
- "joycon": "^3.1.1",
- "picocolors": "^1.1.1",
- "postcss-load-config": "^6.0.1",
- "resolve-from": "^5.0.0",
- "rollup": "^4.34.8",
- "source-map": "^0.7.6",
- "sucrase": "^3.35.0",
- "tinyexec": "^0.3.2",
- "tinyglobby": "^0.2.11",
- "tree-kill": "^1.2.2"
- },
- "bin": {
- "tsup": "dist/cli-default.js",
- "tsup-node": "dist/cli-node.js"
- },
- "engines": {
- "node": ">=18"
- },
- "peerDependencies": {
- "@microsoft/api-extractor": "^7.36.0",
- "@swc/core": "^1",
- "postcss": "^8.4.12",
- "typescript": ">=4.5.0"
- },
- "peerDependenciesMeta": {
- "@microsoft/api-extractor": {
- "optional": true
- },
- "@swc/core": {
- "optional": true
- },
- "postcss": {
- "optional": true
- },
- "typescript": {
- "optional": true
- }
- }
- },
- "node_modules/tsup/node_modules/tinyexec": {
- "version": "0.3.2",
- "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz",
- "integrity": "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==",
- "dev": true,
- "license": "MIT"
- },
- "node_modules/typescript": {
- "version": "5.9.3",
- "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
- "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
- "dev": true,
- "license": "Apache-2.0",
- "peer": true,
- "bin": {
- "tsc": "bin/tsc",
- "tsserver": "bin/tsserver"
- },
- "engines": {
- "node": ">=14.17"
- }
- },
- "node_modules/ufo": {
- "version": "1.6.3",
- "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.6.3.tgz",
- "integrity": "sha512-yDJTmhydvl5lJzBmy/hyOAA0d+aqCBuwl818haVdYCRrWV84o7YyeVm4QlVHStqNrrJSTb6jKuFAVqAFsr+K3Q==",
- "dev": true,
- "license": "MIT"
- },
- "node_modules/undici-types": {
- "version": "7.16.0",
- "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz",
- "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==",
- "dev": true,
- "license": "MIT"
- },
- "node_modules/vite": {
- "version": "7.3.1",
- "resolved": "https://registry.npmjs.org/vite/-/vite-7.3.1.tgz",
- "integrity": "sha512-w+N7Hifpc3gRjZ63vYBXA56dvvRlNWRczTdmCBBa+CotUzAPf5b7YMdMR/8CQoeYE5LX3W4wj6RYTgonm1b9DA==",
- "dev": true,
- "license": "MIT",
- "peer": true,
- "dependencies": {
- "esbuild": "^0.27.0",
- "fdir": "^6.5.0",
- "picomatch": "^4.0.3",
- "postcss": "^8.5.6",
- "rollup": "^4.43.0",
- "tinyglobby": "^0.2.15"
- },
- "bin": {
- "vite": "bin/vite.js"
- },
- "engines": {
- "node": "^20.19.0 || >=22.12.0"
- },
- "funding": {
- "url": "https://github.com/vitejs/vite?sponsor=1"
- },
- "optionalDependencies": {
- "fsevents": "~2.3.3"
- },
- "peerDependencies": {
- "@types/node": "^20.19.0 || >=22.12.0",
- "jiti": ">=1.21.0",
- "less": "^4.0.0",
- "lightningcss": "^1.21.0",
- "sass": "^1.70.0",
- "sass-embedded": "^1.70.0",
- "stylus": ">=0.54.8",
- "sugarss": "^5.0.0",
- "terser": "^5.16.0",
- "tsx": "^4.8.1",
- "yaml": "^2.4.2"
- },
- "peerDependenciesMeta": {
- "@types/node": {
- "optional": true
- },
- "jiti": {
- "optional": true
- },
- "less": {
- "optional": true
- },
- "lightningcss": {
- "optional": true
- },
- "sass": {
- "optional": true
- },
- "sass-embedded": {
- "optional": true
- },
- "stylus": {
- "optional": true
- },
- "sugarss": {
- "optional": true
- },
- "terser": {
- "optional": true
- },
- "tsx": {
- "optional": true
- },
- "yaml": {
- "optional": true
- }
- }
- },
- "node_modules/vitest": {
- "version": "4.0.18",
- "resolved": "https://registry.npmjs.org/vitest/-/vitest-4.0.18.tgz",
- "integrity": "sha512-hOQuK7h0FGKgBAas7v0mSAsnvrIgAvWmRFjmzpJ7SwFHH3g1k2u37JtYwOwmEKhK6ZO3v9ggDBBm0La1LCK4uQ==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "@vitest/expect": "4.0.18",
- "@vitest/mocker": "4.0.18",
- "@vitest/pretty-format": "4.0.18",
- "@vitest/runner": "4.0.18",
- "@vitest/snapshot": "4.0.18",
- "@vitest/spy": "4.0.18",
- "@vitest/utils": "4.0.18",
- "es-module-lexer": "^1.7.0",
- "expect-type": "^1.2.2",
- "magic-string": "^0.30.21",
- "obug": "^2.1.1",
- "pathe": "^2.0.3",
- "picomatch": "^4.0.3",
- "std-env": "^3.10.0",
- "tinybench": "^2.9.0",
- "tinyexec": "^1.0.2",
- "tinyglobby": "^0.2.15",
- "tinyrainbow": "^3.0.3",
- "vite": "^6.0.0 || ^7.0.0",
- "why-is-node-running": "^2.3.0"
- },
- "bin": {
- "vitest": "vitest.mjs"
- },
- "engines": {
- "node": "^20.0.0 || ^22.0.0 || >=24.0.0"
- },
- "funding": {
- "url": "https://opencollective.com/vitest"
- },
- "peerDependencies": {
- "@edge-runtime/vm": "*",
- "@opentelemetry/api": "^1.9.0",
- "@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0",
- "@vitest/browser-playwright": "4.0.18",
- "@vitest/browser-preview": "4.0.18",
- "@vitest/browser-webdriverio": "4.0.18",
- "@vitest/ui": "4.0.18",
- "happy-dom": "*",
- "jsdom": "*"
- },
- "peerDependenciesMeta": {
- "@edge-runtime/vm": {
- "optional": true
- },
- "@opentelemetry/api": {
- "optional": true
- },
- "@types/node": {
- "optional": true
- },
- "@vitest/browser-playwright": {
- "optional": true
- },
- "@vitest/browser-preview": {
- "optional": true
- },
- "@vitest/browser-webdriverio": {
- "optional": true
- },
- "@vitest/ui": {
- "optional": true
- },
- "happy-dom": {
- "optional": true
- },
- "jsdom": {
- "optional": true
- }
- }
- },
- "node_modules/vscode-jsonrpc": {
- "version": "8.2.1",
- "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.2.1.tgz",
- "integrity": "sha512-kdjOSJ2lLIn7r1rtrMbbNCHjyMPfRnowdKjBQ+mGq6NAW5QY2bEZC/khaC5OR8svbbjvLEaIXkOq45e2X9BIbQ==",
- "license": "MIT",
- "engines": {
- "node": ">=14.0.0"
- }
- },
- "node_modules/why-is-node-running": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz",
- "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "siginfo": "^2.0.0",
- "stackback": "0.0.2"
- },
- "bin": {
- "why-is-node-running": "cli.js"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/zod": {
- "version": "4.3.6",
- "resolved": "https://registry.npmjs.org/zod/-/zod-4.3.6.tgz",
- "integrity": "sha512-rftlrkhHZOcjDwkGlnUtZZkvaPHCsDATp4pGpuOOMDaTdDDXF91wuVDJoWoPsKX/3YPQ5fHuF3STjcYyKr+Qhg==",
- "license": "MIT",
- "funding": {
- "url": "https://github.com/sponsors/colinhacks"
- }
- }
- }
-}
diff --git a/copilot-client/package.json b/copilot-client/package.json
deleted file mode 100644
index aca7cf8d41..0000000000
--- a/copilot-client/package.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "name": "@github/gh-aw-copilot-client",
- "version": "0.0.1",
- "type": "module",
- "description": "TypeScript client for GitHub Copilot SDK integration with gh-aw",
- "main": "dist/index.js",
- "types": "dist/index.d.ts",
- "bin": {
- "copilot-client": "dist/cli.js"
- },
- "engines": {
- "node": ">=24.0.0"
- },
- "scripts": {
- "build": "tsup",
- "postbuild": "cp dist/index.js ../actions/setup/js/copilot-client.js",
- "test": "vitest run",
- "test:watch": "vitest",
- "typecheck": "tsc --noEmit",
- "clean": "rm -rf dist"
- },
- "dependencies": {
- "@github/copilot-sdk": "^0.1.23",
- "debug": "^4.4.0"
- },
- "devDependencies": {
- "@types/debug": "^4.1.12",
- "@types/node": "^24.0.0",
- "tsup": "^8.5.1",
- "typescript": "^5.9.3",
- "vitest": "^4.0.18"
- }
-}
diff --git a/copilot-client/src/cli.ts b/copilot-client/src/cli.ts
deleted file mode 100644
index 4eb4ed3ed5..0000000000
--- a/copilot-client/src/cli.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/usr/bin/env node
-/**
- * CLI entry point for the Copilot SDK client
- * Reads configuration from GH_AW_COPILOT_CONFIG environment variable and runs a Copilot session
- */
-
-import { main } from './index.js';
-
-main().catch((error) => {
- console.error('Fatal error:', error);
- process.exit(1);
-});
diff --git a/copilot-client/src/index.test.ts b/copilot-client/src/index.test.ts
deleted file mode 100644
index c81957930f..0000000000
--- a/copilot-client/src/index.test.ts
+++ /dev/null
@@ -1,81 +0,0 @@
-/**
- * Tests for the Copilot SDK client
- */
-
-import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
-import { runCopilotSession } from './index.js';
-import type { CopilotClientConfig } from './types.js';
-import { readFileSync, existsSync, unlinkSync, mkdirSync, writeFileSync } from 'fs';
-import { join } from 'path';
-
-describe('CopilotClient', () => {
- const testDir = join(process.cwd(), 'test-output');
- const eventLogFile = join(testDir, 'events.jsonl');
- const promptFile = join(testDir, 'test-prompt.txt');
-
- beforeEach(() => {
- // Create test directory
- mkdirSync(testDir, { recursive: true });
-
- // Create a simple prompt file
- writeFileSync(promptFile, 'What is 2+2?', 'utf-8');
- });
-
- afterEach(() => {
- // Clean up test files
- if (existsSync(eventLogFile)) {
- unlinkSync(eventLogFile);
- }
- if (existsSync(promptFile)) {
- unlinkSync(promptFile);
- }
- });
-
- it('should validate config structure', () => {
- const config: CopilotClientConfig = {
- promptFile: promptFile,
- eventLogFile: eventLogFile,
- githubToken: 'test-token',
- session: {
- model: 'gpt-5'
- }
- };
-
- expect(config.promptFile).toBe(promptFile);
- expect(config.eventLogFile).toBe(eventLogFile);
- expect(config.githubToken).toBe('test-token');
- expect(config.session?.model).toBe('gpt-5');
- });
-
- it('should read prompt from file', () => {
- const prompt = readFileSync(promptFile, 'utf-8');
- expect(prompt).toBe('What is 2+2?');
- });
-
- // Note: Actual integration tests that connect to the Copilot CLI
- // should be run in the CI workflow with proper authentication
- it.skip('should run a simple session', async () => {
- const config: CopilotClientConfig = {
- promptFile: promptFile,
- eventLogFile: eventLogFile,
- githubToken: process.env.COPILOT_GITHUB_TOKEN,
- session: {
- model: 'gpt-5'
- }
- };
-
- await runCopilotSession(config);
-
- // Verify event log was created
- expect(existsSync(eventLogFile)).toBe(true);
-
- // Verify events were logged
- const events = readFileSync(eventLogFile, 'utf-8')
- .split('\n')
- .filter(line => line.trim())
- .map(line => JSON.parse(line));
-
- expect(events.length).toBeGreaterThan(0);
- expect(events[0].type).toBe('prompt.loaded');
- });
-});
diff --git a/copilot-client/src/index.ts b/copilot-client/src/index.ts
deleted file mode 100644
index 84b62c0ab6..0000000000
--- a/copilot-client/src/index.ts
+++ /dev/null
@@ -1,211 +0,0 @@
-/**
- * GitHub Copilot SDK Client
- *
- * This module provides a client for running GitHub Copilot agentic sessions
- * using the @github/copilot-sdk Node.js package.
- */
-
-import { CopilotClient, CopilotSession, type SessionEvent } from '@github/copilot-sdk';
-import { readFileSync, appendFileSync, mkdirSync } from 'fs';
-import { dirname } from 'path';
-import debugFactory from 'debug';
-import type { CopilotClientConfig, LoggedEvent } from './types.js';
-
-const debug = debugFactory('copilot-client');
-
-/**
- * Run a Copilot agentic session with the given configuration
- *
- * @param config - Configuration for the Copilot client
- * @returns Promise that resolves when the session completes
- */
-export async function runCopilotSession(config: CopilotClientConfig): Promise {
- debug('Starting Copilot session with config:', config);
-
- // Ensure event log directory exists
- mkdirSync(dirname(config.eventLogFile), { recursive: true });
-
- // Helper function to log events
- const logEvent = (type: string, data: any, sessionId?: string): void => {
- const event: LoggedEvent = {
- timestamp: new Date().toISOString(),
- type,
- sessionId,
- data
- };
- appendFileSync(config.eventLogFile, JSON.stringify(event) + '\n', 'utf-8');
- debug('Event logged:', type);
- };
-
- // Load prompt from file
- debug('Loading prompt from:', config.promptFile);
- const prompt = readFileSync(config.promptFile, 'utf-8');
- logEvent('prompt.loaded', { file: config.promptFile, length: prompt.length });
-
- // Create Copilot client
- debug('Creating Copilot client');
-
- // When connecting to an existing server (cliUrl), don't pass options for starting a new process
- // These options are mutually exclusive per the Copilot SDK
- const clientOptions: any = {
- logLevel: config.logLevel ?? 'info',
- githubToken: config.githubToken,
- useLoggedInUser: config.useLoggedInUser
- };
-
- if (config.cliUrl) {
- // Connecting to existing server - only pass cliUrl
- clientOptions.cliUrl = config.cliUrl;
- } else {
- // Starting new process - pass process-related options
- clientOptions.cliPath = config.cliPath;
- clientOptions.cliArgs = config.cliArgs;
- clientOptions.port = config.port;
- clientOptions.useStdio = config.useStdio ?? true;
- clientOptions.autoStart = config.autoStart ?? true;
- clientOptions.autoRestart = config.autoRestart ?? true;
- }
-
- const client = new CopilotClient(clientOptions);
-
- logEvent('client.created', {
- cliPath: config.cliPath,
- useStdio: config.useStdio,
- logLevel: config.logLevel
- });
-
- // Start the client
- debug('Starting Copilot client');
- await client.start();
- logEvent('client.started', {});
-
- let session: CopilotSession | null = null;
-
- try {
- // Create session
- debug('Creating Copilot session');
- session = await client.createSession({
- model: config.session?.model,
- reasoningEffort: config.session?.reasoningEffort,
- systemMessage: config.session?.systemMessage ? {
- mode: 'replace',
- content: config.session.systemMessage
- } : undefined,
- mcpServers: config.session?.mcpServers
- });
-
- logEvent('session.created', {
- sessionId: session.sessionId,
- model: config.session?.model
- }, session.sessionId);
-
- // Set up event handlers
- debug('Setting up event handlers');
-
- // Listen to all events and log them
- session.on((event: SessionEvent) => {
- logEvent(`session.${event.type}`, event.data, session!.sessionId);
-
- // Also log to debug
- debug('Session event:', event.type, event.data);
- });
-
- // Wait for completion
- const done = new Promise((resolve, reject) => {
- let lastAssistantMessage: any = null;
-
- session!.on('assistant.message', (event) => {
- lastAssistantMessage = event.data;
- debug('Assistant message:', event.data.content);
- });
-
- session!.on('session.idle', () => {
- debug('Session became idle');
- resolve();
- });
-
- session!.on('session.error', (event) => {
- debug('Session error:', event.data);
- reject(new Error(event.data.message || 'Session error'));
- });
- });
-
- // Send the prompt
- debug('Sending prompt');
- await session.send({ prompt });
- logEvent('prompt.sent', { prompt }, session.sessionId);
-
- // Wait for completion
- debug('Waiting for session to complete');
- await done;
-
- debug('Session completed successfully');
- logEvent('session.completed', {}, session.sessionId);
-
- } catch (error) {
- const errorMessage = error instanceof Error ? error.message : String(error);
- debug('Error during session:', errorMessage);
- logEvent('session.error', { error: errorMessage }, session?.sessionId);
- throw error;
- } finally {
- // Clean up
- if (session) {
- debug('Destroying session');
- try {
- await session.destroy();
- logEvent('session.destroyed', {}, session.sessionId);
- } catch (error) {
- debug('Error destroying session:', error);
- }
- }
-
- debug('Stopping client');
- try {
- const errors = await client.stop();
- if (errors.length > 0) {
- debug('Errors during client stop:', errors);
- logEvent('client.stopped', { errors: errors.map(e => e.message) });
- } else {
- logEvent('client.stopped', {});
- }
- } catch (error) {
- debug('Error stopping client:', error);
- }
- }
-}
-
-/**
- * Main entry point - reads config from environment variable
- */
-export async function main(): Promise {
- debug('Reading configuration from GH_AW_COPILOT_CONFIG environment variable');
-
- const configJson = process.env.GH_AW_COPILOT_CONFIG;
- if (!configJson) {
- console.error('Error: GH_AW_COPILOT_CONFIG environment variable is not set');
- console.error('Please set the GH_AW_COPILOT_CONFIG environment variable with JSON configuration');
- process.exit(1);
- }
-
- let config: CopilotClientConfig;
- try {
- config = JSON.parse(configJson);
- } catch (error) {
- console.error('Failed to parse configuration JSON:', error);
- process.exit(1);
- }
-
- debug('Parsed config:', config);
-
- try {
- await runCopilotSession(config);
- debug('Session completed successfully');
- process.exit(0);
- } catch (error) {
- console.error('Error running Copilot session:', error);
- process.exit(1);
- }
-}
-
-// Export for testing
-export type { CopilotClientConfig, LoggedEvent } from './types.js';
diff --git a/copilot-client/src/types.ts b/copilot-client/src/types.ts
deleted file mode 100644
index a0c338296f..0000000000
--- a/copilot-client/src/types.ts
+++ /dev/null
@@ -1,109 +0,0 @@
-/**
- * Configuration for the Copilot SDK client
- */
-export interface CopilotClientConfig {
- /**
- * Path to the copilot CLI executable (default: "copilot" from PATH)
- */
- cliPath?: string;
-
- /**
- * Extra arguments prepended before SDK-managed flags
- */
- cliArgs?: string[];
-
- /**
- * URL of existing CLI server to connect to
- */
- cliUrl?: string;
-
- /**
- * Server port (default: 0 for random)
- */
- port?: number;
-
- /**
- * Use stdio transport instead of TCP (default: true)
- */
- useStdio?: boolean;
-
- /**
- * Log level (default: "info")
- */
- logLevel?: "none" | "error" | "warning" | "info" | "debug" | "all";
-
- /**
- * Auto-start server (default: true)
- */
- autoStart?: boolean;
-
- /**
- * Auto-restart on crash (default: true)
- */
- autoRestart?: boolean;
-
- /**
- * GitHub token for authentication
- */
- githubToken?: string;
-
- /**
- * Whether to use logged-in user for authentication
- */
- useLoggedInUser?: boolean;
-
- /**
- * Session configuration
- */
- session?: {
- /**
- * Model to use (e.g., "gpt-5", "claude-sonnet-4.5")
- */
- model?: string;
-
- /**
- * Reasoning effort level
- */
- reasoningEffort?: "low" | "medium" | "high" | "xhigh";
-
- /**
- * System message configuration
- */
- systemMessage?: string;
-
- /**
- * MCP server configurations for the session.
- * Keys are server names, values are server configurations.
- * Example:
- * {
- * "myserver": {
- * "type": "http",
- * "url": "https://example.com/mcp",
- * "tools": ["*"],
- * "headers": { "Authorization": "Bearer token" }
- * }
- * }
- */
- mcpServers?: Record;
- };
-
- /**
- * Path to the prompt file to load
- */
- promptFile: string;
-
- /**
- * Path to the JSONL event log file
- */
- eventLogFile: string;
-}
-
-/**
- * Event logged to the JSONL file
- */
-export interface LoggedEvent {
- timestamp: string;
- type: string;
- sessionId?: string;
- data: any;
-}
diff --git a/copilot-client/test-local.sh b/copilot-client/test-local.sh
deleted file mode 100755
index b84ad62b2e..0000000000
--- a/copilot-client/test-local.sh
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/bin/bash
-# Local test script for copilot-client
-# This simulates what the CI workflow does
-
-set -e
-
-echo "=== Testing copilot-client locally ==="
-
-# Check if copilot CLI is available
-if ! command -v copilot &> /dev/null; then
- echo "Error: copilot CLI not found. Install with: npm install -g @github/copilot"
- exit 1
-fi
-
-# Check if COPILOT_GITHUB_TOKEN is set
-if [ -z "$COPILOT_GITHUB_TOKEN" ]; then
- echo "Warning: COPILOT_GITHUB_TOKEN not set. The test may fail."
- echo "Set it with: export COPILOT_GITHUB_TOKEN=ghp_..."
-fi
-
-# Create test directory
-mkdir -p /tmp/copilot-client-test
-mkdir -p /tmp/copilot-logs
-
-# Create test prompt
-echo "What is 2+2? Answer briefly in one sentence." > /tmp/copilot-client-test/prompt.txt
-
-# Build the client
-echo "Building copilot-client..."
-npm run build
-
-# Create configuration
-cat > /tmp/copilot-client-test/config.json << 'EOFCONFIG'
-{
- "promptFile": "/tmp/copilot-client-test/prompt.txt",
- "eventLogFile": "/tmp/copilot-client-test/events.jsonl",
- "githubToken": "${COPILOT_GITHUB_TOKEN}",
- "logLevel": "info",
- "session": {
- "model": "gpt-5"
- }
-}
-EOFCONFIG
-
-# Replace token placeholder
-if [ -n "$COPILOT_GITHUB_TOKEN" ]; then
- sed -i "s/\${COPILOT_GITHUB_TOKEN}/$COPILOT_GITHUB_TOKEN/g" /tmp/copilot-client-test/config.json
-fi
-
-echo "Configuration:"
-cat /tmp/copilot-client-test/config.json
-
-# Run the client with debug logging
-echo ""
-echo "Running copilot-client..."
-DEBUG=copilot-client cat /tmp/copilot-client-test/config.json | node -e "import('./dist/index.js').then(m => m.main())"
-
-# Check results
-echo ""
-echo "=== Test Results ==="
-if [ -f /tmp/copilot-client-test/events.jsonl ]; then
- EVENT_COUNT=$(wc -l < /tmp/copilot-client-test/events.jsonl)
- echo "✓ Event log created with $EVENT_COUNT events"
- echo ""
- echo "Events:"
- cat /tmp/copilot-client-test/events.jsonl | jq -r '.type' 2>/dev/null || cat /tmp/copilot-client-test/events.jsonl
-else
- echo "✗ Event log not created"
- exit 1
-fi
-
-echo ""
-echo "=== Test completed successfully ==="
diff --git a/copilot-client/tsconfig.json b/copilot-client/tsconfig.json
deleted file mode 100644
index 5ae23d58de..0000000000
--- a/copilot-client/tsconfig.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "compilerOptions": {
- "target": "ES2024",
- "module": "ES2022",
- "lib": ["ES2024"],
- "moduleResolution": "bundler",
- "outDir": "./dist",
- "rootDir": "./src",
- "declaration": true,
- "declarationMap": true,
- "sourceMap": true,
- "strict": true,
- "esModuleInterop": true,
- "skipLibCheck": true,
- "forceConsistentCasingInFileNames": true,
- "resolveJsonModule": true,
- "allowSyntheticDefaultImports": true,
- "types": ["node", "vitest/globals"]
- },
- "include": ["src/**/*"],
- "exclude": ["node_modules", "dist", "**/*.test.ts"]
-}
diff --git a/copilot-client/tsup.config.ts b/copilot-client/tsup.config.ts
deleted file mode 100644
index 2c047898ad..0000000000
--- a/copilot-client/tsup.config.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-import { defineConfig } from 'tsup';
-
-export default defineConfig({
- entry: {
- index: 'src/index.ts',
- },
- format: ['esm'],
- target: 'es2024',
- platform: 'node',
- outDir: 'dist',
- dts: true,
- sourcemap: true,
- clean: true,
- bundle: true,
- splitting: false,
- treeshake: true,
- minify: false,
- // Bundle all dependencies (no external dependencies)
- noExternal: [/.*/],
-});
diff --git a/copilot-client/vitest.config.ts b/copilot-client/vitest.config.ts
deleted file mode 100644
index dd6f6875c0..0000000000
--- a/copilot-client/vitest.config.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { defineConfig } from 'vitest/config';
-
-export default defineConfig({
- test: {
- globals: true,
- environment: 'node',
- include: ['src/**/*.test.ts'],
- coverage: {
- provider: 'v8',
- reporter: ['text', 'json', 'html'],
- exclude: ['**/*.test.ts', 'dist/**', 'scripts/**']
- }
- }
-});
diff --git a/pkg/cli/completions_test.go b/pkg/cli/completions_test.go
index 2bc41e7971..713f664c16 100644
--- a/pkg/cli/completions_test.go
+++ b/pkg/cli/completions_test.go
@@ -245,22 +245,22 @@ func TestCompleteEngineNames(t *testing.T) {
{
name: "empty prefix returns all engines",
toComplete: "",
- wantLen: 5, // copilot, copilot-sdk, claude, codex, custom
+ wantLen: 4, // copilot, claude, codex, custom
},
{
- name: "c prefix returns claude, codex, copilot, copilot-sdk, custom",
+ name: "c prefix returns claude, codex, copilot, custom",
toComplete: "c",
- wantLen: 5,
+ wantLen: 4,
},
{
- name: "co prefix returns copilot, copilot-sdk, codex",
+ name: "co prefix returns copilot, codex",
toComplete: "co",
- wantLen: 3,
+ wantLen: 2,
},
{
- name: "cop prefix returns copilot, copilot-sdk",
+ name: "cop prefix returns copilot",
toComplete: "cop",
- wantLen: 2,
+ wantLen: 1,
},
{
name: "x prefix returns nothing",
@@ -702,9 +702,8 @@ func TestCompleteEngineNamesExactMatch(t *testing.T) {
// Test exact match - should still return the matching engine
completions, directive := CompleteEngineNames(cmd, nil, "copilot")
assert.Equal(t, cobra.ShellCompDirectiveNoFileComp, directive)
- assert.Len(t, completions, 2, "Should return copilot and copilot-sdk")
+ assert.Len(t, completions, 1, "Should return copilot")
assert.Contains(t, completions, "copilot")
- assert.Contains(t, completions, "copilot-sdk")
}
// TestCompleteEngineNamesCaseSensitivity tests engine name completion is case-sensitive
@@ -719,7 +718,7 @@ func TestCompleteEngineNamesCaseSensitivity(t *testing.T) {
{
name: "lowercase copilot",
toComplete: "copilot",
- wantLen: 2, // copilot and copilot-sdk
+ wantLen: 1, // copilot
},
{
name: "uppercase COPILOT should not match",
diff --git a/pkg/cli/engine_secrets.go b/pkg/cli/engine_secrets.go
index 2f57f5b6a0..4f76f38977 100644
--- a/pkg/cli/engine_secrets.go
+++ b/pkg/cli/engine_secrets.go
@@ -90,7 +90,7 @@ func getSecretRequirementsForEngine(engine string, includeSystemSecrets bool, in
// getEngineSecretDescription returns a detailed description for an engine secret
func getEngineSecretDescription(opt *constants.EngineOption) string {
switch opt.Value {
- case string(constants.CopilotEngine), string(constants.CopilotSDKEngine):
+ case string(constants.CopilotEngine):
return "Fine-grained PAT with Copilot Requests permission and repo access where Copilot workflows run."
case string(constants.ClaudeEngine):
return "API key from Anthropic Console for Claude API access."
@@ -189,7 +189,7 @@ func ensureSecretAvailable(req SecretRequirement, config EngineSecretConfig) err
if envValue != "" {
// Validate if it's a Copilot token
- if req.IsEngineSecret && (req.EngineName == string(constants.CopilotEngine) || req.EngineName == string(constants.CopilotSDKEngine)) {
+ if req.IsEngineSecret && req.EngineName == string(constants.CopilotEngine) {
if err := stringutil.ValidateCopilotPAT(envValue); err != nil {
fmt.Fprintln(os.Stderr, console.FormatWarningMessage(fmt.Sprintf("%s in environment is not a valid fine-grained PAT: %s", req.Name, stringutil.GetPATTypeDescription(envValue))))
fmt.Fprintln(os.Stderr, console.FormatErrorMessage(err.Error()))
@@ -221,7 +221,7 @@ func promptForSecret(req SecretRequirement, config EngineSecretConfig) error {
engineSecretsLog.Printf("Prompting for secret: %s", req.Name)
// Copilot requires special handling with PAT creation instructions
- if req.IsEngineSecret && (req.EngineName == string(constants.CopilotEngine) || req.EngineName == string(constants.CopilotSDKEngine)) {
+ if req.IsEngineSecret && req.EngineName == string(constants.CopilotEngine) {
return promptForCopilotPATUnified(req, config)
}
diff --git a/pkg/cli/engine_secrets_test.go b/pkg/cli/engine_secrets_test.go
index f2f64cff7f..4a389b4973 100644
--- a/pkg/cli/engine_secrets_test.go
+++ b/pkg/cli/engine_secrets_test.go
@@ -234,11 +234,6 @@ func TestGetEngineSecretDescription(t *testing.T) {
engineValue: string(constants.CopilotEngine),
wantContains: "Fine-grained PAT",
},
- {
- name: "copilot-sdk engine description",
- engineValue: string(constants.CopilotSDKEngine),
- wantContains: "Fine-grained PAT",
- },
{
name: "claude engine description",
engineValue: string(constants.ClaudeEngine),
diff --git a/pkg/constants/constants.go b/pkg/constants/constants.go
index 3b477e48bf..1d199c9af5 100644
--- a/pkg/constants/constants.go
+++ b/pkg/constants/constants.go
@@ -301,9 +301,6 @@ const (
// CodexLLMGatewayPort is the port for the Codex LLM gateway
CodexLLMGatewayPort = 10001
- // CopilotSDKLLMGatewayPort is the port for the Copilot SDK LLM gateway
- CopilotSDKLLMGatewayPort = 10002
-
// CopilotLLMGatewayPort is the port for the Copilot LLM gateway
CopilotLLMGatewayPort = 10002
)
@@ -679,8 +676,6 @@ const DefaultRateLimitWindow = 60 // Default time window in minutes (1 hour)
const (
// CopilotEngine is the GitHub Copilot engine identifier
CopilotEngine EngineName = "copilot"
- // CopilotSDKEngine is the GitHub Copilot SDK engine identifier
- CopilotSDKEngine EngineName = "copilot-sdk"
// ClaudeEngine is the Anthropic Claude engine identifier
ClaudeEngine EngineName = "claude"
// CodexEngine is the OpenAI Codex engine identifier
@@ -691,7 +686,7 @@ const (
// AgenticEngines lists all supported agentic engine names
// Note: This remains a string slice for backward compatibility with existing code
-var AgenticEngines = []string{string(ClaudeEngine), string(CodexEngine), string(CopilotEngine), string(CopilotSDKEngine)}
+var AgenticEngines = []string{string(ClaudeEngine), string(CodexEngine), string(CopilotEngine)}
// EngineOption represents a selectable AI engine with its display metadata and secret configuration
type EngineOption struct {
@@ -715,14 +710,6 @@ var EngineOptions = []EngineOption{
KeyURL: "https://github.com/settings/personal-access-tokens/new",
WhenNeeded: "Copilot workflows (CLI, engine, agent tasks, etc.)",
},
- {
- Value: string(CopilotSDKEngine),
- Label: "GitHub Copilot SDK",
- Description: "GitHub Copilot SDK with headless mode",
- SecretName: "COPILOT_GITHUB_TOKEN",
- KeyURL: "https://github.com/settings/personal-access-tokens/new",
- WhenNeeded: "Copilot SDK workflows with headless mode",
- },
{
Value: string(ClaudeEngine),
Label: "Claude",
diff --git a/pkg/constants/constants_test.go b/pkg/constants/constants_test.go
index 07388267b3..cded23c3b8 100644
--- a/pkg/constants/constants_test.go
+++ b/pkg/constants/constants_test.go
@@ -83,7 +83,7 @@ func TestAgenticEngines(t *testing.T) {
t.Error("AgenticEngines should not be empty")
}
- expectedEngines := []string{"claude", "codex", "copilot", "copilot-sdk"}
+ expectedEngines := []string{"claude", "codex", "copilot"}
if len(AgenticEngines) != len(expectedEngines) {
t.Errorf("AgenticEngines length = %d, want %d", len(AgenticEngines), len(expectedEngines))
}
@@ -104,9 +104,6 @@ func TestAgenticEngines(t *testing.T) {
if string(CopilotEngine) != "copilot" {
t.Errorf("CopilotEngine constant = %q, want %q", CopilotEngine, "copilot")
}
- if string(CopilotSDKEngine) != "copilot-sdk" {
- t.Errorf("CopilotSDKEngine constant = %q, want %q", CopilotSDKEngine, "copilot-sdk")
- }
if string(CustomEngine) != "custom" {
t.Errorf("CustomEngine constant = %q, want %q", CustomEngine, "custom")
}
diff --git a/pkg/parser/schemas/main_workflow_schema.json b/pkg/parser/schemas/main_workflow_schema.json
index 1e498f6d26..e5add330fd 100644
--- a/pkg/parser/schemas/main_workflow_schema.json
+++ b/pkg/parser/schemas/main_workflow_schema.json
@@ -6787,8 +6787,8 @@
"oneOf": [
{
"type": "string",
- "enum": ["claude", "codex", "copilot", "copilot-sdk", "custom"],
- "description": "Simple engine name: 'claude' (default, Claude Code), 'copilot' (GitHub Copilot CLI), 'copilot-sdk' (GitHub Copilot SDK), 'codex' (OpenAI Codex CLI), or 'custom' (user-defined steps)"
+ "enum": ["claude", "codex", "copilot", "custom"],
+ "description": "Simple engine name: 'claude' (default, Claude Code), 'copilot' (GitHub Copilot CLI), 'codex' (OpenAI Codex CLI), or 'custom' (user-defined steps)"
},
{
"type": "object",
@@ -6796,8 +6796,8 @@
"properties": {
"id": {
"type": "string",
- "enum": ["claude", "codex", "custom", "copilot", "copilot-sdk"],
- "description": "AI engine identifier: 'claude' (Claude Code), 'codex' (OpenAI Codex CLI), 'copilot' (GitHub Copilot CLI), 'copilot-sdk' (GitHub Copilot SDK), or 'custom' (user-defined GitHub Actions steps)"
+ "enum": ["claude", "codex", "custom", "copilot"],
+ "description": "AI engine identifier: 'claude' (Claude Code), 'codex' (OpenAI Codex CLI), 'copilot' (GitHub Copilot CLI), or 'custom' (user-defined GitHub Actions steps)"
},
"version": {
"type": ["string", "number"],
diff --git a/pkg/workflow/agentic_engine.go b/pkg/workflow/agentic_engine.go
index 72241b111f..0cf3aa0bea 100644
--- a/pkg/workflow/agentic_engine.go
+++ b/pkg/workflow/agentic_engine.go
@@ -307,7 +307,6 @@ func NewEngineRegistry() *EngineRegistry {
registry.Register(NewClaudeEngine())
registry.Register(NewCodexEngine())
registry.Register(NewCopilotEngine())
- registry.Register(NewCopilotSDKEngine())
registry.Register(NewCustomEngine())
agenticEngineLog.Printf("Registered %d engines", len(registry.engines))
diff --git a/pkg/workflow/agentic_engine_test.go b/pkg/workflow/agentic_engine_test.go
index acd1723565..8933cccad0 100644
--- a/pkg/workflow/agentic_engine_test.go
+++ b/pkg/workflow/agentic_engine_test.go
@@ -11,8 +11,8 @@ func TestEngineRegistry(t *testing.T) {
// Test that built-in engines are registered
supportedEngines := registry.GetSupportedEngines()
- if len(supportedEngines) != 5 {
- t.Errorf("Expected 5 supported engines, got %d", len(supportedEngines))
+ if len(supportedEngines) != 4 {
+ t.Errorf("Expected 4 supported engines, got %d", len(supportedEngines))
}
// Test getting engines by ID
@@ -118,7 +118,7 @@ func TestEngineRegistryCustomEngine(t *testing.T) {
// Test that supported engines list is updated
supportedEngines := registry.GetSupportedEngines()
- if len(supportedEngines) != 6 {
- t.Errorf("Expected 6 supported engines after adding test-custom, got %d", len(supportedEngines))
+ if len(supportedEngines) != 5 {
+ t.Errorf("Expected 5 supported engines after adding test-custom, got %d", len(supportedEngines))
}
}
diff --git a/pkg/workflow/copilot_sdk_engine.go b/pkg/workflow/copilot_sdk_engine.go
deleted file mode 100644
index 95351f275f..0000000000
--- a/pkg/workflow/copilot_sdk_engine.go
+++ /dev/null
@@ -1,258 +0,0 @@
-// This file implements the GitHub Copilot SDK agentic engine.
-//
-// The Copilot SDK engine is a variant of the Copilot engine that uses the
-// Copilot SDK Node.js client instead of directly invoking the copilot CLI.
-// This approach starts the CLI in headless mode on a specific port and uses
-// the copilot-client.js wrapper to communicate with it.
-//
-// Key differences from the standard Copilot engine:
-// - Starts Copilot CLI in headless mode on a dedicated port
-// - Uses copilot-client.js wrapper via Node.js
-// - Passes configuration via GH_AW_COPILOT_CONFIG environment variable
-// - Uses Docker internal host domain for MCP server connections
-//
-// This implementation follows the same module organization as copilot_engine.go.
-
-package workflow
-
-import (
- "encoding/json"
- "fmt"
- "strings"
-
- "github.com/github/gh-aw/pkg/constants"
- "github.com/github/gh-aw/pkg/logger"
-)
-
-var copilotSDKLog = logger.New("workflow:copilot_sdk_engine")
-
-// CopilotSDKEngine represents the GitHub Copilot SDK agentic engine
-type CopilotSDKEngine struct {
- BaseEngine
-}
-
-// NewCopilotSDKEngine creates a new Copilot SDK engine instance
-func NewCopilotSDKEngine() *CopilotSDKEngine {
- copilotSDKLog.Print("Creating new Copilot SDK engine instance")
- return &CopilotSDKEngine{
- BaseEngine: BaseEngine{
- id: "copilot-sdk",
- displayName: "GitHub Copilot SDK",
- description: "Uses GitHub Copilot SDK with headless mode",
- experimental: true,
- supportsToolsAllowlist: true,
- supportsMaxTurns: false,
- supportsWebFetch: true,
- supportsWebSearch: false,
- supportsFirewall: false, // SDK mode doesn't use firewall/sandbox
- supportsPlugins: false, // SDK mode doesn't support plugins yet
- supportsLLMGateway: false,
- },
- }
-}
-
-// SupportsLLMGateway returns the LLM gateway port for Copilot SDK engine
-func (e *CopilotSDKEngine) SupportsLLMGateway() int {
- return constants.CopilotSDKLLMGatewayPort
-}
-
-// GetDefaultDetectionModel returns the default model for threat detection
-func (e *CopilotSDKEngine) GetDefaultDetectionModel() string {
- return string(constants.DefaultCopilotDetectionModel)
-}
-
-// GetRequiredSecretNames returns the list of secrets required by the Copilot SDK engine
-func (e *CopilotSDKEngine) GetRequiredSecretNames(workflowData *WorkflowData) []string {
- copilotSDKLog.Print("Collecting required secrets for Copilot SDK engine")
- secrets := []string{"COPILOT_GITHUB_TOKEN"}
-
- // Add MCP gateway API key if MCP servers are present
- if HasMCPServers(workflowData) {
- copilotSDKLog.Print("Adding MCP_GATEWAY_API_KEY secret")
- secrets = append(secrets, "MCP_GATEWAY_API_KEY")
- }
-
- // Add GitHub token for GitHub MCP server if present
- if hasGitHubTool(workflowData.ParsedTools) {
- copilotSDKLog.Print("Adding GITHUB_MCP_SERVER_TOKEN secret")
- secrets = append(secrets, "GITHUB_MCP_SERVER_TOKEN")
- }
-
- // Add HTTP MCP header secret names
- headerSecrets := collectHTTPMCPHeaderSecrets(workflowData.Tools)
- for varName := range headerSecrets {
- secrets = append(secrets, varName)
- }
- if len(headerSecrets) > 0 {
- copilotSDKLog.Printf("Added %d HTTP MCP header secrets", len(headerSecrets))
- }
-
- copilotSDKLog.Printf("Total required secrets: %d", len(secrets))
- return secrets
-}
-
-// GetDeclaredOutputFiles returns the list of output files that may be produced
-func (e *CopilotSDKEngine) GetDeclaredOutputFiles() []string {
- return []string{
- "/tmp/gh-aw/copilot-sdk/event-log.jsonl", // Event log from copilot-client
- }
-}
-
-// GetInstallationSteps returns the GitHub Actions steps for installing Copilot SDK
-func (e *CopilotSDKEngine) GetInstallationSteps(workflowData *WorkflowData) []GitHubActionStep {
- copilotSDKLog.Printf("Generating installation steps for Copilot SDK: workflow=%s", workflowData.Name)
-
- // Use the same installation steps as the standard Copilot engine
- // This will install the Copilot CLI and validate secrets
- copilotEngine := NewCopilotEngine()
- return copilotEngine.GetInstallationSteps(workflowData)
-}
-
-// GetExecutionSteps returns the GitHub Actions steps for executing Copilot SDK
-func (e *CopilotSDKEngine) GetExecutionSteps(workflowData *WorkflowData, logFile string) []GitHubActionStep {
- copilotSDKLog.Printf("Generating execution steps for Copilot SDK: workflow=%s", workflowData.Name)
-
- var steps []GitHubActionStep
-
- // Step 1: Start Copilot CLI in headless mode
- steps = append(steps, e.generateCopilotHeadlessStep())
-
- // Step 2: Prepare copilot-client configuration
- steps = append(steps, e.generateConfigurationStep(workflowData))
-
- // Step 3: Execute copilot-client.js
- steps = append(steps, e.generateClientExecutionStep(workflowData))
-
- return steps
-}
-
-// generateCopilotHeadlessStep creates a step to start Copilot CLI in headless mode
-func (e *CopilotSDKEngine) generateCopilotHeadlessStep() GitHubActionStep {
- var stepLines []string
- stepLines = append(stepLines, " - name: Start Copilot CLI in headless mode")
- stepLines = append(stepLines, " run: |")
- stepLines = append(stepLines, fmt.Sprintf(" # Start Copilot CLI in headless mode on port %d", constants.CopilotSDKLLMGatewayPort))
- stepLines = append(stepLines, fmt.Sprintf(" copilot --headless --port %d &", constants.CopilotSDKLLMGatewayPort))
- stepLines = append(stepLines, " COPILOT_PID=$!")
- stepLines = append(stepLines, " echo \"COPILOT_PID=${COPILOT_PID}\" >> $GITHUB_ENV")
- stepLines = append(stepLines, " ")
- stepLines = append(stepLines, " # Wait for Copilot to be ready")
- stepLines = append(stepLines, " sleep 5")
- stepLines = append(stepLines, " ")
- stepLines = append(stepLines, " # Verify Copilot is running")
- stepLines = append(stepLines, " if ! kill -0 ${COPILOT_PID} 2>/dev/null; then")
- stepLines = append(stepLines, " echo \"::error::Copilot CLI failed to start\"")
- stepLines = append(stepLines, " exit 1")
- stepLines = append(stepLines, " fi")
- stepLines = append(stepLines, " ")
- stepLines = append(stepLines, fmt.Sprintf(" echo \"✓ Copilot CLI started in headless mode on port %d\"", constants.CopilotSDKLLMGatewayPort))
-
- return GitHubActionStep(stepLines)
-}
-
-// generateConfigurationStep creates a step to prepare the copilot-client configuration
-func (e *CopilotSDKEngine) generateConfigurationStep(workflowData *WorkflowData) GitHubActionStep {
- // Build the configuration JSON
- config := map[string]any{
- "cliUrl": fmt.Sprintf("http://host.docker.internal:%d", constants.CopilotSDKLLMGatewayPort), // Use Docker internal host with LLM gateway port
- "promptFile": "/tmp/gh-aw/aw-prompts/prompt.txt",
- "eventLogFile": "/tmp/gh-aw/copilot-sdk/event-log.jsonl",
- "githubToken": "${{ secrets.COPILOT_GITHUB_TOKEN }}",
- "logLevel": "info",
- }
-
- // Add model if specified
- if workflowData.EngineConfig != nil && workflowData.EngineConfig.Model != "" {
- config["session"] = map[string]any{
- "model": workflowData.EngineConfig.Model,
- }
- }
-
- // Serialize configuration to JSON
- configJSON, err := json.Marshal(config)
- if err != nil {
- copilotSDKLog.Printf("Error marshaling config: %v", err)
- return []string{
- " - name: Configure Copilot SDK client",
- " run: |",
- fmt.Sprintf(" echo \"::error::Failed to marshal Copilot SDK configuration: %v\"", err),
- " exit 1",
- }
- }
-
- var stepLines []string
- stepLines = append(stepLines, " - name: Configure Copilot SDK client")
- stepLines = append(stepLines, " run: |")
- stepLines = append(stepLines, " # Create directory for event log")
- stepLines = append(stepLines, " mkdir -p /tmp/gh-aw/copilot-sdk/")
- stepLines = append(stepLines, " ")
- stepLines = append(stepLines, " # Set configuration via environment variable")
- stepLines = append(stepLines, fmt.Sprintf(" echo 'GH_AW_COPILOT_CONFIG=%s' >> $GITHUB_ENV", string(configJSON)))
-
- return GitHubActionStep(stepLines)
-}
-
-// generateClientExecutionStep creates a step to execute copilot-client.js
-func (e *CopilotSDKEngine) generateClientExecutionStep(workflowData *WorkflowData) GitHubActionStep {
- var stepLines []string
- stepLines = append(stepLines, " - name: Execute Copilot SDK client")
- stepLines = append(stepLines, " id: agentic_execution")
- stepLines = append(stepLines, " run: |")
- stepLines = append(stepLines, " # Execute copilot-client.js with Node.js")
- stepLines = append(stepLines, " # Configuration is read from GH_AW_COPILOT_CONFIG environment variable")
- stepLines = append(stepLines, " node /opt/gh-aw/copilot/copilot-client.js")
- stepLines = append(stepLines, " ")
- stepLines = append(stepLines, " # Check exit code")
- stepLines = append(stepLines, " if [ $? -ne 0 ]; then")
- stepLines = append(stepLines, " echo \"::error::Copilot SDK client execution failed\"")
- stepLines = append(stepLines, " exit 1")
- stepLines = append(stepLines, " fi")
- stepLines = append(stepLines, " ")
- stepLines = append(stepLines, " echo \"✓ Copilot SDK client execution completed\"")
- stepLines = append(stepLines, " env:")
- stepLines = append(stepLines, " GH_AW_COPILOT_CONFIG: ${{ env.GH_AW_COPILOT_CONFIG }}")
-
- return GitHubActionStep(stepLines)
-}
-
-// RenderMCPConfig renders MCP server configuration for Copilot SDK
-// This uses the Docker internal host domain for server URLs
-func (e *CopilotSDKEngine) RenderMCPConfig(yaml *strings.Builder, tools map[string]any, mcpTools []string, workflowData *WorkflowData) {
- copilotSDKLog.Print("Rendering MCP configuration for Copilot SDK")
-
- // Use the same MCP rendering as standard Copilot engine
- copilotEngine := NewCopilotEngine()
-
- // Create a temporary builder to capture the output
- var tempBuilder strings.Builder
- copilotEngine.RenderMCPConfig(&tempBuilder, tools, mcpTools, workflowData)
-
- // Replace localhost with Docker internal host domain
- config := tempBuilder.String()
- config = strings.ReplaceAll(config, "localhost", "host.docker.internal")
- config = strings.ReplaceAll(config, "127.0.0.1", "host.docker.internal")
-
- // Write to the output builder
- yaml.WriteString(config)
-}
-
-// ParseLogMetrics parses log metrics from the Copilot SDK engine output
-func (e *CopilotSDKEngine) ParseLogMetrics(logContent string, verbose bool) LogMetrics {
- copilotSDKLog.Print("Parsing log metrics for Copilot SDK")
-
- // For now, return minimal metrics
- // The event log is in JSONL format and could be parsed for detailed metrics
- var metrics LogMetrics
-
- return metrics
-}
-
-// GetLogParserScriptId returns the script ID for log parsing
-func (e *CopilotSDKEngine) GetLogParserScriptId() string {
- return "parse-copilot-log"
-}
-
-// GetLogFileForParsing returns the path to the log file that should be parsed
-func (e *CopilotSDKEngine) GetLogFileForParsing() string {
- return "/tmp/gh-aw/copilot-sdk/event-log.jsonl"
-}
diff --git a/pkg/workflow/copilot_sdk_engine_test.go b/pkg/workflow/copilot_sdk_engine_test.go
deleted file mode 100644
index 4b9edab658..0000000000
--- a/pkg/workflow/copilot_sdk_engine_test.go
+++ /dev/null
@@ -1,179 +0,0 @@
-//go:build !integration
-
-package workflow
-
-import (
- "fmt"
- "strings"
- "testing"
-
- "github.com/github/gh-aw/pkg/constants"
- "github.com/stretchr/testify/assert"
-)
-
-func TestCopilotSDKEngineImplementsCodingAgentEngine(t *testing.T) {
- engine := NewCopilotSDKEngine()
-
- // Test basic Engine interface
- assert.Equal(t, "copilot-sdk", engine.GetID())
- assert.Equal(t, "GitHub Copilot SDK", engine.GetDisplayName())
- assert.Contains(t, engine.GetDescription(), "SDK")
- assert.True(t, engine.IsExperimental())
-}
-
-func TestCopilotSDKEngineCapabilities(t *testing.T) {
- engine := NewCopilotSDKEngine()
-
- // Test CapabilityProvider interface
- assert.True(t, engine.SupportsToolsAllowlist())
- assert.False(t, engine.SupportsMaxTurns())
- assert.True(t, engine.SupportsWebFetch())
- assert.False(t, engine.SupportsWebSearch())
- assert.False(t, engine.SupportsFirewall(), "SDK mode doesn't use firewall")
- assert.False(t, engine.SupportsPlugins(), "SDK mode doesn't support plugins yet")
- assert.Equal(t, constants.CopilotSDKLLMGatewayPort, engine.SupportsLLMGateway(), "Copilot SDK uses dedicated port for LLM gateway")
-}
-
-func TestCopilotSDKEngineGetRequiredSecretNames(t *testing.T) {
- engine := NewCopilotSDKEngine()
- workflowData := &WorkflowData{
- Name: "test-workflow",
- }
-
- secrets := engine.GetRequiredSecretNames(workflowData)
-
- assert.Contains(t, secrets, "COPILOT_GITHUB_TOKEN")
- assert.NotContains(t, secrets, "MCP_GATEWAY_API_KEY", "No MCP servers configured")
-}
-
-func TestCopilotSDKEngineGetRequiredSecretNamesWithMCP(t *testing.T) {
- engine := NewCopilotSDKEngine()
- workflowData := &WorkflowData{
- Name: "test-workflow",
- Tools: map[string]any{
- "playwright": map[string]any{},
- },
- }
-
- secrets := engine.GetRequiredSecretNames(workflowData)
-
- assert.Contains(t, secrets, "COPILOT_GITHUB_TOKEN")
- assert.Contains(t, secrets, "MCP_GATEWAY_API_KEY", "MCP servers are configured")
-}
-
-func TestCopilotSDKEngineGetDeclaredOutputFiles(t *testing.T) {
- engine := NewCopilotSDKEngine()
-
- files := engine.GetDeclaredOutputFiles()
-
- assert.Contains(t, files, "/tmp/gh-aw/copilot-sdk/event-log.jsonl")
-}
-
-func TestCopilotSDKEngineGetLogFileForParsing(t *testing.T) {
- engine := NewCopilotSDKEngine()
-
- logFile := engine.GetLogFileForParsing()
-
- assert.Equal(t, "/tmp/gh-aw/copilot-sdk/event-log.jsonl", logFile)
-}
-
-func TestCopilotSDKEngineGetExecutionSteps(t *testing.T) {
- engine := NewCopilotSDKEngine()
- workflowData := &WorkflowData{
- Name: "test-workflow",
- }
-
- steps := engine.GetExecutionSteps(workflowData, "/tmp/agent-log.txt")
-
- // Should have 3 steps: headless start, config, execution
- assert.Len(t, steps, 3)
-
- // Check first step (start headless)
- step1 := strings.Join(steps[0], "\n")
- assert.Contains(t, step1, "Start Copilot CLI in headless mode")
- assert.Contains(t, step1, fmt.Sprintf("copilot --headless --port %d", constants.CopilotSDKLLMGatewayPort))
- assert.Contains(t, step1, "COPILOT_PID")
-
- // Check second step (configuration)
- step2 := strings.Join(steps[1], "\n")
- assert.Contains(t, step2, "Configure Copilot SDK client")
- assert.Contains(t, step2, "GH_AW_COPILOT_CONFIG")
- assert.Contains(t, step2, fmt.Sprintf("host.docker.internal:%d", constants.CopilotSDKLLMGatewayPort))
-
- // Check third step (execution)
- step3 := strings.Join(steps[2], "\n")
- assert.Contains(t, step3, "Execute Copilot SDK client")
- assert.Contains(t, step3, "node /opt/gh-aw/copilot/copilot-client.js")
- assert.Contains(t, step3, "agentic_execution")
-}
-
-func TestCopilotSDKEngineGetExecutionStepsWithModel(t *testing.T) {
- engine := NewCopilotSDKEngine()
- workflowData := &WorkflowData{
- Name: "test-workflow",
- EngineConfig: &EngineConfig{
- Model: "gpt-5.1-pro",
- },
- }
-
- steps := engine.GetExecutionSteps(workflowData, "/tmp/agent-log.txt")
-
- // Check that model is in configuration
- step2 := strings.Join(steps[1], "\n")
- assert.Contains(t, step2, "gpt-5.1-pro")
-}
-
-func TestCopilotSDKEngineGetInstallationSteps(t *testing.T) {
- engine := NewCopilotSDKEngine()
- workflowData := &WorkflowData{
- Name: "test-workflow",
- }
-
- steps := engine.GetInstallationSteps(workflowData)
-
- // Should reuse Copilot engine installation steps
- assert.NotEmpty(t, steps)
-
- // Check for secret validation
- allSteps := strings.Join(concatenateSteps(steps), "\n")
- assert.Contains(t, allSteps, "COPILOT_GITHUB_TOKEN")
-}
-
-func TestCopilotSDKEngineRenderMCPConfig(t *testing.T) {
- engine := NewCopilotSDKEngine()
- var yaml strings.Builder
- tools := map[string]any{
- "playwright": map[string]any{},
- }
- mcpTools := []string{"playwright"}
- workflowData := &WorkflowData{
- Name: "test-workflow",
- }
-
- engine.RenderMCPConfig(&yaml, tools, mcpTools, workflowData)
-
- output := yaml.String()
-
- // Should replace localhost with host.docker.internal
- assert.Contains(t, output, "host.docker.internal")
- assert.NotContains(t, output, "localhost")
- assert.NotContains(t, output, "127.0.0.1")
-}
-
-func TestCopilotSDKEngineParseLogMetrics(t *testing.T) {
- engine := NewCopilotSDKEngine()
-
- metrics := engine.ParseLogMetrics("test log content", true)
-
- // Should return valid LogMetrics struct (even if empty)
- assert.NotNil(t, metrics)
-}
-
-// Helper function to concatenate all steps into a single string array
-func concatenateSteps(steps []GitHubActionStep) []string {
- var result []string
- for _, step := range steps {
- result = append(result, step...)
- }
- return result
-}
diff --git a/pkg/workflow/imported_steps_validation_test.go b/pkg/workflow/imported_steps_validation_test.go
index c9ee754c0f..edb876e00d 100644
--- a/pkg/workflow/imported_steps_validation_test.go
+++ b/pkg/workflow/imported_steps_validation_test.go
@@ -63,10 +63,8 @@ This workflow imports a custom engine with agentic secrets.
errMsg := err.Error()
assert.Contains(t, errMsg, "strict mode", "Error should mention strict mode")
assert.Contains(t, errMsg, "COPILOT_GITHUB_TOKEN", "Error should mention the secret name")
- // Check for either Copilot CLI or Copilot SDK (both use COPILOT_GITHUB_TOKEN)
- hasCopilotCLI := strings.Contains(errMsg, "GitHub Copilot CLI")
- hasCopilotSDK := strings.Contains(errMsg, "GitHub Copilot SDK")
- assert.True(t, hasCopilotCLI || hasCopilotSDK, "Error should mention the engine (GitHub Copilot CLI or GitHub Copilot SDK)")
+ // Check for Copilot CLI (CopilotSDK removed)
+ assert.Contains(t, errMsg, "GitHub Copilot CLI", "Error should mention the engine (GitHub Copilot CLI)")
assert.Contains(t, errMsg, "custom engine steps", "Error should mention custom engine steps")
}
})
@@ -333,11 +331,10 @@ imports:
// Should mention both secrets
assert.Contains(t, errMsg, "COPILOT_GITHUB_TOKEN")
assert.Contains(t, errMsg, "ANTHROPIC_API_KEY")
- // Should mention the engines (GitHub Copilot CLI/SDK and/or Claude Code)
+ // Should mention the engines (GitHub Copilot CLI and/or Claude Code)
hasCopilotCLI := strings.Contains(errMsg, "GitHub Copilot CLI")
- hasCopilotSDK := strings.Contains(errMsg, "GitHub Copilot SDK")
hasClaude := strings.Contains(errMsg, "Claude Code")
- assert.True(t, hasCopilotCLI || hasCopilotSDK || hasClaude, "Should mention the engines")
+ assert.True(t, hasCopilotCLI || hasClaude, "Should mention the engines")
}
}
diff --git a/pkg/workflow/strict_mode_llm_gateway_test.go b/pkg/workflow/strict_mode_llm_gateway_test.go
index cfbe500fb5..f93b8200b8 100644
--- a/pkg/workflow/strict_mode_llm_gateway_test.go
+++ b/pkg/workflow/strict_mode_llm_gateway_test.go
@@ -315,11 +315,6 @@ func TestSupportsLLMGateway(t *testing.T) {
expectedPort: constants.ClaudeLLMGatewayPort,
description: "Claude engine uses dedicated port for LLM gateway",
},
- {
- engineID: "copilot-sdk",
- expectedPort: constants.CopilotSDKLLMGatewayPort,
- description: "Copilot SDK engine uses dedicated port for LLM gateway",
- },
{
engineID: "copilot",
expectedPort: constants.CopilotLLMGatewayPort,
diff --git a/scratchpad/adding-new-engines.md b/scratchpad/adding-new-engines.md
index f8c7516b02..619c123aac 100644
--- a/scratchpad/adding-new-engines.md
+++ b/scratchpad/adding-new-engines.md
@@ -467,7 +467,6 @@ func NewEngineRegistry() *EngineRegistry {
registry.Register(NewClaudeEngine())
registry.Register(NewCodexEngine())
registry.Register(NewCopilotEngine())
- registry.Register(NewCopilotSDKEngine())
registry.Register(NewCustomEngine())
registry.Register(NewMyEngine()) // Add your engine here
diff --git a/scratchpad/engine-architecture-review.md b/scratchpad/engine-architecture-review.md
index 643b52df5d..e58c3ed350 100644
--- a/scratchpad/engine-architecture-review.md
+++ b/scratchpad/engine-architecture-review.md
@@ -47,7 +47,6 @@ CodingAgentEngine (composite)
| Claude | Production | Medium | Full MCP support, firewall, max-turns |
| Codex | Production | Medium | TOML config, firewall, LLM gateway |
| Custom | Production | Low | User-defined steps, minimal features |
-| CopilotSDK | Experimental | Low | Headless mode, limited features |
**Assessment**: ✅ **Good variety**. Implementations range from simple (Custom) to complex (Copilot), providing good examples for new engine authors.
@@ -133,19 +132,6 @@ Key helper functions in `engine_helpers.go`:
**Rating**: ⭐⭐⭐⭐⭐ (5/5)
-### CopilotSDK Engine
-
-**File**: copilot_sdk_engine.go (259 lines)
-
-**Strengths**:
-- ✅ Experimental status clearly marked
-- ✅ Reuses Copilot installation steps
-
-**Areas for improvement**:
-- None identified (experimental status expected)
-
-**Rating**: ⭐⭐⭐⭐ (4/5) - Experimental
-
## Extensibility Assessment
### Adding New Engines
diff --git a/scratchpad/engine-review-summary.md b/scratchpad/engine-review-summary.md
index aeb167cc95..3d083a3816 100644
--- a/scratchpad/engine-review-summary.md
+++ b/scratchpad/engine-review-summary.md
@@ -2,7 +2,7 @@
## Overview
-Completed comprehensive deep review of the agentic engine architecture, interface design, and all implementations (Copilot, Claude, Codex, Custom, CopilotSDK). The architecture is **excellent and ready for extension**.
+Completed comprehensive deep review of the agentic engine architecture, interface design, and all implementations (Copilot, Claude, Codex, Custom). The architecture is **excellent and ready for extension**.
## What Was Reviewed
@@ -17,7 +17,6 @@ Completed comprehensive deep review of the agentic engine architecture, interfac
- ✅ **Claude** - Full MCP, firewall, max-turns, LLM gateway
- ✅ **Codex** - TOML config, full MCP, firewall, LLM gateway
- ✅ **Custom** - User-defined steps, fallback parsing
-- ✅ **CopilotSDK** - Experimental, headless mode
### 3. Interface Compliance
- ✅ Validated all engines implement required interfaces
@@ -138,7 +137,6 @@ CodingAgentEngine (composite - backward compatibility)
| Claude | 1 | ⭐⭐⭐⭐⭐ | Clean, comprehensive |
| Codex | 3 | ⭐⭐⭐⭐⭐ | TOML config, well-organized |
| Custom | 1 | ⭐⭐⭐⭐⭐ | Simple, focused |
-| CopilotSDK | 1 | ⭐⭐⭐⭐ | Experimental, good reuse |
All implementations follow established patterns and are thoroughly tested.
diff --git a/scratchpad/layout.md b/scratchpad/layout.md
index e370bbd30c..235af6e39f 100644
--- a/scratchpad/layout.md
+++ b/scratchpad/layout.md
@@ -133,7 +133,6 @@ Common file paths referenced in workflow files:
| `/tmp/gh-aw/python/*.py` | Files | Python scripts | Python scripts generated or used by agent |
| `/tmp/gh-aw/python/charts/*.png` | Files | Python chart images | Chart images generated by Python scripts |
| `/tmp/gh-aw/python/data/*` | Files | Python data files | Data files used by Python scripts |
-| `/tmp/gh-aw/copilot-sdk/event-log.jsonl` | File | Copilot SDK logs | Event logs from Copilot SDK |
| `/opt/gh-aw/actions` | Directory | Setup action scripts | Destination for copied JavaScript and shell scripts |
| `/opt/gh-aw/safe-jobs/` | Directory | Safe job definitions | Safe output job definitions and handlers |
| `${{ env.GH_AW_AGENT_OUTPUT }}` | Environment var | Agent output path | Dynamic path to agent output file |
@@ -236,7 +235,7 @@ const DefaultMCPServerPort = 3000
const DefaultMCPInspectorPort = 3001
const ClaudeLLMGatewayPort = 10000
const CodexLLMGatewayPort = 10001
-const CopilotSDKLLMGatewayPort = 10002
+const CopilotLLMGatewayPort = 10002
````
### URLs