@sentry/junior 0.121.0 → 0.122.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/{agent-hooks-CQDGDBCP.js → agent-hooks-HJMLQLCB.js} +8 -8
- package/dist/api.js +14 -14
- package/dist/app.js +604 -997
- package/dist/{catalog-runtime-AD3YNTTM.js → catalog-runtime-CYPZUYJD.js} +5 -5
- package/dist/chat/agent/index.d.ts +19 -2
- package/dist/chat/agent/request.d.ts +8 -8
- package/dist/chat/agent/resume.d.ts +1 -3
- package/dist/chat/agent/retry-usage.d.ts +8 -0
- package/dist/chat/agent/skills.d.ts +0 -9
- package/dist/chat/conversations/messages.d.ts +7 -0
- package/dist/chat/conversations/projection.d.ts +16 -0
- package/dist/chat/logging.d.ts +46 -13
- package/dist/chat/runtime/processing-reaction.d.ts +2 -4
- package/dist/chat/runtime/slack-runtime.d.ts +2 -2
- package/dist/chat/services/assistant-reply.d.ts +16 -0
- package/dist/chat/services/empty-output-continuation.d.ts +20 -0
- package/dist/chat/services/turn-failure-response.d.ts +1 -3
- package/dist/chat/services/turn-result.d.ts +0 -5
- package/dist/chat/services/turn-session-record.d.ts +0 -11
- package/dist/chat/tool-support/zod-tool.d.ts +11 -6
- package/dist/chat/tools/execute-tool.d.ts +1 -33
- package/dist/chat/tools/execution/tool-error-handler.d.ts +2 -2
- package/dist/chat/tools/query-conversation-events.d.ts +3 -1
- package/dist/chat/tools/sandbox/bash.d.ts +1 -33
- package/dist/chat/tools/sandbox/edit-file.d.ts +1 -33
- package/dist/chat/tools/sandbox/find-files.d.ts +1 -33
- package/dist/chat/tools/sandbox/grep.d.ts +1 -33
- package/dist/chat/tools/sandbox/list-dir.d.ts +1 -33
- package/dist/chat/tools/sandbox/read-file.d.ts +1 -33
- package/dist/chat/tools/sandbox/write-file.d.ts +1 -33
- package/dist/{chunk-IDXLBKPS.js → chunk-2RFM7STT.js} +11 -22
- package/dist/{chunk-XDRGYDED.js → chunk-32FPGM2V.js} +1 -1
- package/dist/{chunk-JZ47AFSH.js → chunk-4SPRQJOW.js} +37 -45
- package/dist/{chunk-KLUMVJRQ.js → chunk-4TGVC42X.js} +133 -206
- package/dist/{chunk-UXQ5XSA2.js → chunk-BDE5RZVF.js} +2 -2
- package/dist/{chunk-ITMEXX5H.js → chunk-CYW4M6IV.js} +4 -4
- package/dist/{chunk-254MFDOF.js → chunk-DOB5RVMH.js} +2 -2
- package/dist/{chunk-TRECK7RV.js → chunk-E5SRLZQV.js} +14 -29
- package/dist/{chunk-LE77HHF3.js → chunk-GFTZKOTP.js} +1 -1
- package/dist/{chunk-ET2SDCNV.js → chunk-GN6WW7WR.js} +16 -31
- package/dist/{chunk-D2EMOH3N.js → chunk-ISQYBTPG.js} +3 -3
- package/dist/{chunk-IK4QSS5H.js → chunk-L2KJ2GNL.js} +1 -1
- package/dist/{chunk-VWBKDPMQ.js → chunk-NIJG6G6X.js} +472 -684
- package/dist/{chunk-Z2XXPUZG.js → chunk-NNGYYGX5.js} +2061 -2015
- package/dist/{chunk-WUP7NWMP.js → chunk-OKUZIXQM.js} +1 -1
- package/dist/{chunk-HDFGNU5E.js → chunk-S7G34U75.js} +3 -1
- package/dist/{chunk-UURFXX66.js → chunk-TZVZCIYL.js} +1 -1
- package/dist/{chunk-7HYV7KFM.js → chunk-USKP7IM2.js} +49 -92
- package/dist/{chunk-JYDIBXFY.js → chunk-V6XPIKYA.js} +13 -19
- package/dist/{chunk-3DBMANUI.js → chunk-VCC7XFX2.js} +22 -45
- package/dist/cli/chat.js +22 -22
- package/dist/cli/check.js +6 -6
- package/dist/cli/plugins.js +11 -11
- package/dist/cli/snapshot-create.js +9 -9
- package/dist/cli/upgrade.js +6 -6
- package/dist/{db-7HQT2SXQ.js → db-E6O2DXUQ.js} +6 -6
- package/dist/instrumentation.js +3 -3
- package/dist/nitro.js +2 -2
- package/dist/{oauth-callback-server-VHTUCNHK.js → oauth-callback-server-6SCPUFFD.js} +15 -15
- package/dist/{runner-3ONPZRED.js → runner-JFKCMVVY.js} +62 -51
- package/dist/{skills-WGAYGGPA.js → skills-RD66F2OB.js} +6 -6
- package/dist/{validation-ZIWNBG4D.js → validation-XVRNX6IU.js} +6 -6
- package/dist/version.js +1 -1
- package/package.json +8 -8
|
@@ -31,38 +31,6 @@ export declare function createFindFilesTool(): Omit<import("../definition").AnyT
|
|
|
31
31
|
path?: string | undefined;
|
|
32
32
|
limit?: number | undefined;
|
|
33
33
|
};
|
|
34
|
-
execute?: ((input: unknown, options: import("../definition").ToolExecuteOptions) =>
|
|
35
|
-
[x: string]: unknown;
|
|
36
|
-
ok: boolean;
|
|
37
|
-
status: "error" | "success";
|
|
38
|
-
target?: string | undefined;
|
|
39
|
-
data?: unknown;
|
|
40
|
-
truncated?: boolean | undefined;
|
|
41
|
-
continuation?: {
|
|
42
|
-
arguments: Record<string, unknown>;
|
|
43
|
-
reason?: string | undefined;
|
|
44
|
-
} | undefined;
|
|
45
|
-
error?: string | {
|
|
46
|
-
kind: string;
|
|
47
|
-
message: string;
|
|
48
|
-
retryable?: boolean | undefined;
|
|
49
|
-
} | undefined;
|
|
50
|
-
} | Promise<{
|
|
51
|
-
[x: string]: unknown;
|
|
52
|
-
ok: boolean;
|
|
53
|
-
status: "error" | "success";
|
|
54
|
-
target?: string | undefined;
|
|
55
|
-
data?: unknown;
|
|
56
|
-
truncated?: boolean | undefined;
|
|
57
|
-
continuation?: {
|
|
58
|
-
arguments: Record<string, unknown>;
|
|
59
|
-
reason?: string | undefined;
|
|
60
|
-
} | undefined;
|
|
61
|
-
error?: string | {
|
|
62
|
-
kind: string;
|
|
63
|
-
message: string;
|
|
64
|
-
retryable?: boolean | undefined;
|
|
65
|
-
} | undefined;
|
|
66
|
-
}>) | undefined;
|
|
34
|
+
execute?: ((input: unknown, options: import("../definition").ToolExecuteOptions) => Promise<never>) | undefined;
|
|
67
35
|
};
|
|
68
36
|
export {};
|
|
@@ -49,38 +49,6 @@ export declare function createGrepTool(): Omit<import("../definition").AnyToolDe
|
|
|
49
49
|
context?: number | undefined;
|
|
50
50
|
limit?: number | undefined;
|
|
51
51
|
};
|
|
52
|
-
execute?: ((input: unknown, options: import("../definition").ToolExecuteOptions) =>
|
|
53
|
-
[x: string]: unknown;
|
|
54
|
-
ok: boolean;
|
|
55
|
-
status: "error" | "success";
|
|
56
|
-
target?: string | undefined;
|
|
57
|
-
data?: unknown;
|
|
58
|
-
truncated?: boolean | undefined;
|
|
59
|
-
continuation?: {
|
|
60
|
-
arguments: Record<string, unknown>;
|
|
61
|
-
reason?: string | undefined;
|
|
62
|
-
} | undefined;
|
|
63
|
-
error?: string | {
|
|
64
|
-
kind: string;
|
|
65
|
-
message: string;
|
|
66
|
-
retryable?: boolean | undefined;
|
|
67
|
-
} | undefined;
|
|
68
|
-
} | Promise<{
|
|
69
|
-
[x: string]: unknown;
|
|
70
|
-
ok: boolean;
|
|
71
|
-
status: "error" | "success";
|
|
72
|
-
target?: string | undefined;
|
|
73
|
-
data?: unknown;
|
|
74
|
-
truncated?: boolean | undefined;
|
|
75
|
-
continuation?: {
|
|
76
|
-
arguments: Record<string, unknown>;
|
|
77
|
-
reason?: string | undefined;
|
|
78
|
-
} | undefined;
|
|
79
|
-
error?: string | {
|
|
80
|
-
kind: string;
|
|
81
|
-
message: string;
|
|
82
|
-
retryable?: boolean | undefined;
|
|
83
|
-
} | undefined;
|
|
84
|
-
}>) | undefined;
|
|
52
|
+
execute?: ((input: unknown, options: import("../definition").ToolExecuteOptions) => Promise<never>) | undefined;
|
|
85
53
|
};
|
|
86
54
|
export {};
|
|
@@ -33,38 +33,6 @@ export declare function createListDirTool(): Omit<import("../definition").AnyToo
|
|
|
33
33
|
path?: string | undefined;
|
|
34
34
|
limit?: number | undefined;
|
|
35
35
|
};
|
|
36
|
-
execute?: ((input: unknown, options: import("../definition").ToolExecuteOptions) =>
|
|
37
|
-
[x: string]: unknown;
|
|
38
|
-
ok: boolean;
|
|
39
|
-
status: "error" | "success";
|
|
40
|
-
target?: string | undefined;
|
|
41
|
-
data?: unknown;
|
|
42
|
-
truncated?: boolean | undefined;
|
|
43
|
-
continuation?: {
|
|
44
|
-
arguments: Record<string, unknown>;
|
|
45
|
-
reason?: string | undefined;
|
|
46
|
-
} | undefined;
|
|
47
|
-
error?: string | {
|
|
48
|
-
kind: string;
|
|
49
|
-
message: string;
|
|
50
|
-
retryable?: boolean | undefined;
|
|
51
|
-
} | undefined;
|
|
52
|
-
} | Promise<{
|
|
53
|
-
[x: string]: unknown;
|
|
54
|
-
ok: boolean;
|
|
55
|
-
status: "error" | "success";
|
|
56
|
-
target?: string | undefined;
|
|
57
|
-
data?: unknown;
|
|
58
|
-
truncated?: boolean | undefined;
|
|
59
|
-
continuation?: {
|
|
60
|
-
arguments: Record<string, unknown>;
|
|
61
|
-
reason?: string | undefined;
|
|
62
|
-
} | undefined;
|
|
63
|
-
error?: string | {
|
|
64
|
-
kind: string;
|
|
65
|
-
message: string;
|
|
66
|
-
retryable?: boolean | undefined;
|
|
67
|
-
} | undefined;
|
|
68
|
-
}>) | undefined;
|
|
36
|
+
execute?: ((input: unknown, options: import("../definition").ToolExecuteOptions) => Promise<never>) | undefined;
|
|
69
37
|
};
|
|
70
38
|
export {};
|
|
@@ -8,37 +8,5 @@ export declare function createReadFileTool(): Omit<import("../definition").AnyTo
|
|
|
8
8
|
offset?: number | undefined;
|
|
9
9
|
limit?: number | undefined;
|
|
10
10
|
};
|
|
11
|
-
execute?: ((input: unknown, options: import("../definition").ToolExecuteOptions) =>
|
|
12
|
-
[x: string]: unknown;
|
|
13
|
-
ok: boolean;
|
|
14
|
-
status: "error" | "success";
|
|
15
|
-
target?: string | undefined;
|
|
16
|
-
data?: unknown;
|
|
17
|
-
truncated?: boolean | undefined;
|
|
18
|
-
continuation?: {
|
|
19
|
-
arguments: Record<string, unknown>;
|
|
20
|
-
reason?: string | undefined;
|
|
21
|
-
} | undefined;
|
|
22
|
-
error?: string | {
|
|
23
|
-
kind: string;
|
|
24
|
-
message: string;
|
|
25
|
-
retryable?: boolean | undefined;
|
|
26
|
-
} | undefined;
|
|
27
|
-
} | Promise<{
|
|
28
|
-
[x: string]: unknown;
|
|
29
|
-
ok: boolean;
|
|
30
|
-
status: "error" | "success";
|
|
31
|
-
target?: string | undefined;
|
|
32
|
-
data?: unknown;
|
|
33
|
-
truncated?: boolean | undefined;
|
|
34
|
-
continuation?: {
|
|
35
|
-
arguments: Record<string, unknown>;
|
|
36
|
-
reason?: string | undefined;
|
|
37
|
-
} | undefined;
|
|
38
|
-
error?: string | {
|
|
39
|
-
kind: string;
|
|
40
|
-
message: string;
|
|
41
|
-
retryable?: boolean | undefined;
|
|
42
|
-
} | undefined;
|
|
43
|
-
}>) | undefined;
|
|
11
|
+
execute?: ((input: unknown, options: import("../definition").ToolExecuteOptions) => Promise<never>) | undefined;
|
|
44
12
|
};
|
|
@@ -6,37 +6,5 @@ export declare function createWriteFileTool(): Omit<import("../definition").AnyT
|
|
|
6
6
|
path: string;
|
|
7
7
|
content: string;
|
|
8
8
|
};
|
|
9
|
-
execute?: ((input: unknown, options: import("../definition").ToolExecuteOptions) =>
|
|
10
|
-
[x: string]: unknown;
|
|
11
|
-
ok: boolean;
|
|
12
|
-
status: "error" | "success";
|
|
13
|
-
target?: string | undefined;
|
|
14
|
-
data?: unknown;
|
|
15
|
-
truncated?: boolean | undefined;
|
|
16
|
-
continuation?: {
|
|
17
|
-
arguments: Record<string, unknown>;
|
|
18
|
-
reason?: string | undefined;
|
|
19
|
-
} | undefined;
|
|
20
|
-
error?: string | {
|
|
21
|
-
kind: string;
|
|
22
|
-
message: string;
|
|
23
|
-
retryable?: boolean | undefined;
|
|
24
|
-
} | undefined;
|
|
25
|
-
} | Promise<{
|
|
26
|
-
[x: string]: unknown;
|
|
27
|
-
ok: boolean;
|
|
28
|
-
status: "error" | "success";
|
|
29
|
-
target?: string | undefined;
|
|
30
|
-
data?: unknown;
|
|
31
|
-
truncated?: boolean | undefined;
|
|
32
|
-
continuation?: {
|
|
33
|
-
arguments: Record<string, unknown>;
|
|
34
|
-
reason?: string | undefined;
|
|
35
|
-
} | undefined;
|
|
36
|
-
error?: string | {
|
|
37
|
-
kind: string;
|
|
38
|
-
message: string;
|
|
39
|
-
retryable?: boolean | undefined;
|
|
40
|
-
} | undefined;
|
|
41
|
-
}>) | undefined;
|
|
9
|
+
execute?: ((input: unknown, options: import("../definition").ToolExecuteOptions) => Promise<never>) | undefined;
|
|
42
10
|
};
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
toCanonicalInputMessage,
|
|
5
5
|
toCanonicalOutputMessage,
|
|
6
6
|
toGenAiMessagesTraceAttributes
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-S7G34U75.js";
|
|
8
8
|
import {
|
|
9
9
|
extractGenAiUsageAttributes,
|
|
10
10
|
logException,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
normalizeGenAiFinishReason,
|
|
13
13
|
serializeGenAiAttribute,
|
|
14
14
|
withSpan
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-4SPRQJOW.js";
|
|
16
16
|
|
|
17
17
|
// src/chat/config.ts
|
|
18
18
|
import { getModel as getModel2 } from "@earendil-works/pi-ai/compat";
|
|
@@ -407,15 +407,10 @@ async function completeText(params) {
|
|
|
407
407
|
setSpanAttributes(endAttributes);
|
|
408
408
|
if (message.stopReason === "error") {
|
|
409
409
|
const providerMessage2 = message.errorMessage?.trim() || "Unknown provider error";
|
|
410
|
-
logWarn(
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
...baseAttributes,
|
|
415
|
-
"exception.message": providerMessage2
|
|
416
|
-
},
|
|
417
|
-
"AI completion returned provider error"
|
|
418
|
-
);
|
|
410
|
+
logWarn("ai.completion.provider_error", {
|
|
411
|
+
...baseAttributes,
|
|
412
|
+
"exception.message": providerMessage2
|
|
413
|
+
});
|
|
419
414
|
throw createProviderError(providerMessage2, { modelId: params.modelId });
|
|
420
415
|
}
|
|
421
416
|
return {
|
|
@@ -541,17 +536,11 @@ async function embedTexts(params) {
|
|
|
541
536
|
if (isProviderRetryError(providerError)) {
|
|
542
537
|
throw providerError;
|
|
543
538
|
}
|
|
544
|
-
logException(
|
|
545
|
-
|
|
546
|
-
"
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
"gen_ai.provider.name": GEN_AI_PROVIDER_NAME,
|
|
550
|
-
"gen_ai.operation.name": GEN_AI_OPERATION_EMBEDDINGS,
|
|
551
|
-
"gen_ai.request.model": params.modelId
|
|
552
|
-
},
|
|
553
|
-
"AI embeddings failed"
|
|
554
|
-
);
|
|
539
|
+
logException(providerError, "ai.embeddings.failed", {
|
|
540
|
+
"gen_ai.provider.name": GEN_AI_PROVIDER_NAME,
|
|
541
|
+
"gen_ai.operation.name": GEN_AI_OPERATION_EMBEDDINGS,
|
|
542
|
+
"gen_ai.request.model": params.modelId
|
|
543
|
+
});
|
|
555
544
|
throw providerError;
|
|
556
545
|
}
|
|
557
546
|
}
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from "./chunk-6GWA276C.js";
|
|
14
14
|
import {
|
|
15
15
|
getDeploymentTelemetryAttributes
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-L2KJ2GNL.js";
|
|
17
17
|
|
|
18
18
|
// src/chat/logging.ts
|
|
19
19
|
import path from "path";
|
|
@@ -100,6 +100,7 @@ function normalizeIdentityEmail(email) {
|
|
|
100
100
|
|
|
101
101
|
// src/chat/logging.ts
|
|
102
102
|
var MAX_STRING_VALUE = 1200;
|
|
103
|
+
var EVENT_NAME_PATTERN = /^[a-z][a-z0-9_]*(?:\.[a-z][a-z0-9_]*)+$/;
|
|
103
104
|
var SECRETS_RE = [
|
|
104
105
|
/\b(sk-[A-Za-z0-9_-]{20,})\b/g,
|
|
105
106
|
/\b(xox[baprs]-[A-Za-z0-9-]{10,})\b/g,
|
|
@@ -332,6 +333,16 @@ function redactSecrets(input) {
|
|
|
332
333
|
function toSnakeCase(value) {
|
|
333
334
|
return value.replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/[^a-zA-Z0-9_]+/g, "_").replace(/^_+|_+$/g, "").toLowerCase();
|
|
334
335
|
}
|
|
336
|
+
function normalizeEventName(value) {
|
|
337
|
+
const segments = value.trim().split(".").map(toSnakeCase).filter(Boolean);
|
|
338
|
+
const normalized = segments.length === 0 ? "log.record.emitted" : segments.length === 1 ? `app.${segments[0]}` : segments.join(".");
|
|
339
|
+
if (process.env.NODE_ENV !== "production" && (!EVENT_NAME_PATTERN.test(value) || value !== normalized)) {
|
|
340
|
+
throw new Error(
|
|
341
|
+
`Invalid log event name "${value}"; use lowercase dot-delimited namespaces`
|
|
342
|
+
);
|
|
343
|
+
}
|
|
344
|
+
return normalized;
|
|
345
|
+
}
|
|
335
346
|
function isSemanticKey(key) {
|
|
336
347
|
return /^[a-z][a-z0-9_]*(\.[a-z0-9_][a-z0-9_-]*)+$/.test(key);
|
|
337
348
|
}
|
|
@@ -340,6 +351,9 @@ function normalizeAttributeKey(key) {
|
|
|
340
351
|
if (mapped) {
|
|
341
352
|
return mapped;
|
|
342
353
|
}
|
|
354
|
+
if (key === "trace_id" || key === "span_id" || key === "trace_flags") {
|
|
355
|
+
return key;
|
|
356
|
+
}
|
|
343
357
|
if (isSemanticKey(key)) {
|
|
344
358
|
return key;
|
|
345
359
|
}
|
|
@@ -449,7 +463,7 @@ function toEmittedLogRecord(record) {
|
|
|
449
463
|
const body = toOptionalString(rawBody) ?? record.message.map(
|
|
450
464
|
(segment) => typeof segment === "string" ? segment : String(segment ?? "")
|
|
451
465
|
).join("");
|
|
452
|
-
const eventName = toOptionalString(attributes["event.name"]) ?? "
|
|
466
|
+
const eventName = toOptionalString(attributes["event.name"]) ?? "log.record.emitted";
|
|
453
467
|
return {
|
|
454
468
|
level: fromLogTapeLevel(record.level),
|
|
455
469
|
eventName,
|
|
@@ -592,7 +606,7 @@ function formatConsoleValue(value) {
|
|
|
592
606
|
return quoteConsoleValue(value);
|
|
593
607
|
}
|
|
594
608
|
function shouldShowConsoleDestinationName(eventName) {
|
|
595
|
-
return /^(
|
|
609
|
+
return /^(app_home|oauth|queue|slash_command|slack|webhook)\./.test(
|
|
596
610
|
eventName
|
|
597
611
|
);
|
|
598
612
|
}
|
|
@@ -600,7 +614,7 @@ function shouldShowConsoleModel(level, eventName) {
|
|
|
600
614
|
if (level === "warn" || level === "error") {
|
|
601
615
|
return true;
|
|
602
616
|
}
|
|
603
|
-
return eventName.startsWith("
|
|
617
|
+
return eventName.startsWith("ai.") || eventName.startsWith("assistant.") || eventName === "agent.turn.started" || eventName === "agent.turn.completed" || eventName === "agent.turn.provider_error";
|
|
604
618
|
}
|
|
605
619
|
function shouldHideConsoleAttribute(level, eventName, key, attributes) {
|
|
606
620
|
if (CONSOLE_ALWAYS_HIDDEN_KEYS.has(key)) {
|
|
@@ -621,10 +635,10 @@ function shouldHideConsoleAttribute(level, eventName, key, attributes) {
|
|
|
621
635
|
if (key === "gen_ai.request.model" && !shouldShowConsoleModel(level, eventName)) {
|
|
622
636
|
return true;
|
|
623
637
|
}
|
|
624
|
-
if (key === "gen_ai.provider.name" && eventName.startsWith("
|
|
638
|
+
if (key === "gen_ai.provider.name" && eventName.startsWith("agent.tool_call.") && level !== "warn" && level !== "error") {
|
|
625
639
|
return true;
|
|
626
640
|
}
|
|
627
|
-
if (key === "gen_ai.operation.name" && eventName.startsWith("
|
|
641
|
+
if (key === "gen_ai.operation.name" && eventName.startsWith("agent.tool_call.")) {
|
|
628
642
|
return true;
|
|
629
643
|
}
|
|
630
644
|
return false;
|
|
@@ -673,7 +687,7 @@ function booleanConsoleToken(label, value) {
|
|
|
673
687
|
return typeof value === "boolean" ? `${label}=${value ? "yes" : "no"}` : void 0;
|
|
674
688
|
}
|
|
675
689
|
function shouldShowPrettyCorrelation(eventName) {
|
|
676
|
-
return !(eventName === "
|
|
690
|
+
return !(eventName === "plugin.loaded" || eventName === "startup.discovery.completed" || eventName.endsWith(".loaded"));
|
|
677
691
|
}
|
|
678
692
|
function getPrettyConsoleSummaryTokens(level, eventName, attributes) {
|
|
679
693
|
const tokens = [];
|
|
@@ -683,7 +697,7 @@ function getPrettyConsoleSummaryTokens(level, eventName, attributes) {
|
|
|
683
697
|
);
|
|
684
698
|
pushPrettyConsoleToken(
|
|
685
699
|
tokens,
|
|
686
|
-
eventName.startsWith("
|
|
700
|
+
eventName.startsWith("plugin.heartbeat.") ? stringConsoleToken("plugin", attributes["app.plugin.name"]) : toOptionalString(attributes["app.plugin.name"]) ?? void 0
|
|
687
701
|
);
|
|
688
702
|
pushPrettyConsoleToken(
|
|
689
703
|
tokens,
|
|
@@ -733,7 +747,7 @@ function getPrettyConsoleSummaryTokens(level, eventName, attributes) {
|
|
|
733
747
|
);
|
|
734
748
|
}
|
|
735
749
|
const filePath = toOptionalString(attributes["file.path"]);
|
|
736
|
-
if (filePath && eventName.endsWith("
|
|
750
|
+
if (filePath && eventName.endsWith(".loaded")) {
|
|
737
751
|
pushPrettyConsoleToken(tokens, toRelativeConsolePath(filePath));
|
|
738
752
|
}
|
|
739
753
|
if (shouldShowPrettyCorrelation(eventName)) {
|
|
@@ -860,7 +874,7 @@ function emitDirect(level, eventName, body, attributes) {
|
|
|
860
874
|
function emitRecord(category, level, eventName, attrs = {}, body) {
|
|
861
875
|
ensureLoggerBackend();
|
|
862
876
|
const traceAttributes = getTraceCorrelationAttributes();
|
|
863
|
-
const normalizedEventName =
|
|
877
|
+
const normalizedEventName = normalizeEventName(eventName);
|
|
864
878
|
const message = body ? redactSecrets(body) : normalizedEventName;
|
|
865
879
|
const source = getLogSource([...ROOT_LOGGER_CATEGORY, ...category]);
|
|
866
880
|
const contextAttributes = ownsLogTapeBackend ? void 0 : getBoundLogAttributes();
|
|
@@ -914,7 +928,7 @@ var log = {
|
|
|
914
928
|
error(eventName, attrs = {}, body) {
|
|
915
929
|
emit("error", eventName, attrs, body);
|
|
916
930
|
},
|
|
917
|
-
exception(eventName, error, attrs = {}, body
|
|
931
|
+
exception(eventName, error, attrs = {}, body) {
|
|
918
932
|
const normalizedError = error instanceof Error ? error : new Error(String(error));
|
|
919
933
|
emit(
|
|
920
934
|
"error",
|
|
@@ -926,17 +940,14 @@ var log = {
|
|
|
926
940
|
"exception.message": normalizedError.message,
|
|
927
941
|
"exception.stacktrace": normalizedError.stack
|
|
928
942
|
},
|
|
929
|
-
body
|
|
943
|
+
body
|
|
930
944
|
);
|
|
931
945
|
let eventId;
|
|
932
946
|
const sentryWithScope = withScope;
|
|
933
947
|
const sentryCaptureException = captureException;
|
|
934
948
|
if (typeof sentryWithScope === "function" && typeof sentryCaptureException === "function") {
|
|
935
949
|
sentryWithScope((scope) => {
|
|
936
|
-
setSentryScopeContext(scope,
|
|
937
|
-
...getBoundLogContext(),
|
|
938
|
-
...context
|
|
939
|
-
});
|
|
950
|
+
setSentryScopeContext(scope, getBoundLogContext());
|
|
940
951
|
for (const [key, value] of Object.entries(
|
|
941
952
|
mergeAttributes(getBoundLogAttributes(), attrs)
|
|
942
953
|
)) {
|
|
@@ -947,12 +958,7 @@ var log = {
|
|
|
947
958
|
return eventId;
|
|
948
959
|
}
|
|
949
960
|
if (typeof sentryCaptureException === "function") {
|
|
950
|
-
setSentryUser(
|
|
951
|
-
sentryUserIdentityFromContext({
|
|
952
|
-
...getBoundLogContext(),
|
|
953
|
-
...context
|
|
954
|
-
})
|
|
955
|
-
);
|
|
961
|
+
setSentryUser(sentryUserIdentityFromContext(getBoundLogContext()));
|
|
956
962
|
eventId = sentryCaptureException(normalizedError);
|
|
957
963
|
}
|
|
958
964
|
return eventId;
|
|
@@ -1007,7 +1013,7 @@ function createChatSdkLoggerImpl(category, minimumLevel) {
|
|
|
1007
1013
|
emitRecord(
|
|
1008
1014
|
category,
|
|
1009
1015
|
level === "warn" ? "warn" : level,
|
|
1010
|
-
level === "error" ? "
|
|
1016
|
+
level === "error" ? "chat_sdk.log.error" : level === "warn" ? "chat_sdk.log.warn" : "chat_sdk.log",
|
|
1011
1017
|
args.length > 0 ? {
|
|
1012
1018
|
"app.log.args": args.length === 1 ? args[0] : args
|
|
1013
1019
|
} : {},
|
|
@@ -1071,14 +1077,6 @@ function createLogContextFromRequest(request, context = {}) {
|
|
|
1071
1077
|
userAgent: request.headers.get("user-agent") ?? void 0
|
|
1072
1078
|
};
|
|
1073
1079
|
}
|
|
1074
|
-
function toSpanAttributes(context) {
|
|
1075
|
-
const attrs = contextToAttributes(context);
|
|
1076
|
-
return Object.fromEntries(
|
|
1077
|
-
Object.entries(attrs).filter(
|
|
1078
|
-
([, value]) => typeof value === "string" && value.length > 0
|
|
1079
|
-
)
|
|
1080
|
-
);
|
|
1081
|
-
}
|
|
1082
1080
|
function setSentryTagsFromContext(context) {
|
|
1083
1081
|
const attrs = contextToAttributes(context);
|
|
1084
1082
|
for (const [key, value] of Object.entries(attrs)) {
|
|
@@ -1161,24 +1159,18 @@ function setAttributesOnSpan(span, attributes) {
|
|
|
1161
1159
|
span.setAttribute(key, value);
|
|
1162
1160
|
}
|
|
1163
1161
|
}
|
|
1164
|
-
function logInfo(eventName,
|
|
1165
|
-
log.info(eventName,
|
|
1162
|
+
function logInfo(eventName, attributes = {}) {
|
|
1163
|
+
log.info(eventName, attributes);
|
|
1166
1164
|
}
|
|
1167
|
-
function logWarn(eventName,
|
|
1168
|
-
log.warn(eventName,
|
|
1165
|
+
function logWarn(eventName, attributes = {}) {
|
|
1166
|
+
log.warn(eventName, attributes);
|
|
1169
1167
|
}
|
|
1170
|
-
function logError(eventName,
|
|
1171
|
-
log.error(eventName,
|
|
1168
|
+
function logError(eventName, attributes = {}) {
|
|
1169
|
+
log.error(eventName, attributes);
|
|
1172
1170
|
}
|
|
1173
|
-
function logException(error, eventName,
|
|
1171
|
+
function logException(error, eventName, attributes = {}) {
|
|
1174
1172
|
const normalizedError = error instanceof Error ? error : new Error(String(error));
|
|
1175
|
-
return log.exception(
|
|
1176
|
-
eventName,
|
|
1177
|
-
normalizedError,
|
|
1178
|
-
{ ...toSpanAttributes(context), ...attributes },
|
|
1179
|
-
body,
|
|
1180
|
-
context
|
|
1181
|
-
);
|
|
1173
|
+
return log.exception(eventName, normalizedError, attributes);
|
|
1182
1174
|
}
|
|
1183
1175
|
function setTags(context = {}) {
|
|
1184
1176
|
updateLogContext(context, contextToAttributes(context));
|