@sentry/junior 0.222.0 → 0.223.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-7kKtDe-6.js → agent-Bzbf92vv.js} +87 -52
- package/dist/{agent-hooks-DkriF84n.js → agent-hooks-DZU5nsd1.js} +60 -16
- package/dist/{agent-runner-D0ImXS7U.js → agent-runner-2VQ9WhkG.js} +5 -5
- package/dist/api/schema.d.ts +160 -11
- package/dist/api/schema.js +2 -2
- package/dist/api.js +16 -16
- package/dist/{app-C0zbsnr7.d.ts → app-BbSD6EtD.d.ts} +1 -1
- package/dist/app.d.ts +1 -1
- package/dist/app.js +120 -39
- package/dist/{auth-pause-state-3OT67TA8.js → auth-pause-state-Bn2vX4PA.js} +14 -25
- package/dist/{briefs-CNH1ztn5.js → briefs-BJPfCrlT.js} +6 -6
- package/dist/{catalog-runtime-XH_LFA_7.js → catalog-runtime-BthunUDD.js} +1 -1
- package/dist/{checkpoint-CRod8es5.js → checkpoint-Deu-OVb3.js} +11 -8
- package/dist/cli/chat.js +13 -13
- package/dist/cli/check.js +3 -3
- package/dist/cli/main.js +1 -1
- package/dist/cli/plugins.js +3 -3
- package/dist/cli/snapshot-create.js +3 -3
- package/dist/cli/upgrade.js +3 -3
- package/dist/{client-CcSboWx_.js → client-DjC6-6iU.js} +56 -6
- package/dist/{config-CGYv-YPE.js → config-CtoUVs72.js} +6 -7
- package/dist/{conversation-BBDt88di.js → conversation-1HUoZr2l.js} +33 -5
- package/dist/{conversation-privacy-BGjdDVWD.js → conversation-privacy-xS1t92xa.js} +1 -1
- package/dist/{credential-sync-BfzGNruT.js → credential-sync-CKdXEUDO.js} +77 -23
- package/dist/{execution-stats-D97ePWuM.js → execution-stats-CrXs9vSH.js} +3 -3
- package/dist/{executor-BLBZ-UB8.js → executor-AOhG9X1t.js} +1 -1
- package/dist/{history-CaV8Ww7M.d.ts → history-yaSjGMD_.d.ts} +18 -0
- package/dist/instrumentation.js +2 -2
- package/dist/{job-queue-_8gxwDzt.js → job-queue-CNd9cpIy.js} +1 -1
- package/dist/{logging-qmsMdU0y.js → logging-DiN3o3nB.js} +1 -1
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +3 -3
- package/dist/{oauth-callback-server-Mjfm46A5.js → oauth-callback-server-Ca0VLUEw.js} +2 -2
- package/dist/{pending-auth-_1Ry-_Bw.js → pending-auth-D7vmttn_.js} +2 -2
- package/dist/{profile-DbG8AlNd.js → profile-BsNrw8lj.js} +4 -4
- package/dist/{prompt-B8rCQI7K.js → prompt-90miy8VV.js} +1 -1
- package/dist/{registry-DGyQCsiy.js → registry-Dankt-Pl.js} +1 -1
- package/dist/{resolve-D5SqDbCA.js → resolve-B38CpJe2.js} +2 -2
- package/dist/{runner-BRAFjJhe.js → runner-Ck5rEjCm.js} +10 -10
- package/dist/{sandbox-egress-signals-CdI1aVHT.js → sandbox-egress-signals-BOfFkvly.js} +1 -1
- package/dist/{schema-CTOODa3L.js → schema-RpbW5Od2.js} +1 -1
- package/dist/{short-title-CB2fxEyx.js → short-title-BHd_jUFX.js} +2 -2
- package/dist/{skills-BoS3b8cg.js → skills-DbP4TDft.js} +2 -2
- package/dist/{spawn-BXCU1udr.js → spawn-DzXc_PKO.js} +2 -2
- package/dist/{stats-qUXQZq-w.js → stats-pNGp3G5q.js} +19 -17
- package/dist/{task-queue-Di_q8922.js → task-queue-Cy9y1foT.js} +3 -3
- package/dist/{task-runner-4rCppQMo.js → task-runner-DI1FBJFJ.js} +8 -8
- package/dist/{thread-state-2Paza8DV.js → thread-state-DXgxOYpZ.js} +5 -5
- package/dist/{turn-execution--F7a9kEU.js → turn-execution-BNOXrZ-M.js} +3 -3
- package/dist/{turn-lifecycle-f-y0Irpi.js → turn-lifecycle-Bjf6y2GO.js} +1 -1
- package/dist/{validation-Be9lSORU.js → validation-D5CIslEu.js} +1 -1
- package/dist/{version-BydrOZMQ.js → version-_ZQFlslB.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{web-authorization-BdfOkTuG.js → web-authorization-6mmfS_o-.js} +1 -1
- package/dist/{web-input-DegYUyKU.js → web-input-BJpWm6go.js} +7 -7
- package/dist/{work-Citqpnfc.js → work-DvIlJR3C.js} +9 -9
- package/dist/{worker-Bn_HFyvM.js → worker-D1qidg-Y.js} +5 -5
- package/package.json +4 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as TURN_REASONING_LEVELS, o as modelProfileSchema } from "./model-profile-CZmVoGdX.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import { actorSchema, codeChangeStateSchema, conversationAnnotationInputSchema, conversationEventPresentationSchema, conversationSidebarAnnotationSchema } from "@sentry/junior-plugin-api";
|
|
3
|
+
import { actorSchema, codeChangeStateSchema, conversationAnnotationInputSchema, conversationEventPresentationSchema, conversationSidebarAnnotationSchema, ownedObjectAnnotationSchema } from "@sentry/junior-plugin-api";
|
|
4
4
|
//#region src/usage-schema.ts
|
|
5
5
|
const usageCostSchema = z.object({
|
|
6
6
|
input: z.number().finite().nonnegative().optional(),
|
|
@@ -599,22 +599,50 @@ function automationCardText(card) {
|
|
|
599
599
|
//#endregion
|
|
600
600
|
//#region src/chat/conversations/cards.ts
|
|
601
601
|
/** Built-in response types accepted by Message storage and delivery. */
|
|
602
|
-
const messageCardSchema = z.discriminatedUnion("kind", [automationCardSchema]);
|
|
602
|
+
const messageCardSchema = z.discriminatedUnion("kind", [automationCardSchema, ownedObjectAnnotationSchema]);
|
|
603
603
|
const storedCardSchema = automationCardSchema.extend({ operation: z.enum([
|
|
604
604
|
"created",
|
|
605
605
|
"updated",
|
|
606
606
|
"deleted"
|
|
607
607
|
]).optional() });
|
|
608
|
-
/** Read
|
|
608
|
+
/** Read both stored formats while keeping new objects out of the legacy field. */
|
|
609
609
|
function readMessageCards(value) {
|
|
610
|
-
return storedCardSchema.array().parse(value).flatMap(({ operation, ...card }) => operation === "deleted" ? [] : [card]);
|
|
610
|
+
return [...storedCardSchema.array().parse(value.cards ?? []).flatMap(({ operation, ...card }) => operation === "deleted" ? [] : [card]), ...ownedObjectAnnotationSchema.array().parse(value.objectCards ?? [])];
|
|
611
611
|
}
|
|
612
612
|
/** Render each built-in card with its own text format. */
|
|
613
613
|
function messageCardText(card) {
|
|
614
614
|
switch (card.kind) {
|
|
615
|
+
case "object": return [
|
|
616
|
+
card.title,
|
|
617
|
+
card.label !== card.title ? card.label : void 0,
|
|
618
|
+
card.description,
|
|
619
|
+
card.status,
|
|
620
|
+
card.trigger,
|
|
621
|
+
card.warning,
|
|
622
|
+
card.url
|
|
623
|
+
].filter(Boolean).join("\n");
|
|
615
624
|
case "automation": return automationCardText(card);
|
|
616
625
|
}
|
|
617
626
|
}
|
|
627
|
+
/** Deduplicate object cards across successful tool results. */
|
|
628
|
+
function messageCardKey(card) {
|
|
629
|
+
return card.kind === "object" ? JSON.stringify([card.plugin, card.key]) : JSON.stringify(["junior", card.id]);
|
|
630
|
+
}
|
|
631
|
+
/** Identify a deleted object whose pending card must be omitted. */
|
|
632
|
+
const messageCardRefSchema = z.object({
|
|
633
|
+
plugin: z.string().min(1),
|
|
634
|
+
key: z.string().min(1)
|
|
635
|
+
}).strict();
|
|
636
|
+
/** Copy saved annotation facts without storage timestamps for Message delivery. */
|
|
637
|
+
function annotationCard(annotation) {
|
|
638
|
+
const { createdAt: _createdAt, updatedAt: _updatedAt, ...value } = annotation;
|
|
639
|
+
return value.kind === "object" ? value : {
|
|
640
|
+
...value,
|
|
641
|
+
kind: "object",
|
|
642
|
+
objectType: "item",
|
|
643
|
+
title: value.label
|
|
644
|
+
};
|
|
645
|
+
}
|
|
618
646
|
//#endregion
|
|
619
647
|
//#region src/api/schema/conversation.ts
|
|
620
648
|
const conversationReportStatusSchema = z.enum([
|
|
@@ -1205,4 +1233,4 @@ const conversationStatsReportSchema = z.object({
|
|
|
1205
1233
|
windowStart: z.string()
|
|
1206
1234
|
}).strict();
|
|
1207
1235
|
//#endregion
|
|
1208
|
-
export {
|
|
1236
|
+
export { messageCardKey as A, agentHistoryItemSchema as B, conversationReportEventSchema as C, createConversationBodySchema as D, conversationSummaryReportSchema as E, briefLinkSchema as F, historyReplacementSchema as G, conversationTurnFailureCodeSchema as H, briefOutcomeStatusSchema as I, instructionActors as J, newConversationEventSchema as K, conversationBriefSchema as L, messageCardText as M, readMessageCards as N, createConversationMessageBodySchema as O, briefCodeChangeSchema as P, parseBriefInput as R, conversationReportEventDataSchema as S, conversationStatsReportSchema as T, conversationTurnFailureReasonSchema as U, conversationEventDataSchema as V, decodeStoredConversationEvent as W, sameActorIdentity as X, instructionProvenanceFor as Y, usageSchema as Z, conversationParamsSchema as _, cancelConversationPendingMessagesBodySchema as a, conversationPendingMessageSchema as b, conversationAttachmentParamsSchema as c, conversationDetailReportSchema as d, conversationEventHistorySchema as f, conversationFeedSchema as g, conversationFeedQuerySchema as h, archiveConversationResponseSchema as i, messageCardRefSchema as j, annotationCard as k, conversationAuxiliaryCostsSchema as l, conversationEventsQuerySchema as m, actorIdentitySchema as n, cancelConversationPendingMessagesResponseSchema as o, conversationEventPageSchema as p, contextProvenance as q, archiveConversationBodySchema as r, conversationActivityPreviewSchema as s, acceptedConversationMessageSchema as t, conversationDetailQuerySchema as u, conversationPendingAuthorizationSchema as v, conversationStatsItemSchema as w, conversationPendingMessagesReportSchema as x, conversationPendingMessageDeliverySchema as y, KNOWN_CONVERSATION_EVENT_TYPES as z };
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { N as getMcpProviderErrorAttributes, X as createUserTokenStore, a as deleteMcpAuthSession, d as putMcpStoredOAuthCredentials, h as resolvePluginOAuthAccount, i as finalizeMcpAuthorization, l as getMcpAuthSession, u as getMcpStoredOAuthCredentials, y as lookupSlackUserProfile } from "./agent-
|
|
2
|
-
import { m as escapeXml } from "./client-
|
|
3
|
-
import { L as toOptionalString, S as withLogContext, d as logInfo, f as logWarn, m as runBestEffort, u as logException, y as setTags } from "./logging-
|
|
4
|
-
import { a as getChatConfig, h as normalizeSlackEmojiName, n as botConfig, o as getRuntimeMetadata } from "./config-
|
|
1
|
+
import { N as getMcpProviderErrorAttributes, X as createUserTokenStore, a as deleteMcpAuthSession, d as putMcpStoredOAuthCredentials, h as resolvePluginOAuthAccount, i as finalizeMcpAuthorization, l as getMcpAuthSession, u as getMcpStoredOAuthCredentials, y as lookupSlackUserProfile } from "./agent-Bzbf92vv.js";
|
|
2
|
+
import { m as escapeXml } from "./client-DjC6-6iU.js";
|
|
3
|
+
import { L as toOptionalString, S as withLogContext, d as logInfo, f as logWarn, m as runBestEffort, u as logException, y as setTags } from "./logging-DiN3o3nB.js";
|
|
4
|
+
import { a as getChatConfig, h as normalizeSlackEmojiName, n as botConfig, o as getRuntimeMetadata } from "./config-CtoUVs72.js";
|
|
5
5
|
import { n as defaultModelId } from "./model-profile-CZmVoGdX.js";
|
|
6
6
|
import { _ as parseSlackMessageTs, g as parseSlackUserId, l as isUserActor, s as createSlackResumeActor } from "./context-Bplcgypl.js";
|
|
7
|
-
import { G as isDmChannel, H as getHeaderString, K as normalizeSlackConversationId, Kt as
|
|
7
|
+
import { G as isDmChannel, H as getHeaderString, Jt as getSqlExecutor, K as normalizeSlackConversationId, Kt as getConversationStore, Nt as buildSentryConversationUrl, U as getSlackClient, ln as upsertIdentity, mt as getDashboardConversationLink, o as getPluginSlackConversationLink, pn as requireSlackDestination, un as upsertLinkedIdentity, z as SlackActionError } from "./agent-hooks-DZU5nsd1.js";
|
|
8
8
|
import { i as homeDir } from "./package-discovery-7a9YqLhE.js";
|
|
9
|
-
import { n as buildOAuthTokenRequest, r as parseOAuthTokenResponse, u as hasRequiredOAuthScope } from "./registry-
|
|
10
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
11
|
-
import { t as discoverSkills } from "./skills-
|
|
12
|
-
import { B as recordAuthenticationLinked, F as loadProjection, V as recordAuthorizationCompleted, Y as hydrateConversationMessages, ct as recordDeliveredAssistantMessage, d as persistWithRetry, i as abandonTurnRecord, j as commitAcceptedReply, lt as turnHasReply, m as buildTurnErrorResponse, n as loadTurnCheckpoint, o as failTurnRecord, ot as markConversationMessage, r as saveTurnCheckpoint, s as getTurnRecord, tt as buildConversationContext, u as recordTurnSummary } from "./checkpoint-
|
|
13
|
-
import { E as acquireActiveLock, w as getStateAdapter } from "./profile-
|
|
14
|
-
import { Pt as requestConversationWork, c as parseSlackThreadId, d as resolveSlackChannelIdFromThreadId, l as readSlackRawMessageContext, u as resolveSlackChannelIdFromMessage, wt as ensureConversationWake } from "./stats-
|
|
15
|
-
import { a as isPendingAuthLatestRequest, f as CooperativeTurnYieldError, g as isCooperativeTurnYieldError, i as getConversationPendingAuth, r as clearPendingAuth, s as getAssistantReplyText, x as markTurnFailed } from "./pending-auth-
|
|
16
|
-
import { a as parseOAuthStatePayload, c as escapeSlackMrkdwnText, d as normalizeSlackStatusText, f as truncateStatusText, g as removeReactionFromMessage, h as postSlackMessage, i as formatProviderLabel, l as formatSlackLink, o as resolveBaseUrl, p as addReactionToMessage, u as normalizeSlackReplyMarkdown, v as RetryableDeliveryError } from "./agent-runner-
|
|
9
|
+
import { n as buildOAuthTokenRequest, r as parseOAuthTokenResponse, u as hasRequiredOAuthScope } from "./registry-Dankt-Pl.js";
|
|
10
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-BthunUDD.js";
|
|
11
|
+
import { t as discoverSkills } from "./skills-DbP4TDft.js";
|
|
12
|
+
import { B as recordAuthenticationLinked, F as loadProjection, V as recordAuthorizationCompleted, Y as hydrateConversationMessages, ct as recordDeliveredAssistantMessage, d as persistWithRetry, i as abandonTurnRecord, j as commitAcceptedReply, lt as turnHasReply, m as buildTurnErrorResponse, n as loadTurnCheckpoint, o as failTurnRecord, ot as markConversationMessage, r as saveTurnCheckpoint, s as getTurnRecord, tt as buildConversationContext, u as recordTurnSummary } from "./checkpoint-Deu-OVb3.js";
|
|
13
|
+
import { E as acquireActiveLock, w as getStateAdapter } from "./profile-BsNrw8lj.js";
|
|
14
|
+
import { Pt as requestConversationWork, c as parseSlackThreadId, d as resolveSlackChannelIdFromThreadId, l as readSlackRawMessageContext, u as resolveSlackChannelIdFromMessage, wt as ensureConversationWake } from "./stats-pNGp3G5q.js";
|
|
15
|
+
import { a as isPendingAuthLatestRequest, f as CooperativeTurnYieldError, g as isCooperativeTurnYieldError, i as getConversationPendingAuth, r as clearPendingAuth, s as getAssistantReplyText, x as markTurnFailed } from "./pending-auth-D7vmttn_.js";
|
|
16
|
+
import { a as parseOAuthStatePayload, c as escapeSlackMrkdwnText, d as normalizeSlackStatusText, f as truncateStatusText, g as removeReactionFromMessage, h as postSlackMessage, i as formatProviderLabel, l as formatSlackLink, o as resolveBaseUrl, p as addReactionToMessage, u as normalizeSlackReplyMarkdown, v as RetryableDeliveryError } from "./agent-runner-2VQ9WhkG.js";
|
|
17
17
|
import { t as getVercelConversationWorkQueue } from "./vercel-queue-DIkVcfK4.js";
|
|
18
|
-
import { a as getTurnRequestDeadline } from "./job-queue-
|
|
19
|
-
import { i as resolveTurnSessionRouting, n as scheduleSessionCompletedPluginTasks } from "./task-runner-
|
|
20
|
-
import { n as getTurnLifecycle } from "./turn-lifecycle-
|
|
21
|
-
import { n as executeTurn, t as AgentRunError } from "./turn-execution
|
|
22
|
-
import { c as configValueSchema, n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState, t as getLocationConfigurationService } from "./thread-state-
|
|
23
|
-
import { a as requireTurnFailureEventId, c as getTurnUserMessage, d as getTurnUserSlackMessageTs, f as buildDeliveredTurnStatePatch, l as getTurnUserMessageId, n as persistAuthPauseTurnState, o as getInterruptionMarker, r as finalizeFailedTurnReplyWithEvent, s as loadPendingMessageCards, u as getTurnUserReplyAttachmentContext } from "./auth-pause-state-
|
|
18
|
+
import { a as getTurnRequestDeadline } from "./job-queue-CNd9cpIy.js";
|
|
19
|
+
import { i as resolveTurnSessionRouting, n as scheduleSessionCompletedPluginTasks } from "./task-runner-DI1FBJFJ.js";
|
|
20
|
+
import { n as getTurnLifecycle } from "./turn-lifecycle-Bjf6y2GO.js";
|
|
21
|
+
import { n as executeTurn, t as AgentRunError } from "./turn-execution-BNOXrZ-M.js";
|
|
22
|
+
import { c as configValueSchema, n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState, t as getLocationConfigurationService } from "./thread-state-DXgxOYpZ.js";
|
|
23
|
+
import { a as requireTurnFailureEventId, c as getTurnUserMessage, d as getTurnUserSlackMessageTs, f as buildDeliveredTurnStatePatch, l as getTurnUserMessageId, n as persistAuthPauseTurnState, o as getInterruptionMarker, r as finalizeFailedTurnReplyWithEvent, s as loadPendingMessageCards, u as getTurnUserReplyAttachmentContext } from "./auth-pause-state-Bn2vX4PA.js";
|
|
24
24
|
import { n as relayLocalOAuthCallback } from "./oauth-relay-CdCnu80W.js";
|
|
25
|
-
import { n as deleteWebAuthorization } from "./web-authorization-
|
|
25
|
+
import { n as deleteWebAuthorization } from "./web-authorization-6mmfS_o-.js";
|
|
26
26
|
import path from "node:path";
|
|
27
27
|
import { z } from "zod";
|
|
28
28
|
import { createHmac, createSecretKey, timingSafeEqual } from "node:crypto";
|
|
@@ -399,10 +399,64 @@ function renderSlackAutomationCard(card) {
|
|
|
399
399
|
};
|
|
400
400
|
}
|
|
401
401
|
//#endregion
|
|
402
|
+
//#region src/chat/slack/object-card.ts
|
|
403
|
+
/** Render verified annotation facts as a native Task or Item preview. */
|
|
404
|
+
function renderSlackObjectCard(card, conversationId) {
|
|
405
|
+
if (card.objectType === "automation" && card.plugin === "junior") return renderSlackAutomationCard({
|
|
406
|
+
id: card.key,
|
|
407
|
+
title: card.title,
|
|
408
|
+
url: card.url,
|
|
409
|
+
trigger: card.trigger ?? "",
|
|
410
|
+
warning: card.warning ?? null
|
|
411
|
+
});
|
|
412
|
+
const title = card.title.slice(0, 160);
|
|
413
|
+
const text = [
|
|
414
|
+
card.url ? formatSlackLink(card.url, title) : escapeSlackMrkdwnText(title),
|
|
415
|
+
escapeSlackMrkdwnText(card.label),
|
|
416
|
+
card.status ? escapeSlackMrkdwnText(card.status) : null
|
|
417
|
+
].filter(Boolean).join("\n");
|
|
418
|
+
if (!card.url) return {
|
|
419
|
+
entity: null,
|
|
420
|
+
text
|
|
421
|
+
};
|
|
422
|
+
const task = card.objectType === "task";
|
|
423
|
+
return {
|
|
424
|
+
text,
|
|
425
|
+
entity: {
|
|
426
|
+
entity_type: task ? "slack#/entities/task" : "slack#/entities/item",
|
|
427
|
+
external_ref: {
|
|
428
|
+
id: JSON.stringify([
|
|
429
|
+
conversationId,
|
|
430
|
+
card.plugin,
|
|
431
|
+
card.key
|
|
432
|
+
]),
|
|
433
|
+
type: "annotation"
|
|
434
|
+
},
|
|
435
|
+
url: card.url,
|
|
436
|
+
entity_payload: {
|
|
437
|
+
attributes: {
|
|
438
|
+
title: { text: title },
|
|
439
|
+
display_id: card.label,
|
|
440
|
+
display_type: card.objectType === "code_change" ? "Pull request" : task ? "Issue" : "Item",
|
|
441
|
+
product_name: card.plugin
|
|
442
|
+
},
|
|
443
|
+
fields: task && card.status ? { status: { value: card.status } } : void 0,
|
|
444
|
+
custom_fields: !task && card.status ? [{
|
|
445
|
+
key: "status",
|
|
446
|
+
label: "Status",
|
|
447
|
+
type: "string",
|
|
448
|
+
value: card.status
|
|
449
|
+
}] : []
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
};
|
|
453
|
+
}
|
|
454
|
+
//#endregion
|
|
402
455
|
//#region src/chat/slack/cards.ts
|
|
403
456
|
/** Select the Slack object renderer for a built-in card. */
|
|
404
|
-
function renderSlackCard(card) {
|
|
457
|
+
function renderSlackCard(card, conversationId) {
|
|
405
458
|
switch (card.kind) {
|
|
459
|
+
case "object": return renderSlackObjectCard(card, conversationId);
|
|
406
460
|
case "automation": return renderSlackAutomationCard(card);
|
|
407
461
|
}
|
|
408
462
|
}
|
|
@@ -642,7 +696,7 @@ async function sendSlackReply(args) {
|
|
|
642
696
|
text,
|
|
643
697
|
cards: []
|
|
644
698
|
}));
|
|
645
|
-
const cards = (args.cards ?? []).map(renderSlackCard);
|
|
699
|
+
const cards = (args.cards ?? []).map((card) => renderSlackCard(card, args.conversationId));
|
|
646
700
|
for (let index = 0; index < cards.length; index += 5) {
|
|
647
701
|
const group = cards.slice(index, index + 5);
|
|
648
702
|
const lastPost = posts.at(-1);
|
|
@@ -2754,4 +2808,4 @@ async function receiveLocalOAuthCredential(request) {
|
|
|
2754
2808
|
return new Response(null, { status: 204 });
|
|
2755
2809
|
}
|
|
2756
2810
|
//#endregion
|
|
2757
|
-
export { isSlackTitlePermissionError as C, createSlackAdapterAssistantStatusSession as D,
|
|
2811
|
+
export { isSlackTitlePermissionError as C, createSlackAdapterAssistantStatusSession as D, renderSlackObjectCard as E, isRetryableSlackPostError as S, buildSlackOutputMessage as T, getThreadId as _, GET$1 as a, getSlackApiErrorCode as b, wakePausedTurn as c, shouldKeepProcessingReactionForToolInvocation as d, startProcessingReaction as f, getRunId as g, getMessageTs as h, publishAppHomeView as i, resumeSlackTurn as l, getChannelId as m, syncLocalOAuthCredential as n, createPausedTurns as o, getAssistantThreadContext as p, GET as r, getPausedTurnRequest as s, receiveLocalOAuthCredential as t, buildAuthPauseResponse as u, getThreadTs as v, sendSlackReply as w, getSlackErrorObservabilityAttributes as x, stripLeadingBotMention as y };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { f as logWarn } from "./logging-
|
|
2
|
-
import {
|
|
3
|
-
import { E as juniorConversations, s as juniorAutomationExecutions } from "./executor-
|
|
1
|
+
import { f as logWarn } from "./logging-DiN3o3nB.js";
|
|
2
|
+
import { in as agentTurnTotalTokens, qt as getDb, rn as agentTurnCostUsd } from "./agent-hooks-DZU5nsd1.js";
|
|
3
|
+
import { E as juniorConversations, s as juniorAutomationExecutions } from "./executor-AOhG9X1t.js";
|
|
4
4
|
import { and, asc, count, desc, eq, gte, inArray, lte, max, or, sql } from "drizzle-orm";
|
|
5
5
|
//#region src/api/conversations/aggregate.ts
|
|
6
6
|
function usageTokenValue(source, field) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { g as startSpanManual } from "./sentry-CgWZM_kV.js";
|
|
2
|
-
import "./config-
|
|
2
|
+
import "./config-CtoUVs72.js";
|
|
3
3
|
import { n as juniorDestinations, r as timestamptz } from "./destinations-BeBiJeEM.js";
|
|
4
4
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
5
5
|
import { getTableColumns, sql } from "drizzle-orm";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import "@sentry/junior-plugin-api";
|
|
2
3
|
//#region src/chat/conversations/cards.d.ts
|
|
3
4
|
/** Built-in response types accepted by Message storage and delivery. */
|
|
4
5
|
declare const messageCardSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -9,6 +10,23 @@ declare const messageCardSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
9
10
|
instruction: z.ZodString;
|
|
10
11
|
trigger: z.ZodString;
|
|
11
12
|
warning: z.ZodNullable<z.ZodString>;
|
|
13
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
14
|
+
kind: z.ZodLiteral<"object">;
|
|
15
|
+
key: z.ZodString;
|
|
16
|
+
label: z.ZodString;
|
|
17
|
+
objectType: z.ZodEnum<{
|
|
18
|
+
task: "task";
|
|
19
|
+
code_change: "code_change";
|
|
20
|
+
automation: "automation";
|
|
21
|
+
item: "item";
|
|
22
|
+
}>;
|
|
23
|
+
title: z.ZodString;
|
|
24
|
+
url: z.ZodNullable<z.ZodURL>;
|
|
25
|
+
description: z.ZodOptional<z.ZodString>;
|
|
26
|
+
status: z.ZodOptional<z.ZodString>;
|
|
27
|
+
trigger: z.ZodOptional<z.ZodString>;
|
|
28
|
+
warning: z.ZodOptional<z.ZodString>;
|
|
29
|
+
plugin: z.ZodString;
|
|
12
30
|
}, z.core.$strict>], "kind">;
|
|
13
31
|
type MessageCard = z.output<typeof messageCardSchema>;
|
|
14
32
|
/** Render each built-in card with its own text format. */
|
package/dist/instrumentation.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { M as getDeploymentServiceVersion, N as getDeploymentTelemetryAttributes } from "./logging-
|
|
1
|
+
import { M as getDeploymentServiceVersion, N as getDeploymentTelemetryAttributes } from "./logging-DiN3o3nB.js";
|
|
2
2
|
import { _ as vercelAIIntegration, a as getClient, b as withStreamedSpan, c as init, o as getGlobalScope } from "./sentry-CgWZM_kV.js";
|
|
3
|
-
import { n as getCurrentConversationPrivacy } from "./conversation-privacy-
|
|
3
|
+
import { n as getCurrentConversationPrivacy } from "./conversation-privacy-xS1t92xa.js";
|
|
4
4
|
import { t as consumePrivateTraceResultMarker } from "./private-trace-result-BLvBjy_e.js";
|
|
5
5
|
//#region src/chat/sentry-payload-filter.ts
|
|
6
6
|
const PAYLOAD_ATTRIBUTE_KEYS = /* @__PURE__ */ new Set([
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as getChatConfig } from "./config-
|
|
1
|
+
import { a as getChatConfig } from "./config-CtoUVs72.js";
|
|
2
2
|
import { a as signQueueMessage, i as QUEUE_SIGNATURE_MAX_AGE_MS, o as verifyQueueMessage, s as createVercelQueueClient } from "./vercel-queue-DIkVcfK4.js";
|
|
3
3
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
4
4
|
import { z } from "zod";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { d as setTag, f as setUser, h as startSpan, i as getActiveSpan, l as logger, n as captureMessage, p as spanToJSON, s as getTraceData, t as captureException, y as withScope } from "./sentry-CgWZM_kV.js";
|
|
2
|
-
import { t as JUNIOR_VERSION } from "./version-
|
|
2
|
+
import { t as JUNIOR_VERSION } from "./version-_ZQFlslB.js";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { styleText } from "node:util";
|
|
5
5
|
import { ConfigError, configureSync, getConfig, getLogger } from "@logtape/logtape";
|
package/dist/nitro.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as JuniorDashboardOptions } from "./app-
|
|
1
|
+
import { n as JuniorDashboardOptions } from "./app-BbSD6EtD.js";
|
|
2
2
|
import { n as JuniorPluginSet } from "./plugins-BT2l4We3.js";
|
|
3
3
|
//#region src/nitro.d.ts
|
|
4
4
|
export type JuniorNitroDashboardOptions = JuniorDashboardOptions;
|
package/dist/nitro.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { A as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, D as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, E as JUNIOR_HEARTBEAT_ROUTE, O as JUNIOR_RETENTION_CRON_SCHEDULE, T as JUNIOR_HEARTBEAT_CRON_SCHEDULE, k as JUNIOR_RETENTION_ROUTE, w as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "./logging-
|
|
1
|
+
import { A as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, D as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, E as JUNIOR_HEARTBEAT_ROUTE, O as JUNIOR_RETENTION_CRON_SCHEDULE, T as JUNIOR_HEARTBEAT_CRON_SCHEDULE, k as JUNIOR_RETENTION_ROUTE, w as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "./logging-DiN3o3nB.js";
|
|
2
2
|
import { d as resolvePackageDir, t as discoverInstalledPluginPackageContent, u as isValidPackageName } from "./package-discovery-7a9YqLhE.js";
|
|
3
3
|
import { n as resolveConversationWorkQueueTopic } from "./vercel-queue-DIkVcfK4.js";
|
|
4
|
-
import { t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-
|
|
4
|
+
import { t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-CNd9cpIy.js";
|
|
5
5
|
import { a as pluginRuntimeRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "./plugins-egKWjgue.js";
|
|
6
|
-
import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-
|
|
6
|
+
import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-Cy9y1foT.js";
|
|
7
7
|
import { n as loadPluginSetFromModule, r as resolvePluginModule } from "./plugin-module-BKGOXca2.js";
|
|
8
8
|
import path from "node:path";
|
|
9
9
|
import { cpSync, existsSync, mkdirSync, readdirSync, statSync } from "node:fs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { X as createUserTokenStore } from "./agent-
|
|
2
|
-
import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-
|
|
1
|
+
import { X as createUserTokenStore } from "./agent-Bzbf92vv.js";
|
|
2
|
+
import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-CKdXEUDO.js";
|
|
3
3
|
import { createServer } from "node:http";
|
|
4
4
|
//#region src/chat/local/oauth-callback-server.ts
|
|
5
5
|
const LOCAL_OAUTH_TIMEOUT_MS = 6e5;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { g as extractAssistantText, i as abandonTurnRecord } from "./checkpoint-
|
|
2
|
-
import { qt as buildDeterministicTurnId } from "./stats-
|
|
1
|
+
import { g as extractAssistantText, i as abandonTurnRecord } from "./checkpoint-Deu-OVb3.js";
|
|
2
|
+
import { qt as buildDeterministicTurnId } from "./stats-pNGp3G5q.js";
|
|
3
3
|
//#region src/chat/runtime/turn.ts
|
|
4
4
|
/** Classified Slack turn failure carrying the owning Sentry capture outward. */
|
|
5
5
|
var ConversationTurnBoundaryError = class extends Error {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { w as toOptionalTrimmed } from "./client-
|
|
2
|
-
import { _ as setSpanAttributes, v as setSpanStatus } from "./logging-
|
|
3
|
-
import { a as getChatConfig } from "./config-
|
|
4
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
1
|
+
import { w as toOptionalTrimmed } from "./client-DjC6-6iU.js";
|
|
2
|
+
import { _ as setSpanAttributes, v as setSpanStatus } from "./logging-DiN3o3nB.js";
|
|
3
|
+
import { a as getChatConfig } from "./config-CtoUVs72.js";
|
|
4
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-BthunUDD.js";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
6
6
|
import { createMemoryState } from "@chat-adapter/state-memory";
|
|
7
7
|
import { createRedisState } from "@chat-adapter/state-redis";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { I as briefOutcomeStatusSchema, L as conversationBriefSchema, R as parseBriefInput } from "./conversation-1HUoZr2l.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
//#region src/chat/briefs/generate.ts
|
|
4
4
|
const MAX_INPUT_CHARS = 6e4;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as setSpanAttributes, d as logInfo, f as logWarn } from "./logging-
|
|
1
|
+
import { _ as setSpanAttributes, d as logInfo, f as logWarn } from "./logging-DiN3o3nB.js";
|
|
2
2
|
import { i as credentialUserSubjectId } from "./context-Bplcgypl.js";
|
|
3
3
|
import { n as normalizePluginPackageNames, o as pluginRoots, t as discoverInstalledPluginPackageContent } from "./package-discovery-7a9YqLhE.js";
|
|
4
4
|
import path from "node:path";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as withSpan, _ as setSpanAttributes } from "./logging-
|
|
2
|
-
import { A as sleep, P as SANDBOX_WORKSPACE_ROOT, r as isStale, t as create, u as isSandboxUnavailableError, v as getVercelSandboxCredentials, w as getStateAdapter, x as runNonInteractiveCommand } from "./profile-
|
|
1
|
+
import { C as withSpan, _ as setSpanAttributes } from "./logging-DiN3o3nB.js";
|
|
2
|
+
import { A as sleep, P as SANDBOX_WORKSPACE_ROOT, r as isStale, t as create, u as isSandboxUnavailableError, v as getVercelSandboxCredentials, w as getStateAdapter, x as runNonInteractiveCommand } from "./profile-BsNrw8lj.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { FileSystem, Sandbox } from "@vercel/sandbox";
|
|
5
5
|
//#region src/chat/sandbox/resources.ts
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { p as authorizationId } from "./agent-
|
|
2
|
-
import { S as withLogContext, u as logException, y as setTags } from "./logging-
|
|
1
|
+
import { p as authorizationId } from "./agent-Bzbf92vv.js";
|
|
2
|
+
import { S as withLogContext, u as logException, y as setTags } from "./logging-DiN3o3nB.js";
|
|
3
3
|
import { t as credentialContextForActor } from "./context-Bplcgypl.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { F as loadProjection, V as recordAuthorizationCompleted, X as persistConversationMessages, Y as hydrateConversationMessages, ct as recordDeliveredAssistantMessage, d as persistWithRetry, j as commitAcceptedReply, ot as markConversationMessage, r as saveTurnCheckpoint, st as normalizeConversationText, tt as buildConversationContext, ut as upsertConversationMessage } from "./checkpoint-
|
|
7
|
-
import { S as startActiveTurn, s as getAssistantReplyText, x as markTurnFailed } from "./pending-auth-
|
|
8
|
-
import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-
|
|
9
|
-
import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-
|
|
10
|
-
import { n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-
|
|
11
|
-
import { f as buildDeliveredTurnStatePatch, r as finalizeFailedTurnReplyWithEvent, s as loadPendingMessageCards, t as completeAuthPauseTurn } from "./auth-pause-state-
|
|
4
|
+
import { Kt as getConversationStore, Wt as getConversationEventStore } from "./agent-hooks-DZU5nsd1.js";
|
|
5
|
+
import { M as messageCardText } from "./conversation-1HUoZr2l.js";
|
|
6
|
+
import { F as loadProjection, V as recordAuthorizationCompleted, X as persistConversationMessages, Y as hydrateConversationMessages, ct as recordDeliveredAssistantMessage, d as persistWithRetry, j as commitAcceptedReply, ot as markConversationMessage, r as saveTurnCheckpoint, st as normalizeConversationText, tt as buildConversationContext, ut as upsertConversationMessage } from "./checkpoint-Deu-OVb3.js";
|
|
7
|
+
import { S as startActiveTurn, s as getAssistantReplyText, x as markTurnFailed } from "./pending-auth-D7vmttn_.js";
|
|
8
|
+
import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-DI1FBJFJ.js";
|
|
9
|
+
import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-Bjf6y2GO.js";
|
|
10
|
+
import { n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-DXgxOYpZ.js";
|
|
11
|
+
import { f as buildDeliveredTurnStatePatch, r as finalizeFailedTurnReplyWithEvent, s as loadPendingMessageCards, t as completeAuthPauseTurn } from "./auth-pause-state-Bn2vX4PA.js";
|
|
12
12
|
import { randomUUID } from "node:crypto";
|
|
13
13
|
import { createLocalSource, localDestinationSchema } from "@sentry/junior-plugin-api";
|
|
14
14
|
//#region src/chat/local/runner.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Y as sandboxEgressSignalsResponseSchema } from "./agent-
|
|
1
|
+
import { Y as sandboxEgressSignalsResponseSchema } from "./agent-Bzbf92vv.js";
|
|
2
2
|
//#region src/chat/local/sandbox-egress-signals.ts
|
|
3
3
|
const SANDBOX_EGRESS_SIGNALS_PATH = "/api/internal/sandbox-egress/signals";
|
|
4
4
|
const LOCAL_DEV_SERVER_TIMEOUT_MS = 1e3;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as juniorDestinationKindSchema } from "./destinations-BeBiJeEM.js";
|
|
2
|
-
import { E as conversationSummaryReportSchema, n as actorIdentitySchema, w as conversationStatsItemSchema } from "./conversation-
|
|
2
|
+
import { E as conversationSummaryReportSchema, n as actorIdentitySchema, w as conversationStatsItemSchema } from "./conversation-1HUoZr2l.js";
|
|
3
3
|
import { i as fillUtcHours, r as fillUtcDays, s as sumUtcHoursIntoSixHours } from "./reporting-window-DbUqng0P.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { codeChangeStateSchema, taskOutcomeSchema } from "@sentry/junior-plugin-api";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { f as logWarn } from "./logging-
|
|
2
|
-
import { n as botConfig } from "./config-
|
|
1
|
+
import { f as logWarn } from "./logging-DiN3o3nB.js";
|
|
2
|
+
import { n as botConfig } from "./config-CtoUVs72.js";
|
|
3
3
|
const TITLE_PROMPTS = {
|
|
4
4
|
conversation: [
|
|
5
5
|
"Generate a concise 5-8 word conversation title from the first user message below.",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { f as logWarn } from "./logging-
|
|
2
|
+
import { f as logWarn } from "./logging-DiN3o3nB.js";
|
|
3
3
|
import { s as skillRoots } from "./package-discovery-7a9YqLhE.js";
|
|
4
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
4
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-BthunUDD.js";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
import fs from "node:fs/promises";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { C as toolInvocationDestination, y as actorFromRun } from "./agent-runner-
|
|
3
|
-
import { n as createAndEnqueueAgentInvocation } from "./work-
|
|
2
|
+
import { C as toolInvocationDestination, y as actorFromRun } from "./agent-runner-2VQ9WhkG.js";
|
|
3
|
+
import { n as createAndEnqueueAgentInvocation } from "./work-DvIlJR3C.js";
|
|
4
4
|
//#region src/chat/agent-invocations/spawn.ts
|
|
5
5
|
var spawn_exports = /* @__PURE__ */ __exportAll({ bindSpawnAgent: () => bindSpawnAgent });
|
|
6
6
|
/** Bind a Run's Actor and credentials to new Agent invocations. */
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { F as isRecord$1, I as toOptionalNumber, L as toOptionalString } from "./logging-
|
|
2
|
-
import { a as getChatConfig } from "./config-
|
|
1
|
+
import { F as isRecord$1, I as toOptionalNumber, L as toOptionalString } from "./logging-DiN3o3nB.js";
|
|
2
|
+
import { a as getChatConfig } from "./config-CtoUVs72.js";
|
|
3
3
|
import { _ as parseSlackMessageTs, d as parseStoredSlackActor, h as parseSlackTeamId, p as parseSlackChannelId } from "./context-Bplcgypl.js";
|
|
4
|
-
import {
|
|
4
|
+
import { Ft as saveObjectAnnotations, J as withSlackRetries, Kt as getConversationStore, U as getSlackClient, fn as parseDestination, ht as getDashboardTaskLink, mn as sameDestination, pt as JUNIOR_THREAD_STATE_TTL_MS, qt as getDb, u as getPlugins } from "./agent-hooks-DZU5nsd1.js";
|
|
5
5
|
import { n as juniorDestinations } from "./destinations-BeBiJeEM.js";
|
|
6
|
-
import { E as juniorConversations, a as juniorSchedulerRuns, c as juniorStats, l as juniorEventAutomations, o as juniorSchedulerTasks, w as juniorAttachments } from "./executor-
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { C as getDefaultRedisStateAdapterFor, w as getStateAdapter } from "./profile-DbG8AlNd.js";
|
|
6
|
+
import { E as juniorConversations, a as juniorSchedulerRuns, c as juniorStats, l as juniorEventAutomations, o as juniorSchedulerTasks, w as juniorAttachments } from "./executor-AOhG9X1t.js";
|
|
7
|
+
import { t as fallbackShortTitle } from "./short-title-BHd_jUFX.js";
|
|
8
|
+
import { C as getDefaultRedisStateAdapterFor, w as getStateAdapter } from "./profile-BsNrw8lj.js";
|
|
10
9
|
import "./vercel-queue-DIkVcfK4.js";
|
|
11
10
|
import { z } from "zod";
|
|
12
11
|
import { createHash, randomUUID } from "node:crypto";
|
|
13
12
|
import { and, asc, desc, eq, gte, inArray, isNotNull, isNull, lte, ne, notInArray, or, sql } from "drizzle-orm";
|
|
14
|
-
import { actorUserIdSchema, destinationSchema, destinationVisibilitySchema, eventMatchSchema, eventMatches, eventTypeSchema, normalizeEventIdentifier, slackDestinationSchema, taskOutcomeSchema } from "@sentry/junior-plugin-api";
|
|
13
|
+
import { actorUserIdSchema, destinationSchema, destinationVisibilitySchema, eventMatchSchema, eventMatches, eventTypeSchema, normalizeEventIdentifier, ownedObjectAnnotationSchema, slackDestinationSchema, taskOutcomeSchema } from "@sentry/junior-plugin-api";
|
|
15
14
|
//#region src/chat/tools/execution/tool-input-error.ts
|
|
16
15
|
/** Thrown when a tool fails due to invalid model/user input, not a system error. */
|
|
17
16
|
var ToolInputError = class extends Error {
|
|
@@ -1931,7 +1930,7 @@ const compactEventAutomationResultSchema = z.object({
|
|
|
1931
1930
|
/** Validate one successful event-automation mutation result. */
|
|
1932
1931
|
const eventAutomationToolResultSchema = juniorToolOutputSchema.extend({
|
|
1933
1932
|
automation: compactEventAutomationResultSchema,
|
|
1934
|
-
|
|
1933
|
+
objectCards: z.array(ownedObjectAnnotationSchema)
|
|
1935
1934
|
}).strict();
|
|
1936
1935
|
/** Validate one successful event-automation list result. */
|
|
1937
1936
|
const eventAutomationListToolResultSchema = juniorToolOutputSchema.extend({
|
|
@@ -2029,24 +2028,27 @@ function compactEventAutomation(task, catalog, requesterSlackUserId) {
|
|
|
2029
2028
|
});
|
|
2030
2029
|
}
|
|
2031
2030
|
/** Return the standard successful event-automation tool result. */
|
|
2032
|
-
function eventAutomationToolResult(task, catalog, requesterSlackUserId) {
|
|
2031
|
+
async function eventAutomationToolResult(conversationId, task, catalog, requesterSlackUserId) {
|
|
2033
2032
|
const automation = compactEventAutomation(task, catalog, requesterSlackUserId);
|
|
2034
2033
|
const filters = Object.entries(task.trigger.match ?? {}).map(([key, value]) => `${key} = ${JSON.stringify(value)}`);
|
|
2034
|
+
const title = automation.title ?? fallbackShortTitle(task.task.text, "Event automation");
|
|
2035
2035
|
return {
|
|
2036
2036
|
automation,
|
|
2037
|
-
|
|
2038
|
-
kind: "
|
|
2039
|
-
|
|
2040
|
-
|
|
2037
|
+
objectCards: await saveObjectAnnotations(conversationId, "junior", [{
|
|
2038
|
+
kind: "object",
|
|
2039
|
+
objectType: "automation",
|
|
2040
|
+
label: title,
|
|
2041
|
+
key: task.id,
|
|
2042
|
+
title,
|
|
2041
2043
|
url: automation.dashboardUrl,
|
|
2042
|
-
|
|
2044
|
+
description: task.task.text,
|
|
2043
2045
|
trigger: [
|
|
2044
2046
|
task.trigger.label,
|
|
2045
2047
|
task.trigger.events.join(", "),
|
|
2046
2048
|
...filters
|
|
2047
2049
|
].join(" · "),
|
|
2048
|
-
warning: !automation.trigger.available ? "Trigger unavailable. This automation cannot receive events." :
|
|
2049
|
-
}]
|
|
2050
|
+
warning: !automation.trigger.available ? "Trigger unavailable. This automation cannot receive events." : void 0
|
|
2051
|
+
}])
|
|
2050
2052
|
};
|
|
2051
2053
|
}
|
|
2052
2054
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { f as logWarn } from "./logging-
|
|
1
|
+
import { f as logWarn } from "./logging-DiN3o3nB.js";
|
|
2
2
|
import { a as signQueueMessage, i as QUEUE_SIGNATURE_MAX_AGE_MS, o as verifyQueueMessage, s as createVercelQueueClient } from "./vercel-queue-DIkVcfK4.js";
|
|
3
|
-
import { o as runWithTurnRequestDeadline } from "./job-queue-
|
|
3
|
+
import { o as runWithTurnRequestDeadline } from "./job-queue-CNd9cpIy.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
6
6
|
import { handleCallback, registerDevConsumer } from "@vercel/queue";
|
|
@@ -110,7 +110,7 @@ function pluginTaskCallback() {
|
|
|
110
110
|
maxDeliveries: PLUGIN_TASK_MAX_DELIVERIES,
|
|
111
111
|
onRejected: logPluginTaskQueueMessageRejected,
|
|
112
112
|
run: async (message) => {
|
|
113
|
-
const { processPluginTask } = await import("./task-runner-
|
|
113
|
+
const { processPluginTask } = await import("./task-runner-DI1FBJFJ.js").then((n) => n.r);
|
|
114
114
|
await processPluginTask(message);
|
|
115
115
|
},
|
|
116
116
|
topic: PLUGIN_TASK_QUEUE_TOPIC,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
2
|
import { _ as parseSlackMessageTs, r as credentialSubjectSchema } from "./context-Bplcgypl.js";
|
|
3
|
-
import { At as createPluginConversationEvents,
|
|
4
|
-
import {
|
|
5
|
-
import { E as normalizeToolNameFromResult, O as stripRuntimeTurnContext, T as isToolResultMessage, Y as hydrateConversationMessages, _ as getPiMessageRole, s as getTurnRecord, w as isToolResultError, x as instructionTextForProjection } from "./checkpoint-
|
|
6
|
-
import { w as getStateAdapter } from "./profile-
|
|
7
|
-
import { u as recordAutomationExecution } from "./execution-stats-
|
|
8
|
-
import { r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-
|
|
9
|
-
import { i as pluginTaskParamsSchema, o as sendVercelPluginTask, r as pluginTaskId } from "./task-queue-
|
|
3
|
+
import { At as createPluginConversationEvents, Kt as getConversationStore, Q as readActorIdentity, _t as createPluginState, bt as createPluginLogger, p as coreTaskRegistrations, pt as JUNIOR_THREAD_STATE_TTL_MS, qt as getDb, u as getPlugins, vt as createPluginEmbedder, yt as createPluginModel } from "./agent-hooks-DZU5nsd1.js";
|
|
4
|
+
import { X as sameActorIdentity } from "./conversation-1HUoZr2l.js";
|
|
5
|
+
import { E as normalizeToolNameFromResult, O as stripRuntimeTurnContext, T as isToolResultMessage, Y as hydrateConversationMessages, _ as getPiMessageRole, s as getTurnRecord, w as isToolResultError, x as instructionTextForProjection } from "./checkpoint-Deu-OVb3.js";
|
|
6
|
+
import { w as getStateAdapter } from "./profile-BsNrw8lj.js";
|
|
7
|
+
import { u as recordAutomationExecution } from "./execution-stats-CrXs9vSH.js";
|
|
8
|
+
import { r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-DXgxOYpZ.js";
|
|
9
|
+
import { i as pluginTaskParamsSchema, o as sendVercelPluginTask, r as pluginTaskId } from "./task-queue-Cy9y1foT.js";
|
|
10
10
|
import { z } from "zod";
|
|
11
11
|
import { createHash } from "node:crypto";
|
|
12
12
|
import { destinationSchema, destinationVisibilitySchema, isSlackDestination, pluginRunContextSchema, replyAttributionSchema, sourceSchema, taskOutcomeSchema } from "@sentry/junior-plugin-api";
|
|
@@ -345,7 +345,7 @@ function slackSourceForDestination(args) {
|
|
|
345
345
|
* Reads parent Conversations when this Conversation has no Destination.
|
|
346
346
|
*/
|
|
347
347
|
async function resolveConversationRouting(args) {
|
|
348
|
-
const conversationStore = args.conversationStore ?? (await import("./agent-hooks-
|
|
348
|
+
const conversationStore = args.conversationStore ?? (await import("./agent-hooks-DZU5nsd1.js").then((n) => n.Ut)).getConversationStore();
|
|
349
349
|
const chain = await loadConversationChain(args.conversationId, conversationStore);
|
|
350
350
|
let destination;
|
|
351
351
|
let source;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { F as isRecord, I as toOptionalNumber, L as toOptionalString } from "./logging-
|
|
2
|
-
import {
|
|
1
|
+
import { F as isRecord, I as toOptionalNumber, L as toOptionalString } from "./logging-DiN3o3nB.js";
|
|
2
|
+
import { pt as JUNIOR_THREAD_STATE_TTL_MS, qt as getDb } from "./agent-hooks-DZU5nsd1.js";
|
|
3
3
|
import { n as juniorDestinations } from "./destinations-BeBiJeEM.js";
|
|
4
|
-
import { u as juniorLocationConfigurations } from "./executor-
|
|
5
|
-
import { X as persistConversationMessages } from "./checkpoint-
|
|
6
|
-
import { w as getStateAdapter } from "./profile-
|
|
4
|
+
import { u as juniorLocationConfigurations } from "./executor-AOhG9X1t.js";
|
|
5
|
+
import { X as persistConversationMessages } from "./checkpoint-Deu-OVb3.js";
|
|
6
|
+
import { w as getStateAdapter } from "./profile-BsNrw8lj.js";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
import { randomUUID } from "node:crypto";
|
|
9
9
|
import { and, eq, sql } from "drizzle-orm";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as runAgentWithTimeout } from "./agent-runner-
|
|
3
|
-
import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-
|
|
1
|
+
import { Wt as getConversationEventStore } from "./agent-hooks-DZU5nsd1.js";
|
|
2
|
+
import { n as runAgentWithTimeout } from "./agent-runner-2VQ9WhkG.js";
|
|
3
|
+
import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-Bjf6y2GO.js";
|
|
4
4
|
//#region src/chat/runtime/turn-execution.ts
|
|
5
5
|
/** An error thrown while the agent advances a Run. */
|
|
6
6
|
var AgentRunError = class extends Error {
|