@glasstrace/sdk 1.6.1 → 1.8.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/dist/cli/init.cjs CHANGED
@@ -16994,7 +16994,7 @@ async function mcpAdd(options) {
16994
16994
  const bearer = resolved.effective.key;
16995
16995
  for (const agent of targetAgents) {
16996
16996
  const name = formatAgentName(agent.name);
16997
- const sdkVersion = true ? "1.6.1" : "0.0.0-dev";
16997
+ const sdkVersion = true ? "1.8.0" : "0.0.0-dev";
16998
16998
  if (agent.name !== "generic") {
16999
16999
  const cliSuccess = await registerViaCli(agent, bearer);
17000
17000
  if (cliSuccess) {
@@ -17262,7 +17262,7 @@ async function runUpgradeInstructions(options) {
17262
17262
  );
17263
17263
  return { exitCode: 1, refreshed, skipped, warnings, errors };
17264
17264
  }
17265
- const sdkVersion = true ? "1.6.1" : "0.0.0-dev";
17265
+ const sdkVersion = true ? "1.8.0" : "0.0.0-dev";
17266
17266
  for (const agent of agents) {
17267
17267
  if (agent.infoFilePath === null) {
17268
17268
  continue;
@@ -17517,6 +17517,7 @@ var init_exports = {};
17517
17517
  __export(init_exports, {
17518
17518
  decideMcpConfigAction: () => decideMcpConfigAction,
17519
17519
  gitignoreExcludesDiscoveryFile: () => gitignoreExcludesDiscoveryFile,
17520
+ isHelpInvocation: () => isHelpInvocation,
17520
17521
  meetsNodeVersion: () => meetsNodeVersion,
17521
17522
  rollbackSteps: () => rollbackSteps,
17522
17523
  runInit: () => runInit,
@@ -18625,6 +18626,7 @@ async function runInit(options) {
18625
18626
  const summary = [];
18626
18627
  const warnings = [];
18627
18628
  const errors = [];
18629
+ let discoveryFileWriteFailed = false;
18628
18630
  let projectRoot;
18629
18631
  try {
18630
18632
  const classification = resolveProjectRoot(options.projectRoot);
@@ -18801,6 +18803,7 @@ Then add this as the first statement in your register() function:
18801
18803
  warnings.push(
18802
18804
  `Failed to write ${relPath}${discoveryResult.error !== void 0 ? `: ${discoveryResult.error}` : ""}. The Glasstrace browser extension cannot discover this project until the file is written; rerun \`glasstrace init\` after fixing the underlying error.`
18803
18805
  );
18806
+ discoveryFileWriteFailed = true;
18804
18807
  break;
18805
18808
  }
18806
18809
  const gitignorePath = path9.join(projectRoot, ".gitignore");
@@ -18821,6 +18824,7 @@ Then add this as the first statement in your register() function:
18821
18824
  resolveStaticRoot(projectRoot).layout
18822
18825
  )}: ${err instanceof Error ? err.message : String(err)}`
18823
18826
  );
18827
+ discoveryFileWriteFailed = true;
18824
18828
  }
18825
18829
  let anyConfigWritten = false;
18826
18830
  let anyConfigRewrittenWithBearer = false;
@@ -18898,7 +18902,7 @@ Then add this as the first statement in your register() function:
18898
18902
  }
18899
18903
  anyConfigWritten = true;
18900
18904
  anyConfigRewrittenWithBearer = true;
18901
- const sdkVersionForInject = true ? "1.6.1" : "0.0.0-dev";
18905
+ const sdkVersionForInject = true ? "1.8.0" : "0.0.0-dev";
18902
18906
  const infoContent = generateInfoSection(
18903
18907
  agent,
18904
18908
  MCP_ENDPOINT,
@@ -18980,6 +18984,9 @@ Then add this as the first statement in your register() function:
18980
18984
  summary.push("Skipped anon key verification (no anon key on disk)");
18981
18985
  }
18982
18986
  }
18987
+ if (discoveryFileWriteFailed) {
18988
+ return { exitCode: 1, summary, warnings, errors };
18989
+ }
18983
18990
  return { exitCode: 0, summary, warnings, errors };
18984
18991
  }
18985
18992
  async function verifyAnonKeyRegistration(projectRoot) {
@@ -19001,7 +19008,7 @@ async function verifyAnonKeyRegistration(projectRoot) {
19001
19008
  }
19002
19009
  const baseConfig = resolveConfig({ apiKey: devKey });
19003
19010
  const config2 = { ...baseConfig, apiKey: devKey };
19004
- const sdkVersion = true ? "1.6.1" : "0.0.0-dev";
19011
+ const sdkVersion = true ? "1.8.0" : "0.0.0-dev";
19005
19012
  const result = await verifyInitReachable(config2, anonKey, sdkVersion);
19006
19013
  if (result.ok) {
19007
19014
  return { outcome: "verified" };
@@ -19051,7 +19058,11 @@ function parseArgs(argv) {
19051
19058
  }
19052
19059
  var scriptPath = typeof process !== "undefined" && process.argv[1] !== void 0 ? process.argv[1].replace(/\\/g, "/") : void 0;
19053
19060
  var scriptBasename = scriptPath !== void 0 ? path9.basename(scriptPath) : void 0;
19054
- var isDirectExecution = scriptPath !== void 0 && (scriptPath.endsWith("/cli/init.js") || scriptPath.endsWith("/cli/init.ts") || scriptBasename === "glasstrace");
19061
+ var isDirectExecution = scriptPath !== void 0 && (scriptPath.endsWith("/cli/init.js") || scriptPath.endsWith("/cli/init.cjs") || scriptPath.endsWith("/cli/init.ts") || scriptBasename === "glasstrace");
19062
+ function isHelpInvocation(argv) {
19063
+ return argv.some((arg) => arg === "--help" || arg === "-h");
19064
+ }
19065
+ var HELP_TEXT = "glasstrace \u2014 Glasstrace SDK CLI\n\nUsage:\n glasstrace init [--yes] [--coverage-map] [--force] [--validate]\n glasstrace uninit [--dry-run] [--force]\n glasstrace status [--json]\n glasstrace mcp add [--force] [--dry-run]\n glasstrace upgrade-instructions\n\nRun a command without arguments to see its defaults.\nDocs: https://glasstrace.dev/docs/cli\n";
19055
19066
  if (isDirectExecution) {
19056
19067
  if (!meetsNodeVersion(20)) {
19057
19068
  process.stderr.write(
@@ -19060,6 +19071,10 @@ if (isDirectExecution) {
19060
19071
  );
19061
19072
  process.exit(1);
19062
19073
  }
19074
+ if (isHelpInvocation(process.argv.slice(2))) {
19075
+ process.stdout.write(HELP_TEXT);
19076
+ process.exit(0);
19077
+ }
19063
19078
  const subcommand = process.argv[2];
19064
19079
  if (subcommand === "mcp") {
19065
19080
  if (process.argv[3] === "add") {
@@ -19302,6 +19317,7 @@ Usage:
19302
19317
  0 && (module.exports = {
19303
19318
  decideMcpConfigAction,
19304
19319
  gitignoreExcludesDiscoveryFile,
19320
+ isHelpInvocation,
19305
19321
  meetsNodeVersion,
19306
19322
  rollbackSteps,
19307
19323
  runInit,