@lasso-ai/cli 1.3.2 → 1.3.4
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/dist/cli/agent.js +28 -1
- package/dist/cli/bridge.d.ts +22 -0
- package/dist/cli/bridge.js +268 -74
- package/dist/cli/oneshot.js +59 -43
- package/dist/cli/snapshot.d.ts +33 -0
- package/dist/cli/snapshot.js +225 -0
- package/dist/overlay.js +443 -2
- package/package.json +1 -2
package/dist/overlay.js
CHANGED
|
@@ -7837,7 +7837,7 @@
|
|
|
7837
7837
|
if (!name) return "?";
|
|
7838
7838
|
return name.split(/\s+/).filter(Boolean).slice(0, 2).map((part) => part[0]?.toUpperCase() || "").join("") || "?";
|
|
7839
7839
|
}
|
|
7840
|
-
function
|
|
7840
|
+
function timeAgo2(value2) {
|
|
7841
7841
|
if (!value2) return "";
|
|
7842
7842
|
const ms = new Date(value2).getTime();
|
|
7843
7843
|
if (!Number.isFinite(ms)) return "";
|
|
@@ -7945,6 +7945,8 @@
|
|
|
7945
7945
|
collabHeartbeat = null;
|
|
7946
7946
|
activityTimer = null;
|
|
7947
7947
|
spotlightTimer = null;
|
|
7948
|
+
// Timeline/Snapshot History
|
|
7949
|
+
timelineSnapshots = [];
|
|
7948
7950
|
constructor() {
|
|
7949
7951
|
const saved = storedModelId();
|
|
7950
7952
|
if (saved) {
|
|
@@ -10548,6 +10550,276 @@
|
|
|
10548
10550
|
background: var(--lo-primary-hover);
|
|
10549
10551
|
}
|
|
10550
10552
|
|
|
10553
|
+
.lasso-review-history {
|
|
10554
|
+
margin-right: auto;
|
|
10555
|
+
font-size: 11px;
|
|
10556
|
+
color: var(--lo-text-2);
|
|
10557
|
+
}
|
|
10558
|
+
|
|
10559
|
+
/* ==========================================================
|
|
10560
|
+
CONFLICT PANEL
|
|
10561
|
+
========================================================== */
|
|
10562
|
+
|
|
10563
|
+
.lasso-conflict {
|
|
10564
|
+
position: fixed;
|
|
10565
|
+
width: min(540px, calc(100vw - 24px));
|
|
10566
|
+
max-height: min(400px, calc(100vh - 24px));
|
|
10567
|
+
overflow: auto;
|
|
10568
|
+
padding: 18px;
|
|
10569
|
+
border: 1px solid #f59e0b;
|
|
10570
|
+
border-radius: var(--lo-radius-xl);
|
|
10571
|
+
background: rgba(30, 27, 22, 0.98);
|
|
10572
|
+
backdrop-filter: blur(24px);
|
|
10573
|
+
-webkit-backdrop-filter: blur(24px);
|
|
10574
|
+
color: var(--lo-text);
|
|
10575
|
+
box-shadow: 0 20px 48px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(245, 158, 11, 0.2);
|
|
10576
|
+
pointer-events: auto;
|
|
10577
|
+
font-family: inherit;
|
|
10578
|
+
z-index: 25;
|
|
10579
|
+
}
|
|
10580
|
+
|
|
10581
|
+
.lasso-conflict[hidden] {
|
|
10582
|
+
display: none;
|
|
10583
|
+
}
|
|
10584
|
+
|
|
10585
|
+
.lasso-conflict-header {
|
|
10586
|
+
display: flex;
|
|
10587
|
+
align-items: flex-start;
|
|
10588
|
+
justify-content: space-between;
|
|
10589
|
+
gap: 16px;
|
|
10590
|
+
margin-bottom: 14px;
|
|
10591
|
+
}
|
|
10592
|
+
|
|
10593
|
+
.lasso-conflict-title {
|
|
10594
|
+
margin: 0;
|
|
10595
|
+
font-size: 15px;
|
|
10596
|
+
font-weight: 700;
|
|
10597
|
+
color: #f59e0b;
|
|
10598
|
+
}
|
|
10599
|
+
|
|
10600
|
+
.lasso-conflict-subtitle {
|
|
10601
|
+
margin: 4px 0 0;
|
|
10602
|
+
color: var(--lo-text-2);
|
|
10603
|
+
font-size: 12px;
|
|
10604
|
+
line-height: 1.4;
|
|
10605
|
+
}
|
|
10606
|
+
|
|
10607
|
+
.lasso-conflict-close {
|
|
10608
|
+
border: 0;
|
|
10609
|
+
background: transparent;
|
|
10610
|
+
color: var(--lo-text-3);
|
|
10611
|
+
font-size: 18px;
|
|
10612
|
+
cursor: pointer;
|
|
10613
|
+
}
|
|
10614
|
+
|
|
10615
|
+
.lasso-conflict-close:hover {
|
|
10616
|
+
color: var(--lo-text);
|
|
10617
|
+
}
|
|
10618
|
+
|
|
10619
|
+
.lasso-conflict-file {
|
|
10620
|
+
margin-top: 10px;
|
|
10621
|
+
overflow: hidden;
|
|
10622
|
+
border: 1px solid var(--lo-border);
|
|
10623
|
+
border-radius: var(--lo-radius-md);
|
|
10624
|
+
}
|
|
10625
|
+
|
|
10626
|
+
.lasso-conflict-file-name {
|
|
10627
|
+
padding: 8px 10px;
|
|
10628
|
+
background: rgba(245, 158, 11, 0.1);
|
|
10629
|
+
color: #f59e0b;
|
|
10630
|
+
font: 600 11px/1.2 var(--lo-font-mono);
|
|
10631
|
+
}
|
|
10632
|
+
|
|
10633
|
+
.lasso-conflict-details {
|
|
10634
|
+
padding: 10px;
|
|
10635
|
+
font-size: 11px;
|
|
10636
|
+
color: var(--lo-text-2);
|
|
10637
|
+
}
|
|
10638
|
+
|
|
10639
|
+
.lasso-conflict-hash {
|
|
10640
|
+
display: flex;
|
|
10641
|
+
flex-direction: column;
|
|
10642
|
+
gap: 4px;
|
|
10643
|
+
font-family: var(--lo-font-mono);
|
|
10644
|
+
}
|
|
10645
|
+
|
|
10646
|
+
.lasso-conflict-actions {
|
|
10647
|
+
display: flex;
|
|
10648
|
+
justify-content: flex-end;
|
|
10649
|
+
gap: 8px;
|
|
10650
|
+
margin-top: 16px;
|
|
10651
|
+
}
|
|
10652
|
+
|
|
10653
|
+
.lasso-conflict-actions button {
|
|
10654
|
+
min-height: 34px;
|
|
10655
|
+
padding: 0 14px;
|
|
10656
|
+
border: 1px solid var(--lo-border);
|
|
10657
|
+
border-radius: var(--lo-radius-md);
|
|
10658
|
+
background: var(--lo-surface-2);
|
|
10659
|
+
color: var(--lo-text);
|
|
10660
|
+
font: 600 12px/1 inherit;
|
|
10661
|
+
cursor: pointer;
|
|
10662
|
+
transition: background 120ms ease, transform 120ms ease;
|
|
10663
|
+
}
|
|
10664
|
+
|
|
10665
|
+
.lasso-conflict-actions button:hover {
|
|
10666
|
+
background: var(--lo-surface-hover);
|
|
10667
|
+
transform: translateY(-1px);
|
|
10668
|
+
}
|
|
10669
|
+
|
|
10670
|
+
.lasso-conflict-force {
|
|
10671
|
+
border-color: #f59e0b;
|
|
10672
|
+
background: rgba(245, 158, 11, 0.1);
|
|
10673
|
+
color: #f59e0b;
|
|
10674
|
+
}
|
|
10675
|
+
|
|
10676
|
+
.lasso-conflict-force:hover {
|
|
10677
|
+
background: rgba(245, 158, 11, 0.2);
|
|
10678
|
+
}
|
|
10679
|
+
|
|
10680
|
+
/* ==========================================================
|
|
10681
|
+
TIMELINE PANEL
|
|
10682
|
+
========================================================== */
|
|
10683
|
+
|
|
10684
|
+
.lasso-timeline {
|
|
10685
|
+
position: fixed;
|
|
10686
|
+
width: min(540px, calc(100vw - 24px));
|
|
10687
|
+
max-height: min(620px, calc(100vh - 24px));
|
|
10688
|
+
overflow: auto;
|
|
10689
|
+
padding: 18px;
|
|
10690
|
+
border: 1px solid var(--lo-border);
|
|
10691
|
+
border-radius: var(--lo-radius-xl);
|
|
10692
|
+
background: rgba(22, 23, 27, 0.98);
|
|
10693
|
+
backdrop-filter: blur(24px);
|
|
10694
|
+
-webkit-backdrop-filter: blur(24px);
|
|
10695
|
+
color: var(--lo-text);
|
|
10696
|
+
box-shadow: 0 20px 48px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
|
|
10697
|
+
pointer-events: auto;
|
|
10698
|
+
font-family: inherit;
|
|
10699
|
+
z-index: 30;
|
|
10700
|
+
}
|
|
10701
|
+
|
|
10702
|
+
.lasso-timeline[hidden] {
|
|
10703
|
+
display: none;
|
|
10704
|
+
}
|
|
10705
|
+
|
|
10706
|
+
.lasso-timeline-header {
|
|
10707
|
+
display: flex;
|
|
10708
|
+
align-items: flex-start;
|
|
10709
|
+
justify-content: space-between;
|
|
10710
|
+
gap: 16px;
|
|
10711
|
+
margin-bottom: 14px;
|
|
10712
|
+
}
|
|
10713
|
+
|
|
10714
|
+
.lasso-timeline-title {
|
|
10715
|
+
margin: 0;
|
|
10716
|
+
font-size: 15px;
|
|
10717
|
+
font-weight: 700;
|
|
10718
|
+
}
|
|
10719
|
+
|
|
10720
|
+
.lasso-timeline-subtitle {
|
|
10721
|
+
margin: 4px 0 0;
|
|
10722
|
+
color: var(--lo-text-2);
|
|
10723
|
+
font-size: 12px;
|
|
10724
|
+
line-height: 1.4;
|
|
10725
|
+
}
|
|
10726
|
+
|
|
10727
|
+
.lasso-timeline-close {
|
|
10728
|
+
border: 0;
|
|
10729
|
+
background: transparent;
|
|
10730
|
+
color: var(--lo-text-3);
|
|
10731
|
+
font-size: 18px;
|
|
10732
|
+
cursor: pointer;
|
|
10733
|
+
}
|
|
10734
|
+
|
|
10735
|
+
.lasso-timeline-close:hover {
|
|
10736
|
+
color: var(--lo-text);
|
|
10737
|
+
}
|
|
10738
|
+
|
|
10739
|
+
.lasso-timeline-list {
|
|
10740
|
+
display: flex;
|
|
10741
|
+
flex-direction: column;
|
|
10742
|
+
gap: 8px;
|
|
10743
|
+
}
|
|
10744
|
+
|
|
10745
|
+
.lasso-timeline-empty {
|
|
10746
|
+
padding: 20px;
|
|
10747
|
+
text-align: center;
|
|
10748
|
+
color: var(--lo-text-2);
|
|
10749
|
+
font-size: 13px;
|
|
10750
|
+
}
|
|
10751
|
+
|
|
10752
|
+
.lasso-timeline-item {
|
|
10753
|
+
padding: 12px;
|
|
10754
|
+
border: 1px solid var(--lo-border);
|
|
10755
|
+
border-radius: var(--lo-radius-md);
|
|
10756
|
+
background: var(--lo-surface-2);
|
|
10757
|
+
}
|
|
10758
|
+
|
|
10759
|
+
.lasso-timeline-item-header {
|
|
10760
|
+
display: flex;
|
|
10761
|
+
align-items: center;
|
|
10762
|
+
justify-content: space-between;
|
|
10763
|
+
gap: 8px;
|
|
10764
|
+
margin-bottom: 6px;
|
|
10765
|
+
}
|
|
10766
|
+
|
|
10767
|
+
.lasso-timeline-item-summary {
|
|
10768
|
+
font-weight: 600;
|
|
10769
|
+
font-size: 13px;
|
|
10770
|
+
}
|
|
10771
|
+
|
|
10772
|
+
.lasso-timeline-item-time {
|
|
10773
|
+
font-size: 11px;
|
|
10774
|
+
color: var(--lo-text-2);
|
|
10775
|
+
}
|
|
10776
|
+
|
|
10777
|
+
.lasso-timeline-item-files {
|
|
10778
|
+
font-size: 11px;
|
|
10779
|
+
color: var(--lo-text-2);
|
|
10780
|
+
margin-bottom: 8px;
|
|
10781
|
+
}
|
|
10782
|
+
|
|
10783
|
+
.lasso-timeline-item-actions {
|
|
10784
|
+
display: flex;
|
|
10785
|
+
gap: 8px;
|
|
10786
|
+
}
|
|
10787
|
+
|
|
10788
|
+
.lasso-timeline-item button {
|
|
10789
|
+
padding: 6px 12px;
|
|
10790
|
+
border: 1px solid var(--lo-border);
|
|
10791
|
+
border-radius: var(--lo-radius-sm);
|
|
10792
|
+
background: var(--lo-surface-3);
|
|
10793
|
+
color: var(--lo-text);
|
|
10794
|
+
font-size: 11px;
|
|
10795
|
+
cursor: pointer;
|
|
10796
|
+
transition: background 120ms ease;
|
|
10797
|
+
}
|
|
10798
|
+
|
|
10799
|
+
.lasso-timeline-item button:hover {
|
|
10800
|
+
background: var(--lo-surface-hover);
|
|
10801
|
+
}
|
|
10802
|
+
|
|
10803
|
+
.lasso-timeline-restore {
|
|
10804
|
+
border-color: var(--lo-primary);
|
|
10805
|
+
background: rgba(129, 201, 149, 0.1);
|
|
10806
|
+
color: #86efac;
|
|
10807
|
+
}
|
|
10808
|
+
|
|
10809
|
+
.lasso-timeline-restore:hover {
|
|
10810
|
+
background: rgba(129, 201, 149, 0.2);
|
|
10811
|
+
}
|
|
10812
|
+
|
|
10813
|
+
.lasso-timeline-delete {
|
|
10814
|
+
border-color: #f28b82;
|
|
10815
|
+
background: rgba(242, 139, 130, 0.1);
|
|
10816
|
+
color: #f28b82;
|
|
10817
|
+
}
|
|
10818
|
+
|
|
10819
|
+
.lasso-timeline-delete:hover {
|
|
10820
|
+
background: rgba(242, 139, 130, 0.2);
|
|
10821
|
+
}
|
|
10822
|
+
|
|
10551
10823
|
/* ==========================================================
|
|
10552
10824
|
GIT PANEL (Workspace Git Management)
|
|
10553
10825
|
========================================================== */
|
|
@@ -18323,7 +18595,7 @@
|
|
|
18323
18595
|
author.textContent = msg.author?.name || "Unknown";
|
|
18324
18596
|
const time = document.createElement("span");
|
|
18325
18597
|
time.className = "lasso-pin-thread-time";
|
|
18326
|
-
time.textContent =
|
|
18598
|
+
time.textContent = timeAgo2(msg.createdAt);
|
|
18327
18599
|
row.append(av, author, time);
|
|
18328
18600
|
const body = document.createElement("div");
|
|
18329
18601
|
body.className = "lasso-pin-thread-body";
|
|
@@ -21596,7 +21868,22 @@
|
|
|
21596
21868
|
if (task) state.changesHistory = task.changesHistory.map((entry) => ({ ...entry, changes: entry.changes.map((change) => ({ ...change })) }));
|
|
21597
21869
|
state.pendingChanges = [...message.changes];
|
|
21598
21870
|
showReview(message.changes, message.message);
|
|
21871
|
+
} else if (message.status === "error" || message.status === "stopped") {
|
|
21872
|
+
if (taskId2 === state.promptTaskId) {
|
|
21873
|
+
closeReview();
|
|
21874
|
+
}
|
|
21875
|
+
}
|
|
21876
|
+
}
|
|
21877
|
+
if (message.type === "conflict_detected" && message.conflicts && message.taskId) {
|
|
21878
|
+
const taskId2 = message.taskId;
|
|
21879
|
+
if (taskId2 === state.promptTaskId) {
|
|
21880
|
+
showConflict(message.conflicts, message.message);
|
|
21599
21881
|
}
|
|
21882
|
+
void notifyAgent("Conflict detected", message.message);
|
|
21883
|
+
}
|
|
21884
|
+
if (message.type === "timeline" && message.snapshots) {
|
|
21885
|
+
state.timelineSnapshots = message.snapshots;
|
|
21886
|
+
showTimeline();
|
|
21600
21887
|
}
|
|
21601
21888
|
if (message.type === "assistant_message" && message.message) {
|
|
21602
21889
|
const taskId2 = message.taskId;
|
|
@@ -21661,6 +21948,7 @@ The agent is automatically attempting to fix the build errors...`;
|
|
|
21661
21948
|
}
|
|
21662
21949
|
if (isPromptTask) {
|
|
21663
21950
|
closeReview();
|
|
21951
|
+
closeConflict();
|
|
21664
21952
|
resetDrag(false);
|
|
21665
21953
|
state.pendingChanges = [];
|
|
21666
21954
|
}
|
|
@@ -21918,6 +22206,8 @@ The agent is automatically attempting to fix the build errors...`;
|
|
|
21918
22206
|
var reviewPanel = null;
|
|
21919
22207
|
var agentPromptPanel = null;
|
|
21920
22208
|
var agentPromptTaskId = null;
|
|
22209
|
+
var conflictPanel = null;
|
|
22210
|
+
var timelinePanel = null;
|
|
21921
22211
|
var modelBtn = null;
|
|
21922
22212
|
var modelName = null;
|
|
21923
22213
|
var modelMenu = null;
|
|
@@ -22137,6 +22427,46 @@ The agent is automatically attempting to fix the build errors...`;
|
|
|
22137
22427
|
`;
|
|
22138
22428
|
dom.shadow.appendChild(rev);
|
|
22139
22429
|
reviewPanel = rev;
|
|
22430
|
+
const conflict = document.createElement("div");
|
|
22431
|
+
conflict.className = "lasso-conflict";
|
|
22432
|
+
conflict.hidden = true;
|
|
22433
|
+
conflict.innerHTML = `
|
|
22434
|
+
<div class="lasso-conflict-header">
|
|
22435
|
+
<div>
|
|
22436
|
+
<h3 class="lasso-conflict-title">\u26A0\uFE0F Source conflict detected</h3>
|
|
22437
|
+
<p class="lasso-conflict-subtitle">The file(s) have changed since the suggestion was generated.</p>
|
|
22438
|
+
</div>
|
|
22439
|
+
<button class="lasso-conflict-close" type="button" aria-label="Close conflict panel">\xD7</button>
|
|
22440
|
+
</div>
|
|
22441
|
+
<div class="lasso-conflict-files"></div>
|
|
22442
|
+
<div class="lasso-conflict-actions">
|
|
22443
|
+
<button class="lasso-conflict-retry" type="button">Retry with current content</button>
|
|
22444
|
+
<button class="lasso-conflict-rebase" type="button">Rebase changes</button>
|
|
22445
|
+
<button class="lasso-conflict-force" type="button">Force apply</button>
|
|
22446
|
+
</div>
|
|
22447
|
+
`;
|
|
22448
|
+
dom.shadow.appendChild(conflict);
|
|
22449
|
+
conflictPanel = conflict;
|
|
22450
|
+
conflict.querySelector(".lasso-conflict-close").addEventListener("click", closeConflict2);
|
|
22451
|
+
conflict.querySelector(".lasso-conflict-retry").addEventListener("click", () => resolveConflict("retry"));
|
|
22452
|
+
conflict.querySelector(".lasso-conflict-rebase").addEventListener("click", () => resolveConflict("rebase"));
|
|
22453
|
+
conflict.querySelector(".lasso-conflict-force").addEventListener("click", () => resolveConflict("force"));
|
|
22454
|
+
const timeline = document.createElement("div");
|
|
22455
|
+
timeline.className = "lasso-timeline";
|
|
22456
|
+
timeline.hidden = true;
|
|
22457
|
+
timeline.innerHTML = `
|
|
22458
|
+
<div class="lasso-timeline-header">
|
|
22459
|
+
<div>
|
|
22460
|
+
<h3 class="lasso-timeline-title">Change history</h3>
|
|
22461
|
+
<p class="lasso-timeline-subtitle">Restore previous states of your project</p>
|
|
22462
|
+
</div>
|
|
22463
|
+
<button class="lasso-timeline-close" type="button" aria-label="Close timeline">\xD7</button>
|
|
22464
|
+
</div>
|
|
22465
|
+
<div class="lasso-timeline-list"></div>
|
|
22466
|
+
`;
|
|
22467
|
+
dom.shadow.appendChild(timeline);
|
|
22468
|
+
timelinePanel = timeline;
|
|
22469
|
+
timeline.querySelector(".lasso-timeline-close").addEventListener("click", closeTimeline);
|
|
22140
22470
|
onAgentTaskSelected((task) => {
|
|
22141
22471
|
if (task) restoreTaskPrompt(task);
|
|
22142
22472
|
else resetPromptSession();
|
|
@@ -22292,6 +22622,16 @@ The agent is automatically attempting to fix the build errors...`;
|
|
|
22292
22622
|
closeReview();
|
|
22293
22623
|
appendChat("assistant", "Kept as a proposal. Nothing was changed.", taskId2);
|
|
22294
22624
|
});
|
|
22625
|
+
const historyBtn = document.createElement("button");
|
|
22626
|
+
historyBtn.type = "button";
|
|
22627
|
+
historyBtn.className = "lasso-review-history";
|
|
22628
|
+
historyBtn.textContent = "View history";
|
|
22629
|
+
historyBtn.addEventListener("click", () => {
|
|
22630
|
+
if (state.bridgeSocket?.readyState === WebSocket.OPEN) {
|
|
22631
|
+
state.bridgeSocket.send(JSON.stringify({ type: "get_timeline" }));
|
|
22632
|
+
}
|
|
22633
|
+
});
|
|
22634
|
+
rev.querySelector(".lasso-review-actions").prepend(historyBtn);
|
|
22295
22635
|
rev.querySelector(".lasso-review-apply").addEventListener("click", () => {
|
|
22296
22636
|
const taskId2 = state.promptTaskId;
|
|
22297
22637
|
if (!taskId2 || !state.bridgeSocket || state.bridgeSocket.readyState !== WebSocket.OPEN || !state.pendingChanges.length) return;
|
|
@@ -22304,6 +22644,11 @@ The agent is automatically attempting to fix the build errors...`;
|
|
|
22304
22644
|
activity: [...getAgentTask(taskId2)?.activity || [], "Applying accepted changes\u2026"]
|
|
22305
22645
|
});
|
|
22306
22646
|
appendChat("assistant", "Applying the reviewed change\u2026", taskId2);
|
|
22647
|
+
const applyBtn = rev.querySelector(".lasso-review-apply");
|
|
22648
|
+
if (applyBtn) {
|
|
22649
|
+
applyBtn.disabled = true;
|
|
22650
|
+
applyBtn.textContent = "Applying...";
|
|
22651
|
+
}
|
|
22307
22652
|
});
|
|
22308
22653
|
return { prompt: el, review: rev };
|
|
22309
22654
|
}
|
|
@@ -22732,6 +23077,7 @@ The agent is automatically attempting to fix the build errors...`;
|
|
|
22732
23077
|
}
|
|
22733
23078
|
function hideReview() {
|
|
22734
23079
|
if (reviewPanel) reviewPanel.hidden = true;
|
|
23080
|
+
closeConflict2();
|
|
22735
23081
|
}
|
|
22736
23082
|
function resetPromptSession(element = state.selected) {
|
|
22737
23083
|
state.promptTaskId = null;
|
|
@@ -22796,6 +23142,7 @@ The agent is automatically attempting to fix the build errors...`;
|
|
|
22796
23142
|
if (!reviewPanel) return;
|
|
22797
23143
|
const subtitle = reviewPanel.querySelector(".lasso-review-subtitle");
|
|
22798
23144
|
const files = reviewPanel.querySelector(".lasso-review-files");
|
|
23145
|
+
const applyBtn = reviewPanel.querySelector(".lasso-review-apply");
|
|
22799
23146
|
if (!subtitle || !files) return;
|
|
22800
23147
|
subtitle.textContent = `${summary} ${changes.length} file${changes.length === 1 ? "" : "s"} proposed.`;
|
|
22801
23148
|
files.replaceChildren(
|
|
@@ -22818,6 +23165,10 @@ The agent is automatically attempting to fix the build errors...`;
|
|
|
22818
23165
|
return file;
|
|
22819
23166
|
})
|
|
22820
23167
|
);
|
|
23168
|
+
if (applyBtn) {
|
|
23169
|
+
applyBtn.disabled = false;
|
|
23170
|
+
applyBtn.textContent = "Accept & apply";
|
|
23171
|
+
}
|
|
22821
23172
|
reviewPanel.hidden = false;
|
|
22822
23173
|
const left = Math.max(12, (window.innerWidth - Math.min(520, window.innerWidth - 24)) / 2);
|
|
22823
23174
|
const top = Math.max(12, (window.innerHeight - Math.min(620, window.innerHeight - 24)) / 2);
|
|
@@ -22828,6 +23179,96 @@ The agent is automatically attempting to fix the build errors...`;
|
|
|
22828
23179
|
hideReview();
|
|
22829
23180
|
resetAgentState();
|
|
22830
23181
|
}
|
|
23182
|
+
function showConflict(conflicts, message) {
|
|
23183
|
+
if (!conflictPanel) return;
|
|
23184
|
+
const subtitle = conflictPanel.querySelector(".lasso-conflict-subtitle");
|
|
23185
|
+
const files = conflictPanel.querySelector(".lasso-conflict-files");
|
|
23186
|
+
if (!subtitle || !files) return;
|
|
23187
|
+
subtitle.textContent = message;
|
|
23188
|
+
files.replaceChildren(
|
|
23189
|
+
...conflicts.map((conflict) => {
|
|
23190
|
+
const file = document.createElement("div");
|
|
23191
|
+
file.className = "lasso-conflict-file";
|
|
23192
|
+
const name = document.createElement("div");
|
|
23193
|
+
name.className = "lasso-conflict-file-name";
|
|
23194
|
+
name.textContent = conflict.filePath;
|
|
23195
|
+
const details = document.createElement("div");
|
|
23196
|
+
details.className = "lasso-conflict-details";
|
|
23197
|
+
details.innerHTML = `
|
|
23198
|
+
<div class="lasso-conflict-hash">
|
|
23199
|
+
<span>Expected: ${conflict.expectedHash.slice(0, 8)}...</span>
|
|
23200
|
+
<span>Actual: ${conflict.actualHash.slice(0, 8)}...</span>
|
|
23201
|
+
</div>
|
|
23202
|
+
`;
|
|
23203
|
+
file.append(name, details);
|
|
23204
|
+
return file;
|
|
23205
|
+
})
|
|
23206
|
+
);
|
|
23207
|
+
conflictPanel.hidden = false;
|
|
23208
|
+
const left = Math.max(12, (window.innerWidth - Math.min(520, window.innerWidth - 24)) / 2);
|
|
23209
|
+
const top = Math.max(12, (window.innerHeight - Math.min(400, window.innerHeight - 24)) / 2);
|
|
23210
|
+
conflictPanel.style.left = `${left}px`;
|
|
23211
|
+
conflictPanel.style.top = `${top}px`;
|
|
23212
|
+
}
|
|
23213
|
+
function closeConflict2() {
|
|
23214
|
+
if (!conflictPanel) return;
|
|
23215
|
+
conflictPanel.hidden = true;
|
|
23216
|
+
}
|
|
23217
|
+
function resolveConflict(action) {
|
|
23218
|
+
const taskId2 = state.promptTaskId;
|
|
23219
|
+
if (!taskId2 || !state.bridgeSocket || state.bridgeSocket.readyState !== WebSocket.OPEN) return;
|
|
23220
|
+
state.bridgeSocket.send(JSON.stringify({
|
|
23221
|
+
type: "resolve_conflict",
|
|
23222
|
+
taskId: taskId2,
|
|
23223
|
+
action,
|
|
23224
|
+
conflicts: []
|
|
23225
|
+
// Bridge will re-detect conflicts
|
|
23226
|
+
}));
|
|
23227
|
+
closeConflict2();
|
|
23228
|
+
closeReview();
|
|
23229
|
+
}
|
|
23230
|
+
function showTimeline() {
|
|
23231
|
+
if (!timelinePanel) return;
|
|
23232
|
+
const list2 = timelinePanel.querySelector(".lasso-timeline-list");
|
|
23233
|
+
if (!list2) return;
|
|
23234
|
+
list2.replaceChildren(
|
|
23235
|
+
...state.timelineSnapshots.map((snapshot) => {
|
|
23236
|
+
const item = document.createElement("div");
|
|
23237
|
+
item.className = "lasso-timeline-item";
|
|
23238
|
+
item.innerHTML = `
|
|
23239
|
+
<div class="lasso-timeline-item-header">
|
|
23240
|
+
<span class="lasso-timeline-item-summary">${snapshot.summary}</span>
|
|
23241
|
+
<span class="lasso-timeline-item-time">${timeAgo(snapshot.createdAt)}</span>
|
|
23242
|
+
</div>
|
|
23243
|
+
<div class="lasso-timeline-item-files">${snapshot.files.length} file${snapshot.files.length === 1 ? "" : "s"}</div>
|
|
23244
|
+
<button class="lasso-timeline-restore" type="button">Restore</button>
|
|
23245
|
+
<button class="lasso-timeline-delete" type="button">Delete</button>
|
|
23246
|
+
`;
|
|
23247
|
+
item.querySelector(".lasso-timeline-restore").addEventListener("click", () => {
|
|
23248
|
+
if (state.bridgeSocket?.readyState === WebSocket.OPEN) {
|
|
23249
|
+
state.bridgeSocket.send(JSON.stringify({ type: "restore_snapshot", snapshotId: snapshot.id }));
|
|
23250
|
+
}
|
|
23251
|
+
});
|
|
23252
|
+
item.querySelector(".lasso-timeline-delete").addEventListener("click", () => {
|
|
23253
|
+
if (state.bridgeSocket?.readyState === WebSocket.OPEN) {
|
|
23254
|
+
state.bridgeSocket.send(JSON.stringify({ type: "delete_snapshot", snapshotId: snapshot.id }));
|
|
23255
|
+
}
|
|
23256
|
+
});
|
|
23257
|
+
return item;
|
|
23258
|
+
})
|
|
23259
|
+
);
|
|
23260
|
+
if (state.timelineSnapshots.length === 0) {
|
|
23261
|
+
list2.innerHTML = `<div class="lasso-timeline-empty">No snapshots yet. Changes will be automatically saved.</div>`;
|
|
23262
|
+
}
|
|
23263
|
+
timelinePanel.hidden = false;
|
|
23264
|
+
const left = Math.max(12, (window.innerWidth - Math.min(520, window.innerWidth - 24)) / 2);
|
|
23265
|
+
const top = Math.max(12, (window.innerHeight - Math.min(620, window.innerHeight - 24)) / 2);
|
|
23266
|
+
timelinePanel.style.left = `${left}px`;
|
|
23267
|
+
timelinePanel.style.top = `${top}px`;
|
|
23268
|
+
}
|
|
23269
|
+
function closeTimeline() {
|
|
23270
|
+
if (timelinePanel) timelinePanel.hidden = true;
|
|
23271
|
+
}
|
|
22831
23272
|
function positionPrompt(el) {
|
|
22832
23273
|
if (!promptEl) return;
|
|
22833
23274
|
const rect = el.getBoundingClientRect();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lasso-ai/cli",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.4",
|
|
4
4
|
"description": "Select any part of your running app, describe a change, and let AI edit the real source code.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "dist/cli/index.js",
|
|
@@ -76,7 +76,6 @@
|
|
|
76
76
|
"@iconify-icons/logos": "^2.0.1",
|
|
77
77
|
"@iconify-json/logos": "^1.2.14",
|
|
78
78
|
"@iconify/utils": "^3.1.7",
|
|
79
|
-
"@lasso-ai/cli": "link:",
|
|
80
79
|
"chalk": "^6.0.0",
|
|
81
80
|
"commander": "^15.0.0",
|
|
82
81
|
"http-proxy": "^1.18.1",
|