@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,66 +0,0 @@
1
- import { spawn } from "node:child_process";
2
-
3
- export function timeoutCodeForSignal(signal) {
4
- return signal ? 124 : null;
5
- }
6
-
7
- export function runWithTimeout(command, args = [], options = {}) {
8
- const {
9
- cwd = process.cwd(),
10
- env = process.env,
11
- input,
12
- timeoutMs = 0,
13
- stdio = "pipe",
14
- spawnFn = spawn,
15
- } = options;
16
-
17
- return new Promise((resolve, reject) => {
18
- const controller = new AbortController();
19
- let timedOut = false;
20
- const child = spawnFn(command, args, {
21
- cwd,
22
- env,
23
- stdio,
24
- signal: controller.signal,
25
- });
26
- const stdout = [];
27
- const stderr = [];
28
- let timer = null;
29
-
30
- if (child.stdout) child.stdout.on("data", (chunk) => stdout.push(chunk));
31
- if (child.stderr) child.stderr.on("data", (chunk) => stderr.push(chunk));
32
- child.on("error", (err) => {
33
- if (timedOut && err.name === "AbortError") return;
34
- reject(err);
35
- });
36
- child.on("exit", (code, signal) => {
37
- if (timer) clearTimeout(timer);
38
- resolve({
39
- code: timedOut ? 124 : (code ?? timeoutCodeForSignal(signal) ?? 1),
40
- signal,
41
- timedOut,
42
- stdout: Buffer.concat(stdout).toString("utf8"),
43
- stderr: Buffer.concat(stderr).toString("utf8"),
44
- });
45
- });
46
-
47
- if (timeoutMs > 0) {
48
- timer = setTimeout(() => {
49
- timedOut = true;
50
- controller.abort();
51
- if (child.pid) {
52
- try {
53
- process.kill(child.pid, "SIGTERM");
54
- } catch {
55
- // Process already exited.
56
- }
57
- }
58
- }, timeoutMs);
59
- timer.unref?.();
60
- }
61
-
62
- if (input !== undefined && child.stdin) {
63
- child.stdin.end(input);
64
- }
65
- });
66
- }
@@ -1,26 +0,0 @@
1
- import { mkdirSync } from "node:fs";
2
- import { tmpdir } from "node:os";
3
- import { join } from "node:path";
4
-
5
- export function resolveTmpDir({ env = process.env, cwd = process.cwd() } = {}) {
6
- const candidate = env.TFX_TMP || tmpdir();
7
- try {
8
- mkdirSync(candidate, { recursive: true });
9
- return candidate;
10
- } catch {
11
- const fallback = join(cwd, ".tfx-tmp");
12
- try {
13
- mkdirSync(fallback, { recursive: true });
14
- } catch {
15
- // Bash printed the fallback path even when mkdir failed.
16
- }
17
- return fallback;
18
- }
19
- }
20
-
21
- export function resolveJobsDir({
22
- env = process.env,
23
- tmpDir = resolveTmpDir({ env }),
24
- } = {}) {
25
- return env.TFX_JOBS_DIR || join(tmpDir, "tfx-jobs");
26
- }
@@ -1,132 +0,0 @@
1
- import { existsSync, readFileSync, writeFileSync } from "node:fs";
2
- import { createRequire } from "node:module";
3
- import { dirname } from "node:path";
4
- import { sanitizeCodexProfileConfig } from "./codex-profile-config.mjs";
5
-
6
- const require = createRequire(import.meta.url);
7
- let TOML = null;
8
- try {
9
- TOML = require("@iarna/toml");
10
- } catch {
11
- TOML = null;
12
- }
13
-
14
- function walk(value, visitor) {
15
- if (!value || typeof value !== "object") return;
16
- for (const [key, child] of Object.entries(value)) {
17
- visitor(value, key, child);
18
- walk(child, visitor);
19
- }
20
- }
21
-
22
- export function parseToml(source) {
23
- if (!TOML) return parseTomlFallback(source);
24
- return TOML.parse(source || "");
25
- }
26
-
27
- export function stringifyToml(value) {
28
- if (!TOML) return stringifyTomlFallback(value);
29
- return TOML.stringify(value);
30
- }
31
-
32
- function parseTomlFallback(source = "") {
33
- const root = {};
34
- let current = root;
35
- for (const rawLine of String(source).split(/\r?\n/)) {
36
- const line = rawLine.trim();
37
- if (!line || line.startsWith("#")) continue;
38
- const section = line.match(/^\[([^\]]+)\]$/);
39
- if (section) {
40
- current = root;
41
- for (const part of section[1].split(".")) {
42
- current[part] ??= {};
43
- current = current[part];
44
- }
45
- continue;
46
- }
47
- const assignment = line.match(/^([A-Za-z0-9_-]+)\s*=\s*"([^"]*)"$/);
48
- if (assignment) {
49
- current[assignment[1]] = assignment[2];
50
- }
51
- }
52
- return root;
53
- }
54
-
55
- function stringifyTomlFallback(value) {
56
- const lines = [];
57
- for (const [key, child] of Object.entries(value)) {
58
- if (child && typeof child === "object") continue;
59
- lines.push(`${key} = "${String(child)}"`);
60
- }
61
- function writeSections(prefix, obj) {
62
- for (const [key, child] of Object.entries(obj)) {
63
- if (!child || typeof child !== "object") continue;
64
- const section = [...prefix, key];
65
- lines.push("", `[${section.join(".")}]`);
66
- for (const [childKey, childValue] of Object.entries(child)) {
67
- if (childValue && typeof childValue === "object") continue;
68
- lines.push(`${childKey} = "${String(childValue)}"`);
69
- }
70
- writeSections(section, child);
71
- }
72
- }
73
- writeSections([], value);
74
- return `${lines.join("\n")}\n`;
75
- }
76
-
77
- export function detectTopLevelCodexConfig(source) {
78
- const parsed = parseToml(source);
79
- return {
80
- hasTopLevelSandboxOrApproval:
81
- Object.hasOwn(parsed, "sandbox") ||
82
- Object.hasOwn(parsed, "approval_mode"),
83
- };
84
- }
85
-
86
- export function patchMcpApprovalMode(source) {
87
- const parsed = parseToml(source);
88
- let count = 0;
89
- walk(parsed.mcp_servers, (parent, key, value) => {
90
- if (key === "approval_mode" && value === "approve") {
91
- parent[key] = "full-auto";
92
- count += 1;
93
- }
94
- });
95
- return {
96
- changed: count > 0,
97
- count,
98
- toml: count > 0 ? stringifyToml(parsed) : source,
99
- };
100
- }
101
-
102
- export function patchCodexConfigFile(path, { now = () => new Date() } = {}) {
103
- if (!path || !existsSync(path)) return { changed: false, count: 0 };
104
- const source = readFileSync(path, "utf8");
105
- const approvalPatched = patchMcpApprovalMode(source);
106
- const profileSanitized = sanitizeCodexProfileConfig(approvalPatched.toml, {
107
- codexHome: dirname(path),
108
- });
109
- const changed = approvalPatched.changed || profileSanitized.changed;
110
- if (!changed) {
111
- return {
112
- changed: false,
113
- count: 0,
114
- removedProfiles: [],
115
- migratedProfiles: [],
116
- };
117
- }
118
- const stamp = now()
119
- .toISOString()
120
- .replace(/[-:]/g, "")
121
- .replace(/\..*$/, "")
122
- .replace("T", "-");
123
- writeFileSync(`${path}.bak-${stamp}`, source);
124
- writeFileSync(path, profileSanitized.toml);
125
- return {
126
- changed: true,
127
- count: approvalPatched.count,
128
- removedProfiles: profileSanitized.removedProfiles,
129
- migratedProfiles: profileSanitized.migratedProfiles,
130
- toml: profileSanitized.toml,
131
- };
132
- }