heyyumi 0.1.4 → 0.1.6

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/README.md CHANGED
@@ -6,11 +6,12 @@
6
6
 
7
7
  **Your AI finds and books real Korean restaurants, no Korean needed.**
8
8
 
9
- Ask your agent for *"bibimbap near Myeongdong"*, *"a place BTS's Jin goes to for naengmyeon"* or *"somewhere open for dinner in Hongdae where nobody minds that I don't speak Korean"*. HeyYumi answers from verified data on **546,000+ restaurants, cafes and bars across Korea**, and sends the table request to the restaurant itself. Within 5 minutes you know whether the table is yours.
9
+ Ask your agent for *"bibimbap near Myeongdong"*, *"a place BTS's Jin goes to for naengmyeon"* or *"somewhere open for dinner in Hongdae where nobody minds that I don't speak Korean"*. HeyYumi answers from verified data on **546,000+ restaurants, cafes and bars across Korea**, and sends the table request to the restaurant itself. Within 5 minutes you know whether the table is yours. It finds hair salons, nail, lash and waxing shops and skin care the same way: *"my hair has gotten long, should I get a cut today?"*
10
10
 
11
11
  ```bash
12
12
  npx -y heyyumi login # once: Google sign-in in the browser, a key is made for you
13
13
  npx -y heyyumi search bibimbap --region Myeongdong
14
+ npx -y heyyumi search --region Seongsu --business_category salon # hair salons; beauty = every beauty kind
14
15
  npx -y heyyumi reserve <placeId> --time "2026-10-25 19:00" --party 2 --phone +1-415-555-0100 --email you@example.com
15
16
  ```
16
17
 
@@ -96,6 +97,7 @@ npx -y heyyumi place <placeId> --fields all # menu, hours, attributes,
96
97
  - Each sign-in gets its own HeyYumi key on the user's account, so usage is metered per user.
97
98
  - Credentials are saved to `~/.config/heyyumi/credentials.json` (mode 0600; `%APPDATA%\heyyumi` on Windows). Access tokens refresh on their own; refresh is locked across processes so parallel agent commands never sign the user out.
98
99
  - `heyyumi status` shows whether you are signed in (never prints tokens). `heyyumi logout` removes local credentials. Keys can be revoked any time at <https://heyyumi.ai/dashboard>.
100
+ - `--detach` is for agents that must hand the link to a person: it prints `{"pending":true,"url":...}` and returns at once, while a background process waits up to 5 minutes for the sign-in. Many agent shells kill what a command left running (`&`, `nohup`), so a plain background `login` would die before the person opens the link. Check with `heyyumi status` afterwards.
99
101
  - `--no-browser` prints the URL instead of opening it. `--client-name NAME` labels the connection (it shows up as the source of reservation requests, e.g. `--client-name "My Agent"`).
100
102
  - Already have a dashboard key? Set `HEYYUMI_API_KEY=hmp_...` and skip `login`.
101
103
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "heyyumi",
3
- "version": "0.1.4",
4
- "description": "Your AI finds and books real Korean restaurants, no Korean needed. 546,000+ verified venues; search, details and table requests as JSON for any agent.",
3
+ "version": "0.1.6",
4
+ "description": "Your AI finds and books real Korean restaurants and hair & nail salons, no Korean needed. 546,000+ verified venues; search, details and reservation requests as JSON for any agent.",
5
5
  "license": "MIT",
