Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 97 additions & 0 deletions .vscode/package-extension.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
param(
[Parameter(Mandatory = $true)]
[ValidateSet("stable", "insiders")]
[string] $Quality,

[Parameter(Mandatory = $true)]
[string] $Workspace
)

$ErrorActionPreference = "Stop"

switch ($Quality) {
"stable" {
$cli = "code"
$installHint = "Shell Command: Install 'code' command in PATH"
}
"insiders" {
$cli = "code-insiders"
$installHint = "Shell Command: Install 'code-insiders' command in PATH"
}
}

if (-not (Get-Command $cli -ErrorAction SilentlyContinue)) {
[Console]::Error.WriteLine("Missing '$cli' in PATH.`nInstall it from the target VS Code Command Palette:`n $installHint`nThen restart the terminal and try again.")
exit 127
}

# `npm run package` runs the `vscode:prepublish` script, which shells out to bash
# (.github/scripts/prepare-marketplace-readme.sh). Windows does not ship bash, so
# fall back to the interpreter bundled with Git for Windows.
if (-not (Get-Command bash -ErrorAction SilentlyContinue)) {
$candidates = @()

if ($env:ProgramFiles) {
$candidates += (Join-Path $env:ProgramFiles "Git\bin")
}

if (${env:ProgramFiles(x86)}) {
$candidates += (Join-Path ${env:ProgramFiles(x86)} "Git\bin")
}

if ($env:LOCALAPPDATA) {
$candidates += (Join-Path $env:LOCALAPPDATA "Programs\Git\bin")
}

$gitBash = $candidates | Where-Object { Test-Path (Join-Path $_ "bash.exe") } | Select-Object -First 1

if (-not $gitBash) {
[Console]::Error.WriteLine("Missing 'bash' in PATH and Git for Windows was not found.`nInstall Git for Windows, or run 'npm run package' from a shell that has bash.")
exit 127
}

$env:PATH = "$env:PATH;$gitBash"
}

Push-Location $Workspace

try {
# npm and the VS Code CLI write progress and warnings to stderr, and PowerShell 5.1
# surfaces native stderr as errors while $ErrorActionPreference is 'Stop'. Relax it
# for these two invocations and rely on their exit codes instead.
$previousErrorAction = $ErrorActionPreference
$ErrorActionPreference = "Continue"

try {
& npm run package

if ($LASTEXITCODE) {
exit $LASTEXITCODE
}

$manifest = Get-Content (Join-Path $Workspace "package.json") -Raw -Encoding utf8 | ConvertFrom-Json
$vsix = Join-Path $Workspace ("dist\{0}-{1}.vsix" -f $manifest.name, $manifest.version)

if (-not (Test-Path $vsix)) {
[Console]::Error.WriteLine("Expected package output was not produced: $vsix")
exit 1
}

# --force replaces an already-installed copy of the same version with this build.
$installOutput = & $cli --install-extension $vsix --force 2>&1
$installExitCode = $LASTEXITCODE

if ($installExitCode) {
$installOutput | Write-Host
exit $installExitCode
}
} finally {
$ErrorActionPreference = $previousErrorAction
}

Write-Host ""
Write-Host "Installed $($manifest.publisher).$($manifest.name) $($manifest.version) into $Quality VS Code."
Write-Host "Run 'Developer: Reload Window' in that window to activate the new build."
} finally {
Pop-Location
}
40 changes: 40 additions & 0 deletions .vscode/package-extension.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env bash
set -euo pipefail

quality="${1:?usage: package-extension.sh <stable|insiders> <workspace>}"
workspace="${2:?usage: package-extension.sh <stable|insiders> <workspace>}"

case "$quality" in
stable) cli="code" ;;
insiders) cli="code-insiders" ;;
*)
echo "Unknown quality: $quality" >&2
exit 2
;;
esac

if ! command -v "$cli" >/dev/null 2>&1; then
echo "Missing '$cli' in PATH." >&2
echo "Install it from the target VS Code Command Palette: Shell Command: Install '$cli' command in PATH" >&2
exit 127
fi

cd "$workspace"

npm run package

