u-foo 1.7.1 → 1.7.2

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": "1.7.1",
3
+ "version": "1.7.2",
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",
@@ -1,4 +1,4 @@
1
- const DEFAULT_MODE_OPTIONS = ["terminal", "tmux", "internal"];
1
+ const DEFAULT_MODE_OPTIONS = ["auto", "host", "terminal", "tmux", "internal"];
2
2
 
3
3
  function createDashboardKeyController(options = {}) {
4
4
  const {
@@ -468,7 +468,8 @@ function createDashboardKeyController(options = {}) {
468
468
  if (key.name === "down") {
469
469
  clearTargetAgent();
470
470
  state.dashboardView = "mode";
471
- state.selectedModeIndex = state.launchMode === "internal" ? 2 : (state.launchMode === "tmux" ? 1 : 0);
471
+ const launchModeIndex = modeOptions.indexOf(state.launchMode);
472
+ state.selectedModeIndex = launchModeIndex >= 0 ? launchModeIndex : 0;
472
473
  renderDashboardAndScreen();
473
474
  return true;
474
475
  }
@@ -1,6 +1,6 @@
1
1
  const { clampAgentWindowWithSelection } = require("./agentDirectory");
2
2
 
3
- const DEFAULT_MODE_OPTIONS = ["terminal", "tmux", "internal"];
3
+ const DEFAULT_MODE_OPTIONS = ["auto", "host", "terminal", "tmux", "internal"];
4
4
 
5
5
  function providerLabel(value) {
6
6
  if (value === "claude-cli") return "claude";
package/src/chat/index.js CHANGED
@@ -52,6 +52,8 @@ const {
52
52
  filterVisibleProjectRuntimes,
53
53
  } = require("./projectRuntimes");
54
54
 
55
+ const MODE_OPTIONS = ["auto", "host", "terminal", "tmux", "internal"];
56
+
55
57
  async function runChat(projectRoot, options = {}) {
56
58
  const globalMode = options && options.globalMode === true;
57
59
  const DASHBOARD_HEIGHT = globalMode ? 2 : 1;
@@ -673,7 +675,7 @@ async function runChat(projectRoot, options = {}) {
673
675
  let focusMode = "input"; // "input" or "dashboard"
674
676
  let dashboardView = "agents"; // "projects" | "agents" | "mode" | "provider" | "assistant" | "cron"
675
677
  let reportPendingTotal = 0;
676
- let selectedModeIndex = launchMode === "internal" ? 2 : (launchMode === "tmux" ? 1 : 0);
678
+ let selectedModeIndex = Math.max(0, MODE_OPTIONS.indexOf(launchMode));
677
679
  const providerOptions = [
678
680
  { label: "codex", value: "codex-cli" },
679
681
  { label: "claude", value: "claude-cli" },
@@ -1129,6 +1131,7 @@ async function runChat(projectRoot, options = {}) {
1129
1131
  },
1130
1132
  assistantOptions,
1131
1133
  providerOptions,
1134
+ modeOptions: MODE_OPTIONS,
1132
1135
  getAutoResume: () => autoResume,
1133
1136
  setAutoResumeState: (value) => {
1134
1137
  autoResume = value;
@@ -1187,6 +1190,7 @@ async function runChat(projectRoot, options = {}) {
1187
1190
  resumeOptions,
1188
1191
  pendingReports: reportPendingTotal,
1189
1192
  dashHints: DASH_HINTS,
1193
+ modeOptions: MODE_OPTIONS,
1190
1194
  });
1191
1195
  if (globalMode && (focusMode !== "dashboard" || dashboardView === "projects")) {
1192
1196
  projectListWindowStart = computed.windowStart;
@@ -1329,7 +1333,7 @@ async function runChat(projectRoot, options = {}) {
1329
1333
  agentListWindowStart = 0;
1330
1334
  clampAgentWindow();
1331
1335
  }
1332
- selectedModeIndex = launchMode === "internal" ? 2 : (launchMode === "tmux" ? 1 : 0);
1336
+ selectedModeIndex = Math.max(0, MODE_OPTIONS.indexOf(launchMode));
1333
1337
  selectedProviderIndex = Math.max(0, providerOptions.findIndex((opt) => opt.value === agentProvider));
1334
1338
  selectedAssistantIndex = Math.max(
1335
1339
  0,
@@ -1421,6 +1425,7 @@ async function runChat(projectRoot, options = {}) {
1421
1425
  setScreenGrabKeys: (value) => {
1422
1426
  screen.grabKeys = Boolean(value);
1423
1427
  },
1428
+ modeOptions: MODE_OPTIONS,
1424
1429
  });
1425
1430
 
1426
1431
  function handleDashboardKey(key) {
@@ -24,6 +24,7 @@ function createSettingsController(options = {}) {
24
24
  setSelectedAssistantIndex = () => {},
25
25
  assistantOptions = [],
26
26
  providerOptions = [],
27
+ modeOptions = [],
27
28
  getAutoResume = () => true,
28
29
  setAutoResumeState = () => {},
29
30
  setSelectedResumeIndex = () => {},
@@ -68,7 +69,8 @@ function createSettingsController(options = {}) {
68
69
  const next = normalizeLaunchMode(mode);
69
70
  if (next === getLaunchMode()) return false;
70
71
  setLaunchModeState(next);
71
- setSelectedModeIndex(next === "internal" ? 2 : (next === "tmux" ? 1 : 0));
72
+ const nextIndex = modeOptions.findIndex((opt) => opt === next);
73
+ setSelectedModeIndex(nextIndex >= 0 ? nextIndex : 0);
72
74
  saveConfig(projectRoot, { launchMode: next });
73
75
  logMessage("status", `{white-fg}⚙{/white-fg} Launch mode: ${next}`);
74
76
  renderDashboard();
package/src/init/index.js CHANGED
@@ -90,16 +90,17 @@ class UfooInit {
90
90
  fs.mkdirSync(ufooDir, { recursive: true });
91
91
  }
92
92
 
93
- // 创建 docs 符号链接
93
+ // 创建 docs 符号链接:项目的 docs/ -> .ufoo/docs
94
94
  const docsLink = path.join(ufooDir, "docs");
95
- const docsTarget = path.join(this.repoRoot, "docs");
95
+ const projectDocs = path.join(project, "docs");
96
96
 
97
- if (fs.existsSync(docsTarget)) {
98
- if (fs.existsSync(docsLink)) {
97
+ if (fs.existsSync(projectDocs)) {
98
+ const linkStat = this.safeLstat(docsLink);
99
+ if (linkStat) {
99
100
  fs.unlinkSync(docsLink);
100
101
  }
101
- fs.symlinkSync(docsTarget, docsLink);
102
- console.log(`[core] Created docs symlink: .ufoo/docs -> ${docsTarget}`);
102
+ fs.symlinkSync(projectDocs, docsLink);
103
+ console.log(`[core] Created docs symlink: .ufoo/docs -> docs/`);
103
104
  }
104
105
 
105
106
  console.log("[core] Done");