@glasstrace/sdk 1.10.2 → 1.12.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.
Files changed (91) hide show
  1. package/README.md +63 -8
  2. package/dist/async-context/index.cjs +1189 -440
  3. package/dist/async-context/index.cjs.map +1 -1
  4. package/dist/async-context/index.js +2 -2
  5. package/dist/{capture-error-BeuEXXJO.d.cts → capture-error-CRQSqKgd.d.cts} +2 -2
  6. package/dist/{capture-error-D02pzB7q.d.ts → capture-error-CqCbjoMq.d.ts} +2 -2
  7. package/dist/{chunk-OXM2BZMF.js → chunk-4YRYR32D.js} +2 -2
  8. package/dist/{chunk-XG6WR2KS.js → chunk-6NKMAKMI.js} +3 -3
  9. package/dist/{chunk-6RKS3DNA.js → chunk-BN5DVIUO.js} +1176 -424
  10. package/dist/chunk-BN5DVIUO.js.map +1 -0
  11. package/dist/{chunk-QS5RZ2TC.js → chunk-CZQN6G4I.js} +28 -22
  12. package/dist/chunk-CZQN6G4I.js.map +1 -0
  13. package/dist/{chunk-D54FMQHF.js → chunk-FFNGE5RR.js} +2 -2
  14. package/dist/{chunk-RL43PU2X.js → chunk-J3ZCVE67.js} +2 -2
  15. package/dist/{chunk-BSVWJSVX.js → chunk-KBHGPQZ2.js} +2 -2
  16. package/dist/{chunk-CIKPFJOM.js → chunk-KOYZJN6G.js} +310 -20
  17. package/dist/chunk-KOYZJN6G.js.map +1 -0
  18. package/dist/{chunk-M5GO2SSO.js → chunk-M3ZTG4P5.js} +2 -2
  19. package/dist/{chunk-UMGZJYC4.js → chunk-V75ZB4G4.js} +10 -5
  20. package/dist/chunk-V75ZB4G4.js.map +1 -0
  21. package/dist/{chunk-ZBQQXVHD.js → chunk-YIEXKQYP.js} +2 -67
  22. package/dist/chunk-YIEXKQYP.js.map +1 -0
  23. package/dist/{chunk-QVTONMVZ.js → chunk-ZIL2IY4C.js} +2 -2
  24. package/dist/cli/init.cjs +1672 -576
  25. package/dist/cli/init.cjs.map +1 -1
  26. package/dist/cli/init.js +33 -20
  27. package/dist/cli/init.js.map +1 -1
  28. package/dist/cli/mcp-add.cjs +1509 -521
  29. package/dist/cli/mcp-add.cjs.map +1 -1
  30. package/dist/cli/mcp-add.js +34 -16
  31. package/dist/cli/mcp-add.js.map +1 -1
  32. package/dist/cli/status.cjs +6 -1
  33. package/dist/cli/status.cjs.map +1 -1
  34. package/dist/cli/status.js +7 -2
  35. package/dist/cli/status.js.map +1 -1
  36. package/dist/cli/uninit.cjs +6 -1
  37. package/dist/cli/uninit.cjs.map +1 -1
  38. package/dist/cli/uninit.js +4 -4
  39. package/dist/cli/upgrade-instructions.cjs +383 -112
  40. package/dist/cli/upgrade-instructions.cjs.map +1 -1
  41. package/dist/cli/upgrade-instructions.js +72 -20
  42. package/dist/cli/upgrade-instructions.js.map +1 -1
  43. package/dist/cli/validate.cjs +1168 -422
  44. package/dist/cli/validate.cjs.map +1 -1
  45. package/dist/cli/validate.js +2 -2
  46. package/dist/{correlation-id-NAapJ5jn.d.cts → correlation-id-CFpyJsKv.d.cts} +1 -1
  47. package/dist/{correlation-id-B_K8adD6.d.ts → correlation-id-DPXyY9-3.d.ts} +1 -1
  48. package/dist/edge-entry.cjs +1197 -448
  49. package/dist/edge-entry.cjs.map +1 -1
  50. package/dist/edge-entry.d.cts +2 -2
  51. package/dist/edge-entry.d.ts +2 -2
  52. package/dist/edge-entry.js +4 -4
  53. package/dist/index.cjs +1341 -553
  54. package/dist/index.cjs.map +1 -1
  55. package/dist/{index.d-CkTf_boH.d.cts → index.d-D-jdiIPU.d.cts} +1 -1
  56. package/dist/{index.d-CkTf_boH.d.ts → index.d-D-jdiIPU.d.ts} +1 -1
  57. package/dist/index.d.cts +4 -4
  58. package/dist/index.d.ts +4 -4
  59. package/dist/index.js +14 -7
  60. package/dist/index.js.map +1 -1
  61. package/dist/middleware/index.cjs +1192 -443
  62. package/dist/middleware/index.cjs.map +1 -1
  63. package/dist/middleware/index.js +2 -2
  64. package/dist/node-entry.cjs +1329 -551
  65. package/dist/node-entry.cjs.map +1 -1
  66. package/dist/node-entry.d.cts +3 -3
  67. package/dist/node-entry.d.ts +3 -3
  68. package/dist/node-entry.js +8 -8
  69. package/dist/node-subpath.cjs +1168 -422
  70. package/dist/node-subpath.cjs.map +1 -1
  71. package/dist/node-subpath.d.cts +1 -1
  72. package/dist/node-subpath.d.ts +1 -1
  73. package/dist/node-subpath.js +3 -3
  74. package/dist/{source-map-uploader-CLYCE2TZ.js → source-map-uploader-K67LTPBG.js} +3 -3
  75. package/dist/trpc/index.cjs +1187 -438
  76. package/dist/trpc/index.cjs.map +1 -1
  77. package/dist/trpc/index.js +1 -1
  78. package/package.json +2 -2
  79. package/dist/chunk-6RKS3DNA.js.map +0 -1
  80. package/dist/chunk-CIKPFJOM.js.map +0 -1
  81. package/dist/chunk-QS5RZ2TC.js.map +0 -1
  82. package/dist/chunk-UMGZJYC4.js.map +0 -1
  83. package/dist/chunk-ZBQQXVHD.js.map +0 -1
  84. /package/dist/{chunk-OXM2BZMF.js.map → chunk-4YRYR32D.js.map} +0 -0
  85. /package/dist/{chunk-XG6WR2KS.js.map → chunk-6NKMAKMI.js.map} +0 -0
  86. /package/dist/{chunk-D54FMQHF.js.map → chunk-FFNGE5RR.js.map} +0 -0
  87. /package/dist/{chunk-RL43PU2X.js.map → chunk-J3ZCVE67.js.map} +0 -0
  88. /package/dist/{chunk-BSVWJSVX.js.map → chunk-KBHGPQZ2.js.map} +0 -0
  89. /package/dist/{chunk-M5GO2SSO.js.map → chunk-M3ZTG4P5.js.map} +0 -0
  90. /package/dist/{chunk-QVTONMVZ.js.map → chunk-ZIL2IY4C.js.map} +0 -0
  91. /package/dist/{source-map-uploader-CLYCE2TZ.js.map → source-map-uploader-K67LTPBG.js.map} +0 -0
