boardui 0.5.7 → 0.5.8

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
@@ -222,6 +222,13 @@ The daily buckets do not expire automatically.
222
222
  `package.json` and `package-lock.json` stay in sync. The CLI reads its
223
223
  displayed and telemetry version from `package.json` at runtime.
224
224
  2. `cd cli && npm install && npm run build`
225
+ The build embeds the public PostHog project token for MCP analytics. It
226
+ reads the repo's `.env` / `.env.local`, then `cli/.env` / `cli/.env.local`,
227
+ then the build environment (highest priority). Set `POSTHOG_PROJECT_TOKEN`
228
+ and optionally `POSTHOG_HOST`, or use the site's
229
+ `NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN` / `NEXT_PUBLIC_POSTHOG_HOST`. A missing
230
+ or invalid project token fails the build instead of silently disabling
231
+ analytics in every customer's MCP server. Never use a personal API key.
225
232
  3. Smoke test: `node dist/index.js list`
226
233
  4. `npm publish`
227
234
 
package/dist/index.js CHANGED
@@ -1142,9 +1142,6 @@ Monorepos/custom aliases: put boardui.json next to the destination package's pac
1142
1142
  Agent skill: BoardUI also ships an agent skill (SKILL.md open standard) carrying deeper always-loaded knowledge \u2014 the full component catalog, theming, page patterns, and the motion language. get_skill answers questions about it (returns SKILL.md and the file list); install_skill writes it into the project's .claude/skills/boardui. For other destinations, relay the CLI: npx boardui@latest skill (project), --global (~/.claude/skills), --client codex (~/.agents/skills, read by Codex and Gemini), --path <dir> (anywhere), --force (update). Docs: https://www.boardui.com/skill
1143
1143
 
1144
1144
  Pro: items marked PRO require a one-time BoardUI Pro license (${PRICING_URL}, lifetime updates). If the user wants a pro item and no license is active, relay the pricing link \u2014 and if they already purchased, ask them for the license key from their purchase email, then call activate_license with it. After that, pro installs work like free ones.`;
1145
- var posthog = new PostHog("", {
1146
- host: "https://eu.i.posthog.com"
1147
- });
1148
1145
  var freeIndexPromise = null;
1149
1146
  var proIndexPromise = null;
1150
1147
  function freeIndex() {
@@ -1362,7 +1359,25 @@ async function mcp() {
1362
1359
  { name: "boardui", version: CLI_VERSION },
1363
1360
  { instructions: INSTRUCTIONS }
1364
1361
  );
1365
- instrument(server, posthog);
1362
+ const token = "phc_Cp49ooHFujriAf92MgJgj2spJZ2kyBrJC2uUN8wDRqSV"?.trim();
1363
+ const posthog = isTelemetryEnabled() && token ? new PostHog(token, {
1364
+ host: "https://eu.i.posthog.com",
1365
+ // Tool calls are infrequent; do not leave a short session's only call
1366
+ // waiting for the default batch threshold / five-second timer.
1367
+ flushAt: 1,
1368
+ flushInterval: 1e3
1369
+ }) : null;
1370
+ if (posthog) {
1371
+ posthog.on("error", () => console.error("[mcp-analytics] PostHog delivery failed."));
1372
+ instrument(server, posthog, {
1373
+ eventProperties: () => ({ $mcp_transport: "stdio" }),
1374
+ logger: (message) => {
1375
+ if (/warning|failed/i.test(message)) console.error(`[mcp-analytics] ${message}`);
1376
+ }
1377
+ });
1378
+ } else if (isTelemetryEnabled()) {
1379
+ console.error("[mcp-analytics] PostHog project token is missing; MCP analytics is disabled.");
1380
+ }
1366
1381
  server.registerTool(
1367
1382
  "get_started",
1368
1383
  {
@@ -1881,7 +1896,7 @@ ${skillMd}`
1881
1896
  })
1882
1897
  );
1883
1898
  process.on("SIGTERM", async () => {
1884
- await posthog.shutdown();
1899
+ await posthog?.shutdown();
1885
1900
  process.exit(0);
1886
1901
  });
1887
1902
  await server.connect(new StdioServerTransport());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "boardui",
3
- "version": "0.5.7",
3
+ "version": "0.5.8",
4
4
  "description": "Add BoardUI components to your project.",
5
5
  "license": "MIT",
6
6
  "type": "module",