@sentientui/mcp 0.8.0 → 0.8.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/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  ApiClient,
4
4
  createMcpServer
5
- } from "./chunk-E34O3H2Z.js";
5
+ } from "./chunk-GLL5CMBY.js";
6
6
 
7
7
  // src/index.ts
8
8
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
@@ -13,11 +13,12 @@ import { join } from "path";
13
13
  import { homedir } from "os";
14
14
  var CONFIG_DIR = join(homedir(), ".config", "sentientui");
15
15
  var CONFIG_FILE = join(CONFIG_DIR, "mcp-anon.json");
16
- var API_BASE = process.env.SENTIENTUI_API_URL ?? "https://api.sentient-ui.com";
16
+ var _a;
17
+ var API_BASE = (_a = process.env.SENTIENTUI_API_URL) != null ? _a : "https://api.sentient-ui.com";
17
18
  function readCachedToken() {
18
19
  try {
19
20
  return JSON.parse(readFileSync(CONFIG_FILE, "utf-8"));
20
- } catch {
21
+ } catch (e) {
21
22
  return null;
22
23
  }
23
24
  }
@@ -26,8 +27,9 @@ function writeCachedToken(cfg) {
26
27
  writeFileSync(CONFIG_FILE, JSON.stringify(cfg, null, 2), { encoding: "utf-8", mode: 384 });
27
28
  }
28
29
  async function resolveDemoToken() {
30
+ var _a2;
29
31
  const cached = readCachedToken();
30
- if (cached?.token) {
32
+ if (cached == null ? void 0 : cached.token) {
31
33
  process.stderr.write(
32
34
  `[sentientui-mcp] Running in demo mode (${CONFIG_FILE}). Set SENTIENTUI_API_KEY for full access.
33
35
  `
@@ -38,7 +40,7 @@ async function resolveDemoToken() {
38
40
  const res = await fetch(`${API_BASE}/v1/mcp/demo`, { method: "POST" });
39
41
  if (!res.ok) {
40
42
  const body = await res.json().catch(() => ({}));
41
- throw new Error(`Demo provisioning failed: ${String(body.error ?? res.statusText)}`);
43
+ throw new Error(`Demo provisioning failed: ${String((_a2 = body.error) != null ? _a2 : res.statusText)}`);
42
44
  }
43
45
  const data = await res.json();
44
46
  writeCachedToken({ token: data.token, projectId: data.projectId });