@sentry/junior 0.240.0 → 0.242.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-D6fRPRgC.js → admin-C54kvHVC.js} +1 -1
- package/dist/{agent-hooks-JFbgedMZ.js → agent-hooks-BVttjZvb.js} +1952 -1952
- package/dist/{agent-runner-0IjJxsL1.js → agent-runner-BTgnxJ7g.js} +336 -1125
- package/dist/api/schema.d.ts +9 -0
- package/dist/api/schema.js +2 -2
- package/dist/api.js +21 -21
- package/dist/app.js +104 -31
- package/dist/{automation-B5_c8hEb.js → automation-gznOMaQ2.js} +11 -2
- package/dist/{briefs-BGWTp-nz.js → briefs-CKUsv9F1.js} +2 -2
- package/dist/{catalog-runtime-DdigNl7s.js → catalog-runtime-C2YkfMZz.js} +1 -1
- 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.js +3 -3
- package/dist/{client-Cn73E7br.js → client-D51G-Jdg.js} +2 -2
- package/dist/{config-B0S86yw9.js → config-C6Uu3Re9.js} +2 -2
- package/dist/{conversation-privacy-BKlX7D_R.js → conversation-privacy-CzL47nXs.js} +1 -1
- package/dist/{credential-sync-DeNQm7st.js → credential-sync-DvDaE-Uj.js} +14 -14
- package/dist/{executor-BQ-A5nov.js → executor-CGUukwus.js} +4 -2
- package/dist/{images-C7OKd6uy.js → images-DSxZt5vk.js} +2 -2
- package/dist/instrumentation.js +2 -2
- package/dist/{job-queue-DgXLqoeB.js → job-queue-hLylM9cy.js} +1 -1
- package/dist/{logging-BSNF167N.js → logging-BdZ_mK3q.js} +1 -1
- package/dist/nitro.js +3 -3
- package/dist/{oauth-authorization-BM7g61od.js → oauth-authorization-BokpeHv-.js} +1 -1
- package/dist/{oauth-callback-server-Dw-BwI6x.js → oauth-callback-server-C3BOSmT_.js} +2 -2
- package/dist/{pending-auth-Chn_EA1_.js → pending-auth-DOzL4D24.js} +2 -2
- package/dist/{profile-3t9H_IwL.js → profile-2gPzzMib.js} +4 -4
- package/dist/{registry-DLZlAhdP.js → registry-XJkXDNK2.js} +1 -1
- package/dist/{resolve-9_cIPQsq.js → resolve-DhcdtDt6.js} +2 -2
- package/dist/{runner-C_eUbFyp.js → runner-CGyrnIPm.js} +9 -9
- package/dist/{sandbox-egress-signals-C1ycxTNA.js → sandbox-egress-signals-D6F3OZJP.js} +1 -1
- package/dist/{schema-C4XwHTY4.js → schema-Cabm4jcj.js} +1 -1
- package/dist/{skills-Dqgjr_Tl.js → skills-C6PqcBPU.js} +2 -2
- package/dist/{spawn-BfEr3t7b.js → spawn-DL9x3T1o.js} +2 -2
- package/dist/{task-queue-CuFZDOXn.js → task-queue-vZnBGu9B.js} +3 -3
- package/dist/{task-runner-c7gwV8dj.js → task-runner-C-c0t5F5.js} +54 -12
- package/dist/{checkpoint-C1ZnSz7r.js → tasks-EqCtmUJ2.js} +1056 -14
- package/dist/{thread-state-exTu-G1w.js → thread-state-B8IKs_J8.js} +6 -6
- package/dist/{turn-failure-response-DFp99ziF.js → turn-failure-response-BS7OO1BE.js} +9 -8
- package/dist/{turn-lifecycle-C4TjuOzG.js → turn-lifecycle-Cxrt8qMD.js} +1 -1
- package/dist/{turn-session-routing-Vpg8jUD1.js → turn-session-routing-BlGt2AUb.js} +1 -1
- package/dist/{validation-D2lULEG9.js → validation-C8hci6pj.js} +1 -1
- package/dist/{version-BjBMCc2o.js → version-CjnHQ8aY.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-XE3nFqKM.js → viewer-BOgEy5zC.js} +3 -3
- package/dist/{web-authorization-8E8IrWOj.js → web-authorization-DSMV5tMK.js} +6 -6
- package/dist/{web-input-DF4GGJrf.js → web-input-TD5P9jdo.js} +135 -129
- package/dist/{work-Dt_JjfbX.js → work-D39OAwP1.js} +7 -7
- package/dist/{worker-BrbnLmD3.js → worker-CWiLgCWH.js} +5 -5
- package/migrations/0049_event_automation_status_reason.sql +1 -0
- package/migrations/meta/0049_snapshot.json +3581 -0
- package/migrations/meta/_journal.json +8 -1
- package/package.json +5 -5
|
@@ -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-BdZ_mK3q.js";
|
|
2
|
+
import { d as getDb } from "./viewer-BOgEy5zC.js";
|
|
3
3
|
import { n as juniorDestinations } from "./destinations-BeBiJeEM.js";
|
|
4
|
-
import { d as juniorLocationConfigurations } from "./executor-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { w as getStateAdapter } from "./profile-
|
|
4
|
+
import { d as juniorLocationConfigurations } from "./executor-CGUukwus.js";
|
|
5
|
+
import { Bt as persistConversationMessages } from "./tasks-EqCtmUJ2.js";
|
|
6
|
+
import { tt as JUNIOR_THREAD_STATE_TTL_MS } from "./agent-hooks-BVttjZvb.js";
|
|
7
|
+
import { w as getStateAdapter } from "./profile-2gPzzMib.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-D51G-Jdg.js";
|
|
2
|
+
import { I as isRecord, t as buildTurnFailureResponse } from "./logging-BdZ_mK3q.js";
|
|
3
3
|
import { g as parseSlackMessageTs } from "./actor-BTtLaeWy.js";
|
|
4
|
-
import { c as getConversationEventStore, d as getDb } from "./viewer-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { c as getConversationEventStore, d as getDb } from "./viewer-BOgEy5zC.js";
|
|
5
|
+
import { $t as markConversationMessage, zt as hydrateConversationMessages } from "./tasks-EqCtmUJ2.js";
|
|
6
|
+
import { At as listConversationAnnotations } from "./agent-hooks-BVttjZvb.js";
|
|
7
7
|
import { G as removedCardSchema, K as resolveMessageCards, W as readMessageCardRefs } from "./conversation-DwD-vquD.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-DOzL4D24.js";
|
|
9
|
+
import { g as markTurnCompleted, h as markTurnClosed } from "./oauth-authorization-BokpeHv-.js";
|
|
10
|
+
import { o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-B8IKs_J8.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) {
|
|
@@ -173,6 +173,7 @@ function getAgentTurnDiagnosticsAttributes(reply) {
|
|
|
173
173
|
"app.ai.tool_error_results": reply.diagnostics.toolErrorCount,
|
|
174
174
|
"app.ai.tool_call_count": reply.diagnostics.toolCalls.length,
|
|
175
175
|
"app.ai.used_primary_text": reply.diagnostics.usedPrimaryText,
|
|
176
|
+
...reply.automation ? { "app.automation.result": reply.automation.result } : void 0,
|
|
176
177
|
...reply.diagnostics.reasoningLevel ? { "gen_ai.request.reasoning.level": reply.diagnostics.reasoningLevel } : void 0,
|
|
177
178
|
...reply.diagnostics.stopReason ? { "gen_ai.response.finish_reasons": [reply.diagnostics.stopReason] } : void 0,
|
|
178
179
|
...reply.diagnostics.errorMessage && reply.diagnostics.outcome !== "provider_error" ? { "exception.message": reply.diagnostics.errorMessage } : void 0
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as getConversationEventStore } from "./viewer-
|
|
1
|
+
import { c as getConversationEventStore } from "./viewer-BOgEy5zC.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-BOgEy5zC.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-C2YkfMZz.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-CjnHQ8aY.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-BdZ_mK3q.js";
|
|
3
|
+
import { i as getChatConfig } from "./config-C6Uu3Re9.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-CGUukwus.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";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as getConversationEventStore } from "./viewer-
|
|
3
|
-
import {
|
|
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 { Tt as requestConversationWork, ht as ensureConversationWake } from "./agent-runner-BTgnxJ7g.js";
|
|
2
|
+
import { c as getConversationEventStore } from "./viewer-BOgEy5zC.js";
|
|
3
|
+
import { G as loadTurnCheckpoint, X as getTurnRecord, Y as failTurnRecord } from "./tasks-EqCtmUJ2.js";
|
|
4
|
+
import { w as getStateAdapter } from "./profile-2gPzzMib.js";
|
|
5
|
+
import { a as getVercelConversationWorkQueue } from "./job-queue-hLylM9cy.js";
|
|
6
|
+
import { n as resolveTurnSessionRouting } from "./turn-session-routing-BlGt2AUb.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 { A as resolveSlackChannelIdFromMessage, B as
|
|
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 { $ as getEventCatalog, A as resolveSlackChannelIdFromMessage, B as effectiveTaskOutcomes, C as renderBlockText, D as storeAttachment, Ft as maybePostAutomatedTurnLimitNotice, It as recordFinishedTurnForAutomatedLimit, M as getConversationInfo, N as listThreadReplies, O as parseSlackThreadId, Q as timerWatchCredentialSubject, Qt as RetryableDeliveryError, S as renderAttachmentText, X as EVENT_WAIT_MS, Xt as createUserTokenStore, Z as isEventMailboxMetadata, Zt as buildSteeringPiMessage, _t as getConversationWorkState, a as buildAuthPauseResponse, an as shouldEmitDevAgentTrace, h as latestProgressStatus, in as runDispatchOutcome, it as appendAndEnqueueInboundMessage, j as resolveSlackChannelIdFromThreadId, k as readSlackRawMessageContext, m as PluginCredentialFailureError, n as executeAgentRun, nn as deliversFinalText, r as createContextCompactor, rn as finishedRunReply, rt as appendAndEnqueueExclusiveInboundMessage, t as createAgentRunner, tn as AuthorizationFlowDisabledError, tt as pluginEventCatalog, z as eventAutomationTriggerAvailable } from "./agent-runner-BTgnxJ7g.js";
|
|
2
|
+
import { f as escapeXml, i as completeText, r as completeObject, v as isProviderRetryError } from "./client-D51G-Jdg.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-BdZ_mK3q.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-C6Uu3Re9.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-BOgEy5zC.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-CGUukwus.js";
|
|
10
10
|
import { f as instructionProvenanceFor } from "./history-BLTUgFYO.js";
|
|
11
|
-
import { d as credentialContextForActor } from "./registry-
|
|
12
|
-
import { $ as
|
|
13
|
-
import {
|
|
11
|
+
import { d as credentialContextForActor } from "./registry-XJkXDNK2.js";
|
|
12
|
+
import { $ as persistWithRetry, $t as markConversationMessage, A as formatSlackLink, B as removeReactionFromMessage, Bt as persistConversationMessages, C as listAutomationVersions, Ct as loadConversationProjection, F as addReactionToMessage, Ft as recordSubscribedReplyRoute, G as loadTurnCheckpoint, Gt as fallbackShortTitle, Ht as persistConversationMessageSummaries, J as completeTurnRecord, Jt as buildConversationContext, K as saveTurnCheckpoint, M as normalizeSlackStatusText, P as truncateStatusText, Q as recordTurnSummary, Qt as isHumanConversationMessage, S as automationDefinition, T as sameDefinitionValue, Ut as resolveConversationTitle, X as getTurnRecord, Xt as estimateConversationContextTokens, Y as failTurnRecord, Yt as createConversationMemoryService, Z as listTurnSummaries, Zt as getConversationMessageSlackTs, _ as listDeletedEventAutomationsCreatedBy, _t as trimTrailingAssistantMessages, a as readScheduledAutomation, bt as commitAcceptedReply, en as normalizeConversationText, g as getEventAutomation, i as parseScheduledAutomationRow, j as normalizeSlackReplyMarkdown, jt as recordAuthorizationCompleted, k as escapeSlackMrkdwnText, l as withScheduledAutomationLock, m as eventAutomationBelongsToUser, nn as turnHasReply, nt as buildTurnErrorResponse, p as deleteEventAutomation, q as abandonTurnRecord, qt as appendThreadContextMessages, rn as upsertConversationMessage, s as saveScheduledAutomationInLock, tn as recordDeliveredAssistantMessage, wt as loadProjection, xt as commitMessages, y as parseEventAutomationRow, z as postSlackMessage, zt as hydrateConversationMessages } from "./tasks-EqCtmUJ2.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-BVttjZvb.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-2gPzzMib.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-DOzL4D24.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-BokpeHv-.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-hLylM9cy.js";
|
|
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
|
|
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 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-C-c0t5F5.js";
|
|
24
|
+
import { i as resolveAgentInvocationId, o as AgentRunError, s as executeTurn, t as createAgentInvocationWorker } from "./work-D39OAwP1.js";
|
|
25
|
+
import { n as getTurnLifecycle, t as ConversationTurnLifecycleService } from "./turn-lifecycle-Cxrt8qMD.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-B8IKs_J8.js";
|
|
27
|
+
import { a as getPausedTurnRequest, c as getTurnAuthorization, i as createPausedTurns, n as deleteWebAuthorization, s as wakePausedTurn, t as createWebAuthorization } from "./web-authorization-DSMV5tMK.js";
|
|
28
|
+
import { n as resolveTurnSessionRouting } from "./turn-session-routing-BlGt2AUb.js";
|
|
29
|
+
import { t as bindSpawnAgent } from "./spawn-DL9x3T1o.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-BS7OO1BE.js";
|
|
31
|
+
import { r as storeInputImages } from "./images-DSxZt5vk.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";
|
|
@@ -70,7 +70,8 @@ function buildDispatchRoutingContext(dispatch) {
|
|
|
70
70
|
metadata: dispatch.metadata,
|
|
71
71
|
plugin: dispatch.plugin,
|
|
72
72
|
replyAttribution: dispatch.replyAttribution,
|
|
73
|
-
outcomes: dispatch.outcomes
|
|
73
|
+
outcomes: dispatch.outcomes,
|
|
74
|
+
...dispatch.source.kind === "scheduled_automation" || dispatch.source.kind === "event_automation" ? { declaresResult: true } : void 0
|
|
74
75
|
},
|
|
75
76
|
surface: "api"
|
|
76
77
|
};
|
|
@@ -188,7 +189,7 @@ async function projectDispatchTurnResult(dispatchId, result) {
|
|
|
188
189
|
await markDispatchAwaitingResume(dispatchId);
|
|
189
190
|
break;
|
|
190
191
|
case "blocked":
|
|
191
|
-
await markDispatchBlocked(dispatchId, "Dispatch requires authorization that is unavailable for background work", result.resultMessageTs);
|
|
192
|
+
await markDispatchBlocked(dispatchId, result.errorMessage ?? "Dispatch requires authorization that is unavailable for background work", result.resultMessageTs);
|
|
192
193
|
break;
|
|
193
194
|
case "failed":
|
|
194
195
|
await markDispatchFailed(dispatchId, result.errorMessage ?? "Agent turn failed", result.resultMessageTs);
|
|
@@ -200,6 +201,9 @@ function getDispatchBlockingError(error) {
|
|
|
200
201
|
const cause = getConversationTurnBoundaryError(error)?.cause ?? error;
|
|
201
202
|
return cause instanceof AuthorizationFlowDisabledError || cause instanceof PluginCredentialFailureError ? cause : void 0;
|
|
202
203
|
}
|
|
204
|
+
function missingAuthorizationReason(dispatch, provider) {
|
|
205
|
+
return dispatch.credentialSubject ? `This run needs a connected ${provider} account.` : `This run uses system credentials, which have no ${provider} access. Switch it to creator credentials and connect a ${provider} account.`;
|
|
206
|
+
}
|
|
203
207
|
async function persistBlockedDispatchTurn(dispatch, error) {
|
|
204
208
|
const conversationId = getDispatchConversationId(dispatch);
|
|
205
209
|
const sessionId = getDispatchTurnId(dispatch.id);
|
|
@@ -217,7 +221,7 @@ async function persistBlockedDispatchTurn(dispatch, error) {
|
|
|
217
221
|
state: "failed",
|
|
218
222
|
surface: "api"
|
|
219
223
|
});
|
|
220
|
-
await markDispatchBlocked(dispatch.id, error instanceof AuthorizationFlowDisabledError ?
|
|
224
|
+
await markDispatchBlocked(dispatch.id, error instanceof AuthorizationFlowDisabledError ? missingAuthorizationReason(dispatch, error.provider) : error.message);
|
|
221
225
|
}
|
|
222
226
|
/** Run one dispatch start or resume under the owning conversation lease. */
|
|
223
227
|
function createAgentDispatchConversationWorker(options) {
|
|
@@ -2865,7 +2869,7 @@ function viewerAutomationCollection(user) {
|
|
|
2865
2869
|
createdAtMs: event.createdAtMs,
|
|
2866
2870
|
state: sql`${event.status}`.as("state"),
|
|
2867
2871
|
unavailable: sql`not (${available})`.as("unavailable"),
|
|
2868
|
-
attention: sql`${event.status} <> 'paused' and (not (${available}) or ${lastRunNeedsAttention("event", event.id)})`.as("attention"),
|
|
2872
|
+
attention: sql`${event.status} <> 'paused' and (${event.status} = 'blocked' or not (${available}) or ${lastRunNeedsAttention("event", event.id)})`.as("attention"),
|
|
2869
2873
|
owned: sql`${eventOwned}`.as("owned"),
|
|
2870
2874
|
resource: sql`concat_ws(' ', ${event.identifier}, ${event.task}->'trigger'->>'label', ${event.namespace})`.as("resource"),
|
|
2871
2875
|
...fields(event.task, event.teamId)
|
|
@@ -3062,7 +3066,8 @@ function eventAutomationSummary(task, ownedByViewer, destination, stats, creator
|
|
|
3062
3066
|
credentialMode: task.credentialMode,
|
|
3063
3067
|
outcomes: effectiveTaskOutcomes(task.outcomes, task.destination),
|
|
3064
3068
|
title: taskDisplayTitle(task.title, instruction, "Untitled event automation"),
|
|
3065
|
-
status: task.status === "
|
|
3069
|
+
status: task.status === "deleted" ? "active" : task.status,
|
|
3070
|
+
statusReason: task.statusReason,
|
|
3066
3071
|
triggerAvailable: eventAutomationTriggerAvailable(task, getEventCatalog())
|
|
3067
3072
|
};
|
|
3068
3073
|
}
|
|
@@ -3365,6 +3370,93 @@ async function deleteViewerTask(user, kind, id) {
|
|
|
3365
3370
|
await deleteEventAutomation(getDb(), id);
|
|
3366
3371
|
}
|
|
3367
3372
|
//#endregion
|
|
3373
|
+
//#region src/chat/slack/assistant-thread/status-send.ts
|
|
3374
|
+
/**
|
|
3375
|
+
* Slack's assistant loading UI accepts both `status` and `loading_messages`,
|
|
3376
|
+
* but product policy keeps `status` stable and generic. User-visible progress
|
|
3377
|
+
* copy belongs in `loading_messages`.
|
|
3378
|
+
*/
|
|
3379
|
+
const SLACK_ASSISTANT_ACTIVE_STATUS = "is working on your request...";
|
|
3380
|
+
/**
|
|
3381
|
+
* Build a best-effort sender for Slack's assistant loading state.
|
|
3382
|
+
*
|
|
3383
|
+
* The `text` argument is internal progress copy. This transport maps it onto
|
|
3384
|
+
* Slack's loading surface and keeps the raw Slack `status` field fixed.
|
|
3385
|
+
*/
|
|
3386
|
+
function createSlackAdapterStatusSender(args) {
|
|
3387
|
+
const adapter = args.getSlackAdapter();
|
|
3388
|
+
const boundToken = getSlackAdapterRequestToken(adapter);
|
|
3389
|
+
return async (text, loadingMessages) => {
|
|
3390
|
+
const channelId = args.channelId;
|
|
3391
|
+
const threadTs = args.threadTs;
|
|
3392
|
+
if (!channelId || !threadTs) return;
|
|
3393
|
+
const normalizedChannelId = normalizeSlackConversationId(channelId);
|
|
3394
|
+
if (!normalizedChannelId) return;
|
|
3395
|
+
const nextLoadingMessages = text ? loadingMessages ?? [text] : void 0;
|
|
3396
|
+
try {
|
|
3397
|
+
await runWithBoundSlackToken(adapter, boundToken, () => adapter.setAssistantStatus(normalizedChannelId, threadTs, text ? SLACK_ASSISTANT_ACTIVE_STATUS : "", nextLoadingMessages));
|
|
3398
|
+
} catch (error) {
|
|
3399
|
+
logAssistantStatusFailure({
|
|
3400
|
+
status: text,
|
|
3401
|
+
error,
|
|
3402
|
+
channelId,
|
|
3403
|
+
normalizedChannelId,
|
|
3404
|
+
threadTs
|
|
3405
|
+
});
|
|
3406
|
+
}
|
|
3407
|
+
};
|
|
3408
|
+
}
|
|
3409
|
+
/**
|
|
3410
|
+
* Build a best-effort sender for Slack's assistant loading state over raw Web
|
|
3411
|
+
* API calls. As with the adapter-backed path, the dynamic copy goes to
|
|
3412
|
+
* `loading_messages` while `status` stays fixed and generic.
|
|
3413
|
+
*/
|
|
3414
|
+
function createSlackWebApiStatusSender(args) {
|
|
3415
|
+
const getClient = args.getSlackClient ?? getSlackClient;
|
|
3416
|
+
return async (text, loadingMessages) => {
|
|
3417
|
+
const channelId = args.channelId;
|
|
3418
|
+
const threadTs = args.threadTs;
|
|
3419
|
+
if (!channelId || !threadTs) return;
|
|
3420
|
+
const normalizedChannelId = normalizeSlackConversationId(channelId);
|
|
3421
|
+
if (!normalizedChannelId) return;
|
|
3422
|
+
const nextLoadingMessages = text ? loadingMessages ?? [text] : void 0;
|
|
3423
|
+
try {
|
|
3424
|
+
await getClient().assistant.threads.setStatus({
|
|
3425
|
+
channel_id: normalizedChannelId,
|
|
3426
|
+
thread_ts: threadTs,
|
|
3427
|
+
status: text ? SLACK_ASSISTANT_ACTIVE_STATUS : "",
|
|
3428
|
+
...nextLoadingMessages ? { loading_messages: nextLoadingMessages } : void 0
|
|
3429
|
+
});
|
|
3430
|
+
} catch (error) {
|
|
3431
|
+
logAssistantStatusFailure({
|
|
3432
|
+
status: text,
|
|
3433
|
+
error,
|
|
3434
|
+
channelId,
|
|
3435
|
+
normalizedChannelId,
|
|
3436
|
+
threadTs
|
|
3437
|
+
});
|
|
3438
|
+
}
|
|
3439
|
+
};
|
|
3440
|
+
}
|
|
3441
|
+
function getSlackAdapterRequestToken(adapter) {
|
|
3442
|
+
const token = adapter.requestContext?.getStore()?.token;
|
|
3443
|
+
if (typeof token !== "string") return;
|
|
3444
|
+
return token.trim() || void 0;
|
|
3445
|
+
}
|
|
3446
|
+
async function runWithBoundSlackToken(adapter, token, task) {
|
|
3447
|
+
if (!token) return await task();
|
|
3448
|
+
return await adapter.withBotToken(token, task);
|
|
3449
|
+
}
|
|
3450
|
+
function logAssistantStatusFailure(args) {
|
|
3451
|
+
logWarn("assistant.status.update.failed", {
|
|
3452
|
+
"app.slack.status_text": args.status || "(clear)",
|
|
3453
|
+
"app.slack.channel_id_raw": args.channelId,
|
|
3454
|
+
"app.slack.channel_id": args.normalizedChannelId,
|
|
3455
|
+
"app.slack.thread_ts": args.threadTs,
|
|
3456
|
+
"exception.message": args.error instanceof Error ? args.error.message : String(args.error)
|
|
3457
|
+
});
|
|
3458
|
+
}
|
|
3459
|
+
//#endregion
|
|
3368
3460
|
//#region src/chat/services/subscribed-reply-policy.ts
|
|
3369
3461
|
function createSubscribedReplyPolicy(deps) {
|
|
3370
3462
|
return async (args) => {
|
|
@@ -3906,93 +3998,6 @@ function createAssistantStatusScheduler(args) {
|
|
|
3906
3998
|
};
|
|
3907
3999
|
}
|
|
3908
4000
|
//#endregion
|
|
3909
|
-
//#region src/chat/slack/assistant-thread/status-send.ts
|
|
3910
|
-
/**
|
|
3911
|
-
* Slack's assistant loading UI accepts both `status` and `loading_messages`,
|
|
3912
|
-
* but product policy keeps `status` stable and generic. User-visible progress
|
|
3913
|
-
* copy belongs in `loading_messages`.
|
|
3914
|
-
*/
|
|
3915
|
-
const SLACK_ASSISTANT_ACTIVE_STATUS = "is working on your request...";
|
|
3916
|
-
/**
|
|
3917
|
-
* Build a best-effort sender for Slack's assistant loading state.
|
|
3918
|
-
*
|
|
3919
|
-
* The `text` argument is internal progress copy. This transport maps it onto
|
|
3920
|
-
* Slack's loading surface and keeps the raw Slack `status` field fixed.
|
|
3921
|
-
*/
|
|
3922
|
-
function createSlackAdapterStatusSender(args) {
|
|
3923
|
-
const adapter = args.getSlackAdapter();
|
|
3924
|
-
const boundToken = getSlackAdapterRequestToken(adapter);
|
|
3925
|
-
return async (text, loadingMessages) => {
|
|
3926
|
-
const channelId = args.channelId;
|
|
3927
|
-
const threadTs = args.threadTs;
|
|
3928
|
-
if (!channelId || !threadTs) return;
|
|
3929
|
-
const normalizedChannelId = normalizeSlackConversationId(channelId);
|
|
3930
|
-
if (!normalizedChannelId) return;
|
|
3931
|
-
const nextLoadingMessages = text ? loadingMessages ?? [text] : void 0;
|
|
3932
|
-
try {
|
|
3933
|
-
await runWithBoundSlackToken(adapter, boundToken, () => adapter.setAssistantStatus(normalizedChannelId, threadTs, text ? SLACK_ASSISTANT_ACTIVE_STATUS : "", nextLoadingMessages));
|
|
3934
|
-
} catch (error) {
|
|
3935
|
-
logAssistantStatusFailure({
|
|
3936
|
-
status: text,
|
|
3937
|
-
error,
|
|
3938
|
-
channelId,
|
|
3939
|
-
normalizedChannelId,
|
|
3940
|
-
threadTs
|
|
3941
|
-
});
|
|
3942
|
-
}
|
|
3943
|
-
};
|
|
3944
|
-
}
|
|
3945
|
-
/**
|
|
3946
|
-
* Build a best-effort sender for Slack's assistant loading state over raw Web
|
|
3947
|
-
* API calls. As with the adapter-backed path, the dynamic copy goes to
|
|
3948
|
-
* `loading_messages` while `status` stays fixed and generic.
|
|
3949
|
-
*/
|
|
3950
|
-
function createSlackWebApiStatusSender(args) {
|
|
3951
|
-
const getClient = args.getSlackClient ?? getSlackClient;
|
|
3952
|
-
return async (text, loadingMessages) => {
|
|
3953
|
-
const channelId = args.channelId;
|
|
3954
|
-
const threadTs = args.threadTs;
|
|
3955
|
-
if (!channelId || !threadTs) return;
|
|
3956
|
-
const normalizedChannelId = normalizeSlackConversationId(channelId);
|
|
3957
|
-
if (!normalizedChannelId) return;
|
|
3958
|
-
const nextLoadingMessages = text ? loadingMessages ?? [text] : void 0;
|
|
3959
|
-
try {
|
|
3960
|
-
await getClient().assistant.threads.setStatus({
|
|
3961
|
-
channel_id: normalizedChannelId,
|
|
3962
|
-
thread_ts: threadTs,
|
|
3963
|
-
status: text ? SLACK_ASSISTANT_ACTIVE_STATUS : "",
|
|
3964
|
-
...nextLoadingMessages ? { loading_messages: nextLoadingMessages } : void 0
|
|
3965
|
-
});
|
|
3966
|
-
} catch (error) {
|
|
3967
|
-
logAssistantStatusFailure({
|
|
3968
|
-
status: text,
|
|
3969
|
-
error,
|
|
3970
|
-
channelId,
|
|
3971
|
-
normalizedChannelId,
|
|
3972
|
-
threadTs
|
|
3973
|
-
});
|
|
3974
|
-
}
|
|
3975
|
-
};
|
|
3976
|
-
}
|
|
3977
|
-
function getSlackAdapterRequestToken(adapter) {
|
|
3978
|
-
const token = adapter.requestContext?.getStore()?.token;
|
|
3979
|
-
if (typeof token !== "string") return;
|
|
3980
|
-
return token.trim() || void 0;
|
|
3981
|
-
}
|
|
3982
|
-
async function runWithBoundSlackToken(adapter, token, task) {
|
|
3983
|
-
if (!token) return await task();
|
|
3984
|
-
return await adapter.withBotToken(token, task);
|
|
3985
|
-
}
|
|
3986
|
-
function logAssistantStatusFailure(args) {
|
|
3987
|
-
logWarn("assistant.status.update.failed", {
|
|
3988
|
-
"app.slack.status_text": args.status || "(clear)",
|
|
3989
|
-
"app.slack.channel_id_raw": args.channelId,
|
|
3990
|
-
"app.slack.channel_id": args.normalizedChannelId,
|
|
3991
|
-
"app.slack.thread_ts": args.threadTs,
|
|
3992
|
-
"exception.message": args.error instanceof Error ? args.error.message : String(args.error)
|
|
3993
|
-
});
|
|
3994
|
-
}
|
|
3995
|
-
//#endregion
|
|
3996
4001
|
//#region src/chat/slack/assistant-thread/status.ts
|
|
3997
4002
|
/**
|
|
3998
4003
|
* Create a Slack adapter-backed session for Slack's assistant loading state.
|
|
@@ -4915,7 +4920,7 @@ function createSlackTurn(deps) {
|
|
|
4915
4920
|
toolName: event.toolName
|
|
4916
4921
|
});
|
|
4917
4922
|
},
|
|
4918
|
-
...options.execution?.dispatch
|
|
4923
|
+
...deliversFinalText(options.execution?.dispatch) ? { delivery: deliverAssistantMessage } : void 0,
|
|
4919
4924
|
durability: {
|
|
4920
4925
|
onInputCommitted: options.ack,
|
|
4921
4926
|
drainSteeringMessages,
|
|
@@ -4946,12 +4951,10 @@ function createSlackTurn(deps) {
|
|
|
4946
4951
|
finalResult = finalized.reply;
|
|
4947
4952
|
failureEventId = finalized.eventId;
|
|
4948
4953
|
failureReason = finalized.failureReason;
|
|
4949
|
-
await deliverAssistantMessage(finalResult.text);
|
|
4950
4954
|
}
|
|
4951
|
-
const
|
|
4952
|
-
|
|
4953
|
-
|
|
4954
|
-
};
|
|
4955
|
+
const reply = finishedRunReply(finalResult, options.execution?.dispatch);
|
|
4956
|
+
if (reply !== void 0) await deliverAssistantMessage(reply);
|
|
4957
|
+
const turnResult = runDispatchOutcome(finalResult);
|
|
4955
4958
|
runResultHandled = true;
|
|
4956
4959
|
shouldPersistFailureState = false;
|
|
4957
4960
|
boundaryFailureCode = "agent_run_failed";
|
|
@@ -4975,7 +4978,7 @@ function createSlackTurn(deps) {
|
|
|
4975
4978
|
destinationVisibility,
|
|
4976
4979
|
source,
|
|
4977
4980
|
sliceId: 1,
|
|
4978
|
-
dispatchOutcome:
|
|
4981
|
+
dispatchOutcome: turnResult.outcome,
|
|
4979
4982
|
...options.execution?.dispatch && turnResult.errorMessage ? { errorMessage: turnResult.errorMessage } : void 0,
|
|
4980
4983
|
...acceptedDeliveryId ? { resultMessageId: acceptedDeliveryId } : void 0,
|
|
4981
4984
|
messages: finalResult.piMessages,
|
|
@@ -4998,7 +5001,7 @@ function createSlackTurn(deps) {
|
|
|
4998
5001
|
source,
|
|
4999
5002
|
surface: options.execution?.surface ?? "slack",
|
|
5000
5003
|
dispatchId: options.execution?.dispatch?.id,
|
|
5001
|
-
dispatchOutcome:
|
|
5004
|
+
dispatchOutcome: turnResult.outcome,
|
|
5002
5005
|
...acceptedDeliveryId ? { resultMessageId: acceptedDeliveryId } : void 0,
|
|
5003
5006
|
traceId: getActiveTraceId()
|
|
5004
5007
|
});
|
|
@@ -5787,7 +5790,7 @@ function buildResumedRun(args, statusSession, delivery) {
|
|
|
5787
5790
|
if (event.type === "status") statusSession.update({ text: event.text });
|
|
5788
5791
|
await priorOnEvent?.(event);
|
|
5789
5792
|
},
|
|
5790
|
-
...savedRun.dispatch
|
|
5793
|
+
...deliversFinalText(savedRun.dispatch) ? { delivery } : void 0,
|
|
5791
5794
|
durability: {
|
|
5792
5795
|
...savedRun.durability,
|
|
5793
5796
|
onSandboxRefChanged: async (sandboxRef) => {
|
|
@@ -5977,8 +5980,11 @@ async function resumeSlackTurnInContext(args) {
|
|
|
5977
5980
|
logException
|
|
5978
5981
|
});
|
|
5979
5982
|
const reply = finalized.reply;
|
|
5980
|
-
|
|
5981
|
-
|
|
5983
|
+
setSpanAttributes(getAgentTurnDiagnosticsAttributes(reply));
|
|
5984
|
+
const dispatchResult = runDispatchOutcome(reply);
|
|
5985
|
+
const dispatchErrorMessage = run.dispatch ? dispatchResult.errorMessage : void 0;
|
|
5986
|
+
const replyText = finishedRunReply(reply, run.dispatch);
|
|
5987
|
+
if (replyText !== void 0) await deliverAssistantMessage(replyText);
|
|
5982
5988
|
runResultHandled = true;
|
|
5983
5989
|
await status.clear();
|
|
5984
5990
|
failureCode = "persistence_failed";
|
|
@@ -5992,7 +5998,7 @@ async function resumeSlackTurnInContext(args) {
|
|
|
5992
5998
|
destination: run.destination,
|
|
5993
5999
|
destinationVisibility: visibility,
|
|
5994
6000
|
dispatchId: run.dispatch?.id,
|
|
5995
|
-
dispatchOutcome:
|
|
6001
|
+
dispatchOutcome: dispatchResult.outcome,
|
|
5996
6002
|
...dispatchErrorMessage ? { errorMessage: dispatchErrorMessage } : void 0,
|
|
5997
6003
|
...acceptedDeliveryId ? { resultMessageId: acceptedDeliveryId } : void 0,
|
|
5998
6004
|
source: run.source,
|
|
@@ -6005,7 +6011,7 @@ async function resumeSlackTurnInContext(args) {
|
|
|
6005
6011
|
destination: run.destination,
|
|
6006
6012
|
destinationVisibility: visibility,
|
|
6007
6013
|
dispatchId: run.dispatch?.id,
|
|
6008
|
-
dispatchOutcome:
|
|
6014
|
+
dispatchOutcome: dispatchResult.outcome,
|
|
6009
6015
|
...acceptedDeliveryId ? { resultMessageId: acceptedDeliveryId } : void 0,
|
|
6010
6016
|
turnId: runArgs.turnId,
|
|
6011
6017
|
sliceId: runArgs.sliceId ?? 1,
|
|
@@ -7460,4 +7466,4 @@ async function appendAndEnqueueWebMessage(input, options) {
|
|
|
7460
7466
|
};
|
|
7461
7467
|
}
|
|
7462
7468
|
//#endregion
|
|
7463
|
-
export {
|
|
7469
|
+
export { withNormalizedThreadId as A, GET as B, buildSlackInboundMessage as C, isSlackMessageStopped as D, verifySlackSignature as E, parseContent as F, renderSlackObjectCard as I, createVercelAttachmentStorage as L, legacyWebMailboxMetadataSchema as M, THREAD_OPTOUT_ACK as N, stopSlackThread as O, startProcessingReaction as P, AGENT_DISPATCH_MAX_AGE_MS as R, recordSkippedConversationMessage as S, runWithSlackInstallation as T, readHealthReport 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, getAuthPausedConversationTurnId 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, enqueueAgentDispatch as z };
|
|
@@ -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 {
|
|
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 { G as AgentInvocationBusyError, H as agentBindingSchema, K as AgentInvocationLimitError, U as agentInvocationSchema, W as createAgentInvocationSchema, it as appendAndEnqueueInboundMessage, m as PluginCredentialFailureError, tn as AuthorizationFlowDisabledError } from "./agent-runner-BTgnxJ7g.js";
|
|
3
|
+
import { c as getConversationEventStore, f as getSqlExecutor, u as getConversationStore } from "./viewer-BOgEy5zC.js";
|
|
4
|
+
import { m as juniorAgentInvocations, p as juniorAgentBindings } from "./executor-CGUukwus.js";
|
|
5
|
+
import { Dt as openConversationProjection, K as saveTurnCheckpoint, X as getTurnRecord, Y as failTurnRecord, ot as getTerminalAssistantMessages } from "./tasks-EqCtmUJ2.js";
|
|
6
|
+
import { d as getConversationTurnBoundaryError, l as TurnInputCommitLostError, p as isTurnInputCommitLostError, r as getAssistantReplyText } from "./oauth-authorization-BokpeHv-.js";
|
|
7
|
+
import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-Cxrt8qMD.js";
|
|
8
|
+
import { n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState } from "./thread-state-B8IKs_J8.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 { At as hasConversationStop, Et as startConversationWork, Mt as isFinalAttempt, Nt as isInvalidConversationRecordError, St as releaseConversationWork, _t as getConversationWorkState, at as beginConversationResume, bt as recordAttemptFailure, ct as clearConsumedConversationWake, dt as completeConversationWork, ft as countPendingConversationMessages, ht as ensureConversationWake, mt as drainConversationMailbox, nt as ackMessages, pt as deadLetterAttempt, st as checkInConversationWork, ut as completeConversationStop, wt as requestAnotherSlice, xt as recordConversationRetry } from "./agent-runner-BTgnxJ7g.js";
|
|
3
|
+
import { v as isProviderRetryError } from "./client-D51G-Jdg.js";
|
|
4
|
+
import { C as withLogContext, d as logException, f as logInfo, p as logWarn } from "./logging-BdZ_mK3q.js";
|
|
5
|
+
import { i as getChatConfig } from "./config-C6Uu3Re9.js";
|
|
6
|
+
import { f as getTurnRequestDeadline, m as ConversationQueueMessageRejectedError } from "./job-queue-hLylM9cy.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,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ALTER TABLE "junior_event_tasks" ADD COLUMN "status_reason" text;
|