@sentry/junior 0.91.0 → 0.92.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/{agent-hooks-MXAF7RQL.js → agent-hooks-KL7I3ZRC.js} +7 -7
- package/dist/api/people/list.d.ts +3 -3
- package/dist/api/people/list.js +15 -15
- package/dist/api/people/list.query.d.ts +2 -2
- package/dist/api/people/profile.d.ts +3 -3
- package/dist/api/people/profile.js +12 -12
- package/dist/api/people/profile.query.d.ts +2 -2
- package/dist/api/people/shared.d.ts +13 -13
- package/dist/api/people/types.d.ts +12 -12
- package/dist/api-reference.d.ts +1 -1
- package/dist/app.js +365 -265
- package/dist/{catalog-runtime-DXE6NXHT.js → catalog-runtime-NZHMSMYC.js} +2 -2
- package/dist/chat/actor.d.ts +75 -0
- package/dist/chat/agent/prompt.d.ts +2 -2
- package/dist/chat/agent/request.d.ts +13 -13
- package/dist/chat/agent/resume.d.ts +5 -4
- package/dist/chat/agent/tools.d.ts +4 -2
- package/dist/chat/capabilities/jr-rpc-command.d.ts +1 -1
- package/dist/chat/conversation-privacy.d.ts +11 -0
- package/dist/chat/conversations/sql/migrations.d.ts +1 -1
- package/dist/chat/conversations/sql/schema/conversations.d.ts +2 -19
- package/dist/chat/conversations/sql/schema.d.ts +2 -19
- package/dist/chat/conversations/sql/store.d.ts +3 -3
- package/dist/chat/conversations/store.d.ts +4 -4
- package/dist/chat/credentials/context.d.ts +4 -4
- package/dist/chat/logging.d.ts +2 -2
- package/dist/chat/no-reply.d.ts +1 -1
- package/dist/chat/oauth-flow.d.ts +1 -1
- package/dist/chat/pi/messages.d.ts +2 -2
- package/dist/chat/pi/transcript.d.ts +15 -0
- package/dist/chat/plugins/agent-hooks.d.ts +5 -3
- package/dist/chat/plugins/credential-hooks.d.ts +2 -8
- package/dist/chat/prompt.d.ts +3 -6
- package/dist/chat/runtime/reply-executor.d.ts +1 -1
- package/dist/chat/runtime/turn-input.d.ts +1 -1
- package/dist/chat/sandbox/egress/schemas.d.ts +2 -2
- package/dist/chat/sandbox/egress/session.d.ts +1 -1
- package/dist/chat/services/context-compaction.d.ts +1 -1
- package/dist/chat/services/conversation-memory.d.ts +1 -1
- package/dist/chat/services/mcp-auth-orchestration.d.ts +1 -1
- package/dist/chat/services/message-actor-identity.d.ts +4 -4
- package/dist/chat/services/pending-auth.d.ts +2 -2
- package/dist/chat/services/plugin-auth-orchestration.d.ts +1 -1
- package/dist/chat/services/provider-default-config.d.ts +1 -1
- package/dist/chat/services/subscribed-decision.d.ts +1 -1
- package/dist/chat/services/turn-result.d.ts +1 -1
- package/dist/chat/services/turn-session-record.d.ts +11 -8
- package/dist/chat/services/turn-thinking-level.d.ts +1 -1
- package/dist/chat/slack/assistant-thread/title.d.ts +1 -1
- package/dist/chat/slack/tools/canvas/create.d.ts +41 -1
- package/dist/chat/slack/tools/canvas/edit.d.ts +60 -1
- package/dist/chat/slack/tools/canvas/read.d.ts +60 -1
- package/dist/chat/slack/tools/canvas/write.d.ts +41 -1
- package/dist/chat/slack/tools/channel-list-messages.d.ts +45 -1
- package/dist/chat/slack/tools/context.d.ts +3 -3
- package/dist/chat/slack/tools/list/add-items.d.ts +42 -1
- package/dist/chat/slack/tools/list/create.d.ts +40 -1
- package/dist/chat/slack/tools/list/get-items.d.ts +40 -1
- package/dist/chat/slack/tools/list/update-item.d.ts +46 -1
- package/dist/chat/slack/tools/message-add-reaction.d.ts +40 -1
- package/dist/chat/slack/tools/send-message.d.ts +45 -1
- package/dist/chat/slack/tools/thread-read.d.ts +44 -1
- package/dist/chat/slack/tools/user-lookup.d.ts +45 -1
- package/dist/chat/slack/user.d.ts +3 -3
- package/dist/chat/slack/vision-context.d.ts +2 -2
- package/dist/chat/sql/schema.d.ts +2 -19
- package/dist/chat/state/conversation-details.d.ts +4 -4
- package/dist/chat/state/conversation.d.ts +1 -1
- package/dist/chat/state/session-log.d.ts +140 -26
- package/dist/chat/state/turn-session.d.ts +18 -5
- package/dist/chat/task-execution/slack-work.d.ts +2 -2
- package/dist/chat/task-execution/state.d.ts +4 -4
- package/dist/chat/tool-support/zod-tool.d.ts +16 -4
- package/dist/chat/tools/advisor/tool.d.ts +41 -1
- package/dist/chat/tools/definition.d.ts +10 -0
- package/dist/chat/tools/execute-tool.d.ts +41 -1
- package/dist/chat/tools/resource-events.d.ts +124 -3
- package/dist/chat/tools/runtime/report-progress.d.ts +40 -1
- package/dist/chat/tools/sandbox/bash.d.ts +41 -1
- package/dist/chat/tools/sandbox/edit-file.d.ts +44 -1
- package/dist/chat/tools/sandbox/find-files.d.ts +42 -1
- package/dist/chat/tools/sandbox/grep.d.ts +46 -1
- package/dist/chat/tools/sandbox/list-dir.d.ts +41 -1
- package/dist/chat/tools/sandbox/read-file.d.ts +42 -1
- package/dist/chat/tools/sandbox/write-file.d.ts +41 -1
- package/dist/chat/tools/search-tools.d.ts +102 -1
- package/dist/chat/tools/skill/call-mcp-tool.d.ts +10 -1
- package/dist/chat/tools/skill/load-skill.d.ts +40 -1
- package/dist/chat/tools/skill/search-mcp-tools.d.ts +100 -1
- package/dist/chat/tools/system-time.d.ts +38 -1
- package/dist/chat/tools/types.d.ts +4 -4
- package/dist/chat/tools/web/fetch-tool.d.ts +41 -1
- package/dist/chat/tools/web/image-generate.d.ts +62 -1
- package/dist/chat/tools/web/search.d.ts +41 -1
- package/dist/{chunk-HXL2ZV74.js → chunk-3F54A3YM.js} +82 -11
- package/dist/{chunk-ZGDTBSQ7.js → chunk-56SIBIVF.js} +930 -660
- package/dist/{chunk-DACFZ5CI.js → chunk-7K3JALTQ.js} +18 -12
- package/dist/{chunk-IRRMABQD.js → chunk-APIVR44P.js} +10 -10
- package/dist/{chunk-XP7F4LYB.js → chunk-BTH37NCU.js} +4 -4
- package/dist/{chunk-5GBUZI6M.js → chunk-H7KUZAMZ.js} +4 -4
- package/dist/{chunk-PIB4EOW6.js → chunk-IWKVXO3F.js} +19 -72
- package/dist/{chunk-TYUXD3FN.js → chunk-MC4ZZE4Q.js} +1 -1
- package/dist/{chunk-2S7M37HY.js → chunk-NIFONS4W.js} +86 -47
- package/dist/{chunk-AOISHLSF.js → chunk-O6ZYIHFC.js} +143 -20
- package/dist/{chunk-GCWD2VHP.js → chunk-OQQU3SD6.js} +285 -124
- package/dist/{chunk-NW7AXDA5.js → chunk-OZJXGX4U.js} +2 -2
- package/dist/{chunk-KC42JAAQ.js → chunk-PFXC67GJ.js} +3 -3
- package/dist/{chunk-QCKGI74V.js → chunk-PGR4WGZW.js} +10 -10
- package/dist/{chunk-ZUK7BL63.js → chunk-S6QKIGRM.js} +66 -54
- package/dist/{chunk-IX76WFJV.js → chunk-TF5VLGA7.js} +10 -10
- package/dist/{chunk-AN2437E3.js → chunk-YTNPU7I2.js} +2 -2
- package/dist/{chunk-3MPOMK3K.js → chunk-YYBX2BD5.js} +61 -3
- package/dist/{chunk-ONFOWI2D.js → chunk-Z4FOYQXW.js} +16 -15
- package/dist/{chunk-RS6ANWVT.js → chunk-ZATRYQLR.js} +1 -1
- package/dist/cli/chat.js +20 -20
- package/dist/cli/check.js +3 -3
- package/dist/cli/plugins.js +9 -9
- package/dist/cli/snapshot-warmup.js +6 -6
- package/dist/cli/upgrade.js +9 -9
- package/dist/{db-CXI7PR5U.js → db-GCK43OO3.js} +4 -4
- package/dist/instrumentation.js +1 -1
- package/dist/reporting/conversations.d.ts +3 -3
- package/dist/reporting.d.ts +1 -1
- package/dist/reporting.js +48 -50
- package/dist/{runner-FKL3RAHA.js → runner-Y73GZ2VE.js} +20 -18
- package/dist/{validation-I7GD2YWS.js → validation-KYAWETI4.js} +3 -3
- package/package.json +6 -6
- package/dist/chat/requester.d.ts +0 -68
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getCurrentConversationPrivacy,
|
|
3
3
|
resolveConversationPrivacy,
|
|
4
|
+
toCanonicalInputMessage,
|
|
5
|
+
toCanonicalOutputMessage,
|
|
4
6
|
toGenAiMessageMetadata,
|
|
5
7
|
toGenAiMessagesTraceAttributes,
|
|
6
8
|
toGenAiTextMetadata
|
|
7
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-YYBX2BD5.js";
|
|
8
10
|
import {
|
|
9
11
|
extractGenAiUsageAttributes,
|
|
10
12
|
logException,
|
|
@@ -12,13 +14,79 @@ import {
|
|
|
12
14
|
serializeGenAiAttribute,
|
|
13
15
|
setSpanAttributes,
|
|
14
16
|
withSpan
|
|
15
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-S6QKIGRM.js";
|
|
18
|
+
|
|
19
|
+
// src/chat/xml.ts
|
|
20
|
+
function escapeXml(value) {
|
|
21
|
+
return value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// src/chat/current-instruction.ts
|
|
25
|
+
var CURRENT_INSTRUCTION_TAG = "current-instruction";
|
|
26
|
+
var CURRENT_INSTRUCTION_OPEN_PREFIX = `<${CURRENT_INSTRUCTION_TAG}`;
|
|
27
|
+
var CURRENT_INSTRUCTION_OPEN_BARE = `<${CURRENT_INSTRUCTION_TAG}>`;
|
|
28
|
+
var CURRENT_INSTRUCTION_OPEN_ATTR_PREFIX = `<${CURRENT_INSTRUCTION_TAG} `;
|
|
29
|
+
var CURRENT_INSTRUCTION_CLOSE = `
|
|
30
|
+
</${CURRENT_INSTRUCTION_TAG}>`;
|
|
31
|
+
function unescapeXml(value) {
|
|
32
|
+
return value.replaceAll(""", '"').replaceAll("'", "'").replaceAll(">", ">").replaceAll("<", "<").replaceAll("&", "&");
|
|
33
|
+
}
|
|
34
|
+
function isCurrentInstructionOpeningTag(value) {
|
|
35
|
+
return value === CURRENT_INSTRUCTION_OPEN_BARE || value.startsWith(CURRENT_INSTRUCTION_OPEN_ATTR_PREFIX) && value.endsWith(">");
|
|
36
|
+
}
|
|
37
|
+
function readCurrentInstructionBody(text) {
|
|
38
|
+
const start = text.indexOf(CURRENT_INSTRUCTION_OPEN_PREFIX);
|
|
39
|
+
if (start < 0) {
|
|
40
|
+
return void 0;
|
|
41
|
+
}
|
|
42
|
+
const openingEnd = text.indexOf(">\n", start);
|
|
43
|
+
if (openingEnd < 0) {
|
|
44
|
+
return void 0;
|
|
45
|
+
}
|
|
46
|
+
const openingTag = text.slice(start, openingEnd + 1);
|
|
47
|
+
if (!isCurrentInstructionOpeningTag(openingTag)) {
|
|
48
|
+
return void 0;
|
|
49
|
+
}
|
|
50
|
+
const bodyStart = openingEnd + 2;
|
|
51
|
+
const bodyEnd = text.indexOf(CURRENT_INSTRUCTION_CLOSE, bodyStart);
|
|
52
|
+
if (bodyEnd < bodyStart) {
|
|
53
|
+
return void 0;
|
|
54
|
+
}
|
|
55
|
+
return text.slice(bodyStart, bodyEnd);
|
|
56
|
+
}
|
|
57
|
+
function renderCurrentInstruction(instruction, attrs) {
|
|
58
|
+
const renderedAttrs = [
|
|
59
|
+
attrs?.authorId ? `author_id="${escapeXml(attrs.authorId)}"` : void 0,
|
|
60
|
+
attrs?.authorName ? `author_name="${escapeXml(attrs.authorName)}"` : void 0,
|
|
61
|
+
attrs?.slackTs ? `slack_ts="${escapeXml(attrs.slackTs)}"` : void 0
|
|
62
|
+
].filter((attr) => Boolean(attr)).join(" ");
|
|
63
|
+
const openingTag = renderedAttrs ? `<${CURRENT_INSTRUCTION_TAG} ${renderedAttrs}>` : `<${CURRENT_INSTRUCTION_TAG}>`;
|
|
64
|
+
return [
|
|
65
|
+
openingTag,
|
|
66
|
+
escapeXml(instruction),
|
|
67
|
+
`</${CURRENT_INSTRUCTION_TAG}>`
|
|
68
|
+
].join("\n");
|
|
69
|
+
}
|
|
70
|
+
function unwrapCurrentInstruction(text) {
|
|
71
|
+
const body = readCurrentInstructionBody(text);
|
|
72
|
+
return body === void 0 ? void 0 : unescapeXml(body);
|
|
73
|
+
}
|
|
16
74
|
|
|
17
75
|
// src/chat/turn-context-tag.ts
|
|
18
76
|
var TURN_CONTEXT_TAG = "runtime-turn-context";
|
|
19
77
|
|
|
20
78
|
// src/chat/pi/transcript.ts
|
|
21
79
|
var RUNTIME_TURN_CONTEXT_START = `<${TURN_CONTEXT_TAG}>`;
|
|
80
|
+
var EMBEDDED_THREAD_CONTEXT_TAGS = [
|
|
81
|
+
"recent-thread-messages",
|
|
82
|
+
"thread-compactions",
|
|
83
|
+
"thread-transcript",
|
|
84
|
+
"thread-background"
|
|
85
|
+
];
|
|
86
|
+
var EMBEDDED_THREAD_CONTEXT_PATTERN = new RegExp(
|
|
87
|
+
`<(${EMBEDDED_THREAD_CONTEXT_TAGS.join("|")})(?:\\s[^>]*)?>[\\s\\S]*?</\\1>`,
|
|
88
|
+
"g"
|
|
89
|
+
);
|
|
22
90
|
function isAssistantMessage(value) {
|
|
23
91
|
return typeof value === "object" && value !== null && value.role === "assistant";
|
|
24
92
|
}
|
|
@@ -84,6 +152,10 @@ function hasRuntimeTurnContext(messages) {
|
|
|
84
152
|
)
|
|
85
153
|
);
|
|
86
154
|
}
|
|
155
|
+
function instructionTextForProjection(text) {
|
|
156
|
+
const withoutContext = text.replace(EMBEDDED_THREAD_CONTEXT_PATTERN, "").trim();
|
|
157
|
+
return unwrapCurrentInstruction(withoutContext) ?? withoutContext;
|
|
158
|
+
}
|
|
87
159
|
function stripRuntimeTurnContext(messages) {
|
|
88
160
|
return messages.flatMap((message) => {
|
|
89
161
|
const content = getUserMessageContent(message);
|
|
@@ -219,7 +291,7 @@ async function completeText(params) {
|
|
|
219
291
|
const effectivePrivacy = privacy ?? "private";
|
|
220
292
|
const messageAttributeMode = params.messageAttributeMode ?? (effectivePrivacy === "public" ? "content" : "metadata");
|
|
221
293
|
const requestMessagesAttribute = serializeGenAiAttribute(
|
|
222
|
-
messageAttributeMode === "metadata" ? params.messages.map(toGenAiMessageMetadata) : params.messages
|
|
294
|
+
messageAttributeMode === "metadata" ? params.messages.map(toGenAiMessageMetadata) : params.messages.map(toCanonicalInputMessage)
|
|
223
295
|
);
|
|
224
296
|
const systemInstructionsAttribute = params.system ? serializeGenAiAttribute(
|
|
225
297
|
messageAttributeMode === "metadata" ? [toGenAiTextMetadata(params.system)] : [{ type: "text", content: params.system }]
|
|
@@ -232,7 +304,7 @@ async function completeText(params) {
|
|
|
232
304
|
"server.address": GEN_AI_SERVER_ADDRESS,
|
|
233
305
|
"server.port": GEN_AI_SERVER_PORT,
|
|
234
306
|
"app.conversation.privacy": effectivePrivacy,
|
|
235
|
-
...params.thinkingLevel ? { "
|
|
307
|
+
...params.thinkingLevel ? { "gen_ai.request.reasoning.level": params.thinkingLevel } : {}
|
|
236
308
|
};
|
|
237
309
|
const startAttributes = {
|
|
238
310
|
...baseAttributes,
|
|
@@ -274,12 +346,7 @@ async function completeText(params) {
|
|
|
274
346
|
role: "assistant",
|
|
275
347
|
content: outputText ? [toGenAiTextMetadata(outputText)] : []
|
|
276
348
|
}
|
|
277
|
-
] : [
|
|
278
|
-
{
|
|
279
|
-
role: "assistant",
|
|
280
|
-
content: outputText ? [{ type: "text", text: outputText }] : []
|
|
281
|
-
}
|
|
282
|
-
]
|
|
349
|
+
] : [toCanonicalOutputMessage(message)]
|
|
283
350
|
);
|
|
284
351
|
const usageAttributes = extractGenAiUsageAttributes(message);
|
|
285
352
|
const endAttributes = {
|
|
@@ -353,7 +420,7 @@ async function completeObject(params) {
|
|
|
353
420
|
"gen_ai.output.type": "json",
|
|
354
421
|
"server.address": GEN_AI_SERVER_ADDRESS,
|
|
355
422
|
"server.port": GEN_AI_SERVER_PORT,
|
|
356
|
-
...params.thinkingLevel ? { "
|
|
423
|
+
...params.thinkingLevel ? { "gen_ai.request.reasoning.level": params.thinkingLevel } : {}
|
|
357
424
|
}
|
|
358
425
|
);
|
|
359
426
|
setSpanAttributes({
|
|
@@ -728,6 +795,9 @@ function setSlackReactionConfig(overrides) {
|
|
|
728
795
|
|
|
729
796
|
export {
|
|
730
797
|
toOptionalTrimmed,
|
|
798
|
+
escapeXml,
|
|
799
|
+
renderCurrentInstruction,
|
|
800
|
+
unwrapCurrentInstruction,
|
|
731
801
|
TURN_CONTEXT_TAG,
|
|
732
802
|
isAssistantMessage,
|
|
733
803
|
isToolResultMessage,
|
|
@@ -738,6 +808,7 @@ export {
|
|
|
738
808
|
getTerminalAssistantMessages,
|
|
739
809
|
trimTrailingAssistantMessages,
|
|
740
810
|
hasRuntimeTurnContext,
|
|
811
|
+
instructionTextForProjection,
|
|
741
812
|
stripRuntimeTurnContext,
|
|
742
813
|
isProviderRetryError,
|
|
743
814
|
nextProviderRetry,
|