@triflux/remote 10.1.0 → 10.26.0

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 (162) hide show
  1. package/hub/pipe.mjs +239 -121
  2. package/hub/public/dashboard.html +61 -0
  3. package/hub/server.mjs +2179 -709
  4. package/hub/store-adapter.mjs +59 -26
  5. package/hub/store.mjs +356 -153
  6. package/hub/team/agent-map.json +26 -7
  7. package/hub/team/ansi.mjs +245 -146
  8. package/hub/team/backend.mjs +78 -17
  9. package/hub/team/build-worker-prompt.mjs +73 -0
  10. package/hub/team/check-mcp-hub.mjs +49 -0
  11. package/hub/team/claude-daemon-control.mjs +1130 -0
  12. package/hub/team/claude-native-bridge.mjs +1011 -0
  13. package/hub/team/claude-session-projection.mjs +74 -0
  14. package/hub/team/cli/commands/attach.mjs +57 -37
  15. package/hub/team/cli/commands/control.mjs +29 -8
  16. package/hub/team/cli/commands/debug.mjs +95 -74
  17. package/hub/team/cli/commands/focus.mjs +80 -53
  18. package/hub/team/cli/commands/interrupt.mjs +18 -6
  19. package/hub/team/cli/commands/kill.mjs +16 -5
  20. package/hub/team/cli/commands/list.mjs +31 -24
  21. package/hub/team/cli/commands/send.mjs +19 -6
  22. package/hub/team/cli/commands/start/index.mjs +151 -33
  23. package/hub/team/cli/commands/start/parse-args.mjs +97 -13
  24. package/hub/team/cli/commands/start/start-headless.mjs +155 -37
  25. package/hub/team/cli/commands/start/start-in-process.mjs +50 -40
  26. package/hub/team/cli/commands/start/start-mux.mjs +122 -73
  27. package/hub/team/cli/commands/start/start-wt.mjs +86 -69
  28. package/hub/team/cli/commands/status.mjs +43 -14
  29. package/hub/team/cli/commands/stop.mjs +11 -4
  30. package/hub/team/cli/commands/task.mjs +8 -3
  31. package/hub/team/cli/commands/tasks.mjs +13 -13
  32. package/hub/team/cli/help.mjs +1 -1
  33. package/hub/team/cli/index.mjs +2 -2
  34. package/hub/team/cli/manifest.mjs +38 -8
  35. package/hub/team/cli/render.mjs +52 -30
  36. package/hub/team/cli/services/attach-fallback.mjs +74 -54
  37. package/hub/team/cli/services/hub-client.mjs +44 -16
  38. package/hub/team/cli/services/member-selector.mjs +37 -30
  39. package/hub/team/cli/services/native-control.mjs +144 -116
  40. package/hub/team/cli/services/runtime-mode.mjs +61 -4
  41. package/hub/team/cli/services/state-store.mjs +66 -9
  42. package/hub/team/cli/services/task-model.mjs +40 -30
  43. package/hub/team/codex-review.mjs +521 -0
  44. package/hub/team/conductor-mesh-bridge.mjs +25 -24
  45. package/hub/team/conductor-registry.mjs +121 -0
  46. package/hub/team/conductor.mjs +1379 -671
  47. package/hub/team/consensus-meta.mjs +176 -0
  48. package/hub/team/dashboard-anchor.mjs +4 -5
  49. package/hub/team/dashboard-layout.mjs +3 -1
  50. package/hub/team/dashboard-open.mjs +20 -118
  51. package/hub/team/dashboard.mjs +76 -28
  52. package/hub/team/event-log.mjs +18 -10
  53. package/hub/team/execution-mode.mjs +256 -0
  54. package/hub/team/extract-completion-payload.mjs +110 -0
  55. package/hub/team/git-preflight.mjs +286 -0
  56. package/hub/team/handoff.mjs +49 -18
  57. package/hub/team/headless-bridge-session.mjs +17 -0
  58. package/hub/team/headless.mjs +2213 -1156
  59. package/hub/team/health-probe.mjs +232 -69
  60. package/hub/team/interactive-native-launcher.mjs +106 -0
  61. package/hub/team/interactive-native-worker.mjs +80 -0
  62. package/hub/team/interactive-tui-transport.mjs +465 -0
  63. package/hub/team/launcher-template.mjs +49 -17
  64. package/hub/team/lead-control.mjs +91 -4
  65. package/hub/team/mcp-selector.mjs +145 -0
  66. package/hub/team/native-supervisor.mjs +90 -26
  67. package/hub/team/native.mjs +120 -42
  68. package/hub/team/nativeProxy.mjs +184 -113
  69. package/hub/team/notify.mjs +147 -78
  70. package/hub/team/orchestrator.mjs +173 -161
  71. package/hub/team/pane.mjs +43 -20
  72. package/hub/team/process-cleanup.mjs +69 -25
  73. package/hub/team/psmux.mjs +1022 -281
  74. package/hub/team/recovery-store.mjs +149 -0
  75. package/hub/team/remote-probe.mjs +68 -52
  76. package/hub/team/remote-session.mjs +131 -59
  77. package/hub/team/remote-watcher.mjs +61 -33
  78. package/hub/team/retry-state-machine.mjs +336 -0
  79. package/hub/team/routing.mjs +51 -25
  80. package/hub/team/runtime-strategy.mjs +200 -0
  81. package/hub/team/schemas/worker-completion.json +39 -0
  82. package/hub/team/sentinel-capture.mjs +127 -0
  83. package/hub/team/session-sync.mjs +153 -6
  84. package/hub/team/session.mjs +574 -611
  85. package/hub/team/shared.mjs +13 -13
  86. package/hub/team/staleState.mjs +72 -30
  87. package/hub/team/swarm-cli.mjs +390 -0
  88. package/hub/team/swarm-hypervisor.mjs +1544 -193
  89. package/hub/team/swarm-intent.mjs +216 -0
  90. package/hub/team/swarm-locks.mjs +140 -25
  91. package/hub/team/swarm-planner.mjs +121 -21
  92. package/hub/team/swarm-preflight.mjs +319 -0
  93. package/hub/team/swarm-reconciler.mjs +128 -23
  94. package/hub/team/synapse-cli.mjs +458 -0
  95. package/hub/team/synapse-http.mjs +60 -0
  96. package/hub/team/synapse-registry.mjs +329 -0
  97. package/hub/team/terminal-opener.mjs +216 -0
  98. package/hub/team/tui-core.mjs +292 -0
  99. package/hub/team/tui-lite.mjs +237 -148
  100. package/hub/team/tui-remote-adapter.mjs +18 -34
  101. package/hub/team/tui-synapse.mjs +223 -0
  102. package/hub/team/tui-viewer.mjs +108 -48
  103. package/hub/team/tui-widgets.mjs +262 -0
  104. package/hub/team/tui.mjs +931 -439
  105. package/hub/team/worker-completion-validator.mjs +84 -0
  106. package/hub/team/worker-sandbox.mjs +97 -0
  107. package/hub/team/worker-signal.mjs +263 -0
  108. package/hub/team/worker-signal.types.d.ts +52 -0
  109. package/hub/team/worktree-lifecycle.mjs +517 -63
  110. package/hub/team/wt-manager.mjs +297 -26
  111. package/hub/tools.mjs +477 -252
  112. package/hub/tray.mjs +411 -368
  113. package/hub/workers/antigravity-route-worker.mjs +169 -0
  114. package/hub/workers/claude-worker.mjs +162 -118
  115. package/hub/workers/codex-app-server-worker.mjs +1015 -0
  116. package/hub/workers/codex-mcp.mjs +724 -507
  117. package/hub/workers/delegator-mcp.mjs +570 -499
  118. package/hub/workers/factory.mjs +103 -21
  119. package/hub/workers/gemini-worker.mjs +126 -284
  120. package/hub/workers/interface.mjs +24 -2
  121. package/hub/workers/lib/jsonrpc-stdio.mjs +463 -0
  122. package/hub/workers/worker-utils.mjs +23 -17
  123. package/package.json +4 -3
  124. package/scripts/lib/agent-json.mjs +27 -0
  125. package/scripts/lib/async.mjs +174 -0
  126. package/scripts/lib/claudemd-scanner.mjs +223 -0
  127. package/scripts/lib/cli-agy.mjs +62 -0
  128. package/scripts/lib/cli-claude.mjs +78 -0
  129. package/scripts/lib/cli-codex.mjs +199 -0
  130. package/scripts/lib/cli-gemini.mjs +37 -0
  131. package/scripts/lib/codex-recovery.sh +50 -0
  132. package/scripts/lib/context.mjs +67 -0
  133. package/scripts/lib/cross-review-utils.mjs +59 -0
  134. package/scripts/lib/doctor-env-checks.mjs +121 -0
  135. package/scripts/lib/dynamic-route-cli.mjs +107 -0
  136. package/scripts/lib/env-probe.mjs +269 -0
  137. package/scripts/lib/env.mjs +14 -0
  138. package/scripts/lib/gemini-profiles.mjs +119 -0
  139. package/scripts/lib/handoff.mjs +187 -0
  140. package/scripts/lib/hook-utils.mjs +16 -0
  141. package/scripts/lib/hub.mjs +48 -0
  142. package/scripts/lib/keyword-rules.mjs +195 -0
  143. package/scripts/lib/logger.mjs +105 -0
  144. package/scripts/lib/mcp-filter.mjs +883 -0
  145. package/scripts/lib/mcp-gateway-health-check.mjs +159 -0
  146. package/scripts/lib/mcp-gateway-servers.mjs +70 -0
  147. package/scripts/lib/mcp-gateway-wrapper-check.mjs +35 -0
  148. package/scripts/lib/mcp-guard-engine.mjs +2120 -0
  149. package/scripts/lib/mcp-health.mjs +773 -0
  150. package/scripts/lib/mcp-manifest.mjs +89 -0
  151. package/scripts/lib/mcp-server-catalog.mjs +355 -0
  152. package/scripts/lib/pid.mjs +63 -0
  153. package/scripts/lib/process-utils.mjs +26 -0
  154. package/scripts/lib/psmux-info.mjs +224 -0
  155. package/scripts/lib/quota.mjs +47 -0
  156. package/scripts/lib/remote-spawn-transfer.mjs +226 -0
  157. package/scripts/lib/skill-state.mjs +220 -0
  158. package/scripts/lib/skill-template.mjs +375 -0
  159. package/scripts/lib/team.mjs +75 -0
  160. package/scripts/lib/timeout.mjs +66 -0
  161. package/scripts/lib/tmp.mjs +26 -0
  162. package/scripts/lib/toml.mjs +113 -0
