zen-gitsync 2.17.36 → 2.17.38
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 +6 -6
- package/package.json +1 -1
- package/src/cli/ai/turn.js +3 -1
- package/src/config.js +7 -4
- package/src/ui/public/assets/{AgentEngineSelector-DVs4LGHZ.js → AgentEngineSelector-BMJAsMx_.js} +1 -1
- package/src/ui/public/assets/{AgentView-Blp40VRr.js → AgentView-BH5Ec4j1.js} +1 -1
- package/src/ui/public/assets/{AppVersionBadge-BEnoFzwh.js → AppVersionBadge-DNG70v26.js} +2 -2
- package/src/ui/public/assets/{BranchSelector-C7eXeFif.js → BranchSelector-DBI8ieGq.js} +1 -1
- package/src/ui/public/assets/{CommitForm-CK9jLJOC.js → CommitForm-BHwc5sEG.js} +1 -1
- package/src/ui/public/assets/{CommonDialog-BTeIpgGT.js → CommonDialog-DuI8Bsg7.js} +1 -1
- package/src/ui/public/assets/{EditorView-D00zvntf.js → EditorView-B3EO-mxZ.js} +1 -1
- package/src/ui/public/assets/{FileDiffViewer-zqgG9ok3.js → FileDiffViewer-DtGtQGLR.js} +1 -1
- package/src/ui/public/assets/{FlowExecutionViewer-VFnxkbIs.js → FlowExecutionViewer-sM9EwU3Q.js} +1 -1
- package/src/ui/public/assets/{FlowOrchestrationWorkspace-CIIdKK3v.js → FlowOrchestrationWorkspace-0Kh0IoGP.js} +1 -1
- package/src/ui/public/assets/{IconButton-Cgc5v9vb.js → IconButton-C07zojvw.js} +1 -1
- package/src/ui/public/assets/{LogList-DyQv-Yec.js → LogList-BatjYplm.js} +1 -1
- package/src/ui/public/assets/{MindmapView-EC2Wk_Qi.js → MindmapView-CTHfsYTC.js} +1 -1
- package/src/ui/public/assets/{MonitorView-Z5ZbGtaU.js → MonitorView-BblFdPFM.js} +1 -1
- package/src/ui/public/assets/{ProjectStartupButton-Ci19q1bL.js → ProjectStartupButton-CFQKlRoA.js} +1 -1
- package/src/ui/public/assets/{RecentDirectoriesChat-DT0sguEG.js → RecentDirectoriesChat-BVgA8lLY.js} +1 -1
- package/src/ui/public/assets/{RemoteManagerDialog-BRQpjMSK.js → RemoteManagerDialog-BxD0m5c-.js} +1 -1
- package/src/ui/public/assets/{RemoteRepoCard-yK90_VfS.js → RemoteRepoCard-kOIERvah.js} +1 -1
- package/src/ui/public/assets/{SourceMapView-C55ixUwz.js → SourceMapView-Bs3DYqDP.js} +1 -1
- package/src/ui/public/assets/{SvgIcon-ub85vovN.js → SvgIcon-YQZtv72i.js} +1 -1
- package/src/ui/public/assets/{TemplateManager-uDno_64z.js → TemplateManager-zSKmah02.js} +1 -1
- package/src/ui/public/assets/{UserInputNode-Ce55MMEZ.js → UserInputNode-DMCLoOUw.js} +1 -1
- package/src/ui/public/assets/{WorkbenchView-D1Pf6Etd.css → WorkbenchView-C_E3GV0q.css} +1 -1
- package/src/ui/public/assets/WorkbenchView-nHzg7gau.js +231 -0
- package/src/ui/public/assets/{_plugin-vue_export-helper-VuE2vqnn.js → _plugin-vue_export-helper-DcQKU19k.js} +2 -2
- package/src/ui/public/assets/{agentConversations-DcW54Tlt.js → agentConversations-D_TsndCC.js} +1 -1
- package/src/ui/public/assets/{configStore-De_8eQuS.js → configStore-u3FUM08v.js} +1 -1
- package/src/ui/public/assets/{gitStore-BP6TATf7.js → gitStore-ZjHYEyKS.js} +1 -1
- package/src/ui/public/assets/{index-Bq_-TrTP.js → index-DorcTBZN.js} +16 -16
- package/src/ui/public/assets/{previewSandbox-DcVlFmag.js → previewSandbox-KLKRAhm4.js} +1 -1
- package/src/ui/public/assets/{toolsStore-CQclze0T.js → toolsStore-CfyhqJeq.js} +1 -1
- package/src/ui/public/index.html +11 -11
- package/src/ui/server/routes/workbench/agentChat.js +1 -1
- package/src/ui/server/routes/workbench/orchestratorStore.js +4 -0
- package/src/ui/server/routes/workbench/orchestratorStore.progressReport.test.js +26 -0
- package/src/ui/public/assets/WorkbenchView-CtJD3pz-.js +0 -228
package/README.md
CHANGED
|
@@ -383,7 +383,7 @@ A dedicated view for running coding agents across one or many projects. Every ta
|
|
|
383
383
|
| 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. Hovering the card also reveals a **Stop** button in the very slot an idle card puts **Run** in (a running card does not show both — there is no second run to start), so killing a stuck run no longer means opening the editor and scrolling down to it; it goes through the same endpoint and the very same confirmation text as the editor's stop, and a job running inside another `g ui` instance cannot be stopped from this window — the server says exactly that instead of a flat "stop failed" |
|
|
384
384
|
| 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 |
|
|
385
385
|
| 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) |
|
|
386
|
-
| 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. Each report also carries a **progress bar**: the model is asked for its own estimate of overall progress plus one figure per task, and those numbers are drawn as bars labelled **AI estimate** (hover says what the guess is based on). It is an estimate, not a measurement — and when the model declines to give a number, the bar is simply not drawn instead of defaulting to 0%. 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 |
|
|
386
|
+
| 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. Each report also carries a **progress bar**: the model is asked for its own estimate of overall progress plus one figure per task, and those numbers are drawn as bars labelled **AI estimate** (hover says what the guess is based on). It is an estimate, not a measurement — and when the model declines to give a number, the bar is simply not drawn instead of defaulting to 0%. 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. **A report only stays in the main slot while the tasks it covers are still running** — a report is a snapshot of the moment it was generated, so once those tasks finish the card's "{n} running" line becomes a lie, while the counter right above it already reads 0 running. When they do, the slot stops showing it and states what is actually true instead: "No task is running right now" once everything has finished, or "No progress report for the running tasks yet" when a new batch has started but nothing covers it yet; to read an older one, open it from the history list — it comes back tagged **Finished** 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. **History and Project overview fold down to a single line by default** — the report count, and branch plus working-tree state, stay on that line — and open again on click, with your choice remembered. Both are fixed-height blocks, so on a short screen they squeeze the report card into a slit (about a dozen pixels at 1366×768); folded away, the report's window roughly doubles |
|
|
387
387
|
| Silent wrap-up | When a run has been silent for more than **10 minutes** (no prose, no thinking, no tool call) the console asks the master agent to read the facts it has — latest thinking, the last thing it said, the tool mix — and decide whether it **has finished** or is still working / stuck. A "finished" verdict settles that run: the card moves from In progress to Done, with an **AI marked done** chip under the elapsed time whose tooltip carries the model's reasoning. When the evidence is thin it does nothing at all (it only books the check, waits another 10 minutes, and asks at most 3 times per run) — not acting beats marking a running task as done. It changes the record, never the process: killing a hung process stays the job of the **Stop** button on the card. Only runs owned by **this instance** are judged — a task started in another `g ui` window is settled by that window |
|
|
388
388
|
| Marking a task done by hand | The columns are derived from execution facts, which cannot express the two things only you know: a task sitting in **Todo** that was really finished somewhere else, and an **In progress** task whose model has gone quiet while you can see the work is done. Both cards now hover out a **Done** button next to **Run** / **Stop**, and a card that got into Done *by hand* trades it for **Undo**. A card that finished on its own keeps showing neither — undoing a mark it never had would do nothing at all. Marking a still-running task done asks first and stops that run as part of the same action (a card cannot be Done and running at once), which holds across windows too: if the job lives in another `g ui` instance the server refuses with that very reason instead of pretending. The mark is stored on the task rather than faked as a run record, and a later run of that task supersedes it, so the card goes back to following the facts. Undo is one click with no confirmation — it is the "I clicked the wrong one" path — and hands the card back to the execution facts, which is why it is offered only where the mark is what keeps the card in Done |
|
|
389
389
|
| 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 |
|
|
@@ -539,8 +539,8 @@ Progress is saved after each tool result; `/resume` restores the working directo
|
|
|
539
539
|
|
|
540
540
|
Tool-call budget: one message may trigger up to N tool calls in a row before the turn is
|
|
541
541
|
force-ended with a "max tool iterations reached" notice (send another message to continue).
|
|
542
|
-
N defaults to **
|
|
543
|
-
(`aiMaxToolIterations` in `~/.zen-gitsync/config.json`, range 1–
|
|
542
|
+
N defaults to **1000** and is configurable in **Settings → AI models → Agent Runtime**
|
|
543
|
+
(`aiMaxToolIterations` in `~/.zen-gitsync/config.json`, range 1–10000) — the Web agent shares
|
|
544
544
|
the same value.
|
|
545
545
|
|
|
546
546
|
Images: press `Alt+V` in the REPL to paste a clipboard image (screenshot), or attach a
|
|
@@ -1077,7 +1077,7 @@ Activity Bar 第四个视图,在 GUI 内直接浏览并编辑项目文件:
|
|
|
1077
1077
|
| 进行中卡片 | 正在跑的任务不只是右上角一个圆点:卡片上直接带着**执行器的品牌图标**(悬停看是哪个产品)、已运行时长、调用了多少次工具(悬停看类型分布)、最近一次工具调用、最近在思考什么、最新的回复 —— 一段时间没有产出时再补一句静默多久。某一项没有内容就**整行不渲染**(不写"暂无"),没在跑的任务则完全没有这块。这些事实与右栏进度报告同源(都来自执行记录),所以跟随看板 5 秒轮询刷新,别的 `g ui` 实例里跑的任务在这里同样看得到;切到表格视图时同一行摘要压在任务名下方。悬停时卡片右下角还会浮出 **停止** —— 位置正是空闲卡片摆「执行」的那一格(在跑时两者不并排:没有第二轮可跑),所以停掉一条卡住的任务不必再点进编辑器往下翻;它走的是与编辑器里那个「停止」**同一个接口、同一段确认文案**,而在**别的 g ui 实例**里跑的任务在这个窗口停不了 —— 服务端会直说这一句,而不是笼统回一句「停止失败」 |
|
|
1078
1078
|
| 跑完卡片 | 「已完成」列的卡片不再只有标题和时间:它留下一小段**智能体最后说的话** —— 最近一轮执行的正文尾部,压平成一句话、最多 100 字。这条最有用的时候正是它被做出来的理由:一次执行常常以反问收尾(「要 push 吗?」),标着"已完成"的任务其实在等你回一句话,而以前只有点进编辑器翻日志才知道。**执行器的品牌图标就挂在这段摘录的开头** —— 这句话是"它"说的,图标说的是哪个 CLI 说的,放在这里比放在卡片别处更直接。正在跑的任务仍然走上面那块活动区(两者互斥);那次执行没写正文时这段整块不渲染,不拿上一轮的旧话顶;完整摘录在悬停提示里。表格视图的任务名下方同样有这一行。图标只在**执行器认得出来**时才画:加 `agent` 字段之前跑的记录、或值不在已知执行器里的,一律不画,而不是猜一个品牌显示(表格视图里,正在跑的任务图标在状态摘要行、跑完的在最后回复行) |
|
|
1079
1079
|
| 主 Agent 控制台 | 两种工作方式,拨片切换、选择记在浏览器里:**对话** —— 直接跟内置 g ai 聊,由它按需把活派给某个项目(可多轮、可先问清再派);**指令** —— 你自己写一句话,落点由主 Agent 判断(或遵从此前选中的项目),Enter 派发、Shift+Enter 换行。两种方式落到**同一条派发链路与同一条指令流水**,差别只在"谁决定派什么"。调度可暂停 / 恢复,暂停期间派发只建任务不执行 |
|
|
1080
|
-
| 进度报告 | 「指令」模式下这块报的是**正在跑的任务现在到哪一步了**,而不是"谁派发了、谁完成了"(那些看板本身就能看出来)。主 Agent 会读一遍每个在跑的 job —— 已运行多久、**最近在想什么**、**最近 20 次都在调哪类工具**、**已经多久没动静**、最近一行输出 —— 写一段汇报:每个任务在做什么、走到哪一步、有没有卡住的迹象。每次汇报还带一条**进度条**:模型在正文之前先交它自己估的整体进度与每个任务各自的百分比,界面把它们画成条并标上「AI 估计」(悬停说明这个数字是怎么估出来的)。它是估计不是实测 —— 模型不肯给数字时不画那条,不会拿一个 0% 糊弄过去。**思考那一行是关键**:一句正文都不写的任务才是常态(它们的输出从头到尾是空的),只看输出就只能写"看不出来";而"是不是卡住了"现在必须给依据(静默时长、或工具分布是不是在原地打转),不许因为调用次数多就暗示卡住。报告按你设的间隔自动生成(5 / 10 / 15 / 30 / 60
|
|
1080
|
+
| 进度报告 | 「指令」模式下这块报的是**正在跑的任务现在到哪一步了**,而不是"谁派发了、谁完成了"(那些看板本身就能看出来)。主 Agent 会读一遍每个在跑的 job —— 已运行多久、**最近在想什么**、**最近 20 次都在调哪类工具**、**已经多久没动静**、最近一行输出 —— 写一段汇报:每个任务在做什么、走到哪一步、有没有卡住的迹象。每次汇报还带一条**进度条**:模型在正文之前先交它自己估的整体进度与每个任务各自的百分比,界面把它们画成条并标上「AI 估计」(悬停说明这个数字是怎么估出来的)。它是估计不是实测 —— 模型不肯给数字时不画那条,不会拿一个 0% 糊弄过去。**思考那一行是关键**:一句正文都不写的任务才是常态(它们的输出从头到尾是空的),只看输出就只能写"看不出来";而"是不是卡住了"现在必须给依据(静默时长、或工具分布是不是在原地打转),不许因为调用次数多就暗示卡住。报告按你设的间隔自动生成(5 / 10 / 15 / 30 / 60 分钟,也可以关掉),也能随时点「立即报告」;面板上展示最新那份及其依据(项目、已运行时长、工具分布、最近思考、最近一次工具调用、静默时长),更早的从下方历史列表里点开回看。**报告只在它讲的任务还在跑的时候才挂在主位** —— 报告是"生成那一刻"的快照,任务收工之后卡片头上那句「N 个任务进行中」就成了假话(而顶栏同一处正写着「0 个执行中」,两个数自己打起来了);跑完之后主位不再挂它,改说当前的情况:全部跑完说「当前没有正在执行的任务」,换了新任务在跑但还没有覆盖到它们的那份报告时说「这批任务还没有进度报告」。要回看就从历史列表点开,点开的那张标一个「已结束」**卡片分两层摆**:上面那段是主 Agent 自己的**判断**,下面「任务事实」那区是它**凭什么这么说** —— 每个任务一张卡(标题加粗、自己的进度条、三行证据前面各带一个「工具 / 思考 / 回复」的标签好一列扫下来),静默过久的那张卡整条描一遍告警色。这样正文与事实对不上时,你一眼能看出是模型在编,而不是两片同样灰度的小字糊在一起。右栏只有这么宽,正文默认只露 6 行(底下渐隐 + 「展开全文」,想看整段再点开),不然一段汇报会把下面几组任务事实整个顶出视口。自动报告由**服务端**定时产生,所以标签页关着也照样攒历史,回来就能看到;**没有任务在跑就不记条目** —— 自动报告直接跳过,「立即报告」改成回你一句"当前没有正在执行的任务"(都不白调一次模型);间隔内内容一样的两份也不重复落盘,连点两下只留一条。汇报按界面语言生成,输出看不出进度时会直说,而不是编一段像模像样的进展。**「历史报告」「项目概览」默认折成一行** —— 标题行上分别留着报告份数与分支·工作区状态 —— 点标题行即展开,选择跨会话记住。这两块是固定高度,矮屏上会把报告卡挤成一条缝(1366×768 实测只剩十来像素),折起来之后报告拿到的窗口差不多翻倍 |
|
|
1081
1081
|
| 静默收尾 | 一条任务静默超过 **10 分钟**(没有正文、没有思考、也没有工具调用)时,编排台会让主 Agent 读一遍它手上的事实 —— 最近在想什么、最后说了什么、工具分布长什么样 —— 判断它是**已经做完了**,还是还在干活 / 卡住了。判成做完就把这一轮落成终态:卡片从「进行中」挪到「已完成」,并在用时下面标一枚 **AI 判定完成**,悬停看模型给的依据。判据不足时**什么都不做**(只记一笔,等下一个 10 分钟再问,同一条最多问 3 次)—— 不动手,好过把还在跑的任务标成完成。它只改记录、**不动进程**:真要把挂住的进程收掉,仍然是卡片上那个「停止」。只判**本实例**跑的任务 —— 别的 `g ui` 窗口里派出去的那条,由那个窗口自己收尾 |
|
|
1082
1082
|
| 手动标记完成 | 列是执行事实推出来的,推不出两件只有你自己知道的事:一条躺在**待处理**里的任务其实早在别处干完了;一条**进行中**的任务模型已经不说话了,而你一眼能看出它做完了。这两种卡片现在 hover 会浮出一颗 **完成**(就在「执行 / 停止」旁边那一格),而**手动**收进已完成的卡片把那颗换成 **撤销**;自己跑完的卡片两颗都没有 —— 撤销一个它从来没有过的标记,点下去什么都不会发生。给正在跑的任务标完成会先问一句,并在同一次动作里把那一轮停掉(一张卡片不能既是「已完成」又在跑);跨窗口也一样:那个 job 活在别的 `g ui` 实例里时服务端直说原因,不假装标成功。标记记在任务身上,不补假的执行记录;这条任务之后再跑一轮,标记就作废,列重新跟着执行事实走。撤销是一键、不弹确认(它走的就是"点错了退回来"那条路),撤完回哪一列仍然由执行事实说了算 —— 所以那颗按钮只出现在"正是它把卡片留在已完成列"的卡上 |
|
|
1083
1083
|
| 派发执行器 | 派出去的任务由哪个 CLI 跑:**对话模式**在输入框下方选,**指令模式**在派发栏选 —— 两处是同一个组件、同一份选择,与执行按钮的临时切换也共用。注意「引擎」和「执行器」不是一回事:只有**内置 g ai** 能在服务端跑工具循环、才有派发能力,所以对话模式下把引擎切成外部 CLI 时,执行器选择会换成一句「当前引擎只能对话,不能派发任务 —— 切到内置 g ai 才能派活」的说明,而不是让你点了个不会生效的下拉 |
|
|
@@ -1222,9 +1222,9 @@ $ g ai --model=2 # 使用第 2 个已配置的模型(序号或
|
|
|
1222
1222
|
每个工具结果后保存进度,`/resume` 同时恢复工作目录和用量统计。
|
|
1223
1223
|
|
|
1224
1224
|
工具调用预算:一条消息内智能体最多连续调用 N 次工具,触顶后本轮被强制结束并提示
|
|
1225
|
-
"已达单轮最大工具调用次数",再发一条消息即可继续。N 默认 **
|
|
1225
|
+
"已达单轮最大工具调用次数",再发一条消息即可继续。N 默认 **1000**,可在
|
|
1226
1226
|
**设置 → AI 模型配置 → 智能体运行时** 修改(即 `~/.zen-gitsync/config.json` 的
|
|
1227
|
-
`aiMaxToolIterations`,范围 1–
|
|
1227
|
+
`aiMaxToolIterations`,范围 1–10000),Web 端智能体共用同一项设置。
|
|
1228
1228
|
|
|
1229
1229
|
图片:在 REPL 中按 `Alt+V` 粘贴剪贴板图片(截图),或用 `/image <路径>` 附加本地图片;
|
|
1230
1230
|
图片以多模态 `image_url` 部件随下一条消息发送(需视觉模型)。单独 `/image` 查看待发送图片,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zen-gitsync",
|
|
3
|
-
"version": "2.17.
|
|
3
|
+
"version": "2.17.38",
|
|
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",
|
package/src/cli/ai/turn.js
CHANGED
|
@@ -51,7 +51,9 @@ export async function runAgentTurn(state, userText, t, images = [], dependencies
|
|
|
51
51
|
}
|
|
52
52
|
state.messages.push({ role: 'user', content: userContent })
|
|
53
53
|
await checkpoint()
|
|
54
|
-
|
|
54
|
+
// 兜底只在 state.maxToolIterations 缺失/非正数时生效,正常路径由 loadConfig 规范化后传入。
|
|
55
|
+
// 默认值与 config.js 的 aiMaxToolIterations 保持一致(1000),别让两处悄悄分叉。
|
|
56
|
+
const maxIterations = state.maxToolIterations > 0 ? state.maxToolIterations : 1000
|
|
55
57
|
for (let iter = 0; iter < maxIterations; iter++) {
|
|
56
58
|
if (cancelled()) { stats.status = 'cancelled'; return stats }
|
|
57
59
|
const spinner = ui.startSpinner(t.waiting)
|
package/src/config.js
CHANGED
|
@@ -52,15 +52,16 @@ function resolveConfigPath() {
|
|
|
52
52
|
|
|
53
53
|
// AI 智能体单轮工具调用上限的可调范围。
|
|
54
54
|
// 下限 1 是为了保留"防失控"语义 —— 0 会让智能体一动手就停,没人是这个意图;
|
|
55
|
-
// 上限
|
|
55
|
+
// 上限 10000 只防"手改配置写成天文数字"这种明显笔误,不再当成额度保护 ——
|
|
56
|
+
// 真要烧光额度,单轮本来就该由用户自己在设置里选的大小负责(2026-10-03: 2000 → 10000)。
|
|
56
57
|
const AI_MAX_TOOL_ITERATIONS_MIN = 1;
|
|
57
|
-
const AI_MAX_TOOL_ITERATIONS_MAX =
|
|
58
|
+
const AI_MAX_TOOL_ITERATIONS_MAX = 10000;
|
|
58
59
|
|
|
59
60
|
/**
|
|
60
61
|
* 规范化单轮最大工具调用次数。
|
|
61
62
|
*
|
|
62
63
|
* 非法值(非数字 / NaN / 越界)一律**夹取**到合法区间而不是回退默认值 ——
|
|
63
|
-
* 用户手改成
|
|
64
|
+
* 用户手改成 50000 的意图明显是"想更大",夹到上限比悄悄退回默认小值更贴近意图。
|
|
64
65
|
* 完全无法解析(undefined / 'abc')才返回 null,交给调用方取默认值。
|
|
65
66
|
*/
|
|
66
67
|
function normalizeAiMaxToolIterations(value) {
|
|
@@ -154,8 +155,10 @@ const defaultConfig = {
|
|
|
154
155
|
// AI 智能体单轮最大工具调用次数(防失控)。CLI `g ai` 与 Web 智能体共用,全局生效。
|
|
155
156
|
// 2026-09-20: 40 → 200。40 轮在"读多个文件 → 逐个验证 → 再改"这类任务里很容易触顶,
|
|
156
157
|
// 触顶后本轮被强制结束,用户必须再发一条消息才能接着跑,体感像被截断。
|
|
158
|
+
// 2026-10-03: 200 → 1000。实测"边探边改"的长任务(读多个文件 + 逐个验证 + 提交)200 轮
|
|
159
|
+
// 依然会被顶掉,而顶掉后重发消息要重新把上下文喂一遍,远比多跑几轮贵。
|
|
157
160
|
// 想调小/调大改这个值即可(GUI: 设置 → AI 模型配置)。
|
|
158
|
-
aiMaxToolIterations:
|
|
161
|
+
aiMaxToolIterations: 1000,
|
|
159
162
|
// 工作台任务执行器(claude | opencode | codex)。全局配置,跨项目共享。
|
|
160
163
|
// 决定「执行任务 / 执行子任务 / 从此处开始 / 简单任务续聊」这条链路
|
|
161
164
|
// 默认 spawn 哪个本地 CLI;执行入口可以按次覆盖(见 workbench 执行路由)。
|
package/src/ui/public/assets/{AgentEngineSelector-DVs4LGHZ.js → AgentEngineSelector-BMJAsMx_.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./rolldown-runtime-C0FnF6B9.js";import{$n as e,Bn as t,C as n,Dn as r,En as i,Fr as a,In as o,J as s,Jr as c,On as l,Pn as u,S as d,Tn as f,Wn as p,Y as m,Yn as h,Zn as g,br as _,cr as v,ei as y,kn as b,pr as x,qn as S,tt as C,w,xn as T}from"./element-plus-Buzx8xRf.js";import{n as E,t as D}from"./_plugin-vue_export-helper-
|
|
1
|
+
import"./rolldown-runtime-C0FnF6B9.js";import{$n as e,Bn as t,C as n,Dn as r,En as i,Fr as a,In as o,J as s,Jr as c,On as l,Pn as u,S as d,Tn as f,Wn as p,Y as m,Yn as h,Zn as g,br as _,cr as v,ei as y,kn as b,pr as x,qn as S,tt as C,w,xn as T}from"./element-plus-Buzx8xRf.js";import{n as E,t as D}from"./_plugin-vue_export-helper-DcQKU19k.js";import{t as O}from"./SvgIcon-YQZtv72i.js";import{t as k}from"./toolsStore-CfyhqJeq.js";import{s as A,v as j}from"./index-DorcTBZN.js";import{c as M,d as N,l as P,u as F}from"./agentConversations-D_TsndCC.js";t(),x();function I(e,t=680){let n=_(0),r=null;function i(){let t=e.value;return t?(n.value=t.clientWidth,typeof ResizeObserver>`u`||(r=new ResizeObserver(e=>{let t=e[0]?.contentRect?.width;typeof t==`number`&&(n.value=t)}),r.observe(t),!0)):!1}return h(()=>{i()||p(()=>i())}),S(()=>{r?.disconnect(),r=null}),{width:n,narrow:f(()=>n.value>0&&n.value<t)}}t(),x();var L=o({__name:`AgentEngineSelector`,props:{engine:{type:String,required:!0},locked:{type:Boolean,required:!1}},emits:[`select`],setup(e,{expose:t,emit:r}){t();let i=e,a=r,o=k(),c=f(()=>F(i.engine)),l=f(()=>({gai:!0,claude:o.claudeAvailable,opencode:o.opencodeAvailable,codex:o.codexAvailable})),u=_(!1),p=_(null);function h(e){if(!i.locked){if(!l.value[e]){if(!N(e))return;p.value=e,u.value=!0;return}a(`select`,e)}}let g={props:i,emit:a,toolsStore:o,engineName:c,engineAvailability:l,installDialogVisible:u,installTool:p,onCommand:h,get $t(){return E},get ElIcon(){return s},get ElDropdown(){return d},get ElDropdownMenu(){return w},get ElDropdownItem(){return n},get ArrowDown(){return m},get Check(){return C},get AGENT_ENGINE_OPTIONS(){return M},get BUILTIN_ENGINE_ICON(){return P},get isExternalAgentEngine(){return N},SvgIcon:O,TaskExecutorIcon:A,ToolInstallDialog:j};return Object.defineProperty(g,"__isScriptSetup",{enumerable:!1,value:!0}),g}});t(),a();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`};function W(t,n,a,o,s,d){return g(),b(T,null,[l(` 单根包一层:父级传下来的 class(Tab 行的 margin-left:auto、面板的 flex:none)
|
|
2
2
|
才能可靠落到这里 —— 多根组件会丢掉 fallthrough class。 `),i(`div`,R,[u(o.ElDropdown,{trigger:`click`,onCommand:o.onCommand},{dropdown:v(()=>[u(o.ElDropdownMenu,null,{default:v(()=>[(g(!0),b(T,null,e(o.AGENT_ENGINE_OPTIONS,e=>(g(),r(o.ElDropdownItem,{key:e.id,command:e.id},{default:v(()=>[i(`span`,V,[o.isExternalAgentEngine(e.id)?(g(),r(o.TaskExecutorIcon,{key:0,executor:e.id,class:`agent-engine__item-icon`},null,8,[`executor`])):(g(),r(o.SvgIcon,{key:1,"icon-class":o.BUILTIN_ENGINE_ICON,class:`agent-engine__item-icon`},null,8,[`icon-class`])),i(`span`,H,y(e.name),1),a.engine===e.id?(g(),r(o.ElIcon,{key:2,class:`agent-engine__item-check`},{default:v(()=>[u(o.Check)]),_:1})):o.engineAvailability[e.id]?l(`v-if`,!0):(g(),b(`span`,U,y(o.$t(`@42BB9:未安装`)),1))])]),_:2},1032,[`command`]))),128))]),_:1})]),default:v(()=>[i(`button`,{type:`button`,class:c([`agent-engine__btn`,{"is-locked":a.locked}]),disabled:a.locked,title:a.locked?o.$t(`@AGENT:本会话的引擎已锁定;要换引擎请新建会话`):o.$t(`@AGENT:新建会话使用的引擎`),"aria-label":o.$t(`@AGENT:智能体引擎`)},[o.isExternalAgentEngine(a.engine)?(g(),r(o.TaskExecutorIcon,{key:0,executor:a.engine,class:`agent-engine__icon`},null,8,[`executor`])):(g(),r(o.SvgIcon,{key:1,"icon-class":o.BUILTIN_ENGINE_ICON,class:`agent-engine__icon`},null,8,[`icon-class`])),i(`span`,B,y(o.engineName),1),u(o.ElIcon,{class:`agent-engine__caret`},{default:v(()=>[u(o.ArrowDown)]),_:1})],10,z)]),_:1}),u(o.ToolInstallDialog,{modelValue:o.installDialogVisible,"onUpdate:modelValue":n[0]||=e=>o.installDialogVisible=e,tool:o.installTool},null,8,[`modelValue`,`tool`])])],2112)}var G=D(L,[[`render`,W],[`__scopeId`,`data-v-c67a4d14`],[`__file`,`C:/workspace/github_workspace/xz333221/zen-gitsync/src/ui/client/src/components/AgentEngineSelector.vue`]]);export{I as n,G as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./rolldown-runtime-C0FnF6B9.js";import{$n as e,At as t,Bn as n,Ct as r,Dn as i,En as a,Fr as o,Gt as s,Ht as ee,In as c,J as l,Jr as u,M as d,Nn as f,On as p,Pn as m,Tn as h,Tt as g,W as _,Wn as v,Xr as y,Yt as b,Zn as x,_n as S,a as C,an as w,br as T,cr as E,dn as D,ei as O,et as k,i as A,j,kn as M,kt as N,lr as P,lt as F,mt as I,nr as L,o as R,or as z,pr as B,st as V,tt as H,vr as U,xn as W}from"./element-plus-Buzx8xRf.js";import{a as G,t as K}from"./vendor-wERX2bc3.js";import{n as q,t as J}from"./_plugin-vue_export-helper-VuE2vqnn.js";import{t as te}from"./configStore-De_8eQuS.js";import{t as ne}from"./CommonDialog-BTeIpgGT.js";import{a as re,i as ie,n as ae,o as oe,r as se,s as ce,t as le}from"./agentConversations-DcW54Tlt.js";import{n as ue,t as de}from"./AgentEngineSelector-DVs4LGHZ.js";n(),B();var fe=c({__name:`MarketplacePanel`,props:{type:{type:String,required:!0}},setup(e,{expose:t}){t();let n=e,i=te(),a=T([]),o=T([]),c=T(!1),l=T(``),u=T(``),d=T([]),f=T(`project`),p=T(new Set),m=T(new Set),g=T(new Set),_=h(()=>i.currentDirectory||``),v=null;async function y(){if(!c.value){c.value=!0;try{let e=new URLSearchParams({type:n.type,cwd:_.value});u.value&&e.set(`q`,u.value),d.value.length&&e.set(`sources`,d.value.join(`,`));let t=await(await fetch(`/api/agent/marketplace/catalog?${e}`)).json();t?.success?(a.value=t.groups||[],o.value=t.installed||[]):C.error(t?.error||q(`@MKT:加载失败`))}catch{C.error(q(`@MKT:加载失败`))}finally{c.value=!1}}}z(l,e=>{v&&clearTimeout(v),v=setTimeout(()=>{u.value=e.trim(),y()},400)}),z(d,()=>y()),z(()=>n.type,()=>{d.value=[],u.value=``,l.value=``,y()}),z(_,()=>y()),y();let x=h(()=>{let e=_.value?_.value.split(/[\\/]/).filter(Boolean).pop():``;return f.value===`project`?e||q(`@MKT:当前项目`):q(`@MKT:g ai 智能体`)});function S(e){return e.stars?`${E(e.stars)} ★`:e.downloads?`${E(e.downloads)} ${q(`@MKT:周下载`)}`:e.uses?`${E(e.uses)} ${q(`@MKT:次使用`)}`:``}function E(e){return e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:1)}k`:String(e)}function D(e){return`${e.id}`}function O(e){return p.value.has(D(e))}let k=h(()=>{let e={project:[],global:[]};for(let t of o.value)(e[t.target]||=[]).push(t);return e}),j=U({visible:!1,item:null,env:{},args:``});function M(e){return n.type===`mcp`&&(!!e.envKeys?.length||!!e.args?.length)}function P(e){j.item=e,j.env=Object.fromEntries((e.envKeys||[]).map(e=>[e,``])),j.args=(e.args||[]).join(` `),j.visible=!0}function L(){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;B(e,{env:t,...n?{args:n}:{}})}async function R(e){if(!e.installed||await V(e)){if(M(e)){P(e);return}await B(e,{})}}async function B(e,t){let r=D(e);p.value.add(r);try{let r=await fetch(`/api/agent/marketplace/install`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({type:n.type,target:f.value,cwd:_.value,item:{...e,...t}})}),i=await r.json().catch(()=>null);if(!r.ok||!i?.success){C.error(i?.error||q(`@MKT:安装失败`));return}i.item?.warning&&C.warning(i.item.warning),i.item?.envKeys?.length?C.warning(`${q(`@MKT:还缺环境变量`)}: ${i.item.envKeys.join(`, `)}`):C.success(q(`@MKT:安装成功`)),await y()}catch{C.error(q(`@MKT:安装失败`))}finally{p.value.delete(r)}}async function V(e){try{return await A.confirm(`${e.name} ${q(`@MKT:已安装,要重新安装吗?`)}`,q(`@MKT:重新安装`),{confirmButtonText:q(`@MKT:重装`),cancelButtonText:q(`@MKT:取消`),type:`warning`}),!0}catch{return!1}}async function W(e){let t=`${e.target}:${e.id}`;g.value.add(t);try{let t=await fetch(`/api/agent/marketplace/reveal`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({type:n.type,target:e.target,cwd:_.value,id:e.id})}),r=await t.json().catch(()=>null);(!t.ok||!r?.success)&&C.error(r?.error||q(`@MKT:打开失败`))}catch{C.error(q(`@MKT:打开失败`))}finally{g.value.delete(t)}}async function G(e){try{await A.confirm(`${q(`@MKT:确定卸载`)} ${e.name}?`,q(`@MKT:卸载`),{confirmButtonText:q(`@MKT:卸载`),cancelButtonText:q(`@MKT:取消`),type:`warning`})}catch{return}let t=`${e.target}:${e.id}`;m.value.add(t);try{let t=new URLSearchParams({target:e.target,cwd:_.value}),r=await fetch(`/api/agent/marketplace/item/${n.type}/${encodeURIComponent(e.id)}?${t}`,{method:`DELETE`}),i=await r.json().catch(()=>null);if(!r.ok||!i?.success){C.error(i?.error||q(`@MKT:卸载失败`));return}C.success(q(`@MKT:已卸载`)),await y()}catch{C.error(q(`@MKT:卸载失败`))}finally{m.value.delete(t)}}let K={props:n,configStore:i,groups:a,installed:o,loading:c,searchInput:l,query:u,selectedSources:d,installTarget:f,installing:p,removing:m,revealing:g,cwd:_,get searchTimer(){return v},set searchTimer(e){v=e},loadCatalog:y,targetLabel:x,metricText:S,formatCount:E,cardKey:D,isBusy:O,installedByTarget:k,configDialog:j,needsConfig:M,openConfigDialog:P,confirmConfig:L,onInstall:R,doInstall:B,confirmReinstall:V,onReveal:W,onRemove:G,get $t(){return q},get Search(){return s},get Refresh(){return ee},get Delete(){return F},get Link(){return N},get Check(){return H},get Star(){return b},get Download(){return I},get Warning(){return w},get FolderOpened(){return r},CommonDialog:ne};return Object.defineProperty(K,"__isScriptSetup",{enumerable:!1,value:!0}),K}});n(),D(),o();var pe={class:`marketplace-panel`},Y={class:`mp-toolbar`},X={class:`mp-search`},me=[`placeholder`],he={class:`mp-toolbar-sub`},Z={class:`mp-target-hint`},Q={class:`mp-source-filter`},ge=[`onClick`],$={class:`mp-body`},_e={class:`mp-group-header`},ve={class:`mp-group-title`},ye={key:0,class:`mp-group-count`},be={key:1,class:`mp-group-error`},xe=[`href`,`title`],Se={key:0,class:`mp-grid`},Ce={class:`mp-card-head`},we=[`title`],Te={key:0,class:`mp-card-metric`},Ee=[`title`],De={class:`mp-card-meta`},Oe=[`title`],ke=[`title`],Ae={key:2,class:`mp-tag remote`},je={class:`mp-card-foot`},Me=[`href`],Ne={key:1,class:`mp-installed-chip`},Pe=[`disabled`,`onClick`],Fe={key:3,class:`mp-not-installable`},Ie={key:1,class:`mp-empty`},Le={key:0,class:`mp-group installed`},Re={class:`mp-group-header`},ze={class:`mp-group-title`},Be={class:`mp-group-count`},Ve={key:0,class:`mp-installed-block`},He={class:`mp-installed-target`},Ue={class:`mp-installed-list`},We=[`title`],Ge=[`title`],Ke={key:1,class:`mp-meta-pkg`},qe={key:2,class:`mp-tag warn`},Je=[`disabled`,`title`,`onClick`],Ye=[`disabled`,`onClick`],Xe={key:1,class:`mp-empty all`},Ze={key:0,class:`mkt-form`},Qe={class:`mkt-form-name`},$e=[`onUpdate:modelValue`,`placeholder`],et={key:0,class:`mkt-field`},tt={class:`mkt-hint`};function nt(t,n,r,o,s,ee){let c=l,h=j,g=d,v=_,y=R;return x(),M(`div`,pe,[p(` ── 工具栏 ───────────────────────────────── `),a(`div`,Y,[a(`div`,X,[m(c,{class:`mp-search-icon`},{default:E(()=>[m(o.Search)]),_:1}),P(a(`input`,{"onUpdate:modelValue":n[0]||=e=>o.searchInput=e,class:`mp-search-input`,type:`text`,placeholder:r.type===`skill`?o.$t(`@MKT:搜索 Skill...`):o.$t(`@MKT:搜索 MCP 服务...`)},null,8,me),[[S,o.searchInput]])]),m(g,{modelValue:o.installTarget,"onUpdate:modelValue":n[1]||=e=>o.installTarget=e,size:`small`,class:`mp-target`},{default:E(()=>[m(h,{value:`project`},{default:E(()=>[f(O(o.$t(`@MKT:当前项目`)),1)]),_:1}),m(h,{value:`global`},{default:E(()=>[f(O(o.$t(`@MKT:g ai 智能体`)),1)]),_:1})]),_:1},8,[`modelValue`]),m(v,{content:o.$t(`@MKT:刷新`),placement:`top`,"show-after":300},{default:E(()=>[a(`button`,{class:u([`mp-refresh`,{spinning:o.loading}]),onClick:o.loadCatalog},[m(c,null,{default:E(()=>[m(o.Refresh)]),_:1})],2)]),_:1},8,[`content`])]),a(`div`,he,[a(`span`,Z,[f(O(o.$t(`@MKT:安装到`))+` `,1),a(`b`,null,O(o.targetLabel),1)]),a(`div`,Q,[(x(!0),M(W,null,e(o.groups,e=>(x(),M(`button`,{key:e.id,class:u([`mp-chip`,{active:o.selectedSources.includes(e.id)}]),onClick:()=>{let t=o.selectedSources.indexOf(e.id);t>=0?o.selectedSources.splice(t,1):o.selectedSources.push(e.id)}},O(e.label),11,ge))),128)),o.selectedSources.length?(x(),M(`button`,{key:0,class:`mp-chip clear`,onClick:n[2]||=e=>o.selectedSources=[]},O(o.$t(`@MKT:全部来源`)),1)):p(`v-if`,!0)])]),p(` ── 内容 ─────────────────────────────────── `),P((x(),M(`div`,$,[(x(!0),M(W,null,e(o.groups,t=>(x(),M(`section`,{key:t.id,class:`mp-group`},[a(`header`,_e,[a(`h3`,ve,O(t.label),1),t.status===`ok`?(x(),M(`span`,ye,O(t.items.length),1)):(x(),M(`span`,be,[m(c,null,{default:E(()=>[m(o.Warning)]),_:1}),f(` `+O(t.error||o.$t(`@MKT:来源不可用`)),1)])),t.homepage?(x(),M(`a`,{key:2,class:`mp-group-link`,href:t.homepage,target:`_blank`,rel:`noopener noreferrer`,title:t.homepage},[m(c,null,{default:E(()=>[m(o.Link)]),_:1})],8,xe)):p(`v-if`,!0)]),t.status===`ok`&&t.items.length?(x(),M(`div`,Se,[(x(!0),M(W,null,e(t.items,t=>(x(),M(`article`,{key:o.cardKey(t),class:`mp-card`},[a(`div`,Ce,[a(`span`,{class:`mp-card-name`,title:t.name},O(t.name),9,we),o.metricText(t)?(x(),M(`span`,Te,[m(c,null,{default:E(()=>[t.stars?(x(),i(o.Star,{key:0})):(x(),i(o.Download,{key:1}))]),_:2},1024),f(` `+O(o.metricText(t)),1)])):p(`v-if`,!0)]),a(`p`,{class:`mp-card-desc`,title:t.description},O(t.description||o.$t(`@MKT:暂无描述`)),9,Ee),a(`div`,De,[t.package?(x(),M(`code`,{key:0,class:`mp-meta-pkg`,title:t.package},O(t.package),9,Oe)):t.repository?(x(),M(`span`,{key:1,class:`mp-meta-repo`,title:t.repository+(t.subpath?` · `+t.subpath:``)},[f(O(t.repository),1),t.subpath?(x(),M(W,{key:0},[f(` · `+O(t.subpath),1)],64)):p(`v-if`,!0)],8,ke)):p(`v-if`,!0),t.transport===`remote`?(x(),M(`span`,Ae,O(o.$t(`@MKT:远程服务`)),1)):p(`v-if`,!0),(x(!0),M(W,null,e((t.tags||[]).slice(0,2),e=>(x(),M(`span`,{key:e,class:`mp-tag`},O(e),1))),128))]),a(`div`,je,[t.upstream?(x(),M(`a`,{key:0,class:`mp-card-link`,href:t.upstream,target:`_blank`,rel:`noopener noreferrer`},O(o.$t(`@MKT:查看来源`)),9,Me)):p(`v-if`,!0),n[6]||=a(`span`,{class:`mp-foot-spacer`},null,-1),t.installed?(x(),M(`span`,Ne,[m(c,null,{default:E(()=>[m(o.Check)]),_:1}),f(O(o.$t(`@MKT:已安装`)),1)])):t.installable===!1?(x(),M(`span`,Fe,O(o.$t(`@MKT:暂不支持一键安装`)),1)):(x(),M(`button`,{key:2,class:`mp-install-btn`,disabled:o.isBusy(t),onClick:e=>o.onInstall(t)},O(o.isBusy(t)?o.$t(`@MKT:安装中...`):o.$t(`@MKT:安装`)),9,Pe))])]))),128))])):t.status===`ok`?(x(),M(`div`,Ie,O(o.$t(`@MKT:该来源暂无结果`)),1)):p(`v-if`,!0)]))),128)),p(` ── 已安装 ─────────────────────────────── `),o.installed.length?(x(),M(`section`,Le,[a(`header`,Re,[a(`h3`,ze,O(o.$t(`@MKT:已安装`)),1),a(`span`,Be,O(o.installed.length),1)]),(x(),M(W,null,e([`project`,`global`],t=>a(`div`,{key:t},[o.installedByTarget[t]?.length?(x(),M(`div`,Ve,[a(`div`,He,O(t===`project`?o.$t(`@MKT:当前项目`):o.$t(`@MKT:g ai 智能体`)),1),a(`div`,Ue,[(x(!0),M(W,null,e(o.installedByTarget[t],e=>(x(),M(`div`,{key:t+e.id,class:`mp-installed-row`},[a(`span`,{class:`mp-installed-name`,title:e.name},O(e.name),9,We),p(` 实际落盘的标识:SKILL.md 里的 name 常与仓库名不同(如仓库 taste-skill
|
|
1
|
+
import"./rolldown-runtime-C0FnF6B9.js";import{$n as e,At as t,Bn as n,Ct as r,Dn as i,En as a,Fr as o,Gt as s,Ht as ee,In as c,J as l,Jr as u,M as d,Nn as f,On as p,Pn as m,Tn as h,Tt as g,W as _,Wn as v,Xr as y,Yt as b,Zn as x,_n as S,a as C,an as w,br as T,cr as E,dn as D,ei as O,et as k,i as A,j,kn as M,kt as N,lr as P,lt as F,mt as I,nr as L,o as R,or as z,pr as B,st as V,tt as H,vr as U,xn as W}from"./element-plus-Buzx8xRf.js";import{a as G,t as K}from"./vendor-wERX2bc3.js";import{n as q,t as J}from"./_plugin-vue_export-helper-DcQKU19k.js";import{t as te}from"./configStore-u3FUM08v.js";import{t as ne}from"./CommonDialog-DuI8Bsg7.js";import{a as re,i as ie,n as ae,o as oe,r as se,s as ce,t as le}from"./agentConversations-D_TsndCC.js";import{n as ue,t as de}from"./AgentEngineSelector-BMJAsMx_.js";n(),B();var fe=c({__name:`MarketplacePanel`,props:{type:{type:String,required:!0}},setup(e,{expose:t}){t();let n=e,i=te(),a=T([]),o=T([]),c=T(!1),l=T(``),u=T(``),d=T([]),f=T(`project`),p=T(new Set),m=T(new Set),g=T(new Set),_=h(()=>i.currentDirectory||``),v=null;async function y(){if(!c.value){c.value=!0;try{let e=new URLSearchParams({type:n.type,cwd:_.value});u.value&&e.set(`q`,u.value),d.value.length&&e.set(`sources`,d.value.join(`,`));let t=await(await fetch(`/api/agent/marketplace/catalog?${e}`)).json();t?.success?(a.value=t.groups||[],o.value=t.installed||[]):C.error(t?.error||q(`@MKT:加载失败`))}catch{C.error(q(`@MKT:加载失败`))}finally{c.value=!1}}}z(l,e=>{v&&clearTimeout(v),v=setTimeout(()=>{u.value=e.trim(),y()},400)}),z(d,()=>y()),z(()=>n.type,()=>{d.value=[],u.value=``,l.value=``,y()}),z(_,()=>y()),y();let x=h(()=>{let e=_.value?_.value.split(/[\\/]/).filter(Boolean).pop():``;return f.value===`project`?e||q(`@MKT:当前项目`):q(`@MKT:g ai 智能体`)});function S(e){return e.stars?`${E(e.stars)} ★`:e.downloads?`${E(e.downloads)} ${q(`@MKT:周下载`)}`:e.uses?`${E(e.uses)} ${q(`@MKT:次使用`)}`:``}function E(e){return e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:1)}k`:String(e)}function D(e){return`${e.id}`}function O(e){return p.value.has(D(e))}let k=h(()=>{let e={project:[],global:[]};for(let t of o.value)(e[t.target]||=[]).push(t);return e}),j=U({visible:!1,item:null,env:{},args:``});function M(e){return n.type===`mcp`&&(!!e.envKeys?.length||!!e.args?.length)}function P(e){j.item=e,j.env=Object.fromEntries((e.envKeys||[]).map(e=>[e,``])),j.args=(e.args||[]).join(` `),j.visible=!0}function L(){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;B(e,{env:t,...n?{args:n}:{}})}async function R(e){if(!e.installed||await V(e)){if(M(e)){P(e);return}await B(e,{})}}async function B(e,t){let r=D(e);p.value.add(r);try{let r=await fetch(`/api/agent/marketplace/install`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({type:n.type,target:f.value,cwd:_.value,item:{...e,...t}})}),i=await r.json().catch(()=>null);if(!r.ok||!i?.success){C.error(i?.error||q(`@MKT:安装失败`));return}i.item?.warning&&C.warning(i.item.warning),i.item?.envKeys?.length?C.warning(`${q(`@MKT:还缺环境变量`)}: ${i.item.envKeys.join(`, `)}`):C.success(q(`@MKT:安装成功`)),await y()}catch{C.error(q(`@MKT:安装失败`))}finally{p.value.delete(r)}}async function V(e){try{return await A.confirm(`${e.name} ${q(`@MKT:已安装,要重新安装吗?`)}`,q(`@MKT:重新安装`),{confirmButtonText:q(`@MKT:重装`),cancelButtonText:q(`@MKT:取消`),type:`warning`}),!0}catch{return!1}}async function W(e){let t=`${e.target}:${e.id}`;g.value.add(t);try{let t=await fetch(`/api/agent/marketplace/reveal`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({type:n.type,target:e.target,cwd:_.value,id:e.id})}),r=await t.json().catch(()=>null);(!t.ok||!r?.success)&&C.error(r?.error||q(`@MKT:打开失败`))}catch{C.error(q(`@MKT:打开失败`))}finally{g.value.delete(t)}}async function G(e){try{await A.confirm(`${q(`@MKT:确定卸载`)} ${e.name}?`,q(`@MKT:卸载`),{confirmButtonText:q(`@MKT:卸载`),cancelButtonText:q(`@MKT:取消`),type:`warning`})}catch{return}let t=`${e.target}:${e.id}`;m.value.add(t);try{let t=new URLSearchParams({target:e.target,cwd:_.value}),r=await fetch(`/api/agent/marketplace/item/${n.type}/${encodeURIComponent(e.id)}?${t}`,{method:`DELETE`}),i=await r.json().catch(()=>null);if(!r.ok||!i?.success){C.error(i?.error||q(`@MKT:卸载失败`));return}C.success(q(`@MKT:已卸载`)),await y()}catch{C.error(q(`@MKT:卸载失败`))}finally{m.value.delete(t)}}let K={props:n,configStore:i,groups:a,installed:o,loading:c,searchInput:l,query:u,selectedSources:d,installTarget:f,installing:p,removing:m,revealing:g,cwd:_,get searchTimer(){return v},set searchTimer(e){v=e},loadCatalog:y,targetLabel:x,metricText:S,formatCount:E,cardKey:D,isBusy:O,installedByTarget:k,configDialog:j,needsConfig:M,openConfigDialog:P,confirmConfig:L,onInstall:R,doInstall:B,confirmReinstall:V,onReveal:W,onRemove:G,get $t(){return q},get Search(){return s},get Refresh(){return ee},get Delete(){return F},get Link(){return N},get Check(){return H},get Star(){return b},get Download(){return I},get Warning(){return w},get FolderOpened(){return r},CommonDialog:ne};return Object.defineProperty(K,"__isScriptSetup",{enumerable:!1,value:!0}),K}});n(),D(),o();var pe={class:`marketplace-panel`},Y={class:`mp-toolbar`},X={class:`mp-search`},me=[`placeholder`],he={class:`mp-toolbar-sub`},Z={class:`mp-target-hint`},Q={class:`mp-source-filter`},ge=[`onClick`],$={class:`mp-body`},_e={class:`mp-group-header`},ve={class:`mp-group-title`},ye={key:0,class:`mp-group-count`},be={key:1,class:`mp-group-error`},xe=[`href`,`title`],Se={key:0,class:`mp-grid`},Ce={class:`mp-card-head`},we=[`title`],Te={key:0,class:`mp-card-metric`},Ee=[`title`],De={class:`mp-card-meta`},Oe=[`title`],ke=[`title`],Ae={key:2,class:`mp-tag remote`},je={class:`mp-card-foot`},Me=[`href`],Ne={key:1,class:`mp-installed-chip`},Pe=[`disabled`,`onClick`],Fe={key:3,class:`mp-not-installable`},Ie={key:1,class:`mp-empty`},Le={key:0,class:`mp-group installed`},Re={class:`mp-group-header`},ze={class:`mp-group-title`},Be={class:`mp-group-count`},Ve={key:0,class:`mp-installed-block`},He={class:`mp-installed-target`},Ue={class:`mp-installed-list`},We=[`title`],Ge=[`title`],Ke={key:1,class:`mp-meta-pkg`},qe={key:2,class:`mp-tag warn`},Je=[`disabled`,`title`,`onClick`],Ye=[`disabled`,`onClick`],Xe={key:1,class:`mp-empty all`},Ze={key:0,class:`mkt-form`},Qe={class:`mkt-form-name`},$e=[`onUpdate:modelValue`,`placeholder`],et={key:0,class:`mkt-field`},tt={class:`mkt-hint`};function nt(t,n,r,o,s,ee){let c=l,h=j,g=d,v=_,y=R;return x(),M(`div`,pe,[p(` ── 工具栏 ───────────────────────────────── `),a(`div`,Y,[a(`div`,X,[m(c,{class:`mp-search-icon`},{default:E(()=>[m(o.Search)]),_:1}),P(a(`input`,{"onUpdate:modelValue":n[0]||=e=>o.searchInput=e,class:`mp-search-input`,type:`text`,placeholder:r.type===`skill`?o.$t(`@MKT:搜索 Skill...`):o.$t(`@MKT:搜索 MCP 服务...`)},null,8,me),[[S,o.searchInput]])]),m(g,{modelValue:o.installTarget,"onUpdate:modelValue":n[1]||=e=>o.installTarget=e,size:`small`,class:`mp-target`},{default:E(()=>[m(h,{value:`project`},{default:E(()=>[f(O(o.$t(`@MKT:当前项目`)),1)]),_:1}),m(h,{value:`global`},{default:E(()=>[f(O(o.$t(`@MKT:g ai 智能体`)),1)]),_:1})]),_:1},8,[`modelValue`]),m(v,{content:o.$t(`@MKT:刷新`),placement:`top`,"show-after":300},{default:E(()=>[a(`button`,{class:u([`mp-refresh`,{spinning:o.loading}]),onClick:o.loadCatalog},[m(c,null,{default:E(()=>[m(o.Refresh)]),_:1})],2)]),_:1},8,[`content`])]),a(`div`,he,[a(`span`,Z,[f(O(o.$t(`@MKT:安装到`))+` `,1),a(`b`,null,O(o.targetLabel),1)]),a(`div`,Q,[(x(!0),M(W,null,e(o.groups,e=>(x(),M(`button`,{key:e.id,class:u([`mp-chip`,{active:o.selectedSources.includes(e.id)}]),onClick:()=>{let t=o.selectedSources.indexOf(e.id);t>=0?o.selectedSources.splice(t,1):o.selectedSources.push(e.id)}},O(e.label),11,ge))),128)),o.selectedSources.length?(x(),M(`button`,{key:0,class:`mp-chip clear`,onClick:n[2]||=e=>o.selectedSources=[]},O(o.$t(`@MKT:全部来源`)),1)):p(`v-if`,!0)])]),p(` ── 内容 ─────────────────────────────────── `),P((x(),M(`div`,$,[(x(!0),M(W,null,e(o.groups,t=>(x(),M(`section`,{key:t.id,class:`mp-group`},[a(`header`,_e,[a(`h3`,ve,O(t.label),1),t.status===`ok`?(x(),M(`span`,ye,O(t.items.length),1)):(x(),M(`span`,be,[m(c,null,{default:E(()=>[m(o.Warning)]),_:1}),f(` `+O(t.error||o.$t(`@MKT:来源不可用`)),1)])),t.homepage?(x(),M(`a`,{key:2,class:`mp-group-link`,href:t.homepage,target:`_blank`,rel:`noopener noreferrer`,title:t.homepage},[m(c,null,{default:E(()=>[m(o.Link)]),_:1})],8,xe)):p(`v-if`,!0)]),t.status===`ok`&&t.items.length?(x(),M(`div`,Se,[(x(!0),M(W,null,e(t.items,t=>(x(),M(`article`,{key:o.cardKey(t),class:`mp-card`},[a(`div`,Ce,[a(`span`,{class:`mp-card-name`,title:t.name},O(t.name),9,we),o.metricText(t)?(x(),M(`span`,Te,[m(c,null,{default:E(()=>[t.stars?(x(),i(o.Star,{key:0})):(x(),i(o.Download,{key:1}))]),_:2},1024),f(` `+O(o.metricText(t)),1)])):p(`v-if`,!0)]),a(`p`,{class:`mp-card-desc`,title:t.description},O(t.description||o.$t(`@MKT:暂无描述`)),9,Ee),a(`div`,De,[t.package?(x(),M(`code`,{key:0,class:`mp-meta-pkg`,title:t.package},O(t.package),9,Oe)):t.repository?(x(),M(`span`,{key:1,class:`mp-meta-repo`,title:t.repository+(t.subpath?` · `+t.subpath:``)},[f(O(t.repository),1),t.subpath?(x(),M(W,{key:0},[f(` · `+O(t.subpath),1)],64)):p(`v-if`,!0)],8,ke)):p(`v-if`,!0),t.transport===`remote`?(x(),M(`span`,Ae,O(o.$t(`@MKT:远程服务`)),1)):p(`v-if`,!0),(x(!0),M(W,null,e((t.tags||[]).slice(0,2),e=>(x(),M(`span`,{key:e,class:`mp-tag`},O(e),1))),128))]),a(`div`,je,[t.upstream?(x(),M(`a`,{key:0,class:`mp-card-link`,href:t.upstream,target:`_blank`,rel:`noopener noreferrer`},O(o.$t(`@MKT:查看来源`)),9,Me)):p(`v-if`,!0),n[6]||=a(`span`,{class:`mp-foot-spacer`},null,-1),t.installed?(x(),M(`span`,Ne,[m(c,null,{default:E(()=>[m(o.Check)]),_:1}),f(O(o.$t(`@MKT:已安装`)),1)])):t.installable===!1?(x(),M(`span`,Fe,O(o.$t(`@MKT:暂不支持一键安装`)),1)):(x(),M(`button`,{key:2,class:`mp-install-btn`,disabled:o.isBusy(t),onClick:e=>o.onInstall(t)},O(o.isBusy(t)?o.$t(`@MKT:安装中...`):o.$t(`@MKT:安装`)),9,Pe))])]))),128))])):t.status===`ok`?(x(),M(`div`,Ie,O(o.$t(`@MKT:该来源暂无结果`)),1)):p(`v-if`,!0)]))),128)),p(` ── 已安装 ─────────────────────────────── `),o.installed.length?(x(),M(`section`,Le,[a(`header`,Re,[a(`h3`,ze,O(o.$t(`@MKT:已安装`)),1),a(`span`,Be,O(o.installed.length),1)]),(x(),M(W,null,e([`project`,`global`],t=>a(`div`,{key:t},[o.installedByTarget[t]?.length?(x(),M(`div`,Ve,[a(`div`,He,O(t===`project`?o.$t(`@MKT:当前项目`):o.$t(`@MKT:g ai 智能体`)),1),a(`div`,Ue,[(x(!0),M(W,null,e(o.installedByTarget[t],e=>(x(),M(`div`,{key:t+e.id,class:`mp-installed-row`},[a(`span`,{class:`mp-installed-name`,title:e.name},O(e.name),9,We),p(` 实际落盘的标识:SKILL.md 里的 name 常与仓库名不同(如仓库 taste-skill
|
|
2
2
|
里的 skill 自称 brandkit),不显示这个用户就对不上广场卡片上的名字 `),e.id&&e.id!==e.name?(x(),M(`code`,{key:0,class:`mp-installed-id`,title:e.dir||e.file||e.id},O(e.id),9,Ge)):p(`v-if`,!0),e.package?(x(),M(`code`,Ke,O(e.package),1)):p(`v-if`,!0),e.requiredEnv?.length?(x(),M(`span`,qe,O(o.$t(`@MKT:待配置`))+`: `+O(e.requiredEnv.join(`, `)),1)):p(`v-if`,!0),n[7]||=a(`span`,{class:`mp-foot-spacer`},null,-1),a(`button`,{class:`mp-reveal-btn`,disabled:o.revealing.has(t+e.id),title:e.dir||e.file||``,onClick:t=>o.onReveal(e)},[m(c,null,{default:E(()=>[m(o.FolderOpened)]),_:1}),f(` `+O(o.$t(`@MKT:打开文件夹`)),1)],8,Je),a(`button`,{class:`mp-remove-btn`,disabled:o.removing.has(t+e.id),onClick:t=>o.onRemove(e)},[m(c,null,{default:E(()=>[m(o.Delete)]),_:1}),f(` `+O(o.removing.has(t+e.id)?o.$t(`@MKT:卸载中...`):o.$t(`@MKT:卸载`)),1)],8,Ye)]))),128))])])):p(`v-if`,!0)])),64))])):p(`v-if`,!0),!o.loading&&!o.groups.length?(x(),M(`div`,Xe,O(o.$t(`@MKT:加载失败`)),1)):p(`v-if`,!0)])),[[y,o.loading]]),p(` ── MCP 安装前配置 ───────────────────────── `),m(o.CommonDialog,{modelValue:o.configDialog.visible,"onUpdate:modelValue":n[5]||=e=>o.configDialog.visible=e,title:o.$t(`@MKT:配置 MCP`),width:`460px`,type:`flex`,"close-on-click-modal":!1,"append-to-body":``},{footer:E(()=>[a(`button`,{class:`mkt-cancel`,onClick:n[4]||=e=>o.configDialog.visible=!1},O(o.$t(`@MKT:取消`)),1),a(`button`,{class:`mkt-confirm`,onClick:o.confirmConfig},O(o.$t(`@MKT:安装`)),1)]),default:E(()=>[o.configDialog.item?(x(),M(`div`,Ze,[a(`p`,Qe,O(o.configDialog.item.name),1),(x(!0),M(W,null,e(Object.keys(o.configDialog.env),e=>(x(),M(`div`,{key:e,class:`mkt-field`},[a(`label`,null,O(e),1),P(a(`input`,{"onUpdate:modelValue":t=>o.configDialog.env[e]=t,type:`text`,autocomplete:`off`,placeholder:o.$t(`@MKT:环境变量值`),spellcheck:`false`},null,8,$e),[[S,o.configDialog.env[e]]])]))),128)),o.configDialog.item.args?.length?(x(),M(`div`,et,[a(`label`,null,O(o.$t(`@MKT:启动参数`)),1),P(a(`input`,{"onUpdate:modelValue":n[3]||=e=>o.configDialog.args=e,type:`text`,autocomplete:`off`,spellcheck:`false`},null,512),[[S,o.configDialog.args]]),a(`p`,tt,O(o.$t(`@MKT:参数提示`)),1)])):p(`v-if`,!0)])):p(`v-if`,!0)]),_:1},8,[`modelValue`,`title`])])}var rt=J(fe,[[`render`,nt],[`__scopeId`,`data-v-e9f9e851`],[`__file`,`C:/workspace/github_workspace/xz333221/zen-gitsync/src/ui/client/src/components/MarketplacePanel.vue`]]);n(),B();var it=c({__name:`AgentView`,setup(e,{expose:n}){n();let r=te(),i=T(null),{narrow:a}=ue(i),o=T(`chat`),s=T(`chat`),ee=h(()=>s.value===`mcp`?`mcp`:`skill`),c=h(()=>[{id:`chat`,label:q(`@AGENT:对话`),icon:k},{id:`skill`,label:q(`@AGENT:Skill 广场`),icon:g},{id:`mcp`,label:q(`@AGENT:MCP 广场`),icon:V}]),{sessions:u,sessionsLoading:d,currentSessionId:f,messages:p,isStreaming:m,sessionLoading:_,loadSessions:y,loadSession:b,deleteSession:x,renameSession:S,newSession:C,sendMessage:w,pendingQuestion:E,answeringQuestion:D,answerQuestion:O,isSessionGenerating:A,currentEngine:j,pendingEngine:M,isEngineLocked:N,pickEngine:P,stop:F}=ce(),I=h(()=>N.value?j.value:M.value);function L(e){N.value||P(e)}let R=h(()=>{let e=r.theme;return e===`dark`||e===`auto`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}),B=h(()=>re(u.value,A)),H=se(),U=h(()=>B.value.find(e=>e.id===f.value)?.title||q(`@AGENT:对话`)),W={"--welcome-avatar":`url("${le}")`},J=h(()=>[{id:`p1`,label:q(`@AGENT:查看项目结构`),prompt:q(`@AGENT:prompt_p1`)},{id:`p2`,label:q(`@AGENT:分析代码质量`),prompt:q(`@AGENT:prompt_p2`)},{id:`p3`,label:q(`@AGENT:帮我写测试`),prompt:q(`@AGENT:prompt_p3`)},{id:`p4`,label:q(`@AGENT:Git 状态检查`),prompt:q(`@AGENT:prompt_p4`)},{id:`p5`,label:q(`@AGENT:帮我启动项目`),prompt:q(`@AGENT:prompt_p5`)}]);async function ne(e){await w(e.text,e.files),await v(),X()}async function fe(e){await w(e.prompt),await v(),X()}let pe=ie(),Y=T(null);function X(e=!0){Y.value?.scrollToBottom(e)}z(()=>p.value.length,()=>{v(()=>X(!1))});function me(e){b(e),o.value=`chat`}function he(){C(),o.value=`chat`}let Z=T(280),Q=T(!1);function ge(e){Q.value=!0;let t=e.clientX,n=Z.value,r=e=>{let r=e.clientX-t,i=Math.max(200,Math.min(500,n+r));Z.value=i},i=()=>{Q.value=!1,document.removeEventListener(`mousemove`,r),document.removeEventListener(`mouseup`,i)};document.addEventListener(`mousemove`,r),document.addEventListener(`mouseup`,i)}z(a,e=>{e||(o.value=`chat`)}),z(()=>[r.currentDirectory,m.value],async([e,t],n)=>{let r=!n||e!==n[0],i=!!n&&n[1]===!0&&!t;(r||i)&&await y(),f.value&&!m.value&&!u.value.some(e=>e.sessionId===f.value)&&C()},{immediate:!0});let $={configStore:r,rootRef:i,narrow:a,chatPage:o,activeTab:s,marketplaceType:ee,tabs:c,sessions:u,sessionsLoading:d,currentSessionId:f,messages:p,isStreaming:m,sessionLoading:_,loadSessions:y,loadSession:b,deleteSession:x,renameSession:S,newSession:C,sendMessage:w,pendingQuestion:E,answeringQuestion:D,answerQuestion:O,isSessionGenerating:A,currentEngine:j,pendingEngine:M,isEngineLocked:N,pickEngine:P,stop:F,displayEngine:I,handleEngineSelect:L,chatTheme:R,conversationItems:B,conversationLabels:H,currentSessionTitle:U,welcomeAvatarStyle:W,presetQuestions:J,onSend:ne,onSelectPreset:fe,questionLabels:pe,chatContainerRef:Y,scrollToBottom:X,selectSession:me,handleNewSession:he,sidebarWidth:Z,isResizing:Q,startResize:ge,get $t(){return q},get ElIcon(){return l},get Loading(){return t},get ChatContainer(){return G},get ConversationList(){return K},get AGENT_UPLOAD_ACCEPT(){return oe},get AGENT_ASSISTANT_NAME(){return ae},get AGENT_ASSISTANT_AVATAR(){return le},MarketplacePanel:rt,AgentEngineSelector:de};return Object.defineProperty($,"__isScriptSetup",{enumerable:!1,value:!0}),$}});n(),o();var at={ref:`rootRef`,class:`agent-view`},ot={class:`agent-chat-area`},st={class:`agent-tabs`,role:`tablist`},ct=[`aria-selected`,`onClick`],lt={class:`agent-tab-body`},ut={key:0,class:`agent-chat-pane`},dt={key:0,class:`agent-list-page`},ft={key:0,class:`agent-page-bar`},pt=[`title`,`aria-label`],mt={class:`agent-page-title`},ht={key:0,class:`chat-loading`};function gt(t,n,r,o,s,ee){return x(),M(`div`,at,[p(` ═══ 宽屏:左侧会话列表(只在「对话」Tab 显示)═══
|
|
3
3
|
窄屏时这一整块不渲染,会话列表改成 body 里的一个整页(见 .agent-list-page) `),o.activeTab===`chat`&&!o.narrow?(x(),M(W,{key:0},[a(`aside`,{class:`agent-sidebar`,style:y({width:o.sidebarWidth+`px`})},[p(` 会话列表:UI 与交互都在组件库的 ConversationList 里 `),m(o.ConversationList,{class:`agent-conversations`,items:o.conversationItems,"active-id":o.currentSessionId,loading:o.sessionsLoading,labels:o.conversationLabels,onSelect:o.selectSession,onNew:o.handleNewSession,onRename:o.renameSession,onDelete:o.deleteSession},null,8,[`items`,`active-id`,`loading`,`labels`,`onRename`,`onDelete`])],4),p(` 拖拽分隔条 `),a(`div`,{class:u([`sidebar-resizer`,{active:o.isResizing}]),onMousedown:o.startResize},null,34)],64)):p(`v-if`,!0),p(` ═══ 右侧:Tab 栏 + 内容区 ═══ `),a(`main`,ot,[a(`nav`,st,[(x(!0),M(W,null,e(o.tabs,e=>(x(),M(`button`,{key:e.id,type:`button`,class:u([`agent-tab`,{active:o.activeTab===e.id}]),role:`tab`,"aria-selected":o.activeTab===e.id,onClick:t=>o.activeTab=e.id},[m(o.ElIcon,null,{default:E(()=>[(x(),i(L(e.icon)))]),_:2},1024),a(`span`,null,O(e.label),1)],10,ct))),128)),p(` ═══ 引擎选择器 ═══
|
|
4
4
|
与工作台执行器下拉同一套交互(点击展开、未安装标出来、点了直接开安装弹窗)。
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./rolldown-runtime-C0FnF6B9.js";import{At as e,Bn as t,Dn as n,En as r,Fr as i,In as a,J as o,Jr as s,Nn as c,On as l,Pn as u,Tn as d,W as f,Wn as p,Yn as m,Zn as h,a as g,br as _,cr as v,ei as y,i as b,kn as x,nt as S,or as C,pr as w,qn as T,rt as E,z as D}from"./element-plus-Buzx8xRf.js";import{n as O,t as k}from"./_plugin-vue_export-helper-
|
|
2
|
-
`);i=o.pop()??``;for(let e of o)e.trim()&&t(e)}i.trim()&&t(i)}async function M(){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 ee(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 j(t,t=>{try{e(JSON.parse(t))}catch{}})}async function N(){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())};j(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(()=>{})})}t(),w();var P=`npm install -g zen-gitsync --registry https://registry.npmjs.org/`,F=a({__name:`UpgradeDialog`,props:{modelValue:{type:Boolean,required:!0},logs:{type:String,required:!0},status:{type:String,required:!0},countdown:{type:Number,required:!1,default:0}},emits:[`update:modelValue`,`retry`,`restart`,`cancel`],setup(t,{expose:n,emit:r}){n();let i=t,a=r,o=_(null);C(()=>i.logs,async()=>{await p(),o.value&&(o.value.scrollTop=o.value.scrollHeight)});function s(){i.status!==`running`&&(i.status===`success`&&i.countdown>0&&a(`cancel`),a(`update:modelValue`,!1))}function c(){a(`retry`)}function l(){a(`restart`)}function u(){a(`cancel`),a(`update:modelValue`,!1)}async function d(){try{await navigator.clipboard.writeText(P),g.success(O(`@F13B4:已复制升级命令`))}catch{g.warning(O(`@F13B4:复制失败,请手动复制`))}}let f={MANUAL_COMMAND:P,props:i,emit:a,logEl:o,close:s,onRetry:c,onRestart:l,onLater:u,onCopyCommand:d,get Loading(){return e},get CircleCheck(){return S},get CircleClose(){return E},get $t(){return O},CommonDialog:A};return Object.defineProperty(f,"__isScriptSetup",{enumerable:!1,value:!0}),f}});t(),i();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`};function U(e,t,i,a,d,f){let p=o,m=D;return h(),n(a.CommonDialog,{"model-value":i.modelValue,"onUpdate:modelValue":t[0]||=e=>a.emit(`update:modelValue`,e),title:a.$t(`@F13B4:升级`),width:`680px`,type:`flex`,"close-on-click-modal":!1,"close-on-press-escape":!1,"show-close":i.status!==`running`,"append-to-body":``,onClose:a.close},{footer:v(()=>[i.status===`failed`?(h(),n(m,{key:0,type:`primary`,onClick:a.onRetry},{default:v(()=>[c(y(a.$t(`@F13B4:重试`)),1)]),_:1})):l(`v-if`,!0),i.status===`failed`?(h(),n(m,{key:1,onClick:a.onCopyCommand},{default:v(()=>[c(y(a.$t(`@F13B4:复制升级命令`)),1)]),_:1})):l(`v-if`,!0),i.status===`success`?(h(),n(m,{key:2,type:`primary`,onClick:a.onRestart},{default:v(()=>[c(y(a.$t(`@F13B4:立即重启并刷新`)),1)]),_:1})):l(`v-if`,!0),i.status===`success`?(h(),n(m,{key:3,onClick:a.onLater},{default:v(()=>[c(y(a.$t(`@F13B4:稍后手动重启`)),1)]),_:1})):l(`v-if`,!0),i.status===`running`?(h(),n(m,{key:4,disabled:``},{default:v(()=>[c(y(a.$t(`@F13B4:升级中`))+`... `,1)]),_:1})):l(`v-if`,!0)]),default:v(()=>[r(`div`,{class:s([`upgrade-status`,`is-${i.status}`])},[i.status===`running`?(h(),n(p,{key:0,class:`is-loading`},{default:v(()=>[u(a.Loading)]),_:1})):i.status===`success`?(h(),n(p,{key:1,color:`var(--color-success)`},{default:v(()=>[u(a.CircleCheck)]),_:1})):(h(),n(p,{key:2,color:`var(--color-danger)`},{default:v(()=>[u(a.CircleClose)]),_:1})),i.status===`running`?(h(),x(`span`,I,y(a.$t(`@F13B4:升级中`)),1)):i.status===`success`?(h(),x(`span`,L,y(a.$t(`@F13B4:升级完成`)),1)):(h(),x(`span`,R,y(a.$t(`@F13B4:升级失败`)),1))],2),i.status===`success`?(h(),x(`p`,z,[c(y(a.$t(`@F13B4:新版本已全局安装,需要重启服务才能生效`))+` `,1),i.countdown>0?(h(),x(`span`,B,y(a.$t(`@F13B4:{seconds} 秒后自动刷新`,{seconds:i.countdown})),1)):l(`v-if`,!0)])):l(`v-if`,!0),i.status===`failed`?(h(),x(`p`,V,[r(`span`,H,y(a.$t(`@F13B4:手动升级命令`)),1),r(`code`,{class:`upgrade-manual__cmd`},y(a.MANUAL_COMMAND))])):l(`v-if`,!0),r(`pre`,{ref:`logEl`,class:`upgrade-log`},y(i.logs||a.$t(`@F13B4:等待日志输出`)),513)]),_:1},8,[`model-value`,`title`,`show-close`])}var W=k(F,[[`render`,U],[`__scopeId`,`data-v-bc566bba`],[`__file`,`C:/workspace/github_workspace/xz333221/zen-gitsync/src/ui/client/src/components/UpgradeDialog.vue`]]);t(),w();var G=`https://github.com/xz333221/zen-gitsync/releases`,K=5,q=`app-version-check`,J=36e5,Y=a({__name:`AppVersionBadge`,setup(e,{expose:t}){t();let n=`2.17.36`,r=_(n),i=d(()=>r.value||n),a=_(null),o=_(!1),s=_(``),c=_(`running`),l=_(0),u=null,f=_(!1);function p(){try{let e=sessionStorage.getItem(q);if(!e)return null;let{at:t,data:n}=JSON.parse(e);return Date.now()-t>J?null:n}catch{return null}}function h(e){try{sessionStorage.setItem(q,JSON.stringify({at:Date.now(),data:e}))}catch{}}async function v(e=!1){let t=p();t&&(a.value=t);try{let t=await M();a.value=t,h(t),t.current&&(r.value=t.current),!e&&t.success&&t.hasUpdate&&g({type:`success`,message:O(`@F13B4:发现新版本 {version}`,{version:t.latest??``}),duration:4e3})}catch(t){e||g({type:`warning`,message:O(`@F13B4:检查更新失败 {error}`,{error:t?.message||``})})}}async function y(){if(a.value?.hasUpdate){try{await b.confirm(O(`@F13B4:确定要从 {current} 升级到 {latest} 吗?`,{current:a.value.current,latest:a.value.latest}),O(`@F13B4:升级`),{confirmButtonText:O(`@F13B4:确定升级`),cancelButtonText:O(`@F13B4:取消`),type:`info`})}catch{return}s.value=``,c.value=`running`,o.value=!0,await ee(e=>{if(e.type===`done`){if(c.value=e.code===0?`success`:`failed`,e.code===0){try{sessionStorage.removeItem(q)}catch{}a.value?.latest&&(r.value=a.value.latest),x()}}else e.message&&(s.value+=e.message)})}}function x(){S(),l.value=K,u=setInterval(()=>{--l.value,l.value<=0&&(u&&=(clearInterval(u),null),w())},1e3)}function S(){u&&=(clearInterval(u),null),l.value=0}function C(){S()}async function w(){if(S(),!f.value){f.value=!0;try{let e=await N(),{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];g({type:`warning`,message:n?O(n):O(`@F13B4:重启失败 {error}`,{error:t})}),f.value=!1}}}T(()=>{S()}),m(()=>{v(!0)});let E={buildVersion:n,releasesUrl:G,runtimeVersion:r,displayVersion:i,latestInfo:a,upgradeDialogVisible:o,upgradeLogs:s,upgradeStatus:c,AUTO_REFRESH_SECONDS:K,countdown:l,get countdownTimer(){return u},set countdownTimer(e){u=e},restartInFlight:f,CACHE_KEY:q,CACHE_TTL_MS:J,readCache:p,writeCache:h,checkUpdate:v,handleUpgrade:y,startAutoRefreshCountdown:x,cancelAutoRefreshCountdown:S,handleCancelAutoRefresh:C,handleRestart:w,get $t(){return O},UpgradeDialog:W};return Object.defineProperty(E,"__isScriptSetup",{enumerable:!1,value:!0}),E}});t(),i();var X={class:`app-version-badge`},Z=[`aria-label`],Q=[`aria-label`],$=[`title`,`aria-label`],te={class:`upgrade-btn__label`},ne={class:`upgrade-btn__version`};function re(e,t,n,i,a,o){let s=f;return h(),x(`div`,X,[l(` GitHub 链接 `),u(s,{content:i.$t(`@F13B4:在 GitHub 上查看源码`),placement:`top`,effect:`dark`,"show-after":300},{default:v(()=>[r(`a`,{href:`https://github.com/xz333221/zen-gitsync`,target:`_blank`,rel:`noopener noreferrer`,class:`badge-icon-link`,"aria-label":i.$t(`@F13B4:在 GitHub 上查看源码`)},[...t[1]||=[r(`svg`,{viewBox:`0 0 24 24`,width:`15`,height:`15`,"aria-hidden":`true`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},[r(`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,Z)]),_:1},8,[`content`]),l(` NPM 链接 `),u(s,{content:i.$t(`@F13B4:在 npm 上查看包`),placement:`top`,effect:`dark`,"show-after":300},{default:v(()=>[r(`a`,{href:`https://www.npmjs.com/package/zen-gitsync`,target:`_blank`,rel:`noopener noreferrer`,class:`badge-icon-link badge-icon-link--npm`,"aria-label":i.$t(`@F13B4:在 npm 上查看包`)},[...t[2]||=[r(`svg`,{viewBox:`0 0 24 24`,width:`15`,height:`15`,"aria-hidden":`true`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},[r(`path`,{d:`M2 2v20h20V2H2zm17.167 17.167H12.5v-10h-3.333v10H4.833V4.833h14.334v14.334z`})],-1)]],8,Q)]),_:1},8,[`content`]),l(` 版本号 `),u(s,{content:i.$t(`@F13B4:查看更新`),placement:`top`,effect:`dark`,"show-after":300},{default:v(()=>[r(`a`,{href:i.releasesUrl,target:`_blank`,rel:`noopener noreferrer`,class:`version-link`},`v`+y(i.displayVersion),1)]),_:1},8,[`content`]),i.latestInfo?.hasUpdate?(h(),x(`button`,{key:0,type:`button`,class:`upgrade-btn`,title:i.$t(`@F13B4:发现新版本 {version},点击升级`,{version:i.latestInfo.latest??``}),"aria-label":i.$t(`@F13B4:发现新版本 {version},点击升级`,{version:i.latestInfo.latest??``}),onClick:i.handleUpgrade},[t[3]||=r(`span`,{class:`upgrade-btn__dot`,"aria-hidden":`true`},null,-1),r(`span`,te,y(i.$t(`@F13B4:升级`)),1),r(`span`,ne,`v`+y(i.latestInfo.latest),1)],8,$)):l(`v-if`,!0),u(i.UpgradeDialog,{modelValue:i.upgradeDialogVisible,"onUpdate:modelValue":t[0]||=e=>i.upgradeDialogVisible=e,logs:i.upgradeLogs,status:i.upgradeStatus,countdown:i.countdown,onRetry:i.handleUpgrade,onRestart:i.handleRestart,onCancel:i.handleCancelAutoRefresh},null,8,[`modelValue`,`logs`,`status`,`countdown`])])}var ie=k(Y,[[`render`,re],[`__scopeId`,`data-v-7e0300ec`],[`__file`,`C:/workspace/github_workspace/xz333221/zen-gitsync/src/ui/client/src/components/AppVersionBadge.vue`]]);export{ie as default};
|
|
1
|
+
import"./rolldown-runtime-C0FnF6B9.js";import{At as e,Bn as t,Dn as n,En as r,Fr as i,In as a,J as o,Jr as s,Nn as c,On as l,Pn as u,Tn as d,W as f,Wn as p,Yn as m,Zn as h,a as g,br as _,cr as v,ei as y,i as b,kn as x,nt as S,or as C,pr as w,qn as T,rt as E,z as D}from"./element-plus-Buzx8xRf.js";import{n as O,t as k}from"./_plugin-vue_export-helper-DcQKU19k.js";import{t as A}from"./CommonDialog-DuI8Bsg7.js";async function j(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 M(){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 ee(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 j(t,t=>{try{e(JSON.parse(t))}catch{}})}async function N(){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())};j(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(()=>{})})}t(),w();var P=`npm install -g zen-gitsync --registry https://registry.npmjs.org/`,F=a({__name:`UpgradeDialog`,props:{modelValue:{type:Boolean,required:!0},logs:{type:String,required:!0},status:{type:String,required:!0},countdown:{type:Number,required:!1,default:0}},emits:[`update:modelValue`,`retry`,`restart`,`cancel`],setup(t,{expose:n,emit:r}){n();let i=t,a=r,o=_(null);C(()=>i.logs,async()=>{await p(),o.value&&(o.value.scrollTop=o.value.scrollHeight)});function s(){i.status!==`running`&&(i.status===`success`&&i.countdown>0&&a(`cancel`),a(`update:modelValue`,!1))}function c(){a(`retry`)}function l(){a(`restart`)}function u(){a(`cancel`),a(`update:modelValue`,!1)}async function d(){try{await navigator.clipboard.writeText(P),g.success(O(`@F13B4:已复制升级命令`))}catch{g.warning(O(`@F13B4:复制失败,请手动复制`))}}let f={MANUAL_COMMAND:P,props:i,emit:a,logEl:o,close:s,onRetry:c,onRestart:l,onLater:u,onCopyCommand:d,get Loading(){return e},get CircleCheck(){return S},get CircleClose(){return E},get $t(){return O},CommonDialog:A};return Object.defineProperty(f,"__isScriptSetup",{enumerable:!1,value:!0}),f}});t(),i();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`};function U(e,t,i,a,d,f){let p=o,m=D;return h(),n(a.CommonDialog,{"model-value":i.modelValue,"onUpdate:modelValue":t[0]||=e=>a.emit(`update:modelValue`,e),title:a.$t(`@F13B4:升级`),width:`680px`,type:`flex`,"close-on-click-modal":!1,"close-on-press-escape":!1,"show-close":i.status!==`running`,"append-to-body":``,onClose:a.close},{footer:v(()=>[i.status===`failed`?(h(),n(m,{key:0,type:`primary`,onClick:a.onRetry},{default:v(()=>[c(y(a.$t(`@F13B4:重试`)),1)]),_:1})):l(`v-if`,!0),i.status===`failed`?(h(),n(m,{key:1,onClick:a.onCopyCommand},{default:v(()=>[c(y(a.$t(`@F13B4:复制升级命令`)),1)]),_:1})):l(`v-if`,!0),i.status===`success`?(h(),n(m,{key:2,type:`primary`,onClick:a.onRestart},{default:v(()=>[c(y(a.$t(`@F13B4:立即重启并刷新`)),1)]),_:1})):l(`v-if`,!0),i.status===`success`?(h(),n(m,{key:3,onClick:a.onLater},{default:v(()=>[c(y(a.$t(`@F13B4:稍后手动重启`)),1)]),_:1})):l(`v-if`,!0),i.status===`running`?(h(),n(m,{key:4,disabled:``},{default:v(()=>[c(y(a.$t(`@F13B4:升级中`))+`... `,1)]),_:1})):l(`v-if`,!0)]),default:v(()=>[r(`div`,{class:s([`upgrade-status`,`is-${i.status}`])},[i.status===`running`?(h(),n(p,{key:0,class:`is-loading`},{default:v(()=>[u(a.Loading)]),_:1})):i.status===`success`?(h(),n(p,{key:1,color:`var(--color-success)`},{default:v(()=>[u(a.CircleCheck)]),_:1})):(h(),n(p,{key:2,color:`var(--color-danger)`},{default:v(()=>[u(a.CircleClose)]),_:1})),i.status===`running`?(h(),x(`span`,I,y(a.$t(`@F13B4:升级中`)),1)):i.status===`success`?(h(),x(`span`,L,y(a.$t(`@F13B4:升级完成`)),1)):(h(),x(`span`,R,y(a.$t(`@F13B4:升级失败`)),1))],2),i.status===`success`?(h(),x(`p`,z,[c(y(a.$t(`@F13B4:新版本已全局安装,需要重启服务才能生效`))+` `,1),i.countdown>0?(h(),x(`span`,B,y(a.$t(`@F13B4:{seconds} 秒后自动刷新`,{seconds:i.countdown})),1)):l(`v-if`,!0)])):l(`v-if`,!0),i.status===`failed`?(h(),x(`p`,V,[r(`span`,H,y(a.$t(`@F13B4:手动升级命令`)),1),r(`code`,{class:`upgrade-manual__cmd`},y(a.MANUAL_COMMAND))])):l(`v-if`,!0),r(`pre`,{ref:`logEl`,class:`upgrade-log`},y(i.logs||a.$t(`@F13B4:等待日志输出`)),513)]),_:1},8,[`model-value`,`title`,`show-close`])}var W=k(F,[[`render`,U],[`__scopeId`,`data-v-bc566bba`],[`__file`,`C:/workspace/github_workspace/xz333221/zen-gitsync/src/ui/client/src/components/UpgradeDialog.vue`]]);t(),w();var G=`https://github.com/xz333221/zen-gitsync/releases`,K=5,q=`app-version-check`,J=36e5,Y=a({__name:`AppVersionBadge`,setup(e,{expose:t}){t();let n=`2.17.38`,r=_(n),i=d(()=>r.value||n),a=_(null),o=_(!1),s=_(``),c=_(`running`),l=_(0),u=null,f=_(!1);function p(){try{let e=sessionStorage.getItem(q);if(!e)return null;let{at:t,data:n}=JSON.parse(e);return Date.now()-t>J?null:n}catch{return null}}function h(e){try{sessionStorage.setItem(q,JSON.stringify({at:Date.now(),data:e}))}catch{}}async function v(e=!1){let t=p();t&&(a.value=t);try{let t=await M();a.value=t,h(t),t.current&&(r.value=t.current),!e&&t.success&&t.hasUpdate&&g({type:`success`,message:O(`@F13B4:发现新版本 {version}`,{version:t.latest??``}),duration:4e3})}catch(t){e||g({type:`warning`,message:O(`@F13B4:检查更新失败 {error}`,{error:t?.message||``})})}}async function y(){if(a.value?.hasUpdate){try{await b.confirm(O(`@F13B4:确定要从 {current} 升级到 {latest} 吗?`,{current:a.value.current,latest:a.value.latest}),O(`@F13B4:升级`),{confirmButtonText:O(`@F13B4:确定升级`),cancelButtonText:O(`@F13B4:取消`),type:`info`})}catch{return}s.value=``,c.value=`running`,o.value=!0,await ee(e=>{if(e.type===`done`){if(c.value=e.code===0?`success`:`failed`,e.code===0){try{sessionStorage.removeItem(q)}catch{}a.value?.latest&&(r.value=a.value.latest),x()}}else e.message&&(s.value+=e.message)})}}function x(){S(),l.value=K,u=setInterval(()=>{--l.value,l.value<=0&&(u&&=(clearInterval(u),null),w())},1e3)}function S(){u&&=(clearInterval(u),null),l.value=0}function C(){S()}async function w(){if(S(),!f.value){f.value=!0;try{let e=await N(),{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];g({type:`warning`,message:n?O(n):O(`@F13B4:重启失败 {error}`,{error:t})}),f.value=!1}}}T(()=>{S()}),m(()=>{v(!0)});let E={buildVersion:n,releasesUrl:G,runtimeVersion:r,displayVersion:i,latestInfo:a,upgradeDialogVisible:o,upgradeLogs:s,upgradeStatus:c,AUTO_REFRESH_SECONDS:K,countdown:l,get countdownTimer(){return u},set countdownTimer(e){u=e},restartInFlight:f,CACHE_KEY:q,CACHE_TTL_MS:J,readCache:p,writeCache:h,checkUpdate:v,handleUpgrade:y,startAutoRefreshCountdown:x,cancelAutoRefreshCountdown:S,handleCancelAutoRefresh:C,handleRestart:w,get $t(){return O},UpgradeDialog:W};return Object.defineProperty(E,"__isScriptSetup",{enumerable:!1,value:!0}),E}});t(),i();var X={class:`app-version-badge`},Z=[`aria-label`],Q=[`aria-label`],$=[`title`,`aria-label`],te={class:`upgrade-btn__label`},ne={class:`upgrade-btn__version`};function re(e,t,n,i,a,o){let s=f;return h(),x(`div`,X,[l(` GitHub 链接 `),u(s,{content:i.$t(`@F13B4:在 GitHub 上查看源码`),placement:`top`,effect:`dark`,"show-after":300},{default:v(()=>[r(`a`,{href:`https://github.com/xz333221/zen-gitsync`,target:`_blank`,rel:`noopener noreferrer`,class:`badge-icon-link`,"aria-label":i.$t(`@F13B4:在 GitHub 上查看源码`)},[...t[1]||=[r(`svg`,{viewBox:`0 0 24 24`,width:`15`,height:`15`,"aria-hidden":`true`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},[r(`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,Z)]),_:1},8,[`content`]),l(` NPM 链接 `),u(s,{content:i.$t(`@F13B4:在 npm 上查看包`),placement:`top`,effect:`dark`,"show-after":300},{default:v(()=>[r(`a`,{href:`https://www.npmjs.com/package/zen-gitsync`,target:`_blank`,rel:`noopener noreferrer`,class:`badge-icon-link badge-icon-link--npm`,"aria-label":i.$t(`@F13B4:在 npm 上查看包`)},[...t[2]||=[r(`svg`,{viewBox:`0 0 24 24`,width:`15`,height:`15`,"aria-hidden":`true`,fill:`currentColor`,xmlns:`http://www.w3.org/2000/svg`},[r(`path`,{d:`M2 2v20h20V2H2zm17.167 17.167H12.5v-10h-3.333v10H4.833V4.833h14.334v14.334z`})],-1)]],8,Q)]),_:1},8,[`content`]),l(` 版本号 `),u(s,{content:i.$t(`@F13B4:查看更新`),placement:`top`,effect:`dark`,"show-after":300},{default:v(()=>[r(`a`,{href:i.releasesUrl,target:`_blank`,rel:`noopener noreferrer`,class:`version-link`},`v`+y(i.displayVersion),1)]),_:1},8,[`content`]),i.latestInfo?.hasUpdate?(h(),x(`button`,{key:0,type:`button`,class:`upgrade-btn`,title:i.$t(`@F13B4:发现新版本 {version},点击升级`,{version:i.latestInfo.latest??``}),"aria-label":i.$t(`@F13B4:发现新版本 {version},点击升级`,{version:i.latestInfo.latest??``}),onClick:i.handleUpgrade},[t[3]||=r(`span`,{class:`upgrade-btn__dot`,"aria-hidden":`true`},null,-1),r(`span`,te,y(i.$t(`@F13B4:升级`)),1),r(`span`,ne,`v`+y(i.latestInfo.latest),1)],8,$)):l(`v-if`,!0),u(i.UpgradeDialog,{modelValue:i.upgradeDialogVisible,"onUpdate:modelValue":t[0]||=e=>i.upgradeDialogVisible=e,logs:i.upgradeLogs,status:i.upgradeStatus,countdown:i.countdown,onRetry:i.handleUpgrade,onRestart:i.handleRestart,onCancel:i.handleCancelAutoRefresh},null,8,[`modelValue`,`logs`,`status`,`countdown`])])}var ie=k(Y,[[`render`,re],[`__scopeId`,`data-v-7e0300ec`],[`__file`,`C:/workspace/github_workspace/xz333221/zen-gitsync/src/ui/client/src/components/AppVersionBadge.vue`]]);export{ie as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-C0FnF6B9.js";import{$n as e,Bn as t,Dn as n,En as r,F as i,Fr as a,G as o,Ht as s,I as c,In as l,J as u,Jr as d,K as f,Nt as p,On as m,Pn as h,Tn as g,U as _,Zn as v,br as y,cr as b,dn as x,ei as S,kn as C,pr as w,r as T,tt as E,xn as D,yn as O,zt as k}from"./element-plus-Buzx8xRf.js";import{n as A,t as j}from"./_plugin-vue_export-helper-
|
|
1
|
+
import"./rolldown-runtime-C0FnF6B9.js";import{$n as e,Bn as t,Dn as n,En as r,F as i,Fr as a,G as o,Ht as s,I as c,In as l,J as u,Jr as d,K as f,Nt as p,On as m,Pn as h,Tn as g,U as _,Zn as v,br as y,cr as b,dn as x,ei as S,kn as C,pr as w,r as T,tt as E,xn as D,yn as O,zt as k}from"./element-plus-Buzx8xRf.js";import{n as A,t as j}from"./_plugin-vue_export-helper-DcQKU19k.js";import{t as M}from"./SvgIcon-YQZtv72i.js";import{t as N}from"./IconButton-C07zojvw.js";import{r as P}from"./gitStore-ZjHYEyKS.js";import{t as F}from"./CommonDialog-DuI8Bsg7.js";t(),w();var I=l({__name:`BranchSelector`,emits:[`branchChanged`],setup(e,{expose:t,emit:n}){t();let r=P(),i=n,a=y(!1),o=y(``),c=g(()=>{let e=o.value.trim().toLowerCase();return e?r.allBranches.filter(t=>t.toLowerCase().includes(e)):r.allBranches});async function l(e){if(e===r.currentBranch){a.value=!1;return}a.value=!1,await r.changeBranch(e)&&(i(`branchChanged`),r.refreshLog())}let u=y(!1),d=y(``),f=y(``);function m(){a.value=!1,f.value=r.currentBranch,u.value=!0}async function h(){await r.createBranch(d.value,f.value)&&(u.value=!1,d.value=``,i(`branchChanged`))}let _=y(!1);async function v(){if(!_.value){_.value=!0;try{await Promise.all([r.getCurrentBranch(!0),r.getBranchStatus(!0),r.getAllBranches()]),i(`branchChanged`),r.refreshLog()}finally{_.value=!1}}}let b={gitStore:r,emit:i,branchPopoverVisible:a,branchFilter:o,filteredBranches:c,selectBranch:l,createBranchDialogVisible:u,newBranchName:d,selectedBaseBranch:f,openCreateBranchDialog:m,createNewBranch:h,isRefreshingBranch:_,refreshCurrentBranch:v,get $t(){return A},get Plus(){return k},get Menu(){return p},get Check(){return E},get Refresh(){return s},CommonDialog:F,IconButton:N,SvgIcon:M};return Object.defineProperty(b,"__isScriptSetup",{enumerable:!1,value:!0}),b}});t(),a(),x();var L={key:0,class:`branch-info`},R={class:`branch-wrapper`},z={class:`branch-btn`},B={class:`branch-btn-name`},V={class:`branch-btn-caret`},H={class:`branch-popover-inner`},U={class:`branch-search`},W={class:`branch-list`},G=[`onClick`],K={key:1,class:`branch-item-check-placeholder`},q={class:`branch-item-name`},J={key:0,class:`branch-empty`},Y={class:`branch-popover-footer`},X={class:`create-branch-content`},Z={class:`form-label`},Q={class:`form-label`},$={class:`dialog-footer`},ee={class:`footer-actions`},te=[`disabled`];function ne(t,a,s,l,p,g){let y=u,x=_,w=T,E=f,k=i,A=c,j=o;return l.gitStore.currentBranch?(v(),C(`div`,L,[r(`div`,R,[m(` VSCode 风格分支按钮 + 弹出列表 `),h(w,{visible:l.branchPopoverVisible,"onUpdate:visible":a[1]||=e=>l.branchPopoverVisible=e,placement:`top-start`,width:260,trigger:`click`,"popper-class":`branch-popover`,"show-arrow":!1,onShow:a[2]||=e=>l.branchFilter=``},{reference:b(()=>[r(`button`,z,[h(l.SvgIcon,{"icon-class":`git-branch`,"class-name":`branch-btn-icon`}),r(`span`,B,S(l.gitStore.currentBranch),1),r(`span`,V,[h(y,null,{default:b(()=>[...a[7]||=[r(`svg`,{viewBox:`0 0 1024 1024`,xmlns:`http://www.w3.org/2000/svg`},[r(`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:b(()=>[r(`div`,H,[m(` 搜索框 `),r(`div`,U,[h(x,{modelValue:l.branchFilter,"onUpdate:modelValue":a[0]||=e=>l.branchFilter=e,placeholder:l.$t(`@F13B4:搜索或签出分支`),size:`small`,clearable:``,autofocus:``},null,8,[`modelValue`,`placeholder`])]),m(` 分支列表 `),r(`div`,W,[(v(!0),C(D,null,e(l.filteredBranches,e=>(v(),C(`div`,{key:e,class:d([`branch-item`,{"is-active":e===l.gitStore.currentBranch}]),onClick:t=>l.selectBranch(e)},[e===l.gitStore.currentBranch?(v(),n(y,{key:0,class:`branch-item-check`},{default:b(()=>[h(l.Check)]),_:1})):(v(),C(`span`,K)),h(l.SvgIcon,{"icon-class":`git-branch`,"class-name":`branch-item-icon`}),r(`span`,q,S(e),1)],10,G))),128)),l.filteredBranches.length===0?(v(),C(`div`,J,S(l.$t(`@F13B4:没有匹配的分支`)),1)):m(`v-if`,!0)]),m(` 底部:创建新分支 `),r(`div`,Y,[r(`button`,{class:`branch-create-btn`,onClick:l.openCreateBranchDialog},[h(y,null,{default:b(()=>[h(l.Plus)]),_:1}),r(`span`,null,S(l.$t(`@F13B4:创建新分支`)),1)])])])]),_:1},8,[`visible`]),m(` 刷新按钮 `),h(l.IconButton,{tooltip:l.$t(`@CMDCON:刷新`),onClick:l.refreshCurrentBranch},{default:b(()=>[h(y,{class:d({"is-loading":l.isRefreshingBranch})},{default:b(()=>[h(l.Refresh)]),_:1},8,[`class`])]),_:1},8,[`tooltip`])]),m(` 创建分支对话框 `),h(l.CommonDialog,{modelValue:l.createBranchDialogVisible,"onUpdate:modelValue":a[6]||=e=>l.createBranchDialogVisible=e,title:l.$t(`@F13B4:创建新分支`),size:`small`,"destroy-on-close":!0,"append-to-body":!0,"custom-class":`create-branch-dialog`},{footer:b(()=>[r(`div`,$,[r(`div`,ee,[r(`button`,{type:`button`,class:`dialog-cancel-btn`,onClick:a[5]||=e=>l.createBranchDialogVisible=!1},S(l.$t(`@F13B4:取消`)),1),r(`button`,{type:`button`,class:`dialog-confirm-btn`,onClick:l.createNewBranch,disabled:l.gitStore.isCreatingBranch},[l.gitStore.isCreatingBranch?(v(),n(y,{key:1,class:`is-loading`},{default:b(()=>[...a[8]||=[r(`svg`,{viewBox:`0 0 1024 1024`,xmlns:`http://www.w3.org/2000/svg`},[r(`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})):(v(),n(y,{key:0},{default:b(()=>[h(l.Check)]),_:1})),r(`span`,null,S(l.$t(`@F13B4:创建`)),1)],8,te)])])]),default:b(()=>[r(`div`,X,[h(j,{model:{newBranchName:l.newBranchName,selectedBaseBranch:l.selectedBaseBranch},"label-position":`top`},{default:b(()=>[h(E,null,{label:b(()=>[r(`div`,Z,[h(y,{class:`label-icon`},{default:b(()=>[h(l.Plus)]),_:1}),r(`span`,null,S(l.$t(`@F13B4:新分支名称`)),1)])]),default:b(()=>[h(x,{modelValue:l.newBranchName,"onUpdate:modelValue":a[3]||=e=>l.newBranchName=e,placeholder:l.$t(`@F13B4:请输入新分支名称`),class:`modern-input`,size:`large`,onKeyup:O(l.createNewBranch,[`enter`])},null,8,[`modelValue`,`placeholder`])]),_:1}),h(E,null,{label:b(()=>[r(`div`,Q,[h(y,{class:`label-icon`},{default:b(()=>[h(l.Menu)]),_:1}),r(`span`,null,S(l.$t(`@F13B4:基于分支`)),1)])]),default:b(()=>[h(A,{modelValue:l.selectedBaseBranch,"onUpdate:modelValue":a[4]||=e=>l.selectedBaseBranch=e,placeholder:l.$t(`@F13B4:选择基础分支`),class:`modern-select`,size:`large`,style:{width:`100%`}},{default:b(()=>[(v(!0),C(D,null,e(l.gitStore.allBranches,e=>(v(),n(k,{key:e,label:e,value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])]),_:1})]),_:1},8,[`model`])])]),_:1},8,[`modelValue`,`title`])])):m(`v-if`,!0)}var re=j(I,[[`render`,ne],[`__scopeId`,`data-v-9548a76f`],[`__file`,`C:/workspace/github_workspace/xz333221/zen-gitsync/src/ui/client/src/components/BranchSelector.vue`]]);export{re as default};
|