zen-gitsync 2.17.22 → 2.17.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -8
- package/package.json +8 -1
- package/src/config.js +34 -3
- package/src/ui/public/assets/{AgentEngineSelector-Dtvp5u3j.js → AgentEngineSelector-CvIoGCLD.js} +1 -1
- package/src/ui/public/assets/{AgentView-BzfjNz7k.js → AgentView-BrqS78Rt.js} +1 -1
- package/src/ui/public/assets/{AppVersionBadge-DAAnAFNp.js → AppVersionBadge-BHxZm7-h.js} +2 -2
- package/src/ui/public/assets/{BranchSelector-C20zVkp_.js → BranchSelector-w5ybmWVv.js} +1 -1
- package/src/ui/public/assets/{CommitForm-COc-NwA8.js → CommitForm-pRCnAfz6.js} +1 -1
- package/src/ui/public/assets/{CommonDialog-B7r-EaIr.js → CommonDialog-qXAsFhNS.js} +1 -1
- package/src/ui/public/assets/{EditorView-DnMiWg3T.css → EditorView-C6HFYeEM.css} +1 -1
- package/src/ui/public/assets/EditorView-DnuGnX3k.js +1 -0
- package/src/ui/public/assets/{FileDiffViewer-7HZ_CW13.js → FileDiffViewer-Bc8j9cQn.js} +1 -1
- package/src/ui/public/assets/{FlowExecutionViewer-YKYhtKmd.js → FlowExecutionViewer-CF4HkGu6.js} +1 -1
- package/src/ui/public/assets/{FlowOrchestrationWorkspace-Bg5pSrGY.js → FlowOrchestrationWorkspace-a3Zk4BMK.js} +1 -1
- package/src/ui/public/assets/{IconButton-CyEyp9_D.js → IconButton-BjIHmE4p.js} +1 -1
- package/src/ui/public/assets/{LogList-B0YcWT9U.js → LogList-CqpSAW5T.js} +1 -1
- package/src/ui/public/assets/{MindmapView-CJI789Gz.js → MindmapView-CgptM54l.js} +1 -1
- package/src/ui/public/assets/{MonitorView-DVrInkz0.js → MonitorView-qb0EPvQW.js} +1 -1
- package/src/ui/public/assets/{ProjectStartupButton-BGrtaPiJ.js → ProjectStartupButton-CmankQtk.js} +1 -1
- package/src/ui/public/assets/{RecentDirectoriesChat-BsM5qfRX.js → RecentDirectoriesChat-CsHHckPP.js} +1 -1
- package/src/ui/public/assets/{RemoteManagerDialog-fGsXehZF.js → RemoteManagerDialog-Cpg4g5KW.js} +1 -1
- package/src/ui/public/assets/{RemoteRepoCard-CYXYYtM8.js → RemoteRepoCard-DCc-adLb.js} +1 -1
- package/src/ui/public/assets/{SourceMapView-BNyHS4uU.js → SourceMapView-I41XvvZr.js} +1 -1
- package/src/ui/public/assets/{SvgIcon-Cgmy9qD6.js → SvgIcon-BB80ERhO.js} +1 -1
- package/src/ui/public/assets/{TemplateManager-DUPI3yBg.js → TemplateManager-BB_bEiBB.js} +1 -1
- package/src/ui/public/assets/{UserInputNode-DUbPMxsr.js → UserInputNode-y9gz0EKH.js} +1 -1
- package/src/ui/public/assets/WorkbenchView-Bkzbu5Sp.css +1 -0
- package/src/ui/public/assets/WorkbenchView-DKqriLBP.js +6 -0
- package/src/ui/public/assets/_plugin-vue_export-helper-Dd_YmKEO.js +19 -0
- package/src/ui/public/assets/{agentConversations-CuFU_pdW.js → agentConversations-CT9E8eQr.js} +1 -1
- package/src/ui/public/assets/configStore-BR8vEJCp.js +1 -0
- package/src/ui/public/assets/{gitStore-BoFStoL3.js → gitStore-Bz77W-S0.js} +1 -1
- package/src/ui/public/assets/index-CsLyZsXy.js +29 -0
- package/src/ui/public/assets/index-D2rf9QKB.css +1 -0
- package/src/ui/public/assets/{previewSandbox-BzitUMhT.js → previewSandbox-luPexzF4.js} +1 -1
- package/src/ui/public/assets/toolsStore-CeI7jM5o.js +1 -0
- package/src/ui/public/index.html +12 -12
- package/src/ui/public/sounds/CREDITS.txt +32 -0
- package/src/ui/public/sounds/task-done.wav +0 -0
- package/src/ui/public/sounds/task-error.wav +0 -0
- package/src/ui/server/routes/config.js +11 -2
- package/src/ui/server/routes/fileOpen.js +35 -6
- package/src/ui/server/routes/workbench/executorModels.js +329 -0
- package/src/ui/server/routes/workbench/executorModels.test.js +326 -0
- package/src/ui/server/routes/workbench/index.js +26 -0
- package/src/ui/server/routes/workbench/jobActivity.js +27 -1
- package/src/ui/server/routes/workbench/jobActivity.test.js +25 -0
- package/src/ui/server/routes/workbench/orchestratorStore.js +4 -1
- package/src/ui/server/routes/workbench/projectRegistry.js +9 -1
- package/src/ui/server/routes/workbench/projectRegistry.test.js +26 -0
- package/src/ui/public/assets/EditorView-CWCzo4aE.js +0 -1
- package/src/ui/public/assets/WorkbenchView-AbJMHSJy.js +0 -6
- package/src/ui/public/assets/WorkbenchView-D8wqeEiu.css +0 -1
- package/src/ui/public/assets/_plugin-vue_export-helper-DBFEfstn.js +0 -19
- package/src/ui/public/assets/configStore-6xFSX9E5.js +0 -1
- package/src/ui/public/assets/index-BVkLqLHo.js +0 -29
- package/src/ui/public/assets/index-DVJITdth.css +0 -1
- package/src/ui/public/assets/toolsStore-B49mCaQ_.js +0 -1
package/README.md
CHANGED
|
@@ -350,6 +350,7 @@ A full IDE-like editor (fourth icon in the activity bar) for browsing and editin
|
|
|
350
350
|
| File search | Type in the sidebar search box to filter the tree (180 ms debounce); matched substrings are highlighted in node names; `Ctrl+F` / `Cmd+F` focuses the box; `Esc` clears the query or blurs the input |
|
|
351
351
|
| Multi-tab editing | Open multiple files simultaneously; tabs show unsaved (●) indicator |
|
|
352
352
|
| Workspace restore | The tree's expanded folders and the open tabs (their order plus which one is active) are remembered **per project** and put back on reload, and when you switch back to that project. The snapshot lives in `~/.zen-gitsync/config.json` under `ui.editorWorkspaceByProject`; only paths are stored — files are re-read from disk, so unsaved edits do not survive a reload, and files that no longer exist are skipped silently |
|
|
353
|
+
| Sidebar width | Drag the divider to resize the file tree pane; unlike the workspace snapshot the width is **global** (one value for every project) and is stored in `~/.zen-gitsync/config.json` under `ui.editorSidebarWidth`, restored on reload. Clamped to 140–400px |
|
|
353
354
|
| Monaco editor | Syntax highlighting for JS, TS, Vue, Python, Go, JSON, CSS, and more |
|
|
354
355
|
| Markdown preview | Toggle between source and rendered preview for `.md` files |
|
|
355
356
|
| HTML preview / browser | `.html` / `.htm` render in a sandboxed in-app iframe; right-click one in the file tree → **Open in Browser** to hand it to the system default browser instead |
|
|
@@ -375,9 +376,9 @@ A dedicated view for running coding agents across one or many projects. Every ta
|
|
|
375
376
|
| Task list | Create, edit, delete tasks. Rows are grouped by project (current project first), each a single line — the title, or the first characters of the description (ellipsised) when the title is empty. Tasks with neither a title nor a description count as drafts that are never saved (switching away drops them) |
|
|
376
377
|
| Multi-project board | Three resizable / collapsible panes: the project list with its run monitor, the kanban board, and the master-agent console. Drag a divider to resize (project list 180–420 px, console 260–560 px), double-click it to reset the responsive default, or fold a side away — the top-bar button folds the project list, the console folds into a 32 px rail that expands on click. The run monitor has its own divider (120 px up to half the viewport height) for when several jobs run at once. All widths / heights are remembered across sessions |
|
|
377
378
|
| Kanban board | **Todo / Doing / Done** columns with the done column sorted newest-first; a filter checkbox narrows the board to tasks whose last run failed, and a table view is one click away for a denser listing. A **New task** entry sits at the end of the Todo column whether or not that column already holds cards (it doubles as the empty state, and opens the same create dialog as the top-right button) |
|
|
378
|
-
| Card status while running | A running task is more than a blinking dot: the card itself carries
|
|
379
|
+
| Card status while running | A running task is more than a blinking dot: the card itself carries its executor's brand icon (hover for the product name), the elapsed time, how many tool calls it has made (hover for the mix of types), its most recent tool call, what it is thinking right now, and its newest reply — plus a silence figure once the job has gone quiet for a while. A row with nothing in it is left out instead of being filled with "none yet", and a card that is not running has no such block at all. The facts come from the execution log, the same source the progress report reads, so they refresh with the board's 5-second poll and a task running in another `g ui` instance shows up here too; in table view the same summary sits under the task name |
|
|
379
380
|
| Master-agent console | Give the master agent an instruction and it dispatches a new task, deciding the target project itself (or honouring the project you selected). Enter dispatches, Shift+Enter starts a new line. Dispatching can be paused and resumed — while paused, a dispatch creates the task without running it |
|
|
380
|
-
| Card after a run | A card in Done no longer stops at its title and timestamp: it keeps a short excerpt of the last thing the agent said — the tail of the newest run's reply, flattened to one line and capped at 100 characters. This is the case it was built for: a run often ends by asking you something ("shall I push?"), so a task sitting in Done may still be waiting on your answer, and the only way to find out used to be opening the editor and reading the log. A task that is still running keeps showing the live block instead (the two are mutually exclusive), a run that wrote no body text leaves this line out entirely rather than borrowing an earlier run's words, and the full excerpt is in the hover tooltip; the table view carries the same line under the task name |
|
|
381
|
+
| Card after a run | A card in Done no longer stops at its title and timestamp: it keeps a short excerpt of the last thing the agent said — the tail of the newest run's reply, flattened to one line and capped at 100 characters. This is the case it was built for: a run often ends by asking you something ("shall I push?"), so a task sitting in Done may still be waiting on your answer, and the only way to find out used to be opening the editor and reading the log. The executor's brand icon sits at the head of that excerpt — the line is what **it** said, so the icon that says which CLI said it belongs there rather than somewhere else on the card. A task that is still running keeps showing the live block instead (the two are mutually exclusive), a run that wrote no body text leaves this line out entirely rather than borrowing an earlier run's words, and the full excerpt is in the hover tooltip; the table view carries the same line under the task name. Executor icons are drawn only when the executor is actually known — a run recorded before the `agent` field existed, or one whose value this build does not recognise, gets no icon rather than a guessed brand (in the table view, icons appear on the status line for a running task and on the last-reply line for a finished one) |
|
|
381
382
|
| Progress report | The console's **Instruction** pane reports where your running tasks actually stand instead of listing what was dispatched and what finished (the board already shows that). The master agent reads each running job — elapsed time, **its latest thinking**, **what mix of tools it has been calling**, **how long it has been silent**, and the latest output — and writes a short paragraph per report: what each task is doing, how far it has got, and whether it looks stuck. The thinking line is what makes this work for tasks that never write a line of prose (they are the common case — their output stays empty from start to finish); "looks stuck" now has to come with evidence — a silence figure, or a tool mix going in circles — instead of being inferred from a high call count. Reports appear on an interval you pick (5 / 10 / 15 / 30 / 60 minutes, or off) or whenever you hit **Report now**, and the newest one is shown with the facts behind it (project, elapsed, tool mix, latest thinking, last tool call, silence) while earlier ones stay browsable from the history list. Automatic reports are generated **server-side**, so the history keeps filling up while the tab is closed and is waiting for you when you come back. Nothing running means nothing filed: automatic reports are skipped outright, and **Report now** answers with a plain "no task is running right now" rather than filing an empty entry (no empty entries, no wasted model call), while two identical reports arriving seconds apart are collapsed into one so a double click leaves no duplicate. The paragraph is written in the UI language and, when a task's output is inconclusive, it says so rather than inventing progress |
|
|
382
383
|
| Dispatch default prompts | Give every dispatch a standing prompt: one **global** entry that applies to all projects, plus one **per project** that is appended after it whenever you dispatch to that project (it supplements the global one rather than replacing it). Both are edited from the gear button in the console's composer; the combined text is prepended to the instruction, a "Default prompt (global + this project)" checkbox appears next to **Run now** so a single dispatch can opt out, and the instruction log records which level was attached. The prompt is copied onto the task at dispatch time, so editing the setting later never rewrites tasks that already exist; it lands in the task's own prompt field, where you can still edit it per task |
|
|
383
384
|
| Open-with menu per project | Hovering a project row in the board's project list reveals two buttons: **Open folder** (straight to your file manager) and **Open with**, a menu holding file manager / terminal / `g ui` in a new tab plus every editor and AI tool (VS Code, Codex, OpenCode, Kimi Code, ZCode, DeepSeek Harness, and Claude Code in default or fully-approved mode). Tools that are not installed are dimmed and labelled "Not installed" — clicking one opens the very same install guide the top bar uses. Every action applies to that row's project only; the board's selection is never touched |
|
|
@@ -391,7 +392,7 @@ A dedicated view for running coding agents across one or many projects. Every ta
|
|
|
391
392
|
| Live log | The "执行日志 / Execution log" panel **opens by default** and auto-scrolls, showing accumulated `stdout` + `stderr` (last 64 KB rendered client-side; the server keeps up to 100 MB per job) |
|
|
392
393
|
| Live status | Task status (pending / running / done / error / cancelled) and PID stream in real time over SSE |
|
|
393
394
|
| Tool-call stream | The model's tool calls are rendered inline in the conversation flow, so you can follow what the agent actually did |
|
|
394
|
-
| Finish notice | When a run finishes or fails you get an in-app toast while the page is in the foreground, and a system notification when it is not — so you can be looking at another view or window and still be told |
|
|
395
|
+
| Finish notice | When a run finishes or fails you get a chime (a distinct tone for done vs. error; stopping on purpose stays silent) plus an in-app toast while the page is in the foreground, and a system notification when it is not — so you can be looking at another view or window and still be told. The chime has its **own switch** under the notice toggle, so you can keep the notices but mute the sound, or the other way round. Sounds are CC0 assets under `public/sounds/`; see `CREDITS.txt` there to swap in another tone |
|
|
395
396
|
| Cross-view indicator | While any Workbench task is running, a pulsing dot appears on the Workbench icon in the Activity Bar so you can see job state from the Git or Editor view |
|
|
396
397
|
| Execution log manager (dialog) | The "Execution logs" button in the workbench top bar opens a dialog with the list / filter / batch delete / clear / retention-policy UI (defaults: 500 records, 256 MB); the task execution view stays mounted so no work-in-progress state is dropped |
|
|
397
398
|
| Continue chat | After a task reaches a done / error / cancelled state, a follow-up composer appears; sending a message resumes the previous session (`claude --resume <session_id>` for Claude Code, `--session` for OpenCode, `codex exec resume <thread_id>` for Codex), and each new turn stacks into the same chat-style flow |
|
|
@@ -431,7 +432,7 @@ A dedicated view (robot icon in the activity bar) for chatting with the built-in
|
|
|
431
432
|
|
|
432
433
|
| Tab | What's inside |
|
|
433
434
|
|---|---|
|
|
434
|
-
| General settings | Appearance (theme — light / dark / follow the system — and language), task execution (task executor, task-finish notifications) and UI options (file-list view, diff split ratio, AI diff explanation, command console, layout ratios) |
|
|
435
|
+
| General settings | Appearance (theme — light / dark / follow the system — and language), task execution (task executor, task-finish notifications and their sound cue) and UI options (file-list view, diff split ratio, AI diff explanation, command console, layout ratios) |
|
|
435
436
|
| AI models | OpenAI-compatible endpoints — API key, base URL, model name — with several entries side by side, a default model, plus the **Agent runtime** section holding the per-turn tool-call budget |
|
|
436
437
|
| Git global settings | `user.name` / `user.email`, auto-set upstream, pull strategy, auto-prune remote branches, line-ending handling, the default branch for `git init` |
|
|
437
438
|
| Commit settings | Standardised commit form, skip hooks (`--no-verify`), Enter-to-commit, auto-close the push modal, pull before push, auto-fill the default commit message |
|
|
@@ -1010,6 +1011,7 @@ Activity Bar 第四个视图,在 GUI 内直接浏览并编辑项目文件:
|
|
|
1010
1011
|
| 文件搜索 | 在侧边栏搜索框中输入关键字过滤文件树(180ms 防抖),命中片段会在节点名中高亮;`Ctrl+F` / `Cmd+F` 聚焦搜索框,`Esc` 清空内容或失焦 |
|
|
1011
1012
|
| 多标签页 | 同时打开多个文件,未保存文件显示 ● 标记 |
|
|
1012
1013
|
| 工作区恢复 | **按项目**记住文件树展开了哪些目录、开了哪些标签(顺序 + 当前激活的那个),刷新页面或切回该项目时自动恢复;快照存在 `~/.zen-gitsync/config.json` 的 `ui.editorWorkspaceByProject`。只记路径 —— 文件按盘上最新内容重开,未保存的改动不跨会话保留,已被删除的文件静默跳过 |
|
|
1014
|
+
| 侧边栏宽度 | 拖拽分隔条调整文件树栏宽度;与工作区快照不同,宽度是**全局**一份(所有项目共用),存在 `~/.zen-gitsync/config.json` 的 `ui.editorSidebarWidth`,刷新后自动恢复,取值夹在 140–400px |
|
|
1013
1015
|
| Monaco 编辑器 | 支持 JS、TS、Vue、Python、Go、JSON、CSS 等语法高亮 |
|
|
1014
1016
|
| Markdown 预览 | `.md` 文件可切换源码与渲染预览模式 |
|
|
1015
1017
|
| HTML 预览 / 浏览器打开 | `.html` / `.htm` 在应用内沙箱 iframe 里渲染;在文件树里右键 → **在浏览器中打开**,改交系统默认浏览器渲染 |
|
|
@@ -1035,8 +1037,8 @@ Activity Bar 第四个视图,在 GUI 内直接浏览并编辑项目文件:
|
|
|
1035
1037
|
| 任务列表 | 新建、编辑、删除任务;按项目分组(当前项目排在最前),每条任务只占一行 —— 有标题显示标题,没标题则显示描述前若干字符(超出省略);标题和描述都没填的任务视为草稿,切走时直接丢弃、不落盘 |
|
|
1036
1038
|
| 多项目看板 | 三栏均可拖动 / 可折叠:项目列表(含执行监控)、看板、主 Agent 控制台。拖动分隔条调整宽度(项目列表 180–420 px、控制台 260 px ~ `min(900, 视口 46%)`),双击恢复响应式默认值;两侧也都能收起 —— 顶栏按钮收项目列表,控制台自己的按钮把它收成 32px 收纳条、点一下展开。项目列表下方的执行监控有独立分隔条(120 px ~ 视口高度一半),并行跑多个任务时上下拖动即可加高。所有宽高跨会话记住 |
|
|
1037
1039
|
| 看板视图 | **待处理 / 进行中 / 已完成** 三列,已完成列按完成时间倒序;顶部勾选可只看「最近一次执行报错」的任务;一键切换成表格视图,信息密度更高。待处理列末尾常驻一个「新建任务」入口 —— 列里已有卡片时它照样在(列空时它还兼任空状态),点开的是和右上角按钮同一个新建弹窗 |
|
|
1038
|
-
| 进行中卡片 |
|
|
1039
|
-
| 跑完卡片 | 「已完成」列的卡片不再只有标题和时间:它留下一小段**智能体最后说的话** —— 最近一轮执行的正文尾部,压平成一句话、最多 100 字。这条最有用的时候正是它被做出来的理由:一次执行常常以反问收尾(「要 push 吗?」),标着"已完成"
|
|
1040
|
+
| 进行中卡片 | 正在跑的任务不只是右上角一个圆点:卡片上直接带着**执行器的品牌图标**(悬停看是哪个产品)、已运行时长、调用了多少次工具(悬停看类型分布)、最近一次工具调用、最近在思考什么、最新的回复 —— 一段时间没有产出时再补一句静默多久。某一项没有内容就**整行不渲染**(不写"暂无"),没在跑的任务则完全没有这块。这些事实与右栏进度报告同源(都来自执行记录),所以跟随看板 5 秒轮询刷新,别的 `g ui` 实例里跑的任务在这里同样看得到;切到表格视图时同一行摘要压在任务名下方 |
|
|
1041
|
+
| 跑完卡片 | 「已完成」列的卡片不再只有标题和时间:它留下一小段**智能体最后说的话** —— 最近一轮执行的正文尾部,压平成一句话、最多 100 字。这条最有用的时候正是它被做出来的理由:一次执行常常以反问收尾(「要 push 吗?」),标着"已完成"的任务其实在等你回一句话,而以前只有点进编辑器翻日志才知道。**执行器的品牌图标就挂在这段摘录的开头** —— 这句话是"它"说的,图标说的是哪个 CLI 说的,放在这里比放在卡片别处更直接。正在跑的任务仍然走上面那块活动区(两者互斥);那次执行没写正文时这段整块不渲染,不拿上一轮的旧话顶;完整摘录在悬停提示里。表格视图的任务名下方同样有这一行。图标只在**执行器认得出来**时才画:加 `agent` 字段之前跑的记录、或值不在已知执行器里的,一律不画,而不是猜一个品牌显示(表格视图里,正在跑的任务图标在状态摘要行、跑完的在最后回复行) |
|
|
1040
1042
|
| 主 Agent 控制台 | 两种工作方式,拨片切换、选择记在浏览器里:**对话** —— 直接跟内置 g ai 聊,由它按需把活派给某个项目(可多轮、可先问清再派);**指令** —— 你自己写一句话,落点由主 Agent 判断(或遵从此前选中的项目),Enter 派发、Shift+Enter 换行。两种方式落到**同一条派发链路与同一条指令流水**,差别只在"谁决定派什么"。调度可暂停 / 恢复,暂停期间派发只建任务不执行 |
|
|
1041
1043
|
| 进度报告 | 「指令」模式下这块报的是**正在跑的任务现在到哪一步了**,而不是"谁派发了、谁完成了"(那些看板本身就能看出来)。主 Agent 会读一遍每个在跑的 job —— 已运行多久、**最近在想什么**、**最近 20 次都在调哪类工具**、**已经多久没动静**、最近一行输出 —— 写一段汇报:每个任务在做什么、走到哪一步、有没有卡住的迹象。**思考那一行是关键**:一句正文都不写的任务才是常态(它们的输出从头到尾是空的),只看输出就只能写"看不出来";而"是不是卡住了"现在必须给依据(静默时长、或工具分布是不是在原地打转),不许因为调用次数多就暗示卡住。报告按你设的间隔自动生成(5 / 10 / 15 / 30 / 60 分钟,也可以关掉),也能随时点「立即报告」;面板上展示最新那份及其依据(项目、已运行时长、工具分布、最近思考、最近一次工具调用、静默时长),更早的从下方历史列表里点开回看。自动报告由**服务端**定时产生,所以标签页关着也照样攒历史,回来就能看到;**没有任务在跑就不记条目** —— 自动报告直接跳过,「立即报告」改成回你一句"当前没有正在执行的任务"(都不白调一次模型);间隔内内容一样的两份也不重复落盘,连点两下只留一条。汇报按界面语言生成,输出看不出进度时会直说,而不是编一段像模像样的进展 |
|
|
1042
1044
|
| 派发执行器 | 派出去的任务由哪个 CLI 跑:**对话模式**在输入框下方选,**指令模式**在派发栏选 —— 两处是同一个组件、同一份选择,与执行按钮的临时切换也共用。注意「引擎」和「执行器」不是一回事:只有**内置 g ai** 能在服务端跑工具循环、才有派发能力,所以对话模式下把引擎切成外部 CLI 时,执行器选择会换成一句「当前引擎只能对话,不能派发任务 —— 切到内置 g ai 才能派活」的说明,而不是让你点了个不会生效的下拉 |
|
|
@@ -1052,7 +1054,7 @@ Activity Bar 第四个视图,在 GUI 内直接浏览并编辑项目文件:
|
|
|
1052
1054
|
| 实时日志 | 「执行日志」面板**默认展开**,方便随时回看上次执行结果;面板内自动滚到底,展示累积的 stdout / stderr(客户端渲染最近 64 KB,服务端单个 job 最多保留 100 MB 输出) |
|
|
1053
1055
|
| 实时状态 | 任务状态(pending / running / done / error / cancelled)和 PID 通过 SSE 实时推送 |
|
|
1054
1056
|
| 工具调用流 | 模型的工具调用直接渲染在对话流里,能看清智能体具体做了什么 |
|
|
1055
|
-
| 结束提示 |
|
|
1057
|
+
| 结束提示 | 任务结束或报错时响一声提示音(完成 / 出错各一种音色,主动停止不响),同时页面在前台弹应用内提示、页面在后台/别的窗口发系统通知,切到别的视图也不会漏掉结果。提示音在总开关下**有自己的开关**——可以"要提示但静音",也可以反过来只要声音。音源是 CC0 资源(`public/sounds/`),换音色见同目录 `CREDITS.txt` |
|
|
1056
1058
|
| 跨视图指示 | 任意任务运行中时,Activity Bar 上的工作台图标会显示脉动小圆点;切换到 Git 或编辑器视图也能看到运行状态 |
|
|
1057
1059
|
| 执行日志管理(弹窗) | 顶部「执行日志」按钮唤起弹窗:列表 / 过滤 / 批量删除 / 清空 / 保留策略全部可在此一次性管理(默认保留 500 条、256 MB);弹窗关闭后任务执行视图常驻,避免切换时不必要的卸载 |
|
|
1058
1060
|
| 继续对话 | 任务进入终态(done / error / cancelled)后出现续聊输入框;发送续聊消息会用 `claude --resume <session_id>`(Claude Code)、`--session`(OpenCode)或 `codex exec resume <thread_id>`(Codex)续接上一轮会话,**新一轮 = 新 job**,多轮纵向堆叠成对话流 |
|
|
@@ -1092,7 +1094,7 @@ Activity Bar 中的机器人图标视图,可直接在浏览器中与内置 AI
|
|
|
1092
1094
|
|
|
1093
1095
|
| tab | 内容 |
|
|
1094
1096
|
|---|---|
|
|
1095
|
-
| 通用设置 | 外观(主题 —— 浅色 / 深色 /
|
|
1097
|
+
| 通用设置 | 外观(主题 —— 浅色 / 深色 / 跟随系统,以及界面语言)、任务执行(任务执行器、任务完成提示及其提示音),以及界面选项(文件列表视图、文件差异分割、AI 差异说明、命令控制台、布局比例) |
|
|
1096
1098
|
| AI 模型配置 | 兼容 OpenAI 协议的模型端点 —— API Key、baseURL、模型名,可多套并存并设置默认模型;另有 **智能体运行时** 存放单轮工具调用上限 |
|
|
1097
1099
|
| Git 全局设置 | `user.name` / `user.email`、自动设置上游、拉取策略、自动清理远程分支、换行符处理、`git init` 默认分支 |
|
|
1098
1100
|
| 提交设置 | 标准化提交、跳过钩子检查(`--no-verify`)、回车自动提交、Push 完成自动关闭、推送前拉取更新、自动填充默认提交信息 |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zen-gitsync",
|
|
3
|
-
"version": "2.17.
|
|
3
|
+
"version": "2.17.24",
|
|
4
4
|
"description": "Auto commit, scheduled sync, and visual GUI for Git. Run `g` in any repo for one-key commit & push, AI commit messages, scheduled background sync, and a drag-and-drop workflow builder.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -41,7 +41,11 @@
|
|
|
41
41
|
"verify:wb-overview": "node scripts/verify-workbench-overview.cjs",
|
|
42
42
|
"verify:wb-progress-report": "node scripts/verify-wb-progress-report.cjs",
|
|
43
43
|
"verify:wb-card-live": "node scripts/verify-wb-card-live.cjs",
|
|
44
|
+
"verify:wb-card-row1": "node scripts/verify-wb-card-row1.cjs",
|
|
44
45
|
"verify:wb-card-reply": "node scripts/verify-wb-card-reply.cjs",
|
|
46
|
+
"verify:wb-card-executor-icon": "node scripts/verify-wb-card-executor-icon.cjs",
|
|
47
|
+
"verify:wb-executor-models": "node scripts/verify-wb-executor-models.cjs",
|
|
48
|
+
"verify:wb-task-sound": "node scripts/verify-wb-task-sound.cjs",
|
|
45
49
|
"verify:wb-proj-branch": "node scripts/verify-workbench-proj-branch.cjs",
|
|
46
50
|
"verify:wb-proj-filter": "node scripts/verify-wb-proj-filter.cjs",
|
|
47
51
|
"verify:wb-panel-resize": "node scripts/verify-wb-panel-resize.cjs",
|
|
@@ -50,7 +54,10 @@
|
|
|
50
54
|
"verify:wb-editor-persist": "node scripts/verify-workbench-editor-persist.cjs",
|
|
51
55
|
"verify:wb-open-scroll-bottom": "node scripts/verify-workbench-open-scroll-bottom.cjs",
|
|
52
56
|
"verify:editor-preview-scroll": "node scripts/verify-editor-preview-scroll.cjs",
|
|
57
|
+
"verify:editor-sidebar-width": "node scripts/verify-editor-sidebar-width.cjs",
|
|
53
58
|
"verify:wb-copy-folder-name": "node scripts/verify-copy-folder-name.cjs",
|
|
59
|
+
"verify:wb-opencode-menu": "node scripts/verify-opencode-auto-menu.cjs",
|
|
60
|
+
"verify:opencode-permission": "node --test test/opencode-permission.test.mjs",
|
|
54
61
|
"verify:repo-list": "node scripts/verify-repo-list.cjs",
|
|
55
62
|
"e2e": "cd src/ui/client && npx playwright test",
|
|
56
63
|
"e2e:headed": "cd src/ui/client && npx playwright test --headed",
|
package/src/config.js
CHANGED
|
@@ -98,6 +98,19 @@ export function normalizeNotifyOnTaskDone(value) {
|
|
|
98
98
|
return typeof value === 'boolean' ? value : null;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
+
/**
|
|
102
|
+
* 规范化「任务完成提示音」开关。语义与 normalizeNotifyOnTaskDone 完全一致
|
|
103
|
+
* (只收布尔值,`'false'` 这种字符串不当真值用 —— 理由同上)。
|
|
104
|
+
*
|
|
105
|
+
* 为什么和总开关分开成两个键:有人要"发系统通知但别出声"(开会 / 图书馆 / 夜里),
|
|
106
|
+
* 也有人反过来只要"叮"一声、不想要通知卡片和权限询问。合成一个开关两边都别扭。
|
|
107
|
+
* 从属关系在消费端:总开关关着时整个提示链路都不走,提示音自然也不会响
|
|
108
|
+
* (见 useTaskNotifier.announce 的调用点)。
|
|
109
|
+
*/
|
|
110
|
+
export function normalizeNotifySoundOnTaskDone(value) {
|
|
111
|
+
return typeof value === 'boolean' ? value : null;
|
|
112
|
+
}
|
|
113
|
+
|
|
101
114
|
// 默认配置
|
|
102
115
|
const defaultConfig = {
|
|
103
116
|
defaultCommitMessage: "submit",
|
|
@@ -153,6 +166,11 @@ const defaultConfig = {
|
|
|
153
166
|
// 默认关等于大部分人永远不知道有它;浏览器通知权限在页面内首次点击时自动申请
|
|
154
167
|
// (见 App.vue 的 onUserGestureForNotifyPermission),所以默认开不会静默失效。
|
|
155
168
|
notifyOnTaskDone: true,
|
|
169
|
+
// 任务完成提示音(全局,默认开):跑完 / 出错误各响一声,主动停止不响。
|
|
170
|
+
// 从属于上面的 notifyOnTaskDone —— 总开关关着时整条提示链路都不走,声音也不会响。
|
|
171
|
+
// 单独一个键是为了"要通知但别出声"和"要声音但不要通知卡片"这两种人都能配。
|
|
172
|
+
// 音源是 CC0 资源(src/ui/client/public/sounds/),见同目录 CREDITS.txt。
|
|
173
|
+
notifySoundOnTaskDone: true,
|
|
156
174
|
// UI 状态(跨项目共享,存到顶层 ui 对象)
|
|
157
175
|
// 之前散落在 localStorage,因随机端口启动而失效,迁到文件持久化
|
|
158
176
|
ui: {
|
|
@@ -474,7 +492,9 @@ async function loadConfig() {
|
|
|
474
492
|
aiMaxToolIterations: normalizeAiMaxToolIterations(raw.aiMaxToolIterations)
|
|
475
493
|
?? defaultConfig.aiMaxToolIterations,
|
|
476
494
|
taskExecutor: normalizeTaskExecutor(raw.taskExecutor) ?? defaultConfig.taskExecutor,
|
|
477
|
-
notifyOnTaskDone: normalizeNotifyOnTaskDone(raw.notifyOnTaskDone) ?? defaultConfig.notifyOnTaskDone
|
|
495
|
+
notifyOnTaskDone: normalizeNotifyOnTaskDone(raw.notifyOnTaskDone) ?? defaultConfig.notifyOnTaskDone,
|
|
496
|
+
notifySoundOnTaskDone: normalizeNotifySoundOnTaskDone(raw.notifySoundOnTaskDone)
|
|
497
|
+
?? defaultConfig.notifySoundOnTaskDone
|
|
478
498
|
};
|
|
479
499
|
}
|
|
480
500
|
|
|
@@ -494,7 +514,9 @@ async function loadConfig() {
|
|
|
494
514
|
?? defaultConfig.aiMaxToolIterations,
|
|
495
515
|
taskExecutor: normalizeTaskExecutor(raw?.taskExecutor) ?? defaultConfig.taskExecutor,
|
|
496
516
|
// 同 taskExecutor:全局配置,始终取顶层,防止被项目配置里的旧值覆盖
|
|
497
|
-
notifyOnTaskDone: normalizeNotifyOnTaskDone(raw?.notifyOnTaskDone) ?? defaultConfig.notifyOnTaskDone
|
|
517
|
+
notifyOnTaskDone: normalizeNotifyOnTaskDone(raw?.notifyOnTaskDone) ?? defaultConfig.notifyOnTaskDone,
|
|
518
|
+
notifySoundOnTaskDone: normalizeNotifySoundOnTaskDone(raw?.notifySoundOnTaskDone)
|
|
519
|
+
?? defaultConfig.notifySoundOnTaskDone
|
|
498
520
|
};
|
|
499
521
|
}
|
|
500
522
|
|
|
@@ -542,7 +564,7 @@ async function saveConfig(config) {
|
|
|
542
564
|
|
|
543
565
|
// 分离全局设置和项目设置
|
|
544
566
|
// models / ui 也是全局配置(跨项目共享),和 theme/locale 一样存到顶层
|
|
545
|
-
const { theme, locale, models, ui, aiMaxToolIterations, taskExecutor, notifyOnTaskDone, ...projectConfig } = config;
|
|
567
|
+
const { theme, locale, models, ui, aiMaxToolIterations, taskExecutor, notifyOnTaskDone, notifySoundOnTaskDone, ...projectConfig } = config;
|
|
546
568
|
|
|
547
569
|
// 保存全局设置到根级别
|
|
548
570
|
if (theme !== undefined) {
|
|
@@ -572,6 +594,10 @@ async function saveConfig(config) {
|
|
|
572
594
|
if (normalizedNotify !== null) {
|
|
573
595
|
raw.notifyOnTaskDone = normalizedNotify;
|
|
574
596
|
}
|
|
597
|
+
const normalizedNotifySound = normalizeNotifySoundOnTaskDone(notifySoundOnTaskDone);
|
|
598
|
+
if (normalizedNotifySound !== null) {
|
|
599
|
+
raw.notifySoundOnTaskDone = normalizedNotifySound;
|
|
600
|
+
}
|
|
575
601
|
|
|
576
602
|
// 写入当前项目配置(在 defaultConfig 基础上合并,但不清空顶层其它键)
|
|
577
603
|
const existingProjectConfig = (raw.projects[key] && typeof raw.projects[key] === 'object') ? raw.projects[key] : {};
|
|
@@ -771,6 +797,11 @@ export default {
|
|
|
771
797
|
TASK_EXECUTORS,
|
|
772
798
|
// 任务执行结束提示开关规范化(同上)
|
|
773
799
|
normalizeNotifyOnTaskDone,
|
|
800
|
+
// 任务完成提示音开关规范化(同上)。⚠️ 新增规范化函数务必同步加进这个对象字面量 ——
|
|
801
|
+
// server 侧 `import config from '../../config.js'` 拿的是**这个默认导出对象**,
|
|
802
|
+
// 只在下面 `export {}` 里命名导出是不够的:漏加会变成 undefined 调用 → 路由 500,
|
|
803
|
+
// 而且因为有 try/catch 兜底,前端只会看到"保存失败",不知道是哪个函数缺了。
|
|
804
|
+
normalizeNotifySoundOnTaskDone,
|
|
774
805
|
};
|
|
775
806
|
|
|
776
807
|
// 命名导出 — 用于测试与外部复用
|
package/src/ui/public/assets/{AgentEngineSelector-Dtvp5u3j.js → AgentEngineSelector-CvIoGCLD.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-C0FnF6B9.js";import{$ as e,C as t,Cn as n,Dn as r,En as i,Er as a,Jn as o,K as s,Kn as c,Mn as l,Pn as u,Pr as d,Qn as f,Qr as p,Rn as m,S as h,Tn as g,Un as _,Xn as v,br as y,cr as b,pr as x,q as S,qr as C,w,wn as T,yn as E}from"./element-plus-Bx3j6vzG.js";import{n as D,t as O}from"./_plugin-vue_export-helper-
|
|
1
|
+
import"./rolldown-runtime-C0FnF6B9.js";import{$ as e,C as t,Cn as n,Dn as r,En as i,Er as a,Jn as o,K as s,Kn as c,Mn as l,Pn as u,Pr as d,Qn as f,Qr as p,Rn as m,S as h,Tn as g,Un as _,Xn as v,br as y,cr as b,pr as x,q as S,qr as C,w,wn as T,yn as E}from"./element-plus-Bx3j6vzG.js";import{n as D,t as O}from"./_plugin-vue_export-helper-Dd_YmKEO.js";import{t as k}from"./SvgIcon-BB80ERhO.js";import{t as A}from"./toolsStore-CeI7jM5o.js";import{a as j,m as M}from"./index-CsLyZsXy.js";import{c as N,d as P,l as F,u as I}from"./agentConversations-CT9E8eQr.js";m(),x();function L(e,t=680){let r=y(0),i=null;function a(){let t=e.value;return t?(r.value=t.clientWidth,typeof ResizeObserver>`u`||(i=new ResizeObserver(e=>{let t=e[0]?.contentRect?.width;typeof t==`number`&&(r.value=t)}),i.observe(t),!0)):!1}return o(()=>{a()||_(()=>a())}),c(()=>{i?.disconnect(),i=null}),{width:r,narrow:n(()=>r.value>0&&r.value<t)}}m(),x(),d();var R={class:`agent-engine`},z=[`disabled`,`title`,`aria-label`],B={class:`agent-engine__name`},V={class:`agent-engine__item`},H={class:`agent-engine__item-name`},U={key:3,class:`agent-engine__item-missing`},W=O(u({__name:`AgentEngineSelector`,props:{engine:{},locked:{type:Boolean}},emits:[`select`],setup(o,{emit:c}){let u=o,d=c,m=A(),_=n(()=>I(u.engine)),x=n(()=>({gai:!0,claude:m.claudeAvailable,opencode:m.opencodeAvailable,codex:m.codexAvailable})),O=y(!1),L=y(null);function W(e){if(!u.locked){if(!x.value[e]){if(!P(e))return;L.value=e,O.value=!0;return}d(`select`,e)}}return(n,c)=>(v(),r(`div`,R,[l(a(h),{trigger:`click`,onCommand:W},{dropdown:b(()=>[l(a(w),null,{default:b(()=>[(v(!0),r(E,null,f(a(N),n=>(v(),g(a(t),{key:n.id,command:n.id},{default:b(()=>[T(`span`,V,[a(P)(n.id)?(v(),g(j,{key:0,executor:n.id,class:`agent-engine__item-icon`},null,8,[`executor`])):(v(),g(k,{key:1,"icon-class":a(F),class:`agent-engine__item-icon`},null,8,[`icon-class`])),T(`span`,H,p(n.name),1),o.engine===n.id?(v(),g(a(s),{key:2,class:`agent-engine__item-check`},{default:b(()=>[l(a(e))]),_:1})):x.value[n.id]?i(``,!0):(v(),r(`span`,U,p(a(D)(`@42BB9:未安装`)),1))])]),_:2},1032,[`command`]))),128))]),_:1})]),default:b(()=>[T(`button`,{type:`button`,class:C([`agent-engine__btn`,{"is-locked":o.locked}]),disabled:o.locked,title:o.locked?a(D)(`@AGENT:本会话的引擎已锁定;要换引擎请新建会话`):a(D)(`@AGENT:新建会话使用的引擎`),"aria-label":a(D)(`@AGENT:智能体引擎`)},[a(P)(o.engine)?(v(),g(j,{key:0,executor:o.engine,class:`agent-engine__icon`},null,8,[`executor`])):(v(),g(k,{key:1,"icon-class":a(F),class:`agent-engine__icon`},null,8,[`icon-class`])),T(`span`,B,p(_.value),1),l(a(s),{class:`agent-engine__caret`},{default:b(()=>[l(a(S))]),_:1})],10,z)]),_:1}),l(M,{modelValue:O.value,"onUpdate:modelValue":c[0]||=e=>O.value=e,tool:L.value},null,8,[`modelValue`,`tool`])]))}}),[[`__scopeId`,`data-v-81dfa007`]]);export{L as n,W as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-C0FnF6B9.js";import{$ as e,A as t,Bt as n,Cn as r,Ct as i,Dn as a,Dt as o,En as s,Er as c,H as l,K as u,Mn as d,Ot as f,Pn as p,Pr as m,Q as h,Qn as g,Qr as _,Rn as v,Tn as y,Un as b,Ut as x,Xn as S,Yr as C,a as w,at as T,br as E,cr as D,ft as O,hn as k,i as A,j as ee,jn as j,ln as M,lr as N,o as P,or as F,pr as I,qr as L,qt as te,rn as ne,st as re,tr as R,vr as ie,wn as z,yn as B}from"./element-plus-Bx3j6vzG.js";import{r as V,t as H}from"./vendor-CyWsJd6S.js";import{n as U,t as W}from"./_plugin-vue_export-helper-DBFEfstn.js";import{t as ae}from"./configStore-6xFSX9E5.js";import{t as oe}from"./CommonDialog-B7r-EaIr.js";import{a as se,i as G,n as K,o as q,r as ce,s as le,t as J}from"./agentConversations-CuFU_pdW.js";import{n as ue,t as de}from"./AgentEngineSelector-Dtvp5u3j.js";v(),I(),M(),m();var fe={class:`marketplace-panel`},Y={class:`mp-toolbar`},pe={class:`mp-search`},me=[`placeholder`],he={class:`mp-toolbar-sub`},ge={class:`mp-target-hint`},_e={class:`mp-source-filter`},X=[`onClick`],ve={class:`mp-body`},ye={class:`mp-group-header`},be={class:`mp-group-title`},xe={key:0,class:`mp-group-count`},Se={key:1,class:`mp-group-error`},Ce=[`href`,`title`],we={key:0,class:`mp-grid`},Z={class:`mp-card-head`},Te=[`title`],Ee={key:0,class:`mp-card-metric`},Q=[`title`],$={class:`mp-card-meta`},De=[`title`],Oe=[`title`],ke={key:2,class:`mp-tag remote`},Ae={class:`mp-card-foot`},je=[`href`],Me={key:1,class:`mp-installed-chip`},Ne=[`disabled`,`onClick`],Pe={key:3,class:`mp-not-installable`},Fe={key:1,class:`mp-empty`},Ie={key:0,class:`mp-group installed`},Le={class:`mp-group-header`},Re={class:`mp-group-title`},ze={class:`mp-group-count`},Be={key:0,class:`mp-installed-block`},Ve={class:`mp-installed-target`},He={class:`mp-installed-list`},Ue={class:`mp-installed-name`},We={key:0,class:`mp-meta-pkg`},Ge={key:1,class:`mp-tag warn`},Ke=[`disabled`,`onClick`],qe={key:1,class:`mp-empty all`},Je={key:0,class:`mkt-form`},Ye={class:`mkt-form-name`},Xe=[`onUpdate:modelValue`,`placeholder`],Ze={key:0,class:`mkt-field`},Qe={class:`mkt-hint`},$e=W(p({__name:`MarketplacePanel`,props:{type:{}},setup(i){let f=i,p=ae(),m=E([]),h=E([]),v=E(!1),b=E(``),C=E(``),T=E([]),M=E(`project`),I=E(new Set),R=E(new Set),V=r(()=>p.currentDirectory||``),H=null;async function W(){if(!v.value){v.value=!0;try{let e=new URLSearchParams({type:f.type,cwd:V.value});C.value&&e.set(`q`,C.value),T.value.length&&e.set(`sources`,T.value.join(`,`));let t=await(await fetch(`/api/agent/marketplace/catalog?${e}`)).json();t?.success?(m.value=t.groups||[],h.value=t.installed||[]):w.error(t?.error||U(`@MKT:加载失败`))}catch{w.error(U(`@MKT:加载失败`))}finally{v.value=!1}}}F(b,e=>{H&&clearTimeout(H),H=setTimeout(()=>{C.value=e.trim(),W()},400)}),F(T,()=>W()),F(()=>f.type,()=>{T.value=[],C.value=``,b.value=``,W()}),F(V,()=>W()),W();let se=r(()=>{let e=V.value?V.value.split(/[\\/]/).filter(Boolean).pop():``;return M.value===`project`?e||U(`@MKT:当前项目`):U(`@MKT:g ai 智能体`)});function G(e){return e.stars?`${K(e.stars)} ★`:e.downloads?`${K(e.downloads)} ${U(`@MKT:周下载`)}`:e.uses?`${K(e.uses)} ${U(`@MKT:次使用`)}`:``}function K(e){return e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:1)}k`:String(e)}function q(e){return`${e.id}`}function ce(e){return I.value.has(q(e))}let le=r(()=>{let e={project:[],global:[]};for(let t of h.value)(e[t.target]||=[]).push(t);return e}),J=ie({visible:!1,item:null,env:{},args:``});function ue(e){return f.type===`mcp`&&(!!e.envKeys?.length||!!e.args?.length)}function de(e){J.item=e,J.env=Object.fromEntries((e.envKeys||[]).map(e=>[e,``])),J.args=(e.args||[]).join(` `),J.visible=!0}function $e(){let e=J.item;if(J.visible=!1,!e)return;let t=Object.fromEntries(Object.entries(J.env).filter(([,e])=>e.trim()!==``)),n=J.args.trim()?J.args.trim().match(/(?:[^\s"]+|"[^"]*")+/g)?.map(e=>e.replace(/^"|"$/g,``))??void 0:void 0;tt(e,{env:t,...n?{args:n}:{}})}async function et(e){if(!e.installed||await nt(e)){if(ue(e)){de(e);return}await tt(e,{})}}async function tt(e,t){let n=q(e);I.value.add(n);try{let n=await fetch(`/api/agent/marketplace/install`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({type:f.type,target:M.value,cwd:V.value,item:{...e,...t}})}),r=await n.json().catch(()=>null);if(!n.ok||!r?.success){w.error(r?.error||U(`@MKT:安装失败`));return}r.item?.warning&&w.warning(r.item.warning),r.item?.envKeys?.length?w.warning(`${U(`@MKT:还缺环境变量`)}: ${r.item.envKeys.join(`, `)}`):w.success(U(`@MKT:安装成功`)),await W()}catch{w.error(U(`@MKT:安装失败`))}finally{I.value.delete(n)}}async function nt(e){try{return await A.confirm(`${e.name} ${U(`@MKT:已安装,要重新安装吗?`)}`,U(`@MKT:重新安装`),{confirmButtonText:U(`@MKT:重装`),cancelButtonText:U(`@MKT:取消`),type:`warning`}),!0}catch{return!1}}async function rt(e){try{await A.confirm(`${U(`@MKT:确定卸载`)} ${e.name}?`,U(`@MKT:卸载`),{confirmButtonText:U(`@MKT:卸载`),cancelButtonText:U(`@MKT:取消`),type:`warning`})}catch{return}let t=`${e.target}:${e.id}`;R.value.add(t);try{let t=new URLSearchParams({target:e.target,cwd:V.value}),n=await fetch(`/api/agent/marketplace/item/${f.type}/${encodeURIComponent(e.id)}?${t}`,{method:`DELETE`}),r=await n.json().catch(()=>null);if(!n.ok||!r?.success){w.error(r?.error||U(`@MKT:卸载失败`));return}w.success(U(`@MKT:已卸载`)),await W()}catch{w.error(U(`@MKT:卸载失败`))}finally{R.value.delete(t)}}return(r,f)=>{let p=u,C=t,w=ee,E=l,A=P;return S(),a(`div`,fe,[z(`div`,Y,[z(`div`,pe,[d(p,{class:`mp-search-icon`},{default:D(()=>[d(c(x))]),_:1}),N(z(`input`,{"onUpdate:modelValue":f[0]||=e=>b.value=e,class:`mp-search-input`,type:`text`,placeholder:i.type===`skill`?c(U)(`@MKT:搜索 Skill...`):c(U)(`@MKT:搜索 MCP 服务...`)},null,8,me),[[k,b.value]])]),d(w,{modelValue:M.value,"onUpdate:modelValue":f[1]||=e=>M.value=e,size:`small`,class:`mp-target`},{default:D(()=>[d(C,{value:`project`},{default:D(()=>[j(_(c(U)(`@MKT:当前项目`)),1)]),_:1}),d(C,{value:`global`},{default:D(()=>[j(_(c(U)(`@MKT:g ai 智能体`)),1)]),_:1})]),_:1},8,[`modelValue`]),d(E,{content:c(U)(`@MKT:刷新`),placement:`top`,"show-after":300},{default:D(()=>[z(`button`,{class:L([`mp-refresh`,{spinning:v.value}]),onClick:W},[d(p,null,{default:D(()=>[d(c(n))]),_:1})],2)]),_:1},8,[`content`])]),z(`div`,he,[z(`span`,ge,[j(_(c(U)(`@MKT:安装到`))+` `,1),z(`b`,null,_(se.value),1)]),z(`div`,_e,[(S(!0),a(B,null,g(m.value,e=>(S(),a(`button`,{key:e.id,class:L([`mp-chip`,{active:T.value.includes(e.id)}]),onClick:()=>{let t=T.value.indexOf(e.id);t>=0?T.value.splice(t,1):T.value.push(e.id)}},_(e.label),11,X))),128)),T.value.length?(S(),a(`button`,{key:0,class:`mp-chip clear`,onClick:f[2]||=e=>T.value=[]},_(c(U)(`@MKT:全部来源`)),1)):s(``,!0)])]),N((S(),a(`div`,ve,[(S(!0),a(B,null,g(m.value,t=>(S(),a(`section`,{key:t.id,class:`mp-group`},[z(`header`,ye,[z(`h3`,be,_(t.label),1),t.status===`ok`?(S(),a(`span`,xe,_(t.items.length),1)):(S(),a(`span`,Se,[d(p,null,{default:D(()=>[d(c(ne))]),_:1}),j(` `+_(t.error||c(U)(`@MKT:来源不可用`)),1)])),t.homepage?(S(),a(`a`,{key:2,class:`mp-group-link`,href:t.homepage,target:`_blank`,rel:`noopener noreferrer`,title:t.homepage},[d(p,null,{default:D(()=>[d(c(o))]),_:1})],8,Ce)):s(``,!0)]),t.status===`ok`&&t.items.length?(S(),a(`div`,we,[(S(!0),a(B,null,g(t.items,t=>(S(),a(`article`,{key:q(t),class:`mp-card`},[z(`div`,Z,[z(`span`,{class:`mp-card-name`,title:t.name},_(t.name),9,Te),G(t)?(S(),a(`span`,Ee,[d(p,null,{default:D(()=>[t.stars?(S(),y(c(te),{key:0})):(S(),y(c(O),{key:1}))]),_:2},1024),j(` `+_(G(t)),1)])):s(``,!0)]),z(`p`,{class:`mp-card-desc`,title:t.description},_(t.description||c(U)(`@MKT:暂无描述`)),9,Q),z(`div`,$,[t.package?(S(),a(`code`,{key:0,class:`mp-meta-pkg`,title:t.package},_(t.package),9,De)):t.repository?(S(),a(`span`,{key:1,class:`mp-meta-repo`,title:t.repository+(t.subpath?` · `+t.subpath:``)},[j(_(t.repository),1),t.subpath?(S(),a(B,{key:0},[j(` · `+_(t.subpath),1)],64)):s(``,!0)],8,Oe)):s(``,!0),t.transport===`remote`?(S(),a(`span`,ke,_(c(U)(`@MKT:远程服务`)),1)):s(``,!0),(S(!0),a(B,null,g((t.tags||[]).slice(0,2),e=>(S(),a(`span`,{key:e,class:`mp-tag`},_(e),1))),128))]),z(`div`,Ae,[t.upstream?(S(),a(`a`,{key:0,class:`mp-card-link`,href:t.upstream,target:`_blank`,rel:`noopener noreferrer`},_(c(U)(`@MKT:查看来源`)),9,je)):s(``,!0),f[6]||=z(`span`,{class:`mp-foot-spacer`},null,-1),t.installed?(S(),a(`span`,Me,[d(p,null,{default:D(()=>[d(c(e))]),_:1}),j(_(c(U)(`@MKT:已安装`)),1)])):t.installable===!1?(S(),a(`span`,Pe,_(c(U)(`@MKT:暂不支持一键安装`)),1)):(S(),a(`button`,{key:2,class:`mp-install-btn`,disabled:ce(t),onClick:e=>et(t)},_(ce(t)?c(U)(`@MKT:安装中...`):c(U)(`@MKT:安装`)),9,Ne))])]))),128))])):t.status===`ok`?(S(),a(`div`,Fe,_(c(U)(`@MKT:该来源暂无结果`)),1)):s(``,!0)]))),128)),h.value.length?(S(),a(`section`,Ie,[z(`header`,Le,[z(`h3`,Re,_(c(U)(`@MKT:已安装`)),1),z(`span`,ze,_(h.value.length),1)]),(S(),a(B,null,g([`project`,`global`],e=>z(`div`,{key:e},[le.value[e]?.length?(S(),a(`div`,Be,[z(`div`,Ve,_(e===`project`?c(U)(`@MKT:当前项目`):c(U)(`@MKT:g ai 智能体`)),1),z(`div`,He,[(S(!0),a(B,null,g(le.value[e],t=>(S(),a(`div`,{key:e+t.id,class:`mp-installed-row`},[z(`span`,Ue,_(t.name),1),t.package?(S(),a(`code`,We,_(t.package),1)):s(``,!0),t.requiredEnv?.length?(S(),a(`span`,Ge,_(c(U)(`@MKT:待配置`))+`: `+_(t.requiredEnv.join(`, `)),1)):s(``,!0),f[7]||=z(`span`,{class:`mp-foot-spacer`},null,-1),z(`button`,{class:`mp-remove-btn`,disabled:R.value.has(e+t.id),onClick:e=>rt(t)},[d(p,null,{default:D(()=>[d(c(re))]),_:1}),j(` `+_(R.value.has(e+t.id)?c(U)(`@MKT:卸载中...`):c(U)(`@MKT:卸载`)),1)],8,Ke)]))),128))])])):s(``,!0)])),64))])):s(``,!0),!v.value&&!m.value.length?(S(),a(`div`,qe,_(c(U)(`@MKT:加载失败`)),1)):s(``,!0)])),[[A,v.value]]),d(oe,{modelValue:J.visible,"onUpdate:modelValue":f[5]||=e=>J.visible=e,title:c(U)(`@MKT:配置 MCP`),width:`460px`,type:`flex`,"close-on-click-modal":!1,"append-to-body":``},{footer:D(()=>[z(`button`,{class:`mkt-cancel`,onClick:f[4]||=e=>J.visible=!1},_(c(U)(`@MKT:取消`)),1),z(`button`,{class:`mkt-confirm`,onClick:$e},_(c(U)(`@MKT:安装`)),1)]),default:D(()=>[J.item?(S(),a(`div`,Je,[z(`p`,Ye,_(J.item.name),1),(S(!0),a(B,null,g(Object.keys(J.env),e=>(S(),a(`div`,{key:e,class:`mkt-field`},[z(`label`,null,_(e),1),N(z(`input`,{"onUpdate:modelValue":t=>J.env[e]=t,type:`text`,autocomplete:`off`,placeholder:c(U)(`@MKT:环境变量值`),spellcheck:`false`},null,8,Xe),[[k,J.env[e]]])]))),128)),J.item.args?.length?(S(),a(`div`,Ze,[z(`label`,null,_(c(U)(`@MKT:启动参数`)),1),N(z(`input`,{"onUpdate:modelValue":f[3]||=e=>J.args=e,type:`text`,autocomplete:`off`,spellcheck:`false`},null,512),[[k,J.args]]),z(`p`,Qe,_(c(U)(`@MKT:参数提示`)),1)])):s(``,!0)])):s(``,!0)]),_:1},8,[`modelValue`,`title`])])}}}),[[`__scopeId`,`data-v-6788a7b1`]]);v(),I(),m();var et={class:`agent-chat-area`},tt={class:`agent-tabs`,role:`tablist`},nt=[`aria-selected`,`onClick`],rt={class:`agent-tab-body`},it={key:0,class:`agent-chat-pane`},at={key:0,class:`agent-list-page`},ot={key:0,class:`agent-page-bar`},st=[`title`,`aria-label`],ct={class:`agent-page-title`},lt={class:`agent-chat-host`},ut={key:0,class:`chat-loading`},dt=W(p({__name:`AgentView`,setup(e){let t=ae(),n=E(null),{narrow:o}=ue(n),l=E(`chat`),p=E(`chat`),m=r(()=>p.value===`mcp`?`mcp`:`skill`),v=r(()=>[{id:`chat`,label:U(`@AGENT:对话`),icon:h},{id:`skill`,label:U(`@AGENT:Skill 广场`),icon:i},{id:`mcp`,label:U(`@AGENT:MCP 广场`),icon:T}]),{sessions:x,sessionsLoading:w,currentSessionId:O,messages:k,isStreaming:A,sessionLoading:ee,loadSessions:j,loadSession:M,deleteSession:N,renameSession:P,newSession:I,sendMessage:te,pendingQuestion:ne,answeringQuestion:re,answerQuestion:ie,isSessionGenerating:W,currentEngine:oe,pendingEngine:fe,isEngineLocked:Y,pickEngine:pe,stop:me}=le(),he=r(()=>Y.value?oe.value:fe.value);function ge(e){Y.value||pe(e)}let _e=r(()=>{let e=t.theme;return e===`dark`||e===`auto`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}),X=r(()=>se(x.value,W)),ve=ce(),ye=r(()=>X.value.find(e=>e.id===O.value)?.title||U(`@AGENT:对话`)),be=r(()=>[{id:`p1`,label:U(`@AGENT:查看项目结构`),prompt:U(`@AGENT:prompt_p1`)},{id:`p2`,label:U(`@AGENT:分析代码质量`),prompt:U(`@AGENT:prompt_p2`)},{id:`p3`,label:U(`@AGENT:帮我写测试`),prompt:U(`@AGENT:prompt_p3`)},{id:`p4`,label:U(`@AGENT:Git 状态检查`),prompt:U(`@AGENT:prompt_p4`)},{id:`p5`,label:U(`@AGENT:帮我启动项目`),prompt:U(`@AGENT:prompt_p5`)}]);async function xe(e){await te(e.text,e.files),await b(),Z()}async function Se(e){await te(e.prompt),await b(),Z()}let Ce=G(),we=E(null);function Z(e=!0){we.value?.scrollToBottom(e)}F(()=>k.value.length,()=>{b(()=>Z(!1))});function Te(e){M(e),l.value=`chat`}function Ee(){I(),l.value=`chat`}let Q=E(280),$=E(!1);function De(e){$.value=!0;let t=e.clientX,n=Q.value,r=e=>{let r=e.clientX-t,i=Math.max(200,Math.min(500,n+r));Q.value=i},i=()=>{$.value=!1,document.removeEventListener(`mousemove`,r),document.removeEventListener(`mouseup`,i)};document.addEventListener(`mousemove`,r),document.addEventListener(`mouseup`,i)}return F(o,e=>{e||(l.value=`chat`)}),F(()=>[t.currentDirectory,A.value],async([e,t],n)=>{let r=!n||e!==n[0],i=!!n&&n[1]===!0&&!t;(r||i)&&await j(),O.value&&!A.value&&!x.value.some(e=>e.sessionId===O.value)&&I()},{immediate:!0}),(e,t)=>(S(),a(`div`,{ref_key:`rootRef`,ref:n,class:`agent-view`},[p.value===`chat`&&!c(o)?(S(),a(B,{key:0},[z(`aside`,{class:`agent-sidebar`,style:C({width:Q.value+`px`})},[d(c(V),{class:`agent-conversations`,items:X.value,"active-id":c(O),loading:c(w),labels:c(ve),onSelect:Te,onNew:Ee,onRename:c(P),onDelete:c(N)},null,8,[`items`,`active-id`,`loading`,`labels`,`onRename`,`onDelete`])],4),z(`div`,{class:L([`sidebar-resizer`,{active:$.value}]),onMousedown:De},null,34)],64)):s(``,!0),z(`main`,et,[z(`nav`,tt,[(S(!0),a(B,null,g(v.value,e=>(S(),a(`button`,{key:e.id,type:`button`,class:L([`agent-tab`,{active:p.value===e.id}]),role:`tab`,"aria-selected":p.value===e.id,onClick:t=>p.value=e.id},[d(c(u),null,{default:D(()=>[(S(),y(R(e.icon)))]),_:2},1024),z(`span`,null,_(e.label),1)],10,nt))),128)),p.value===`chat`?(S(),y(de,{key:0,class:`agent-engine`,engine:he.value,locked:c(Y),onSelect:ge},null,8,[`engine`,`locked`])):s(``,!0)]),z(`div`,rt,[p.value===`chat`?(S(),a(`div`,it,[c(o)&&l.value===`list`?(S(),a(`div`,at,[d(c(V),{class:`agent-conversations`,items:X.value,"active-id":c(O),loading:c(w),labels:c(ve),onSelect:Te,onNew:Ee,onRename:c(P),onDelete:c(N)},null,8,[`items`,`active-id`,`loading`,`labels`,`onRename`,`onDelete`])])):(S(),a(B,{key:1},[c(o)?(S(),a(`div`,ot,[z(`button`,{type:`button`,class:`agent-page-back`,title:c(U)(`@AGENT:返回会话列表`),"aria-label":c(U)(`@AGENT:返回会话列表`),onClick:t[0]||=e=>l.value=`list`},[...t[1]||=[z(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[z(`line`,{x1:`19`,y1:`12`,x2:`5`,y2:`12`}),z(`polyline`,{points:`12 19 5 12 12 5`})],-1)]],8,st),z(`span`,ct,_(ye.value),1)])):s(``,!0),z(`div`,lt,[c(ee)?(S(),a(`div`,ut,[d(c(u),{class:`is-loading`,size:32},{default:D(()=>[d(c(f))]),_:1}),z(`span`,null,_(c(U)(`@AGENT:加载会话中...`)),1)])):(S(),y(c(H),{key:1,ref_key:`chatContainerRef`,ref:we,messages:c(k),"preset-questions":be.value,"welcome-title":c(U)(`@AGENT:智能体助手`),"welcome-description":c(U)(`@AGENT:我可以帮你阅读代码、执行命令、修改文件。选择下方话题或直接输入你的问题。`),"assistant-name":c(K),"assistant-avatar":c(J),theme:_e.value,disabled:c(A),generating:c(A),"upload-config":{accept:c(q)},placeholder:c(A)?c(U)(`@AGENT:正在生成中...`):c(U)(`@AGENT:输入消息,Enter 发送`),question:c(ne),"question-submitting":c(re),"question-labels":c(Ce),onSend:xe,onSelect:Se,onStop:c(me),onAnswer:c(ie)},null,8,[`messages`,`preset-questions`,`welcome-title`,`welcome-description`,`assistant-name`,`assistant-avatar`,`theme`,`disabled`,`generating`,`upload-config`,`placeholder`,`question`,`question-submitting`,`question-labels`,`onStop`,`onAnswer`]))])],64))])):(S(),y($e,{key:1,type:m.value},null,8,[`type`]))])])],512))}}),[[`__scopeId`,`data-v-52f9739a`]]);export{dt as default};
|
|
1
|
+
import"./rolldown-runtime-C0FnF6B9.js";import{$ as e,A as t,Bt as n,Cn as r,Ct as i,Dn as a,Dt as o,En as s,Er as c,H as l,K as u,Mn as d,Ot as f,Pn as p,Pr as m,Q as h,Qn as g,Qr as _,Rn as v,Tn as y,Un as b,Ut as x,Xn as S,Yr as C,a as w,at as T,br as E,cr as D,ft as O,hn as k,i as A,j as ee,jn as j,ln as M,lr as N,o as P,or as F,pr as I,qr as L,qt as te,rn as ne,st as re,tr as R,vr as ie,wn as z,yn as B}from"./element-plus-Bx3j6vzG.js";import{r as V,t as H}from"./vendor-CyWsJd6S.js";import{n as U,t as W}from"./_plugin-vue_export-helper-Dd_YmKEO.js";import{t as ae}from"./configStore-BR8vEJCp.js";import{t as oe}from"./CommonDialog-qXAsFhNS.js";import{a as se,i as G,n as K,o as q,r as ce,s as le,t as J}from"./agentConversations-CT9E8eQr.js";import{n as ue,t as de}from"./AgentEngineSelector-CvIoGCLD.js";v(),I(),M(),m();var fe={class:`marketplace-panel`},Y={class:`mp-toolbar`},pe={class:`mp-search`},me=[`placeholder`],he={class:`mp-toolbar-sub`},ge={class:`mp-target-hint`},_e={class:`mp-source-filter`},X=[`onClick`],ve={class:`mp-body`},ye={class:`mp-group-header`},be={class:`mp-group-title`},xe={key:0,class:`mp-group-count`},Se={key:1,class:`mp-group-error`},Ce=[`href`,`title`],we={key:0,class:`mp-grid`},Z={class:`mp-card-head`},Te=[`title`],Ee={key:0,class:`mp-card-metric`},Q=[`title`],$={class:`mp-card-meta`},De=[`title`],Oe=[`title`],ke={key:2,class:`mp-tag remote`},Ae={class:`mp-card-foot`},je=[`href`],Me={key:1,class:`mp-installed-chip`},Ne=[`disabled`,`onClick`],Pe={key:3,class:`mp-not-installable`},Fe={key:1,class:`mp-empty`},Ie={key:0,class:`mp-group installed`},Le={class:`mp-group-header`},Re={class:`mp-group-title`},ze={class:`mp-group-count`},Be={key:0,class:`mp-installed-block`},Ve={class:`mp-installed-target`},He={class:`mp-installed-list`},Ue={class:`mp-installed-name`},We={key:0,class:`mp-meta-pkg`},Ge={key:1,class:`mp-tag warn`},Ke=[`disabled`,`onClick`],qe={key:1,class:`mp-empty all`},Je={key:0,class:`mkt-form`},Ye={class:`mkt-form-name`},Xe=[`onUpdate:modelValue`,`placeholder`],Ze={key:0,class:`mkt-field`},Qe={class:`mkt-hint`},$e=W(p({__name:`MarketplacePanel`,props:{type:{}},setup(i){let f=i,p=ae(),m=E([]),h=E([]),v=E(!1),b=E(``),C=E(``),T=E([]),M=E(`project`),I=E(new Set),R=E(new Set),V=r(()=>p.currentDirectory||``),H=null;async function W(){if(!v.value){v.value=!0;try{let e=new URLSearchParams({type:f.type,cwd:V.value});C.value&&e.set(`q`,C.value),T.value.length&&e.set(`sources`,T.value.join(`,`));let t=await(await fetch(`/api/agent/marketplace/catalog?${e}`)).json();t?.success?(m.value=t.groups||[],h.value=t.installed||[]):w.error(t?.error||U(`@MKT:加载失败`))}catch{w.error(U(`@MKT:加载失败`))}finally{v.value=!1}}}F(b,e=>{H&&clearTimeout(H),H=setTimeout(()=>{C.value=e.trim(),W()},400)}),F(T,()=>W()),F(()=>f.type,()=>{T.value=[],C.value=``,b.value=``,W()}),F(V,()=>W()),W();let se=r(()=>{let e=V.value?V.value.split(/[\\/]/).filter(Boolean).pop():``;return M.value===`project`?e||U(`@MKT:当前项目`):U(`@MKT:g ai 智能体`)});function G(e){return e.stars?`${K(e.stars)} ★`:e.downloads?`${K(e.downloads)} ${U(`@MKT:周下载`)}`:e.uses?`${K(e.uses)} ${U(`@MKT:次使用`)}`:``}function K(e){return e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:1)}k`:String(e)}function q(e){return`${e.id}`}function ce(e){return I.value.has(q(e))}let le=r(()=>{let e={project:[],global:[]};for(let t of h.value)(e[t.target]||=[]).push(t);return e}),J=ie({visible:!1,item:null,env:{},args:``});function ue(e){return f.type===`mcp`&&(!!e.envKeys?.length||!!e.args?.length)}function de(e){J.item=e,J.env=Object.fromEntries((e.envKeys||[]).map(e=>[e,``])),J.args=(e.args||[]).join(` `),J.visible=!0}function $e(){let e=J.item;if(J.visible=!1,!e)return;let t=Object.fromEntries(Object.entries(J.env).filter(([,e])=>e.trim()!==``)),n=J.args.trim()?J.args.trim().match(/(?:[^\s"]+|"[^"]*")+/g)?.map(e=>e.replace(/^"|"$/g,``))??void 0:void 0;tt(e,{env:t,...n?{args:n}:{}})}async function et(e){if(!e.installed||await nt(e)){if(ue(e)){de(e);return}await tt(e,{})}}async function tt(e,t){let n=q(e);I.value.add(n);try{let n=await fetch(`/api/agent/marketplace/install`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({type:f.type,target:M.value,cwd:V.value,item:{...e,...t}})}),r=await n.json().catch(()=>null);if(!n.ok||!r?.success){w.error(r?.error||U(`@MKT:安装失败`));return}r.item?.warning&&w.warning(r.item.warning),r.item?.envKeys?.length?w.warning(`${U(`@MKT:还缺环境变量`)}: ${r.item.envKeys.join(`, `)}`):w.success(U(`@MKT:安装成功`)),await W()}catch{w.error(U(`@MKT:安装失败`))}finally{I.value.delete(n)}}async function nt(e){try{return await A.confirm(`${e.name} ${U(`@MKT:已安装,要重新安装吗?`)}`,U(`@MKT:重新安装`),{confirmButtonText:U(`@MKT:重装`),cancelButtonText:U(`@MKT:取消`),type:`warning`}),!0}catch{return!1}}async function rt(e){try{await A.confirm(`${U(`@MKT:确定卸载`)} ${e.name}?`,U(`@MKT:卸载`),{confirmButtonText:U(`@MKT:卸载`),cancelButtonText:U(`@MKT:取消`),type:`warning`})}catch{return}let t=`${e.target}:${e.id}`;R.value.add(t);try{let t=new URLSearchParams({target:e.target,cwd:V.value}),n=await fetch(`/api/agent/marketplace/item/${f.type}/${encodeURIComponent(e.id)}?${t}`,{method:`DELETE`}),r=await n.json().catch(()=>null);if(!n.ok||!r?.success){w.error(r?.error||U(`@MKT:卸载失败`));return}w.success(U(`@MKT:已卸载`)),await W()}catch{w.error(U(`@MKT:卸载失败`))}finally{R.value.delete(t)}}return(r,f)=>{let p=u,C=t,w=ee,E=l,A=P;return S(),a(`div`,fe,[z(`div`,Y,[z(`div`,pe,[d(p,{class:`mp-search-icon`},{default:D(()=>[d(c(x))]),_:1}),N(z(`input`,{"onUpdate:modelValue":f[0]||=e=>b.value=e,class:`mp-search-input`,type:`text`,placeholder:i.type===`skill`?c(U)(`@MKT:搜索 Skill...`):c(U)(`@MKT:搜索 MCP 服务...`)},null,8,me),[[k,b.value]])]),d(w,{modelValue:M.value,"onUpdate:modelValue":f[1]||=e=>M.value=e,size:`small`,class:`mp-target`},{default:D(()=>[d(C,{value:`project`},{default:D(()=>[j(_(c(U)(`@MKT:当前项目`)),1)]),_:1}),d(C,{value:`global`},{default:D(()=>[j(_(c(U)(`@MKT:g ai 智能体`)),1)]),_:1})]),_:1},8,[`modelValue`]),d(E,{content:c(U)(`@MKT:刷新`),placement:`top`,"show-after":300},{default:D(()=>[z(`button`,{class:L([`mp-refresh`,{spinning:v.value}]),onClick:W},[d(p,null,{default:D(()=>[d(c(n))]),_:1})],2)]),_:1},8,[`content`])]),z(`div`,he,[z(`span`,ge,[j(_(c(U)(`@MKT:安装到`))+` `,1),z(`b`,null,_(se.value),1)]),z(`div`,_e,[(S(!0),a(B,null,g(m.value,e=>(S(),a(`button`,{key:e.id,class:L([`mp-chip`,{active:T.value.includes(e.id)}]),onClick:()=>{let t=T.value.indexOf(e.id);t>=0?T.value.splice(t,1):T.value.push(e.id)}},_(e.label),11,X))),128)),T.value.length?(S(),a(`button`,{key:0,class:`mp-chip clear`,onClick:f[2]||=e=>T.value=[]},_(c(U)(`@MKT:全部来源`)),1)):s(``,!0)])]),N((S(),a(`div`,ve,[(S(!0),a(B,null,g(m.value,t=>(S(),a(`section`,{key:t.id,class:`mp-group`},[z(`header`,ye,[z(`h3`,be,_(t.label),1),t.status===`ok`?(S(),a(`span`,xe,_(t.items.length),1)):(S(),a(`span`,Se,[d(p,null,{default:D(()=>[d(c(ne))]),_:1}),j(` `+_(t.error||c(U)(`@MKT:来源不可用`)),1)])),t.homepage?(S(),a(`a`,{key:2,class:`mp-group-link`,href:t.homepage,target:`_blank`,rel:`noopener noreferrer`,title:t.homepage},[d(p,null,{default:D(()=>[d(c(o))]),_:1})],8,Ce)):s(``,!0)]),t.status===`ok`&&t.items.length?(S(),a(`div`,we,[(S(!0),a(B,null,g(t.items,t=>(S(),a(`article`,{key:q(t),class:`mp-card`},[z(`div`,Z,[z(`span`,{class:`mp-card-name`,title:t.name},_(t.name),9,Te),G(t)?(S(),a(`span`,Ee,[d(p,null,{default:D(()=>[t.stars?(S(),y(c(te),{key:0})):(S(),y(c(O),{key:1}))]),_:2},1024),j(` `+_(G(t)),1)])):s(``,!0)]),z(`p`,{class:`mp-card-desc`,title:t.description},_(t.description||c(U)(`@MKT:暂无描述`)),9,Q),z(`div`,$,[t.package?(S(),a(`code`,{key:0,class:`mp-meta-pkg`,title:t.package},_(t.package),9,De)):t.repository?(S(),a(`span`,{key:1,class:`mp-meta-repo`,title:t.repository+(t.subpath?` · `+t.subpath:``)},[j(_(t.repository),1),t.subpath?(S(),a(B,{key:0},[j(` · `+_(t.subpath),1)],64)):s(``,!0)],8,Oe)):s(``,!0),t.transport===`remote`?(S(),a(`span`,ke,_(c(U)(`@MKT:远程服务`)),1)):s(``,!0),(S(!0),a(B,null,g((t.tags||[]).slice(0,2),e=>(S(),a(`span`,{key:e,class:`mp-tag`},_(e),1))),128))]),z(`div`,Ae,[t.upstream?(S(),a(`a`,{key:0,class:`mp-card-link`,href:t.upstream,target:`_blank`,rel:`noopener noreferrer`},_(c(U)(`@MKT:查看来源`)),9,je)):s(``,!0),f[6]||=z(`span`,{class:`mp-foot-spacer`},null,-1),t.installed?(S(),a(`span`,Me,[d(p,null,{default:D(()=>[d(c(e))]),_:1}),j(_(c(U)(`@MKT:已安装`)),1)])):t.installable===!1?(S(),a(`span`,Pe,_(c(U)(`@MKT:暂不支持一键安装`)),1)):(S(),a(`button`,{key:2,class:`mp-install-btn`,disabled:ce(t),onClick:e=>et(t)},_(ce(t)?c(U)(`@MKT:安装中...`):c(U)(`@MKT:安装`)),9,Ne))])]))),128))])):t.status===`ok`?(S(),a(`div`,Fe,_(c(U)(`@MKT:该来源暂无结果`)),1)):s(``,!0)]))),128)),h.value.length?(S(),a(`section`,Ie,[z(`header`,Le,[z(`h3`,Re,_(c(U)(`@MKT:已安装`)),1),z(`span`,ze,_(h.value.length),1)]),(S(),a(B,null,g([`project`,`global`],e=>z(`div`,{key:e},[le.value[e]?.length?(S(),a(`div`,Be,[z(`div`,Ve,_(e===`project`?c(U)(`@MKT:当前项目`):c(U)(`@MKT:g ai 智能体`)),1),z(`div`,He,[(S(!0),a(B,null,g(le.value[e],t=>(S(),a(`div`,{key:e+t.id,class:`mp-installed-row`},[z(`span`,Ue,_(t.name),1),t.package?(S(),a(`code`,We,_(t.package),1)):s(``,!0),t.requiredEnv?.length?(S(),a(`span`,Ge,_(c(U)(`@MKT:待配置`))+`: `+_(t.requiredEnv.join(`, `)),1)):s(``,!0),f[7]||=z(`span`,{class:`mp-foot-spacer`},null,-1),z(`button`,{class:`mp-remove-btn`,disabled:R.value.has(e+t.id),onClick:e=>rt(t)},[d(p,null,{default:D(()=>[d(c(re))]),_:1}),j(` `+_(R.value.has(e+t.id)?c(U)(`@MKT:卸载中...`):c(U)(`@MKT:卸载`)),1)],8,Ke)]))),128))])])):s(``,!0)])),64))])):s(``,!0),!v.value&&!m.value.length?(S(),a(`div`,qe,_(c(U)(`@MKT:加载失败`)),1)):s(``,!0)])),[[A,v.value]]),d(oe,{modelValue:J.visible,"onUpdate:modelValue":f[5]||=e=>J.visible=e,title:c(U)(`@MKT:配置 MCP`),width:`460px`,type:`flex`,"close-on-click-modal":!1,"append-to-body":``},{footer:D(()=>[z(`button`,{class:`mkt-cancel`,onClick:f[4]||=e=>J.visible=!1},_(c(U)(`@MKT:取消`)),1),z(`button`,{class:`mkt-confirm`,onClick:$e},_(c(U)(`@MKT:安装`)),1)]),default:D(()=>[J.item?(S(),a(`div`,Je,[z(`p`,Ye,_(J.item.name),1),(S(!0),a(B,null,g(Object.keys(J.env),e=>(S(),a(`div`,{key:e,class:`mkt-field`},[z(`label`,null,_(e),1),N(z(`input`,{"onUpdate:modelValue":t=>J.env[e]=t,type:`text`,autocomplete:`off`,placeholder:c(U)(`@MKT:环境变量值`),spellcheck:`false`},null,8,Xe),[[k,J.env[e]]])]))),128)),J.item.args?.length?(S(),a(`div`,Ze,[z(`label`,null,_(c(U)(`@MKT:启动参数`)),1),N(z(`input`,{"onUpdate:modelValue":f[3]||=e=>J.args=e,type:`text`,autocomplete:`off`,spellcheck:`false`},null,512),[[k,J.args]]),z(`p`,Qe,_(c(U)(`@MKT:参数提示`)),1)])):s(``,!0)])):s(``,!0)]),_:1},8,[`modelValue`,`title`])])}}}),[[`__scopeId`,`data-v-6788a7b1`]]);v(),I(),m();var et={class:`agent-chat-area`},tt={class:`agent-tabs`,role:`tablist`},nt=[`aria-selected`,`onClick`],rt={class:`agent-tab-body`},it={key:0,class:`agent-chat-pane`},at={key:0,class:`agent-list-page`},ot={key:0,class:`agent-page-bar`},st=[`title`,`aria-label`],ct={class:`agent-page-title`},lt={class:`agent-chat-host`},ut={key:0,class:`chat-loading`},dt=W(p({__name:`AgentView`,setup(e){let t=ae(),n=E(null),{narrow:o}=ue(n),l=E(`chat`),p=E(`chat`),m=r(()=>p.value===`mcp`?`mcp`:`skill`),v=r(()=>[{id:`chat`,label:U(`@AGENT:对话`),icon:h},{id:`skill`,label:U(`@AGENT:Skill 广场`),icon:i},{id:`mcp`,label:U(`@AGENT:MCP 广场`),icon:T}]),{sessions:x,sessionsLoading:w,currentSessionId:O,messages:k,isStreaming:A,sessionLoading:ee,loadSessions:j,loadSession:M,deleteSession:N,renameSession:P,newSession:I,sendMessage:te,pendingQuestion:ne,answeringQuestion:re,answerQuestion:ie,isSessionGenerating:W,currentEngine:oe,pendingEngine:fe,isEngineLocked:Y,pickEngine:pe,stop:me}=le(),he=r(()=>Y.value?oe.value:fe.value);function ge(e){Y.value||pe(e)}let _e=r(()=>{let e=t.theme;return e===`dark`||e===`auto`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}),X=r(()=>se(x.value,W)),ve=ce(),ye=r(()=>X.value.find(e=>e.id===O.value)?.title||U(`@AGENT:对话`)),be=r(()=>[{id:`p1`,label:U(`@AGENT:查看项目结构`),prompt:U(`@AGENT:prompt_p1`)},{id:`p2`,label:U(`@AGENT:分析代码质量`),prompt:U(`@AGENT:prompt_p2`)},{id:`p3`,label:U(`@AGENT:帮我写测试`),prompt:U(`@AGENT:prompt_p3`)},{id:`p4`,label:U(`@AGENT:Git 状态检查`),prompt:U(`@AGENT:prompt_p4`)},{id:`p5`,label:U(`@AGENT:帮我启动项目`),prompt:U(`@AGENT:prompt_p5`)}]);async function xe(e){await te(e.text,e.files),await b(),Z()}async function Se(e){await te(e.prompt),await b(),Z()}let Ce=G(),we=E(null);function Z(e=!0){we.value?.scrollToBottom(e)}F(()=>k.value.length,()=>{b(()=>Z(!1))});function Te(e){M(e),l.value=`chat`}function Ee(){I(),l.value=`chat`}let Q=E(280),$=E(!1);function De(e){$.value=!0;let t=e.clientX,n=Q.value,r=e=>{let r=e.clientX-t,i=Math.max(200,Math.min(500,n+r));Q.value=i},i=()=>{$.value=!1,document.removeEventListener(`mousemove`,r),document.removeEventListener(`mouseup`,i)};document.addEventListener(`mousemove`,r),document.addEventListener(`mouseup`,i)}return F(o,e=>{e||(l.value=`chat`)}),F(()=>[t.currentDirectory,A.value],async([e,t],n)=>{let r=!n||e!==n[0],i=!!n&&n[1]===!0&&!t;(r||i)&&await j(),O.value&&!A.value&&!x.value.some(e=>e.sessionId===O.value)&&I()},{immediate:!0}),(e,t)=>(S(),a(`div`,{ref_key:`rootRef`,ref:n,class:`agent-view`},[p.value===`chat`&&!c(o)?(S(),a(B,{key:0},[z(`aside`,{class:`agent-sidebar`,style:C({width:Q.value+`px`})},[d(c(V),{class:`agent-conversations`,items:X.value,"active-id":c(O),loading:c(w),labels:c(ve),onSelect:Te,onNew:Ee,onRename:c(P),onDelete:c(N)},null,8,[`items`,`active-id`,`loading`,`labels`,`onRename`,`onDelete`])],4),z(`div`,{class:L([`sidebar-resizer`,{active:$.value}]),onMousedown:De},null,34)],64)):s(``,!0),z(`main`,et,[z(`nav`,tt,[(S(!0),a(B,null,g(v.value,e=>(S(),a(`button`,{key:e.id,type:`button`,class:L([`agent-tab`,{active:p.value===e.id}]),role:`tab`,"aria-selected":p.value===e.id,onClick:t=>p.value=e.id},[d(c(u),null,{default:D(()=>[(S(),y(R(e.icon)))]),_:2},1024),z(`span`,null,_(e.label),1)],10,nt))),128)),p.value===`chat`?(S(),y(de,{key:0,class:`agent-engine`,engine:he.value,locked:c(Y),onSelect:ge},null,8,[`engine`,`locked`])):s(``,!0)]),z(`div`,rt,[p.value===`chat`?(S(),a(`div`,it,[c(o)&&l.value===`list`?(S(),a(`div`,at,[d(c(V),{class:`agent-conversations`,items:X.value,"active-id":c(O),loading:c(w),labels:c(ve),onSelect:Te,onNew:Ee,onRename:c(P),onDelete:c(N)},null,8,[`items`,`active-id`,`loading`,`labels`,`onRename`,`onDelete`])])):(S(),a(B,{key:1},[c(o)?(S(),a(`div`,ot,[z(`button`,{type:`button`,class:`agent-page-back`,title:c(U)(`@AGENT:返回会话列表`),"aria-label":c(U)(`@AGENT:返回会话列表`),onClick:t[0]||=e=>l.value=`list`},[...t[1]||=[z(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[z(`line`,{x1:`19`,y1:`12`,x2:`5`,y2:`12`}),z(`polyline`,{points:`12 19 5 12 12 5`})],-1)]],8,st),z(`span`,ct,_(ye.value),1)])):s(``,!0),z(`div`,lt,[c(ee)?(S(),a(`div`,ut,[d(c(u),{class:`is-loading`,size:32},{default:D(()=>[d(c(f))]),_:1}),z(`span`,null,_(c(U)(`@AGENT:加载会话中...`)),1)])):(S(),y(c(H),{key:1,ref_key:`chatContainerRef`,ref:we,messages:c(k),"preset-questions":be.value,"welcome-title":c(U)(`@AGENT:智能体助手`),"welcome-description":c(U)(`@AGENT:我可以帮你阅读代码、执行命令、修改文件。选择下方话题或直接输入你的问题。`),"assistant-name":c(K),"assistant-avatar":c(J),theme:_e.value,disabled:c(A),generating:c(A),"upload-config":{accept:c(q)},placeholder:c(A)?c(U)(`@AGENT:正在生成中...`):c(U)(`@AGENT:输入消息,Enter 发送`),question:c(ne),"question-submitting":c(re),"question-labels":c(Ce),onSend:xe,onSelect:Se,onStop:c(me),onAnswer:c(ie)},null,8,[`messages`,`preset-questions`,`welcome-title`,`welcome-description`,`assistant-name`,`assistant-avatar`,`theme`,`disabled`,`generating`,`upload-config`,`placeholder`,`question`,`question-submitting`,`question-labels`,`onStop`,`onAnswer`]))])],64))])):(S(),y($e,{key:1,type:m.value},null,8,[`type`]))])])],512))}}),[[`__scopeId`,`data-v-52f9739a`]]);export{dt as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./rolldown-runtime-C0FnF6B9.js";import{Cn as e,Dn as t,En as n,Er as r,H as i,Jn as a,K as o,Kn as s,L as c,Mn as l,Ot as u,Pn as d,Pr as f,Qr as p,Rn as m,Tn as h,Un as g,Xn as _,a as v,br as y,cr as b,et as x,i as S,jn as C,or as w,pr as T,qr as E,tt as D,wn as O}from"./element-plus-Bx3j6vzG.js";import{n as k,t as A}from"./_plugin-vue_export-helper-
|
|
2
|
-
`);i=o.pop()??``;for(let e of o)e.trim()&&t(e)}i.trim()&&t(i)}async function N(){let e=await fetch(`/api/app-version`);return e.ok?e.json():{success:!1,current:``,latest:null,hasUpdate:!1,error:`HTTP ${e.status}`}}async function P(e){let t=await fetch(`/api/app-upgrade`,{method:`POST`});if(!t.ok){let n=`HTTP ${t.status}`;try{let e=await t.json();e?.error&&(n=e.error)}catch{}e({type:`error`,message:n}),e({type:`done`,code:t.status});return}if(!t.body){e({type:`error`,message:`响应无 body`}),e({type:`done`,code:-1});return}await M(t,t=>{try{e(JSON.parse(t))}catch{}})}async function F(){let e=await fetch(`/api/app-restart`,{method:`POST`});if(!e.ok){let t=`HTTP ${e.status}`;try{let n=await e.json();n?.error&&(t=n.error)}catch{}throw Error(t)}if(!e.body)throw Error(`响应无 body`);return new Promise((t,n)=>{let r=!1,i=e=>{r||(r=!0,e())};M(e,e=>{try{let r=JSON.parse(e);r.type===`ready`&&typeof r.port==`number`&&r.port>0?i(()=>t(r.port)):r.type===`timeout`?i(()=>n(Error(`restart.timeout`))):r.type===`error`&&i(()=>n(Error(r.message||`restart.failed`)))}catch{}}).then(()=>{i(()=>n(Error(`restart.stream-closed`)))}).catch(()=>{})})}m(),T(),f();var I={key:3},L={key:4},R={key:5},z={key:0,class:`upgrade-hint`},B={key:0,class:`upgrade-countdown`},V={key:1,class:`upgrade-manual`},H={class:`upgrade-manual__label`},U=`npm install -g zen-gitsync --registry https://registry.npmjs.org/`,W=A(d({__name:`UpgradeDialog`,props:{modelValue:{type:Boolean},logs:{},status:{},countdown:{default:0}},emits:[`update:modelValue`,`retry`,`restart`,`cancel`],setup(e,{emit:i}){let a=e,s=i,d=y(null);w(()=>a.logs,async()=>{await g(),d.value&&(d.value.scrollTop=d.value.scrollHeight)});function f(){a.status!==`running`&&(a.status===`success`&&a.countdown>0&&s(`cancel`),s(`update:modelValue`,!1))}function m(){s(`retry`)}function S(){s(`restart`)}function T(){s(`cancel`),s(`update:modelValue`,!1)}async function A(){try{await navigator.clipboard.writeText(U),v.success(k(`@F13B4:已复制升级命令`))}catch{v.warning(k(`@F13B4:复制失败,请手动复制`))}}return(i,a)=>{let g=o,v=c;return _(),h(j,{"model-value":e.modelValue,"onUpdate:modelValue":a[0]||=e=>s(`update:modelValue`,e),title:r(k)(`@F13B4:升级`),width:`680px`,type:`flex`,"close-on-click-modal":!1,"close-on-press-escape":!1,"show-close":e.status!==`running`,"append-to-body":``,onClose:f},{footer:b(()=>[e.status===`failed`?(_(),h(v,{key:0,type:`primary`,onClick:m},{default:b(()=>[C(p(r(k)(`@F13B4:重试`)),1)]),_:1})):n(``,!0),e.status===`failed`?(_(),h(v,{key:1,onClick:A},{default:b(()=>[C(p(r(k)(`@F13B4:复制升级命令`)),1)]),_:1})):n(``,!0),e.status===`success`?(_(),h(v,{key:2,type:`primary`,onClick:S},{default:b(()=>[C(p(r(k)(`@F13B4:立即重启并刷新`)),1)]),_:1})):n(``,!0),e.status===`success`?(_(),h(v,{key:3,onClick:T},{default:b(()=>[C(p(r(k)(`@F13B4:稍后手动重启`)),1)]),_:1})):n(``,!0),e.status===`running`?(_(),h(v,{key:4,disabled:``},{default:b(()=>[C(p(r(k)(`@F13B4:升级中`))+`... `,1)]),_:1})):n(``,!0)]),default:b(()=>[O(`div`,{class:E([`upgrade-status`,`is-${e.status}`])},[e.status===`running`?(_(),h(g,{key:0,class:`is-loading`},{default:b(()=>[l(r(u))]),_:1})):e.status===`success`?(_(),h(g,{key:1,color:`var(--color-success)`},{default:b(()=>[l(r(x))]),_:1})):(_(),h(g,{key:2,color:`var(--color-danger)`},{default:b(()=>[l(r(D))]),_:1})),e.status===`running`?(_(),t(`span`,I,p(r(k)(`@F13B4:升级中`)),1)):e.status===`success`?(_(),t(`span`,L,p(r(k)(`@F13B4:升级完成`)),1)):(_(),t(`span`,R,p(r(k)(`@F13B4:升级失败`)),1))],2),e.status===`success`?(_(),t(`p`,z,[C(p(r(k)(`@F13B4:新版本已全局安装,需要重启服务才能生效`))+` `,1),e.countdown>0?(_(),t(`span`,B,p(r(k)(`@F13B4:{seconds} 秒后自动刷新`,{seconds:e.countdown})),1)):n(``,!0)])):n(``,!0),e.status===`failed`?(_(),t(`p`,V,[O(`span`,H,p(r(k)(`@F13B4:手动升级命令`)),1),O(`code`,{class:`upgrade-manual__cmd`},p(U))])):n(``,!0),O(`pre`,{ref_key:`logEl`,ref:d,class:`upgrade-log`},p(e.logs||r(k)(`@F13B4:等待日志输出`)),513)]),_:1},8,[`model-value`,`title`,`show-close`])}}}),[[`__scopeId`,`data-v-5c9f402d`]]);m(),T(),f();var G={class:`app-version-badge`},K=[`aria-label`],q=[`aria-label`],J=[`title`,`aria-label`],Y={class:`upgrade-btn__label`},X={class:`upgrade-btn__version`},Z=`https://github.com/xz333221/zen-gitsync/releases`,Q=5,$=`app-version-check`,ee=36e5,te=A(d({__name:`AppVersionBadge`,setup(o){let c=`2.17.
|
|
1
|
+
import"./rolldown-runtime-C0FnF6B9.js";import{Cn as e,Dn as t,En as n,Er as r,H as i,Jn as a,K as o,Kn as s,L as c,Mn as l,Ot as u,Pn as d,Pr as f,Qr as p,Rn as m,Tn as h,Un as g,Xn as _,a as v,br as y,cr as b,et as x,i as S,jn as C,or as w,pr as T,qr as E,tt as D,wn as O}from"./element-plus-Bx3j6vzG.js";import{n as k,t as A}from"./_plugin-vue_export-helper-Dd_YmKEO.js";import{t as j}from"./CommonDialog-qXAsFhNS.js";async function M(e,t){let n=e.body.getReader(),r=new TextDecoder(`utf-8`),i=``;for(;;){let{done:e,value:a}=await n.read();if(e)break;i+=r.decode(a,{stream:!0});let o=i.split(`
|
|
2
|
+
`);i=o.pop()??``;for(let e of o)e.trim()&&t(e)}i.trim()&&t(i)}async function N(){let e=await fetch(`/api/app-version`);return e.ok?e.json():{success:!1,current:``,latest:null,hasUpdate:!1,error:`HTTP ${e.status}`}}async function P(e){let t=await fetch(`/api/app-upgrade`,{method:`POST`});if(!t.ok){let n=`HTTP ${t.status}`;try{let e=await t.json();e?.error&&(n=e.error)}catch{}e({type:`error`,message:n}),e({type:`done`,code:t.status});return}if(!t.body){e({type:`error`,message:`响应无 body`}),e({type:`done`,code:-1});return}await M(t,t=>{try{e(JSON.parse(t))}catch{}})}async function F(){let e=await fetch(`/api/app-restart`,{method:`POST`});if(!e.ok){let t=`HTTP ${e.status}`;try{let n=await e.json();n?.error&&(t=n.error)}catch{}throw Error(t)}if(!e.body)throw Error(`响应无 body`);return new Promise((t,n)=>{let r=!1,i=e=>{r||(r=!0,e())};M(e,e=>{try{let r=JSON.parse(e);r.type===`ready`&&typeof r.port==`number`&&r.port>0?i(()=>t(r.port)):r.type===`timeout`?i(()=>n(Error(`restart.timeout`))):r.type===`error`&&i(()=>n(Error(r.message||`restart.failed`)))}catch{}}).then(()=>{i(()=>n(Error(`restart.stream-closed`)))}).catch(()=>{})})}m(),T(),f();var I={key:3},L={key:4},R={key:5},z={key:0,class:`upgrade-hint`},B={key:0,class:`upgrade-countdown`},V={key:1,class:`upgrade-manual`},H={class:`upgrade-manual__label`},U=`npm install -g zen-gitsync --registry https://registry.npmjs.org/`,W=A(d({__name:`UpgradeDialog`,props:{modelValue:{type:Boolean},logs:{},status:{},countdown:{default:0}},emits:[`update:modelValue`,`retry`,`restart`,`cancel`],setup(e,{emit:i}){let a=e,s=i,d=y(null);w(()=>a.logs,async()=>{await g(),d.value&&(d.value.scrollTop=d.value.scrollHeight)});function f(){a.status!==`running`&&(a.status===`success`&&a.countdown>0&&s(`cancel`),s(`update:modelValue`,!1))}function m(){s(`retry`)}function S(){s(`restart`)}function T(){s(`cancel`),s(`update:modelValue`,!1)}async function A(){try{await navigator.clipboard.writeText(U),v.success(k(`@F13B4:已复制升级命令`))}catch{v.warning(k(`@F13B4:复制失败,请手动复制`))}}return(i,a)=>{let g=o,v=c;return _(),h(j,{"model-value":e.modelValue,"onUpdate:modelValue":a[0]||=e=>s(`update:modelValue`,e),title:r(k)(`@F13B4:升级`),width:`680px`,type:`flex`,"close-on-click-modal":!1,"close-on-press-escape":!1,"show-close":e.status!==`running`,"append-to-body":``,onClose:f},{footer:b(()=>[e.status===`failed`?(_(),h(v,{key:0,type:`primary`,onClick:m},{default:b(()=>[C(p(r(k)(`@F13B4:重试`)),1)]),_:1})):n(``,!0),e.status===`failed`?(_(),h(v,{key:1,onClick:A},{default:b(()=>[C(p(r(k)(`@F13B4:复制升级命令`)),1)]),_:1})):n(``,!0),e.status===`success`?(_(),h(v,{key:2,type:`primary`,onClick:S},{default:b(()=>[C(p(r(k)(`@F13B4:立即重启并刷新`)),1)]),_:1})):n(``,!0),e.status===`success`?(_(),h(v,{key:3,onClick:T},{default:b(()=>[C(p(r(k)(`@F13B4:稍后手动重启`)),1)]),_:1})):n(``,!0),e.status===`running`?(_(),h(v,{key:4,disabled:``},{default:b(()=>[C(p(r(k)(`@F13B4:升级中`))+`... `,1)]),_:1})):n(``,!0)]),default:b(()=>[O(`div`,{class:E([`upgrade-status`,`is-${e.status}`])},[e.status===`running`?(_(),h(g,{key:0,class:`is-loading`},{default:b(()=>[l(r(u))]),_:1})):e.status===`success`?(_(),h(g,{key:1,color:`var(--color-success)`},{default:b(()=>[l(r(x))]),_:1})):(_(),h(g,{key:2,color:`var(--color-danger)`},{default:b(()=>[l(r(D))]),_:1})),e.status===`running`?(_(),t(`span`,I,p(r(k)(`@F13B4:升级中`)),1)):e.status===`success`?(_(),t(`span`,L,p(r(k)(`@F13B4:升级完成`)),1)):(_(),t(`span`,R,p(r(k)(`@F13B4:升级失败`)),1))],2),e.status===`success`?(_(),t(`p`,z,[C(p(r(k)(`@F13B4:新版本已全局安装,需要重启服务才能生效`))+` `,1),e.countdown>0?(_(),t(`span`,B,p(r(k)(`@F13B4:{seconds} 秒后自动刷新`,{seconds:e.countdown})),1)):n(``,!0)])):n(``,!0),e.status===`failed`?(_(),t(`p`,V,[O(`span`,H,p(r(k)(`@F13B4:手动升级命令`)),1),O(`code`,{class:`upgrade-manual__cmd`},p(U))])):n(``,!0),O(`pre`,{ref_key:`logEl`,ref:d,class:`upgrade-log`},p(e.logs||r(k)(`@F13B4:等待日志输出`)),513)]),_:1},8,[`model-value`,`title`,`show-close`])}}}),[[`__scopeId`,`data-v-5c9f402d`]]);m(),T(),f();var G={class:`app-version-badge`},K=[`aria-label`],q=[`aria-label`],J=[`title`,`aria-label`],Y={class:`upgrade-btn__label`},X={class:`upgrade-btn__version`},Z=`https://github.com/xz333221/zen-gitsync/releases`,Q=5,$=`app-version-check`,ee=36e5,te=A(d({__name:`AppVersionBadge`,setup(o){let c=`2.17.24`,u=y(c),d=e(()=>u.value||c),f=y(null),m=y(!1),h=y(``),g=y(`running`),x=y(0),C=null,w=y(!1);function T(){try{let e=sessionStorage.getItem($);if(!e)return null;let{at:t,data:n}=JSON.parse(e);return Date.now()-t>ee?null:n}catch{return null}}function E(e){try{sessionStorage.setItem($,JSON.stringify({at:Date.now(),data:e}))}catch{}}async function D(e=!1){let t=T();t&&(f.value=t);try{let t=await N();f.value=t,E(t),t.current&&(u.value=t.current),!e&&t.success&&t.hasUpdate&&v({type:`success`,message:k(`@F13B4:发现新版本 {version}`,{version:t.latest??``}),duration:4e3})}catch(t){e||v({type:`warning`,message:k(`@F13B4:检查更新失败 {error}`,{error:t?.message||``})})}}async function A(){if(f.value?.hasUpdate){try{await S.confirm(k(`@F13B4:确定要从 {current} 升级到 {latest} 吗?`,{current:f.value.current,latest:f.value.latest}),k(`@F13B4:升级`),{confirmButtonText:k(`@F13B4:确定升级`),cancelButtonText:k(`@F13B4:取消`),type:`info`})}catch{return}h.value=``,g.value=`running`,m.value=!0,await P(e=>{if(e.type===`done`){if(g.value=e.code===0?`success`:`failed`,e.code===0){try{sessionStorage.removeItem($)}catch{}f.value?.latest&&(u.value=f.value.latest),j()}}else e.message&&(h.value+=e.message)})}}function j(){M(),x.value=Q,C=setInterval(()=>{--x.value,x.value<=0&&(C&&=(clearInterval(C),null),L())},1e3)}function M(){C&&=(clearInterval(C),null),x.value=0}function I(){M()}async function L(){if(M(),!w.value){w.value=!0;try{let e=await F(),{pathname:t,search:n,hash:r}=window.location;window.location.href=`http://localhost:${e}${t}${n}${r}`}catch(e){let t=e?.message||``,n={"restart.timeout":`@F13B4:重启超时`,"restart.stream-closed":`@F13B4:重启失败,请刷新页面重试`,"restart.failed":`@F13B4:重启失败`}[t];v({type:`warning`,message:n?k(n):k(`@F13B4:重启失败 {error}`,{error:t})}),w.value=!1}}}return s(()=>{M()}),a(()=>{D(!0)}),(e,a)=>{let o=i;return _(),t(`div`,G,[l(o,{content:r(k)(`@F13B4:在 GitHub 上查看源码`),placement:`top`,effect:`dark`,"show-after":300},{default:b(()=>[O(`a`,{href:`https://github.com/xz333221/zen-gitsync`,target:`_blank`,rel:`noopener noreferrer`,class:`badge-icon-link`,"aria-label":r(k)(`@F13B4:在 GitHub 上查看源码`)},[...a[1]||=[O(`svg`,{viewBox:`0 0 24 24`,width:`15`,height:`15`,"aria-hidden":`true`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},[O(`path`,{d:`M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0 1 12 6.844a9.59 9.59 0 0 1 2.504.337c1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.02 10.02 0 0 0 22 12.017C22 6.484 17.522 2 12 2z`})],-1)]],8,K)]),_:1},8,[`content`]),l(o,{content:r(k)(`@F13B4:在 npm 上查看包`),placement:`top`,effect:`dark`,"show-after":300},{default:b(()=>[O(`a`,{href:`https://www.npmjs.com/package/zen-gitsync`,target:`_blank`,rel:`noopener noreferrer`,class:`badge-icon-link badge-icon-link--npm`,"aria-label":r(k)(`@F13B4:在 npm 上查看包`)},[...a[2]||=[O(`svg`,{viewBox:`0 0 24 24`,width:`15`,height:`15`,"aria-hidden":`true`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},[O(`path`,{d:`M2 2v20h20V2H2zm17.167 17.167H12.5v-10h-3.333v10H4.833V4.833h14.334v14.334z`})],-1)]],8,q)]),_:1},8,[`content`]),l(o,{content:r(k)(`@F13B4:查看更新`),placement:`top`,effect:`dark`,"show-after":300},{default:b(()=>[O(`a`,{href:Z,target:`_blank`,rel:`noopener noreferrer`,class:`version-link`},`v`+p(d.value),1)]),_:1},8,[`content`]),f.value?.hasUpdate?(_(),t(`button`,{key:0,type:`button`,class:`upgrade-btn`,title:r(k)(`@F13B4:发现新版本 {version},点击升级`,{version:f.value.latest??``}),"aria-label":r(k)(`@F13B4:发现新版本 {version},点击升级`,{version:f.value.latest??``}),onClick:A},[a[3]||=O(`span`,{class:`upgrade-btn__dot`,"aria-hidden":`true`},null,-1),O(`span`,Y,p(r(k)(`@F13B4:升级`)),1),O(`span`,X,`v`+p(f.value.latest),1)],8,J)):n(``,!0),l(W,{modelValue:m.value,"onUpdate:modelValue":a[0]||=e=>m.value=e,logs:h.value,status:g.value,countdown:x.value,onRetry:A,onRestart:L,onCancel:I},null,8,[`modelValue`,`logs`,`status`,`countdown`])])}}}),[[`__scopeId`,`data-v-4084e4be`]]);export{te as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-C0FnF6B9.js";import{$ as e,Bt as t,Cn as n,Dn as r,En as i,Er as a,F as ee,K as te,Lt as o,Mn as s,P as c,Pn as l,Pr as u,Qn as d,Qr as f,Rn as p,Tn as m,U as ne,V as h,W as g,Xn as _,_n as re,br as v,cr as y,jt as ie,ln as b,pr as x,qr as S,r as ae,wn as C,yn as w}from"./element-plus-Bx3j6vzG.js";import{n as T,t as E}from"./_plugin-vue_export-helper-
|
|
1
|
+
import"./rolldown-runtime-C0FnF6B9.js";import{$ as e,Bt as t,Cn as n,Dn as r,En as i,Er as a,F as ee,K as te,Lt as o,Mn as s,P as c,Pn as l,Pr as u,Qn as d,Qr as f,Rn as p,Tn as m,U as ne,V as h,W as g,Xn as _,_n as re,br as v,cr as y,jt as ie,ln as b,pr as x,qr as S,r as ae,wn as C,yn as w}from"./element-plus-Bx3j6vzG.js";import{n as T,t as E}from"./_plugin-vue_export-helper-Dd_YmKEO.js";import{t as D}from"./SvgIcon-BB80ERhO.js";import{t as O}from"./IconButton-BjIHmE4p.js";import{r as k}from"./gitStore-Bz77W-S0.js";import{t as A}from"./CommonDialog-qXAsFhNS.js";p(),x(),u(),b();var j={key:0,class:`branch-info`},M={class:`branch-wrapper`},N={class:`branch-btn`},P={class:`branch-btn-name`},F={class:`branch-btn-caret`},I={class:`branch-popover-inner`},L={class:`branch-search`},R={class:`branch-list`},z=[`onClick`],B={key:1,class:`branch-item-check-placeholder`},V={class:`branch-item-name`},oe={key:0,class:`branch-empty`},H={class:`branch-popover-footer`},U={class:`create-branch-content`},W={class:`form-label`},G={class:`form-label`},K={class:`dialog-footer`},q={class:`footer-actions`},se=[`disabled`],J=E(l({__name:`BranchSelector`,emits:[`branchChanged`],setup(l,{emit:u}){let p=k(),b=u,x=v(!1),E=v(``),J=n(()=>{let e=E.value.trim().toLowerCase();return e?p.allBranches.filter(t=>t.toLowerCase().includes(e)):p.allBranches});async function ce(e){if(e===p.currentBranch){x.value=!1;return}x.value=!1,await p.changeBranch(e)&&(b(`branchChanged`),p.refreshLog())}let Y=v(!1),X=v(``),Z=v(``);function le(){x.value=!1,Z.value=p.currentBranch,Y.value=!0}async function Q(){await p.createBranch(X.value,Z.value)&&(Y.value=!1,X.value=``,b(`branchChanged`))}let $=v(!1);async function ue(){if(!$.value){$.value=!0;try{await Promise.all([p.getCurrentBranch(!0),p.getBranchStatus(!0),p.getAllBranches()]),b(`branchChanged`),p.refreshLog()}finally{$.value=!1}}}return(n,l)=>{let u=te,v=h,b=ae,k=g,de=c,fe=ee,pe=ne;return a(p).currentBranch?(_(),r(`div`,j,[C(`div`,M,[s(b,{visible:x.value,"onUpdate:visible":l[1]||=e=>x.value=e,placement:`top-start`,width:260,trigger:`click`,"popper-class":`branch-popover`,"show-arrow":!1,onShow:l[2]||=e=>E.value=``},{reference:y(()=>[C(`button`,N,[s(D,{"icon-class":`git-branch`,"class-name":`branch-btn-icon`}),C(`span`,P,f(a(p).currentBranch),1),C(`span`,F,[s(u,null,{default:y(()=>[...l[7]||=[C(`svg`,{viewBox:`0 0 1024 1024`,xmlns:`http://www.w3.org/2000/svg`},[C(`path`,{fill:`currentColor`,d:`M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.776a29.12 29.12 0 0 0 0-41.6 30.592 30.592 0 0 0-42.752 0z`})],-1)]]),_:1})])])]),default:y(()=>[C(`div`,I,[C(`div`,L,[s(v,{modelValue:E.value,"onUpdate:modelValue":l[0]||=e=>E.value=e,placeholder:a(T)(`@F13B4:搜索或签出分支`),size:`small`,clearable:``,autofocus:``},null,8,[`modelValue`,`placeholder`])]),C(`div`,R,[(_(!0),r(w,null,d(J.value,t=>(_(),r(`div`,{key:t,class:S([`branch-item`,{"is-active":t===a(p).currentBranch}]),onClick:e=>ce(t)},[t===a(p).currentBranch?(_(),m(u,{key:0,class:`branch-item-check`},{default:y(()=>[s(a(e))]),_:1})):(_(),r(`span`,B)),s(D,{"icon-class":`git-branch`,"class-name":`branch-item-icon`}),C(`span`,V,f(t),1)],10,z))),128)),J.value.length===0?(_(),r(`div`,oe,f(a(T)(`@F13B4:没有匹配的分支`)),1)):i(``,!0)]),C(`div`,H,[C(`button`,{class:`branch-create-btn`,onClick:le},[s(u,null,{default:y(()=>[s(a(o))]),_:1}),C(`span`,null,f(a(T)(`@F13B4:创建新分支`)),1)])])])]),_:1},8,[`visible`]),s(O,{tooltip:a(T)(`@CMDCON:刷新`),onClick:ue},{default:y(()=>[s(u,{class:S({"is-loading":$.value})},{default:y(()=>[s(a(t))]),_:1},8,[`class`])]),_:1},8,[`tooltip`])]),s(A,{modelValue:Y.value,"onUpdate:modelValue":l[6]||=e=>Y.value=e,title:a(T)(`@F13B4:创建新分支`),size:`small`,"destroy-on-close":!0,"append-to-body":!0,"custom-class":`create-branch-dialog`},{footer:y(()=>[C(`div`,K,[C(`div`,q,[C(`button`,{type:`button`,class:`dialog-cancel-btn`,onClick:l[5]||=e=>Y.value=!1},f(a(T)(`@F13B4:取消`)),1),C(`button`,{type:`button`,class:`dialog-confirm-btn`,onClick:Q,disabled:a(p).isCreatingBranch},[a(p).isCreatingBranch?(_(),m(u,{key:1,class:`is-loading`},{default:y(()=>[...l[8]||=[C(`svg`,{viewBox:`0 0 1024 1024`,xmlns:`http://www.w3.org/2000/svg`},[C(`path`,{fill:`currentColor`,d:`M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32zm0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32zm448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32zm-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32z`})],-1)]]),_:1})):(_(),m(u,{key:0},{default:y(()=>[s(a(e))]),_:1})),C(`span`,null,f(a(T)(`@F13B4:创建`)),1)],8,se)])])]),default:y(()=>[C(`div`,U,[s(pe,{model:{newBranchName:X.value,selectedBaseBranch:Z.value},"label-position":`top`},{default:y(()=>[s(k,null,{label:y(()=>[C(`div`,W,[s(u,{class:`label-icon`},{default:y(()=>[s(a(o))]),_:1}),C(`span`,null,f(a(T)(`@F13B4:新分支名称`)),1)])]),default:y(()=>[s(v,{modelValue:X.value,"onUpdate:modelValue":l[3]||=e=>X.value=e,placeholder:a(T)(`@F13B4:请输入新分支名称`),class:`modern-input`,size:`large`,onKeyup:re(Q,[`enter`])},null,8,[`modelValue`,`placeholder`])]),_:1}),s(k,null,{label:y(()=>[C(`div`,G,[s(u,{class:`label-icon`},{default:y(()=>[s(a(ie))]),_:1}),C(`span`,null,f(a(T)(`@F13B4:基于分支`)),1)])]),default:y(()=>[s(fe,{modelValue:Z.value,"onUpdate:modelValue":l[4]||=e=>Z.value=e,placeholder:a(T)(`@F13B4:选择基础分支`),class:`modern-select`,size:`large`,style:{width:`100%`}},{default:y(()=>[(_(!0),r(w,null,d(a(p).allBranches,e=>(_(),m(de,{key:e,label:e,value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])]),_:1})]),_:1},8,[`model`])])]),_:1},8,[`modelValue`,`title`])])):i(``,!0)}}}),[[`__scopeId`,`data-v-407da320`]]);export{J as default};
|