litepaseo 0.13.4 → 0.14.0

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.
Files changed (148) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/server/cli.mjs +2 -2
  3. package/dist/server/{worker-Dtl_KOz9.mjs → worker-DCp3pZYp.mjs} +278 -15
  4. package/dist/web/assets/AddProjectDialog-KlhTl3pQ.js +1 -0
  5. package/dist/web/assets/AddProjectDialog-KlhTl3pQ.js.br +0 -0
  6. package/dist/web/assets/AddProjectDialog-KlhTl3pQ.js.gz +0 -0
  7. package/dist/web/assets/{ArchivedWorkspaces-B2vUSFVW.js → ArchivedWorkspaces-DskP5Tih.js} +1 -1
  8. package/dist/web/assets/ArchivedWorkspaces-DskP5Tih.js.br +0 -0
  9. package/dist/web/assets/ArchivedWorkspaces-DskP5Tih.js.gz +0 -0
  10. package/dist/web/assets/{ChangesPanel-DBlpoPYb.js → ChangesPanel-CNFEnH8u.js} +2 -2
  11. package/dist/web/assets/ChangesPanel-CNFEnH8u.js.br +0 -0
  12. package/dist/web/assets/ChangesPanel-CNFEnH8u.js.gz +0 -0
  13. package/dist/web/assets/{CodeBlockNode-fBM-qTZY.js → CodeBlockNode-D5UGBgBo.js} +1 -1
  14. package/dist/web/assets/CodeBlockNode-D5UGBgBo.js.br +0 -0
  15. package/dist/web/assets/CodeBlockNode-D5UGBgBo.js.gz +0 -0
  16. package/dist/web/assets/{CommandCenter-CIwf7U03.js → CommandCenter-CfbLPl1u.js} +1 -1
  17. package/dist/web/assets/CommandCenter-CfbLPl1u.js.br +0 -0
  18. package/dist/web/assets/CommandCenter-CfbLPl1u.js.gz +0 -0
  19. package/dist/web/assets/{ConversationSearch-Ckc45F45.js → ConversationSearch-Cdqnpodo.js} +1 -1
  20. package/dist/web/assets/ConversationSearch-Cdqnpodo.js.br +0 -0
  21. package/dist/web/assets/ConversationSearch-Cdqnpodo.js.gz +0 -0
  22. package/dist/web/assets/FileViewer-BfvWZNL8.js +2 -0
  23. package/dist/web/assets/FileViewer-BfvWZNL8.js.br +0 -0
  24. package/dist/web/assets/FileViewer-BfvWZNL8.js.gz +0 -0
  25. package/dist/web/assets/FileViewer-DgsB2rdj.css +1 -0
  26. package/dist/web/assets/FileViewer-DgsB2rdj.css.br +0 -0
  27. package/dist/web/assets/FileViewer-DgsB2rdj.css.gz +0 -0
  28. package/dist/web/assets/FilesPanel-CZQKdUg4.js +1 -0
  29. package/dist/web/assets/FilesPanel-CZQKdUg4.js.br +0 -0
  30. package/dist/web/assets/FilesPanel-CZQKdUg4.js.gz +0 -0
  31. package/dist/web/assets/HostSettings-DAa1rg7p.js +5 -0
  32. package/dist/web/assets/HostSettings-DAa1rg7p.js.br +0 -0
  33. package/dist/web/assets/HostSettings-DAa1rg7p.js.gz +0 -0
  34. package/dist/web/assets/ImportSessionDialog-XjbnywIR.js +1 -0
  35. package/dist/web/assets/ImportSessionDialog-XjbnywIR.js.br +0 -0
  36. package/dist/web/assets/ImportSessionDialog-XjbnywIR.js.gz +0 -0
  37. package/dist/web/assets/{KanbanPage-DwZbnEwI.js → KanbanPage-6LaK4lAp.js} +1 -1
  38. package/dist/web/assets/KanbanPage-6LaK4lAp.js.br +0 -0
  39. package/dist/web/assets/KanbanPage-6LaK4lAp.js.gz +0 -0
  40. package/dist/web/assets/{LabelsDialog-CIZwN5JQ.js → LabelsDialog-aECWzRCP.js} +1 -1
  41. package/dist/web/assets/LabelsDialog-aECWzRCP.js.br +0 -0
  42. package/dist/web/assets/LabelsDialog-aECWzRCP.js.gz +0 -0
  43. package/dist/web/assets/{MarkdownMessage-B5JuY96x.js → MarkdownMessage-Cz2a-heW.js} +5 -5
  44. package/dist/web/assets/MarkdownMessage-Cz2a-heW.js.br +0 -0
  45. package/dist/web/assets/MarkdownMessage-Cz2a-heW.js.gz +0 -0
  46. package/dist/web/assets/{PreCodeBlock-BZxij1Se.js → PreCodeBlock-VABP7RPr.js} +1 -1
  47. package/dist/web/assets/{PreCodeBlock.vue_vue_type_style_index_0_lang-C8gxl3_t.js → PreCodeBlock.vue_vue_type_style_index_0_lang-B4p5wP0S.js} +1 -1
  48. package/dist/web/assets/PreCodeBlock.vue_vue_type_style_index_0_lang-B4p5wP0S.js.br +0 -0
  49. package/dist/web/assets/PreCodeBlock.vue_vue_type_style_index_0_lang-B4p5wP0S.js.gz +0 -0
  50. package/dist/web/assets/{SubagentsPanel-NjiTD7SL.js → SubagentsPanel-DNQ0U-hw.js} +1 -1
  51. package/dist/web/assets/SubagentsPanel-DNQ0U-hw.js.br +0 -0
  52. package/dist/web/assets/SubagentsPanel-DNQ0U-hw.js.gz +0 -0
  53. package/dist/web/assets/TerminalPanel-BnjX_223.js +3 -0
  54. package/dist/web/assets/TerminalPanel-BnjX_223.js.br +0 -0
  55. package/dist/web/assets/TerminalPanel-BnjX_223.js.gz +0 -0
  56. package/dist/web/assets/{Tooltip-DykA2YFi.js → Tooltip-DWpicVuG.js} +1 -1
  57. package/dist/web/assets/Tooltip-DWpicVuG.js.br +0 -0
  58. package/dist/web/assets/Tooltip-DWpicVuG.js.gz +0 -0
  59. package/dist/web/assets/index-Ce8bdxwG.js +45 -0
  60. package/dist/web/assets/index-Ce8bdxwG.js.br +0 -0
  61. package/dist/web/assets/index-Ce8bdxwG.js.gz +0 -0
  62. package/dist/web/assets/index-DwxhY3AB.css +1 -0
  63. package/dist/web/assets/index-DwxhY3AB.css.br +0 -0
  64. package/dist/web/assets/index-DwxhY3AB.css.gz +0 -0
  65. package/dist/web/assets/{index10-Dg_4gqi_.js → index10-9PQ1qCgE.js} +1 -1
  66. package/dist/web/assets/index10-9PQ1qCgE.js.br +0 -0
  67. package/dist/web/assets/index10-9PQ1qCgE.js.gz +0 -0
  68. package/dist/web/assets/index3-D4BmE5z2.js +1 -0
  69. package/dist/web/assets/index4-DqdY9eET.js +1 -0
  70. package/dist/web/assets/{index5-BylgZR6g.js → index5-EvVIUWBE.js} +1 -1
  71. package/dist/web/assets/index5-EvVIUWBE.js.br +0 -0
  72. package/dist/web/assets/index5-EvVIUWBE.js.gz +0 -0
  73. package/dist/web/assets/{index6-BEVCQ3WX.js → index6-Dp2tbhQ_.js} +1 -1
  74. package/dist/web/assets/index6-Dp2tbhQ_.js.br +0 -0
  75. package/dist/web/assets/index6-Dp2tbhQ_.js.gz +0 -0
  76. package/dist/web/assets/{index7-D-rT0wQb.js → index7-CFOwrJfH.js} +1 -1
  77. package/dist/web/assets/index7-CFOwrJfH.js.br +0 -0
  78. package/dist/web/assets/index7-CFOwrJfH.js.gz +0 -0
  79. package/dist/web/assets/{index8-m4nMNgie.js → index8-BvMAnsy9.js} +1 -1
  80. package/dist/web/assets/index8-BvMAnsy9.js.br +0 -0
  81. package/dist/web/assets/index8-BvMAnsy9.js.gz +0 -0
  82. package/dist/web/assets/{index9-DQf7xduQ.js → index9-Bj-VCtON.js} +1 -1
  83. package/dist/web/assets/index9-Bj-VCtON.js.br +0 -0
  84. package/dist/web/assets/index9-Bj-VCtON.js.gz +0 -0
  85. package/dist/web/index.html +2 -2
  86. package/dist/web/index.html.br +0 -0
  87. package/dist/web/index.html.gz +0 -0
  88. package/package.json +3 -3
  89. package/dist/web/assets/AddProjectDialog-Da5SYnbc.js +0 -1
  90. package/dist/web/assets/AddProjectDialog-Da5SYnbc.js.br +0 -0
  91. package/dist/web/assets/AddProjectDialog-Da5SYnbc.js.gz +0 -0
  92. package/dist/web/assets/ArchivedWorkspaces-B2vUSFVW.js.br +0 -0
  93. package/dist/web/assets/ArchivedWorkspaces-B2vUSFVW.js.gz +0 -0
  94. package/dist/web/assets/ChangesPanel-DBlpoPYb.js.br +0 -0
  95. package/dist/web/assets/ChangesPanel-DBlpoPYb.js.gz +0 -0
  96. package/dist/web/assets/CodeBlockNode-fBM-qTZY.js.br +0 -0
  97. package/dist/web/assets/CodeBlockNode-fBM-qTZY.js.gz +0 -0
  98. package/dist/web/assets/CommandCenter-CIwf7U03.js.br +0 -0
  99. package/dist/web/assets/CommandCenter-CIwf7U03.js.gz +0 -0
  100. package/dist/web/assets/ConversationSearch-Ckc45F45.js.br +0 -0
  101. package/dist/web/assets/ConversationSearch-Ckc45F45.js.gz +0 -0
  102. package/dist/web/assets/FileViewer-CWOWcrwG.css +0 -1
  103. package/dist/web/assets/FileViewer-CWOWcrwG.css.br +0 -0
  104. package/dist/web/assets/FileViewer-CWOWcrwG.css.gz +0 -0
  105. package/dist/web/assets/FileViewer-DtHpEbXq.js +0 -2
  106. package/dist/web/assets/FileViewer-DtHpEbXq.js.br +0 -0
  107. package/dist/web/assets/FileViewer-DtHpEbXq.js.gz +0 -0
  108. package/dist/web/assets/FilesPanel-DeG8VfEb.js +0 -1
  109. package/dist/web/assets/FilesPanel-DeG8VfEb.js.br +0 -0
  110. package/dist/web/assets/FilesPanel-DeG8VfEb.js.gz +0 -0
  111. package/dist/web/assets/HostSettings-DoNAVnxT.js +0 -5
  112. package/dist/web/assets/HostSettings-DoNAVnxT.js.br +0 -0
  113. package/dist/web/assets/HostSettings-DoNAVnxT.js.gz +0 -0
  114. package/dist/web/assets/KanbanPage-DwZbnEwI.js.br +0 -0
  115. package/dist/web/assets/KanbanPage-DwZbnEwI.js.gz +0 -0
  116. package/dist/web/assets/LabelsDialog-CIZwN5JQ.js.br +0 -0
  117. package/dist/web/assets/LabelsDialog-CIZwN5JQ.js.gz +0 -0
  118. package/dist/web/assets/MarkdownMessage-B5JuY96x.js.br +0 -0
  119. package/dist/web/assets/MarkdownMessage-B5JuY96x.js.gz +0 -0
  120. package/dist/web/assets/PreCodeBlock.vue_vue_type_style_index_0_lang-C8gxl3_t.js.br +0 -0
  121. package/dist/web/assets/PreCodeBlock.vue_vue_type_style_index_0_lang-C8gxl3_t.js.gz +0 -0
  122. package/dist/web/assets/SubagentsPanel-NjiTD7SL.js.br +0 -0
  123. package/dist/web/assets/SubagentsPanel-NjiTD7SL.js.gz +0 -0
  124. package/dist/web/assets/TerminalPanel-DJL_P7gn.js +0 -3
  125. package/dist/web/assets/TerminalPanel-DJL_P7gn.js.br +0 -0
  126. package/dist/web/assets/TerminalPanel-DJL_P7gn.js.gz +0 -0
  127. package/dist/web/assets/Tooltip-DykA2YFi.js.br +0 -0
  128. package/dist/web/assets/Tooltip-DykA2YFi.js.gz +0 -0
  129. package/dist/web/assets/index-DZm2Vxoh.js +0 -39
  130. package/dist/web/assets/index-DZm2Vxoh.js.br +0 -0
  131. package/dist/web/assets/index-DZm2Vxoh.js.gz +0 -0
  132. package/dist/web/assets/index-mcXZ0n9O.css +0 -1
  133. package/dist/web/assets/index-mcXZ0n9O.css.br +0 -0
  134. package/dist/web/assets/index-mcXZ0n9O.css.gz +0 -0
  135. package/dist/web/assets/index10-Dg_4gqi_.js.br +0 -0
  136. package/dist/web/assets/index10-Dg_4gqi_.js.gz +0 -0
  137. package/dist/web/assets/index3-DvC22Kiy.js +0 -1
  138. package/dist/web/assets/index4-BKXDDv9R.js +0 -1
  139. package/dist/web/assets/index5-BylgZR6g.js.br +0 -0
  140. package/dist/web/assets/index5-BylgZR6g.js.gz +0 -0
  141. package/dist/web/assets/index6-BEVCQ3WX.js.br +0 -0
  142. package/dist/web/assets/index6-BEVCQ3WX.js.gz +0 -0
  143. package/dist/web/assets/index7-D-rT0wQb.js.br +0 -0
  144. package/dist/web/assets/index7-D-rT0wQb.js.gz +0 -0
  145. package/dist/web/assets/index8-m4nMNgie.js.br +0 -0
  146. package/dist/web/assets/index8-m4nMNgie.js.gz +0 -0
  147. package/dist/web/assets/index9-DQf7xduQ.js.br +0 -0
  148. package/dist/web/assets/index9-DQf7xduQ.js.gz +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,36 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.14.0