@@ -0,0 +1,39 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "WorkerCompletion",
4
+ "description": "Self-reported worker completion payload emitted by a swarm shard worker.",
5
+ "type": "object",
6
+ "required": ["status"],
7
+ "properties": {
8
+ "status": {
9
+ "type": "string",
10
+ "enum": ["ok", "skipped", "failed"]
11
+ },
12
+ "shard": { "type": "string" },
13
+ "reason": { "type": "string" },
14
+ "commits_made": {
15
+ "type": "array",
16
+ "items": {
17
+ "type": "object",
18
+ "required": ["sha"],
19
+ "properties": {
20
+ "sha": { "type": "string", "minLength": 7 },
21
+ "message": { "type": "string" }
22
+ },
23
+ "additionalProperties": true
24
+ }
25
+ }
26
+ },
27
+ "additionalProperties": true,
28
+ "allOf": [
29
+ {
30
+ "if": { "properties": { "status": { "const": "ok" } } },
31
+ "then": {
32
+ "required": ["commits_made"],
33
+ "properties": {
34
+ "commits_made": { "minItems": 1 }
35
+ }
36
+ }
37
+ }
38
+ ]
39
+ }
@@ -0,0 +1,127 @@
1
+ // hub/team/sentinel-capture.mjs — stdout sentinel-framed payload capture (#125)
2
+ //
3
+ // Workers emit completion payloads delimited by `<<<TFX_COMPLETION_BEGIN>>>`
4
+ // and `<<<TFX_COMPLETION_END>>>` (see swarm-hypervisor.mjs buildWorkerPrompt
5
+ // appendix). conductor.mjs feeds every stdout chunk through `push()`. After the
6
+ // child exits, `snapshot()` returns the captured slice (BEGIN..END inclusive)
7
+ // for `extractCompletionPayload`.
8
+ //
9
+ // Why this lives outside the 16 KiB stdoutTail buffer:
10
+ // payloads with large `commits_made` arrays can exceed 16 KiB and a sliding
11
+ // tail would head-truncate the BEGIN marker, leading to silent fallback to
12
+ // brace-scan and an incorrect inner-object extraction (#115 Codex Finding 2).
13
+ //
14
+ // Pure module — no I/O, no timers — so it can be unit-tested directly.
15
+
16
+ export const SENTINEL_BEGIN = "<<<TFX_COMPLETION_BEGIN>>>";
17
+ export const SENTINEL_END = "<<<TFX_COMPLETION_END>>>";
18
+
19
+ const DEFAULT_MAX_BYTES = 1 << 20; // 1 MiB safety cap on captured region
20
+
21
+ // Per the worker prompt appendix, both markers must appear alone on their own
22
+ // line. Substring matches inside log lines / debug echoes must NOT trigger
23
+ // capture or terminate it. We treat `\n`, `\r`, and string boundaries (start
24
+ // or end of buffer) as line edges so Windows `\r\n` works without special-casing.
25
+ function isLineEdgeChar(ch) {
26
+ return ch === "\n" || ch === "\r";
27
+ }
28
+
29
+ function findStandaloneMarker(text, marker, fromIdx = 0) {
30
+ let from = fromIdx;
31
+ while (from <= text.length - marker.length) {
32
+ const idx = text.indexOf(marker, from);
33
+ if (idx === -1) return -1;
34
+ const before = idx === 0 || isLineEdgeChar(text[idx - 1]);
35
+ const afterIdx = idx + marker.length;
36
+ const after = afterIdx === text.length || isLineEdgeChar(text[afterIdx]);
37
+ if (before && after) return idx;
38
+ from = idx + 1;
39
+ }
40
+ return -1;
41
+ }
42
+
43
+ /**
44
+ * Streaming sentinel capture state machine.
45
+ *
46
+ * @param {object} [opts]
47
+ * @param {number} [opts.maxBytes=1048576] safety cap on the captured region.
48
+ * If the capture grows past this and head-truncation removes the BEGIN
49
+ * marker, `isOverflow()` becomes true so the conductor can deterministically
50
+ * reject instead of falling back to brace-scan on a runaway payload
51
+ * (Codex R1 MEDIUM finding).
52
+ * @returns {{push: (text: string) => void, snapshot: () => string,
53
+ * isActive: () => boolean, isComplete: () => boolean,
54
+ * isOverflow: () => boolean}}
55
+ */
56
+ export function createSentinelCapture({ maxBytes = DEFAULT_MAX_BYTES } = {}) {
57
+ let capturing = false;
58
+ let capture = "";
59
+ let overlap = "";
60
+ let done = false;
61
+ let overflowed = false;
62
+
63
+ // Boundary overlap covers the marker length plus one extra byte so we can
64
+ // verify the line-edge character that precedes BEGIN across chunk seams.
65
+ const overlapWindow = SENTINEL_BEGIN.length;
66
+
67
+ function maybeFlagOverflow() {
68
+ if (findStandaloneMarker(capture, SENTINEL_BEGIN) === -1) {
69
+ overflowed = true;
70
+ done = true;
71
+ return true;
72
+ }
73
+ return false;
74
+ }
75
+
76
+ function push(text) {
77
+ if (done || typeof text !== "string" || text.length === 0) return;
78
+
79
+ if (!capturing) {
80
+ const search = overlap + text;
81
+ const idx = findStandaloneMarker(search, SENTINEL_BEGIN);
82
+ if (idx !== -1) {
83
+ capturing = true;
84
+ capture = search.slice(idx);
85
+ overlap = "";
86
+ if (capture.length > maxBytes) {
87
+ capture = capture.slice(-maxBytes);
88
+ if (maybeFlagOverflow()) return;
89
+ }
90
+ } else {
91
+ overlap = search.slice(-overlapWindow);
92
+ return;
93
+ }
94
+ } else {
95
+ capture += text;
96
+ if (capture.length > maxBytes) {
97
+ capture = capture.slice(-maxBytes);
98
+ if (maybeFlagOverflow()) return;
99
+ }
100
+ }
101
+
102
+ // Stop capturing once the standalone-line END marker is seen. Trim to the
103
+ // first BEGIN..END pair so a worker that re-emitted (retry, debug log)
104
+ // doesn't bloat the snapshot.
105
+ const endIdx = findStandaloneMarker(capture, SENTINEL_END);
106
+ if (endIdx !== -1) {
107
+ done = true;
108
+ capture = capture.slice(0, endIdx + SENTINEL_END.length);
109
+ }
110
+ }
111
+
112
+ return {
113
+ push,
114
+ snapshot() {
115
+ return capture;
116
+ },
117
+ isActive() {
118
+ return capturing && !done;
119
+ },
120
+ isComplete() {
121
+ return done && !overflowed;
122
+ },
123
+ isOverflow() {
124
+ return overflowed;
125
+ },
126
+ };
127
+ }
@@ -1,13 +1,19 @@
1
+ import { readState } from "@triflux/core/hub/state.mjs";
2
+
1
3
  const DEFAULT_TIMEOUT_MS = 2500;
