@triflux/remote 10.51.0 → 10.52.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 (59) hide show
  1. package/cto/brief.mjs +0 -8
  2. package/cto/collect.mjs +1 -127
  3. package/cto/current.schema.json +2 -19
  4. package/cto/hygiene.mjs +2 -61
  5. package/cto/lake-root.mjs +0 -56
  6. package/cto/status.mjs +5 -139
  7. package/hub/index.mjs +0 -9
  8. package/hub/team/agents-row-attach.py +120 -0
  9. package/hub/team/agents-row.mjs +200 -0
  10. package/hub/team/claude-daemon-control.mjs +1 -2
  11. package/hub/team/claude-session-projection.mjs +5 -73
  12. package/hub/team/cli/commands/debug.mjs +1 -2
  13. package/hub/team/cli/commands/start/index.mjs +2 -1
  14. package/hub/team/cli/commands/start/start-mux.mjs +2 -4
  15. package/hub/team/cli/services/state-store.mjs +5 -20
  16. package/hub/team/headless.mjs +96 -543
  17. package/hub/team/psmux.mjs +3 -33
  18. package/hub/team/session-context.mjs +1 -1
  19. package/hub/team/tui-viewer.mjs +9 -56
  20. package/hub/team/tui.mjs +0 -37
  21. package/hub/team/uds-orchestrator.mjs +2 -580
  22. package/hub/workers/factory.mjs +6 -51
  23. package/hub/workers/interface.mjs +1 -7
  24. package/hub/workers/lib/jsonrpc-core.mjs +11 -0
  25. package/hub/workers/lib/jsonrpc-ws-uds.mjs +5 -6
  26. package/package.json +3 -8
  27. package/scripts/lib/agent-route-policy.mjs +0 -67
  28. package/scripts/lib/cli-claude.mjs +0 -12
  29. package/scripts/lib/env-probe.mjs +0 -70
  30. package/scripts/lib/legacy-mcp-cleanup.mjs +283 -0
  31. package/scripts/lib/mcp-guard-engine.mjs +40 -98
  32. package/hub/hub-lifecycle.mjs +0 -248
  33. package/hub/pipe.mjs +0 -825
  34. package/hub/promote-penalties.mjs +0 -138
  35. package/hub/public/dashboard.html +0 -416
  36. package/hub/schema.sql +0 -209
  37. package/hub/server.mjs +0 -3048
  38. package/hub/store-adapter.mjs +0 -182
  39. package/hub/store.mjs +0 -1736
  40. package/hub/team/cli/services/hub-client.mjs +0 -178
  41. package/hub/team/conductor-registry.mjs +0 -121
  42. package/hub/team/cto-auto-collect.mjs +0 -115
  43. package/hub/team/lead-control.mjs +0 -191
  44. package/hub/team/session-sync.mjs +0 -316
  45. package/hub/team/swarm-intent.mjs +0 -18
  46. package/hub/team/synapse-cli.mjs +0 -458
  47. package/hub/team/synapse-http.mjs +0 -311
  48. package/hub/team/synapse-registry.mjs +0 -618
  49. package/hub/team/tui-synapse.mjs +0 -223
  50. package/hub/team/worker-sandbox.mjs +0 -125
  51. package/hub/tools.mjs +0 -900
  52. package/hub/workers/codex-app-server-worker.mjs +0 -1067
  53. package/hub/workers/delegator-mcp.mjs +0 -1098
  54. package/hub/workers/lib/jsonrpc-stdio.mjs +0 -204
  55. package/scripts/lib/claudemd-scanner.mjs +0 -26
  56. package/scripts/lib/context.mjs +0 -51
  57. package/scripts/lib/handoff.mjs +0 -187
  58. package/scripts/lib/logger.mjs +0 -122
  59. package/scripts/lib/stealth-fetch.mjs +0 -176
