@serkanalgur/opencode-nexus 1.8.1 → 1.8.3
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/tui.js +24 -17
- package/package.json +1 -1
package/dist/tui.js
CHANGED
|
@@ -34743,27 +34743,33 @@ var tui_default = define({
|
|
|
34743
34743
|
budgetRemaining: 10
|
|
34744
34744
|
}
|
|
34745
34745
|
});
|
|
34746
|
-
const
|
|
34746
|
+
const unsubSessionSucceeded = context.data.on("session.execution.succeeded", (event) => {
|
|
34747
|
+
const sessionId = event.data.sessionID;
|
|
34748
|
+
setSidebarState((draft) => {
|
|
34749
|
+
const agent = draft.agents.find((a) => a.sessionID === sessionId);
|
|
34750
|
+
if (agent) {
|
|
34751
|
+
agent.status = "completed";
|
|
34752
|
+
agent.tasksCompleted++;
|
|
34753
|
+
}
|
|
34754
|
+
});
|
|
34755
|
+
});
|
|
34756
|
+
const unsubSessionFailed = context.data.on("session.execution.failed", (event) => {
|
|
34757
|
+
const sessionId = event.data.sessionID;
|
|
34758
|
+
setSidebarState((draft) => {
|
|
34759
|
+
const agent = draft.agents.find((a) => a.sessionID === sessionId);
|
|
34760
|
+
if (agent) {
|
|
34761
|
+
agent.status = "failed";
|
|
34762
|
+
agent.tasksFailed++;
|
|
34763
|
+
}
|
|
34764
|
+
});
|
|
34765
|
+
});
|
|
34747
34766
|
const unsubSidebar = context.ui.slot({
|
|
34748
34767
|
append: "sidebar.content",
|
|
34749
34768
|
render: (props) => {
|
|
34750
|
-
const
|
|
34751
|
-
|
|
34752
|
-
const childSessions = family.filter((id) => id !== props.sessionID).map((id) => context.data.session.get(id)).filter(Boolean);
|
|
34753
|
-
if (childSessions.length === 0 && sidebarState.agents.length === 0) {
|
|
34769
|
+
const agents = sidebarState.agents;
|
|
34770
|
+
if (!agents || agents.length === 0) {
|
|
34754
34771
|
return null;
|
|
34755
34772
|
}
|
|
34756
|
-
const agents = sidebarState.agents.length > 0 ? sidebarState.agents : childSessions.map((s) => ({
|
|
34757
|
-
id: s.id,
|
|
34758
|
-
name: s.title || s.id.slice(0, 12),
|
|
34759
|
-
role: "agent",
|
|
34760
|
-
status: "idle",
|
|
34761
|
-
model: "",
|
|
34762
|
-
sessionID: s.id,
|
|
34763
|
-
spawnedAt: new Date().toISOString(),
|
|
34764
|
-
tasksCompleted: 0,
|
|
34765
|
-
tasksFailed: 0
|
|
34766
|
-
}));
|
|
34767
34773
|
const activeAgents = agents.filter((a) => a.status === "working" || a.status === "idle");
|
|
34768
34774
|
const completedAgents = agents.filter((a) => a.status === "completed");
|
|
34769
34775
|
const failedAgents = agents.filter((a) => a.status === "failed");
|
|
@@ -34862,7 +34868,8 @@ var tui_default = define({
|
|
|
34862
34868
|
}
|
|
34863
34869
|
});
|
|
34864
34870
|
return () => {
|
|
34865
|
-
|
|
34871
|
+
unsubSessionSucceeded();
|
|
34872
|
+
unsubSessionFailed();
|
|
34866
34873
|
unsubSidebar();
|
|
34867
34874
|
};
|
|
34868
34875
|
}
|