@sentry/junior 0.273.0 → 0.275.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/{adapter-umap1cth.js → adapter-dE2BiWP_.js} +1 -1
- package/dist/{admin-0o6E_3lo.js → admin-CkPaAYuZ.js} +1 -1
- package/dist/{agent-runner-D7Qz-lGO.js → agent-runner-bE7aH7ew.js} +1131 -306
- package/dist/api/schema.d.ts +1 -1
- package/dist/api/schema.js +4 -4
- package/dist/api.d.ts +1 -1
- package/dist/api.js +27 -27
- package/dist/{app-BcyhJq8x.d.ts → app-CgkquhZ8.d.ts} +18 -2
- package/dist/app.d.ts +1 -1
- package/dist/app.js +74 -30
- package/dist/{assistant-reply-wZ7i4OFa.js → assistant-reply-CjRU9Z59.js} +1 -1
- package/dist/{automation-yffXcZt9.js → automation-BGrd03QO.js} +1 -1
- package/dist/{job-queue-C4lphW9Y.js → background-compaction-queue-BYuOt3qK.js} +42 -3
- package/dist/{briefs-CgMnlpIp.js → briefs-6xUvmGos.js} +4 -4
- package/dist/{catalog-runtime-TygDsPOU.js → catalog-runtime-DcJ5NHDW.js} +1 -1
- package/dist/cli/chat.js +14 -14
- package/dist/cli/check.js +3 -3
- package/dist/cli/main.js +3 -3
- package/dist/cli/plugins.js +4 -4
- package/dist/cli/snapshot-create.js +4 -4
- package/dist/cli/upgrade.d.ts +1 -1
- package/dist/cli/upgrade.js +3 -3
- package/dist/{client-DhqbV0Fe.js → client-gnKpkpqP.js} +2 -2
- package/dist/{config-C6FTd7PX.js → config-D0GKc9sC.js} +2 -2
- package/dist/{connections-Dq72KajR.js → connections-DLqP5Bp1.js} +10 -10
- package/dist/{conversation-T4oabbBi.js → conversation-BjTo9ZFL.js} +1 -1
- package/dist/{conversation-privacy-BeRgrsph.js → conversation-privacy-BCXFshP9.js} +1 -1
- package/dist/{credential-sync-BmCbHAp4.js → credential-sync-BjihXFF2.js} +13 -13
- package/dist/{db-DOzBGLn5.d.ts → db-BMZhoYKj.d.ts} +1 -1
- package/dist/{executor-BafgvQcc.js → executor-j8VMt-To.js} +2 -2
- package/dist/instrumentation.js +2 -2
- package/dist/{logging-CNs1e04n.js → logging-CFHIO4Vs.js} +10 -2
- package/dist/{media-U6Tuz6Mi.js → media-DstkkoNP.js} +21 -2
- package/dist/{message-CETC5lsl.js → message-DH0cqFRS.js} +9 -9
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +13 -3
- package/dist/{oauth-callback-server-DcQZsKMm.js → oauth-callback-server-BgU4EZsJ.js} +2 -2
- package/dist/{projection-BOpi891B.js → projection-CTvLSwcm.js} +42 -15
- package/dist/{prompt-B1ySjUyf.js → prompt-JEWUUpLW.js} +1 -1
- package/dist/{registry-B-yUrv3h.js → registry-OsyWR4GO.js} +1 -1
- package/dist/{resolve-DqVtd4Q9.js → resolve-DCrKjmVP.js} +3 -3
- package/dist/{result-DQwTiLTw.js → result-Btdt5bSl.js} +9 -9
- package/dist/{runner-Dco5qMq6.js → runner-C1AwS93W.js} +11 -11
- package/dist/{sandbox-egress-signals-DFc_9Mcv.js → sandbox-egress-signals-C-5i7Zxm.js} +1 -1
- package/dist/{schema-5xHDGlBW.js → schema-CX9XGKCm.js} +11 -4
- package/dist/{schema-9OGdsaxF.d.ts → schema-DfdHlBnb.d.ts} +9 -2
- package/dist/{service-account-smdPFWNy.js → service-account-CQIW6At4.js} +3 -3
- package/dist/{service-account-CWfk9Cs-.js → service-account-DZX1KlQl.js} +3 -3
- package/dist/{session-stop-DaT_7tYa.js → session-stop-DjIyORJw.js} +11 -11
- package/dist/{skills-BbtJSF2-.js → skills-BEfAAT6p.js} +2 -2
- package/dist/{spawn-Ceikdjkp.js → spawn-Dgj4xxvO.js} +2 -2
- package/dist/{stop-dKUc-x2K.js → stop-DomyNvuv.js} +61 -69
- package/dist/{store-C1xuZcLd.js → store-B7Z6zIc7.js} +3 -3
- package/dist/{store-DaxUuOmD.js → store-Dp3RMEQd.js} +3 -3
- package/dist/{task-queue-ymAh_-P1.js → task-queue-CVQ9cWnC.js} +3 -3
- package/dist/{task-runner-vlH6pEm3.js → task-runner-DHBG47gS.js} +7 -7
- package/dist/{thread-state-BkUpE9Ae.js → thread-state-BF8VwIxd.js} +4 -4
- package/dist/{turn-failure-response-DIsD7ip_.js → turn-failure-response-Di7TbgsF.js} +7 -7
- package/dist/{turn-lifecycle-BdPKdPS8.js → turn-lifecycle-DzXwXmLg.js} +1 -1
- package/dist/{turn-session-routing-BdCTDq9m.js → turn-session-routing-CIWhXKeT.js} +9 -9
- package/dist/{validation-BQjCfh84.js → validation-BRmwRaXc.js} +1 -1
- package/dist/{version-BpiFGZZW.js → version-DBVMsgvA.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-C6Y1aXjZ.js → viewer-BFADRGP8.js} +17 -8
- package/dist/{work-ChPh_YEh.js → work-DDaoxZAw.js} +11 -11
- package/dist/{worker-Be_sK_ou.js → worker-Bub0fDtW.js} +6 -6
- package/package.json +4 -4
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
|
|
2
|
-
import { at as listTurnSummaries, it as getTurnRecord } from "./projection-
|
|
2
|
+
import { at as listTurnSummaries, it as getTurnRecord } from "./projection-CTvLSwcm.js";
|
|
3
3
|
import { t as createActor } from "./actor-B4DYygOB.js";
|
|
4
|
-
import { M as SYSTEM_IDENTITY_ID } from "./viewer-
|
|
5
|
-
import { f as credentialContextForActor } from "./registry-
|
|
6
|
-
import {
|
|
7
|
-
import { a as EVENT_SYSTEM_ACTOR, i as EVENT_MESSAGE_AUTHOR, o as isEventConversationMessage } from "./prompt-
|
|
8
|
-
import { C as markAgentInvocationParentMailboxAppended, a as createAgentInvocationFromLatest, c as getAgentInvocationIdForEvents, f as getAgentInvocationResultMessageId, g as getLatestAgentInvocationForConversation, l as getAgentInvocationIdForMessage, s as getAgentInvocation, u as getAgentInvocationIdForResult, v as isTerminalAgentInvocation } from "./store-
|
|
9
|
-
import { a as EVENT_WAIT_MS, c as isEventMailboxMetadata, l as renderEventBatchText, u as timerWatchCredentialSubject } from "./session-stop-
|
|
10
|
-
import { r as appendAndEnqueueInboundMessage } from "./store-
|
|
11
|
-
import { i as resolveAgentInvocationId, r as enqueueAgentInvocation, t as createAgentInvocationWorker } from "./work-
|
|
4
|
+
import { M as SYSTEM_IDENTITY_ID } from "./viewer-BFADRGP8.js";
|
|
5
|
+
import { f as credentialContextForActor } from "./registry-OsyWR4GO.js";
|
|
6
|
+
import { Ct as listUnreportedSiblingAgents } from "./agent-runner-bE7aH7ew.js";
|
|
7
|
+
import { a as EVENT_SYSTEM_ACTOR, i as EVENT_MESSAGE_AUTHOR, o as isEventConversationMessage } from "./prompt-JEWUUpLW.js";
|
|
8
|
+
import { C as markAgentInvocationParentMailboxAppended, a as createAgentInvocationFromLatest, c as getAgentInvocationIdForEvents, f as getAgentInvocationResultMessageId, g as getLatestAgentInvocationForConversation, l as getAgentInvocationIdForMessage, s as getAgentInvocation, u as getAgentInvocationIdForResult, v as isTerminalAgentInvocation } from "./store-B7Z6zIc7.js";
|
|
9
|
+
import { a as EVENT_WAIT_MS, c as isEventMailboxMetadata, l as renderEventBatchText, u as timerWatchCredentialSubject } from "./session-stop-DjIyORJw.js";
|
|
10
|
+
import { r as appendAndEnqueueInboundMessage } from "./store-Dp3RMEQd.js";
|
|
11
|
+
import { i as resolveAgentInvocationId, r as enqueueAgentInvocation, t as createAgentInvocationWorker } from "./work-DDaoxZAw.js";
|
|
12
12
|
import { z } from "zod";
|
|
13
13
|
import { createEventSource, createLocalSource, createWebSource } from "@sentry/junior-plugin-api";
|
|
14
14
|
// src/chat/conversations/web-mailbox.ts
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { A as buildConversationContext, F as markConversationMessage, I as normalizeConversationText, Kt as persistWithRetry, L as recordDeliveredAssistantMessage, S as persistConversationMessages, U as authorizationId, et as saveTurnCheckpoint, o as loadProjection, p as recordAuthorizationCompleted, t as commitAcceptedReply, x as hydrateConversationMessages, z as upsertConversationMessage } from "./projection-
|
|
2
|
-
import { S as setTags, T as withLogContext, p as logException } from "./logging-
|
|
3
|
-
import { M as SYSTEM_IDENTITY_ID, x as getConversationStore, y as getConversationEventStore } from "./viewer-
|
|
4
|
-
import { f as credentialContextForActor } from "./registry-
|
|
5
|
-
import { z as messageCardText } from "./conversation-
|
|
6
|
-
import { $ as startActiveTurn, Q as markTurnFailed } from "./store-
|
|
7
|
-
import { n as getAssistantReplyText } from "./assistant-reply-
|
|
8
|
-
import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-
|
|
9
|
-
import { a as persistThreadStateById, n as getPersistedSandboxState, o as coerceThreadConversationState, r as getPersistedThreadState } from "./thread-state-
|
|
10
|
-
import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-
|
|
11
|
-
import { i as completeAuthPauseTurn, l as buildDeliveredTurnStatePatch, t as finalizeFailedTurnReplyWithEvent, u as loadPendingMessageCards } from "./turn-failure-response-
|
|
1
|
+
import { A as buildConversationContext, F as markConversationMessage, I as normalizeConversationText, Kt as persistWithRetry, L as recordDeliveredAssistantMessage, S as persistConversationMessages, U as authorizationId, et as saveTurnCheckpoint, o as loadProjection, p as recordAuthorizationCompleted, t as commitAcceptedReply, x as hydrateConversationMessages, z as upsertConversationMessage } from "./projection-CTvLSwcm.js";
|
|
2
|
+
import { S as setTags, T as withLogContext, p as logException } from "./logging-CFHIO4Vs.js";
|
|
3
|
+
import { M as SYSTEM_IDENTITY_ID, x as getConversationStore, y as getConversationEventStore } from "./viewer-BFADRGP8.js";
|
|
4
|
+
import { f as credentialContextForActor } from "./registry-OsyWR4GO.js";
|
|
5
|
+
import { z as messageCardText } from "./conversation-BjTo9ZFL.js";
|
|
6
|
+
import { $ as startActiveTurn, Q as markTurnFailed } from "./store-B7Z6zIc7.js";
|
|
7
|
+
import { n as getAssistantReplyText } from "./assistant-reply-CjRU9Z59.js";
|
|
8
|
+
import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-DzXwXmLg.js";
|
|
9
|
+
import { a as persistThreadStateById, n as getPersistedSandboxState, o as coerceThreadConversationState, r as getPersistedThreadState } from "./thread-state-BF8VwIxd.js";
|
|
10
|
+
import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-DHBG47gS.js";
|
|
11
|
+
import { i as completeAuthPauseTurn, l as buildDeliveredTurnStatePatch, t as finalizeFailedTurnReplyWithEvent, u as loadPendingMessageCards } from "./turn-failure-response-Di7TbgsF.js";
|
|
12
12
|
import { randomUUID } from "node:crypto";
|
|
13
13
|
import { createLocalSource, localDestinationSchema } from "@sentry/junior-plugin-api";
|
|
14
14
|
// src/chat/local/runner.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { hi as sandboxEgressSignalsResponseSchema } from "./projection-CTvLSwcm.js";
|
|
2
2
|
// src/chat/local/sandbox-egress-signals.ts
|
|
3
3
|
const SANDBOX_EGRESS_SIGNALS_PATH = "/api/internal/sandbox-egress/signals";
|
|
4
4
|
const LOCAL_DEV_SERVER_TIMEOUT_MS = 1e3;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as AGENT_INVOCATION_STATUSES, u as juniorDestinationKindSchema } from "./agent-invocations-C1RNOCs8.js";
|
|
2
|
-
import { E as conversationSummaryReportSchema, F as conversationChildAgentTotalsSchema, O as conversationUsageSchema, l as conversationAuxiliaryCostsSchema, n as actorIdentitySchema } from "./conversation-
|
|
2
|
+
import { E as conversationSummaryReportSchema, F as conversationChildAgentTotalsSchema, O as conversationUsageSchema, l as conversationAuxiliaryCostsSchema, n as actorIdentitySchema } from "./conversation-BjTo9ZFL.js";
|
|
3
3
|
import { i as fillUtcHours, r as fillUtcDays, s as sumUtcHoursIntoSixHours, y as userInputRequestSchema } from "./reporting-window-DgHgwQB3.js";
|
|
4
|
-
import "./automation-
|
|
4
|
+
import "./automation-BGrd03QO.js";
|
|
5
5
|
import "./common-Eu6sx09c.js";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
import { codeChangeStateSchema, eventMatchSchema } from "@sentry/junior-plugin-api";
|
|
@@ -554,8 +554,15 @@ const reviewItemCountSchema = z.object({
|
|
|
554
554
|
* (`reviewItemNeedsUser`). Notices and items for Everyone do not count.
|
|
555
555
|
*/
|
|
556
556
|
needsViewer: z.number().int().nonnegative() }).strict();
|
|
557
|
-
/**
|
|
558
|
-
|
|
557
|
+
/**
|
|
558
|
+
* Conversations linked to an open action item assigned to the viewer. `title`
|
|
559
|
+
* is the newest such item; `count` is how many there are.
|
|
560
|
+
*/
|
|
561
|
+
const reviewItemWaitingConversationsSchema = z.object({ conversations: z.array(z.object({
|
|
562
|
+
conversationId: z.string().min(1),
|
|
563
|
+
title: z.string().min(1),
|
|
564
|
+
count: z.number().int().positive()
|
|
565
|
+
}).strict()) }).strict();
|
|
559
566
|
const reviewItemParamsSchema = z.object({ id: z.string().min(1) }).strict();
|
|
560
567
|
/** One person action on a Review item. */
|
|
561
568
|
const reviewItemActionSchema = z.discriminatedUnion("action", [
|
|
@@ -5966,9 +5966,16 @@ declare const reviewItemListSchema: z.ZodObject<{
|
|
|
5966
5966
|
declare const reviewItemCountSchema: z.ZodObject<{
|
|
5967
5967
|
needsViewer: z.ZodNumber;
|
|
5968
5968
|
}, z.core.$strict>;
|
|
5969
|
-
/**
|
|
5969
|
+
/**
|
|
5970
|
+
* Conversations linked to an open action item assigned to the viewer. `title`
|
|
5971
|
+
* is the newest such item; `count` is how many there are.
|
|
5972
|
+
*/
|
|
5970
5973
|
declare const reviewItemWaitingConversationsSchema: z.ZodObject<{
|
|
5971
|
-
|
|
5974
|
+
conversations: z.ZodArray<z.ZodObject<{
|
|
5975
|
+
conversationId: z.ZodString;
|
|
5976
|
+
title: z.ZodString;
|
|
5977
|
+
count: z.ZodNumber;
|
|
5978
|
+
}, z.core.$strict>>;
|
|
5972
5979
|
}, z.core.$strict>;
|
|
5973
5980
|
/** One person action on a Review item. */
|
|
5974
5981
|
declare const reviewItemActionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as fetchWithBoundedOAuthErrorBodies, i as resolvePluginHeaderEnvRefs } from "./registry-
|
|
1
|
+
import { H as isRecord, b as setSpanAttributes, h as logWarn } from "./logging-CFHIO4Vs.js";
|
|
2
|
+
import { c as fetchWithBoundedOAuthErrorBodies, i as resolvePluginHeaderEnvRefs } from "./registry-OsyWR4GO.js";
|
|
3
3
|
import { a as withLock, i as fenceLock, n as MUTATION_LOCK_TTL_MS } from "./locks-D-0h111u.js";
|
|
4
|
-
import { r as getStateAdapter } from "./adapter-
|
|
4
|
+
import { r as getStateAdapter } from "./adapter-dE2BiWP_.js";
|
|
5
5
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
6
6
|
import { randomUUID } from "node:crypto";
|
|
7
7
|
import { UnauthorizedError, auth } from "@modelcontextprotocol/sdk/client/auth.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
2
|
-
import { t as disconnectStateAdapter } from "./adapter-
|
|
3
|
-
import { n as finishServiceAccountSignIn, o as serviceAccountPlugins, r as getServiceAccountStatus, s as startServiceAccountSignIn, t as disconnectServiceAccount } from "./service-account-
|
|
1
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-DcJ5NHDW.js";
|
|
2
|
+
import { t as disconnectStateAdapter } from "./adapter-dE2BiWP_.js";
|
|
3
|
+
import { n as finishServiceAccountSignIn, o as serviceAccountPlugins, r as getServiceAccountStatus, s as startServiceAccountSignIn, t as disconnectServiceAccount } from "./service-account-CQIW6At4.js";
|
|
4
4
|
import { CLI_USAGE } from "./cli/run.js";
|
|
5
5
|
import { createServer } from "node:http";
|
|
6
6
|
// src/cli/service-account.ts
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
|
|
2
|
-
import {
|
|
3
|
-
import { n as botConfig } from "./config-
|
|
4
|
-
import { h as logWarn, m as logInfo, p as logException } from "./logging-
|
|
5
|
-
import { C as getSqlExecutor, M as SYSTEM_IDENTITY_ID, x as getConversationStore } from "./viewer-
|
|
2
|
+
import { Ba as buildSentryConversationUrl, Br as normalizeSlackReplyMarkdown, Ln as getPlugins, Nn as getPluginSlackConversationLink, Rr as escapeSlackMrkdwnText, Wi as verifyTimerWatchCredentialSubject, Xr as postSlackMessage, aa as getDashboardConversationLink, an as normalizeToolNameFromResult, en as isAssistantMessage, ia as JUNIOR_THREAD_STATE_TTL_MS, in as isToolResultMessage, oa as getDashboardObjectIconLink, rn as isToolResultError, ua as ToolInputError, zr as formatSlackLink } from "./projection-CTvLSwcm.js";
|
|
3
|
+
import { n as botConfig } from "./config-D0GKc9sC.js";
|
|
4
|
+
import { h as logWarn, m as logInfo, p as logException } from "./logging-CFHIO4Vs.js";
|
|
5
|
+
import { C as getSqlExecutor, M as SYSTEM_IDENTITY_ID, x as getConversationStore } from "./viewer-BFADRGP8.js";
|
|
6
6
|
import { s as juniorConversations } from "./agent-invocations-C1RNOCs8.js";
|
|
7
|
-
import "./executor-
|
|
8
|
-
import { h as credentialSubjectSchema } from "./registry-
|
|
9
|
-
import { r as getStateAdapter } from "./adapter-
|
|
10
|
-
import { r as EVENT_AUTHOR_ID } from "./prompt-
|
|
11
|
-
import { r as sanitizeAssistantText } from "./assistant-reply-
|
|
12
|
-
import { r as appendAndEnqueueInboundMessage } from "./store-
|
|
13
|
-
import { dt as CORE_EVENT_NAMESPACE, ht as eventGuidance, mt as eventCatalogEntry } from "./turn-session-routing-
|
|
7
|
+
import "./executor-j8VMt-To.js";
|
|
8
|
+
import { h as credentialSubjectSchema } from "./registry-OsyWR4GO.js";
|
|
9
|
+
import { r as getStateAdapter } from "./adapter-dE2BiWP_.js";
|
|
10
|
+
import { r as EVENT_AUTHOR_ID } from "./prompt-JEWUUpLW.js";
|
|
11
|
+
import { r as sanitizeAssistantText } from "./assistant-reply-CjRU9Z59.js";
|
|
12
|
+
import { r as appendAndEnqueueInboundMessage } from "./store-Dp3RMEQd.js";
|
|
13
|
+
import { dt as CORE_EVENT_NAMESPACE, ht as eventGuidance, mt as eventCatalogEntry } from "./turn-session-routing-CIWhXKeT.js";
|
|
14
14
|
import { z } from "zod";
|
|
15
15
|
import { eq, inArray } from "drizzle-orm";
|
|
16
16
|
import { eventMatchFieldsSchema, objectFactFields, objectPresentation, objectTypeSchema } from "@sentry/junior-plugin-api";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
|
|
2
|
-
import { h as logWarn } from "./logging-
|
|
2
|
+
import { h as logWarn } from "./logging-CFHIO4Vs.js";
|
|
3
3
|
import { s as skillRoots } from "./package-discovery-DJBompdd.js";
|
|
4
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
4
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-DcJ5NHDW.js";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
import fs from "node:fs/promises";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
|
|
2
|
-
import {
|
|
3
|
-
import { n as createAndEnqueueAgentInvocation } from "./work-
|
|
2
|
+
import { Nt as actorFromRun, Pt as toolInvocationDestination } from "./agent-runner-bE7aH7ew.js";
|
|
3
|
+
import { n as createAndEnqueueAgentInvocation } from "./work-DDaoxZAw.js";
|
|
4
4
|
// src/chat/agent-invocations/spawn.ts
|
|
5
5
|
var spawn_exports = /* @__PURE__ */ __exportAll({ bindSpawnAgent: () => bindSpawnAgent });
|
|
6
6
|
/** Bind a Run's Actor and credentials to new Agent invocations. */
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { $ as loadTurnCheckpoint, $
|
|
2
|
-
import { a as completeText, b as isProviderRetryError, m as escapeXml, r as completeDecision } from "./client-
|
|
3
|
-
import { _ as normalizeSlackEmojiName, c as getSlackClientSecret, i as getChatConfig, l as getSlackSigningSecret, n as botConfig, o as getSlackBotToken, s as getSlackClientId, v as createS3AttachmentStorage } from "./config-
|
|
4
|
-
import {
|
|
1
|
+
import { $ as loadTurnCheckpoint, $n as takeReviewItem, A as buildConversationContext, Aa as conversationArchivedForEmail, Ba as buildSentryConversationUrl, D as fallbackShortTitle, Da as createPluginLogger, En as createUserTokenStore, F as markConversationMessage, Fa as conversationNotArchivedForUser, G as AuthorizationFlowDisabledError, Ga as readAttachmentVisionSummary, Gi as SlackActionError, Ha as notInheritedByForkChild, Ht as buildTurnErrorResponse, I as normalizeConversationText, Ia as viewerConversationMembership, Ji as getHeaderString, Jn as getReviewItem, Ka as recordSlackAttachment, Ki as downloadPrivateSlackFile, Kt as persistWithRetry, L as recordDeliveredAssistantMessage, Ln as getPlugins, M as estimateConversationContextTokens, Ma as conversationHasParticipantUser, N as getConversationMessageSlackTs, Na as conversationIsMemberRoot, Oa as readConversationAccessFromSql, Oi as cancelSubscriptions, P as isHumanConversationMessage, Pa as conversationNotArchivedForEmail, Qi as normalizeSlackConversationId, R as turnHasReply, Ra as readLatestConversationBrief, S as persistConversationMessages, T as resolveConversationTitle, Ua as getSlackFileId, Ur as truncateStatusText, V as PluginCredentialFailureError, Vr as normalizeSlackStatusText, Wi as verifyTimerWatchCredentialSubject, Wn as closeReviewItem, Wr as addReactionToMessage, Xa as listConversationAnnotations, Xn as listReplyActionItems, Y as clearPendingAuth, Yi as getSlackClient, Z as wasPendingAuthStopped, Za as listConversationAnnotationsById, Zi as isDmChannel, Zr as removeReactionFromMessage, _ as recordSubscribedReplyRoute, _n as getThreadStopDecision, ao as piMessageFromHistoryItem, ar as isOnlyAssignee, at as listTurnSummaries, cn as trimTrailingAssistantMessages, ea as withSlackRetries, eo as lookupSlackUser, et as saveTurnCheckpoint, fn as buildDeterministicAssistantMessageId, gn as getSubscribedReplyPreflightDecision, hn as decideSubscribedThreadReply, i as loadConversationProjection, ia as JUNIOR_THREAD_STATE_TTL_MS, ir as canReadReviewItem, it as getTurnRecord, j as createConversationMemoryService, ja as conversationArchivedForUser, k as appendThreadContextMessages, ka as conversationArchiveTimes, lr as reviewItemReaderForUser, n as commitMessages, nr as canActOnReviewItem, nt as completeTurnRecord, o as loadProjection, ot as recordTurnSummary, p as recordAuthorizationCompleted, pn as buildDeterministicTurnId, ro as configValueSchema, rt as failTurnRecord, s as loadTurnProjection, t as commitAcceptedReply, to as createPluginCache, tt as abandonTurnRecord, w as persistConversationMessageSummaries, wn as isExperimentalFeatureEnabled, x as hydrateConversationMessages, z as upsertConversationMessage, za as readConversationEventPage } from "./projection-CTvLSwcm.js";
|
|
2
|
+
import { a as completeText, b as isProviderRetryError, c as resolveGatewayModel, m as escapeXml, r as completeDecision } from "./client-gnKpkpqP.js";
|
|
3
|
+
import { _ as normalizeSlackEmojiName, c as getSlackClientSecret, i as getChatConfig, l as getSlackSigningSecret, n as botConfig, o as getSlackBotToken, s as getSlackClientId, v as createS3AttachmentStorage } from "./config-D0GKc9sC.js";
|
|
4
|
+
import { E as withSpan, H as isRecord, S as setTags, T as withLogContext, U as toOptionalNumber, W as toOptionalString, b as setSpanAttributes, f as logError, h as logWarn, m as logInfo, n as createChatSdkLogger, o as getActiveTraceContext, p as logException, s as getActiveTraceId, t as buildTurnFailureResponse, y as setSentryUser } from "./logging-CFHIO4Vs.js";
|
|
5
5
|
import { i as getActiveSpan, r as continueTrace } from "./sentry-MDkYAVPV.js";
|
|
6
|
-
import { i as defaultModelId
|
|
6
|
+
import { i as defaultModelId } from "./model-profile-B998sjVd.js";
|
|
7
7
|
import { f as parseSlackTeamId, h as parseSlackMessageTs, i as isActorUserId, n as createSlackActor, o as isUserActor, r as createSlackResumeActor, s as parseActorUserId, t as createActor, u as parseSlackChannelId } from "./actor-B4DYygOB.js";
|
|
8
|
-
import { A as locationFromRow, C as getSqlExecutor, D as loadConversationSlackTenantIds, E as withConversationEventLock, J as hasAgentTurnUsage, N as resolveActorIdentityId, P as saveActorAvatar, Q as requireSlackDestination, S as getDb, U as parseSessionSource, W as addAgentTurnUsage, X as createSlackDestination, Y as resolveRootConversationId, f as identityAvatarUrl, h as readUserAvatarUrls, q as agentTurnUsageSchema, x as getConversationStore, y as getConversationEventStore } from "./viewer-
|
|
8
|
+
import { A as locationFromRow, C as getSqlExecutor, D as loadConversationSlackTenantIds, E as withConversationEventLock, J as hasAgentTurnUsage, N as resolveActorIdentityId, P as saveActorAvatar, Q as requireSlackDestination, S as getDb, U as parseSessionSource, W as addAgentTurnUsage, X as createSlackDestination, Y as resolveRootConversationId, f as identityAvatarUrl, h as readUserAvatarUrls, q as agentTurnUsageSchema, x as getConversationStore, y as getConversationEventStore } from "./viewer-BFADRGP8.js";
|
|
9
9
|
import { c as juniorIdentities, d as juniorDestinations, l as juniorUsers, o as conversationReadColumns, s as juniorConversations } from "./agent-invocations-C1RNOCs8.js";
|
|
10
|
-
import { C as juniorCodeChanges, _ as juniorConversationBriefs, b as juniorConversationEvents, h as juniorConversationParticipants, m as juniorConversationReadPositions } from "./executor-
|
|
11
|
-
import { g as instructionProvenanceFor, m as contextProvenance, r as isVisionImageMediaType } from "./media-
|
|
12
|
-
import { d as actorLogContext, f as credentialContextForActor } from "./registry-
|
|
13
|
-
import {
|
|
10
|
+
import { C as juniorCodeChanges, _ as juniorConversationBriefs, b as juniorConversationEvents, h as juniorConversationParticipants, m as juniorConversationReadPositions } from "./executor-j8VMt-To.js";
|
|
11
|
+
import { g as instructionProvenanceFor, m as contextProvenance, n as detectImageMediaType, r as isVisionImageMediaType } from "./media-DstkkoNP.js";
|
|
12
|
+
import { d as actorLogContext, f as credentialContextForActor } from "./registry-OsyWR4GO.js";
|
|
13
|
+
import { A as runWithSlackInstallation, F as resolveSlackChannelIdFromThreadId, I as getConversationInfo, It as shouldEmitDevAgentTrace, J as readConversationSourceTask, M as parseSlackThreadId, Mt as RetryableDeliveryError, N as readSlackRawMessageContext, Ot as buildSteeringPiMessage, P as resolveSlackChannelIdFromMessage, R as listThreadReplies, Tt as conversationSubtreeColumns, _t as storeAttachment, a as buildAuthPauseResponse, b as renderAttachmentText, dt as webActorFromEmail, ft as resolveConversationDestination, i as measureTurnCompactionWait, kt as withoutSavedSteeringMessages, lt as createConversationId, m as latestProgressStatus, n as executeAgentRun, rt as deliverReviewItemChange, t as createAgentRunner, ut as recordWebConversationActivity, wt as conversationSubtree, x as renderBlockText, z as resolveDestinationVisibility } from "./agent-runner-bE7aH7ew.js";
|
|
14
14
|
import { a as withLock, n as MUTATION_LOCK_TTL_MS, r as acquireActiveLock } from "./locks-D-0h111u.js";
|
|
15
|
-
import { r as getStateAdapter } from "./adapter-
|
|
16
|
-
import { G as readMessageAttachments, d as conversationDetailReportSchema, g as conversationFeedSchema } from "./conversation-
|
|
17
|
-
import { a as EVENT_SYSTEM_ACTOR, o as isEventConversationMessage } from "./prompt-
|
|
18
|
-
import { $ as startActiveTurn, G as TurnInputDeferredError, H as ConversationTurnBoundaryError, J as isTurnInputCommitLostError, K as getConversationTurnBoundaryError, Q as markTurnFailed, U as CooperativeTurnYieldError, W as TurnInputCommitLostError, X as markTurnClosed, Y as isTurnInputDeferredError, Z as markTurnCompleted, m as getChildAgentLabel, q as isCooperativeTurnYieldError } from "./store-
|
|
19
|
-
import { n as getAssistantReplyText } from "./assistant-reply-
|
|
20
|
-
import { A as recordFinishedTurnForAutomatedLimit, D as sendSlackReply, E as resolveSlackReplyTarget, F as finishedRunReply, I as postsRunNotices, P as deliversFinalText, S as joinMailboxText, c as isEventMailboxMetadata, i as skipInputBeforeConversationStop, l as renderEventBatchText, s as eventBatchMessageEvents, u as timerWatchCredentialSubject, w as maybePostAutomatedTurnLimitNotice, z as runDispatchOutcome } from "./session-stop-
|
|
15
|
+
import { r as getStateAdapter } from "./adapter-dE2BiWP_.js";
|
|
16
|
+
import { G as readMessageAttachments, d as conversationDetailReportSchema, g as conversationFeedSchema } from "./conversation-BjTo9ZFL.js";
|
|
17
|
+
import { a as EVENT_SYSTEM_ACTOR, o as isEventConversationMessage } from "./prompt-JEWUUpLW.js";
|
|
18
|
+
import { $ as startActiveTurn, G as TurnInputDeferredError, H as ConversationTurnBoundaryError, J as isTurnInputCommitLostError, K as getConversationTurnBoundaryError, Q as markTurnFailed, U as CooperativeTurnYieldError, W as TurnInputCommitLostError, X as markTurnClosed, Y as isTurnInputDeferredError, Z as markTurnCompleted, m as getChildAgentLabel, q as isCooperativeTurnYieldError } from "./store-B7Z6zIc7.js";
|
|
19
|
+
import { n as getAssistantReplyText } from "./assistant-reply-CjRU9Z59.js";
|
|
20
|
+
import { A as recordFinishedTurnForAutomatedLimit, D as sendSlackReply, E as resolveSlackReplyTarget, F as finishedRunReply, I as postsRunNotices, P as deliversFinalText, S as joinMailboxText, c as isEventMailboxMetadata, i as skipInputBeforeConversationStop, l as renderEventBatchText, s as eventBatchMessageEvents, u as timerWatchCredentialSubject, w as maybePostAutomatedTurnLimitNotice, z as runDispatchOutcome } from "./session-stop-DjIyORJw.js";
|
|
21
21
|
import { _ as isEmptyUserInputAnswer, v as normalizeUserInputAnswer } from "./reporting-window-DgHgwQB3.js";
|
|
22
|
-
import {
|
|
23
|
-
import { D as stopConversationWork, g as getConversationWorkState, h as getConversation, m as ensureConversationWake, r as appendAndEnqueueInboundMessage, w as requestConversationWork } from "./store-
|
|
24
|
-
import { _ as markDispatchCompleted, a as confirmDispatchMailboxAppend, d as getDispatchTurnId, g as markDispatchBlocked, h as markDispatchAwaitingResume, i as claimDispatchMailboxAppend, j as readAutomationTitlesByConversationId, l as getDispatchInputMessageId, n as resolveTurnSessionRouting, p as isTerminalDispatchStatus, s as getDispatchConversationId, t as resolveConversationRouting, u as getDispatchRecord, v as markDispatchFailed, y as markDispatchRunning } from "./turn-session-routing-
|
|
22
|
+
import { g as getTurnRequestDeadline, l as getVercelConversationWorkQueue } from "./background-compaction-queue-BYuOt3qK.js";
|
|
23
|
+
import { D as stopConversationWork, g as getConversationWorkState, h as getConversation, m as ensureConversationWake, r as appendAndEnqueueInboundMessage, w as requestConversationWork } from "./store-Dp3RMEQd.js";
|
|
24
|
+
import { _ as markDispatchCompleted, a as confirmDispatchMailboxAppend, d as getDispatchTurnId, g as markDispatchBlocked, h as markDispatchAwaitingResume, i as claimDispatchMailboxAppend, j as readAutomationTitlesByConversationId, l as getDispatchInputMessageId, n as resolveTurnSessionRouting, p as isTerminalDispatchStatus, s as getDispatchConversationId, t as resolveConversationRouting, u as getDispatchRecord, v as markDispatchFailed, y as markDispatchRunning } from "./turn-session-routing-CIWhXKeT.js";
|
|
25
25
|
import { n as healthReportSchema, t as apiErrorSchema } from "./common-Eu6sx09c.js";
|
|
26
|
-
import { a as withAgentInvocationResultActors, c as listActiveMailboxTurns, d as turnInputFactsFromConversationMessage, f as legacyWebMailboxMetadataSchema, l as resolveMailboxTurnWork, n as enqueueAgentInvocationResult, o as getAuthPausedConversationTurnId, s as getEventBatchDelayMs, t as createChildConversationWorker, u as sourceFromTurnInput } from "./result-
|
|
27
|
-
import { n as getTurnLifecycle, t as ConversationTurnLifecycleService } from "./turn-lifecycle-
|
|
28
|
-
import { a as AgentRunError, o as executeTurn } from "./work-
|
|
29
|
-
import { a as persistThreadStateById, i as persistThreadRuntimeState, n as getPersistedSandboxState, o as coerceThreadConversationState, r as getPersistedThreadState, t as getLocationConfigurationService } from "./thread-state-
|
|
30
|
-
import { c as deleteWebAuthorization, d as createPausedTurns, f as getPausedTurnRequest, h as getTurnAuthorization, m as wakePausedTurn, s as createWebAuthorization } from "./connections-
|
|
31
|
-
import { t as bindMessageAgent } from "./message-
|
|
32
|
-
import { t as bindSpawnAgent } from "./spawn-
|
|
33
|
-
import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-
|
|
34
|
-
import { a as persistAuthPauseTurnState, c as getTurnUserSlackMessageTs, i as completeAuthPauseTurn, l as buildDeliveredTurnStatePatch, n as getAgentTurnDiagnosticsAttributes, o as getTurnUserMessage, r as requireTurnFailureEventId, s as getTurnUserReplyAttachmentContext, t as finalizeFailedTurnReplyWithEvent, u as loadPendingMessageCards } from "./turn-failure-response-
|
|
26
|
+
import { a as withAgentInvocationResultActors, c as listActiveMailboxTurns, d as turnInputFactsFromConversationMessage, f as legacyWebMailboxMetadataSchema, l as resolveMailboxTurnWork, n as enqueueAgentInvocationResult, o as getAuthPausedConversationTurnId, s as getEventBatchDelayMs, t as createChildConversationWorker, u as sourceFromTurnInput } from "./result-Btdt5bSl.js";
|
|
27
|
+
import { n as getTurnLifecycle, t as ConversationTurnLifecycleService } from "./turn-lifecycle-DzXwXmLg.js";
|
|
28
|
+
import { a as AgentRunError, o as executeTurn } from "./work-DDaoxZAw.js";
|
|
29
|
+
import { a as persistThreadStateById, i as persistThreadRuntimeState, n as getPersistedSandboxState, o as coerceThreadConversationState, r as getPersistedThreadState, t as getLocationConfigurationService } from "./thread-state-BF8VwIxd.js";
|
|
30
|
+
import { c as deleteWebAuthorization, d as createPausedTurns, f as getPausedTurnRequest, h as getTurnAuthorization, m as wakePausedTurn, s as createWebAuthorization } from "./connections-DLqP5Bp1.js";
|
|
31
|
+
import { t as bindMessageAgent } from "./message-DH0cqFRS.js";
|
|
32
|
+
import { t as bindSpawnAgent } from "./spawn-Dgj4xxvO.js";
|
|
33
|
+
import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-DHBG47gS.js";
|
|
34
|
+
import { a as persistAuthPauseTurnState, c as getTurnUserSlackMessageTs, i as completeAuthPauseTurn, l as buildDeliveredTurnStatePatch, n as getAgentTurnDiagnosticsAttributes, o as getTurnUserMessage, r as requireTurnFailureEventId, s as getTurnUserReplyAttachmentContext, t as finalizeFailedTurnReplyWithEvent, u as loadPendingMessageCards } from "./turn-failure-response-Di7TbgsF.js";
|
|
35
35
|
import { createHash, createHmac, timingSafeEqual } from "node:crypto";
|
|
36
36
|
import { z } from "zod";
|
|
37
37
|
import { and, asc, desc, eq, inArray, isNotNull, isNull, max, or, sql } from "drizzle-orm";
|
|
@@ -932,11 +932,12 @@ function spanLinks({ sentryTrace }) {
|
|
|
932
932
|
*
|
|
933
933
|
* The span links to the other trace contexts and to the span that was active,
|
|
934
934
|
* such as the worker span. Without a trace context, the span is a child of the
|
|
935
|
-
* active span. A malformed trace context starts a new trace.
|
|
935
|
+
* active span. A malformed trace context starts a new trace. The span records
|
|
936
|
+
* how long the Turn waited on context compaction.
|
|
936
937
|
*/
|
|
937
938
|
async function withTurnSpan(context, input, callback) {
|
|
938
939
|
const [parent, ...others] = input?.traceContexts ?? [];
|
|
939
|
-
if (!parent) return await withSpan("chat.turn", "chat.turn", context, callback);
|
|
940
|
+
if (!parent) return await withSpan("chat.turn", "chat.turn", context, (set) => measureTurnCompactionWait(set, () => callback(set)));
|
|
940
941
|
const activeSpan = getActiveSpan();
|
|
941
942
|
const links = [...others.flatMap(spanLinks), ...activeSpan ? [{ context: activeSpan.spanContext() }] : []];
|
|
942
943
|
const { baggage, sentryTrace } = parent;
|
|
@@ -945,7 +946,7 @@ async function withTurnSpan(context, input, callback) {
|
|
|
945
946
|
sentryTrace
|
|
946
947
|
}, () => withSpan("chat.turn", "chat.turn", context, async (setSpanAttributes) => {
|
|
947
948
|
getActiveSpan()?.addLinks(links);
|
|
948
|
-
return await callback(setSpanAttributes);
|
|
949
|
+
return await measureTurnCompactionWait(setSpanAttributes, () => callback(setSpanAttributes));
|
|
949
950
|
}));
|
|
950
951
|
}
|
|
951
952
|
/**
|
|
@@ -2462,6 +2463,18 @@ function countPotentialImageAttachments(attachments) {
|
|
|
2462
2463
|
function isVisionEnabled() {
|
|
2463
2464
|
return Boolean(botConfig.visionModelId);
|
|
2464
2465
|
}
|
|
2466
|
+
/**
|
|
2467
|
+
* Report whether every profile model accepts image input. The router picks the
|
|
2468
|
+
* profile after attachments resolve, so native images need every profile to
|
|
2469
|
+
* read them.
|
|
2470
|
+
*/
|
|
2471
|
+
function profileModelsAcceptImages() {
|
|
2472
|
+
return Object.values(botConfig.profiles).every((profile) => resolveGatewayModel(profile.modelId).input.includes("image"));
|
|
2473
|
+
}
|
|
2474
|
+
/** Report whether the agent can read current-message images by any path. */
|
|
2475
|
+
function canReadImages() {
|
|
2476
|
+
return isVisionEnabled() || profileModelsAcceptImages();
|
|
2477
|
+
}
|
|
2465
2478
|
var ImageAttachmentProcessingError = class extends Error {
|
|
2466
2479
|
constructor(message) {
|
|
2467
2480
|
super(message);
|
|
@@ -2629,6 +2642,14 @@ async function resolveUserAttachmentsWithDeps(attachments, context, deps) {
|
|
|
2629
2642
|
}
|
|
2630
2643
|
continue;
|
|
2631
2644
|
}
|
|
2645
|
+
const nativeImageMediaType = isImageAttachment && profileModelsAcceptImages() ? detectImageMediaType(data) : void 0;
|
|
2646
|
+
if (nativeImageMediaType) {
|
|
2647
|
+
nextCachedImageSummaryIndex += 1;
|
|
2648
|
+
resolvedAttachment.mediaType = nativeImageMediaType;
|
|
2649
|
+
resolvedAttachment.data = data;
|
|
2650
|
+
results.push(resolvedAttachment);
|
|
2651
|
+
continue;
|
|
2652
|
+
}
|
|
2632
2653
|
if (isImageAttachment && isVisionEnabled()) {
|
|
2633
2654
|
const cachedSummary = (attachmentId ? await readAttachmentVisionSummary({
|
|
2634
2655
|
attachmentId,
|
|
@@ -3093,10 +3114,6 @@ function createSubscribedReplyPolicy(deps) {
|
|
|
3093
3114
|
// src/chat/app/services.ts
|
|
3094
3115
|
function createJuniorRuntimeServices(overrides = {}) {
|
|
3095
3116
|
const conversationMemory = createConversationMemoryService({ completeText: overrides.conversationMemory?.completeText ?? completeText });
|
|
3096
|
-
const contextCompactor = createContextCompactor({
|
|
3097
|
-
completeText: overrides.contextCompactor?.completeText ?? completeText,
|
|
3098
|
-
autoCompactionTriggerTokens: overrides.contextCompactor?.autoCompactionTriggerTokens
|
|
3099
|
-
});
|
|
3100
3117
|
const visionContext = createVisionContextService({
|
|
3101
3118
|
attachmentStorage: overrides.visionContext?.attachmentStorage,
|
|
3102
3119
|
completeText: overrides.visionContext?.completeText ?? completeText,
|
|
@@ -3110,7 +3127,6 @@ function createJuniorRuntimeServices(overrides = {}) {
|
|
|
3110
3127
|
});
|
|
3111
3128
|
return {
|
|
3112
3129
|
conversationMemory,
|
|
3113
|
-
contextCompactor,
|
|
3114
3130
|
executeTurn: async (run, saveResult) => await executeTurn(agentRunner, run, saveResult),
|
|
3115
3131
|
subscribedReplyPolicy: createSubscribedReplyPolicy({ completeDecision: overrides.subscribedReplyPolicy?.completeDecision ?? completeDecision }),
|
|
3116
3132
|
visionContext
|
|
@@ -3636,7 +3652,8 @@ async function persistThreadRuntimeStateWithRetry(conversationId, patch) {
|
|
|
3636
3652
|
}
|
|
3637
3653
|
/**
|
|
3638
3654
|
* Resolve the Pi history for this Slack turn from the most precise durable
|
|
3639
|
-
* boundary available: active turn record first, then
|
|
3655
|
+
* boundary available: active turn record first, then the projection. The
|
|
3656
|
+
* agent compacts it before its first model request.
|
|
3640
3657
|
* Both are SQL-backed; there is no thread-state fallback.
|
|
3641
3658
|
*/
|
|
3642
3659
|
async function loadPiMessagesForTurn(args) {
|
|
@@ -3646,11 +3663,7 @@ async function loadPiMessagesForTurn(args) {
|
|
|
3646
3663
|
if (sessionRecord?.piMessages.length) return { piMessages: trimTrailingAssistantMessages(sessionRecord.piMessages) };
|
|
3647
3664
|
}
|
|
3648
3665
|
const projection = await loadConversationProjection({ conversationId: args.conversationId });
|
|
3649
|
-
if (projection.messages.length > 0) return {
|
|
3650
|
-
canCompact: true,
|
|
3651
|
-
modelProfile: projection.modelProfile,
|
|
3652
|
-
piMessages: projection.messages
|
|
3653
|
-
};
|
|
3666
|
+
if (projection.messages.length > 0) return { piMessages: projection.messages };
|
|
3654
3667
|
return {};
|
|
3655
3668
|
}
|
|
3656
3669
|
/** Build the Slack caller that prepares input and delivers output for a Turn. */
|
|
@@ -3789,7 +3802,7 @@ function createSlackTurn(deps) {
|
|
|
3789
3802
|
provenance: inboundMessageProvenance(queued, teamId),
|
|
3790
3803
|
text: queued.userText,
|
|
3791
3804
|
timestampMs: queued.message.metadata.dateSent.getTime(),
|
|
3792
|
-
omittedImageAttachmentCount: !
|
|
3805
|
+
omittedImageAttachmentCount: !canReadImages() && hasPotentialImageAttachment(attachments) ? countPotentialImageAttachments(attachments) : 0,
|
|
3793
3806
|
attachments: await deps.resolveUserAttachments(attachments, {
|
|
3794
3807
|
conversationId,
|
|
3795
3808
|
threadId,
|
|
@@ -3968,13 +3981,12 @@ function createSlackTurn(deps) {
|
|
|
3968
3981
|
conversation: preparedState.conversation,
|
|
3969
3982
|
messageTs: slackMessageTs
|
|
3970
3983
|
});
|
|
3971
|
-
const omittedImageAttachmentCount = !
|
|
3984
|
+
const omittedImageAttachmentCount = !canReadImages() && hasPotentialImageAttachment(turnAttachments) ? countPotentialImageAttachments(turnAttachments) : 0;
|
|
3972
3985
|
const status = createSlackAdapterAssistantStatusSession({
|
|
3973
3986
|
channelId: assistantThreadContext?.channelId,
|
|
3974
3987
|
threadTs: assistantThreadContext?.threadTs,
|
|
3975
3988
|
getSlackAdapter: deps.getSlackAdapter
|
|
3976
3989
|
});
|
|
3977
|
-
const compactingStatus = { text: "Compacting context" };
|
|
3978
3990
|
let persistedAtLeastOnce = false;
|
|
3979
3991
|
let shouldPersistFailureState = true;
|
|
3980
3992
|
let runResultHandled = false;
|
|
@@ -4113,31 +4125,10 @@ function createSlackTurn(deps) {
|
|
|
4113
4125
|
boundaryFailureCode = "agent_run_failed";
|
|
4114
4126
|
};
|
|
4115
4127
|
try {
|
|
4116
|
-
|
|
4128
|
+
let piMessages = (await loadPiMessagesForTurn({
|
|
4117
4129
|
conversationId,
|
|
4118
4130
|
activeTurnId
|
|
4119
|
-
});
|
|
4120
|
-
let piMessages = loadedPiMessages.piMessages;
|
|
4121
|
-
if (conversationId && loadedPiMessages.canCompact && piMessages?.length) {
|
|
4122
|
-
const compaction = await deps.contextCompactor.maybeCompact({
|
|
4123
|
-
conversation: preparedState.conversation,
|
|
4124
|
-
conversationContext: preparedState.conversationContext,
|
|
4125
|
-
conversationId,
|
|
4126
|
-
metadata: {
|
|
4127
|
-
threadId,
|
|
4128
|
-
actorId: slackActorId,
|
|
4129
|
-
channelId,
|
|
4130
|
-
runId
|
|
4131
|
-
},
|
|
4132
|
-
onCompactionStart: () => status.update(compactingStatus),
|
|
4133
|
-
piMessages,
|
|
4134
|
-
modelId: modelIdForProfile(botConfig, boundProfile(botConfig, loadedPiMessages.modelProfile ?? botConfig.defaultProfile))
|
|
4135
|
-
});
|
|
4136
|
-
if (compaction.compacted) {
|
|
4137
|
-
piMessages = compaction.piMessages;
|
|
4138
|
-
await persistThreadStateById(conversationId, { conversation: preparedState.conversation });
|
|
4139
|
-
}
|
|
4140
|
-
}
|
|
4131
|
+
})).piMessages;
|
|
4141
4132
|
const hasDurablePromptHistory = Boolean(piMessages?.length);
|
|
4142
4133
|
const batchedSteeringMessages = (await resolveSteeringMessages((options.queuedMessages ?? []).filter((queued) => queued.explicitMention))).map((steering) => ({
|
|
4143
4134
|
message: buildSteeringPiMessage(steering),
|
|
@@ -4840,7 +4831,6 @@ function createSlackRuntime(options) {
|
|
|
4840
4831
|
}
|
|
4841
4832
|
});
|
|
4842
4833
|
const executeSlackTurn = createSlackTurn({
|
|
4843
|
-
contextCompactor: services.contextCompactor,
|
|
4844
4834
|
executeTurn: services.executeTurn,
|
|
4845
4835
|
getSlackAdapter: options.getSlackAdapter,
|
|
4846
4836
|
pausedTurns: options.pausedTurns ?? createPausedTurns(),
|
|
@@ -7026,6 +7016,8 @@ function notCopiedByFork() {
|
|
|
7026
7016
|
const UNCOPIED_EVENT_TYPES = /* @__PURE__ */ new Set([
|
|
7027
7017
|
"authorization_completed",
|
|
7028
7018
|
"authorization_requested",
|
|
7019
|
+
"compaction_prepared",
|
|
7020
|
+
"compaction_requested",
|
|
7029
7021
|
"guardian_action_reviewed",
|
|
7030
7022
|
"mcp_provider_connected",
|
|
7031
7023
|
"mcp_provider_connected_unowned",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { c as modelProfileSchema, u as TURN_REASONING_LEVELS } from "./model-profile-B998sjVd.js";
|
|
2
|
-
import { C as getSqlExecutor, x as getConversationStore } from "./viewer-
|
|
2
|
+
import { C as getSqlExecutor, x as getConversationStore } from "./viewer-BFADRGP8.js";
|
|
3
3
|
import { a as juniorAgentInvocations, i as juniorAgentBindings, n as AGENT_INVOCATION_PARENT_MAILBOX_STATUSES, t as AGENT_INVOCATION_MAILBOX_STATUSES } from "./agent-invocations-C1RNOCs8.js";
|
|
4
|
-
import "./executor-
|
|
5
|
-
import { p as credentialContextSchema } from "./registry-
|
|
4
|
+
import "./executor-j8VMt-To.js";
|
|
5
|
+
import { p as credentialContextSchema } from "./registry-OsyWR4GO.js";
|
|
6
6
|
import { createHash } from "node:crypto";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
import { and, asc, count, countDistinct, desc, eq, inArray, lt, ne, or, sql } from "drizzle-orm";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { At as recordConversationRetry$1, Dt as listActiveConversationIds$1, Ft as startConversationWork$1, It as steerWebPendingMessages$1, Lt as stopConversationWork$1, Mt as removeActiveConversation$1, Nt as requestAnotherSlice$1, Ot as markConversationWorkEnqueued$1, Pt as requestConversationWork$1, St as getConversationWorkState$1, _t as completeConversationStop$1, bt as drainConversationMailbox$1, dt as appendInboundMessage, ft as beginConversationResume$1, gt as clearExpiredConversationLease$1, ht as clearConsumedConversationWake$1, jt as releaseConversationWork$1, kt as recordAttemptFailure$1, lt as ackMessages$1, mt as checkInConversationWork$1, pt as cancelHumanFacingPendingMessages$1, ut as appendExclusiveInboundMessage, vt as completeConversationWork$1, xt as getConversation$1, yt as deadLetterAttempt$1 } from "./projection-
|
|
2
|
-
import { x as getConversationStore } from "./viewer-
|
|
3
|
-
import "./
|
|
1
|
+
import { At as recordConversationRetry$1, Dt as listActiveConversationIds$1, Ft as startConversationWork$1, It as steerWebPendingMessages$1, Lt as stopConversationWork$1, Mt as removeActiveConversation$1, Nt as requestAnotherSlice$1, Ot as markConversationWorkEnqueued$1, Pt as requestConversationWork$1, St as getConversationWorkState$1, _t as completeConversationStop$1, bt as drainConversationMailbox$1, dt as appendInboundMessage, ft as beginConversationResume$1, gt as clearExpiredConversationLease$1, ht as clearConsumedConversationWake$1, jt as releaseConversationWork$1, kt as recordAttemptFailure$1, lt as ackMessages$1, mt as checkInConversationWork$1, pt as cancelHumanFacingPendingMessages$1, ut as appendExclusiveInboundMessage, vt as completeConversationWork$1, xt as getConversation$1, yt as deadLetterAttempt$1 } from "./projection-CTvLSwcm.js";
|
|
2
|
+
import { x as getConversationStore } from "./viewer-BFADRGP8.js";
|
|
3
|
+
import "./background-compaction-queue-BYuOt3qK.js";
|
|
4
4
|
// src/chat/task-execution/store.ts
|
|
5
5
|
function metadataStore(options) {
|
|
6
6
|
return options.conversationStore ?? getConversationStore();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { h as logWarn } from "./logging-
|
|
2
|
-
import {
|
|
1
|
+
import { h as logWarn } from "./logging-CFHIO4Vs.js";
|
|
2
|
+
import { _ as runWithTurnRequestDeadline, f as QUEUE_SIGNATURE_MAX_AGE_MS, h as getQueueProvider, m as verifyQueueMessage, p as signQueueMessage } from "./background-compaction-queue-BYuOt3qK.js";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
// src/chat/queue/callback.ts
|
|
@@ -110,7 +110,7 @@ function pluginTaskCallback() {
|
|
|
110
110
|
maxDeliveries: PLUGIN_TASK_MAX_DELIVERIES,
|
|
111
111
|
onRejected: logPluginTaskQueueMessageRejected,
|
|
112
112
|
run: async (message) => {
|
|
113
|
-
const { processPluginTask } = await import("./task-runner-
|
|
113
|
+
const { processPluginTask } = await import("./task-runner-DHBG47gS.js").then((n) => n.r);
|
|
114
114
|
await processPluginTask(message);
|
|
115
115
|
},
|
|
116
116
|
topic: PLUGIN_TASK_QUEUE_TOPIC,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
|
|
2
|
-
import {
|
|
2
|
+
import { $t as instructionTextForProjection, Bn as coreTaskRegistrations, Da as createPluginLogger, Ea as createPluginModel, Jt as getPiMessageRole, La as createPluginConversationEvents, Ln as getPlugins, Ta as createPluginEmbedder, an as normalizeToolNameFromResult, in as isToolResultMessage, it as getTurnRecord, rn as isToolResultError, sn as stripRuntimeTurnContext, to as createPluginCache, wa as createPluginState, x as hydrateConversationMessages } from "./projection-CTvLSwcm.js";
|
|
3
3
|
import { h as parseSlackMessageTs } from "./actor-B4DYygOB.js";
|
|
4
|
-
import { S as getDb, i as readActorIdentity, x as getConversationStore } from "./viewer-
|
|
5
|
-
import { _ as sameActorIdentity } from "./media-
|
|
6
|
-
import { r as getStateAdapter } from "./adapter-
|
|
7
|
-
import { t as resolveConversationRouting, u as getDispatchRecord } from "./turn-session-routing-
|
|
8
|
-
import { o as coerceThreadConversationState, r as getPersistedThreadState } from "./thread-state-
|
|
9
|
-
import { i as pluginTaskParamsSchema, r as pluginTaskId, s as sendVercelPluginTask } from "./task-queue-
|
|
4
|
+
import { S as getDb, i as readActorIdentity, x as getConversationStore } from "./viewer-BFADRGP8.js";
|
|
5
|
+
import { _ as sameActorIdentity } from "./media-DstkkoNP.js";
|
|
6
|
+
import { r as getStateAdapter } from "./adapter-dE2BiWP_.js";
|
|
7
|
+
import { t as resolveConversationRouting, u as getDispatchRecord } from "./turn-session-routing-CIWhXKeT.js";
|
|
8
|
+
import { o as coerceThreadConversationState, r as getPersistedThreadState } from "./thread-state-BF8VwIxd.js";
|
|
9
|
+
import { i as pluginTaskParamsSchema, r as pluginTaskId, s as sendVercelPluginTask } from "./task-queue-CVQ9cWnC.js";
|
|
10
10
|
import { pluginRunContextSchema } from "@sentry/junior-plugin-api";
|
|
11
11
|
// src/chat/plugins/task-runner.ts
|
|
12
12
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { S as getDb } from "./viewer-
|
|
4
|
-
import { r as getStateAdapter } from "./adapter-
|
|
1
|
+
import { S as persistConversationMessages, ia as JUNIOR_THREAD_STATE_TTL_MS, no as createDurableLocationConfigurationService } from "./projection-CTvLSwcm.js";
|
|
2
|
+
import { H as isRecord, U as toOptionalNumber, W as toOptionalString } from "./logging-CFHIO4Vs.js";
|
|
3
|
+
import { S as getDb } from "./viewer-BFADRGP8.js";
|
|
4
|
+
import { r as getStateAdapter } from "./adapter-dE2BiWP_.js";
|
|
5
5
|
// src/chat/state/conversation.ts
|
|
6
6
|
function defaultConversationState() {
|
|
7
7
|
return {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { F as markConversationMessage,
|
|
2
|
-
import { _ as findProviderError, h as ProviderError, v as getProviderErrorAttributes, y as getProviderErrorUserMessage } from "./client-
|
|
3
|
-
import {
|
|
1
|
+
import { F as markConversationMessage, Xa as listConversationAnnotations, Y as clearPendingAuth, pn as buildDeterministicTurnId, x as hydrateConversationMessages } from "./projection-CTvLSwcm.js";
|
|
2
|
+
import { _ as findProviderError, h as ProviderError, v as getProviderErrorAttributes, y as getProviderErrorUserMessage } from "./client-gnKpkpqP.js";
|
|
3
|
+
import { H as isRecord, t as buildTurnFailureResponse } from "./logging-CFHIO4Vs.js";
|
|
4
4
|
import { h as parseSlackMessageTs } from "./actor-B4DYygOB.js";
|
|
5
|
-
import { S as getDb, y as getConversationEventStore } from "./viewer-
|
|
6
|
-
import { B as readMessageCardRefs, H as resolveMessageCards, V as removedCardSchema } from "./conversation-
|
|
7
|
-
import { D as parseAgentInvocationResultMessageId, X as markTurnClosed, Z as markTurnCompleted, p as getAgentInvocationTurnId, s as getAgentInvocation } from "./store-
|
|
8
|
-
import { a as persistThreadStateById, o as coerceThreadConversationState, r as getPersistedThreadState } from "./thread-state-
|
|
5
|
+
import { S as getDb, y as getConversationEventStore } from "./viewer-BFADRGP8.js";
|
|
6
|
+
import { B as readMessageCardRefs, H as resolveMessageCards, V as removedCardSchema } from "./conversation-BjTo9ZFL.js";
|
|
7
|
+
import { D as parseAgentInvocationResultMessageId, X as markTurnClosed, Z as markTurnCompleted, p as getAgentInvocationTurnId, s as getAgentInvocation } from "./store-B7Z6zIc7.js";
|
|
8
|
+
import { a as persistThreadStateById, o as coerceThreadConversationState, r as getPersistedThreadState } from "./thread-state-BF8VwIxd.js";
|
|
9
9
|
// src/chat/conversations/pending-cards.ts
|
|
10
10
|
/**
|
|
11
11
|
* Add the cards that tool results selected since the last visible assistant
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { y as getConversationEventStore } from "./viewer-
|
|
1
|
+
import { y as getConversationEventStore } from "./viewer-BFADRGP8.js";
|
|
2
2
|
// src/chat/conversations/turn-lifecycle.ts
|
|
3
3
|
/** Persist correlated turn lifecycle facts with retry-safe terminal exclusion. */
|
|
4
4
|
var ConversationTurnLifecycleService = class {
|