@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.
- package/hub/pipe.mjs +239 -121
- package/hub/public/dashboard.html +61 -0
- package/hub/server.mjs +2179 -709
- package/hub/store-adapter.mjs +59 -26
- package/hub/store.mjs +356 -153
- package/hub/team/agent-map.json +26 -7
- package/hub/team/ansi.mjs +245 -146
- package/hub/team/backend.mjs +78 -17
- package/hub/team/build-worker-prompt.mjs +73 -0
- package/hub/team/check-mcp-hub.mjs +49 -0
- package/hub/team/claude-daemon-control.mjs +1130 -0
- package/hub/team/claude-native-bridge.mjs +1011 -0
- package/hub/team/claude-session-projection.mjs +74 -0
- package/hub/team/cli/commands/attach.mjs +57 -37
- package/hub/team/cli/commands/control.mjs +29 -8
- package/hub/team/cli/commands/debug.mjs +95 -74
- package/hub/team/cli/commands/focus.mjs +80 -53
- package/hub/team/cli/commands/interrupt.mjs +18 -6
- package/hub/team/cli/commands/kill.mjs +16 -5
- package/hub/team/cli/commands/list.mjs +31 -24
- package/hub/team/cli/commands/send.mjs +19 -6
- package/hub/team/cli/commands/start/index.mjs +151 -33
- package/hub/team/cli/commands/start/parse-args.mjs +97 -13
- package/hub/team/cli/commands/start/start-headless.mjs +155 -37
- package/hub/team/cli/commands/start/start-in-process.mjs +50 -40
- package/hub/team/cli/commands/start/start-mux.mjs +122 -73
- package/hub/team/cli/commands/start/start-wt.mjs +86 -69
- package/hub/team/cli/commands/status.mjs +43 -14
- package/hub/team/cli/commands/stop.mjs +11 -4
- package/hub/team/cli/commands/task.mjs +8 -3
- package/hub/team/cli/commands/tasks.mjs +13 -13
- package/hub/team/cli/help.mjs +1 -1
- package/hub/team/cli/index.mjs +2 -2
- package/hub/team/cli/manifest.mjs +38 -8
- package/hub/team/cli/render.mjs +52 -30
- package/hub/team/cli/services/attach-fallback.mjs +74 -54
- package/hub/team/cli/services/hub-client.mjs +44 -16
- package/hub/team/cli/services/member-selector.mjs +37 -30
- package/hub/team/cli/services/native-control.mjs +144 -116
- package/hub/team/cli/services/runtime-mode.mjs +61 -4
- package/hub/team/cli/services/state-store.mjs +66 -9
- package/hub/team/cli/services/task-model.mjs +40 -30
- package/hub/team/codex-review.mjs +521 -0
- package/hub/team/conductor-mesh-bridge.mjs +25 -24
- package/hub/team/conductor-registry.mjs +121 -0
- package/hub/team/conductor.mjs +1379 -671
- package/hub/team/consensus-meta.mjs +176 -0
- package/hub/team/dashboard-anchor.mjs +4 -5
- package/hub/team/dashboard-layout.mjs +3 -1
- package/hub/team/dashboard-open.mjs +20 -118
- package/hub/team/dashboard.mjs +76 -28
- package/hub/team/event-log.mjs +18 -10
- package/hub/team/execution-mode.mjs +256 -0
- package/hub/team/extract-completion-payload.mjs +110 -0
- package/hub/team/git-preflight.mjs +286 -0
- package/hub/team/handoff.mjs +49 -18
- package/hub/team/headless-bridge-session.mjs +17 -0
- package/hub/team/headless.mjs +2213 -1156
- package/hub/team/health-probe.mjs +232 -69
- package/hub/team/interactive-native-launcher.mjs +106 -0
- package/hub/team/interactive-native-worker.mjs +80 -0
- package/hub/team/interactive-tui-transport.mjs +465 -0
- package/hub/team/launcher-template.mjs +49 -17
- package/hub/team/lead-control.mjs +91 -4
- package/hub/team/mcp-selector.mjs +145 -0
- package/hub/team/native-supervisor.mjs +90 -26
- package/hub/team/native.mjs +120 -42
- package/hub/team/nativeProxy.mjs +184 -113
- package/hub/team/notify.mjs +147 -78
- package/hub/team/orchestrator.mjs +173 -161
- package/hub/team/pane.mjs +43 -20
- package/hub/team/process-cleanup.mjs +69 -25
- package/hub/team/psmux.mjs +1022 -281
- package/hub/team/recovery-store.mjs +149 -0
- package/hub/team/remote-probe.mjs +68 -52
- package/hub/team/remote-session.mjs +131 -59
- package/hub/team/remote-watcher.mjs +61 -33
- package/hub/team/retry-state-machine.mjs +336 -0
- package/hub/team/routing.mjs +51 -25
- package/hub/team/runtime-strategy.mjs +200 -0
- package/hub/team/schemas/worker-completion.json +39 -0
- package/hub/team/sentinel-capture.mjs +127 -0
- package/hub/team/session-sync.mjs +153 -6
- package/hub/team/session.mjs +574 -611
- package/hub/team/shared.mjs +13 -13
- package/hub/team/staleState.mjs +72 -30
- package/hub/team/swarm-cli.mjs +390 -0
- package/hub/team/swarm-hypervisor.mjs +1544 -193
- package/hub/team/swarm-intent.mjs +216 -0
- package/hub/team/swarm-locks.mjs +140 -25
- package/hub/team/swarm-planner.mjs +121 -21
- package/hub/team/swarm-preflight.mjs +319 -0
- package/hub/team/swarm-reconciler.mjs +128 -23
- package/hub/team/synapse-cli.mjs +458 -0
- package/hub/team/synapse-http.mjs +60 -0
- package/hub/team/synapse-registry.mjs +329 -0
- package/hub/team/terminal-opener.mjs +216 -0
- package/hub/team/tui-core.mjs +292 -0
- package/hub/team/tui-lite.mjs +237 -148
- package/hub/team/tui-remote-adapter.mjs +18 -34
- package/hub/team/tui-synapse.mjs +223 -0
- package/hub/team/tui-viewer.mjs +108 -48
- package/hub/team/tui-widgets.mjs +262 -0
- package/hub/team/tui.mjs +931 -439
- package/hub/team/worker-completion-validator.mjs +84 -0
- package/hub/team/worker-sandbox.mjs +97 -0
- package/hub/team/worker-signal.mjs +263 -0
- package/hub/team/worker-signal.types.d.ts +52 -0
- package/hub/team/worktree-lifecycle.mjs +517 -63
- package/hub/team/wt-manager.mjs +297 -26
- package/hub/tools.mjs +477 -252
- package/hub/tray.mjs +411 -368
- package/hub/workers/antigravity-route-worker.mjs +169 -0
- package/hub/workers/claude-worker.mjs +162 -118
- package/hub/workers/codex-app-server-worker.mjs +1015 -0
- package/hub/workers/codex-mcp.mjs +724 -507
- package/hub/workers/delegator-mcp.mjs +570 -499
- package/hub/workers/factory.mjs +103 -21
- package/hub/workers/gemini-worker.mjs +126 -284
- package/hub/workers/interface.mjs +24 -2
- package/hub/workers/lib/jsonrpc-stdio.mjs +463 -0
- package/hub/workers/worker-utils.mjs +23 -17
- package/package.json +4 -3
- package/scripts/lib/agent-json.mjs +27 -0
- package/scripts/lib/async.mjs +174 -0
- package/scripts/lib/claudemd-scanner.mjs +223 -0
- package/scripts/lib/cli-agy.mjs +62 -0
- package/scripts/lib/cli-claude.mjs +78 -0
- package/scripts/lib/cli-codex.mjs +199 -0
- package/scripts/lib/cli-gemini.mjs +37 -0
- package/scripts/lib/codex-recovery.sh +50 -0
- package/scripts/lib/context.mjs +67 -0
- package/scripts/lib/cross-review-utils.mjs +59 -0
- package/scripts/lib/doctor-env-checks.mjs +121 -0
- package/scripts/lib/dynamic-route-cli.mjs +107 -0
- package/scripts/lib/env-probe.mjs +269 -0
- package/scripts/lib/env.mjs +14 -0
- package/scripts/lib/gemini-profiles.mjs +119 -0
- package/scripts/lib/handoff.mjs +187 -0
- package/scripts/lib/hook-utils.mjs +16 -0
- package/scripts/lib/hub.mjs +48 -0
- package/scripts/lib/keyword-rules.mjs +195 -0
- package/scripts/lib/logger.mjs +105 -0
- package/scripts/lib/mcp-filter.mjs +883 -0
- package/scripts/lib/mcp-gateway-health-check.mjs +159 -0
- package/scripts/lib/mcp-gateway-servers.mjs +70 -0
- package/scripts/lib/mcp-gateway-wrapper-check.mjs +35 -0
- package/scripts/lib/mcp-guard-engine.mjs +2120 -0
- package/scripts/lib/mcp-health.mjs +773 -0
- package/scripts/lib/mcp-manifest.mjs +89 -0
- package/scripts/lib/mcp-server-catalog.mjs +355 -0
- package/scripts/lib/pid.mjs +63 -0
- package/scripts/lib/process-utils.mjs +26 -0
- package/scripts/lib/psmux-info.mjs +224 -0
- package/scripts/lib/quota.mjs +47 -0
- package/scripts/lib/remote-spawn-transfer.mjs +226 -0
- package/scripts/lib/skill-state.mjs +220 -0
- package/scripts/lib/skill-template.mjs +375 -0
- package/scripts/lib/team.mjs +75 -0
- package/scripts/lib/timeout.mjs +66 -0
- package/scripts/lib/tmp.mjs +26 -0
- package/scripts/lib/toml.mjs +113 -0
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
// scripts/lib/mcp-gateway-health-check.mjs
|
|
2
|
+
//
|
|
3
|
+
// `~/.local/state/triflux/mcp-gateway.out.log` 파싱 헬퍼.
|
|
4
|
+
// install-mcp-gateway-startup.mjs 가 LaunchAgent/systemd 로 띄운 gateway daemon
|
|
5
|
+
// (mcp-gateway-start.mjs) 의 stdout 로그에서 다음 신호를 추출한다.
|
|
6
|
+
//
|
|
7
|
+
// [WARN] <server> skipped — missing env: <KEY> → missing-env finding
|
|
8
|
+
// [START] <server> on :<port> → started
|
|
9
|
+
// [SKIP] <server> already running on :<port> → started (preExisting)
|
|
10
|
+
// [SKIP] <server> — manifest에서 비활성 → manifest-disabled skip
|
|
11
|
+
//
|
|
12
|
+
// 호출자는 `findings` 만 보고 doctor 진단을 출력할 수 있다.
|
|
13
|
+
// log 파일이 없으면 `available: false` 로 반환하므로, gateway 미설치 환경에서는
|
|
14
|
+
// 침묵한다 (false-positive 방지).
|
|
15
|
+
|
|
16
|
+
import { readFileSync, statSync } from "node:fs";
|
|
17
|
+
import { homedir } from "node:os";
|
|
18
|
+
import { join } from "node:path";
|
|
19
|
+
|
|
20
|
+
const DEFAULT_LOG_PATH = join(
|
|
21
|
+
homedir(),
|
|
22
|
+
".local",
|
|
23
|
+
"state",
|
|
24
|
+
"triflux",
|
|
25
|
+
"mcp-gateway.out.log",
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
// producer (scripts/mcp-gateway-start.mjs:146) 가 missing env 를 `missing.join(", ")`
|
|
29
|
+
// 로 출력하므로 detail 은 공백 포함 다중 키 (예: "JIRA_API_TOKEN, JIRA_EMAIL, JIRA_INSTANCE_URL")
|
|
30
|
+
// 일 수 있다. line 끝까지 캡처한다.
|
|
31
|
+
const MISSING_ENV_RE = /^\[WARN\]\s+(\S+)\s+skipped\s+—\s+missing env:\s+(.+)$/;
|
|
32
|
+
const START_RE = /^\[START\]\s+(\S+)\s+on\s+:(\d+)$/;
|
|
33
|
+
const SKIP_RUNNING_RE = /^\[SKIP\]\s+(\S+)\s+already running on\s+:(\d+)$/;
|
|
34
|
+
const SKIP_DISABLED_RE = /^\[SKIP\]\s+(\S+)\s+—\s+manifest에서 비활성$/;
|
|
35
|
+
|
|
36
|
+
export function checkMcpGatewayHealth({
|
|
37
|
+
fs = { readFileSync, statSync },
|
|
38
|
+
logPath = DEFAULT_LOG_PATH,
|
|
39
|
+
} = {}) {
|
|
40
|
+
try {
|
|
41
|
+
fs.statSync(logPath);
|
|
42
|
+
} catch {
|
|
43
|
+
return {
|
|
44
|
+
available: false,
|
|
45
|
+
logPath,
|
|
46
|
+
findings: [],
|
|
47
|
+
started: [],
|
|
48
|
+
skipped: [],
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
let text;
|
|
53
|
+
try {
|
|
54
|
+
text = fs.readFileSync(logPath, "utf8");
|
|
55
|
+
} catch (error) {
|
|
56
|
+
return {
|
|
57
|
+
available: true,
|
|
58
|
+
logPath,
|
|
59
|
+
findings: [
|
|
60
|
+
{
|
|
61
|
+
server: null,
|
|
62
|
+
reason: "log-read-error",
|
|
63
|
+
detail: error?.message || String(error),
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
started: [],
|
|
67
|
+
skipped: [],
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// log 는 append-only 라 옛 [WARN] 라인 뒤에 새 [START] 라인이 올 수 있다.
|
|
72
|
+
// server 별 마지막 이벤트가 현재 상태이므로 그것만 finding 으로 환원한다.
|
|
73
|
+
// (예: BRAVE_API_KEY missing 으로 한 번 skip → secrets 추가 후 restart 로 start)
|
|
74
|
+
const lastEvent = new Map();
|
|
75
|
+
|
|
76
|
+
for (const rawLine of text.split("\n")) {
|
|
77
|
+
const line = rawLine.trim();
|
|
78
|
+
if (!line) continue;
|
|
79
|
+
|
|
80
|
+
let m;
|
|
81
|
+
if ((m = MISSING_ENV_RE.exec(line))) {
|
|
82
|
+
lastEvent.set(m[1], {
|
|
83
|
+
type: "missing-env",
|
|
84
|
+
detail: m[2],
|
|
85
|
+
});
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
if ((m = START_RE.exec(line))) {
|
|
89
|
+
lastEvent.set(m[1], {
|
|
90
|
+
type: "started",
|
|
91
|
+
port: Number(m[2]),
|
|
92
|
+
preExisting: false,
|
|
93
|
+
});
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
if ((m = SKIP_RUNNING_RE.exec(line))) {
|
|
97
|
+
lastEvent.set(m[1], {
|
|
98
|
+
type: "started",
|
|
99
|
+
port: Number(m[2]),
|
|
100
|
+
preExisting: true,
|
|
101
|
+
});
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
if ((m = SKIP_DISABLED_RE.exec(line))) {
|
|
105
|
+
lastEvent.set(m[1], {
|
|
106
|
+
type: "manifest-disabled",
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const findings = [];
|
|
112
|
+
const started = [];
|
|
113
|
+
const skipped = [];
|
|
114
|
+
for (const [server, ev] of lastEvent) {
|
|
115
|
+
if (ev.type === "missing-env") {
|
|
116
|
+
findings.push({ server, reason: "missing-env", detail: ev.detail });
|
|
117
|
+
} else if (ev.type === "started") {
|
|
118
|
+
started.push({ server, port: ev.port, preExisting: ev.preExisting });
|
|
119
|
+
} else if (ev.type === "manifest-disabled") {
|
|
120
|
+
skipped.push({ server, reason: "manifest-disabled" });
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return {
|
|
125
|
+
available: true,
|
|
126
|
+
logPath,
|
|
127
|
+
findings,
|
|
128
|
+
started,
|
|
129
|
+
skipped,
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export function summarizeMcpGatewayHealth(result) {
|
|
134
|
+
if (!result?.available) {
|
|
135
|
+
return {
|
|
136
|
+
level: "skip",
|
|
137
|
+
message: "mcp-gateway log 없음 (gateway 미설치 또는 미실행)",
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
if (result.findings.length === 0) {
|
|
141
|
+
return {
|
|
142
|
+
level: "ok",
|
|
143
|
+
message: `mcp-gateway healthy (${result.started.length}개 server up)`,
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
const missingEnv = result.findings.filter((f) => f.reason === "missing-env");
|
|
147
|
+
if (missingEnv.length > 0) {
|
|
148
|
+
const list = missingEnv.map((f) => `${f.server} (${f.detail})`).join(", ");
|
|
149
|
+
return {
|
|
150
|
+
level: "warn",
|
|
151
|
+
message: `${missingEnv.length}개 MCP 서버가 missing env 로 skip: ${list}`,
|
|
152
|
+
fix: "secrets 를 ~/.config/triflux/secrets.env 에 추가하고 `launchctl kickstart -k gui/$(id -u)/com.tellang.mcp-gateway` (macOS) 또는 `systemctl --user restart mcp-gateway` (linux)",
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
return {
|
|
156
|
+
level: "warn",
|
|
157
|
+
message: `${result.findings.length}개 gateway 이슈`,
|
|
158
|
+
};
|
|
159
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
const SERVER_DEFINITIONS = Object.freeze([
|
|
2
|
+
{
|
|
3
|
+
name: "context7",
|
|
4
|
+
port: 8100,
|
|
5
|
+
stdioCmd: "npx -y @upstash/context7-mcp@latest",
|
|
6
|
+
envVars: [],
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
name: "brave-search",
|
|
10
|
+
port: 8101,
|
|
11
|
+
stdioCmd: "npx -y @brave/brave-search-mcp-server",
|
|
12
|
+
envVars: ["BRAVE_API_KEY"],
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: "exa",
|
|
16
|
+
port: 8102,
|
|
17
|
+
stdioCmd: "npx -y exa-mcp-server",
|
|
18
|
+
envVars: ["EXA_API_KEY"],
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: "tavily",
|
|
22
|
+
port: 8103,
|
|
23
|
+
stdioCmd: "npx -y tavily-mcp@latest",
|
|
24
|
+
envVars: ["TAVILY_API_KEY"],
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: "jira",
|
|
28
|
+
port: 8104,
|
|
29
|
+
stdioCmd: "npx -y mcp-jira-cloud@latest",
|
|
30
|
+
envVars: ["JIRA_API_TOKEN", "JIRA_EMAIL", "JIRA_INSTANCE_URL"],
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: "serena",
|
|
34
|
+
port: 8105,
|
|
35
|
+
stdioCmd:
|
|
36
|
+
"uvx --from git+https://github.com/oraios/serena serena start-mcp-server",
|
|
37
|
+
envVars: [],
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: "notion",
|
|
41
|
+
port: 8106,
|
|
42
|
+
stdioCmd: "npx -y @notionhq/notion-mcp-server",
|
|
43
|
+
envVars: ["NOTION_TOKEN"],
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: "notion-guest",
|
|
47
|
+
port: 8107,
|
|
48
|
+
stdioCmd: "npx -y @notionhq/notion-mcp-server",
|
|
49
|
+
envVars: ["NOTION_TOKEN"],
|
|
50
|
+
},
|
|
51
|
+
]);
|
|
52
|
+
|
|
53
|
+
export const SERVERS = SERVER_DEFINITIONS.map((server) => ({
|
|
54
|
+
name: server.name,
|
|
55
|
+
port: server.port,
|
|
56
|
+
cmd: server.stdioCmd,
|
|
57
|
+
envVars: [...server.envVars],
|
|
58
|
+
}));
|
|
59
|
+
|
|
60
|
+
export const GATEWAY_SERVERS = SERVER_DEFINITIONS.map((server) => ({
|
|
61
|
+
name: server.name,
|
|
62
|
+
port: server.port,
|
|
63
|
+
stdioCmd: server.stdioCmd,
|
|
64
|
+
}));
|
|
65
|
+
|
|
66
|
+
export function serversWithSatisfiedEnv(env = process.env) {
|
|
67
|
+
return SERVERS.filter((server) =>
|
|
68
|
+
server.envVars.every((envName) => Boolean(env[envName])),
|
|
69
|
+
);
|
|
70
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import os from "node:os";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
|
|
5
|
+
export async function checkWrapperSourcing({
|
|
6
|
+
wrapperPath = path.join(
|
|
7
|
+
os.homedir(),
|
|
8
|
+
".local",
|
|
9
|
+
"bin",
|
|
10
|
+
"mcp-gateway-wrapper.sh",
|
|
11
|
+
),
|
|
12
|
+
marker = "secrets.env",
|
|
13
|
+
} = {}) {
|
|
14
|
+
let text;
|
|
15
|
+
try {
|
|
16
|
+
text = await readFile(wrapperPath, "utf8");
|
|
17
|
+
} catch (error) {
|
|
18
|
+
const result = { status: "missing", wrapperPath };
|
|
19
|
+
if (error?.code !== "ENOENT") {
|
|
20
|
+
result.message = `wrapper read failed: ${error?.message || String(error)}`;
|
|
21
|
+
}
|
|
22
|
+
return result;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (text.includes(marker)) {
|
|
26
|
+
return { status: "ok", wrapperPath };
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return {
|
|
30
|
+
status: "warn",
|
|
31
|
+
wrapperPath,
|
|
32
|
+
message: "wrapper exists but does not source secrets.env",
|
|
33
|
+
suggestedFix: "Re-run: node scripts/install-mcp-gateway-startup.mjs",
|
|
34
|
+
};
|
|
35
|
+
}
|