package/dist/cli/init.js CHANGED
@@ -4,10 +4,10 @@ import {
4
4
  } from "../chunk-2M57EO6U.js";
5
5
  import {
6
6
  verifyInitReachable
7
- } from "../chunk-XG6WR2KS.js";
7
+ } from "../chunk-6NKMAKMI.js";
8
8
  import {
9
9
  buildImportGraph
10
- } from "../chunk-BSVWJSVX.js";
10
+ } from "../chunk-KBHGPQZ2.js";
11
11
  import {
12
12
  resolveConfig
13
13
  } from "../chunk-VUZCLMIX.js";
@@ -21,12 +21,12 @@ import {
21
21
  unwrapCJSExport,
22
22
  unwrapExport,
23
23
  writeDiscoveryFile
24
- } from "../chunk-UMGZJYC4.js";
24
+ } from "../chunk-V75ZB4G4.js";
25
25
  import {
26
26
  detectAgents,
27
- generateInfoSection,
28
- generateMcpConfig
29
- } from "../chunk-CIKPFJOM.js";
27
+ generateMcpConfig,
28
+ injectAllTargets
29
+ } from "../chunk-KOYZJN6G.js";
30
30
  import {
31
31
  MCP_ENDPOINT,
32
32
  getOrCreateAnonKey,
@@ -37,17 +37,16 @@ import {
37
37
  readEnvLocalApiKey,
38
38
  resolveEffectiveMcpCredential,
39
39
  writeMcpMarker
40
- } from "../chunk-RL43PU2X.js";
41
- import "../chunk-6RKS3DNA.js";
40
+ } from "../chunk-J3ZCVE67.js";
41
+ import "../chunk-BN5DVIUO.js";
42
42
  import {
43
43
  NEXT_CONFIG_NAMES,
44
44
  formatAgentName
45
45
  } from "../chunk-NB7GJE4S.js";