6
6
  "bin": {
7
7
  "heyyumi": "bin/heyyumi.js"
@@ -32,6 +32,9 @@
32
32
  "seoul",
33
33
  "restaurant",
34
34
  "reservation",
35
+ "beauty",
36
+ "hair-salon",
37
+ "nail-salon",
35
38
  "booking",
36
39
  "travel",
37
40
  "ai-agent",
package/src/args.js CHANGED
@@ -46,6 +46,7 @@ const CLI_FLAGS = new Set([
46
46
  "json",
47
47
  "timeout",
48
48
  "no-browser",
49
+ "detach",
49
50
  "client-name",
50
51
  "force",
51
52
  ]);
package/src/commands.js CHANGED
@@ -3,6 +3,7 @@
3
3
  const { flagsToToolArgs } = require("./args");
4
4
  const { callTool, listTools, rpc } = require("./mcp");
5
5
  const { login } = require("./oauth");
6
+ const { detachedLogin } = require("./detach");
6
7
  const { readCredentials, removeCredentials } = require("./credentials");
7
8
  const { normalizeReservationTime } = require("./time");
8
9
  const { credentialsPath, DEFAULT_CLIENT_NAME, MCP_URL, version } = require("./config");
@@ -120,7 +121,7 @@ function photosResult(data) {
120
121
  // `--nme` would book under no name, so reject it. Commands not listed forward flags to the tool,
121
122
  // where validateArgs checks them against the live schema.
122
123
  const OWN_FLAGS = {
123
- login: ["client-name", "no-browser", "timeout", "force"],
124
+ login: ["client-name", "no-browser", "detach", "timeout", "force"],
124
125
  logout: [],
125
126
  status: [],
126
127
  photos: ["category", "limit"],
@@ -156,6 +157,9 @@ const commands = {
156
157
  return { ok: true, alreadySignedIn: true, clientName: existing.clientName, note: "Already signed in. Use --force to sign in again." };
157
158
  }
158
159
  const clientName = typeof flags["client-name"] === "string" ? flags["client-name"] : process.env.HEYYUMI_CLIENT_NAME || DEFAULT_CLIENT_NAME;
160
+ if (flags.detach === true) {
161
+ return detachedLogin({ clientName, timeoutSec: timeoutFlag(flags, 300), force: flags.force === true });
162
+ }
159
163
  const creds = await login({
160
164
  clientName,
161
165
  noBrowser: flags["no-browser"] === true,
@@ -345,6 +349,7 @@ const HELP = `heyyumi ${version} — Korean restaurant search & table requests f
345
349
 
346
350
  Sign in (once per machine; opens Google sign-in, finishes on its own):
347
351
  heyyumi login [--no-browser] [--client-name NAME] [--timeout 300] [--force]
352
+ heyyumi login --detach for agents: prints the sign-in url and returns; sign-in finishes in the background
348
353
  heyyumi status | logout
349
354
 
350
355
  Rules for agents (from the server, always current):
@@ -355,6 +360,8 @@ Search & details:
355
360
  heyyumi search [KEYWORD] --region 을지로 [--subtype korean_bbq] [--open_at "2026-10-25 19:00"] [--parking] ...
356
361
  Any search_places filter works as a flag (see: heyyumi tools search_places). 10 results unless --page-size.
357
362
  --region takes Korean or romanized names, stations and landmarks (Hongdae, 강남역, 제주공항).
363
+ Hair, nails, lashes, waxing, skin care: add --business_category salon|nail|lash|waxing|esthetic|beauty.
364
+ Each search returns one kind only; without it you get restaurants, cafes and bars.
358
365
  heyyumi nearby --lat 37.5665 --lng 126.978 [--radius 800] [--sort discovery]
359
366
  heyyumi place PLACE_ID [--fields all]
360
367
  heyyumi photos PLACE_ID [--limit 6] [--category interior]
package/src/detach.js ADDED
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+
3
+ const fs = require("node:fs");
4
+ const path = require("node:path");
5
+ const { spawn } = require("node:child_process");
6
+ const { configDir } = require("./config");
7
+ const { CliError } = require("./errors");
8
+
9
+ const BIN = path.join(__dirname, "..", "bin", "heyyumi.js");
10
+ const AUTH_URL = /^https?:\/\/\S+\/oauth\/authorize\?\S+$/m;
11
+
12
+ function readLog(file) {
13
+ try {
14
+ return fs.readFileSync(file, "utf8");
15
+ } catch {
16
+ return "";
17
+ }
18
+ }
19
+
20
+ function lastJson(text) {
21
+ const line = text.trim().split("\n").reverse().find((l) => l.startsWith("{"));
22
+ try {
23
+ return line ? JSON.parse(line) : null;
24
+ } catch {
25
+ return null;
26
+ }
27
+ }
28
+
29
+ /**
30
+ * `login --detach`: print the sign-in link and return at once, while a child in its own session keeps the
31
+ * loopback callback open and saves the sign-in. Agent shells kill whatever a command left running when it
32
+ * returns (`&` and `nohup` included), so a plain background login dies before the person opens the link.
33
+ */
34
+ async function detachedLogin({ clientName, timeoutSec, force = false, waitMs = 25000 }) {
35
+ const dir = configDir();
36
+ fs.mkdirSync(dir, { recursive: true, mode: 0o700 });
37
+ const logFile = path.join(dir, "login.log");
38
+ const fd = fs.openSync(logFile, "w", 0o600);
39
+ const args = [BIN, "login", "--no-browser", "--timeout", String(timeoutSec), "--client-name", clientName];
40
+ if (force) args.push("--force");
41
+ const child = spawn(process.execPath, args, { detached: true, stdio: ["ignore", fd, fd], windowsHide: true });
42
+ fs.closeSync(fd);
43
+ let exited = false;
44
+ child.once("exit", () => {
45
+ exited = true;
46
+ });
47
+ child.unref();
48
+
49
+ const deadline = Date.now() + waitMs;
50
+ while (Date.now() < deadline) {
51
+ await new Promise((r) => setTimeout(r, 150));
52
+ const text = readLog(logFile);
53
+ const url = text.match(AUTH_URL)?.[0];
54
+ if (url) {
55
+ return {
56
+ ok: true,
57
+ pending: true,
58
+ url,
59
+ expiresInSec: timeoutSec,
60
+ next: "Give the url to the person. It must be opened on this computer. Once they say they signed in, run: npx -y heyyumi status",
61
+ };
62
+ }
63
+ if (exited) break;
64
+ }
65
+
66
+ const out = lastJson(readLog(logFile));
67
+ if (out?.ok) return out;
68
+ const err = out?.error;
69
+ if (!exited) {
70
+ try {
71
+ process.kill(child.pid);
72
+ } catch {
73
+ // Already gone.
74
+ }
75
+ }
76
+ throw new CliError(err?.code || "login_start_failed", err?.message || "Could not start the sign-in. Try again.", {
77
+ exitCode: err?.code ? 3 : 1,
78
+ next: "npx -y heyyumi login --detach",
79
+ });
80
+ }
81
+
82
+ module.exports = { detachedLogin };