@morsehq-dev/sdk 0.4.0 → 0.4.1-rc.1
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/anthropic/index.cjs +10 -10
- package/dist/anthropic/index.js +3 -3
- package/dist/anthropic-agent-sdk/index.cjs +32 -32
- package/dist/anthropic-agent-sdk/index.js +5 -5
- package/dist/browser/anthropic/index.cjs +10 -10
- package/dist/browser/anthropic/index.js +3 -3
- package/dist/browser/anthropic-agent-sdk/index.cjs +32 -32
- package/dist/browser/anthropic-agent-sdk/index.js +5 -5
- package/dist/{chunk-7EO7MQBA.cjs → browser/chunk-3BGG7GH3.cjs} +6 -6
- package/dist/browser/{chunk-KRBADE6R.cjs.map → chunk-3BGG7GH3.cjs.map} +1 -1
- package/dist/browser/{chunk-JBOYFQSB.js → chunk-AYNX24P5.js} +3 -3
- package/dist/browser/{chunk-JBOYFQSB.js.map → chunk-AYNX24P5.js.map} +1 -1
- package/dist/{chunk-ME5JALGT.js → browser/chunk-DOLWR7LD.js} +4 -4
- package/dist/browser/{chunk-7MSXWGAH.js.map → chunk-DOLWR7LD.js.map} +1 -1
- package/dist/browser/{chunk-O4HG3OSK.cjs → chunk-DXWHT3HK.cjs} +13 -4
- package/dist/browser/chunk-DXWHT3HK.cjs.map +1 -0
- package/dist/browser/{chunk-B7DEUDP6.cjs → chunk-EFUQVASI.cjs} +15 -15
- package/dist/browser/{chunk-B7DEUDP6.cjs.map → chunk-EFUQVASI.cjs.map} +1 -1
- package/dist/browser/{chunk-5J2QBK75.js → chunk-F3B4UR64.js} +13 -4
- package/dist/browser/chunk-F3B4UR64.js.map +1 -0
- package/dist/{chunk-HDAFUKQ3.js → browser/chunk-F7BGQ26H.js} +4 -4
- package/dist/browser/{chunk-TYDG747E.js.map → chunk-F7BGQ26H.js.map} +1 -1
- package/dist/browser/{chunk-YAOBFRKP.js → chunk-GWJYOQNC.js} +4 -4
- package/dist/browser/{chunk-YAOBFRKP.js.map → chunk-GWJYOQNC.js.map} +1 -1
- package/dist/browser/{chunk-TZRSDDFP.cjs → chunk-HGN7J3EU.cjs} +12 -12
- package/dist/browser/{chunk-TZRSDDFP.cjs.map → chunk-HGN7J3EU.cjs.map} +1 -1
- package/dist/browser/{chunk-Z22Q2ONC.cjs → chunk-M2GZJ3RS.cjs} +14 -14
- package/dist/browser/{chunk-Z22Q2ONC.cjs.map → chunk-M2GZJ3RS.cjs.map} +1 -1
- package/dist/browser/{chunk-NQG2IAQS.js → chunk-YHV5GL32.js} +3 -3
- package/dist/browser/{chunk-NQG2IAQS.js.map → chunk-YHV5GL32.js.map} +1 -1
- package/dist/{chunk-VXDBDPDR.cjs → browser/chunk-YNUZGKUA.cjs} +7 -7
- package/dist/browser/{chunk-MCJYZH6W.cjs.map → chunk-YNUZGKUA.cjs.map} +1 -1
- package/dist/browser/index.cjs +80 -80
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.js +7 -7
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/integrations/pino.cjs +4 -4
- package/dist/browser/integrations/pino.js +3 -3
- package/dist/browser/langchain/index.cjs +17 -17
- package/dist/browser/langchain/index.js +2 -2
- package/dist/browser/langgraph/index.cjs +21 -21
- package/dist/browser/langgraph/index.js +4 -4
- package/dist/browser/openai/index.cjs +5 -5
- package/dist/browser/openai/index.js +1 -1
- package/dist/browser/openai-agents/index.cjs +32 -32
- package/dist/browser/openai-agents/index.js +4 -4
- package/dist/browser/vercel-ai/index.cjs +14 -14
- package/dist/browser/vercel-ai/index.js +3 -3
- package/dist/{chunk-KZBCOZIQ.cjs → chunk-5D6SBSEI.cjs} +15 -15
- package/dist/{chunk-KZBCOZIQ.cjs.map → chunk-5D6SBSEI.cjs.map} +1 -1
- package/dist/{chunk-ZKUGOWER.js → chunk-AEFUXEKV.js} +3 -3
- package/dist/{chunk-ZKUGOWER.js.map → chunk-AEFUXEKV.js.map} +1 -1
- package/dist/{chunk-FJUNILZT.cjs → chunk-HNCWTENX.cjs} +13 -4
- package/dist/chunk-HNCWTENX.cjs.map +1 -0
- package/dist/{chunk-7YCENA54.cjs → chunk-LQI63FHF.cjs} +14 -14
- package/dist/{chunk-7YCENA54.cjs.map → chunk-LQI63FHF.cjs.map} +1 -1
- package/dist/{chunk-TQWI4UYO.js → chunk-LTKGLXAE.js} +13 -4
- package/dist/chunk-LTKGLXAE.js.map +1 -0
- package/dist/{chunk-RTL23YOQ.js → chunk-POCQNSVD.js} +3 -3
- package/dist/{chunk-RTL23YOQ.js.map → chunk-POCQNSVD.js.map} +1 -1
- package/dist/{chunk-PVHDEPRE.cjs → chunk-QXRJUPDP.cjs} +12 -12
- package/dist/{chunk-PVHDEPRE.cjs.map → chunk-QXRJUPDP.cjs.map} +1 -1
- package/dist/{browser/chunk-TYDG747E.js → chunk-SBGY5NS4.js} +4 -4
- package/dist/{chunk-HDAFUKQ3.js.map → chunk-SBGY5NS4.js.map} +1 -1
- package/dist/{chunk-CKFOGDUF.js → chunk-STK4KJQ6.js} +4 -4
- package/dist/{chunk-CKFOGDUF.js.map → chunk-STK4KJQ6.js.map} +1 -1
- package/dist/{browser/chunk-KRBADE6R.cjs → chunk-T2KW3P23.cjs} +6 -6
- package/dist/{chunk-7EO7MQBA.cjs.map → chunk-T2KW3P23.cjs.map} +1 -1
- package/dist/{browser/chunk-7MSXWGAH.js → chunk-V5J6J4ZR.js} +4 -4
- package/dist/{chunk-ME5JALGT.js.map → chunk-V5J6J4ZR.js.map} +1 -1
- package/dist/{browser/chunk-MCJYZH6W.cjs → chunk-Y7SVGUKY.cjs} +7 -7
- package/dist/{chunk-VXDBDPDR.cjs.map → chunk-Y7SVGUKY.cjs.map} +1 -1
- package/dist/index.cjs +87 -87
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/dist/integrations/pino.cjs +4 -4
- package/dist/integrations/pino.js +3 -3
- package/dist/langchain/index.cjs +17 -17
- package/dist/langchain/index.js +2 -2
- package/dist/langgraph/index.cjs +21 -21
- package/dist/langgraph/index.js +4 -4
- package/dist/openai/index.cjs +5 -5
- package/dist/openai/index.js +1 -1
- package/dist/openai-agents/index.cjs +32 -32
- package/dist/openai-agents/index.js +4 -4
- package/dist/vercel-ai/index.cjs +14 -14
- package/dist/vercel-ai/index.js +3 -3
- package/package.json +1 -1
- package/dist/browser/chunk-5J2QBK75.js.map +0 -1
- package/dist/browser/chunk-O4HG3OSK.cjs.map +0 -1
- package/dist/chunk-FJUNILZT.cjs.map +0 -1
- package/dist/chunk-TQWI4UYO.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkLQI63FHF_cjs = require('./chunk-LQI63FHF.cjs');
|
|
4
|
+
var chunkQXRJUPDP_cjs = require('./chunk-QXRJUPDP.cjs');
|
|
5
|
+
var chunkT2KW3P23_cjs = require('./chunk-T2KW3P23.cjs');
|
|
6
6
|
require('./chunk-KBWPNIH4.cjs');
|
|
7
|
-
var
|
|
7
|
+
var chunkHNCWTENX_cjs = require('./chunk-HNCWTENX.cjs');
|
|
8
8
|
var module$1 = require('module');
|
|
9
9
|
var instrumentationPg = require('@opentelemetry/instrumentation-pg');
|
|
10
10
|
var instrumentationMysql2 = require('@opentelemetry/instrumentation-mysql2');
|
|
@@ -12,10 +12,10 @@ var instrumentation = require('@opentelemetry/instrumentation');
|
|
|
12
12
|
var api = require('@opentelemetry/api');
|
|
13
13
|
|
|
14
14
|
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
15
|
-
|
|
15
|
+
chunkHNCWTENX_cjs.init_env();
|
|
16
16
|
var FULL_INSTALL_TARGETS = {
|
|
17
17
|
"@anthropic-ai/sdk": {
|
|
18
|
-
install: (mod) =>
|
|
18
|
+
install: (mod) => chunkLQI63FHF_cjs.instrumentAnthropic({ anthropicModule: mod })
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
21
|
var DETECT_ONLY_TARGETS = {
|
|
@@ -89,7 +89,7 @@ function uninstallLazyHook() {
|
|
|
89
89
|
originalRequire = null;
|
|
90
90
|
}
|
|
91
91
|
async function installAdapters() {
|
|
92
|
-
if (
|
|
92
|
+
if (chunkHNCWTENX_cjs.isAutoDetectDisabled()) return;
|
|
93
93
|
const nodeRequire = getNodeRequire();
|
|
94
94
|
if (!nodeRequire) return;
|
|
95
95
|
const installPromises = [];
|
|
@@ -127,11 +127,11 @@ function _resetForTesting3() {
|
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
// src/index.ts
|
|
130
|
-
|
|
130
|
+
chunkHNCWTENX_cjs.init_env();
|
|
131
131
|
|
|
132
132
|
// src/_internal/db-capture.ts
|
|
133
|
-
|
|
134
|
-
|
|
133
|
+
chunkHNCWTENX_cjs.init_env();
|
|
134
|
+
chunkHNCWTENX_cjs.init_otel_provider();
|
|
135
135
|
var SEMCONV_DB_SYSTEM_NAME = "db.system.name";
|
|
136
136
|
var SEMCONV_DB_QUERY_TEXT = "db.query.text";
|
|
137
137
|
var DB_SYSTEM_NAME_SQLITE = "sqlite";
|
|
@@ -245,7 +245,7 @@ function registerDbInstrumentation() {
|
|
|
245
245
|
disableDbCapture();
|
|
246
246
|
try {
|
|
247
247
|
const instrumentations = buildDbInstrumentations();
|
|
248
|
-
const off =
|
|
248
|
+
const off = chunkHNCWTENX_cjs.getEngine().registerInstrumentations(instrumentations);
|
|
249
249
|
if (off === null) return false;
|
|
250
250
|
unregister = off;
|
|
251
251
|
registeredInstrumentations = instrumentations;
|
|
@@ -267,17 +267,17 @@ function disableDbCapture() {
|
|
|
267
267
|
registeredInstrumentations = null;
|
|
268
268
|
}
|
|
269
269
|
function maybeEnableDbCaptureFromEnv() {
|
|
270
|
-
if (
|
|
270
|
+
if (chunkHNCWTENX_cjs.isDbCaptureEnabled()) {
|
|
271
271
|
registerDbInstrumentation();
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
274
|
|
|
275
275
|
// src/index.ts
|
|
276
|
-
|
|
277
|
-
|
|
276
|
+
chunkHNCWTENX_cjs.init_otel_provider();
|
|
277
|
+
chunkHNCWTENX_cjs.init_redaction();
|
|
278
278
|
|
|
279
279
|
// src/_internal/transport.ts
|
|
280
|
-
var SDK_VERSION = "0.4.
|
|
280
|
+
var SDK_VERSION = "0.4.1-rc.1" ;
|
|
281
281
|
var RETRY_AFTER_CAP_SECONDS = 30;
|
|
282
282
|
function parseRetryAfter(value) {
|
|
283
283
|
if (!value) return null;
|
|
@@ -477,7 +477,7 @@ var BatchTransport = class {
|
|
|
477
477
|
bodySnippet = text.slice(0, 200);
|
|
478
478
|
} catch {
|
|
479
479
|
}
|
|
480
|
-
|
|
480
|
+
chunkT2KW3P23_cjs.report(new Error(`morse: batch POST returned ${resp.status} ${bodySnippet}`), {
|
|
481
481
|
fingerprint: "morse.transport.post.non_2xx",
|
|
482
482
|
extra: {
|
|
483
483
|
endpoint_host: hostnameOf(url),
|
|
@@ -486,7 +486,7 @@ var BatchTransport = class {
|
|
|
486
486
|
});
|
|
487
487
|
}
|
|
488
488
|
} catch (err) {
|
|
489
|
-
|
|
489
|
+
chunkT2KW3P23_cjs.report(err, {
|
|
490
490
|
fingerprint: "morse.transport.post.network",
|
|
491
491
|
extra: {
|
|
492
492
|
endpoint_host: hostnameOf(url),
|
|
@@ -518,9 +518,9 @@ function deriveLogsEndpoint(tracesEndpoint) {
|
|
|
518
518
|
}
|
|
519
519
|
|
|
520
520
|
// src/index.ts
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
521
|
+
chunkHNCWTENX_cjs.init_tracing();
|
|
522
|
+
chunkHNCWTENX_cjs.init_spans();
|
|
523
|
+
chunkHNCWTENX_cjs.init_propagation();
|
|
524
524
|
var version = SDK_VERSION;
|
|
525
525
|
var singleton = null;
|
|
526
526
|
var transportFactory = (opts) => new BatchTransport(opts);
|
|
@@ -540,9 +540,9 @@ function logDestinationOnce(endpoint) {
|
|
|
540
540
|
}
|
|
541
541
|
function resolveEndpoint(explicit) {
|
|
542
542
|
if (explicit && explicit.length > 0) return explicit;
|
|
543
|
-
const fromEnv =
|
|
543
|
+
const fromEnv = chunkHNCWTENX_cjs.getEndpoint();
|
|
544
544
|
if (fromEnv) return fromEnv;
|
|
545
|
-
return
|
|
545
|
+
return chunkHNCWTENX_cjs.DEFAULT_ENDPOINT;
|
|
546
546
|
}
|
|
547
547
|
var OTLP_TRACES_PATH = "/api/v1/otlp/v1/traces";
|
|
548
548
|
function deriveOtlpEndpoint(tracesEndpoint) {
|
|
@@ -557,10 +557,10 @@ function deriveOtlpEndpoint(tracesEndpoint) {
|
|
|
557
557
|
}
|
|
558
558
|
}
|
|
559
559
|
function buildSingleton(opts, redaction) {
|
|
560
|
-
if (
|
|
560
|
+
if (chunkHNCWTENX_cjs.isDisabled()) {
|
|
561
561
|
return null;
|
|
562
562
|
}
|
|
563
|
-
const apiKey = opts.apiKey ??
|
|
563
|
+
const apiKey = opts.apiKey ?? chunkHNCWTENX_cjs.getApiKey();
|
|
564
564
|
if (!apiKey) {
|
|
565
565
|
if (!noApiKeyWarningEmitted) {
|
|
566
566
|
logger2(
|
|
@@ -572,23 +572,23 @@ function buildSingleton(opts, redaction) {
|
|
|
572
572
|
return null;
|
|
573
573
|
}
|
|
574
574
|
const endpoint = resolveEndpoint(opts.endpoint);
|
|
575
|
-
const flushIntervalSeconds = opts.flushIntervalSeconds ??
|
|
575
|
+
const flushIntervalSeconds = opts.flushIntervalSeconds ?? chunkHNCWTENX_cjs.getFlushIntervalSeconds();
|
|
576
576
|
const transport = transportFactory({ apiKey, endpoint, flushIntervalSeconds });
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
const explicitSource =
|
|
580
|
-
const resolvedSource = explicitSource ??
|
|
581
|
-
|
|
577
|
+
chunkHNCWTENX_cjs.setTransport(transport);
|
|
578
|
+
chunkHNCWTENX_cjs.setRedactionConfig(redaction);
|
|
579
|
+
const explicitSource = chunkHNCWTENX_cjs.isValidInternalSource(opts.source) ? opts.source : void 0;
|
|
580
|
+
const resolvedSource = explicitSource ?? chunkHNCWTENX_cjs.getInternalSource() ?? null;
|
|
581
|
+
chunkHNCWTENX_cjs.setSource(resolvedSource);
|
|
582
582
|
logDestinationOnce(endpoint);
|
|
583
583
|
try {
|
|
584
|
-
|
|
584
|
+
chunkHNCWTENX_cjs.getEngine().configure({
|
|
585
585
|
endpoint: deriveOtlpEndpoint(endpoint),
|
|
586
586
|
apiKey,
|
|
587
|
-
sampleRate:
|
|
587
|
+
sampleRate: chunkHNCWTENX_cjs.getSampleRate(),
|
|
588
588
|
scheduleDelayMillis: flushIntervalSeconds * 1e3,
|
|
589
|
-
maxQueueSize:
|
|
590
|
-
maxExportBatchSize:
|
|
591
|
-
maxFieldBytes:
|
|
589
|
+
maxQueueSize: chunkHNCWTENX_cjs.getMaxQueueSize(),
|
|
590
|
+
maxExportBatchSize: chunkHNCWTENX_cjs.getMaxBatchSize(),
|
|
591
|
+
maxFieldBytes: chunkHNCWTENX_cjs.getMaxFieldBytes(),
|
|
592
592
|
// 10s (not the exporter's un-overridden 30s ceiling): a genuine
|
|
593
593
|
// network blip still gets several retries with backoff; a fully dead
|
|
594
594
|
// endpoint fails within a bounded, shutdown-friendly window instead
|
|
@@ -597,32 +597,32 @@ function buildSingleton(opts, redaction) {
|
|
|
597
597
|
redactionConfig: redaction
|
|
598
598
|
});
|
|
599
599
|
} catch (err) {
|
|
600
|
-
|
|
600
|
+
chunkT2KW3P23_cjs.report(err, { fingerprint: "morse.otel_provider.configure" });
|
|
601
601
|
}
|
|
602
602
|
void installAdapters().catch(() => {
|
|
603
603
|
});
|
|
604
604
|
try {
|
|
605
605
|
maybeEnableDbCaptureFromEnv();
|
|
606
606
|
} catch (err) {
|
|
607
|
-
|
|
607
|
+
chunkT2KW3P23_cjs.report(err, { fingerprint: "morse.db_capture.register" });
|
|
608
608
|
}
|
|
609
609
|
return { apiKey, endpoint, transport, redaction };
|
|
610
610
|
}
|
|
611
611
|
function ensureInitialized() {
|
|
612
|
-
if (
|
|
612
|
+
if (chunkHNCWTENX_cjs.isDisabled()) return null;
|
|
613
613
|
if (singleton !== null) return singleton;
|
|
614
|
-
singleton = buildSingleton({},
|
|
614
|
+
singleton = buildSingleton({}, chunkHNCWTENX_cjs.buildRedactionConfig());
|
|
615
615
|
return singleton;
|
|
616
616
|
}
|
|
617
|
-
|
|
617
|
+
chunkQXRJUPDP_cjs._setEnsureInitialized(() => {
|
|
618
618
|
ensureInitialized();
|
|
619
619
|
});
|
|
620
620
|
function init(options = {}) {
|
|
621
|
-
if (
|
|
621
|
+
if (chunkHNCWTENX_cjs.isDisabled()) {
|
|
622
622
|
logger2("info", "morse: MORSE_DISABLED=1 \u2014 SDK is a no-op");
|
|
623
623
|
return;
|
|
624
624
|
}
|
|
625
|
-
const redaction =
|
|
625
|
+
const redaction = chunkHNCWTENX_cjs.buildRedactionConfig(options.redaction);
|
|
626
626
|
try {
|
|
627
627
|
if (singleton !== null) {
|
|
628
628
|
void singleton.transport.shutdown();
|
|
@@ -630,10 +630,10 @@ function init(options = {}) {
|
|
|
630
630
|
}
|
|
631
631
|
singleton = buildSingleton(options, redaction);
|
|
632
632
|
} catch (err) {
|
|
633
|
-
|
|
633
|
+
chunkT2KW3P23_cjs.report(err, { fingerprint: "morse.init" });
|
|
634
634
|
}
|
|
635
635
|
}
|
|
636
|
-
var track =
|
|
636
|
+
var track = chunkT2KW3P23_cjs.absorbErrorsSync(
|
|
637
637
|
(options) => {
|
|
638
638
|
const state = ensureInitialized();
|
|
639
639
|
if (!state) return;
|
|
@@ -641,33 +641,33 @@ var track = chunk7EO7MQBA_cjs.absorbErrorsSync(
|
|
|
641
641
|
agent_id: options.agentId,
|
|
642
642
|
...options.runData
|
|
643
643
|
};
|
|
644
|
-
const redacted =
|
|
644
|
+
const redacted = chunkHNCWTENX_cjs.redactValue(payload, state.redaction);
|
|
645
645
|
state.transport.track(redacted);
|
|
646
646
|
},
|
|
647
647
|
{ fingerprint: "morse.track" }
|
|
648
648
|
);
|
|
649
|
-
var batchTrack =
|
|
649
|
+
var batchTrack = chunkT2KW3P23_cjs.absorbErrorsSync(
|
|
650
650
|
(runs) => {
|
|
651
651
|
const state = ensureInitialized();
|
|
652
652
|
if (!state) return;
|
|
653
653
|
for (const run2 of runs) {
|
|
654
|
-
const redacted =
|
|
654
|
+
const redacted = chunkHNCWTENX_cjs.redactValue(run2, state.redaction);
|
|
655
655
|
state.transport.track(redacted);
|
|
656
656
|
}
|
|
657
657
|
},
|
|
658
658
|
{ fingerprint: "morse.batch_track" }
|
|
659
659
|
);
|
|
660
|
-
var record =
|
|
660
|
+
var record = chunkT2KW3P23_cjs.absorbErrorsSync(
|
|
661
661
|
(rec) => {
|
|
662
662
|
const state = ensureInitialized();
|
|
663
663
|
if (!state) return;
|
|
664
|
-
const traceId =
|
|
665
|
-
const now =
|
|
664
|
+
const traceId = chunkHNCWTENX_cjs.generateTraceId();
|
|
665
|
+
const now = chunkHNCWTENX_cjs.nowIso();
|
|
666
666
|
const resolvedStatus = rec.errorMessage ? "failed" : rec.status ?? "completed";
|
|
667
667
|
const span2 = {
|
|
668
668
|
trace_id: traceId,
|
|
669
|
-
span_id:
|
|
670
|
-
type:
|
|
669
|
+
span_id: chunkHNCWTENX_cjs.generateSpanId(),
|
|
670
|
+
type: chunkHNCWTENX_cjs.SpanType.AGENT,
|
|
671
671
|
name: rec.agent,
|
|
672
672
|
started_at: now,
|
|
673
673
|
ended_at: now,
|
|
@@ -692,57 +692,57 @@ var record = chunk7EO7MQBA_cjs.absorbErrorsSync(
|
|
|
692
692
|
success: rec.success,
|
|
693
693
|
outcome: rec.outcome
|
|
694
694
|
};
|
|
695
|
-
const entry =
|
|
696
|
-
const redacted =
|
|
697
|
-
|
|
695
|
+
const entry = chunkHNCWTENX_cjs.buildTraceEntry(traceFields, [span2]);
|
|
696
|
+
const redacted = chunkHNCWTENX_cjs.redactValue(entry, state.redaction);
|
|
697
|
+
chunkHNCWTENX_cjs.sendTrace(redacted);
|
|
698
698
|
},
|
|
699
699
|
{ fingerprint: "morse.record" }
|
|
700
700
|
);
|
|
701
701
|
function run(nameOrOpts, fn) {
|
|
702
702
|
const opts = typeof nameOrOpts === "string" ? { agentName: nameOrOpts } : nameOrOpts;
|
|
703
703
|
ensureInitialized();
|
|
704
|
-
return
|
|
704
|
+
return chunkHNCWTENX_cjs.runSync(opts, fn);
|
|
705
705
|
}
|
|
706
706
|
function runTraced(options, fn) {
|
|
707
707
|
ensureInitialized();
|
|
708
|
-
return
|
|
708
|
+
return chunkHNCWTENX_cjs.runAsync(options, fn);
|
|
709
709
|
}
|
|
710
710
|
function setContext2(dims) {
|
|
711
|
-
|
|
711
|
+
chunkHNCWTENX_cjs.setContext(dims);
|
|
712
712
|
}
|
|
713
713
|
function startSpan2(options) {
|
|
714
|
-
return
|
|
714
|
+
return chunkHNCWTENX_cjs.startSpan(options);
|
|
715
715
|
}
|
|
716
716
|
function span(options, fn) {
|
|
717
|
-
return
|
|
717
|
+
return chunkHNCWTENX_cjs.spanSync(options, fn);
|
|
718
718
|
}
|
|
719
719
|
function spanAsync2(options, fn) {
|
|
720
|
-
return
|
|
720
|
+
return chunkHNCWTENX_cjs.spanAsync(options, fn);
|
|
721
721
|
}
|
|
722
|
-
var flush =
|
|
722
|
+
var flush = chunkT2KW3P23_cjs.absorbErrorsAsync(
|
|
723
723
|
async () => {
|
|
724
724
|
if (singleton !== null) {
|
|
725
725
|
await singleton.transport.flush();
|
|
726
|
-
await
|
|
726
|
+
await chunkHNCWTENX_cjs.getEngine().flush();
|
|
727
727
|
}
|
|
728
728
|
},
|
|
729
729
|
{ fingerprint: "morse.flush" }
|
|
730
730
|
);
|
|
731
|
-
var quotaState2 =
|
|
731
|
+
var quotaState2 = chunkT2KW3P23_cjs.absorbErrorsSync(
|
|
732
732
|
() => {
|
|
733
733
|
if (singleton === null) return null;
|
|
734
734
|
return getQuotaState();
|
|
735
735
|
},
|
|
736
736
|
{ fingerprint: "morse.quota_state" }
|
|
737
737
|
);
|
|
738
|
-
var shutdown =
|
|
738
|
+
var shutdown = chunkT2KW3P23_cjs.absorbErrorsAsync(
|
|
739
739
|
async () => {
|
|
740
740
|
if (singleton !== null) {
|
|
741
741
|
await singleton.transport.shutdown();
|
|
742
|
-
await
|
|
743
|
-
|
|
742
|
+
await chunkHNCWTENX_cjs.getEngine().flush();
|
|
743
|
+
chunkHNCWTENX_cjs.getEngine().shutdown();
|
|
744
744
|
singleton = null;
|
|
745
|
-
|
|
745
|
+
chunkHNCWTENX_cjs.setTransport(null);
|
|
746
746
|
}
|
|
747
747
|
},
|
|
748
748
|
{ fingerprint: "morse.shutdown" }
|
|
@@ -751,14 +751,14 @@ function _resetForTesting4() {
|
|
|
751
751
|
if (singleton !== null) {
|
|
752
752
|
void singleton.transport.shutdown();
|
|
753
753
|
singleton = null;
|
|
754
|
-
|
|
754
|
+
chunkHNCWTENX_cjs.setTransport(null);
|
|
755
755
|
}
|
|
756
|
-
|
|
756
|
+
chunkHNCWTENX_cjs.getEngine().resetForTesting();
|
|
757
757
|
noApiKeyWarningEmitted = false;
|
|
758
758
|
lastLoggedEndpoint = null;
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
759
|
+
chunkHNCWTENX_cjs.setSource(null);
|
|
760
|
+
chunkHNCWTENX_cjs._resetForTesting();
|
|
761
|
+
chunkT2KW3P23_cjs._resetForTesting();
|
|
762
762
|
_resetForTesting3();
|
|
763
763
|
_resetQuotaStateForTesting();
|
|
764
764
|
transportFactory = (opts) => new BatchTransport(opts);
|
|
@@ -767,59 +767,59 @@ function _setTransportFactoryForTesting(factory) {
|
|
|
767
767
|
transportFactory = factory;
|
|
768
768
|
}
|
|
769
769
|
function _getLastTraceForTesting() {
|
|
770
|
-
return
|
|
770
|
+
return chunkHNCWTENX_cjs.getLastTrace();
|
|
771
771
|
}
|
|
772
772
|
function _getActiveTraceStateForTesting() {
|
|
773
|
-
return
|
|
773
|
+
return chunkHNCWTENX_cjs.getActiveTraceState();
|
|
774
774
|
}
|
|
775
775
|
|
|
776
776
|
Object.defineProperty(exports, "MAX_SEGMENT_CONTENT_BYTES", {
|
|
777
777
|
enumerable: true,
|
|
778
|
-
get: function () { return
|
|
778
|
+
get: function () { return chunkLQI63FHF_cjs.MAX_SEGMENT_CONTENT_BYTES; }
|
|
779
779
|
});
|
|
780
780
|
Object.defineProperty(exports, "extractAnthropicSegments", {
|
|
781
781
|
enumerable: true,
|
|
782
|
-
get: function () { return
|
|
782
|
+
get: function () { return chunkLQI63FHF_cjs.extractAnthropicSegments; }
|
|
783
783
|
});
|
|
784
784
|
Object.defineProperty(exports, "instrumentAnthropic", {
|
|
785
785
|
enumerable: true,
|
|
786
|
-
get: function () { return
|
|
786
|
+
get: function () { return chunkLQI63FHF_cjs.instrumentAnthropic; }
|
|
787
787
|
});
|
|
788
788
|
Object.defineProperty(exports, "isAnthropicWrapped", {
|
|
789
789
|
enumerable: true,
|
|
790
|
-
get: function () { return
|
|
790
|
+
get: function () { return chunkLQI63FHF_cjs.isAnthropicWrapped; }
|
|
791
791
|
});
|
|
792
792
|
Object.defineProperty(exports, "uninstallAnthropic", {
|
|
793
793
|
enumerable: true,
|
|
794
|
-
get: function () { return
|
|
794
|
+
get: function () { return chunkLQI63FHF_cjs.uninstallAnthropic; }
|
|
795
795
|
});
|
|
796
796
|
Object.defineProperty(exports, "wrapAnthropic", {
|
|
797
797
|
enumerable: true,
|
|
798
|
-
get: function () { return
|
|
798
|
+
get: function () { return chunkLQI63FHF_cjs.wrapAnthropic; }
|
|
799
799
|
});
|
|
800
800
|
Object.defineProperty(exports, "log", {
|
|
801
801
|
enumerable: true,
|
|
802
|
-
get: function () { return
|
|
802
|
+
get: function () { return chunkQXRJUPDP_cjs.log; }
|
|
803
803
|
});
|
|
804
804
|
Object.defineProperty(exports, "W3C_TRACEPARENT_HEADER", {
|
|
805
805
|
enumerable: true,
|
|
806
|
-
get: function () { return
|
|
806
|
+
get: function () { return chunkHNCWTENX_cjs.W3C_TRACEPARENT_HEADER; }
|
|
807
807
|
});
|
|
808
808
|
Object.defineProperty(exports, "extractTraceparent", {
|
|
809
809
|
enumerable: true,
|
|
810
|
-
get: function () { return
|
|
810
|
+
get: function () { return chunkHNCWTENX_cjs.extractTraceparent; }
|
|
811
811
|
});
|
|
812
812
|
Object.defineProperty(exports, "formatTraceparent", {
|
|
813
813
|
enumerable: true,
|
|
814
|
-
get: function () { return
|
|
814
|
+
get: function () { return chunkHNCWTENX_cjs.formatTraceparent; }
|
|
815
815
|
});
|
|
816
816
|
Object.defineProperty(exports, "injectIntoRequestInit", {
|
|
817
817
|
enumerable: true,
|
|
818
|
-
get: function () { return
|
|
818
|
+
get: function () { return chunkHNCWTENX_cjs.injectIntoRequestInit; }
|
|
819
819
|
});
|
|
820
820
|
Object.defineProperty(exports, "injectTraceparent", {
|
|
821
821
|
enumerable: true,
|
|
822
|
-
get: function () { return
|
|
822
|
+
get: function () { return chunkHNCWTENX_cjs.injectTraceparent; }
|
|
823
823
|
});
|
|
824
824
|
exports._getActiveTraceStateForTesting = _getActiveTraceStateForTesting;
|
|
825
825
|
exports._getLastTraceForTesting = _getLastTraceForTesting;
|