46
46
  import {
47
- injectInfoSection,
48
47
  updateGitignore,
49
48
  writeMcpConfig
50
- } from "../chunk-ZBQQXVHD.js";
49
+ } from "../chunk-YIEXKQYP.js";
51
50
  import "../chunk-NSBPE2FW.js";
52
51
 
53
52
  // src/cli/init.ts
@@ -877,6 +876,7 @@ Then add this as the first statement in your register() function:
877
876
  agents = [];
878
877
  }
879
878
  const configuredNames = [];
879
+ const agentsWithMcpReady = [];
880
880
  for (const agent of agents) {
881
881
  try {
882
882
  const configContent = generateMcpConfig(agent, MCP_ENDPOINT, bearer);
@@ -891,6 +891,7 @@ Then add this as the first statement in your register() function:
891
891
  );
892
892
  if (agent.mcpConfigPath !== null && fs2.existsSync(agent.mcpConfigPath)) {
893
893
  anyConfigWritten = true;
894
+ agentsWithMcpReady.push(agent);
894
895
  }
895
896
  continue;
896
897
  }
@@ -901,15 +902,7 @@ Then add this as the first statement in your register() function:
901
902
  }
902
903
  anyConfigWritten = true;
903
904
  anyConfigRewrittenWithBearer = true;
904
- const sdkVersionForInject = true ? "1.10.2" : "0.0.0-dev";
905
- const infoContent = generateInfoSection(
906
- agent,
907
- MCP_ENDPOINT,
908
- sdkVersionForInject
909
- );
910
- if (infoContent !== "") {
911
- await injectInfoSection(agent, infoContent, projectRoot);
912
- }
905
+ agentsWithMcpReady.push(agent);
913
906
  if (agent.name !== "generic") {
914
907
  configuredNames.push(formatAgentName(agent.name));
915
908
  }
@@ -919,6 +912,26 @@ Then add this as the first statement in your register() function:
919
912
  );
920
913
  }
921
914
  }
915
+ const detectedNonGeneric = agents.filter((a) => a.name !== "generic");
916
+ const nonGenericReady = agentsWithMcpReady.filter(
917
+ (a) => a.name !== "generic"
918
+ );
919
+ const dispatchSet = detectedNonGeneric.length === 0 ? agentsWithMcpReady : nonGenericReady;
920
+ if (dispatchSet.length > 0) {
921
+ const sdkVersionForInject = true ? "1.12.0" : "0.0.0-dev";
922
+ try {
923
+ await injectAllTargets(
924
+ dispatchSet,
925
+ MCP_ENDPOINT,
926
+ sdkVersionForInject,
927
+ projectRoot
928
+ );
929
+ } catch (injectErr) {
930
+ warnings.push(
931
+ `Failed to write agent-instruction files: ${injectErr instanceof Error ? injectErr.message : String(injectErr)}`
932
+ );
933
+ }
934
+ }
922
935
  if (configuredNames.length > 0) {
923
936
  summary.push(`Configured MCP for: ${configuredNames.join(", ")}`);
924
937
  } else if (anyConfigWritten) {
@@ -1007,7 +1020,7 @@ async function verifyAnonKeyRegistration(projectRoot) {
1007
1020
  }
1008
1021
  const baseConfig = resolveConfig({ apiKey: devKey });
1009
1022
  const config = { ...baseConfig, apiKey: devKey };
1010
- const sdkVersion = true ? "1.10.2" : "0.0.0-dev";
1023
+ const sdkVersion = true ? "1.12.0" : "0.0.0-dev";
1011
1024
  const result = await verifyInitReachable(config, anonKey, sdkVersion);
1012
1025
  if (result.ok) {
1013
1026
  return { outcome: "verified" };