@glasstrace/sdk 1.10.2 → 1.11.0
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 +43 -5
- package/dist/{chunk-QS5RZ2TC.js → chunk-DQFGNX3H.js} +13 -8
- package/dist/{chunk-QS5RZ2TC.js.map → chunk-DQFGNX3H.js.map} +1 -1
- package/dist/{chunk-UMGZJYC4.js → chunk-FQ4SEG6Y.js} +8 -3
- package/dist/chunk-FQ4SEG6Y.js.map +1 -0
- package/dist/{chunk-CIKPFJOM.js → chunk-KOYZJN6G.js} +310 -20
- package/dist/chunk-KOYZJN6G.js.map +1 -0
- package/dist/{chunk-ZBQQXVHD.js → chunk-YIEXKQYP.js} +2 -67
- package/dist/chunk-YIEXKQYP.js.map +1 -0
- package/dist/cli/init.cjs +453 -126
- package/dist/cli/init.cjs.map +1 -1
- package/dist/cli/init.js +29 -16
- package/dist/cli/init.js.map +1 -1
- package/dist/cli/mcp-add.cjs +339 -97
- package/dist/cli/mcp-add.cjs.map +1 -1
- package/dist/cli/mcp-add.js +32 -14
- package/dist/cli/mcp-add.js.map +1 -1
- package/dist/cli/status.cjs +6 -1
- package/dist/cli/status.cjs.map +1 -1
- package/dist/cli/status.js +7 -2
- package/dist/cli/status.js.map +1 -1
- package/dist/cli/uninit.cjs +6 -1
- package/dist/cli/uninit.cjs.map +1 -1
- package/dist/cli/uninit.js +2 -2
- package/dist/cli/upgrade-instructions.cjs +383 -112
- package/dist/cli/upgrade-instructions.cjs.map +1 -1
- package/dist/cli/upgrade-instructions.js +70 -18
- package/dist/cli/upgrade-instructions.js.map +1 -1
- package/dist/index.cjs +11 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -2
- package/dist/node-entry.cjs +11 -6
- package/dist/node-entry.cjs.map +1 -1
- package/dist/node-entry.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-CIKPFJOM.js.map +0 -1
- package/dist/chunk-UMGZJYC4.js.map +0 -1
- package/dist/chunk-ZBQQXVHD.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/cli/upgrade-instructions.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { isAbsolute, relative } from \"node:path\";\nimport { MCP_ENDPOINT } from \"../mcp-runtime.js\";\nimport { detectAgents } from \"../agent-detection/detect.js\";\nimport { generateInfoSection } from \"../agent-detection/configs.js\";\nimport {\n hasManagedSection,\n injectInfoSection,\n} from \"../agent-detection/inject.js\";\n\n// Declare the tsup-injected SDK version literal. Replaced at build time\n// via `define` in tsup.config.ts. Falls back to \"0.0.0-dev\" when\n// running tests under vitest (no tsup build step).\ndeclare const __SDK_VERSION__: string;\n\n/**\n * Options for {@link runUpgradeInstructions}. The CLI entry point in\n * `init.ts` wires `process.cwd()` through `resolveProjectRoot()` so\n * monorepo roots resolve to the active app directory; tests pass an\n * explicit `projectRoot` for isolation.\n */\nexport interface UpgradeInstructionsOptions {\n projectRoot: string;\n}\n\n/**\n * Result of running the upgrade-instructions command. Returned to the\n * CLI entry point so it can render output without forcing the core\n * logic to call `process.stderr.write` / `process.exit`.\n */\nexport interface UpgradeInstructionsResult {\n exitCode: number;\n /**\n * Files whose managed Glasstrace section was refreshed in place.\n * Reported as paths relative to {@link UpgradeInstructionsOptions.projectRoot}\n * so the CLI output stays portable across machines and developer\n * homes; an absolute path is returned only when the detected file\n * lives outside the resolved project root (e.g. Windsurf's global\n * config under `$HOME/.codeium/`), where a relative form would be\n * misleading.\n */\n refreshed: string[];\n /**\n * Files inspected that did not contain a managed section, and were\n * therefore left untouched. Reported so the user can verify the\n * command did not accidentally append a block to a hand-written\n * instruction file. Same path-shape rule as\n * {@link UpgradeInstructionsResult.refreshed}.\n */\n skipped: string[];\n /**\n * Soft warnings (e.g. permission errors handled internally by\n * `injectInfoSection`). One line per issue.\n */\n warnings: string[];\n /**\n * Hard errors that prevented the command from completing.\n */\n errors: string[];\n}\n\n/**\n * Refreshes the managed Glasstrace MCP section in every detected agent\n * instruction file in the project (DISC-1592 / SDK-050 §Required\n * Semantics Item 2). Idempotent and safe to re-run; the helper only\n * touches files that already contain a marker pair, so a hand-written\n * `CLAUDE.md` without a Glasstrace block is left alone.\n *\n * Multi-file projects are handled in a single run (DISC-1592 §Multi-file\n * projects): the same `detectAgents()` call that scaffolds files at\n * `init` time enumerates every detected agent, and this function\n * refreshes every file with a managed section in one pass.\n *\n * The replace-in-place behaviour works for both legacy unstamped\n * markers (pre-SDK-050) and SDK-050+ stamped markers — see\n * `findMarkerBoundaries` in `inject.ts`.\n *\n * @param options - Project root to operate on. The CLI entry point\n * resolves monorepo roots before calling this function.\n */\n/**\n * Renders an absolute file path in a form suitable for CLI output:\n * relative to `projectRoot` when the file lives inside the tree, or\n * the original absolute path otherwise. Keeps output portable for\n * normal in-tree files (`CLAUDE.md`, `.cursorrules`, `codex.md`) while\n * preserving full paths for out-of-tree targets like Windsurf's\n * global config (`$HOME/.codeium/windsurf/mcp_config.json`), where a\n * relative form (e.g. `../../../../home/.../mcp_config.json`) would\n * be harder to read than the absolute path.\n */\nfunction formatPathForOutput(filePath: string, projectRoot: string): string {\n const rel = relative(projectRoot, filePath);\n if (rel === \"\" || rel.startsWith(\"..\") || isAbsolute(rel)) {\n return filePath;\n }\n return rel;\n}\n\nexport async function runUpgradeInstructions(\n options: UpgradeInstructionsOptions,\n): Promise<UpgradeInstructionsResult> {\n const refreshed: string[] = [];\n const skipped: string[] = [];\n const warnings: string[] = [];\n const errors: string[] = [];\n\n let agents;\n try {\n agents = await detectAgents(options.projectRoot);\n } catch (err) {\n errors.push(\n `Failed to detect agents: ${err instanceof Error ? err.message : String(err)}`,\n );\n return { exitCode: 1, refreshed, skipped, warnings, errors };\n }\n\n const sdkVersion =\n typeof __SDK_VERSION__ === \"string\" ? __SDK_VERSION__ : \"0.0.0-dev\";\n\n for (const agent of agents) {\n if (agent.infoFilePath === null) {\n // Generic / gemini / windsurf, or detected agent whose info\n // file does not exist on disk — nothing to refresh.\n continue;\n }\n\n const displayPath = formatPathForOutput(\n agent.infoFilePath,\n options.projectRoot,\n );\n\n let containsSection: boolean;\n try {\n containsSection = await hasManagedSection(agent.infoFilePath);\n } catch (err) {\n // hasManagedSection swallows read errors and returns false, so\n // this branch is defensive against a future refactor.\n warnings.push(\n `Could not inspect ${displayPath}: ${err instanceof Error ? err.message : String(err)}`,\n );\n continue;\n }\n\n if (!containsSection) {\n // The agent was detected (marker file present) but the\n // instruction file has no Glasstrace managed section. Refusing\n // to inject prevents `upgrade-instructions` from accidentally\n // adding a Glasstrace block to a project that opted out.\n skipped.push(displayPath);\n continue;\n }\n\n const content = generateInfoSection(agent, MCP_ENDPOINT, sdkVersion);\n if (content === \"\") {\n // Defensive — agents whose `infoFilePath` is non-null currently\n // always render content. Belt-and-braces guard against a future\n // mismatch.\n continue;\n }\n\n try {\n await injectInfoSection(agent, content, options.projectRoot);\n refreshed.push(displayPath);\n } catch (err) {\n errors.push(\n `Failed to refresh ${displayPath}: ${err instanceof Error ? err.message : String(err)}`,\n );\n }\n }\n\n const exitCode = errors.length === 0 ? 0 : 1;\n return { exitCode, refreshed, skipped, warnings, errors };\n}\n"],"mappings":";;;;;;;;;;;;;;;;AACA,SAAS,YAAY,gBAAgB;AAyFrC,SAAS,oBAAoB,UAAkB,aAA6B;AAC1E,QAAM,MAAM,SAAS,aAAa,QAAQ;AAC1C,MAAI,QAAQ,MAAM,IAAI,WAAW,IAAI,KAAK,WAAW,GAAG,GAAG;AACzD,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAEA,eAAsB,uBACpB,SACoC;AACpC,QAAM,YAAsB,CAAC;AAC7B,QAAM,UAAoB,CAAC;AAC3B,QAAM,WAAqB,CAAC;AAC5B,QAAM,SAAmB,CAAC;AAE1B,MAAI;AACJ,MAAI;AACF,aAAS,MAAM,aAAa,QAAQ,WAAW;AAAA,EACjD,SAAS,KAAK;AACZ,WAAO;AAAA,MACL,4BAA4B,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG,CAAC;AAAA,IAC9E;AACA,WAAO,EAAE,UAAU,GAAG,WAAW,SAAS,UAAU,OAAO;AAAA,EAC7D;AAEA,QAAM,aACJ,OAAsC,WAAkB;AAE1D,aAAW,SAAS,QAAQ;AAC1B,QAAI,MAAM,iBAAiB,MAAM;AAG/B;AAAA,IACF;AAEA,UAAM,cAAc;AAAA,MAClB,MAAM;AAAA,MACN,QAAQ;AAAA,IACV;AAEA,QAAI;AACJ,QAAI;AACF,wBAAkB,MAAM,kBAAkB,MAAM,YAAY;AAAA,IAC9D,SAAS,KAAK;AAGZ,eAAS;AAAA,QACP,qBAAqB,WAAW,KAAK,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG,CAAC;AAAA,MACvF;AACA;AAAA,IACF;AAEA,QAAI,CAAC,iBAAiB;AAKpB,cAAQ,KAAK,WAAW;AACxB;AAAA,IACF;AAEA,UAAM,UAAU,oBAAoB,OAAO,cAAc,UAAU;AACnE,QAAI,YAAY,IAAI;AAIlB;AAAA,IACF;AAEA,QAAI;AACF,YAAM,kBAAkB,OAAO,SAAS,QAAQ,WAAW;AAC3D,gBAAU,KAAK,WAAW;AAAA,IAC5B,SAAS,KAAK;AACZ,aAAO;AAAA,QACL,qBAAqB,WAAW,KAAK,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG,CAAC;AAAA,MACvF;AAAA,IACF;AAAA,EACF;AAEA,QAAM,WAAW,OAAO,WAAW,IAAI,IAAI;AAC3C,SAAO,EAAE,UAAU,WAAW,SAAS,UAAU,OAAO;AAC1D;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/cli/upgrade-instructions.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { dirname, isAbsolute, join, relative } from \"node:path\";\nimport { MCP_ENDPOINT } from \"../mcp-runtime.js\";\nimport { detectAgents } from \"../agent-detection/detect.js\";\nimport { hasManagedSection } from \"../agent-detection/inject.js\";\nimport { injectAllTargets } from \"../agent-detection/inject-all-targets.js\";\nimport type { DetectedAgent } from \"../agent-detection/detect.js\";\n\n/**\n * Per-agent legacy destinations that may carry a pre-Wave-18 managed\n * section. Used by the upgrade-instructions opted-in gate to detect\n * users who installed via an older SDK and need their managed section\n * migrated to the Wave 18 canonical destinations.\n */\nfunction legacyDestinationsForAgent(agent: DetectedAgent): string[] {\n // Resolve legacy paths relative to the agent's detected `foundDir`\n // (the directory where `detectAgents` resolved the marker), NOT\n // against the project root. `detectAgents` walks up to the git\n // root for monorepo support, so for a project initialized in\n // `packages/api/` with a legacy `codex.md` at the git root, the\n // detected agent's `infoFilePath` is `<gitRoot>/AGENTS.md` and we\n // need the legacy `codex.md` to resolve under `<gitRoot>`, not\n // under `packages/api/` (Codex P2 review of v5).\n if (agent.infoFilePath === null) {\n return [];\n }\n switch (agent.name) {\n case \"codex\":\n // agent.infoFilePath = <foundDir>/AGENTS.md → foundDir = dirname\n return [join(dirname(agent.infoFilePath), \"codex.md\")];\n case \"cursor\":\n // agent.infoFilePath = <foundDir>/.cursor/rules/glasstrace.mdc\n // → foundDir = dirname(dirname(dirname(infoFilePath)))\n return [\n join(dirname(dirname(dirname(agent.infoFilePath))), \".cursorrules\"),\n ];\n case \"windsurf\":\n // agent.infoFilePath = <foundDir>/.windsurf/rules/glasstrace.md\n // → foundDir = dirname(dirname(dirname(infoFilePath)))\n return [\n join(\n dirname(dirname(dirname(agent.infoFilePath))),\n \".windsurfrules\",\n ),\n ];\n case \"claude\":\n case \"gemini\":\n case \"generic\":\n return [];\n }\n}\n\n/**\n * Returns true if any of the candidate file paths contains a managed\n * section. Walks each candidate via `hasManagedSection`; aggregates\n * the result.\n */\nasync function anyHasManagedSection(paths: string[]): Promise<boolean> {\n for (const p of paths) {\n if (await hasManagedSection(p)) {\n return true;\n }\n }\n return false;\n}\n\n// Declare the tsup-injected SDK version literal. Replaced at build time\n// via `define` in tsup.config.ts. Falls back to \"0.0.0-dev\" when\n// running tests under vitest (no tsup build step).\ndeclare const __SDK_VERSION__: string;\n\n/**\n * Options for {@link runUpgradeInstructions}. The CLI entry point in\n * `init.ts` wires `process.cwd()` through `resolveProjectRoot()` so\n * monorepo roots resolve to the active app directory; tests pass an\n * explicit `projectRoot` for isolation.\n */\nexport interface UpgradeInstructionsOptions {\n projectRoot: string;\n}\n\n/**\n * Result of running the upgrade-instructions command. Returned to the\n * CLI entry point so it can render output without forcing the core\n * logic to call `process.stderr.write` / `process.exit`.\n */\nexport interface UpgradeInstructionsResult {\n exitCode: number;\n /**\n * Files whose managed Glasstrace section was refreshed in place.\n * Reported as paths relative to {@link UpgradeInstructionsOptions.projectRoot}\n * so the CLI output stays portable across machines and developer\n * homes; an absolute path is returned only when the detected file\n * lives outside the resolved project root (e.g. Windsurf's global\n * config under `$HOME/.codeium/`), where a relative form would be\n * misleading.\n */\n refreshed: string[];\n /**\n * Files inspected that did not contain a managed section, and were\n * therefore left untouched. Reported so the user can verify the\n * command did not accidentally append a block to a hand-written\n * instruction file. Same path-shape rule as\n * {@link UpgradeInstructionsResult.refreshed}.\n */\n skipped: string[];\n /**\n * Soft warnings (e.g. permission errors handled internally by\n * `injectInfoSection`). One line per issue.\n */\n warnings: string[];\n /**\n * Hard errors that prevented the command from completing.\n */\n errors: string[];\n}\n\n/**\n * Refreshes the managed Glasstrace MCP section in every detected agent\n * instruction file in the project (DISC-1592 / SDK-050 §Required\n * Semantics Item 2). Idempotent and safe to re-run; the helper only\n * touches files that already contain a marker pair, so a hand-written\n * `CLAUDE.md` without a Glasstrace block is left alone.\n *\n * Multi-file projects are handled in a single run (DISC-1592 §Multi-file\n * projects): the same `detectAgents()` call that scaffolds files at\n * `init` time enumerates every detected agent, and this function\n * refreshes every file with a managed section in one pass.\n *\n * The replace-in-place behaviour works for both legacy unstamped\n * markers (pre-SDK-050) and SDK-050+ stamped markers — see\n * `findMarkerBoundaries` in `inject.ts`.\n *\n * @param options - Project root to operate on. The CLI entry point\n * resolves monorepo roots before calling this function.\n */\n/**\n * Renders an absolute file path in a form suitable for CLI output:\n * relative to `projectRoot` when the file lives inside the tree, or\n * the original absolute path otherwise. Keeps output portable for\n * normal in-tree files (`AGENTS.md`, `CLAUDE.md`, `GEMINI.md`,\n * `.cursor/rules/glasstrace.mdc`, `.windsurf/rules/glasstrace.md`, plus\n * legacy `.cursorrules` / `codex.md` / `.windsurfrules`) while\n * preserving full paths for out-of-tree targets like Windsurf's\n * global config (`$HOME/.codeium/windsurf/mcp_config.json`), where a\n * relative form (e.g. `../../../../home/.../mcp_config.json`) would\n * be harder to read than the absolute path.\n */\nfunction formatPathForOutput(filePath: string, projectRoot: string): string {\n const rel = relative(projectRoot, filePath);\n if (rel === \"\" || rel.startsWith(\"..\") || isAbsolute(rel)) {\n return filePath;\n }\n return rel;\n}\n\nexport async function runUpgradeInstructions(\n options: UpgradeInstructionsOptions,\n): Promise<UpgradeInstructionsResult> {\n const refreshed: string[] = [];\n const skipped: string[] = [];\n const warnings: string[] = [];\n const errors: string[] = [];\n\n let agents;\n try {\n agents = await detectAgents(options.projectRoot);\n } catch (err) {\n errors.push(\n `Failed to detect agents: ${err instanceof Error ? err.message : String(err)}`,\n );\n return { exitCode: 1, refreshed, skipped, warnings, errors };\n }\n\n const sdkVersion =\n typeof __SDK_VERSION__ === \"string\" ? __SDK_VERSION__ : \"0.0.0-dev\";\n\n // Track opted-in agents by identity (the agent reference itself),\n // NOT by display path. Multiple agents (notably codex + generic)\n // share the same canonical destination `AGENTS.md`; if we filtered\n // by path-collision against `skipped`, a generic skip would\n // incorrectly remove an opted-in codex from the refresh set\n // (Codex P1 review of PR #274). Identity-based tracking avoids\n // the collision.\n const optedInAgents: DetectedAgent[] = [];\n for (const agent of agents) {\n if (agent.infoFilePath === null) {\n // Detected agent with no canonical infoFilePath — nothing to\n // refresh. (Pre-Wave-18 this branch covered Gemini / Windsurf /\n // generic which had `infoFilePath: null`; Wave 18 wires all six\n // agents to a non-null canonical destination, so in practice\n // this guard is now defensive.)\n continue;\n }\n\n const displayPath = formatPathForOutput(\n agent.infoFilePath,\n options.projectRoot,\n );\n\n // Wave 18: refresh-gate semantics broadened.\n //\n // The pre-Wave-18 logic refused to inject when the canonical\n // `agent.infoFilePath` had no managed section (preserving opt-out\n // for users who deleted CLAUDE.md content). After Wave 18 the\n // canonical destinations changed (Codex `codex.md` → `AGENTS.md`;\n // Cursor `.cursorrules` → `.cursor/rules/glasstrace.mdc`; etc.),\n // so the new canonical file usually does NOT have a managed\n // section yet for legacy users — but the LEGACY file does, and\n // those users intend to migrate. Check both: the canonical 2026\n // destination AND the agent's known legacy destinations. If\n // either has a managed section the user has opted in; refresh\n // proceeds. If neither has one, the user opted out; skip.\n const legacyDestinations = legacyDestinationsForAgent(agent);\n let optedIn: boolean;\n try {\n optedIn = await anyHasManagedSection([\n agent.infoFilePath,\n ...legacyDestinations,\n ]);\n } catch (err) {\n warnings.push(\n `Could not inspect ${displayPath}: ${err instanceof Error ? err.message : String(err)}`,\n );\n continue;\n }\n\n if (!optedIn) {\n // No managed section in any known destination — user opted out\n // (or never installed). Refusing to inject prevents\n // `upgrade-instructions` from adding a Glasstrace block to a\n // project that doesn't want one.\n skipped.push(displayPath);\n continue;\n }\n\n optedInAgents.push(agent);\n }\n\n // Wave 18: refresh via `injectAllTargets` (multi-target dispatcher).\n // Surviving agents pass through this single hoisted dispatch which\n // writes to canonical 2026 destinations + AGENTS.md companion +\n // Cursor `.cursorrules` transitional fallback, deduplicating\n // AGENTS.md across agents.\n if (optedInAgents.length > 0) {\n try {\n await injectAllTargets(\n optedInAgents,\n MCP_ENDPOINT,\n sdkVersion,\n options.projectRoot,\n );\n for (const a of optedInAgents) {\n if (a.infoFilePath !== null) {\n refreshed.push(formatPathForOutput(a.infoFilePath, options.projectRoot));\n }\n }\n } catch (err) {\n errors.push(\n `Failed to refresh agent-instruction files: ${err instanceof Error ? err.message : String(err)}`,\n );\n }\n }\n\n // Codex P3 review of v4: dedupe `skipped` against `refreshed`. In\n // a legacy Codex migration, codex (canonical destination AGENTS.md)\n // and generic (also canonical destination AGENTS.md) share the same\n // path; codex's legacy `codex.md` carries the managed section so\n // codex is opted-in and refreshes AGENTS.md, while generic has no\n // managed section anywhere and is recorded in `skipped`. Without\n // this dedup the SAME path \"AGENTS.md\" appears in both `refreshed`\n // and `skipped`, contradicting itself for users and automation\n // parsing the lists. Refresh wins (the file was actually written).\n const refreshedSet = new Set(refreshed);\n const dedupedSkipped = skipped.filter((p) => !refreshedSet.has(p));\n\n const exitCode = errors.length === 0 ? 0 : 1;\n return {\n exitCode,\n refreshed,\n skipped: dedupedSkipped,\n warnings,\n errors,\n };\n}\n"],"mappings":"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","names":[]}
|
package/dist/index.cjs
CHANGED
|
@@ -23413,9 +23413,14 @@ function isEndMarkerLine(line) {
|
|
|
23413
23413
|
// src/agent-detection/upgrade-notice.ts
|
|
23414
23414
|
var warningEmitted = false;
|
|
23415
23415
|
var AGENT_INSTRUCTION_FILES = [
|
|
23416
|
+
"AGENTS.md",
|
|
23416
23417
|
"CLAUDE.md",
|
|
23418
|
+
"GEMINI.md",
|
|
23419
|
+
".cursor/rules/glasstrace.mdc",
|
|
23420
|
+
".windsurf/rules/glasstrace.md",
|
|
23421
|
+
".cursorrules",
|
|
23417
23422
|
"codex.md",
|
|
23418
|
-
".
|
|
23423
|
+
".windsurfrules"
|
|
23419
23424
|
];
|
|
23420
23425
|
function parseSemver(input) {
|
|
23421
23426
|
const plusIdx = input.indexOf("+");
|
|
@@ -23576,11 +23581,11 @@ function registerGlasstrace(options) {
|
|
|
23576
23581
|
setCoreState(CoreState.REGISTERING);
|
|
23577
23582
|
maybeWarnStaleAgentInstructions({
|
|
23578
23583
|
projectRoot: process.cwd(),
|
|
23579
|
-
sdkVersion: "1.
|
|
23584
|
+
sdkVersion: "1.11.0"
|
|
23580
23585
|
});
|
|
23581
23586
|
startRuntimeStateWriter({
|
|
23582
23587
|
projectRoot: process.cwd(),
|
|
23583
|
-
sdkVersion: "1.
|
|
23588
|
+
sdkVersion: "1.11.0"
|
|
23584
23589
|
});
|
|
23585
23590
|
const config2 = resolveConfig(options);
|
|
23586
23591
|
if (config2.verbose) {
|
|
@@ -23747,8 +23752,8 @@ async function backgroundInit(config2, anonKeyForInit, generation) {
|
|
|
23747
23752
|
if (config2.verbose) {
|
|
23748
23753
|
console.info("[glasstrace] Background init firing.");
|
|
23749
23754
|
}
|
|
23750
|
-
const healthReport = collectHealthReport("1.
|
|
23751
|
-
const initResult = await performInit(config2, anonKeyForInit, "1.
|
|
23755
|
+
const healthReport = collectHealthReport("1.11.0");
|
|
23756
|
+
const initResult = await performInit(config2, anonKeyForInit, "1.11.0", healthReport);
|
|
23752
23757
|
if (generation !== registrationGeneration) return;
|
|
23753
23758
|
const currentState = getCoreState();
|
|
23754
23759
|
if (currentState === CoreState.SHUTTING_DOWN || currentState === CoreState.SHUTDOWN) {
|
|
@@ -23771,7 +23776,7 @@ async function backgroundInit(config2, anonKeyForInit, generation) {
|
|
|
23771
23776
|
}
|
|
23772
23777
|
maybeInstallConsoleCapture();
|
|
23773
23778
|
if (didLastInitSucceed()) {
|
|
23774
|
-
startHeartbeat(config2, anonKeyForInit, "1.
|
|
23779
|
+
startHeartbeat(config2, anonKeyForInit, "1.11.0", generation, (newApiKey, accountId) => {
|
|
23775
23780
|
setAuthState(AuthState.CLAIMING);
|
|
23776
23781
|
emitLifecycleEvent("auth:claim_started", { accountId });
|
|
23777
23782
|
setResolvedApiKey(newApiKey);
|