diff --git a/plugins/glean/.claude-plugin/plugin.json b/plugins/glean/.claude-plugin/plugin.json index 711d058..301b08a 100644 --- a/plugins/glean/.claude-plugin/plugin.json +++ b/plugins/glean/.claude-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "glean-vnext", - "version": "0.2.35", + "version": "0.2.36", "description": "Glean plugin for discovering skills and running tools.", "author": { "name": "Glean" diff --git a/plugins/glean/.codex-plugin/plugin.json b/plugins/glean/.codex-plugin/plugin.json index feedbf4..7b31deb 100644 --- a/plugins/glean/.codex-plugin/plugin.json +++ b/plugins/glean/.codex-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "glean-vnext", - "version": "0.2.35", + "version": "0.2.36", "description": "Glean Codex plugin for discovering skills and running tools.", "author": { "name": "Glean" diff --git a/plugins/glean/.cursor-plugin/plugin.json b/plugins/glean/.cursor-plugin/plugin.json index 9495404..232df50 100644 --- a/plugins/glean/.cursor-plugin/plugin.json +++ b/plugins/glean/.cursor-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "glean-vnext", "displayName": "Glean vNext", - "version": "0.2.35", + "version": "0.2.36", "description": "Search and act across your company's apps — Jira, Slack, Salesforce, Google Workspace, and more — without leaving Cursor.", "author": { "name": "Glean" diff --git a/plugins/glean/dist/index.js b/plugins/glean/dist/index.js index 9230eff..0366730 100644 --- a/plugins/glean/dist/index.js +++ b/plugins/glean/dist/index.js @@ -26235,6 +26235,7 @@ function sameOrigin(a, b) { } // src/index.ts +var PLUGIN_VERSION = true ? "0.2.36" : "dev"; function readEnv(...keys) { for (const key of keys) { const v = process.env[key]; @@ -26807,6 +26808,11 @@ ${EMAIL_RESOLVE_FAILED_TEXT}` } }); async function main() { + logLine("server.start", { + version: PLUGIN_VERSION, + node: process.version, + pid: process.pid + }); const ONE_WEEK_MS = 7 * 24 * 60 * 60 * 1e3; try { await evictStaleSkills(resolveSkillsBaseDir(), ONE_WEEK_MS, logLine); diff --git a/scripts/build.mjs b/scripts/build.mjs index 1eb313c..ea95625 100644 --- a/scripts/build.mjs +++ b/scripts/build.mjs @@ -18,16 +18,32 @@ import { build } from "esbuild"; import { builtinModules } from "node:module"; +import { readFileSync } from "node:fs"; const nodeBuiltins = [ ...builtinModules, ...builtinModules.map((m) => `node:${m}`), ]; +// Stamp the plugin version into the bundle as a compile-time constant so the +// running server can log which version it is. The per-host manifests are the +// single source of truth (kept aligned by check-version-bump.sh), so reading +// the Claude manifest is representative. Under `tsx` dev (no bundle), the +// constant is absent and src/index.ts falls back to "dev". +const pluginVersion = JSON.parse( + readFileSync( + new URL("../plugins/glean/.claude-plugin/plugin.json", import.meta.url), + "utf8", + ), +).version; + await build({ entryPoints: ["src/index.ts"], outfile: "plugins/glean/dist/index.js", bundle: true, + define: { + __GLEAN_PLUGIN_VERSION__: JSON.stringify(pluginVersion), + }, platform: "node", format: "esm", target: "node20", diff --git a/src/index.ts b/src/index.ts index 3034752..286aa3e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -42,6 +42,14 @@ import { import { resolveSessionId } from "./session-id.js"; import { resolveServerUrlFromEmail } from "./config-search.js"; +// Injected at build time by scripts/build.mjs from the plugin manifest version. +// Absent under `tsx` dev runs — the typeof guard falls back to "dev" there. +declare const __GLEAN_PLUGIN_VERSION__: string | undefined; +const PLUGIN_VERSION = + typeof __GLEAN_PLUGIN_VERSION__ !== "undefined" + ? __GLEAN_PLUGIN_VERSION__ + : "dev"; + function readEnv(...keys: string[]): string | undefined { for (const key of keys) { const v = process.env[key]; @@ -812,6 +820,13 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => { async function main() { // Run once per session at MCP server startup. + // First line per process: stamps the plugin version (+ node/pid) so any + // session's log is traceable to the exact build that served it. + logLine("server.start", { + version: PLUGIN_VERSION, + node: process.version, + pid: process.pid, + }); const ONE_WEEK_MS = 7 * 24 * 60 * 60 * 1000; try { await evictStaleSkills(resolveSkillsBaseDir(), ONE_WEEK_MS, logLine);