@mindstudio-ai/local-model-tunnel 0.5.8 → 0.5.9

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.
@@ -3,7 +3,7 @@ import {
3
3
  detectAllProviderStatuses,
4
4
  discoverAllModelsWithParameters,
5
5
  requestEvents
6
- } from "./chunk-QALGC7T7.js";
6
+ } from "./chunk-253MU7UA.js";
7
7
  import {
8
8
  DevProxy,
9
9
  DevRunner,
@@ -34,8 +34,9 @@ import {
34
34
  syncModels,
35
35
  syncSchema,
36
36
  verifyApiKey,
37
+ watchConfigFile,
37
38
  watchTableFiles
38
- } from "./chunk-C3JPRLSS.js";
39
+ } from "./chunk-4CMGJFH3.js";
39
40
 
40
41
  // src/tui/index.tsx
41
42
  import { render } from "ink";
@@ -150,7 +151,7 @@ function Header({
150
151
  /* @__PURE__ */ jsx(Text, { bold: true, color: "white", children: "MindStudio Local Tunnel" }),
151
152
  compact && /* @__PURE__ */ jsxs(Text, { color: "gray", children: [
152
153
  " v",
153
- "0.5.8"
154
+ "0.5.9"
154
155
  ] }),
155
156
  environment !== "prod" && /* @__PURE__ */ jsxs(Fragment, { children: [
156
157
  /* @__PURE__ */ jsx(Text, { children: " " }),
@@ -168,7 +169,7 @@ function Header({
168
169
  ] }),
169
170
  !compact && /* @__PURE__ */ jsxs(Text, { color: "gray", children: [
170
171
  "v",
171
- "0.5.8"
172
+ "0.5.9"
172
173
  ] })
173
174
  ] })
174
175
  ]
@@ -2604,8 +2605,6 @@ function TabBar({ tabs, activeTab }) {
2604
2605
  // src/tui/dev/hooks/useDevSession.ts
2605
2606
  import { useState as useState18, useEffect as useEffect17, useRef as useRef10, useCallback as useCallback11 } from "react";
2606
2607
  import { spawn as spawn3 } from "child_process";
2607
- import { watch } from "fs";
2608
- import { join } from "path";
2609
2608
 
2610
2609
  // src/tui/dev/hooks/useDevServer.ts
2611
2610
  import { useState as useState17, useCallback as useCallback10, useRef as useRef9, useEffect as useEffect16 } from "react";
@@ -2829,38 +2828,26 @@ function useDevSession(appConfig) {
2829
2828
  unsubAuthFailed();
2830
2829
  };
2831
2830
  }, []);
2832
- const restartTimerRef = useRef10(void 0);
2833
2831
  useEffect17(() => {
2834
- let watcher;
2835
- try {
2836
- const configPath = join(process.cwd(), "mindstudio.json");
2837
- watcher = watch(configPath, () => {
2838
- clearTimeout(restartTimerRef.current);
2839
- restartTimerRef.current = setTimeout(async () => {
2840
- if (!mountedRef.current || phase !== "running") return;
2841
- cleanupTableWatchers();
2842
- proxyRef.current?.stop();
2843
- proxyRef.current = null;
2844
- devServer.stop();
2845
- if (runnerRef.current) {
2846
- await runnerRef.current.stop().catch(() => {
2847
- });
2848
- runnerRef.current = null;
2849
- }
2850
- if (mountedRef.current) {
2851
- setSession(null);
2852
- setProxyPort(null);
2853
- setSyncResult(null);
2854
- setPhase("ready");
2855
- }
2856
- }, 500);
2857
- });
2858
- } catch {
2859
- }
2860
- return () => {
2861
- clearTimeout(restartTimerRef.current);
2862
- watcher?.close();
2863
- };
2832
+ const cleanup = watchConfigFile(process.cwd(), async () => {
2833
+ if (!mountedRef.current || phase !== "running") return;
2834
+ cleanupTableWatchers();
2835
+ proxyRef.current?.stop();
2836
+ proxyRef.current = null;
2837
+ devServer.stop();
2838
+ if (runnerRef.current) {
2839
+ await runnerRef.current.stop().catch(() => {
2840
+ });
2841
+ runnerRef.current = null;
2842
+ }
2843
+ if (mountedRef.current) {
2844
+ setSession(null);
2845
+ setProxyPort(null);
2846
+ setSyncResult(null);
2847
+ setPhase("ready");
2848
+ }
2849
+ });
2850
+ return cleanup;
2864
2851
  }, [phase, devServer]);
2865
2852
  useEffect17(() => {
2866
2853
  mountedRef.current = true;
@@ -3803,7 +3790,7 @@ function getInstallMethod() {
3803
3790
  return "npm";
3804
3791
  }
3805
3792
  function getCurrentVersion() {
3806
- return "0.5.8";
3793
+ return "0.5.9";
3807
3794
  }
3808
3795
  async function fetchLatestVersion() {
3809
3796
  try {
@@ -4045,4 +4032,4 @@ async function startTUI() {
4045
4032
  export {
4046
4033
  startTUI
4047
4034
  };
4048
- //# sourceMappingURL=tui-4PJCFILV.js.map
4035
+ //# sourceMappingURL=tui-343LXUFQ.js.map