@sentry/junior 0.271.0 → 0.272.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-Bqbtr1RV.js → adapter-BDYDi1F9.js} +1 -1
- package/dist/{admin-CWBjzyN0.js → admin-Dj7EFycG.js} +1 -1
- package/dist/{agent-runner-BiHsH8O_.js → agent-runner-Cl6Usx2Y.js} +320 -271
- package/dist/api/schema.d.ts +2 -2
- package/dist/api/schema.js +4 -4
- package/dist/api.d.ts +1 -1
- package/dist/api.js +71 -29
- package/dist/{app-C81xfpNa.d.ts → app-DjZblE2J.d.ts} +2 -2
- package/dist/app.d.ts +1 -1
- package/dist/app.js +29 -36
- package/dist/{assistant-reply-DgtX9DaJ.js → assistant-reply-DN2w6JL_.js} +1 -1
- package/dist/{automation-Dwh_xcqM.js → automation-CV7g5h3A.js} +1 -1
- package/dist/{briefs-0FeSJHQ3.js → briefs-PysAqnjV.js} +4 -4
- package/dist/{catalog-runtime-Bw9kjGVu.js → catalog-runtime-BNeCWIaF.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-B0jlQSgO.js → client-FRphcDWW.js} +2 -2
- package/dist/{config-DrAeD8sr.js → config-BUP9wjiR.js} +3 -3
- package/dist/{connections-BzN2K0G9.js → connections-CesHau9u.js} +10 -10
- package/dist/{conversation-AhOVzN_k.js → conversation-BtQzLoK8.js} +12 -1
- package/dist/{conversation-privacy-D1NhUxyo.js → conversation-privacy-DiGvA9a3.js} +1 -1
- package/dist/{credential-sync-DpNWl4yy.js → credential-sync-D2odJC30.js} +14 -14
- package/dist/{credentialed-mh7HBqey.js → credentialed-CgTulRDH.js} +11 -11
- package/dist/{db-DSabI7jJ.d.ts → db-BPLmOwXf.d.ts} +11 -1
- package/dist/{executor-C2cRw0hZ.js → executor-DGDpyegI.js} +25 -7
- package/dist/instrumentation.js +2 -2
- package/dist/{job-queue-CEeLYkSj.js → job-queue-CjB97sii.js} +2 -2
- package/dist/{list-DjJJ5K0x.js → list-JZUP1yog.js} +35 -51
- package/dist/{logging-DuwXUuIY.js → logging-CjkDr-jP.js} +1 -1
- package/dist/message-D9y8PKA1.js +186 -0
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +3 -3
- package/dist/{oauth-callback-server-oM5TJt34.js → oauth-callback-server-02Pej6hj.js} +2 -2
- package/dist/{prompt-BPSdXYXV.js → prompt-vfceH0c-.js} +1 -1
- package/dist/{registry-BPtbAVFo.js → registry-7XgwNgQe.js} +1 -1
- package/dist/{resolve-D44G1jJm.js → resolve-CuuxNfWG.js} +3 -3
- package/dist/{result-CvP8c5bb.js → result-BRhb6iN1.js} +16 -12
- package/dist/{runner-FIGIKvk2.js → runner-DaWCofuS.js} +11 -11
- package/dist/{sandbox-egress-signals-C_JzucwP.js → sandbox-egress-signals-Bn6FA1UC.js} +1 -1
- package/dist/{schema-DPCvePop.d.ts → schema-CNjAzYOw.d.ts} +15 -3
- package/dist/{schema-DKZgO-xf.js → schema-D5VLF4NT.js} +3 -4
- package/dist/{service-account-1mJGRAvx.js → service-account-D9vrsi8d.js} +3 -3
- package/dist/{service-account-CHO3YXpt.js → service-account-H45LIAG2.js} +3 -3
- package/dist/{session-stop-DuUB1rwQ.js → session-stop-HKl0ECX0.js} +50 -24
- package/dist/{skills-DHK7L9Eo.js → skills-CsiKu3-g.js} +2 -2
- package/dist/{spawn-CKl_ySIq.js → spawn-DqjBxqWh.js} +2 -2
- package/dist/{store-BF2XEeQz.js → store-CPF2kzbu.js} +3 -3
- package/dist/{store-Di0E4EvU.js → store-DyVKH0QB.js} +47 -30
- package/dist/{task-queue-CC7IFtbT.js → task-queue-BbQXCcNX.js} +3 -3
- package/dist/{task-runner-DKZtMFwa.js → task-runner-ChzW5E7R.js} +6 -6
- package/dist/{thread-state-BQ1T3eeF.js → thread-state-Ds8JTsX6.js} +5 -5
- package/dist/{turn-failure-response-B5eSFoHn.js → turn-failure-response-DCMvjsA0.js} +8 -8
- package/dist/{turn-lifecycle-CTLEIEOn.js → turn-lifecycle-DM_77q33.js} +1 -1
- package/dist/{turn-session-routing-BFVp8TbU.js → turn-session-routing-BV_gX7n3.js} +12 -12
- package/dist/{validation-Cjo-3yt3.js → validation-DcGelbBi.js} +1 -1
- package/dist/{version-D30MBLLw.js → version-C48azPKq.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-D3jhuP66.js → viewer-BCRuO8Wg.js} +25 -9
- package/dist/{work-CL9QwQcl.js → work-zxkmbJAp.js} +27 -11
- package/dist/{worker-S2P7IJDI.js → worker-CNNxHF1V.js} +6 -6
- package/migrations/0072_conversation_read_positions.sql +10 -0
- package/migrations/meta/0072_snapshot.json +4064 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +4 -4
- package/dist/message-CRe3WBKc.js +0 -59
- package/migrations/AGENTS.md +0 -8
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as pluginCatalogRuntime } from "../catalog-runtime-
|
|
2
|
-
import { nt as create } from "../credentialed-
|
|
3
|
-
import { t as disconnectStateAdapter } from "../adapter-
|
|
4
|
-
import { n as resolve } from "../resolve-
|
|
1
|
+
import { n as pluginCatalogRuntime } from "../catalog-runtime-BNeCWIaF.js";
|
|
2
|
+
import { nt as create } from "../credentialed-CgTulRDH.js";
|
|
3
|
+
import { t as disconnectStateAdapter } from "../adapter-BDYDi1F9.js";
|
|
4
|
+
import { n as resolve } from "../resolve-CuuxNfWG.js";
|
|
5
5
|
// src/cli/snapshot-create.ts
|
|
6
6
|
const DEFAULT_RUNTIME = "node22";
|
|
7
7
|
const DEFAULT_TIMEOUT_MS = 6e5;
|
package/dist/cli/upgrade.d.ts
CHANGED
package/dist/cli/upgrade.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as getChatConfig } from "../config-
|
|
2
|
-
import { t as createJuniorSqlExecutor } from "../executor-
|
|
3
|
-
import { t as createPluginCatalogRuntime } from "../registry-
|
|
1
|
+
import { i as getChatConfig } from "../config-BUP9wjiR.js";
|
|
2
|
+
import { t as createJuniorSqlExecutor } from "../executor-DGDpyegI.js";
|
|
3
|
+
import { t as createPluginCatalogRuntime } from "../registry-7XgwNgQe.js";
|
|
4
4
|
import { n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "../plugins-DOm9Y6qI.js";
|
|
5
5
|
import { t as loadAppPluginSet } from "../plugin-module-Cf5gVPWP.js";
|
|
6
6
|
import { basename, dirname, join, resolve } from "node:path";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as withSpan, g as normalizeGenAiFinishReason, h as logWarn, i as extractGenAiUsageAttributes, p as logException, v as serializeGenAiAttribute } from "./logging-
|
|
2
|
-
import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-
|
|
1
|
+
import { E as withSpan, g as normalizeGenAiFinishReason, h as logWarn, i as extractGenAiUsageAttributes, p as logException, v as serializeGenAiAttribute } from "./logging-CjkDr-jP.js";
|
|
2
|
+
import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-DiGvA9a3.js";
|
|
3
3
|
import { calculateCost, completeSimple, getEnvApiKey, getModels, registerApiProvider } from "@earendil-works/pi-ai/compat";
|
|
4
4
|
import { stream as streamAnthropic, streamSimple as streamSimpleAnthropic } from "@earendil-works/pi-ai/api/anthropic-messages";
|
|
5
5
|
import { createGatewayProvider } from "@ai-sdk/gateway";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
|
|
2
|
-
import { S as toOptionalTrimmed, s as resolveGatewayModel } from "./client-
|
|
3
|
-
import { h as logWarn } from "./logging-
|
|
2
|
+
import { S as toOptionalTrimmed, s as resolveGatewayModel } from "./client-FRphcDWW.js";
|
|
3
|
+
import { h as logWarn } from "./logging-CjkDr-jP.js";
|
|
4
4
|
import { c as modelProfileSchema, d as parseTurnReasoningLevel, t as DEFAULT_MODEL_PROFILES, u as TURN_REASONING_LEVELS } from "./model-profile-B998sjVd.js";
|
|
5
5
|
import { AwsClient } from "aws4fetch";
|
|
6
6
|
// src/chat/attachments/s3.ts
|
|
@@ -264,7 +264,7 @@ const DEFAULT_HANDOFF_MODEL_ID = resolveGatewayModel(DEFAULT_MODEL_PROFILES.hand
|
|
|
264
264
|
const DEFAULT_WEB_SEARCH_MODEL_ID = resolveGatewayModel("openai/gpt-6-luna").id;
|
|
265
265
|
const DEFAULT_DECISION_MODEL_ID = "typesafe-ai/jev";
|
|
266
266
|
const DEFAULT_EMBEDDING_MODEL_ID = "openai/text-embedding-3-small";
|
|
267
|
-
const DEFAULT_IMAGE_GENERATION_MODEL_ID = "
|
|
267
|
+
const DEFAULT_IMAGE_GENERATION_MODEL_ID = "openai/gpt-image-2";
|
|
268
268
|
const DEFAULT_VISION_MODEL_ID = resolveGatewayModel("openai/gpt-5.6-sol").id;
|
|
269
269
|
function validateGatewayModelId(raw) {
|
|
270
270
|
const trimmed = toOptionalTrimmed(raw);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Cn as loadTurnCheckpoint, Dn as failTurnRecord, On as getTurnRecord, n as resolveTurnSessionRouting } from "./turn-session-routing-
|
|
2
|
-
import { n as botConfig } from "./config-
|
|
3
|
-
import { C as getSqlExecutor, F as deleteProviderIdentityForUser, P as deleteProviderIdentityForSlackUser, y as getConversationEventStore } from "./viewer-
|
|
4
|
-
import { u as hasRequiredOAuthScope } from "./registry-
|
|
5
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
6
|
-
import { c as deleteMcpServerSessionId, l as deleteMcpStoredOAuthCredentials, s as deleteMcpAuthSessionsForUserProvider } from "./agent-runner-
|
|
7
|
-
import { pt as startOAuthFlow } from "./credentialed-
|
|
8
|
-
import { r as getStateAdapter } from "./adapter-
|
|
9
|
-
import { a as getVercelConversationWorkQueue } from "./job-queue-
|
|
10
|
-
import { m as ensureConversationWake, w as requestConversationWork } from "./store-
|
|
1
|
+
import { Cn as loadTurnCheckpoint, Dn as failTurnRecord, On as getTurnRecord, n as resolveTurnSessionRouting } from "./turn-session-routing-BV_gX7n3.js";
|
|
2
|
+
import { n as botConfig } from "./config-BUP9wjiR.js";
|
|
3
|
+
import { C as getSqlExecutor, F as deleteProviderIdentityForUser, P as deleteProviderIdentityForSlackUser, y as getConversationEventStore } from "./viewer-BCRuO8Wg.js";
|
|
4
|
+
import { u as hasRequiredOAuthScope } from "./registry-7XgwNgQe.js";
|
|
5
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-BNeCWIaF.js";
|
|
6
|
+
import { c as deleteMcpServerSessionId, l as deleteMcpStoredOAuthCredentials, s as deleteMcpAuthSessionsForUserProvider } from "./agent-runner-Cl6Usx2Y.js";
|
|
7
|
+
import { pt as startOAuthFlow } from "./credentialed-CgTulRDH.js";
|
|
8
|
+
import { r as getStateAdapter } from "./adapter-BDYDi1F9.js";
|
|
9
|
+
import { a as getVercelConversationWorkQueue } from "./job-queue-CjB97sii.js";
|
|
10
|
+
import { m as ensureConversationWake, w as requestConversationWork } from "./store-CPF2kzbu.js";
|
|
11
11
|
import { z } from "zod";
|
|
12
12
|
import { randomBytes, randomUUID } from "node:crypto";
|
|
13
13
|
// src/chat/task-execution/authorized-turn.ts
|
|
@@ -230,6 +230,15 @@ function annotationCard(annotation) {
|
|
|
230
230
|
title: value.label
|
|
231
231
|
};
|
|
232
232
|
}
|
|
233
|
+
// src/api/schema/conversation-read-position.ts
|
|
234
|
+
/**
|
|
235
|
+
* How far the signed-in viewer has read a Conversation transcript.
|
|
236
|
+
*
|
|
237
|
+
* `lastReadSeq` is the event sequence of the last transcript row the viewer
|
|
238
|
+
* saw. The server keeps the highest value it receives, so it only moves
|
|
239
|
+
* forward.
|
|
240
|
+
*/
|
|
241
|
+
const conversationReadPositionSchema = z.object({ lastReadSeq: z.number().int().nonnegative() }).strict();
|
|
233
242
|
// src/api/schema/child-agent-totals.ts
|
|
234
243
|
/**
|
|
235
244
|
* The part of a Conversation total that its child agents spent, at any depth.
|
|
@@ -815,6 +824,8 @@ const conversationDetailReportSchema = conversationSummaryReportSchema.extend({
|
|
|
815
824
|
agentTree: z.array(conversationAgentTreeNodeSchema).min(2).optional(),
|
|
816
825
|
/** The viewer can fork this conversation from an assistant reply. */
|
|
817
826
|
canFork: z.boolean().optional(),
|
|
827
|
+
/** How far the signed-in viewer has read. Absent until they read. */
|
|
828
|
+
readPosition: conversationReadPositionSchema.optional(),
|
|
818
829
|
forkedFromConversationId: z.string().optional(),
|
|
819
830
|
/** Title of the fork source, when the viewer can open it. */
|
|
820
831
|
forkedFromTitle: z.string().optional(),
|
|
@@ -845,4 +856,4 @@ const conversationFeedSchema = z.object({
|
|
|
845
856
|
source: z.literal("conversation_index"),
|
|
846
857
|
generatedAt: z.string()
|
|
847
858
|
}).strict();
|
|
848
|
-
export { createConversationMessageBodySchema as A,
|
|
859
|
+
export { createConversationMessageBodySchema as A, readMessageCardRefs as B, conversationReportEventSchema as C, conversationSurfaceSchema as D, conversationSummaryReportSchema as E, conversationChildAgentTotalsSchema as F, readMessageAttachments as G, resolveMessageCards as H, conversationReadPositionSchema as I, briefOutcomeStatusSchema as J, briefCodeChangeSchema as K, annotationCard as L, forkConversationResponseSchema as M, steerConversationPendingMessagesBodySchema as N, conversationUsageSchema as O, steerConversationPendingMessagesResponseSchema as P, messageCardRef as R, conversationReportEventDataSchema as S, conversationReportStatusSchema as T, MAX_INPUT_IMAGES as U, removedCardSchema as V, MAX_INPUT_IMAGE_BYTES as W, parseBriefInput as X, conversationBriefSchema as Y, conversationParamsSchema as _, cancelConversationPendingMessagesBodySchema as a, conversationPendingMessageSchema as b, conversationAttachmentParamsSchema as c, conversationDetailReportSchema as d, conversationEventHistorySchema as f, conversationFeedSchema as g, conversationFeedQuerySchema as h, archiveConversationResponseSchema as i, forkConversationBodySchema as j, createConversationBodySchema as k, conversationAuxiliaryCostsSchema as l, conversationEventsQuerySchema as m, actorIdentitySchema as n, cancelConversationPendingMessagesResponseSchema as o, conversationEventPageSchema as p, briefLinkSchema as q, archiveConversationBodySchema as r, conversationActivityPreviewSchema as s, acceptedConversationMessageSchema as t, conversationDetailQuerySchema as u, conversationPendingAuthorizationSchema as v, conversationReportMessageEventSchema as w, conversationPendingMessagesReportSchema as x, conversationPendingMessageDeliverySchema as y, messageCardText as z };
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { It as recordAuthenticationLinked, Lt as recordAuthorizationCompleted, On as getTurnRecord, bn as getConversationPendingAuth } from "./turn-session-routing-
|
|
2
|
-
import { p as escapeXml } from "./client-
|
|
3
|
-
import { a as getRuntimeMetadata, n as botConfig } from "./config-
|
|
4
|
-
import { R as isNativeIdentityProvider, _ as runBestEffort, h as logWarn, p as logException } from "./logging-
|
|
1
|
+
import { It as recordAuthenticationLinked, Lt as recordAuthorizationCompleted, On as getTurnRecord, bn as getConversationPendingAuth } from "./turn-session-routing-BV_gX7n3.js";
|
|
2
|
+
import { p as escapeXml } from "./client-FRphcDWW.js";
|
|
3
|
+
import { a as getRuntimeMetadata, n as botConfig } from "./config-BUP9wjiR.js";
|
|
4
|
+
import { R as isNativeIdentityProvider, _ as runBestEffort, h as logWarn, p as logException } from "./logging-CjkDr-jP.js";
|
|
5
5
|
import { p as parseSlackUserId } from "./actor-B4DYygOB.js";
|
|
6
|
-
import { B as upsertLinkedIdentity, C as getSqlExecutor, I as findUserByVerifiedEmails, M as resolveActorIdentityId, o as readIdentityById } from "./viewer-
|
|
6
|
+
import { B as upsertLinkedIdentity, C as getSqlExecutor, I as findUserByVerifiedEmails, M as resolveActorIdentityId, o as readIdentityById } from "./viewer-BCRuO8Wg.js";
|
|
7
7
|
import { i as homeDir } from "./package-discovery-DJBompdd.js";
|
|
8
|
-
import { n as buildOAuthTokenRequest, r as parseOAuthTokenResponse, u as hasRequiredOAuthScope } from "./registry-
|
|
9
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
10
|
-
import { t as discoverSkills } from "./skills-
|
|
11
|
-
import { a as finalizeMcpAuthorization, d as getMcpStoredOAuthCredentials, f as putMcpStoredOAuthCredentials, o as deleteMcpAuthSession, u as getMcpAuthSession, v as lookupSlackUserProfile } from "./agent-runner-
|
|
12
|
-
import { Dn as getSlackClient, Et as postSlackMessage, dt as parseOAuthStatePayload, ft as resolveBaseUrl, i as resolvePluginOAuthAccount, n as createUserTokenStore, ut as formatProviderLabel } from "./credentialed-
|
|
8
|
+
import { n as buildOAuthTokenRequest, r as parseOAuthTokenResponse, u as hasRequiredOAuthScope } from "./registry-7XgwNgQe.js";
|
|
9
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-BNeCWIaF.js";
|
|
10
|
+
import { t as discoverSkills } from "./skills-CsiKu3-g.js";
|
|
11
|
+
import { a as finalizeMcpAuthorization, d as getMcpStoredOAuthCredentials, f as putMcpStoredOAuthCredentials, o as deleteMcpAuthSession, u as getMcpAuthSession, v as lookupSlackUserProfile } from "./agent-runner-Cl6Usx2Y.js";
|
|
12
|
+
import { Dn as getSlackClient, Et as postSlackMessage, dt as parseOAuthStatePayload, ft as resolveBaseUrl, i as resolvePluginOAuthAccount, n as createUserTokenStore, ut as formatProviderLabel } from "./credentialed-CgTulRDH.js";
|
|
13
13
|
import { r as acquireActiveLock } from "./locks-D-0h111u.js";
|
|
14
|
-
import { r as getStateAdapter } from "./adapter-
|
|
15
|
-
import { _ as getMcpProviderErrorAttributes } from "./service-account-
|
|
16
|
-
import { o as coerceThreadConversationState, r as getPersistedThreadState } from "./thread-state-
|
|
17
|
-
import { c as deleteWebAuthorization, i as readConnectedOAuthTokens, m as wakePausedTurn, p as wakeAuthorizedTurn, u as htmlCallbackResponse } from "./connections-
|
|
14
|
+
import { r as getStateAdapter } from "./adapter-BDYDi1F9.js";
|
|
15
|
+
import { _ as getMcpProviderErrorAttributes } from "./service-account-H45LIAG2.js";
|
|
16
|
+
import { o as coerceThreadConversationState, r as getPersistedThreadState } from "./thread-state-Ds8JTsX6.js";
|
|
17
|
+
import { c as deleteWebAuthorization, i as readConnectedOAuthTokens, m as wakePausedTurn, p as wakeAuthorizedTurn, u as htmlCallbackResponse } from "./connections-CesHau9u.js";
|
|
18
18
|
import { n as relayLocalOAuthCallback } from "./oauth-relay-CTygMkNx.js";
|
|
19
19
|
import path from "node:path";
|
|
20
20
|
import { z } from "zod";
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
|
|
2
|
-
import { S as toOptionalTrimmed, i as completeObject, o as embedTexts, t as GEN_AI_PROVIDER_NAME } from "./client-
|
|
3
|
-
import { i as getChatConfig, n as botConfig, o as getSlackBotToken, v as normalizeSlackEmojiName } from "./config-
|
|
4
|
-
import { B as isRecord$2, E as withSpan, a as extractGenAiUsageSummary, b as setSpanAttributes, c as getLogContextAttributes, d as logAudit, h as logWarn, m as logInfo, p as logException, y as setSentryUser } from "./logging-
|
|
2
|
+
import { S as toOptionalTrimmed, i as completeObject, o as embedTexts, t as GEN_AI_PROVIDER_NAME } from "./client-FRphcDWW.js";
|
|
3
|
+
import { i as getChatConfig, n as botConfig, o as getSlackBotToken, v as normalizeSlackEmojiName } from "./config-BUP9wjiR.js";
|
|
4
|
+
import { B as isRecord$2, E as withSpan, a as extractGenAiUsageSummary, b as setSpanAttributes, c as getLogContextAttributes, d as logAudit, h as logWarn, m as logInfo, p as logException, y as setSentryUser } from "./logging-CjkDr-jP.js";
|
|
5
5
|
import { a as getClient$1, n as captureMessage, r as continueTrace } from "./sentry-MDkYAVPV.js";
|
|
6
|
-
import { t as canExposeConversationPayload } from "./conversation-privacy-
|
|
6
|
+
import { t as canExposeConversationPayload } from "./conversation-privacy-DiGvA9a3.js";
|
|
7
7
|
import { i as defaultModelId } from "./model-profile-B998sjVd.js";
|
|
8
8
|
import { d as parseSlackChannelReferenceId, f as parseSlackTeamId, h as parseSlackMessageTs, i as isActorUserId, p as parseSlackUserId, s as parseActorUserId } from "./actor-B4DYygOB.js";
|
|
9
|
-
import { C as getSqlExecutor, D as createSqlStore, L as readUserTimezone, S as getDb, X as parseDestination, g as createCache, i as readActorIdentity, l as resolveViewerUser, n as findUserByEmailFromSql, o as readIdentityById, p as parseAvatarUrl, q as hasAgentTurnUsage, s as readIdentityByIdFromSql, y as getConversationEventStore, z as saveUserTimezone } from "./viewer-
|
|
9
|
+
import { C as getSqlExecutor, D as createSqlStore, L as readUserTimezone, S as getDb, X as parseDestination, g as createCache, i as readActorIdentity, l as resolveViewerUser, n as findUserByEmailFromSql, o as readIdentityById, p as parseAvatarUrl, q as hasAgentTurnUsage, s as readIdentityByIdFromSql, y as getConversationEventStore, z as saveUserTimezone } from "./viewer-BCRuO8Wg.js";
|
|
10
10
|
import { c as juniorIdentities, d as juniorDestinations, l as juniorUsers, s as juniorConversations } from "./agent-invocations-C1RNOCs8.js";
|
|
11
|
-
import { C as
|
|
11
|
+
import { C as juniorCodeChanges, S as juniorConversationAnnotations, T as juniorAttachments, _ as juniorConversationBriefs, a as juniorReviewItemAssignees, b as juniorConversationEvents, c as juniorReviewItems, d as juniorAutomations, h as juniorConversationParticipants, i as juniorWorkspaces, n as juniorSnapshots, o as juniorReviewItemConversations, r as juniorWorkspaceRepos, w as juniorCodeRepositories } from "./executor-DGDpyegI.js";
|
|
12
12
|
import { l as decodeStoredConversationEvent } from "./media-U6Tuz6Mi.js";
|
|
13
|
-
import { _ as CredentialUnavailableError, a as resolveAuthTokenPlaceholder, h as credentialSubjectSchema, m as credentialLogContext, o as resolvePluginCommandEnv, p as credentialContextSchema } from "./registry-
|
|
14
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
13
|
+
import { _ as CredentialUnavailableError, a as resolveAuthTokenPlaceholder, h as credentialSubjectSchema, m as credentialLogContext, o as resolvePluginCommandEnv, p as credentialContextSchema } from "./registry-7XgwNgQe.js";
|
|
14
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-BNeCWIaF.js";
|
|
15
15
|
import { r as acquireActiveLock } from "./locks-D-0h111u.js";
|
|
16
|
-
import { n as getDefaultRedisStateAdapterFor, r as getStateAdapter } from "./adapter-
|
|
16
|
+
import { n as getDefaultRedisStateAdapterFor, r as getStateAdapter } from "./adapter-BDYDi1F9.js";
|
|
17
17
|
import { i as isValidTimeZone } from "./cadence-R7Em4RjE.js";
|
|
18
|
-
import {
|
|
19
|
-
import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-
|
|
18
|
+
import { B as readMessageCardRefs, C as conversationReportEventSchema, G as readMessageAttachments, X as parseBriefInput, Y as conversationBriefSchema, w as conversationReportMessageEventSchema } from "./conversation-BtQzLoK8.js";
|
|
19
|
+
import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-vfceH0c-.js";
|
|
20
20
|
import path from "node:path";
|
|
21
21
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
22
22
|
import { z } from "zod";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./schema-
|
|
1
|
+
import "./schema-CNjAzYOw.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { Destination, Source, locationSchema } from "@sentry/junior-plugin-api";
|
|
4
4
|
import "drizzle-orm/pg-core";
|
|
@@ -149,6 +149,16 @@ interface ConversationStore {
|
|
|
149
149
|
providerDestinationId: string;
|
|
150
150
|
providerTenantId?: string;
|
|
151
151
|
}): Promise<ConversationPrivacy | undefined>;
|
|
152
|
+
/**
|
|
153
|
+
* Store live visibility for a Destination that has no Conversation yet,
|
|
154
|
+
* such as a channel that an Automation moves to.
|
|
155
|
+
*/
|
|
156
|
+
recordDestinationVisibility(args: {
|
|
157
|
+
channelName?: string;
|
|
158
|
+
destination: Destination;
|
|
159
|
+
nowMs?: number;
|
|
160
|
+
visibility: ConversationPrivacy;
|
|
161
|
+
}): Promise<void>;
|
|
152
162
|
/**
|
|
153
163
|
* Resolve one Slack channel id from a known destination display name.
|
|
154
164
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./config-
|
|
2
|
-
import { p as logException } from "./logging-
|
|
1
|
+
import "./config-BUP9wjiR.js";
|
|
2
|
+
import { p as logException } from "./logging-CjkDr-jP.js";
|
|
3
3
|
import { a as juniorAgentInvocations, c as juniorIdentities, d as juniorDestinations, f as timestamptz, i as juniorAgentBindings, l as juniorUsers, s as juniorConversations } from "./agent-invocations-C1RNOCs8.js";
|
|
4
4
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
5
5
|
import { sql } from "drizzle-orm";
|
|
@@ -239,8 +239,8 @@ const juniorConversationBindings = pgTable("junior_conversation_bindings", {
|
|
|
239
239
|
// src/db/schema/conversation-participants.ts
|
|
240
240
|
/**
|
|
241
241
|
* Materialized personal-feed membership for one linked user on one root
|
|
242
|
-
* conversation. Rows come from the root actor and from
|
|
243
|
-
*
|
|
242
|
+
* conversation. Rows come from the root actor and from the authors of Turn
|
|
243
|
+
* input messages. Thread context authors do not get a row.
|
|
244
244
|
*/
|
|
245
245
|
const juniorConversationParticipants = pgTable("junior_conversation_participants", {
|
|
246
246
|
userId: text("user_id").notNull().references(() => juniorUsers.id),
|
|
@@ -255,6 +255,23 @@ const juniorConversationParticipants = pgTable("junior_conversation_participants
|
|
|
255
255
|
index("junior_conversation_participants_user_activity_idx").on(table.userId, table.lastMessageAt.desc()),
|
|
256
256
|
index("junior_conversation_participants_root_idx").on(table.rootConversationId)
|
|
257
257
|
]);
|
|
258
|
+
// src/db/schema/conversation-read-positions.ts
|
|
259
|
+
/**
|
|
260
|
+
* How far one signed-in user has read one Conversation transcript.
|
|
261
|
+
*
|
|
262
|
+
* `last_read_seq` is the event sequence of the last transcript row the user
|
|
263
|
+
* saw. It only moves forward, so clients on several devices can write in any
|
|
264
|
+
* order.
|
|
265
|
+
*/
|
|
266
|
+
const juniorConversationReadPositions = pgTable("junior_conversation_read_positions", {
|
|
267
|
+
userId: text("user_id").notNull().references(() => juniorUsers.id),
|
|
268
|
+
conversationId: text("conversation_id").notNull().references(() => juniorConversations.conversationId),
|
|
269
|
+
lastReadSeq: integer("last_read_seq").notNull(),
|
|
270
|
+
updatedAt: timestamptz("updated_at").notNull()
|
|
271
|
+
}, (table) => [primaryKey({
|
|
272
|
+
name: "junior_conversation_read_positions_user_conversation_pk",
|
|
273
|
+
columns: [table.userId, table.conversationId]
|
|
274
|
+
})]);
|
|
258
275
|
// src/db/schema/location-configurations.ts
|
|
259
276
|
/** Durable user configuration entries scoped to provider Locations. */
|
|
260
277
|
const juniorLocationConfigurations = pgTable("junior_location_configurations", {
|
|
@@ -384,8 +401,8 @@ const juniorAutomationRuns = pgTable("junior_automation_runs", {
|
|
|
384
401
|
]);
|
|
385
402
|
// src/db/schema/review-items.ts
|
|
386
403
|
/**
|
|
387
|
-
* One Review item: something that needs a person.
|
|
388
|
-
* `
|
|
404
|
+
* One Review item: something that needs a person. An action item stores its
|
|
405
|
+
* `request`, and
|
|
389
406
|
* its `answer` after an assignee submits it. `closed_at` is set for `done`
|
|
390
407
|
* and `dismissed`. `closed_by_user_id` is null when an agent closed it.
|
|
391
408
|
*/
|
|
@@ -526,6 +543,7 @@ const juniorSqlSchema = {
|
|
|
526
543
|
juniorConversationBriefs,
|
|
527
544
|
juniorConversationBindings,
|
|
528
545
|
juniorConversationParticipants,
|
|
546
|
+
juniorConversationReadPositions,
|
|
529
547
|
juniorConversations,
|
|
530
548
|
juniorLocationConfigurations,
|
|
531
549
|
juniorDestinations,
|
|
@@ -788,4 +806,4 @@ function createJuniorSqlExecutor(args) {
|
|
|
788
806
|
statementTimeoutMs
|
|
789
807
|
});
|
|
790
808
|
}
|
|
791
|
-
export {
|
|
809
|
+
export { juniorCodeChanges as C, juniorArtifacts as E, juniorConversationAnnotations as S, juniorAttachments as T, juniorConversationBriefs as _, juniorReviewItemAssignees as a, juniorConversationEvents as b, juniorReviewItems as c, juniorAutomations as d, juniorStats as f, juniorConversationBindings as g, juniorConversationParticipants as h, juniorWorkspaces as i, juniorAutomationRuns as l, juniorConversationReadPositions as m, juniorSnapshots as n, juniorReviewItemConversations as o, juniorLocationConfigurations as p, juniorWorkspaceRepos as r, juniorReviewItemSlackCards as s, createJuniorSqlExecutor as t, juniorAutomationVersions as u, CONVERSATION_METRICS as v, juniorCodeRepositories as w, juniorApiTokens as x, juniorConversationMetrics as y };
|
package/dist/instrumentation.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { F as getDeploymentServiceVersion, I as getDeploymentTelemetryAttributes } from "./logging-
|
|
1
|
+
import { F as getDeploymentServiceVersion, I as getDeploymentTelemetryAttributes } from "./logging-CjkDr-jP.js";
|
|
2
2
|
import { a as getClient, c as init, o as getGlobalScope } from "./sentry-MDkYAVPV.js";
|
|
3
|
-
import { n as getCurrentConversationPrivacy } from "./conversation-privacy-
|
|
3
|
+
import { n as getCurrentConversationPrivacy } from "./conversation-privacy-DiGvA9a3.js";
|
|
4
4
|
import { t as consumePrivateTraceResultMarker } from "./private-trace-result-CE7_lEdq.js";
|
|
5
5
|
// src/chat/sentry-payload-filter.ts
|
|
6
6
|
const PAYLOAD_ATTRIBUTE_KEYS = /* @__PURE__ */ new Set([
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as getChatConfig } from "./config-
|
|
2
|
-
import { E as withSpan, m as logInfo, p as logException } from "./logging-
|
|
1
|
+
import { i as getChatConfig } from "./config-BUP9wjiR.js";
|
|
2
|
+
import { E as withSpan, m as logInfo, p as logException } from "./logging-CjkDr-jP.js";
|
|
3
3
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { createHash, createHmac, timingSafeEqual } from "node:crypto";
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { $t as appendThreadContextMessages, An as recordTurnSummary, Ar as trimTrailingAssistantMessages, At as loadProjection, Cn as loadTurnCheckpoint, Dn as failTurnRecord, En as completeTurnRecord, Et as commitMessages, Fr as buildDeterministicTurnId, Gt as hydrateConversationMessages, Jt as persistConversationMessageSummaries, Kt as persistConversationMessages, Lr as decideSubscribedThreadReply, Lt as recordAuthorizationCompleted, On as getTurnRecord, Ot as loadConversationProjection, Pr as buildDeterministicAssistantMessageId, Rr as getSubscribedReplyPreflightDecision, Tn as abandonTurnRecord, Tt as commitAcceptedReply, Vt as recordSubscribedReplyRoute, Wr as isExperimentalFeatureEnabled, Yr as piMessageFromHistoryItem, Yt as resolveConversationTitle, Zt as fallbackShortTitle, _ as markDispatchCompleted, a as confirmDispatchMailboxAppend, an as markConversationMessage, cn as turnHasReply, d as getDispatchTurnId, dn as PluginCredentialFailureError, en as buildConversationContext, fr as buildTurnErrorResponse, g as markDispatchBlocked, gr as persistWithRetry, h as markDispatchAwaitingResume, hn as AuthorizationFlowDisabledError, i as claimDispatchMailboxAppend, in as isHumanConversationMessage, j as readAutomationTitlesByConversationId, jt as loadTurnProjection, kn as listTurnSummaries, l as getDispatchInputMessageId, ln as upsertConversationMessage, n as resolveTurnSessionRouting, nn as estimateConversationContextTokens, on as normalizeConversationText, p as isTerminalDispatchStatus, qr as configValueSchema, rn as getConversationMessageSlackTs, s as getDispatchConversationId, sn as recordDeliveredAssistantMessage, t as resolveConversationRouting, tn as createConversationMemoryService, u as getDispatchRecord, v as markDispatchFailed, wn as saveTurnCheckpoint, xn as wasPendingAuthStopped, y as markDispatchRunning, yn as clearPendingAuth, zr as getThreadStopDecision } from "./turn-session-routing-
|
|
2
|
-
import { a as completeText, p as escapeXml, r as completeDecision, y as isProviderRetryError } from "./client-
|
|
3
|
-
import { c as getSlackClientSecret, i as getChatConfig, l as getSlackSigningSecret, n as botConfig, o as getSlackBotToken, s as getSlackClientId, v as normalizeSlackEmojiName, y as createS3AttachmentStorage } from "./config-
|
|
4
|
-
import { B as isRecord, E as withSpan, H as toOptionalString, S as setTags, T as withLogContext, V as toOptionalNumber, 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-
|
|
1
|
+
import { $t as appendThreadContextMessages, An as recordTurnSummary, Ar as trimTrailingAssistantMessages, At as loadProjection, Cn as loadTurnCheckpoint, Dn as failTurnRecord, En as completeTurnRecord, Et as commitMessages, Fr as buildDeterministicTurnId, Gt as hydrateConversationMessages, Jt as persistConversationMessageSummaries, Kt as persistConversationMessages, Lr as decideSubscribedThreadReply, Lt as recordAuthorizationCompleted, On as getTurnRecord, Ot as loadConversationProjection, Pr as buildDeterministicAssistantMessageId, Rr as getSubscribedReplyPreflightDecision, Tn as abandonTurnRecord, Tt as commitAcceptedReply, Vt as recordSubscribedReplyRoute, Wr as isExperimentalFeatureEnabled, Yr as piMessageFromHistoryItem, Yt as resolveConversationTitle, Zt as fallbackShortTitle, _ as markDispatchCompleted, a as confirmDispatchMailboxAppend, an as markConversationMessage, cn as turnHasReply, d as getDispatchTurnId, dn as PluginCredentialFailureError, en as buildConversationContext, fr as buildTurnErrorResponse, g as markDispatchBlocked, gr as persistWithRetry, h as markDispatchAwaitingResume, hn as AuthorizationFlowDisabledError, i as claimDispatchMailboxAppend, in as isHumanConversationMessage, j as readAutomationTitlesByConversationId, jt as loadTurnProjection, kn as listTurnSummaries, l as getDispatchInputMessageId, ln as upsertConversationMessage, n as resolveTurnSessionRouting, nn as estimateConversationContextTokens, on as normalizeConversationText, p as isTerminalDispatchStatus, qr as configValueSchema, rn as getConversationMessageSlackTs, s as getDispatchConversationId, sn as recordDeliveredAssistantMessage, t as resolveConversationRouting, tn as createConversationMemoryService, u as getDispatchRecord, v as markDispatchFailed, wn as saveTurnCheckpoint, xn as wasPendingAuthStopped, y as markDispatchRunning, yn as clearPendingAuth, zr as getThreadStopDecision } from "./turn-session-routing-BV_gX7n3.js";
|
|
2
|
+
import { a as completeText, p as escapeXml, r as completeDecision, y as isProviderRetryError } from "./client-FRphcDWW.js";
|
|
3
|
+
import { c as getSlackClientSecret, i as getChatConfig, l as getSlackSigningSecret, n as botConfig, o as getSlackBotToken, s as getSlackClientId, v as normalizeSlackEmojiName, y as createS3AttachmentStorage } from "./config-BUP9wjiR.js";
|
|
4
|
+
import { B as isRecord, E as withSpan, H as toOptionalString, S as setTags, T as withLogContext, V as toOptionalNumber, 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-CjkDr-jP.js";
|
|
5
5
|
import { i as getActiveSpan, r as continueTrace } from "./sentry-MDkYAVPV.js";
|
|
6
6
|
import { i as defaultModelId, r as boundProfile, s as modelIdForProfile } 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 { C as getSqlExecutor, E as loadConversationSlackTenantIds, H as parseSessionSource, M as resolveActorIdentityId, N as saveActorAvatar, S as getDb, T as withConversationEventLock, U as addAgentTurnUsage, Y as createSlackDestination, Z as requireSlackDestination, f as identityAvatarUrl, h as readUserAvatarUrls, k as locationFromRow, q as hasAgentTurnUsage, x as getConversationStore, y as getConversationEventStore } from "./viewer-
|
|
8
|
+
import { C as getSqlExecutor, E as loadConversationSlackTenantIds, H as parseSessionSource, M as resolveActorIdentityId, N as saveActorAvatar, S as getDb, T as withConversationEventLock, U as addAgentTurnUsage, Y as createSlackDestination, Z as requireSlackDestination, f as identityAvatarUrl, h as readUserAvatarUrls, k as locationFromRow, q as hasAgentTurnUsage, x as getConversationStore, y as getConversationEventStore } from "./viewer-BCRuO8Wg.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 {
|
|
10
|
+
import { C as juniorCodeChanges, _ as juniorConversationBriefs, b as juniorConversationEvents, h as juniorConversationParticipants } from "./executor-DGDpyegI.js";
|
|
11
11
|
import { g as instructionProvenanceFor, m as contextProvenance, r as isVisionImageMediaType } from "./media-U6Tuz6Mi.js";
|
|
12
|
-
import { d as actorLogContext, f as credentialContextForActor } from "./registry-
|
|
13
|
-
import {
|
|
14
|
-
import { An as normalizeSlackConversationId, Ar as lookupSlackUser, Cn as SlackActionError, Dn as getSlackClient, Dr as listConversationAnnotationsById, Dt as removeReactionFromMessage, E as listReplyActionItems, En as getHeaderString, F as isOnlyAssignee, In as JUNIOR_THREAD_STATE_TTL_MS, M as canActOnReviewItem, Mn as withSlackRetries, P as canReadReviewItem, Sn as verifyTimerWatchCredentialSubject, Sr as recordSlackAttachment, _t as normalizeSlackStatusText, ar as createPluginLogger, b as closeReviewItem, bt as addReactionToMessage, cr as conversationArchivedForEmail, dr as conversationIsMemberRoot, fr as conversationNotArchivedForEmail, jr as createPluginCache, k as takeReviewItem, kn as isDmChannel, lr as conversationArchivedForUser, mr as viewerConversationMembership, n as createUserTokenStore, on as cancelSubscriptions, or as readConversationAccessFromSql, p as getPlugins, pr as conversationNotArchivedForUser, sr as conversationArchiveTimes, ur as conversationHasParticipantUser, w as getReviewItem, wn as downloadPrivateSlackFile, xr as readAttachmentVisionSummary, yr as getSlackFileId, yt as truncateStatusText, z as reviewItemReaderForUser } from "./credentialed-
|
|
12
|
+
import { d as actorLogContext, f as credentialContextForActor } from "./registry-7XgwNgQe.js";
|
|
13
|
+
import { Ct as conversationSubtree, Dt as buildSteeringPiMessage, F as getConversationInfo, Ft as shouldEmitDevAgentTrace, L as listThreadReplies, M as readSlackRawMessageContext, N as resolveSlackChannelIdFromMessage, Ot as withoutSavedSteeringMessages, P as resolveSlackChannelIdFromThreadId, R as resolveDestinationVisibility, b as renderBlockText, ct as createConversationId, dt as resolveConversationDestination, gt as storeAttachment, i as buildAuthPauseResponse, j as parseSlackThreadId, jt as RetryableDeliveryError, k as runWithSlackInstallation, lt as recordWebConversationActivity, n as executeAgentRun, nt as deliverReviewItemChange, p as latestProgressStatus, r as createContextCompactor, t as createAgentRunner, ut as webActorFromEmail, wt as conversationSubtreeColumns, y as renderAttachmentText } from "./agent-runner-Cl6Usx2Y.js";
|
|
14
|
+
import { An as normalizeSlackConversationId, Ar as lookupSlackUser, Cn as SlackActionError, Dn as getSlackClient, Dr as listConversationAnnotationsById, Dt as removeReactionFromMessage, E as listReplyActionItems, En as getHeaderString, F as isOnlyAssignee, In as JUNIOR_THREAD_STATE_TTL_MS, M as canActOnReviewItem, Mn as withSlackRetries, P as canReadReviewItem, Sn as verifyTimerWatchCredentialSubject, Sr as recordSlackAttachment, _t as normalizeSlackStatusText, ar as createPluginLogger, b as closeReviewItem, bt as addReactionToMessage, cr as conversationArchivedForEmail, dr as conversationIsMemberRoot, fr as conversationNotArchivedForEmail, jr as createPluginCache, k as takeReviewItem, kn as isDmChannel, lr as conversationArchivedForUser, mr as viewerConversationMembership, n as createUserTokenStore, on as cancelSubscriptions, or as readConversationAccessFromSql, p as getPlugins, pr as conversationNotArchivedForUser, sr as conversationArchiveTimes, ur as conversationHasParticipantUser, w as getReviewItem, wn as downloadPrivateSlackFile, xr as readAttachmentVisionSummary, yr as getSlackFileId, yt as truncateStatusText, z as reviewItemReaderForUser } from "./credentialed-CgTulRDH.js";
|
|
15
15
|
import { a as withLock, n as MUTATION_LOCK_TTL_MS, r as acquireActiveLock } from "./locks-D-0h111u.js";
|
|
16
|
-
import { r as getStateAdapter } from "./adapter-
|
|
17
|
-
import {
|
|
18
|
-
import { a as EVENT_SYSTEM_ACTOR, o as isEventConversationMessage } from "./prompt-
|
|
19
|
-
import {
|
|
20
|
-
import { n as getAssistantReplyText } from "./assistant-reply-
|
|
21
|
-
import {
|
|
16
|
+
import { r as getStateAdapter } from "./adapter-BDYDi1F9.js";
|
|
17
|
+
import { G as readMessageAttachments, g as conversationFeedSchema } from "./conversation-BtQzLoK8.js";
|
|
18
|
+
import { a as EVENT_SYSTEM_ACTOR, o as isEventConversationMessage } from "./prompt-vfceH0c-.js";
|
|
19
|
+
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, q as isCooperativeTurnYieldError } from "./store-DyVKH0QB.js";
|
|
20
|
+
import { n as getAssistantReplyText } from "./assistant-reply-DN2w6JL_.js";
|
|
21
|
+
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-HKl0ECX0.js";
|
|
22
22
|
import { _ as isEmptyUserInputAnswer, v as normalizeUserInputAnswer } from "./reporting-window-DgHgwQB3.js";
|
|
23
|
-
import { a as getVercelConversationWorkQueue, f as getTurnRequestDeadline } from "./job-queue-
|
|
24
|
-
import { D as stopConversationWork, g as getConversationWorkState, h as getConversation, m as ensureConversationWake, r as appendAndEnqueueInboundMessage, w as requestConversationWork } from "./store-
|
|
23
|
+
import { a as getVercelConversationWorkQueue, f as getTurnRequestDeadline } from "./job-queue-CjB97sii.js";
|
|
24
|
+
import { D as stopConversationWork, g as getConversationWorkState, h as getConversation, m as ensureConversationWake, r as appendAndEnqueueInboundMessage, w as requestConversationWork } from "./store-CPF2kzbu.js";
|
|
25
25
|
import { t as healthReportSchema } from "./reporting-schema-CZREhYc-.js";
|
|
26
|
-
import { a as withAgentInvocationResultActors, c as
|
|
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-BRhb6iN1.js";
|
|
27
|
+
import { n as getTurnLifecycle, t as ConversationTurnLifecycleService } from "./turn-lifecycle-DM_77q33.js";
|
|
28
|
+
import { a as AgentRunError, o as executeTurn } from "./work-zxkmbJAp.js";
|
|
29
|
+
import { a as persistThreadStateById, i as persistThreadRuntimeState, n as getPersistedSandboxState, o as coerceThreadConversationState, r as getPersistedThreadState, t as getLocationConfigurationService } from "./thread-state-Ds8JTsX6.js";
|
|
30
|
+
import { c as deleteWebAuthorization, d as createPausedTurns, f as getPausedTurnRequest, h as getTurnAuthorization, m as wakePausedTurn, s as createWebAuthorization } from "./connections-CesHau9u.js";
|
|
31
|
+
import { t as bindMessageAgent } from "./message-D9y8PKA1.js";
|
|
32
|
+
import { t as bindSpawnAgent } from "./spawn-DqjBxqWh.js";
|
|
33
|
+
import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-ChzW5E7R.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-DCMvjsA0.js";
|
|
35
35
|
import { z } from "zod";
|
|
36
36
|
import { createHash } from "node:crypto";
|
|
37
|
-
import { and, asc, desc, eq, inArray, isNotNull, isNull,
|
|
37
|
+
import { and, asc, desc, eq, inArray, isNotNull, isNull, or, sql } from "drizzle-orm";
|
|
38
38
|
import { conversationSidebarAnnotationSchema, createSlackSource, objectTypeSchema } from "@sentry/junior-plugin-api";
|
|
39
39
|
import { alias } from "drizzle-orm/pg-core";
|
|
40
40
|
import { del, get, put } from "@vercel/blob";
|
|
@@ -471,10 +471,6 @@ function reviewItemChange(action, user) {
|
|
|
471
471
|
kind: "submitted",
|
|
472
472
|
user
|
|
473
473
|
};
|
|
474
|
-
if (action === "complete") return {
|
|
475
|
-
kind: "completed",
|
|
476
|
-
user
|
|
477
|
-
};
|
|
478
474
|
return {
|
|
479
475
|
kind: "dismissed",
|
|
480
476
|
user
|
|
@@ -499,7 +495,7 @@ function submittedAnswer(item, answer) {
|
|
|
499
495
|
}
|
|
500
496
|
/**
|
|
501
497
|
* Do one person action on a Review item and tell its linked Conversations.
|
|
502
|
-
* The first submit
|
|
498
|
+
* The first submit or dismiss closes the item for every
|
|
503
499
|
* assignee. A retry of the same close sends any missing messages again and
|
|
504
500
|
* succeeds, so a client can retry after a failure. With `firstCloseOnly`,
|
|
505
501
|
* only the call that closes the item succeeds, and every other call gets a
|
|
@@ -537,7 +533,6 @@ async function actOnReviewItem(args) {
|
|
|
537
533
|
let closedNow = false;
|
|
538
534
|
if (item.status === "open") {
|
|
539
535
|
if (!canActOnReviewItem(item, user.id)) throw new ReviewItemActionError("forbidden", "Only an assignee can act on this item.");
|
|
540
|
-
if (action === "complete" && item.kind === "action") throw new ReviewItemActionError("invalid", "An action item needs an answer. Submit it or dismiss it.");
|
|
541
536
|
const answer = action === "submit" ? submittedAnswer(item, args.answer) : void 0;
|
|
542
537
|
closedNow = await closeReviewItem(db, {
|
|
543
538
|
closedByUserId: user.id,
|
|
@@ -3518,17 +3513,6 @@ async function maybeApplyProviderDefaultConfigRequest(args) {
|
|
|
3518
3513
|
});
|
|
3519
3514
|
return { text: `Default GitHub repo set to \`${repo}\`.` };
|
|
3520
3515
|
}
|
|
3521
|
-
// src/chat/conversations/destination-visibility.ts
|
|
3522
|
-
/** Read confirmed visibility from the current signal or persisted destination. */
|
|
3523
|
-
async function resolveDestinationVisibility(args) {
|
|
3524
|
-
if (args.visibility) return args.visibility;
|
|
3525
|
-
if (args.destination.platform === "local") return "private";
|
|
3526
|
-
return await getConversationStore().getDestinationVisibility({
|
|
3527
|
-
provider: "slack",
|
|
3528
|
-
providerDestinationId: args.destination.channelId,
|
|
3529
|
-
providerTenantId: args.destination.teamId
|
|
3530
|
-
});
|
|
3531
|
-
}
|
|
3532
3516
|
// src/chat/providers/slack/input.ts
|
|
3533
3517
|
function renderRecentThreadMessageLines(conversationContext, messages) {
|
|
3534
3518
|
const messagesForContext = messages.filter((queued) => {
|
|
@@ -6393,21 +6377,21 @@ function createConversationTurnWorker(agentRunner, deliverMessage) {
|
|
|
6393
6377
|
if (stopSignal?.aborted) return await completeCancelledTurn();
|
|
6394
6378
|
if (!isResume) {
|
|
6395
6379
|
const pendingAuthorizationActorId = conversation.processing.pendingAuth?.actorId;
|
|
6396
|
-
const
|
|
6397
|
-
for (const
|
|
6380
|
+
const superseded = (await listActiveMailboxTurns(context.conversationId)).filter((record) => record.turnId !== turnId);
|
|
6381
|
+
for (const stale of superseded) {
|
|
6398
6382
|
if (stopSignal?.aborted) return await completeCancelledTurn();
|
|
6399
6383
|
await abandonTurnRecord({
|
|
6400
6384
|
conversationId: context.conversationId,
|
|
6401
|
-
turnId:
|
|
6402
|
-
errorMessage: "
|
|
6385
|
+
turnId: stale.turnId,
|
|
6386
|
+
errorMessage: "Turn superseded by new input"
|
|
6403
6387
|
});
|
|
6404
6388
|
markTurnClosed({
|
|
6405
6389
|
conversation,
|
|
6406
6390
|
nowMs: Date.now(),
|
|
6407
|
-
sessionId:
|
|
6391
|
+
sessionId: stale.turnId
|
|
6408
6392
|
});
|
|
6409
6393
|
}
|
|
6410
|
-
if (
|
|
6394
|
+
if (superseded.some((record) => record.state === "paused" && record.resumeReason === "auth") && pendingAuthorizationActorId) await deleteWebAuthorization({
|
|
6411
6395
|
actorId: pendingAuthorizationActorId,
|
|
6412
6396
|
conversationId: context.conversationId
|
|
6413
6397
|
});
|
|
@@ -7710,7 +7694,7 @@ async function readConversationParticipants(db, conversationIds) {
|
|
|
7710
7694
|
conversationId: juniorConversationEvents.conversationId,
|
|
7711
7695
|
seq: juniorConversationEvents.seq,
|
|
7712
7696
|
...identityColumns
|
|
7713
|
-
}).from(juniorConversationEvents).innerJoin(juniorIdentities, eq(juniorIdentities.id, juniorConversationEvents.actorIdentityId)).leftJoin(juniorUsers, eq(juniorUsers.id, juniorIdentities.userId)).
|
|
7697
|
+
}).from(juniorConversationEvents).innerJoin(juniorIdentities, eq(juniorIdentities.id, juniorConversationEvents.actorIdentityId)).leftJoin(juniorUsers, eq(juniorUsers.id, juniorIdentities.userId)).innerJoin(juniorConversations, eq(juniorConversations.conversationId, juniorConversationEvents.conversationId)).innerJoin(juniorConversationParticipants, and(eq(juniorConversationParticipants.userId, juniorIdentities.userId), eq(juniorConversationParticipants.rootConversationId, sql`coalesce(${juniorConversations.rootConversationId}, ${juniorConversations.conversationId})`))).where(inArray(juniorConversationEvents.conversationId, [...conversationIds])).orderBy(asc(juniorConversationEvents.conversationId), asc(juniorConversationEvents.actorIdentityId), asc(juniorConversationEvents.seq))]);
|
|
7714
7698
|
const userAvatarUrls = await readUserAvatarUrls(db, [...rootRows, ...eventRows].flatMap((row) => row.userId ? [row.userId] : []));
|
|
7715
7699
|
const ordered = /* @__PURE__ */ new Map();
|
|
7716
7700
|
const add = (conversationId, row) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _ as withScope, d as setTag, f as setUser, h as startSpan, i as getActiveSpan, l as logger, n as captureMessage, p as spanToJSON, s as getTraceData, t as captureException } from "./sentry-MDkYAVPV.js";
|
|
2
|
-
import { t as JUNIOR_VERSION } from "./version-
|
|
2
|
+
import { t as JUNIOR_VERSION } from "./version-C48azPKq.js";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { styleText } from "node:util";
|
|
5
5
|
import { ConfigError, configureSync, getConfig, getLogger } from "@logtape/logtape";
|