param()
$ErrorActionPreference = 'Stop'
$agentChat = Join-Path (Split-Path $PSScriptRoot) 'XFEWorkflow\XFEWorkflow.Plugins.AgentBrowser.WinUI\Chat'
Push-Location -LiteralPath $agentChat
try {
npm.cmd ci --ignore-scripts --no-audit --no-fund
if ($LASTEXITCODE -ne 0) { throw 'Agent Markdown 依赖恢复失败' }
$destination = Join-Path $agentChat 'vendor'
New-Item -ItemType Directory -Force -Path $destination | Out-Null
$assets = @{
'marked/lib/marked.umd.js' = 'marked.umd.js'
'marked/LICENSE' = 'marked.LICENSE'
'dompurify/dist/purify.min.js' = 'purify.min.js'
'dompurify/LICENSE' = 'DOMPurify.LICENSE'
'@highlightjs/cdn-assets/highlight.min.js' = 'highlight.min.js'
'@highlightjs/cdn-assets/LICENSE' = 'highlight.LICENSE'
}
foreach ($entry in $assets.GetEnumerator()) { Copy-Item -LiteralPath (Join-Path $agentChat ('node_modules/' + $entry.Key)) -Destination (Join-Path $destination $entry.Value) -Force }
} finally { Pop-Location }
param()
$ErrorActionPreference = 'Stop'
$agentChat = Join-Path (Split-Path $PSScriptRoot) 'XFEWorkflow\XFEWorkflow.Plugins.AgentBrowser.WinUI\Chat'
Push-Location -LiteralPath $agentChat
try {
npm.cmd ci --ignore-scripts --no-audit --no-fund
if ($LASTEXITCODE -ne 0) { throw 'Agent Markdown 依赖恢复失败' }
$destination = Join-Path $agentChat 'vendor'
New-Item -ItemType Directory -Force -Path $destination | Out-Null
$assets = @{
'marked/lib/marked.umd.js' = 'marked.umd.js'
'marked/LICENSE' = 'marked.LICENSE'
'dompurify/dist/purify.min.js' = 'purify.min.js'
'dompurify/LICENSE' = 'DOMPurify.LICENSE'
'@highlightjs/cdn-assets/highlight.min.js' = 'highlight.min.js'
'@highlightjs/cdn-assets/LICENSE' = 'highlight.LICENSE'
}
foreach ($entry in $assets.GetEnumerator()) { Copy-Item -LiteralPath (Join-Path $agentChat ('node_modules/' + $entry.Key)) -Destination (Join-Path $destination $entry.Value) -Force }
} finally { Pop-Location }