openmagic 0.14.1 → 0.14.2

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/cli.js CHANGED
@@ -1356,7 +1356,7 @@ async function handleLlmChat(params, onChunk, onDone, onError) {
1356
1356
  }
1357
1357
 
1358
1358
  // src/server.ts
1359
- var VERSION = "0.14.1";
1359
+ var VERSION = "0.14.2";
1360
1360
  var __dirname = dirname2(fileURLToPath(import.meta.url));
1361
1361
  function attachOpenMagic(httpServer, roots) {
1362
1362
  function handleRequest(req, res) {
@@ -1702,14 +1702,10 @@ var COMMON_DEV_PORTS = [
1702
1702
  // Vue CLI, generic
1703
1703
  8e3,
1704
1704
  // Django, Python
1705
- 8888,
1706
- // Jupyter, generic
1707
1705
  3001,
1708
1706
  // Common alternate
1709
1707
  4e3,
1710
1708
  // Phoenix, generic
1711
- 5e3,
1712
- // Flask
1713
1709
  1234,
1714
1710
  // Parcel
1715
1711
  4321,
@@ -1718,8 +1714,12 @@ var COMMON_DEV_PORTS = [
1718
1714
  // Remix
1719
1715
  8081,
1720
1716
  // Metro (React Native)
1721
- 9e3
1717
+ 9e3,
1722
1718
  // generic
1719
+ 8888,
1720
+ // Jupyter, generic
1721
+ 5e3
1722
+ // Flask (last — macOS AirPlay also uses 5000)
1723
1723
  ];
1724
1724
  function checkPort(port, host = "127.0.0.1") {
1725
1725
  return new Promise((resolve3) => {
@@ -1739,6 +1739,15 @@ function checkPort(port, host = "127.0.0.1") {
1739
1739
  });
1740
1740
  }
1741
1741
  async function detectDevServer() {
1742
+ const scripts = detectDevScripts();
1743
+ const scriptPorts = scripts.map((s) => s.defaultPort).filter((p, i, a) => a.indexOf(p) === i);
1744
+ if (scriptPorts.length > 0) {
1745
+ for (const port of scriptPorts) {
1746
+ if (await checkPort(port)) {
1747
+ return { port, host: "127.0.0.1" };
1748
+ }
1749
+ }
1750
+ }
1742
1751
  const checks = COMMON_DEV_PORTS.map(async (port) => {
1743
1752
  const isOpen = await checkPort(port);
1744
1753
  return isOpen ? port : null;
@@ -1861,7 +1870,7 @@ process.on("uncaughtException", (err) => {
1861
1870
  process.exit(1);
1862
1871
  });
1863
1872
  var childProcesses = [];
1864
- var VERSION2 = "0.14.1";
1873
+ var VERSION2 = "0.14.2";
1865
1874
  function ask(question) {
1866
1875
  const rl = createInterface({ input: process.stdin, output: process.stdout });
1867
1876
  return new Promise((resolve3) => {