@burdenoff/fe-libs 2026.1028.2 → 2026.1028.4

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.
@@ -35,72 +35,78 @@ function d(e) {
35
35
  default: return "unknown";
36
36
  }
37
37
  }
38
- function f({ onFinalize: s, language: c }) {
39
- let { locale: f } = e(), [p, m] = i(!1), [h, g] = i(!1), [_, v] = i(""), [y, b] = i(null), x = r(null), S = r(0), C = r(-Infinity), w = r(0), T = r(s);
38
+ function f({ onFinalize: s, onSpeechEnd: c, language: f }) {
39
+ let { locale: p } = e(), [m, h] = i(!1), [g, _] = i(!1), [v, y] = i(""), [b, x] = i(null), S = r(null), C = r(0), w = r(-Infinity), T = r(0), E = r(c);
40
40
  n(() => {
41
- T.current = s;
41
+ E.current = c;
42
+ }, [c]);
43
+ let D = r(s);
44
+ n(() => {
45
+ D.current = s;
42
46
  }, [s]);
43
- let E = o() !== null, D = c ?? a[f] ?? "en-US";
47
+ let O = o() !== null, k = f ?? a[p] ?? "en-US";
44
48
  n(() => () => {
45
- x.current?.abort(), x.current = null;
49
+ S.current?.abort(), S.current = null;
46
50
  }, []);
47
- let O = t((e = "manual") => {
51
+ let A = t((e = "manual") => {
48
52
  let t = o();
49
- if (!t || x.current || e === "auto" && u(C.current, performance.now())) return;
53
+ if (!t || S.current || e === "auto" && u(w.current, performance.now())) return;
50
54
  let n = new t();
51
- n.continuous = !0, n.interimResults = !0, n.lang = D;
52
- let r = S.current;
53
- n.onresult = (e) => {
54
- if (r !== S.current) return;
55
+ n.continuous = !0, n.interimResults = !0, n.lang = k;
56
+ let r = C.current;
57
+ n.onspeechend = () => {
58
+ r === C.current && E.current?.(performance.now());
59
+ }, n.onresult = (e) => {
60
+ if (r !== C.current) return;
55
61
  let t = "", n = "";
56
62
  for (let r = e.resultIndex; r < e.results.length; r += 1) {
57
63
  let i = e.results[r], a = i[0]?.transcript ?? "";
58
64
  i.isFinal ? t += a : n += a;
59
65
  }
60
- t.trim() && T.current(t.trim()), v(n.trim());
66
+ t.trim() && D.current(t.trim()), y(n.trim());
61
67
  }, n.onerror = (e) => {
62
- if (r !== S.current) return;
68
+ if (r !== C.current) return;
63
69
  let t = d(e.error);
64
- t !== "no-speech" && b(t);
70
+ t !== "no-speech" && x(t);
65
71
  }, n.onend = () => {
66
- r === S.current && (x.current = null, g(!1), m(!1), v(""));
72
+ r === C.current && (S.current = null, _(!1), h(!1), y(""));
67
73
  }, n.onstart = () => {
68
- r === S.current && (g(!1), m(!0));
69
- }, g(!0);
74
+ r === C.current && (_(!1), h(!0));
75
+ }, _(!0);
70
76
  try {
71
77
  n.start();
72
78
  } catch {
73
- C.current = performance.now(), w.current += 1, w.current >= l && b("unknown"), x.current = null, g(!1), m(!1);
79
+ w.current = performance.now(), T.current += 1, T.current >= l && x("unknown"), S.current = null, _(!1), h(!1);
74
80
  return;
75
81
  }
76
- x.current = n, w.current = 0, b(null), v("");
77
- }, [D]), k = t(() => {
78
- let e = x.current;
79
- x.current = null, S.current += 1, e?.stop(), g(!1), m(!1), v("");
80
- }, []), A = r(D);
82
+ S.current = n, T.current = 0, x(null), y("");
83
+ }, [k]), j = t(() => {
84
+ let e = S.current;
85
+ S.current = null, C.current += 1, e?.stop(), _(!1), h(!1), y("");
86
+ }, []), M = r(k);
81
87
  n(() => {
82
- A.current !== D && (A.current = D, k(), b(null));
83
- }, [D, k]);
84
- let j = t(() => {
85
- p || h ? k() : O();
88
+ M.current !== k && (M.current = k, j(), x(null));
89
+ }, [k, j]);
90
+ let N = t(() => {
91
+ m || g ? j() : A();
86
92
  }, [
87
- p,
88
- h,
89
- O,
90
- k
91
- ]), M = t(() => b(null), []);
93
+ m,
94
+ g,
95
+ A,
96
+ j
97
+ ]), P = t(() => x(null), []);
92
98
  return {
93
- isSupported: E,
94
- isListening: p,
95
- isStarting: h,
96
- isActive: p || h,
97
- interim: _,
98
- error: y,
99
- language: D,
100
- start: O,
101
- stop: k,
102
- toggle: j,
103
- clearError: M
99
+ isSupported: O,
100
+ isListening: m,
101
+ isStarting: g,
102
+ isActive: m || g,
103
+ interim: v,
104
+ error: b,
105
+ language: k,
106
+ start: A,
107
+ stop: j,
108
+ toggle: N,
109
+ clearError: P
104
110
  };
