triflux 10.2.0 → 10.3.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/README.md +236 -156
- package/hub/bridge.mjs +638 -290
- package/hub/codex-compat.mjs +1 -1
- package/hub/fullcycle.mjs +1 -1
- package/hub/intent.mjs +1 -0
- package/hub/lib/mcp-response-cache.mjs +205 -0
- package/hub/pipe.mjs +228 -119
- package/hub/reflexion.mjs +87 -13
- package/hub/research.mjs +1 -0
- package/hub/server.mjs +997 -611
- package/hub/team/ansi.mjs +1 -1
- package/hub/team/conductor-registry.mjs +121 -0
- package/hub/team/conductor.mjs +256 -125
- package/hub/team/execution-mode.mjs +105 -0
- package/hub/team/headless.mjs +686 -252
- package/hub/team/lead-control.mjs +91 -4
- package/hub/team/mcp-selector.mjs +145 -0
- package/hub/team/session-sync.mjs +153 -6
- package/hub/team/swarm-hypervisor.mjs +208 -86
- package/hub/team/tui-lite.mjs +18 -2
- package/hub/token-mode.mjs +1 -0
- package/hub/tools.mjs +474 -252
- package/package.json +5 -5
- package/scripts/codex-gateway-preflight.mjs +133 -0
- package/scripts/codex-mcp-gateway-sync.mjs +199 -0
- package/skills/star-prompt/SKILL.md +169 -69
- package/skills/tfx-setup/SKILL.md +124 -0
- package/skills/tfx-swarm/SKILL.md +124 -72
package/hub/team/ansi.mjs
CHANGED
|
@@ -163,7 +163,7 @@ export function box(lines, width, borderColor = "", options = {}) {
|
|
|
163
163
|
const bot = botChars
|
|
164
164
|
.map((glyph, col) => renderBorderChar(glyph, totalRows - 1, col, highlightCell, bc(totalRows - 1), highlightSeq))
|
|
165
165
|
.join("");
|
|
166
|
-
const mid = `${bc(Math.floor(totalRows / 2))}${BOX.ml}${BOX.h.repeat(width - 2)}${BOX.mr}${rst}`;
|
|
166
|
+
const mid = `${bc(Math.floor(totalRows / 2))}${BOX.ml}${BOX.h.repeat(Math.max(0, width - 2))}${BOX.mr}${rst}`;
|
|
167
167
|
const body = lines.map((l, i) => {
|
|
168
168
|
const row = i + 1;
|
|
169
169
|
const content = options.titleFlashBg && i === 0
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
function normalizeSessionId(sessionId) {
|
|
2
|
+
if (sessionId == null) return "";
|
|
3
|
+
return String(sessionId).trim();
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export function createConductorRegistry() {
|
|
7
|
+
const sessions = new Map();
|
|
8
|
+
|
|
9
|
+
return Object.freeze({
|
|
10
|
+
register(sessionId, conductor) {
|
|
11
|
+
const normalizedSessionId = normalizeSessionId(sessionId);
|
|
12
|
+
if (
|
|
13
|
+
!normalizedSessionId ||
|
|
14
|
+
!conductor ||
|
|
15
|
+
typeof conductor.sendInput !== "function"
|
|
16
|
+
) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
sessions.set(normalizedSessionId, conductor);
|
|
20
|
+
return true;
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
unregister(sessionId, conductor = null) {
|
|
24
|
+
const normalizedSessionId = normalizeSessionId(sessionId);
|
|
25
|
+
if (!normalizedSessionId || !sessions.has(normalizedSessionId))
|
|
26
|
+
return false;
|
|
27
|
+
if (conductor && sessions.get(normalizedSessionId) !== conductor)
|
|
28
|
+
return false;
|
|
29
|
+
return sessions.delete(normalizedSessionId);
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
get(sessionId) {
|
|
33
|
+
const normalizedSessionId = normalizeSessionId(sessionId);
|
|
34
|
+
if (!normalizedSessionId) return null;
|
|
35
|
+
return sessions.get(normalizedSessionId) || null;
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
clear() {
|
|
39
|
+
sessions.clear();
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
list() {
|
|
43
|
+
return [...sessions.keys()];
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
let conductorRegistry = null;
|
|
49
|
+
|
|
50
|
+
export function getConductorRegistry() {
|
|
51
|
+
return conductorRegistry;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function setConductorRegistry(nextRegistry) {
|
|
55
|
+
const previousRegistry = conductorRegistry;
|
|
56
|
+
conductorRegistry = nextRegistry ?? null;
|
|
57
|
+
return previousRegistry;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function ensureConductorRegistry() {
|
|
61
|
+
if (!conductorRegistry) {
|
|
62
|
+
conductorRegistry = createConductorRegistry();
|
|
63
|
+
}
|
|
64
|
+
return conductorRegistry;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function sendInputToConductorSession(sessionId, text) {
|
|
68
|
+
const normalizedSessionId = normalizeSessionId(sessionId);
|
|
69
|
+
const normalizedText = typeof text === "string" ? text : "";
|
|
70
|
+
|
|
71
|
+
if (!normalizedSessionId || !normalizedText) {
|
|
72
|
+
return {
|
|
73
|
+
ok: false,
|
|
74
|
+
error: {
|
|
75
|
+
code: "INVALID_SEND_INPUT",
|
|
76
|
+
message: "session_id, text 필수",
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const registry = getConductorRegistry();
|
|
82
|
+
if (!registry) {
|
|
83
|
+
return {
|
|
84
|
+
ok: false,
|
|
85
|
+
error: {
|
|
86
|
+
code: "CONDUCTOR_REGISTRY_NOT_AVAILABLE",
|
|
87
|
+
message: "Conductor registry가 초기화되지 않았습니다",
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const conductor = registry.get(normalizedSessionId);
|
|
93
|
+
if (!conductor) {
|
|
94
|
+
return {
|
|
95
|
+
ok: false,
|
|
96
|
+
error: {
|
|
97
|
+
code: "CONDUCTOR_SESSION_NOT_FOUND",
|
|
98
|
+
message: `Conductor session not found: ${normalizedSessionId}`,
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const sent = conductor.sendInput(normalizedSessionId, normalizedText);
|
|
104
|
+
if (!sent) {
|
|
105
|
+
return {
|
|
106
|
+
ok: false,
|
|
107
|
+
error: {
|
|
108
|
+
code: "SEND_INPUT_FAILED",
|
|
109
|
+
message: `입력 전송 실패: ${normalizedSessionId}`,
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return {
|
|
115
|
+
ok: true,
|
|
116
|
+
data: {
|
|
117
|
+
session_id: normalizedSessionId,
|
|
118
|
+
sent: true,
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
}
|