@serkanalgur/opencode-nexus 1.7.0 → 1.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/README.md +254 -330
  2. package/dist/index.js +1183 -50
  3. package/dist/tui.js +177 -12
  4. package/package.json +1 -1
package/dist/tui.js CHANGED
@@ -34535,21 +34535,29 @@ var tui_default = define({
34535
34535
  break;
34536
34536
  case "web":
34537
34537
  case "w":
34538
- try {
34538
+ {
34539
34539
  const port = parts[1] ? parseInt(parts[1]) : 4747;
34540
+ const host = parts[2] || "127.0.0.1";
34540
34541
  context.ui.toast.show({
34541
- title: "Nexus Dashboard",
34542
- message: `Starting web dashboard on port ${port}...
34543
- Open http://localhost:${port} in your browser`,
34542
+ title: "⚡ Nexus Web Dashboard",
34543
+ message: [
34544
+ `Starting dashboard on port ${port}...`,
34545
+ "",
34546
+ `Ask the agent to run: nexus.dashboard.start(port=${port})`,
34547
+ "",
34548
+ `Or type: nexus.dashboard.start with port=${port} in your next message`,
34549
+ "",
34550
+ `Then open: http://${host}:${port}`
34551
+ ].join(`
34552
+ `),
34544
34553
  variant: "success",
34545
- duration: 5000
34546
- });
34547
- } catch (e) {
34548
- context.ui.toast.show({
34549
- title: "Nexus",
34550
- message: `Failed to start dashboard: ${e.message}`,
34551
- variant: "error"
34554
+ duration: 8000
34552
34555
  });
34556
+ try {
34557
+ const { exec } = await import("node:child_process");
34558
+ const cmd = process.platform === "darwin" ? "open" : process.platform === "win32" ? "start" : "xdg-open";
34559
+ exec(`${cmd} http://${host}:${port}`);
34560
+ } catch {}
34553
34561
  }
34554
34562
  break;
34555
34563
  case "model":
@@ -34621,6 +34629,35 @@ Open http://localhost:${port} in your browser`,
34621
34629
  await handleDashboard();
34622
34630
  }
34623
34631
  },
34632
+ {
34633
+ id: "nexus.web",
34634
+ title: "Start Nexus Web Dashboard",
34635
+ group: "Nexus",
34636
+ palette: true,
34637
+ slash: { name: "nexus-web", aliases: ["nw"], arguments: true },
34638
+ enabled: () => true,
34639
+ suggested: true,
34640
+ run: async (input) => {
34641
+ const port = input ? parseInt(input) : 4747;
34642
+ const host = "127.0.0.1";
34643
+ context.ui.toast.show({
34644
+ title: "⚡ Nexus Web Dashboard",
34645
+ message: [
34646
+ `Port: ${port} Host: ${host}`,
34647
+ "",
34648
+ "To start the dashboard, ask the agent:",
34649
+ ` nexus.dashboard.start(port=${port}, host="${host}")`,
34650
+ "",
34651
+ `Then open: http://${host}:${port}`,
34652
+ "",
34653
+ "Tip: The dashboard shows live agent status, costs, and history."
34654
+ ].join(`
34655
+ `),
34656
+ variant: "info",
34657
+ duration: 12000
34658
+ });
34659
+ }
34660
+ },
34624
34661
  {
34625
34662
  id: "nexus.model",
34626
34663
  title: "Select Agent Model",
@@ -34699,7 +34736,135 @@ Open http://localhost:${port} in your browser`,
34699
34736
  variant: "info",
34700
34737
  duration: 3000
34701
34738
  });
