@sentry/junior 0.75.0 → 0.76.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/README.md +1 -1
- package/bin/junior.mjs +4 -66
- package/dist/agent-hooks-ZOE7RIED.js +37 -0
- package/dist/api-reference.d.ts +2 -0
- package/dist/app.js +364 -135
- package/dist/build/virtual-config.d.ts +2 -2
- package/dist/chat/agent-dispatch/runner.d.ts +2 -0
- package/dist/chat/config.d.ts +1 -0
- package/dist/chat/credentials/state-adapter-token-store.d.ts +2 -0
- package/dist/chat/credentials/user-token-store.d.ts +17 -12
- package/dist/chat/db.d.ts +8 -0
- package/dist/chat/mcp/auth-store.d.ts +2 -1
- package/dist/chat/mcp/oauth.d.ts +2 -1
- package/dist/chat/oauth-flow.d.ts +3 -1
- package/dist/chat/pi/client.d.ts +15 -7
- package/dist/chat/plugins/agent-hooks.d.ts +7 -0
- package/dist/chat/plugins/auth/oauth-request.d.ts +11 -7
- package/dist/chat/plugins/model.d.ts +9 -0
- package/dist/chat/plugins/prompt.d.ts +5 -0
- package/dist/chat/plugins/task-callback.d.ts +5 -0
- package/dist/chat/plugins/task-message.d.ts +23 -0
- package/dist/chat/plugins/task-queue.d.ts +5 -0
- package/dist/chat/plugins/task-runner.d.ts +12 -0
- package/dist/chat/plugins/task-signing.d.ts +31 -0
- package/dist/chat/prompt.d.ts +4 -0
- package/dist/chat/requester.d.ts +6 -5
- package/dist/chat/respond-helpers.d.ts +2 -0
- package/dist/chat/respond.d.ts +4 -2
- package/dist/chat/runtime/agent-continue-runner.d.ts +4 -0
- package/dist/chat/runtime/reply-executor.d.ts +5 -1
- package/dist/chat/runtime/slack-resume.d.ts +10 -2
- package/dist/chat/sentry.d.ts +1 -0
- package/dist/chat/services/mcp-auth-orchestration.d.ts +2 -1
- package/dist/chat/services/plugin-auth-orchestration.d.ts +2 -1
- package/dist/chat/services/subscribed-decision.d.ts +2 -2
- package/dist/chat/services/turn-session-record.d.ts +11 -7
- package/dist/chat/slack/footer.d.ts +1 -1
- package/dist/chat/state/turn-session.d.ts +8 -5
- package/dist/chat/tools/agent-tools.d.ts +8 -1
- package/dist/chat/tools/slack/context.d.ts +2 -2
- package/dist/chat/tools/types.d.ts +4 -4
- package/dist/chat/vercel-queue-client.d.ts +3 -0
- package/dist/{chunk-C3AM4Z4J.js → chunk-2ECJXSVQ.js} +5 -5
- package/dist/{chunk-OJODNL2P.js → chunk-4SCWV7TJ.js} +2 -2
- package/dist/chunk-4UO6FK4G.js +64 -0
- package/dist/{chunk-BNJIEFQC.js → chunk-56TBVRJG.js} +2 -2
- package/dist/{chunk-OK4KKR7B.js → chunk-EJN6G5A2.js} +28 -12
- package/dist/{chunk-TQ74BATR.js → chunk-FFGXUXMD.js} +435 -111
- package/dist/{chunk-XJHDZUGD.js → chunk-JBASI5VV.js} +4 -4
- package/dist/chunk-KNFROR7R.js +127 -0
- package/dist/{chunk-VNTLUFTY.js → chunk-KOIMO7S3.js} +126 -87
- package/dist/chunk-MLKGABMK.js +9 -0
- package/dist/{chunk-NPVUAXUE.js → chunk-NFTMTIP3.js} +303 -33
- package/dist/chunk-NYKJ3KON.js +1082 -0
- package/dist/{chunk-SJHUF3DP.js → chunk-OJ53FYVG.js} +2 -10
- package/dist/{chunk-62FUNJYS.js → chunk-Q6XFTRV5.js} +54 -3
- package/dist/{chunk-UJ7OTHPO.js → chunk-R6Z5XWY3.js} +12 -670
- package/dist/chunk-RV5RYIJW.js +56 -0
- package/dist/{chunk-EE6PJWY4.js → chunk-SG5WAA7H.js} +7 -5
- package/dist/chunk-ST6YNAXG.js +54 -0
- package/dist/{chunk-FCZO7LAR.js → chunk-T77LUIX3.js} +139 -153
- package/dist/{chunk-EIYL7I4S.js → chunk-VALUBQ7R.js} +22 -30
- package/dist/{chunk-OZSPLAQ4.js → chunk-XBBC6W45.js} +1 -1
- package/dist/{chunk-ZNNTSPNF.js → chunk-Y5OFBCBZ.js} +1 -1
- package/dist/{chunk-74HO27II.js → chunk-Z4CIQ3EB.js} +5 -1
- package/dist/{chunk-2RWFUS5F.js → chunk-ZLMBNBUG.js} +101 -44
- package/dist/{chunk-JEELK46E.js → chunk-ZQB37HUX.js} +11 -11
- package/dist/cli/chat.js +52 -23
- package/dist/cli/check.js +7 -7
- package/dist/cli/env.js +4 -53
- package/dist/cli/init.js +6 -1
- package/dist/cli/main.js +84 -0
- package/dist/cli/plugins.js +244 -0
- package/dist/cli/run.js +5 -52
- package/dist/cli/snapshot-warmup.js +9 -9
- package/dist/cli/upgrade.js +167 -48
- package/dist/db-7A7PFRGL.js +17 -0
- package/dist/deployment.d.ts +1 -0
- package/dist/instrumentation.js +14 -18
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +43 -22
- package/dist/plugins-PZMDS7AT.js +15 -0
- package/dist/plugins.d.ts +4 -2
- package/dist/{registry-NLZFIW23.js → registry-OIPAJU2O.js} +6 -6
- package/dist/reporting.js +34 -26
- package/dist/{runner-LUQZ5G67.js → runner-7Z4D6AKV.js} +76 -23
- package/dist/sentry-4CP5NNQ5.js +31 -0
- package/dist/validation-SLA6IGF7.js +15 -0
- package/dist/vercel.js +1 -1
- package/package.json +8 -7
- package/dist/agent-hooks-2HEB4C3Q.js +0 -33
- package/dist/chat/conversations/configured.d.ts +0 -7
- package/dist/chat/conversations/state.d.ts +0 -4
- package/dist/chat/plugins/db.d.ts +0 -31
- package/dist/chunk-2KG3PWR4.js +0 -17
- package/dist/chunk-D7NFH5GD.js +0 -570
- package/dist/chunk-MCMROINU.js +0 -12
- package/dist/chunk-WBZ4M5N5.js +0 -59
- package/dist/db-A3ILH67H.js +0 -20
- package/dist/plugins-OMJKLRJ2.js +0 -13
- package/dist/validation-VMCPP3YO.js +0 -15
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__reExport
|
|
3
|
-
} from "./chunk-2KG3PWR4.js";
|
|
4
|
-
|
|
5
|
-
// src/chat/sentry.ts
|
|
6
|
-
var sentry_exports = {};
|
|
7
|
-
__reExport(sentry_exports, node_star);
|
|
8
|
-
import * as node_star from "@sentry/node";
|
|
9
|
-
|
|
10
1
|
// src/deployment.ts
|
|
11
2
|
var JUNIOR_HEARTBEAT_ROUTE = "/api/internal/heartbeat";
|
|
12
3
|
var JUNIOR_HEARTBEAT_CRON_SCHEDULE = "* * * * *";
|
|
13
4
|
var JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE = "/api/internal/agent/continue";
|
|
5
|
+
var JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE = "/api/internal/plugin/tasks";
|
|
14
6
|
var LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION = "api/internal/agent/continue.ts";
|
|
15
7
|
function toOptionalTrimmed(value) {
|
|
16
8
|
const trimmed = value?.trim();
|
|
@@ -33,10 +25,10 @@ function getDeploymentTelemetryAttributes() {
|
|
|
33
25
|
}
|
|
34
26
|
|
|
35
27
|
export {
|
|
36
|
-
sentry_exports,
|
|
37
28
|
JUNIOR_HEARTBEAT_ROUTE,
|
|
38
29
|
JUNIOR_HEARTBEAT_CRON_SCHEDULE,
|
|
39
30
|
JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE,
|
|
31
|
+
JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE,
|
|
40
32
|
LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION,
|
|
41
33
|
getDeploymentServiceVersion,
|
|
42
34
|
getDeploymentTelemetryAttributes
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getSlackBotToken
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-T77LUIX3.js";
|
|
4
4
|
import {
|
|
5
|
+
isSlackConversationId,
|
|
6
|
+
isSlackTeamId,
|
|
5
7
|
logWarn
|
|
6
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-EJN6G5A2.js";
|
|
7
9
|
|
|
8
10
|
// src/chat/slack/client.ts
|
|
9
11
|
import { WebClient } from "@slack/web-api";
|
|
@@ -274,6 +276,50 @@ async function downloadPrivateSlackFile(url) {
|
|
|
274
276
|
return Buffer.from(await response.arrayBuffer());
|
|
275
277
|
}
|
|
276
278
|
|
|
279
|
+
// src/chat/destination.ts
|
|
280
|
+
import {
|
|
281
|
+
destinationSchema
|
|
282
|
+
} from "@sentry/junior-plugin-api";
|
|
283
|
+
function createSlackDestination(input) {
|
|
284
|
+
const channelId = normalizeSlackConversationId(input.channelId);
|
|
285
|
+
const teamId = input.teamId?.trim();
|
|
286
|
+
if (!channelId || !teamId) {
|
|
287
|
+
return void 0;
|
|
288
|
+
}
|
|
289
|
+
if (!isSlackConversationId(channelId) || !isSlackTeamId(teamId)) {
|
|
290
|
+
return void 0;
|
|
291
|
+
}
|
|
292
|
+
return { platform: "slack", teamId, channelId };
|
|
293
|
+
}
|
|
294
|
+
function parseDestination(value) {
|
|
295
|
+
const parsed = destinationSchema.safeParse(value);
|
|
296
|
+
return parsed.success ? parsed.data : void 0;
|
|
297
|
+
}
|
|
298
|
+
function requireSlackDestination(destination, action) {
|
|
299
|
+
if (destination?.platform === "slack") {
|
|
300
|
+
return destination;
|
|
301
|
+
}
|
|
302
|
+
throw new Error(`${action} requires a Slack destination`);
|
|
303
|
+
}
|
|
304
|
+
function sameDestination(left, right) {
|
|
305
|
+
if (left.platform !== right.platform) {
|
|
306
|
+
return false;
|
|
307
|
+
}
|
|
308
|
+
if (left.platform === "local" && right.platform === "local") {
|
|
309
|
+
return left.conversationId === right.conversationId;
|
|
310
|
+
}
|
|
311
|
+
if (left.platform === "slack" && right.platform === "slack") {
|
|
312
|
+
return left.teamId === right.teamId && left.channelId === right.channelId;
|
|
313
|
+
}
|
|
314
|
+
return false;
|
|
315
|
+
}
|
|
316
|
+
function destinationKey(destination) {
|
|
317
|
+
if (destination.platform === "local") {
|
|
318
|
+
return destination.conversationId;
|
|
319
|
+
}
|
|
320
|
+
return `slack:${destination.teamId}:${destination.channelId}`;
|
|
321
|
+
}
|
|
322
|
+
|
|
277
323
|
export {
|
|
278
324
|
SlackActionError,
|
|
279
325
|
getHeaderString,
|
|
@@ -284,5 +330,10 @@ export {
|
|
|
284
330
|
isConversationScopedChannel,
|
|
285
331
|
isConversationChannel,
|
|
286
332
|
getFilePermalink,
|
|
287
|
-
downloadPrivateSlackFile
|
|
333
|
+
downloadPrivateSlackFile,
|
|
334
|
+
createSlackDestination,
|
|
335
|
+
parseDestination,
|
|
336
|
+
requireSlackDestination,
|
|
337
|
+
sameDestination,
|
|
338
|
+
destinationKey
|
|
288
339
|
};
|