4
+
5
+ - Upgrade `@getpaseo/client` and `@getpaseo/protocol` to `0.17.4`.
6
+ - **Sidebar multi-select batch archive & hover quick-archive**:
7
+ - `Shift+Click` any workspace row (or choose **Select…** from the thread menu) to enter multi-select mode with range selection, a sticky batch action bar, a single confirmation prompt, and a unified 6-second Undo toast (`Cmd/Ctrl+Z`).
8
+ - Added a hover quick-archive icon button on desktop workspace rows.
9
+ - **One-tap blockquote copy**:
10
+ - Top-level Markdown blockquotes in assistant replies now show a **Copy** control in the top-right corner that copies the quote body cleanly without `> ` markers.
11
+ - **Import CLI sessions**:
12
+ - Browse, search, and filter recent local CLI sessions (Claude Code, Codex, Pi, Antigravity, etc.) from the sidebar footer or Command Center and import them directly into LitePaseo, preserving partial results and provider warnings.
13
+ - **Command Center enhancements**:
14
+ - Added **Rewind latest turn** for active conversations whose provider supports rewind.
15
+ - Added host **Agent Profiles** (`Profile › <name>`) searchable by name, provider, model, or mode—applying directly to matching active agents or opening a pre-configured draft session for other providers—plus draft model/thinking shortcuts before the first message.
16
+ - **Worktrees from existing branches or GitHub PRs**:
17
+ - `NewSession` now supports creating worktrees from a **New branch**, **From branch** (with live host branch suggestions), **From PR** (`#123`), or an **Existing** worktree.
18
+ - **Built-in Plugin Gallery**:
19
+ - Browse, search, filter by category, inspect README details, and install plugins from the host's Paseo plugin registry directly inside Host Settings → Plugins.
20
+ - **Add Project dialog overhaul**:
21
+ - Unified into three tabs (**Existing**, **Clone**, **New folder**) with `Cmd/Ctrl+1/2/3` shortcuts, select-then-confirm rows, preserved tab drafts, and host-side folder creation.
22
+ - **Rich-text hyperlink paste & Issue/PR autolinking**:
23
+ - Pasting rich text containing hyperlinks into the composer preserves `[label](url)` Markdown links; `owner/repo#123` (and repo-scoped `#123`) references in replies and file previews link directly to their forge issues.
24
+
25
+ ## 0.13.5
26
+
27
+ - **Fix missing workspace unread indicator (green dot) & tighten auto-read**:
28
+ - Reconcile workspace effective state from active root agents in `Hosts` / `HostWorkspaces` (matching Paseo's `deriveEffectiveWorkspaceStatus` fallback) so a lagging or `"done"` `workspace_update` never hides an unread/running/failed/needs-input root agent, while same-workspace subagents only contribute while running.
29
+ - Gate automatic `/read` marking on actual foreground conversation viewing (`!document.hidden && document.hasFocus()`, `tab === "chat"`, detail open on compact layouts, and not viewing a file or terminal), trigger it when returning to the foreground, and reset the dedupe marker after unread clears or manual "Mark as unread".
30
+ - **Instant optimistic first prompt when starting a new session**:
31
+ - `NewSession.vue` now displays the submitted first prompt immediately at 0 ms as an optimistic user bubble with a `Starting session…` indicator while `POST /api/hosts/:host/agents` is in flight (restoring the draft and idempotency key cleanly on error).
32
+ - Hand off the submitted prompt to `OptimisticStore` on creation and render it through the `pendingSelection` gap until the live `ConversationView` mounts and reconciles with the daemon row.
33
+
3
34
  ## 0.13.4
4
35
 
5
36
  - **Close individual agent session tabs in a workspace**:
@@ -8,7 +8,7 @@ import { DatabaseSync } from "node:sqlite";
8
8
  import { homedir } from "node:os";
9
9
  import { fileURLToPath } from "node:url";
10
10
  // src/server/version.ts
11
- const VERSION = "0.13.4";
11
+ const VERSION = "0.14.0";
12
12
  // src/server/rotating-log.ts
13
13
  /** One writer (the supervisor); bounded active file plus numbered archives. */
14
14
  var RotatingLog = class {
@@ -1764,7 +1764,7 @@ async function run() {
1764
1764
  if (name === "--help" || name === "-h") return console.log(mainHelp(VERSION, displayDirectory(), out));
1765
1765
  if (name === "worker") {
1766
1766
  const paths = await dataDirectory();
1767
- const { runWorker } = await import("./worker-Dtl_KOz9.mjs");
1767
+ const { runWorker } = await import("./worker-DCp3pZYp.mjs");
1768
1768
  return runWorker(paths.directory, fileURLToPath(new URL("../web/", import.meta.url)));
1769
1769
  }
1770
1770
  const command = findCommand(name);
@@ -275,6 +275,25 @@ var HostMirror = class {
275
275
  onSnapshotProcessed(_payload, _full) {}
276
276
  onRawUpdate(_payload) {}
277
277
  onDisposed() {}
278
+ postSummarize(_raw, summary) {
279
+ return summary;
280
+ }
281
+ /** Re-runs summarization for a single retained member (e.g. when a derived fallback changes). */
282
+ refresh(id) {
283
+ const member = this.members.get(id);
284
+ if (!member) return;
285
+ const { summary: base, memo } = this.adapter.summarize(this.hostId, member.raw, member.extra, member.memo);
286
+ const summary = this.postSummarize(member.raw, base);
287
+ const fingerprint = JSON.stringify(summary);
288
+ member.memo = memo;
289
+ if (member.fingerprint === fingerprint) return;
290
+ const previous = member.summary;
291
+ member.fingerprint = fingerprint;
292
+ member.summary = summary;
293
+ this.collection.set(summary.key, summary);
294
+ this.changed();
295
+ this.transition(previous, summary);
296
+ }
278
297
  key(id) {
279
298
  return `${this.hostId}:${id}`;
280
299
  }
@@ -399,9 +418,11 @@ var HostMirror = class {
399
418
  const member = this.members.get(id);
400
419
  if (!force && member?.version !== void 0 && version !== void 0 && version < member.version) return;
401
420
  const kept = extra === void 0 ? member?.extra : extra;
402
- const { summary, memo } = this.adapter.summarize(this.hostId, raw, kept, member?.memo);
421
+ const { summary: base, memo } = this.adapter.summarize(this.hostId, raw, kept, member?.memo);
422
+ const summary = this.postSummarize(raw, base);
403
423
  const fingerprint = JSON.stringify(summary);
404
424
  const next = {
425
+ raw,
405
426
  fingerprint,
406
427
  version: version ?? member?.version,
407
428
  extra: kept,
@@ -652,14 +673,65 @@ const workspaceAdapter = {
652
673
  };
653
674
  }
654
675
  };
676
+ const AGENT_STATE_PRIORITY = {
677
+ needs_input: 0,
678
+ failed: 1,
679
+ running: 2,
680
+ unread: 3,
681
+ done: 4
682
+ };
683
+ /**
684
+ * Fallback workspace state derived from its active agents, matching Paseo's
685
+ * `buildWorkspaceAgentActivityIndex` + `deriveEffectiveWorkspaceStatus`: root agents contribute
686
+ * their full state bucket; same-workspace subagents contribute only while running.
687
+ */
688
+ function deriveWorkspaceAgentState(agents) {
689
+ const list = Array.isArray(agents) ? agents : [...agents];
690
+ if (!list.length) return null;
691
+ const byId = /* @__PURE__ */ new Map();
692
+ for (const agent of list) byId.set(agent.id, agent);
693
+ let best = null;
694
+ let bestPriority = AGENT_STATE_PRIORITY.done;
695
+ for (const agent of list) {
696
+ const isRoot = !agent.parentAgentId || !byId.has(agent.parentAgentId);
697
+ let candidate;
698
+ if (isRoot) candidate = agent.state === "done" && agent.unread ? "unread" : agent.state;
699
+ else if (agent.state === "running" || agent.turnActive) candidate = "running";
700
+ else continue;
701
+ const priority = AGENT_STATE_PRIORITY[candidate];
702
+ if (priority < bestPriority) {
703
+ best = candidate;
704
+ bestPriority = priority;
705
+ if (bestPriority === 0) break;
706
+ }
707
+ }
708
+ return best;
709
+ }
655
710
  /** One daemon's workspaces (Paseo's threads) and projects with zero active workspaces. */
656
711
  var HostWorkspaces = class extends HostMirror {
657
712
  emptyProjects;
713
+ fallbackState;
658
714
  activeByProject = /* @__PURE__ */ new Map();
659
715
  emptyMembers = /* @__PURE__ */ new Map();
660
- constructor(hostId, driver, collection, changed, emptyProjects) {
716
+ constructor(hostId, driver, collection, changed, emptyProjects, fallbackState) {
661
717
  super(workspaceAdapter, hostId, driver, collection, changed, (previous, next) => this.trackProject(previous, next));
662
718
  this.emptyProjects = emptyProjects;
719
+ this.fallbackState = fallbackState;
720
+ }
721
+ /** Re-evaluates one workspace's effective state when its agents change. */
722
+ reconcile(workspaceId) {
723
+ this.refresh(workspaceId);
724
+ }
725
+ postSummarize(ws, summary) {
726
+ if (summary.state !== "done" || !this.fallbackState) return summary;
727
+ const fallback = this.fallbackState(ws.id);
728
+ if (!fallback || fallback === "done") return summary;
729
+ return {
730
+ ...summary,
731
+ state: fallback,
732
+ attention: fallback === "needs_input",
733
+ unread: fallback === "unread" || fallback === "failed"
734
+ };
663
735
  }
664
736
  trackProject(previous, next) {
665
737
  if (previous && previous.projectId !== next?.projectId) {
@@ -1695,7 +1767,29 @@ var Hosts = class {
1695
1767
  /** Wires a connected-or-connecting driver; separate from `add` so tests can inject doubles. */
1696
1768
  attach(hostId, driver, api) {
1697
1769
  this.assertDetached(hostId);
1770
+ const agentsByWorkspace = /* @__PURE__ */ new Map();
1771
+ const workspaceAgentState = (workspaceId) => {
1772
+ const bucket = agentsByWorkspace.get(workspaceId);
1773
+ return bucket ? deriveWorkspaceAgentState(bucket.values()) : null;
1774
+ };
1775
+ const workspaces = new HostWorkspaces(hostId, driver, this.workspaces, () => this.emit(this.agentListeners), this.emptyProjects, workspaceAgentState);
1698
1776
  const directory = new HostDirectory(hostId, driver, this.agents, () => this.emit(this.agentListeners), (previous, next) => {
1777
+ const touchedWorkspaces = /* @__PURE__ */ new Set();
1778
+ if (previous?.workspaceId) {
1779
+ const bucket = agentsByWorkspace.get(previous.workspaceId);
1780
+ if (bucket) {
1781
+ bucket.delete(previous.id);
1782
+ if (!bucket.size) agentsByWorkspace.delete(previous.workspaceId);
1783
+ }
1784
+ touchedWorkspaces.add(previous.workspaceId);
1785
+ }
1786
+ if (next?.workspaceId) {
1787
+ let bucket = agentsByWorkspace.get(next.workspaceId);
1788
+ if (!bucket) agentsByWorkspace.set(next.workspaceId, bucket = /* @__PURE__ */ new Map());
1789
+ bucket.set(next.id, next);
1790
+ touchedWorkspaces.add(next.workspaceId);
1791
+ }
1792
+ for (const workspaceId of touchedWorkspaces) workspaces.reconcile(workspaceId);
1699
1793
  if (next) {
1700
1794
  const view = this.timelines.get(next.key)?.view;
1701
1795
  if (view) {
@@ -1706,7 +1800,6 @@ var Hosts = class {
1706
1800
  }
1707
1801
  notifyListeners(this.transitionListeners, previous, next);
1708
1802
  });
1709
- const workspaces = new HostWorkspaces(hostId, driver, this.workspaces, () => this.emit(this.agentListeners), this.emptyProjects);
1710
1803
  const update = (state) => {
1711
1804
  const previous = this.diagnostics.get(hostId) ?? {};
1712
1805
  if (state.status === "connected") {
@@ -3330,14 +3423,19 @@ function registerHostSettings(app, hosts) {
3330
3423
  });
3331
3424
  app.get("/api/hosts/:host/plugins", async (c) => {
3332
3425
  const plugins = await hosts.get(c.req.param("host")).driver.listPlugins();
3333
- return c.json(plugins.map(({ id, name, enabled, status, description, error }) => ({
3334
- id,
3335
- name,
3336
- enabled,
3337
- status,
3338
- description,
3339
- error
3340
- })));
3426
+ return c.json(plugins.map(({ id, name, enabled, status, description, error, installation }) => {
3427
+ const identity = installation?.identity;
3428
+ const registryId = identity && "registry" in identity ? identity.registry?.id : void 0;
3429
+ return {
3430
+ id,
3431
+ name,
3432
+ enabled,
3433
+ status,
3434
+ description,
3435
+ error,
3436
+ ...registryId ? { registryId } : {}
3437
+ };
3438
+ }));
3341
3439
  });
3342
3440
  app.post("/api/hosts/:host/plugins/:plugin/:action", async (c) => {
3343
3441
  const driver = hosts.get(c.req.param("host")).driver, id = c.req.param("plugin");
@@ -3361,6 +3459,62 @@ function registerHostSettings(app, hosts) {
3361
3459
  await driver.installPluginSource(input);
3362
3460
  return c.json({ ok: true });
3363
3461
  });
3462
+ app.get("/api/hosts/:host/plugin-registry", async (c) => {
3463
+ const driver = hosts.get(c.req.param("host")).driver;
3464
+ if (!driver.getLastServerInfoMessage()?.features?.pluginRegistry || typeof driver.listPluginRegistry !== "function") return c.json({ error: "Plugin gallery is unavailable on this host" }, 409);
3465
+ try {
3466
+ const idx = await driver.listPluginRegistry();
3467
+ return c.json({
3468
+ registryName: idx.registry.name,
3469
+ registryUrl: idx.registry.url,
3470
+ categories: idx.categories ?? [],
3471
+ featured: idx.featured ?? [],
3472
+ plugins: (idx.plugins ?? []).map((p) => ({
3473
+ id: p.id,
3474
+ name: p.name,
3475
+ description: p.description,
3476
+ categories: p.categories ?? [],
3477
+ author: {
3478
+ github: p.author.github,
3479
+ ...p.author.name ? { name: p.author.name } : {}
3480
+ },
3481
+ repositoryUrl: p.repository.url,
3482
+ ...p.license ? { license: p.license } : {},
3483
+ ...typeof p.installs === "number" ? { installs: p.installs } : {},
3484
+ updatedAt: p.updatedAt,
3485
+ ...p.artifact?.version ? { version: p.artifact.version } : {}
3486
+ }))
3487
+ });
3488
+ } catch (error) {
3489
+ return c.json({ error: error instanceof Error ? error.message : "Could not load plugin gallery" }, 502);
3490
+ }
3491
+ });
3492
+ app.get("/api/hosts/:host/plugin-registry/:owner/:name", async (c) => {
3493
+ const driver = hosts.get(c.req.param("host")).driver;
3494
+ if (!driver.getLastServerInfoMessage()?.features?.pluginRegistry || typeof driver.getRegistryPlugin !== "function") return c.json({ error: "Plugin gallery is unavailable on this host" }, 409);
3495
+ const id = `${c.req.param("owner")}/${c.req.param("name")}`;
3496
+ try {
3497
+ const p = await driver.getRegistryPlugin(id);
3498
+ return c.json({
3499
+ id: p.id,
3500
+ name: p.name,
3501
+ description: p.description,
3502
+ categories: p.categories ?? [],
3503
+ author: {
3504
+ github: p.author.github,
3505
+ ...p.author.name ? { name: p.author.name } : {}
3506
+ },
3507
+ repositoryUrl: p.repository.url,
3508
+ ...p.license ? { license: p.license } : {},
3509
+ ...typeof p.installs === "number" ? { installs: p.installs } : {},
3510
+ updatedAt: p.updatedAt,
3511
+ ...p.artifact?.version ? { version: p.artifact.version } : {},
3512
+ readme: p.readme ?? ""
3513
+ });
3514
+ } catch (error) {
3515
+ return c.json({ error: error instanceof Error ? error.message : "Could not load plugin details" }, 502);
3516
+ }
3517
+ });
3364
3518
  app.get("/api/hosts/:host/status", async (c) => c.json(await hosts.get(c.req.param("host")).driver.getDaemonStatus()));
3365
3519
  app.get("/api/hosts/:host/lifecycle", (c) => c.json(jobs.get(c.req.param("host")) ?? null));
3366
3520
  app.post("/api/hosts/:host/lifecycle/:action", async (c) => {
@@ -4897,6 +5051,21 @@ function registerAgentRoutes(app, { hosts }) {
4897
5051
  featureValues: z.record(z.string(), z.unknown()).optional(),
4898
5052
  prompt: z.string().max(1e5).optional(),
4899
5053
  worktreeBranch: z.string().trim().min(1).max(200).optional(),
5054
+ worktree: z.discriminatedUnion("mode", [
5055
+ z.object({
5056
+ mode: z.literal("branch-off"),
5057
+ newBranch: z.string().trim().min(1).max(200),
5058
+ base: z.string().trim().min(1).max(200).optional()
5059
+ }),
5060
+ z.object({
5061
+ mode: z.literal("checkout-branch"),
5062
+ branch: z.string().trim().min(1).max(200)
5063
+ }),
5064
+ z.object({
5065
+ mode: z.literal("checkout-pr"),
5066
+ prNumber: z.number().int().positive()
5067
+ })
5068
+ ]).optional(),
4900
5069
  workspaceId: z.string().trim().min(1).max(200).optional(),
4901
5070
  attachments: z.array(z.object({
4902
5071
  id: z.string().max(200).optional(),
@@ -4915,6 +5084,10 @@ function registerAgentRoutes(app, { hosts }) {
4915
5084
  model = models.find((m) => m.isDefault)?.id ?? models[0]?.id;
4916
5085
  if (!model) return c.json({ error: "No selectable model is available for this provider. Refresh providers and select a model." }, 400);
4917
5086
  }
5087
+ const worktree = input.worktree ?? (input.worktreeBranch ? {
5088
+ mode: "branch-off",
5089
+ newBranch: input.worktreeBranch
5090
+ } : void 0);
4918
5091
  const agent = input.workspaceId ? await driver.createAgent({
4919
5092
  idempotencyKey: input.idempotencyKey,
4920
5093
  workspaceId: input.workspaceId,
@@ -4937,10 +5110,7 @@ function registerAgentRoutes(app, { hosts }) {
4937
5110
  },
4938
5111
  ...input.prompt?.trim() ? { prompt: input.prompt } : {},
4939
5112
  ...input.attachments?.length ? { attachments: input.attachments } : {},
4940
- ...input.worktreeBranch ? { worktree: {
4941
- mode: "branch-off",
4942
- newBranch: input.worktreeBranch
4943
- } } : {}
5113
+ ...worktree ? { worktree } : {}
4944
5114
  });
4945
5115
  return c.json({
4946
5116
  id: agent.id,
@@ -5023,6 +5193,77 @@ function registerAgentRoutes(app, { hosts }) {
5023
5193
  return c.json({ error: errorMessage(error, "Could not list worktrees") }, 502);
5024
5194
  }
5025
5195
  });
5196
+ app.get("/api/hosts/:host/branches", async (c) => {
5197
+ const cwd = hostPath.parse(c.req.query("cwd"));
5198
+ const { driver } = hosts.get(c.req.param("host"));
5199
+ if (typeof driver.getBranchSuggestions !== "function") return c.json({ branches: [] });
5200
+ try {
5201
+ const res = await driver.getBranchSuggestions({ cwd });
5202
+ if (res.error) return c.json({ error: res.error }, 400);
5203
+ return c.json({ branches: res.branches ?? [] });
5204
+ } catch (error) {
5205
+ return c.json({ error: errorMessage(error, "Could not list branches") }, 502);
5206
+ }
5207
+ });
5208
+ app.get("/api/hosts/:host/importable-sessions", async (c) => {
5209
+ const { driver } = hosts.get(c.req.param("host"));
5210
+ if (typeof driver.fetchRecentProviderSessions !== "function") return c.json({ error: "This host does not support importing CLI sessions." }, 409);
5211
+ const cwd = c.req.query("cwd")?.trim() ? hostPath.parse(c.req.query("cwd")) : void 0;
5212
+ const provider = z.string().trim().min(1).max(100).optional().parse(c.req.query("provider") || void 0);
5213
+ const query = z.string().trim().max(200).optional().parse(c.req.query("q") || void 0);
5214
+ const rawLimit = Number(c.req.query("limit"));
5215
+ const limit = Number.isFinite(rawLimit) && rawLimit > 0 ? Math.min(200, Math.trunc(rawLimit)) : 50;
5216
+ try {
5217
+ const res = await driver.fetchRecentProviderSessions({
5218
+ ...cwd ? { cwd } : {},
5219
+ ...provider ? { providers: [provider] } : {},
5220
+ ...query ? { query } : {},
5221
+ limit
5222
+ });
5223
+ const out = {
5224
+ entries: (res.entries ?? []).map((e) => ({
5225
+ providerId: e.providerId,
5226
+ providerLabel: e.providerLabel,
5227
+ providerHandleId: e.providerHandleId,
5228
+ cwd: e.cwd,
5229
+ title: e.title ?? null,
5230
+ firstPromptPreview: e.firstPromptPreview ?? null,
5231
+ lastPromptPreview: e.lastPromptPreview ?? null,
5232
+ lastActivityAt: e.lastActivityAt
5233
+ })),
5234
+ ...typeof res.filteredAlreadyImportedCount === "number" ? { filteredAlreadyImportedCount: res.filteredAlreadyImportedCount } : {},
5235
+ ...res.providerErrors?.length ? { providerErrors: res.providerErrors } : {}
5236
+ };
5237
+ return c.json(out);
5238
+ } catch (error) {
5239
+ return c.json({ error: errorMessage(error, "Could not load CLI sessions") }, 502);
5240
+ }
5241
+ });
5242
+ app.post("/api/hosts/:host/import-session", async (c) => {
5243
+ const input = z.object({
5244
+ providerId: z.string().trim().min(1).max(200),
5245
+ providerHandleId: z.string().trim().min(1).max(500),
5246
+ cwd: hostPath.optional(),
5247
+ workspaceId: z.string().trim().min(1).max(200).optional()
5248
+ }).parse(await c.req.json());
5249
+ const hostId = c.req.param("host");
5250
+ const { driver } = hosts.get(hostId);
5251
+ if (typeof driver.importAgent !== "function") return c.json({ error: "This host does not support importing CLI sessions." }, 409);
5252
+ try {
5253
+ const agent = await driver.importAgent({
5254
+ providerId: input.providerId,
5255
+ providerHandleId: input.providerHandleId,
5256
+ ...input.cwd ? { cwd: input.cwd } : {},
5257
+ ...input.workspaceId ? { workspaceId: input.workspaceId } : {}
5258
+ });
5259
+ return c.json({
5260
+ id: agent.id,
5261
+ key: `${hostId}:${agent.id}`
5262
+ }, 201);
5263
+ } catch (error) {
5264
+ return c.json({ error: errorMessage(error, "Could not import session") }, 502);
5265
+ }
5266
+ });
5026
5267
  /** What the open agent can switch to. Modes/features come from the live directory (no round trip). */
5027
5268
  app.get("/api/hosts/:host/agents/:agent/config", async (c) => {
5028
5269
  const client = hosts.get(c.req.param("host"));
@@ -6100,6 +6341,28 @@ function registerProjectRoutes(app, { hosts, fetch }) {
6100
6341
  return c.json({ error: errorMessage(error, "Could not add project.") }, 502);
6101
6342
  }
6102
6343
  });
6344
+ app.post("/api/hosts/:host/projects/create-directory", async (c) => {
6345
+ const input = z.object({
6346
+ parentPath: hostPath,
6347
+ name: z.string().trim().min(1).max(200).refine((v) => !v.includes("/") && !v.includes("\\") && v !== "." && v !== "..", "Invalid folder name")
6348
+ }).parse(await c.req.json());
6349
+ const { driver } = hosts.get(c.req.param("host"));
6350
+ if (typeof driver.createProjectDirectory !== "function") return c.json({ error: "This host does not support creating project folders." }, 409);
6351
+ try {
6352
+ const res = await driver.createProjectDirectory(input);
6353
+ if (res.error) return c.json({
6354
+ error: res.error,
6355
+ code: res.errorCode ?? null
6356
+ }, 400);
6357
+ return c.json({
6358
+ ok: true,
6359
+ path: res.directoryPath,
6360
+ project: res.project ?? null
6361
+ });
6362
+ } catch (error) {
6363
+ return c.json({ error: errorMessage(error, "Could not create project folder.") }, 502);
6364
+ }
6365
+ });
6103
6366
  app.get("/api/hosts/:host/github/search", async (c) => {
6104
6367
  const query = z.string().trim().min(1).max(200).parse(c.req.query("q") ?? "");
6105
6368
  const { driver } = hosts.get(c.req.param("host"));
@@ -0,0 +1 @@
1
+ import{C as e,H as t,I as ee,M as n,Q as r,S as i,T as a,Y as o,c as s,ct as c,d as l,dt as u,f as d,g as f,h as p,it as m,s as te,st as h,v as g,y as _,z as v}from"./vue.runtime.esm-bundler-DmQNwI70.js";import{_ as y,v as ne,y as b}from"./index-Ce8bdxwG.js";var re={class:`sheet-head`},ie={class:`add-project-body`},ae={key:0,class:`field`},oe=[`value`],se={class:`segmented segmented-sm`,role:`tablist`},ce=[`aria-selected`],le=[`aria-selected`],ue=[`aria-selected`],de={key:1,class:`setting-note is-error`,role:`alert`},fe={class:`field`},pe=[`disabled`],me={key:0,class:`add-project-suggestions`},he={key:0,class:`subtle`},ge=[`disabled`,`onClick`,`onDblclick`],_e={class:`grow`},ve={class:`row-title`},ye={class:`row-sub mono`},be={class:`row-sub`},xe={class:`form-actions`},Se=[`disabled`],Ce=[`disabled`],we={key:0,class:`add-project-suggestions`},Te=[`onClick`],Ee={class:`grow`},De={class:`row-title`},Oe={key:0,class:`hs-tag`},ke={key:0,class:`row-sub`},Ae={class:`field`},x=[`disabled`],S={class:`field`},C=[`disabled`],je={class:`segmented segmented-sm`},Me={class:`form-actions`},Ne=[`disabled`],Pe={class:`field`},Fe=[`disabled`],w={class:`field`},Ie=[`disabled`],Le={key:0,class:`row-sub mono`},Re={class:`form-actions`},ze=[`disabled`],T=a({__name:`AddProjectDialog`,props:{hosts:{},initialHostId:{},api:{type:Function}},emits:[`close`,`added`],setup(a,{emit:T}){let E=a,D=T,O=m(null),k=m(null),A=m(null),j=m(null);ne(O,()=>D(`close`));let M=p(()=>E.hosts.filter(e=>e.state===`connected`)),N=m(M.value.find(e=>e.id===E.initialHostId)?.id??M.value[0]?.id??``),P=m(`existing`),F=m(!1),I=m(``),L=m(``),R=m([]),z=m(!1),B=p(()=>{let e=L.value.trim().toLowerCase();return e?R.value.filter(t=>t.path.toLowerCase().includes(e)||(t.name?.toLowerCase().includes(e)??!1)).slice(0,12):R.value.slice(0,12)}),V=m(``),H=m([]),U=m(!1),W=m(``),G=m(``),K=m(!1),q=m(`ssh`),J=m(``),Y=m(!1),X=m(``),Z=p(()=>{let e=R.value[0]?.path;if(!e)return``;let t=e.lastIndexOf(`/`);return t>0?e.slice(0,t):``});async function Q(){if(N.value){z.value=!0;try{let e=await E.api(`/hosts/${encodeURIComponent(N.value)}/project-suggestions`);if(R.value=(e.suggestions??[]).map(e=>({path:e.path??e.rootPath??e.cwd??``,name:e.name??e.displayName})).filter(e=>!!e.path),Y.value||(J.value=Z.value),!K.value&&W.value&&Z.value){let e=W.value.split(`/`).pop()||W.value;G.value=`${Z.value.replace(/\/+$/,``)}/${e}`}}catch{R.value=[]}finally{z.value=!1}}}o(N,()=>{R.value=[],Y.value||(J.value=``),K.value||(G.value=``),Q()},{immediate:!0}),o(P,e=>{I.value=``,n(()=>{e===`existing`?k.value?.focus():e===`clone`?A.value?.focus():j.value?.focus()})});function Be(e){!(e.metaKey||e.ctrlKey)||e.altKey||e.shiftKey||(e.key===`1`?(e.preventDefault(),P.value=`existing`):e.key===`2`?(e.preventDefault(),P.value=`clone`):e.key===`3`&&(e.preventDefault(),P.value=`new`))}async function $(e){let t=(e??L.value).trim();if(N.value&&t){F.value=!0,I.value=``;try{await E.api(`/hosts/${encodeURIComponent(N.value)}/projects`,`POST`,{cwd:t}),D(`added`,N.value,t),D(`close`)}catch(e){I.value=e.message||`Could not add project.`}finally{F.value=!1}}}async function Ve(){if(N.value&&V.value.trim()){U.value=!0,I.value=``;try{let e=await E.api(`/hosts/${encodeURIComponent(N.value)}/github/search?q=${encodeURIComponent(V.value.trim())}`);H.value=(e.repositories??[]).map(e=>({fullName:e.fullName??e.nameWithOwner??e.repo??``,description:e.description??null,isPrivate:e.isPrivate===!0||e.private===!0})).filter(e=>!!e.fullName)}catch(e){I.value=e.message||`Could not search GitHub.`}finally{U.value=!1}}}function He(e){if(W.value=e,!K.value&&Z.value){let t=e.split(`/`).pop()||e;G.value=`${Z.value.replace(/\/+$/,``)}/${t}`}}async function Ue(){if(N.value&&W.value.trim()&&G.value.trim()){F.value=!0,I.value=``;try{let e=await E.api(`/hosts/${encodeURIComponent(N.value)}/projects/clone`,`POST`,{repo:W.value.trim(),targetDirectory:G.value.trim(),cloneProtocol:q.value},12e4);D(`added`,N.value,e.path||G.value.trim()),D(`close`)}catch(e){I.value=e.message||`Could not clone repository.`}finally{F.value=!1}}}async function We(){if(N.value&&J.value.trim()&&X.value.trim()){F.value=!0,I.value=``;try{let e=await E.api(`/hosts/${encodeURIComponent(N.value)}/projects/create-directory`,`POST`,{parentPath:J.value.trim(),name:X.value.trim()});D(`added`,N.value,e.path||`${J.value.trim().replace(/\/+$/,``)}/${X.value.trim()}`),D(`close`)}catch(e){I.value=e.message||`Could not create project folder.`}finally{F.value=!1}}}return ee(()=>{Q(),n(()=>k.value?.focus())}),(ee,n)=>(v(),_(`div`,{class:`overlay`,onMousedown:n[19]||=l(e=>D(`close`),[`self`])},[f(`section`,{ref_key:`sheet`,ref:O,class:`sheet add-project-sheet`,role:`dialog`,"aria-modal":`true`,"aria-label":`Add project`,tabindex:`-1`,onKeydown:Be},[f(`header`,re,[n[20]||=f(`h2`,null,`Add project`,-1),f(`button`,{type:`button`,class:`icon-btn`,"aria-label":`Close`,onClick:n[0]||=e=>D(`close`)},[e(b,{name:`close`,size:16})])]),f(`div`,ie,[M.value.length>1?(v(),_(`label`,ae,[n[21]||=f(`span`,null,`Host`,-1),r(f(`select`,{"onUpdate:modelValue":n[1]||=e=>N.value=e},[(v(!0),_(d,null,t(M.value,e=>(v(),_(`option`,{key:e.id,value:e.id},u(e.label),9,oe))),128))],512),[[te,N.value]])])):g(``,!0),f(`div`,se,[f(`button`,{type:`button`,role:`tab`,"aria-selected":P.value===`existing`,class:c({chosen:P.value===`existing`}),onClick:n[2]||=e=>P.value=`existing`},`Existing`,10,ce),f(`button`,{type:`button`,role:`tab`,"aria-selected":P.value===`clone`,class:c({chosen:P.value===`clone`}),onClick:n[3]||=e=>P.value=`clone`},`Clone`,10,le),f(`button`,{type:`button`,role:`tab`,"aria-selected":P.value===`new`,class:c({chosen:P.value===`new`}),onClick:n[4]||=e=>P.value=`new`},`New folder`,10,ue)]),I.value?(v(),_(`p`,de,u(I.value),1)):g(``,!0),P.value===`existing`?(v(),_(`form`,{key:2,class:`add-project-form`,onSubmit:n[7]||=l(e=>$(),[`prevent`])},[f(`label`,fe,[n[22]||=f(`span`,null,`Directory path or filter recent folders`,-1),r(f(`input`,{ref_key:`existingInput`,ref:k,"onUpdate:modelValue":n[5]||=e=>L.value=e,placeholder:`/home/user/code/my-repo`,disabled:F.value},null,8,pe),[[s,L.value]])]),B.value.length||z.value?(v(),_(`div`,me,[n[24]||=f(`span`,{class:`subtle`},`Recent folders on this host · click to select, then confirm`,-1),z.value&&!R.value.length?(v(),_(`p`,he,[...n[23]||=[f(`span`,{class:`spinner spinner-sm`},null,-1),i(` Loading…`,-1)]])):g(``,!0),(v(!0),_(d,null,t(B.value,t=>(v(),_(`button`,{key:t.path,type:`button`,class:c([`suggestion-row`,{chosen:L.value.trim()===t.path}]),disabled:F.value,onClick:e=>L.value=t.path,onDblclick:e=>$(t.path)},[e(b,{name:`folder`,size:14}),f(`span`,_e,[f(`span`,ve,u(t.name||t.path.split(`/`).pop()),1),f(`span`,ye,u(h(y)(t.path)),1)]),f(`span`,be,u(L.value.trim()===t.path?`Selected`:`Select`),1)],42,ge))),128))])):g(``,!0),f(`div`,xe,[f(`button`,{type:`button`,class:`btn btn-ghost`,onClick:n[6]||=e=>D(`close`)},`Cancel`),f(`button`,{type:`submit`,class:`btn btn-primary`,disabled:F.value||!L.value.trim()},u(F.value?`Adding…`:`Add project`),9,Se)])],32)):P.value===`clone`?(v(),_(d,{key:3},[f(`form`,{class:`archived-search`,onSubmit:l(Ve,[`prevent`])},[r(f(`input`,{ref_key:`cloneInput`,ref:A,"onUpdate:modelValue":n[8]||=e=>V.value=e,placeholder:`Search GitHub repos (owner/name or keyword)…`},null,512),[[s,V.value]]),f(`button`,{type:`submit`,class:`btn btn-sm btn-outline`,disabled:U.value||!V.value.trim()},u(U.value?`Searching…`:`Search`),9,Ce)],32),H.value.length?(v(),_(`div`,we,[(v(!0),_(d,null,t(H.value,t=>(v(),_(`button`,{key:t.fullName,type:`button`,class:c([`suggestion-row`,{chosen:W.value===t.fullName}]),onClick:e=>He(t.fullName)},[e(b,{name:`branch`,size:14}),f(`span`,Ee,[f(`span`,De,[i(u(t.fullName)+` `,1),t.isPrivate?(v(),_(`small`,Oe,`private`)):g(``,!0)]),t.description?(v(),_(`span`,ke,u(t.description),1)):g(``,!0)])],10,Te))),128))])):g(``,!0),f(`form`,{class:`add-project-form`,onSubmit:l(Ue,[`prevent`])},[f(`label`,Ae,[n[25]||=f(`span`,null,`Repository (owner/repo)`,-1),r(f(`input`,{"onUpdate:modelValue":n[9]||=e=>W.value=e,placeholder:`owner/repo`,disabled:F.value},null,8,x),[[s,W.value]])]),f(`label`,S,[n[26]||=f(`span`,null,`Target directory on host`,-1),r(f(`input`,{"onUpdate:modelValue":n[10]||=e=>G.value=e,placeholder:`/home/user/code/repo`,disabled:F.value,onInput:n[11]||=e=>K.value=!0},null,40,C),[[s,G.value]])]),f(`div`,je,[f(`button`,{type:`button`,class:c({chosen:q.value===`ssh`}),onClick:n[12]||=e=>q.value=`ssh`},`SSH`,2),f(`button`,{type:`button`,class:c({chosen:q.value===`https`}),onClick:n[13]||=e=>q.value=`https`},`HTTPS`,2)]),f(`div`,Me,[f(`button`,{type:`button`,class:`btn btn-ghost`,onClick:n[14]||=e=>D(`close`)},`Cancel`),f(`button`,{type:`submit`,class:`btn btn-primary`,disabled:F.value||!W.value.trim()||!G.value.trim()},u(F.value?`Cloning…`:`Clone & add`),9,Ne)])],32)],64)):(v(),_(`form`,{key:4,class:`add-project-form`,onSubmit:l(We,[`prevent`])},[f(`label`,Pe,[n[27]||=f(`span`,null,`Parent directory on host`,-1),r(f(`input`,{"onUpdate:modelValue":n[15]||=e=>J.value=e,placeholder:`/home/user/code`,disabled:F.value,onInput:n[16]||=e=>Y.value=!0},null,40,Fe),[[s,J.value]])]),f(`label`,w,[n[28]||=f(`span`,null,`New folder name`,-1),r(f(`input`,{ref_key:`newFolderInput`,ref:j,"onUpdate:modelValue":n[17]||=e=>X.value=e,placeholder:`my-new-project`,disabled:F.value},null,8,Ie),[[s,X.value]])]),J.value.trim()&&X.value.trim()?(v(),_(`p`,Le,` Will create: `+u(h(y)(J.value.trim().replace(/\/+$/,``)+`/`+X.value.trim())),1)):g(``,!0),f(`div`,Re,[f(`button`,{type:`button`,class:`btn btn-ghost`,onClick:n[18]||=e=>D(`close`)},`Cancel`),f(`button`,{type:`submit`,class:`btn btn-primary`,disabled:F.value||!J.value.trim()||!X.value.trim()},u(F.value?`Creating…`:`Create & add`),9,ze)])],32))])],544)],32))}});export{T as default};
@@ -1 +1 @@
1
- import{C as e,H as t,I as n,Q as r,S as i,T as a,c as o,d as s,dt as c,f as l,g as u,h as d,it as f,v as p,y as m,z as h}from"./vue.runtime.esm-bundler-DmQNwI70.js";import{_ as g,g as _,t as v}from"./index-DZm2Vxoh.js";var y={class:`sheet-head`},b={class:`archived-search`},x=[`disabled`],S={key:0,class:`setting-note is-error`,role:`alert`},C={class:`archived-list`},w={key:0,class:`subtle archived-empty`},T={key:1,class:`subtle archived-empty`},E={class:`grow`},D={class:`row-title`},O={class:`row-sub`},k=[`disabled`,`onClick`],A=a({__name:`ArchivedWorkspaces`,props:{hosts:{},api:{type:Function}},emits:[`close`,`restored`],setup(a,{emit:A}){let j=a,M=A,N=f(null);_(N,()=>M(`close`));let P=f(``),F=f([]),I=f(!1),L=f(``),R=f(null),z=d(()=>new Map(j.hosts.map(e=>[e.id,e.label])));async function B(){I.value=!0,L.value=``;let e=j.hosts.filter(e=>e.state===`connected`);try{let t=await Promise.allSettled(e.map(e=>{let t=P.value.trim()?`?q=${encodeURIComponent(P.value.trim())}`:``;return j.api(`/hosts/${encodeURIComponent(e.id)}/archived-workspaces${t}`)})),n=[];for(let e of t)e.status===`fulfilled`&&Array.isArray(e.value)&&n.push(...e.value);n.sort((e,t)=>Date.parse(t.archivedAt)-Date.parse(e.archivedAt)),F.value=n}catch(e){L.value=e.message||`Could not load archived workspaces.`}finally{I.value=!1}}async function V(e){if(!e.workspaceId)return;let t=`${e.hostId}:${e.workspaceId}`;R.value=t,L.value=``;try{await j.api(`/hosts/${encodeURIComponent(e.hostId)}/workspaces/${encodeURIComponent(e.workspaceId)}/restore`,`POST`,{}),F.value=F.value.filter(t=>t.hostId!==e.hostId||t.workspaceId!==e.workspaceId),M(`restored`,e.hostId,e.workspaceId)}catch(e){L.value=e.message||`Could not restore workspace.`}finally{R.value=null}}function H(e){let t=Math.max(0,(Date.now()-Date.parse(e))/1e3);return t<90?`just now`:t<3600?Math.round(t/60)+`m ago`:t<86400?Math.round(t/3600)+`h ago`:Math.round(t/86400)+`d ago`}return n(()=>void B()),(n,d)=>(h(),m(`div`,{class:`overlay`,onMousedown:d[2]||=s(e=>M(`close`),[`self`])},[u(`section`,{ref_key:`sheet`,ref:N,class:`sheet archived-sheet`,role:`dialog`,"aria-modal":`true`,"aria-label":`Archived workspaces`,tabindex:`-1`},[u(`header`,y,[d[3]||=u(`h2`,null,`Archived workspaces`,-1),u(`button`,{type:`button`,class:`icon-btn`,"aria-label":`Close`,onClick:d[0]||=e=>M(`close`)},[e(g,{name:`close`,size:16})])]),u(`div`,b,[u(`form`,{onSubmit:s(B,[`prevent`])},[r(u(`input`,{"onUpdate:modelValue":d[1]||=e=>P.value=e,type:`search`,placeholder:`Search archived workspaces…`,"aria-label":`Search archived workspaces`},null,512),[[o,P.value]]),u(`button`,{type:`submit`,class:`btn btn-sm btn-outline`,disabled:I.value},c(I.value?`Loading…`:`Search`),9,x)],32)]),L.value?(h(),m(`p`,S,c(L.value),1)):p(``,!0),u(`div`,C,[I.value&&!F.value.length?(h(),m(`p`,w,[...d[4]||=[u(`span`,{class:`spinner spinner-sm`},null,-1),i(` Loading archived workspaces…`,-1)]])):F.value.length?p(``,!0):(h(),m(`p`,T,`No archived workspaces found.`)),(h(!0),m(l,null,t(F.value,t=>(h(),m(`div`,{key:t.hostId+`:`+(t.workspaceId||t.id),class:`archived-row`},[e(v,{provider:t.provider},null,8,[`provider`]),u(`div`,E,[u(`div`,D,c(t.name),1),u(`div`,O,[i(c(t.project)+` `,1),a.hosts.length>1?(h(),m(l,{key:0},[i(` · `+c(z.value.get(t.hostId)||t.hostId),1)],64)):p(``,!0),i(` · archived `+c(H(t.archivedAt)),1)])]),t.workspaceId?(h(),m(`button`,{key:0,type:`button`,class:`btn btn-sm btn-outline`,disabled:R.value===t.hostId+`:`+t.workspaceId,onClick:e=>V(t)},[e(g,{name:`undo`,size:13}),i(c(R.value===t.hostId+`:`+t.workspaceId?`Restoring…`:`Restore`),1)],8,k)):p(``,!0)]))),128))])],512)],32))}});export{A as default};
1
+ import{C as e,H as t,I as n,Q as r,S as i,T as a,c as o,d as s,dt as c,f as l,g as u,h as d,it as f,v as p,y as m,z as h}from"./vue.runtime.esm-bundler-DmQNwI70.js";import{t as g,v as _,y as v}from"./index-Ce8bdxwG.js";var y={class:`sheet-head`},b={class:`archived-search`},x=[`disabled`],S={key:0,class:`setting-note is-error`,role:`alert`},C={class:`archived-list`},w={key:0,class:`subtle archived-empty`},T={key:1,class:`subtle archived-empty`},E={class:`grow`},D={class:`row-title`},O={class:`row-sub`},k=[`disabled`,`onClick`],A=a({__name:`ArchivedWorkspaces`,props:{hosts:{},api:{type:Function}},emits:[`close`,`restored`],setup(a,{emit:A}){let j=a,M=A,N=f(null);_(N,()=>M(`close`));let P=f(``),F=f([]),I=f(!1),L=f(``),R=f(null),z=d(()=>new Map(j.hosts.map(e=>[e.id,e.label])));async function B(){I.value=!0,L.value=``;let e=j.hosts.filter(e=>e.state===`connected`);try{let t=await Promise.allSettled(e.map(e=>{let t=P.value.trim()?`?q=${encodeURIComponent(P.value.trim())}`:``;return j.api(`/hosts/${encodeURIComponent(e.id)}/archived-workspaces${t}`)})),n=[];for(let e of t)e.status===`fulfilled`&&Array.isArray(e.value)&&n.push(...e.value);n.sort((e,t)=>Date.parse(t.archivedAt)-Date.parse(e.archivedAt)),F.value=n}catch(e){L.value=e.message||`Could not load archived workspaces.`}finally{I.value=!1}}async function V(e){if(!e.workspaceId)return;let t=`${e.hostId}:${e.workspaceId}`;R.value=t,L.value=``;try{await j.api(`/hosts/${encodeURIComponent(e.hostId)}/workspaces/${encodeURIComponent(e.workspaceId)}/restore`,`POST`,{}),F.value=F.value.filter(t=>t.hostId!==e.hostId||t.workspaceId!==e.workspaceId),M(`restored`,e.hostId,e.workspaceId)}catch(e){L.value=e.message||`Could not restore workspace.`}finally{R.value=null}}function H(e){let t=Math.max(0,(Date.now()-Date.parse(e))/1e3);return t<90?`just now`:t<3600?Math.round(t/60)+`m ago`:t<86400?Math.round(t/3600)+`h ago`:Math.round(t/86400)+`d ago`}return n(()=>void B()),(n,d)=>(h(),m(`div`,{class:`overlay`,onMousedown:d[2]||=s(e=>M(`close`),[`self`])},[u(`section`,{ref_key:`sheet`,ref:N,class:`sheet archived-sheet`,role:`dialog`,"aria-modal":`true`,"aria-label":`Archived workspaces`,tabindex:`-1`},[u(`header`,y,[d[3]||=u(`h2`,null,`Archived workspaces`,-1),u(`button`,{type:`button`,class:`icon-btn`,"aria-label":`Close`,onClick:d[0]||=e=>M(`close`)},[e(v,{name:`close`,size:16})])]),u(`div`,b,[u(`form`,{onSubmit:s(B,[`prevent`])},[r(u(`input`,{"onUpdate:modelValue":d[1]||=e=>P.value=e,type:`search`,placeholder:`Search archived workspaces…`,"aria-label":`Search archived workspaces`},null,512),[[o,P.value]]),u(`button`,{type:`submit`,class:`btn btn-sm btn-outline`,disabled:I.value},c(I.value?`Loading…`:`Search`),9,x)],32)]),L.value?(h(),m(`p`,S,c(L.value),1)):p(``,!0),u(`div`,C,[I.value&&!F.value.length?(h(),m(`p`,w,[...d[4]||=[u(`span`,{class:`spinner spinner-sm`},null,-1),i(` Loading archived workspaces…`,-1)]])):F.value.length?p(``,!0):(h(),m(`p`,T,`No archived workspaces found.`)),(h(!0),m(l,null,t(F.value,t=>(h(),m(`div`,{key:t.hostId+`:`+(t.workspaceId||t.id),class:`archived-row`},[e(g,{provider:t.provider},null,8,[`provider`]),u(`div`,E,[u(`div`,D,c(t.name),1),u(`div`,O,[i(c(t.project)+` `,1),a.hosts.length>1?(h(),m(l,{key:0},[i(` · `+c(z.value.get(t.hostId)||t.hostId),1)],64)):p(``,!0),i(` · archived `+c(H(t.archivedAt)),1)])]),t.workspaceId?(h(),m(`button`,{key:0,type:`button`,class:`btn btn-sm btn-outline`,disabled:R.value===t.hostId+`:`+t.workspaceId,onClick:e=>V(t)},[e(v,{name:`undo`,size:13}),i(c(R.value===t.hostId+`:`+t.workspaceId?`Restoring…`:`Restore`),1)],8,k)):p(``,!0)]))),128))])],512)],32))}});export{A as default};
@@ -1,3 +1,3 @@
1
- import{C as e,H as t,L as n,Q as r,S as i,T as a,Y as o,c as s,ct as c,d as l,dt as u,f as d,g as f,h as ee,it as p,u as te,v as m,y as h,z as g}from"./vue.runtime.esm-bundler-DmQNwI70.js";import{_,m as v}from"./index-DZm2Vxoh.js";var ne={class:`changes-panel`},re={class:`changes-top`},ie={class:`segmented segmented-sm`,role:`tablist`},ae=[`aria-selected`],oe=[`aria-selected`],se={key:0,class:`segmented segmented-sm`,role:`radiogroup`,"aria-label":`Compare mode`},ce=[`disabled`],le={key:0,class:`base-bar`},ue=[`onKeydown`],de={class:`row-sub`},fe={key:1,class:`pr-bar`},pe=[`href`],me={class:`pr-title`},he={class:`git-actions`},ge=[`disabled`],_e=[`disabled`],ve=[`disabled`],ye=[`disabled`],be={class:`form-actions`},xe=[`disabled`],Se=[`disabled`],Ce=[`disabled`],we={class:`form-actions`},Te=[`disabled`],Ee={key:4,class:`setting-note`,role:`status`},De={key:5,class:`setting-note is-error`,role:`alert`},Oe={key:6,class:`review-tray`,role:`region`,"aria-label":`Pending review comments`},ke={class:`review-tray-head`},Ae={class:`grow`},je=[`onClick`],Me={key:0,class:`row-sub`},Ne={key:1,class:`row-sub`},Pe=[`onToggle`],Fe={class:`file-sum-path`},Ie={class:`file-sum-stat`},Le={class:`stat-add`},Re={class:`stat-del`},ze={class:`file-bar`},Be=[`onClick`],Ve=[`onClick`],He=[`onSubmit`],Ue={class:`form-actions`},We=[`disabled`],Ge={key:1,class:`row-sub`},Ke={key:2,class:`row-sub`},qe={class:`hunk`},Je=[`onClick`],Ye={class:`diff-code`},Xe=[`onSubmit`],Ze={class:`form-actions`},Qe=[`disabled`],$e={key:0,class:`row-sub`},et={key:1,class:`row-sub`},tt={class:`commit-sha`},nt={class:`commit-subj`},rt={key:0,class:`hs-tag`},it={class:`row-sub`},at=[`onToggle`],ot={class:`file-sum-stat`},st={class:`stat-add`},ct={class:`stat-del`},lt={key:0,class:`row-sub`},ut={key:1,class:`setting-note is-error`},dt={class:`hunk`},y=v(a({__name:`ChangesPanel`,props:{hostId:{},cwd:{},workspaceId:{},api:{type:Function}},emits:[`sendReview`],setup(a,{emit:v}){let y=a,ft=v,b=p(`diff`),x=p(`uncommitted`),S=p(``),C=p(!1),w=p(``),T=p([]),E=p(``),D=p(``),O=p(!1),k=p(!1),A=0,j=p(new Set),M=p([]),N=p(!1),P=p({}),F=p(null),I=p(!1),L=p(!1),R=p(``),z=p(!1),B=p(``),V=p(``),H=p([]),U=p(null),W=p(``),pt=0;n(()=>A++);let G=()=>`/hosts/${encodeURIComponent(y.hostId)}`;async function K(){let e=++A;O.value=!0,E.value=``,T.value=[],k.value=!1,j.value=new Set;try{let t=new URLSearchParams({cwd:y.cwd,mode:x.value});x.value===`base`&&S.value.trim()&&t.set(`baseRef`,S.value.trim());let n=await y.api(`${G()}/changes?${t}`);if(e!==A)return;T.value=n.files??[],k.value=!!n.diffTooLarge,n.baseRef&&!S.value&&(S.value=n.baseRef)}catch(t){e===A&&(E.value=t.message)}finally{e===A&&(O.value=!1)}}async function q(){try{F.value=await y.api(`${G()}/git/pr-status?cwd=${encodeURIComponent(y.cwd)}`)}catch{F.value=null}}async function J(){N.value=!0,E.value=``;try{let e=await y.api(`${G()}/git/commits?cwd=${encodeURIComponent(y.cwd)}`);M.value=e.commits??[],e.baseRef&&!S.value&&(S.value=e.baseRef)}catch(e){E.value=e.message}finally{N.value=!1}}async function mt(e,t){let n=`${e}:${t}`;if(!P.value[n])try{let r=await y.api(`${G()}/git/commit-diff?cwd=${encodeURIComponent(y.cwd)}&sha=${encodeURIComponent(e)}&path=${encodeURIComponent(t)}`);P.value[n]=r.file??{status:`empty`,hunks:[]}}catch(e){P.value[n]={error:e.message}}}async function Y(){let e=w.value.trim();if(e){if(C.value=!1,S.value=e,y.workspaceId)try{await y.api(`${G()}/workspaces/${encodeURIComponent(y.workspaceId)}/base-branch`,`POST`,{baseRef:e})}catch{}x.value===`base`&&K()}}async function ht(){I.value=!0,E.value=D.value=``;try{await y.api(`${G()}/git/commit`,`POST`,{cwd:y.cwd,message:R.value.trim()||void 0,addAll:!0},6e4),R.value=``,L.value=!1,D.value=`Committed changes.`,await Promise.all([K(),q(),b.value===`commits`?J():Promise.resolve()])}catch(e){E.value=e.message}finally{I.value=!1}}async function X(){I.value=!0,E.value=D.value=``;try{await y.api(`${G()}/git/push`,`POST`,{cwd:y.cwd},6e4),D.value=`Pushed to remote.`,await q()}catch(e){E.value=e.message}finally{I.value=!1}}async function gt(){I.value=!0,E.value=D.value=``;try{let e=await y.api(`${G()}/git/pr`,`POST`,{cwd:y.cwd,title:B.value.trim()||void 0,body:V.value.trim()||void 0,baseRef:S.value.trim()||void 0},6e4);z.value=!1,B.value=V.value=``,D.value=e.url?`PR created: ${e.url}`:`PR created.`,await q()}catch(e){E.value=e.message}finally{I.value=!1}}async function _t(e){try{await navigator.clipboard.writeText(e)}catch{E.value=`Could not copy path.`}}function Z(e,t){let n=`${e}::${t}`;U.value===n?U.value=null:(U.value=n,W.value=``)}function Q(e,t){let n=W.value.trim();n&&(H.value.push({id:`c-${++pt}`,path:e,line:t,text:n}),W.value=``,U.value=null)}function vt(e){H.value=H.value.filter(t=>t.id!==e)}function yt(){if(!H.value.length)return;let e=[`Please address the following code review comments:`,``,...H.value.map((e,t)=>`${t+1}. \`${e.path}\` (${e.line}): ${e.text}`)];ft(`sendReview`,e.join(`
2
- `)),H.value=[]}let $=ee(()=>{let e=F.value;if(!e||!e.pr)return null;let t=Array.isArray(e.checks)?e.checks:[],n=t.filter(e=>e.conclusion===`failure`||e.state===`failure`).length,r=t.filter(e=>e.status===`in_progress`||e.status===`queued`||e.state===`pending`).length,i=t.length-n-r;return{pr:e.pr,checksCount:t.length,failed:n,pending:r,passed:i}});return o(()=>[y.hostId,y.cwd],()=>{T.value=[],M.value=[],P.value={},H.value=[],F.value=null,K(),q()},{immediate:!0}),o(x,()=>{b.value===`diff`&&K()}),o(b,e=>{e===`commits`&&!M.value.length&&J()}),(n,a)=>(g(),h(`section`,ne,[f(`div`,re,[f(`div`,ie,[f(`button`,{type:`button`,role:`tab`,"aria-selected":b.value===`diff`,class:c({chosen:b.value===`diff`}),onClick:a[0]||=e=>b.value=`diff`},`Diff`,10,ae),f(`button`,{type:`button`,role:`tab`,"aria-selected":b.value===`commits`,class:c({chosen:b.value===`commits`}),onClick:a[1]||=e=>b.value=`commits`},`Commits`,10,oe)]),b.value===`diff`?(g(),h(`div`,se,[f(`button`,{type:`button`,class:c({chosen:x.value===`uncommitted`}),onClick:a[2]||=e=>x.value=`uncommitted`},`Uncommitted`,2),f(`button`,{type:`button`,class:c({chosen:x.value===`base`}),onClick:a[3]||=e=>x.value=`base`},`vs `+u(S.value||`Base`),3)])):m(``,!0),f(`button`,{type:`button`,class:`icon-btn`,disabled:O.value||N.value,title:`Refresh`,"aria-label":`Refresh changes`,onClick:a[4]||=e=>{b.value===`diff`?K():J(),q()}},[e(_,{name:`refresh`,size:14})],8,ce)]),b.value===`diff`&&x.value===`base`?(g(),h(`div`,le,[C.value?(g(),h(d,{key:0},[r(f(`input`,{"onUpdate:modelValue":a[5]||=e=>w.value=e,placeholder:`main`,"aria-label":`Base branch`,onKeydown:te(l(Y,[`prevent`]),[`enter`])},null,40,ue),[[s,w.value]]),f(`button`,{type:`button`,class:`btn btn-sm btn-primary`,onClick:Y},`Set`),f(`button`,{type:`button`,class:`btn btn-sm btn-ghost`,onClick:a[6]||=e=>C.value=!1},`Cancel`)],64)):(g(),h(d,{key:1},[f(`span`,de,[a[19]||=i(`Base: `,-1),f(`code`,null,u(S.value||`default`),1)]),f(`button`,{type:`button`,class:`link-btn`,onClick:a[7]||=e=>{w.value=S.value,C.value=!0}},`Change base`)],64))])):m(``,!0),$.value?(g(),h(`div`,fe,[f(`a`,{href:$.value.pr.url,target:`_blank`,rel:`noopener noreferrer`,class:`pr-link`},[e(_,{name:`branch`,size:13}),f(`strong`,null,`#`+u($.value.pr.number),1),f(`span`,me,u($.value.pr.title),1),e(_,{name:`external`,size:12})],8,pe),$.value.checksCount?(g(),h(`span`,{key:0,class:c([`pr-checks`,$.value.failed?`is-danger`:$.value.pending?`is-warn`:`is-ok`])},u($.value.failed?`${$.value.failed} failed`:$.value.pending?`${$.value.pending} running`:`${$.value.passed} passed`),3)):m(``,!0)])):m(``,!0),f(`div`,he,[f(`button`,{type:`button`,class:`btn btn-sm btn-outline`,disabled:I.value,onClick:a[8]||=e=>{L.value=!L.value,z.value=!1}},`Commit`,8,ge),f(`button`,{type:`button`,class:`btn btn-sm btn-outline`,disabled:I.value,onClick:X},u(I.value?`Working…`:`Push`),9,_e),$.value?m(``,!0):(g(),h(`button`,{key:0,type:`button`,class:`btn btn-sm btn-outline`,disabled:I.value,onClick:a[9]||=e=>{z.value=!z.value,L.value=!1}},`Create PR`,8,ve))]),L.value?(g(),h(`form`,{key:2,class:`git-form`,onSubmit:l(ht,[`prevent`])},[r(f(`textarea`,{"onUpdate:modelValue":a[10]||=e=>R.value=e,rows:`2`,placeholder:`Commit message (leave blank to auto-generate)`,disabled:I.value},null,8,ye),[[s,R.value]]),f(`div`,be,[f(`button`,{type:`button`,class:`btn btn-sm btn-ghost`,onClick:a[11]||=e=>L.value=!1},`Cancel`),f(`button`,{type:`submit`,class:`btn btn-sm btn-primary`,disabled:I.value},u(I.value?`Committing…`:`Commit all`),9,xe)])],32)):m(``,!0),z.value?(g(),h(`form`,{key:3,class:`git-form`,onSubmit:l(gt,[`prevent`])},[r(f(`input`,{"onUpdate:modelValue":a[12]||=e=>B.value=e,placeholder:`PR title (leave blank to auto-generate)`,disabled:I.value},null,8,Se),[[s,B.value]]),r(f(`textarea`,{"onUpdate:modelValue":a[13]||=e=>V.value=e,rows:`2`,placeholder:`PR description (optional)`,disabled:I.value},null,8,Ce),[[s,V.value]]),f(`div`,we,[f(`button`,{type:`button`,class:`btn btn-sm btn-ghost`,onClick:a[14]||=e=>z.value=!1},`Cancel`),f(`button`,{type:`submit`,class:`btn btn-sm btn-primary`,disabled:I.value},u(I.value?`Creating…`:`Create PR`),9,Te)])],32)):m(``,!0),D.value?(g(),h(`p`,Ee,u(D.value),1)):m(``,!0),E.value?(g(),h(`p`,De,u(E.value),1)):m(``,!0),H.value.length?(g(),h(`div`,Oe,[f(`div`,ke,[f(`strong`,null,u(H.value.length)+` review `+u(H.value.length===1?`comment`:`comments`),1),f(`button`,{type:`button`,class:`btn btn-sm btn-primary`,onClick:yt},`Send to agent`)]),(g(!0),h(d,null,t(H.value,t=>(g(),h(`div`,{key:t.id,class:`review-chip`},[f(`span`,Ae,[f(`code`,null,u(t.path)+`:`+u(t.line),1),i(` — `+u(t.text),1)]),f(`button`,{type:`button`,class:`icon-btn`,"aria-label":`Remove comment`,onClick:e=>vt(t.id)},[e(_,{name:`close`,size:12})],8,je)]))),128))])):m(``,!0),b.value===`diff`?(g(),h(d,{key:7},[k.value?(g(),h(`p`,Me,`Diff exceeds the host limit; some changes are omitted.`)):m(``,!0),!O.value&&!E.value&&!T.value.length?(g(),h(`p`,Ne,`No `+u(x.value===`uncommitted`?`uncommitted `:``)+`changes.`,1)):m(``,!0),(g(!0),h(d,null,t(T.value,e=>(g(),h(`details`,{key:e.path,onToggle:t=>t.target.open?j.value.add(e.path):j.value.delete(e.path)},[f(`summary`,null,[f(`span`,Fe,u(e.oldPath?e.oldPath+` → `:``)+u(e.path),1),f(`span`,Ie,[f(`em`,Le,`+`+u(e.additions),1),a[20]||=i(),f(`em`,Re,`−`+u(e.deletions),1)])]),f(`div`,ze,[f(`button`,{type:`button`,class:`link-btn`,onClick:t=>_t(e.path)},`Copy path`,8,Be),f(`button`,{type:`button`,class:`link-btn`,onClick:t=>Z(e.path,`file`)},`+ Comment on file`,8,Ve)]),U.value===e.path+`::file`?(g(),h(`form`,{key:0,class:`review-form`,onSubmit:l(t=>Q(e.path,`file`),[`prevent`])},[r(f(`textarea`,{"onUpdate:modelValue":a[15]||=e=>W.value=e,rows:`2`,placeholder:`Write review comment for this file…`},null,512),[[s,W.value]]),f(`div`,Ue,[f(`button`,{type:`button`,class:`btn btn-sm btn-ghost`,onClick:a[16]||=e=>U.value=null},`Cancel`),f(`button`,{type:`submit`,class:`btn btn-sm btn-primary`,disabled:!W.value.trim()},`Add comment`,8,We)])],40,He)):m(``,!0),e.status===`binary`?(g(),h(`p`,Ge,`Binary file changed.`)):e.status===`too_large`?(g(),h(`p`,Ke,`File diff is too large to display.`)):m(``,!0),j.value.has(e.path)?(g(!0),h(d,{key:3},t(e.hunks,(n,i)=>(g(),h(`div`,{key:i,class:`diff-hunk-block`},[f(`div`,qe,`@@ −`+u(n.oldStart)+`,`+u(n.oldCount)+` +`+u(n.newStart)+`,`+u(n.newCount)+` @@`,1),(g(!0),h(d,null,t(n.lines,(t,i)=>(g(),h(d,{key:i},[f(`div`,{class:c([`diff-line`,t.type])},[f(`button`,{type:`button`,class:`diff-comment-btn`,title:`Add review comment on this line`,"aria-label":`Add review comment`,onClick:r=>Z(e.path,`L${t.newLineNumber??t.oldLineNumber??n.newStart+i}`)},`+`,8,Je),f(`span`,Ye,u(t.type===`add`?`+`:t.type===`remove`?`−`:` `)+u(t.content),1)],2),U.value===`${e.path}::L${t.newLineNumber??t.oldLineNumber??n.newStart+i}`?(g(),h(`form`,{key:0,class:`review-form`,onSubmit:l(r=>Q(e.path,`L${t.newLineNumber??t.oldLineNumber??n.newStart+i}`),[`prevent`])},[r(f(`textarea`,{"onUpdate:modelValue":a[17]||=e=>W.value=e,rows:`2`,placeholder:`Write review comment on this line…`},null,512),[[s,W.value]]),f(`div`,Ze,[f(`button`,{type:`button`,class:`btn btn-sm btn-ghost`,onClick:a[18]||=e=>U.value=null},`Cancel`),f(`button`,{type:`submit`,class:`btn btn-sm btn-primary`,disabled:!W.value.trim()},`Add comment`,8,Qe)])],40,Xe)):m(``,!0)],64))),128))]))),128)):m(``,!0)],40,Pe))),128))],64)):(g(),h(d,{key:8},[N.value&&!M.value.length?(g(),h(`p`,$e,`Loading commits…`)):M.value.length?m(``,!0):(g(),h(`p`,et,`No commits found.`)),(g(!0),h(d,null,t(M.value,e=>(g(),h(`details`,{key:e.sha,class:`commit-item`},[f(`summary`,null,[f(`code`,tt,u(e.shortSha),1),f(`span`,nt,u(e.subject),1),e.isOnRemote?m(``,!0):(g(),h(`span`,rt,`unpushed`))]),f(`p`,it,u(e.authorName)+` · `+u(new Date(e.authorDate).toLocaleString()),1),(g(!0),h(d,null,t(e.files??[],n=>(g(),h(`details`,{key:n.path,class:`commit-file`,onToggle:t=>t.target.open&&mt(e.sha,n.path)},[f(`summary`,null,[i(u(n.path)+` `,1),f(`span`,ot,[f(`em`,st,`+`+u(n.additions??0),1),a[21]||=i(),f(`em`,ct,`−`+u(n.deletions??0),1)])]),P.value[e.sha+`:`+n.path]?P.value[e.sha+`:`+n.path].error?(g(),h(`p`,ut,u(P.value[e.sha+`:`+n.path].error),1)):(g(!0),h(d,{key:2},t(P.value[e.sha+`:`+n.path].hunks??[],(e,n)=>(g(),h(`pre`,{key:n},[f(`code`,null,[f(`span`,dt,`@@ −`+u(e.oldStart)+`,`+u(e.oldCount)+` +`+u(e.newStart)+`,`+u(e.newCount)+` @@
1
+ import{C as e,H as t,L as n,Q as r,S as i,T as a,Y as o,c as s,ct as c,d as l,dt as u,f as d,g as f,h as ee,it as p,u as te,v as m,y as h,z as g}from"./vue.runtime.esm-bundler-DmQNwI70.js";import{g as _,y as v}from"./index-Ce8bdxwG.js";var ne={class:`changes-panel`},re={class:`changes-top`},ie={class:`segmented segmented-sm`,role:`tablist`},ae=[`aria-selected`],oe=[`aria-selected`],se={key:0,class:`segmented segmented-sm`,role:`radiogroup`,"aria-label":`Compare mode`},ce=[`disabled`],le={key:0,class:`base-bar`},ue=[`onKeydown`],de={class:`row-sub`},fe={key:1,class:`pr-bar`},pe=[`href`],me={class:`pr-title`},he={class:`git-actions`},ge=[`disabled`],_e=[`disabled`],ve=[`disabled`],ye=[`disabled`],be={class:`form-actions`},xe=[`disabled`],Se=[`disabled`],Ce=[`disabled`],we={class:`form-actions`},Te=[`disabled`],Ee={key:4,class:`setting-note`,role:`status`},De={key:5,class:`setting-note is-error`,role:`alert`},Oe={key:6,class:`review-tray`,role:`region`,"aria-label":`Pending review comments`},ke={class:`review-tray-head`},Ae={class:`grow`},je=[`onClick`],Me={key:0,class:`row-sub`},Ne={key:1,class:`row-sub`},Pe=[`onToggle`],Fe={class:`file-sum-path`},Ie={class:`file-sum-stat`},Le={class:`stat-add`},Re={class:`stat-del`},ze={class:`file-bar`},Be=[`onClick`],Ve=[`onClick`],He=[`onSubmit`],Ue={class:`form-actions`},We=[`disabled`],Ge={key:1,class:`row-sub`},Ke={key:2,class:`row-sub`},qe={class:`hunk`},Je=[`onClick`],Ye={class:`diff-code`},Xe=[`onSubmit`],Ze={class:`form-actions`},Qe=[`disabled`],$e={key:0,class:`row-sub`},et={key:1,class:`row-sub`},tt={class:`commit-sha`},nt={class:`commit-subj`},rt={key:0,class:`hs-tag`},it={class:`row-sub`},at=[`onToggle`],ot={class:`file-sum-stat`},st={class:`stat-add`},ct={class:`stat-del`},lt={key:0,class:`row-sub`},ut={key:1,class:`setting-note is-error`},dt={class:`hunk`},y=_(a({__name:`ChangesPanel`,props:{hostId:{},cwd:{},workspaceId:{},api:{type:Function}},emits:[`sendReview`],setup(a,{emit:_}){let y=a,ft=_,b=p(`diff`),x=p(`uncommitted`),S=p(``),C=p(!1),w=p(``),T=p([]),E=p(``),D=p(``),O=p(!1),k=p(!1),A=0,j=p(new Set),M=p([]),N=p(!1),P=p({}),F=p(null),I=p(!1),L=p(!1),R=p(``),z=p(!1),B=p(``),V=p(``),H=p([]),U=p(null),W=p(``),pt=0;n(()=>A++);let G=()=>`/hosts/${encodeURIComponent(y.hostId)}`;async function K(){let e=++A;O.value=!0,E.value=``,T.value=[],k.value=!1,j.value=new Set;try{let t=new URLSearchParams({cwd:y.cwd,mode:x.value});x.value===`base`&&S.value.trim()&&t.set(`baseRef`,S.value.trim());let n=await y.api(`${G()}/changes?${t}`);if(e!==A)return;T.value=n.files??[],k.value=!!n.diffTooLarge,n.baseRef&&!S.value&&(S.value=n.baseRef)}catch(t){e===A&&(E.value=t.message)}finally{e===A&&(O.value=!1)}}async function q(){try{F.value=await y.api(`${G()}/git/pr-status?cwd=${encodeURIComponent(y.cwd)}`)}catch{F.value=null}}async function J(){N.value=!0,E.value=``;try{let e=await y.api(`${G()}/git/commits?cwd=${encodeURIComponent(y.cwd)}`);M.value=e.commits??[],e.baseRef&&!S.value&&(S.value=e.baseRef)}catch(e){E.value=e.message}finally{N.value=!1}}async function mt(e,t){let n=`${e}:${t}`;if(!P.value[n])try{let r=await y.api(`${G()}/git/commit-diff?cwd=${encodeURIComponent(y.cwd)}&sha=${encodeURIComponent(e)}&path=${encodeURIComponent(t)}`);P.value[n]=r.file??{status:`empty`,hunks:[]}}catch(e){P.value[n]={error:e.message}}}async function Y(){let e=w.value.trim();if(e){if(C.value=!1,S.value=e,y.workspaceId)try{await y.api(`${G()}/workspaces/${encodeURIComponent(y.workspaceId)}/base-branch`,`POST`,{baseRef:e})}catch{}x.value===`base`&&K()}}async function ht(){I.value=!0,E.value=D.value=``;try{await y.api(`${G()}/git/commit`,`POST`,{cwd:y.cwd,message:R.value.trim()||void 0,addAll:!0},6e4),R.value=``,L.value=!1,D.value=`Committed changes.`,await Promise.all([K(),q(),b.value===`commits`?J():Promise.resolve()])}catch(e){E.value=e.message}finally{I.value=!1}}async function X(){I.value=!0,E.value=D.value=``;try{await y.api(`${G()}/git/push`,`POST`,{cwd:y.cwd},6e4),D.value=`Pushed to remote.`,await q()}catch(e){E.value=e.message}finally{I.value=!1}}async function gt(){I.value=!0,E.value=D.value=``;try{let e=await y.api(`${G()}/git/pr`,`POST`,{cwd:y.cwd,title:B.value.trim()||void 0,body:V.value.trim()||void 0,baseRef:S.value.trim()||void 0},6e4);z.value=!1,B.value=V.value=``,D.value=e.url?`PR created: ${e.url}`:`PR created.`,await q()}catch(e){E.value=e.message}finally{I.value=!1}}async function _t(e){try{await navigator.clipboard.writeText(e)}catch{E.value=`Could not copy path.`}}function Z(e,t){let n=`${e}::${t}`;U.value===n?U.value=null:(U.value=n,W.value=``)}function Q(e,t){let n=W.value.trim();n&&(H.value.push({id:`c-${++pt}`,path:e,line:t,text:n}),W.value=``,U.value=null)}function vt(e){H.value=H.value.filter(t=>t.id!==e)}function yt(){if(!H.value.length)return;let e=[`Please address the following code review comments:`,``,...H.value.map((e,t)=>`${t+1}. \`${e.path}\` (${e.line}): ${e.text}`)];ft(`sendReview`,e.join(`
2
+ `)),H.value=[]}let $=ee(()=>{let e=F.value;if(!e||!e.pr)return null;let t=Array.isArray(e.checks)?e.checks:[],n=t.filter(e=>e.conclusion===`failure`||e.state===`failure`).length,r=t.filter(e=>e.status===`in_progress`||e.status===`queued`||e.state===`pending`).length,i=t.length-n-r;return{pr:e.pr,checksCount:t.length,failed:n,pending:r,passed:i}});return o(()=>[y.hostId,y.cwd],()=>{T.value=[],M.value=[],P.value={},H.value=[],F.value=null,K(),q()},{immediate:!0}),o(x,()=>{b.value===`diff`&&K()}),o(b,e=>{e===`commits`&&!M.value.length&&J()}),(n,a)=>(g(),h(`section`,ne,[f(`div`,re,[f(`div`,ie,[f(`button`,{type:`button`,role:`tab`,"aria-selected":b.value===`diff`,class:c({chosen:b.value===`diff`}),onClick:a[0]||=e=>b.value=`diff`},`Diff`,10,ae),f(`button`,{type:`button`,role:`tab`,"aria-selected":b.value===`commits`,class:c({chosen:b.value===`commits`}),onClick:a[1]||=e=>b.value=`commits`},`Commits`,10,oe)]),b.value===`diff`?(g(),h(`div`,se,[f(`button`,{type:`button`,class:c({chosen:x.value===`uncommitted`}),onClick:a[2]||=e=>x.value=`uncommitted`},`Uncommitted`,2),f(`button`,{type:`button`,class:c({chosen:x.value===`base`}),onClick:a[3]||=e=>x.value=`base`},`vs `+u(S.value||`Base`),3)])):m(``,!0),f(`button`,{type:`button`,class:`icon-btn`,disabled:O.value||N.value,title:`Refresh`,"aria-label":`Refresh changes`,onClick:a[4]||=e=>{b.value===`diff`?K():J(),q()}},[e(v,{name:`refresh`,size:14})],8,ce)]),b.value===`diff`&&x.value===`base`?(g(),h(`div`,le,[C.value?(g(),h(d,{key:0},[r(f(`input`,{"onUpdate:modelValue":a[5]||=e=>w.value=e,placeholder:`main`,"aria-label":`Base branch`,onKeydown:te(l(Y,[`prevent`]),[`enter`])},null,40,ue),[[s,w.value]]),f(`button`,{type:`button`,class:`btn btn-sm btn-primary`,onClick:Y},`Set`),f(`button`,{type:`button`,class:`btn btn-sm btn-ghost`,onClick:a[6]||=e=>C.value=!1},`Cancel`)],64)):(g(),h(d,{key:1},[f(`span`,de,[a[19]||=i(`Base: `,-1),f(`code`,null,u(S.value||`default`),1)]),f(`button`,{type:`button`,class:`link-btn`,onClick:a[7]||=e=>{w.value=S.value,C.value=!0}},`Change base`)],64))])):m(``,!0),$.value?(g(),h(`div`,fe,[f(`a`,{href:$.value.pr.url,target:`_blank`,rel:`noopener noreferrer`,class:`pr-link`},[e(v,{name:`branch`,size:13}),f(`strong`,null,`#`+u($.value.pr.number),1),f(`span`,me,u($.value.pr.title),1),e(v,{name:`external`,size:12})],8,pe),$.value.checksCount?(g(),h(`span`,{key:0,class:c([`pr-checks`,$.value.failed?`is-danger`:$.value.pending?`is-warn`:`is-ok`])},u($.value.failed?`${$.value.failed} failed`:$.value.pending?`${$.value.pending} running`:`${$.value.passed} passed`),3)):m(``,!0)])):m(``,!0),f(`div`,he,[f(`button`,{type:`button`,class:`btn btn-sm btn-outline`,disabled:I.value,onClick:a[8]||=e=>{L.value=!L.value,z.value=!1}},`Commit`,8,ge),f(`button`,{type:`button`,class:`btn btn-sm btn-outline`,disabled:I.value,onClick:X},u(I.value?`Working…`:`Push`),9,_e),$.value?m(``,!0):(g(),h(`button`,{key:0,type:`button`,class:`btn btn-sm btn-outline`,disabled:I.value,onClick:a[9]||=e=>{z.value=!z.value,L.value=!1}},`Create PR`,8,ve))]),L.value?(g(),h(`form`,{key:2,class:`git-form`,onSubmit:l(ht,[`prevent`])},[r(f(`textarea`,{"onUpdate:modelValue":a[10]||=e=>R.value=e,rows:`2`,placeholder:`Commit message (leave blank to auto-generate)`,disabled:I.value},null,8,ye),[[s,R.value]]),f(`div`,be,[f(`button`,{type:`button`,class:`btn btn-sm btn-ghost`,onClick:a[11]||=e=>L.value=!1},`Cancel`),f(`button`,{type:`submit`,class:`btn btn-sm btn-primary`,disabled:I.value},u(I.value?`Committing…`:`Commit all`),9,xe)])],32)):m(``,!0),z.value?(g(),h(`form`,{key:3,class:`git-form`,onSubmit:l(gt,[`prevent`])},[r(f(`input`,{"onUpdate:modelValue":a[12]||=e=>B.value=e,placeholder:`PR title (leave blank to auto-generate)`,disabled:I.value},null,8,Se),[[s,B.value]]),r(f(`textarea`,{"onUpdate:modelValue":a[13]||=e=>V.value=e,rows:`2`,placeholder:`PR description (optional)`,disabled:I.value},null,8,Ce),[[s,V.value]]),f(`div`,we,[f(`button`,{type:`button`,class:`btn btn-sm btn-ghost`,onClick:a[14]||=e=>z.value=!1},`Cancel`),f(`button`,{type:`submit`,class:`btn btn-sm btn-primary`,disabled:I.value},u(I.value?`Creating…`:`Create PR`),9,Te)])],32)):m(``,!0),D.value?(g(),h(`p`,Ee,u(D.value),1)):m(``,!0),E.value?(g(),h(`p`,De,u(E.value),1)):m(``,!0),H.value.length?(g(),h(`div`,Oe,[f(`div`,ke,[f(`strong`,null,u(H.value.length)+` review `+u(H.value.length===1?`comment`:`comments`),1),f(`button`,{type:`button`,class:`btn btn-sm btn-primary`,onClick:yt},`Send to agent`)]),(g(!0),h(d,null,t(H.value,t=>(g(),h(`div`,{key:t.id,class:`review-chip`},[f(`span`,Ae,[f(`code`,null,u(t.path)+`:`+u(t.line),1),i(` — `+u(t.text),1)]),f(`button`,{type:`button`,class:`icon-btn`,"aria-label":`Remove comment`,onClick:e=>vt(t.id)},[e(v,{name:`close`,size:12})],8,je)]))),128))])):m(``,!0),b.value===`diff`?(g(),h(d,{key:7},[k.value?(g(),h(`p`,Me,`Diff exceeds the host limit; some changes are omitted.`)):m(``,!0),!O.value&&!E.value&&!T.value.length?(g(),h(`p`,Ne,`No `+u(x.value===`uncommitted`?`uncommitted `:``)+`changes.`,1)):m(``,!0),(g(!0),h(d,null,t(T.value,e=>(g(),h(`details`,{key:e.path,onToggle:t=>t.target.open?j.value.add(e.path):j.value.delete(e.path)},[f(`summary`,null,[f(`span`,Fe,u(e.oldPath?e.oldPath+` → `:``)+u(e.path),1),f(`span`,Ie,[f(`em`,Le,`+`+u(e.additions),1),a[20]||=i(),f(`em`,Re,`−`+u(e.deletions),1)])]),f(`div`,ze,[f(`button`,{type:`button`,class:`link-btn`,onClick:t=>_t(e.path)},`Copy path`,8,Be),f(`button`,{type:`button`,class:`link-btn`,onClick:t=>Z(e.path,`file`)},`+ Comment on file`,8,Ve)]),U.value===e.path+`::file`?(g(),h(`form`,{key:0,class:`review-form`,onSubmit:l(t=>Q(e.path,`file`),[`prevent`])},[r(f(`textarea`,{"onUpdate:modelValue":a[15]||=e=>W.value=e,rows:`2`,placeholder:`Write review comment for this file…`},null,512),[[s,W.value]]),f(`div`,Ue,[f(`button`,{type:`button`,class:`btn btn-sm btn-ghost`,onClick:a[16]||=e=>U.value=null},`Cancel`),f(`button`,{type:`submit`,class:`btn btn-sm btn-primary`,disabled:!W.value.trim()},`Add comment`,8,We)])],40,He)):m(``,!0),e.status===`binary`?(g(),h(`p`,Ge,`Binary file changed.`)):e.status===`too_large`?(g(),h(`p`,Ke,`File diff is too large to display.`)):m(``,!0),j.value.has(e.path)?(g(!0),h(d,{key:3},t(e.hunks,(n,i)=>(g(),h(`div`,{key:i,class:`diff-hunk-block`},[f(`div`,qe,`@@ −`+u(n.oldStart)+`,`+u(n.oldCount)+` +`+u(n.newStart)+`,`+u(n.newCount)+` @@`,1),(g(!0),h(d,null,t(n.lines,(t,i)=>(g(),h(d,{key:i},[f(`div`,{class:c([`diff-line`,t.type])},[f(`button`,{type:`button`,class:`diff-comment-btn`,title:`Add review comment on this line`,"aria-label":`Add review comment`,onClick:r=>Z(e.path,`L${t.newLineNumber??t.oldLineNumber??n.newStart+i}`)},`+`,8,Je),f(`span`,Ye,u(t.type===`add`?`+`:t.type===`remove`?`−`:` `)+u(t.content),1)],2),U.value===`${e.path}::L${t.newLineNumber??t.oldLineNumber??n.newStart+i}`?(g(),h(`form`,{key:0,class:`review-form`,onSubmit:l(r=>Q(e.path,`L${t.newLineNumber??t.oldLineNumber??n.newStart+i}`),[`prevent`])},[r(f(`textarea`,{"onUpdate:modelValue":a[17]||=e=>W.value=e,rows:`2`,placeholder:`Write review comment on this line…`},null,512),[[s,W.value]]),f(`div`,Ze,[f(`button`,{type:`button`,class:`btn btn-sm btn-ghost`,onClick:a[18]||=e=>U.value=null},`Cancel`),f(`button`,{type:`submit`,class:`btn btn-sm btn-primary`,disabled:!W.value.trim()},`Add comment`,8,Qe)])],40,Xe)):m(``,!0)],64))),128))]))),128)):m(``,!0)],40,Pe))),128))],64)):(g(),h(d,{key:8},[N.value&&!M.value.length?(g(),h(`p`,$e,`Loading commits…`)):M.value.length?m(``,!0):(g(),h(`p`,et,`No commits found.`)),(g(!0),h(d,null,t(M.value,e=>(g(),h(`details`,{key:e.sha,class:`commit-item`},[f(`summary`,null,[f(`code`,tt,u(e.shortSha),1),f(`span`,nt,u(e.subject),1),e.isOnRemote?m(``,!0):(g(),h(`span`,rt,`unpushed`))]),f(`p`,it,u(e.authorName)+` · `+u(new Date(e.authorDate).toLocaleString()),1),(g(!0),h(d,null,t(e.files??[],n=>(g(),h(`details`,{key:n.path,class:`commit-file`,onToggle:t=>t.target.open&&mt(e.sha,n.path)},[f(`summary`,null,[i(u(n.path)+` `,1),f(`span`,ot,[f(`em`,st,`+`+u(n.additions??0),1),a[21]||=i(),f(`em`,ct,`−`+u(n.deletions??0),1)])]),P.value[e.sha+`:`+n.path]?P.value[e.sha+`:`+n.path].error?(g(),h(`p`,ut,u(P.value[e.sha+`:`+n.path].error),1)):(g(!0),h(d,{key:2},t(P.value[e.sha+`:`+n.path].hunks??[],(e,n)=>(g(),h(`pre`,{key:n},[f(`code`,null,[f(`span`,dt,`@@ −`+u(e.oldStart)+`,`+u(e.oldCount)+` +`+u(e.newStart)+`,`+u(e.newCount)+` @@
3
3
  `,1),(g(!0),h(d,null,t(e.lines,(e,t)=>(g(),h(`span`,{key:t,class:c(e.type)},u(e.type===`add`?`+`:e.type===`remove`?`−`:` `)+u(e.content),3))),128))])]))),128)):(g(),h(`p`,lt,`Loading diff…`))],40,at))),128))]))),128))],64))]))}}),[[`__scopeId`,`data-v-c13449c7`]]);export{y as default};