@sentry/junior 0.264.0 → 0.266.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/README.md +1 -1
- package/dist/{adapter-BIbMSKlG.js → adapter-eRFA_naf.js} +1 -1
- package/dist/{admin-D4d0HXax.js → admin-tILpP51p.js} +1 -1
- package/dist/{agent-runner-CvRxb09K.js → agent-runner-BtYK7bht.js} +263 -198
- package/dist/api/schema.d.ts +216 -15
- package/dist/api/schema.js +5 -5
- package/dist/api.js +109 -42
- package/dist/{app-Buc5gIWz.d.ts → app-Csbi9dW7.d.ts} +0 -4
- package/dist/app.d.ts +1 -1
- package/dist/app.js +79 -390
- package/dist/{assistant-reply-BcJj_ORj.js → assistant-reply-UyzAfZQo.js} +1 -1
- package/dist/{automation-CWX0qL8U.js → automation-BKpY9LPa.js} +31 -10
- package/dist/{briefs-BFfIE5N6.js → briefs-DgfWMU7e.js} +5 -5
- package/dist/{catalog-runtime-R53MWcMi.js → catalog-runtime-DAJjAbSx.js} +1 -1
- package/dist/cli/chat.js +15 -15
- package/dist/cli/check.js +3 -3
- package/dist/cli/init.js +4 -18
- package/dist/cli/main.js +4 -4
- package/dist/cli/plugins.js +4 -4
- package/dist/cli/snapshot-create.js +4 -4
- package/dist/cli/upgrade.js +3 -3
- package/dist/{client-DpOwh_zX.js → client-B0YZfxNy.js} +3 -8
- package/dist/{config-BxPrFVJP.js → config-C0UwYqDK.js} +100 -3
- package/dist/{connections-BnTM1nRf.js → connections-Bwu3VORi.js} +11 -10
- package/dist/{conversation-B0baEwoA.js → conversation-DF4rUcjb.js} +6 -2
- package/dist/{conversation-privacy-ueJ6i-t9.js → conversation-privacy-CY7JVjxn.js} +1 -1
- package/dist/{credential-sync-DeDkof_D.js → credential-sync-VGAMUTGp.js} +20 -20
- package/dist/{agent-hooks-D_PbluRX.js → credentialed-enF5Bf3y.js} +3316 -179
- package/dist/{executor-D3WIS4vl.js → executor-TnWbvL09.js} +10 -300
- package/dist/{history-AY8rs-FR.js → history-C84mlAwO.js} +2 -1
- package/dist/{images-5VNK_yYC.js → images-BKQqSi5W.js} +3 -3
- package/dist/instrumentation.js +41 -25
- package/dist/{job-queue-BYHonCAH.js → job-queue-DBpHmKnd.js} +53 -14
- package/dist/{logging-DNQqsQ57.js → logging-Ce0mXZ8J.js} +19 -32
- package/dist/{message-CDTJISxL.js → message-VZ3DFpGb.js} +4 -4
- package/dist/nitro.d.ts +17 -2
- package/dist/nitro.js +26 -27
- package/dist/{oauth-callback-server-Bk4rbLOs.js → oauth-callback-server-CpqWLjVY.js} +2 -2
- package/dist/{prompt-CxatQVaj.js → prompt-BcCGlmg2.js} +2 -2
- package/dist/{registry-CfdUEk4N.js → registry-1BEIPdbT.js} +1 -1
- package/dist/{resolve-BXShI336.js → resolve-BSHHkEGE.js} +7 -106
- package/dist/{result-R35jcahx.js → result-CwOpzqdh.js} +8 -8
- package/dist/{runner-IC4Drh3Y.js → runner-CEaX04kz.js} +11 -11
- package/dist/{sandbox-egress-signals-C4RIfjb8.js → sandbox-egress-signals-BwtGHwqa.js} +1 -1
- package/dist/{schema-QidbykYl.js → schema-RsaBHxRH.js} +45 -4
- package/dist/{sentry-BBUlHih9.js → sentry-MDkYAVPV.js} +3 -6
- package/dist/{service-account-DJSRo2cL.js → service-account-6wC76eBZ.js} +5 -5
- package/dist/{service-account-DifohWyX.js → service-account-Dg4lIbHm.js} +3 -3
- package/dist/{session-stop-B9RRGC-P.js → session-stop-tZOw9AJD.js} +120 -80
- package/dist/{skills-DVJmS_ZP.js → skills-DzyGN7wd.js} +2 -2
- package/dist/{spawn-DkVYGfSY.js → spawn-6rokq7l_.js} +2 -2
- package/dist/{store-BvolNnx4.js → store-DcKkzrdt.js} +3 -3
- package/dist/{store-C_mHwAnR.js → store-FALy-JQb.js} +6 -6
- package/dist/{task-queue-BcEyPhtX.js → task-queue-Bg4RS2Gy.js} +14 -19
- package/dist/{task-runner-CiQj5M_9.js → task-runner-8N5LIkSg.js} +47 -29
- package/dist/{tasks-OgXmReUv.js → tasks-DDT-J3Rf.js} +17 -2078
- package/dist/{thread-state-XFvpWXE9.js → thread-state-cprEaxgl.js} +5 -5
- package/dist/{turn-failure-response-BjBAtnVt.js → turn-failure-response-C8sMdsdX.js} +8 -8
- package/dist/{turn-lifecycle-nvKL2rul.js → turn-lifecycle-DaBVoz7h.js} +2 -2
- package/dist/{turn-session-routing-DEMxHySb.js → turn-session-routing-a9CHX-w6.js} +1 -1
- package/dist/{validation-XOFldwvE.js → validation-C2lllinq.js} +1 -1
- package/dist/{version-C9f5hdHD.js → version-oaLfxxnf.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-BuPwzOC9.js → viewer-BpE6Z3qf.js} +22 -6
- package/dist/{web-input-4t7TYLsY.js → web-input-B-bMjD1V.js} +147 -48
- package/dist/{work-C_aF6JN5.js → work-VX1SHWha.js} +52 -51
- package/dist/{worker-DR633sA-.js → worker-hook-y_Y.js} +5 -5
- package/package.json +10 -9
- package/dist/profile-ieODOp4u.js +0 -582
package/dist/api.js
CHANGED
|
@@ -1,31 +1,30 @@
|
|
|
1
|
-
import { D as AutomationConflictError, E as sameDefinitionValue, I as loadTurnProjection, O as automationRevision, S as automationDefinition,
|
|
2
|
-
import { p as escapeXml } from "./client-
|
|
3
|
-
import { f as logException, m as logWarn, p as logInfo } from "./logging-
|
|
1
|
+
import { D as AutomationConflictError, E as sameDefinitionValue, I as loadTurnProjection, O as automationRevision, S as automationDefinition, Sn as piMessageFromHistoryItem, T as readAutomationVersion, a as saveScheduledAutomation, k as requireAutomationRevision, nt as fallbackShortTitle, v as saveEventAutomation, y as setEventAutomationStatus } from "./tasks-DDT-J3Rf.js";
|
|
2
|
+
import { p as escapeXml } from "./client-B0YZfxNy.js";
|
|
3
|
+
import { f as logException, m as logWarn, p as logInfo } from "./logging-Ce0mXZ8J.js";
|
|
4
4
|
import { d as parseSlackTeamId, g as parseSlackMessageTs, l as parseSlackChannelId } from "./actor-tlxzqaRe.js";
|
|
5
|
-
import { C as
|
|
5
|
+
import { C as parseSessionSource, D as agentTurnUsageSchema, O as hasAgentTurnUsage, a as resolveViewerUser, d as getConversationStore, f as getDb, g as loadConversationSlackTenantIds, h as withConversationEventLock, k as resolveRootConversationId, l as getConversationEventStore, p as getSqlExecutor, s as updateViewerDisplayName, t as findUserByEmail, w as addAgentTurnUsage, y as locationFromRow } from "./viewer-BpE6Z3qf.js";
|
|
6
6
|
import { c as juniorIdentities, d as juniorDestinations, l as juniorUsers, o as conversationReadColumns, s as juniorConversations } from "./agent-invocations-CxKldAeB.js";
|
|
7
|
-
import { f as juniorConversationBriefs, g as juniorApiTokens, h as juniorConversationEvents, m as juniorConversationMetrics, u as juniorConversationParticipants, v as juniorCodeChanges, y as juniorCodeRepositories } from "./executor-
|
|
8
|
-
import { d as contextProvenance } from "./history-
|
|
9
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
10
|
-
import { F as AutomationEditError,
|
|
11
|
-
import {
|
|
7
|
+
import { f as juniorConversationBriefs, g as juniorApiTokens, h as juniorConversationEvents, m as juniorConversationMetrics, u as juniorConversationParticipants, v as juniorCodeChanges, y as juniorCodeRepositories } from "./executor-TnWbvL09.js";
|
|
8
|
+
import { d as contextProvenance } from "./history-C84mlAwO.js";
|
|
9
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-DAJjAbSx.js";
|
|
10
|
+
import { F as AutomationEditError, K as conversationSubtree, P as editEventAutomation, R as resolveTaskOutcomes, S as readLiveAttachment, T as parseSlackThreadId, W as listChildAgents, j as editScheduledAutomation, m as readStats, q as conversationSubtreeColumns, z as listOwnedWatches } from "./agent-runner-BtYK7bht.js";
|
|
11
|
+
import { An as createPluginLogger, C as listWorkspaces, E as WorkspaceValidationError, Fn as conversationHasParticipantUser, Hn as readConversationEventPage, In as conversationIsMemberRoot, Ln as conversationNotArchivedForEmail, M as create, Mn as conversationArchiveTimes, N as hash, Nn as conversationArchivedForEmail, Pn as conversationArchivedForUser, Qn as listConversationAnnotationsById, Rn as conversationNotArchivedForUser, T as updateWorkspace, Un as buildSentryConversationUrl, Vn as readLatestConversationBrief, Zn as listConversationAnnotations, an as withSlackRetries, b as deleteWorkspace, en as getSlackClient, j as SANDBOX_RUNTIME, jn as readConversationAccessFromSql, n as createUserTokenStore, nr as createPluginCache, p as getPlugins, tr as lookupSlackUser, w as listWorkspacesByRepository, wt as workspaceRepoCheckoutPath, x as getWorkspace, y as createWorkspace, zn as viewerConversationMembership } from "./credentialed-enF5Bf3y.js";
|
|
12
12
|
import { t as getFirstRunAtMs } from "./cadence-R7Em4RjE.js";
|
|
13
|
-
import { A as forkConversationResponseSchema, B as readMessageAttachments, D as createConversationBodySchema, O as createConversationMessageBodySchema, V as INPUT_IMAGE_TYPES, _ as conversationParamsSchema, a as cancelConversationPendingMessagesBodySchema, c as conversationAttachmentParamsSchema, d as conversationDetailReportSchema, g as conversationFeedSchema, h as conversationFeedQuerySchema, i as archiveConversationResponseSchema, k as forkConversationBodySchema, m as conversationEventsQuerySchema, o as cancelConversationPendingMessagesResponseSchema, p as conversationEventPageSchema, r as archiveConversationBodySchema, t as acceptedConversationMessageSchema, u as conversationDetailQuerySchema, x as conversationPendingMessagesReportSchema } from "./conversation-
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { a as
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import { M as compileScheduleIntent, P as weekdaySchema, _ as automationSummarySchema, b as automationVersionListSchema, c as automationLifecycleSchema, d as automationParamsSchema, f as automationRunListSchema, g as automationSchedulePreviewSchema, h as automationScheduleIntentSchema, i as automationExecutionListSchema, j as ScheduleIntentError, l as automationListQuerySchema, n as automationEditSchema, r as automationEventCatalogSchema, t as automationEditErrorSchema, u as automationListSchema, v as automationUpdateSchema, x as automationVersionParamsSchema, y as automationVersionActivateSchema } from "./automation-CWX0qL8U.js";
|
|
13
|
+
import { A as forkConversationResponseSchema, B as readMessageAttachments, D as createConversationBodySchema, O as createConversationMessageBodySchema, V as INPUT_IMAGE_TYPES, _ as conversationParamsSchema, a as cancelConversationPendingMessagesBodySchema, c as conversationAttachmentParamsSchema, d as conversationDetailReportSchema, g as conversationFeedSchema, h as conversationFeedQuerySchema, i as archiveConversationResponseSchema, k as forkConversationBodySchema, m as conversationEventsQuerySchema, o as cancelConversationPendingMessagesResponseSchema, p as conversationEventPageSchema, r as archiveConversationBodySchema, t as acceptedConversationMessageSchema, u as conversationDetailQuerySchema, x as conversationPendingMessagesReportSchema } from "./conversation-DF4rUcjb.js";
|
|
14
|
+
import { h as getChildAgentLabel } from "./store-DcKkzrdt.js";
|
|
15
|
+
import { d as getEventCatalog, x as automationEventCatalog } from "./session-stop-tZOw9AJD.js";
|
|
16
|
+
import { s as getSandboxResources, t as getCachedSnapshot } from "./resolve-BSHHkEGE.js";
|
|
17
|
+
import { a as getVercelConversationWorkQueue } from "./job-queue-DBpHmKnd.js";
|
|
18
|
+
import { a as cancelHumanFacingPendingMessages, h as getConversation } from "./store-FALy-JQb.js";
|
|
19
|
+
import { n as finishServiceAccountSignIn, o as serviceAccountPlugins, r as getServiceAccountStatus, s as startServiceAccountSignIn, t as disconnectServiceAccount } from "./service-account-6wC76eBZ.js";
|
|
20
|
+
import { M as compileScheduleIntent, P as weekdaySchema, _ as automationSummarySchema, b as automationVersionListSchema, c as automationLifecycleSchema, d as automationParamsSchema, f as automationRunListSchema, g as automationSchedulePreviewSchema, h as automationScheduleIntentSchema, i as automationExecutionListSchema, j as ScheduleIntentError, l as automationListQuerySchema, n as automationEditSchema, r as automationEventCatalogSchema, t as automationEditErrorSchema, u as automationListSchema, v as automationUpdateSchema, x as automationVersionParamsSchema, y as automationVersionActivateSchema } from "./automation-BKpY9LPa.js";
|
|
22
21
|
import { C as skillReportsSchema, a as fillUtcHours, b as pluginsSchema, c as sumUtcHoursIntoSixHours, d as trailingUtcSixHourWindow, f as utcDayKey, h as pluginOperationalReportFeedSchema, i as fillUtcDays, l as trailingUtcDayWindow, m as healthReportSchema, n as DAY_MS$1, o as fillUtcSixHours, p as utcHourKey, r as HOUR_MS$1, s as startOfUtcHour, u as trailingUtcHourWindow, x as runtimeInfoReportSchema } from "./web-message-id-CJSUiksE.js";
|
|
23
|
-
import { B as readHealthReport, I as
|
|
24
|
-
import { F as conversationAggregateColumns, I as conversationRangeColumns, M as readAutomationTitlesByConversationId, P as conversationActiveDaysColumn } from "./task-runner-
|
|
25
|
-
import { d as legacyWebMailboxMetadataSchema } from "./result-
|
|
26
|
-
import { a as startConnection, l as getWebAuthorization, n as isConnectableProvider, r as listConnections, t as disconnectConnection, u as htmlCallbackResponse } from "./connections-
|
|
27
|
-
import { t as decodeInputImages } from "./images-
|
|
28
|
-
import { A as activityHours$1, C as personParamsSchema, D as locationDirectoryReportSchema, E as locationDetailReportSchema, H as codePersonReportSchema, I as disconnectConnectionResponseSchema,
|
|
22
|
+
import { B as readHealthReport, I as getAttachmentStorage, _ as readViewerAutomationRuns, a as recordWebConversationActivity, b as readViewerAutomations, d as resolveSlackConversationContextFromThreadId, g as readViewerAutomationExecutions, h as readConversationSourceTask, i as createConversationId, k as stopConversationTurn, l as getProductionSlackAdapter, m as deleteViewerTask, o as webActorFromEmail, p as ViewerTaskNotFoundError, r as createAndEnqueueConversation, t as appendAndEnqueueWebMessage, u as formatSlackConversationRedactedLabel, v as readViewerAutomationSummary, w as clearSlackPendingReactions, x as resolveViewerTaskCandidate, y as readViewerAutomationVersions } from "./web-input-B-bMjD1V.js";
|
|
23
|
+
import { F as conversationAggregateColumns, I as conversationRangeColumns, M as readAutomationTitlesByConversationId, P as conversationActiveDaysColumn } from "./task-runner-8N5LIkSg.js";
|
|
24
|
+
import { d as legacyWebMailboxMetadataSchema } from "./result-CwOpzqdh.js";
|
|
25
|
+
import { a as startConnection, l as getWebAuthorization, n as isConnectableProvider, r as listConnections, t as disconnectConnection, u as htmlCallbackResponse } from "./connections-Bwu3VORi.js";
|
|
26
|
+
import { t as decodeInputImages } from "./images-BKQqSi5W.js";
|
|
27
|
+
import { A as activityHours$1, C as personParamsSchema, D as locationDirectoryReportSchema, E as locationDetailReportSchema, H as codePersonReportSchema, I as disconnectConnectionResponseSchema, L as startConnectionResponseSchema, N as connectionListSchema, O as locationParamsSchema, P as connectionParamsSchema, Q as apiErrorSchema, S as actorProfileReportSchema, U as codeRepositoryParamsSchema, V as codeOverviewReportSchema, W as codeRepositoryReportSchema, X as stopConversationTurnResponseSchema, Y as conversationChildAgentsReportSchema, Z as conversationStatsReportSchema, _ as personalTokenListSchema, a as workspaceBodySchema, b as revokePersonalTokenResponseSchema, d as serviceAccountListSchema, f as serviceAccountParamsSchema, g as createdPersonalTokenSchema, h as createPersonalTokenBodySchema, i as deleteWorkspaceResponseSchema, j as activitySixHours$1, k as activityDays$1, l as workspaceSchema, m as startServiceAccountSignInResponseSchema, n as statsReportSchema, o as workspaceListSchema, q as conversationWatchesReportSchema, s as workspaceParamsSchema, u as disconnectServiceAccountResponseSchema, w as personalSpendReportSchema, x as actorDirectoryReportSchema, y as personalTokenParamsSchema } from "./schema-RsaBHxRH.js";
|
|
29
28
|
import { Hono } from "hono";
|
|
30
29
|
import path from "node:path";
|
|
31
30
|
import { z } from "zod";
|
|
@@ -889,6 +888,21 @@ function decodeConversationCursor(args) {
|
|
|
889
888
|
return;
|
|
890
889
|
}
|
|
891
890
|
}
|
|
891
|
+
// src/api/conversations/first-message.ts
|
|
892
|
+
/**
|
|
893
|
+
* Read the text of the first human message for each untitled conversation.
|
|
894
|
+
* Read-time titles use it while the generated title is still unset.
|
|
895
|
+
*/
|
|
896
|
+
async function readFirstHumanMessageTexts(db, conversations) {
|
|
897
|
+
const untitledIds = conversations.flatMap((conversation) => conversation.title ? [] : [conversation.conversationId]);
|
|
898
|
+
if (untitledIds.length === 0) return /* @__PURE__ */ new Map();
|
|
899
|
+
const text = sql`${juniorConversationEvents.payload}->>'text'`;
|
|
900
|
+
const rows = await db.selectDistinctOn([juniorConversationEvents.conversationId], {
|
|
901
|
+
conversationId: juniorConversationEvents.conversationId,
|
|
902
|
+
text: text.as("text")
|
|
903
|
+
}).from(juniorConversationEvents).where(and(inArray(juniorConversationEvents.conversationId, untitledIds), eq(juniorConversationEvents.type, "message"), sql`${juniorConversationEvents.payload}->>'role' = 'user'`, sql`coalesce(${juniorConversationEvents.payload}->'meta'->'author'->>'isBot', 'false') <> 'true'`, isNotNull(sql`nullif(btrim(${text}), '')`))).orderBy(juniorConversationEvents.conversationId, asc(juniorConversationEvents.createdAt), asc(juniorConversationEvents.seq));
|
|
904
|
+
return new Map(rows.map((row) => [row.conversationId, row.text]));
|
|
905
|
+
}
|
|
892
906
|
// src/api/mentions.ts
|
|
893
907
|
const SLACK_USER_MENTION_RE = /<@([UW][A-Z0-9]+)(?:\|[^<>]*)?>/g;
|
|
894
908
|
function mentionedSlackUserIds(texts) {
|
|
@@ -1102,7 +1116,7 @@ function titleFromConversation(args) {
|
|
|
1102
1116
|
return (args.canViewPrivateContent ? void 0 : privateConversationLabel(slackConversation)) ?? args.conversation.title ?? args.automationTitle ?? slackStatsLocationLabel({
|
|
1103
1117
|
channel: slackThread?.channelId,
|
|
1104
1118
|
channelName: effectiveChannelName
|
|
1105
|
-
}) ?? (args.conversation.source === "plugin" ? "Automation run" : surfaceFallbackLabel(args.surface));
|
|
1119
|
+
}) ?? (args.conversation.source === "plugin" ? "Automation run" : fallbackShortTitle(args.firstHumanMessageText ?? "", surfaceFallbackLabel(args.surface)));
|
|
1106
1120
|
}
|
|
1107
1121
|
function channelNameFromConversation(conversation, canViewPrivateContent, visibility) {
|
|
1108
1122
|
const effectiveChannelName = conversation.channelName;
|
|
@@ -1156,6 +1170,7 @@ function conversationSummaryFromStoredConversation(args) {
|
|
|
1156
1170
|
automationTitle: args.automationTitle,
|
|
1157
1171
|
canViewPrivateContent,
|
|
1158
1172
|
conversation,
|
|
1173
|
+
firstHumanMessageText: args.firstHumanMessageText,
|
|
1159
1174
|
surface,
|
|
1160
1175
|
visibility
|
|
1161
1176
|
}),
|
|
@@ -1482,7 +1497,7 @@ async function readConversationFeedFromSql(options = {}) {
|
|
|
1482
1497
|
} : void 0);
|
|
1483
1498
|
const conversations = rows.map((row) => conversationFromRow(row));
|
|
1484
1499
|
const conversationIds = conversations.map((conversation) => conversation.conversationId);
|
|
1485
|
-
const [accessByConversation, archiveTimesByConversation, annotationsByConversation, auxiliaryCostsByRoot, metricsByRoot, participantsByConversation, teamDomainByTeamId, conversationWork, lastUserMessageAtByConversation, activityPreviewByConversation, automationTitleByConversation] = await Promise.all([
|
|
1500
|
+
const [accessByConversation, archiveTimesByConversation, annotationsByConversation, auxiliaryCostsByRoot, metricsByRoot, participantsByConversation, teamDomainByTeamId, conversationWork, lastUserMessageAtByConversation, activityPreviewByConversation, automationTitleByConversation, firstHumanMessageTextByConversation] = await Promise.all([
|
|
1486
1501
|
readConversationAccessFromSql(db, conversationIds, options.viewer),
|
|
1487
1502
|
conversationArchiveTimes(db, conversationIds, filter?.kind === "viewer" ? { userId: filter.userId } : filter?.kind === "actorEmail" ? { email: filter.email } : void 0),
|
|
1488
1503
|
listConversationAnnotationsById(db, conversationIds),
|
|
@@ -1493,7 +1508,8 @@ async function readConversationFeedFromSql(options = {}) {
|
|
|
1493
1508
|
listConversationWork(conversationIds),
|
|
1494
1509
|
readLastUserMessageAtByConversation(db, conversationIds),
|
|
1495
1510
|
readConversationActivityPreviews(db, conversationIds),
|
|
1496
|
-
readAutomationTitlesByConversationId(conversations)
|
|
1511
|
+
readAutomationTitlesByConversationId(conversations),
|
|
1512
|
+
readFirstHumanMessageTexts(db, conversations)
|
|
1497
1513
|
]);
|
|
1498
1514
|
const visibleActivityPreviews = await attachActivityPreviewMentions(getSqlExecutor(), new Map([...activityPreviewByConversation].filter(([conversationId]) => accessByConversation.get(conversationId)?.canViewPrivateContent)));
|
|
1499
1515
|
const sidebarAnnotationsByConversation = await listConversationSidebarAnnotations(conversationIds, new Map(conversationIds.map((conversationId) => [conversationId, accessByConversation.get(conversationId)?.canViewPrivateContent ? annotationsByConversation.get(conversationId) ?? [] : []])));
|
|
@@ -1515,6 +1531,7 @@ async function readConversationFeedFromSql(options = {}) {
|
|
|
1515
1531
|
auxiliaryCosts: auxiliaryCosts?.total,
|
|
1516
1532
|
...childAgentTotals ? { childAgentTotals } : void 0,
|
|
1517
1533
|
durationMs: metrics?.durationMs ?? row.conversation.durationMs,
|
|
1534
|
+
firstHumanMessageText: firstHumanMessageTextByConversation.get(conversation.conversationId),
|
|
1518
1535
|
teamDomainByTeamId,
|
|
1519
1536
|
...row.location?.visibility === "public" ? { locationId: row.location.id } : void 0,
|
|
1520
1537
|
usage: metrics?.usage ?? row.conversation.usage ?? void 0
|
|
@@ -1627,7 +1644,11 @@ async function readConversationAgentTree(conversationId, viewer) {
|
|
|
1627
1644
|
}
|
|
1628
1645
|
if (ids.length < 2) return;
|
|
1629
1646
|
const root = parentId ? void 0 : await getConversationStore().get({ conversationId: ids[0] });
|
|
1630
|
-
const [access, automationTitleByConversation] = await Promise.all([
|
|
1647
|
+
const [access, automationTitleByConversation, firstHumanMessageTextByConversation] = await Promise.all([
|
|
1648
|
+
readConversationAccessFromSql(getDb(), ids, viewer),
|
|
1649
|
+
readAutomationTitlesByConversationId(root ? [root] : []),
|
|
1650
|
+
readFirstHumanMessageTexts(getDb(), root ? [root] : [])
|
|
1651
|
+
]);
|
|
1631
1652
|
return await Promise.all(ids.map(async (id) => {
|
|
1632
1653
|
const itemAccess = access.get(id);
|
|
1633
1654
|
if (root?.conversationId === id) return {
|
|
@@ -1636,7 +1657,8 @@ async function readConversationAgentTree(conversationId, viewer) {
|
|
|
1636
1657
|
access: itemAccess,
|
|
1637
1658
|
automationTitle: automationTitleByConversation.get(id),
|
|
1638
1659
|
conversation: root,
|
|
1639
|
-
durationMs: 0
|
|
1660
|
+
durationMs: 0,
|
|
1661
|
+
firstHumanMessageText: firstHumanMessageTextByConversation.get(id)
|
|
1640
1662
|
}).displayTitle
|
|
1641
1663
|
};
|
|
1642
1664
|
if (!itemAccess?.canViewPrivateContent) return {
|
|
@@ -1668,6 +1690,7 @@ function projectConversationDetail(args) {
|
|
|
1668
1690
|
...args.childAgentTotals ? { childAgentTotals: args.childAgentTotals } : void 0,
|
|
1669
1691
|
conversation,
|
|
1670
1692
|
durationMs: args.durationMs,
|
|
1693
|
+
firstHumanMessageText: args.firstHumanMessageText,
|
|
1671
1694
|
...args.locationId ? { locationId: args.locationId } : void 0,
|
|
1672
1695
|
...args.teamDomainByTeamId ? { teamDomainByTeamId: args.teamDomainByTeamId } : void 0,
|
|
1673
1696
|
usage: args.usage
|
|
@@ -1696,12 +1719,13 @@ async function readConversationDetailFromSql(conversationId, options) {
|
|
|
1696
1719
|
if (!record) return void 0;
|
|
1697
1720
|
const archivedAtMs = options.viewer ? await readConversationArchivedAt(options.viewer, conversationId) : void 0;
|
|
1698
1721
|
const executor = getSqlExecutor();
|
|
1699
|
-
const [accessByConversation, annotations, automationTitleByConversation, auxiliaryCostsByConversation, briefVersion, modelUsage, metricsByConversation, participantsByConversation, sourceTask, teamDomainByTeamId] = await Promise.all([
|
|
1722
|
+
const [accessByConversation, annotations, automationTitleByConversation, auxiliaryCostsByConversation, briefVersion, firstHumanMessageTextByConversation, modelUsage, metricsByConversation, participantsByConversation, sourceTask, teamDomainByTeamId] = await Promise.all([
|
|
1700
1723
|
readConversationAccessFromSql(getDb(), [conversationId], options.viewer),
|
|
1701
1724
|
listConversationAnnotations(getDb(), conversationId),
|
|
1702
1725
|
readAutomationTitlesByConversationId([record.conversation]),
|
|
1703
1726
|
readConversationAuxiliaryCostsFromSql(getDb(), [conversationId]),
|
|
1704
1727
|
readLatestConversationBrief(getDb(), conversationId),
|
|
1728
|
+
readFirstHumanMessageTexts(getDb(), [record.conversation]),
|
|
1705
1729
|
record.conversation.transcriptPurgedAtMs === void 0 ? readConversationModelUsageFromSql(executor, { conversationId }) : Promise.resolve([]),
|
|
1706
1730
|
readConversationTreeMetricsFromSql(getDb(), [conversationId]),
|
|
1707
1731
|
readConversationParticipants(getDb(), [conversationId]),
|
|
@@ -1743,6 +1767,7 @@ async function readConversationDetailFromSql(conversationId, options) {
|
|
|
1743
1767
|
} } : void 0,
|
|
1744
1768
|
durationMs: metrics?.durationMs ?? record.durationMs,
|
|
1745
1769
|
events,
|
|
1770
|
+
firstHumanMessageText: firstHumanMessageTextByConversation.get(conversationId),
|
|
1746
1771
|
modelUsage,
|
|
1747
1772
|
participants: participantsByConversation.get(conversationId) ?? [],
|
|
1748
1773
|
...sourceTask ? { sourceTask } : void 0,
|
|
@@ -2357,6 +2382,39 @@ function viewerWebMessages(messages, viewer) {
|
|
|
2357
2382
|
}] : [];
|
|
2358
2383
|
});
|
|
2359
2384
|
}
|
|
2385
|
+
// src/api/conversations/watches.ts
|
|
2386
|
+
/**
|
|
2387
|
+
* Load the active Watches that one Conversation owns, or throw a standard API
|
|
2388
|
+
* not-found error. Viewers who cannot see private content get only the
|
|
2389
|
+
* resource type, event types, and times of each Watch.
|
|
2390
|
+
*/
|
|
2391
|
+
async function requireConversationWatches(conversationId, options = {}) {
|
|
2392
|
+
if (!await getConversationStore().get({ conversationId })) throwApiError(404, "Conversation not found.");
|
|
2393
|
+
const [accessByConversation, owned] = await Promise.all([readConversationAccessFromSql(getDb(), [conversationId], options.viewer), listOwnedWatches(conversationId)]);
|
|
2394
|
+
const canExposePayload = accessByConversation.get(conversationId)?.canViewPrivateContent ?? false;
|
|
2395
|
+
const watches = owned.map(({ childAgent, watch }) => ({
|
|
2396
|
+
...childAgent ? { childAgent: {
|
|
2397
|
+
conversationId: childAgent.conversationId,
|
|
2398
|
+
...canExposePayload && childAgent.name ? { name: childAgent.name } : void 0
|
|
2399
|
+
} } : void 0,
|
|
2400
|
+
createdAt: new Date(watch.createdAtMs).toISOString(),
|
|
2401
|
+
events: watch.events,
|
|
2402
|
+
expiresAt: new Date(watch.expiresAtMs).toISOString(),
|
|
2403
|
+
...watch.firesAtMs !== void 0 ? { firesAt: new Date(watch.firesAtMs).toISOString() } : void 0,
|
|
2404
|
+
id: watch.id,
|
|
2405
|
+
namespace: watch.namespace,
|
|
2406
|
+
resourceType: watch.resourceType,
|
|
2407
|
+
...canExposePayload ? {
|
|
2408
|
+
intent: watch.intent,
|
|
2409
|
+
label: watch.label,
|
|
2410
|
+
...watch.match ? { match: watch.match } : void 0
|
|
2411
|
+
} : { redacted: true }
|
|
2412
|
+
}));
|
|
2413
|
+
return conversationWatchesReportSchema.parse({
|
|
2414
|
+
conversationId,
|
|
2415
|
+
watches
|
|
2416
|
+
});
|
|
2417
|
+
}
|
|
2360
2418
|
// src/api/conversations/routes.ts
|
|
2361
2419
|
/** Create the HTTP routes owned by the conversations API. */
|
|
2362
2420
|
function createConversationRoutes(options) {
|
|
@@ -2418,6 +2476,11 @@ function createConversationRoutes(options) {
|
|
|
2418
2476
|
const viewer = context.get("viewer");
|
|
2419
2477
|
return jsonResponse(conversationChildAgentsReportSchema, await requireConversationChildAgents(conversationId, { viewer }));
|
|
2420
2478
|
});
|
|
2479
|
+
app.get("/:conversationId/watches", validateRequest("param", conversationParamsSchema, "Invalid route parameters."), async (context) => {
|
|
2480
|
+
const { conversationId } = context.req.valid("param");
|
|
2481
|
+
const viewer = context.get("viewer");
|
|
2482
|
+
return jsonResponse(conversationWatchesReportSchema, await requireConversationWatches(conversationId, { viewer }));
|
|
2483
|
+
});
|
|
2421
2484
|
app.get("/:conversationId/pending-messages", validateRequest("param", conversationParamsSchema, "Invalid route parameters."), async (context) => {
|
|
2422
2485
|
const { conversationId } = context.req.valid("param");
|
|
2423
2486
|
const viewer = context.get("viewer");
|
|
@@ -3016,6 +3079,7 @@ function summaryFromRow(row, options = {}) {
|
|
|
3016
3079
|
automationTitle: options.automationTitle,
|
|
3017
3080
|
conversation,
|
|
3018
3081
|
durationMs: options.metrics?.durationMs ?? row.durationMs,
|
|
3082
|
+
firstHumanMessageText: options.firstHumanMessageText,
|
|
3019
3083
|
...options.access?.visibility === "public" && row.destinationId ? { locationId: row.destinationId } : void 0,
|
|
3020
3084
|
usage: options.metrics?.usage ?? row.usage ?? void 0
|
|
3021
3085
|
});
|
|
@@ -3315,10 +3379,11 @@ async function readLocationDetailFromSql(locationId, options = {}) {
|
|
|
3315
3379
|
const activity = activityDays$1(days, nowMs, ACTIVITY_DAYS$1);
|
|
3316
3380
|
const hourlyActivity = activityHours$1(hours, nowMs);
|
|
3317
3381
|
const recentConversationIds = recentRows.map((row) => row.conversationId);
|
|
3318
|
-
const [accessByConversation, metricsByRoot, automationTitleByConversation] = await Promise.all([
|
|
3382
|
+
const [accessByConversation, metricsByRoot, automationTitleByConversation, firstHumanMessageTextByConversation] = await Promise.all([
|
|
3319
3383
|
readConversationAccessFromSql(getDb(), recentConversationIds, options.viewer),
|
|
3320
3384
|
readConversationTreeMetricsFromSql(getDb(), recentConversationIds),
|
|
3321
|
-
readAutomationTitlesByConversationId(recentRows)
|
|
3385
|
+
readAutomationTitlesByConversationId(recentRows),
|
|
3386
|
+
readFirstHumanMessageTexts(getDb(), recentRows)
|
|
3322
3387
|
]);
|
|
3323
3388
|
return {
|
|
3324
3389
|
...location,
|
|
@@ -3330,6 +3395,7 @@ async function readLocationDetailFromSql(locationId, options = {}) {
|
|
|
3330
3395
|
recentConversations: recentRows.map((row) => summaryFromRow(row, {
|
|
3331
3396
|
access: accessByConversation.get(row.conversationId),
|
|
3332
3397
|
automationTitle: automationTitleByConversation.get(row.conversationId),
|
|
3398
|
+
firstHumanMessageText: firstHumanMessageTextByConversation.get(row.conversationId),
|
|
3333
3399
|
metrics: metricsByRoot.get(row.conversationId)
|
|
3334
3400
|
})),
|
|
3335
3401
|
source: "conversation_index",
|
|
@@ -3711,7 +3777,7 @@ async function readPeoplePluginReports(args) {
|
|
|
3711
3777
|
reports: [],
|
|
3712
3778
|
source: "plugins"
|
|
3713
3779
|
});
|
|
3714
|
-
const { getPluginProfileReports } = await import("./
|
|
3780
|
+
const { getPluginProfileReports } = await import("./credentialed-enF5Bf3y.js").then((n) => n.a);
|
|
3715
3781
|
return pluginOperationalReportFeedSchema.parse({
|
|
3716
3782
|
generatedAt: new Date(nowMs).toISOString(),
|
|
3717
3783
|
reports: await getPluginProfileReports({
|
|
@@ -3861,10 +3927,11 @@ async function readPeopleProfileFromSql(email, options = {}) {
|
|
|
3861
3927
|
const surfaces = /* @__PURE__ */ new Map();
|
|
3862
3928
|
for (const row of surfaceRows) addAggregate(surfaces, surfaceLabel(row.surface), row);
|
|
3863
3929
|
const recentConversationIds = recentRows.map((row) => row.conversationId);
|
|
3864
|
-
const [accessByConversation, metricsByRoot, automationTitleByConversation] = await Promise.all([
|
|
3930
|
+
const [accessByConversation, metricsByRoot, automationTitleByConversation, firstHumanMessageTextByConversation] = await Promise.all([
|
|
3865
3931
|
readConversationAccessFromSql(getDb(), recentConversationIds, options.viewer),
|
|
3866
3932
|
readConversationTreeMetricsFromSql(getDb(), recentConversationIds),
|
|
3867
|
-
readAutomationTitlesByConversationId(recentRows)
|
|
3933
|
+
readAutomationTitlesByConversationId(recentRows),
|
|
3934
|
+
readFirstHumanMessageTexts(getDb(), recentRows)
|
|
3868
3935
|
]);
|
|
3869
3936
|
return {
|
|
3870
3937
|
activityDays: activityDays(days, nowMs),
|
|
@@ -3875,6 +3942,7 @@ async function readPeopleProfileFromSql(email, options = {}) {
|
|
|
3875
3942
|
recentConversations: recentRows.map((row) => summaryFromRow(row, {
|
|
3876
3943
|
access: accessByConversation.get(row.conversationId),
|
|
3877
3944
|
automationTitle: automationTitleByConversation.get(row.conversationId),
|
|
3945
|
+
firstHumanMessageText: firstHumanMessageTextByConversation.get(row.conversationId),
|
|
3878
3946
|
metrics: metricsByRoot.get(row.conversationId)
|
|
3879
3947
|
})),
|
|
3880
3948
|
actor,
|
|
@@ -4275,8 +4343,7 @@ function editView(automation, ownedByViewer) {
|
|
|
4275
4343
|
...common,
|
|
4276
4344
|
kind: "event",
|
|
4277
4345
|
status: automation.task.status === "deleted" ? "active" : automation.task.status,
|
|
4278
|
-
trigger: automation.task.trigger
|
|
4279
|
-
triggerAvailable: eventAutomationTriggerAvailable(automation.task, getEventCatalog())
|
|
4346
|
+
trigger: automation.task.trigger
|
|
4280
4347
|
};
|
|
4281
4348
|
}
|
|
4282
4349
|
/** Load exact editable values by ID, independent of list filters. */
|
|
@@ -4743,7 +4810,7 @@ function readDescriptionText(home) {
|
|
|
4743
4810
|
}
|
|
4744
4811
|
/** Read discovered skill names for authenticated runtime diagnostics. */
|
|
4745
4812
|
async function readSkillReports() {
|
|
4746
|
-
const { discoverSkills } = await import("./skills-
|
|
4813
|
+
const { discoverSkills } = await import("./skills-DzyGN7wd.js").then((n) => n.o);
|
|
4747
4814
|
const skills = await discoverSkills();
|
|
4748
4815
|
return skillReportsSchema.parse(skills.map((skill) => ({
|
|
4749
4816
|
name: skill.name,
|
|
@@ -4752,7 +4819,7 @@ async function readSkillReports() {
|
|
|
4752
4819
|
}
|
|
4753
4820
|
/** Read safe configured plugin metadata for authenticated runtime diagnostics. */
|
|
4754
4821
|
async function readPlugins() {
|
|
4755
|
-
const { pluginCatalogRuntime } = await import("./catalog-runtime-
|
|
4822
|
+
const { pluginCatalogRuntime } = await import("./catalog-runtime-DAJjAbSx.js").then((n) => n.t);
|
|
4756
4823
|
return pluginsSchema.parse(pluginCatalogRuntime.getProviders().map((plugin) => ({
|
|
4757
4824
|
configKeys: plugin.manifest.configKeys ?? [],
|
|
4758
4825
|
description: plugin.manifest.description,
|
|
@@ -4764,7 +4831,7 @@ async function readPlugins() {
|
|
|
4764
4831
|
async function readRuntimeInfoReport() {
|
|
4765
4832
|
const [{ homeDir }, { pluginCatalogRuntime }, plugins, skills] = await Promise.all([
|
|
4766
4833
|
import("./package-discovery-DJBompdd.js").then((n) => n.r),
|
|
4767
|
-
import("./catalog-runtime-
|
|
4834
|
+
import("./catalog-runtime-DAJjAbSx.js").then((n) => n.t),
|
|
4768
4835
|
readPlugins(),
|
|
4769
4836
|
readSkillReports()
|
|
4770
4837
|
]);
|
|
@@ -4781,7 +4848,7 @@ async function readRuntimeInfoReport() {
|
|
|
4781
4848
|
/** Read sanitized operational summaries contributed by plugins. */
|
|
4782
4849
|
async function readPluginOperationalReportFeed() {
|
|
4783
4850
|
const nowMs = Date.now();
|
|
4784
|
-
const { getPluginOperationalReports } = await import("./
|
|
4851
|
+
const { getPluginOperationalReports } = await import("./credentialed-enF5Bf3y.js").then((n) => n.a);
|
|
4785
4852
|
return pluginOperationalReportFeedSchema.parse({
|
|
4786
4853
|
source: "plugins",
|
|
4787
4854
|
generatedAt: new Date(nowMs).toISOString(),
|
|
@@ -4799,7 +4866,7 @@ function createJuniorApi(options = {}) {
|
|
|
4799
4866
|
app.get("/api/plugin-reports", async () => jsonResponse(pluginOperationalReportFeedSchema, await readPluginOperationalReportFeed()));
|
|
4800
4867
|
app.get("/api/stats", async () => jsonResponse(statsReportSchema, await readStatsReport()));
|
|
4801
4868
|
app.route("/api/conversations", createConversationRoutes({
|
|
4802
|
-
attachmentStorage:
|
|
4869
|
+
attachmentStorage: getAttachmentStorage(),
|
|
4803
4870
|
queue: options.conversationWorkQueue ?? getVercelConversationWorkQueue()
|
|
4804
4871
|
}));
|
|
4805
4872
|
app.route("/api/code", createCodeRoutes());
|
|
@@ -9,10 +9,8 @@ import "ai";
|
|
|
9
9
|
import { z } from "zod";
|
|
10
10
|
import { Destination, OwnedObjectAnnotation, PluginRegistration, Source, User } from "@sentry/junior-plugin-api";
|
|
11
11
|
import "@earendil-works/pi-agent-core";
|
|
12
|
-
import { Sandbox } from "@vercel/sandbox";
|
|
13
12
|
import "@earendil-works/pi-ai";
|
|
14
13
|
import "@sinclair/typebox";
|
|
15
|
-
import "@vercel/queue";
|
|
16
14
|
import "@modelcontextprotocol/sdk/client/auth.js";
|
|
17
15
|
import { Client } from "@modelcontextprotocol/sdk/client";
|
|
18
16
|
import { Message, StateAdapter } from "chat";
|
|
@@ -199,8 +197,6 @@ interface JuniorDashboardOptions {
|
|
|
199
197
|
basePath?: string;
|
|
200
198
|
/** Public deployment origin used for auth callbacks and external links. */
|
|
201
199
|
baseURL?: string;
|
|
202
|
-
/** Expose the config-gated component gallery for local visual QA. */
|
|
203
|
-
componentGallery?: boolean;
|
|
204
200
|
/** Disable dashboard route mounting while preserving serializable config shape. */
|
|
205
201
|
disabled?: boolean;
|
|
206
202
|
/** Replace Conversation route responses with dashboard visual-QA fixtures. */
|
package/dist/app.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as ModelProfileInput, n as createApp, r as JuniorDashboardOptions, t as JuniorAppOptions } from "./app-
|
|
1
|
+
import { i as ModelProfileInput, n as createApp, r as JuniorDashboardOptions, t as JuniorAppOptions } from "./app-Csbi9dW7.js";
|
|
2
2
|
import { i as defineJuniorPlugins, n as JuniorPluginSet, r as JuniorPluginSetOptions, t as JuniorPluginInput } from "./plugins-B_0Cr0MO.js";
|
|
3
3
|
import { t as JUNIOR_VERSION } from "./version-Cc2OFd9G.js";
|
|
4
4
|
export { JUNIOR_VERSION, JuniorAppOptions, type JuniorDashboardOptions, type JuniorPluginInput, type JuniorPluginSet, type JuniorPluginSetOptions, type ModelProfileInput, createApp, defineJuniorPlugins };
|