zidane-gui 7.0.14 → 7.0.16
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.
|
@@ -13670,6 +13670,7 @@ function descriptionFor(entry, token2, scope) {
|
|
|
13670
13670
|
ageString(entry.updatedAt),
|
|
13671
13671
|
`${entry.userMessageCount} msg${entry.userMessageCount === 1 ? "" : "s"}`
|
|
13672
13672
|
];
|
|
13673
|
+
if ((entry.artifactCount ?? 0) > 0) bits.push(`${entry.artifactCount} artifact${entry.artifactCount === 1 ? "" : "s"}`);
|
|
13673
13674
|
const project = projectLabel(entry.projectRoot);
|
|
13674
13675
|
if (scope === "all" && project) bits.push(project);
|
|
13675
13676
|
return bits.join(" · ");
|
|
@@ -16587,7 +16588,7 @@ function reconcileEvents(prev, next) {
|
|
|
16587
16588
|
}
|
|
16588
16589
|
const pool = /* @__PURE__ */ new Map();
|
|
16589
16590
|
for (const event of prev) {
|
|
16590
|
-
const key2 =
|
|
16591
|
+
const key2 = bucketKey(event);
|
|
16591
16592
|
const bucket = pool.get(key2);
|
|
16592
16593
|
if (bucket) {
|
|
16593
16594
|
bucket.push(event);
|
|
@@ -16595,12 +16596,45 @@ function reconcileEvents(prev, next) {
|
|
|
16595
16596
|
pool.set(key2, [event]);
|
|
16596
16597
|
}
|
|
16597
16598
|
}
|
|
16598
|
-
const out = next.map((event) =>
|
|
16599
|
+
const out = next.map((event) => {
|
|
16600
|
+
const bucket = pool.get(bucketKey(event));
|
|
16601
|
+
if (!bucket) {
|
|
16602
|
+
return event;
|
|
16603
|
+
}
|
|
16604
|
+
const hit = bucket.findIndex((candidate) => sameEvent(candidate, event));
|
|
16605
|
+
return hit === -1 ? event : bucket.splice(hit, 1)[0];
|
|
16606
|
+
});
|
|
16599
16607
|
return out.length === prev.length && out.every((event, i) => event === prev[i]) ? prev : out;
|
|
16600
16608
|
}
|
|
16601
|
-
function
|
|
16602
|
-
const
|
|
16603
|
-
return
|
|
16609
|
+
function bucketKey(event) {
|
|
16610
|
+
const text2 = typeof event.text === "string" ? event.text.length : 0;
|
|
16611
|
+
return `${event.kind}\0${event.turnId ?? ""}\0${event.callId ?? ""}\0${event.childId ?? ""}\0${text2}`;
|
|
16612
|
+
}
|
|
16613
|
+
function sameEvent(a, b2) {
|
|
16614
|
+
if (a === b2) {
|
|
16615
|
+
return true;
|
|
16616
|
+
}
|
|
16617
|
+
const keysA = Object.keys(a).filter((key2) => key2 !== "receivedAt");
|
|
16618
|
+
const keysB = Object.keys(b2).filter((key2) => key2 !== "receivedAt");
|
|
16619
|
+
if (keysA.length !== keysB.length) {
|
|
16620
|
+
return false;
|
|
16621
|
+
}
|
|
16622
|
+
return keysA.every((key2) => key2 in b2 && deepEqual$2(a[key2], b2[key2]));
|
|
16623
|
+
}
|
|
16624
|
+
function deepEqual$2(a, b2) {
|
|
16625
|
+
if (a === b2) {
|
|
16626
|
+
return true;
|
|
16627
|
+
}
|
|
16628
|
+
if (typeof a !== "object" || typeof b2 !== "object" || a === null || b2 === null) {
|
|
16629
|
+
return false;
|
|
16630
|
+
}
|
|
16631
|
+
if (Array.isArray(a) || Array.isArray(b2)) {
|
|
16632
|
+
return Array.isArray(a) && Array.isArray(b2) && a.length === b2.length && a.every((item, i) => deepEqual$2(item, b2[i]));
|
|
16633
|
+
}
|
|
16634
|
+
const objA = a;
|
|
16635
|
+
const objB = b2;
|
|
16636
|
+
const keys2 = Object.keys(objA);
|
|
16637
|
+
return keys2.length === Object.keys(objB).length && keys2.every((key2) => key2 in objB && deepEqual$2(objA[key2], objB[key2]));
|
|
16604
16638
|
}
|
|
16605
16639
|
function ownerOf(event) {
|
|
16606
16640
|
return event.childId ?? PARENT_OWNER;
|
|
@@ -17581,205 +17615,6 @@ function ModalShell({
|
|
|
17581
17615
|
}
|
|
17582
17616
|
);
|
|
17583
17617
|
}
|
|
17584
|
-
const SafeModeContext = reactExports.createContext(null);
|
|
17585
|
-
const HeadStoreContext = reactExports.createContext(null);
|
|
17586
|
-
function createHeadStore() {
|
|
17587
|
-
const heads = /* @__PURE__ */ new Map();
|
|
17588
|
-
const listeners2 = /* @__PURE__ */ new Map();
|
|
17589
|
-
const subscribe2 = (sessionId, listener) => {
|
|
17590
|
-
if (!sessionId) {
|
|
17591
|
-
return () => void 0;
|
|
17592
|
-
}
|
|
17593
|
-
let set2 = listeners2.get(sessionId);
|
|
17594
|
-
if (!set2) {
|
|
17595
|
-
set2 = /* @__PURE__ */ new Set();
|
|
17596
|
-
listeners2.set(sessionId, set2);
|
|
17597
|
-
}
|
|
17598
|
-
set2.add(listener);
|
|
17599
|
-
return () => {
|
|
17600
|
-
const live = listeners2.get(sessionId);
|
|
17601
|
-
if (!live) {
|
|
17602
|
-
return;
|
|
17603
|
-
}
|
|
17604
|
-
live.delete(listener);
|
|
17605
|
-
if (live.size === 0) {
|
|
17606
|
-
listeners2.delete(sessionId);
|
|
17607
|
-
}
|
|
17608
|
-
};
|
|
17609
|
-
};
|
|
17610
|
-
const notify2 = (sessionId) => {
|
|
17611
|
-
const set2 = listeners2.get(sessionId);
|
|
17612
|
-
if (!set2) {
|
|
17613
|
-
return;
|
|
17614
|
-
}
|
|
17615
|
-
for (const fn2 of set2) {
|
|
17616
|
-
fn2();
|
|
17617
|
-
}
|
|
17618
|
-
};
|
|
17619
|
-
const reindex = (queue) => {
|
|
17620
|
-
const next = /* @__PURE__ */ new Map();
|
|
17621
|
-
for (const entry of queue) {
|
|
17622
|
-
if (!next.has(entry.sessionId)) {
|
|
17623
|
-
next.set(entry.sessionId, entry);
|
|
17624
|
-
}
|
|
17625
|
-
}
|
|
17626
|
-
const touched = /* @__PURE__ */ new Set();
|
|
17627
|
-
for (const [sessionId, head2] of next) {
|
|
17628
|
-
if (heads.get(sessionId) !== head2) {
|
|
17629
|
-
touched.add(sessionId);
|
|
17630
|
-
}
|
|
17631
|
-
}
|
|
17632
|
-
for (const sessionId of heads.keys()) {
|
|
17633
|
-
if (!next.has(sessionId)) {
|
|
17634
|
-
touched.add(sessionId);
|
|
17635
|
-
}
|
|
17636
|
-
}
|
|
17637
|
-
heads.clear();
|
|
17638
|
-
for (const [sessionId, head2] of next) {
|
|
17639
|
-
heads.set(sessionId, head2);
|
|
17640
|
-
}
|
|
17641
|
-
for (const sessionId of touched) {
|
|
17642
|
-
notify2(sessionId);
|
|
17643
|
-
}
|
|
17644
|
-
};
|
|
17645
|
-
return {
|
|
17646
|
-
getHead: (sessionId) => sessionId ? heads.get(sessionId) ?? null : null,
|
|
17647
|
-
subscribe: subscribe2,
|
|
17648
|
-
reindex
|
|
17649
|
-
};
|
|
17650
|
-
}
|
|
17651
|
-
function SafeModeProvider({ children }) {
|
|
17652
|
-
const [queue, setQueue] = reactExports.useState([]);
|
|
17653
|
-
const localResolversRef = reactExports.useRef(/* @__PURE__ */ new Map());
|
|
17654
|
-
const headStoreRef = reactExports.useRef(null);
|
|
17655
|
-
if (headStoreRef.current === null) {
|
|
17656
|
-
headStoreRef.current = createHeadStore();
|
|
17657
|
-
}
|
|
17658
|
-
const headStore = headStoreRef.current;
|
|
17659
|
-
reactExports.useEffect(() => {
|
|
17660
|
-
headStore.reindex(queue);
|
|
17661
|
-
}, [queue, headStore]);
|
|
17662
|
-
reactExports.useEffect(() => {
|
|
17663
|
-
const unsubscribe = window.api.safeMode.onApprovalRequest((req) => {
|
|
17664
|
-
setQueue((prev) => prev.some((r2) => r2.id === req.id) ? prev : [...prev, req]);
|
|
17665
|
-
});
|
|
17666
|
-
const unsubscribeResolved = window.api.safeMode.onApprovalResolved(({ requestId }) => {
|
|
17667
|
-
localResolversRef.current.delete(requestId);
|
|
17668
|
-
setQueue((prev) => {
|
|
17669
|
-
const next = prev.filter((r2) => r2.id !== requestId);
|
|
17670
|
-
return next.length === prev.length ? prev : next;
|
|
17671
|
-
});
|
|
17672
|
-
});
|
|
17673
|
-
let cancelled = false;
|
|
17674
|
-
const backfill = () => {
|
|
17675
|
-
window.api.safeMode.listPending().then((existing) => {
|
|
17676
|
-
if (cancelled || !Array.isArray(existing)) {
|
|
17677
|
-
return;
|
|
17678
|
-
}
|
|
17679
|
-
setQueue((prev) => {
|
|
17680
|
-
const seen2 = new Set(prev.map((r2) => r2.id));
|
|
17681
|
-
const additions = existing.filter((r2) => !seen2.has(r2.id));
|
|
17682
|
-
return additions.length === 0 ? prev : [...prev, ...additions];
|
|
17683
|
-
});
|
|
17684
|
-
}).catch(() => void 0);
|
|
17685
|
-
};
|
|
17686
|
-
backfill();
|
|
17687
|
-
const unsubscribeDaemon = window.api.daemon.onState(({ connected }) => {
|
|
17688
|
-
if (connected) {
|
|
17689
|
-
backfill();
|
|
17690
|
-
}
|
|
17691
|
-
});
|
|
17692
|
-
return () => {
|
|
17693
|
-
cancelled = true;
|
|
17694
|
-
unsubscribe();
|
|
17695
|
-
unsubscribeResolved();
|
|
17696
|
-
unsubscribeDaemon();
|
|
17697
|
-
};
|
|
17698
|
-
}, []);
|
|
17699
|
-
const resolveHead = reactExports.useCallback((decision) => {
|
|
17700
|
-
setQueue((prev) => {
|
|
17701
|
-
const [head2, ...rest] = prev;
|
|
17702
|
-
if (!head2) {
|
|
17703
|
-
return prev;
|
|
17704
|
-
}
|
|
17705
|
-
const localResolver = localResolversRef.current.get(head2.id);
|
|
17706
|
-
if (localResolver) {
|
|
17707
|
-
localResolversRef.current.delete(head2.id);
|
|
17708
|
-
localResolver(decision);
|
|
17709
|
-
} else {
|
|
17710
|
-
window.api.safeMode.resolve(head2.id, decision).catch(() => void 0);
|
|
17711
|
-
}
|
|
17712
|
-
return rest;
|
|
17713
|
-
});
|
|
17714
|
-
}, []);
|
|
17715
|
-
const resolveById = reactExports.useCallback((id, decision) => {
|
|
17716
|
-
setQueue((prev) => {
|
|
17717
|
-
const target = prev.find((r2) => r2.id === id);
|
|
17718
|
-
if (!target) {
|
|
17719
|
-
return prev;
|
|
17720
|
-
}
|
|
17721
|
-
const localResolver = localResolversRef.current.get(id);
|
|
17722
|
-
if (localResolver) {
|
|
17723
|
-
localResolversRef.current.delete(id);
|
|
17724
|
-
localResolver(decision);
|
|
17725
|
-
} else {
|
|
17726
|
-
window.api.safeMode.resolve(id, decision).catch(() => void 0);
|
|
17727
|
-
}
|
|
17728
|
-
return prev.filter((r2) => r2.id !== id);
|
|
17729
|
-
});
|
|
17730
|
-
}, []);
|
|
17731
|
-
const denyAll = reactExports.useCallback(() => {
|
|
17732
|
-
setQueue((prev) => {
|
|
17733
|
-
for (const req of prev) {
|
|
17734
|
-
const localResolver = localResolversRef.current.get(req.id);
|
|
17735
|
-
if (localResolver) {
|
|
17736
|
-
localResolversRef.current.delete(req.id);
|
|
17737
|
-
localResolver("deny");
|
|
17738
|
-
} else {
|
|
17739
|
-
window.api.safeMode.resolve(req.id, "deny").catch(() => void 0);
|
|
17740
|
-
}
|
|
17741
|
-
}
|
|
17742
|
-
return [];
|
|
17743
|
-
});
|
|
17744
|
-
}, []);
|
|
17745
|
-
const enqueueLocal = reactExports.useCallback((req, onResolve) => {
|
|
17746
|
-
localResolversRef.current.set(req.id, onResolve);
|
|
17747
|
-
setQueue((prev) => [...prev, req]);
|
|
17748
|
-
}, []);
|
|
17749
|
-
const value = reactExports.useMemo(
|
|
17750
|
-
() => ({ queue, resolveHead, resolveById, denyAll, enqueueLocal }),
|
|
17751
|
-
[queue, resolveHead, resolveById, denyAll, enqueueLocal]
|
|
17752
|
-
);
|
|
17753
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(SafeModeContext.Provider, { value, children: /* @__PURE__ */ jsxRuntimeExports.jsx(HeadStoreContext.Provider, { value: headStore, children }) });
|
|
17754
|
-
}
|
|
17755
|
-
function useSafeModeQueue() {
|
|
17756
|
-
const ctx = reactExports.useContext(SafeModeContext);
|
|
17757
|
-
if (!ctx) {
|
|
17758
|
-
throw new Error("useSafeModeQueue must be used within SafeModeProvider");
|
|
17759
|
-
}
|
|
17760
|
-
return ctx.queue;
|
|
17761
|
-
}
|
|
17762
|
-
function useSafeModeActions() {
|
|
17763
|
-
const ctx = reactExports.useContext(SafeModeContext);
|
|
17764
|
-
if (!ctx) {
|
|
17765
|
-
throw new Error("useSafeModeActions must be used within SafeModeProvider");
|
|
17766
|
-
}
|
|
17767
|
-
return {
|
|
17768
|
-
resolveHead: ctx.resolveHead,
|
|
17769
|
-
resolveById: ctx.resolveById,
|
|
17770
|
-
denyAll: ctx.denyAll,
|
|
17771
|
-
enqueueLocal: ctx.enqueueLocal
|
|
17772
|
-
};
|
|
17773
|
-
}
|
|
17774
|
-
function useSessionApprovalHead(sessionId) {
|
|
17775
|
-
const store = reactExports.useContext(HeadStoreContext);
|
|
17776
|
-
if (!store) {
|
|
17777
|
-
throw new Error("useSessionApprovalHead must be used within SafeModeProvider");
|
|
17778
|
-
}
|
|
17779
|
-
const subscribe2 = reactExports.useCallback((listener) => store.subscribe(sessionId, listener), [store, sessionId]);
|
|
17780
|
-
const getSnapshot2 = reactExports.useCallback(() => store.getHead(sessionId), [store, sessionId]);
|
|
17781
|
-
return reactExports.useSyncExternalStore(subscribe2, getSnapshot2, getSnapshot2);
|
|
17782
|
-
}
|
|
17783
17618
|
const SelectTurnContext = reactExports.createContext(null);
|
|
17784
17619
|
function SelectTurnProvider({ children }) {
|
|
17785
17620
|
const [state, setState] = reactExports.useState(null);
|
|
@@ -17841,6 +17676,12 @@ const KEYBINDING_DEFS = [
|
|
|
17841
17676
|
label: "todos",
|
|
17842
17677
|
description: "open the active run's todo list (the agent's `todowrite` checkpoints)"
|
|
17843
17678
|
},
|
|
17679
|
+
{
|
|
17680
|
+
action: "openArtifacts",
|
|
17681
|
+
default: "ctrl+shift+a",
|
|
17682
|
+
label: "artifacts",
|
|
17683
|
+
description: "open the session's artifacts (pull requests, branches, commits, files it produced)"
|
|
17684
|
+
},
|
|
17844
17685
|
{
|
|
17845
17686
|
action: "openMainSession",
|
|
17846
17687
|
default: "ctrl+shift+m",
|
|
@@ -18397,6 +18238,205 @@ function formatKey(key2) {
|
|
|
18397
18238
|
const lower2 = key2.toLowerCase();
|
|
18398
18239
|
return KeySymbols[lower2] || key2;
|
|
18399
18240
|
}
|
|
18241
|
+
const SafeModeContext = reactExports.createContext(null);
|
|
18242
|
+
const HeadStoreContext = reactExports.createContext(null);
|
|
18243
|
+
function createHeadStore() {
|
|
18244
|
+
const heads = /* @__PURE__ */ new Map();
|
|
18245
|
+
const listeners2 = /* @__PURE__ */ new Map();
|
|
18246
|
+
const subscribe2 = (sessionId, listener) => {
|
|
18247
|
+
if (!sessionId) {
|
|
18248
|
+
return () => void 0;
|
|
18249
|
+
}
|
|
18250
|
+
let set2 = listeners2.get(sessionId);
|
|
18251
|
+
if (!set2) {
|
|
18252
|
+
set2 = /* @__PURE__ */ new Set();
|
|
18253
|
+
listeners2.set(sessionId, set2);
|
|
18254
|
+
}
|
|
18255
|
+
set2.add(listener);
|
|
18256
|
+
return () => {
|
|
18257
|
+
const live = listeners2.get(sessionId);
|
|
18258
|
+
if (!live) {
|
|
18259
|
+
return;
|
|
18260
|
+
}
|
|
18261
|
+
live.delete(listener);
|
|
18262
|
+
if (live.size === 0) {
|
|
18263
|
+
listeners2.delete(sessionId);
|
|
18264
|
+
}
|
|
18265
|
+
};
|
|
18266
|
+
};
|
|
18267
|
+
const notify2 = (sessionId) => {
|
|
18268
|
+
const set2 = listeners2.get(sessionId);
|
|
18269
|
+
if (!set2) {
|
|
18270
|
+
return;
|
|
18271
|
+
}
|
|
18272
|
+
for (const fn2 of set2) {
|
|
18273
|
+
fn2();
|
|
18274
|
+
}
|
|
18275
|
+
};
|
|
18276
|
+
const reindex = (queue) => {
|
|
18277
|
+
const next = /* @__PURE__ */ new Map();
|
|
18278
|
+
for (const entry of queue) {
|
|
18279
|
+
if (!next.has(entry.sessionId)) {
|
|
18280
|
+
next.set(entry.sessionId, entry);
|
|
18281
|
+
}
|
|
18282
|
+
}
|
|
18283
|
+
const touched = /* @__PURE__ */ new Set();
|
|
18284
|
+
for (const [sessionId, head2] of next) {
|
|
18285
|
+
if (heads.get(sessionId) !== head2) {
|
|
18286
|
+
touched.add(sessionId);
|
|
18287
|
+
}
|
|
18288
|
+
}
|
|
18289
|
+
for (const sessionId of heads.keys()) {
|
|
18290
|
+
if (!next.has(sessionId)) {
|
|
18291
|
+
touched.add(sessionId);
|
|
18292
|
+
}
|
|
18293
|
+
}
|
|
18294
|
+
heads.clear();
|
|
18295
|
+
for (const [sessionId, head2] of next) {
|
|
18296
|
+
heads.set(sessionId, head2);
|
|
18297
|
+
}
|
|
18298
|
+
for (const sessionId of touched) {
|
|
18299
|
+
notify2(sessionId);
|
|
18300
|
+
}
|
|
18301
|
+
};
|
|
18302
|
+
return {
|
|
18303
|
+
getHead: (sessionId) => sessionId ? heads.get(sessionId) ?? null : null,
|
|
18304
|
+
subscribe: subscribe2,
|
|
18305
|
+
reindex
|
|
18306
|
+
};
|
|
18307
|
+
}
|
|
18308
|
+
function SafeModeProvider({ children }) {
|
|
18309
|
+
const [queue, setQueue] = reactExports.useState([]);
|
|
18310
|
+
const localResolversRef = reactExports.useRef(/* @__PURE__ */ new Map());
|
|
18311
|
+
const headStoreRef = reactExports.useRef(null);
|
|
18312
|
+
if (headStoreRef.current === null) {
|
|
18313
|
+
headStoreRef.current = createHeadStore();
|
|
18314
|
+
}
|
|
18315
|
+
const headStore = headStoreRef.current;
|
|
18316
|
+
reactExports.useEffect(() => {
|
|
18317
|
+
headStore.reindex(queue);
|
|
18318
|
+
}, [queue, headStore]);
|
|
18319
|
+
reactExports.useEffect(() => {
|
|
18320
|
+
const unsubscribe = window.api.safeMode.onApprovalRequest((req) => {
|
|
18321
|
+
setQueue((prev) => prev.some((r2) => r2.id === req.id) ? prev : [...prev, req]);
|
|
18322
|
+
});
|
|
18323
|
+
const unsubscribeResolved = window.api.safeMode.onApprovalResolved(({ requestId }) => {
|
|
18324
|
+
localResolversRef.current.delete(requestId);
|
|
18325
|
+
setQueue((prev) => {
|
|
18326
|
+
const next = prev.filter((r2) => r2.id !== requestId);
|
|
18327
|
+
return next.length === prev.length ? prev : next;
|
|
18328
|
+
});
|
|
18329
|
+
});
|
|
18330
|
+
let cancelled = false;
|
|
18331
|
+
const backfill = () => {
|
|
18332
|
+
window.api.safeMode.listPending().then((existing) => {
|
|
18333
|
+
if (cancelled || !Array.isArray(existing)) {
|
|
18334
|
+
return;
|
|
18335
|
+
}
|
|
18336
|
+
setQueue((prev) => {
|
|
18337
|
+
const seen2 = new Set(prev.map((r2) => r2.id));
|
|
18338
|
+
const additions = existing.filter((r2) => !seen2.has(r2.id));
|
|
18339
|
+
return additions.length === 0 ? prev : [...prev, ...additions];
|
|
18340
|
+
});
|
|
18341
|
+
}).catch(() => void 0);
|
|
18342
|
+
};
|
|
18343
|
+
backfill();
|
|
18344
|
+
const unsubscribeDaemon = window.api.daemon.onState(({ connected }) => {
|
|
18345
|
+
if (connected) {
|
|
18346
|
+
backfill();
|
|
18347
|
+
}
|
|
18348
|
+
});
|
|
18349
|
+
return () => {
|
|
18350
|
+
cancelled = true;
|
|
18351
|
+
unsubscribe();
|
|
18352
|
+
unsubscribeResolved();
|
|
18353
|
+
unsubscribeDaemon();
|
|
18354
|
+
};
|
|
18355
|
+
}, []);
|
|
18356
|
+
const resolveHead = reactExports.useCallback((decision) => {
|
|
18357
|
+
setQueue((prev) => {
|
|
18358
|
+
const [head2, ...rest] = prev;
|
|
18359
|
+
if (!head2) {
|
|
18360
|
+
return prev;
|
|
18361
|
+
}
|
|
18362
|
+
const localResolver = localResolversRef.current.get(head2.id);
|
|
18363
|
+
if (localResolver) {
|
|
18364
|
+
localResolversRef.current.delete(head2.id);
|
|
18365
|
+
localResolver(decision);
|
|
18366
|
+
} else {
|
|
18367
|
+
window.api.safeMode.resolve(head2.id, decision).catch(() => void 0);
|
|
18368
|
+
}
|
|
18369
|
+
return rest;
|
|
18370
|
+
});
|
|
18371
|
+
}, []);
|
|
18372
|
+
const resolveById = reactExports.useCallback((id, decision) => {
|
|
18373
|
+
setQueue((prev) => {
|
|
18374
|
+
const target = prev.find((r2) => r2.id === id);
|
|
18375
|
+
if (!target) {
|
|
18376
|
+
return prev;
|
|
18377
|
+
}
|
|
18378
|
+
const localResolver = localResolversRef.current.get(id);
|
|
18379
|
+
if (localResolver) {
|
|
18380
|
+
localResolversRef.current.delete(id);
|
|
18381
|
+
localResolver(decision);
|
|
18382
|
+
} else {
|
|
18383
|
+
window.api.safeMode.resolve(id, decision).catch(() => void 0);
|
|
18384
|
+
}
|
|
18385
|
+
return prev.filter((r2) => r2.id !== id);
|
|
18386
|
+
});
|
|
18387
|
+
}, []);
|
|
18388
|
+
const denyAll = reactExports.useCallback(() => {
|
|
18389
|
+
setQueue((prev) => {
|
|
18390
|
+
for (const req of prev) {
|
|
18391
|
+
const localResolver = localResolversRef.current.get(req.id);
|
|
18392
|
+
if (localResolver) {
|
|
18393
|
+
localResolversRef.current.delete(req.id);
|
|
18394
|
+
localResolver("deny");
|
|
18395
|
+
} else {
|
|
18396
|
+
window.api.safeMode.resolve(req.id, "deny").catch(() => void 0);
|
|
18397
|
+
}
|
|
18398
|
+
}
|
|
18399
|
+
return [];
|
|
18400
|
+
});
|
|
18401
|
+
}, []);
|
|
18402
|
+
const enqueueLocal = reactExports.useCallback((req, onResolve) => {
|
|
18403
|
+
localResolversRef.current.set(req.id, onResolve);
|
|
18404
|
+
setQueue((prev) => [...prev, req]);
|
|
18405
|
+
}, []);
|
|
18406
|
+
const value = reactExports.useMemo(
|
|
18407
|
+
() => ({ queue, resolveHead, resolveById, denyAll, enqueueLocal }),
|
|
18408
|
+
[queue, resolveHead, resolveById, denyAll, enqueueLocal]
|
|
18409
|
+
);
|
|
18410
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(SafeModeContext.Provider, { value, children: /* @__PURE__ */ jsxRuntimeExports.jsx(HeadStoreContext.Provider, { value: headStore, children }) });
|
|
18411
|
+
}
|
|
18412
|
+
function useSafeModeQueue() {
|
|
18413
|
+
const ctx = reactExports.useContext(SafeModeContext);
|
|
18414
|
+
if (!ctx) {
|
|
18415
|
+
throw new Error("useSafeModeQueue must be used within SafeModeProvider");
|
|
18416
|
+
}
|
|
18417
|
+
return ctx.queue;
|
|
18418
|
+
}
|
|
18419
|
+
function useSafeModeActions() {
|
|
18420
|
+
const ctx = reactExports.useContext(SafeModeContext);
|
|
18421
|
+
if (!ctx) {
|
|
18422
|
+
throw new Error("useSafeModeActions must be used within SafeModeProvider");
|
|
18423
|
+
}
|
|
18424
|
+
return {
|
|
18425
|
+
resolveHead: ctx.resolveHead,
|
|
18426
|
+
resolveById: ctx.resolveById,
|
|
18427
|
+
denyAll: ctx.denyAll,
|
|
18428
|
+
enqueueLocal: ctx.enqueueLocal
|
|
18429
|
+
};
|
|
18430
|
+
}
|
|
18431
|
+
function useSessionApprovalHead(sessionId) {
|
|
18432
|
+
const store = reactExports.useContext(HeadStoreContext);
|
|
18433
|
+
if (!store) {
|
|
18434
|
+
throw new Error("useSessionApprovalHead must be used within SafeModeProvider");
|
|
18435
|
+
}
|
|
18436
|
+
const subscribe2 = reactExports.useCallback((listener) => store.subscribe(sessionId, listener), [store, sessionId]);
|
|
18437
|
+
const getSnapshot2 = reactExports.useCallback(() => store.getHead(sessionId), [store, sessionId]);
|
|
18438
|
+
return reactExports.useSyncExternalStore(subscribe2, getSnapshot2, getSnapshot2);
|
|
18439
|
+
}
|
|
18400
18440
|
function ComposerDock({ children }) {
|
|
18401
18441
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "zg-composer-dock flex flex-col gap-2", children });
|
|
18402
18442
|
}
|
|
@@ -18408,7 +18448,7 @@ function DockCard({
|
|
|
18408
18448
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18409
18449
|
"div",
|
|
18410
18450
|
{
|
|
18411
|
-
className: `zg-
|
|
18451
|
+
className: `zg-dock-card rounded-xl border px-3 py-2 ${tone === "attention" ? "border-[color-mix(in_srgb,var(--zg-warn)_35%,var(--zg-border))] bg-[color-mix(in_srgb,var(--zg-warn)_6%,var(--zg-bg-elevated))]" : "border-[var(--zg-border)] bg-[var(--zg-bg-elevated)]"} ${className}`,
|
|
18412
18452
|
children
|
|
18413
18453
|
}
|
|
18414
18454
|
);
|
|
@@ -18451,6 +18491,14 @@ function DockIconButton({
|
|
|
18451
18491
|
}
|
|
18452
18492
|
);
|
|
18453
18493
|
}
|
|
18494
|
+
function useCloseWhenResolved(stillPending) {
|
|
18495
|
+
const modal = useModal();
|
|
18496
|
+
reactExports.useEffect(() => {
|
|
18497
|
+
if (!stillPending) {
|
|
18498
|
+
modal.close();
|
|
18499
|
+
}
|
|
18500
|
+
}, [stillPending, modal]);
|
|
18501
|
+
}
|
|
18454
18502
|
const BASE_NO_CLAMP = {};
|
|
18455
18503
|
const DiffLines = reactExports.memo(({ lines, maxHeight }) => {
|
|
18456
18504
|
const style2 = maxHeight ? { maxHeight: `${maxHeight}px` } : BASE_NO_CLAMP;
|
|
@@ -18480,11 +18528,12 @@ const TONE_CLS$1 = {
|
|
|
18480
18528
|
primary: "bg-[var(--zg-accent)] hover:bg-[var(--zg-accent-hover)] text-white border-transparent focus-visible:ring-[var(--zg-accent)]",
|
|
18481
18529
|
secondary: "bg-[var(--zg-bg)] hover:bg-[var(--zg-bg-hover)] text-[var(--zg-text)] border-[var(--zg-border)] focus-visible:ring-[var(--zg-accent)]",
|
|
18482
18530
|
safelist: "bg-[var(--zg-bg)] hover:bg-[var(--zg-bg-hover)] text-[var(--zg-text)] border-[var(--zg-border)] focus-visible:ring-[var(--zg-accent)]",
|
|
18483
|
-
danger: "bg-[
|
|
18531
|
+
danger: "bg-[color-mix(in_srgb,var(--zg-error)_12%,transparent)] hover:bg-[var(--zg-error)] text-[var(--zg-error)] hover:text-white border-[color-mix(in_srgb,var(--zg-error)_30%,transparent)] focus-visible:ring-[var(--zg-error)]"
|
|
18484
18532
|
};
|
|
18485
18533
|
function FileEditApprovalModal({ request }) {
|
|
18486
18534
|
const modal = useModal();
|
|
18487
18535
|
const { resolveById } = useSafeModeActions();
|
|
18536
|
+
useCloseWhenResolved(useSafeModeQueue().some((r2) => r2.id === request.id));
|
|
18488
18537
|
const edit = request.edit;
|
|
18489
18538
|
const preview = request.preview;
|
|
18490
18539
|
const path2 = edit?.path ?? readPath(request.input);
|
|
@@ -18835,7 +18884,7 @@ function SingleHunkPreview({ edit, preview, path: path2, isWriteFile }) {
|
|
|
18835
18884
|
"+",
|
|
18836
18885
|
added
|
|
18837
18886
|
] }),
|
|
18838
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "font-mono tabular-nums text-[
|
|
18887
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "font-mono tabular-nums text-[var(--zg-error)]", children: [
|
|
18839
18888
|
"−",
|
|
18840
18889
|
removed
|
|
18841
18890
|
] })
|
|
@@ -18876,7 +18925,7 @@ function readPath(input) {
|
|
|
18876
18925
|
}
|
|
18877
18926
|
const PRIMARY = "zg-press inline-flex items-center h-8 px-3.5 rounded-md text-[13px] font-medium bg-[var(--zg-accent)] hover:bg-[var(--zg-accent-hover)] text-white border-0 cursor-pointer transition-colors duration-150 disabled:opacity-40 disabled:cursor-not-allowed focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--zg-accent)]";
|
|
18878
18927
|
const SECONDARY = "zg-press inline-flex items-center h-8 px-3.5 rounded-md text-[13px] font-medium bg-[var(--zg-bg-hover)] hover:bg-[var(--zg-bg)] text-[var(--zg-text)] border border-[var(--zg-border)] cursor-pointer transition-colors duration-150 disabled:opacity-40 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--zg-accent)]";
|
|
18879
|
-
const DESTRUCTIVE = "zg-press inline-flex items-center h-8 px-3.5 rounded-md text-[13px] font-medium bg-[
|
|
18928
|
+
const DESTRUCTIVE = "zg-press inline-flex items-center h-8 px-3.5 rounded-md text-[13px] font-medium bg-[color-mix(in_srgb,var(--zg-error)_12%,transparent)] hover:bg-[var(--zg-error)] text-[var(--zg-error)] hover:text-white border border-[color-mix(in_srgb,var(--zg-error)_30%,transparent)] cursor-pointer transition-colors duration-150 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--zg-error)]";
|
|
18880
18929
|
const FILE_EDIT_TOOLS = /* @__PURE__ */ new Set(["edit", "multi_edit", "write_file"]);
|
|
18881
18930
|
function ApprovalBar({ sessionId }) {
|
|
18882
18931
|
const head2 = useSessionApprovalHead(sessionId);
|
|
@@ -42896,6 +42945,7 @@ function useShikiHtml$1(code, language, enabled) {
|
|
|
42896
42945
|
function AskUserModal({ request }) {
|
|
42897
42946
|
const modal = useModal();
|
|
42898
42947
|
const interactions = useInteractions();
|
|
42948
|
+
useCloseWhenResolved(interactions.pending.some((p2) => p2.request.id === request.id));
|
|
42899
42949
|
const payload = request.payload;
|
|
42900
42950
|
const [answers, setAnswers] = reactExports.useState(() => seedDefaults(payload));
|
|
42901
42951
|
const [busy, setBusy] = reactExports.useState(false);
|
|
@@ -43117,6 +43167,7 @@ const BTN_DANGER$2 = "zg-press h-8 px-3.5 rounded-md text-[13px] font-medium bg-
|
|
|
43117
43167
|
function PresentPlanModal({ request }) {
|
|
43118
43168
|
const modal = useModal();
|
|
43119
43169
|
const interactions = useInteractions();
|
|
43170
|
+
useCloseWhenResolved(interactions.pending.some((p2) => p2.request.id === request.id));
|
|
43120
43171
|
const [decision, setDecision] = reactExports.useState(null);
|
|
43121
43172
|
const [comment2, setComment] = reactExports.useState("");
|
|
43122
43173
|
const [busy, setBusy] = reactExports.useState(false);
|
|
@@ -74513,6 +74564,42 @@ function RowActionsMenu({ open, anchorRef, position: position2, onClose, items }
|
|
|
74513
74564
|
document.body
|
|
74514
74565
|
);
|
|
74515
74566
|
}
|
|
74567
|
+
const SEGMENTS = 5;
|
|
74568
|
+
const STEP_MS = 80;
|
|
74569
|
+
const DIMENSIONS = {
|
|
74570
|
+
xs: { w: 2, h: 6, gap: 1.5 },
|
|
74571
|
+
sm: { w: 2.5, h: 8, gap: 2 },
|
|
74572
|
+
md: { w: 3, h: 10, gap: 2 }
|
|
74573
|
+
};
|
|
74574
|
+
const TONE = {
|
|
74575
|
+
inherit: void 0,
|
|
74576
|
+
accent: "var(--zg-accent)",
|
|
74577
|
+
warn: "var(--zg-warn)",
|
|
74578
|
+
muted: "var(--zg-text-muted)"
|
|
74579
|
+
};
|
|
74580
|
+
function SegmentSpinner({ size: size2 = "sm", tone = "inherit", label = "Working", className = "" }) {
|
|
74581
|
+
const d2 = DIMENSIONS[size2];
|
|
74582
|
+
const color2 = TONE[tone];
|
|
74583
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
74584
|
+
"span",
|
|
74585
|
+
{
|
|
74586
|
+
role: "status",
|
|
74587
|
+
"aria-label": label,
|
|
74588
|
+
title: label,
|
|
74589
|
+
className: `zg-seg inline-flex items-center shrink-0 align-middle ${className}`,
|
|
74590
|
+
style: { gap: d2.gap, ...color2 ? { color: color2 } : {} },
|
|
74591
|
+
children: Array.from({ length: SEGMENTS }, (_2, i) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
74592
|
+
"span",
|
|
74593
|
+
{
|
|
74594
|
+
"aria-hidden": true,
|
|
74595
|
+
className: "inline-block rounded-[1px] bg-current",
|
|
74596
|
+
style: { width: d2.w, height: d2.h, animationDelay: `${i * STEP_MS}ms` }
|
|
74597
|
+
},
|
|
74598
|
+
i
|
|
74599
|
+
))
|
|
74600
|
+
}
|
|
74601
|
+
);
|
|
74602
|
+
}
|
|
74516
74603
|
function SessionHeader({ session, onOpenDetails, lightsInCenter = false }) {
|
|
74517
74604
|
const { setDefaultFolder, refresh: refreshSessions } = useSessions();
|
|
74518
74605
|
const folderless = !session.cwd;
|
|
@@ -74652,13 +74739,7 @@ function SessionHeader({ session, onOpenDetails, lightsInCenter = false }) {
|
|
|
74652
74739
|
"aria-expanded": menuOpen,
|
|
74653
74740
|
onClick: () => setMenuOpen((open) => !open),
|
|
74654
74741
|
className: "zg-press-soft zg-hit-extend relative inline-flex items-center justify-center w-7 h-7 shrink-0 rounded-md bg-transparent hover:bg-[var(--zg-bg-hover)] text-[var(--zg-text-muted)] hover:text-[var(--zg-text)] border-0 cursor-pointer p-0 transition-colors duration-150 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--zg-accent)]",
|
|
74655
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
74656
|
-
"span",
|
|
74657
|
-
{
|
|
74658
|
-
className: compacting ? "i-heroicons-arrow-path text-sm animate-spin" : "i-heroicons-ellipsis-horizontal text-sm",
|
|
74659
|
-
"aria-hidden": true
|
|
74660
|
-
}
|
|
74661
|
-
)
|
|
74742
|
+
children: compacting ? /* @__PURE__ */ jsxRuntimeExports.jsx(SegmentSpinner, { size: "xs", tone: "warn", label: "Compacting" }) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "i-heroicons-ellipsis-horizontal text-sm", "aria-hidden": true })
|
|
74662
74743
|
}
|
|
74663
74744
|
),
|
|
74664
74745
|
/* @__PURE__ */ jsxRuntimeExports.jsx(RowActionsMenu, { open: menuOpen, anchorRef: menuTriggerRef, onClose: () => setMenuOpen(false), items: menuItems })
|
|
@@ -74712,7 +74793,7 @@ const TODO_STATUS_GLYPHS = {
|
|
|
74712
74793
|
cancelled: "☒"
|
|
74713
74794
|
};
|
|
74714
74795
|
const INPUT_CLS = "flex-1 min-w-0 font-mono text-sm bg-[var(--zg-bg)] border border-[var(--zg-border)] rounded-md px-3 py-1.5 text-[var(--zg-text)] outline-none focus:border-[var(--zg-accent)] focus:ring-2 focus:ring-[var(--zg-accent)]/20";
|
|
74715
|
-
const GHOST_BTN$
|
|
74796
|
+
const GHOST_BTN$2 = "zg-press h-7 px-2 rounded-md text-xs text-[var(--zg-text-muted)] hover:text-[var(--zg-text)] hover:bg-[var(--zg-bg-hover)] border-0 bg-transparent cursor-pointer transition-colors duration-150 disabled:opacity-40 disabled:cursor-not-allowed";
|
|
74716
74797
|
function TodosModal({ sessionId }) {
|
|
74717
74798
|
const snap = useTodosFor(sessionId);
|
|
74718
74799
|
const { close: close2 } = useModal();
|
|
@@ -74789,7 +74870,7 @@ function TodosModal({ sessionId }) {
|
|
|
74789
74870
|
"button",
|
|
74790
74871
|
{
|
|
74791
74872
|
type: "button",
|
|
74792
|
-
className: `${GHOST_BTN$
|
|
74873
|
+
className: `${GHOST_BTN$2} text-[var(--zg-error)]`,
|
|
74793
74874
|
onClick: () => {
|
|
74794
74875
|
commit(clearTodos());
|
|
74795
74876
|
setConfirmClear(false);
|
|
@@ -74797,12 +74878,12 @@ function TodosModal({ sessionId }) {
|
|
|
74797
74878
|
children: "Yes"
|
|
74798
74879
|
}
|
|
74799
74880
|
),
|
|
74800
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("button", { type: "button", className: GHOST_BTN$
|
|
74881
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("button", { type: "button", className: GHOST_BTN$2, onClick: () => setConfirmClear(false), children: "Cancel" })
|
|
74801
74882
|
] }) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
74802
74883
|
"button",
|
|
74803
74884
|
{
|
|
74804
74885
|
type: "button",
|
|
74805
|
-
className: GHOST_BTN$
|
|
74886
|
+
className: GHOST_BTN$2,
|
|
74806
74887
|
disabled: base2.length === 0,
|
|
74807
74888
|
onClick: () => setConfirmClear(true),
|
|
74808
74889
|
title: "Remove every todo from the live list",
|
|
@@ -74900,7 +74981,7 @@ function TodosModal({ sessionId }) {
|
|
|
74900
74981
|
className: INPUT_CLS
|
|
74901
74982
|
}
|
|
74902
74983
|
),
|
|
74903
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("button", { type: "button", className: GHOST_BTN$
|
|
74984
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("button", { type: "button", className: GHOST_BTN$2, disabled: adding.trim().length === 0, onClick: submitAdd, children: "Add" })
|
|
74904
74985
|
] })
|
|
74905
74986
|
] })
|
|
74906
74987
|
}
|
|
@@ -74935,7 +75016,7 @@ function TodoIndicator({ sessionId }) {
|
|
|
74935
75016
|
const total = list2.length;
|
|
74936
75017
|
const done = snap.tally.completed + snap.tally.cancelled;
|
|
74937
75018
|
const headline = snap.inProgress ?? list2.find((t) => t.status === "in_progress") ?? list2.find((t) => t.status === "pending") ?? list2[0];
|
|
74938
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(DockCard, { className: "
|
|
75019
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(DockCard, { className: "cursor-pointer hover:bg-[var(--zg-bg-hover)] transition-colors duration-150", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
74939
75020
|
"button",
|
|
74940
75021
|
{
|
|
74941
75022
|
type: "button",
|
|
@@ -79903,7 +79984,7 @@ ${task}` : ""}`,
|
|
|
79903
79984
|
}
|
|
79904
79985
|
) }),
|
|
79905
79986
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "flex items-center gap-2 min-w-0 flex-1", children: [
|
|
79906
|
-
status === "open" && streaming ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
79987
|
+
status === "open" && streaming ? /* @__PURE__ */ jsxRuntimeExports.jsx(SegmentSpinner, { size: "xs", label: "running" }) : status === "failed" ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "i-heroicons-x-mark text-[11px] shrink-0 text-[#ef4444]", "aria-label": "failed" }) : status === "done" ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "i-heroicons-check text-[11px] shrink-0 text-[#22c55e]", "aria-label": "done" }) : null,
|
|
79907
79988
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-xs min-w-0 truncate", children: [
|
|
79908
79989
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-medium text-[var(--zg-text)]", children: "Agent" }),
|
|
79909
79990
|
task && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
|
|
@@ -80235,8 +80316,13 @@ function Dot({ variant }) {
|
|
|
80235
80316
|
"span",
|
|
80236
80317
|
{
|
|
80237
80318
|
"aria-hidden": true,
|
|
80238
|
-
className: "absolute inset-
|
|
80239
|
-
style: {
|
|
80319
|
+
className: "absolute -inset-[2px] rounded-full",
|
|
80320
|
+
style: {
|
|
80321
|
+
background: "conic-gradient(from 0deg, var(--zg-accent) 0 30%, transparent 30% 100%)",
|
|
80322
|
+
WebkitMaskImage: "radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px))",
|
|
80323
|
+
maskImage: "radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px))",
|
|
80324
|
+
animation: "zg-orbit 1.1s linear infinite"
|
|
80325
|
+
}
|
|
80240
80326
|
}
|
|
80241
80327
|
)
|
|
80242
80328
|
]
|
|
@@ -80615,7 +80701,7 @@ ${lines.slice(lines.length - USER_BASH_TAIL_LINES).join("\n")}`;
|
|
|
80615
80701
|
const badge = (() => {
|
|
80616
80702
|
if (row.running) {
|
|
80617
80703
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "inline-flex items-center gap-1.5 self-center", children: [
|
|
80618
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
80704
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SegmentSpinner, { size: "xs", tone: "muted" }),
|
|
80619
80705
|
sessionId && row.callId && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
80620
80706
|
"button",
|
|
80621
80707
|
{
|
|
@@ -80676,7 +80762,7 @@ function ToolTiming({
|
|
|
80676
80762
|
return null;
|
|
80677
80763
|
}
|
|
80678
80764
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "inline-flex items-center gap-1 shrink-0 self-center text-[10px] font-mono tabular-nums text-[var(--zg-text-muted)]", children: [
|
|
80679
|
-
running && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
80765
|
+
running && /* @__PURE__ */ jsxRuntimeExports.jsx(SegmentSpinner, { size: "xs" }),
|
|
80680
80766
|
formatToolMs(ms)
|
|
80681
80767
|
] });
|
|
80682
80768
|
}
|
|
@@ -84410,10 +84496,16 @@ function deriveDotState(input) {
|
|
|
84410
84496
|
}
|
|
84411
84497
|
function SessionStatusDotInner({ sessionId, override }) {
|
|
84412
84498
|
const running = useSessionRunning(sessionId);
|
|
84413
|
-
const
|
|
84499
|
+
const pendingApproval = useSessionApprovalHead(sessionId);
|
|
84500
|
+
const pendingInteraction = useInteractions().headFor(sessionId);
|
|
84414
84501
|
const notification = useSessionNotification(sessionId);
|
|
84415
84502
|
const presence = useSessionPresence(sessionId);
|
|
84416
|
-
const state = override ?? deriveDotState({
|
|
84503
|
+
const state = override ?? deriveDotState({
|
|
84504
|
+
pending: Boolean(pendingApproval) || Boolean(pendingInteraction),
|
|
84505
|
+
running,
|
|
84506
|
+
notification,
|
|
84507
|
+
presence
|
|
84508
|
+
});
|
|
84417
84509
|
const cfg = STYLES[state];
|
|
84418
84510
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
84419
84511
|
"span",
|
|
@@ -84422,24 +84514,24 @@ function SessionStatusDotInner({ sessionId, override }) {
|
|
|
84422
84514
|
title: cfg.label,
|
|
84423
84515
|
className: "relative shrink-0 inline-block w-2 h-2 rounded-full",
|
|
84424
84516
|
style: cfg.style,
|
|
84425
|
-
children: cfg.
|
|
84426
|
-
"span",
|
|
84427
|
-
{
|
|
84428
|
-
"aria-hidden": true,
|
|
84429
|
-
className: "absolute inset-0 rounded-full",
|
|
84430
|
-
style: { background: "var(--zg-accent)", animation: "zg-dot 1.8s ease-in-out infinite" }
|
|
84431
|
-
}
|
|
84432
|
-
)
|
|
84517
|
+
children: cfg.ring && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { "aria-hidden": true, className: `absolute rounded-full ${cfg.ring.className}`, style: cfg.ring.style })
|
|
84433
84518
|
}
|
|
84434
84519
|
);
|
|
84435
84520
|
}
|
|
84521
|
+
function orbitRing(color2) {
|
|
84522
|
+
const mask = "radial-gradient(farthest-side, transparent calc(100% - 1.5px), #000 calc(100% - 1.5px))";
|
|
84523
|
+
return {
|
|
84524
|
+
className: "-inset-[3px]",
|
|
84525
|
+
style: {
|
|
84526
|
+
background: `conic-gradient(from 0deg, ${color2} 0 32%, transparent 32% 100%)`,
|
|
84527
|
+
WebkitMaskImage: mask,
|
|
84528
|
+
maskImage: mask,
|
|
84529
|
+
animation: "zg-orbit 1.1s linear infinite"
|
|
84530
|
+
}
|
|
84531
|
+
};
|
|
84532
|
+
}
|
|
84436
84533
|
const SessionStatusDot = reactExports.memo(SessionStatusDotInner);
|
|
84437
84534
|
const STYLES = {
|
|
84438
|
-
/**
|
|
84439
|
-
* Hollow outline — no fill — so the dot is visible at rest without
|
|
84440
|
-
* competing with the title text for attention. Same dimensions as
|
|
84441
|
-
* the active variants so the row layout doesn't shift on state flip.
|
|
84442
|
-
*/
|
|
84443
84535
|
idle: {
|
|
84444
84536
|
label: "Idle",
|
|
84445
84537
|
style: {
|
|
@@ -84448,27 +84540,25 @@ const STYLES = {
|
|
|
84448
84540
|
opacity: 0.5
|
|
84449
84541
|
}
|
|
84450
84542
|
},
|
|
84451
|
-
|
|
84452
|
-
|
|
84453
|
-
* (Timeline's tool-running idiom). The ring is an absolute inset-0
|
|
84454
|
-
* child, so it never affects layout; the dot itself doesn't animate.
|
|
84455
|
-
*/
|
|
84543
|
+
// Core is a 5px radial fill (transparent edge, so it works on any row
|
|
84544
|
+
// background) leaving the orbiting arc breathing room in the 8px slot.
|
|
84456
84545
|
running: {
|
|
84457
84546
|
label: "Running",
|
|
84458
|
-
style: {
|
|
84459
|
-
|
|
84547
|
+
style: {
|
|
84548
|
+
background: "radial-gradient(circle, var(--zg-accent) 0 2.3px, transparent 2.6px)"
|
|
84549
|
+
},
|
|
84550
|
+
ring: orbitRing("var(--zg-accent)")
|
|
84460
84551
|
},
|
|
84552
|
+
// This window's own approval / question: the strongest "needs you" cue,
|
|
84553
|
+
// so it ripples outward instead of just breathing.
|
|
84461
84554
|
pending: {
|
|
84462
84555
|
label: "Pending approval",
|
|
84463
|
-
style: { background: "var(--zg-warn)" }
|
|
84556
|
+
style: { background: "var(--zg-warn)" },
|
|
84557
|
+
ring: {
|
|
84558
|
+
className: "inset-0",
|
|
84559
|
+
style: { background: "var(--zg-warn)", animation: "zg-dot 1.8s ease-in-out infinite" }
|
|
84560
|
+
}
|
|
84464
84561
|
},
|
|
84465
|
-
/**
|
|
84466
|
-
* Daemon presence: some window (possibly this one) has an approval /
|
|
84467
|
-
* interaction waiting. Same amber as `pending` (it's the same "needs
|
|
84468
|
-
* you" semantic — TUI ◉) plus a breathing glow — `zg-breathe` cycles
|
|
84469
|
-
* the whole element's opacity, so the soft amber halo swells and
|
|
84470
|
-
* settles with the dot. Alive while scanning, not alarming.
|
|
84471
|
-
*/
|
|
84472
84562
|
attention: {
|
|
84473
84563
|
label: "Awaiting input",
|
|
84474
84564
|
style: {
|
|
@@ -84477,25 +84567,27 @@ const STYLES = {
|
|
|
84477
84567
|
animation: "zg-breathe 1.2s ease-in-out infinite"
|
|
84478
84568
|
}
|
|
84479
84569
|
},
|
|
84480
|
-
/**
|
|
84481
|
-
* Daemon presence: attached elsewhere, nothing in flight — TUI ○.
|
|
84482
|
-
* Muted green, static — matches the TUI's attached color semantic
|
|
84483
|
-
* without motion, so only in-flight states draw the eye.
|
|
84484
|
-
*/
|
|
84485
84570
|
attached: {
|
|
84486
84571
|
label: "Attached",
|
|
84487
84572
|
style: {
|
|
84488
|
-
background: "
|
|
84489
|
-
|
|
84573
|
+
background: "transparent",
|
|
84574
|
+
boxShadow: "inset 0 0 0 1.5px var(--zg-success)",
|
|
84575
|
+
opacity: 0.8
|
|
84490
84576
|
}
|
|
84491
84577
|
},
|
|
84492
84578
|
completed: {
|
|
84493
84579
|
label: "Completed",
|
|
84494
|
-
style: {
|
|
84580
|
+
style: {
|
|
84581
|
+
background: "var(--zg-success)",
|
|
84582
|
+
animation: "zg-pop 320ms cubic-bezier(0.34, 1.56, 0.64, 1) 1"
|
|
84583
|
+
}
|
|
84495
84584
|
},
|
|
84496
84585
|
error: {
|
|
84497
84586
|
label: "Errored",
|
|
84498
|
-
style: {
|
|
84587
|
+
style: {
|
|
84588
|
+
background: "var(--zg-danger)",
|
|
84589
|
+
boxShadow: "0 0 5px 1px color-mix(in srgb, var(--zg-danger) 45%, transparent)"
|
|
84590
|
+
}
|
|
84499
84591
|
}
|
|
84500
84592
|
};
|
|
84501
84593
|
const PROJECT_GROUP_CAP = 5;
|
|
@@ -87180,7 +87272,8 @@ const SECTIONS = [
|
|
|
87180
87272
|
{ action: "cycleAgent", label: "Cycle agent (Build / Plan)" },
|
|
87181
87273
|
{ action: "openModelPicker", label: "Switch model" },
|
|
87182
87274
|
{ action: "openEffortPicker", label: "Reasoning effort" },
|
|
87183
|
-
{ action: "openTodos", label: "Todo list" }
|
|
87275
|
+
{ action: "openTodos", label: "Todo list" },
|
|
87276
|
+
{ action: "openArtifacts", label: "Artifacts" }
|
|
87184
87277
|
]
|
|
87185
87278
|
},
|
|
87186
87279
|
{
|
|
@@ -90467,7 +90560,7 @@ function ExtActionRow({
|
|
|
90467
90560
|
statusText && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `text-xs break-words ${statusClass}`, children: statusText })
|
|
90468
90561
|
] }),
|
|
90469
90562
|
/* @__PURE__ */ jsxRuntimeExports.jsx("button", { type: "button", onClick: onRun, disabled: anyBusy, className: `${BTN_SECONDARY} shrink-0`, children: lifecycle?.state === "busy" ? /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "flex items-center gap-1.5", children: [
|
|
90470
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
90563
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SegmentSpinner, { size: "xs", label: "Running" }),
|
|
90471
90564
|
"Running"
|
|
90472
90565
|
] }) : "Run" })
|
|
90473
90566
|
] });
|
|
@@ -90894,6 +90987,43 @@ const PANEL_SEARCH_ENTRIES = [
|
|
|
90894
90987
|
{ tab: "authentication", label: "Authentication", description: "Sign in to providers — API keys and OAuth." },
|
|
90895
90988
|
{ tab: "logs", label: "Logs", description: "Extension warnings, MCP diagnostics and host debug lines." }
|
|
90896
90989
|
];
|
|
90990
|
+
function AppVersion() {
|
|
90991
|
+
const [version, setVersion] = reactExports.useState(null);
|
|
90992
|
+
const [copied, setCopied] = reactExports.useState(false);
|
|
90993
|
+
reactExports.useEffect(() => {
|
|
90994
|
+
let cancelled = false;
|
|
90995
|
+
void window.api.app.version().then((v2) => {
|
|
90996
|
+
if (!cancelled) {
|
|
90997
|
+
setVersion(v2);
|
|
90998
|
+
}
|
|
90999
|
+
});
|
|
91000
|
+
return () => {
|
|
91001
|
+
cancelled = true;
|
|
91002
|
+
};
|
|
91003
|
+
}, []);
|
|
91004
|
+
reactExports.useEffect(() => {
|
|
91005
|
+
if (!copied) {
|
|
91006
|
+
return;
|
|
91007
|
+
}
|
|
91008
|
+
const t = setTimeout(() => setCopied(false), 1200);
|
|
91009
|
+
return () => clearTimeout(t);
|
|
91010
|
+
}, [copied]);
|
|
91011
|
+
if (!version) {
|
|
91012
|
+
return null;
|
|
91013
|
+
}
|
|
91014
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
91015
|
+
"button",
|
|
91016
|
+
{
|
|
91017
|
+
type: "button",
|
|
91018
|
+
onClick: () => {
|
|
91019
|
+
void navigator.clipboard.writeText(version).then(() => setCopied(true));
|
|
91020
|
+
},
|
|
91021
|
+
title: "Copy version",
|
|
91022
|
+
className: "mt-2 shrink-0 h-7 px-2.5 w-full text-left text-[11px] font-mono tabular-nums text-[var(--zg-text-muted)] bg-transparent border-0 rounded-md cursor-pointer hover:bg-[var(--zg-bg-hover)] hover:text-[var(--zg-text)] transition-colors duration-150 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--zg-accent)]",
|
|
91023
|
+
children: copied ? "copied" : `Zidane ${version}`
|
|
91024
|
+
}
|
|
91025
|
+
);
|
|
91026
|
+
}
|
|
90897
91027
|
function SettingsModal({ onClose, cwd: cwd2, actions = [], initialTab = "general", onCreateExtension }) {
|
|
90898
91028
|
const { settings, toggle, setSetting } = useSettings();
|
|
90899
91029
|
const [extensionThemes, setExtensionThemes] = reactExports.useState([]);
|
|
@@ -91135,38 +91265,41 @@ function SettingsModal({ onClose, cwd: cwd2, actions = [], initialTab = "general
|
|
|
91135
91265
|
size: "xxlarge",
|
|
91136
91266
|
scrollBody: false,
|
|
91137
91267
|
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-4 h-[min(76vh,640px)] max-h-full min-h-0", children: [
|
|
91138
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
91139
|
-
|
|
91140
|
-
|
|
91141
|
-
|
|
91142
|
-
|
|
91143
|
-
|
|
91144
|
-
|
|
91145
|
-
|
|
91146
|
-
|
|
91147
|
-
|
|
91148
|
-
|
|
91149
|
-
|
|
91150
|
-
|
|
91151
|
-
|
|
91152
|
-
|
|
91268
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-44 shrink-0 flex flex-col min-h-0", children: [
|
|
91269
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
91270
|
+
"nav",
|
|
91271
|
+
{
|
|
91272
|
+
role: "tablist",
|
|
91273
|
+
"aria-orientation": "vertical",
|
|
91274
|
+
"aria-label": "Settings sections",
|
|
91275
|
+
className: "flex-1 space-y-0.5 min-h-0 overflow-y-auto",
|
|
91276
|
+
onKeyDown: onRailKeyDown,
|
|
91277
|
+
children: TABS.map((tab2) => {
|
|
91278
|
+
const active = tab2.id === activeTab;
|
|
91279
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
91280
|
+
"button",
|
|
91281
|
+
{
|
|
91282
|
+
ref: (el) => {
|
|
91283
|
+
tabRefs.current[tab2.id] = el;
|
|
91284
|
+
},
|
|
91285
|
+
type: "button",
|
|
91286
|
+
role: "tab",
|
|
91287
|
+
"aria-selected": active,
|
|
91288
|
+
tabIndex: active ? 0 : -1,
|
|
91289
|
+
onClick: () => selectTab(tab2.id),
|
|
91290
|
+
className: `zg-press-subtle flex items-center gap-2.5 w-full h-8 text-left px-2.5 rounded-md border-0 cursor-pointer text-[13px] transition-colors duration-150 ${active ? "bg-[var(--zg-bg-hover)] text-[var(--zg-text)] font-medium" : "bg-transparent text-[var(--zg-text-muted)] hover:bg-[var(--zg-bg-hover)] hover:text-[var(--zg-text)]"}`,
|
|
91291
|
+
children: [
|
|
91292
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `${tab2.icon} text-sm shrink-0 ${active ? "text-[var(--zg-accent)]" : ""}` }),
|
|
91293
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "truncate", children: tab2.label })
|
|
91294
|
+
]
|
|
91153
91295
|
},
|
|
91154
|
-
|
|
91155
|
-
|
|
91156
|
-
|
|
91157
|
-
|
|
91158
|
-
|
|
91159
|
-
|
|
91160
|
-
|
|
91161
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `${tab2.icon} text-sm shrink-0 ${active ? "text-[var(--zg-accent)]" : ""}` }),
|
|
91162
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "truncate", children: tab2.label })
|
|
91163
|
-
]
|
|
91164
|
-
},
|
|
91165
|
-
tab2.id
|
|
91166
|
-
);
|
|
91167
|
-
})
|
|
91168
|
-
}
|
|
91169
|
-
),
|
|
91296
|
+
tab2.id
|
|
91297
|
+
);
|
|
91298
|
+
})
|
|
91299
|
+
}
|
|
91300
|
+
),
|
|
91301
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(AppVersion, {})
|
|
91302
|
+
] }),
|
|
91170
91303
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 min-w-0 min-h-0 flex flex-col", children: [
|
|
91171
91304
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "shrink-0 flex items-center justify-between gap-3 pb-3", children: [
|
|
91172
91305
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative w-72 max-w-full", children: [
|
|
@@ -91255,6 +91388,215 @@ function nextOption(row, current) {
|
|
|
91255
91388
|
const next = row.options[(idx + 1) % row.options.length];
|
|
91256
91389
|
return next.value;
|
|
91257
91390
|
}
|
|
91391
|
+
const ArtifactsContext = reactExports.createContext(null);
|
|
91392
|
+
function ArtifactsProvider({ children }) {
|
|
91393
|
+
const [byId, setById] = reactExports.useState(() => /* @__PURE__ */ new Map());
|
|
91394
|
+
const pending = reactExports.useRef(/* @__PURE__ */ new Set());
|
|
91395
|
+
const fetch = reactExports.useCallback(async (sessionId) => {
|
|
91396
|
+
const groups = await window.api.artifacts.list({ sessionId });
|
|
91397
|
+
setById((prev) => {
|
|
91398
|
+
const next = new Map(prev);
|
|
91399
|
+
next.set(sessionId, groups);
|
|
91400
|
+
return next;
|
|
91401
|
+
});
|
|
91402
|
+
}, []);
|
|
91403
|
+
reactExports.useEffect(() => {
|
|
91404
|
+
return window.api.chat.onStreamSignal((signal) => {
|
|
91405
|
+
if (signal.kind !== "artifact:recorded" && signal.kind !== "artifact:changed") return;
|
|
91406
|
+
const { sessionId } = signal;
|
|
91407
|
+
if (pending.current.has(sessionId)) return;
|
|
91408
|
+
pending.current.add(sessionId);
|
|
91409
|
+
queueMicrotask(() => {
|
|
91410
|
+
pending.current.delete(sessionId);
|
|
91411
|
+
void fetch(sessionId).catch(() => void 0);
|
|
91412
|
+
});
|
|
91413
|
+
});
|
|
91414
|
+
}, [fetch]);
|
|
91415
|
+
const groupsFor = reactExports.useCallback(
|
|
91416
|
+
(sessionId) => sessionId ? byId.get(sessionId) ?? null : null,
|
|
91417
|
+
[byId]
|
|
91418
|
+
);
|
|
91419
|
+
const value = reactExports.useMemo(() => ({ groupsFor, fetch }), [groupsFor, fetch]);
|
|
91420
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(ArtifactsContext.Provider, { value, children });
|
|
91421
|
+
}
|
|
91422
|
+
function useArtifactsFor(sessionId) {
|
|
91423
|
+
const ctx = reactExports.useContext(ArtifactsContext);
|
|
91424
|
+
if (!ctx) throw new Error("useArtifactsFor must be used within ArtifactsProvider");
|
|
91425
|
+
return ctx.groupsFor(sessionId);
|
|
91426
|
+
}
|
|
91427
|
+
function useArtifactsFetcher() {
|
|
91428
|
+
const ctx = reactExports.useContext(ArtifactsContext);
|
|
91429
|
+
if (!ctx) throw new Error("useArtifactsFetcher must be used within ArtifactsProvider");
|
|
91430
|
+
return ctx.fetch;
|
|
91431
|
+
}
|
|
91432
|
+
function countArtifacts(groups) {
|
|
91433
|
+
return groups ? groups.reduce((n, g) => n + g.rows.length, 0) : 0;
|
|
91434
|
+
}
|
|
91435
|
+
const GHOST_BTN$1 = "zg-press h-7 px-2 rounded-md text-xs text-[var(--zg-text-muted)] hover:text-[var(--zg-text)] hover:bg-[var(--zg-bg-hover)] border-0 bg-transparent cursor-pointer transition-colors duration-150 disabled:opacity-40 disabled:cursor-not-allowed";
|
|
91436
|
+
const TAB_BTN = (active) => `zg-press h-7 px-2.5 rounded-md text-xs border-0 cursor-pointer transition-colors duration-150 ${active ? "bg-[var(--zg-bg-hover)] text-[var(--zg-text)]" : "bg-transparent text-[var(--zg-text-muted)] hover:text-[var(--zg-text)]"}`;
|
|
91437
|
+
function ArtifactsModal({ sessionId, projectRoot, sessionTitle }) {
|
|
91438
|
+
const { close: close2 } = useModal();
|
|
91439
|
+
const cached = useArtifactsFor(sessionId);
|
|
91440
|
+
const fetchSession = useArtifactsFetcher();
|
|
91441
|
+
const [scope, setScope] = reactExports.useState("session");
|
|
91442
|
+
const [project, setProject] = reactExports.useState(null);
|
|
91443
|
+
const [error, setError] = reactExports.useState(null);
|
|
91444
|
+
reactExports.useEffect(() => {
|
|
91445
|
+
void fetchSession(sessionId).catch((err) => setError(err.message));
|
|
91446
|
+
}, [fetchSession, sessionId]);
|
|
91447
|
+
const loadProject = reactExports.useCallback(async () => {
|
|
91448
|
+
if (!projectRoot) return;
|
|
91449
|
+
try {
|
|
91450
|
+
setProject(await window.api.artifacts.list({ projectRoot }));
|
|
91451
|
+
} catch (err) {
|
|
91452
|
+
setError(err.message);
|
|
91453
|
+
}
|
|
91454
|
+
}, [projectRoot]);
|
|
91455
|
+
reactExports.useEffect(() => {
|
|
91456
|
+
if (scope !== "project") return;
|
|
91457
|
+
void loadProject();
|
|
91458
|
+
return window.api.chat.onStreamSignal((signal) => {
|
|
91459
|
+
if (signal.kind === "artifact:recorded" || signal.kind === "artifact:changed") void loadProject();
|
|
91460
|
+
});
|
|
91461
|
+
}, [scope, loadProject]);
|
|
91462
|
+
const groups = scope === "project" ? project : cached;
|
|
91463
|
+
const total = countArtifacts(groups);
|
|
91464
|
+
const refreshed = reactExports.useRef(/* @__PURE__ */ new Set());
|
|
91465
|
+
const refresh = reactExports.useCallback((row) => {
|
|
91466
|
+
if (refreshed.current.has(row.artifact.id)) return;
|
|
91467
|
+
refreshed.current.add(row.artifact.id);
|
|
91468
|
+
void window.api.artifacts.refresh(row.artifact).catch(() => void 0);
|
|
91469
|
+
}, []);
|
|
91470
|
+
const remove = reactExports.useCallback(
|
|
91471
|
+
(row) => {
|
|
91472
|
+
setError(null);
|
|
91473
|
+
void window.api.artifacts.delete(row.artifact.sessionId, row.artifact.id).then((ok2) => {
|
|
91474
|
+
if (!ok2) setError("This session store does not support artifacts.");
|
|
91475
|
+
else if (scope === "project") void loadProject();
|
|
91476
|
+
}).catch((err) => setError(err.message));
|
|
91477
|
+
},
|
|
91478
|
+
[scope, loadProject]
|
|
91479
|
+
);
|
|
91480
|
+
const description = reactExports.useMemo(() => {
|
|
91481
|
+
if (groups === null) return "Loading…";
|
|
91482
|
+
if (total === 0) {
|
|
91483
|
+
return scope === "project" ? `No artifacts recorded for ${projectRoot} yet.` : "No artifacts yet — pull requests, branches, commits and created files land here as the agent produces them.";
|
|
91484
|
+
}
|
|
91485
|
+
return groups.map((g) => `${g.rows.length} ${plural(g.label, g.rows.length)}`).join(" · ");
|
|
91486
|
+
}, [groups, total, scope, projectRoot]);
|
|
91487
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
91488
|
+
ModalShell,
|
|
91489
|
+
{
|
|
91490
|
+
title: "Artifacts",
|
|
91491
|
+
description,
|
|
91492
|
+
onClose: close2,
|
|
91493
|
+
size: "medium",
|
|
91494
|
+
footer: projectRoot ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-1 w-full", children: [
|
|
91495
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("button", { type: "button", className: TAB_BTN(scope === "session"), onClick: () => setScope("session"), children: "This session" }),
|
|
91496
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
91497
|
+
"button",
|
|
91498
|
+
{
|
|
91499
|
+
type: "button",
|
|
91500
|
+
className: TAB_BTN(scope === "project"),
|
|
91501
|
+
onClick: () => setScope("project"),
|
|
91502
|
+
title: `Every session under ${projectRoot}`,
|
|
91503
|
+
children: "Project"
|
|
91504
|
+
}
|
|
91505
|
+
)
|
|
91506
|
+
] }) : void 0,
|
|
91507
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-3 p-4", children: [
|
|
91508
|
+
error && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs text-[var(--zg-warn)] px-1", role: "alert", children: error }),
|
|
91509
|
+
groups && total > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-3 overflow-y-auto", children: groups.map((group) => /* @__PURE__ */ jsxRuntimeExports.jsxs("section", { className: "flex flex-col gap-1.5", children: [
|
|
91510
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "m-0 text-[11px] uppercase tracking-wide text-[var(--zg-text-muted)] px-1", children: group.rows.length === 1 ? group.label : `${group.label}s` }),
|
|
91511
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: "flex flex-col gap-1.5 m-0 list-none p-0", children: group.rows.map((row) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
91512
|
+
ArtifactRow,
|
|
91513
|
+
{
|
|
91514
|
+
row,
|
|
91515
|
+
showSession: scope === "project",
|
|
91516
|
+
sessionTitle,
|
|
91517
|
+
onFocus: () => refresh(row),
|
|
91518
|
+
onRemove: () => remove(row)
|
|
91519
|
+
},
|
|
91520
|
+
row.artifact.id
|
|
91521
|
+
)) })
|
|
91522
|
+
] }, group.kind)) })
|
|
91523
|
+
] })
|
|
91524
|
+
}
|
|
91525
|
+
);
|
|
91526
|
+
}
|
|
91527
|
+
function ArtifactRow({
|
|
91528
|
+
row,
|
|
91529
|
+
showSession,
|
|
91530
|
+
sessionTitle,
|
|
91531
|
+
onFocus,
|
|
91532
|
+
onRemove
|
|
91533
|
+
}) {
|
|
91534
|
+
const { artifact, row: view } = row;
|
|
91535
|
+
const href = view.href;
|
|
91536
|
+
const isUrl2 = href !== void 0 && /^https?:\/\//.test(href);
|
|
91537
|
+
const session = showSession ? sessionTitle?.(artifact.sessionId) ?? artifact.sessionId.slice(0, 8) : void 0;
|
|
91538
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
91539
|
+
"li",
|
|
91540
|
+
{
|
|
91541
|
+
className: "group flex items-start gap-3 px-3 py-2 rounded-md bg-[var(--zg-bg)] border border-[var(--zg-border)]",
|
|
91542
|
+
onMouseEnter: onFocus,
|
|
91543
|
+
onFocus,
|
|
91544
|
+
children: [
|
|
91545
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 min-w-0 flex flex-col gap-0.5", children: [
|
|
91546
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 min-w-0", children: [
|
|
91547
|
+
isUrl2 ? (
|
|
91548
|
+
// `target="_blank"` routes through main's window-open handler → `shell.openExternal`.
|
|
91549
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
91550
|
+
"a",
|
|
91551
|
+
{
|
|
91552
|
+
href,
|
|
91553
|
+
target: "_blank",
|
|
91554
|
+
rel: "noreferrer",
|
|
91555
|
+
className: "truncate text-sm text-[var(--zg-text)] hover:text-[var(--zg-accent)] no-underline hover:underline",
|
|
91556
|
+
title: href,
|
|
91557
|
+
children: view.title
|
|
91558
|
+
}
|
|
91559
|
+
)
|
|
91560
|
+
) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "truncate text-sm text-[var(--zg-text)]", title: href ?? artifact.uri, children: view.title }),
|
|
91561
|
+
view.status && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "shrink-0 text-[10px] uppercase tracking-wide px-1.5 py-0.5 rounded bg-[var(--zg-bg-hover)] text-[var(--zg-text-muted)]", children: view.status }),
|
|
91562
|
+
session && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "shrink-0 text-xs text-[var(--zg-text-muted)]", children: [
|
|
91563
|
+
"— ",
|
|
91564
|
+
session
|
|
91565
|
+
] })
|
|
91566
|
+
] }),
|
|
91567
|
+
view.subtitle && view.subtitle !== view.title && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "truncate text-xs text-[var(--zg-text-muted)] font-mono", title: view.subtitle, children: view.subtitle })
|
|
91568
|
+
] }),
|
|
91569
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
91570
|
+
"button",
|
|
91571
|
+
{
|
|
91572
|
+
type: "button",
|
|
91573
|
+
"aria-label": "Copy locator",
|
|
91574
|
+
title: "Copy",
|
|
91575
|
+
onClick: () => void navigator.clipboard.writeText(href ?? artifact.uri),
|
|
91576
|
+
className: `${GHOST_BTN$1} opacity-0 group-hover:opacity-100 focus-visible:opacity-100`,
|
|
91577
|
+
children: "copy"
|
|
91578
|
+
}
|
|
91579
|
+
),
|
|
91580
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
91581
|
+
"button",
|
|
91582
|
+
{
|
|
91583
|
+
type: "button",
|
|
91584
|
+
"aria-label": "Remove artifact",
|
|
91585
|
+
title: "Remove from this session",
|
|
91586
|
+
onClick: onRemove,
|
|
91587
|
+
className: "opacity-0 group-hover:opacity-100 focus-visible:opacity-100 text-[var(--zg-text-muted)] hover:text-[var(--zg-error)] bg-transparent border-0 p-0 cursor-pointer text-base leading-6 transition-opacity",
|
|
91588
|
+
children: "×"
|
|
91589
|
+
}
|
|
91590
|
+
)
|
|
91591
|
+
]
|
|
91592
|
+
}
|
|
91593
|
+
);
|
|
91594
|
+
}
|
|
91595
|
+
function plural(label, count2) {
|
|
91596
|
+
const lower2 = label.toLowerCase();
|
|
91597
|
+
if (count2 === 1) return lower2;
|
|
91598
|
+
return /(?:s|x|ch|sh)$/.test(lower2) ? `${lower2}es` : `${lower2}s`;
|
|
91599
|
+
}
|
|
91258
91600
|
const TONE_CLS = {
|
|
91259
91601
|
ok: "text-[var(--zg-accent)]",
|
|
91260
91602
|
warn: "text-[#f59e0b]",
|
|
@@ -91697,7 +92039,6 @@ function formatElapsed(ms) {
|
|
|
91697
92039
|
function AppShell() {
|
|
91698
92040
|
useNativeChromeZoomVar();
|
|
91699
92041
|
const { sessions, activeSessionId, setActiveSessionId, defaultFolder, refresh: refreshSessions } = useSessions();
|
|
91700
|
-
const queue = useSafeModeQueue();
|
|
91701
92042
|
const interactions = useInteractions();
|
|
91702
92043
|
const modal = useModal();
|
|
91703
92044
|
const modalIsOpenRef = reactExports.useRef(modal.isOpen);
|
|
@@ -91832,15 +92173,6 @@ function AppShell() {
|
|
|
91832
92173
|
setRunningWork([]);
|
|
91833
92174
|
};
|
|
91834
92175
|
}, [activeSessionId]);
|
|
91835
|
-
reactExports.useEffect(() => {
|
|
91836
|
-
if (activeSessionId) {
|
|
91837
|
-
return;
|
|
91838
|
-
}
|
|
91839
|
-
const pending = queue.find((r2) => r2.sessionId && sessions.some((s2) => s2.id === r2.sessionId));
|
|
91840
|
-
if (pending?.sessionId) {
|
|
91841
|
-
setActiveSessionId(pending.sessionId);
|
|
91842
|
-
}
|
|
91843
|
-
}, [activeSessionId, queue, sessions, setActiveSessionId]);
|
|
91844
92176
|
const autoOpenedInteractionRef = reactExports.useRef(null);
|
|
91845
92177
|
reactExports.useEffect(() => {
|
|
91846
92178
|
if (modal.isOpen) {
|
|
@@ -91857,15 +92189,6 @@ function AppShell() {
|
|
|
91857
92189
|
modal.open(/* @__PURE__ */ jsxRuntimeExports.jsx(AskUserModal, { request: head2.request }, head2.request.id));
|
|
91858
92190
|
}
|
|
91859
92191
|
}, [interactions, activeSessionId, modal]);
|
|
91860
|
-
reactExports.useEffect(() => {
|
|
91861
|
-
if (activeSessionId) {
|
|
91862
|
-
return;
|
|
91863
|
-
}
|
|
91864
|
-
const head2 = interactions.pending.find((p2) => p2.live && sessions.some((s2) => s2.id === p2.sessionId));
|
|
91865
|
-
if (head2) {
|
|
91866
|
-
setActiveSessionId(head2.sessionId);
|
|
91867
|
-
}
|
|
91868
|
-
}, [activeSessionId, interactions.pending, sessions, setActiveSessionId]);
|
|
91869
92192
|
reactExports.useEffect(() => {
|
|
91870
92193
|
let cancelled = false;
|
|
91871
92194
|
void window.api.auth.hasAny().then((hasAny) => {
|
|
@@ -92140,6 +92463,22 @@ function AppShell() {
|
|
|
92140
92463
|
}
|
|
92141
92464
|
modal.open(/* @__PURE__ */ jsxRuntimeExports.jsx(TodosModal, { sessionId: activeSession.id }));
|
|
92142
92465
|
}, [modal, activeSession]);
|
|
92466
|
+
const openArtifacts = reactExports.useCallback(() => {
|
|
92467
|
+
if (!activeSession) {
|
|
92468
|
+
return;
|
|
92469
|
+
}
|
|
92470
|
+
const projectRoot = activeSession.projectRoot ?? activeSession.cwd;
|
|
92471
|
+
modal.open(
|
|
92472
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
92473
|
+
ArtifactsModal,
|
|
92474
|
+
{
|
|
92475
|
+
sessionId: activeSession.id,
|
|
92476
|
+
...projectRoot ? { projectRoot } : {},
|
|
92477
|
+
sessionTitle: (id) => sessions.find((s2) => s2.id === id)?.title
|
|
92478
|
+
}
|
|
92479
|
+
)
|
|
92480
|
+
);
|
|
92481
|
+
}, [modal, activeSession, sessions]);
|
|
92143
92482
|
const openUsagePanel = reactExports.useCallback(() => {
|
|
92144
92483
|
modal.open(/* @__PURE__ */ jsxRuntimeExports.jsx(UsagePanelModal, { activeProviderKey: activeSession?.providerKey ?? null }));
|
|
92145
92484
|
}, [modal, activeSession]);
|
|
@@ -92272,6 +92611,7 @@ function AppShell() {
|
|
|
92272
92611
|
...activeSession ? { openEffortPicker } : {},
|
|
92273
92612
|
...activeSession ? { openModelPicker } : {},
|
|
92274
92613
|
...activeSession ? { openTodos } : {},
|
|
92614
|
+
...activeSession ? { openArtifacts } : {},
|
|
92275
92615
|
openUsagePanel,
|
|
92276
92616
|
openMainSession,
|
|
92277
92617
|
newSession: () => setActiveSessionId(null),
|
|
@@ -92293,6 +92633,7 @@ function AppShell() {
|
|
|
92293
92633
|
openEffortPicker,
|
|
92294
92634
|
openModelPicker,
|
|
92295
92635
|
openTodos,
|
|
92636
|
+
openArtifacts,
|
|
92296
92637
|
openUsagePanel,
|
|
92297
92638
|
openMainSession,
|
|
92298
92639
|
setActiveSessionId,
|
|
@@ -92483,7 +92824,7 @@ function McpAuthProvider({ children }) {
|
|
|
92483
92824
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(McpAuthContext.Provider, { value, children });
|
|
92484
92825
|
}
|
|
92485
92826
|
function AppProviders({ children }) {
|
|
92486
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Provider, { delayDuration: 300, children: /* @__PURE__ */ jsxRuntimeExports.jsx(SettingsProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ProviderUsageProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(SafeModeProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(McpAuthProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(DiscoveryProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(StreamProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(PresenceProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(TodosProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(MessageQueueProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(PromptHistoryProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectTurnProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(InteractionsProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(SessionsProvider, { children }) }) }) }) }) }) }) }) }) }) }) }) }) });
|
|
92827
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Provider, { delayDuration: 300, children: /* @__PURE__ */ jsxRuntimeExports.jsx(SettingsProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ProviderUsageProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(SafeModeProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(McpAuthProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(DiscoveryProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(StreamProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(PresenceProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(TodosProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ArtifactsProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(MessageQueueProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(PromptHistoryProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectTurnProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(InteractionsProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(SessionsProvider, { children }) }) }) }) }) }) }) }) }) }) }) }) }) }) });
|
|
92487
92828
|
}
|
|
92488
92829
|
function ThemedShell({ children }) {
|
|
92489
92830
|
const { settings } = useSettings();
|