u-foo 2.3.24 → 2.3.25

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "u-foo",
3
- "version": "2.3.24",
3
+ "version": "2.3.25",
4
4
  "description": "Multi-Agent Workspace Protocol. Just add u. claude → uclaude, codex → ucodex.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "homepage": "https://ufoo.dev",
@@ -78,6 +78,14 @@ function collectHostLaunchRequestContext(env = process.env) {
78
78
  return context;
79
79
  }
80
80
 
81
+ function collectTerminalLaunchRequestContext(resolveTerminalApp = defaultResolveTerminalApp) {
82
+ const terminalApp = String(resolveTerminalApp() || "").trim().toLowerCase();
83
+ if (terminalApp === "terminal" || terminalApp === "iterm2") {
84
+ return { terminal_app: terminalApp };
85
+ }
86
+ return {};
87
+ }
88
+
81
89
  async function withCapturedConsole(capture, fn) {
82
90
  const originalLog = console.log;
83
91
  const originalError = console.error;
@@ -551,11 +559,8 @@ function createCommandExecutor(options = {}) {
551
559
  prompt_profile: promptProfile,
552
560
  launch_scope: launchScope,
553
561
  ...collectHostLaunchRequestContext(),
562
+ ...collectTerminalLaunchRequestContext(resolveTerminalApp),
554
563
  };
555
- const terminalApp = String(resolveTerminalApp() || "").trim().toLowerCase();
556
- if (terminalApp === "terminal" || terminalApp === "iterm2") {
557
- request.terminal_app = terminalApp;
558
- }
559
564
  send(request);
560
565
  schedule(requestStatus, 1000);
561
566
  } catch (err) {
@@ -696,6 +701,7 @@ function createCommandExecutor(options = {}) {
696
701
  prompt_profile: profile,
697
702
  launch_scope: launchScope,
698
703
  ...collectHostLaunchRequestContext(),
704
+ ...collectTerminalLaunchRequestContext(resolveTerminalApp),
699
705
  });
700
706
  schedule(requestStatus, 1000);
701
707
  } catch (err) {
@@ -1106,6 +1112,7 @@ function createCommandExecutor(options = {}) {
1106
1112
  instance,
1107
1113
  dry_run: dryRun,
1108
1114
  ...collectHostLaunchRequestContext(),
1115
+ ...collectTerminalLaunchRequestContext(resolveTerminalApp),
1109
1116
  });
1110
1117
  schedule(requestStatus, 1000);
1111
1118
  return;
@@ -1638,4 +1645,5 @@ function createCommandExecutor(options = {}) {
1638
1645
  module.exports = {
1639
1646
  createCommandExecutor,
1640
1647
  collectHostLaunchRequestContext,
1648
+ collectTerminalLaunchRequestContext,
1641
1649
  };
@@ -242,11 +242,13 @@ function buildLaunchHostContext(params = {}) {
242
242
  const hostDaemonSock = asTrimmedString(params.host_daemon_sock || params.hostDaemonSock);
243
243
  const hostName = asTrimmedString(params.host_name || params.hostName);
244
244
  const hostSessionId = asTrimmedString(params.host_session_id || params.hostSessionId);
245
+ const terminalApp = asTrimmedString(params.terminal_app || params.terminalApp);
245
246
  const context = {};
246
247
  if (hostInjectSock) context.host_inject_sock = hostInjectSock;
247
248
  if (hostDaemonSock) context.host_daemon_sock = hostDaemonSock;
248
249
  if (hostName) context.host_name = hostName;
249
250
  if (hostSessionId) context.host_session_id = hostSessionId;
251
+ if (terminalApp) context.terminal_app = terminalApp;
250
252
  if (params.host_capabilities && typeof params.host_capabilities === "object") {
251
253
  context.host_capabilities = { ...params.host_capabilities };
252
254
  } else if (params.hostCapabilities && typeof params.hostCapabilities === "object") {
@@ -1753,6 +1753,7 @@ function startDaemon({ projectRoot, provider, model, resumeMode = "auto" }) {
1753
1753
  const hostDaemonSock = req.host_daemon_sock || req.hostDaemonSock || "";
1754
1754
  const hostName = req.host_name || req.hostName || "";
1755
1755
  const hostSessionId = req.host_session_id || req.hostSessionId || "";
1756
+ const terminalApp = req.terminal_app || req.terminalApp || "";
1756
1757
  const hostCapabilities =
1757
1758
  req.host_capabilities && typeof req.host_capabilities === "object"
1758
1759
  ? req.host_capabilities
@@ -1768,6 +1769,7 @@ function startDaemon({ projectRoot, provider, model, resumeMode = "auto" }) {
1768
1769
  host_daemon_sock: hostDaemonSock,
1769
1770
  host_name: hostName,
1770
1771
  host_session_id: hostSessionId,
1772
+ terminal_app: terminalApp,
1771
1773
  host_capabilities: hostCapabilities,
1772
1774
  });
1773
1775
  const ok = result && result.ok !== false;
package/src/daemon/ops.js CHANGED
@@ -152,14 +152,25 @@ function resolveHostLaunchContext(options = {}) {
152
152
  };
153
153
  }
154
154
 
155
+ function resolveNativeTerminalApp(options = {}) {
156
+ const explicit = normalizeTerminalAppPreference(options.terminalApp);
157
+ if (explicit) return explicit;
158
+
159
+ const termProgram = normalizeTerminalAppPreference(process.env.TERM_PROGRAM || "");
160
+ if (termProgram) return termProgram;
161
+ if (process.env.ITERM_SESSION_ID) return "iterm2";
162
+ return "";
163
+ }
164
+
155
165
  function resolveConfiguredLaunchMode(configuredMode = "", options = {}) {
156
166
  const mode = normalizeOptionalString(configuredMode);
157
167
  if (mode === "internal" || mode === "internal-pty" || mode === "tmux" || mode === "terminal" || mode === "host") {
158
168
  return mode;
159
169
  }
160
- const hostContext = resolveHostLaunchContext(options);
161
- if (hostContext.hostDaemonSock) return "host";
162
170
  if (process.env.TMUX_PANE) return "tmux";
171
+ const hostContext = resolveHostLaunchContext(options);
172
+ const nativeTerminalApp = resolveNativeTerminalApp(options);
173
+ if (hostContext.hostDaemonSock && !nativeTerminalApp) return "host";
163
174
  return "terminal";
164
175
  }
165
176
 
@@ -1303,4 +1314,14 @@ async function closeAgent(projectRoot, agentId) {
1303
1314
  };
1304
1315
  }
1305
1316
 
1306
- module.exports = { launchAgent, closeAgent, getRecoverableAgents, resumeAgents };
1317
+ module.exports = {
1318
+ launchAgent,
1319
+ closeAgent,
1320
+ getRecoverableAgents,
1321
+ resumeAgents,
1322
+ __private: {
1323
+ resolveConfiguredLaunchMode,
1324
+ resolveHostLaunchContext,
1325
+ resolveNativeTerminalApp,
1326
+ },
1327
+ };