34702
- return () => {};
34739
+ const [sidebarState, setSidebarState] = context.storage.memory("nexus-sidebar-state", {
34740
+ initial: {
34741
+ agents: [],
34742
+ totalCost: 0,
34743
+ budgetRemaining: 10
34744
+ }
34745
+ });
34746
+ const unsubStorage = context.data.on("model.updated", (event) => {});
34747
+ const unsubSidebar = context.ui.slot({
34748
+ append: "sidebar.content",
34749
+ render: (props) => {
34750
+ const family = context.data.session.family(props.sessionID);
34751
+ const sessions = context.data.session.list();
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) {
34754
+ return null;
34755
+ }
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
+ const activeAgents = agents.filter((a) => a.status === "working" || a.status === "idle");
34768
+ const completedAgents = agents.filter((a) => a.status === "completed");
34769
+ const failedAgents = agents.filter((a) => a.status === "failed");
34770
+ return /* @__PURE__ */ jsxDEV("div", {
34771
+ style: {
34772
+ padding: "8px",
34773
+ borderTop: "1px solid #333",
34774
+ marginTop: "8px"
34775
+ },
34776
+ children: [
34777
+ /* @__PURE__ */ jsxDEV("div", {
34778
+ style: {
34779
+ fontSize: "11px",
34780
+ color: "#888",
34781
+ marginBottom: "4px",
34782
+ display: "flex",
34783
+ justifyContent: "space-between",
34784
+ alignItems: "center"
34785
+ },
34786
+ children: [
34787
+ /* @__PURE__ */ jsxDEV("span", {
34788
+ children: "\uD83E\uDD16 Nexus Agents"
34789
+ }, undefined, false, undefined, this),
34790
+ /* @__PURE__ */ jsxDEV("span", {
34791
+ style: { color: "#666" },
34792
+ children: [
34793
+ activeAgents.length,
34794
+ " active"
34795
+ ]
34796
+ }, undefined, true, undefined, this)
34797
+ ]
34798
+ }, undefined, true, undefined, this),
34799
+ activeAgents.map((agent) => /* @__PURE__ */ jsxDEV("div", {
34800
+ style: {
34801
+ fontSize: "10px",
34802
+ padding: "2px 0",
34803
+ color: agent.status === "working" ? "#4ade80" : "#94a3b8"
34804
+ },
34805
+ children: [
34806
+ /* @__PURE__ */ jsxDEV("span", {
34807
+ children: agent.status === "working" ? "\uD83D\uDD04" : "⏸️"
34808
+ }, undefined, false, undefined, this),
34809
+ " ",
34810
+ agent.name,
34811
+ agent.model && /* @__PURE__ */ jsxDEV("span", {
34812
+ style: { color: "#64748b" },
34813
+ children: [
34814
+ " — ",
34815
+ agent.model.split("/").pop()
34816
+ ]
34817
+ }, undefined, true, undefined, this)
34818
+ ]
34819
+ }, agent.id, true, undefined, this)),
34820
+ completedAgents.length > 0 && /* @__PURE__ */ jsxDEV("div", {
34821
+ style: {
34822
+ marginTop: "4px",
34823
+ paddingTop: "4px",
34824
+ borderTop: "1px solid #222"
34825
+ },
34826
+ children: /* @__PURE__ */ jsxDEV("div", {
34827
+ style: { fontSize: "10px", color: "#666", marginBottom: "2px" },
34828
+ children: [
34829
+ "✅ ",
34830
+ completedAgents.length,
34831
+ " completed"
34832
+ ]
34833
+ }, undefined, true, undefined, this)
34834
+ }, undefined, false, undefined, this),
34835
+ failedAgents.length > 0 && /* @__PURE__ */ jsxDEV("div", {
34836
+ style: { marginTop: "2px" },
34837
+ children: /* @__PURE__ */ jsxDEV("div", {
34838
+ style: { fontSize: "10px", color: "#ef4444", marginBottom: "2px" },
34839
+ children: [
34840
+ "❌ ",
34841
+ failedAgents.length,
34842
+ " failed"
34843
+ ]
34844
+ }, undefined, true, undefined, this)
34845
+ }, undefined, false, undefined, this),
34846
+ sidebarState.totalCost > 0 && /* @__PURE__ */ jsxDEV("div", {
34847
+ style: {
34848
+ marginTop: "4px",
34849
+ fontSize: "10px",
34850
+ color: "#666"
34851
+ },
34852
+ children: [
34853
+ "\uD83D\uDCB0 $",
34854
+ sidebarState.totalCost.toFixed(4),
34855
+ " / $",
34856
+ sidebarState.budgetRemaining.toFixed(2),
34857
+ " remaining"
34858
+ ]
34859
+ }, undefined, true, undefined, this)
34860
+ ]
34861
+ }, undefined, true, undefined, this);
34862
+ }
34863
+ });
34864
+ return () => {
34865
+ unsubStorage();
34866
+ unsubSidebar();
34867
+ };
34703
34868
  }
34704
34869
  });
34705
34870
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serkanalgur/opencode-nexus",
3
- "version": "1.7.0",
3
+ "version": "1.8.1",
4
4
  "description": "Adaptive Multi-Agent Orchestration with Cost Intelligence for OpenCode V2",
5
5
  "keywords": [
6
6
  "opencode",