@sentry/junior 0.239.0 → 0.240.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/{admin-Cc-iA6z9.js → admin-D6fRPRgC.js} +1 -1
- package/dist/{agent-hooks-DzfA5m3R.js → agent-hooks-JFbgedMZ.js} +116 -10
- package/dist/{agent-runner--1wC26S6.js → agent-runner-0IjJxsL1.js} +60 -121
- package/dist/api/schema.js +2 -2
- package/dist/api.d.ts +1 -1
- package/dist/api.js +21 -20
- package/dist/{app-FB2hmHpZ.d.ts → app-MEd7wbF0.d.ts} +1 -1
- package/dist/app.d.ts +1 -1
- package/dist/app.js +24 -23
- package/dist/{automation-CrQGQ2MT.js → automation-B5_c8hEb.js} +2 -253
- package/dist/{briefs-DGc2Thua.js → briefs-BGWTp-nz.js} +2 -2
- package/dist/cadence-D00SCzT1.js +256 -0
- package/dist/{catalog-runtime-DpB_hG_I.js → catalog-runtime-DdigNl7s.js} +1 -1
- package/dist/{checkpoint-CN7yMfSo.js → checkpoint-C1ZnSz7r.js} +15 -11
- package/dist/cli/chat.js +12 -12
- package/dist/cli/check.js +3 -3
- package/dist/cli/main.js +2 -2
- package/dist/cli/plugins.js +4 -4
- package/dist/cli/snapshot-create.js +3 -3
- package/dist/cli/upgrade.d.ts +1 -1
- package/dist/cli/upgrade.js +3 -3
- package/dist/{client-DNf-sJmM.js → client-Cn73E7br.js} +2 -2
- package/dist/{config-B8QN-04U.js → config-B0S86yw9.js} +2 -2
- package/dist/{conversation-privacy-CrYizZM3.js → conversation-privacy-BKlX7D_R.js} +1 -1
- package/dist/{credential-sync-BG_Yvja8.js → credential-sync-DeNQm7st.js} +14 -14
- package/dist/{db-CWZP77Ex.d.ts → db-Ca9Nt5ci.d.ts} +1 -1
- package/dist/{executor-BQV1Zc1z.js → executor-BQ-A5nov.js} +2 -2
- package/dist/{images-C_0iwPsW.js → images-C7OKd6uy.js} +2 -2
- package/dist/instrumentation.js +2 -2
- package/dist/{job-queue-D82gksYM.js → job-queue-DgXLqoeB.js} +1 -1
- package/dist/{logging-Crg0e1jb.js → logging-BSNF167N.js} +1 -1
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +3 -3
- package/dist/{oauth-authorization-Bdu39G-H.js → oauth-authorization-BM7g61od.js} +1 -1
- package/dist/{oauth-callback-server-eJfI6skP.js → oauth-callback-server-Dw-BwI6x.js} +2 -2
- package/dist/{pending-auth-DauOaies.js → pending-auth-Chn_EA1_.js} +2 -2
- package/dist/{profile-XzHSfIah.js → profile-3t9H_IwL.js} +4 -4
- package/dist/{registry-BJME30oR.js → registry-DLZlAhdP.js} +1 -1
- package/dist/{resolve-ZKXfsZuZ.js → resolve-9_cIPQsq.js} +2 -2
- package/dist/{runner-DkHL8vRA.js → runner-C_eUbFyp.js} +9 -9
- package/dist/{sandbox-egress-signals-BEQsK7ym.js → sandbox-egress-signals-C1ycxTNA.js} +1 -1
- package/dist/{schema-CxWAN2zq.js → schema-C4XwHTY4.js} +1 -1
- package/dist/{skills-CMl248J3.js → skills-Dqgjr_Tl.js} +2 -2
- package/dist/{spawn-DrvZYrTQ.js → spawn-BfEr3t7b.js} +2 -2
- package/dist/{store-BxxbxBlm.d.ts → store-DoewL5mG.d.ts} +0 -7
- package/dist/{task-queue-BMzTARMo.js → task-queue-CuFZDOXn.js} +3 -3
- package/dist/{task-runner-CXTpWSmw.js → task-runner-c7gwV8dj.js} +10 -10
- package/dist/{thread-state-BM1sLptE.js → thread-state-exTu-G1w.js} +6 -6
- package/dist/{turn-failure-response-ISrbka5I.js → turn-failure-response-DFp99ziF.js} +8 -8
- package/dist/{turn-lifecycle-f7TPxQsc.js → turn-lifecycle-C4TjuOzG.js} +1 -1
- package/dist/{turn-session-routing-BcAD7onh.js → turn-session-routing-Vpg8jUD1.js} +1 -1
- package/dist/{validation-Bo6BHmig.js → validation-D2lULEG9.js} +1 -1
- package/dist/{version-Cv__n5ue.js → version-BjBMCc2o.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-EftpWXcF.js → viewer-XE3nFqKM.js} +9 -11
- package/dist/{web-authorization-BLDXKk2u.js → web-authorization-8E8IrWOj.js} +6 -6
- package/dist/{web-input-DSa6geKr.js → web-input-DF4GGJrf.js} +24 -41
- package/dist/{work-WOk5DovU.js → work-Dt_JjfbX.js} +7 -7
- package/dist/{worker-B7rtMFzw.js → worker-BrbnLmD3.js} +5 -5
- package/package.json +5 -5
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { F as normalizeIdentityEmail } from "./logging-
|
|
3
|
-
import { i as getChatConfig } from "./config-
|
|
2
|
+
import { F as normalizeIdentityEmail } from "./logging-BSNF167N.js";
|
|
3
|
+
import { i as getChatConfig } from "./config-B0S86yw9.js";
|
|
4
4
|
import { d as parseSlackTeamId, o as parseActorUserId, u as parseSlackChannelReferenceId } from "./actor-BTtLaeWy.js";
|
|
5
5
|
import { n as juniorDestinations } from "./destinations-BeBiJeEM.js";
|
|
6
|
-
import { D as juniorConversations, E as conversationReadColumns, O as juniorIdentities, S as juniorConversationAnnotations, b as juniorConversationEvents, g as juniorConversationBindings, h as juniorConversationParticipants, k as juniorUsers, t as createJuniorSqlExecutor, v as CONVERSATION_METRICS, y as juniorConversationMetrics } from "./executor-
|
|
6
|
+
import { D as juniorConversations, E as conversationReadColumns, O as juniorIdentities, S as juniorConversationAnnotations, b as juniorConversationEvents, g as juniorConversationBindings, h as juniorConversationParticipants, k as juniorUsers, t as createJuniorSqlExecutor, v as CONVERSATION_METRICS, y as juniorConversationMetrics } from "./executor-BQ-A5nov.js";
|
|
7
7
|
import { c as newConversationEventSchema, l as encodeHistoryPayload, m as usageSchema, o as decodeStoredConversationEvent, r as conversationEventDataSchema, s as historyReplacementSchema } from "./history-BLTUgFYO.js";
|
|
8
8
|
import { randomUUID } from "node:crypto";
|
|
9
9
|
import { and, asc, desc, eq, gt, gte, inArray, isNull, lt, lte, ne, or, sql } from "drizzle-orm";
|
|
@@ -413,10 +413,6 @@ function parseSessionSource(value) {
|
|
|
413
413
|
async function getConversationIdByProviderConversation(executor, args) {
|
|
414
414
|
return (await executor.db().select({ conversationId: juniorConversationBindings.conversationId }).from(juniorConversationBindings).where(and(eq(juniorConversationBindings.provider, args.provider), eq(juniorConversationBindings.providerTenantId, args.providerTenantId), eq(juniorConversationBindings.providerDestinationId, args.providerDestinationId), eq(juniorConversationBindings.providerConversationId, args.providerConversationId))).limit(1))[0]?.conversationId;
|
|
415
415
|
}
|
|
416
|
-
/** Return the first provider conversation bound in one destination. */
|
|
417
|
-
async function getFirstProviderConversationId(executor, args) {
|
|
418
|
-
return (await executor.db().select({ providerConversationId: juniorConversationBindings.providerConversationId }).from(juniorConversationBindings).where(and(eq(juniorConversationBindings.conversationId, args.conversationId), eq(juniorConversationBindings.provider, args.provider), eq(juniorConversationBindings.providerTenantId, args.providerTenantId), eq(juniorConversationBindings.providerDestinationId, args.providerDestinationId))).orderBy(asc(juniorConversationBindings.createdAt), asc(juniorConversationBindings.providerConversationId)).limit(1))[0]?.providerConversationId;
|
|
419
|
-
}
|
|
420
416
|
/** Bind provider coordinates to a durable conversation in the caller's SQL scope. */
|
|
421
417
|
async function bindProviderConversation(executor, args) {
|
|
422
418
|
if (((await executor.db().insert(juniorConversationBindings).values({
|
|
@@ -566,6 +562,11 @@ function visibilityFromLocationRow(row) {
|
|
|
566
562
|
if (!row) return;
|
|
567
563
|
if (row.visibility === "public" || row.visibility === "private") return row.visibility;
|
|
568
564
|
}
|
|
565
|
+
/** Store a channel-level Location's first bound post as its thread. */
|
|
566
|
+
async function startLocationThread(executor, binding) {
|
|
567
|
+
const location = juniorConversations.location;
|
|
568
|
+
await executor.db().update(juniorConversations).set({ location: sql`${location} || jsonb_build_object('threadTs', ${binding.providerConversationId}::text)` }).where(and(eq(juniorConversations.conversationId, binding.conversationId), sql`${location}->>'provider' = ${binding.provider}`, sql`${location}->>'teamId' = ${binding.providerTenantId}`, sql`${location}->>'channelId' = ${binding.providerDestinationId}`, isNull(sql`${location}->>'threadTs'`)));
|
|
569
|
+
}
|
|
569
570
|
//#endregion
|
|
570
571
|
//#region src/chat/conversations/sql/store.ts
|
|
571
572
|
const CONVERSATION_MUTATION_LOCK_PREFIX = "junior_conversation";
|
|
@@ -718,9 +719,6 @@ var SqlStore = class {
|
|
|
718
719
|
async getConversationIdByProviderConversation(args) {
|
|
719
720
|
return await getConversationIdByProviderConversation(this.executor, args);
|
|
720
721
|
}
|
|
721
|
-
async getFirstProviderConversationId(args) {
|
|
722
|
-
return await getFirstProviderConversationId(this.executor, args);
|
|
723
|
-
}
|
|
724
722
|
async bindProviderConversation(args) {
|
|
725
723
|
await bindProviderConversation(this.executor, args);
|
|
726
724
|
}
|
|
@@ -1633,4 +1631,4 @@ async function readActorIdentity(actor) {
|
|
|
1633
1631
|
return await readActorIdentityFromSql(getDb(), actor);
|
|
1634
1632
|
}
|
|
1635
1633
|
//#endregion
|
|
1636
|
-
export {
|
|
1634
|
+
export { upsertIdentity as A, agentTurnTotalTokens as C, deleteProviderIdentityForSlackUser as D, resolveRootConversationId as E, sameDestination as F, createSlackDestination as M, parseDestination as N, readUserTimezone as O, requireSlackDestination as P, agentTurnCostUsd as S, hasAgentTurnUsage as T, locationFromRow as _, setUserAdminFromSql as a, parseSessionSource as b, getConversationEventStore as c, getDb as d, getSqlExecutor as f, withConversationMutationLock as g, createSqlStore as h, resolveViewerUser as i, upsertLinkedIdentity as j, saveUserTimezone as k, getConversationMessageSearchStore as l, withConversationEventLock as m, listAdminUsersFromSql as n, updateViewerDisplayName as o, createSqlConversationEventStore as p, readActorIdentity as r, db_exports as s, findUserByEmail as t, getConversationStore as u, startLocationThread as v, agentTurnUsageSchema as w, addAgentTurnUsage as x, bindProviderConversation as y };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as getConversationEventStore } from "./viewer-
|
|
3
|
-
import { n as loadTurnCheckpoint, o as failTurnRecord, s as getTurnRecord } from "./checkpoint-
|
|
4
|
-
import { w as getStateAdapter } from "./profile-
|
|
5
|
-
import { a as getVercelConversationWorkQueue } from "./job-queue-
|
|
6
|
-
import { n as resolveTurnSessionRouting } from "./turn-session-routing-
|
|
1
|
+
import { Yt as requestConversationWork, zt as ensureConversationWake } from "./agent-runner-0IjJxsL1.js";
|
|
2
|
+
import { c as getConversationEventStore } from "./viewer-XE3nFqKM.js";
|
|
3
|
+
import { n as loadTurnCheckpoint, o as failTurnRecord, s as getTurnRecord } from "./checkpoint-C1ZnSz7r.js";
|
|
4
|
+
import { w as getStateAdapter } from "./profile-3t9H_IwL.js";
|
|
5
|
+
import { a as getVercelConversationWorkQueue } from "./job-queue-DgXLqoeB.js";
|
|
6
|
+
import { n as resolveTurnSessionRouting } from "./turn-session-routing-Vpg8jUD1.js";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
import { randomUUID } from "node:crypto";
|
|
9
9
|
//#region src/chat/task-execution/authorized-turn.ts
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { f as escapeXml, i as completeText, r as completeObject, v as isProviderRetryError } from "./client-
|
|
3
|
-
import { C as withLogContext, I as isRecord, L as toOptionalNumber, R as toOptionalString, _ as setSentryUser, b as setTags, d as logException, f as logInfo, n as createChatSdkLogger, o as getActiveTraceId, p as logWarn, t as buildTurnFailureResponse, u as logError, v as setSpanAttributes, w as withSpan } from "./logging-
|
|
4
|
-
import { c as getSlackClientSecret, i as getChatConfig, l as getSlackSigningSecret, n as botConfig, o as getSlackBotToken, s as getSlackClientId, v as normalizeSlackEmojiName } from "./config-
|
|
1
|
+
import { A as resolveSlackChannelIdFromMessage, B as readScheduledAutomation, C as renderBlockText, Cn as normalizeSlackStatusText, Ct as getEventCatalog, D as storeAttachment, Dn as postSlackMessage, Dt as appendAndEnqueueExclusiveInboundMessage, En as addReactionToMessage, H as saveScheduledAutomationInLock, In as AuthorizationFlowDisabledError, J as effectiveTaskOutcomes, Ln as shouldEmitDevAgentTrace, M as getConversationInfo, Mn as buildSteeringPiMessage, N as listThreadReplies, Nn as RetryableDeliveryError, O as parseSlackThreadId, On as removeReactionFromMessage, Ot as appendAndEnqueueInboundMessage, Q as eventAutomationBelongsToUser, S as renderAttachmentText, Sn as normalizeSlackReplyMarkdown, St as timerWatchCredentialSubject, Tn as truncateStatusText, Tt as pluginEventCatalog, Vt as getConversationWorkState, W as withScheduledAutomationLock, Z as deleteEventAutomation, a as buildAuthPauseResponse, an as maybePostAutomatedTurnLimitNotice, at as automationDefinition, bn as escapeSlackMrkdwnText, bt as EVENT_WAIT_MS, ct as sameDefinitionValue, et as getEventAutomation, h as latestProgressStatus, j as resolveSlackChannelIdFromThreadId, jn as createUserTokenStore, k as readSlackRawMessageContext, m as PluginCredentialFailureError, n as executeAgentRun, nt as parseEventAutomationRow, on as recordFinishedTurnForAutomatedLimit, ot as listAutomationVersions, q as eventAutomationTriggerAvailable, r as createContextCompactor, t as createAgentRunner, tt as listDeletedEventAutomationsCreatedBy, xn as formatSlackLink, xt as isEventMailboxMetadata, z as parseScheduledAutomationRow } from "./agent-runner-0IjJxsL1.js";
|
|
2
|
+
import { f as escapeXml, i as completeText, r as completeObject, v as isProviderRetryError } from "./client-Cn73E7br.js";
|
|
3
|
+
import { C as withLogContext, I as isRecord, L as toOptionalNumber, R as toOptionalString, _ as setSentryUser, b as setTags, d as logException, f as logInfo, n as createChatSdkLogger, o as getActiveTraceId, p as logWarn, t as buildTurnFailureResponse, u as logError, v as setSpanAttributes, w as withSpan } from "./logging-BSNF167N.js";
|
|
4
|
+
import { c as getSlackClientSecret, i as getChatConfig, l as getSlackSigningSecret, n as botConfig, o as getSlackBotToken, s as getSlackClientId, v as normalizeSlackEmojiName } from "./config-B0S86yw9.js";
|
|
5
5
|
import { o as modelIdForProfile, r as defaultModelId } from "./model-profile-BwU8mqwD.js";
|
|
6
6
|
import { a as isUserActor, g as parseSlackMessageTs, i as isActorUserId, l as parseSlackChannelId, n as createSlackActor, o as parseActorUserId, r as createSlackResumeActor, t as createActor } from "./actor-BTtLaeWy.js";
|
|
7
|
-
import {
|
|
7
|
+
import { M as createSlackDestination, P as requireSlackDestination, c as getConversationEventStore, d as getDb, f as getSqlExecutor, u as getConversationStore } from "./viewer-XE3nFqKM.js";
|
|
8
8
|
import { n as juniorDestinations } from "./destinations-BeBiJeEM.js";
|
|
9
|
-
import { O as juniorIdentities, c as juniorAutomationExecutions, k as juniorUsers, o as juniorSchedulerTasks, u as juniorEventAutomations } from "./executor-
|
|
9
|
+
import { O as juniorIdentities, c as juniorAutomationExecutions, k as juniorUsers, o as juniorSchedulerTasks, u as juniorEventAutomations } from "./executor-BQ-A5nov.js";
|
|
10
10
|
import { f as instructionProvenanceFor } from "./history-BLTUgFYO.js";
|
|
11
|
-
import { d as credentialContextForActor } from "./registry-
|
|
12
|
-
import { $ as resolveConversationTitle, A as commitAcceptedReply, G as recordSubscribedReplyRoute, N as loadConversationProjection, O as trimTrailingAssistantMessages, P as loadProjection, Q as persistConversationMessageSummaries, V as recordAuthorizationCompleted, X as persistConversationMessages, Y as hydrateConversationMessages, a as completeTurnRecord, at as createConversationMemoryService, c as listTurnSummaries, ct as isHumanConversationMessage, dt as recordDeliveredAssistantMessage, ft as turnHasReply, i as abandonTurnRecord, it as buildConversationContext, j as commitMessages, l as recordTurnSummary, lt as markConversationMessage, n as loadTurnCheckpoint, o as failTurnRecord, ot as estimateConversationContextTokens, p as buildTurnErrorResponse, pt as upsertConversationMessage, r as saveTurnCheckpoint, rt as appendThreadContextMessages, s as getTurnRecord, st as getConversationMessageSlackTs, tt as fallbackShortTitle, u as persistWithRetry, ut as normalizeConversationText } from "./checkpoint-
|
|
13
|
-
import { Ft as getSlackFileId, Lt as readAttachmentVisionSummary, Pt as buildSentryConversationUrl, Rt as recordSlackAttachment, at as getSlackClient, ct as normalizeSlackConversationId, et as verifyTimerWatchCredentialSubject, ht as getDashboardObjectIconLink, it as getHeaderString, lt as runWithSlackInstallationToken, mt as getDashboardConversationLink, nt as downloadPrivateSlackFile, o as getPluginSlackConversationLink, pt as JUNIOR_THREAD_STATE_TTL_MS, st as isDmChannel, tt as SlackActionError, z as cancelSubscriptions } from "./agent-hooks-
|
|
11
|
+
import { d as credentialContextForActor } from "./registry-DLZlAhdP.js";
|
|
12
|
+
import { $ as resolveConversationTitle, A as commitAcceptedReply, G as recordSubscribedReplyRoute, N as loadConversationProjection, O as trimTrailingAssistantMessages, P as loadProjection, Q as persistConversationMessageSummaries, V as recordAuthorizationCompleted, X as persistConversationMessages, Y as hydrateConversationMessages, a as completeTurnRecord, at as createConversationMemoryService, c as listTurnSummaries, ct as isHumanConversationMessage, dt as recordDeliveredAssistantMessage, ft as turnHasReply, i as abandonTurnRecord, it as buildConversationContext, j as commitMessages, l as recordTurnSummary, lt as markConversationMessage, n as loadTurnCheckpoint, o as failTurnRecord, ot as estimateConversationContextTokens, p as buildTurnErrorResponse, pt as upsertConversationMessage, r as saveTurnCheckpoint, rt as appendThreadContextMessages, s as getTurnRecord, st as getConversationMessageSlackTs, tt as fallbackShortTitle, u as persistWithRetry, ut as normalizeConversationText } from "./checkpoint-C1ZnSz7r.js";
|
|
13
|
+
import { Ft as getSlackFileId, Kt as lookupSlackUser, Lt as readAttachmentVisionSummary, Pt as buildSentryConversationUrl, Rt as recordSlackAttachment, at as getSlackClient, ct as normalizeSlackConversationId, et as verifyTimerWatchCredentialSubject, ht as getDashboardObjectIconLink, it as getHeaderString, lt as runWithSlackInstallationToken, mt as getDashboardConversationLink, nt as downloadPrivateSlackFile, o as getPluginSlackConversationLink, pt as JUNIOR_THREAD_STATE_TTL_MS, st as isDmChannel, tt as SlackActionError, z as cancelSubscriptions } from "./agent-hooks-JFbgedMZ.js";
|
|
14
14
|
import { F as isVisionImageMediaType, N as readMessageAttachments } from "./conversation-DwD-vquD.js";
|
|
15
|
-
import { E as acquireActiveLock, O as withLock, T as MUTATION_LOCK_TTL_MS, w as getStateAdapter } from "./profile-
|
|
16
|
-
import { a as wasPendingAuthStopped, c as getThreadStopDecision, l as buildDeterministicAssistantMessageId, o as decideSubscribedThreadReply, r as clearPendingAuth, s as getSubscribedReplyPreflightDecision, u as buildDeterministicTurnId } from "./pending-auth-
|
|
17
|
-
import { _ as markTurnFailed, c as CooperativeTurnYieldError, d as getConversationTurnBoundaryError, f as isCooperativeTurnYieldError, g as markTurnCompleted, h as markTurnClosed, l as TurnInputCommitLostError, m as isTurnInputDeferredError, p as isTurnInputCommitLostError, r as getAssistantReplyText, s as ConversationTurnBoundaryError, u as TurnInputDeferredError, v as startActiveTurn } from "./oauth-authorization-
|
|
15
|
+
import { E as acquireActiveLock, O as withLock, T as MUTATION_LOCK_TTL_MS, w as getStateAdapter } from "./profile-3t9H_IwL.js";
|
|
16
|
+
import { a as wasPendingAuthStopped, c as getThreadStopDecision, l as buildDeterministicAssistantMessageId, o as decideSubscribedThreadReply, r as clearPendingAuth, s as getSubscribedReplyPreflightDecision, u as buildDeterministicTurnId } from "./pending-auth-Chn_EA1_.js";
|
|
17
|
+
import { _ as markTurnFailed, c as CooperativeTurnYieldError, d as getConversationTurnBoundaryError, f as isCooperativeTurnYieldError, g as markTurnCompleted, h as markTurnClosed, l as TurnInputCommitLostError, m as isTurnInputDeferredError, p as isTurnInputCommitLostError, r as getAssistantReplyText, s as ConversationTurnBoundaryError, u as TurnInputDeferredError, v as startActiveTurn } from "./oauth-authorization-BM7g61od.js";
|
|
18
18
|
import { a as EVENT_SYSTEM_ACTOR, i as EVENT_MESSAGE_AUTHOR, o as isEventConversationMessage } from "./prompt-CMU-B4FA.js";
|
|
19
|
-
import { a as getVercelConversationWorkQueue, f as getTurnRequestDeadline } from "./job-queue-
|
|
20
|
-
import { l as automationListQuerySchema } from "./automation-
|
|
19
|
+
import { a as getVercelConversationWorkQueue, f as getTurnRequestDeadline } from "./job-queue-DgXLqoeB.js";
|
|
20
|
+
import { l as automationListQuerySchema } from "./automation-B5_c8hEb.js";
|
|
21
21
|
import { r as isExperimentalFeatureEnabled } from "./experimental-Qn9rKLgx.js";
|
|
22
22
|
import { c as sumUtcHoursIntoSixHours, m as healthReportSchema, t as webMessageId } from "./web-message-id-xPI_EFSC.js";
|
|
23
|
-
import { C as readAutomationExecutionStatusDays, D as readAutomationRuns, E as readAutomationExecutions, S as readAutomationExecutionHours, T as readAutomationExecutionSummaries, _ as markDispatchFailed, a as confirmDispatchMailboxAppend, b as readAutomationExecutionByConversationId, c as getDispatchInputMessageId, f as isTerminalDispatchStatus, g as markDispatchCompleted, h as markDispatchBlocked, i as claimDispatchMailboxAppend, l as getDispatchRecord, m as markDispatchAwaitingResume, n as scheduleSessionCompletedPluginTasks, s as getDispatchConversationId, t as processPluginTask, u as getDispatchTurnId, v as markDispatchRunning, w as readAutomationExecutionStatusHours, x as readAutomationExecutionDays, y as emptyAutomationRunWindows } from "./task-runner-
|
|
24
|
-
import { i as resolveAgentInvocationId, o as AgentRunError, s as executeTurn, t as createAgentInvocationWorker } from "./work-
|
|
25
|
-
import { n as getTurnLifecycle, t as ConversationTurnLifecycleService } from "./turn-lifecycle-
|
|
26
|
-
import { a as persistThreadState, c as configValueSchema, i as persistThreadRuntimeState, n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState, t as getLocationConfigurationService } from "./thread-state-
|
|
27
|
-
import { a as getPausedTurnRequest, c as getTurnAuthorization, i as createPausedTurns, n as deleteWebAuthorization, s as wakePausedTurn, t as createWebAuthorization } from "./web-authorization-
|
|
28
|
-
import { n as resolveTurnSessionRouting } from "./turn-session-routing-
|
|
29
|
-
import { t as bindSpawnAgent } from "./spawn-
|
|
30
|
-
import { a as persistAuthPauseTurnState, c as getTurnUserSlackMessageTs, d as loadPendingMessageCards, i as completeAuthPauseTurn, l as buildDeliveredTurnStatePatch, n as getAgentTurnDiagnosticsAttributes, o as getTurnUserMessage, r as requireTurnFailureEventId, s as getTurnUserReplyAttachmentContext, t as finalizeFailedTurnReplyWithEvent, u as getInterruptionMarker } from "./turn-failure-response-
|
|
31
|
-
import { r as storeInputImages } from "./images-
|
|
23
|
+
import { C as readAutomationExecutionStatusDays, D as readAutomationRuns, E as readAutomationExecutions, S as readAutomationExecutionHours, T as readAutomationExecutionSummaries, _ as markDispatchFailed, a as confirmDispatchMailboxAppend, b as readAutomationExecutionByConversationId, c as getDispatchInputMessageId, f as isTerminalDispatchStatus, g as markDispatchCompleted, h as markDispatchBlocked, i as claimDispatchMailboxAppend, l as getDispatchRecord, m as markDispatchAwaitingResume, n as scheduleSessionCompletedPluginTasks, s as getDispatchConversationId, t as processPluginTask, u as getDispatchTurnId, v as markDispatchRunning, w as readAutomationExecutionStatusHours, x as readAutomationExecutionDays, y as emptyAutomationRunWindows } from "./task-runner-c7gwV8dj.js";
|
|
24
|
+
import { i as resolveAgentInvocationId, o as AgentRunError, s as executeTurn, t as createAgentInvocationWorker } from "./work-Dt_JjfbX.js";
|
|
25
|
+
import { n as getTurnLifecycle, t as ConversationTurnLifecycleService } from "./turn-lifecycle-C4TjuOzG.js";
|
|
26
|
+
import { a as persistThreadState, c as configValueSchema, i as persistThreadRuntimeState, n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState, t as getLocationConfigurationService } from "./thread-state-exTu-G1w.js";
|
|
27
|
+
import { a as getPausedTurnRequest, c as getTurnAuthorization, i as createPausedTurns, n as deleteWebAuthorization, s as wakePausedTurn, t as createWebAuthorization } from "./web-authorization-8E8IrWOj.js";
|
|
28
|
+
import { n as resolveTurnSessionRouting } from "./turn-session-routing-Vpg8jUD1.js";
|
|
29
|
+
import { t as bindSpawnAgent } from "./spawn-BfEr3t7b.js";
|
|
30
|
+
import { a as persistAuthPauseTurnState, c as getTurnUserSlackMessageTs, d as loadPendingMessageCards, i as completeAuthPauseTurn, l as buildDeliveredTurnStatePatch, n as getAgentTurnDiagnosticsAttributes, o as getTurnUserMessage, r as requireTurnFailureEventId, s as getTurnUserReplyAttachmentContext, t as finalizeFailedTurnReplyWithEvent, u as getInterruptionMarker } from "./turn-failure-response-DFp99ziF.js";
|
|
31
|
+
import { r as storeInputImages } from "./images-C7OKd6uy.js";
|
|
32
32
|
import { z } from "zod";
|
|
33
33
|
import { createHash } from "node:crypto";
|
|
34
34
|
import { and, asc, count, desc, eq, exists, inArray, ne, or, sql } from "drizzle-orm";
|
|
@@ -6675,23 +6675,6 @@ function captureConversationTurnFailure(args) {
|
|
|
6675
6675
|
});
|
|
6676
6676
|
return typeof eventId === "string" ? eventId : void 0;
|
|
6677
6677
|
}
|
|
6678
|
-
/**
|
|
6679
|
-
* Reply in the thread started by a channel-level Conversation's first Message.
|
|
6680
|
-
* Automation runs post at the channel top level, so their Watches need this.
|
|
6681
|
-
*/
|
|
6682
|
-
async function resolveStartedThreadLocation(conversationId, location) {
|
|
6683
|
-
if (location?.provider !== "slack" || location.threadTs) return location;
|
|
6684
|
-
const threadTs = await getConversationStore().getFirstProviderConversationId({
|
|
6685
|
-
conversationId,
|
|
6686
|
-
provider: "slack",
|
|
6687
|
-
providerDestinationId: location.channelId,
|
|
6688
|
-
providerTenantId: location.teamId
|
|
6689
|
-
});
|
|
6690
|
-
return threadTs ? {
|
|
6691
|
-
...location,
|
|
6692
|
-
threadTs
|
|
6693
|
-
} : location;
|
|
6694
|
-
}
|
|
6695
6678
|
/** Return the saved timer creator subject when it is still valid here. */
|
|
6696
6679
|
function resumedTimerWatchCredentialSubject(conversationId, subject) {
|
|
6697
6680
|
if (subject?.binding.type !== "timer-watch") return void 0;
|
|
@@ -6816,7 +6799,7 @@ function createConversationTurnWorker(agentRunner, deliverMessage) {
|
|
|
6816
6799
|
visibility: storedConversation?.visibility
|
|
6817
6800
|
});
|
|
6818
6801
|
const webActor = actor.platform === "web" ? actor : void 0;
|
|
6819
|
-
const conversationLocation =
|
|
6802
|
+
const conversationLocation = storedConversation?.location;
|
|
6820
6803
|
const deliverToProvider = Boolean(conversationLocation) && (source.kind === "event" || savedMessageIsEvent);
|
|
6821
6804
|
const surface = deliverToProvider ? "slack" : "api";
|
|
6822
6805
|
return await withLogContext({
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import {
|
|
3
|
-
import { c as getConversationEventStore, f as getSqlExecutor, u as getConversationStore } from "./viewer-
|
|
4
|
-
import { m as juniorAgentInvocations, p as juniorAgentBindings } from "./executor-
|
|
5
|
-
import { L as openConversationProjection, _ as getTerminalAssistantMessages, o as failTurnRecord, r as saveTurnCheckpoint, s as getTurnRecord } from "./checkpoint-
|
|
6
|
-
import { d as getConversationTurnBoundaryError, l as TurnInputCommitLostError, p as isTurnInputCommitLostError, r as getAssistantReplyText } from "./oauth-authorization-
|
|
7
|
-
import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-
|
|
8
|
-
import { n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState } from "./thread-state-
|
|
2
|
+
import { In as AuthorizationFlowDisabledError, Ot as appendAndEnqueueInboundMessage, ft as agentBindingSchema, gt as AgentInvocationLimitError, ht as AgentInvocationBusyError, m as PluginCredentialFailureError, mt as createAgentInvocationSchema, pt as agentInvocationSchema } from "./agent-runner-0IjJxsL1.js";
|
|
3
|
+
import { c as getConversationEventStore, f as getSqlExecutor, u as getConversationStore } from "./viewer-XE3nFqKM.js";
|
|
4
|
+
import { m as juniorAgentInvocations, p as juniorAgentBindings } from "./executor-BQ-A5nov.js";
|
|
5
|
+
import { L as openConversationProjection, _ as getTerminalAssistantMessages, o as failTurnRecord, r as saveTurnCheckpoint, s as getTurnRecord } from "./checkpoint-C1ZnSz7r.js";
|
|
6
|
+
import { d as getConversationTurnBoundaryError, l as TurnInputCommitLostError, p as isTurnInputCommitLostError, r as getAssistantReplyText } from "./oauth-authorization-BM7g61od.js";
|
|
7
|
+
import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-C4TjuOzG.js";
|
|
8
|
+
import { n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState } from "./thread-state-exTu-G1w.js";
|
|
9
9
|
import { z } from "zod";
|
|
10
10
|
import { createHash } from "node:crypto";
|
|
11
11
|
import { and, asc, count, eq, inArray } from "drizzle-orm";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import {
|
|
3
|
-
import { v as isProviderRetryError } from "./client-
|
|
4
|
-
import { C as withLogContext, d as logException, f as logInfo, p as logWarn } from "./logging-
|
|
5
|
-
import { i as getChatConfig } from "./config-
|
|
6
|
-
import { f as getTurnRequestDeadline, m as ConversationQueueMessageRejectedError } from "./job-queue-
|
|
2
|
+
import { Et as ackMessages, Ft as completeConversationWork, Gt as recordConversationRetry, It as countPendingConversationMessages, Jt as requestAnotherSlice, Kt as releaseConversationWork, Lt as deadLetterAttempt, Mt as clearConsumedConversationWake, Pt as completeConversationStop, Rt as drainConversationMailbox, Vt as getConversationWorkState, Wt as recordAttemptFailure, Xt as startConversationWork, en as hasConversationStop, jt as checkInConversationWork, kt as beginConversationResume, nn as isFinalAttempt, rn as isInvalidConversationRecordError, zt as ensureConversationWake } from "./agent-runner-0IjJxsL1.js";
|
|
3
|
+
import { v as isProviderRetryError } from "./client-Cn73E7br.js";
|
|
4
|
+
import { C as withLogContext, d as logException, f as logInfo, p as logWarn } from "./logging-BSNF167N.js";
|
|
5
|
+
import { i as getChatConfig } from "./config-B0S86yw9.js";
|
|
6
|
+
import { f as getTurnRequestDeadline, m as ConversationQueueMessageRejectedError } from "./job-queue-DgXLqoeB.js";
|
|
7
7
|
//#region src/chat/task-execution/worker.ts
|
|
8
8
|
var worker_exports = /* @__PURE__ */ __exportAll({
|
|
9
9
|
CONVERSATION_WORK_DEFER_DELAY_MS: () => CONVERSATION_WORK_DEFER_DELAY_MS,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/junior",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.240.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@earendil-works/pi-ai": "0.85.1",
|
|
62
62
|
"@hono/zod-validator": "^0.9.0",
|
|
63
63
|
"@logtape/logtape": "^2.1.1",
|
|
64
|
-
"@modelcontextprotocol/sdk": "1.
|
|
64
|
+
"@modelcontextprotocol/sdk": "1.31.0",
|
|
65
65
|
"@neondatabase/serverless": "^1.1.0",
|
|
66
66
|
"@opentelemetry/api": "1.9.1",
|
|
67
67
|
"@opentelemetry/core": "2.9.0",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"pg": "^8.16.3",
|
|
88
88
|
"yaml": "^2.9.0",
|
|
89
89
|
"zod": "^4.5.4",
|
|
90
|
-
"@sentry/junior-plugin-api": "0.
|
|
90
|
+
"@sentry/junior-plugin-api": "0.240.0"
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
|
93
93
|
"@emnapi/core": "^1.10.0",
|
|
@@ -106,9 +106,9 @@
|
|
|
106
106
|
"typescript": "^6.0.3",
|
|
107
107
|
"vercel": "^54.4.0",
|
|
108
108
|
"vitest": "^4.1.7",
|
|
109
|
-
"@sentry/junior-
|
|
109
|
+
"@sentry/junior-github": "0.240.0",
|
|
110
110
|
"@sentry/junior-testing": "0.0.0",
|
|
111
|
-
"@sentry/junior-
|
|
111
|
+
"@sentry/junior-memory": "0.240.0"
|
|
112
112
|
},
|
|
113
113
|
"scripts": {
|
|
114
114
|
"build": "tsdown",
|