4
+ const DEFAULT_HEADLESS_POLL_MS = 1000;
2
5
 
3
6
  function resolveFetch(fetchImpl) {
4
7
  if (typeof fetchImpl === "function") return fetchImpl;
5
- if (typeof globalThis.fetch === "function") return globalThis.fetch.bind(globalThis);
8
+ if (typeof globalThis.fetch === "function")
9
+ return globalThis.fetch.bind(globalThis);
6
10
  return null;
7
11
  }
8
12
 
9
13
  function normalizeHubBaseUrl(hubUrl) {
10
- return String(hubUrl || "").replace(/\/+$/, "").replace(/\/mcp$/, "");
14
+ return String(hubUrl || "")
15
+ .replace(/\/+$/, "")
16
+ .replace(/\/mcp$/, "");
11
17
  }
12
18
 
13
19
  function safeAbortSignal(timeoutMs) {
@@ -15,6 +21,55 @@ function safeAbortSignal(timeoutMs) {
15
21
  return AbortSignal.timeout(timeoutMs);
16
22
  }
17
23
 
24
+ function isPidAlive(pid) {
25
+ const resolvedPid = Number(pid);
26
+ if (!Number.isFinite(resolvedPid) || resolvedPid <= 0) return false;
27
+ try {
28
+ process.kill(resolvedPid, 0);
29
+ return true;
30
+ } catch {
31
+ return false;
32
+ }
33
+ }
34
+
35
+ function resolveHeadlessHubUrl(hubUrl) {
36
+ const normalized = normalizeHubBaseUrl(hubUrl);
37
+ if (normalized) return normalized;
38
+
39
+ const stateUrl = normalizeHubBaseUrl(readState()?.url);
40
+ if (stateUrl) return stateUrl;
41
+
42
+ const envHubUrl = normalizeHubBaseUrl(process.env.TFX_HUB_URL);
43
+ if (envHubUrl) return envHubUrl;
44
+
45
+ const envPort = Number(process.env.TFX_HUB_PORT || "27888");
46
+ const port = Number.isFinite(envPort) && envPort > 0 ? envPort : 27888;
47
+ return `http://127.0.0.1:${port}`;
48
+ }
49
+
50
+ function hasLiveHubState() {
51
+ const state = readState();
52
+ return !!normalizeHubBaseUrl(state?.url) && isPidAlive(state?.pid);
53
+ }
54
+
55
+ function toHeadlessSessionAgentId(sessionName) {
56
+ const normalizedSessionName = String(sessionName || "").trim();
57
+ return normalizedSessionName ? `session:${normalizedSessionName}` : "";
58
+ }
59
+
60
+ async function dispatchHeadlessCommand(command, callbacks) {
61
+ const callbackMap = {
62
+ pause: callbacks.onPause,
63
+ resume: callbacks.onResume,
64
+ abort: callbacks.onAbort,
65
+ reassign: callbacks.onReassign,
66
+ };
67
+ const handler = callbackMap[command?.command];
68
+ if (typeof handler === "function") {
69
+ await handler(command);
70
+ }
71
+ }
72
+
18
73
  async function safeJson(res) {
19
74
  try {
20
75
  return await res.json();
@@ -24,8 +79,13 @@ async function safeJson(res) {
24
79
  }
25
80
 
26
81
  function normalizeLeadCommandMessage(message) {
27
- const payload = message?.payload && typeof message.payload === "object" ? message.payload : {};
28
- const command = String(payload.command || "").trim().toLowerCase();
82
+ const payload =
83
+ message?.payload && typeof message.payload === "object"
84
+ ? message.payload
85
+ : {};
86
+ const command = String(payload.command || "")
87
+ .trim()
88
+ .toLowerCase();
29
89
  if (!command) return null;
30
90
  return {
31
91
  messageId: message.id || null,
@@ -79,7 +139,9 @@ export async function subscribeToLeadCommands({
79
139
  });
80
140
 
81
141
  const body = await safeJson(res);
82
- const messages = Array.isArray(body?.data?.messages) ? body.data.messages : [];
142
+ const messages = Array.isArray(body?.data?.messages)
143
+ ? body.data.messages
144
+ : [];
83
145
  const commands = messages
84
146
  .filter((message) => message?.topic === "lead.control")
85
147
  .map(normalizeLeadCommandMessage)
@@ -108,6 +170,90 @@ export async function subscribeToLeadCommands({
108
170
  }
109
171
  }
110
172
 
173
+ export function createHeadlessControlSubscriber(
174
+ sessionName,
175
+ {
176
+ onPause,
177
+ onResume,
178
+ onAbort,
179
+ onReassign,
180
+ hubUrl,
181
+ pollIntervalMs = DEFAULT_HEADLESS_POLL_MS,
182
+ maxMessages = 10,
183
+ autoAck = true,
184
+ timeoutMs = DEFAULT_TIMEOUT_MS,
185
+ fetchImpl,
186
+ } = {},
187
+ ) {
188
+ const sessionAgentId = toHeadlessSessionAgentId(sessionName);
189
+ if (!sessionAgentId) {
190
+ return { stop() {} };
191
+ }
192
+
193
+ const explicitHubUrl =
194
+ normalizeHubBaseUrl(hubUrl) || normalizeHubBaseUrl(process.env.TFX_HUB_URL);
195
+ if (!explicitHubUrl && !hasLiveHubState()) {
196
+ return { stop() {} };
197
+ }
198
+
199
+ const resolvedHubUrl = explicitHubUrl || resolveHeadlessHubUrl(hubUrl);
200
+ const callbacks = { onPause, onResume, onAbort, onReassign };
201
+ const intervalMs = Math.max(
202
+ 50,
203
+ Number(pollIntervalMs) || DEFAULT_HEADLESS_POLL_MS,
204
+ );
205
+
206
+ let stopped = false;
207
+ let timer = null;
208
+ let pending = false;
209
+
210
+ const stop = () => {
211
+ stopped = true;
212
+ if (timer) clearTimeout(timer);
213
+ timer = null;
214
+ };
215
+
216
+ const scheduleNext = () => {
217
+ if (stopped) return;
218
+ timer = setTimeout(tick, intervalMs);
219
+ if (typeof timer?.unref === "function") timer.unref();
220
+ };
221
+
222
+ const tick = async () => {
223
+ if (stopped || pending) {
224
+ scheduleNext();
225
+ return;
226
+ }
227
+
228
+ pending = true;
229
+ try {
230
+ const result = await subscribeToLeadCommands({
231
+ hubUrl: resolvedHubUrl,
232
+ agentId: sessionAgentId,
233
+ maxMessages,
234
+ autoAck,
235
+ timeoutMs,
236
+ fetchImpl,
237
+ onCommand: async (command) => {
238
+ await dispatchHeadlessCommand(command, callbacks);
239
+ },
240
+ });
241
+
242
+ if (!result?.ok && result?.error === "LEAD_COMMAND_SUBSCRIBE_FAILED") {
243
+ stop();
244
+ return;
245
+ }
246
+ } finally {
247
+ pending = false;
248
+ scheduleNext();
249
+ }
250
+ };
251
+
252
+ void tick();
253
+
254
+ return { stop };
255
+ }
256
+
111
257
  export async function getTeamStatus({
112
258
  hubUrl,
113
259
  scope = "hub",
@@ -127,7 +273,8 @@ export async function getTeamStatus({
127
273
  return { ok: false, error: "HUB_URL_REQUIRED" };
128
274
  }
129
275
 
130
- const normalizedMethod = String(method || "GET").toUpperCase() === "POST" ? "POST" : "GET";
276
+ const normalizedMethod =
277
+ String(method || "GET").toUpperCase() === "POST" ? "POST" : "GET";
131
278
  const statusScope = String(scope || "hub").trim() || "hub";
132
279
 
133
280
  let endpoint = `${hubBase}/bridge/status`;