@triflux/remote 10.50.2 → 10.51.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 +0 -12
- package/cto/collect.mjs +0 -73
- package/cto/current.schema.json +0 -4
- package/cto/status.mjs +2 -50
- package/hub/index.mjs +0 -8
- package/hub/team/agent-map.json +0 -1
- package/hub/team/ansi.mjs +1 -35
- package/hub/team/backend.mjs +9 -145
- package/hub/team/cli/commands/attach.mjs +1 -17
- package/hub/team/cli/commands/control.mjs +12 -38
- package/hub/team/cli/commands/debug.mjs +1 -37
- package/hub/team/cli/commands/focus.mjs +5 -31
- package/hub/team/cli/commands/interrupt.mjs +6 -25
- package/hub/team/cli/commands/kill.mjs +1 -30
- package/hub/team/cli/commands/list.mjs +0 -16
- package/hub/team/cli/commands/send.mjs +6 -26
- package/hub/team/cli/commands/start/index.mjs +41 -133
- package/hub/team/cli/commands/start/parse-args.mjs +15 -40
- package/hub/team/cli/commands/start/start-headless.mjs +138 -105
- package/hub/team/cli/commands/start/start-mux.mjs +0 -3
- package/hub/team/cli/commands/status.mjs +2 -57
- package/hub/team/cli/commands/stop.mjs +14 -19
- package/hub/team/cli/help.mjs +4 -5
- package/hub/team/cli/manifest.mjs +5 -1
- package/hub/team/cli/render.mjs +0 -12
- package/hub/team/cli/services/hub-client.mjs +2 -88
- package/hub/team/cli/services/runtime-mode.mjs +27 -98
- package/hub/team/handoff.mjs +3 -34
- package/hub/team/headless.mjs +13 -754
- package/hub/team/orchestrator.mjs +4 -30
- package/hub/team/pane.mjs +6 -28
- package/hub/team/psmux.mjs +0 -1
- package/hub/team/remote-session.mjs +1 -2
- package/hub/team/session.mjs +7 -91
- package/hub/team/swarm-intent.mjs +0 -198
- package/hub/team/tui-core.mjs +1 -1
- package/hub/team/tui-viewer.mjs +2 -2
- package/hub/team/tui.mjs +8 -269
- package/hub/team/wt-manager.mjs +2 -2
- package/hub/workers/factory.mjs +4 -37
- package/hub/workers/lib/jsonrpc-ws-uds.mjs +0 -2
- package/package.json +1 -1
- package/scripts/lib/agent-route-policy.mjs +162 -14
- package/scripts/lib/claudemd-scanner.mjs +2 -199
- package/scripts/lib/cli-claude.mjs +0 -2
- package/scripts/lib/context.mjs +3 -19
- package/scripts/lib/env-probe.mjs +5 -64
- package/scripts/lib/gemini-profiles.mjs +2 -69
- package/scripts/lib/machine-profile.mjs +3 -17
- package/scripts/lib/mcp-filter.mjs +109 -53
- package/scripts/lib/mcp-health.mjs +2 -2
- package/scripts/lib/mcp-server-catalog.mjs +2 -2
- package/scripts/lib/psmux-info.mjs +11 -59
- package/scripts/lib/skill-template.mjs +0 -245
- package/hub/team/build-worker-prompt.mjs +0 -92
- package/hub/team/check-mcp-hub.mjs +0 -49
- package/hub/team/claude-native-bridge.mjs +0 -987
- package/hub/team/cli/commands/start/start-in-process.mjs +0 -50
- package/hub/team/cli/commands/start/start-wt.mjs +0 -86
- package/hub/team/cli/services/native-control.mjs +0 -145
- package/hub/team/codex-review.mjs +0 -520
- package/hub/team/conductor-mesh-bridge.mjs +0 -122
- package/hub/team/conductor.mjs +0 -1529
- package/hub/team/consensus-meta.mjs +0 -176
- package/hub/team/cto-pull.mjs +0 -31
- package/hub/team/daemon-pty-tmux-bridge.mjs +0 -146
- package/hub/team/dashboard.mjs +0 -322
- package/hub/team/event-log.mjs +0 -84
- package/hub/team/execution-mode.mjs +0 -324
- package/hub/team/extract-completion-payload.mjs +0 -110
- package/hub/team/headless-bridge-session.mjs +0 -17
- package/hub/team/health-probe.mjs +0 -435
- package/hub/team/interactive-native-launcher.mjs +0 -119
- package/hub/team/interactive-native-worker.mjs +0 -80
- package/hub/team/interactive-tui-transport.mjs +0 -479
- package/hub/team/launcher-template.mjs +0 -144
- package/hub/team/mcp-selector.mjs +0 -145
- package/hub/team/native-supervisor.mjs +0 -460
- package/hub/team/native.mjs +0 -727
- package/hub/team/recovery-store.mjs +0 -149
- package/hub/team/remote-probe.mjs +0 -292
- package/hub/team/remote-watcher.mjs +0 -506
- package/hub/team/runtime-strategy.mjs +0 -200
- package/hub/team/schemas/worker-completion.json +0 -39
- package/hub/team/sentinel-capture.mjs +0 -127
- package/hub/team/swarm-cli.mjs +0 -390
- package/hub/team/swarm-hypervisor.mjs +0 -2206
- package/hub/team/swarm-locks.mjs +0 -335
- package/hub/team/swarm-planner.mjs +0 -371
- package/hub/team/swarm-preflight.mjs +0 -366
- package/hub/team/swarm-reconciler.mjs +0 -242
- package/hub/team/tui-remote-adapter.mjs +0 -377
- package/hub/team/worker-completion-validator.mjs +0 -79
- package/hub/team/worktree-lifecycle.mjs +0 -639
- package/hub/team/wt-templates.json +0 -43
- package/hub/workers/antigravity-route-worker.mjs +0 -179
- package/scripts/lib/dynamic-route-cli.mjs +0 -107
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
// hub/workers/antigravity-route-worker.mjs — SDK-free Antigravity route worker
|
|
2
|
-
|
|
3
|
-
import { spawn } from "node:child_process";
|
|
4
|
-
import { existsSync } from "node:fs";
|
|
5
|
-
import { dirname, resolve } from "node:path";
|
|
6
|
-
import { fileURLToPath } from "node:url";
|
|
7
|
-
|
|
8
|
-
const SCRIPT_DIR = dirname(fileURLToPath(import.meta.url));
|
|
9
|
-
const DEFAULT_TIMEOUT_MS = 15 * 60 * 1000;
|
|
10
|
-
|
|
11
|
-
function resolveCandidatePath(candidate, cwd = process.cwd()) {
|
|
12
|
-
if (!candidate) return null;
|
|
13
|
-
const normalized = String(candidate).startsWith("/")
|
|
14
|
-
? String(candidate)
|
|
15
|
-
: resolve(cwd, String(candidate));
|
|
16
|
-
return existsSync(normalized) ? normalized : null;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function resolveRouteScript(
|
|
20
|
-
explicitPath,
|
|
21
|
-
cwd = process.cwd(),
|
|
22
|
-
env = process.env,
|
|
23
|
-
) {
|
|
24
|
-
const candidates = [
|
|
25
|
-
explicitPath,
|
|
26
|
-
env.TFX_DELEGATOR_ROUTE_SCRIPT,
|
|
27
|
-
env.TFX_ROUTE_SCRIPT,
|
|
28
|
-
resolve(SCRIPT_DIR, "..", "..", "scripts", "tfx-route.sh"),
|
|
29
|
-
resolve(cwd, "scripts", "tfx-route.sh"),
|
|
30
|
-
];
|
|
31
|
-
|
|
32
|
-
for (const candidate of candidates) {
|
|
33
|
-
const resolved = resolveCandidatePath(candidate, cwd);
|
|
34
|
-
if (resolved) return resolved;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return null;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function parseRouteType(stderr = "") {
|
|
41
|
-
const match = String(stderr).match(/type=([a-z-]+)/);
|
|
42
|
-
if (!match) return "antigravity";
|
|
43
|
-
return match[1] === "gemini" ? "antigravity" : match[1];
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
function normalizeResult(result = {}) {
|
|
47
|
-
const output = result.output || result.error || "";
|
|
48
|
-
const exitCode = result.exitCode ?? (result.ok ? 0 : 1);
|
|
49
|
-
return {
|
|
50
|
-
response: output,
|
|
51
|
-
output,
|
|
52
|
-
exitCode,
|
|
53
|
-
stderr: result.stderr || "",
|
|
54
|
-
raw: result,
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export class AntigravityRouteWorker {
|
|
59
|
-
type = "antigravity";
|
|
60
|
-
|
|
61
|
-
constructor(options = {}) {
|
|
62
|
-
this.cwd = options.cwd || process.cwd();
|
|
63
|
-
this.env = { ...process.env, ...(options.env || {}) };
|
|
64
|
-
this.routeScript = resolveRouteScript(
|
|
65
|
-
options.routeScript,
|
|
66
|
-
this.cwd,
|
|
67
|
-
this.env,
|
|
68
|
-
);
|
|
69
|
-
this.bashCommand = options.bashCommand || this.env.BASH_BIN || "bash";
|
|
70
|
-
this.timeoutMs =
|
|
71
|
-
Number.isFinite(Number(options.timeoutMs)) &&
|
|
72
|
-
Number(options.timeoutMs) > 0
|
|
73
|
-
? Number(options.timeoutMs)
|
|
74
|
-
: DEFAULT_TIMEOUT_MS;
|
|
75
|
-
this.children = new Set();
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
isReady() {
|
|
79
|
-
return Boolean(this.routeScript);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
async start() {}
|
|
83
|
-
|
|
84
|
-
async stop() {
|
|
85
|
-
for (const child of this.children) {
|
|
86
|
-
child.kill("SIGTERM");
|
|
87
|
-
}
|
|
88
|
-
this.children.clear();
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
async run(prompt, options = {}) {
|
|
92
|
-
if (!this.routeScript) {
|
|
93
|
-
return normalizeResult({
|
|
94
|
-
ok: false,
|
|
95
|
-
output: "tfx-route.sh 경로를 찾지 못했습니다.",
|
|
96
|
-
exitCode: 70,
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
const timeoutMs =
|
|
101
|
-
Number.isFinite(Number(options.timeoutMs)) &&
|
|
102
|
-
Number(options.timeoutMs) > 0
|
|
103
|
-
? Number(options.timeoutMs)
|
|
104
|
-
: this.timeoutMs;
|
|
105
|
-
const timeoutSec = Math.max(1, Math.ceil(timeoutMs / 1000));
|
|
106
|
-
const childArgs = [
|
|
107
|
-
this.routeScript,
|
|
108
|
-
options.agentType || "executor",
|
|
109
|
-
String(prompt ?? ""),
|
|
110
|
-
options.mcpProfile || "auto",
|
|
111
|
-
String(timeoutSec),
|
|
112
|
-
];
|
|
113
|
-
const childEnv = {
|
|
114
|
-
...this.env,
|
|
115
|
-
...(options.env || {}),
|
|
116
|
-
TFX_CLI_MODE: "antigravity",
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
const result = await new Promise((resolveResult) => {
|
|
120
|
-
const child = spawn(this.bashCommand, childArgs, {
|
|
121
|
-
cwd: options.cwd || this.cwd,
|
|
122
|
-
env: childEnv,
|
|
123
|
-
stdio: ["ignore", "pipe", "pipe"],
|
|
124
|
-
});
|
|
125
|
-
this.children.add(child);
|
|
126
|
-
|
|
127
|
-
let stdout = "";
|
|
128
|
-
let stderr = "";
|
|
129
|
-
const timeout = setTimeout(() => {
|
|
130
|
-
child.kill("SIGTERM");
|
|
131
|
-
}, timeoutMs);
|
|
132
|
-
timeout.unref?.();
|
|
133
|
-
|
|
134
|
-
child.stdout?.setEncoding("utf8");
|
|
135
|
-
child.stderr?.setEncoding("utf8");
|
|
136
|
-
child.stdout?.on("data", (chunk) => {
|
|
137
|
-
stdout += chunk;
|
|
138
|
-
});
|
|
139
|
-
child.stderr?.on("data", (chunk) => {
|
|
140
|
-
stderr += chunk;
|
|
141
|
-
});
|
|
142
|
-
child.on("close", (code, signal) => {
|
|
143
|
-
clearTimeout(timeout);
|
|
144
|
-
this.children.delete(child);
|
|
145
|
-
const timedOut = signal === "SIGTERM" && code === null;
|
|
146
|
-
resolveResult({
|
|
147
|
-
ok: code === 0,
|
|
148
|
-
output: stdout.trim() || stderr.trim(),
|
|
149
|
-
stderr: stderr.trim(),
|
|
150
|
-
exitCode: timedOut ? 124 : (code ?? 1),
|
|
151
|
-
providerResolved: parseRouteType(stderr),
|
|
152
|
-
});
|
|
153
|
-
});
|
|
154
|
-
child.on("error", (error) => {
|
|
155
|
-
clearTimeout(timeout);
|
|
156
|
-
this.children.delete(child);
|
|
157
|
-
resolveResult({
|
|
158
|
-
ok: false,
|
|
159
|
-
output: error.message,
|
|
160
|
-
stderr,
|
|
161
|
-
exitCode: 1,
|
|
162
|
-
});
|
|
163
|
-
});
|
|
164
|
-
});
|
|
165
|
-
|
|
166
|
-
return normalizeResult(result);
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
async execute(prompt, options = {}) {
|
|
170
|
-
const result = await this.run(prompt, options);
|
|
171
|
-
return {
|
|
172
|
-
output: result.output,
|
|
173
|
-
exitCode: result.exitCode,
|
|
174
|
-
threadId: null,
|
|
175
|
-
sessionKey: null,
|
|
176
|
-
raw: result.raw,
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// scripts/lib/dynamic-route-cli.mjs
|
|
3
|
-
//
|
|
4
|
-
// Phase 1 Wire-up 3 helper — tfx-route.sh 등 sh 경로에서 dynamic routing
|
|
5
|
-
// decision 을 받아 단일 CLI 문자열 (또는 JSON) 으로 출력한다.
|
|
6
|
-
//
|
|
7
|
-
// 사용:
|
|
8
|
-
// node scripts/lib/dynamic-route-cli.mjs --agent-hint codex
|
|
9
|
-
// → "codex"
|
|
10
|
-
// node scripts/lib/dynamic-route-cli.mjs --agent-hint codex --json
|
|
11
|
-
// → {"scenario":"fallback","mode":"codex-default","shards":[{"cli":"codex",...}]}
|
|
12
|
-
// node scripts/lib/dynamic-route-cli.mjs --agent-hint codex --field scenario
|
|
13
|
-
// → "fallback"
|
|
14
|
-
//
|
|
15
|
-
// 정책:
|
|
16
|
-
// - opt-in env TRIFLUX_DYNAMIC_ROUTING=1|true 미설정 시 즉시 silent exit 0
|
|
17
|
-
// (override 없음 = stdout empty, sh caller 가 graceful no-op).
|
|
18
|
-
// - error 발생 시 stderr 에 한 줄 + exit 0 (sh caller 가 fallback path 진행).
|
|
19
|
-
|
|
20
|
-
import { createDynamicRouter } from "@triflux/core/hub/dynamic-routing-engine.mjs";
|
|
21
|
-
|
|
22
|
-
function parseArgs(argv) {
|
|
23
|
-
const args = {
|
|
24
|
-
taskId: `tfx-route-${process.pid}-${Date.now()}`,
|
|
25
|
-
agentHint: "codex",
|
|
26
|
-
teamSize: 1,
|
|
27
|
-
json: false,
|
|
28
|
-
field: null,
|
|
29
|
-
};
|
|
30
|
-
for (let i = 2; i < argv.length; i++) {
|
|
31
|
-
const v = argv[i];
|
|
32
|
-
switch (v) {
|
|
33
|
-
case "--task-id":
|
|
34
|
-
args.taskId = argv[++i] || args.taskId;
|
|
35
|
-
break;
|
|
36
|
-
case "--agent-hint":
|
|
37
|
-
args.agentHint = argv[++i] || args.agentHint;
|
|
38
|
-
break;
|
|
39
|
-
case "--team-size":
|
|
40
|
-
args.teamSize = Number(argv[++i]) || args.teamSize;
|
|
41
|
-
break;
|
|
42
|
-
case "--json":
|
|
43
|
-
args.json = true;
|
|
44
|
-
break;
|
|
45
|
-
case "--field":
|
|
46
|
-
args.field = argv[++i] || null;
|
|
47
|
-
break;
|
|
48
|
-
case "--help":
|
|
49
|
-
case "-h":
|
|
50
|
-
process.stdout.write(
|
|
51
|
-
"Usage: dynamic-route-cli.mjs [--task-id ID] [--agent-hint CLI] [--team-size N] [--json|--field FIELD]\n",
|
|
52
|
-
);
|
|
53
|
-
process.exit(0);
|
|
54
|
-
break;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
return args;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
async function main() {
|
|
61
|
-
const args = parseArgs(process.argv);
|
|
62
|
-
|
|
63
|
-
// opt-in env 미설정 시 silent no-op (sh caller graceful path)
|
|
64
|
-
const flag = process.env.TRIFLUX_DYNAMIC_ROUTING;
|
|
65
|
-
if (flag !== "1" && flag !== "true") return;
|
|
66
|
-
|
|
67
|
-
let decision;
|
|
68
|
-
try {
|
|
69
|
-
const router = createDynamicRouter();
|
|
70
|
-
decision = await router.routeRequest({
|
|
71
|
-
task_id: args.taskId,
|
|
72
|
-
team_size: args.teamSize,
|
|
73
|
-
agent_hint: args.agentHint,
|
|
74
|
-
});
|
|
75
|
-
} catch (err) {
|
|
76
|
-
process.stderr.write(
|
|
77
|
-
`[dynamic-route-cli] error: ${err?.message || String(err)}\n`,
|
|
78
|
-
);
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
if (args.json) {
|
|
83
|
-
process.stdout.write(JSON.stringify(decision));
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
if (args.field) {
|
|
88
|
-
const value = decision?.[args.field];
|
|
89
|
-
if (value !== undefined && value !== null) {
|
|
90
|
-
process.stdout.write(String(value));
|
|
91
|
-
}
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
// 기본 — shards[0].cli 만 stdout 으로 (sh caller 가 즉시 비교)
|
|
96
|
-
const cli = decision?.shards?.[0]?.cli;
|
|
97
|
-
if (cli) {
|
|
98
|
-
process.stdout.write(String(cli));
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
main().catch((err) => {
|
|
103
|
-
process.stderr.write(
|
|
104
|
-
`[dynamic-route-cli] fatal: ${err?.message || String(err)}\n`,
|
|
105
|
-
);
|
|
106
|
-
process.exit(0); // sh caller 가 정상 fallback 하도록 always 0
|
|
107
|
-
});
|