105
111
  }
106
112
  //#endregion
@@ -70,3 +70,16 @@ export declare function resolveNativeDeployTarget(): DeployTarget;
70
70
  * a localhost dev server against a remote backend without editing source.
71
71
  */
72
72
  export declare function resolveGatewayUrls(): RuntimeGatewayUrls;
73
+ /**
74
+ * Gateway URLs that a client OUTSIDE this browser tab can reach: an MCP client,
75
+ * a webhook sender, a CLI, a curl command shown on a settings page.
76
+ *
77
+ * `resolveGatewayUrls()` is right for the shell's own requests, but on alpha it
78
+ * returns the shell's own origin (`https://alphaapp.<domain>`), because the
79
+ * alpha edge worker proxies only the GraphQL paths same-origin. Any other path
80
+ * on that host (`/mcp/...`, webhooks) is answered by the SPA fallback with HTML,
81
+ * so a URL built from it and handed to an external client is wrong. This
82
+ * resolver returns the real alpha gateway hosts instead and is identical to
83
+ * `resolveGatewayUrls()` everywhere else.
84
+ */
85
+ export declare function resolveExternalGatewayUrls(): RuntimeGatewayUrls;
@@ -42,7 +42,7 @@ function d() {
42
42
  }
43
43
  }
44
44
  function f() {
45
- let e = h();
45
+ let e = g();
46
46
  if (e === "prod" || e === "alpha" || e === "local") return e;
47
47
  let t = d();
48
48
  return t === "alpha" || t === "staging" ? "alpha" : t === "dev" || t === "development" ? "local" : "prod";
@@ -59,13 +59,17 @@ function m() {
59
59
  if (o.has(d)) return r;
60
60
  if (s.has(d)) return l(d);
61
61
  if (u(d)) {
62
- let e = h();
62
+ let e = g();
63
63
  if (e === "prod") return p || (p = !0, console.warn("[gatewayUrls] WARNING: localhost dev server is configured to hit PRODUCTION backends (VITE_GATEWAY_TARGET=prod). Any mutation will modify real prod data. Remove the env var or delete .env.local to disable.")), r;
64
64
  if (e === "alpha") return n;
65
65
  }
66
66
  return i;
67
67
  }
68
68
  function h() {
69
+ let e = m(), t = c();
70
+ return s.has(t) && e.workspaceBaseUrl === `https://${t}` ? n : e;
71
+ }
72
+ function g() {
69
73
  try {
70
74
  return {
71
75
  BASE_URL: "/",
@@ -79,4 +83,4 @@ function h() {
79
83
  }
80
84
  }
81
85
  //#endregion
82
- export { a as ALL_PRODUCT_DOMAINS, s as ALPHA_HOSTS, o as PROD_HOSTS, c as getCurrentHostname, m as resolveGatewayUrls, f as resolveNativeDeployTarget };
86
+ export { a as ALL_PRODUCT_DOMAINS, s as ALPHA_HOSTS, o as PROD_HOSTS, c as getCurrentHostname, h as resolveExternalGatewayUrls, m as resolveGatewayUrls, f as resolveNativeDeployTarget };
@@ -64,7 +64,7 @@ export declare function getGatewayConfig(gateway: Gateway): {
64
64
  * Build full gateway URL
65
65
  */
66
66
  export declare function getGatewayUrl(baseUrl: string | undefined, gateway: Gateway): string;
67
- export { resolveGatewayUrls } from './gatewayUrls';
67
+ export { resolveExternalGatewayUrls, resolveGatewayUrls } from './gatewayUrls';
68
68
  export type { RuntimeGatewayUrls } from './gatewayUrls';
69
69
  export { resolveAuthBridgeConfig, resolveShellAuthBridgeConfig } from './authBridgeUrls';
70
70
  export type { RuntimeAuthBridgeConfig } from './authBridgeUrls';