@@ -1,176 +0,0 @@
1
- #!/usr/bin/env node
2
- // SSRF boundary: stealthFetch only accepts http: and https: URLs. It does not
3
- // guard private IPs, metadata hosts such as 169.254.x.x, or localhost; callers
4
- // must treat the URL as already inside their trust boundary.
5
-
6
- import { pathToFileURL } from "node:url";
7
-
8
- export class CloakBrowserUnavailableError extends Error {}
9
-
10
- const DEFAULT_TIMEOUT_MS = 30_000;
11
- const DEFAULT_WAIT_UNTIL = "load";
12
- const SUPPORTED_PLATFORMS = new Set([
13
- "linux:x64",
14
- "linux:arm64",
15
- "darwin:x64",
16
- "darwin:arm64",
17
- "win32:x64",
18
- ]);
19
- const EXIT_CODES = {
20
- not_installed: 3,
21
- unsupported_platform: 4,
22
- runtime_error: 5,
23
- blocked_scheme: 6,
24
- };
25
-
26
- function isSupportedPlatform(platform, arch) {
27
- return SUPPORTED_PLATFORMS.has(`${platform}:${arch}`);
28
- }
29
-
30
- function isModuleNotFound(error) {
31
- return (
32
- error?.code === "ERR_MODULE_NOT_FOUND" || error?.code === "MODULE_NOT_FOUND"
33
- );
34
- }
35
-
36
- function htmlToText(html) {
37
- return String(html || "")
38
- .replace(/<script\b[^>]*>[\s\S]*?<\/script>/giu, " ")
39
- .replace(/<style\b[^>]*>[\s\S]*?<\/style>/giu, " ")
40
- .replace(/<[^>]+>/gu, " ")
41
- .replace(/&nbsp;/giu, " ")
42
- .replace(/&amp;/giu, "&")
43
- .replace(/&lt;/giu, "<")
44
- .replace(/&gt;/giu, ">")
45
- .replace(/&quot;/giu, '"')
46
- .replace(/&#39;/gu, "'")
47
- .replace(/\s+/gu, " ")
48
- .trim();
49
- }
50
-
51
- function responseStatus(response) {
52
- if (!response) return null;
53
- if (typeof response.status === "function") return response.status();
54
- return response.status ?? null;
55
- }
56
-
57
- function responseUrl(response, fallbackUrl) {
58
- if (!response) return fallbackUrl;
59
- if (typeof response.url === "function") return response.url();
60
- return response.url ?? fallbackUrl;
61
- }
62
-
63
- function parseAllowedFetchUrl(url) {
64
- let parsed;
65
- try {
66
- parsed = new URL(url);
67
- } catch {
68
- return { ok: false, scheme: null };
69
- }
70
- if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
71
- return { ok: false, scheme: parsed.protocol };
72
- }
73
- return { ok: true, href: parsed.href };
74
- }
75
-
76
- async function closeBrowser(browser) {
77
- if (!browser || typeof browser.close !== "function") return;
78
- try {
79
- await browser.close();
80
- } catch {
81
- // best effort: fetch callers only need the primary result signal
82
- }
83
- }
84
-
85
- export async function stealthFetch(url, opts = {}) {
86
- const timeoutMs = opts.timeoutMs ?? DEFAULT_TIMEOUT_MS;
87
- const waitUntil = opts.waitUntil ?? DEFAULT_WAIT_UNTIL;
88
- const loadCloakBrowser = opts._import ?? (() => import("cloakbrowser"));
89
- const platform = opts._platform ?? process.platform;
90
- const arch = opts._arch ?? process.arch;
91
-
92
- if (!isSupportedPlatform(platform, arch)) {
93
- return {
94
- ok: false,
95
- reason: "unsupported_platform",
96
- platform,
97
- arch,
98
- };
99
- }
100
-
101
- const parsedUrl = parseAllowedFetchUrl(url);
102
- if (!parsedUrl.ok) {
103
- return {
104
- ok: false,
105
- reason: "blocked_scheme",
106
- scheme: parsedUrl.scheme,
107
- };
108
- }
109
-
110
- let cloakbrowser;
111
- try {
112
- cloakbrowser = await loadCloakBrowser();
113
- } catch (error) {
114
- if (isModuleNotFound(error)) return { ok: false, reason: "not_installed" };
115
- return { ok: false, reason: "runtime_error", error: String(error) };
116
- }
117
-
118
- let browser;
119
- try {
120
- const launch = cloakbrowser?.launch;
121
- if (typeof launch !== "function") {
122
- throw new CloakBrowserUnavailableError("cloakbrowser launch unavailable");
123
- }
124
- browser = await launch();
125
- const page = await browser.newPage();
126
- const response = await page.goto(parsedUrl.href, {
127
- waitUntil,
128
- timeout: timeoutMs,
129
- });
130
- const html = await page.content();
131
- return {
132
- ok: true,
133
- engine: "cloakbrowser",
134
- url: parsedUrl.href,
135
- finalUrl: responseUrl(response, parsedUrl.href),
136
- status: responseStatus(response),
137
- html,
138
- text: htmlToText(html),
139
- };
140
- } catch (error) {
141
- return { ok: false, reason: "runtime_error", error: String(error) };
142
- } finally {
143
- await closeBrowser(browser);
144
- }
145
- }
146
-
147
- export function exitCodeFor(result) {
148
- return EXIT_CODES[result?.reason] ?? 5;
149
- }
150
-
151
- export async function main(argv = process.argv) {
152
- const url = argv[2];
153
- if (!url) {
154
- console.error("usage: stealth-fetch <url>");
155
- process.exitCode = 2;
156
- return;
157
- }
158
-
159
- const result = await stealthFetch(url);
160
- if (result.ok) {
161
- console.log(JSON.stringify(result));
162
- process.exitCode = 0;
163
- return;
164
- }
165
-
166
- console.error(`[stealth-fetch] 폴백: ${result.reason}`);
167
- console.log(JSON.stringify(result));
168
- process.exitCode = exitCodeFor(result);
169
- }
170
-
171
- if (
172
- process.argv[1] &&
173
- import.meta.url === pathToFileURL(process.argv[1]).href
174
- ) {
175
- await main();
176
- }