name=$(node -p "require('./package.json').name")
version=$(node -p "require('./package.json').version")
vsix="dist/${name}-${version}.vsix"

if [ ! -f "$vsix" ]; then
echo "Expected package output was not produced: $vsix" >&2
exit 1
fi

# --force replaces an already-installed copy of the same version with this build.
"$cli" --install-extension "$vsix" --force

echo
echo "Installed ${name} ${version} into $quality VS Code."
echo "Run 'Developer: Reload Window' in that window to activate the new build."
46 changes: 46 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,52 @@
"dependsOn": "npm: watch",
"dependsOrder": "sequence",
"problemMatcher": []
},
{
"label": "Package & Install Extension (Stable)",
"type": "shell",
"command": "bash",
"args": [
"${workspaceFolder}/.vscode/package-extension.sh",
"stable",
"${workspaceFolder}"
],
"windows": {
"command": "powershell",
"args": [
"-NoProfile",
"-ExecutionPolicy",
"Bypass",
"-File",
"${workspaceFolder}/.vscode/package-extension.ps1",
"stable",
"${workspaceFolder}"
]
},
"problemMatcher": []
},
{
"label": "Package & Install Extension (Insiders)",
"type": "shell",
"command": "bash",
"args": [
"${workspaceFolder}/.vscode/package-extension.sh",
"insiders",
"${workspaceFolder}"
],
"windows": {
"command": "powershell",
"args": [
"-NoProfile",
"-ExecutionPolicy",
"Bypass",
"-File",
"${workspaceFolder}/.vscode/package-extension.ps1",
"insiders",
"${workspaceFolder}"
]
},
"problemMatcher": []
}
]
}
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 18 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "DeepSeek V4 for Copilot Chat",
"description": "Use DeepSeek V4.1 Flash in Copilot Chat with native vision, Vision Proxy, reasoning, and agent tools.",
"icon": "resources/icon.png",
"version": "0.9.3",
"version": "0.9.3-local",
"publisher": "Vizards",
"license": "MIT",
"repository": {
Expand Down Expand Up @@ -209,6 +209,23 @@
"%deepseek-copilot.config.debugMode.verbose.description%"
],
"markdownDescription": "%deepseek-copilot.config.debugMode.description%"
},
"deepseek-copilot.tariff.transitionAlerts": {
"type": "boolean",
"default": true,
"markdownDescription": "Show a visible warning when a DeepSeek tariff transition is within the configured threshold."
},
"deepseek-copilot.tariff.transitionAudio": {
"type": "boolean",
"default": true,
"markdownDescription": "Play a system beep when a DeepSeek tariff transition warning triggers. Disable this if you do not want audio alerts."
},
"deepseek-copilot.tariff.transitionWarningMinutes": {
"type": "number",
"default": 5,
"minimum": 1,
"maximum": 60,
"markdownDescription": "How many minutes before a tariff transition to raise the warning."
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"deepseek-copilot.config.debugMode.metadata.description": "Privacy-safe metadata. Safe to share publicly. View with `DeepSeek: Show Logs`.",
"deepseek-copilot.config.debugMode.verbose.label": "Verbose",
"deepseek-copilot.config.debugMode.verbose.description": "⚠️ Contains sensitive prompt content. For local debugging only.",
"deepseek-copilot.config.tariff.transitionAlerts.description": "Show a visible warning when a DeepSeek tariff transition is within the configured threshold.",
"deepseek-copilot.config.tariff.transitionAudio.description": "Play a system beep when a DeepSeek tariff transition warning triggers.",
"deepseek-copilot.config.tariff.transitionWarningMinutes.description": "How many minutes before a tariff transition to raise the warning.",
"deepseek-copilot.config.modelIdOverrides.description": "Override the API model ID sent for each DeepSeek model. Defaults are prefilled with official DeepSeek IDs; change them only when using a compatible third-party API that uses different model names.",
"deepseek-copilot.config.modelIdOverrides.deepseek-flash.description": "API model ID for DeepSeek V4.1 Flash",
"deepseek-copilot.config.modelIdOverrides.deepseek-v4-flash.description": "API model ID for DeepSeek V4 Flash",
Expand Down
Loading