@triflux/core 10.51.0 → 10.53.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/bridge.mjs +69 -1197
- package/hub/cli-adapter-base.mjs +4 -104
- package/hub/codex-adapter.mjs +7 -116
- package/hub/index.mjs +3 -20
- package/hub/lib/process-utils.mjs +1 -33
- package/hub/team/claude-daemon-control.mjs +1 -2
- package/hub/team/claude-session-projection.mjs +5 -73
- package/hub/team/claude-transcript.mjs +19 -0
- package/hub/team/nativeProxy.mjs +759 -0
- package/hub/team/session-context.mjs +1 -1
- package/hud/constants.mjs +9 -22
- package/hud/hud-qos-status.mjs +16 -19
- package/hud/providers/codex-probe.mjs +2 -31
- package/hud/providers/codex.mjs +16 -58
- package/hud/providers/gemini.mjs +20 -0
- package/hud/renderers.mjs +101 -77
- package/hud/utils.mjs +9 -13
- package/package.json +3 -6
- package/scripts/lib/agent-route-policy.mjs +0 -67
- package/scripts/lib/cli-claude.mjs +0 -12
- package/scripts/lib/env-probe.mjs +0 -70
- package/scripts/lib/legacy-mcp-cleanup.mjs +283 -0
- package/scripts/lib/mcp-guard-engine.mjs +42 -101
- package/scripts/lib/session-presence.mjs +1 -99
- package/hub/account-broker.mjs +0 -1221
- package/hub/adaptive-diagnostic.mjs +0 -350
- package/hub/adaptive-inject.mjs +0 -224
- package/hub/adaptive-memory.mjs +0 -277
- package/hub/adaptive.mjs +0 -172
- package/hub/assign-callbacks.mjs +0 -170
- package/hub/delegator/contracts.mjs +0 -38
- package/hub/delegator/index.mjs +0 -14
- package/hub/delegator/schema/delegator-tools.schema.json +0 -250
- package/hub/delegator/service.mjs +0 -336
- package/hub/delegator/tool-definitions.mjs +0 -35
- package/hub/hitl.mjs +0 -202
- package/hub/lib/known-errors.json +0 -72
- package/hub/lib/memory-store.mjs +0 -1001
- package/hub/lib/phase-manager.mjs +0 -493
- package/hub/lib/state-snapshot.mjs +0 -293
- package/hub/lib/trace-recorder.mjs +0 -153
- package/hub/lib/uuidv7.mjs +0 -45
- package/hub/memory-doctor.mjs +0 -640
- package/hub/middleware/quota-middleware.mjs +0 -70
- package/hub/middleware/request-logger.mjs +0 -191
- package/hub/paths.mjs +0 -24
- package/hub/pipeline/index.mjs +0 -163
- package/hub/pipeline/state.mjs +0 -191
- package/hub/pipeline/transitions.mjs +0 -131
- package/hub/reflexion.mjs +0 -290
- package/hub/role-contract.mjs +0 -312
- package/hub/router.mjs +0 -2026
- package/hub/session-fingerprint.mjs +0 -418
- package/hub/state.mjs +0 -300
- package/hub/team/synapse-http.mjs +0 -311
- package/hub/team-bridge.mjs +0 -27
- package/scripts/lib/claudemd-scanner.mjs +0 -26
- package/scripts/lib/context.mjs +0 -51
- package/scripts/lib/handoff.mjs +0 -187
- package/scripts/lib/logger.mjs +0 -122
- package/scripts/lib/stealth-fetch.mjs +0 -176
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
// Codex와 Antigravity 세션 hook이 공유하는 presence 기록 함수.
|
|
2
|
-
import {
|
|
2
|
+
import { execFileSync } from "node:child_process";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import { resolveRoleControlSnapshot } from "../../hub/lib/cto-env.mjs";
|
|
5
|
-
import {
|
|
6
|
-
buildSynapseTaskSummary,
|
|
7
|
-
heartbeatSynapseSession,
|
|
8
|
-
registerSynapseSession,
|
|
9
|
-
} from "../../hub/team/synapse-http.mjs";
|
|
10
5
|
|
|
11
6
|
function parseStartPayload(stdinData) {
|
|
12
7
|
try {
|
|
@@ -154,96 +149,3 @@ export function shouldSkipInteractiveRegistration(payload, seams = {}) {
|
|
|
154
149
|
commandUsesClaudePrintMode(command),
|
|
155
150
|
);
|
|
156
151
|
}
|
|
157
|
-
|
|
158
|
-
/** git 조회는 세션 시작을 막지 않도록 비동기로 실행한다. */
|
|
159
|
-
function gitContextAsync(cwd, gitRunner = defaultGitRunner) {
|
|
160
|
-
const run = (args) =>
|
|
161
|
-
new Promise((resolve) => {
|
|
162
|
-
try {
|
|
163
|
-
gitRunner(cwd, args, (out) => resolve(out));
|
|
164
|
-
} catch {
|
|
165
|
-
resolve("");
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
return Promise.all([
|
|
169
|
-
run(["rev-parse", "--show-toplevel"]),
|
|
170
|
-
run(["rev-parse", "--abbrev-ref", "HEAD"]),
|
|
171
|
-
]).then(([toplevel, branch]) => ({
|
|
172
|
-
worktreePath: toplevel || cwd,
|
|
173
|
-
branch,
|
|
174
|
-
}));
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
/** git 조회 실패는 빈 문자열로 처리한다. */
|
|
178
|
-
function defaultGitRunner(cwd, args, cb) {
|
|
179
|
-
execFile(
|
|
180
|
-
"git",
|
|
181
|
-
args,
|
|
182
|
-
{
|
|
183
|
-
cwd,
|
|
184
|
-
encoding: "utf8",
|
|
185
|
-
timeout: 1500,
|
|
186
|
-
killSignal: "SIGKILL",
|
|
187
|
-
windowsHide: true,
|
|
188
|
-
},
|
|
189
|
-
(err, stdout) => {
|
|
190
|
-
cb(err ? "" : String(stdout || "").trim());
|
|
191
|
-
},
|
|
192
|
-
);
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
/** 세션을 즉시 등록하고 git 정보는 뒤이어 갱신한다. 훅 PID는 세션 PID가 아니다. */
|
|
196
|
-
export function registerInteractiveSession(stdinData, seams = {}) {
|
|
197
|
-
let ctoEvent = null;
|
|
198
|
-
const register = seams.register || registerSynapseSession;
|
|
199
|
-
const heartbeat = seams.heartbeat || heartbeatSynapseSession;
|
|
200
|
-
const gitRunner = seams.gitRunner || defaultGitRunner;
|
|
201
|
-
try {
|
|
202
|
-
const payload = parseStartPayload(stdinData);
|
|
203
|
-
const sessionId = String(payload?.session_id || "").trim();
|
|
204
|
-
if (!sessionId) return null;
|
|
205
|
-
if (shouldSkipInteractiveRegistration(payload, seams)) return null;
|
|
206
|
-
const cwd = typeof payload?.cwd === "string" ? payload.cwd : process.cwd();
|
|
207
|
-
|
|
208
|
-
register({
|
|
209
|
-
sessionId,
|
|
210
|
-
cwd,
|
|
211
|
-
worktreePath: cwd,
|
|
212
|
-
branch: "",
|
|
213
|
-
host: "local",
|
|
214
|
-
sessionKind: "interactive",
|
|
215
|
-
isRemote: false,
|
|
216
|
-
});
|
|
217
|
-
|
|
218
|
-
ctoEvent = emitParticipantSessionStarted(stdinData, seams).catch(
|
|
219
|
-
() => null,
|
|
220
|
-
);
|
|
221
|
-
|
|
222
|
-
gitContextAsync(cwd, gitRunner)
|
|
223
|
-
.then(({ worktreePath, branch }) => {
|
|
224
|
-
if (worktreePath === cwd && !branch) return;
|
|
225
|
-
heartbeat(sessionId, { worktreePath, branch });
|
|
226
|
-
})
|
|
227
|
-
.catch(() => {});
|
|
228
|
-
} catch {
|
|
229
|
-
/* 세션 시작은 계속한다. */
|
|
230
|
-
}
|
|
231
|
-
return ctoEvent;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
/** 사용자 활동을 갱신한다. 호출자는 종료 전에 전송을 완료해야 한다. */
|
|
235
|
-
export function heartbeatInteractiveSession(stdinData, seams = {}) {
|
|
236
|
-
const heartbeat = seams.heartbeat || heartbeatSynapseSession;
|
|
237
|
-
try {
|
|
238
|
-
const payload = parseStartPayload(stdinData);
|
|
239
|
-
const sessionId = String(payload?.session_id || "").trim();
|
|
240
|
-
if (!sessionId) return;
|
|
241
|
-
const cwd = typeof payload?.cwd === "string" ? payload.cwd : process.cwd();
|
|
242
|
-
const partial = { worktreePath: cwd, host: "local" };
|
|
243
|
-
const prompt = typeof payload?.prompt === "string" ? payload.prompt : "";
|
|
244
|
-
if (prompt) partial.taskSummary = buildSynapseTaskSummary(prompt);
|
|
245
|
-
heartbeat(sessionId, partial);
|
|
246
|
-
} catch {
|
|
247
|
-
/* 프롬프트 처리는 계속한다. */
|
|
248
|
-
}
|
|
249
|
-
}
|