turno-cli 0.1.1 → 0.3.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 (121) hide show
  1. package/CHANGELOG.md +432 -0
  2. package/README.md +228 -73
  3. package/dist/accounts/audit.js +154 -12
  4. package/dist/accounts/builtin.js +100 -25
  5. package/dist/accounts/delegate.js +199 -35
  6. package/dist/accounts/policy.js +79 -0
  7. package/dist/accounts/registry.js +39 -21
  8. package/dist/agents/adapter.js +29 -0
  9. package/dist/agents/claude.js +246 -0
  10. package/dist/agents/codex.js +186 -0
  11. package/dist/agents/copilot.js +56 -0
  12. package/dist/agents/cursor.js +58 -0
  13. package/dist/agents/index.js +26 -86
  14. package/dist/agents/snippets.js +43 -13
  15. package/dist/cli/args.js +38 -6
  16. package/dist/cli/commands/accounts.js +119 -52
  17. package/dist/cli/commands/auto.js +121 -33
  18. package/dist/cli/commands/browser-identity.js +514 -0
  19. package/dist/cli/commands/browser-session.js +102 -0
  20. package/dist/cli/commands/browser-vault.js +193 -0
  21. package/dist/cli/commands/browser.js +319 -138
  22. package/dist/cli/commands/complete.js +14 -3
  23. package/dist/cli/commands/completion.js +8 -2
  24. package/dist/cli/commands/config.js +186 -24
  25. package/dist/cli/commands/demo.js +321 -0
  26. package/dist/cli/commands/doctor.js +525 -123
  27. package/dist/cli/commands/handoff.js +33 -22
  28. package/dist/cli/commands/identity.js +192 -54
  29. package/dist/cli/commands/init.js +648 -0
  30. package/dist/cli/commands/limit.js +84 -16
  31. package/dist/cli/commands/mcp-call.js +240 -0
  32. package/dist/cli/commands/mcp-oauth.js +221 -0
  33. package/dist/cli/commands/mcp-observe.js +539 -0
  34. package/dist/cli/commands/mcp-share.js +201 -0
  35. package/dist/cli/commands/mcp.js +816 -187
  36. package/dist/cli/commands/mcpd.js +388 -76
  37. package/dist/cli/commands/migrate.js +6 -4
  38. package/dist/cli/commands/open.js +115 -27
  39. package/dist/cli/commands/profile.js +396 -78
  40. package/dist/cli/commands/resolve.js +14 -3
  41. package/dist/cli/commands/run.js +36 -6
  42. package/dist/cli/commands/secret.js +80 -76
  43. package/dist/cli/commands/session.js +17 -6
  44. package/dist/cli/commands/sessions.js +48 -12
  45. package/dist/cli/commands/setup.js +214 -164
  46. package/dist/cli/commands/status.js +227 -44
  47. package/dist/cli/commands/statusline.js +311 -114
  48. package/dist/cli/commands/ui.js +78 -68
  49. package/dist/cli/commands/undo.js +193 -18
  50. package/dist/cli/commands/uninstall.js +481 -0
  51. package/dist/cli/commands/upgrade.js +172 -79
  52. package/dist/cli/commands/usage.js +125 -51
  53. package/dist/cli/commands/version.js +21 -7
  54. package/dist/cli/commands/which.js +9 -24
  55. package/dist/cli/compile-cache.js +32 -0
  56. package/dist/cli/diagnostics.js +184 -0
  57. package/dist/cli/exit.js +65 -0
  58. package/dist/cli/group.js +24 -12
  59. package/dist/cli/help.js +62 -0
  60. package/dist/cli/highlight.js +236 -0
  61. package/dist/cli/hints.js +30 -0
  62. package/dist/cli/io.js +186 -1
  63. package/dist/cli/launch.js +52 -39
  64. package/dist/cli/launchers.js +161 -95
  65. package/dist/cli/main.js +201 -31
  66. package/dist/cli/optional.js +144 -0
  67. package/dist/cli/output.js +123 -0
  68. package/dist/cli/picker.js +459 -0
  69. package/dist/cli/registry.js +61 -6
  70. package/dist/cli/safe.js +87 -0
  71. package/dist/cli/secret-input.js +63 -0
  72. package/dist/cli/security.js +561 -0
  73. package/dist/cli/style.js +311 -0
  74. package/dist/cli/topics.js +142 -0
  75. package/dist/core/config.js +181 -23
  76. package/dist/core/exhausted.js +6 -8
  77. package/dist/core/fsutil.js +39 -0
  78. package/dist/core/journal.js +294 -16
  79. package/dist/core/manifest.js +153 -6
  80. package/dist/core/paths.js +14 -13
  81. package/dist/core/profiles.js +160 -10
  82. package/dist/core/resolve.js +139 -23
  83. package/dist/core/secrets.js +68 -23
  84. package/dist/core/sessions.js +13 -20
  85. package/dist/core/state-file.js +107 -0
  86. package/dist/core/update.js +31 -18
  87. package/dist/core/version.js +57 -10
  88. package/dist/demo/server.js +42 -0
  89. package/dist/mcpd/cache.js +23 -10
  90. package/dist/mcpd/calllog.js +254 -0
  91. package/dist/mcpd/client-names.js +46 -0
  92. package/dist/mcpd/connectors.js +188 -18
  93. package/dist/mcpd/daemon.js +472 -115
  94. package/dist/mcpd/folder-sets.js +42 -0
  95. package/dist/mcpd/gateway.js +473 -51
  96. package/dist/mcpd/health.js +313 -0
  97. package/dist/mcpd/importer.js +453 -36
  98. package/dist/mcpd/instances.js +453 -65
  99. package/dist/mcpd/jsonrpc.js +11 -1
  100. package/dist/mcpd/launchd.js +65 -48
  101. package/dist/mcpd/middleware.js +144 -0
  102. package/dist/mcpd/modern.js +686 -0
  103. package/dist/mcpd/oauth.js +845 -0
  104. package/dist/mcpd/peerpid.js +134 -6
  105. package/dist/mcpd/pressure.js +88 -0
  106. package/dist/mcpd/rss.js +166 -0
  107. package/dist/mcpd/service.js +191 -0
  108. package/dist/mcpd/share.js +217 -0
  109. package/dist/mcpd/state.js +183 -0
  110. package/dist/mcpd/sync.js +72 -87
  111. package/dist/mcpd/systemd.js +83 -0
  112. package/dist/mcpd/tokens.js +85 -0
  113. package/dist/mcpd/upstream.js +163 -46
  114. package/dist/statusline/cost.js +167 -44
  115. package/dist/statusline/input.js +78 -0
  116. package/dist/statusline/render.js +9 -3
  117. package/dist/ui/fonts.js +8 -3
  118. package/dist/ui/settings.js +33 -16
  119. package/npm-shrinkwrap.json +1102 -0
  120. package/package.json +10 -9
  121. package/dist/cli/commands/available.js +0 -18
