@rikaidev/yomi 0.6.2 → 0.6.5

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.
@@ -0,0 +1,333 @@
1
+ /**
2
+ * Yomi MCP Shared Daemon.
3
+ *
4
+ * Runs a single, persistent Yomi instance (holding one LINE session, one
5
+ * Transformers embedding model, and one SQLite search index) as a background
6
+ * daemon. Multiple AI clients (OpenCode, Minimax, Claude Code, Cursor, Agy)
7
+ * share this daemon via HTTP/SSE or transparent stdio proxies, eliminating
8
+ * redundant processes, memory duplication, and session race conditions.
9
+ */
10
+ import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync, } from 'node:fs';
11
+ import { createServer } from 'node:http';
12
+ import { dirname } from 'node:path';
13
+ import { Readable } from 'node:stream';
14
+ import { createMcpHandler, ReadBuffer, serializeMessage, } from '@modelcontextprotocol/server';
15
+ import { LineProtocolService } from '../line/core/service.js';
16
+ import { startCapture } from '../search/capture.js';
17
+ import { getDefaultEmbedder } from '../search/default-embedder.js';
18
+ import { yomiDataPath } from '../util/data-dir.js';
19
+ import { createCliLogger } from '../util/log.js';
20
+ import { checkForUpdate } from '../util/update-check.js';
21
+ import { YOMI_VERSION } from '../version.js';
22
+ import { NO_CREDENTIALS_MESSAGE } from './handlers/index.js';
23
+ import { buildInstructions, createBuildServer } from './server.js';
24
+ const log = createCliLogger('YomiDaemon');
25
+ export const DEFAULT_DAEMON_PORT = 3333;
26
+ export const DEFAULT_DAEMON_HOST = '127.0.0.1';
27
+ export function daemonInfoPath() {
28
+ return yomiDataPath('daemon.json');
29
+ }
30
+ export function readDaemonInfo() {
31
+ const file = daemonInfoPath();
32
+ if (!existsSync(file)) {
33
+ return null;
34
+ }
35
+ try {
36
+ const raw = readFileSync(file, 'utf8');
37
+ const data = JSON.parse(raw);
38
+ if (!data.pid || !data.port) {
39
+ return null;
40
+ }
41
+ // Verify whether the process is actually alive
42
+ try {
43
+ process.kill(data.pid, 0);
44
+ return data;
45
+ }
46
+ catch {
47
+ // Process is dead, clean up stale state file
48
+ try {
49
+ rmSync(file);
50
+ }
51
+ catch { }
52
+ return null;
53
+ }
54
+ }
55
+ catch {
56
+ return null;
57
+ }
58
+ }
59
+ export async function isDaemonHealthy(info) {
60
+ try {
61
+ const controller = new AbortController();
62
+ const timer = setTimeout(() => controller.abort(), 3000);
63
+ const res = await fetch(`http://${info.host}:${info.port}/health`, {
64
+ signal: controller.signal,
65
+ });
66
+ clearTimeout(timer);
67
+ if (!res.ok) {
68
+ return false;
69
+ }
70
+ const json = (await res.json());
71
+ return json?.ok === true;
72
+ }
73
+ catch {
74
+ return false;
75
+ }
76
+ }
77
+ export async function getRunningDaemon() {
78
+ const info = readDaemonInfo();
79
+ if (!info) {
80
+ return null;
81
+ }
82
+ const healthy = await isDaemonHealthy(info);
83
+ if (healthy) {
84
+ return info;
85
+ }
86
+ // Check if PID is still alive. If alive, do NOT delete daemon.json (avoid competing instances)
87
+ try {
88
+ process.kill(info.pid, 0);
89
+ return info;
90
+ }
91
+ catch {
92
+ try {
93
+ rmSync(daemonInfoPath());
94
+ }
95
+ catch { }
96
+ return null;
97
+ }
98
+ }
99
+ export async function startDaemonServer(options = {}) {
100
+ const host = options.host ?? DEFAULT_DAEMON_HOST;
101
+ const requestedPort = options.port ??
102
+ (process.env.YOMI_PORT
103
+ ? parseInt(process.env.YOMI_PORT, 10)
104
+ : DEFAULT_DAEMON_PORT);
105
+ const service = options.service ?? new LineProtocolService();
106
+ service.on('error', (error) => log.warn('service.error', { error: error?.message ?? String(error) }));
107
+ const resumed = await service.resumeSession();
108
+ if (!resumed) {
109
+ log.warn('session.resume_failed', { message: NO_CREDENTIALS_MESSAGE });
110
+ }
111
+ else {
112
+ log.info('session.resumed', { mid: service.profile?.mid ?? null });
113
+ startCapture(service, getDefaultEmbedder()).catch((error) => {
114
+ log.error('capture.start_failed', {
115
+ error: error?.message ?? String(error),
116
+ });
117
+ });
118
+ }
119
+ const updateNotice = await checkForUpdate();
120
+ if (updateNotice) {
121
+ log.info('update.available', { current: YOMI_VERSION });
122
+ }
123
+ const instructions = buildInstructions(updateNotice);
124
+ const buildServer = createBuildServer(service, instructions);
125
+ const mcpHandler = createMcpHandler(buildServer, {
126
+ legacy: 'stateless',
127
+ onerror: (error) => log.error('server.protocol_error', {
128
+ error: error?.message ?? String(error),
129
+ }),
130
+ });
131
+ const server = createServer(async (req, res) => {
132
+ // Health and status endpoint
133
+ if (req.url === '/health' || req.url === '/status') {
134
+ res.writeHead(200, { 'content-type': 'application/json' });
135
+ res.end(JSON.stringify({
136
+ ok: true,
137
+ version: YOMI_VERSION,
138
+ pid: process.pid,
139
+ uptime: process.uptime(),
140
+ session: service.profile ? { mid: service.profile.mid } : null,
141
+ loginRequired: service.loginRequired ?? false,
142
+ }));
143
+ return;
144
+ }
145
+ // Modern / Streamable HTTP & Legacy MCP endpoint
146
+ const url = `http://${req.headers.host || `${host}:${requestedPort}`}${req.url}`;
147
+ const headers = new Headers();
148
+ for (const [k, v] of Object.entries(req.headers)) {
149
+ if (v) {
150
+ headers.set(k, Array.isArray(v) ? v.join(', ') : v);
151
+ }
152
+ }
153
+ // Ensure Accept header includes text/event-stream for MCP spec compliance
154
+ const accept = headers.get('accept');
155
+ if (!accept) {
156
+ headers.set('accept', 'application/json, text/event-stream');
157
+ }
158
+ else if (!accept.includes('text/event-stream')) {
159
+ headers.set('accept', `${accept}, text/event-stream`);
160
+ }
161
+ const body = req.method === 'GET' || req.method === 'HEAD'
162
+ ? undefined
163
+ : Readable.toWeb(req);
164
+ const webReq = new Request(url, {
165
+ method: req.method,
166
+ headers,
167
+ body,
168
+ duplex: 'half',
169
+ });
170
+ try {
171
+ const webRes = await mcpHandler.fetch(webReq);
172
+ res.writeHead(webRes.status, Object.fromEntries(webRes.headers.entries()));
173
+ if (webRes.body) {
174
+ const reader = webRes.body.getReader();
175
+ while (true) {
176
+ const { done, value } = await reader.read();
177
+ if (done)
178
+ break;
179
+ res.write(value);
180
+ }
181
+ }
182
+ res.end();
183
+ }
184
+ catch (error) {
185
+ res.writeHead(500, { 'content-type': 'application/json' });
186
+ res.end(JSON.stringify({
187
+ jsonrpc: '2.0',
188
+ error: { code: -32603, message: error?.message ?? String(error) },
189
+ id: null,
190
+ }));
191
+ }
192
+ });
193
+ await new Promise((resolve, reject) => {
194
+ server.on('error', reject);
195
+ server.listen(requestedPort, host, () => resolve());
196
+ });
197
+ const addr = server.address();
198
+ const actualPort = typeof addr === 'object' && addr ? addr.port : requestedPort;
199
+ const info = {
200
+ pid: process.pid,
201
+ port: actualPort,
202
+ host,
203
+ startedAt: new Date().toISOString(),
204
+ version: YOMI_VERSION,
205
+ };
206
+ try {
207
+ const file = daemonInfoPath();
208
+ const dir = dirname(file);
209
+ if (!existsSync(dir)) {
210
+ mkdirSync(dir, { recursive: true });
211
+ }
212
+ writeFileSync(file, JSON.stringify(info, null, 2), 'utf8');
213
+ }
214
+ catch (err) {
215
+ log.warn('daemon.info_write_failed', { error: err?.message ?? String(err) });
216
+ }
217
+ const cleanup = () => {
218
+ try {
219
+ rmSync(daemonInfoPath());
220
+ }
221
+ catch { }
222
+ try {
223
+ server.close();
224
+ }
225
+ catch { }
226
+ };
227
+ process.once('SIGTERM', cleanup);
228
+ process.once('SIGINT', cleanup);
229
+ process.once('exit', cleanup);
230
+ if (!options.quiet) {
231
+ log.info('daemon.started', { port: actualPort, host, pid: process.pid });
232
+ }
233
+ return { server, port: actualPort, info };
234
+ }
235
+ export async function stopDaemon() {
236
+ const info = readDaemonInfo();
237
+ if (!info) {
238
+ return { stopped: false };
239
+ }
240
+ try {
241
+ process.kill(info.pid, 'SIGTERM');
242
+ const start = Date.now();
243
+ while (Date.now() - start < 3000) {
244
+ await new Promise((r) => setTimeout(r, 100));
245
+ try {
246
+ process.kill(info.pid, 0);
247
+ }
248
+ catch {
249
+ try {
250
+ rmSync(daemonInfoPath());
251
+ }
252
+ catch { }
253
+ return { stopped: true, pid: info.pid };
254
+ }
255
+ }
256
+ // Force kill if graceful exit timed out
257
+ process.kill(info.pid, 'SIGKILL');
258
+ try {
259
+ rmSync(daemonInfoPath());
260
+ }
261
+ catch { }
262
+ return { stopped: true, pid: info.pid };
263
+ }
264
+ catch {
265
+ try {
266
+ rmSync(daemonInfoPath());
267
+ }
268
+ catch { }
269
+ return { stopped: false };
270
+ }
271
+ }
272
+ export async function proxyStdioToDaemon(info) {
273
+ const daemonUrl = `http://${info.host}:${info.port}/mcp`;
274
+ const readBuffer = new ReadBuffer();
275
+ process.stdin.on('data', (chunk) => {
276
+ readBuffer.append(chunk);
277
+ while (true) {
278
+ let message;
279
+ try {
280
+ message = readBuffer.readMessage();
281
+ }
282
+ catch (err) {
283
+ log.error('proxy.buffer_error', { error: err?.message ?? String(err) });
284
+ break;
285
+ }
286
+ if (!message)
287
+ break;
288
+ const body = serializeMessage(message);
289
+ fetch(daemonUrl, {
290
+ method: 'POST',
291
+ headers: {
292
+ 'content-type': 'application/json',
293
+ accept: 'application/json, text/event-stream',
294
+ },
295
+ body,
296
+ })
297
+ .then(async (res) => {
298
+ const text = await res.text();
299
+ const lines = text.split('\n');
300
+ let handled = false;
301
+ for (const line of lines) {
302
+ if (line.startsWith('data: ')) {
303
+ const data = line.slice(6).trim();
304
+ if (data) {
305
+ process.stdout.write(`${data}\n`);
306
+ handled = true;
307
+ }
308
+ }
309
+ }
310
+ if (!handled && text.trim()) {
311
+ process.stdout.write(`${text.trim()}\n`);
312
+ }
313
+ })
314
+ .catch((error) => {
315
+ if (message.id !== undefined && message.id !== null) {
316
+ const errResp = {
317
+ jsonrpc: '2.0',
318
+ id: message.id,
319
+ error: {
320
+ code: -32000,
321
+ message: `Failed to forward request to Yomi daemon: ${error?.message ?? String(error)}`,
322
+ },
323
+ };
324
+ process.stdout.write(`${JSON.stringify(errResp)}\n`);
325
+ }
326
+ });
327
+ }
328
+ });
329
+ await new Promise((resolve) => {
330
+ process.stdin.on('end', resolve);
331
+ process.stdin.on('close', resolve);
332
+ });
333
+ }
@@ -79,7 +79,7 @@ description: Manage and interact with user's LINE account via Yomi E2EE MCP Serv
79
79
 
