@triflux/remote 10.50.1 → 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.
Files changed (120) hide show
  1. package/cto/brief.mjs +0 -12
  2. package/cto/collect.mjs +16 -247
  3. package/cto/current.schema.json +4 -20
  4. package/cto/events.mjs +13 -294
  5. package/cto/hygiene.mjs +26 -346
  6. package/cto/lake-root.mjs +114 -16
  7. package/cto/status.mjs +33 -128
  8. package/hub/index.mjs +0 -8
  9. package/hub/store-adapter.mjs +1 -1
  10. package/hub/team/agent-map.json +0 -1
  11. package/hub/team/ansi.mjs +1 -35
  12. package/hub/team/backend.mjs +9 -145
  13. package/hub/team/cli/commands/attach.mjs +1 -17
  14. package/hub/team/cli/commands/control.mjs +12 -38
  15. package/hub/team/cli/commands/debug.mjs +1 -37
  16. package/hub/team/cli/commands/focus.mjs +5 -31
  17. package/hub/team/cli/commands/interrupt.mjs +6 -25
  18. package/hub/team/cli/commands/kill.mjs +1 -30
  19. package/hub/team/cli/commands/list.mjs +0 -16
  20. package/hub/team/cli/commands/send.mjs +6 -26
  21. package/hub/team/cli/commands/start/index.mjs +41 -133
  22. package/hub/team/cli/commands/start/parse-args.mjs +15 -40
  23. package/hub/team/cli/commands/start/start-headless.mjs +138 -105
  24. package/hub/team/cli/commands/start/start-mux.mjs +0 -3
  25. package/hub/team/cli/commands/status.mjs +2 -57
  26. package/hub/team/cli/commands/stop.mjs +14 -19
  27. package/hub/team/cli/help.mjs +4 -5
  28. package/hub/team/cli/manifest.mjs +5 -1
  29. package/hub/team/cli/render.mjs +0 -12
  30. package/hub/team/cli/services/hub-client.mjs +2 -88
  31. package/hub/team/cli/services/runtime-mode.mjs +27 -98
  32. package/hub/team/handoff.mjs +3 -34
  33. package/hub/team/headless.mjs +14 -755
  34. package/hub/team/orchestrator.mjs +4 -30
  35. package/hub/team/pane.mjs +6 -28
  36. package/hub/team/psmux.mjs +16 -403
  37. package/hub/team/remote-session.mjs +1 -2
  38. package/hub/team/session.mjs +8 -119
  39. package/hub/team/swarm-intent.mjs +0 -198
  40. package/hub/team/terminal-opener.mjs +11 -35
  41. package/hub/team/tui-core.mjs +1 -1
  42. package/hub/team/tui-viewer.mjs +2 -2
  43. package/hub/team/tui.mjs +8 -269
  44. package/hub/team/wt-manager.mjs +2 -2
  45. package/hub/workers/factory.mjs +4 -37
  46. package/hub/workers/lib/jsonrpc-ws-uds.mjs +0 -2
  47. package/package.json +1 -1
  48. package/scripts/lib/agent-route-policy.mjs +162 -14
  49. package/scripts/lib/claudemd-scanner.mjs +2 -199
  50. package/scripts/lib/cli-claude.mjs +0 -2
  51. package/scripts/lib/context.mjs +3 -19
  52. package/scripts/lib/env-probe.mjs +5 -64
  53. package/scripts/lib/gemini-profiles.mjs +2 -69
  54. package/scripts/lib/legacy-mcp-cleanup.mjs +14 -3
  55. package/scripts/lib/machine-profile.mjs +3 -17
  56. package/scripts/lib/mcp-filter.mjs +109 -53
  57. package/scripts/lib/mcp-health.mjs +2 -2
  58. package/scripts/lib/mcp-server-catalog.mjs +2 -2
  59. package/scripts/lib/psmux-info.mjs +25 -104
  60. package/scripts/lib/skill-template.mjs +0 -271
  61. package/cto/hygiene-actions.mjs +0 -355
  62. package/cto/hygiene-notify.mjs +0 -170
  63. package/hub/team/build-worker-prompt.mjs +0 -92
  64. package/hub/team/check-mcp-hub.mjs +0 -49
  65. package/hub/team/claude-native-bridge.mjs +0 -987
  66. package/hub/team/cli/commands/start/start-in-process.mjs +0 -50
  67. package/hub/team/cli/commands/start/start-wt.mjs +0 -86
  68. package/hub/team/cli/services/native-control.mjs +0 -145
  69. package/hub/team/codex-review.mjs +0 -520
  70. package/hub/team/conductor-mesh-bridge.mjs +0 -122
  71. package/hub/team/conductor.mjs +0 -1529
  72. package/hub/team/consensus-meta.mjs +0 -176
  73. package/hub/team/cto-pull.mjs +0 -31
  74. package/hub/team/daemon-pty-tmux-bridge.mjs +0 -146
  75. package/hub/team/dashboard.mjs +0 -322
  76. package/hub/team/event-log.mjs +0 -84
  77. package/hub/team/execution-mode.mjs +0 -324
  78. package/hub/team/extract-completion-payload.mjs +0 -110
  79. package/hub/team/headless-bridge-session.mjs +0 -17
  80. package/hub/team/health-probe.mjs +0 -435
  81. package/hub/team/interactive-native-launcher.mjs +0 -119
  82. package/hub/team/interactive-native-worker.mjs +0 -80
  83. package/hub/team/interactive-tui-transport.mjs +0 -479
  84. package/hub/team/launcher-template.mjs +0 -144
  85. package/hub/team/mcp-selector.mjs +0 -145
  86. package/hub/team/native-supervisor.mjs +0 -460
  87. package/hub/team/native.mjs +0 -727
  88. package/hub/team/recovery-store.mjs +0 -149
  89. package/hub/team/remote-probe.mjs +0 -292
  90. package/hub/team/remote-watcher.mjs +0 -506
  91. package/hub/team/runtime-strategy.mjs +0 -200
  92. package/hub/team/schemas/worker-completion.json +0 -39
  93. package/hub/team/sentinel-capture.mjs +0 -127
  94. package/hub/team/swarm-cli.mjs +0 -390
  95. package/hub/team/swarm-hypervisor.mjs +0 -2206
  96. package/hub/team/swarm-locks.mjs +0 -335
  97. package/hub/team/swarm-planner.mjs +0 -371
  98. package/hub/team/swarm-preflight.mjs +0 -366
  99. package/hub/team/swarm-reconciler.mjs +0 -242
  100. package/hub/team/tui-remote-adapter.mjs +0 -377
  101. package/hub/team/worker-completion-validator.mjs +0 -79
  102. package/hub/team/worktree-lifecycle.mjs +0 -639
  103. package/hub/team/wt-templates.json +0 -43
  104. package/hub/workers/antigravity-route-worker.mjs +0 -179
  105. package/hub/workers/gemini-worker.mjs +0 -217
  106. package/scripts/lib/agent-json.mjs +0 -27
  107. package/scripts/lib/async.mjs +0 -174
  108. package/scripts/lib/cli-agy.mjs +0 -85
  109. package/scripts/lib/cli-codex.mjs +0 -62
  110. package/scripts/lib/cli-gemini.mjs +0 -37
  111. package/scripts/lib/dynamic-route-cli.mjs +0 -107
  112. package/scripts/lib/env.mjs +0 -14
  113. package/scripts/lib/hub.mjs +0 -48
  114. package/scripts/lib/pid.mjs +0 -63
  115. package/scripts/lib/quota.mjs +0 -47
  116. package/scripts/lib/skill-state.mjs +0 -220
  117. package/scripts/lib/team.mjs +0 -75
  118. package/scripts/lib/timeout.mjs +0 -66
  119. package/scripts/lib/tmp.mjs +0 -26
  120. package/scripts/lib/toml.mjs +0 -132
