@sentry/junior 0.15.1 → 0.16.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/app.d.ts +1 -1
- package/dist/app.js +63 -25
- package/dist/{chunk-ESPIOJPM.js → chunk-3JKW7ISL.js} +1 -1
- package/dist/{chunk-5JHLDXBN.js → chunk-RUC2V7Q7.js} +9 -2
- package/dist/{chunk-KTBQH6L5.js → chunk-ZU6X5ZGL.js} +1 -1
- package/dist/cli/check.js +2 -2
- package/dist/cli/init.js +1 -1
- package/dist/cli/snapshot-warmup.js +2 -2
- package/package.json +1 -1
package/dist/app.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ interface JuniorAppOptions {
|
|
|
7
7
|
pluginPackages?: string[];
|
|
8
8
|
waitUntil?: WaitUntilFn;
|
|
9
9
|
}
|
|
10
|
-
/** Create a Hono app with all Junior routes
|
|
10
|
+
/** Create a Hono app with all Junior routes. */
|
|
11
11
|
declare function createApp(options?: JuniorAppOptions): Promise<Hono>;
|
|
12
12
|
|
|
13
13
|
export { type JuniorAppOptions, createApp };
|
package/dist/app.js
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
logCapabilityCatalogLoadedOnce,
|
|
8
8
|
parseSkillInvocation,
|
|
9
9
|
stripFrontmatter
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-ZU6X5ZGL.js";
|
|
11
11
|
import {
|
|
12
12
|
SANDBOX_SKILLS_ROOT,
|
|
13
13
|
SANDBOX_WORKSPACE_ROOT,
|
|
@@ -26,13 +26,14 @@ import {
|
|
|
26
26
|
runNonInteractiveCommand,
|
|
27
27
|
sandboxSkillDir,
|
|
28
28
|
toOptionalTrimmed
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-3JKW7ISL.js";
|
|
30
30
|
import {
|
|
31
31
|
CredentialUnavailableError,
|
|
32
32
|
buildOAuthTokenRequest,
|
|
33
33
|
createPluginBroker,
|
|
34
34
|
createRequestContext,
|
|
35
35
|
extractGenAiUsageAttributes,
|
|
36
|
+
getActiveTraceId,
|
|
36
37
|
getPluginDefinition,
|
|
37
38
|
getPluginMcpProviders,
|
|
38
39
|
getPluginOAuthConfig,
|
|
@@ -54,7 +55,7 @@ import {
|
|
|
54
55
|
toOptionalString,
|
|
55
56
|
withContext,
|
|
56
57
|
withSpan
|
|
57
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-RUC2V7Q7.js";
|
|
58
59
|
import "./chunk-Z3YD6NHK.js";
|
|
59
60
|
import {
|
|
60
61
|
aboutPathCandidates,
|
|
@@ -224,8 +225,8 @@ async function GET3() {
|
|
|
224
225
|
html += `
|
|
225
226
|
</div>`;
|
|
226
227
|
const endpoints = [
|
|
227
|
-
{ method: "GET", path: "/
|
|
228
|
-
{ method: "GET", path: "/api/
|
|
228
|
+
{ method: "GET", path: "/health" },
|
|
229
|
+
{ method: "GET", path: "/api/info" },
|
|
229
230
|
{ method: "GET", path: "/api/oauth/callback/mcp/:provider" },
|
|
230
231
|
{ method: "GET", path: "/api/oauth/callback/:provider" },
|
|
231
232
|
{ method: "POST", path: "/api/webhooks/:platform" }
|
|
@@ -1157,21 +1158,44 @@ function summarizeMessageText(text) {
|
|
|
1157
1158
|
}
|
|
1158
1159
|
return normalized.length > 1200 ? `${normalized.slice(0, 1200)}...` : normalized;
|
|
1159
1160
|
}
|
|
1160
|
-
function buildUserTurnText(userInput, conversationContext) {
|
|
1161
|
+
function buildUserTurnText(userInput, conversationContext, metadata) {
|
|
1161
1162
|
const trimmedContext = conversationContext?.trim();
|
|
1162
|
-
|
|
1163
|
+
const hasSessionContext = Boolean(metadata?.sessionContext?.conversationId);
|
|
1164
|
+
const hasTurnContext = Boolean(metadata?.turnContext?.traceId);
|
|
1165
|
+
if (!trimmedContext && !hasSessionContext && !hasTurnContext) {
|
|
1163
1166
|
return userInput;
|
|
1164
1167
|
}
|
|
1165
|
-
|
|
1168
|
+
const sections = [
|
|
1166
1169
|
"<current-message>",
|
|
1167
1170
|
userInput,
|
|
1168
|
-
"</current-message>"
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1171
|
+
"</current-message>"
|
|
1172
|
+
];
|
|
1173
|
+
if (trimmedContext) {
|
|
1174
|
+
sections.push(
|
|
1175
|
+
"",
|
|
1176
|
+
"<thread-conversation-context>",
|
|
1177
|
+
"Use this context for continuity across prior thread turns.",
|
|
1178
|
+
trimmedContext,
|
|
1179
|
+
"</thread-conversation-context>"
|
|
1180
|
+
);
|
|
1181
|
+
}
|
|
1182
|
+
if (metadata?.sessionContext?.conversationId) {
|
|
1183
|
+
sections.push(
|
|
1184
|
+
"",
|
|
1185
|
+
"<session-context>",
|
|
1186
|
+
`- gen_ai.conversation.id: ${metadata.sessionContext.conversationId}`,
|
|
1187
|
+
"</session-context>"
|
|
1188
|
+
);
|
|
1189
|
+
}
|
|
1190
|
+
if (metadata?.turnContext?.traceId) {
|
|
1191
|
+
sections.push(
|
|
1192
|
+
"",
|
|
1193
|
+
"<turn-context>",
|
|
1194
|
+
`- trace_id: ${metadata.turnContext.traceId}`,
|
|
1195
|
+
"</turn-context>"
|
|
1196
|
+
);
|
|
1197
|
+
}
|
|
1198
|
+
return sections.join("\n");
|
|
1175
1199
|
}
|
|
1176
1200
|
function encodeNonImageAttachmentForPrompt(attachment) {
|
|
1177
1201
|
const base64 = attachment.data.toString("base64");
|
|
@@ -2058,9 +2082,18 @@ function getChannelConfigurationService(thread) {
|
|
|
2058
2082
|
import {
|
|
2059
2083
|
completeSimple,
|
|
2060
2084
|
getEnvApiKey,
|
|
2061
|
-
getModels
|
|
2085
|
+
getModels,
|
|
2086
|
+
registerApiProvider
|
|
2062
2087
|
} from "@mariozechner/pi-ai";
|
|
2063
|
-
import
|
|
2088
|
+
import {
|
|
2089
|
+
streamAnthropic,
|
|
2090
|
+
streamSimpleAnthropic
|
|
2091
|
+
} from "@mariozechner/pi-ai/anthropic";
|
|
2092
|
+
registerApiProvider({
|
|
2093
|
+
api: "anthropic-messages",
|
|
2094
|
+
stream: streamAnthropic,
|
|
2095
|
+
streamSimple: streamSimpleAnthropic
|
|
2096
|
+
});
|
|
2064
2097
|
var GATEWAY_PROVIDER = "vercel-ai-gateway";
|
|
2065
2098
|
var GEN_AI_PROVIDER_NAME = GATEWAY_PROVIDER;
|
|
2066
2099
|
var GEN_AI_OPERATION_CHAT = "chat";
|
|
@@ -2997,7 +3030,8 @@ function buildSystemPrompt(params) {
|
|
|
2997
3030
|
"- Never call side-effecting tools when the user only asked for analysis or options.",
|
|
2998
3031
|
"- `loadSkill` returns `available_tools` when the loaded skill exposes MCP tools. Use those exact tool_name values instead of guessing.",
|
|
2999
3032
|
"- `searchTools` searches active MCP tools exposed by currently loaded skills when you need to rediscover or filter them.",
|
|
3000
|
-
"- `useTool` executes a canonical MCP tool name from `loadSkill.available_tools`, `<loaded_tools>`, or `searchTools`."
|
|
3033
|
+
"- `useTool` executes a canonical MCP tool name from `loadSkill.available_tools`, `<loaded_tools>`, or `searchTools`.",
|
|
3034
|
+
"- When the user asks for their conversation ID, trace ID, or a reference for Sentry lookup, use the IDs from `<session-context>` and `<turn-context>` in the user turn."
|
|
3001
3035
|
].join("\n")
|
|
3002
3036
|
),
|
|
3003
3037
|
renderTag(
|
|
@@ -8951,7 +8985,11 @@ async function generateAssistantReply(messageText, context = {}) {
|
|
|
8951
8985
|
}
|
|
8952
8986
|
const userTurnText = buildUserTurnText(
|
|
8953
8987
|
userInput,
|
|
8954
|
-
context.conversationContext
|
|
8988
|
+
context.conversationContext,
|
|
8989
|
+
{
|
|
8990
|
+
sessionContext: { conversationId: sessionConversationId },
|
|
8991
|
+
turnContext: { traceId: getActiveTraceId() }
|
|
8992
|
+
}
|
|
8955
8993
|
);
|
|
8956
8994
|
timeoutResumeMessages = [];
|
|
8957
8995
|
pendingMcpAuthorizationPause = void 0;
|
|
@@ -12964,21 +13002,21 @@ async function createApp(options) {
|
|
|
12964
13002
|
options?.pluginPackages ?? await resolveBuildPluginPackages()
|
|
12965
13003
|
);
|
|
12966
13004
|
const waitUntil = options?.waitUntil ?? await defaultWaitUntil();
|
|
12967
|
-
const app = new Hono()
|
|
13005
|
+
const app = new Hono();
|
|
12968
13006
|
app.onError((err, c) => {
|
|
12969
13007
|
logException(err, "unhandled_route_error");
|
|
12970
13008
|
return c.text("Internal Server Error", 500);
|
|
12971
13009
|
});
|
|
13010
|
+
app.get("/", () => GET3());
|
|
12972
13011
|
app.get("/health", () => GET2());
|
|
12973
|
-
app.get("/
|
|
12974
|
-
app.get("/
|
|
12975
|
-
app.get("/oauth/callback/mcp/:provider", (c) => {
|
|
13012
|
+
app.get("/api/info", () => GET());
|
|
13013
|
+
app.get("/api/oauth/callback/mcp/:provider", (c) => {
|
|
12976
13014
|
return GET4(c.req.raw, c.req.param("provider"), waitUntil);
|
|
12977
13015
|
});
|
|
12978
|
-
app.get("/oauth/callback/:provider", (c) => {
|
|
13016
|
+
app.get("/api/oauth/callback/:provider", (c) => {
|
|
12979
13017
|
return GET5(c.req.raw, c.req.param("provider"), waitUntil);
|
|
12980
13018
|
});
|
|
12981
|
-
app.post("/webhooks/:platform", (c) => {
|
|
13019
|
+
app.post("/api/webhooks/:platform", (c) => {
|
|
12982
13020
|
return POST(c.req.raw, c.req.param("platform"), waitUntil);
|
|
12983
13021
|
});
|
|
12984
13022
|
return app;
|
|
@@ -1623,6 +1623,12 @@ function createGitHubAppBroker(manifest, credentials) {
|
|
|
1623
1623
|
function leaseDomainsFor(capability) {
|
|
1624
1624
|
return GIT_CAPABILITIES.has(capability) ? [...apiDomains, GIT_DOMAIN] : apiDomains;
|
|
1625
1625
|
}
|
|
1626
|
+
function authorizationFor(domain, token) {
|
|
1627
|
+
if (domain === GIT_DOMAIN) {
|
|
1628
|
+
return `Basic ${Buffer.from(`x-access-token:${token}`).toString("base64")}`;
|
|
1629
|
+
}
|
|
1630
|
+
return `Bearer ${token}`;
|
|
1631
|
+
}
|
|
1626
1632
|
const supportedCapabilities = new Set(manifest.capabilities);
|
|
1627
1633
|
return {
|
|
1628
1634
|
async issue(input) {
|
|
@@ -1659,7 +1665,7 @@ function createGitHubAppBroker(manifest, credentials) {
|
|
|
1659
1665
|
domain,
|
|
1660
1666
|
headers: {
|
|
1661
1667
|
...apiHeaders ?? {},
|
|
1662
|
-
Authorization:
|
|
1668
|
+
Authorization: authorizationFor(domain, cached.token)
|
|
1663
1669
|
}
|
|
1664
1670
|
})),
|
|
1665
1671
|
expiresAt: new Date(cached.expiresAt).toISOString(),
|
|
@@ -1703,7 +1709,7 @@ function createGitHubAppBroker(manifest, credentials) {
|
|
|
1703
1709
|
domain,
|
|
1704
1710
|
headers: {
|
|
1705
1711
|
...apiHeaders ?? {},
|
|
1706
|
-
Authorization:
|
|
1712
|
+
Authorization: authorizationFor(domain, accessTokenResponse.token)
|
|
1707
1713
|
}
|
|
1708
1714
|
})),
|
|
1709
1715
|
expiresAt: new Date(expiresAtMs).toISOString(),
|
|
@@ -2288,6 +2294,7 @@ export {
|
|
|
2288
2294
|
withSpan,
|
|
2289
2295
|
setSpanAttributes,
|
|
2290
2296
|
setSpanStatus,
|
|
2297
|
+
getActiveTraceId,
|
|
2291
2298
|
resolveErrorReference,
|
|
2292
2299
|
serializeGenAiAttribute,
|
|
2293
2300
|
extractGenAiUsageAttributes,
|
package/dist/cli/check.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
parseSkillFile
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-ZU6X5ZGL.js";
|
|
4
4
|
import {
|
|
5
5
|
parsePluginManifest
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-RUC2V7Q7.js";
|
|
7
7
|
import "../chunk-Z3YD6NHK.js";
|
|
8
8
|
import "../chunk-RBB2MZAN.js";
|
|
9
9
|
import "../chunk-2KG3PWR4.js";
|
package/dist/cli/init.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
disconnectStateAdapter,
|
|
3
3
|
resolveRuntimeDependencySnapshot
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-3JKW7ISL.js";
|
|
5
5
|
import {
|
|
6
6
|
getPluginProviders,
|
|
7
7
|
getPluginRuntimeDependencies,
|
|
8
8
|
getPluginRuntimePostinstall
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-RUC2V7Q7.js";
|
|
10
10
|
import "../chunk-Z3YD6NHK.js";
|
|
11
11
|
import "../chunk-RBB2MZAN.js";
|
|
12
12
|
import "../chunk-2KG3PWR4.js";
|