@glasstrace/sdk 0.13.5 → 0.14.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/{chunk-DF52INSK.js → chunk-ECEN724Y.js} +2 -2
- package/dist/{chunk-7MHQRVVW.js → chunk-ERGEG4ZQ.js} +2 -3
- package/dist/chunk-ERGEG4ZQ.js.map +1 -0
- package/dist/{chunk-AMFO5UL4.js → chunk-UPS5BGER.js} +2 -2
- package/dist/{chunk-UJ74MD4Y.js → chunk-YMEXDDTA.js} +7 -3
- package/dist/{chunk-UJ74MD4Y.js.map → chunk-YMEXDDTA.js.map} +1 -1
- package/dist/cli/init.cjs +68 -3
- package/dist/cli/init.cjs.map +1 -1
- package/dist/cli/init.js +3 -3
- package/dist/cli/mcp-add.cjs +2 -1
- package/dist/cli/mcp-add.cjs.map +1 -1
- package/dist/cli/mcp-add.js +2 -2
- package/dist/cli/status.cjs +65 -1
- package/dist/cli/status.cjs.map +1 -1
- package/dist/cli/status.d.cts +22 -1
- package/dist/cli/status.d.ts +22 -1
- package/dist/cli/status.js +65 -1
- package/dist/cli/status.js.map +1 -1
- package/dist/index.cjs +825 -62
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +71 -2
- package/dist/index.d.ts +71 -2
- package/dist/index.js +815 -64
- package/dist/index.js.map +1 -1
- package/dist/{source-map-uploader-EWA2XQI4.js → source-map-uploader-W6VPGY26.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-7MHQRVVW.js.map +0 -1
- /package/dist/{chunk-DF52INSK.js.map → chunk-ECEN724Y.js.map} +0 -0
- /package/dist/{chunk-AMFO5UL4.js.map → chunk-UPS5BGER.js.map} +0 -0
- /package/dist/{source-map-uploader-EWA2XQI4.js.map → source-map-uploader-W6VPGY26.js.map} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -38,6 +38,7 @@ declare const CaptureConfigSchema: z.ZodObject<{
|
|
|
38
38
|
fullConsoleOutput: z.ZodBoolean;
|
|
39
39
|
importGraph: z.ZodBoolean;
|
|
40
40
|
consoleErrors: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
41
|
+
errorResponseBodies: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
41
42
|
}, z.core.$strip>;
|
|
42
43
|
type CaptureConfig = z.infer<typeof CaptureConfigSchema>;
|
|
43
44
|
/** Developer-facing config for registerGlasstrace(). */
|
|
@@ -102,6 +103,7 @@ declare const SdkInitResponseSchema: z.ZodObject<{
|
|
|
102
103
|
fullConsoleOutput: z.ZodBoolean;
|
|
103
104
|
importGraph: z.ZodBoolean;
|
|
104
105
|
consoleErrors: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
106
|
+
errorResponseBodies: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
105
107
|
}, z.core.$strip>;
|
|
106
108
|
subscriptionStatus: z.ZodString;
|
|
107
109
|
linkedAccountId: z.ZodOptional<z.ZodString>;
|
|
@@ -361,7 +363,7 @@ interface GlasstraceExporterOptions {
|
|
|
361
363
|
environment: string | undefined;
|
|
362
364
|
endpointUrl: string;
|
|
363
365
|
createDelegate: ((url: string, headers: Record<string, string>) => SpanExporter) | null;
|
|
364
|
-
/**
|
|
366
|
+
/** When true, logs diagnostic details about enrichment decisions via sdkLog. */
|
|
365
367
|
verbose?: boolean;
|
|
366
368
|
}
|
|
367
369
|
/**
|
|
@@ -383,6 +385,7 @@ declare class GlasstraceExporter implements SpanExporter {
|
|
|
383
385
|
private readonly environment;
|
|
384
386
|
private readonly endpointUrl;
|
|
385
387
|
private readonly createDelegateFn;
|
|
388
|
+
private readonly verbose;
|
|
386
389
|
private delegate;
|
|
387
390
|
private delegateKey;
|
|
388
391
|
private pendingBatches;
|
|
@@ -498,6 +501,72 @@ type NextConfig = Record<string, unknown>;
|
|
|
498
501
|
*/
|
|
499
502
|
declare function withGlasstraceConfig(nextConfig: NextConfig): NextConfig;
|
|
500
503
|
|
|
504
|
+
/**
|
|
505
|
+
* Returns true when the SDK is in ACTIVE or ACTIVE_DEGRADED state.
|
|
506
|
+
*/
|
|
507
|
+
declare function isReady(): boolean;
|
|
508
|
+
/**
|
|
509
|
+
* Resolves when the SDK reaches ACTIVE or ACTIVE_DEGRADED.
|
|
510
|
+
* Rejects on PRODUCTION_DISABLED, REGISTRATION_FAILED, or timeout.
|
|
511
|
+
*
|
|
512
|
+
* Checks current state synchronously first — resolves/rejects immediately
|
|
513
|
+
* if the SDK has already reached a terminal or ready state.
|
|
514
|
+
*/
|
|
515
|
+
declare function waitForReady(timeoutMs?: number): Promise<void>;
|
|
516
|
+
/**
|
|
517
|
+
* Simplified public state query for external consumers.
|
|
518
|
+
* Hides implementation details like coexistence scenarios.
|
|
519
|
+
*/
|
|
520
|
+
declare function getStatus(): {
|
|
521
|
+
ready: boolean;
|
|
522
|
+
mode: "anonymous" | "authenticated" | "claiming" | "disabled";
|
|
523
|
+
tracing: "active" | "degraded" | "not-configured" | "coexistence";
|
|
524
|
+
};
|
|
525
|
+
|
|
526
|
+
/**
|
|
527
|
+
* OTel Coexistence Public API
|
|
528
|
+
*
|
|
529
|
+
* Provides createGlasstraceSpanProcessor() for developers who want to
|
|
530
|
+
* manually integrate Glasstrace with their existing OTel provider
|
|
531
|
+
* (e.g., Sentry's openTelemetrySpanProcessors config option).
|
|
532
|
+
*
|
|
533
|
+
* Also provides nudge messaging that guides developers toward this
|
|
534
|
+
* clean integration path when auto-attach is used.
|
|
535
|
+
*
|
|
536
|
+
* Design: sdk-otel-coexistence.md Sections 3, 5, 6
|
|
537
|
+
*/
|
|
538
|
+
|
|
539
|
+
/**
|
|
540
|
+
* Creates a Glasstrace span processor for manual integration with an
|
|
541
|
+
* existing OTel provider.
|
|
542
|
+
*
|
|
543
|
+
* Use this when another tool (e.g., Sentry) owns the OTel provider and
|
|
544
|
+
* you want to add Glasstrace to their processor list:
|
|
545
|
+
*
|
|
546
|
+
* @example
|
|
547
|
+
* ```ts
|
|
548
|
+
* import * as Sentry from "@sentry/nextjs";
|
|
549
|
+
* import { createGlasstraceSpanProcessor } from "@glasstrace/sdk";
|
|
550
|
+
*
|
|
551
|
+
* Sentry.init({
|
|
552
|
+
* dsn: "...",
|
|
553
|
+
* openTelemetrySpanProcessors: [createGlasstraceSpanProcessor()],
|
|
554
|
+
* });
|
|
555
|
+
* ```
|
|
556
|
+
*
|
|
557
|
+
* **Important:** `registerGlasstrace()` is still required even when using
|
|
558
|
+
* this function. The processor handles span transport (enrichment and
|
|
559
|
+
* export). `registerGlasstrace()` handles everything else: init calls,
|
|
560
|
+
* config sync, session management, anonymous key generation, discovery
|
|
561
|
+
* endpoint, and health reporting.
|
|
562
|
+
*
|
|
563
|
+
* @param options - Optional SDK configuration. If omitted, uses the same
|
|
564
|
+
* config as registerGlasstrace() (environment variables).
|
|
565
|
+
* @returns A BatchSpanProcessor wrapping a GlasstraceExporter with the
|
|
566
|
+
* branded Symbol.for('glasstrace.exporter') for coexistence detection.
|
|
567
|
+
*/
|
|
568
|
+
declare function createGlasstraceSpanProcessor(options?: GlasstraceOptions): SpanProcessor;
|
|
569
|
+
|
|
501
570
|
interface SourceMapEntry {
|
|
502
571
|
filePath: string;
|
|
503
572
|
content: string;
|
|
@@ -658,4 +727,4 @@ declare function extractImports(fileContent: string): string[];
|
|
|
658
727
|
*/
|
|
659
728
|
declare function buildImportGraph(projectRoot: string): Promise<ImportGraphPayload>;
|
|
660
729
|
|
|
661
|
-
export { type AutoUploadOptions, type BlobUploader, type ClaimState, type FetchTarget, GlasstraceExporter, type GlasstraceExporterOptions, GlasstraceSpanProcessor, type InitClaimResult, PRESIGNED_THRESHOLD_BYTES, type ResolvedConfig, SdkError, SessionManager, type SourceMapEntry, type SourceMapFileInfo, buildImportGraph, captureError, classifyFetchTarget, collectSourceMaps, computeBuildHash, createDiscoveryHandler, deriveSessionId, discoverSourceMapFiles, discoverTestFiles, extractImports, getActiveConfig, getDateString, getDiscoveryHandler, getLinkedAccountId, getOrCreateAnonKey, getOrigin, isAnonymousMode, isProductionDisabled, loadCachedConfig, performInit, readAnonKey, readEnvVars, registerGlasstrace, resolveConfig, saveCachedConfig, sendInitRequest, uploadSourceMaps, uploadSourceMapsAuto, uploadSourceMapsPresigned, withGlasstraceConfig };
|
|
730
|
+
export { type AutoUploadOptions, type BlobUploader, type ClaimState, type FetchTarget, GlasstraceExporter, type GlasstraceExporterOptions, GlasstraceSpanProcessor, type InitClaimResult, PRESIGNED_THRESHOLD_BYTES, type ResolvedConfig, SdkError, SessionManager, type SourceMapEntry, type SourceMapFileInfo, buildImportGraph, captureError, classifyFetchTarget, collectSourceMaps, computeBuildHash, createDiscoveryHandler, createGlasstraceSpanProcessor, deriveSessionId, discoverSourceMapFiles, discoverTestFiles, extractImports, getActiveConfig, getDateString, getDiscoveryHandler, getLinkedAccountId, getOrCreateAnonKey, getOrigin, getStatus, isAnonymousMode, isProductionDisabled, isReady, loadCachedConfig, performInit, readAnonKey, readEnvVars, registerGlasstrace, resolveConfig, saveCachedConfig, sendInitRequest, uploadSourceMaps, uploadSourceMapsAuto, uploadSourceMapsPresigned, waitForReady, withGlasstraceConfig };
|
package/dist/index.d.ts
CHANGED
|
@@ -38,6 +38,7 @@ declare const CaptureConfigSchema: z.ZodObject<{
|
|
|
38
38
|
fullConsoleOutput: z.ZodBoolean;
|
|
39
39
|
importGraph: z.ZodBoolean;
|
|
40
40
|
consoleErrors: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
41
|
+
errorResponseBodies: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
41
42
|
}, z.core.$strip>;
|
|
42
43
|
type CaptureConfig = z.infer<typeof CaptureConfigSchema>;
|
|
43
44
|
/** Developer-facing config for registerGlasstrace(). */
|
|
@@ -102,6 +103,7 @@ declare const SdkInitResponseSchema: z.ZodObject<{
|
|
|
102
103
|
fullConsoleOutput: z.ZodBoolean;
|
|
103
104
|
importGraph: z.ZodBoolean;
|
|
104
105
|
consoleErrors: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
106
|
+
errorResponseBodies: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
105
107
|
}, z.core.$strip>;
|
|
106
108
|
subscriptionStatus: z.ZodString;
|
|
107
109
|
linkedAccountId: z.ZodOptional<z.ZodString>;
|
|
@@ -361,7 +363,7 @@ interface GlasstraceExporterOptions {
|
|
|
361
363
|
environment: string | undefined;
|
|
362
364
|
endpointUrl: string;
|
|
363
365
|
createDelegate: ((url: string, headers: Record<string, string>) => SpanExporter) | null;
|
|
364
|
-
/**
|
|
366
|
+
/** When true, logs diagnostic details about enrichment decisions via sdkLog. */
|
|
365
367
|
verbose?: boolean;
|
|
366
368
|
}
|
|
367
369
|
/**
|
|
@@ -383,6 +385,7 @@ declare class GlasstraceExporter implements SpanExporter {
|
|
|
383
385
|
private readonly environment;
|
|
384
386
|
private readonly endpointUrl;
|
|
385
387
|
private readonly createDelegateFn;
|
|
388
|
+
private readonly verbose;
|
|
386
389
|
private delegate;
|
|
387
390
|
private delegateKey;
|
|
388
391
|
private pendingBatches;
|
|
@@ -498,6 +501,72 @@ type NextConfig = Record<string, unknown>;
|
|
|
498
501
|
*/
|
|
499
502
|
declare function withGlasstraceConfig(nextConfig: NextConfig): NextConfig;
|
|
500
503
|
|
|
504
|
+
/**
|
|
505
|
+
* Returns true when the SDK is in ACTIVE or ACTIVE_DEGRADED state.
|
|
506
|
+
*/
|
|
507
|
+
declare function isReady(): boolean;
|
|
508
|
+
/**
|
|
509
|
+
* Resolves when the SDK reaches ACTIVE or ACTIVE_DEGRADED.
|
|
510
|
+
* Rejects on PRODUCTION_DISABLED, REGISTRATION_FAILED, or timeout.
|
|
511
|
+
*
|
|
512
|
+
* Checks current state synchronously first — resolves/rejects immediately
|
|
513
|
+
* if the SDK has already reached a terminal or ready state.
|
|
514
|
+
*/
|
|
515
|
+
declare function waitForReady(timeoutMs?: number): Promise<void>;
|
|
516
|
+
/**
|
|
517
|
+
* Simplified public state query for external consumers.
|
|
518
|
+
* Hides implementation details like coexistence scenarios.
|
|
519
|
+
*/
|
|
520
|
+
declare function getStatus(): {
|
|
521
|
+
ready: boolean;
|
|
522
|
+
mode: "anonymous" | "authenticated" | "claiming" | "disabled";
|
|
523
|
+
tracing: "active" | "degraded" | "not-configured" | "coexistence";
|
|
524
|
+
};
|
|
525
|
+
|
|
526
|
+
/**
|
|
527
|
+
* OTel Coexistence Public API
|
|
528
|
+
*
|
|
529
|
+
* Provides createGlasstraceSpanProcessor() for developers who want to
|
|
530
|
+
* manually integrate Glasstrace with their existing OTel provider
|
|
531
|
+
* (e.g., Sentry's openTelemetrySpanProcessors config option).
|
|
532
|
+
*
|
|
533
|
+
* Also provides nudge messaging that guides developers toward this
|
|
534
|
+
* clean integration path when auto-attach is used.
|
|
535
|
+
*
|
|
536
|
+
* Design: sdk-otel-coexistence.md Sections 3, 5, 6
|
|
537
|
+
*/
|
|
538
|
+
|
|
539
|
+
/**
|
|
540
|
+
* Creates a Glasstrace span processor for manual integration with an
|
|
541
|
+
* existing OTel provider.
|
|
542
|
+
*
|
|
543
|
+
* Use this when another tool (e.g., Sentry) owns the OTel provider and
|
|
544
|
+
* you want to add Glasstrace to their processor list:
|
|
545
|
+
*
|
|
546
|
+
* @example
|
|
547
|
+
* ```ts
|
|
548
|
+
* import * as Sentry from "@sentry/nextjs";
|
|
549
|
+
* import { createGlasstraceSpanProcessor } from "@glasstrace/sdk";
|
|
550
|
+
*
|
|
551
|
+
* Sentry.init({
|
|
552
|
+
* dsn: "...",
|
|
553
|
+
* openTelemetrySpanProcessors: [createGlasstraceSpanProcessor()],
|
|
554
|
+
* });
|
|
555
|
+
* ```
|
|
556
|
+
*
|
|
557
|
+
* **Important:** `registerGlasstrace()` is still required even when using
|
|
558
|
+
* this function. The processor handles span transport (enrichment and
|
|
559
|
+
* export). `registerGlasstrace()` handles everything else: init calls,
|
|
560
|
+
* config sync, session management, anonymous key generation, discovery
|
|
561
|
+
* endpoint, and health reporting.
|
|
562
|
+
*
|
|
563
|
+
* @param options - Optional SDK configuration. If omitted, uses the same
|
|
564
|
+
* config as registerGlasstrace() (environment variables).
|
|
565
|
+
* @returns A BatchSpanProcessor wrapping a GlasstraceExporter with the
|
|
566
|
+
* branded Symbol.for('glasstrace.exporter') for coexistence detection.
|
|
567
|
+
*/
|
|
568
|
+
declare function createGlasstraceSpanProcessor(options?: GlasstraceOptions): SpanProcessor;
|
|
569
|
+
|
|
501
570
|
interface SourceMapEntry {
|
|
502
571
|
filePath: string;
|
|
503
572
|
content: string;
|
|
@@ -658,4 +727,4 @@ declare function extractImports(fileContent: string): string[];
|
|
|
658
727
|
*/
|
|
659
728
|
declare function buildImportGraph(projectRoot: string): Promise<ImportGraphPayload>;
|
|
660
729
|
|
|
661
|
-
export { type AutoUploadOptions, type BlobUploader, type ClaimState, type FetchTarget, GlasstraceExporter, type GlasstraceExporterOptions, GlasstraceSpanProcessor, type InitClaimResult, PRESIGNED_THRESHOLD_BYTES, type ResolvedConfig, SdkError, SessionManager, type SourceMapEntry, type SourceMapFileInfo, buildImportGraph, captureError, classifyFetchTarget, collectSourceMaps, computeBuildHash, createDiscoveryHandler, deriveSessionId, discoverSourceMapFiles, discoverTestFiles, extractImports, getActiveConfig, getDateString, getDiscoveryHandler, getLinkedAccountId, getOrCreateAnonKey, getOrigin, isAnonymousMode, isProductionDisabled, loadCachedConfig, performInit, readAnonKey, readEnvVars, registerGlasstrace, resolveConfig, saveCachedConfig, sendInitRequest, uploadSourceMaps, uploadSourceMapsAuto, uploadSourceMapsPresigned, withGlasstraceConfig };
|
|
730
|
+
export { type AutoUploadOptions, type BlobUploader, type ClaimState, type FetchTarget, GlasstraceExporter, type GlasstraceExporterOptions, GlasstraceSpanProcessor, type InitClaimResult, PRESIGNED_THRESHOLD_BYTES, type ResolvedConfig, SdkError, SessionManager, type SourceMapEntry, type SourceMapFileInfo, buildImportGraph, captureError, classifyFetchTarget, collectSourceMaps, computeBuildHash, createDiscoveryHandler, createGlasstraceSpanProcessor, deriveSessionId, discoverSourceMapFiles, discoverTestFiles, extractImports, getActiveConfig, getDateString, getDiscoveryHandler, getLinkedAccountId, getOrCreateAnonKey, getOrigin, getStatus, isAnonymousMode, isProductionDisabled, isReady, loadCachedConfig, performInit, readAnonKey, readEnvVars, registerGlasstrace, resolveConfig, saveCachedConfig, sendInitRequest, uploadSourceMaps, uploadSourceMapsAuto, uploadSourceMapsPresigned, waitForReady, withGlasstraceConfig };
|