@@ -1,42 +1,108 @@
1
+ import { existsSync } from "node:fs";
1
2
  import { join } from "node:path";
3
+ import { loadManifest } from "../../core/manifest.js";
2
4
  import { migrationPending } from "../../core/config-edit.js";
3
5
  import { loadConfig } from "../../core/config.js";
4
6
  import { paths, tildify } from "../../core/paths.js";
5
- import { resolveProfile } from "../../core/resolve.js";
6
7
  import { availableUpdate } from "../../core/update.js";
7
8
  import { packageInfo } from "../../core/version.js";
8
9
  import { FALLBACK, checkFonts, userFontDir } from "../../ui/fonts.js";
9
- import { currentStatusLine, isTurnoStatusLine } from "../../ui/settings.js";
10
+ import { currentStatusLine, isTurnoStatusLine, statusLineLabel } from "../../ui/settings.js";
10
11
  import { currentTerminal, nerdHere } from "../../ui/terminal-id.js";
11
- import { JSON_FLAG, bool, parseFlags, printJson } from "../args.js";
12
- import { paint } from "../io.js";
12
+ import { JSON_FLAG, bool, parseFlags } from "../args.js";
13
+ import { emit, jsonOutput } from "../output.js";
14
+ import { plural } from "../io.js";
15
+ import { profileColor, style, visibleWidth } from "../style.js";
13
16
  import { mcpdStatus } from "./doctor.js";
14
- import { adapter } from "../../agents/index.js";
17
+ import { DEFAULT_AGENT, adapter } from "../../agents/index.js";
15
18
  import { limitsData } from "./limit.js";
16
- import { profilesData } from "./profile.js";
19
+ import { NO_DEFAULT_ACCOUNT, profilesData, resolveAll, usingText } from "./profile.js";
17
20
  import { sessionsData } from "./session.js";
