@myop/cli 0.1.49 → 0.1.50

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 (2) hide show
  1. package/dist/myop-cli.js +140 -142
  2. package/package.json +1 -1
package/dist/myop-cli.js CHANGED
@@ -262,13 +262,13 @@ async function ct(o, t, e, n, s = {}) {
262
262
  onRetry: g
263
263
  } = s, h = ((o == null ? void 0 : o.message) || "") + (t || "") + (e || "");
264
264
  return !i && Dt(h) ? (Lt(), await Ut(n) && g ? (console.log(`🔄 Retrying build...
265
- `), g(), { handled: !0, hasTriedPlatformFix: !0, hasTriedInstall: d }) : { handled: !0, hasTriedPlatformFix: !0, hasTriedInstall: d }) : !d && At(h) ? (console.log("📦 Missing dependencies detected, running npm install..."), new Promise((c) => {
266
- n("npm install", (l, y, S) => {
267
- if (l) {
268
- console.error("❌ Failed to install dependencies:", l.message), S && console.error(S), c({ handled: !0, hasTriedPlatformFix: i, hasTriedInstall: !0 });
265
+ `), g(), { handled: !0, hasTriedPlatformFix: !0, hasTriedInstall: d }) : { handled: !0, hasTriedPlatformFix: !0, hasTriedInstall: d }) : !d && At(h) ? (console.log("📦 Missing dependencies detected, running npm install..."), new Promise((l) => {
266
+ n("npm install", (c, y, S) => {
267
+ if (c) {
268
+ console.error("❌ Failed to install dependencies:", c.message), S && console.error(S), l({ handled: !0, hasTriedPlatformFix: i, hasTriedInstall: !0 });
269
269
  return;
270
270
  }
271
- console.log("✅ Dependencies installed"), g && g(), c({ handled: !0, hasTriedPlatformFix: i, hasTriedInstall: !0 });
271
+ console.log("✅ Dependencies installed"), g && g(), l({ handled: !0, hasTriedPlatformFix: i, hasTriedInstall: !0 });
272
272
  });
273
273
  })) : { handled: !1, hasTriedPlatformFix: i, hasTriedInstall: d };
274
274
  }
@@ -280,7 +280,7 @@ async function be() {
280
280
  i = t.default.dirname(m);
281
281
  } else
282
282
  i = t.default.dirname(import.meta.url);
283
- const d = t.default.join(i, "commands", "dev", "management-website"), g = o.default.readFileSync(t.default.join(d, "styles.css"), "utf-8"), h = o.default.readFileSync(t.default.join(d, "app.js"), "utf-8"), c = 9292, l = 9293;
283
+ const d = t.default.join(i, "commands", "dev", "management-website"), g = o.default.readFileSync(t.default.join(d, "styles.css"), "utf-8"), h = o.default.readFileSync(t.default.join(d, "app.js"), "utf-8"), l = 9292, c = 9293;
284
284
  let y = "./dist", S = !1, x = !1, u = !1, p = null;
285
285
  const E = () => {
286
286
  try {
@@ -319,7 +319,7 @@ async function be() {
319
319
  const r = ((await new Promise((w, b) => {
320
320
  const O = {
321
321
  hostname: "localhost",
322
- port: l,
322
+ port: c,
323
323
  path: "/_list",
324
324
  method: "GET",
325
325
  timeout: 1e3
@@ -464,7 +464,7 @@ Sec-WebSocket-Accept: ${b}\r
464
464
  r.writeHead(403, { "Content-Type": "text/plain" }), r.end("Forbidden");
465
465
  return;
466
466
  }
467
- const m = new URL(a.url, `http://localhost:${c}`), f = m.pathname, w = f.split("/").filter((J) => J);
467
+ const m = new URL(a.url, `http://localhost:${l}`), f = m.pathname, w = f.split("/").filter((J) => J);
468
468
  if (f.startsWith("/consume")) {
469
469
  const J = m.searchParams.get("id");
470
470
  if (!J) {
@@ -614,7 +614,7 @@ Sec-WebSocket-Accept: ${b}\r
614
614
  return;
615
615
  }
616
616
  if (w.length === 0) {
617
- r.writeHead(200, { "Content-Type": "text/html" }), r.end(jt(c, l, g, h));
617
+ r.writeHead(200, { "Content-Type": "text/html" }), r.end(jt(l, c, g, h));
618
618
  return;
619
619
  }
620
620
  if (w[0] !== "view") {
@@ -656,7 +656,7 @@ Sec-WebSocket-Accept: ${b}\r
656
656
  htmlFile: u ? p : null
657
657
  }), w = {
658
658
  hostname: "localhost",
659
- port: l,
659
+ port: c,
660
660
  path: "/_register",
661
661
  method: "POST",
662
662
  headers: {
@@ -673,7 +673,7 @@ Sec-WebSocket-Accept: ${b}\r
673
673
  }), ht = () => new Promise((a, r) => {
674
674
  const m = JSON.stringify({ componentId: M }), f = {
675
675
  hostname: "localhost",
676
- port: l,
676
+ port: c,
677
677
  path: "/_unregister",
678
678
  method: "POST",
679
679
  headers: {
@@ -689,7 +689,7 @@ Sec-WebSocket-Accept: ${b}\r
689
689
  <script>
690
690
  (function() {
691
691
  const componentId = '${a}';
692
- const wsUrl = 'ws://localhost:${l}/_hmr/' + componentId;
692
+ const wsUrl = 'ws://localhost:${c}/_hmr/' + componentId;
693
693
  let ws;
694
694
  let reconnectAttempts = 0;
695
695
  const maxReconnectAttempts = 10;
@@ -846,7 +846,7 @@ Sec-WebSocket-Accept: ${b}\r
846
846
  html: r
847
847
  }), f = {
848
848
  hostname: "localhost",
849
- port: l,
849
+ port: c,
850
850
  path: "/_hmr_notify",
851
851
  method: "POST",
852
852
  headers: {
@@ -925,7 +925,7 @@ Sec-WebSocket-Accept: ${b}\r
925
925
  }, wt = () => new Promise((a) => {
926
926
  const r = {
927
927
  hostname: "localhost",
928
- port: l,
928
+ port: c,
929
929
  path: "/_list",
930
930
  method: "GET",
931
931
  timeout: 1e3
@@ -963,12 +963,12 @@ Sec-WebSocket-Accept: ${b}\r
963
963
  });
964
964
  r.on("error", () => {
965
965
  a(!1);
966
- }), r.listen(l, () => {
966
+ }), r.listen(c, () => {
967
967
  console.log(`
968
- 🔄 Taking over as server...`), console.log(`📡 Management server on port ${l}`), ge.on("error", () => {
968
+ 🔄 Taking over as server...`), console.log(`📡 Management server on port ${c}`), ge.on("error", () => {
969
969
  r.close(), a(!1);
970
- }), ge.listen(c, () => {
971
- console.log(`📡 Main server running at http://localhost:${c}`);
970
+ }), ge.listen(l, () => {
971
+ console.log(`📡 Main server running at http://localhost:${l}`);
972
972
  const m = u ? t.default.resolve(_) : t.default.resolve(_, y);
973
973
  T.set(M, {
974
974
  path: m,
@@ -976,7 +976,7 @@ Sec-WebSocket-Accept: ${b}\r
976
976
  htmlFile: u ? p : null
977
977
  });
978
978
  const f = R ? ` (${R})` : "";
979
- console.log(`✅ Registered component: ${M}${f}`), console.log(`📡 Access at: http://localhost:${c}/view/${M}/`), a(!0);
979
+ console.log(`✅ Registered component: ${M}${f}`), console.log(`📡 Access at: http://localhost:${l}/view/${M}/`), a(!0);
980
980
  });
981
981
  });
982
982
  });
@@ -1006,20 +1006,20 @@ Sec-WebSocket-Accept: ${b}\r
1006
1006
  try {
1007
1007
  M = await A();
1008
1008
  const r = await Ke();
1009
- console.log(`✅ Registered component: ${M}`), console.log(`📡 Access at: http://localhost:${c}/view/${M}/`), console.log(`📋 All registered components: ${r.registered.join(", ")}`), qe(() => {
1010
- process.env.MYOP_NO_BROWSER || $(`http://localhost:${c}/view/${M}/`);
1009
+ console.log(`✅ Registered component: ${M}`), console.log(`📡 Access at: http://localhost:${l}/view/${M}/`), console.log(`📋 All registered components: ${r.registered.join(", ")}`), qe(() => {
1010
+ process.env.MYOP_NO_BROWSER || $(`http://localhost:${l}/view/${M}/`);
1011
1011
  }), et();
1012
1012
  } catch (r) {
1013
1013
  console.error("❌ Failed to register component:", r.message), process.exit(1);
1014
1014
  }
1015
1015
  } else
1016
1016
  console.error("❌ Management server error:", a.message), process.exit(1);
1017
- }), Ee.on("upgrade", ft), Ee.listen(l, async () => {
1017
+ }), Ee.on("upgrade", ft), Ee.listen(c, async () => {
1018
1018
  Re = !0, console.log(`
1019
- 🚀 Starting shared dev server...`), console.log(`📡 Management server on port ${l}`), ge.on("error", (a) => {
1019
+ 🚀 Starting shared dev server...`), console.log(`📡 Management server on port ${c}`), ge.on("error", (a) => {
1020
1020
  console.error("❌ Main server error:", a.message), process.exit(1);
1021
- }), ge.listen(c, async () => {
1022
- console.log(`📡 Main server running at http://localhost:${c}`), (M === "DEV" || M === "NEW") && (M = "DEV1");
1021
+ }), ge.listen(l, async () => {
1022
+ console.log(`📡 Main server running at http://localhost:${l}`), (M === "DEV" || M === "NEW") && (M = "DEV1");
1023
1023
  const a = u ? t.default.resolve(_) : t.default.resolve(_, y);
1024
1024
  T.set(M, {
1025
1025
  path: a,
@@ -1027,8 +1027,8 @@ Sec-WebSocket-Accept: ${b}\r
1027
1027
  htmlFile: u ? p : null
1028
1028
  });
1029
1029
  const r = R ? ` (${R})` : "";
1030
- console.log(`✅ Registered component: ${M}${r}`), console.log(`📡 Access at: http://localhost:${c}/view/${M}/`), qe(() => {
1031
- process.env.MYOP_NO_BROWSER || $(`http://localhost:${c}/view/${M}/`);
1030
+ console.log(`✅ Registered component: ${M}${r}`), console.log(`📡 Access at: http://localhost:${l}/view/${M}/`), qe(() => {
1031
+ process.env.MYOP_NO_BROWSER || $(`http://localhost:${l}/view/${M}/`);
1032
1032
  });
1033
1033
  });
1034
1034
  });
@@ -1083,15 +1083,15 @@ const D = class D {
1083
1083
  const t = this.components.length, e = 38;
1084
1084
  let n;
1085
1085
  this.cols >= e * 3 + 4 ? n = Math.min(t, 3) : this.cols >= e * 2 + 2 ? n = Math.min(t, 2) : n = 1;
1086
- const s = Math.ceil(t / n), i = Math.floor(this.cols / n), d = 2, h = this.rows - d - 2, c = Math.floor(h / s);
1087
- this.visibleLogLines = Math.max(2, c - 4), this.layout = { panelsPerRow: n, panelWidth: i, numRows: s, panelHeight: c }, this.panelPositions.clear();
1088
- for (let l = 0; l < t; l++) {
1089
- const y = this.components[l], S = Math.floor(l / n), x = l % n;
1086
+ const s = Math.ceil(t / n), i = Math.floor(this.cols / n), d = 2, h = this.rows - d - 2, l = Math.floor(h / s);
1087
+ this.visibleLogLines = Math.max(2, l - 4), this.layout = { panelsPerRow: n, panelWidth: i, numRows: s, panelHeight: l }, this.panelPositions.clear();
1088
+ for (let c = 0; c < t; c++) {
1089
+ const y = this.components[c], S = Math.floor(c / n), x = c % n;
1090
1090
  this.panelPositions.set(y.name, {
1091
- row: d + 1 + S * c,
1091
+ row: d + 1 + S * l,
1092
1092
  col: x * i + 1,
1093
1093
  width: i,
1094
- height: c
1094
+ height: l
1095
1095
  });
1096
1096
  }
1097
1097
  }
@@ -1139,10 +1139,10 @@ const D = class D {
1139
1139
  renderPanel(t) {
1140
1140
  const e = D.C, n = D.STATUS, s = this.panelPositions.get(t);
1141
1141
  if (!s) return;
1142
- const i = this.components.findIndex((A) => A.name === t), d = this.components[i], g = i === this.selectedPanel, h = this.statusKeys.get(t) || "initializing", c = n[h], l = e[c.color], y = this.logs.get(t) || [], S = this.scrollPos.get(t) || 0, x = s.width - 1, u = g ? e.cyan : e.gray, p = [], E = d.name.substring(0, x - 20);
1143
- let I = `${u}┌─${e.reset} ${l}${c.icon}${e.reset} `;
1144
- I += `${e.bold}${E}${e.reset} ${e.gray}─${e.reset} ${l}${c.label}${e.reset} `;
1145
- const $ = 5 + E.length + c.label.length + 3;
1142
+ const i = this.components.findIndex((A) => A.name === t), d = this.components[i], g = i === this.selectedPanel, h = this.statusKeys.get(t) || "initializing", l = n[h], c = e[l.color], y = this.logs.get(t) || [], S = this.scrollPos.get(t) || 0, x = s.width - 1, u = g ? e.cyan : e.gray, p = [], E = d.name.substring(0, x - 20);
1143
+ let I = `${u}┌─${e.reset} ${c}${l.icon}${e.reset} `;
1144
+ I += `${e.bold}${E}${e.reset} ${e.gray}─${e.reset} ${c}${l.label}${e.reset} `;
1145
+ const $ = 5 + E.length + l.label.length + 3;
1146
1146
  I += `${u}${"─".repeat(Math.max(0, x - $))}┐${e.reset}`, p.push(D.ESC.moveTo(s.row, s.col) + I);
1147
1147
  const C = (d.path || "").substring(0, x - 6);
1148
1148
  let j = `${u}│${e.reset} ${e.dim}${C}${e.reset}`;
@@ -1226,30 +1226,30 @@ we(D, "STATUS", {
1226
1226
  });
1227
1227
  let Ae = D;
1228
1228
  async function Ht(o) {
1229
- const { spawn: t, exec: e } = await import("child_process"), n = await import("path"), s = o.map((l) => ({
1230
- name: l.name,
1231
- path: l.path,
1232
- id: l.componentId || ""
1233
- })), i = new Ae(s), d = [], g = (l) => {
1229
+ const { spawn: t, exec: e } = await import("child_process"), n = await import("path"), s = o.map((c) => ({
1230
+ name: c.name,
1231
+ path: c.path,
1232
+ id: c.componentId || ""
1233
+ })), i = new Ae(s), d = [], g = (c) => {
1234
1234
  const y = process.platform;
1235
1235
  let S;
1236
- y === "darwin" ? S = `open "${l}"` : y === "win32" ? S = `start "" "${l}"` : S = `xdg-open "${l}"`, e(S, () => {
1236
+ y === "darwin" ? S = `open "${c}"` : y === "win32" ? S = `start "" "${c}"` : S = `xdg-open "${c}"`, e(S, () => {
1237
1237
  });
1238
1238
  }, h = () => {
1239
1239
  i.clear(), console.log(`
1240
- 🛑 Shutting down all components...`), d.forEach((l) => {
1240
+ 🛑 Shutting down all components...`), d.forEach((c) => {
1241
1241
  try {
1242
- l.kill("SIGTERM");
1242
+ c.kill("SIGTERM");
1243
1243
  } catch {
1244
1244
  }
1245
1245
  }), setTimeout(() => process.exit(0), 500);
1246
1246
  };
1247
1247
  process.on("SIGINT", h), process.on("SIGTERM", h);
1248
- const c = process.argv[1];
1249
- for (let l = 0; l < o.length; l++) {
1250
- const y = o[l], S = y.name;
1248
+ const l = process.argv[1];
1249
+ for (let c = 0; c < o.length; c++) {
1250
+ const y = o[c], S = y.name;
1251
1251
  i.setStatus(S, "⏳ Starting..."), i.log(S, `Starting in ${y.path}`);
1252
- const x = t("node", [c, "dev"], {
1252
+ const x = t("node", [l, "dev"], {
1253
1253
  cwd: n.default.resolve(y.path),
1254
1254
  env: { ...process.env, FORCE_COLOR: "1", MYOP_NO_BROWSER: "1" },
1255
1255
  stdio: ["ignore", "pipe", "pipe"]
@@ -1274,7 +1274,7 @@ async function Ht(o) {
1274
1274
  }
1275
1275
  }), x.on("exit", (p) => {
1276
1276
  p !== 0 && p !== null && (i.setStatus(S, `❌ Exited (${p})`), i.log(S, `Process exited with code ${p}`));
1277
- }), l < o.length - 1 && await new Promise((p) => setTimeout(p, 500));
1277
+ }), c < o.length - 1 && await new Promise((p) => setTimeout(p, 500));
1278
1278
  }
1279
1279
  i.render(), setTimeout(() => {
1280
1280
  g("http://localhost:9292");
@@ -1524,14 +1524,14 @@ function Kt(o) {
1524
1524
  const n = Mt.createServer((s, i) => {
1525
1525
  const d = new nt(s.url, `http://localhost:${Se}`);
1526
1526
  if (d.pathname === "/callback") {
1527
- const g = d.searchParams.get("code"), h = d.searchParams.get("state"), c = d.searchParams.get("error");
1528
- if (c) {
1527
+ const g = d.searchParams.get("code"), h = d.searchParams.get("state"), l = d.searchParams.get("error");
1528
+ if (l) {
1529
1529
  i.writeHead(200, { "Content-Type": "text/html" }), i.end(ve(
1530
1530
  "error",
1531
1531
  "Authentication Failed",
1532
1532
  "Unable to complete the authentication process.",
1533
- c
1534
- )), n.close(), e(new Error(`OAuth error: ${c}`));
1533
+ l
1534
+ )), n.close(), e(new Error(`OAuth error: ${l}`));
1535
1535
  return;
1536
1536
  }
1537
1537
  if (h !== o) {
@@ -1641,17 +1641,17 @@ async function pe() {
1641
1641
  `), await Pt(g.toString());
1642
1642
  const h = await d;
1643
1643
  o.start("Exchanging authorization code...");
1644
- const c = await Qt(h, e, n);
1644
+ const l = await Qt(h, e, n);
1645
1645
  o.text = "Getting user info...";
1646
- const l = await Xt(c.access_token), y = {
1647
- accessToken: c.access_token,
1648
- refreshToken: c.refresh_token,
1649
- expiresAt: new Date(Date.now() + c.expires_in * 1e3).toISOString(),
1646
+ const c = await Xt(l.access_token), y = {
1647
+ accessToken: l.access_token,
1648
+ refreshToken: l.refresh_token,
1649
+ expiresAt: new Date(Date.now() + l.expires_in * 1e3).toISOString(),
1650
1650
  clientId: e,
1651
- userId: l.userId,
1652
- userEmail: l.email
1651
+ userId: c.userId,
1652
+ userEmail: c.email
1653
1653
  };
1654
- return dt(y), o.succeed(`Authenticated as ${l.email}`), y;
1654
+ return dt(y), o.succeed(`Authenticated as ${c.email}`), y;
1655
1655
  } catch (t) {
1656
1656
  throw o.fail(`Authentication failed: ${t.message}`), t;
1657
1657
  }
@@ -1771,20 +1771,20 @@ async function so(o) {
1771
1771
  `);
1772
1772
  try {
1773
1773
  if (Fe) {
1774
- const l = `Start-Process -FilePath 'cmd' -ArgumentList '/c npm ${d ? `install -g ${Z}@latest --prefix \\"${d}\\"` : `install -g ${Z}@latest`}' -Verb RunAs -Wait`;
1775
- Q(`powershell -Command "${l}"`, { stdio: "inherit" });
1774
+ const c = `Start-Process -FilePath 'cmd' -ArgumentList '/c npm ${d ? `install -g ${Z}@latest --prefix \\"${d}\\"` : `install -g ${Z}@latest`}' -Verb RunAs -Wait`;
1775
+ Q(`powershell -Command "${c}"`, { stdio: "inherit" });
1776
1776
  } else {
1777
- const c = d ? `sudo npm install -g ${Z}@latest --prefix "${d}"` : `sudo ${i}`;
1778
- Q(c, { stdio: "inherit" });
1777
+ const l = d ? `sudo npm install -g ${Z}@latest --prefix "${d}"` : `sudo ${i}`;
1778
+ Q(l, { stdio: "inherit" });
1779
1779
  }
1780
1780
  console.log(`
1781
1781
  ✅ Updated to v${e}`);
1782
1782
  } catch {
1783
1783
  console.log(`
1784
1784
  ❌ Update failed`);
1785
- const l = Fe ? `npm install -g ${Z}@latest (run as Administrator)` : `sudo npm install -g ${Z}@latest`;
1785
+ const c = Fe ? `npm install -g ${Z}@latest (run as Administrator)` : `sudo npm install -g ${Z}@latest`;
1786
1786
  console.log(`
1787
- Please run manually: ${l}
1787
+ Please run manually: ${c}
1788
1788
  `), process.exit(1);
1789
1789
  }
1790
1790
  }
@@ -1792,8 +1792,8 @@ Please run manually: ${l}
1792
1792
  try {
1793
1793
  let h;
1794
1794
  d ? h = Fe ? _e(d, "node_modules") : _e(d, "lib", "node_modules") : h = Q("npm root -g", { encoding: "utf-8" }).trim();
1795
- const c = _e(h, Z, "package.json"), l = Ct(c, "utf-8");
1796
- g = JSON.parse(l).version;
1795
+ const l = _e(h, Z, "package.json"), c = Ct(l, "utf-8");
1796
+ g = JSON.parse(c).version;
1797
1797
  } catch {
1798
1798
  }
1799
1799
  if (g === e)
@@ -1802,8 +1802,8 @@ Please run manually: ${l}
1802
1802
  `), $t(process.argv[0], process.argv.slice(1), {
1803
1803
  stdio: "inherit",
1804
1804
  shell: !0
1805
- }).on("close", (c) => {
1806
- process.exit(c || 0);
1805
+ }).on("close", (l) => {
1806
+ process.exit(l || 0);
1807
1807
  }), !0;
1808
1808
  console.log(`
1809
1809
  Please run myop again to use the new version.
@@ -1839,7 +1839,7 @@ function je({ id: o, name: t }) {
1839
1839
  ro({ defaultOrganization: { id: o, name: t } });
1840
1840
  }
1841
1841
  async function lo(o, t, e, n = {}) {
1842
- var g, h, c;
1842
+ var g, h, l;
1843
1843
  const s = await fetch(`${o}/mcp`, {
1844
1844
  method: "POST",
1845
1845
  headers: {
@@ -1861,7 +1861,7 @@ async function lo(o, t, e, n = {}) {
1861
1861
  const i = await s.json();
1862
1862
  if (i.error)
1863
1863
  throw new Error(i.error.message || "MCP error");
1864
- const d = (c = (h = (g = i.result) == null ? void 0 : g.content) == null ? void 0 : h[0]) == null ? void 0 : c.text;
1864
+ const d = (l = (h = (g = i.result) == null ? void 0 : g.content) == null ? void 0 : h[0]) == null ? void 0 : l.text;
1865
1865
  if (!d)
1866
1866
  throw new Error(`No content returned from ${e}`);
1867
1867
  return JSON.parse(d);
@@ -1901,9 +1901,9 @@ const po = () => {
1901
1901
  { deps: ["@myop/vue", "vue"], skill: "myop-vue-host" },
1902
1902
  { deps: ["@myop/angular", "@angular/core"], skill: "myop-angular-host" },
1903
1903
  { deps: ["@myop/react-native", "react-native"], skill: "myop-react-native-host" }
1904
- ], i = s.filter(({ deps: c }) => c.some((l) => e.includes(l))).map(({ skill: c }) => c), d = s.flatMap(({ deps: c }) => c.filter((l) => e.includes(l)));
1905
- i.length > 0 ? n.push(...i) : n.push(...s.map((c) => c.skill));
1906
- const g = n.map((c) => `--skill ${c}`).join(" "), h = `npx -y skills add "${t}" ${g} --agent '*' --copy -y`;
1904
+ ], i = s.filter(({ deps: l }) => l.some((c) => e.includes(c))).map(({ skill: l }) => l), d = s.flatMap(({ deps: l }) => l.filter((c) => e.includes(c)));
1905
+ i.length > 0 ? n.push(...i) : n.push(...s.map((l) => l.skill));
1906
+ const g = n.map((l) => `--skill ${l}`).join(" "), h = `npx -y skills add "${t}" ${g} --agent '*' --copy -y`;
1907
1907
  return Q(h, { cwd: o, stdio: "pipe" }), { success: !0, detected: d, skillNames: n };
1908
1908
  } catch (e) {
1909
1909
  return console.info("Failed to install skills:", e.message), { success: !1 };
@@ -1967,7 +1967,7 @@ const Me = (o = !1) => {
1967
1967
  new De(),
1968
1968
  ...Ft
1969
1969
  ];
1970
- const uo = "0.1.49";
1970
+ const uo = "0.1.50";
1971
1971
  v.program = new bt();
1972
1972
  v.program.name("@myop/cli").description("Myop CLI - Remote UI Made Easy").version(uo);
1973
1973
  v.program.addOption(new ue("-c, --config <value>", "myop.config.json file location").default("./myop.config.json", "./myop.config.json"));
@@ -2082,10 +2082,10 @@ v.program.command("push").description("Upload component to Myop platform").argum
2082
2082
  [MYOP_AUTH_REQUIRED] Run 'myop login' to authenticate,`), console.error(` or use the setup_cli_auth MCP tool to set up credentials automatically.
2083
2083
  `)), process.exit(1);
2084
2084
  }
2085
- const c = Ce();
2086
- let l = V("Uploading...").start(), y;
2085
+ const l = Ce();
2086
+ let c = V("Uploading...").start(), y;
2087
2087
  try {
2088
- const p = await fetch(`${c}/mcp`, {
2088
+ const p = await fetch(`${l}/mcp`, {
2089
2089
  method: "POST",
2090
2090
  headers: {
2091
2091
  "Content-Type": "application/json",
@@ -2114,9 +2114,9 @@ v.program.command("push").description("Upload component to Myop platform").argum
2114
2114
  const I = (u = (x = (S = E.result) == null ? void 0 : S.content) == null ? void 0 : x[0]) == null ? void 0 : u.text;
2115
2115
  if (y = JSON.parse(I), !y.success)
2116
2116
  throw new Error(y.error);
2117
- l.succeed("Pushed successfully");
2117
+ c.succeed("Pushed successfully");
2118
2118
  } catch (p) {
2119
- l.fail("Upload failed"), re(p) ? (console.error("❌ Network error: Unable to reach mcp.myop.dev"), ae("push")) : console.error(" ", p.message), process.exit(1);
2119
+ c.fail("Upload failed"), re(p) ? (console.error("❌ Network error: Unable to reach mcp.myop.dev"), ae("push")) : console.error(" ", p.message), process.exit(1);
2120
2120
  }
2121
2121
  if (y.isNewComponent || !e.componentId || e.componentId === "DEV") {
2122
2122
  e.componentId = y.componentId, e.organization = y.orgId, e.name || (e.name = y.componentName);
@@ -2153,7 +2153,7 @@ v.program.command("pull").description("Download component HTML from Myop platfor
2153
2153
  `)), process.exit(1);
2154
2154
  }
2155
2155
  const g = Ce(), h = V("Fetching component...").start();
2156
- let c;
2156
+ let l;
2157
2157
  try {
2158
2158
  const $ = await fetch(`${g}/mcp`, {
2159
2159
  method: "POST",
@@ -2177,20 +2177,18 @@ v.program.command("pull").description("Download component HTML from Myop platfor
2177
2177
  if (C.error)
2178
2178
  throw new Error(C.error.message);
2179
2179
  const j = (I = (E = (p = C.result) == null ? void 0 : p.content) == null ? void 0 : E[0]) == null ? void 0 : I.text;
2180
- if (c = JSON.parse(j), !c.success && !c.html)
2181
- throw new Error(c.error || "No HTML content returned");
2182
- h.succeed("Component fetched");
2180
+ l = JSON.parse(j), !l.success && !l.html && (h.fail("Failed to fetch component"), console.error(" ", l.error || "No HTML content returned"), l.message && console.error(" ", l.message), process.exit(1)), h.succeed("Component fetched");
2183
2181
  } catch ($) {
2184
2182
  h.fail("Failed to fetch component"), re($) ? (console.error("❌ Network error: Unable to reach mcp.myop.dev"), ae("pull")) : console.error(" ", $.message), process.exit(1);
2185
2183
  }
2186
- let l = t.output;
2187
- l || (P.existsSync("./dist/index.html") ? l = "./dist/index.html" : l = "./index.html");
2188
- const y = c.htmlContent || c.html, S = N.dirname(l);
2189
- S && !P.existsSync(S) && P.mkdirSync(S, { recursive: !0 }), P.writeFileSync(l, y), console.log(` Saved to: ${l} (${(y.length / 1024).toFixed(1)} KB)`);
2184
+ let c = t.output;
2185
+ c || (P.existsSync("./dist/index.html") ? c = "./dist/index.html" : c = "./index.html");
2186
+ const y = l.htmlContent || l.html, S = N.dirname(c);
2187
+ S && !P.existsSync(S) && P.mkdirSync(S, { recursive: !0 }), P.writeFileSync(c, y), console.log(` Saved to: ${c} (${(y.length / 1024).toFixed(1)} KB)`);
2190
2188
  const x = P.existsSync(e);
2191
2189
  let u = !1;
2192
- if (x ? ((!n.componentId || n.componentId === "DEV") && (n.componentId = s, u = !0), !n.name && c.name && (n.name = c.name, u = !0)) : (n = {
2193
- name: c.name || N.basename(process.cwd()),
2190
+ if (x ? ((!n.componentId || n.componentId === "DEV") && (n.componentId = s, u = !0), !n.name && l.name && (n.name = l.name, u = !0)) : (n = {
2191
+ name: l.name || N.basename(process.cwd()),
2194
2192
  componentId: s,
2195
2193
  type: "html",
2196
2194
  author: "@myop-cli",
@@ -2225,16 +2223,16 @@ v.program.command("list").description("Browse and pull/push remote components").
2225
2223
  d.fail("Failed to load organizations"), re(u) ? (console.error("❌ Network error: Unable to reach mcp.myop.dev"), ae("list")) : console.error(" ", u.message), process.exit(1);
2226
2224
  }
2227
2225
  g.length === 0 && (d.fail("No organizations found for this account"), process.exit(1)), d.stop();
2228
- let h, c;
2226
+ let h, l;
2229
2227
  if (o.org) {
2230
2228
  const u = g.find((p) => p.id === o.org || p._id === o.org);
2231
- u || (console.error(`Organization "${o.org}" not found. Available:`), g.forEach((p) => console.log(` ${p.id || p._id} ${p.name}`)), process.exit(1)), h = u.id || u._id, c = u.name, je({ id: h, name: c });
2229
+ u || (console.error(`Organization "${o.org}" not found. Available:`), g.forEach((p) => console.log(` ${p.id || p._id} ${p.name}`)), process.exit(1)), h = u.id || u._id, l = u.name, je({ id: h, name: l });
2232
2230
  } else {
2233
2231
  const u = ao();
2234
2232
  if (u && g.find((p) => (p.id || p._id) === u.id))
2235
- h = u.id, c = u.name;
2233
+ h = u.id, l = u.name;
2236
2234
  else if (g.length === 1)
2237
- h = g[0].id || g[0]._id, c = g[0].name, je({ id: h, name: c });
2235
+ h = g[0].id || g[0]._id, l = g[0].name, je({ id: h, name: l });
2238
2236
  else
2239
2237
  try {
2240
2238
  const p = await e({
@@ -2244,7 +2242,7 @@ v.program.command("list").description("Browse and pull/push remote components").
2244
2242
  value: { id: E.id || E._id, name: E.name }
2245
2243
  }))
2246
2244
  });
2247
- h = p.id, c = p.name, je({ id: h, name: c });
2245
+ h = p.id, l = p.name, je({ id: h, name: l });
2248
2246
  } catch (p) {
2249
2247
  throw p.name === "ExitPromptError" && (console.log(`
2250
2248
 
@@ -2252,17 +2250,17 @@ v.program.command("list").description("Browse and pull/push remote components").
2252
2250
  `), process.exit(0)), p;
2253
2251
  }
2254
2252
  }
2255
- console.log(` Using organization: ${c}`), d = V("Loading components...").start();
2256
- let l;
2253
+ console.log(` Using organization: ${l}`), d = V("Loading components...").start();
2254
+ let c;
2257
2255
  try {
2258
2256
  const u = await i("list_components", { organizationId: h });
2259
- if (l = u.components || u, !Array.isArray(l))
2257
+ if (c = u.components || u, !Array.isArray(c))
2260
2258
  throw new Error("Unexpected response from list_components");
2261
2259
  } catch (u) {
2262
2260
  d.fail("Failed to load components"), console.error(" ", u.message), process.exit(1);
2263
2261
  }
2264
- d.stop(), l.length === 0 && (console.log(` No components found in this organization.
2265
- `), process.exit(0)), console.log(` ${c} - ${l.length} component(s)
2262
+ d.stop(), c.length === 0 && (console.log(` No components found in this organization.
2263
+ `), process.exit(0)), console.log(` ${l} - ${c.length} component(s)
2266
2264
  `);
2267
2265
  const y = [];
2268
2266
  for (; ; ) {
@@ -2272,7 +2270,7 @@ v.program.command("list").description("Browse and pull/push remote components").
2272
2270
  I = await t({
2273
2271
  message: "Search & select components:",
2274
2272
  source: (C) => {
2275
- const j = (C || "").toLowerCase(), M = l.filter((k) => {
2273
+ const j = (C || "").toLowerCase(), M = c.filter((k) => {
2276
2274
  const L = k.id || k._id || k.componentId;
2277
2275
  return E.has(L) ? !1 : j ? (k.name || "").toLowerCase().includes(j) : !0;
2278
2276
  }), R = [
@@ -2296,7 +2294,7 @@ v.program.command("list").description("Browse and pull/push remote components").
2296
2294
  }
2297
2295
  if (I === p)
2298
2296
  break;
2299
- const $ = l.find((C) => (C.id || C._id || C.componentId) === I);
2297
+ const $ = c.find((C) => (C.id || C._id || C.componentId) === I);
2300
2298
  $ && (y.push($), console.log(` + ${$.name}`));
2301
2299
  }
2302
2300
  y.length === 0 && (console.log(` No components selected.
@@ -2615,45 +2613,45 @@ v.program.command("mcp").description("Configure Myop MCP server for your AI codi
2615
2613
  try {
2616
2614
  d = await o({
2617
2615
  message: "Select your AI coding assistant:",
2618
- choices: i.map((l) => ({ name: l.name, value: l.value }))
2616
+ choices: i.map((c) => ({ name: c.name, value: c.value }))
2619
2617
  });
2620
- } catch (l) {
2621
- throw l.name === "ExitPromptError" && (console.log(`
2618
+ } catch (c) {
2619
+ throw c.name === "ExitPromptError" && (console.log(`
2622
2620
 
2623
2621
  👋 Goodbye!
2624
- `), process.exit(0)), l;
2622
+ `), process.exit(0)), c;
2625
2623
  }
2626
- const g = i.find((l) => l.value === d);
2624
+ const g = i.find((c) => c.value === d);
2627
2625
  let h = {};
2628
2626
  try {
2629
- const l = P.readFileSync(g.configPath, "utf-8");
2630
- h = JSON.parse(l);
2627
+ const c = P.readFileSync(g.configPath, "utf-8");
2628
+ h = JSON.parse(c);
2631
2629
  } catch {
2632
2630
  }
2633
2631
  h.mcpServers || (h.mcpServers = {});
2634
- const c = h.mcpServers.myop;
2635
- if (c && c.url === s) {
2632
+ const l = h.mcpServers.myop;
2633
+ if (l && l.url === s) {
2636
2634
  console.log(`
2637
2635
  Myop MCP is already configured for ${g.name}.`), console.log(` Config: ${g.configPath}`), console.log(`
2638
2636
  \x1B[1mNext steps:\x1B[0m`);
2639
- for (const l of g.nextSteps)
2640
- console.log(` ${l}`);
2637
+ for (const c of g.nextSteps)
2638
+ console.log(` ${c}`);
2641
2639
  console.log(""), process.exit(0);
2642
2640
  }
2643
- if (c) {
2641
+ if (l) {
2644
2642
  console.log(`
2645
- Myop MCP is already configured (URL: ${c.url}).`);
2643
+ Myop MCP is already configured (URL: ${l.url}).`);
2646
2644
  try {
2647
2645
  await t({ message: "Update to latest URL?", default: !0 }) || process.exit(0);
2648
- } catch (l) {
2649
- throw l.name === "ExitPromptError" && process.exit(0), l;
2646
+ } catch (c) {
2647
+ throw c.name === "ExitPromptError" && process.exit(0), c;
2650
2648
  }
2651
2649
  }
2652
2650
  h.mcpServers.myop = g.getEntry(), P.mkdirSync(N.dirname(g.configPath), { recursive: !0 }), P.writeFileSync(g.configPath, JSON.stringify(h, null, 2)), console.log(`
2653
2651
  \x1B[32m✔\x1B[0m Myop MCP configured for ${g.name}`), console.log(` Config: ${g.configPath}`), console.log(` Server: ${s}`), console.log(`
2654
2652
  \x1B[1mNext steps:\x1B[0m`);
2655
- for (const l of g.nextSteps)
2656
- console.log(` ${l}`);
2653
+ for (const c of g.nextSteps)
2654
+ console.log(` ${c}`);
2657
2655
  console.log(""), process.exit(0);
2658
2656
  });
2659
2657
  const go = () => {
@@ -2689,8 +2687,8 @@ const go = () => {
2689
2687
  return null;
2690
2688
  }
2691
2689
  }, ne = async (o = !1, t = !1) => {
2692
- var l, y, S;
2693
- const e = $e(), n = !!(e != null && e.email), s = ((l = v.myopConfig) == null ? void 0 : l.name) || ((y = v.myopConfig) == null ? void 0 : y.componentName), i = (S = v.myopConfig) == null ? void 0 : S.componentId, d = go();
2690
+ var c, y, S;
2691
+ const e = $e(), n = !!(e != null && e.email), s = ((c = v.myopConfig) == null ? void 0 : c.name) || ((y = v.myopConfig) == null ? void 0 : y.componentName), i = (S = v.myopConfig) == null ? void 0 : S.componentId, d = go();
2694
2692
  console.log(`
2695
2693
  ┌─────────────────────────────────────────────────┐`), console.log("│ │"), console.log("│ Welcome to Myop CLI - Remote UI Made Easy │"), console.log("│ │"), console.log(`└─────────────────────────────────────────────────┘
2696
2694
  `), o && s ? (console.log(` Component: ${s}`), i ? (console.log(` ID: ${i}`), console.log(` Dashboard: https://dashboard.myop.dev/dashboard/2.0/component/${i}`)) : console.log(" ID: (not yet pushed)")) : console.log(" Component: No myop.config.json found"), console.log(` User: ${n ? e.email : "Not logged in"}`), d != null && d.gitNotInstalled ? (console.log(" Changes: Git not installed"), console.log(" Install: https://git-scm.com/downloads"), console.log(" Mac: brew install git | Windows: https://gitforwindows.org")) : d != null && d.notARepo ? console.log(" Changes: Not a git repository") : d && (d.insertions > 0 || d.deletions > 0) ? console.log(` Changes: ${d.files} file${d.files !== 1 ? "s" : ""} | \x1B[32m+${d.insertions}\x1B[0m \x1B[31m-${d.deletions}\x1B[0m`) : d && console.log(" Changes: No uncommitted changes"), console.log("");
@@ -2740,9 +2738,9 @@ const go = () => {
2740
2738
  value: "exit"
2741
2739
  }
2742
2740
  );
2743
- let c;
2741
+ let l;
2744
2742
  try {
2745
- c = await ot({
2743
+ l = await ot({
2746
2744
  message: "What would you like to do?",
2747
2745
  choices: h
2748
2746
  });
@@ -2752,7 +2750,7 @@ const go = () => {
2752
2750
  👋 Goodbye!
2753
2751
  `), process.exit(0)), x;
2754
2752
  }
2755
- switch (c) {
2753
+ switch (l) {
2756
2754
  case "init":
2757
2755
  await wo();
2758
2756
  break;
@@ -2844,11 +2842,11 @@ Pushing component...
2844
2842
  ⚠️ No components selected.
2845
2843
  `), process.exit(0)), g || (ho(h), console.log(`
2846
2844
  💾 Selection saved to ${xe}`));
2847
- const c = n.filter((y) => h.includes(y.path));
2848
- console.log(`🚀 Starting dev mode for ${c.length} component${c.length > 1 ? "s" : ""}...
2845
+ const l = n.filter((y) => h.includes(y.path));
2846
+ console.log(`🚀 Starting dev mode for ${l.length} component${l.length > 1 ? "s" : ""}...
2849
2847
  `);
2850
- const { monorepoDevCommand: l } = await Promise.resolve().then(() => Bt);
2851
- await l(c);
2848
+ const { monorepoDevCommand: c } = await Promise.resolve().then(() => Bt);
2849
+ await c(l);
2852
2850
  }, wo = async () => {
2853
2851
  const { input: o, select: t } = await import("@inquirer/prompts"), e = await import("fs"), n = await import("path"), s = n.default.basename(process.cwd());
2854
2852
  let i, d;
@@ -2865,11 +2863,11 @@ Pushing component...
2865
2863
  { name: "🅰️ Angular", value: "angular", disabled: "(coming soon)" }
2866
2864
  ]
2867
2865
  });
2868
- } catch (c) {
2869
- throw c.name === "ExitPromptError" && (console.log(`
2866
+ } catch (l) {
2867
+ throw l.name === "ExitPromptError" && (console.log(`
2870
2868
 
2871
2869
  👋 Goodbye!
2872
- `), process.exit(0)), c;
2870
+ `), process.exit(0)), l;
2873
2871
  }
2874
2872
  const g = {
2875
2873
  name: i,
@@ -2880,7 +2878,7 @@ Pushing component...
2880
2878
  try {
2881
2879
  e.writeFileSync(h, JSON.stringify(g, null, 2)), console.log(`
2882
2880
  ✅ Created ${h}`);
2883
- const c = {
2881
+ const l = {
2884
2882
  name: i.toLowerCase().replace(/\s+/g, "-"),
2885
2883
  version: "1.0.0",
2886
2884
  type: "module",
@@ -2892,7 +2890,7 @@ Pushing component...
2892
2890
  esbuild: "^0.24.0"
2893
2891
  }
2894
2892
  };
2895
- e.writeFileSync("package.json", JSON.stringify(c, null, 2)), console.log("✅ Created package.json"), e.mkdirSync("src/modules", { recursive: !0 }), e.mkdirSync("src/styles", { recursive: !0 }), e.writeFileSync("build.js", `import * as esbuild from 'esbuild';
2893
+ e.writeFileSync("package.json", JSON.stringify(l, null, 2)), console.log("✅ Created package.json"), e.mkdirSync("src/modules", { recursive: !0 }), e.mkdirSync("src/styles", { recursive: !0 }), e.writeFileSync("build.js", `import * as esbuild from 'esbuild';
2896
2894
  import fs from 'fs';
2897
2895
  import path from 'path';
2898
2896
 
@@ -3116,8 +3114,8 @@ dist/
3116
3114
  console.log(`
3117
3115
  📦 Next steps:`), console.log(" 1. npm install"), console.log(" 2. npm run build"), console.log(` 3. myop sync
3118
3116
  `), v.myopConfig = g, await ne(!0);
3119
- } catch (c) {
3120
- console.error(`Failed to initialize component: ${c.message}`), process.exit(1);
3117
+ } catch (l) {
3118
+ console.error(`Failed to initialize component: ${l.message}`), process.exit(1);
3121
3119
  }
3122
3120
  };
3123
3121
  v.program.command("default", { isDefault: !0 }).action(async () => {
@@ -3126,7 +3124,7 @@ v.program.command("default", { isDefault: !0 }).action(async () => {
3126
3124
  return;
3127
3125
  }
3128
3126
  if (v.program.getOptionValue("ci")) {
3129
- const g = await import("fs"), h = v.program.getOptionValue("config") || "./myop.config.json", c = v.program.version(), l = $e();
3127
+ const g = await import("fs"), h = v.program.getOptionValue("config") || "./myop.config.json", l = v.program.version(), c = $e();
3130
3128
  let y = { found: !1 };
3131
3129
  try {
3132
3130
  if (g.existsSync(h)) {
@@ -3143,11 +3141,11 @@ v.program.command("default", { isDefault: !0 }).action(async () => {
3143
3141
  y = { found: !1, error: x.message };
3144
3142
  }
3145
3143
  const S = {
3146
- version: c,
3144
+ version: l,
3147
3145
  config: y,
3148
3146
  auth: {
3149
- loggedIn: !!(l != null && l.email),
3150
- email: (l == null ? void 0 : l.email) || null
3147
+ loggedIn: !!(c != null && c.email),
3148
+ email: (c == null ? void 0 : c.email) || null
3151
3149
  }
3152
3150
  };
3153
3151
  console.log(JSON.stringify(S, null, 2)), process.exit(0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myop/cli",
3
- "version": "0.1.49",
3
+ "version": "0.1.50",
4
4
  "description": "Myop cli",
5
5
  "type": "module",
6
6
  "repository": {