@morsehq-dev/sdk 0.5.0-rc.6 → 0.5.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/anthropic/index.cjs +11 -11
- package/dist/anthropic/index.js +4 -4
- package/dist/anthropic-agent-sdk/index.cjs +40 -40
- package/dist/anthropic-agent-sdk/index.js +6 -6
- package/dist/browser/anthropic/index.cjs +11 -11
- package/dist/browser/anthropic/index.js +4 -4
- package/dist/browser/anthropic-agent-sdk/index.cjs +40 -40
- package/dist/browser/anthropic-agent-sdk/index.js +6 -6
- package/dist/browser/{chunk-TGN4FEKB.cjs → chunk-2X64OY2L.cjs} +12 -12
- package/dist/browser/{chunk-TGN4FEKB.cjs.map → chunk-2X64OY2L.cjs.map} +1 -1
- package/dist/browser/{chunk-6YPVIGD2.cjs → chunk-4CMVMTFB.cjs} +6 -6
- package/dist/browser/{chunk-6YPVIGD2.cjs.map → chunk-4CMVMTFB.cjs.map} +1 -1
- package/dist/browser/{chunk-PNUCUOUA.cjs → chunk-52JTU4LH.cjs} +15 -15
- package/dist/browser/{chunk-PNUCUOUA.cjs.map → chunk-52JTU4LH.cjs.map} +1 -1
- package/dist/browser/{chunk-WG45SF7N.cjs → chunk-6BNMYEMW.cjs} +3 -3
- package/dist/browser/{chunk-WG45SF7N.cjs.map → chunk-6BNMYEMW.cjs.map} +1 -1
- package/dist/browser/{chunk-MIHCAKQ2.js → chunk-6T6ZPOKZ.js} +3 -3
- package/dist/browser/{chunk-MIHCAKQ2.js.map → chunk-6T6ZPOKZ.js.map} +1 -1
- package/dist/{chunk-B3WEUUUK.cjs → browser/chunk-BIP66M44.cjs} +7 -7
- package/dist/browser/{chunk-NK6D2G5O.cjs.map → chunk-BIP66M44.cjs.map} +1 -1
- package/dist/browser/{chunk-FDWPKINR.js → chunk-BUCIE3DR.js} +4 -4
- package/dist/browser/{chunk-FDWPKINR.js.map → chunk-BUCIE3DR.js.map} +1 -1
- package/dist/browser/{chunk-DQ4JWHYH.cjs → chunk-ELQ4LGAS.cjs} +18 -18
- package/dist/browser/{chunk-DQ4JWHYH.cjs.map → chunk-ELQ4LGAS.cjs.map} +1 -1
- package/dist/browser/{chunk-JNF26SQM.js → chunk-KZFG23MO.js} +5 -5
- package/dist/browser/{chunk-JNF26SQM.js.map → chunk-KZFG23MO.js.map} +1 -1
- package/dist/browser/{chunk-IXCAR4UA.js → chunk-NU74H55W.js} +3 -3
- package/dist/browser/{chunk-IXCAR4UA.js.map → chunk-NU74H55W.js.map} +1 -1
- package/dist/browser/{chunk-2LZCQD3J.js → chunk-T6Z6UIBN.js} +3 -3
- package/dist/browser/{chunk-2LZCQD3J.js.map → chunk-T6Z6UIBN.js.map} +1 -1
- package/dist/browser/{chunk-ZAISDHUV.cjs → chunk-TV7TRP5O.cjs} +5 -5
- package/dist/browser/{chunk-ZAISDHUV.cjs.map → chunk-TV7TRP5O.cjs.map} +1 -1
- package/dist/browser/{chunk-PHE4P3DN.js → chunk-VIOT3AOP.js} +3 -3
- package/dist/browser/{chunk-PHE4P3DN.js.map → chunk-VIOT3AOP.js.map} +1 -1
- package/dist/{chunk-LEDIWC2M.js → browser/chunk-YYUDZTHI.js} +4 -4
- package/dist/browser/{chunk-TIZ5QRK2.js.map → chunk-YYUDZTHI.js.map} +1 -1
- package/dist/browser/index.cjs +91 -91
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.js +8 -8
- 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 +27 -27
- package/dist/browser/langgraph/index.js +5 -5
- package/dist/browser/openai/index.cjs +11 -11
- package/dist/browser/openai/index.js +2 -2
- package/dist/browser/openai-agents/index.cjs +34 -34
- 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-2GWOF5JM.js → chunk-3ONFIKKC.js} +3 -3
- package/dist/{chunk-2GWOF5JM.js.map → chunk-3ONFIKKC.js.map} +1 -1
- package/dist/{chunk-QTATKDEI.js → chunk-6FLGLD72.js} +3 -3
- package/dist/{chunk-QTATKDEI.js.map → chunk-6FLGLD72.js.map} +1 -1
- package/dist/{chunk-TEWSIQ6E.cjs → chunk-7HYFOHM3.cjs} +6 -6
- package/dist/{chunk-TEWSIQ6E.cjs.map → chunk-7HYFOHM3.cjs.map} +1 -1
- package/dist/{chunk-K4FHTOBB.cjs → chunk-D5NTF54A.cjs} +12 -12
- package/dist/{chunk-K4FHTOBB.cjs.map → chunk-D5NTF54A.cjs.map} +1 -1
- package/dist/{chunk-ZFZTJXIO.cjs → chunk-GTPKPUAV.cjs} +15 -15
- package/dist/{chunk-ZFZTJXIO.cjs.map → chunk-GTPKPUAV.cjs.map} +1 -1
- package/dist/{chunk-Z2AYPTB2.js → chunk-J5FEPM7L.js} +5 -5
- package/dist/{chunk-Z2AYPTB2.js.map → chunk-J5FEPM7L.js.map} +1 -1
- package/dist/{chunk-UV5FUVNK.cjs → chunk-KMBKZLXH.cjs} +3 -3
- package/dist/{chunk-UV5FUVNK.cjs.map → chunk-KMBKZLXH.cjs.map} +1 -1
- package/dist/{browser/chunk-TIZ5QRK2.js → chunk-KWOSUW7B.js} +4 -4
- package/dist/{chunk-LEDIWC2M.js.map → chunk-KWOSUW7B.js.map} +1 -1
- package/dist/{chunk-AT3YR5SP.cjs → chunk-LPLL2OXI.cjs} +5 -5
- package/dist/{chunk-AT3YR5SP.cjs.map → chunk-LPLL2OXI.cjs.map} +1 -1
- package/dist/{browser/chunk-NK6D2G5O.cjs → chunk-NMARCV3R.cjs} +7 -7
- package/dist/{chunk-B3WEUUUK.cjs.map → chunk-NMARCV3R.cjs.map} +1 -1
- package/dist/{chunk-T5UFHQLZ.js → chunk-SFI36VWW.js} +3 -3
- package/dist/{chunk-T5UFHQLZ.js.map → chunk-SFI36VWW.js.map} +1 -1
- package/dist/{chunk-4QY5O46P.cjs → chunk-SUEBUMHL.cjs} +18 -18
- package/dist/{chunk-4QY5O46P.cjs.map → chunk-SUEBUMHL.cjs.map} +1 -1
- package/dist/{chunk-5YJXFU5U.js → chunk-ZIMGB7IT.js} +3 -3
- package/dist/{chunk-5YJXFU5U.js.map → chunk-ZIMGB7IT.js.map} +1 -1
- package/dist/{chunk-DK3RX7RS.js → chunk-ZZSVPAXM.js} +4 -4
- package/dist/{chunk-DK3RX7RS.js.map → chunk-ZZSVPAXM.js.map} +1 -1
- package/dist/index.cjs +101 -101
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +9 -9
- 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 +27 -27
- package/dist/langgraph/index.js +5 -5
- package/dist/openai/index.cjs +11 -11
- package/dist/openai/index.js +2 -2
- package/dist/openai-agents/index.cjs +34 -34
- 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/index.cjs
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
6
|
-
var
|
|
3
|
+
var chunkELQ4LGAS_cjs = require('./chunk-ELQ4LGAS.cjs');
|
|
4
|
+
var chunk2X64OY2L_cjs = require('./chunk-2X64OY2L.cjs');
|
|
5
|
+
require('./chunk-TV7TRP5O.cjs');
|
|
6
|
+
var chunk4CMVMTFB_cjs = require('./chunk-4CMVMTFB.cjs');
|
|
7
7
|
require('./chunk-SWQOPFE4.cjs');
|
|
8
8
|
require('./chunk-RBNCTHK3.cjs');
|
|
9
|
-
var
|
|
9
|
+
var chunk6BNMYEMW_cjs = require('./chunk-6BNMYEMW.cjs');
|
|
10
10
|
|
|
11
11
|
// src/_internal/auto-detect.browser.ts
|
|
12
12
|
async function installAdapters() {
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
// src/index.ts
|
|
16
|
-
|
|
16
|
+
chunk6BNMYEMW_cjs.init_env();
|
|
17
17
|
|
|
18
18
|
// src/_internal/db-capture.browser.ts
|
|
19
19
|
function maybeEnableDbCaptureFromEnv() {
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
// src/index.ts
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
chunk6BNMYEMW_cjs.init_otel_provider_browser();
|
|
24
|
+
chunk6BNMYEMW_cjs.init_redaction();
|
|
25
25
|
|
|
26
26
|
// src/_internal/transport.ts
|
|
27
|
-
|
|
28
|
-
var SDK_VERSION = "0.5.0
|
|
27
|
+
chunk6BNMYEMW_cjs.init_diagnostics();
|
|
28
|
+
var SDK_VERSION = "0.5.0" ;
|
|
29
29
|
var RETRY_AFTER_CAP_SECONDS = 30;
|
|
30
30
|
function parseRetryAfter(value) {
|
|
31
31
|
if (!value) return null;
|
|
@@ -130,11 +130,11 @@ var BatchTransport = class {
|
|
|
130
130
|
/** Enqueue an event. Non-blocking. Returns false if the queue is full. */
|
|
131
131
|
track(event) {
|
|
132
132
|
if (this.closed) {
|
|
133
|
-
|
|
133
|
+
chunk6BNMYEMW_cjs.recordDrop(chunk6BNMYEMW_cjs.REASON_SHUTDOWN_DROP, "trace");
|
|
134
134
|
return false;
|
|
135
135
|
}
|
|
136
136
|
if (this.queue.length >= this.maxQueueSize) {
|
|
137
|
-
|
|
137
|
+
chunk6BNMYEMW_cjs.recordDrop(chunk6BNMYEMW_cjs.REASON_QUEUE_FULL, "trace");
|
|
138
138
|
return false;
|
|
139
139
|
}
|
|
140
140
|
this.queue.push(event);
|
|
@@ -221,12 +221,12 @@ var BatchTransport = class {
|
|
|
221
221
|
body: JSON.stringify(payload),
|
|
222
222
|
signal: controller.signal
|
|
223
223
|
});
|
|
224
|
-
|
|
224
|
+
chunk6BNMYEMW_cjs.setLevel(resp.headers.get("X-Morse-Diagnostics"));
|
|
225
225
|
const droppedCount = countPayloadEntries(payload);
|
|
226
226
|
const droppedCategory = categoryOf(payload);
|
|
227
227
|
if (resp.status === 429) {
|
|
228
228
|
await recordQuotaState(resp);
|
|
229
|
-
|
|
229
|
+
chunk6BNMYEMW_cjs.recordDrop(chunk6BNMYEMW_cjs.REASON_QUOTA_REJECTED, droppedCategory, droppedCount);
|
|
230
230
|
}
|
|
231
231
|
if (!resp.ok) {
|
|
232
232
|
let bodySnippet = "";
|
|
@@ -236,9 +236,9 @@ var BatchTransport = class {
|
|
|
236
236
|
} catch {
|
|
237
237
|
}
|
|
238
238
|
if (resp.status !== 429) {
|
|
239
|
-
|
|
239
|
+
chunk6BNMYEMW_cjs.recordDrop(chunk6BNMYEMW_cjs.REASON_RETRY_EXHAUSTED, droppedCategory, droppedCount);
|
|
240
240
|
}
|
|
241
|
-
|
|
241
|
+
chunk6BNMYEMW_cjs.report(new Error(`morse: batch POST returned ${resp.status} ${bodySnippet}`), {
|
|
242
242
|
fingerprint: "morse.transport.post.non_2xx",
|
|
243
243
|
extra: {
|
|
244
244
|
endpoint_host: hostnameOf(url),
|
|
@@ -247,8 +247,8 @@ var BatchTransport = class {
|
|
|
247
247
|
});
|
|
248
248
|
}
|
|
249
249
|
} catch (err) {
|
|
250
|
-
|
|
251
|
-
|
|
250
|
+
chunk6BNMYEMW_cjs.recordDrop(chunk6BNMYEMW_cjs.REASON_RETRY_EXHAUSTED, categoryOf(payload), countPayloadEntries(payload));
|
|
251
|
+
chunk6BNMYEMW_cjs.report(err, {
|
|
252
252
|
fingerprint: "morse.transport.post.network",
|
|
253
253
|
extra: {
|
|
254
254
|
endpoint_host: hostnameOf(url),
|
|
@@ -292,10 +292,10 @@ function categoryOf(payload) {
|
|
|
292
292
|
}
|
|
293
293
|
|
|
294
294
|
// src/index.ts
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
295
|
+
chunk6BNMYEMW_cjs.init_tracing();
|
|
296
|
+
chunk6BNMYEMW_cjs.init_diagnostics();
|
|
297
|
+
chunk6BNMYEMW_cjs.init_spans();
|
|
298
|
+
chunk6BNMYEMW_cjs.init_propagation();
|
|
299
299
|
var version = SDK_VERSION;
|
|
300
300
|
var singleton = null;
|
|
301
301
|
var transportFactory = (opts) => new BatchTransport(opts);
|
|
@@ -315,9 +315,9 @@ function logDestinationOnce(endpoint) {
|
|
|
315
315
|
}
|
|
316
316
|
function resolveEndpoint(explicit) {
|
|
317
317
|
if (explicit && explicit.length > 0) return explicit;
|
|
318
|
-
const fromEnv =
|
|
318
|
+
const fromEnv = chunk6BNMYEMW_cjs.getEndpoint();
|
|
319
319
|
if (fromEnv) return fromEnv;
|
|
320
|
-
return
|
|
320
|
+
return chunk6BNMYEMW_cjs.DEFAULT_ENDPOINT;
|
|
321
321
|
}
|
|
322
322
|
var OTLP_TRACES_PATH = "/api/v1/otlp/v1/traces";
|
|
323
323
|
function deriveOtlpEndpoint(tracesEndpoint) {
|
|
@@ -332,10 +332,10 @@ function deriveOtlpEndpoint(tracesEndpoint) {
|
|
|
332
332
|
}
|
|
333
333
|
}
|
|
334
334
|
function buildSingleton(opts, redaction) {
|
|
335
|
-
if (
|
|
335
|
+
if (chunk6BNMYEMW_cjs.isDisabled()) {
|
|
336
336
|
return null;
|
|
337
337
|
}
|
|
338
|
-
const apiKey = opts.apiKey ??
|
|
338
|
+
const apiKey = opts.apiKey ?? chunk6BNMYEMW_cjs.getApiKey();
|
|
339
339
|
if (!apiKey) {
|
|
340
340
|
if (!noApiKeyWarningEmitted) {
|
|
341
341
|
logger(
|
|
@@ -347,24 +347,24 @@ function buildSingleton(opts, redaction) {
|
|
|
347
347
|
return null;
|
|
348
348
|
}
|
|
349
349
|
const endpoint = resolveEndpoint(opts.endpoint);
|
|
350
|
-
const flushIntervalSeconds = opts.flushIntervalSeconds ??
|
|
350
|
+
const flushIntervalSeconds = opts.flushIntervalSeconds ?? chunk6BNMYEMW_cjs.getFlushIntervalSeconds();
|
|
351
351
|
const transport = transportFactory({ apiKey, endpoint, flushIntervalSeconds });
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
const explicitSource =
|
|
356
|
-
const resolvedSource = explicitSource ??
|
|
357
|
-
|
|
352
|
+
chunk6BNMYEMW_cjs.setTransport(transport);
|
|
353
|
+
chunk6BNMYEMW_cjs.setRedactionConfig(redaction);
|
|
354
|
+
chunk6BNMYEMW_cjs.setDiagnosticsClientConfig({ apiKey, endpoint });
|
|
355
|
+
const explicitSource = chunk6BNMYEMW_cjs.isValidInternalSource(opts.source) ? opts.source : void 0;
|
|
356
|
+
const resolvedSource = explicitSource ?? chunk6BNMYEMW_cjs.getInternalSource() ?? null;
|
|
357
|
+
chunk6BNMYEMW_cjs.setSource(resolvedSource);
|
|
358
358
|
logDestinationOnce(endpoint);
|
|
359
359
|
try {
|
|
360
|
-
|
|
360
|
+
chunk6BNMYEMW_cjs.getEngine().configure({
|
|
361
361
|
endpoint: deriveOtlpEndpoint(endpoint),
|
|
362
362
|
apiKey,
|
|
363
|
-
sampleRate:
|
|
363
|
+
sampleRate: chunk6BNMYEMW_cjs.getSampleRate(),
|
|
364
364
|
scheduleDelayMillis: flushIntervalSeconds * 1e3,
|
|
365
|
-
maxQueueSize:
|
|
366
|
-
maxExportBatchSize:
|
|
367
|
-
maxFieldBytes:
|
|
365
|
+
maxQueueSize: chunk6BNMYEMW_cjs.getMaxQueueSize(),
|
|
366
|
+
maxExportBatchSize: chunk6BNMYEMW_cjs.getMaxBatchSize(),
|
|
367
|
+
maxFieldBytes: chunk6BNMYEMW_cjs.getMaxFieldBytes(),
|
|
368
368
|
// 10s (not the exporter's un-overridden 30s ceiling): a genuine
|
|
369
369
|
// network blip still gets several retries with backoff; a fully dead
|
|
370
370
|
// endpoint fails within a bounded, shutdown-friendly window instead
|
|
@@ -373,32 +373,32 @@ function buildSingleton(opts, redaction) {
|
|
|
373
373
|
redactionConfig: redaction
|
|
374
374
|
});
|
|
375
375
|
} catch (err) {
|
|
376
|
-
|
|
376
|
+
chunk6BNMYEMW_cjs.report(err, { fingerprint: "morse.otel_provider.configure" });
|
|
377
377
|
}
|
|
378
378
|
void installAdapters().catch(() => {
|
|
379
379
|
});
|
|
380
380
|
try {
|
|
381
381
|
maybeEnableDbCaptureFromEnv();
|
|
382
382
|
} catch (err) {
|
|
383
|
-
|
|
383
|
+
chunk6BNMYEMW_cjs.report(err, { fingerprint: "morse.db_capture.register" });
|
|
384
384
|
}
|
|
385
385
|
return { apiKey, endpoint, transport, redaction };
|
|
386
386
|
}
|
|
387
387
|
function ensureInitialized() {
|
|
388
|
-
if (
|
|
388
|
+
if (chunk6BNMYEMW_cjs.isDisabled()) return null;
|
|
389
389
|
if (singleton !== null) return singleton;
|
|
390
|
-
singleton = buildSingleton({},
|
|
390
|
+
singleton = buildSingleton({}, chunk6BNMYEMW_cjs.buildRedactionConfig());
|
|
391
391
|
return singleton;
|
|
392
392
|
}
|
|
393
|
-
|
|
393
|
+
chunk2X64OY2L_cjs._setEnsureInitialized(() => {
|
|
394
394
|
ensureInitialized();
|
|
395
395
|
});
|
|
396
396
|
function init(options = {}) {
|
|
397
|
-
if (
|
|
397
|
+
if (chunk6BNMYEMW_cjs.isDisabled()) {
|
|
398
398
|
logger("info", "morse: MORSE_DISABLED=1 \u2014 SDK is a no-op");
|
|
399
399
|
return;
|
|
400
400
|
}
|
|
401
|
-
const redaction =
|
|
401
|
+
const redaction = chunk6BNMYEMW_cjs.buildRedactionConfig(options.redaction);
|
|
402
402
|
try {
|
|
403
403
|
if (singleton !== null) {
|
|
404
404
|
void singleton.transport.shutdown();
|
|
@@ -406,10 +406,10 @@ function init(options = {}) {
|
|
|
406
406
|
}
|
|
407
407
|
singleton = buildSingleton(options, redaction);
|
|
408
408
|
} catch (err) {
|
|
409
|
-
|
|
409
|
+
chunk6BNMYEMW_cjs.report(err, { fingerprint: "morse.init" });
|
|
410
410
|
}
|
|
411
411
|
}
|
|
412
|
-
var track =
|
|
412
|
+
var track = chunk4CMVMTFB_cjs.absorbErrorsSync(
|
|
413
413
|
(options) => {
|
|
414
414
|
const state = ensureInitialized();
|
|
415
415
|
if (!state) return;
|
|
@@ -417,33 +417,33 @@ var track = chunk6YPVIGD2_cjs.absorbErrorsSync(
|
|
|
417
417
|
agent_id: options.agentId,
|
|
418
418
|
...options.runData
|
|
419
419
|
};
|
|
420
|
-
const redacted =
|
|
420
|
+
const redacted = chunk6BNMYEMW_cjs.redactValue(payload, state.redaction);
|
|
421
421
|
state.transport.track(redacted);
|
|
422
422
|
},
|
|
423
423
|
{ fingerprint: "morse.track" }
|
|
424
424
|
);
|
|
425
|
-
var batchTrack =
|
|
425
|
+
var batchTrack = chunk4CMVMTFB_cjs.absorbErrorsSync(
|
|
426
426
|
(runs) => {
|
|
427
427
|
const state = ensureInitialized();
|
|
428
428
|
if (!state) return;
|
|
429
429
|
for (const run2 of runs) {
|
|
430
|
-
const redacted =
|
|
430
|
+
const redacted = chunk6BNMYEMW_cjs.redactValue(run2, state.redaction);
|
|
431
431
|
state.transport.track(redacted);
|
|
432
432
|
}
|
|
433
433
|
},
|
|
434
434
|
{ fingerprint: "morse.batch_track" }
|
|
435
435
|
);
|
|
436
|
-
var record =
|
|
436
|
+
var record = chunk4CMVMTFB_cjs.absorbErrorsSync(
|
|
437
437
|
(rec) => {
|
|
438
438
|
const state = ensureInitialized();
|
|
439
439
|
if (!state) return;
|
|
440
|
-
const traceId =
|
|
441
|
-
const now =
|
|
440
|
+
const traceId = chunk6BNMYEMW_cjs.generateTraceId();
|
|
441
|
+
const now = chunk6BNMYEMW_cjs.nowIso();
|
|
442
442
|
const resolvedStatus = rec.errorMessage ? "failed" : rec.status ?? "completed";
|
|
443
443
|
const span2 = {
|
|
444
444
|
trace_id: traceId,
|
|
445
|
-
span_id:
|
|
446
|
-
type:
|
|
445
|
+
span_id: chunk6BNMYEMW_cjs.generateSpanId(),
|
|
446
|
+
type: chunk6BNMYEMW_cjs.SpanType.AGENT,
|
|
447
447
|
name: rec.agent,
|
|
448
448
|
started_at: now,
|
|
449
449
|
ended_at: now,
|
|
@@ -468,58 +468,58 @@ var record = chunk6YPVIGD2_cjs.absorbErrorsSync(
|
|
|
468
468
|
success: rec.success,
|
|
469
469
|
outcome: rec.outcome
|
|
470
470
|
};
|
|
471
|
-
const entry =
|
|
472
|
-
const redacted =
|
|
473
|
-
|
|
471
|
+
const entry = chunk6BNMYEMW_cjs.buildTraceEntry(traceFields, [span2]);
|
|
472
|
+
const redacted = chunk6BNMYEMW_cjs.redactValue(entry, state.redaction);
|
|
473
|
+
chunk6BNMYEMW_cjs.sendTrace(redacted);
|
|
474
474
|
},
|
|
475
475
|
{ fingerprint: "morse.record" }
|
|
476
476
|
);
|
|
477
477
|
function run(nameOrOpts, fn) {
|
|
478
478
|
const opts = typeof nameOrOpts === "string" ? { agentName: nameOrOpts } : nameOrOpts;
|
|
479
479
|
ensureInitialized();
|
|
480
|
-
return
|
|
480
|
+
return chunk6BNMYEMW_cjs.runSync(opts, fn);
|
|
481
481
|
}
|
|
482
482
|
function runTraced(options, fn) {
|
|
483
483
|
ensureInitialized();
|
|
484
|
-
return
|
|
484
|
+
return chunk6BNMYEMW_cjs.runAsync(options, fn);
|
|
485
485
|
}
|
|
486
486
|
function setContext2(dims) {
|
|
487
|
-
|
|
487
|
+
chunk6BNMYEMW_cjs.setContext(dims);
|
|
488
488
|
}
|
|
489
489
|
function startSpan2(options) {
|
|
490
|
-
return
|
|
490
|
+
return chunk6BNMYEMW_cjs.startSpan(options);
|
|
491
491
|
}
|
|
492
492
|
function span(options, fn) {
|
|
493
|
-
return
|
|
493
|
+
return chunk6BNMYEMW_cjs.spanSync(options, fn);
|
|
494
494
|
}
|
|
495
495
|
function spanAsync2(options, fn) {
|
|
496
|
-
return
|
|
496
|
+
return chunk6BNMYEMW_cjs.spanAsync(options, fn);
|
|
497
497
|
}
|
|
498
|
-
var flush =
|
|
498
|
+
var flush = chunk4CMVMTFB_cjs.absorbErrorsAsync(
|
|
499
499
|
async () => {
|
|
500
500
|
if (singleton !== null) {
|
|
501
501
|
await singleton.transport.flush();
|
|
502
|
-
await
|
|
502
|
+
await chunk6BNMYEMW_cjs.getEngine().flush();
|
|
503
503
|
}
|
|
504
504
|
},
|
|
505
505
|
{ fingerprint: "morse.flush" }
|
|
506
506
|
);
|
|
507
|
-
var quotaState2 =
|
|
507
|
+
var quotaState2 = chunk4CMVMTFB_cjs.absorbErrorsSync(
|
|
508
508
|
() => {
|
|
509
509
|
if (singleton === null) return null;
|
|
510
510
|
return getQuotaState();
|
|
511
511
|
},
|
|
512
512
|
{ fingerprint: "morse.quota_state" }
|
|
513
513
|
);
|
|
514
|
-
var shutdown =
|
|
514
|
+
var shutdown = chunk4CMVMTFB_cjs.absorbErrorsAsync(
|
|
515
515
|
async () => {
|
|
516
516
|
if (singleton !== null) {
|
|
517
517
|
await singleton.transport.shutdown();
|
|
518
|
-
await
|
|
519
|
-
|
|
520
|
-
await
|
|
518
|
+
await chunk6BNMYEMW_cjs.getEngine().flush();
|
|
519
|
+
chunk6BNMYEMW_cjs.getEngine().shutdown();
|
|
520
|
+
await chunk6BNMYEMW_cjs.flushOnce();
|
|
521
521
|
singleton = null;
|
|
522
|
-
|
|
522
|
+
chunk6BNMYEMW_cjs.setTransport(null);
|
|
523
523
|
}
|
|
524
524
|
},
|
|
525
525
|
{ fingerprint: "morse.shutdown" }
|
|
@@ -528,14 +528,14 @@ function _resetForTesting4() {
|
|
|
528
528
|
if (singleton !== null) {
|
|
529
529
|
void singleton.transport.shutdown();
|
|
530
530
|
singleton = null;
|
|
531
|
-
|
|
531
|
+
chunk6BNMYEMW_cjs.setTransport(null);
|
|
532
532
|
}
|
|
533
|
-
|
|
533
|
+
chunk6BNMYEMW_cjs.getEngine().resetForTesting();
|
|
534
534
|
noApiKeyWarningEmitted = false;
|
|
535
535
|
lastLoggedEndpoint = null;
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
536
|
+
chunk6BNMYEMW_cjs.setSource(null);
|
|
537
|
+
chunk6BNMYEMW_cjs._resetForTesting2();
|
|
538
|
+
chunk6BNMYEMW_cjs._resetForTesting();
|
|
539
539
|
_resetQuotaStateForTesting();
|
|
540
540
|
transportFactory = (opts) => new BatchTransport(opts);
|
|
541
541
|
}
|
|
@@ -543,59 +543,59 @@ function _setTransportFactoryForTesting(factory) {
|
|
|
543
543
|
transportFactory = factory;
|
|
544
544
|
}
|
|
545
545
|
function _getLastTraceForTesting() {
|
|
546
|
-
return
|
|
546
|
+
return chunk6BNMYEMW_cjs.getLastTrace();
|
|
547
547
|
}
|
|
548
548
|
function _getActiveTraceStateForTesting() {
|
|
549
|
-
return
|
|
549
|
+
return chunk6BNMYEMW_cjs.getActiveTraceState();
|
|
550
550
|
}
|
|
551
551
|
|
|
552
552
|
Object.defineProperty(exports, "MAX_SEGMENT_CONTENT_BYTES", {
|
|
553
553
|
enumerable: true,
|
|
554
|
-
get: function () { return
|
|
554
|
+
get: function () { return chunkELQ4LGAS_cjs.MAX_SEGMENT_CONTENT_BYTES; }
|
|
555
555
|
});
|
|
556
556
|
Object.defineProperty(exports, "extractAnthropicSegments", {
|
|
557
557
|
enumerable: true,
|
|
558
|
-
get: function () { return
|
|
558
|
+
get: function () { return chunkELQ4LGAS_cjs.extractAnthropicSegments; }
|
|
559
559
|
});
|
|
560
560
|
Object.defineProperty(exports, "instrumentAnthropic", {
|
|
561
561
|
enumerable: true,
|
|
562
|
-
get: function () { return
|
|
562
|
+
get: function () { return chunkELQ4LGAS_cjs.instrumentAnthropic; }
|
|
563
563
|
});
|
|
564
564
|
Object.defineProperty(exports, "isAnthropicWrapped", {
|
|
565
565
|
enumerable: true,
|
|
566
|
-
get: function () { return
|
|
566
|
+
get: function () { return chunkELQ4LGAS_cjs.isAnthropicWrapped; }
|
|
567
567
|
});
|
|
568
568
|
Object.defineProperty(exports, "uninstallAnthropic", {
|
|
569
569
|
enumerable: true,
|
|
570
|
-
get: function () { return
|
|
570
|
+
get: function () { return chunkELQ4LGAS_cjs.uninstallAnthropic; }
|
|
571
571
|
});
|
|
572
572
|
Object.defineProperty(exports, "wrapAnthropic", {
|
|
573
573
|
enumerable: true,
|
|
574
|
-
get: function () { return
|
|
574
|
+
get: function () { return chunkELQ4LGAS_cjs.wrapAnthropic; }
|
|
575
575
|
});
|
|
576
576
|
Object.defineProperty(exports, "log", {
|
|
577
577
|
enumerable: true,
|
|
578
|
-
get: function () { return
|
|
578
|
+
get: function () { return chunk2X64OY2L_cjs.log; }
|
|
579
579
|
});
|
|
580
580
|
Object.defineProperty(exports, "W3C_TRACEPARENT_HEADER", {
|
|
581
581
|
enumerable: true,
|
|
582
|
-
get: function () { return
|
|
582
|
+
get: function () { return chunk6BNMYEMW_cjs.W3C_TRACEPARENT_HEADER; }
|
|
583
583
|
});
|
|
584
584
|
Object.defineProperty(exports, "extractTraceparent", {
|
|
585
585
|
enumerable: true,
|
|
586
|
-
get: function () { return
|
|
586
|
+
get: function () { return chunk6BNMYEMW_cjs.extractTraceparent; }
|
|
587
587
|
});
|
|
588
588
|
Object.defineProperty(exports, "formatTraceparent", {
|
|
589
589
|
enumerable: true,
|
|
590
|
-
get: function () { return
|
|
590
|
+
get: function () { return chunk6BNMYEMW_cjs.formatTraceparent; }
|
|
591
591
|
});
|
|
592
592
|
Object.defineProperty(exports, "injectIntoRequestInit", {
|
|
593
593
|
enumerable: true,
|
|
594
|
-
get: function () { return
|
|
594
|
+
get: function () { return chunk6BNMYEMW_cjs.injectIntoRequestInit; }
|
|
595
595
|
});
|
|
596
596
|
Object.defineProperty(exports, "injectTraceparent", {
|
|
597
597
|
enumerable: true,
|
|
598
|
-
get: function () { return
|
|
598
|
+
get: function () { return chunk6BNMYEMW_cjs.injectTraceparent; }
|
|
599
599
|
});
|
|
600
600
|
exports._getActiveTraceStateForTesting = _getActiveTraceStateForTesting;
|
|
601
601
|
exports._getLastTraceForTesting = _getLastTraceForTesting;
|