@triflux/remote 10.31.0 → 10.33.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.
- package/cto/brief.mjs +93 -0
- package/cto/collect.mjs +846 -0
- package/cto/current.schema.json +181 -0
- package/cto/status.mjs +260 -0
- package/hub/hub-lifecycle.mjs +242 -0
- package/hub/mac-focus.mjs +94 -0
- package/hub/mac-tray.swift +133 -0
- package/hub/promote-penalties.mjs +138 -0
- package/hub/public/tray.html +594 -0
- package/hub/server.mjs +233 -44
- package/hub/team/claude-daemon-control.mjs +46 -46
- package/hub/team/conductor.mjs +18 -0
- package/hub/team/cto-auto-collect.mjs +109 -0
- package/hub/team/cto-pull.mjs +27 -0
- package/hub/team/uds-orchestrator.mjs +607 -0
- package/hub/tray-lifecycle.mjs +131 -0
- package/hub/tray-runtime.mjs +265 -0
- package/hub/tray-state.mjs +448 -0
- package/hub/tray.mjs +93 -4
- package/hub/workers/antigravity-route-worker.mjs +14 -4
- package/hub/workers/delegator-mcp.mjs +2 -5
- package/hub/workers/factory.mjs +1 -1
- package/hub/workers/gemini-worker.mjs +2 -1
- package/package.json +7 -2
- package/scripts/lib/env-probe.mjs +36 -9
|
@@ -4,7 +4,8 @@ import { existsSync, readFileSync } from "node:fs";
|
|
|
4
4
|
import { homedir } from "node:os";
|
|
5
5
|
import { dirname, join } from "node:path";
|
|
6
6
|
import { fileURLToPath } from "node:url";
|
|
7
|
-
import {
|
|
7
|
+
import { resolveHubPortForContext } from "../../hub/hub-lifecycle.mjs";
|
|
8
|
+
import { whichCommand, whichCommandAsync } from "../../hub/platform.mjs";
|
|
8
9
|
|
|
9
10
|
const HUB_DEFAULT_PORT = 27888;
|
|
10
11
|
const DEFAULT_STATUS_URL = "http://127.0.0.1:27888/status";
|
|
@@ -37,13 +38,36 @@ function fetchHubStatus({
|
|
|
37
38
|
};
|
|
38
39
|
}
|
|
39
40
|
|
|
40
|
-
export function resolveDefaultStatusUrl(env = process.env) {
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
export function resolveDefaultStatusUrl(env = process.env, cwd = process.cwd()) {
|
|
42
|
+
const port = resolveHubPortForContext({
|
|
43
|
+
env,
|
|
44
|
+
cwd,
|
|
45
|
+
defaultPort: HUB_DEFAULT_PORT,
|
|
46
|
+
});
|
|
44
47
|
return `http://127.0.0.1:${port}/status`;
|
|
45
48
|
}
|
|
46
49
|
|
|
50
|
+
function resolveStatusUrlForContext({
|
|
51
|
+
statusUrl,
|
|
52
|
+
env = process.env,
|
|
53
|
+
cwd = process.cwd(),
|
|
54
|
+
} = {}) {
|
|
55
|
+
try {
|
|
56
|
+
const url = new URL(String(statusUrl));
|
|
57
|
+
url.port = String(
|
|
58
|
+
resolveHubPortForContext({
|
|
59
|
+
port: url.port,
|
|
60
|
+
env,
|
|
61
|
+
cwd,
|
|
62
|
+
defaultPort: HUB_DEFAULT_PORT,
|
|
63
|
+
}),
|
|
64
|
+
);
|
|
65
|
+
return url.toString();
|
|
66
|
+
} catch {
|
|
67
|
+
return resolveDefaultStatusUrl(env, cwd);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
47
71
|
function normalizeCliName(name) {
|
|
48
72
|
return String(name ?? "").trim() || null;
|
|
49
73
|
}
|
|
@@ -212,8 +236,10 @@ export function detectCodexPlan(options = {}) {
|
|
|
212
236
|
}
|
|
213
237
|
|
|
214
238
|
export function checkHub({
|
|
239
|
+
env = process.env,
|
|
240
|
+
cwd = process.cwd(),
|
|
215
241
|
pkgRoot = DEFAULT_PKG_ROOT,
|
|
216
|
-
statusUrl = resolveDefaultStatusUrl(),
|
|
242
|
+
statusUrl = resolveDefaultStatusUrl(env, cwd),
|
|
217
243
|
restart = true,
|
|
218
244
|
requestTimeoutMs = 3000,
|
|
219
245
|
pollAttempts = 8,
|
|
@@ -223,10 +249,11 @@ export function checkHub({
|
|
|
223
249
|
existsSyncFn = existsSync,
|
|
224
250
|
sleepSyncFn = sleepSync,
|
|
225
251
|
} = {}) {
|
|
252
|
+
const guardedStatusUrl = resolveStatusUrlForContext({ statusUrl, env, cwd });
|
|
226
253
|
try {
|
|
227
254
|
return fetchHubStatus({
|
|
228
255
|
execSyncFn,
|
|
229
|
-
statusUrl,
|
|
256
|
+
statusUrl: guardedStatusUrl,
|
|
230
257
|
timeout: requestTimeoutMs,
|
|
231
258
|
});
|
|
232
259
|
} catch {}
|
|
@@ -239,7 +266,7 @@ export function checkHub({
|
|
|
239
266
|
|
|
240
267
|
try {
|
|
241
268
|
const child = spawnFn(process.execPath, [serverPath], {
|
|
242
|
-
env: { ...
|
|
269
|
+
env: { ...env, TFX_HUB_PORT: String(new URL(guardedStatusUrl).port) },
|
|
243
270
|
detached: true,
|
|
244
271
|
stdio: "ignore",
|
|
245
272
|
windowsHide: true,
|
|
@@ -254,7 +281,7 @@ export function checkHub({
|
|
|
254
281
|
try {
|
|
255
282
|
const status = fetchHubStatus({
|
|
256
283
|
execSyncFn,
|
|
257
|
-
statusUrl,
|
|
284
|
+
statusUrl: guardedStatusUrl,
|
|
258
285
|
timeout: Math.min(requestTimeoutMs, 1000),
|
|
259
286
|
});
|
|
260
287
|
if (status.state === "healthy") {
|