@flextudio/scenario 0.1.2 → 0.1.3

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 (2) hide show
  1. package/package.json +1 -1
  2. package/scripts/auth.mjs +22 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flextudio/scenario",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "type": "module",
5
5
  "description": "flextudio meta-contract v1 시나리오 검증·카탈로그·세션 CLI + Claude Code Skill. MCP 서버 없이 SKILL.md 인라인 스키마로 시나리오를 만들고 자체 검증한다. otel 없는 클린 배포본. (벤치용 gen·otel 은 bench/cli_bench 로 분리)",
6
6
  "bin": {
package/scripts/auth.mjs CHANGED
@@ -10,7 +10,7 @@ import http from "node:http";
10
10
  import crypto from "node:crypto";
11
11
  import fs from "node:fs/promises";
12
12
  import path from "node:path";
13
- import { execFile } from "node:child_process";
13
+ import { spawn } from "node:child_process";
14
14
 
15
15
  import { TOKEN_PATH } from "./install-paths.mjs";
16
16
 
@@ -43,13 +43,31 @@ async function discover() {
43
43
  }
44
44
 
45
45
  function openBrowser(url) {
46
+ let child;
46
47
  if (process.platform === "darwin") {
47
- execFile("open", [url]);
48
+ child = spawn("open", [url], {
49
+ detached: true,
50
+ stdio: "ignore",
51
+ });
48
52
  } else if (process.platform === "win32") {
49
- execFile("cmd", ["/c", "start", "", url]);
53
+ child = spawn("rundll32.exe", ["url.dll,FileProtocolHandler", url], {
54
+ detached: true,
55
+ stdio: "ignore",
56
+ windowsHide: true,
57
+ });
50
58
  } else {
51
- execFile("xdg-open", [url]);
59
+ child = spawn("xdg-open", [url], {
60
+ detached: true,
61
+ stdio: "ignore",
62
+ });
52
63
  }
64
+ child.on("error", (error) => {
65
+ console.error("Failed to open browser automatically.");
66
+ console.error(error.message);
67
+ console.error("Open this URL manually:");
68
+ console.error(url);
69
+ });
70
+ child.unref();
53
71
  }
54
72
 
55
73
  function waitForCallback(expectedState) {