18
- import { bar, shortTime } from "./usage.js";
19
- export function accountLine(s) {
20
- if (!s?.loggedIn)
21
- return undefined;
22
- const parts = [s.email, s.orgName, s.subscriptionType].filter((v) => Boolean(v)).map(String);
23
- return parts.length ? parts.join(" · ") : (s.authMethod ?? "logged in");
21
+ import { shortTime } from "./usage.js";
22
+ /** Servers in mcp.toml, or 0 when it is missing or unreadable (turno mcp list shows why). */
23
+ function manifestServers(env) {
24
+ if (!existsSync(paths(env).mcpFile))
25
+ return 0;
26
+ try {
27
+ return Object.keys(loadManifest(env).servers).length;
28
+ }
29
+ catch {
30
+ return 0;
31
+ }
32
+ }
33
+ /** Profiles whose agent config does not point at the gateway yet, from a silent `mcp sync --dry-run`. */
34
+ async function syncPending(env) {
35
+ try {
36
+ const { syncProfiles } = await import("./mcp.js");
37
+ const quiet = { env, isTty: false, out: () => { }, err: () => { } };
38
+ return (await syncProfiles(quiet, { dryRun: true })).changed;
39
+ }
40
+ catch {
41
+ return 0;
42
+ }
43
+ }
44
+ /** First thing that keeps this machine from working fully, in the order a person would fix it. */
45
+ async function nextStep(env, d) {
46
+ if (d.migrationPending)
47
+ return { command: "turno migrate", why: "the bash claudio config is not moved to turno yet" };
48
+ if (!d.profiles.length)
49
+ return { command: "turno init", why: "no profiles yet; init finds your agents, folders and MCP servers" };
50
+ const notSetUp = d.profiles.find((x) => !x.setUp);
51
+ if (notSetUp)
52
+ return {
53
+ command: `turno profile repair ${notSetUp.name}`,
54
+ why: `profile ${notSetUp.name} has no folder or launcher yet`,
55
+ };
56
+ const servers = manifestServers(env);
57
+ if (servers && !d.mcpd.running)
58
+ return {
59
+ command: "turno mcp daemon start",
60
+ why: `mcp.toml has ${plural(servers, "server")} and the gateway is not running`,
61
+ };
62
+ if (servers) {
63
+ const pending = await syncPending(env);
64
+ if (pending)
65
+ return { command: "turno mcp sync", why: `${plural(pending, "agent config")} do not point at the gateway yet` };
66
+ }
67
+ if (d.update)
68
+ return { command: "turno upgrade", why: `turno ${d.update} is available` };
69
+ if (d.look.statusLine !== "turno")
70
+ return { command: "turno ui install", why: "optional: the status line with account, usage and gateway" };
71
+ return null;
24
72
  }
25
73
  /** Everything `turno status` shows, as data. */
26
74
  export async function statusData(env, cwd = process.cwd()) {
75
+ const base = await statusBase(env, cwd);
76
+ return { ...base, next: await nextStep(env, base) };
77
+ }
78
+ async function statusBase(env, cwd) {
27
79
  const config = loadConfig(env);
28
- const [profiles, limits, mcpd] = await Promise.all([profilesData(env, config), limitsData(env, false), mcpdStatus(env, config)]);
29
- const here = resolveProfile(cwd, config, env);
80
+ const [profiles, limits, mcpd] = await Promise.all([
81
+ profilesData(env, config),
82
+ limitsData(env, false),
83
+ mcpdStatus(env, config),
84
+ ]);
85
+ const all = resolveAll(cwd, config, env);
86
+ const here = all[0].r;
30
87
  const sessions = sessionsData(env);
31
88
  const line = currentStatusLine(join(paths(env).hub, "settings.json"));
32
89
  const fontDir = userFontDir(env);
33
90
  const fonts = fontDir ? checkFonts(FALLBACK, fontDir) : [];
34
91
  const terminal = currentTerminal(env);
92
+ // Why mcpd is down: the last start error (mcpd.error.json) and who holds its port.
93
+ const mcpdProblems = mcpd.running ? [] : await (await import("./mcpd.js")).downReasons(env).catch(() => []);
35
94
  return {
36
95
  version: packageInfo().version,
37
96
  update: availableUpdate(env) ?? null,
38
97
  migrationPending: migrationPending(env),
39
- here: { dir: tildify(cwd, env), assigned: here.assigned || null, chosen: here.chosen || null, reason: here.reason, note: here.note || null },
98
+ here: {
99
+ dir: tildify(cwd, env),
100
+ assigned: here.assigned || null,
101
+ chosen: here.chosen || null,
102
+ reason: here.reason,
103
+ note: here.note || null,
104
+ agents: Object.fromEntries(all.map(({ agent, r }) => [agent, { chosen: r.chosen || null, text: usingText(agent, r, env, config) }])),
105
+ },
40
106
  profiles: profiles.map((p) => {
41
107
  const l = limits.find((x) => x.profile === p.name);
42
108
  return { ...p, fiveHour: l?.fiveHour ?? null, week: l?.week ?? null };
@@ -45,10 +111,11 @@ export async function statusData(env, cwd = process.cwd()) {
45
111
  total: sessions.length,
46
112
  byProfile: sessions.reduce((acc, s) => {
47
113
  const key = s.profile ?? (s.source === "desktop" ? "desktop" : "unknown");
48
- return { ...acc, [key]: (acc[key] ?? 0) + 1 };
114
+ acc[key] = (acc[key] ?? 0) + 1;
115
+ return acc;
49
116
  }, {}),
50
117
  },
51
- mcpd: { running: mcpd.running, port: mcpd.port },
118
+ mcpd: { running: mcpd.running, port: mcpd.port, problems: mcpdProblems },
52
119
  look: {
53
120
  statusLine: isTurnoStatusLine(line) ? "turno" : (line?.command ?? null),
54
121
  font: fonts.length > 0 && fonts.every((f) => f.state === "installed"),
@@ -57,45 +124,161 @@ export async function statusData(env, cwd = process.cwd()) {
57
124
  },
58
125
  };
59
126
  }
60
- function pct(w, now) {
61
- if (!w)
62
- return `${"-".padStart(7)}${" ".repeat(6)}`;
63
- const used = w.resetsAt && w.resetsAt < now ? 0 : w.used;
64
- return `${bar(used, 8)} ${used.toFixed(0).padStart(3)}%`;
127
+ /** "33m", "2h06m", "5d 18h": time left until a window resets. */
128
+ export function resetIn(resetsAt, now) {
129
+ if (!resetsAt || resetsAt <= now)
130
+ return "";
131
+ const d = Math.floor(resetsAt - now);
132
+ const h = Math.floor(d / 3600);
133
+ const m = Math.floor((d % 3600) / 60);
134
+ return h >= 24 ? `${Math.floor(h / 24)}d ${h % 24}h` : h ? `${h}h${String(m).padStart(2, "0")}m` : `${m}m`;
135
+ }
136
+ /** The status screen as lines: the same layout with colors on a terminal and as plain text. */
137
+ export function renderStatus(d, io, opts = {}) {
138
+ const now = opts.now ?? Date.now() / 1000;
139
+ const s = style(io, { nerd: d.look.icons === "nerd" });
140
+ const pill = (name) => s.profile(name, opts.colors ? profileColor(opts.colors, name) : undefined);
141
+ const out = [];
142
+ // system = "" leaves plain claude without an account: say so rather than "plain claude".
143
+ const plain = d.here.agents[DEFAULT_AGENT]?.text.startsWith(NO_DEFAULT_ACCOUNT)
144
+ ? s.warn("no profile")
145
+ : "plain claude";
146
+ const using = d.here.chosen ? pill(d.here.chosen) : plain;
147
+ out.push(s.wrap(`${s.bold(s.accent("turno"))} ${s.muted(d.version)} `, `${d.here.dir} ${s.icon("arrow")} ${using}`));
148
+ if (d.update)
149
+ out.push(s.warn(`${s.icon("info")} turno ${d.update} is available: turno upgrade`));
150
+ if (d.migrationPending)
151
+ out.push(s.warn(`${s.icon("warn")} the bash claudio config is not migrated yet: turno migrate`));
152
+ // Here: what each agent opens in this folder.
153
+ out.push("", s.header("Here"));
154
+ const why = d.here.note ? `${d.here.assigned} ${d.here.note}` : d.here.reason;
155
+ const here = [
156
+ [
157
+ s.muted(DEFAULT_AGENT),
158
+ d.here.chosen ? pill(d.here.chosen) : plain,
159
+ s.muted(plain === "plain claude" ? why : `${why}; system = "" (turno auto exits 3)`),
160
+ ],
161
+ ];
162
+ for (const [agent, a] of Object.entries(d.here.agents)) {
163
+ if (agent === DEFAULT_AGENT)
164
+ continue;
165
+ const m = /^(.*) \((.*)\)$/.exec(a.text);
166
+ here.push([s.muted(agent), a.chosen ? pill(a.chosen) : (m?.[1] ?? a.text), s.muted(m?.[2] ?? "")]);
167
+ }
168
+ out.push(...s.table(here, { columns: [{}, {}, { drop: 1 }] }));
169
+ // Profiles: usage of each account with its reset time, and who it is.
170
+ out.push("", s.header("Profiles"));
171
+ if (!d.profiles.length)
172
+ out.push(` none yet ${s.muted("(turno profile add <name>)")}`);
173
+ else {
174
+ const win = (w) => {
175
+ if (!w)
176
+ return [s.muted("-"), ""];
177
+ const used = w.resetsAt && w.resetsAt < now ? 0 : w.used;
178
+ return [s.bar(used, 8), s.muted(resetIn(w.resetsAt, now))];
179
+ };
180
+ const rows = [["", s.muted("5 hours"), "", s.muted("week"), "", s.muted("account")]];
181
+ for (const x of d.profiles) {
182
+ const who = !x.setUp
183
+ ? s.warn("not set up")
184
+ : !adapter(x.agent).accountDetails
185
+ ? adapter(x.agent).label
186
+ : x.email
187
+ ? x.email
188
+ : s.warn("not logged in");
189
+ const flags = [...x.roles, x.exhaustedUntil ? `exhausted until ${shortTime(x.exhaustedUntil)}` : ""]
190
+ .filter(Boolean)
191
+ .join(", ");
192
+ const usage = adapter(x.agent).accountDetails
193
+ ? [...win(x.fiveHour), ...win(x.week)]
194
+ : [s.muted("-"), "", s.muted("-"), ""];
195
+ rows.push([
196
+ pill(x.name),
197
+ ...usage,
198
+ `${who}${x.plan ? s.muted(` · ${x.plan}`) : ""}${flags ? s.muted(` ${flags}`) : ""}`,
199
+ ]);
200
+ }
201
+ out.push(...s.table(rows, { columns: [{}, {}, { drop: 3 }, {}, { drop: 4 }, {}] }));
202
+ }
203
+ // The machine: gateway, sessions and the look.
204
+ out.push("", s.header("Machine"));
205
+ const by = Object.entries(d.sessions.byProfile)
206
+ .map(([k, v]) => `${k} ${v}`)
207
+ .join(", ");
208
+ const gateway = d.mcpd.running
209
+ ? `${s.lead("on", "running")} ${s.muted(`on port ${d.mcpd.port}`)}`
210
+ : `${s.lead("off", s.warn("not running"))} ${s.muted("(turno mcp daemon start)")}`;
211
+ const lineText = d.look.statusLine === "turno"
212
+ ? "turno status line"
213
+ : d.look.statusLine
214
+ ? `status line ${statusLineLabel({ type: "command", command: d.look.statusLine }, io.env, 40)}`
215
+ : "no status line";
216
+ const look = [
217
+ lineText,
218
+ d.look.font ? "font installed" : `font missing ${s.muted("(turno ui install)")}`,
219
+ `${d.look.icons} icons here`,
220
+ ].join(s.muted(" · "));
221
+ out.push(s.kv("gateway", gateway, 8));
222
+ for (const problem of d.mcpd.problems)
223
+ out.push(s.wrap(` ${" ".repeat(8)} ${s.warn(s.icon("warn"))} `, s.warn(problem)));
224
+ out.push(s.kv("sessions", `${plural(d.sessions.total, "live session")}${by ? s.muted(` (${by})`) : ""}`, 8));
225
+ out.push(s.kv("look", look, 8));
226
+ out.push("", ...nextLines(s, d.next));
227
+ out.push("", s.muted("turno doctor checks each part; turno limit, session and profile show more."));
228
+ return out;
229
+ }
230
+ function nextLines(s, next) {
231
+ const label = s.lead("next", s.bold(s.accent("Next")));
232
+ if (!next)
233
+ return [`${label} ${s.ok("nothing to do: everything is set up")}`];
234
+ const pad = " ".repeat(visibleWidth(label) + 2);
235
+ return [s.wrap(`${label} `, s.bold(next.command)), s.wrap(pad, s.muted(next.why))];
65
236
  }
237
+ /** `turno status --json`. */
238
+ const STATUS_JSON = jsonOutput([
239
+ "version",
240
+ "update",
241
+ "migrationPending",
242
+ "here",
243
+ "profiles",
244
+ "sessions",
245
+ "mcpd",
246
+ "look",
247
+ "next",
248
+ ]);
66
249
  export const command = {
67
250
  summary: "one screen with everything: this folder, profiles and usage, sessions, mcpd and the look",
68
- usage: "Usage: turno status [--json]\n\nturno doctor checks each part in depth and can fix problems.",
251
+ usage: "Usage: turno status [--json]\n\nturno doctor checks each part in depth and can fix problems.\n\nExamples:\n $ turno status\n $ turno status --json=here,mcpd",
69
252
  flags: ["--json"],
253
+ json: STATUS_JSON,
70
254
  async run(args, io) {
71
255
  const p = parseFlags(args, JSON_FLAG, 0);
72
256
  const d = await statusData(io.env);
73
257
  if (bool(p, "json")) {
74
- printJson(io.out, d);
258
+ emit(io, p, STATUS_JSON, d);
75
259
  return 0;
76
260
  }
77
- const now = Date.now() / 1000;
78
- const dim = (s) => paint(io, s, "2");
79
- io.out(`${paint(io, `turno ${d.version}`, "1")}${d.update ? paint(io, ` (${d.update} available: turno upgrade)`, "33") : ""}`);
80
- if (d.migrationPending)
81
- io.out(paint(io, "the bash claudio config is not migrated yet: turno migrate", "33"));
82
- const using = d.here.chosen ?? "plain claude";
83
- io.out(`here ${d.here.dir} -> ${using}${d.here.note ? ` (${d.here.assigned} ${d.here.note})` : dim(` (${d.here.reason})`)}`);
84
- if (!d.profiles.length)
85
- io.out("profiles none yet (turno profile add <name>)");
86
- const w = Math.max(0, ...d.profiles.map((x) => x.name.length));
87
- for (const [i, x] of d.profiles.entries()) {
88
- const who = !x.setUp ? "not set up" : x.agent !== "claude" ? adapter(x.agent).label : (x.email ?? "not logged in");
89
- const flags = [...x.roles, x.exhaustedUntil ? `exhausted until ${shortTime(x.exhaustedUntil)}` : ""].filter(Boolean).join(", ");
90
- io.out(`${i === 0 ? "profiles " : " "}${x.name.padEnd(w)} 5h ${pct(x.fiveHour, now)} week ${pct(x.week, now)} ${who}${x.plan ? ` · ${x.plan}` : ""}${flags ? dim(` ${flags}`) : ""}`);
261
+ let profiles = {};
262
+ try {
263
+ profiles = loadConfig(io.env).profiles;
91
264
  }
92
- const by = Object.entries(d.sessions.byProfile).map(([k, v]) => `${k} ${v}`).join(", ");
93
- io.out(`sessions ${d.sessions.total} live${by ? ` (${by})` : ""}`);
94
- io.out(`mcpd ${d.mcpd.running ? `running on port ${d.mcpd.port}` : "not running (turno mcp daemon start)"}`);
95
- const lineText = d.look.statusLine === "turno" ? "turno status line" : d.look.statusLine ? `status line \`${d.look.statusLine}\`` : "no status line";
96
- io.out(`look ${lineText}, ${d.look.font ? "font installed" : "font missing (turno ui install)"}, ${d.look.icons} icons here`);
97
- io.out(dim("\nturno doctor checks each part; turno limit, session and profile show more."));
265
+ catch {
266
+ /* statusData already read it */
267
+ }
268
+ for (const line of renderStatus(d, io, { colors: profiles }))
269
+ io.out(line);
98
270
  return 0;
99
271
  },
100
272
  };
273
+ /**
274
+ * What bare `turno` shows: this screen once turno is set up, the help before that (so a new
275
+ * person sees "Start here: turno init").
276
+ */
277
+ export async function homeScreen(io) {
278
+ const p = paths(io.env);
279
+ if (!existsSync(p.configFile) && !existsSync(p.mcpFile))
280
+ return undefined;
281
+ const code = await command.run([], io);
282
+ return code;
283
+ }
101
284
  //# sourceMappingURL=status.js.map