80
80
  # Yomi LINE Copilot Skill
81
81
 
82
- You have real-time access to the user's LINE account through the Yomi Letter-Sealing E2EE server. Discover the current tools and complete a scoped read before claiming that access; the names below describe expected capabilities, not proof they are connected.
82
+ You have real-time access to the user's LINE account through the Yomi Letter-Sealing E2EE server. Check which of these tools your runtime actually exposes, and complete a scoped read before claiming that access; the names below describe expected capabilities, not proof they are connected.
83
83
 
84
84
  ## Reading
85
85
  1. \`list_conversations\`: List the chats the account can see.
@@ -95,10 +95,16 @@ You have real-time access to the user's LINE account through the Yomi Letter-Sea
95
95
  2. \`unsend_message\`: Recall a message the account sent.
96
96
 
97
97
  ## Operating the server
98
+ - The Yomi Model Context Protocol server is registered globally for the coding tools on this machine. Every tool keeps its own server list, so a tool that does not expose the names above is missing its own registration, not the server.
99
+ - When the names above are in your tool list, call them directly. Start the server yourself only when they are absent.
98
100
  - The Model Context Protocol server speaks stdio and lives only while its stdin stays open. A command that closes stdin ends the server, so keep the pipe open for as long as the session needs it.
99
101
  - The \`yomi messages\` CLI reports an empty list; only the Model Context Protocol tools above return real messages.
100
102
  - \`unsend_message\` is irreversible, and LINE accepts a recall only within one hour of sending. A recall past that window is refused by LINE itself, not by the tool.
101
103
 
104
+ ## Recovering message text
105
+ - A message can come back with no text while the conversation still holds it. The local search index keeps the plaintext, so look the same message id up in \`search-index.db\` in the Yomi data directory before you report a message as empty.
106
+ - An empty text field is not proof of a recall. A recall is an unsend you made yourself, and LINE refuses one outside the first hour.
107
+
102
108
  ## Guidelines
103
109
  - Summarize conversations concisely and highlight action items or mentions needing attention.
104
110
  - Drafting does not authorize sending. Require explicit sending authorization for the recipient and content; reuse that exact authorization when already given.
@@ -21,43 +21,8 @@ import { TOOLS } from './tools.js';
21
21
  import { LOGIN_UI_RESOURCE_CONTENTS, LOGIN_UI_RESOURCE_LISTING, LOGIN_UI_RESOURCE_URI, } from './ui/resource.js';
22
22
  import { toolsForClient } from './ui/tools-with-ui.js';
23
23
  const log = createCliLogger('Yomi');
24
- /**
25
- * Build and start the Yomi MCP server over stdio.
26
- */
27
- async function main() {
28
- const service = new LineProtocolService();
29
- // A Node EventEmitter with zero 'error' listeners turns any emit('error')
30
- // into an uncaught exception that kills this process (see pwless-login-flow.ts,
31
- // auth-session-service.ts). This listener must exist for the lifetime of the
32
- // service so a login/session error surfaces as a log line, not a crash — the
33
- // real failure still reaches callers through the normal throw/rejection path.
34
- service.on('error', (error) => log.warn('service.error', { error: error?.message ?? String(error) }));
35
- const resumed = await service.resumeSession();
36
- if (!resumed) {
37
- log.warn('session.resume_failed', { message: NO_CREDENTIALS_MESSAGE });
38
- }
39
- else {
40
- log.info('session.resumed', { mid: service.profile?.mid ?? null });
41
- startCapture(service, getDefaultEmbedder()).catch((error) => {
42
- log.error('capture.start_failed', {
43
- error: error?.message ?? String(error),
44
- });
45
- });
46
- }
47
- // Asked once per process, bounded, best-effort: a hand-installed .mcpb
48
- // bundle never auto-updates, so this notice is the only way a GUI-only user
49
- // learns a newer Yomi exists (see ../util/update-check.ts). Awaited here
50
- // because `instructions` is built once, before any client connects.
51
- const updateNotice = await checkForUpdate();
52
- if (updateNotice) {
53
- log.info('update.available', { current: YOMI_VERSION });
54
- }
55
- // `instructions` is surfaced by the MCP SDK to the client/model on
56
- // initialize — a "TOS on connect" privacy disclosure. It is a consent
57
- // notice, not decoration. A short model directive precedes the canonical
58
- // policy prose, which lives ONLY in PRIVACY.md (see ./policy.ts) so the
59
- // disclosure is single-sourced and never drifts from get_scope_policy.
60
- const instructions = (updateNotice ? `${updateNotice}\n\n` : '') +
24
+ export function buildInstructions(updateNotice) {
25
+ return ((updateNotice ? `${updateNotice}\n\n` : '') +
61
26
  'SESSION ERRORS — if a tool fails with a login-required or signed-out ' +
62
27
  'error, the MCP server and its connection are healthy: LINE revoked this ' +
63
28
  "device's session (usually because the same account logged in somewhere " +
@@ -82,8 +47,10 @@ async function main() {
82
47
  'is included below, so you do NOT need to call get_scope_policy just to recite the ' +
83
48
  'policy; call get_scope_policy only when the user asks to see the policy again or ' +
84
49
  'wants the current exclusion list. Policy follows:\n\n' +
85
- getPrivacyPolicyText();
86
- const buildServer = ({ era }) => {
50
+ getPrivacyPolicyText());
51
+ }
52
+ export function createBuildServer(service, instructions) {
53
+ return ({ era }) => {
87
54
  const server = new Server({ name: 'yomi', version: YOMI_VERSION }, {
88
55
  capabilities: { tools: {}, resources: {} },
89
56
  instructions,
@@ -258,6 +225,41 @@ async function main() {
258
225
  });
259
226
  return server;
260
227
  };
228
+ }
229
+ /**
230
+ * Build and start the Yomi MCP server over stdio.
231
+ */
232
+ async function main() {
233
+ // If a background daemon is running and standalone is not forced, proxy stdio to it!
234
+ if (process.env.YOMI_STANDALONE !== '1') {
235
+ const { getRunningDaemon, proxyStdioToDaemon } = await import('./daemon.js');
236
+ const daemon = await getRunningDaemon();
237
+ if (daemon) {
238
+ log.info('daemon.connected', { port: daemon.port, pid: daemon.pid });
239
+ await proxyStdioToDaemon(daemon);
240
+ return;
241
+ }
242
+ }
243
+ const service = new LineProtocolService();
244
+ service.on('error', (error) => log.warn('service.error', { error: error?.message ?? String(error) }));
245
+ const resumed = await service.resumeSession();
246
+ if (!resumed) {
247
+ log.warn('session.resume_failed', { message: NO_CREDENTIALS_MESSAGE });
248
+ }
249
+ else {
250
+ log.info('session.resumed', { mid: service.profile?.mid ?? null });
251
+ startCapture(service, getDefaultEmbedder()).catch((error) => {
252
+ log.error('capture.start_failed', {
253
+ error: error?.message ?? String(error),
254
+ });
255
+ });
256
+ }
257
+ const updateNotice = await checkForUpdate();
258
+ if (updateNotice) {
259
+ log.info('update.available', { current: YOMI_VERSION });
260
+ }
261
+ const instructions = buildInstructions(updateNotice);
262
+ const buildServer = createBuildServer(service, instructions);
261
263
  serveStdio(buildServer, {
262
264
  legacy: 'serve',
263
265
  onerror: (error) => log.error('server.protocol_error', { error: error.message }),
package/dist/version.js CHANGED
@@ -4,4 +4,4 @@
4
4
  * virtual filesystem). MUST stay equal to the "version" field in
5
5
  * package.json — the test in version.test.ts enforces that.
6
6
  */
7
- export const YOMI_VERSION = '0.6.2';
7
+ export const YOMI_VERSION = '0.6.5';
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "engines": {
4
4
  "node": ">=22.13.0 <23.0.0 || >=23.4.0"
5
5
  },
6
- "version": "0.6.2",
6
+ "version": "0.6.5",
7
7
  "description": "Open-source personal LINE MCP server for AI agents. Read, reply, send images, and search LINE conversations locally with Letter-Sealing E2EE.",
8
8
  "type": "module",
9
9
  "license": "MIT",
package/run.mjs CHANGED
@@ -433,14 +433,111 @@ switch (cmd) {
433
433
  case 'serve':
434
434
  await load('mcp/server');
435
435
  break;
436
+ case 'daemon': {
437
+ const subCmd = args[1] && !args[1].startsWith('-') ? args[1] : 'start';
438
+ const { startDaemonServer, stopDaemon, getRunningDaemon } = await load('mcp/daemon');
439
+
440
+ if (subCmd === 'status') {
441
+ const daemon = await getRunningDaemon();
442
+ if (!daemon) {
443
+ console.log(JSON.stringify({ running: false }));
444
+ } else {
445
+ console.log(JSON.stringify({ running: true, ...daemon }));
446
+ }
447
+ process.exit(0);
448
+ }
449
+
450
+ if (subCmd === 'stop') {
451
+ const res = await stopDaemon();
452
+ if (res.stopped) {
453
+ console.log(JSON.stringify({ stopped: true, pid: res.pid }));
454
+ } else {
455
+ console.log(JSON.stringify({ stopped: false, message: 'Daemon is not running' }));
456
+ }
457
+ process.exit(0);
458
+ }
459
+
460
+ if (subCmd === 'start' || subCmd === 'run') {
461
+ const isForeground = args.includes('--foreground') || args.includes('-f');
462
+ const portIdx = args.indexOf('--port');
463
+ const port = portIdx >= 0 && args[portIdx + 1] ? parseInt(args[portIdx + 1], 10) : undefined;
464
+
465
+ const existing = await getRunningDaemon();
466
+ if (existing) {
467
+ console.log(JSON.stringify({ started: false, message: 'Daemon already running', ...existing }));
468
+ process.exit(0);
469
+ }
470
+
471
+ if (isForeground) {
472
+ await startDaemonServer({ port });
473
+ break;
474
+ }
475
+
476
+ const { spawn } = await import('node:child_process');
477
+ const child = spawn(
478
+ process.execPath,
479
+ [process.argv[1], 'daemon', 'start', '--foreground', ...(port ? ['--port', String(port)] : [])],
480
+ {
481
+ detached: true,
482
+ stdio: 'ignore',
483
+ env: process.env,
484
+ },
485
+ );
486
+ child.unref();
487
+
488
+ let running = null;
489
+ for (let i = 0; i < 100; i++) {
490
+ await new Promise((r) => setTimeout(r, 100));
491
+ running = await getRunningDaemon();
492
+ if (running) break;
493
+ }
494
+
495
+ if (running) {
496
+ console.log(JSON.stringify({ started: true, ...running }));
497
+ process.exit(0);
498
+ } else {
499
+ console.error(JSON.stringify({ started: false, error: 'Daemon failed to initialize in background' }));
500
+ process.exit(1);
501
+ }
502
+ }
503
+
504
+ if (subCmd === 'restart') {
505
+ await stopDaemon();
506
+ await new Promise((r) => setTimeout(r, 500));
507
+ const { spawn } = await import('node:child_process');
508
+ const child = spawn(process.execPath, [process.argv[1], 'daemon', 'start', '--foreground'], {
509
+ detached: true,
510
+ stdio: 'ignore',
511
+ env: process.env,
512
+ });
513
+ child.unref();
514
+ let running = null;
515
+ for (let i = 0; i < 100; i++) {
516
+ await new Promise((r) => setTimeout(r, 100));
517
+ running = await getRunningDaemon();
518
+ if (running) break;
519
+ }
520
+ if (running) {
521
+ console.log(JSON.stringify({ restarted: true, ...running }));
522
+ process.exit(0);
523
+ } else {
524
+ console.error(JSON.stringify({ restarted: false, error: 'Daemon failed to restart' }));
525
+ process.exit(1);
526
+ }
527
+ }
528
+
529
+ console.error(`Unknown daemon command: ${subCmd}\nUsage: yomi daemon [start|stop|status|restart] [--foreground] [--port <number>]`);
530
+ process.exit(1);
531
+ }
436
532
  case 'help':
437
533
  case '--help':
438
534
  case '-h':
439
535
  console.log(`Yomi (読み) — read, reply, send images to, and search your LINE from any AI agent.
440
536
 
441
537
  Usage:
442
- yomi Start the MCP stdio server (default)
538
+ yomi Start the MCP stdio server (default, proxies to daemon if running)
443
539
  yomi serve Same as above, explicit
540
+ yomi daemon [...] Manage background persistent MCP daemon (start|stop|status|restart)
444
541
  yomi login [...] Run the passwordless login flow in a terminal
445
542
  yomi unsend <id> Retract (unsend) a message sent within the last hour
446
543
  yomi help Show this help
@@ -448,6 +545,9 @@ Usage:
448
545
 
449
546
  Examples:
450
547
  npx @rikaidev/yomi # start MCP server
548
+ npx @rikaidev/yomi daemon start # start persistent shared daemon
549
+ npx @rikaidev/yomi daemon status # check daemon status
550
+ npx @rikaidev/yomi daemon stop # stop background daemon
451
551
  npx @rikaidev/yomi login # interactive login
452
552
  npx @rikaidev/yomi login --phone +886912345678 --region TW`);
453
553
  break;