@sentry/junior 0.26.0 → 0.27.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/app.js +692 -758
- package/dist/{chunk-A75TWGF2.js → chunk-4PVJHUEV.js} +36 -0
- package/dist/cli/snapshot-warmup.js +1 -1
- package/package.json +1 -1
|
@@ -22,6 +22,20 @@ var MIN_AGENT_TURN_TIMEOUT_MS = 10 * 1e3;
|
|
|
22
22
|
var DEFAULT_AGENT_TURN_TIMEOUT_MS = 12 * 60 * 1e3;
|
|
23
23
|
var DEFAULT_FUNCTION_MAX_DURATION_SECONDS = 800;
|
|
24
24
|
var FUNCTION_TIMEOUT_BUFFER_SECONDS = 20;
|
|
25
|
+
var DEFAULT_ASSISTANT_LOADING_MESSAGES = [
|
|
26
|
+
"Consulting the orb",
|
|
27
|
+
"Bribing the gremlins",
|
|
28
|
+
"Shuffling the papers dramatically",
|
|
29
|
+
"Summoning the right stack trace",
|
|
30
|
+
"Negotiating with the mutex",
|
|
31
|
+
"Poking the internet with a stick",
|
|
32
|
+
"Asking the docs nicely",
|
|
33
|
+
"Searching for the least cursed path",
|
|
34
|
+
"Pretending this was obvious",
|
|
35
|
+
"Waking up the test suite",
|
|
36
|
+
"Untangling the spaghetti carefully",
|
|
37
|
+
"Rattling the command line"
|
|
38
|
+
];
|
|
25
39
|
function parseAgentTurnTimeoutMs(rawValue, maxTimeoutMs) {
|
|
26
40
|
const value = Number.parseInt(rawValue ?? "", 10);
|
|
27
41
|
if (Number.isNaN(value)) {
|
|
@@ -44,6 +58,27 @@ function resolveMaxTurnTimeoutMs(functionMaxDurationSeconds) {
|
|
|
44
58
|
const budgetSeconds = functionMaxDurationSeconds - FUNCTION_TIMEOUT_BUFFER_SECONDS;
|
|
45
59
|
return Math.max(MIN_AGENT_TURN_TIMEOUT_MS, budgetSeconds * 1e3);
|
|
46
60
|
}
|
|
61
|
+
function parseLoadingMessages(rawValue) {
|
|
62
|
+
const trimmed = rawValue?.trim();
|
|
63
|
+
if (!trimmed) {
|
|
64
|
+
return [...DEFAULT_ASSISTANT_LOADING_MESSAGES];
|
|
65
|
+
}
|
|
66
|
+
let parsed;
|
|
67
|
+
try {
|
|
68
|
+
parsed = JSON.parse(trimmed);
|
|
69
|
+
} catch {
|
|
70
|
+
throw new Error("JUNIOR_LOADING_MESSAGES must be a JSON array of strings");
|
|
71
|
+
}
|
|
72
|
+
if (!Array.isArray(parsed)) {
|
|
73
|
+
throw new Error("JUNIOR_LOADING_MESSAGES must be a JSON array of strings");
|
|
74
|
+
}
|
|
75
|
+
return parsed.map((value, index) => {
|
|
76
|
+
if (typeof value !== "string") {
|
|
77
|
+
throw new Error(`JUNIOR_LOADING_MESSAGES[${index}] must be a string`);
|
|
78
|
+
}
|
|
79
|
+
return value.trim();
|
|
80
|
+
});
|
|
81
|
+
}
|
|
47
82
|
function readBotConfig(env) {
|
|
48
83
|
const functionMaxDurationSeconds = resolveFunctionMaxDurationSeconds(env);
|
|
49
84
|
const maxTurnTimeoutMs = resolveMaxTurnTimeoutMs(functionMaxDurationSeconds);
|
|
@@ -51,6 +86,7 @@ function readBotConfig(env) {
|
|
|
51
86
|
userName: env.JUNIOR_BOT_NAME ?? "junior",
|
|
52
87
|
modelId: env.AI_MODEL ?? "anthropic/claude-sonnet-4.6",
|
|
53
88
|
fastModelId: env.AI_FAST_MODEL ?? env.AI_MODEL ?? "anthropic/claude-haiku-4.5",
|
|
89
|
+
loadingMessages: parseLoadingMessages(env.JUNIOR_LOADING_MESSAGES),
|
|
54
90
|
visionModelId: toOptionalTrimmed(env.AI_VISION_MODEL),
|
|
55
91
|
turnTimeoutMs: parseAgentTurnTimeoutMs(
|
|
56
92
|
env.AGENT_TURN_TIMEOUT_MS,
|