@townco/ui 0.1.102 → 0.1.103

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.
@@ -121,8 +121,8 @@ export function useSubagentStream(options) {
121
121
  });
122
122
  }
123
123
  }, [scheduleUpdate]);
124
- const connectToSubagent = useCallback(async (port, sessionId, host) => {
125
- const baseUrl = `http://${host}:${port}`;
124
+ const connectToSubagent = useCallback(async (port, sessionId, host, protocol) => {
125
+ const baseUrl = `${protocol}//${host}:${port}`;
126
126
  logger.info("Connecting to sub-agent SSE", { baseUrl, sessionId });
127
127
  setIsStreaming(true);
128
128
  setError(null);
@@ -226,6 +226,7 @@ export function useSubagentStream(options) {
226
226
  const sessionId = options?.sessionId;
227
227
  const host = options?.host ??
228
228
  (typeof window !== "undefined" ? window.location.hostname : "localhost");
229
+ const protocol = typeof window !== "undefined" ? window.location.protocol : "http:";
229
230
  // Connect when options change
230
231
  useEffect(() => {
231
232
  if (!port || !sessionId) {
@@ -236,7 +237,7 @@ export function useSubagentStream(options) {
236
237
  setError(null);
237
238
  setHasCompleted(false);
238
239
  setIsStreaming(true);
239
- connectToSubagent(port, sessionId, host);
240
+ connectToSubagent(port, sessionId, host, protocol);
240
241
  // Cleanup on unmount or options change
241
242
  return () => {
242
243
  if (abortControllerRef.current) {
@@ -248,7 +249,7 @@ export function useSubagentStream(options) {
248
249
  updateTimeoutRef.current = null;
249
250
  }
250
251
  };
251
- }, [port, sessionId, host, connectToSubagent]);
252
+ }, [port, sessionId, host, protocol, connectToSubagent]);
252
253
  // Derive streaming status: streaming if we haven't completed yet
253
254
  const effectiveIsStreaming = !hasCompleted;
254
255
  return { messages, isStreaming: effectiveIsStreaming, error };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@townco/ui",
3
- "version": "0.1.102",
3
+ "version": "0.1.103",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -49,7 +49,7 @@
49
49
  "@radix-ui/react-slot": "^1.2.4",
50
50
  "@radix-ui/react-tabs": "^1.1.13",
51
51
  "@radix-ui/react-tooltip": "^1.2.8",
52
- "@townco/core": "0.0.80",
52
+ "@townco/core": "0.0.81",
53
53
  "@types/mdast": "^4.0.4",
54
54
  "@uiw/react-json-view": "^2.0.0-alpha.39",
55
55
  "class-variance-authority": "^0.7.1",
@@ -67,7 +67,7 @@
67
67
  "zustand": "^5.0.8"
68
68
  },
69
69
  "devDependencies": {
70
- "@townco/tsconfig": "0.1.99",
70
+ "@townco/tsconfig": "0.1.100",
71
71
  "@types/node": "^24.10.0",
72
72
  "@types/react": "^19.2.2",
73
73
  "@types/unist": "^3.0.3",