@sentry/junior 0.259.0 → 0.260.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-Bn0gFVSF.js → adapter-Dj5BTJRd.js} +1 -1
- package/dist/{admin-C8xz2f10.js → admin-tzkZDqrH.js} +1 -1
- package/dist/{agent-hooks-B00FaKdP.js → agent-hooks-V4Hfc2tB.js} +711 -698
- package/dist/{agent-runner-CPSd7rKm.js → agent-runner-DvTUyGTY.js} +685 -2221
- package/dist/api/schema.d.ts +210 -54
- package/dist/api/schema.js +3 -3
- package/dist/api.js +150 -60
- package/dist/{app-Bbxrehjf.d.ts → app-BsBUs3rF.d.ts} +1 -1
- package/dist/app.d.ts +1 -1
- package/dist/app.js +29 -31
- package/dist/{assistant-reply-CqthTerd.js → assistant-reply-CEOMzsWy.js} +1 -1
- package/dist/{automation-DWBFBenG.js → automation-DrpcA-SX.js} +3 -0
- package/dist/{briefs-DNYbQ9cD.js → briefs-BSCkyYqs.js} +4 -4
- package/dist/{catalog-runtime-B8SuFPGb.js → catalog-runtime-Bpcs2b2L.js} +1 -1
- package/dist/cli/chat.js +16 -16
- 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.js +3 -3
- package/dist/{client-BZdxgKyL.js → client-JeyzRwsT.js} +2 -2
- package/dist/{config-Deqpfpg9.js → config-ULs6Zl9b.js} +2 -2
- package/dist/{connections-9gJkfS85.js → connections-CZ7HhEmN.js} +10 -10
- package/dist/{conversation-DjN3mlog.js → conversation-CvuKJ3tA.js} +108 -155
- package/dist/{conversation-privacy-CFhNKxp-.js → conversation-privacy-BQSlZXgV.js} +1 -1
- package/dist/{credential-sync-BABGymK3.js → credential-sync-BKcv5rBe.js} +14 -15
- package/dist/{executor-Bb3eQb8q.js → executor-BoGNVEDn.js} +3 -2
- package/dist/{images-BbSdVHC6.js → images-BBmDXQCB.js} +3 -3
- package/dist/instrumentation.js +2 -2
- package/dist/{job-queue-vdGU-5ge.js → job-queue-CbdVyaCo.js} +1 -1
- package/dist/{logging-BStXN56b.js → logging-DSMmkHXG.js} +1 -1
- package/dist/{message-DRf6m4uO.js → message-zaj5gBbS.js} +3 -3
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +3 -3
- package/dist/{oauth-callback-server-JmOgLcGl.js → oauth-callback-server-yYFG8Own.js} +2 -2
- package/dist/{profile-qBM6B_-V.js → profile-ByWkAY7L.js} +24 -24
- package/dist/{prompt-xgpyMtg7.js → prompt-DeVax2qO.js} +1 -1
- package/dist/{registry-B_M_x_iS.js → registry-BL-osYWN.js} +1 -1
- package/dist/{resolve-BzpuLh8c.js → resolve-HuPG2VMB.js} +9 -5
- package/dist/{result-DEZH_AnZ.js → result-DS7V4a3-.js} +9 -14
- package/dist/{runner-BqQlG10t.js → runner-Cba_OfGl.js} +11 -11
- package/dist/{sandbox-egress-signals-DCq3WLs5.js → sandbox-egress-signals-C7NcPzea.js} +1 -1
- package/dist/{schema-CF9HqNRY.js → schema-OzL8Zw4H.js} +68 -3
- package/dist/{service-account-BqTBkyD7.js → service-account-DqwHhwJA.js} +3 -3
- package/dist/{service-account-BzhW7kXu.js → service-account-Ko1Xs--F.js} +3 -3
- package/dist/{session-stop-CV65ZlU3.js → session-stop-HfKx-pky.js} +180 -22
- package/dist/{skills-CiWS5_Ub.js → skills-D6_bcAuW.js} +2 -2
- package/dist/{spawn-BSAQ7UQZ.js → spawn-BWqK6EwM.js} +2 -2
- package/dist/{store-B1GES4gC.js → store-DzRbd5VT.js} +6 -6
- package/dist/{task-queue-BAeGEMjJ.js → task-queue-9LICOzcL.js} +3 -3
- package/dist/{task-runner-BlGhcQPi.js → task-runner-DGnd_B5X.js} +10 -10
- package/dist/{tasks-DieKX3d4.js → tasks-CjrS098O.js} +4928 -2390
- package/dist/thread-state-CqkYowEz.js +184 -0
- package/dist/{turn-failure-response-DQljogGJ.js → turn-failure-response-BkKmGqFt.js} +8 -9
- package/dist/{turn-lifecycle-BLgrkV_L.js → turn-lifecycle-DYv8IV6w.js} +1 -1
- package/dist/{turn-session-routing-BlajheOU.js → turn-session-routing-TaVhKmdz.js} +1 -1
- package/dist/{validation-23d7K9tX.js → validation-BrXMYPyo.js} +1 -1
- package/dist/{version-B_XumRx-.js → version-Ct049vav.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-B2_ABsYi.js → viewer-C-J0ewlH.js} +19 -10
- package/dist/{web-input-BZDyxpzR.js → web-input-C_xB3RXp.js} +38 -34
- package/dist/{work-D3QKiV0O.js → work-D829Ue7k.js} +9 -10
- package/dist/{worker-C8mUjYf9.js → worker-BRTYzlpk.js} +5 -5
- package/migrations/0061_workspace_vcpus.sql +1 -0
- package/migrations/meta/0061_snapshot.json +3471 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +5 -5
- package/dist/experimental-BNK1l1jv.js +0 -49
- package/dist/oauth-authorization-djQn5Nhy.js +0 -97
- package/dist/pending-auth-rG5U_QS1.js +0 -442
- package/dist/thread-state-DpSWS4Rr.js +0 -426
package/dist/api.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import {
|
|
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, L as loadTurnProjection, O as automationRevision, S as automationDefinition, T as readAutomationVersion, a as saveScheduledAutomation, bn as createUserTokenStore, k as requireAutomationRevision, rr as piMessageFromHistoryItem, v as saveEventAutomation, y as setEventAutomationStatus } from "./tasks-CjrS098O.js";
|
|
2
|
+
import { p as escapeXml } from "./client-JeyzRwsT.js";
|
|
3
|
+
import { f as logException, m as logWarn, p as logInfo } from "./logging-DSMmkHXG.js";
|
|
4
4
|
import { d as parseSlackTeamId, g as parseSlackMessageTs, l as parseSlackChannelId } from "./actor-tlxzqaRe.js";
|
|
5
|
-
import { C as addAgentTurnUsage, D as hasAgentTurnUsage, E as agentTurnUsageSchema, O as resolveRootConversationId, S as parseSessionSource, c as getConversationEventStore, d as getDb, f as getSqlExecutor, h as
|
|
5
|
+
import { C as addAgentTurnUsage, D as hasAgentTurnUsage, E as agentTurnUsageSchema, O as resolveRootConversationId, S as parseSessionSource, c as getConversationEventStore, d as getDb, f as getSqlExecutor, h as loadConversationSlackTenantIds, i as resolveViewerUser, m as withConversationEventLock, o as updateViewerDisplayName, t as findUserByEmail, u as getConversationStore, v as locationFromRow } from "./viewer-C-J0ewlH.js";
|
|
6
6
|
import { c as juniorIdentities, d as juniorDestinations, l as juniorUsers, o as conversationReadColumns, s as juniorConversations } from "./agent-invocations-Qfz7dWgU.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-
|
|
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-BoGNVEDn.js";
|
|
8
8
|
import { d as contextProvenance } from "./history-AY8rs-FR.js";
|
|
9
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { A as forkConversationBodySchema, F as readMessageAttachments, I as INPUT_IMAGE_TYPES, O as createConversationBodySchema, T as conversationStatsReportSchema, _ as conversationParamsSchema, a as cancelConversationPendingMessagesBodySchema, c as conversationAttachmentParamsSchema, d as conversationDetailReportSchema, g as conversationFeedSchema, h as conversationFeedQuerySchema, i as archiveConversationResponseSchema, j as forkConversationResponseSchema, k as createConversationMessageBodySchema, m as conversationEventsQuerySchema, o as cancelConversationPendingMessagesResponseSchema, p as conversationEventPageSchema, r as archiveConversationBodySchema, t as acceptedConversationMessageSchema, u as conversationDetailQuerySchema, x as conversationPendingMessagesReportSchema } from "./conversation-DjN3mlog.js";
|
|
13
|
-
import { n as hash, t as create } from "./profile-qBM6B_-V.js";
|
|
14
|
-
import { l as getEventCatalog, y as automationEventCatalog } from "./session-stop-CV65ZlU3.js";
|
|
9
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-Bpcs2b2L.js";
|
|
10
|
+
import { F as AutomationEditError, I as eventAutomationTriggerAvailable, P as editEventAutomation, R as resolveTaskOutcomes, S as readLiveAttachment, T as parseSlackThreadId, U as listChildAgents, _t as conversationSubtreeColumns, gt as conversationSubtree, j as editScheduledAutomation, m as readStats, rt as getChildAgentLabel } from "./agent-runner-DvTUyGTY.js";
|
|
11
|
+
import { At as conversationHasParticipantUser, C as WorkspaceValidationError, Dt as conversationArchivedForEmail, Et as conversationArchiveTimes, Ft as readLatestConversationBrief, Gt as listConversationAnnotations, It as readConversationEventPage, Kt as listConversationAnnotationsById, Lt as buildSentryConversationUrl, M as workspaceRepoCheckoutPath, Mt as conversationNotArchivedForUser, Nt as viewerConversationMembership, O as SANDBOX_RUNTIME, Ot as conversationArchivedForUser, S as updateWorkspace, Tt as readConversationAccessFromSql, Yt as lookupSlackUser, _ as deleteWorkspace, b as listWorkspaces, ct as getSlackClient, g as createWorkspace, jt as conversationNotArchivedForEmail, kt as conversationHasParticipantEmail, pt as withSlackRetries, u as getPlugins, v as getWorkspace, wt as createPluginLogger, x as listWorkspacesByRepository } from "./agent-hooks-V4Hfc2tB.js";
|
|
15
12
|
import { t as getFirstRunAtMs } from "./cadence-R7Em4RjE.js";
|
|
16
|
-
import { t as
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
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-CvuKJ3tA.js";
|
|
14
|
+
import { n as hash, t as create } from "./profile-ByWkAY7L.js";
|
|
15
|
+
import { d as getEventCatalog, x as automationEventCatalog } from "./session-stop-HfKx-pky.js";
|
|
16
|
+
import { d as getSandboxResources, t as getCachedSnapshot } from "./resolve-HuPG2VMB.js";
|
|
17
|
+
import { a as getVercelConversationWorkQueue } from "./job-queue-CbdVyaCo.js";
|
|
18
|
+
import { a as cancelHumanFacingPendingMessages, h as getConversation } from "./store-DzRbd5VT.js";
|
|
19
|
+
import { n as finishServiceAccountSignIn, o as serviceAccountPlugins, r as getServiceAccountStatus, s as startServiceAccountSignIn, t as disconnectServiceAccount } from "./service-account-Ko1Xs--F.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-DrpcA-SX.js";
|
|
21
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";
|
|
22
|
-
import { B as readHealthReport, I as createVercelAttachmentStorage, _ 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-
|
|
23
|
-
import { F as conversationAggregateColumns, I as conversationRangeColumns, M as readAutomationTitlesByConversationId, P as conversationActiveDaysColumn } from "./task-runner-
|
|
24
|
-
import { d as legacyWebMailboxMetadataSchema } from "./result-
|
|
25
|
-
import { a as startConnection, l as getWebAuthorization, n as isConnectableProvider, r as listConnections, t as disconnectConnection, u as htmlCallbackResponse } from "./connections-
|
|
26
|
-
import { t as decodeInputImages } from "./images-
|
|
27
|
-
import { A as activityHours$1, C as personParamsSchema, D as locationDirectoryReportSchema, E as locationDetailReportSchema, H as codePersonReportSchema, I as disconnectConnectionResponseSchema, J as stopConversationTurnResponseSchema, L as startConnectionResponseSchema, N as connectionListSchema, O as locationParamsSchema, P as connectionParamsSchema, S as actorProfileReportSchema, U as codeRepositoryParamsSchema, V as codeOverviewReportSchema, W as codeRepositoryReportSchema,
|
|
22
|
+
import { B as readHealthReport, I as createVercelAttachmentStorage, _ 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-C_xB3RXp.js";
|
|
23
|
+
import { F as conversationAggregateColumns, I as conversationRangeColumns, M as readAutomationTitlesByConversationId, P as conversationActiveDaysColumn } from "./task-runner-DGnd_B5X.js";
|
|
24
|
+
import { d as legacyWebMailboxMetadataSchema } from "./result-DS7V4a3-.js";
|
|
25
|
+
import { a as startConnection, l as getWebAuthorization, n as isConnectableProvider, r as listConnections, t as disconnectConnection, u as htmlCallbackResponse } from "./connections-CZ7HhEmN.js";
|
|
26
|
+
import { t as decodeInputImages } from "./images-BBmDXQCB.js";
|
|
27
|
+
import { A as activityHours$1, C as personParamsSchema, D as locationDirectoryReportSchema, E as locationDetailReportSchema, H as codePersonReportSchema, I as disconnectConnectionResponseSchema, J as stopConversationTurnResponseSchema, L as startConnectionResponseSchema, N as connectionListSchema, O as locationParamsSchema, P as connectionParamsSchema, S as actorProfileReportSchema, U as codeRepositoryParamsSchema, V as codeOverviewReportSchema, W as codeRepositoryReportSchema, X as apiErrorSchema, Y 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 conversationChildAgentsReportSchema, s as workspaceParamsSchema, u as disconnectServiceAccountResponseSchema, w as personalSpendReportSchema, x as actorDirectoryReportSchema, y as personalTokenParamsSchema } from "./schema-OzL8Zw4H.js";
|
|
28
28
|
import { Hono } from "hono";
|
|
29
29
|
import path from "node:path";
|
|
30
30
|
import { z } from "zod";
|
|
@@ -887,22 +887,42 @@ function decodeConversationCursor(args) {
|
|
|
887
887
|
return;
|
|
888
888
|
}
|
|
889
889
|
}
|
|
890
|
-
// src/api/
|
|
890
|
+
// src/api/mentions.ts
|
|
891
891
|
const SLACK_USER_MENTION_RE = /<@([UW][A-Z0-9]+)(?:\|[^<>]*)?>/g;
|
|
892
|
-
function mentionedSlackUserIds(
|
|
893
|
-
|
|
894
|
-
return [...new Set(
|
|
892
|
+
function mentionedSlackUserIds(texts) {
|
|
893
|
+
const ids = texts.flatMap((text) => text ? [...text.matchAll(SLACK_USER_MENTION_RE)].map((m) => m[1]) : []);
|
|
894
|
+
return [...new Set(ids)];
|
|
895
895
|
}
|
|
896
|
-
|
|
897
|
-
|
|
896
|
+
/**
|
|
897
|
+
* Resolve the people that each source mentions, in source order. Every API
|
|
898
|
+
* that returns display text uses this, so the dashboard can show the same
|
|
899
|
+
* names and People links everywhere. It does one identity query per Slack
|
|
900
|
+
* workspace.
|
|
901
|
+
*/
|
|
902
|
+
async function resolveMentions(executor, sources) {
|
|
903
|
+
const idsBySource = sources.map((source) => mentionedSlackUserIds(source.texts));
|
|
904
|
+
const idsByTenant = /* @__PURE__ */ new Map();
|
|
905
|
+
sources.forEach((source, index) => {
|
|
906
|
+
if (idsBySource[index].length === 0) return;
|
|
907
|
+
const ids = idsByTenant.get(source.tenantId) ?? /* @__PURE__ */ new Set();
|
|
908
|
+
for (const id of idsBySource[index]) ids.add(id);
|
|
909
|
+
idsByTenant.set(source.tenantId, ids);
|
|
910
|
+
});
|
|
911
|
+
const peopleByTenant = new Map(await Promise.all([...idsByTenant].map(async ([tenantId, ids]) => [tenantId, await readMentionedPeople(executor, tenantId, [...ids])])));
|
|
912
|
+
return sources.map((source, index) => {
|
|
913
|
+
const people = peopleByTenant.get(source.tenantId);
|
|
914
|
+
return idsBySource[index].flatMap((id) => {
|
|
915
|
+
const person = people?.get(id);
|
|
916
|
+
return person ? [person] : [];
|
|
917
|
+
});
|
|
918
|
+
});
|
|
898
919
|
}
|
|
899
920
|
/**
|
|
900
921
|
* Read current names for mentioned Slack users. Known Junior identities come
|
|
901
922
|
* first. The email is set only for a linked, verified Junior user, because
|
|
902
923
|
* that email is the People profile route.
|
|
903
924
|
*/
|
|
904
|
-
async function
|
|
905
|
-
const tenantId = await loadConversationSlackTenantId(executor, conversationId);
|
|
925
|
+
async function readMentionedPeople(executor, tenantId, userIds) {
|
|
906
926
|
const rows = await executor.db().select({
|
|
907
927
|
displayName: juniorIdentities.displayName,
|
|
908
928
|
emailVerified: juniorIdentities.emailVerified,
|
|
@@ -942,26 +962,67 @@ async function resolveSlackMentions(executor, conversationId, userIds) {
|
|
|
942
962
|
}
|
|
943
963
|
return people;
|
|
944
964
|
}
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
return
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
965
|
+
// src/api/conversations/mentions.ts
|
|
966
|
+
/** Text in one event that the dashboard renders with mentions. */
|
|
967
|
+
function eventMentionTexts(data) {
|
|
968
|
+
switch (data.type) {
|
|
969
|
+
case "message": return data.redacted ? [] : [
|
|
970
|
+
data.text,
|
|
971
|
+
data.trustedSummary,
|
|
972
|
+
...(data.events ?? []).map((event) => event.trustedSummary)
|
|
973
|
+
];
|
|
974
|
+
case "assistant_message": return data.parts.map((part) => part.text);
|
|
975
|
+
case "compaction":
|
|
976
|
+
case "handoff": return [data.summary];
|
|
977
|
+
case "structured_event": return [data.presentation.preview, ...(data.presentation.details ?? []).map((detail) => detail.description)];
|
|
978
|
+
default: return [];
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
function briefMentionTexts(brief) {
|
|
982
|
+
return [
|
|
983
|
+
brief.summary,
|
|
984
|
+
brief.intent,
|
|
985
|
+
brief.outcome.text,
|
|
986
|
+
...brief.decisions.flatMap((decision) => [decision.text, decision.by]),
|
|
987
|
+
...brief.openDecisions.flatMap((decision) => [decision.text, decision.owner]),
|
|
988
|
+
...brief.facts
|
|
989
|
+
];
|
|
990
|
+
}
|
|
991
|
+
function withMentions(value, mentions) {
|
|
992
|
+
return mentions.length > 0 ? {
|
|
993
|
+
...value,
|
|
994
|
+
mentions
|
|
995
|
+
} : value;
|
|
996
|
+
}
|
|
997
|
+
/**
|
|
998
|
+
* Attach the people that each event and the Brief of one conversation
|
|
999
|
+
* mention, resolved at read time.
|
|
1000
|
+
*/
|
|
1001
|
+
async function attachConversationMentions(executor, conversationId, content) {
|
|
1002
|
+
const tenantId = (await loadConversationSlackTenantIds(executor, [conversationId])).get(conversationId);
|
|
1003
|
+
const sources = content.events.map((event) => ({
|
|
1004
|
+
tenantId,
|
|
1005
|
+
texts: eventMentionTexts(event.data)
|
|
1006
|
+
}));
|
|
1007
|
+
if (content.brief) sources.push({
|
|
1008
|
+
tenantId,
|
|
1009
|
+
texts: briefMentionTexts(content.brief)
|
|
964
1010
|
});
|
|
1011
|
+
const mentions = await resolveMentions(executor, sources);
|
|
1012
|
+
return {
|
|
1013
|
+
briefMentions: content.brief ? mentions.at(-1) : [],
|
|
1014
|
+
events: content.events.map((event, index) => withMentions(event, mentions[index]))
|
|
1015
|
+
};
|
|
1016
|
+
}
|
|
1017
|
+
/** Attach the people that each activity preview mentions, resolved at read time. */
|
|
1018
|
+
async function attachActivityPreviewMentions(executor, previews) {
|
|
1019
|
+
const entries = [...previews];
|
|
1020
|
+
const tenants = await loadConversationSlackTenantIds(executor, entries.map(([conversationId]) => conversationId));
|
|
1021
|
+
const mentions = await resolveMentions(executor, entries.map(([conversationId, preview]) => ({
|
|
1022
|
+
tenantId: tenants.get(conversationId),
|
|
1023
|
+
texts: [preview.text]
|
|
1024
|
+
})));
|
|
1025
|
+
return new Map(entries.map(([conversationId, preview], index) => [conversationId, withMentions(preview, mentions[index])]));
|
|
965
1026
|
}
|
|
966
1027
|
// src/api/conversations/shared.ts
|
|
967
1028
|
/** Format a Slack destination without exposing private channel names. */
|
|
@@ -1437,6 +1498,7 @@ async function readConversationFeedFromSql(options = {}) {
|
|
|
1437
1498
|
readConversationActivityPreviews(db, conversationIds),
|
|
1438
1499
|
readAutomationTitlesByConversationId(conversations)
|
|
1439
1500
|
]);
|
|
1501
|
+
const visibleActivityPreviews = await attachActivityPreviewMentions(getSqlExecutor(), new Map([...activityPreviewByConversation].filter(([conversationId]) => accessByConversation.get(conversationId)?.canViewPrivateContent)));
|
|
1440
1502
|
const sidebarAnnotationsByConversation = await listConversationSidebarAnnotations(conversationIds, new Map(conversationIds.map((conversationId) => [conversationId, accessByConversation.get(conversationId)?.canViewPrivateContent ? annotationsByConversation.get(conversationId) ?? [] : []])));
|
|
1441
1503
|
const assignedWork = new Set(conversationWork.assignedIds);
|
|
1442
1504
|
const unfinishedWork = new Set(conversationWork.unfinishedIds);
|
|
@@ -1466,7 +1528,7 @@ async function readConversationFeedFromSql(options = {}) {
|
|
|
1466
1528
|
...unfinishedWork.has(conversation.conversationId) ? { unfinishedWork: true } : void 0
|
|
1467
1529
|
};
|
|
1468
1530
|
const annotations = access?.canViewPrivateContent ? annotationsByConversation.get(conversation.conversationId) ?? [] : [];
|
|
1469
|
-
const activityPreview =
|
|
1531
|
+
const activityPreview = visibleActivityPreviews.get(conversation.conversationId);
|
|
1470
1532
|
const participants = access?.canViewPrivateContent ? participantsByConversation.get(conversation.conversationId) : void 0;
|
|
1471
1533
|
return {
|
|
1472
1534
|
...summary,
|
|
@@ -1659,7 +1721,11 @@ async function readConversationDetailFromSql(conversationId, options) {
|
|
|
1659
1721
|
conversationId,
|
|
1660
1722
|
limit: options.limit
|
|
1661
1723
|
}) : { events: [] };
|
|
1662
|
-
const
|
|
1724
|
+
const brief = access?.canViewPrivateContent ? briefVersion?.content : void 0;
|
|
1725
|
+
const { briefMentions, events } = await attachConversationMentions(executor, conversationId, {
|
|
1726
|
+
...brief ? { brief } : void 0,
|
|
1727
|
+
events: page.events
|
|
1728
|
+
});
|
|
1663
1729
|
const metrics = metricsByConversation.get(conversationId);
|
|
1664
1730
|
const auxiliaryCosts = auxiliaryCostsByConversation.get(conversationId);
|
|
1665
1731
|
const childAgentTotals = childAgentTotalsReport(metrics, auxiliaryCosts);
|
|
@@ -1674,6 +1740,7 @@ async function readConversationDetailFromSql(conversationId, options) {
|
|
|
1674
1740
|
...childAgentTotals ? { childAgentTotals } : void 0,
|
|
1675
1741
|
...briefVersion ? { brief: {
|
|
1676
1742
|
content: briefVersion.content,
|
|
1743
|
+
...briefMentions.length > 0 ? { mentions: briefMentions } : void 0,
|
|
1677
1744
|
updatedAt: briefVersion.createdAt.toISOString(),
|
|
1678
1745
|
version: briefVersion.version
|
|
1679
1746
|
} } : void 0,
|
|
@@ -1720,7 +1787,7 @@ async function readConversationEvents(conversationId, beforeValue, options = {})
|
|
|
1720
1787
|
limit: options.limit ?? 500
|
|
1721
1788
|
}) : { events: [] };
|
|
1722
1789
|
return conversationEventPageSchema.parse({
|
|
1723
|
-
events: await
|
|
1790
|
+
events: (await attachConversationMentions(getSqlExecutor(), conversationId, { events: page.events })).events,
|
|
1724
1791
|
eventHistory: conversationEventHistory({
|
|
1725
1792
|
canExposePayload,
|
|
1726
1793
|
...transcriptPurgedAtMs === void 0 ? void 0 : { transcriptPurgedAtMs }
|
|
@@ -3643,7 +3710,7 @@ async function readPeoplePluginReports(args) {
|
|
|
3643
3710
|
reports: [],
|
|
3644
3711
|
source: "plugins"
|
|
3645
3712
|
});
|
|
3646
|
-
const { getPluginProfileReports } = await import("./agent-hooks-
|
|
3713
|
+
const { getPluginProfileReports } = await import("./agent-hooks-V4Hfc2tB.js").then((n) => n.t);
|
|
3647
3714
|
return pluginOperationalReportFeedSchema.parse({
|
|
3648
3715
|
generatedAt: new Date(nowMs).toISOString(),
|
|
3649
3716
|
reports: await getPluginProfileReports({
|
|
@@ -4404,6 +4471,18 @@ async function previewAutomationSchedule(user, id, intent) {
|
|
|
4404
4471
|
throw error;
|
|
4405
4472
|
}
|
|
4406
4473
|
}
|
|
4474
|
+
// src/api/automations/mentions.ts
|
|
4475
|
+
/** Attach the people that each Automation instruction mentions, resolved at read time. */
|
|
4476
|
+
async function attachAutomationMentions(executor, automations) {
|
|
4477
|
+
const mentions = await resolveMentions(executor, automations.map((automation) => ({
|
|
4478
|
+
tenantId: automation.destination.teamId,
|
|
4479
|
+
texts: [automation.instruction]
|
|
4480
|
+
})));
|
|
4481
|
+
return automations.map((automation, index) => mentions[index].length > 0 ? {
|
|
4482
|
+
...automation,
|
|
4483
|
+
mentions: mentions[index]
|
|
4484
|
+
} : automation);
|
|
4485
|
+
}
|
|
4407
4486
|
// src/api/automations/routes.ts
|
|
4408
4487
|
/** Translate expected edit failures; unexpected failures stay at the API boundary. */
|
|
4409
4488
|
function editErrorResponse(error) {
|
|
@@ -4428,7 +4507,11 @@ function createAutomationRoutes() {
|
|
|
4428
4507
|
app.get("/", requireViewer, validateRequest("query", automationListQuerySchema, "Invalid task list query."), async (context) => {
|
|
4429
4508
|
const user = context.get("viewer");
|
|
4430
4509
|
const query = context.req.valid("query");
|
|
4431
|
-
|
|
4510
|
+
const list = await readViewerAutomations(user, query);
|
|
4511
|
+
return jsonResponse(automationListSchema, {
|
|
4512
|
+
...list,
|
|
4513
|
+
automations: await attachAutomationMentions(getSqlExecutor(), list.automations)
|
|
4514
|
+
});
|
|
4432
4515
|
});
|
|
4433
4516
|
app.get("/event-catalog", requireViewer, () => {
|
|
4434
4517
|
return jsonResponse(automationEventCatalogSchema, readAutomationEventCatalog());
|
|
@@ -4448,7 +4531,12 @@ function createAutomationRoutes() {
|
|
|
4448
4531
|
const user = context.get("viewer");
|
|
4449
4532
|
const params = context.req.valid("param");
|
|
4450
4533
|
try {
|
|
4451
|
-
|
|
4534
|
+
const list = await readViewerAutomationExecutions(user, params.id);
|
|
4535
|
+
const [automation] = await attachAutomationMentions(getSqlExecutor(), [list.automation]);
|
|
4536
|
+
return jsonResponse(automationExecutionListSchema, {
|
|
4537
|
+
...list,
|
|
4538
|
+
automation
|
|
4539
|
+
});
|
|
4452
4540
|
} catch (error) {
|
|
4453
4541
|
if (error instanceof ViewerTaskNotFoundError) return jsonResponse(apiErrorSchema, { error: error.message }, { status: 404 });
|
|
4454
4542
|
throw error;
|
|
@@ -4514,7 +4602,7 @@ function createAutomationRoutes() {
|
|
|
4514
4602
|
});
|
|
4515
4603
|
app.get("/:id", requireViewer, async (context) => {
|
|
4516
4604
|
const automation = await readViewerAutomationSummary(context.get("viewer"), context.req.param("id"));
|
|
4517
|
-
return automation ? jsonResponse(automationSummarySchema, automation) : jsonResponse(apiErrorSchema, { error: "Automation was not found." }, { status: 404 });
|
|
4605
|
+
return automation ? jsonResponse(automationSummarySchema, (await attachAutomationMentions(getSqlExecutor(), [automation]))[0]) : jsonResponse(apiErrorSchema, { error: "Automation was not found." }, { status: 404 });
|
|
4518
4606
|
});
|
|
4519
4607
|
app.delete("/:id", requireViewer, validateRequest("param", automationParamsSchema, "Invalid task."), async (context) => {
|
|
4520
4608
|
const user = context.get("viewer");
|
|
@@ -4564,6 +4652,7 @@ function view(workspace) {
|
|
|
4564
4652
|
id: workspace.id,
|
|
4565
4653
|
name: workspace.name,
|
|
4566
4654
|
setupScript: workspace.setupScript,
|
|
4655
|
+
vcpus: workspace.vcpus,
|
|
4567
4656
|
repos: workspace.repos.map((repo) => ({
|
|
4568
4657
|
provider: repo.provider,
|
|
4569
4658
|
repo: repo.repo,
|
|
@@ -4589,6 +4678,7 @@ function createWorkspaceRoutes() {
|
|
|
4589
4678
|
const [baselineSnapshot, workspaces] = await Promise.all([baselineSnapshotView(), listWorkspaces(getDb())]);
|
|
4590
4679
|
return jsonResponse(workspaceListSchema, {
|
|
4591
4680
|
baselineSnapshot,
|
|
4681
|
+
defaultVcpus: getSandboxResources()?.vcpus ?? null,
|
|
4592
4682
|
workspaces: workspaces.map(view)
|
|
4593
4683
|
});
|
|
4594
4684
|
});
|
|
@@ -4651,7 +4741,7 @@ function readDescriptionText(home) {
|
|
|
4651
4741
|
}
|
|
4652
4742
|
/** Read discovered skill names for authenticated runtime diagnostics. */
|
|
4653
4743
|
async function readSkillReports() {
|
|
4654
|
-
const { discoverSkills } = await import("./skills-
|
|
4744
|
+
const { discoverSkills } = await import("./skills-D6_bcAuW.js").then((n) => n.o);
|
|
4655
4745
|
const skills = await discoverSkills();
|
|
4656
4746
|
return skillReportsSchema.parse(skills.map((skill) => ({
|
|
4657
4747
|
name: skill.name,
|
|
@@ -4660,7 +4750,7 @@ async function readSkillReports() {
|
|
|
4660
4750
|
}
|
|
4661
4751
|
/** Read safe configured plugin metadata for authenticated runtime diagnostics. */
|
|
4662
4752
|
async function readPlugins() {
|
|
4663
|
-
const { pluginCatalogRuntime } = await import("./catalog-runtime-
|
|
4753
|
+
const { pluginCatalogRuntime } = await import("./catalog-runtime-Bpcs2b2L.js").then((n) => n.t);
|
|
4664
4754
|
return pluginsSchema.parse(pluginCatalogRuntime.getProviders().map((plugin) => ({
|
|
4665
4755
|
configKeys: plugin.manifest.configKeys ?? [],
|
|
4666
4756
|
description: plugin.manifest.description,
|
|
@@ -4672,7 +4762,7 @@ async function readPlugins() {
|
|
|
4672
4762
|
async function readRuntimeInfoReport() {
|
|
4673
4763
|
const [{ homeDir }, { pluginCatalogRuntime }, plugins, skills] = await Promise.all([
|
|
4674
4764
|
import("./package-discovery-DJBompdd.js").then((n) => n.r),
|
|
4675
|
-
import("./catalog-runtime-
|
|
4765
|
+
import("./catalog-runtime-Bpcs2b2L.js").then((n) => n.t),
|
|
4676
4766
|
readPlugins(),
|
|
4677
4767
|
readSkillReports()
|
|
4678
4768
|
]);
|
|
@@ -4689,7 +4779,7 @@ async function readRuntimeInfoReport() {
|
|
|
4689
4779
|
/** Read sanitized operational summaries contributed by plugins. */
|
|
4690
4780
|
async function readPluginOperationalReportFeed() {
|
|
4691
4781
|
const nowMs = Date.now();
|
|
4692
|
-
const { getPluginOperationalReports } = await import("./agent-hooks-
|
|
4782
|
+
const { getPluginOperationalReports } = await import("./agent-hooks-V4Hfc2tB.js").then((n) => n.t);
|
|
4693
4783
|
return pluginOperationalReportFeedSchema.parse({
|
|
4694
4784
|
source: "plugins",
|
|
4695
4785
|
generatedAt: new Date(nowMs).toISOString(),
|
|
@@ -9,9 +9,9 @@ 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";
|
|
12
13
|
import "@earendil-works/pi-ai";
|
|
13
14
|
import "@sinclair/typebox";
|
|
14
|
-
import { Sandbox } from "@vercel/sandbox";
|
|
15
15
|
import "@modelcontextprotocol/sdk/client/auth.js";
|
|
16
16
|
import { Client } from "@modelcontextprotocol/sdk/client";
|
|
17
17
|
import { Message, StateAdapter } from "chat";
|
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-BsBUs3rF.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 };
|
package/dist/app.js
CHANGED
|
@@ -1,39 +1,37 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { C as withContext, M as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, R as normalizeIdentityEmail, T as withSpan, b as setSpanStatus, f as logException, k as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, m as logWarn, p as logInfo, r as createRequestContext, v as setSentryUser, w as withLogContext, y as setSpanAttributes } from "./logging-
|
|
1
|
+
import { $ as projectConversationMessages, C as automationVersionOf, Cn as resolveSandboxEgressProviderForHost, Dn as clearSandboxEgressSignals, En as SANDBOX_EGRESS_PROXY_PATH, Hn as slackMention, In as resolveBaseUrl, Ln as startOAuthFlow, On as consumeSandboxEgressAuthRequiredSignal, Pn as formatProviderLabel, Tn as shouldPropagateSandboxEgressTrace, X as appendConversationMessages, Xn as slackEntitySchema, Zn as slackExternalRefIdSchema, _n as isExperimentalFeatureEnabled, ar as setConfigDefaults, b as admitEventAutomationRun, bn as createUserTokenStore, c as withScheduledAutomationLock, cn as SubscribedReplyReason, dn as getThreadStopDecision, gn as getExperimentalFeatures, i as readScheduledAutomation, ir as getConfigDefaults, jn as parseSandboxEgressCredentialToken, kn as consumeSandboxEgressPermissionDeniedSignal, l as blockEventAutomation, n as listScheduledAutomationsForTeam, nt as settleConversationTitleWork, o as saveScheduledAutomationInLock, p as findMatchingEventAutomations, s as scheduledRunId, u as collectEventAutomationMatchKeys, vn as setExperimentalFeatures, wn as normalizeSandboxEgressTracePropagationDomains, x as eventAutomationRunLimitReason, yn as executeCredentialedEgressRequest } from "./tasks-CjrS098O.js";
|
|
2
|
+
import { C as withContext, M as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, R as normalizeIdentityEmail, T as withSpan, b as setSpanStatus, f as logException, k as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, m as logWarn, p as logInfo, r as createRequestContext, v as setSentryUser, w as withLogContext, y as setSpanAttributes } from "./logging-DSMmkHXG.js";
|
|
3
3
|
import { n as captureMessage, r as continueTrace } from "./sentry-BBUlHih9.js";
|
|
4
|
-
import { t as JUNIOR_VERSION } from "./version-
|
|
5
|
-
import { _ as snapshotRuntimeConfig, d as restoreRuntimeConfig, f as setBotModelConfig, g as setSlackReactionConfig, h as setRuntimeLimits, i as getChatConfig, m as setProfiles, n as botConfig, o as getSlackBotToken, p as setCrossActorMidRunMode, u as resetRuntimeConfig } from "./config-
|
|
4
|
+
import { t as JUNIOR_VERSION } from "./version-Ct049vav.js";
|
|
5
|
+
import { _ as snapshotRuntimeConfig, d as restoreRuntimeConfig, f as setBotModelConfig, g as setSlackReactionConfig, h as setRuntimeLimits, i as getChatConfig, m as setProfiles, n as botConfig, o as getSlackBotToken, p as setCrossActorMidRunMode, u as resetRuntimeConfig } from "./config-ULs6Zl9b.js";
|
|
6
6
|
import { _ as slackMessageTsSchema, d as parseSlackTeamId, f as parseSlackUserId, h as slackUserIdSchema, m as slackTeamIdSchema, o as parseActorUserId, p as slackChannelIdSchema } from "./actor-tlxzqaRe.js";
|
|
7
|
-
import { N as recordGoogleSignIn, _ as withConversationMutationLock, c as getConversationEventStore, d as getDb, f as getSqlExecutor, m as withConversationEventLock, r as readActorIdentity, u as getConversationStore } from "./viewer-
|
|
7
|
+
import { N as recordGoogleSignIn, _ as withConversationMutationLock, c as getConversationEventStore, d as getDb, f as getSqlExecutor, m as withConversationEventLock, r as readActorIdentity, u as getConversationStore } from "./viewer-C-J0ewlH.js";
|
|
8
8
|
import { a as juniorAgentInvocations, d as juniorDestinations, i as juniorAgentBindings, s as juniorConversations } from "./agent-invocations-Qfz7dWgU.js";
|
|
9
|
-
import { a as juniorAutomationRuns, f as juniorConversationBriefs, h as juniorConversationEvents, s as juniorAutomations } from "./executor-
|
|
10
|
-
import { m as credentialLogContext } from "./registry-
|
|
11
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
12
|
-
import {
|
|
13
|
-
import { $ as bindSlackDirectCredentialSubject,
|
|
14
|
-
import { W as annotationCard } from "./conversation-DjN3mlog.js";
|
|
15
|
-
import { l as getThreadStopDecision, o as SubscribedReplyReason } from "./pending-auth-rG5U_QS1.js";
|
|
16
|
-
import { b as eventGuidance, f as slackChannelMessageEvent, k as renderTaskInput, l as getEventCatalog, m as slackChannelMessageRunsAutomation, p as slackChannelMessageReplyThreadTs, u as SLACK_EVENT_NAMESPACE } from "./session-stop-CV65ZlU3.js";
|
|
17
|
-
import { r as getStateAdapter, s as withLock$1 } from "./adapter-Bn0gFVSF.js";
|
|
9
|
+
import { a as juniorAutomationRuns, f as juniorConversationBriefs, h as juniorConversationEvents, s as juniorAutomations } from "./executor-BoGNVEDn.js";
|
|
10
|
+
import { m as credentialLogContext } from "./registry-BL-osYWN.js";
|
|
11
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-Bpcs2b2L.js";
|
|
12
|
+
import { B as stopConversationSession, C as requestAttachmentDeletion, L as effectiveTaskOutcomes, M as logScheduledAutomationRunSkipped, N as scheduledAutomationRunAttributes, T as parseSlackThreadId, V as recordSubagentEnded, _ as unpublishedArtifactHeaders, g as readPublicArtifact, h as publicArtifactHeaders, n as executeAgentRun, ot as listPendingAgentInvocationMailboxAppends, st as listPendingAgentInvocationResults, t as createAgentRunner, v as lookupSlackUserProfile, vt as processWorkspaceSnapshotJob, x as collectAttachmentGarbage, yt as ingestEvent } from "./agent-runner-DvTUyGTY.js";
|
|
13
|
+
import { $ as bindSlackDirectCredentialSubject, Gt as listConversationAnnotations, Ht as resolveRootVisibility, Q as bindScheduledAutomationCredentialSubject, Tt as readConversationAccessFromSql, U as collectEventMatchKeys, X as takeDueTimerWatches, Z as bindEventAutomationCredentialSubject, _t as getDashboardConversationLink, a as getPluginRoutes, bt as setDashboardConversationLinkOptions, ct as getSlackClient, d as setPlugins, et as verifyEventAutomationCredentialSubject, f as validatePlugins, h as setBriefsConfig, ht as runWithWorkspaceTeamId, i as getPluginApiRoutes, mt as getWorkspaceTeamId, nt as verifySlackDirectCredentialSubject, q as findMatchingWatches, tt as verifyScheduledAutomationCredentialSubject, u as getPlugins, ut as isDmChannel, wt as createPluginLogger, xt as createPluginState, yt as getDashboardTaskLink } from "./agent-hooks-V4Hfc2tB.js";
|
|
18
14
|
import { n as getNextRunAtMs } from "./cadence-R7Em4RjE.js";
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import { i as
|
|
24
|
-
import {
|
|
15
|
+
import { M as annotationCard } from "./conversation-CvuKJ3tA.js";
|
|
16
|
+
import { r as getStateAdapter, s as withLock$1 } from "./adapter-Dj5BTJRd.js";
|
|
17
|
+
import { M as renderTaskInput, S as eventGuidance, d as getEventCatalog, f as SLACK_EVENT_NAMESPACE, g as slackChannelMessageRunsAutomation, h as slackChannelMessageReplyThreadTs, m as slackChannelMessageEvent } from "./session-stop-HfKx-pky.js";
|
|
18
|
+
import { f as setSandboxResourceConfig, u as getSandboxResourceConfig } from "./resolve-HuPG2VMB.js";
|
|
19
|
+
import { a as getVercelConversationWorkQueue, g as isConversationQueueMessageRejectedError, h as conversationQueueMessageSchema, i as verifyWorkspaceSnapshotJobMessage, o as resolveConversationWorkQueueTopic, s as verifyConversationQueueMessage, t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-CbdVyaCo.js";
|
|
20
|
+
import { A as hasRunnableConversationWork$1, M as isInvalidConversationRecordError, O as CONVERSATION_WORK_STALE_ENQUEUE_MS, S as removeActiveConversation, _ as hasRunnableConversationWork, c as clearExpiredConversationLease, g as getConversationWorkState, h as getConversation, m as ensureConversationWake, r as appendAndEnqueueInboundMessage, v as listActiveConversationIds } from "./store-DzRbd5VT.js";
|
|
21
|
+
import { D as scheduledRunSchema } from "./automation-DrpcA-SX.js";
|
|
22
|
+
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-BrXMYPyo.js";
|
|
25
23
|
import { a as pluginRuntimeRegistrationsFromPluginSet, n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "./plugins-DOm9Y6qI.js";
|
|
26
|
-
import { A as THREAD_OPTOUT_ACK, C as buildSlackInboundMessage, D as normalizeIncomingSlackThreadId, E as stopSlackThread, F as renderSlackObjectCard, I as createVercelAttachmentStorage, M as parseContent, N as runWithSlackInstallation, O as withNormalizedThreadId, P as verifySlackSignature, R as enqueueAgentDispatch, S as recordSkippedConversationMessage, T as isSlackMessageStopped, a as recordWebConversationActivity, c as createProductionSlackWebhookServices, f as createSlackWebApiStatusSender, j as startProcessingReaction, k as stopConversationTurn, l as getProductionSlackAdapter, n as conversationTurnIdForMessage, o as webActorFromEmail, s as createProductionConversationWorkOptions, t as appendAndEnqueueWebMessage, v as readViewerAutomationSummary, w as clearSlackPendingReactions, z as GET$3 } from "./web-input-
|
|
27
|
-
import { C as existingConversationId, N as recordAutomationExecution, c as getDispatchConversationId, d as getDispatchRecord, h as listPendingDispatchMailboxAppends, i as buildDispatchId, m as isTerminalDispatchStatus, o as confirmDispatchMailboxAppend, p as getPluginDispatchProjection, s as createOrGetDispatch, t as processPluginTask, x as notifyAutomationBlocked, y as markDispatchFailed } from "./task-runner-
|
|
28
|
-
import { o as getAuthPausedConversationTurnId, t as enqueueAgentInvocationResult } from "./result-
|
|
29
|
-
import { r as enqueueAgentInvocation } from "./work-
|
|
30
|
-
import { s as coerceThreadConversationState } from "./thread-state-
|
|
31
|
-
import { o as unlinkProvider } from "./connections-
|
|
32
|
-
import { a as GET$4, i as publishAppHomeView, r as GET$5, t as receiveLocalOAuthCredential } from "./credential-sync-
|
|
33
|
-
import { a as registerVercelPluginTaskDevConsumer, n as createVercelPluginTaskCallback, s as queueCallback } from "./task-queue-
|
|
34
|
-
import { t as processConversationWork } from "./worker-
|
|
35
|
-
import { t as bindMessageAgent } from "./message-
|
|
36
|
-
import { t as bindSpawnAgent } from "./spawn-
|
|
24
|
+
import { A as THREAD_OPTOUT_ACK, C as buildSlackInboundMessage, D as normalizeIncomingSlackThreadId, E as stopSlackThread, F as renderSlackObjectCard, I as createVercelAttachmentStorage, M as parseContent, N as runWithSlackInstallation, O as withNormalizedThreadId, P as verifySlackSignature, R as enqueueAgentDispatch, S as recordSkippedConversationMessage, T as isSlackMessageStopped, a as recordWebConversationActivity, c as createProductionSlackWebhookServices, f as createSlackWebApiStatusSender, j as startProcessingReaction, k as stopConversationTurn, l as getProductionSlackAdapter, n as conversationTurnIdForMessage, o as webActorFromEmail, s as createProductionConversationWorkOptions, t as appendAndEnqueueWebMessage, v as readViewerAutomationSummary, w as clearSlackPendingReactions, z as GET$3 } from "./web-input-C_xB3RXp.js";
|
|
25
|
+
import { C as existingConversationId, N as recordAutomationExecution, c as getDispatchConversationId, d as getDispatchRecord, h as listPendingDispatchMailboxAppends, i as buildDispatchId, m as isTerminalDispatchStatus, o as confirmDispatchMailboxAppend, p as getPluginDispatchProjection, s as createOrGetDispatch, t as processPluginTask, x as notifyAutomationBlocked, y as markDispatchFailed } from "./task-runner-DGnd_B5X.js";
|
|
26
|
+
import { o as getAuthPausedConversationTurnId, t as enqueueAgentInvocationResult } from "./result-DS7V4a3-.js";
|
|
27
|
+
import { r as enqueueAgentInvocation } from "./work-D829Ue7k.js";
|
|
28
|
+
import { s as coerceThreadConversationState } from "./thread-state-CqkYowEz.js";
|
|
29
|
+
import { o as unlinkProvider } from "./connections-CZ7HhEmN.js";
|
|
30
|
+
import { a as GET$4, i as publishAppHomeView, r as GET$5, t as receiveLocalOAuthCredential } from "./credential-sync-BKcv5rBe.js";
|
|
31
|
+
import { a as registerVercelPluginTaskDevConsumer, n as createVercelPluginTaskCallback, s as queueCallback } from "./task-queue-9LICOzcL.js";
|
|
32
|
+
import { t as processConversationWork } from "./worker-BRTYzlpk.js";
|
|
33
|
+
import { t as bindMessageAgent } from "./message-zaj5gBbS.js";
|
|
34
|
+
import { t as bindSpawnAgent } from "./spawn-BWqK6EwM.js";
|
|
37
35
|
import { createRequire } from "node:module";
|
|
38
36
|
import { Hono } from "hono";
|
|
39
37
|
import { z } from "zod";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { a as resolveLocalScheduleAtMs, i as isValidTimeZone, r as getZonedDateTimeParts, t as getFirstRunAtMs } from "./cadence-R7Em4RjE.js";
|
|
2
|
+
import { n as actorIdentitySchema } from "./conversation-CvuKJ3tA.js";
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
import { actorUserIdSchema, destinationVisibilitySchema, eventMatchSchema, eventTypeSchema, pluginEventTypeSchema, slackDestinationSchema, taskOutcomeSchema } from "@sentry/junior-plugin-api";
|
|
4
5
|
// src/chat/task-outcomes-schema.ts
|
|
@@ -395,6 +396,8 @@ const automationSummaryBaseSchema = z.object({
|
|
|
395
396
|
destination: automationDestinationSchema,
|
|
396
397
|
id: z.string().min(1),
|
|
397
398
|
instruction: z.string().min(1),
|
|
399
|
+
/** People mentioned in the instruction, resolved at read time. */
|
|
400
|
+
mentions: z.array(actorIdentitySchema).optional(),
|
|
398
401
|
lastConversationId: z.string().min(1).optional(),
|
|
399
402
|
lastRunAt: z.string().datetime().optional(),
|
|
400
403
|
lastRunStatus: z.enum([
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { i as completeObject } from "./client-
|
|
1
|
+
import { i as completeObject } from "./client-JeyzRwsT.js";
|
|
2
2
|
import { r as defaultModelId } from "./model-profile-Bg8EoCKD.js";
|
|
3
|
-
import {
|
|
4
|
-
import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-
|
|
3
|
+
import { J as parseBriefInput, W as briefCodeChangeSchema, d as conversationDetailReportSchema, p as conversationEventPageSchema } from "./conversation-CvuKJ3tA.js";
|
|
4
|
+
import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-DeVax2qO.js";
|
|
5
5
|
import { CLI_USAGE } from "./cli/run.js";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import { z } from "zod";
|
|
@@ -267,7 +267,7 @@ async function parseRunOptions(argv) {
|
|
|
267
267
|
* `DATABASE_URL` at import, and `briefs pull` must work with only a token.
|
|
268
268
|
*/
|
|
269
269
|
async function configuredDefaultModelId() {
|
|
270
|
-
const { botConfig } = await import("./config-
|
|
270
|
+
const { botConfig } = await import("./config-ULs6Zl9b.js").then((n) => n.r);
|
|
271
271
|
return defaultModelId(botConfig);
|
|
272
272
|
}
|
|
273
273
|
function apiUrl(baseUrl, pathname) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
|
|
2
|
-
import { t as createPluginCatalogRuntime } from "./registry-
|
|
2
|
+
import { t as createPluginCatalogRuntime } from "./registry-BL-osYWN.js";
|
|
3
3
|
// src/chat/plugins/catalog-runtime.ts
|
|
4
4
|
var catalog_runtime_exports = /* @__PURE__ */ __exportAll({ pluginCatalogRuntime: () => pluginCatalogRuntime });
|
|
5
5
|
const pluginCatalogRuntime = createPluginCatalogRuntime();
|
package/dist/cli/chat.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as executeAgentRun, t as createAgentRunner } from "../agent-runner-
|
|
1
|
+
import { n as executeAgentRun, t as createAgentRunner } from "../agent-runner-DvTUyGTY.js";
|
|
2
2
|
import { t as loadAppPluginSet } from "../plugin-module-Cf5gVPWP.js";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { createHash, randomUUID } from "node:crypto";
|
|
@@ -99,10 +99,10 @@ async function loadLocalPluginSet() {
|
|
|
99
99
|
async function configureLocalChatPlugins(pluginSet) {
|
|
100
100
|
const [pluginsModule, agentHooksModule, catalogRuntimeModule, validationModule, databaseModule] = await Promise.all([
|
|
101
101
|
import("../plugins-DOm9Y6qI.js").then((n) => n.o),
|
|
102
|
-
import("../agent-hooks-
|
|
103
|
-
import("../catalog-runtime-
|
|
104
|
-
import("../validation-
|
|
105
|
-
import("../viewer-
|
|
102
|
+
import("../agent-hooks-V4Hfc2tB.js").then((n) => n.t),
|
|
103
|
+
import("../catalog-runtime-Bpcs2b2L.js").then((n) => n.t),
|
|
104
|
+
import("../validation-BrXMYPyo.js").then((n) => n.r),
|
|
105
|
+
import("../viewer-C-J0ewlH.js").then((n) => n.s)
|
|
106
106
|
]);
|
|
107
107
|
const resolvedPluginSet = pluginSet === void 0 ? await loadLocalPluginSet() : pluginSet ?? void 0;
|
|
108
108
|
const plugins = pluginsModule.pluginRuntimeRegistrationsFromPluginSet(resolvedPluginSet);
|
|
@@ -152,21 +152,21 @@ function localDevServerUrl() {
|
|
|
152
152
|
async function prepareLocalChatRun(io, pluginSet) {
|
|
153
153
|
defaultStateAdapterForLocalChat();
|
|
154
154
|
await configureLocalChatPlugins(pluginSet);
|
|
155
|
-
const { setExperimentalFeatures } = await import("../
|
|
155
|
+
const { setExperimentalFeatures } = await import("../tasks-CjrS098O.js").then((n) => n.hn);
|
|
156
156
|
setExperimentalFeatures({ subagents: true });
|
|
157
|
-
const { setBriefsConfig } = await import("../agent-hooks-
|
|
157
|
+
const { setBriefsConfig } = await import("../agent-hooks-V4Hfc2tB.js").then((n) => n.m);
|
|
158
158
|
setBriefsConfig({ enabled: true });
|
|
159
|
-
const { runLocalAgentTurn } = await import("../runner-
|
|
160
|
-
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-
|
|
159
|
+
const { runLocalAgentTurn } = await import("../runner-Cba_OfGl.js");
|
|
160
|
+
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-yYFG8Own.js");
|
|
161
161
|
const { createLocalOAuthState } = await import("../oauth-relay-CTygMkNx.js").then((n) => n.t);
|
|
162
|
-
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-
|
|
163
|
-
const { bindSpawnAgent } = await import("../spawn-
|
|
164
|
-
const { bindMessageAgent } = await import("../message-
|
|
165
|
-
const { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-
|
|
166
|
-
const { startAgentInvocationsForChildInput } = await import("../result-
|
|
167
|
-
const { skipInputBeforeConversationStop } = await import("../session-stop-
|
|
162
|
+
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-C7NcPzea.js");
|
|
163
|
+
const { bindSpawnAgent } = await import("../spawn-BWqK6EwM.js").then((n) => n.n);
|
|
164
|
+
const { bindMessageAgent } = await import("../message-zaj5gBbS.js").then((n) => n.n);
|
|
165
|
+
const { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-D829Ue7k.js").then((n) => n.a);
|
|
166
|
+
const { startAgentInvocationsForChildInput } = await import("../result-DS7V4a3-.js").then((n) => n.r);
|
|
167
|
+
const { skipInputBeforeConversationStop } = await import("../session-stop-HfKx-pky.js").then((n) => n.r);
|
|
168
168
|
const { createLocalConversationWork } = await import("../conversation-work-BaT_T6EB.js");
|
|
169
|
-
const { processConversationWork } = await import("../worker-
|
|
169
|
+
const { processConversationWork } = await import("../worker-BRTYzlpk.js").then((n) => n.n);
|
|
170
170
|
let agentRunner;
|
|
171
171
|
const localConversationWork = createLocalConversationWork(async (message) => {
|
|
172
172
|
if (!agentRunner) throw new Error("Local agent runner is not ready");
|
package/dist/cli/check.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { E as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, N as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, O as JUNIOR_HEARTBEAT_ROUTE } from "../logging-
|
|
2
|
-
import { v as parseInlinePluginManifest, y as parsePluginManifest } from "../registry-
|
|
3
|
-
import { i as parseSkillFile } from "../skills-
|
|
1
|
+
import { E as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, N as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, O as JUNIOR_HEARTBEAT_ROUTE } from "../logging-DSMmkHXG.js";
|
|
2
|
+
import { v as parseInlinePluginManifest, y as parsePluginManifest } from "../registry-BL-osYWN.js";
|
|
3
|
+
import { i as parseSkillFile } from "../skills-D6_bcAuW.js";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import fs from "node:fs/promises";
|
|
6
6
|
import { pathToFileURL } from "node:url";
|