XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFEWorkflow

【WinUI】XFE基于windows的工作流

公开
关注 0 Fork 0 Star 0
UTF-8
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 }