@triflux/remote 10.0.1 → 10.25.1
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 +68 -7
- package/hub/server.mjs +2181 -701
- package/hub/store-adapter.mjs +101 -37
- 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 +84 -17
- package/hub/team/build-worker-prompt.mjs +42 -0
- package/hub/team/check-mcp-hub.mjs +49 -0
- package/hub/team/claude-daemon-control.mjs +219 -0
- package/hub/team/claude-native-bridge.mjs +784 -0
- package/hub/team/claude-session-projection.mjs +65 -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 +154 -33
- package/hub/team/cli/commands/start/parse-args.mjs +89 -12
- package/hub/team/cli/commands/start/start-headless.mjs +127 -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/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 +45 -17
- 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 +55 -1
- 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 +21 -119
- package/hub/team/dashboard.mjs +76 -28
- package/hub/team/event-log.mjs +18 -10
- package/hub/team/execution-mode.mjs +241 -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 +2065 -1156
- package/hub/team/health-probe.mjs +232 -69
- package/hub/team/launcher-template.mjs +23 -13
- 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 +74 -35
- 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 -15
- package/hub/team/process-cleanup.mjs +69 -25
- package/hub/team/psmux.mjs +1067 -264
- package/hub/team/recovery-store.mjs +149 -0
- package/hub/team/remote-probe.mjs +69 -53
- package/hub/team/remote-session.mjs +131 -59
- package/hub/team/remote-watcher.mjs +62 -34
- package/hub/team/retry-state-machine.mjs +267 -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 +605 -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 +1526 -198
- 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 +317 -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 +288 -0
- package/hub/team/tui-lite.mjs +234 -146
- package/hub/team/tui-remote-adapter.mjs +21 -37
- package/hub/team/tui-synapse.mjs +223 -0
- package/hub/team/tui-viewer.mjs +104 -45
- package/hub/team/tui-widgets.mjs +262 -0
- package/hub/team/tui.mjs +936 -449
- package/hub/team/worker-completion-validator.mjs +84 -0
- package/hub/team/worker-sandbox.mjs +93 -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 +518 -64
- package/hub/team/wt-manager.mjs +297 -26
- package/hub/tools.mjs +474 -252
- package/hub/tray.mjs +411 -368
- 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 +663 -337
- package/hub/workers/factory.mjs +100 -21
- package/hub/workers/gemini-worker.mjs +179 -86
- package/hub/workers/interface.mjs +23 -2
- package/hub/workers/lib/jsonrpc-stdio.mjs +463 -0
- package/hub/workers/worker-utils.mjs +22 -16
- 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 +67 -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-servers.mjs +70 -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 +179 -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
package/hub/team/handoff.mjs
CHANGED
|
@@ -44,8 +44,7 @@ Rules:
|
|
|
44
44
|
/**
|
|
45
45
|
* CLI 프롬프트 길이 제한을 고려한 축약 HANDOFF 지시
|
|
46
46
|
*/
|
|
47
|
-
export const HANDOFF_INSTRUCTION_SHORT =
|
|
48
|
-
`After completing, output this block at the end:
|
|
47
|
+
export const HANDOFF_INSTRUCTION_SHORT = `After completing, output this block at the end:
|
|
49
48
|
--- HANDOFF ---
|
|
50
49
|
status: ok | partial | failed
|
|
51
50
|
lead_action: accept | needs_read | retry | reassign
|
|
@@ -71,13 +70,20 @@ export function parseHandoff(rawText) {
|
|
|
71
70
|
const endIdx = rest.indexOf("\n---");
|
|
72
71
|
const block = endIdx === -1 ? rest : rest.slice(0, endIdx);
|
|
73
72
|
|
|
74
|
-
const lines = block
|
|
73
|
+
const lines = block
|
|
74
|
+
.split("\n")
|
|
75
|
+
.map((l) => l.trim())
|
|
76
|
+
.filter(Boolean);
|
|
75
77
|
const parsed = {};
|
|
76
78
|
|
|
77
79
|
for (const line of lines) {
|
|
78
80
|
const colonIdx = line.indexOf(":");
|
|
79
81
|
if (colonIdx === -1) continue;
|
|
80
|
-
const key = line
|
|
82
|
+
const key = line
|
|
83
|
+
.slice(0, colonIdx)
|
|
84
|
+
.trim()
|
|
85
|
+
.toLowerCase()
|
|
86
|
+
.replace(/\s+/g, "_");
|
|
81
87
|
const value = line.slice(colonIdx + 1).trim();
|
|
82
88
|
if (key && value) parsed[key] = value;
|
|
83
89
|
}
|
|
@@ -169,14 +175,18 @@ export function validateHandoff(parsed, context = {}) {
|
|
|
169
175
|
if (h.status === "failed" || h.status === "partial") {
|
|
170
176
|
if (h.error_stage) {
|
|
171
177
|
const v = validateEnum(h.error_stage, ERROR_STAGE_VALUES);
|
|
172
|
-
if (!v) {
|
|
173
|
-
|
|
178
|
+
if (!v) {
|
|
179
|
+
warnings.push(`error_stage: "${h.error_stage}" invalid`);
|
|
180
|
+
delete h.error_stage;
|
|
181
|
+
} else h.error_stage = v;
|
|
174
182
|
}
|
|
175
183
|
for (const f of ["retryable", "partial_output"]) {
|
|
176
184
|
if (h[f]) {
|
|
177
185
|
const v = validateEnum(h[f], YES_NO);
|
|
178
|
-
if (!v) {
|
|
179
|
-
|
|
186
|
+
if (!v) {
|
|
187
|
+
warnings.push(`${f}: "${h[f]}" invalid`);
|
|
188
|
+
delete h[f];
|
|
189
|
+
} else h[f] = v;
|
|
180
190
|
}
|
|
181
191
|
}
|
|
182
192
|
}
|
|
@@ -204,7 +214,17 @@ export function validateHandoff(parsed, context = {}) {
|
|
|
204
214
|
const rest = h.files_changed.length - 3;
|
|
205
215
|
h.files_changed = [...h.files_changed.slice(0, 3), `+${rest} more`];
|
|
206
216
|
}
|
|
207
|
-
warnings.push(
|
|
217
|
+
warnings.push(
|
|
218
|
+
`token cap exceeded (${tokens} > ${TOKEN_HARD_CAP}), trimmed`,
|
|
219
|
+
);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
const filesChangedCount = Array.isArray(h.files_changed)
|
|
223
|
+
? h.files_changed.filter(Boolean).length
|
|
224
|
+
: 0;
|
|
225
|
+
if (filesChangedCount === 0 && h.lead_action === "accept") {
|
|
226
|
+
h.lead_action = "needs_read";
|
|
227
|
+
warnings.push("files_changed empty: accept → needs_read");
|
|
208
228
|
}
|
|
209
229
|
|
|
210
230
|
const missingCore = coreRequired.filter((f) => !h[f]);
|
|
@@ -219,23 +239,31 @@ export function validateHandoff(parsed, context = {}) {
|
|
|
219
239
|
* @param {number} exitCode
|
|
220
240
|
* @param {string} resultFile
|
|
221
241
|
* @param {string} [cli]
|
|
242
|
+
* @param {object} [context]
|
|
243
|
+
* @param {string[]} [context.filesChanged]
|
|
222
244
|
* @returns {object}
|
|
223
245
|
*/
|
|
224
|
-
export function buildFallbackHandoff(exitCode, resultFile, cli) {
|
|
246
|
+
export function buildFallbackHandoff(exitCode, resultFile, cli, context = {}) {
|
|
225
247
|
const ok = exitCode === 0;
|
|
248
|
+
const filesChanged = Array.isArray(context.filesChanged)
|
|
249
|
+
? context.filesChanged.filter(Boolean)
|
|
250
|
+
: [];
|
|
226
251
|
return {
|
|
227
252
|
status: ok ? "ok" : "failed",
|
|
228
|
-
lead_action:
|
|
253
|
+
lead_action:
|
|
254
|
+
ok && filesChanged.length > 0 ? "accept" : ok ? "needs_read" : "retry",
|
|
229
255
|
task: "unknown",
|
|
230
|
-
files_changed:
|
|
256
|
+
files_changed: filesChanged,
|
|
231
257
|
verdict: `${cli || "worker"} completed (exit ${exitCode})`,
|
|
232
258
|
confidence: "low",
|
|
233
259
|
risk: "low",
|
|
234
260
|
detail: resultFile || "none",
|
|
235
|
-
...(ok
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
261
|
+
...(ok
|
|
262
|
+
? {}
|
|
263
|
+
: {
|
|
264
|
+
error_stage: exitCode === 124 ? "timeout" : "execution",
|
|
265
|
+
retryable: exitCode === 124 ? "no" : "yes",
|
|
266
|
+
}),
|
|
239
267
|
_fallback: true,
|
|
240
268
|
};
|
|
241
269
|
}
|
|
@@ -248,8 +276,10 @@ export function buildFallbackHandoff(exitCode, resultFile, cli) {
|
|
|
248
276
|
export function formatHandoffForLead(handoff) {
|
|
249
277
|
const h = handoff;
|
|
250
278
|
const files = Array.isArray(h.files_changed)
|
|
251
|
-
?
|
|
252
|
-
|
|
279
|
+
? h.files_changed.length > 0
|
|
280
|
+
? h.files_changed.join(", ")
|
|
281
|
+
: "none"
|
|
282
|
+
: h.files_changed || "none";
|
|
253
283
|
|
|
254
284
|
const lines = [
|
|
255
285
|
`[HANDOFF] status=${h.status || "?"} action=${h.lead_action || "?"} confidence=${h.confidence || "?"}`,
|
|
@@ -282,6 +312,7 @@ export function processHandoff(rawText, context = {}) {
|
|
|
282
312
|
context.exitCode ?? 1,
|
|
283
313
|
context.resultFile || "none",
|
|
284
314
|
context.cli,
|
|
315
|
+
{ filesChanged: context.gitDiffFiles },
|
|
285
316
|
);
|
|
286
317
|
return {
|
|
287
318
|
handoff: fb,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import fs from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
|
|
4
|
+
export async function writeBridgeSession(sessionId, socketPath, baseDir) {
|
|
5
|
+
const sessionsDir = path.join(baseDir, "sessions");
|
|
6
|
+
await fs.mkdir(sessionsDir, { recursive: true });
|
|
7
|
+
|
|
8
|
+
const sessionData = {
|
|
9
|
+
session_id: sessionId,
|
|
10
|
+
messagingSock: socketPath,
|
|
11
|
+
status: "RUNNING",
|
|
12
|
+
created_at: new Date().toISOString(),
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const filePath = path.join(sessionsDir, `${sessionId}.json`);
|
|
16
|
+
await fs.writeFile(filePath, JSON.stringify(sessionData, null, 2), "utf8");
|
|
17
|
+
}
|