litepaseo 0.12.2 → 0.13.1
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/CHANGELOG.md +18 -0
- package/dist/server/cli.mjs +2 -2
- package/dist/server/{worker-BFGIplko.mjs → worker-DfNLXgRM.mjs} +274 -9
- package/dist/web/assets/{AddProjectDialog-BLxWPHSV.js → AddProjectDialog-BH4t1mH0.js} +1 -1
- package/dist/web/assets/AddProjectDialog-BH4t1mH0.js.br +0 -0
- package/dist/web/assets/AddProjectDialog-BH4t1mH0.js.gz +0 -0
- package/dist/web/assets/{ArchivedWorkspaces-CI1WOL06.js → ArchivedWorkspaces-c0EOLkEH.js} +1 -1
- package/dist/web/assets/ArchivedWorkspaces-c0EOLkEH.js.br +0 -0
- package/dist/web/assets/ArchivedWorkspaces-c0EOLkEH.js.gz +0 -0
- package/dist/web/assets/ChangesPanel-BEjmqUew.css +1 -0
- package/dist/web/assets/ChangesPanel-BEjmqUew.css.br +0 -0
- package/dist/web/assets/ChangesPanel-BEjmqUew.css.gz +0 -0
- package/dist/web/assets/ChangesPanel-DjkKjhfi.js +3 -0
- package/dist/web/assets/ChangesPanel-DjkKjhfi.js.br +0 -0
- package/dist/web/assets/ChangesPanel-DjkKjhfi.js.gz +0 -0
- package/dist/web/assets/{CodeBlockNode-DdarDbUY.js → CodeBlockNode-bijGGeoN.js} +1 -1
- package/dist/web/assets/CodeBlockNode-bijGGeoN.js.br +0 -0
- package/dist/web/assets/CodeBlockNode-bijGGeoN.js.gz +0 -0
- package/dist/web/assets/CommandCenter-CCTGjCPX.js +1 -0
- package/dist/web/assets/CommandCenter-CCTGjCPX.js.br +0 -0
- package/dist/web/assets/CommandCenter-CCTGjCPX.js.gz +0 -0
- package/dist/web/assets/{ConversationSearch-CalLvgyc.js → ConversationSearch-1MY_nmz4.js} +1 -1
- package/dist/web/assets/ConversationSearch-1MY_nmz4.js.br +0 -0
- package/dist/web/assets/ConversationSearch-1MY_nmz4.js.gz +0 -0
- package/dist/web/assets/FileViewer-B0bQlA3z.js +2 -0
- package/dist/web/assets/FileViewer-B0bQlA3z.js.br +0 -0
- package/dist/web/assets/FileViewer-B0bQlA3z.js.gz +0 -0
- package/dist/web/assets/FileViewer-CWOWcrwG.css +1 -0
- package/dist/web/assets/FileViewer-CWOWcrwG.css.br +0 -0
- package/dist/web/assets/FileViewer-CWOWcrwG.css.gz +0 -0
- package/dist/web/assets/{FilesPanel-BnJhiHEi.js → FilesPanel-D_-v_ZcF.js} +1 -1
- package/dist/web/assets/FilesPanel-D_-v_ZcF.js.br +0 -0
- package/dist/web/assets/FilesPanel-D_-v_ZcF.js.gz +0 -0
- package/dist/web/assets/{HostSettings-DNQuE0Bg.js → HostSettings-DSgKGO4q.js} +1 -1
- package/dist/web/assets/HostSettings-DSgKGO4q.js.br +0 -0
- package/dist/web/assets/HostSettings-DSgKGO4q.js.gz +0 -0
- package/dist/web/assets/{KanbanPage-Bo1lGpZJ.js → KanbanPage-CdxFwCay.js} +1 -1
- package/dist/web/assets/KanbanPage-CdxFwCay.js.br +0 -0
- package/dist/web/assets/KanbanPage-CdxFwCay.js.gz +0 -0
- package/dist/web/assets/LabelsDialog-BLDf7cQV.js +1 -0
- package/dist/web/assets/LabelsDialog-BLDf7cQV.js.br +0 -0
- package/dist/web/assets/LabelsDialog-BLDf7cQV.js.gz +0 -0
- package/dist/web/assets/{MarkdownMessage-N6A4HF22.js → MarkdownMessage-C7r5tc7R.js} +5 -5
- package/dist/web/assets/MarkdownMessage-C7r5tc7R.js.br +0 -0
- package/dist/web/assets/MarkdownMessage-C7r5tc7R.js.gz +0 -0
- package/dist/web/assets/{PreCodeBlock-CkuCPuPW.js → PreCodeBlock-Df4DvpxT.js} +1 -1
- package/dist/web/assets/{PreCodeBlock.vue_vue_type_style_index_0_lang-uQYvfuPo.js → PreCodeBlock.vue_vue_type_style_index_0_lang-bn_V109a.js} +1 -1
- package/dist/web/assets/PreCodeBlock.vue_vue_type_style_index_0_lang-bn_V109a.js.br +0 -0
- package/dist/web/assets/PreCodeBlock.vue_vue_type_style_index_0_lang-bn_V109a.js.gz +0 -0
- package/dist/web/assets/{SubagentsPanel-9hNkpyCH.js → SubagentsPanel-CU1DOqGi.js} +1 -1
- package/dist/web/assets/SubagentsPanel-CU1DOqGi.js.br +0 -0
- package/dist/web/assets/SubagentsPanel-CU1DOqGi.js.gz +0 -0
- package/dist/web/assets/{TerminalPanel-DdYYjx43.js → TerminalPanel-CKE10Knv.js} +1 -1
- package/dist/web/assets/TerminalPanel-CKE10Knv.js.br +0 -0
- package/dist/web/assets/TerminalPanel-CKE10Knv.js.gz +0 -0
- package/dist/web/assets/{Tooltip-Dm05uqJp.js → Tooltip-CKIQz11V.js} +1 -1
- package/dist/web/assets/Tooltip-CKIQz11V.js.br +0 -0
- package/dist/web/assets/Tooltip-CKIQz11V.js.gz +0 -0
- package/dist/web/assets/index--Rpf_YJs.js +39 -0
- package/dist/web/assets/index--Rpf_YJs.js.br +0 -0
- package/dist/web/assets/index--Rpf_YJs.js.gz +0 -0
- package/dist/web/assets/index-CnAv6NUR.css +1 -0
- package/dist/web/assets/index-CnAv6NUR.css.br +0 -0
- package/dist/web/assets/index-CnAv6NUR.css.gz +0 -0
- package/dist/web/assets/{index10-BM68C-_8.js → index10-BH5cR790.js} +1 -1
- package/dist/web/assets/index10-BH5cR790.js.br +0 -0
- package/dist/web/assets/index10-BH5cR790.js.gz +0 -0
- package/dist/web/assets/index3-OdSvV8Az.js +1 -0
- package/dist/web/assets/index4-p9EqAM3V.js +1 -0
- package/dist/web/assets/{index5-BAhnSjSa.js → index5-COjA17v2.js} +1 -1
- package/dist/web/assets/index5-COjA17v2.js.br +0 -0
- package/dist/web/assets/index5-COjA17v2.js.gz +0 -0
- package/dist/web/assets/{index6-DqBuE7Hj.js → index6-C7WwIv8h.js} +1 -1
- package/dist/web/assets/index6-C7WwIv8h.js.br +0 -0
- package/dist/web/assets/index6-C7WwIv8h.js.gz +0 -0
- package/dist/web/assets/{index7-Dpl81yIG.js → index7-MofimpJO.js} +1 -1
- package/dist/web/assets/index7-MofimpJO.js.br +0 -0
- package/dist/web/assets/index7-MofimpJO.js.gz +0 -0
- package/dist/web/assets/{index8-H-v6DMrA.js → index8-BN62x6v7.js} +1 -1
- package/dist/web/assets/index8-BN62x6v7.js.br +0 -0
- package/dist/web/assets/index8-BN62x6v7.js.gz +0 -0
- package/dist/web/assets/{index9-CuB3jKlU.js → index9-DSF8wXFh.js} +1 -1
- package/dist/web/assets/index9-DSF8wXFh.js.br +0 -0
- package/dist/web/assets/index9-DSF8wXFh.js.gz +0 -0
- package/dist/web/index.html +2 -2
- package/dist/web/index.html.br +0 -0
- package/dist/web/index.html.gz +0 -0
- package/package.json +1 -1
- package/dist/web/assets/AddProjectDialog-BLxWPHSV.js.br +0 -0
- package/dist/web/assets/AddProjectDialog-BLxWPHSV.js.gz +0 -0
- package/dist/web/assets/ArchivedWorkspaces-CI1WOL06.js.br +0 -0
- package/dist/web/assets/ArchivedWorkspaces-CI1WOL06.js.gz +0 -0
- package/dist/web/assets/ChangesPanel-BkZxgG02.js +0 -2
- package/dist/web/assets/ChangesPanel-BkZxgG02.js.br +0 -0
- package/dist/web/assets/ChangesPanel-BkZxgG02.js.gz +0 -0
- package/dist/web/assets/ChangesPanel-BlAOBntI.css +0 -1
- package/dist/web/assets/CodeBlockNode-DdarDbUY.js.br +0 -0
- package/dist/web/assets/CodeBlockNode-DdarDbUY.js.gz +0 -0
- package/dist/web/assets/CommandCenter-B5_Pxy0J.js +0 -1
- package/dist/web/assets/CommandCenter-B5_Pxy0J.js.br +0 -0
- package/dist/web/assets/CommandCenter-B5_Pxy0J.js.gz +0 -0
- package/dist/web/assets/ConversationSearch-CalLvgyc.js.br +0 -0
- package/dist/web/assets/ConversationSearch-CalLvgyc.js.gz +0 -0
- package/dist/web/assets/FileViewer-B7MjCzPt.js +0 -2
- package/dist/web/assets/FileViewer-B7MjCzPt.js.br +0 -0
- package/dist/web/assets/FileViewer-B7MjCzPt.js.gz +0 -0
- package/dist/web/assets/FileViewer-DK0Fgglf.css +0 -1
- package/dist/web/assets/FileViewer-DK0Fgglf.css.br +0 -0
- package/dist/web/assets/FileViewer-DK0Fgglf.css.gz +0 -0
- package/dist/web/assets/FilesPanel-BnJhiHEi.js.br +0 -0
- package/dist/web/assets/FilesPanel-BnJhiHEi.js.gz +0 -0
- package/dist/web/assets/HostSettings-DNQuE0Bg.js.br +0 -0
- package/dist/web/assets/HostSettings-DNQuE0Bg.js.gz +0 -0
- package/dist/web/assets/KanbanPage-Bo1lGpZJ.js.br +0 -0
- package/dist/web/assets/KanbanPage-Bo1lGpZJ.js.gz +0 -0
- package/dist/web/assets/MarkdownMessage-N6A4HF22.js.br +0 -0
- package/dist/web/assets/MarkdownMessage-N6A4HF22.js.gz +0 -0
- package/dist/web/assets/PreCodeBlock.vue_vue_type_style_index_0_lang-uQYvfuPo.js.br +0 -0
- package/dist/web/assets/PreCodeBlock.vue_vue_type_style_index_0_lang-uQYvfuPo.js.gz +0 -0
- package/dist/web/assets/SubagentsPanel-9hNkpyCH.js.br +0 -0
- package/dist/web/assets/SubagentsPanel-9hNkpyCH.js.gz +0 -0
- package/dist/web/assets/TerminalPanel-DdYYjx43.js.br +0 -0
- package/dist/web/assets/TerminalPanel-DdYYjx43.js.gz +0 -0
- package/dist/web/assets/Tooltip-Dm05uqJp.js.br +0 -0
- package/dist/web/assets/Tooltip-Dm05uqJp.js.gz +0 -0
- package/dist/web/assets/index-BYfYTC37.js +0 -36
- package/dist/web/assets/index-BYfYTC37.js.br +0 -0
- package/dist/web/assets/index-BYfYTC37.js.gz +0 -0
- package/dist/web/assets/index-Bj6t0-V6.css +0 -1
- package/dist/web/assets/index-Bj6t0-V6.css.br +0 -0
- package/dist/web/assets/index-Bj6t0-V6.css.gz +0 -0
- package/dist/web/assets/index10-BM68C-_8.js.br +0 -0
- package/dist/web/assets/index10-BM68C-_8.js.gz +0 -0
- package/dist/web/assets/index3-DRTxELjn.js +0 -1
- package/dist/web/assets/index4-CC_NIAY8.js +0 -1
- package/dist/web/assets/index5-BAhnSjSa.js.br +0 -0
- package/dist/web/assets/index5-BAhnSjSa.js.gz +0 -0
- package/dist/web/assets/index6-DqBuE7Hj.js.br +0 -0
- package/dist/web/assets/index6-DqBuE7Hj.js.gz +0 -0
- package/dist/web/assets/index7-Dpl81yIG.js.br +0 -0
- package/dist/web/assets/index7-Dpl81yIG.js.gz +0 -0
- package/dist/web/assets/index8-H-v6DMrA.js.br +0 -0
- package/dist/web/assets/index8-H-v6DMrA.js.gz +0 -0
- package/dist/web/assets/index9-CuB3jKlU.js.br +0 -0
- package/dist/web/assets/index9-CuB3jKlU.js.gz +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.13.1
|
|
4
|
+
|
|
5
|
+
- **Fix intermittent missing turn stats (`turnMetrics`)**:
|
|
6
|
+
- Refresh tail `turnMetrics` even while a kept-alive conversation is backgrounded, retry (`600ms` / `1500ms`) if the latest turn's metrics haven't landed yet, and match overlapping `seqStart`–`seqEnd` ranges.
|
|
7
|
+
- Track `metricsTouched` rows in `TimelineView.resumeOps` so returning to a cached tab always receives newly attached `turnMetrics` even though `seqEnd` did not advance.
|
|
8
|
+
- Render `turnMetrics` on standalone rows without a `turnId` as well.
|
|
9
|
+
|
|
10
|
+
## 0.13.0
|
|
11
|
+
|
|
12
|
+
- **Workspace scripts & services runner**: run, stop, and inspect `paseo.json` scripts and services directly from the chat header, including live status, port badges, and service URL links.
|
|
13
|
+
- **Changes panel Git workflow**: compare uncommitted changes or diff against a configurable base branch, browse commit history with per-file commit diffs, commit (with optional auto-generated messages), push, create pull requests, and view PR status & CI checks.
|
|
14
|
+
- **Inline diff review comments**: click `+` on any diff line (or file) to add review comments and send them all as a structured prompt to the active agent.
|
|
15
|
+
- **Fork conversation**: fork any workspace conversation from the thread menu or Command Center into a new draft session carrying its context attachment so you can switch provider, model, or worktree.
|
|
16
|
+
- **Workspace labels**: assign, create, and delete 10-color workspace labels, display label chips in the sidebar, and filter workspaces by label in the sidebar and Command Center.
|
|
17
|
+
- **Composer history recall & long-paste collapse**: press `↑`/`↓` in an empty composer to recall previous prompts; long text pastes (> 1,500 chars or > 30 lines) collapse into expandable chips and recombine on send.
|
|
18
|
+
- **File downloads**: download any workspace file (including binary/non-text files) from `FileViewer` via a bounded, safe attachment endpoint.
|
|
19
|
+
- **Fix live turn stats reliability**: preserve `turnMetrics` across `TimelineStore` resets, propagate turn metrics from any row in the turn into the turn footer, and retry tail metrics refresh once after turn completion.
|
|
20
|
+
|
|
3
21
|
## 0.12.2
|
|
4
22
|
|
|
5
23
|
- **Next message suggestions compatibility & testing**: switch default token limit to `max_completion_tokens` (512) with automatic fallback to `max_tokens` for older gateways, fixing 400 errors on newer OpenAI/reasoning models; add a **Test** button in Settings to verify the configured endpoint directly.
|
package/dist/server/cli.mjs
CHANGED
|
@@ -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.
|
|
11
|
+
const VERSION = "0.13.1";
|
|
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-
|
|
1767
|
+
const { runWorker } = await import("./worker-DfNLXgRM.mjs");
|
|
1768
1768
|
return runWorker(paths.directory, fileURLToPath(new URL("../web/", import.meta.url)));
|
|
1769
1769
|
}
|
|
1770
1770
|
const command = findCommand(name);
|
|
@@ -584,7 +584,9 @@ function summarizeWorkspace(hostId, ws, activity) {
|
|
|
584
584
|
activityAt: activity,
|
|
585
585
|
state,
|
|
586
586
|
attention: state === "needs_input",
|
|
587
|
-
unread: state === "unread" || state === "failed"
|
|
587
|
+
unread: state === "unread" || state === "failed",
|
|
588
|
+
...ws.labels?.length ? { labels: ws.labels } : {},
|
|
589
|
+
...ws.diffStat ? { diffStat: ws.diffStat } : {}
|
|
588
590
|
};
|
|
589
591
|
}
|
|
590
592
|
function summarizeEmptyProject(hostId, p) {
|
|
@@ -780,6 +782,8 @@ var TimelineView = class {
|
|
|
780
782
|
rows = [];
|
|
781
783
|
bySeqStart = /* @__PURE__ */ new Map();
|
|
782
784
|
identities = /* @__PURE__ */ new Map();
|
|
785
|
+
/** seqStarts whose turnMetrics were attached after streaming; included in resumeOps so returning tabs pick them up. */
|
|
786
|
+
metricsTouched = /* @__PURE__ */ new Set();
|
|
783
787
|
epoch = "";
|
|
784
788
|
lastSeq = -1;
|
|
785
789
|
hasOlder = false;
|
|
@@ -1054,6 +1058,7 @@ var TimelineView = class {
|
|
|
1054
1058
|
this.bySeqStart.clear();
|
|
1055
1059
|
this.identities.clear();
|
|
1056
1060
|
this.pending.clear();
|
|
1061
|
+
this.metricsTouched.clear();
|
|
1057
1062
|
this.epoch = page.epoch;
|
|
1058
1063
|
this.lastSeq = page.window.maxSeq;
|
|
1059
1064
|
this.resumeFloor = this.lastSeq;
|
|
@@ -1182,7 +1187,7 @@ var TimelineView = class {
|
|
|
1182
1187
|
*/
|
|
1183
1188
|
resumeOps(since) {
|
|
1184
1189
|
if (since.epoch !== this.epoch || since.seq < this.resumeFloor || since.seq > this.lastSeq) return null;
|
|
1185
|
-
const changed = this.rows.filter((row) => row.
|
|
1190
|
+
const changed = this.rows.filter((row) => row.seqStart >= since.from && (row.seqEnd > since.seq || this.metricsTouched.has(row.seqStart)));
|
|
1186
1191
|
if (changed.length > RESET_ROWS) return null;
|
|
1187
1192
|
return changed.map((row) => ({
|
|
1188
1193
|
type: "upsert",
|
|
@@ -1233,28 +1238,37 @@ var TimelineView = class {
|
|
|
1233
1238
|
* Pulls the last few projected entries after a turn finishes so daemon-computed turnMetrics
|
|
1234
1239
|
* (speed, tokens, cache, cost) attach to live rows without reloading the whole timeline.
|
|
1235
1240
|
*/
|
|
1236
|
-
async refreshTailMetrics() {
|
|
1237
|
-
if (this.state !== "live"
|
|
1241
|
+
async refreshTailMetrics(attempt = 0) {
|
|
1242
|
+
if (this.state !== "live") return;
|
|
1238
1243
|
const token = this.token;
|
|
1239
1244
|
try {
|
|
1240
1245
|
const page = await this.driver.fetchAgentTimeline(this.agentId, {
|
|
1241
1246
|
direction: "tail",
|
|
1242
|
-
limit:
|
|
1247
|
+
limit: 12,
|
|
1243
1248
|
projection: "projected",
|
|
1244
1249
|
wholeTurns: false
|
|
1245
1250
|
});
|
|
1246
1251
|
if (token !== this.token || this.state !== "live" || page.epoch !== this.epoch) return;
|
|
1247
1252
|
let updated = false;
|
|
1253
|
+
let latestHasMetrics = false;
|
|
1254
|
+
const latestAssistant = [...page.entries].reverse().find((e) => e.item.type === "assistant_message" || e.item.type === "tool_call");
|
|
1248
1255
|
for (const entry of page.entries) {
|
|
1249
1256
|
if (!entry.turnMetrics?.length) continue;
|
|
1250
|
-
|
|
1257
|
+
if (latestAssistant && entry.seqStart === latestAssistant.seqStart) latestHasMetrics = true;
|
|
1258
|
+
const existing = this.bySeqStart.get(entry.seqStart) ?? this.rows.find((r) => r.seqStart <= entry.seqEnd && r.seqEnd >= entry.seqStart);
|
|
1251
1259
|
if (!existing) continue;
|
|
1252
1260
|
if (JSON.stringify(existing.turnMetrics ?? null) === JSON.stringify(entry.turnMetrics)) continue;
|
|
1253
1261
|
existing.turnMetrics = entry.turnMetrics;
|
|
1262
|
+
this.metricsTouched.add(existing.seqStart);
|
|
1263
|
+
if (this.metricsTouched.size > 16) {
|
|
1264
|
+
const oldest = this.metricsTouched.values().next().value;
|
|
1265
|
+
if (oldest !== void 0) this.metricsTouched.delete(oldest);
|
|
1266
|
+
}
|
|
1254
1267
|
this.mark(existing.seqStart, true);
|
|
1255
1268
|
updated = true;
|
|
1256
1269
|
}
|
|
1257
1270
|
if (updated) this.flush();
|
|
1271
|
+
if (!latestHasMetrics && attempt < 2) setTimeout(() => void this.refreshTailMetrics(attempt + 1), attempt === 0 ? 600 : 1500).unref?.();
|
|
1258
1272
|
} catch {}
|
|
1259
1273
|
}
|
|
1260
1274
|
broadcast(ops) {
|
|
@@ -4953,7 +4967,14 @@ function registerAgentRoutes(app, { hosts }) {
|
|
|
4953
4967
|
featureValues: z.record(z.string(), z.unknown()).optional(),
|
|
4954
4968
|
prompt: z.string().max(1e5).optional(),
|
|
4955
4969
|
worktreeBranch: z.string().trim().min(1).max(200).optional(),
|
|
4956
|
-
workspaceId: z.string().trim().min(1).max(200).optional()
|
|
4970
|
+
workspaceId: z.string().trim().min(1).max(200).optional(),
|
|
4971
|
+
attachments: z.array(z.object({
|
|
4972
|
+
id: z.string().max(200).optional(),
|
|
4973
|
+
filename: z.string().min(1).max(300),
|
|
4974
|
+
mimeType: z.literal("text/plain"),
|
|
4975
|
+
title: z.string().max(300).nullable().optional(),
|
|
4976
|
+
text: z.string().max(5e5)
|
|
4977
|
+
})).max(5).optional()
|
|
4957
4978
|
}).parse(await c.req.json());
|
|
4958
4979
|
const hostId = c.req.param("host");
|
|
4959
4980
|
const { api, driver } = hosts.get(hostId);
|
|
@@ -4973,7 +4994,8 @@ function registerAgentRoutes(app, { hosts }) {
|
|
|
4973
4994
|
...input.featureValues ? { featureValues: input.featureValues } : {},
|
|
4974
4995
|
...input.modeId ? { modeId: input.modeId } : {},
|
|
4975
4996
|
...input.thinkingOptionId ? { thinkingOptionId: input.thinkingOptionId } : {},
|
|
4976
|
-
...input.prompt?.trim() ? { initialPrompt: input.prompt } : {}
|
|
4997
|
+
...input.prompt?.trim() ? { initialPrompt: input.prompt } : {},
|
|
4998
|
+
...input.attachments?.length ? { attachments: input.attachments } : {}
|
|
4977
4999
|
}) : await api.agents.create({
|
|
4978
5000
|
idempotencyKey: input.idempotencyKey,
|
|
4979
5001
|
cwd: input.cwd,
|
|
@@ -4984,6 +5006,7 @@ function registerAgentRoutes(app, { hosts }) {
|
|
|
4984
5006
|
...input.thinkingOptionId ? { thinkingOptionId: input.thinkingOptionId } : {}
|
|
4985
5007
|
},
|
|
4986
5008
|
...input.prompt?.trim() ? { prompt: input.prompt } : {},
|
|
5009
|
+
...input.attachments?.length ? { attachments: input.attachments } : {},
|
|
4987
5010
|
...input.worktreeBranch ? { worktree: {
|
|
4988
5011
|
mode: "branch-off",
|
|
4989
5012
|
newBranch: input.worktreeBranch
|
|
@@ -4997,6 +5020,20 @@ function registerAgentRoutes(app, { hosts }) {
|
|
|
4997
5020
|
return c.json({ error: error instanceof Error && error.message ? `Could not start the session: ${error.message}` : "Creation outcome unknown. Check the session list before retrying." }, 502);
|
|
4998
5021
|
}
|
|
4999
5022
|
});
|
|
5023
|
+
app.post("/api/hosts/:host/agents/:agent/fork-context", async (c) => {
|
|
5024
|
+
const { driver } = hosts.get(c.req.param("host"));
|
|
5025
|
+
if (typeof driver.buildAgentForkContext !== "function") return c.json({ error: "This host does not support forking conversations." }, 409);
|
|
5026
|
+
try {
|
|
5027
|
+
const res = await driver.buildAgentForkContext(c.req.param("agent"));
|
|
5028
|
+
if (res.error) return c.json({ error: res.error }, 409);
|
|
5029
|
+
return c.json({
|
|
5030
|
+
attachment: res.attachment ?? null,
|
|
5031
|
+
itemCount: res.itemCount ?? 0
|
|
5032
|
+
});
|
|
5033
|
+
} catch (error) {
|
|
5034
|
+
return c.json({ error: errorMessage(error, "Could not build fork context.") }, 502);
|
|
5035
|
+
}
|
|
5036
|
+
});
|
|
5000
5037
|
const mapCommands = (commands) => commands.map((cmd) => ({
|
|
5001
5038
|
name: cmd.name,
|
|
5002
5039
|
description: cmd.description ?? "",
|
|
@@ -5995,6 +6032,75 @@ function registerProjectRoutes(app, { hosts, fetch }) {
|
|
|
5995
6032
|
return c.json({ error: errorMessage(error, "Could not restore workspace.") }, 409);
|
|
5996
6033
|
}
|
|
5997
6034
|
});
|
|
6035
|
+
const LABEL_COLORS = [
|
|
6036
|
+
"violet",
|
|
6037
|
+
"sky",
|
|
6038
|
+
"emerald",
|
|
6039
|
+
"orange",
|
|
6040
|
+
"pink",
|
|
6041
|
+
"indigo",
|
|
6042
|
+
"teal",
|
|
6043
|
+
"red",
|
|
6044
|
+
"amber",
|
|
6045
|
+
"blue"
|
|
6046
|
+
];
|
|
6047
|
+
app.get("/api/hosts/:host/labels", async (c) => {
|
|
6048
|
+
const { driver } = hosts.get(c.req.param("host"));
|
|
6049
|
+
if (typeof driver.listWorkspaceLabels !== "function") return c.json({ labels: [] });
|
|
6050
|
+
try {
|
|
6051
|
+
const res = await driver.listWorkspaceLabels();
|
|
6052
|
+
return c.json({ labels: res.labels ?? [] });
|
|
6053
|
+
} catch (error) {
|
|
6054
|
+
return c.json({ error: errorMessage(error, "Could not list workspace labels.") }, 502);
|
|
6055
|
+
}
|
|
6056
|
+
});
|
|
6057
|
+
app.post("/api/hosts/:host/workspaces/:workspace/labels", async (c) => {
|
|
6058
|
+
const input = z.object({
|
|
6059
|
+
name: z.string().trim().min(1).max(60),
|
|
6060
|
+
color: z.enum(LABEL_COLORS).optional(),
|
|
6061
|
+
assigned: z.boolean()
|
|
6062
|
+
}).parse(await c.req.json());
|
|
6063
|
+
const { driver, id } = workspace(c);
|
|
6064
|
+
if (typeof driver.setWorkspaceLabel !== "function") return c.json({ error: "Workspace labels are unsupported on this host." }, 409);
|
|
6065
|
+
try {
|
|
6066
|
+
const res = await driver.setWorkspaceLabel({
|
|
6067
|
+
workspaceId: id,
|
|
6068
|
+
label: {
|
|
6069
|
+
name: input.name,
|
|
6070
|
+
color: input.color ?? "blue"
|
|
6071
|
+
},
|
|
6072
|
+
assigned: input.assigned
|
|
6073
|
+
});
|
|
6074
|
+
return c.json(res);
|
|
6075
|
+
} catch (error) {
|
|
6076
|
+
return c.json({ error: errorMessage(error, "Could not update workspace label.") }, 502);
|
|
6077
|
+
}
|
|
6078
|
+
});
|
|
6079
|
+
app.patch("/api/hosts/:host/labels/:name", async (c) => {
|
|
6080
|
+
const input = z.object({
|
|
6081
|
+
newName: z.string().trim().min(1).max(60).optional(),
|
|
6082
|
+
color: z.enum(LABEL_COLORS).optional()
|
|
6083
|
+
}).parse(await c.req.json());
|
|
6084
|
+
const { driver } = hosts.get(c.req.param("host"));
|
|
6085
|
+
if (typeof driver.updateWorkspaceLabel !== "function") return c.json({ error: "Workspace labels are unsupported on this host." }, 409);
|
|
6086
|
+
try {
|
|
6087
|
+
return c.json(await driver.updateWorkspaceLabel({
|
|
6088
|
+
name: c.req.param("name"),
|
|
6089
|
+
...input
|
|
6090
|
+
}));
|
|
6091
|
+
} catch (error) {
|
|
6092
|
+
return c.json({ error: errorMessage(error, "Could not update label.") }, 502);
|
|
6093
|
+
}
|
|
6094
|
+
});
|
|
6095
|
+
app.delete("/api/hosts/:host/labels/:name", async (c) => {
|
|
6096
|
+
const { driver } = hosts.get(c.req.param("host"));
|
|
6097
|
+
if (typeof driver.deleteWorkspaceLabel !== "function") return c.json({ error: "Workspace labels are unsupported on this host." }, 409);
|
|
6098
|
+
try {
|
|
6099
|
+
return c.json(await driver.deleteWorkspaceLabel({ name: c.req.param("name") }));
|
|
6100
|
+
} catch (error) {
|
|
6101
|
+
return c.json({ error: errorMessage(error, "Could not delete label.") }, 502);
|
|
6102
|
+
}
|
|
6103
|
+
});
|
|
5998
6104
|
app.get("/api/hosts/:host/archived-workspaces", async (c) => {
|
|
5999
6105
|
const hostId = c.req.param("host");
|
|
6000
6106
|
const q = z.string().max(200).optional().parse(c.req.query("q") || void 0);
|
|
@@ -6540,6 +6646,7 @@ function registerBoardRoutes(app, { store }) {
|
|
|
6540
6646
|
// src/server/workspace-routes.ts
|
|
6541
6647
|
/** Text files larger than this open truncated: the viewer is for reading, not for dumps. */
|
|
6542
6648
|
const MAX_TEXT_BYTES = 1048576;
|
|
6649
|
+
const MAX_DOWNLOAD_BYTES = 33554432;
|
|
6543
6650
|
const MAX_ENTRIES = 2e3;
|
|
6544
6651
|
const SEARCH_CACHE_MS = 15e3;
|
|
6545
6652
|
const SEARCH_MAX_FILES = 1500;
|
|
@@ -6611,10 +6718,149 @@ function registerWorkspaceRoutes(app, { hosts, store, streamValidity, encodingOf
|
|
|
6611
6718
|
}
|
|
6612
6719
|
app.get("/api/hosts/:host/changes", async (c) => {
|
|
6613
6720
|
const cwd = hostPath.parse(c.req.query("cwd"));
|
|
6614
|
-
const
|
|
6721
|
+
const mode = z.enum([
|
|
6722
|
+
"uncommitted",
|
|
6723
|
+
"base",
|
|
6724
|
+
"all"
|
|
6725
|
+
]).catch("uncommitted").parse(c.req.query("mode"));
|
|
6726
|
+
const baseRef = z.string().trim().min(1).max(200).optional().parse(c.req.query("baseRef") || void 0);
|
|
6727
|
+
const result = await hosts.get(c.req.param("host")).driver.getCheckoutDiff(cwd, {
|
|
6728
|
+
mode,
|
|
6729
|
+
...baseRef ? { baseRef } : {}
|
|
6730
|
+
});
|
|
6615
6731
|
if (result.error) return c.json({ error: result.error.message }, 409);
|
|
6616
6732
|
return c.json(result);
|
|
6617
6733
|
});
|
|
6734
|
+
app.get("/api/hosts/:host/git/commits", async (c) => {
|
|
6735
|
+
const cwd = hostPath.parse(c.req.query("cwd"));
|
|
6736
|
+
const { driver } = hosts.get(c.req.param("host"));
|
|
6737
|
+
if (typeof driver.listCheckoutCommits !== "function") return c.json({
|
|
6738
|
+
baseRef: null,
|
|
6739
|
+
commits: []
|
|
6740
|
+
});
|
|
6741
|
+
try {
|
|
6742
|
+
return c.json(await driver.listCheckoutCommits(cwd));
|
|
6743
|
+
} catch (error) {
|
|
6744
|
+
return c.json({ error: errorMessage(error, "Could not load commits") }, 502);
|
|
6745
|
+
}
|
|
6746
|
+
});
|
|
6747
|
+
app.get("/api/hosts/:host/git/commit-diff", async (c) => {
|
|
6748
|
+
const cwd = hostPath.parse(c.req.query("cwd"));
|
|
6749
|
+
const sha = z.string().trim().min(4).max(80).regex(/^[0-9a-fA-F]+$/).parse(c.req.query("sha"));
|
|
6750
|
+
const filePath = hostPath.parse(c.req.query("path"));
|
|
6751
|
+
const { driver } = hosts.get(c.req.param("host"));
|
|
6752
|
+
if (typeof driver.getCommitFileDiff !== "function") return c.json({ error: "Commit diff unsupported on this host" }, 409);
|
|
6753
|
+
try {
|
|
6754
|
+
return c.json(await driver.getCommitFileDiff(cwd, sha, filePath));
|
|
6755
|
+
} catch (error) {
|
|
6756
|
+
return c.json({ error: errorMessage(error, "Could not load commit diff") }, 502);
|
|
6757
|
+
}
|
|
6758
|
+
});
|
|
6759
|
+
app.post("/api/hosts/:host/git/commit", async (c) => {
|
|
6760
|
+
const input = z.object({
|
|
6761
|
+
cwd: hostPath,
|
|
6762
|
+
message: z.string().max(4e3).optional(),
|
|
6763
|
+
addAll: z.boolean().optional()
|
|
6764
|
+
}).parse(await c.req.json());
|
|
6765
|
+
const { driver } = hosts.get(c.req.param("host"));
|
|
6766
|
+
try {
|
|
6767
|
+
const res = await driver.checkoutCommit(input.cwd, {
|
|
6768
|
+
...input.message?.trim() ? { message: input.message.trim() } : {},
|
|
6769
|
+
addAll: input.addAll !== false
|
|
6770
|
+
});
|
|
6771
|
+
if (res.error) return c.json({ error: res.error.message || "Commit failed" }, 409);
|
|
6772
|
+
return c.json(res);
|
|
6773
|
+
} catch (error) {
|
|
6774
|
+
return c.json({ error: errorMessage(error, "Commit failed") }, 502);
|
|
6775
|
+
}
|
|
6776
|
+
});
|
|
6777
|
+
app.post("/api/hosts/:host/git/push", async (c) => {
|
|
6778
|
+
const { cwd } = z.object({ cwd: hostPath }).parse(await c.req.json());
|
|
6779
|
+
const { driver } = hosts.get(c.req.param("host"));
|
|
6780
|
+
try {
|
|
6781
|
+
const res = await driver.checkoutPush(cwd);
|
|
6782
|
+
if (res.error) return c.json({ error: res.error.message || "Push failed" }, 409);
|
|
6783
|
+
return c.json(res);
|
|
6784
|
+
} catch (error) {
|
|
6785
|
+
return c.json({ error: errorMessage(error, "Push failed") }, 502);
|
|
6786
|
+
}
|
|
6787
|
+
});
|
|
6788
|
+
app.get("/api/hosts/:host/git/pr-status", async (c) => {
|
|
6789
|
+
const cwd = hostPath.parse(c.req.query("cwd"));
|
|
6790
|
+
const { driver } = hosts.get(c.req.param("host"));
|
|
6791
|
+
if (typeof driver.checkoutPrStatus !== "function") return c.json({ available: false });
|
|
6792
|
+
try {
|
|
6793
|
+
return c.json(await driver.checkoutPrStatus(cwd));
|
|
6794
|
+
} catch (error) {
|
|
6795
|
+
return c.json({ error: errorMessage(error, "PR status unavailable") }, 502);
|
|
6796
|
+
}
|
|
6797
|
+
});
|
|
6798
|
+
app.post("/api/hosts/:host/git/pr", async (c) => {
|
|
6799
|
+
const input = z.object({
|
|
6800
|
+
cwd: hostPath,
|
|
6801
|
+
title: z.string().max(300).optional(),
|
|
6802
|
+
body: z.string().max(2e4).optional(),
|
|
6803
|
+
baseRef: z.string().max(200).optional()
|
|
6804
|
+
}).parse(await c.req.json());
|
|
6805
|
+
const { driver } = hosts.get(c.req.param("host"));
|
|
6806
|
+
try {
|
|
6807
|
+
const res = await driver.checkoutPrCreate(input.cwd, {
|
|
6808
|
+
...input.title?.trim() ? { title: input.title.trim() } : {},
|
|
6809
|
+
...input.body?.trim() ? { body: input.body.trim() } : {},
|
|
6810
|
+
...input.baseRef?.trim() ? { baseRef: input.baseRef.trim() } : {}
|
|
6811
|
+
});
|
|
6812
|
+
if (res.error) return c.json({ error: res.error.message || "Could not create PR" }, 409);
|
|
6813
|
+
return c.json(res);
|
|
6814
|
+
} catch (error) {
|
|
6815
|
+
return c.json({ error: errorMessage(error, "Could not create PR") }, 502);
|
|
6816
|
+
}
|
|
6817
|
+
});
|
|
6818
|
+
app.post("/api/hosts/:host/workspaces/:workspace/base-branch", async (c) => {
|
|
6819
|
+
const { baseRef } = z.object({ baseRef: z.string().trim().min(1).max(200) }).parse(await c.req.json());
|
|
6820
|
+
const { driver } = hosts.get(c.req.param("host"));
|
|
6821
|
+
if (typeof driver.setWorkspaceBaseBranch !== "function") return c.json({ error: "Base branch setting unsupported" }, 409);
|
|
6822
|
+
try {
|
|
6823
|
+
return c.json(await driver.setWorkspaceBaseBranch({
|
|
6824
|
+
workspaceId: c.req.param("workspace"),
|
|
6825
|
+
baseRef
|
|
6826
|
+
}));
|
|
6827
|
+
} catch (error) {
|
|
6828
|
+
return c.json({ error: errorMessage(error, "Could not set base branch") }, 502);
|
|
6829
|
+
}
|
|
6830
|
+
});
|
|
6831
|
+
app.get("/api/hosts/:host/workspaces/:workspace/scripts", async (c) => {
|
|
6832
|
+
const { driver } = hosts.get(c.req.param("host"));
|
|
6833
|
+
if (typeof driver.listWorkspaceScripts !== "function") return c.json({ scripts: [] });
|
|
6834
|
+
try {
|
|
6835
|
+
const res = await driver.listWorkspaceScripts(c.req.param("workspace"));
|
|
6836
|
+
if (res.error) return c.json({ error: res.error }, 502);
|
|
6837
|
+
return c.json({ scripts: res.scripts ?? [] });
|
|
6838
|
+
} catch (error) {
|
|
6839
|
+
return c.json({ error: errorMessage(error, "Could not list scripts") }, 502);
|
|
6840
|
+
}
|
|
6841
|
+
});
|
|
6842
|
+
app.post("/api/hosts/:host/workspaces/:workspace/scripts/:name/start", async (c) => {
|
|
6843
|
+
const { driver } = hosts.get(c.req.param("host"));
|
|
6844
|
+
const wsId = c.req.param("workspace"), name = c.req.param("name");
|
|
6845
|
+
try {
|
|
6846
|
+
const res = typeof driver.startWorkspaceScriptWithStatus === "function" ? await driver.startWorkspaceScriptWithStatus(wsId, name) : await driver.startWorkspaceScript(wsId, name);
|
|
6847
|
+
if (res.error) return c.json({ error: res.error }, 409);
|
|
6848
|
+
return c.json(res);
|
|
6849
|
+
} catch (error) {
|
|
6850
|
+
return c.json({ error: errorMessage(error, "Could not start script") }, 502);
|
|
6851
|
+
}
|
|
6852
|
+
});
|
|
6853
|
+
app.post("/api/hosts/:host/workspaces/:workspace/scripts/:name/stop", async (c) => {
|
|
6854
|
+
const { driver } = hosts.get(c.req.param("host"));
|
|
6855
|
+
if (typeof driver.stopWorkspaceScript !== "function") return c.json({ error: "Stopping scripts is unsupported on this host" }, 409);
|
|
6856
|
+
try {
|
|
6857
|
+
const res = await driver.stopWorkspaceScript(c.req.param("workspace"), c.req.param("name"));
|
|
6858
|
+
if (res.error) return c.json({ error: res.error }, 409);
|
|
6859
|
+
return c.json(res);
|
|
6860
|
+
} catch (error) {
|
|
6861
|
+
return c.json({ error: errorMessage(error, "Could not stop script") }, 502);
|
|
6862
|
+
}
|
|
6863
|
+
});
|
|
6618
6864
|
app.get("/api/hosts/:host/fs/search", async (c) => {
|
|
6619
6865
|
const hostId = c.req.param("host");
|
|
6620
6866
|
const cwd = hostPath.parse(c.req.query("cwd"));
|
|
@@ -6695,6 +6941,25 @@ function registerWorkspaceRoutes(app, { hosts, store, streamValidity, encodingOf
|
|
|
6695
6941
|
return c.json({ error: errorMessage(error, "File unavailable") }, 404);
|
|
6696
6942
|
}
|
|
6697
6943
|
});
|
|
6944
|
+
app.get("/api/hosts/:host/fs/download", async (c) => {
|
|
6945
|
+
const cwd = hostPath.parse(c.req.query("cwd"));
|
|
6946
|
+
const file = hostPath.parse(c.req.query("path"));
|
|
6947
|
+
const { driver } = hosts.get(c.req.param("host"));
|
|
6948
|
+
try {
|
|
6949
|
+
const result = await driver.readFile(cwd, file, void 0, 33554433);
|
|
6950
|
+
if (result.size > MAX_DOWNLOAD_BYTES) return c.json({ error: "File exceeds 32 MB download limit" }, 413);
|
|
6951
|
+
const rawName = (result.path.split("/").pop() || "download").replace(/[\r\n"\\]/g, "_");
|
|
6952
|
+
const encoded = encodeURIComponent(rawName);
|
|
6953
|
+
return c.body(result.bytes, 200, {
|
|
6954
|
+
"Content-Type": result.mime || "application/octet-stream",
|
|
6955
|
+
"Content-Disposition": `attachment; filename="${rawName}"; filename*=UTF-8''${encoded}`,
|
|
6956
|
+
"X-Content-Type-Options": "nosniff",
|
|
6957
|
+
"Cache-Control": "private, no-store"
|
|
6958
|
+
});
|
|
6959
|
+
} catch (error) {
|
|
6960
|
+
return c.json({ error: errorMessage(error, "File unavailable") }, 404);
|
|
6961
|
+
}
|
|
6962
|
+
});
|
|
6698
6963
|
app.get("/api/hosts/:host/fs/raw", async (c) => {
|
|
6699
6964
|
const cwd = hostPath.parse(c.req.query("cwd"));
|
|
6700
6965
|
const file = hostPath.parse(c.req.query("path"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as e,H as t,I as ee,Q as n,S as r,T as i,Y as te,c as a,ct as o,d as s,dt as c,f as l,g as u,h as ne,it as d,s as re,st as ie,v as f,y as p,z as m}from"./vue.runtime.esm-bundler-DmQNwI70.js";import{_ as h,g as ae,h as oe}from"./index
|
|
1
|
+
import{C as e,H as t,I as ee,Q as n,S as r,T as i,Y as te,c as a,ct as o,d as s,dt as c,f as l,g as u,h as ne,it as d,s as re,st as ie,v as f,y as p,z as m}from"./vue.runtime.esm-bundler-DmQNwI70.js";import{_ as h,g as ae,h as oe}from"./index--Rpf_YJs.js";var se={class:`sheet-head`},g={class:`add-project-body`},ce={key:0,class:`field`},le=[`value`],ue={class:`segmented segmented-sm`,role:`tablist`},de=[`aria-selected`],fe=[`aria-selected`],pe={key:1,class:`setting-note is-error`,role:`alert`},me={class:`field`},he=[`disabled`],ge={class:`form-actions`},_e=[`disabled`],ve={key:0,class:`add-project-suggestions`},ye={key:0,class:`subtle`},be=[`disabled`,`onClick`],_={class:`grow`},v={class:`row-title`},y={class:`row-sub mono`},b=[`disabled`],x={key:0,class:`add-project-suggestions`},S=[`onClick`],C={class:`grow`},w={class:`row-title`},T={key:0,class:`hs-tag`},E={key:0,class:`row-sub`},D={class:`field`},O=[`disabled`],k={class:`field`},A=[`disabled`],j={class:`segmented segmented-sm`},M={class:`form-actions`},N=[`disabled`],P=i({__name:`AddProjectDialog`,props:{hosts:{},initialHostId:{},api:{type:Function}},emits:[`close`,`added`],setup(i,{emit:P}){let F=i,I=P,L=d(null);ae(L,()=>I(`close`));let R=ne(()=>F.hosts.filter(e=>e.state===`connected`)),z=d(R.value.find(e=>e.id===F.initialHostId)?.id??R.value[0]?.id??``),B=d(`path`),V=d(``),H=d([]),U=d(!1),W=d(!1),G=d(``),K=d(``),q=d([]),J=d(!1),Y=d(``),X=d(``),Z=d(`ssh`);async function Q(){if(z.value){U.value=!0;try{let e=await F.api(`/hosts/${encodeURIComponent(z.value)}/project-suggestions`);H.value=(e.suggestions??[]).map(e=>({path:e.path??e.rootPath??e.cwd??``,name:e.name??e.displayName})).filter(e=>!!e.path)}catch{H.value=[]}finally{U.value=!1}}}te(z,()=>{H.value=[],Q()},{immediate:!0});async function $(e){let t=(e??V.value).trim();if(z.value&&t){W.value=!0,G.value=``;try{await F.api(`/hosts/${encodeURIComponent(z.value)}/projects`,`POST`,{cwd:t}),I(`added`,z.value,t),I(`close`)}catch(e){G.value=e.message||`Could not add project.`}finally{W.value=!1}}}async function xe(){if(z.value&&K.value.trim()){J.value=!0,G.value=``;try{let e=await F.api(`/hosts/${encodeURIComponent(z.value)}/github/search?q=${encodeURIComponent(K.value.trim())}`);q.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){G.value=e.message||`Could not search GitHub.`}finally{J.value=!1}}}async function Se(){if(z.value&&Y.value.trim()&&X.value.trim()){W.value=!0,G.value=``;try{let e=await F.api(`/hosts/${encodeURIComponent(z.value)}/projects/clone`,`POST`,{repo:Y.value.trim(),targetDirectory:X.value.trim(),cloneProtocol:Z.value},12e4);I(`added`,z.value,e.path||X.value.trim()),I(`close`)}catch(e){G.value=e.message||`Could not clone repository.`}finally{W.value=!1}}}return ee(()=>void Q()),(ee,i)=>(m(),p(`div`,{class:`overlay`,onMousedown:i[13]||=s(e=>I(`close`),[`self`])},[u(`section`,{ref_key:`sheet`,ref:L,class:`sheet add-project-sheet`,role:`dialog`,"aria-modal":`true`,"aria-label":`Add project`,tabindex:`-1`},[u(`header`,se,[i[14]||=u(`h2`,null,`Add project`,-1),u(`button`,{type:`button`,class:`icon-btn`,"aria-label":`Close`,onClick:i[0]||=e=>I(`close`)},[e(h,{name:`close`,size:16})])]),u(`div`,g,[R.value.length>1?(m(),p(`label`,ce,[i[15]||=u(`span`,null,`Host`,-1),n(u(`select`,{"onUpdate:modelValue":i[1]||=e=>z.value=e},[(m(!0),p(l,null,t(R.value,e=>(m(),p(`option`,{key:e.id,value:e.id},c(e.label),9,le))),128))],512),[[re,z.value]])])):f(``,!0),u(`div`,ue,[u(`button`,{type:`button`,role:`tab`,"aria-selected":B.value===`path`,class:o({chosen:B.value===`path`}),onClick:i[2]||=e=>B.value=`path`},`Host directory`,10,de),u(`button`,{type:`button`,role:`tab`,"aria-selected":B.value===`github`,class:o({chosen:B.value===`github`}),onClick:i[3]||=e=>B.value=`github`},`Clone from GitHub`,10,fe)]),G.value?(m(),p(`p`,pe,c(G.value),1)):f(``,!0),B.value===`path`?(m(),p(l,{key:2},[u(`form`,{class:`add-project-form`,onSubmit:i[6]||=s(e=>$(),[`prevent`])},[u(`label`,me,[i[16]||=u(`span`,null,`Directory path on host`,-1),n(u(`input`,{"onUpdate:modelValue":i[4]||=e=>V.value=e,placeholder:`/home/user/code/my-repo`,disabled:W.value,autofocus:``},null,8,he),[[a,V.value]])]),u(`div`,ge,[u(`button`,{type:`button`,class:`btn btn-ghost`,onClick:i[5]||=e=>I(`close`)},`Cancel`),u(`button`,{type:`submit`,class:`btn btn-primary`,disabled:W.value||!V.value.trim()},c(W.value?`Adding…`:`Add project`),9,_e)])],32),H.value.length||U.value?(m(),p(`div`,ve,[i[19]||=u(`span`,{class:`subtle`},`Recent repositories on this host`,-1),U.value&&!H.value.length?(m(),p(`p`,ye,[...i[17]||=[u(`span`,{class:`spinner spinner-sm`},null,-1),r(` Loading…`,-1)]])):f(``,!0),(m(!0),p(l,null,t(H.value.slice(0,10),t=>(m(),p(`button`,{key:t.path,type:`button`,class:`suggestion-row`,disabled:W.value,onClick:e=>$(t.path)},[e(h,{name:`folder`,size:14}),u(`span`,_,[u(`span`,v,c(t.name||t.path.split(`/`).pop()),1),u(`span`,y,c(ie(oe)(t.path)),1)]),i[18]||=u(`span`,{class:`row-sub`},`Add`,-1)],8,be))),128))])):f(``,!0)],64)):(m(),p(l,{key:3},[u(`form`,{class:`archived-search`,onSubmit:s(xe,[`prevent`])},[n(u(`input`,{"onUpdate:modelValue":i[7]||=e=>K.value=e,placeholder:`Search GitHub repos (owner/name or keyword)…`},null,512),[[a,K.value]]),u(`button`,{type:`submit`,class:`btn btn-sm btn-outline`,disabled:J.value||!K.value.trim()},c(J.value?`Searching…`:`Search`),9,b)],32),q.value.length?(m(),p(`div`,x,[(m(!0),p(l,null,t(q.value,t=>(m(),p(`button`,{key:t.fullName,type:`button`,class:o([`suggestion-row`,{chosen:Y.value===t.fullName}]),onClick:e=>Y.value=t.fullName},[e(h,{name:`branch`,size:14}),u(`span`,C,[u(`span`,w,[r(c(t.fullName)+` `,1),t.isPrivate?(m(),p(`small`,T,`private`)):f(``,!0)]),t.description?(m(),p(`span`,E,c(t.description),1)):f(``,!0)])],10,S))),128))])):f(``,!0),u(`form`,{class:`add-project-form`,onSubmit:s(Se,[`prevent`])},[u(`label`,D,[i[20]||=u(`span`,null,`Repository (owner/repo)`,-1),n(u(`input`,{"onUpdate:modelValue":i[8]||=e=>Y.value=e,placeholder:`owner/repo`,disabled:W.value},null,8,O),[[a,Y.value]])]),u(`label`,k,[i[21]||=u(`span`,null,`Target directory on host`,-1),n(u(`input`,{"onUpdate:modelValue":i[9]||=e=>X.value=e,placeholder:`/home/user/code/repo`,disabled:W.value},null,8,A),[[a,X.value]])]),u(`div`,j,[u(`button`,{type:`button`,class:o({chosen:Z.value===`ssh`}),onClick:i[10]||=e=>Z.value=`ssh`},`SSH`,2),u(`button`,{type:`button`,class:o({chosen:Z.value===`https`}),onClick:i[11]||=e=>Z.value=`https`},`HTTPS`,2)]),u(`div`,M,[u(`button`,{type:`button`,class:`btn btn-ghost`,onClick:i[12]||=e=>I(`close`)},`Cancel`),u(`button`,{type:`submit`,class:`btn btn-primary`,disabled:W.value||!Y.value.trim()||!X.value.trim()},c(W.value?`Cloning…`:`Clone & add`),9,N)])],32)],64))])],512)],32))}});export{P as default};
|
|
Binary file
|
|
Binary file
|
|
@@ -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
|
|
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--Rpf_YJs.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};
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.changes-panel[data-v-c13449c7]{flex-direction:column;gap:8px;height:100%;padding:12px;font-size:13px;display:flex;overflow:auto}.changes-top[data-v-c13449c7],.base-bar[data-v-c13449c7],.git-actions[data-v-c13449c7],.file-bar[data-v-c13449c7]{flex-wrap:wrap;align-items:center;gap:6px;display:flex}.base-bar input[data-v-c13449c7]{max-width:150px;padding:3px 8px;font-size:12px}.pr-bar[data-v-c13449c7]{border:1px solid var(--border);background:var(--surface-1);border-radius:10px;align-items:center;gap:8px;padding:6px 10px;display:flex}.pr-link[data-v-c13449c7]{color:var(--fg);flex:1;align-items:center;gap:5px;min-width:0;text-decoration:none;display:inline-flex}.pr-link[data-v-c13449c7]:hover{color:var(--accent)}.pr-title[data-v-c13449c7]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.pr-checks[data-v-c13449c7]{border-radius:999px;flex-shrink:0;padding:1px 6px;font-size:11px}.pr-checks.is-ok[data-v-c13449c7]{background:color-mix(in srgb, var(--unread) 16%, transparent);color:var(--unread)}.pr-checks.is-warn[data-v-c13449c7]{background:var(--warn-soft);color:var(--warn)}.pr-checks.is-danger[data-v-c13449c7]{background:color-mix(in srgb, var(--danger) 16%, transparent);color:var(--danger)}.git-form[data-v-c13449c7],.review-form[data-v-c13449c7]{border:1px solid var(--border);background:var(--surface-1);border-radius:10px;flex-direction:column;gap:6px;padding:8px;display:flex}.review-tray[data-v-c13449c7]{border:1px solid var(--accent);background:var(--accent-soft);border-radius:10px;flex-direction:column;gap:6px;padding:8px 10px;display:flex}.review-tray-head[data-v-c13449c7]{justify-content:space-between;align-items:center;gap:8px;display:flex}.review-chip[data-v-c13449c7]{align-items:center;gap:6px;font-size:12px;display:flex}details[data-v-c13449c7]{border-top:1px solid var(--border);padding-top:8px}summary[data-v-c13449c7]{cursor:pointer;overflow-wrap:anywhere;align-items:baseline;gap:6px;display:flex}.file-sum-path[data-v-c13449c7]{flex:1;min-width:0}.file-sum-stat[data-v-c13449c7]{font-family:var(--mono);flex-shrink:0;font-size:11.5px}.stat-add[data-v-c13449c7]{color:var(--unread);font-style:normal}.stat-del[data-v-c13449c7]{color:var(--danger);font-style:normal}.diff-hunk-block[data-v-c13449c7]{font-family:var(--mono);margin-top:6px;font-size:12px;overflow-x:auto}.diff-line[data-v-c13449c7]{white-space:pre;align-items:flex-start;display:flex}.diff-comment-btn[data-v-c13449c7]{width:18px;min-width:18px;color:var(--fg-faint);cursor:pointer;font-family:var(--mono);opacity:.35;background:0 0;border:0;padding:0}.diff-line:hover .diff-comment-btn[data-v-c13449c7],.diff-comment-btn[data-v-c13449c7]:focus-visible{opacity:1;color:var(--accent)}.diff-code[data-v-c13449c7]{flex:1}.add[data-v-c13449c7]{background:#2842}.remove[data-v-c13449c7]{background:#c332}.hunk[data-v-c13449c7]{color:var(--fg-muted);font-family:var(--mono);font-size:11.5px}pre[data-v-c13449c7]{margin:4px 0;font-size:12px;overflow:auto}code span[data-v-c13449c7]{white-space:pre;display:block}.commit-sha[data-v-c13449c7]{color:var(--accent);font-size:11.5px}.commit-subj[data-v-c13449c7]{text-overflow:ellipsis;white-space:nowrap;flex:1;overflow:hidden}.commit-file[data-v-c13449c7]{border-top:0;margin-left:10px;padding-top:4px}
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +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--Rpf_YJs.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)+` @@
|
|
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};
|
|
Binary file
|
|
Binary file
|