@kl-c/matrixos 0.3.21 → 0.3.23

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.
@@ -4,3 +4,9 @@ export interface DashboardCliOptions {
4
4
  readonly daemon?: boolean;
5
5
  }
6
6
  export declare function dashboardCli(options: DashboardCliOptions): Promise<number>;
7
+ /**
8
+ * Kill any existing dashboard process bound to the target port, then start a fresh
9
+ * daemon instance. Allows Morpheus (or any agent) to self-heal the dashboard with a
10
+ * single idempotent command: `matrixos dashboard restart --host 0.0.0.0`.
11
+ */
12
+ export declare function restartDashboard(options: DashboardCliOptions): Promise<number>;
package/dist/cli/index.js CHANGED
@@ -2163,7 +2163,7 @@ var package_default;
2163
2163
  var init_package = __esm(() => {
2164
2164
  package_default = {
2165
2165
  name: "@kl-c/matrixos",
2166
- version: "0.3.21",
2166
+ version: "0.3.23",
2167
2167
  description: "MaTrixOS \u2014 Agentic OS for OpenCode. Personalizable, communicating, self-improving, resilient.",
2168
2168
  main: "./dist/index.js",
2169
2169
  types: "dist/index.d.ts",
@@ -186830,6 +186830,14 @@ function createDataProvider(config5) {
186830
186830
  return result;
186831
186831
  },
186832
186832
  getModels() {
186833
+ try {
186834
+ const { execSync: execSync2 } = __require("child_process");
186835
+ const raw = execSync2("opencode models 2>/dev/null", { encoding: "utf-8", timeout: 1e4 });
186836
+ const parsed = raw.split(`
186837
+ `).map((l2) => l2.trim()).filter((l2) => l2.includes("/") && !l2.startsWith("[") && !l2.toLowerCase().includes("debug"));
186838
+ if (parsed.length > 0)
186839
+ return parsed;
186840
+ } catch {}
186833
186841
  return AVAILABLE_MODELS;
186834
186842
  },
186835
186843
  updateAgentModel(agentName, model) {
@@ -187448,6 +187456,29 @@ async function dashboardCli(options) {
187448
187456
  return 1;
187449
187457
  }
187450
187458
  }
187459
+ async function restartDashboard(options) {
187460
+ const port3 = options.port ?? 9123;
187461
+ const host = options.host ?? "0.0.0.0";
187462
+ try {
187463
+ const { execSync: execSync2 } = __require("child_process");
187464
+ if (process.platform === "win32") {
187465
+ const pid = execSync2(`netstat -ano | findstr :${port3} | findstr LISTENING`, { encoding: "utf-8" }).split(`
187466
+ `)[0]?.trim().split(/\s+/).pop();
187467
+ if (pid)
187468
+ execSync2(`taskkill /PID ${pid} /F`);
187469
+ } else {
187470
+ const pids = execSync2(`lsof -ti tcp:${port3} 2>/dev/null || true`, { encoding: "utf-8" }).split(`
187471
+ `).map((l2) => l2.trim()).filter(Boolean);
187472
+ for (const pid of pids) {
187473
+ try {
187474
+ execSync2(`kill -9 ${pid} 2>/dev/null || true`);
187475
+ } catch {}
187476
+ }
187477
+ }
187478
+ } catch {}
187479
+ await new Promise((r2) => setTimeout(r2, 1500));
187480
+ return dashboardCli({ ...options, port: port3, host, daemon: true });
187481
+ }
187451
187482
 
187452
187483
  // packages/omo-opencode/src/cli/architect.ts
187453
187484
  import { join as join75 } from "path";
@@ -187748,6 +187779,13 @@ function configureRuntimeCommands(program2) {
187748
187779
  if (!options.daemon)
187749
187780
  process.exit(exitCode);
187750
187781
  });
187782
+ program2.command("dashboard:restart").description("Restart the MaTrixOS web dashboard (kill existing + start daemon)").option("-p, --port <number>", "HTTP port", "9123").option("--host <addr>", "Bind address", "0.0.0.0").action(async (options) => {
187783
+ const exitCode = await restartDashboard({
187784
+ port: parseInt(options.port ?? "9123", 10),
187785
+ host: options.host ?? "0.0.0.0"
187786
+ });
187787
+ process.exit(exitCode);
187788
+ });
187751
187789
  }
187752
187790
 
187753
187791
  // packages/omo-opencode/src/cli/cli-program.ts
@@ -2163,7 +2163,7 @@ var package_default;
2163
2163
  var init_package = __esm(() => {
2164
2164
  package_default = {
2165
2165
  name: "@kl-c/matrixos",
2166
- version: "0.3.21",
2166
+ version: "0.3.23",
2167
2167
  description: "MaTrixOS \u2014 Agentic OS for OpenCode. Personalizable, communicating, self-improving, resilient.",
2168
2168
  main: "./dist/index.js",
2169
2169
  types: "dist/index.d.ts",
@@ -186885,6 +186885,14 @@ function createDataProvider(config5) {
186885
186885
  return result;
186886
186886
  },
186887
186887
  getModels() {
186888
+ try {
186889
+ const { execSync: execSync2 } = __require("child_process");
186890
+ const raw = execSync2("opencode models 2>/dev/null", { encoding: "utf-8", timeout: 1e4 });
186891
+ const parsed = raw.split(`
186892
+ `).map((l2) => l2.trim()).filter((l2) => l2.includes("/") && !l2.startsWith("[") && !l2.toLowerCase().includes("debug"));
186893
+ if (parsed.length > 0)
186894
+ return parsed;
186895
+ } catch {}
186888
186896
  return AVAILABLE_MODELS;
186889
186897
  },
186890
186898
  updateAgentModel(agentName, model) {
@@ -187503,6 +187511,29 @@ async function dashboardCli(options) {
187503
187511
  return 1;
187504
187512
  }
187505
187513
  }
187514
+ async function restartDashboard(options) {
187515
+ const port3 = options.port ?? 9123;
187516
+ const host = options.host ?? "0.0.0.0";
187517
+ try {
187518
+ const { execSync: execSync2 } = __require("child_process");
187519
+ if (process.platform === "win32") {
187520
+ const pid = execSync2(`netstat -ano | findstr :${port3} | findstr LISTENING`, { encoding: "utf-8" }).split(`
187521
+ `)[0]?.trim().split(/\s+/).pop();
187522
+ if (pid)
187523
+ execSync2(`taskkill /PID ${pid} /F`);
187524
+ } else {
187525
+ const pids = execSync2(`lsof -ti tcp:${port3} 2>/dev/null || true`, { encoding: "utf-8" }).split(`
187526
+ `).map((l2) => l2.trim()).filter(Boolean);
187527
+ for (const pid of pids) {
187528
+ try {
187529
+ execSync2(`kill -9 ${pid} 2>/dev/null || true`);
187530
+ } catch {}
187531
+ }
187532
+ }
187533
+ } catch {}
187534
+ await new Promise((r2) => setTimeout(r2, 1500));
187535
+ return dashboardCli({ ...options, port: port3, host, daemon: true });
187536
+ }
187506
187537
 
187507
187538
  // packages/omo-opencode/src/cli/architect.ts
187508
187539
  import { join as join75 } from "path";
@@ -187803,6 +187834,13 @@ function configureRuntimeCommands(program2) {
187803
187834
  if (!options.daemon)
187804
187835
  process.exit(exitCode);
187805
187836
  });
187837
+ program2.command("dashboard:restart").description("Restart the MaTrixOS web dashboard (kill existing + start daemon)").option("-p, --port <number>", "HTTP port", "9123").option("--host <addr>", "Bind address", "0.0.0.0").action(async (options) => {
187838
+ const exitCode = await restartDashboard({
187839
+ port: parseInt(options.port ?? "9123", 10),
187840
+ host: options.host ?? "0.0.0.0"
187841
+ });
187842
+ process.exit(exitCode);
187843
+ });
187806
187844
  }
187807
187845
 
187808
187846
  // packages/omo-opencode/src/cli/cli-program.ts
@@ -223,6 +223,7 @@ body{font-family:var(--font-body);font-size:var(--text-base);color:var(--text-pr
223
223
  .agent-model-label{font-size:var(--text-xs);color:var(--text-tertiary)}
224
224
  .agent-model-select{flex:1;max-width:200px;padding:4px 6px;border-radius:var(--radius-sm);border:1px solid var(--border);background:var(--bg-secondary);color:var(--text-primary);font-size:var(--text-xs);font-family:var(--font-mono);cursor:pointer}
225
225
  .agent-model-select:focus{outline:none;border-color:var(--accent-primary)}
226
+ .agent-model-select option{background:var(--bg-elevated);color:var(--text-primary)}
226
227
 
227
228
  @media(max-width:1024px){.kpi-grid,.grid-2{grid-template-columns:repeat(2,1fr)}.kanban-board{grid-template-columns:repeat(2,1fr)}.gauge-grid{grid-template-columns:repeat(2,1fr)}}
228
229
  @media(max-width:768px){.kpi-grid,.grid-2{grid-template-columns:1fr}.kanban-board{grid-template-columns:1fr}.agent-grid{grid-template-columns:1fr}}
package/dist/index.js CHANGED
@@ -368019,7 +368019,7 @@ function getCachedVersion(options = {}) {
368019
368019
  // package.json
368020
368020
  var package_default = {
368021
368021
  name: "@kl-c/matrixos",
368022
- version: "0.3.21",
368022
+ version: "0.3.23",
368023
368023
  description: "MaTrixOS \u2014 Agentic OS for OpenCode. Personalizable, communicating, self-improving, resilient.",
368024
368024
  main: "./dist/index.js",
368025
368025
  types: "dist/index.d.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kl-c/matrixos",
3
- "version": "0.3.21",
3
+ "version": "0.3.23",
4
4
  "description": "MaTrixOS \u2014 Agentic OS for OpenCode. Personalizable, communicating, self-improving, resilient.",
5
5
  "main": "./dist/index.js",
6
6
  "types": "dist/index.d.ts",