@sentry/junior 0.245.0 → 0.246.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-BEbNsG87.js → admin-Bh-MYw-j.js} +1 -1
- package/dist/{agent-hooks-Caa0Qh_Q.js → agent-hooks-DpklSWZg.js} +8 -8
- package/dist/{agent-runner-BEuPFbbv.js → agent-runner-DSKpHjHW.js} +419 -160
- package/dist/api/schema.d.ts +23 -1
- package/dist/api/schema.js +2 -2
- package/dist/api.js +77 -19
- package/dist/app.js +30 -64
- package/dist/{briefs-DFAh_jTW.js → briefs-cZ5vWqP_.js} +2 -2
- package/dist/{catalog-runtime-wmq_fqff.js → catalog-runtime-CTaQXYqS.js} +1 -1
- package/dist/cli/chat.js +17 -13
- 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.js +3 -3
- package/dist/{client-Bn9SRFCi.js → client--xtsAxKP.js} +2 -2
- package/dist/{config-_XAINZMN.js → config-BK53Ip5C.js} +2 -2
- package/dist/{conversation-privacy-BN5SGxsF.js → conversation-privacy-BDBFw6Ws.js} +1 -1
- package/dist/{credential-sync-BvaUm6HQ.js → credential-sync-BiuhC9Ds.js} +14 -14
- package/dist/{executor-CFIqoCNJ.js → executor-bmmuRY-w.js} +2 -2
- package/dist/{images-Ci43I3ek.js → images-DZliDtSH.js} +2 -2
- package/dist/instrumentation.js +2 -2
- package/dist/{job-queue-CGicV7x6.js → job-queue-Cz3M7gg4.js} +1 -1
- package/dist/{logging-Bs3dV81s.js → logging-DVtMYOdD.js} +1 -1
- package/dist/message-BSN-Ma5f.js +317 -0
- package/dist/nitro.js +3 -3
- package/dist/{oauth-authorization-COzWmMjO.js → oauth-authorization-By_MVRDC.js} +1 -1
- package/dist/{oauth-callback-server-17c9_39v.js → oauth-callback-server-BrUo6w1e.js} +2 -2
- package/dist/{pending-auth-Bnhg7Q9k.js → pending-auth-BuQLZ6dK.js} +2 -2
- package/dist/{profile-BA471c-l.js → profile-BevMNSlr.js} +4 -4
- package/dist/{registry-BYNOFO6e.js → registry-C2rSEio1.js} +1 -1
- package/dist/{resolve-rpz8No2i.js → resolve-qPhrznTf.js} +2 -2
- package/dist/{runner-C8DRk9X6.js → runner-CNh5eMWx.js} +9 -9
- package/dist/{sandbox-egress-signals-B8hurjFt.js → sandbox-egress-signals-BnDEKu8d.js} +1 -1
- package/dist/{schema-WRgR9EL6.js → schema-BWMRg8JS.js} +21 -1
- package/dist/{skills-C4yrD2NR.js → skills-C6zJbudq.js} +2 -2
- package/dist/{spawn-CdAaTXrY.js → spawn-C3efZSx3.js} +2 -2
- package/dist/{task-queue-BBxHzlIB.js → task-queue-BX4vG6uA.js} +3 -3
- package/dist/{task-runner-BqFapTjs.js → task-runner-T51kll0U.js} +10 -10
- package/dist/{tasks-Ddd7OAkp.js → tasks-B9OIjl2K.js} +8 -8
- package/dist/{thread-state-DqErwbA8.js → thread-state-AGZtVyXp.js} +6 -6
- package/dist/{turn-failure-response-DtL1-fOl.js → turn-failure-response-DJ8KU2bo.js} +8 -8
- package/dist/{turn-lifecycle-B5pzyD6W.js → turn-lifecycle-DZJkJ95q.js} +1 -1
- package/dist/{turn-session-routing-D6pTU5uF.js → turn-session-routing-mRqLbMZW.js} +1 -1
- package/dist/{validation-BAzlyNIc.js → validation-Dg0Ihxzo.js} +1 -1
- package/dist/{version-CiXDH3oe.js → version-Deub4try.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-wCn8xneI.js → viewer-D5hbx6TE.js} +3 -3
- package/dist/{web-authorization-d5MtGpfG.js → web-authorization-DCxixz5S.js} +6 -6
- package/dist/{web-input-BZTiCtvP.js → web-input-0sorYVLh.js} +62 -198
- package/dist/{work-4QPqTd5_.js → work-rm2X7jj4.js} +13 -6
- package/dist/{worker-mc62tybz.js → worker-bnGsAOP3.js} +5 -5
- package/package.json +5 -5
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { d as unwrapCurrentInstruction, f as escapeXml, i as completeText, o as resolveGatewayModel } from "./client
|
|
2
|
-
import { d as logException, o as getActiveTraceId, p as logWarn, s as getLogContextAttributes, t as buildTurnFailureResponse, v as setSpanAttributes } from "./logging-
|
|
1
|
+
import { d as unwrapCurrentInstruction, f as escapeXml, i as completeText, o as resolveGatewayModel } from "./client--xtsAxKP.js";
|
|
2
|
+
import { d as logException, o as getActiveTraceId, p as logWarn, s as getLogContextAttributes, t as buildTurnFailureResponse, v as setSpanAttributes } from "./logging-DVtMYOdD.js";
|
|
3
3
|
import { n as captureMessage } from "./sentry-CgWZM_kV.js";
|
|
4
|
-
import { n as botConfig, v as normalizeSlackEmojiName } from "./config-
|
|
4
|
+
import { n as botConfig, v as normalizeSlackEmojiName } from "./config-BK53Ip5C.js";
|
|
5
5
|
import { c as toStoredSlackActor, f as parseSlackUserId, g as parseSlackMessageTs } from "./actor-BTtLaeWy.js";
|
|
6
|
-
import { c as getConversationEventStore, f as getSqlExecutor, m as withConversationEventLock, p as createSqlConversationEventStore, u as getConversationStore, v as startLocationThread, x as addAgentTurnUsage, y as bindProviderConversation } from "./viewer-
|
|
7
|
-
import { a as juniorSchedulerRuns, o as juniorSchedulerTasks, s as juniorAutomationVersions, u as juniorEventAutomations } from "./executor-
|
|
6
|
+
import { c as getConversationEventStore, f as getSqlExecutor, m as withConversationEventLock, p as createSqlConversationEventStore, u as getConversationStore, v as startLocationThread, x as addAgentTurnUsage, y as bindProviderConversation } from "./viewer-D5hbx6TE.js";
|
|
7
|
+
import { a as juniorSchedulerRuns, o as juniorSchedulerTasks, s as juniorAutomationVersions, u as juniorEventAutomations } from "./executor-bmmuRY-w.js";
|
|
8
8
|
import { d as instructionActors, f as instructionProvenanceFor, n as agentHistoryItemSchema, u as contextProvenance } from "./history-Nte1oVed.js";
|
|
9
|
-
import { p as credentialSubjectSchema } from "./registry-
|
|
10
|
-
import { Ft as SlackActionError, Ht as normalizeSlackConversationId, Jt as agentsInstructionsUpdatedEvent, Wt as withSlackRetries, Xt as authenticationUnlinkedEvent, Yt as authenticationLinkedEvent, n as applyPluginFormatMarkdown, qt as JUNIOR_NATIVE_EVENT_NAMESPACE, zt as getSlackClient } from "./agent-hooks-
|
|
9
|
+
import { p as credentialSubjectSchema } from "./registry-C2rSEio1.js";
|
|
10
|
+
import { Ft as SlackActionError, Ht as normalizeSlackConversationId, Jt as agentsInstructionsUpdatedEvent, Wt as withSlackRetries, Xt as authenticationUnlinkedEvent, Yt as authenticationLinkedEvent, n as applyPluginFormatMarkdown, qt as JUNIOR_NATIVE_EVENT_NAMESPACE, zt as getSlackClient } from "./agent-hooks-DpklSWZg.js";
|
|
11
11
|
import { U as messageCardRef } from "./conversation-CvBG57Io.js";
|
|
12
|
-
import { D as fenceLock, O as withLock, T as MUTATION_LOCK_TTL_MS, k as sleep, w as getStateAdapter } from "./profile-
|
|
12
|
+
import { D as fenceLock, O as withLock, T as MUTATION_LOCK_TTL_MS, k as sleep, w as getStateAdapter } from "./profile-BevMNSlr.js";
|
|
13
13
|
import { A as eventAutomationSchema, D as scheduledRunSchema, E as scheduledAutomationSchema, S as automationVersionSchema } from "./automation-gznOMaQ2.js";
|
|
14
14
|
import { isDeepStrictEqual } from "node:util";
|
|
15
15
|
import { z } from "zod";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { I as isRecord, L as toOptionalNumber, R as toOptionalString } from "./logging-
|
|
2
|
-
import { d as getDb } from "./viewer-
|
|
1
|
+
import { I as isRecord, L as toOptionalNumber, R as toOptionalString } from "./logging-DVtMYOdD.js";
|
|
2
|
+
import { d as getDb } from "./viewer-D5hbx6TE.js";
|
|
3
3
|
import { d as juniorDestinations } from "./agent-invocations-BO6ddZax.js";
|
|
4
|
-
import { d as juniorLocationConfigurations } from "./executor-
|
|
5
|
-
import { Ut as persistConversationMessages } from "./tasks-
|
|
6
|
-
import { tt as JUNIOR_THREAD_STATE_TTL_MS } from "./agent-hooks-
|
|
7
|
-
import { w as getStateAdapter } from "./profile-
|
|
4
|
+
import { d as juniorLocationConfigurations } from "./executor-bmmuRY-w.js";
|
|
5
|
+
import { Ut as persistConversationMessages } from "./tasks-B9OIjl2K.js";
|
|
6
|
+
import { tt as JUNIOR_THREAD_STATE_TTL_MS } from "./agent-hooks-DpklSWZg.js";
|
|
7
|
+
import { w as getStateAdapter } from "./profile-BevMNSlr.js";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
import { randomUUID } from "node:crypto";
|
|
10
10
|
import { and, eq, sql } from "drizzle-orm";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { _ as getProviderErrorUserMessage, g as getProviderErrorAttributes, h as findProviderError, p as ProviderError } from "./client
|
|
2
|
-
import { I as isRecord, t as buildTurnFailureResponse } from "./logging-
|
|
1
|
+
import { _ as getProviderErrorUserMessage, g as getProviderErrorAttributes, h as findProviderError, p as ProviderError } from "./client--xtsAxKP.js";
|
|
2
|
+
import { I as isRecord, t as buildTurnFailureResponse } from "./logging-DVtMYOdD.js";
|
|
3
3
|
import { g as parseSlackMessageTs } from "./actor-BTtLaeWy.js";
|
|
4
|
-
import { c as getConversationEventStore, d as getDb } from "./viewer-
|
|
5
|
-
import { Ht as hydrateConversationMessages, nn as markConversationMessage } from "./tasks-
|
|
6
|
-
import { At as listConversationAnnotations } from "./agent-hooks-
|
|
4
|
+
import { c as getConversationEventStore, d as getDb } from "./viewer-D5hbx6TE.js";
|
|
5
|
+
import { Ht as hydrateConversationMessages, nn as markConversationMessage } from "./tasks-B9OIjl2K.js";
|
|
6
|
+
import { At as listConversationAnnotations } from "./agent-hooks-DpklSWZg.js";
|
|
7
7
|
import { G as readMessageCardRefs, K as removedCardSchema, q as resolveMessageCards } from "./conversation-CvBG57Io.js";
|
|
8
|
-
import { r as clearPendingAuth, u as buildDeterministicTurnId } from "./pending-auth-
|
|
9
|
-
import { g as markTurnCompleted, h as markTurnClosed } from "./oauth-authorization-
|
|
10
|
-
import { o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-
|
|
8
|
+
import { r as clearPendingAuth, u as buildDeterministicTurnId } from "./pending-auth-BuQLZ6dK.js";
|
|
9
|
+
import { g as markTurnCompleted, h as markTurnClosed } from "./oauth-authorization-By_MVRDC.js";
|
|
10
|
+
import { o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-AGZtVyXp.js";
|
|
11
11
|
//#region src/chat/conversations/pending-cards.ts
|
|
12
12
|
/** Select undelivered cards and load their latest saved facts. */
|
|
13
13
|
async function loadPendingMessageCards(conversationId) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as getConversationEventStore } from "./viewer-
|
|
1
|
+
import { c as getConversationEventStore } from "./viewer-D5hbx6TE.js";
|
|
2
2
|
//#region src/chat/conversations/turn-lifecycle.ts
|
|
3
3
|
/** Persist correlated turn lifecycle facts with retry-safe terminal exclusion. */
|
|
4
4
|
var ConversationTurnLifecycleService = class {
|
|
@@ -34,7 +34,7 @@ function slackSourceForDestination(args) {
|
|
|
34
34
|
* Reads parent Conversations when this Conversation has no Destination.
|
|
35
35
|
*/
|
|
36
36
|
async function resolveConversationRouting(args) {
|
|
37
|
-
const conversationStore = args.conversationStore ?? (await import("./viewer-
|
|
37
|
+
const conversationStore = args.conversationStore ?? (await import("./viewer-D5hbx6TE.js").then((n) => n.s)).getConversationStore();
|
|
38
38
|
const chain = await loadConversationChain(args.conversationId, conversationStore);
|
|
39
39
|
let destination;
|
|
40
40
|
let source;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
2
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-CTaQXYqS.js";
|
|
3
3
|
import { isDeepStrictEqual } from "node:util";
|
|
4
4
|
//#region src/chat/plugins/validation.ts
|
|
5
5
|
var validation_exports = /* @__PURE__ */ __exportAll({
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as JUNIOR_VERSION } from "./version-
|
|
1
|
+
import { t as JUNIOR_VERSION } from "./version-Deub4try.js";
|
|
2
2
|
export { JUNIOR_VERSION };
|
|
@@ -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-DVtMYOdD.js";
|
|
3
|
+
import { i as getChatConfig } from "./config-BK53Ip5C.js";
|
|
4
4
|
import { d as parseSlackTeamId, o as parseActorUserId, u as parseSlackChannelReferenceId } from "./actor-BTtLaeWy.js";
|
|
5
5
|
import { c as juniorIdentities, d as juniorDestinations, l as juniorUsers, o as conversationReadColumns, s as juniorConversations } from "./agent-invocations-BO6ddZax.js";
|
|
6
|
-
import { _ as juniorConversationEvents, f as juniorConversationParticipants, g as juniorConversationMetrics, h as CONVERSATION_METRICS, p as juniorConversationBindings, t as createJuniorSqlExecutor, y as juniorConversationAnnotations } from "./executor-
|
|
6
|
+
import { _ as juniorConversationEvents, f as juniorConversationParticipants, g as juniorConversationMetrics, h as CONVERSATION_METRICS, p as juniorConversationBindings, t as createJuniorSqlExecutor, y as juniorConversationAnnotations } from "./executor-bmmuRY-w.js";
|
|
7
7
|
import { c as newConversationEventSchema, l as encodeHistoryPayload, m as usageSchema, o as decodeStoredConversationEvent, r as conversationEventDataSchema, s as historyReplacementSchema } from "./history-Nte1oVed.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";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as getConversationEventStore } from "./viewer-
|
|
3
|
-
import { Q as getTurnRecord, Z as failTurnRecord, q as loadTurnCheckpoint } from "./tasks-
|
|
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 { Vt as ensureConversationWake, Zt as requestConversationWork } from "./agent-runner-DSKpHjHW.js";
|
|
2
|
+
import { c as getConversationEventStore } from "./viewer-D5hbx6TE.js";
|
|
3
|
+
import { Q as getTurnRecord, Z as failTurnRecord, q as loadTurnCheckpoint } from "./tasks-B9OIjl2K.js";
|
|
4
|
+
import { w as getStateAdapter } from "./profile-BevMNSlr.js";
|
|
5
|
+
import { a as getVercelConversationWorkQueue } from "./job-queue-Cz3M7gg4.js";
|
|
6
|
+
import { n as resolveTurnSessionRouting } from "./turn-session-routing-mRqLbMZW.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,35 @@
|
|
|
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 { $t as stopConversationWork, A as resolveSlackChannelIdFromMessage, An as finishedRunReply, At as appendAndEnqueueInboundMessage, B as effectiveTaskOutcomes, C as renderBlockText, Cn as buildSteeringPiMessage, D as storeAttachment, Dn as AuthorizationFlowDisabledError, Et as automationEventCatalog, Ht as getConversation, M as getConversationInfo, Mn as shouldEmitDevAgentTrace, N as listThreadReplies, O as parseSlackThreadId, S as renderAttachmentText, Sn as createUserTokenStore, St as getEventCatalog, Ut as getConversationWorkState, Vt as ensureConversationWake, Zt as requestConversationWork, a as buildAuthPauseResponse, bt as isEventMailboxMetadata, cn as recordFinishedTurnForAutomatedLimit, h as latestProgressStatus, j as resolveSlackChannelIdFromThreadId, jn as runDispatchOutcome, k as readSlackRawMessageContext, kn as deliversFinalText, kt as appendAndEnqueueExclusiveInboundMessage, m as PluginCredentialFailureError, n as executeAgentRun, r as createContextCompactor, sn as maybePostAutomatedTurnLimitNotice, t as createAgentRunner, wn as RetryableDeliveryError, xt as timerWatchCredentialSubject, yt as EVENT_WAIT_MS, z as eventAutomationTriggerAvailable } from "./agent-runner-DSKpHjHW.js";
|
|
2
|
+
import { f as escapeXml, i as completeText, r as completeObject, v as isProviderRetryError } from "./client--xtsAxKP.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-DVtMYOdD.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-BK53Ip5C.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 { M as createSlackDestination, P as requireSlackDestination, c as getConversationEventStore, d as getDb, f as getSqlExecutor, u as getConversationStore } from "./viewer-
|
|
7
|
+
import { M as createSlackDestination, P as requireSlackDestination, c as getConversationEventStore, d as getDb, f as getSqlExecutor, u as getConversationStore } from "./viewer-D5hbx6TE.js";
|
|
8
8
|
import { c as juniorIdentities, d as juniorDestinations, l as juniorUsers } from "./agent-invocations-BO6ddZax.js";
|
|
9
|
-
import { c as juniorAutomationExecutions, o as juniorSchedulerTasks, u as juniorEventAutomations } from "./executor-
|
|
9
|
+
import { c as juniorAutomationExecutions, o as juniorSchedulerTasks, u as juniorEventAutomations } from "./executor-bmmuRY-w.js";
|
|
10
10
|
import { f as instructionProvenanceFor } from "./history-Nte1oVed.js";
|
|
11
|
-
import { d as credentialContextForActor } from "./registry-
|
|
12
|
-
import { $ as listTurnSummaries, $t as estimateConversationContextTokens, Ct as commitMessages, D as sameDefinitionValue, Dt as loadProjection, Gt as persistConversationMessageSummaries, H as removeReactionFromMessage, Ht as hydrateConversationMessages, I as truncateStatusText, J as saveTurnCheckpoint, Jt as fallbackShortTitle, Kt as resolveConversationTitle, L as addReactionToMessage, M as formatSlackLink, N as normalizeSlackReplyMarkdown, P as normalizeSlackStatusText, Pt as recordAuthorizationCompleted, Q as getTurnRecord, Qt as createConversationMemoryService, Rt as recordSubscribedReplyRoute, St as commitAcceptedReply, T as listAutomationVersions, Tt as loadConversationProjection, Ut as persistConversationMessages, V as postSlackMessage, X as completeTurnRecord, Xt as appendThreadContextMessages, Y as abandonTurnRecord, Z as failTurnRecord, Zt as buildConversationContext, _ as listDeletedEventAutomationsCreatedBy, a as readScheduledAutomation, an as turnHasReply, en as getConversationMessageSlackTs, et as recordTurnSummary, g as getEventAutomation, i as parseScheduledAutomationRow, in as recordDeliveredAssistantMessage, it as buildTurnErrorResponse, j as escapeSlackMrkdwnText, l as withScheduledAutomationLock, m as eventAutomationBelongsToUser, nn as markConversationMessage, on as upsertConversationMessage, p as deleteEventAutomation, q as loadTurnCheckpoint, rn as normalizeConversationText, s as saveScheduledAutomationInLock, tn as isHumanConversationMessage, tt as persistWithRetry, w as automationDefinition, y as parseEventAutomationRow, yt as trimTrailingAssistantMessages } from "./tasks-
|
|
13
|
-
import { Ct as getSlackFileId, Et as recordSlackAttachment, Ft as SlackActionError, Ht as normalizeSlackConversationId, It as downloadPrivateSlackFile, Pt as lookupSlackUser, Rt as getHeaderString, St as buildSentryConversationUrl, Tt as readAttachmentVisionSummary, Ut as runWithSlackInstallationToken, Vt as isDmChannel, et as verifyTimerWatchCredentialSubject, nt as getDashboardConversationLink, o as getPluginSlackConversationLink, rt as getDashboardObjectIconLink, tt as JUNIOR_THREAD_STATE_TTL_MS, z as cancelSubscriptions, zt as getSlackClient } from "./agent-hooks-
|
|
11
|
+
import { d as credentialContextForActor } from "./registry-C2rSEio1.js";
|
|
12
|
+
import { $ as listTurnSummaries, $t as estimateConversationContextTokens, Ct as commitMessages, D as sameDefinitionValue, Dt as loadProjection, Gt as persistConversationMessageSummaries, H as removeReactionFromMessage, Ht as hydrateConversationMessages, I as truncateStatusText, J as saveTurnCheckpoint, Jt as fallbackShortTitle, Kt as resolveConversationTitle, L as addReactionToMessage, M as formatSlackLink, N as normalizeSlackReplyMarkdown, P as normalizeSlackStatusText, Pt as recordAuthorizationCompleted, Q as getTurnRecord, Qt as createConversationMemoryService, Rt as recordSubscribedReplyRoute, St as commitAcceptedReply, T as listAutomationVersions, Tt as loadConversationProjection, Ut as persistConversationMessages, V as postSlackMessage, X as completeTurnRecord, Xt as appendThreadContextMessages, Y as abandonTurnRecord, Z as failTurnRecord, Zt as buildConversationContext, _ as listDeletedEventAutomationsCreatedBy, a as readScheduledAutomation, an as turnHasReply, en as getConversationMessageSlackTs, et as recordTurnSummary, g as getEventAutomation, i as parseScheduledAutomationRow, in as recordDeliveredAssistantMessage, it as buildTurnErrorResponse, j as escapeSlackMrkdwnText, l as withScheduledAutomationLock, m as eventAutomationBelongsToUser, nn as markConversationMessage, on as upsertConversationMessage, p as deleteEventAutomation, q as loadTurnCheckpoint, rn as normalizeConversationText, s as saveScheduledAutomationInLock, tn as isHumanConversationMessage, tt as persistWithRetry, w as automationDefinition, y as parseEventAutomationRow, yt as trimTrailingAssistantMessages } from "./tasks-B9OIjl2K.js";
|
|
13
|
+
import { Ct as getSlackFileId, Et as recordSlackAttachment, Ft as SlackActionError, Ht as normalizeSlackConversationId, It as downloadPrivateSlackFile, Pt as lookupSlackUser, Rt as getHeaderString, St as buildSentryConversationUrl, Tt as readAttachmentVisionSummary, Ut as runWithSlackInstallationToken, Vt as isDmChannel, et as verifyTimerWatchCredentialSubject, nt as getDashboardConversationLink, o as getPluginSlackConversationLink, rt as getDashboardObjectIconLink, tt as JUNIOR_THREAD_STATE_TTL_MS, z as cancelSubscriptions, zt as getSlackClient } from "./agent-hooks-DpklSWZg.js";
|
|
14
14
|
import { I as isVisionImageMediaType, P as readMessageAttachments } from "./conversation-CvBG57Io.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-BevMNSlr.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-BuQLZ6dK.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-By_MVRDC.js";
|
|
18
18
|
import { a as EVENT_SYSTEM_ACTOR, i as EVENT_MESSAGE_AUTHOR, o as isEventConversationMessage } from "./prompt-C9Q9cjD3.js";
|
|
19
|
-
import { a as getVercelConversationWorkQueue, f as getTurnRequestDeadline } from "./job-queue-
|
|
19
|
+
import { a as getVercelConversationWorkQueue, f as getTurnRequestDeadline } from "./job-queue-Cz3M7gg4.js";
|
|
20
20
|
import { l as automationListQuerySchema } from "./automation-gznOMaQ2.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 readAutomationExecutionHours, D as readAutomationExecutions, E as readAutomationExecutionSummaries, O as readAutomationRuns, S as readAutomationExecutionDays, T as readAutomationExecutionStatusHours, _ as markDispatchFailed, a as confirmDispatchMailboxAppend, b as emptyAutomationRunWindows, 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 readAutomationExecutionStatusDays, x as readAutomationExecutionByConversationId } from "./task-runner-
|
|
24
|
-
import { n as getTurnLifecycle, t as ConversationTurnLifecycleService } from "./turn-lifecycle-
|
|
25
|
-
import { i as resolveAgentInvocationId, o as AgentRunError,
|
|
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
|
|
28
|
-
import { n as
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import { r as
|
|
23
|
+
import { C as readAutomationExecutionHours, D as readAutomationExecutions, E as readAutomationExecutionSummaries, O as readAutomationRuns, S as readAutomationExecutionDays, T as readAutomationExecutionStatusHours, _ as markDispatchFailed, a as confirmDispatchMailboxAppend, b as emptyAutomationRunWindows, 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 readAutomationExecutionStatusDays, x as readAutomationExecutionByConversationId } from "./task-runner-T51kll0U.js";
|
|
24
|
+
import { n as getTurnLifecycle, t as ConversationTurnLifecycleService } from "./turn-lifecycle-DZJkJ95q.js";
|
|
25
|
+
import { i as resolveAgentInvocationId, o as AgentRunError, s as executeTurn, t as createAgentInvocationWorker } from "./work-rm2X7jj4.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-AGZtVyXp.js";
|
|
27
|
+
import { a as withAgentInvocationResultActors, i as startAgentInvocationsForChildResults, r as enqueueAgentInvocationResult, t as bindMessageAgent } from "./message-BSN-Ma5f.js";
|
|
28
|
+
import { a as getPausedTurnRequest, c as getTurnAuthorization, i as createPausedTurns, n as deleteWebAuthorization, s as wakePausedTurn, t as createWebAuthorization } from "./web-authorization-DCxixz5S.js";
|
|
29
|
+
import { n as resolveTurnSessionRouting } from "./turn-session-routing-mRqLbMZW.js";
|
|
30
|
+
import { t as bindSpawnAgent } from "./spawn-C3efZSx3.js";
|
|
31
|
+
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-DJ8KU2bo.js";
|
|
32
|
+
import { r as storeInputImages } from "./images-DZliDtSH.js";
|
|
32
33
|
import { z } from "zod";
|
|
33
34
|
import { createHash } from "node:crypto";
|
|
34
35
|
import { and, asc, count, desc, eq, exists, inArray, ne, or, sql } from "drizzle-orm";
|
|
@@ -303,181 +304,6 @@ function createAgentDispatchConversationWorker(options) {
|
|
|
303
304
|
};
|
|
304
305
|
}
|
|
305
306
|
//#endregion
|
|
306
|
-
//#region src/chat/agent-invocations/result.ts
|
|
307
|
-
const AGENT_INVOCATION_EVENT_NAMESPACE = "junior";
|
|
308
|
-
const AGENT_INVOCATION_EVENT_TYPE_PREFIX = "agent_invocation.";
|
|
309
|
-
const AGENT_INVOCATION_RESULT_MAX_LENGTH = 12e3;
|
|
310
|
-
/**
|
|
311
|
-
* Return the Inbound message author id for results sent by one Actor.
|
|
312
|
-
* `selectContiguousTurnBatch` in `task-execution/worker.ts` puts messages in
|
|
313
|
-
* one attempt only when their author ids and sources match. Mid-Turn drains
|
|
314
|
-
* take only `interrupt` messages, and results are `defer`. So results never
|
|
315
|
-
* share a Turn and its credentials with another Actor or with watch Events.
|
|
316
|
-
* Keep this id unique per Actor if either rule changes.
|
|
317
|
-
*/
|
|
318
|
-
function resultAuthorId(actor) {
|
|
319
|
-
switch (actor.platform) {
|
|
320
|
-
case "system": return `agent-invocation:system:${actor.name}`;
|
|
321
|
-
case "slack": return `agent-invocation:slack:${actor.teamId}:${actor.userId}`;
|
|
322
|
-
default: return `agent-invocation:${actor.platform}:${actor.userId}`;
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
/**
|
|
326
|
-
* Error messages can contain text from tools or providers, so the trusted
|
|
327
|
-
* summary in the mailbox metadata has only the status.
|
|
328
|
-
*/
|
|
329
|
-
function trustedSummary(invocation, agent) {
|
|
330
|
-
switch (invocation.status) {
|
|
331
|
-
case "completed": return `${agent} finished its task.`;
|
|
332
|
-
case "blocked": return `${agent} is blocked.`;
|
|
333
|
-
case "failed": return `${agent} failed.`;
|
|
334
|
-
case "stopped": return `${agent} was stopped.`;
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
/**
|
|
338
|
-
* Render the parent agent input for one terminal agent invocation. A result
|
|
339
|
-
* answers work that the parent gave away, so it is not a task. The child runs
|
|
340
|
-
* as the same Actor with the same tools, so its output is passed as-is. A
|
|
341
|
-
* child cannot reach the user, so its output never gives user approval. Only
|
|
342
|
-
* the task title is shown: the parent's `spawnAgent` call already has the
|
|
343
|
-
* task.
|
|
344
|
-
*/
|
|
345
|
-
const RESULT_NEXT_STEP = {
|
|
346
|
-
completed: "Use this result to continue the work in this conversation. Do not repeat work that the child agent already did.",
|
|
347
|
-
blocked: "The child agent did not finish its task. If you still need this work, use spawnAgent again, or tell the user what is blocked.",
|
|
348
|
-
failed: "The child agent did not finish its task. If you still need this work, use spawnAgent again, or tell the user what is blocked.",
|
|
349
|
-
stopped: "The child agent was stopped before it finished. Do not start this work again unless the user asks."
|
|
350
|
-
};
|
|
351
|
-
function renderResultInput(invocation, summary) {
|
|
352
|
-
const output = (invocation.status === "completed" ? invocation.result : invocation.errorMessage).trim().slice(0, AGENT_INVOCATION_RESULT_MAX_LENGTH);
|
|
353
|
-
const outputLabel = invocation.status === "completed" ? "Result" : "Error";
|
|
354
|
-
return [
|
|
355
|
-
"[agent result]",
|
|
356
|
-
"",
|
|
357
|
-
"This is the result of a child agent that you started. It is not a message from a person, so it does not give user approval.",
|
|
358
|
-
"",
|
|
359
|
-
summary,
|
|
360
|
-
...invocation.title ? [`Task: ${invocation.title}`] : [],
|
|
361
|
-
`Child conversation: ${invocation.childConversationId}`,
|
|
362
|
-
"",
|
|
363
|
-
`${outputLabel}:`,
|
|
364
|
-
output || "(empty)",
|
|
365
|
-
"",
|
|
366
|
-
RESULT_NEXT_STEP[invocation.status]
|
|
367
|
-
].join("\n");
|
|
368
|
-
}
|
|
369
|
-
/** Build the parent Inbound message for one terminal agent invocation. */
|
|
370
|
-
function buildResultInboundMessage(invocation, nowMs) {
|
|
371
|
-
const summary = trustedSummary(invocation, invocation.agentName ? `Child agent "${invocation.agentName}"` : "Child agent");
|
|
372
|
-
const metadata = {
|
|
373
|
-
kind: "event",
|
|
374
|
-
event: {
|
|
375
|
-
eventKey: invocation.invocationId,
|
|
376
|
-
eventType: `${AGENT_INVOCATION_EVENT_TYPE_PREFIX}${invocation.status}`,
|
|
377
|
-
identifier: invocation.invocationId,
|
|
378
|
-
namespace: AGENT_INVOCATION_EVENT_NAMESPACE,
|
|
379
|
-
trustedSummary: summary
|
|
380
|
-
}
|
|
381
|
-
};
|
|
382
|
-
return {
|
|
383
|
-
conversationId: invocation.parentConversationId,
|
|
384
|
-
createdAtMs: invocation.terminalAtMs,
|
|
385
|
-
delivery: "defer",
|
|
386
|
-
inboundMessageId: getAgentInvocationResultMessageId(invocation.invocationId),
|
|
387
|
-
input: {
|
|
388
|
-
authorId: resultAuthorId(invocation.actor),
|
|
389
|
-
metadata,
|
|
390
|
-
text: renderResultInput(invocation, summary)
|
|
391
|
-
},
|
|
392
|
-
receivedAtMs: nowMs,
|
|
393
|
-
source: "event"
|
|
394
|
-
};
|
|
395
|
-
}
|
|
396
|
-
/**
|
|
397
|
-
* Append one terminal agent invocation result to the parent mailbox and wake
|
|
398
|
-
* the parent. Repeat calls are safe.
|
|
399
|
-
*
|
|
400
|
-
* Results do not go through `admitAutomatedTurn`, so the automated-turn limit
|
|
401
|
-
* never drops them. Result Turns still count toward that limit.
|
|
402
|
-
* TODO(dcramer): Add a per-parent total invocation limit as the loop guard
|
|
403
|
-
* for spawn -> result -> spawn chains (#881).
|
|
404
|
-
*/
|
|
405
|
-
async function enqueueAgentInvocationResult(invocation, options) {
|
|
406
|
-
if (invocation.parentMailboxStatus !== "pending") return;
|
|
407
|
-
const nowMs = options.nowMs ?? Date.now();
|
|
408
|
-
await appendAndEnqueueInboundMessage({
|
|
409
|
-
message: buildResultInboundMessage(invocation, nowMs),
|
|
410
|
-
queue: options.queue,
|
|
411
|
-
queueDelayMs: EVENT_WAIT_MS,
|
|
412
|
-
state: options.state
|
|
413
|
-
});
|
|
414
|
-
await markAgentInvocationParentMailboxAppended(invocation.invocationId, nowMs);
|
|
415
|
-
}
|
|
416
|
-
function resultInvocationId(message) {
|
|
417
|
-
const metadata = message.input.metadata;
|
|
418
|
-
return isEventMailboxMetadata(metadata) && metadata.event.namespace === AGENT_INVOCATION_EVENT_NAMESPACE && metadata.event.eventType.startsWith(AGENT_INVOCATION_EVENT_TYPE_PREFIX) ? metadata.event.identifier : void 0;
|
|
419
|
-
}
|
|
420
|
-
/** Read one result message's agent invocation and check its parent. */
|
|
421
|
-
async function getResultInvocation(message, invocationId) {
|
|
422
|
-
const invocation = await getAgentInvocation(invocationId);
|
|
423
|
-
if (!invocation || !isTerminalAgentInvocation(invocation) || invocation.parentConversationId !== message.conversationId) throw new Error(`Agent invocation result ${invocationId} does not belong to ${message.conversationId}`);
|
|
424
|
-
return invocation;
|
|
425
|
-
}
|
|
426
|
-
/**
|
|
427
|
-
* Give agent invocation results that reach a child Conversation to that
|
|
428
|
-
* child. A child Conversation has no Location, so it cannot run an Event
|
|
429
|
-
* Turn. Each result starts a new agent invocation on the child instead, and
|
|
430
|
-
* that invocation reports to the child's parent. Returns undefined for work
|
|
431
|
-
* that is not a result for a child Conversation.
|
|
432
|
-
*/
|
|
433
|
-
async function startAgentInvocationsForChildResults(context, options) {
|
|
434
|
-
const messages = context.attempt.messages;
|
|
435
|
-
const invocationIds = messages.map(resultInvocationId);
|
|
436
|
-
if (messages.length === 0 || invocationIds.some((id) => !id)) return;
|
|
437
|
-
const latest = await getLatestAgentInvocationForConversation(context.conversationId);
|
|
438
|
-
if (!latest) return;
|
|
439
|
-
if (latest.status === "stopped") {
|
|
440
|
-
await context.attempt.ack();
|
|
441
|
-
return { status: "completed" };
|
|
442
|
-
}
|
|
443
|
-
for (const [index, message] of messages.entries()) {
|
|
444
|
-
const result = await getResultInvocation(message, invocationIds[index]);
|
|
445
|
-
if (result.parentMailboxStatus === "skipped") continue;
|
|
446
|
-
const invocation = await createAgentInvocationForResult({
|
|
447
|
-
input: message.input.text.trim(),
|
|
448
|
-
latest,
|
|
449
|
-
resultInvocationId: result.invocationId
|
|
450
|
-
});
|
|
451
|
-
await enqueueAgentInvocation(invocation, options);
|
|
452
|
-
}
|
|
453
|
-
await context.attempt.ack();
|
|
454
|
-
return { status: "completed" };
|
|
455
|
-
}
|
|
456
|
-
/**
|
|
457
|
-
* Run each agent invocation result as the Actor that triggered the child, user
|
|
458
|
-
* or system. This is on purpose: the result continues that Actor's work. The
|
|
459
|
-
* Actor comes from SQL, not from mailbox metadata, so the parent Turn has the
|
|
460
|
-
* same authority it had at spawn time.
|
|
461
|
-
*
|
|
462
|
-
* TODO(dcramer): Pass the delegated credential subject of a system Actor, such
|
|
463
|
-
* as a timer watch Turn, when system Turns can spawn children that need it.
|
|
464
|
-
*/
|
|
465
|
-
async function withAgentInvocationResultActors(work) {
|
|
466
|
-
if (work.kind !== "mailbox") return work;
|
|
467
|
-
return {
|
|
468
|
-
kind: "mailbox",
|
|
469
|
-
batch: await Promise.all(work.batch.map(async (entry) => {
|
|
470
|
-
const invocationId = resultInvocationId(entry.message);
|
|
471
|
-
if (!invocationId) return entry;
|
|
472
|
-
const invocation = await getResultInvocation(entry.message, invocationId);
|
|
473
|
-
return {
|
|
474
|
-
...entry,
|
|
475
|
-
actor: invocation.actor
|
|
476
|
-
};
|
|
477
|
-
}))
|
|
478
|
-
};
|
|
479
|
-
}
|
|
480
|
-
//#endregion
|
|
481
307
|
//#region src/chat/attachments/vercel.ts
|
|
482
308
|
/** Store private conversation attachments in Vercel Blob. */
|
|
483
309
|
function createVercelAttachmentStorage() {
|
|
@@ -1881,6 +1707,43 @@ async function resolveMailboxTurnWork(context) {
|
|
|
1881
1707
|
} : void 0;
|
|
1882
1708
|
}
|
|
1883
1709
|
//#endregion
|
|
1710
|
+
//#region src/chat/conversations/stop.ts
|
|
1711
|
+
/** Stop the current Conversation Turn and wake an idle resume when needed. */
|
|
1712
|
+
async function stopConversationTurn(args) {
|
|
1713
|
+
const nowMs = args.nowMs ?? Date.now();
|
|
1714
|
+
const stop = async () => await stopConversationWork({
|
|
1715
|
+
conversationId: args.conversationId,
|
|
1716
|
+
conversationStore: args.conversationStore,
|
|
1717
|
+
nowMs,
|
|
1718
|
+
state: args.state
|
|
1719
|
+
});
|
|
1720
|
+
let result = await stop();
|
|
1721
|
+
if (result.status === "no_work" && await getAuthPausedConversationTurnId(args.conversationId)) {
|
|
1722
|
+
const conversation = await getConversation({
|
|
1723
|
+
conversationId: args.conversationId,
|
|
1724
|
+
state: args.state
|
|
1725
|
+
});
|
|
1726
|
+
await requestConversationWork({
|
|
1727
|
+
conversationId: args.conversationId,
|
|
1728
|
+
conversationStore: args.conversationStore,
|
|
1729
|
+
destination: conversation?.destination,
|
|
1730
|
+
nowMs,
|
|
1731
|
+
state: args.state
|
|
1732
|
+
});
|
|
1733
|
+
result = await stop();
|
|
1734
|
+
}
|
|
1735
|
+
if (result.status === "requested") await ensureConversationWake({
|
|
1736
|
+
conversationId: args.conversationId,
|
|
1737
|
+
conversationStore: args.conversationStore,
|
|
1738
|
+
idempotencyKey: `conversation-stop:${args.conversationId}:${result.runId}`,
|
|
1739
|
+
nowMs,
|
|
1740
|
+
queue: args.queue,
|
|
1741
|
+
replaceExistingWake: true,
|
|
1742
|
+
state: args.state
|
|
1743
|
+
});
|
|
1744
|
+
return result;
|
|
1745
|
+
}
|
|
1746
|
+
//#endregion
|
|
1884
1747
|
//#region src/chat/ingress/message-router.ts
|
|
1885
1748
|
/** Derive canonical Slack thread IDs from the raw event payload. */
|
|
1886
1749
|
/** Rebuild a Message onto a normalized Slack thread id. */
|
|
@@ -3690,6 +3553,7 @@ function createJuniorRuntimeServices(overrides = {}) {
|
|
|
3690
3553
|
downloadFile: overrides.visionContext?.downloadFile ?? downloadPrivateSlackFile
|
|
3691
3554
|
});
|
|
3692
3555
|
const agentRunner = overrides.agentRunner ?? createAgentRunner(executeAgentRun, {
|
|
3556
|
+
bindMessageAgent: (request) => bindMessageAgent(request, { queue: getVercelConversationWorkQueue }),
|
|
3693
3557
|
bindSpawnAgent: (request) => bindSpawnAgent(request, { queue: getVercelConversationWorkQueue }),
|
|
3694
3558
|
tracePropagation: overrides.sandbox?.tracePropagation
|
|
3695
3559
|
});
|
|
@@ -7685,4 +7549,4 @@ async function appendAndEnqueueWebMessage(input, options) {
|
|
|
7685
7549
|
};
|
|
7686
7550
|
}
|
|
7687
7551
|
//#endregion
|
|
7688
|
-
export { withNormalizedThreadId as A, enqueueAgentDispatch as B, buildSlackInboundMessage as C, isSlackMessageStopped as D, verifySlackSignature as E,
|
|
7552
|
+
export { withNormalizedThreadId as A, enqueueAgentDispatch as B, buildSlackInboundMessage as C, isSlackMessageStopped as D, verifySlackSignature as E, startProcessingReaction as F, readHealthReport as H, parseContent as I, renderSlackObjectCard as L, getAuthPausedConversationTurnId as M, legacyWebMailboxMetadataSchema as N, stopSlackThread as O, THREAD_OPTOUT_ACK as P, createVercelAttachmentStorage as R, recordSkippedConversationMessage as S, runWithSlackInstallation as T, GET as V, readViewerAutomationRuns as _, recordWebConversationActivity as a, readViewerAutomations as b, createProductionSlackWebhookServices as c, resolveSlackConversationContextFromThreadId as d, createSlackWebApiStatusSender as f, readViewerAutomationExecutions as g, readConversationSourceTask as h, createConversationId as i, stopConversationTurn as j, normalizeIncomingSlackThreadId as k, getProductionSlackAdapter as l, deleteViewerTask as m, conversationTurnIdForMessage as n, webActorFromEmail as o, ViewerTaskNotFoundError as p, createAndEnqueueConversation as r, createProductionConversationWorkOptions as s, appendAndEnqueueWebMessage as t, formatSlackConversationRedactedLabel as u, readViewerAutomationSummary as v, clearSlackPendingReactions as w, resolveViewerTaskCandidate as x, readViewerAutomationVersions as y, AGENT_DISPATCH_MAX_AGE_MS as z };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import {
|
|
3
|
-
import { c as getConversationEventStore, u as getConversationStore } from "./viewer-
|
|
4
|
-
import { At as openConversationProjection, J as saveTurnCheckpoint, Q as getTurnRecord, Y as abandonTurnRecord, Z as failTurnRecord, ct as getTerminalAssistantMessages } from "./tasks-
|
|
5
|
-
import { d as getConversationTurnBoundaryError, l as TurnInputCommitLostError, p as isTurnInputCommitLostError, r as getAssistantReplyText } from "./oauth-authorization-
|
|
6
|
-
import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-
|
|
7
|
-
import { n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState } from "./thread-state-
|
|
2
|
+
import { At as appendAndEnqueueInboundMessage, Dn as AuthorizationFlowDisabledError, H as stopChildAgentsOf, K as completeAgentInvocation, On as readBlockedReport, Q as getAgentInvocation, U as recordSubagentEnded, W as recordSubagentStarted, Z as getActiveAgentInvocationForConversation, at as getLatestAgentInvocationForConversation, dt as markAgentInvocationPaused, ft as markAgentInvocationRunning, lt as markAgentInvocationMailboxAppended, m as PluginCredentialFailureError, ot as isTerminalAgentInvocation, pt as reportReplacedAgentInvocation, q as createAgentInvocation, rt as getAgentInvocationTurnId, tt as getAgentInvocationMessageId } from "./agent-runner-DSKpHjHW.js";
|
|
3
|
+
import { c as getConversationEventStore, u as getConversationStore } from "./viewer-D5hbx6TE.js";
|
|
4
|
+
import { At as openConversationProjection, J as saveTurnCheckpoint, Q as getTurnRecord, Y as abandonTurnRecord, Z as failTurnRecord, ct as getTerminalAssistantMessages } from "./tasks-B9OIjl2K.js";
|
|
5
|
+
import { d as getConversationTurnBoundaryError, l as TurnInputCommitLostError, p as isTurnInputCommitLostError, r as getAssistantReplyText } from "./oauth-authorization-By_MVRDC.js";
|
|
6
|
+
import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-DZJkJ95q.js";
|
|
7
|
+
import { n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState } from "./thread-state-AGZtVyXp.js";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
//#region src/chat/runtime/turn-execution.ts
|
|
10
10
|
/** An error thrown while the agent advances a Run. */
|
|
@@ -166,11 +166,15 @@ async function projectTerminalTurn(invocation) {
|
|
|
166
166
|
if (turn.state === "paused") return;
|
|
167
167
|
const result = getTerminalAssistantMessages(turn.piMessages).map(getAssistantReplyText).filter((text) => text !== void 0).join("\n\n");
|
|
168
168
|
const failed = turn.state !== "completed" || Boolean(turn.errorMessage);
|
|
169
|
+
const blocked = turn.turnStartMessageIndex === void 0 ? void 0 : readBlockedReport(turn.piMessages.slice(turn.turnStartMessageIndex));
|
|
169
170
|
return await completeAgentInvocation({
|
|
170
171
|
invocationId: invocation.invocationId,
|
|
171
172
|
...failed ? {
|
|
172
173
|
errorMessage: turn.errorMessage ?? "Agent invocation failed",
|
|
173
174
|
status: "failed"
|
|
175
|
+
} : blocked ? {
|
|
176
|
+
errorMessage: blocked.missing,
|
|
177
|
+
status: "blocked"
|
|
174
178
|
} : {
|
|
175
179
|
result,
|
|
176
180
|
status: "completed"
|
|
@@ -208,6 +212,9 @@ async function saveAgentInvocationResult(args) {
|
|
|
208
212
|
...failed ? {
|
|
209
213
|
errorMessage: args.result.diagnostics.errorMessage ?? "Agent invocation failed",
|
|
210
214
|
status: "failed"
|
|
215
|
+
} : args.result.blocked ? {
|
|
216
|
+
errorMessage: args.result.blocked.missing,
|
|
217
|
+
status: "blocked"
|
|
211
218
|
} : {
|
|
212
219
|
result: args.result.text,
|
|
213
220
|
status: "completed"
|
|
@@ -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 { Bt as drainConversationMailbox, It as completeConversationStop, Jt as releaseConversationWork, Kt as recordAttemptFailure, Lt as completeConversationWork, Nt as checkInConversationWork, Ot as ackMessages, Pt as clearConsumedConversationWake, Qt as startConversationWork, Rt as countPendingConversationMessages, Ut as getConversationWorkState, Vt as ensureConversationWake, Xt as requestAnotherSlice, an as isInvalidConversationRecordError, in as isFinalAttempt, jt as beginConversationResume, nn as hasConversationStop, qt as recordConversationRetry, zt as deadLetterAttempt } from "./agent-runner-DSKpHjHW.js";
|
|
3
|
+
import { v as isProviderRetryError } from "./client--xtsAxKP.js";
|
|
4
|
+
import { C as withLogContext, d as logException, f as logInfo, p as logWarn } from "./logging-DVtMYOdD.js";
|
|
5
|
+
import { i as getChatConfig } from "./config-BK53Ip5C.js";
|
|
6
|
+
import { f as getTurnRequestDeadline, m as ConversationQueueMessageRejectedError } from "./job-queue-Cz3M7gg4.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.246.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -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.246.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-github": "0.
|
|
110
|
-
"@sentry/junior-
|
|
111
|
-
"@sentry/junior-
|
|
109
|
+
"@sentry/junior-github": "0.246.0",
|
|
110
|
+
"@sentry/junior-testing": "0.0.0",
|
|
111
|
+
"@sentry/junior-memory": "0.246.0"
|
|
112
112
|
},
|
|
113
113
|
"scripts": {
|
|
114
114
|
"build": "tsdown",
|