@sentry/junior 0.109.0 → 0.111.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-FHHVLNPA.js → agent-hooks-QQ2IWKOP.js} +12 -13
- package/dist/api/conversations/access.d.ts +9 -0
- package/dist/api/conversations/aggregate.d.ts +12 -1
- package/dist/api/conversations/archive.d.ts +3 -5
- package/dist/api/conversations/detail.d.ts +156 -7
- package/dist/api/conversations/events.d.ts +1 -1
- package/dist/api/conversations/list.d.ts +57 -6
- package/dist/api/conversations/projection.d.ts +6 -7
- package/dist/api/conversations/reporting.d.ts +10 -4
- package/dist/api/conversations/routes.d.ts +2 -1
- package/dist/api/conversations/shared.d.ts +1 -1
- package/dist/api/conversations/stats.d.ts +37 -6
- package/dist/api/conversations/stats.query.d.ts +1 -1
- package/dist/api/conversations/usage.d.ts +9 -0
- package/dist/api/http.d.ts +7 -0
- package/dist/api/locations/detail.d.ts +102 -6
- package/dist/api/locations/list.d.ts +43 -5
- package/dist/api/locations/query.d.ts +4 -2
- package/dist/api/locations/routes.d.ts +2 -1
- package/dist/api/people/list.d.ts +28 -6
- package/dist/api/people/list.query.d.ts +1 -1
- package/dist/api/people/profile.d.ts +96 -7
- package/dist/api/people/profile.query.d.ts +4 -2
- package/dist/api/people/routes.d.ts +2 -1
- package/dist/api/people/shared.d.ts +1219 -2
- package/dist/api/route.d.ts +18 -4
- package/dist/api/schema/common.d.ts +6 -0
- package/dist/api/{conversations/schema.d.ts → schema/conversation.d.ts} +31 -3
- package/dist/api/{locations/schema.d.ts → schema/location.d.ts} +5 -0
- package/dist/api/{people/schema.d.ts → schema/person.d.ts} +37 -45
- package/dist/api/schema.d.ts +8 -22
- package/dist/api/schema.js +10 -2
- package/dist/api.d.ts +5 -1
- package/dist/api.js +767 -384
- package/dist/app.js +591 -447
- package/dist/build/virtual-config.d.ts +2 -0
- package/dist/catalog-runtime-D22W6QEJ.js +16 -0
- package/dist/chat/agent/request.d.ts +3 -6
- package/dist/chat/agent/resume.d.ts +11 -12
- package/dist/chat/agent/sandbox.d.ts +36 -11
- package/dist/chat/agent/tools.d.ts +5 -8
- package/dist/chat/config.d.ts +8 -1
- package/dist/chat/conversations/history.d.ts +3 -0
- package/dist/chat/conversations/sql/privacy.d.ts +3 -15
- package/dist/chat/pi/messages.d.ts +2 -2
- package/dist/chat/pi/sdk.d.ts +1 -1
- package/dist/chat/pi/sql-model-usage.d.ts +4 -1
- package/dist/chat/plugins/agent-hooks.d.ts +2 -2
- package/dist/chat/runtime/agent-continue-runner.d.ts +7 -3
- package/dist/chat/runtime/slack-runtime.d.ts +1 -2
- package/dist/chat/runtime/thread-state.d.ts +3 -7
- package/dist/chat/runtime/turn-preparation.d.ts +2 -2
- package/dist/chat/sandbox/command-result.d.ts +91 -0
- package/dist/chat/sandbox/errors.d.ts +3 -1
- package/dist/chat/sandbox/ref.d.ts +5 -0
- package/dist/chat/sandbox/sandbox.d.ts +19 -46
- package/dist/chat/sandbox/session.d.ts +16 -20
- package/dist/chat/sandbox/skill-sync.d.ts +2 -2
- package/dist/chat/sandbox/workspace.d.ts +14 -12
- package/dist/chat/services/auth-pause.d.ts +4 -0
- package/dist/chat/services/context-compaction.d.ts +1 -0
- package/dist/chat/services/turn-result.d.ts +3 -4
- package/dist/chat/task-execution/queue-signing.d.ts +10 -8
- package/dist/chat/task-execution/queue.d.ts +9 -7
- package/dist/chat/task-execution/slack-work.d.ts +9 -7
- package/dist/chat/task-execution/state.d.ts +75 -22
- package/dist/chat/task-execution/store.d.ts +34 -3
- package/dist/chat/task-execution/worker.d.ts +0 -1
- package/dist/chat/tool-support/normalize-result.d.ts +2 -2
- package/dist/chat/tool-support/pi-tool-adapter.d.ts +2 -2
- package/dist/chat/tool-support/structured-result.d.ts +1 -2
- package/dist/chat/tools/sandbox/file-uploads.d.ts +1 -1
- package/dist/chat/{runtime → tools/sandbox}/generated-artifacts.d.ts +3 -3
- package/dist/chat/tools/types.d.ts +1 -1
- package/dist/chat/tools/web/fetch-content.d.ts +5 -0
- package/dist/chat/tools/web/image-generate.d.ts +2 -1
- package/dist/chat/tools/web/search.d.ts +1 -1
- package/dist/{chunk-CEA3A3UA.js → chunk-2ZTTXTSZ.js} +24 -1
- package/dist/{chunk-IVVGFRQQ.js → chunk-42WRQLJ6.js} +10 -38
- package/dist/{chunk-O3JMSZLI.js → chunk-6Y5L4BOM.js} +3 -5
- package/dist/{chunk-HO5NT6OE.js → chunk-B45FPP2A.js} +306 -31
- package/dist/{chunk-WHMOBKT7.js → chunk-BTRNMS6A.js} +2 -2
- package/dist/{chunk-PLB7MRCQ.js → chunk-C4MZ3GP5.js} +1 -1
- package/dist/{chunk-HHVY4SMP.js → chunk-FPK7XY3F.js} +98 -92
- package/dist/{chunk-RGX4V75M.js → chunk-IFAHK54X.js} +3 -3
- package/dist/{chunk-ISMWX44P.js → chunk-J7APPQIJ.js} +2 -2
- package/dist/{chunk-TMBRFULF.js → chunk-JQFJO5WH.js} +7 -1
- package/dist/{chunk-FWJRXN4F.js → chunk-L6JPKANW.js} +3 -139
- package/dist/{chunk-7Q6WCISF.js → chunk-MIAKQNYX.js} +43 -31
- package/dist/chunk-MPVES2IC.js +44 -0
- package/dist/{chunk-JNAVF45E.js → chunk-NQLWOTY4.js} +47 -19
- package/dist/{chunk-IXKSQGIO.js → chunk-OOLU34J4.js} +8860 -9137
- package/dist/{chunk-OUHNWH46.js → chunk-PYKKM4MM.js} +1 -1
- package/dist/{chunk-MXW4GL53.js → chunk-PZELBSHC.js} +8 -9
- package/dist/{chunk-QY636HZU.js → chunk-QQIVLZW4.js} +96 -17
- package/dist/{chunk-72OMGPDS.js → chunk-SL3ZKNLQ.js} +19 -18
- package/dist/{chunk-3SXUV423.js → chunk-WSRBFHPX.js} +1 -1
- package/dist/{chunk-TT6GMXNA.js → chunk-XQAYFRWT.js} +2 -2
- package/dist/{chunk-MGUMR35T.js → chunk-Z2W4SJZ7.js} +1 -1
- package/dist/{chunk-OCD3OZRK.js → chunk-Z4G3WCP3.js} +1 -1
- package/dist/{chunk-FENLIFJD.js → chunk-ZRZ4SVWG.js} +69 -10
- package/dist/cli/chat.js +23 -24
- package/dist/cli/check.js +8 -8
- package/dist/cli/plugins.js +15 -16
- package/dist/cli/snapshot-warmup.js +11 -11
- package/dist/cli/upgrade.js +9 -9
- package/dist/db/schema/conversations.d.ts +17 -0
- package/dist/db/schema.d.ts +17 -0
- package/dist/{db-V3NU72O2.js → db-WXQOQESG.js} +8 -9
- package/dist/instrumentation.js +4 -4
- package/dist/nitro.js +15 -10
- package/dist/reporting-schema.d.ts +46 -0
- package/dist/{runner-JYBCQBLK.js → runner-4QY4XH4B.js} +23 -33
- package/dist/{skills-U6MDAST7.js → skills-P5MU4EBX.js} +8 -8
- package/dist/{validation-72N3JVRU.js → validation-PQF5OP6T.js} +8 -8
- package/dist/version.js +1 -1
- package/migrations/0007_thick_sugar_man.sql +23 -0
- package/migrations/meta/0007_snapshot.json +1013 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +6 -6
- package/dist/catalog-runtime-DMGJSLV2.js +0 -16
- package/dist/chunk-OB42YVAE.js +0 -16
- package/dist/chunk-SYAQIR5Z.js +0 -53
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
toCanonicalInputMessage,
|
|
5
5
|
toCanonicalOutputMessage,
|
|
6
6
|
toGenAiMessagesTraceAttributes
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-6Y5L4BOM.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-J7APPQIJ.js";
|
|
16
16
|
|
|
17
17
|
// src/chat/xml.ts
|
|
18
18
|
function escapeXml(value) {
|
|
@@ -172,7 +172,7 @@ function stripRuntimeTurnContext(messages) {
|
|
|
172
172
|
}
|
|
173
173
|
|
|
174
174
|
// src/chat/config.ts
|
|
175
|
-
import { getModel } from "@earendil-works/pi-ai/compat";
|
|
175
|
+
import { getModel as getModel2 } from "@earendil-works/pi-ai/compat";
|
|
176
176
|
|
|
177
177
|
// src/chat/optional-string.ts
|
|
178
178
|
function toOptionalTrimmed(value) {
|
|
@@ -187,7 +187,9 @@ function toOptionalTrimmed(value) {
|
|
|
187
187
|
import {
|
|
188
188
|
completeSimple,
|
|
189
189
|
getEnvApiKey,
|
|
190
|
+
getModel,
|
|
190
191
|
getModels,
|
|
192
|
+
isRetryableAssistantError,
|
|
191
193
|
registerApiProvider
|
|
192
194
|
} from "@earendil-works/pi-ai/compat";
|
|
193
195
|
import {
|
|
@@ -592,6 +594,7 @@ var DEFAULT_SLACK_SLASH_COMMAND = "/jr";
|
|
|
592
594
|
var DEFAULT_PROCESSING_REACTION_EMOJI = "eyes";
|
|
593
595
|
var DEFAULT_COMPLETED_REACTION_EMOJI = "white_check_mark";
|
|
594
596
|
var FUNCTION_TIMEOUT_BUFFER_SECONDS = 20;
|
|
597
|
+
var CONVERSATION_WORK_SOFT_YIELD_BUFFER_SECONDS = 40;
|
|
595
598
|
var DEFAULT_ASSISTANT_LOADING_MESSAGES = [
|
|
596
599
|
"Consulting the orb",
|
|
597
600
|
"Bribing the gremlins",
|
|
@@ -616,13 +619,14 @@ function parseAgentTurnTimeoutMs(rawValue, maxTimeoutMs) {
|
|
|
616
619
|
}
|
|
617
620
|
return Math.max(MIN_AGENT_TURN_TIMEOUT_MS, Math.min(value, maxTimeoutMs));
|
|
618
621
|
}
|
|
619
|
-
function resolveFunctionMaxDurationSeconds(
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
622
|
+
function resolveFunctionMaxDurationSeconds(functionMaxDurationSeconds) {
|
|
623
|
+
return functionMaxDurationSeconds ?? DEFAULT_FUNCTION_MAX_DURATION_SECONDS;
|
|
624
|
+
}
|
|
625
|
+
function resolveConversationWorkSoftYieldAfterMs(functionMaxDurationSeconds) {
|
|
626
|
+
return Math.max(
|
|
627
|
+
MIN_AGENT_TURN_TIMEOUT_MS,
|
|
628
|
+
(functionMaxDurationSeconds - CONVERSATION_WORK_SOFT_YIELD_BUFFER_SECONDS) * 1e3
|
|
629
|
+
);
|
|
626
630
|
}
|
|
627
631
|
function resolveMaxTurnTimeoutMs(functionMaxDurationSeconds) {
|
|
628
632
|
const budgetSeconds = functionMaxDurationSeconds - FUNCTION_TIMEOUT_BUFFER_SECONDS;
|
|
@@ -669,16 +673,21 @@ function parseSlashCommand(rawValue) {
|
|
|
669
673
|
}
|
|
670
674
|
return command;
|
|
671
675
|
}
|
|
672
|
-
var DEFAULT_MODEL_ID =
|
|
673
|
-
var DEFAULT_FAST_MODEL_ID =
|
|
676
|
+
var DEFAULT_MODEL_ID = getModel2("vercel-ai-gateway", "xai/grok-4.5").id;
|
|
677
|
+
var DEFAULT_FAST_MODEL_ID = getModel2(
|
|
674
678
|
"vercel-ai-gateway",
|
|
675
679
|
"anthropic/claude-haiku-4.5"
|
|
676
680
|
).id;
|
|
677
|
-
var DEFAULT_HANDOFF_MODEL_ID =
|
|
681
|
+
var DEFAULT_HANDOFF_MODEL_ID = getModel2(
|
|
678
682
|
"vercel-ai-gateway",
|
|
679
683
|
"openai/gpt-5.6-sol"
|
|
680
684
|
).id;
|
|
685
|
+
var DEFAULT_WEB_SEARCH_MODEL_ID = getModel2(
|
|
686
|
+
"vercel-ai-gateway",
|
|
687
|
+
"openai/gpt-5.4"
|
|
688
|
+
).id;
|
|
681
689
|
var DEFAULT_EMBEDDING_MODEL_ID = "openai/text-embedding-3-small";
|
|
690
|
+
var DEFAULT_IMAGE_GENERATION_MODEL_ID = "google/gemini-3-pro-image";
|
|
682
691
|
function validateGatewayModelId(raw) {
|
|
683
692
|
const trimmed = toOptionalTrimmed(raw);
|
|
684
693
|
if (trimmed === void 0) return void 0;
|
|
@@ -742,8 +751,7 @@ function parseReactionEmoji(envName, rawValue, defaultEmoji) {
|
|
|
742
751
|
}
|
|
743
752
|
return normalized;
|
|
744
753
|
}
|
|
745
|
-
function readBotConfig(env) {
|
|
746
|
-
const functionMaxDurationSeconds = resolveFunctionMaxDurationSeconds(env);
|
|
754
|
+
function readBotConfig(env, functionMaxDurationSeconds) {
|
|
747
755
|
const maxTurnTimeoutMs = resolveMaxTurnTimeoutMs(functionMaxDurationSeconds);
|
|
748
756
|
const modelId = validateGatewayModelId(env.AI_MODEL) ?? DEFAULT_MODEL_ID;
|
|
749
757
|
const reasoningLevel = toOptionalTrimmed(env.AI_REASONING_LEVEL);
|
|
@@ -758,6 +766,7 @@ function readBotConfig(env) {
|
|
|
758
766
|
),
|
|
759
767
|
reasoningLevel: reasoningLevel === void 0 ? void 0 : parseTurnReasoningLevel(reasoningLevel),
|
|
760
768
|
fastModelId,
|
|
769
|
+
imageGenerationModelId: toOptionalTrimmed(env.AI_IMAGE_MODEL) ?? DEFAULT_IMAGE_GENERATION_MODEL_ID,
|
|
761
770
|
embeddingModelId: validateEmbeddingModelId(env.AI_EMBEDDING_MODEL) ?? DEFAULT_EMBEDDING_MODEL_ID,
|
|
762
771
|
loadingMessages: parseLoadingMessages(env.JUNIOR_LOADING_MESSAGES),
|
|
763
772
|
visionModelId: validateGatewayModelId(env.AI_VISION_MODEL),
|
|
@@ -765,7 +774,8 @@ function readBotConfig(env) {
|
|
|
765
774
|
turnTimeoutMs: parseAgentTurnTimeoutMs(
|
|
766
775
|
env.AGENT_TURN_TIMEOUT_MS,
|
|
767
776
|
maxTurnTimeoutMs
|
|
768
|
-
)
|
|
777
|
+
),
|
|
778
|
+
webSearchModelId: validateGatewayModelId(env.AI_WEB_SEARCH_MODEL) ?? DEFAULT_WEB_SEARCH_MODEL_ID
|
|
769
779
|
};
|
|
770
780
|
}
|
|
771
781
|
function readDatabaseUrl(env) {
|
|
@@ -796,11 +806,17 @@ function readSqlDriver(env, databaseUrl) {
|
|
|
796
806
|
}
|
|
797
807
|
throw new Error("JUNIOR_DATABASE_DRIVER must be postgres or neon");
|
|
798
808
|
}
|
|
799
|
-
function readChatConfig(env = process.env) {
|
|
809
|
+
function readChatConfig(env = process.env, functionMaxDurationSeconds = DEFAULT_FUNCTION_MAX_DURATION_SECONDS) {
|
|
800
810
|
const databaseUrl = readDatabaseUrl(env);
|
|
811
|
+
const resolvedFunctionMaxDurationSeconds = resolveFunctionMaxDurationSeconds(
|
|
812
|
+
functionMaxDurationSeconds
|
|
813
|
+
);
|
|
801
814
|
return {
|
|
802
|
-
bot: readBotConfig(env),
|
|
803
|
-
functionMaxDurationSeconds:
|
|
815
|
+
bot: readBotConfig(env, resolvedFunctionMaxDurationSeconds),
|
|
816
|
+
functionMaxDurationSeconds: resolvedFunctionMaxDurationSeconds,
|
|
817
|
+
conversationWorkSoftYieldAfterMs: resolveConversationWorkSoftYieldAfterMs(
|
|
818
|
+
resolvedFunctionMaxDurationSeconds
|
|
819
|
+
),
|
|
804
820
|
sql: {
|
|
805
821
|
databaseUrl,
|
|
806
822
|
driver: readSqlDriver(env, databaseUrl)
|
|
@@ -822,6 +838,17 @@ function readChatConfig(env = process.env) {
|
|
|
822
838
|
};
|
|
823
839
|
}
|
|
824
840
|
var chatConfig = readChatConfig(process.env);
|
|
841
|
+
function configureFunctionMaxDurationSeconds(functionMaxDurationSeconds) {
|
|
842
|
+
const resolved = resolveFunctionMaxDurationSeconds(
|
|
843
|
+
functionMaxDurationSeconds
|
|
844
|
+
);
|
|
845
|
+
chatConfig.functionMaxDurationSeconds = resolved;
|
|
846
|
+
chatConfig.conversationWorkSoftYieldAfterMs = resolveConversationWorkSoftYieldAfterMs(resolved);
|
|
847
|
+
chatConfig.bot.turnTimeoutMs = parseAgentTurnTimeoutMs(
|
|
848
|
+
process.env.AGENT_TURN_TIMEOUT_MS,
|
|
849
|
+
resolveMaxTurnTimeoutMs(resolved)
|
|
850
|
+
);
|
|
851
|
+
}
|
|
825
852
|
function getChatConfig() {
|
|
826
853
|
return chatConfig;
|
|
827
854
|
}
|
|
@@ -910,6 +937,7 @@ export {
|
|
|
910
937
|
standardModelId,
|
|
911
938
|
profileConfig,
|
|
912
939
|
FUNCTION_TIMEOUT_BUFFER_SECONDS,
|
|
940
|
+
configureFunctionMaxDurationSeconds,
|
|
913
941
|
getChatConfig,
|
|
914
942
|
botConfig,
|
|
915
943
|
getSlackBotToken,
|