@@ -1,50 +0,0 @@
1
- import { startNativeSupervisor } from "../../services/native-control.mjs";
2
- import { buildTasks } from "../../services/task-model.mjs";
3
-
4
- export async function startInProcessTeam({
5
- sessionId,
6
- task,
7
- lead,
8
- agents,
9
- subtasks,
10
- hubUrl,
11
- }) {
12
- const { runtime, members } = await startNativeSupervisor({
13
- sessionId,
14
- task,
15
- lead,
16
- agents,
17
- subtasks,
18
- hubUrl,
19
- });
20
-
21
- if (!runtime?.controlUrl) return null;
22
-
23
- return {
24
- sessionName: sessionId,
25
- task,
26
- lead,
27
- agents,
28
- layout: "native",
29
- teammateMode: "in-process",
30
- startedAt: Date.now(),
31
- hubUrl,
32
- members: members.map((member, index) => ({
33
- role: member.role,
34
- name: member.name,
35
- cli: member.cli,
36
- agentId: member.agentId,
37
- pane: `native:${index}`,
38
- subtask: member.subtask || null,
39
- })),
40
- panes: {},
41
- tasks: buildTasks(
42
- subtasks,
43
- members.filter((member) => member.role === "worker"),
44
- ),
45
- native: {
46
- controlUrl: runtime.controlUrl,
47
- supervisorPid: runtime.supervisorPid,
48
- },
49
- };
50
- }
@@ -1,86 +0,0 @@
1
- import { buildCliCommand } from "../../../pane.mjs";
2
- import { createWtSession } from "../../../session.mjs";
3
- import { warn } from "../../render.mjs";
4
- import { toAgentId } from "../../services/member-selector.mjs";
5
- import { buildTasks } from "../../services/task-model.mjs";
6
-
7
- export async function startWtTeam({
8
- sessionId,
9
- task,
10
- lead,
11
- agents,
12
- subtasks,
13
- layout,
14
- hubUrl,
15
- }) {
16
- const paneCount = agents.length + 1;
17
- const effectiveLayout = layout === "Nx1" ? "Nx1" : "1xN";
18
- if (layout !== effectiveLayout)
19
- warn(`wt 모드에서 ${layout} 레이아웃은 미지원 — ${effectiveLayout}로 대체`);
20
- console.log(` 레이아웃: ${effectiveLayout} (${paneCount} panes)`);
21
-
22
- const session = await createWtSession(sessionId, {
23
- layout: effectiveLayout,
24
- paneCommands: [
25
- { title: `${sessionId}-lead`, command: buildCliCommand(lead) },
26
- ...agents.map((cli, index) => ({
27
- title: `${sessionId}-${cli}-${index + 1}`,
28
- command: buildCliCommand(cli),
29
- })),
30
- ],
31
- });
32
-
33
- const members = [
34
- {
35
- role: "lead",
36
- name: "lead",
37
- cli: lead,
38
- pane: session.panes[0] || "wt:0",
39
- agentId: toAgentId(lead, session.panes[0] || "wt:0"),
40
- },
41
- ...agents.map((cli, index) => {
42
- const pane = session.panes[index + 1] || `wt:${index + 1}`;
43
- return {
44
- role: "worker",
45
- name: `${cli}-${index + 1}`,
46
- cli,
47
- pane,
48
- subtask: subtasks[index],
49
- agentId: toAgentId(cli, pane),
50
- };
51
- }),
52
- ];
53
-
54
- return {
55
- sessionName: sessionId,
56
- task,
57
- lead,
58
- agents,
59
- layout: effectiveLayout,
60
- teammateMode: "wt",
61
- startedAt: Date.now(),
62
- hubUrl,
63
- members,
64
- panes: Object.fromEntries(
65
- members.map((member) => [
66
- member.pane,
67
- {
68
- role: member.role,
69
- name: member.name,
70
- cli: member.cli,
71
- agentId: member.agentId,
72
- subtask: member.subtask || null,
73
- },
74
- ]),
75
- ),
76
- tasks: buildTasks(
77
- subtasks,
78
- members.filter((member) => member.role === "worker"),
79
- ),
80
- wt: {
81
- windowId: 0,
82
- layout: effectiveLayout,
83
- paneCount: session.paneCount,
84
- },
85
- };
86
- }
@@ -1,145 +0,0 @@
1
- import { spawn } from "node:child_process";
2
- import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
3
- import { join } from "node:path";
4
- import { buildExecArgs } from "@triflux/core/hub/codex-adapter.mjs";
5
- import { buildLeadPrompt, buildPrompt } from "../../orchestrator.mjs";
6
- import { HUB_PID_DIR, PKG_ROOT } from "./state-store.mjs";
7
-
8
- export function buildNativeCliCommand(cli) {
9
- switch (cli) {
10
- case "codex":
11
- return buildExecArgs({});
12
- case "gemini":
13
- return "gemini";
14
- case "claude":
15
- return "claude";
16
- default:
17
- return cli;
18
- }
19
- }
20
-
21
- export async function startNativeSupervisor({
22
- sessionId,
23
- task,
24
- lead,
25
- agents,
26
- subtasks,
27
- hubUrl,
28
- }) {
29
- const configPath = join(HUB_PID_DIR, `team-native-${sessionId}.config.json`);
30
- const runtimePath = join(
31
- HUB_PID_DIR,
32
- `team-native-${sessionId}.runtime.json`,
33
- );
34
- const logsDir = join(HUB_PID_DIR, "team-logs", sessionId);
35
- mkdirSync(logsDir, { recursive: true });
36
-
37
- const leadMember = {
38
- role: "lead",
39
- name: "lead",
40
- cli: lead,
41
- agentId: `${lead}-lead`,
42
- command: buildNativeCliCommand(lead),
43
- };
44
- const workers = agents.map((cli, index) => ({
45
- role: "worker",
46
- name: `${cli}-${index + 1}`,
47
- cli,
48
- agentId: `${cli}-w${index + 1}`,
49
- command: buildNativeCliCommand(cli),
50
- subtask: subtasks[index],
51
- }));
52
- const members = [
53
- {
54
- ...leadMember,
55
- prompt: buildLeadPrompt(task, {
56
- agentId: leadMember.agentId,
57
- hubUrl,
58
- teammateMode: "in-process",
59
- workers: workers.map((worker) => ({
60
- agentId: worker.agentId,
61
- cli: worker.cli,
62
- subtask: worker.subtask,
63
- })),
64
- }),
65
- },
66
- ...workers.map((worker) => ({
67
- ...worker,
68
- prompt: buildPrompt(worker.subtask, {
69
- cli: worker.cli,
70
- agentId: worker.agentId,
71
- hubUrl,
72
- }),
73
- })),
74
- ];
75
-
76
- writeFileSync(
77
- configPath,
78
- JSON.stringify(
79
- {
80
- sessionName: sessionId,
81
- hubUrl,
82
- workdir: process.cwd(),
83
- startupDelayMs: 3000,
84
- logsDir,
85
- runtimeFile: runtimePath,
86
- members,
87
- },
88
- null,
89
- 2,
90
- ) + "\n",
91
- );
92
-
93
- const child = spawn(
94
- process.execPath,
95
- [
96
- join(PKG_ROOT, "hub", "team", "native-supervisor.mjs"),
97
- "--config",
98
- configPath,
99
- ],
100
- {
101
- detached: true,
102
- stdio: "ignore",
103
- env: { ...process.env },
104
- windowsHide: true,
105
- },
106
- );
107
- child.unref();
108
-
109
- const deadline = Date.now() + 5000;
110
- while (Date.now() < deadline) {
111
- if (existsSync(runtimePath)) {
112
- try {
113
- const runtime = JSON.parse(readFileSync(runtimePath, "utf8"));
114
- return { runtime, members };
115
- } catch {}
116
- }
117
- await new Promise((resolve) => setTimeout(resolve, 100));
118
- }
119
-
120
- return { runtime: null, members };
121
- }
122
-
123
- export async function nativeRequest(state, path, body = {}) {
124
- if (!state?.native?.controlUrl) return null;
125
- try {
126
- const res = await fetch(`${state.native.controlUrl}${path}`, {
127
- method: "POST",
128
- headers: { "Content-Type": "application/json" },
129
- body: JSON.stringify(body),
130
- });
131
- return await res.json();
132
- } catch {
133
- return null;
134
- }
135
- }
136
-
137
- export async function nativeGetStatus(state) {
138
- if (!state?.native?.controlUrl) return null;
139
- try {
140
- const res = await fetch(`${state.native.controlUrl}/status`);
141
- return await res.json();
142
- } catch {
143
- return null;
144
- }
145
- }