@sentry/junior 0.312.0 → 0.314.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-iIq7ihf7.js → adapter-JARQvoLw.js} +1 -2
- package/dist/{adapter-context-BRjEWRy1.js → adapter-context-B4BrJZuS.js} +2 -2
- package/dist/{admin-DhInw5K9.js → admin-BXGAySz0.js} +1 -1
- package/dist/{agent-runner-C9iDurwX.js → agent-runner-qZU5TR8i.js} +865 -138
- package/dist/agent-update-cS7Z9mnG.js +26 -0
- package/dist/agent-update-delivery-CZ5M8RDa.js +85 -0
- package/dist/api/schema.d.ts +2 -2
- package/dist/api/schema.js +6 -6
- package/dist/api.d.ts +1 -1
- package/dist/api.js +340 -106
- package/dist/{app-DRFrC8Mw.d.ts → app-D7tKnw9a.d.ts} +4 -21
- package/dist/app.d.ts +2 -2
- package/dist/app.js +80 -171
- package/dist/{background-compaction-queue-DrKi7w3d.js → background-compaction-queue-C_uIBUvS.js} +6 -17
- package/dist/{callback-mFlTUWWx.js → callback-C8SdXCwr.js} +4 -11
- package/dist/{catalog-runtime-D7xapBAX.js → catalog-runtime-BLKtnUL3.js} +1 -1
- package/dist/{channel-access-CJGfNTdn.js → channel-access-BOL29BG3.js} +6 -6
- package/dist/child-message--2G3Ft26.js +19 -0
- package/dist/cli/chat.js +18 -21
- package/dist/cli/check.js +4 -4
- package/dist/cli/main.js +2 -2
- package/dist/cli/plugins.js +5 -5
- package/dist/cli/snapshot-create.js +5 -5
- package/dist/cli/upgrade.d.ts +1 -1
- package/dist/cli/upgrade.js +23 -4
- package/dist/{config-kXB2Y5tl.js → config-BIfHKNXN.js} +40 -35
- package/dist/{continue-in-slack-O6pV5004.js → continue-in-slack-fnmD2Ifb.js} +5 -7
- package/dist/{conversation-feed-uNOv_x68.js → conversation-feed-DdFQuQDR.js} +13 -2
- package/dist/{logging-dQ9ZRGQ8.js → conversation-privacy-DtZhI91r.js} +188 -2
- package/dist/{conversation-turn-CeLbHqdw.js → conversation-turn-DScuDYmN.js} +465 -62
- package/dist/create-CrNt4Ewu.js +212 -0
- package/dist/{credential-sync-I8VBGk05.js → credential-sync-CtqsGjj1.js} +14 -18
- package/dist/{credentialed-Cb6E2phL.js → credentialed-dWRA3-oJ.js} +911 -429
- package/dist/{db-LAyyX8tk.js → db-BTmLKZrp.js} +2245 -50
- package/dist/{db-BbC5stfa.d.ts → db-DcmzbA55.d.ts} +2 -2
- package/dist/{history-CYstOMKX.js → history-CneKY7_V.js} +19 -1
- package/dist/{html-BCZ3Xtb_.js → html-B8rBt7F4.js} +5 -7
- package/dist/{install-DCFJFkC0.js → install-OtFboxOM.js} +2 -2
- package/dist/instrumentation.js +2 -2
- package/dist/{lineage-B_m-4TJw.js → lineage-EULJkGO1.js} +1 -2
- package/dist/{list-CN2QA2R9.js → list-C5400AlJ.js} +284 -113
- package/dist/{thread-state-DhPndWi1.js → mailbox-turn-DL3Lvsm0.js} +4830 -485
- package/dist/markers-DUP8aBOp.js +323 -0
- package/dist/{media-CYm1QD8T.js → media-FYM-Bl3H.js} +42 -14
- package/dist/{message-DSXGj1hM.js → message-DuDelZFr.js} +16 -15
- package/dist/{model-input--TrP9hYV.js → model-input-0osF3pBS.js} +3 -3
- package/dist/nitro.d.ts +2 -4
- package/dist/nitro.js +340 -13
- package/dist/{oauth-callback-server-DHCZC6B4.js → oauth-callback-server-DX2fQ7Nq.js} +2 -2
- package/dist/{oauth-relay-pPMGnDZt.js → oauth-relay-PwPMdZJv.js} +1 -1
- package/dist/{plugins-Bkk0XRo2.js → plugins-BXMdNdyA.js} +1 -1
- package/dist/{registry-CZOzddwu.js → registry-D6kS6xYH.js} +1402 -64
- package/dist/{statuses-_cRJHXK7.js → reporting-window-C4dbzDiR.js} +1 -27
- package/dist/{resolve-cKOQ14Dh.js → resolve-D8CPJcNK.js} +3 -3
- package/dist/result-D090hxr5.js +402 -0
- package/dist/{runner-DBfUW44l.js → runner-BU7fgrm-.js} +7 -8
- package/dist/{sandbox-egress-signals-BVF_xAm1.js → sandbox-egress-signals-BUmVrsoG.js} +1 -1
- package/dist/{schema-Bk9Nm2E8.js → schema-7gW9vBpJ.js} +91 -10
- package/dist/{schema-BEHKxr4I.d.ts → schema-BB6E0wyV.d.ts} +2105 -2753
- package/dist/{service-account-CVYsFjty.js → service-account-plA-uzIB.js} +6 -5
- package/dist/{skills-VTnhAJWm.js → skills-CIosT6bS.js} +3 -3
- package/dist/{slack-conversation-unfurl-fuLnF1jE.js → slack-conversation-unfurl-CBgZqth6.js} +8 -10
- package/dist/spawn-DRjdzh3R.js +46 -0
- package/dist/{start-conversation-CEn2KH1A.js → start-conversation-a4NXH4X9.js} +13 -202
- package/dist/{store-DFZaN-Ix.js → store-BuhF1QDm.js} +2 -4
- package/dist/{task-queue-Cx4Lmjyk.js → task-queue-CrRjFzOh.js} +5 -16
- package/dist/{task-runner-CbTwFA6k.js → task-runner-C-pXsgHM.js} +105 -51
- package/dist/{thread-context-BkAZDTX2.js → thread-context-CDX4dSZd.js} +8 -10
- package/dist/turn-session-routing-CZTRU8IY.js +116 -0
- package/dist/turn-wake-Bzq1Efrm.js +154 -0
- package/dist/user-customization-B27StpVQ.js +9 -0
- package/dist/{validation-nIzMtAVJ.js → validation-bTq88sya.js} +1 -1
- package/dist/{vercel-queue-hW90XzbG.js → vercel-queue-nL0Hq3hr.js} +32 -147
- package/dist/{version-Brbtz4Qf.js → version-DGUa1dZK.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{warmup-BDA5myRK.js → warmup-CCOuIwAS.js} +831 -3254
- package/dist/{worker-D63RcaVD.js → worker-AkZg7Dg1.js} +5 -6
- package/migrations/0158_keep_legacy_archive_columns.sql +5 -0
- package/migrations/0159_conversation_embeddings_fk_validate.sql +5 -0
- package/migrations/0160_money_micro_usd_repair.sql +99 -0
- package/migrations/0161_agent_config_backfill.sql +34 -0
- package/migrations/0162_inbox_item_deliveries.sql +15 -0
- package/migrations/0163_pg_trgm.sql +2 -0
- package/migrations/0164_search_indexes.sql +4 -0
- package/migrations/0165_drop_legacy_archive_columns.sql +4 -0
- package/migrations/0166_memory_prefix_index.sql +1 -0
- package/migrations/0167_todo_search_indexes.sql +2 -0
- package/migrations/0168_todo_inbox_items.sql +4 -0
- package/migrations/0169_drop_code_urls.sql +2 -0
- package/migrations/meta/0158_snapshot.json +6515 -0
- package/migrations/meta/0159_snapshot.json +6515 -0
- package/migrations/meta/0160_snapshot.json +6515 -0
- package/migrations/meta/0161_snapshot.json +6278 -0
- package/migrations/meta/0162_snapshot.json +6404 -0
- package/migrations/meta/0163_snapshot.json +6404 -0
- package/migrations/meta/0164_snapshot.json +6466 -0
- package/migrations/meta/0165_snapshot.json +6466 -0
- package/migrations/meta/0166_snapshot.json +6494 -0
- package/migrations/meta/0167_snapshot.json +6525 -0
- package/migrations/meta/0168_snapshot.json +6525 -0
- package/migrations/meta/0169_snapshot.json +6513 -0
- package/migrations/meta/_journal.json +84 -0
- package/package.json +9 -18
- package/skills/design-automation-skill/SKILL.md +2 -3
- package/dist/actor-BsBdxDXQ.js +0 -208
- package/dist/child-message-DcsritGf.js +0 -179
- package/dist/conversation-privacy-L4ja1_W6.js +0 -189
- package/dist/executor-SCub-fAq.js +0 -1860
- package/dist/fan-out-Cod-yEHG.js +0 -10
- package/dist/ingest-BDf3D50j.js +0 -3836
- package/dist/result-DcvEOe1r.js +0 -574
- package/dist/result-event-type-BdIJuZxg.js +0 -48
- package/dist/service-account-Ts4ulcrV.js +0 -931
- package/dist/spawn-vxAarlX5.js +0 -73
- package/dist/state-C1P3_Ywk.js +0 -161
package/dist/api.js
CHANGED
|
@@ -1,35 +1,31 @@
|
|
|
1
|
-
import { A as readEnabledProviders, M as saveEnabledProviders, N as cacheKeyPrefix, P as createCache, gt as
|
|
2
|
-
import { $
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { A as automationVersionActivateSchema, C as automationRunListSchema, D as automationSchedulePreviewSchema, E as automationScheduleIntentSchema, G as conversationDetailReportSchema, H as conversationAttachmentQuerySchema, I as CONVERSATION_DETAIL_VERSION_HEADER, J as conversationEventsQuerySchema, L as CONVERSATION_VERSION_HEADER, Lt as ScheduleIntentError, M as automationVersionParamsSchema, O as automationSummarySchema, R as acceptedConversationMessageSchema, Rt as compileScheduleIntent, S as automationParamsSchema, Tt as MAX_ATTACHMENT_BYTES, V as conversationAttachmentParamsSchema, W as conversationDetailQuerySchema, Y as conversationParamsSchema, _ as automationLifecycleSchema, _t as conversationReadPositionSchema, b as automationListQuerySchema, d as automationEditSchema, f as automationEventCatalogSchema,
|
|
7
|
-
import { $
|
|
8
|
-
import { C as conversationUnchangedDetailWithMailboxSchema, D as pluginOperationalReportFeedSchema, E as healthReportSchema, I as skillReportsSchema, M as pluginsSchema, N as runtimeInfoReportSchema, P as skillDetailReportSchema, S as conversationPendingMessagesReportSchema, T as steerConversationPendingMessagesResponseSchema, a as conversationInviteResponseSchema, d as reorderPinnedConversationsResponseSchema, i as conversationInviteBodySchema, n as conversationFeedSchema, t as conversationFeedQuerySchema, u as reorderPinnedConversationsBodySchema, v as conversationDetailWithMailboxReportSchema, w as steerConversationPendingMessagesBodySchema } from "./conversation-feed-
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { A as
|
|
12
|
-
import { a as readConversationEventPage, i as transcriptEntriesFromReportEvents } from "./task-runner-
|
|
13
|
-
import {
|
|
14
|
-
import { t as runWithSlackInstallation } from "./adapter-context-
|
|
15
|
-
import {
|
|
16
|
-
import { i as continueConversationInSlack, r as canContinueInSlack, t as BUSY } from "./continue-in-slack-
|
|
17
|
-
import {
|
|
18
|
-
import { i as readLiveAttachment } from "./store-DFZaN-Ix.js";
|
|
1
|
+
import { A as readEnabledProviders, M as saveEnabledProviders, N as cacheKeyPrefix, P as createCache, gt as mapBounded, j as readServedProviders, n as botConfig, vt as getAttachmentStorage, z as withLock } from "./config-BIfHKNXN.js";
|
|
2
|
+
import { $ as rankSearchMatches, $t as updateWorkspace, D as readWebPushConfig, Ds as completeText, Eo as cancelWatch, F as saveNotificationSchedule, Fo as listWatches, G as revalidateContent, Ga as ownerConversationId, H as REVALIDATED_READ_PATHS, I as savePushSubscription, Ia as countInboxItemsNeedingUserBySubject, J as parseTypedQuery, Jt as deleteWorkspace, K as memoryDb, Ka as searchInboxItems, M as deletePushSubscription, N as listPushSubscriptions, O as sendPushNotificationToUser, P as readNotificationSchedule, Q as prefixRank, Qt as listWorkspacesByRepository, R as isPausedBySlack, Ra as getInboxItem, Ri as getDashboardConversationLink, Rr as createPluginLogger, T as apiRoutePrefix, Ta as readAutomationTitlesByConversationId, U as contentVersion, Ui as getDashboardPersonLink, Un as createPluginEmbedder, Va as inboxItemsNeedingUserVersionQuery, Vn as workspaceRepoCheckoutPath, W as contentVersionHeaders, Wi as getDashboardSettingsLink, X as fuzzyRank, Y as fuzzyMatch, Yt as getWorkspace, Z as prefixMatch, Zt as listWorkspaces, an as create, bi as formatSlackLink, co as snoozeInboxItems, cr as createPluginAnnotations, do as getEventCatalog, en as WorkspaceValidationError, et as scoredSearchMatches, g as getRegistrations, h as getPlugins, io as inboxItemSnoozedBy, j as resolveNotificationTimezone, lo as snoozeTimerTrigger, lr as listConversationAnnotations, ls as automationEventCatalog, on as hash, oo as readViewerInboxSnoozes, pa as AutomationConflictError, ps as eventWatchUnavailable, q as searchTypedMemories, qt as createWorkspace, r as createUserTokenStore, ro as inboxItemInRow, so as settleInboxSnoozes, to as clearInboxWakeReasons, ui as postSlackMessage, uo as unsnoozeInboxRow, ws as createPluginCache, yi as escapeSlackMrkdwnText, zn as SANDBOX_RUNTIME } from "./credentialed-dWRA3-oJ.js";
|
|
3
|
+
import { $ as microUsdSql, Ar as juniorConversationEvents, Bn as rootVisibleToViewer, Br as juniorConversations, Ct as canUserReadInboxItem, Fr as juniorCodeChanges, Gr as juniorDestinations, Hr as slackPersonPredicate, Ir as juniorCodeRepositories, It as isOnlyAssignee, Mn as readConversationAccessFromSql, Mt as inboxItemReaderForUserInConversation, Nr as codeChangeSearchDocument, Nt as inboxItemTodo, Pn as readableSlackTeamId, Pr as codeRepositorySearchDocument, Pt as inboxItemVisibleTo, Rt as itemNeedsUser, Sr as juniorAgentBindings, Tt as inboxItemForUser, Ur as slackPersonSearchDocument, Vr as juniorIdentities, Wr as juniorUsers, _r as automationSearchDocument, a as getDb, an as identityAvatarUrl, ar as todoSearchDocument, at as conversationUsageCostExpr, bt as canActOnInboxItem, cn as readUserAvatarUrls, ct as conversationTurnFailedSql, dt as conversationKindFromRow, en as readViewerAvatarUrl, et as microUsdToUsd, fi as parseSlackChannelId, fr as juniorInboxItemConversations, gr as automationFuzzyTitle, hr as juniorInboxItems, i as getConversationStore, ir as todoFuzzyTitle, it as conversationRangeColumns, jn as createConversationAccessReader, jr as juniorApiTokens, jt as inboxItemReaderForUser, kr as juniorConversationMetrics, lr as inboxItemFuzzyTitle, mi as parseSlackTeamId, nt as usdToMicroUsdUnbiased, o as getSqlExecutor, ot as conversationIsActiveSql, qt as findUserByEmail, rn as updateViewerDisplayName, rr as juniorTodos, rt as conversationAggregateColumns, sn as readAvatarFetch, st as conversationStatusSql, tn as resolveViewerUser, ur as inboxItemSearchDocument, vr as juniorAutomations, x as loadConversationSlackTenantIds } from "./db-BTmLKZrp.js";
|
|
4
|
+
import { C as logInfo, E as runBestEffort, F as withSpan, O as setSentryUser, S as logException, w as logWarn } from "./conversation-privacy-DtZhI91r.js";
|
|
5
|
+
import { Ar as addStats, Br as connectedState, Ht as jsonResponse, Ir as breakerStates, Jn as readViewerAutomationEdit, Kn as changeViewerAutomationLifecycle, Mr as readStats, Pt as listOwnedWatches, Qn as collectionRowTitle, Tt as reportConversationRead, Un as activateViewerAutomationVersion, Ut as throwApiError, Vt as emptyResponse, Xn as updateViewerAutomation, Zn as ViewerTaskNotFoundError, _r as viewerAutomationCollection, er as readViewerAutomationExecutions, ir as readViewerAutomations, kr as savingsTotals, nr as readViewerAutomationSummary, qn as deleteViewerTask, rr as readViewerAutomationVersions, tr as readViewerAutomationRuns, ur as AutomationEditError, yr as SAVINGS_NAMESPACE, zr as closeBreaker, zt as inviteToConversation } from "./warmup-CCOuIwAS.js";
|
|
6
|
+
import { A as automationVersionActivateSchema, C as automationRunListSchema, D as automationSchedulePreviewSchema, E as automationScheduleIntentSchema, G as conversationDetailReportSchema, H as conversationAttachmentQuerySchema, I as CONVERSATION_DETAIL_VERSION_HEADER, J as conversationEventsQuerySchema, L as CONVERSATION_VERSION_HEADER, Lt as ScheduleIntentError, M as automationVersionParamsSchema, O as automationSummarySchema, R as acceptedConversationMessageSchema, Rt as compileScheduleIntent, S as automationParamsSchema, Tt as MAX_ATTACHMENT_BYTES, V as conversationAttachmentParamsSchema, W as conversationDetailQuerySchema, Y as conversationParamsSchema, _ as automationLifecycleSchema, _t as conversationReadPositionSchema, b as automationListQuerySchema, d as automationEditSchema, f as automationEventCatalogSchema, fn as automationTaskText, it as createConversationMessageBodySchema, j as automationVersionListSchema, k as automationUpdateSchema, l as apiErrorSchema, n as INPUT_IMAGE_TYPES, p as automationExecutionListSchema, q as conversationEventPageSchema, r as detectImageMediaType, rt as createConversationBodySchema, s as notificationScheduleSchema, t as INLINE_VIDEO_TYPES, u as automationEditErrorSchema, y as automationListPageSchema } from "./media-FYM-Bl3H.js";
|
|
7
|
+
import { $ as actorProfileReportSchema, $t as objectLinksQuerySchema, A as cacheHealthQuerySchema, B as serviceAccountParamsSchema, Bt as conversationTodosReportSchema, C as inboxSnoozeResourceQuerySchema, Ct as disconnectConnectionResponseSchema, D as inboxSnoozeWakesClearSchema, Dt as codeChangeSearchQuerySchema, E as inboxSnoozeSubjectSchema, F as cacheWarmingSavingsRefillResponseSchema, Ft as codeRepositoryReportSchema, G as createPersonalTokenBodySchema, Gt as watchParamsSchema, H as startServiceAccountSignInResponseSchema, Ht as todoStatusBodySchema, I as cacheWarmingSavingsReportSchema, Jt as continueConversationInSlackBodySchema, K as createdPersonalTokenSchema, L as closeCacheWarmingBreakerResponseSchema, M as cacheWarmingBreakerListSchema, Mt as codePersonReportSchema, N as cacheWarmingBreakerParamsSchema, Nt as codeRepositoryParamsSchema, O as gatewayProvidersSchema, Ot as codeChangeSearchReportSchema, P as cacheWarmingSavingsQuerySchema, Pt as codeRepositoryQuerySchema, Q as actorDirectoryReportSchema, Qt as attachObjectLinkResponseSchema, R as disconnectServiceAccountResponseSchema, Rt as personCodeQuerySchema, S as inboxSnoozeCreateSchema, T as inboxSnoozeSchema, U as searchQuerySchema, Vt as todoParamsSchema, W as searchReportSchema, Wt as conversationWatchesReportSchema, X as revokePersonalTokenResponseSchema, Y as personalTokenParamsSchema, Yt as continueConversationInSlackResponseSchema, Zt as attachObjectLinkBodySchema, _ as inboxItemListSchema, _t as pushSubscriptionBodySchema, a as statsReportSchema, an as conversationDeliveryResponseSchema, at as personParamsSchema, b as inboxItemWaitingConversationsSchema, bt as connectionListSchema, c as workspaceBodySchema, cn as attachmentUploadParamsSchema, dn as forkConversationBodySchema, dt as locationParamsSchema, en as objectLinksReportSchema, et as avatarParamsSchema, f as workspaceSchema, fn as forkConversationResponseSchema, ft as activityDays$1, g as inboxItemListQuerySchema, gt as notificationSettingsSchema, h as inboxItemCountSchema, in as conversationDeliveryBodySchema, it as personCardReportSchema, j as cacheHealthReportSchema, jt as codeOverviewReportSchema, k as updateGatewayProvidersBodySchema, l as workspaceListSchema, ln as attachmentUploadSchema, lt as locationDetailReportSchema, m as inboxItemCountQuerySchema, mt as activitySixHours$1, n as versionsQuerySchema, nt as peopleSearchQuerySchema, on as conversationCatchUpBodySchema, ot as personalSpendReportSchema, p as inboxItemActionSchema, pt as activityHours$2, q as personalTokenListSchema, qt as conversationChildAgentsReportSchema, r as versionsSchema, rn as conversationOutlineSchema, rt as peopleSearchReportSchema, s as deleteWorkspaceResponseSchema, sn as conversationCatchUpSchema, st as leadSchema, tn as conversationStatsReportSchema, u as workspaceParamsSchema, un as createAttachmentUploadBodySchema, ut as locationDirectoryReportSchema, v as inboxItemParamsSchema, vt as pushSubscriptionDeleteBodySchema, w as inboxSnoozeResourceSchema, wt as startConnectionResponseSchema, xt as connectionParamsSchema, y as inboxItemSchema, yt as testNotificationResponseSchema, z as serviceAccountListSchema, zt as conversationTodoSchema } from "./schema-7gW9vBpJ.js";
|
|
8
|
+
import { C as conversationUnchangedDetailWithMailboxSchema, D as pluginOperationalReportFeedSchema, E as healthReportSchema, I as skillReportsSchema, M as pluginsSchema, N as runtimeInfoReportSchema, P as skillDetailReportSchema, S as conversationPendingMessagesReportSchema, T as steerConversationPendingMessagesResponseSchema, a as conversationInviteResponseSchema, d as reorderPinnedConversationsResponseSchema, i as conversationInviteBodySchema, n as conversationFeedSchema, t as conversationFeedQuerySchema, u as reorderPinnedConversationsBodySchema, v as conversationDetailWithMailboxReportSchema, w as steerConversationPendingMessagesBodySchema } from "./conversation-feed-DdFQuQDR.js";
|
|
9
|
+
import { En as addConversationNote, Fr as createPluginEgress, Mn as isExperimentalFeatureEnabled, V as parseEmail, Yt as steerWebPendingMessages, _n as setTodoStatusByUser, gn as listTodos, ln as readUserCustomization, un as saveUserCustomization, z as isAllowedDomain } from "./mailbox-turn-DL3Lvsm0.js";
|
|
10
|
+
import { S as readSlackAttachmentSource, f as webActorFromUser, g as createAttachmentUpload, m as AttachmentUploadError, o as acceptsWebMessages, r as getLeadConversation, v as writeAttachmentUpload } from "./start-conversation-a4NXH4X9.js";
|
|
11
|
+
import { $t as decodeImageId, A as stopConversationOperation, C as archiveDoneConversationsOperation, Ct as viewerCanViewPluginLink, D as renameConversationOperation, E as pinConversationOperation, J as InboxItemActionError, K as requireConversationPendingMessages, Kt as resolvePersonLink, M as apiOperationHandler, O as setConversationAutoArchiveOperation, Qt as IMAGE_WIDTHS, S as archiveConversationOperation, St as resolveObjectLinks, Xt as readFirstHumanMessageTexts, Y as actOnInboxItem, Yt as conversationSummaryFromStoredConversation, Z as readInboxItemForUser, Zt as createViewerMcp, _ as appendConversationMessageForViewer, _t as readHealthReport, a as listWaitingConversations, bt as readObjectLinkTypes, c as readConversationDetail, d as readConversationTreeMetricsFromSql, dt as scheduleInboxSnoozeTimer, f as conversationVersionsQuery, ft as readSavingsRefill, g as readConversationEvents, h as keepQuickQuestionForViewer, i as encodePageCursor, it as updateUserSettings, j as reorderPinnedConversations, k as setConversationSubscriptionOperation, kt as getProductionSlackAdapter, l as readConversationAuxiliaryCostsFromSql, m as forkConversationForViewer, mt as startSavingsRefill, n as readConversationFeed, nt as DEFAULT_USER_SETTINGS, o as listedConversation, p as readConversationDetailEtag, q as resolveMentions, qt as conversationRecordJoins, r as decodePageCursor, rt as readUserSettings, s as notLeadConversation, t as conversationFeedVersionQuery, u as childAgentTotalsReport, v as createConversationForViewer, vt as OBJECT_LINK_TTL_MS, w as cancelQueuedMessagesOperation, wt as guardedFetch, xt as resolveObjectLinkNow, y as requireWebMessageConversation, yt as readLinkObjectType } from "./list-C5400AlJ.js";
|
|
12
|
+
import { a as codeChangeUrl, c as readConversationEventPage, d as readConversationLastEventSeq, i as transcriptEntriesFromReportEvents, o as codeRepositoryUrl, p as reportParentAgentInput, s as linkedCodeProviders } from "./task-runner-C-pXsgHM.js";
|
|
13
|
+
import { A as canPauseConversationDelivery, F as readAttachmentContent, I as previewOriginBelongsTo, M as pauseConversationDelivery, N as resumeConversationDelivery, P as AttachmentDownloadError, f as createInboxItemShow, p as pushConversationInboxItemsNow } from "./agent-runner-qZU5TR8i.js";
|
|
14
|
+
import { t as runWithSlackInstallation } from "./adapter-context-B4BrJZuS.js";
|
|
15
|
+
import { a as listChildAgents } from "./markers-DUP8aBOp.js";
|
|
16
|
+
import { i as continueConversationInSlack, r as canContinueInSlack, t as BUSY } from "./continue-in-slack-fnmD2Ifb.js";
|
|
17
|
+
import { i as readLiveAttachment } from "./store-BuhF1QDm.js";
|
|
19
18
|
import { u as sentry_exports } from "./sentry-CPbZjomA.js";
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import { i as
|
|
23
|
-
import {
|
|
24
|
-
import { c as
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import { o as getSandboxResources } from "./install-DCFJFkC0.js";
|
|
31
|
-
import { t as getCachedSnapshot } from "./resolve-cKOQ14Dh.js";
|
|
32
|
-
import { t as getVercelConversationWorkQueue } from "./vercel-queue-hW90XzbG.js";
|
|
19
|
+
import { K as credentialContextForActor, M as webActorUserIds, a as finishServiceAccountSignIn, i as disconnectServiceAccount, l as serviceAccountPlugins, o as getServiceAccountStatus, u as startServiceAccountSignIn } from "./registry-D6kS6xYH.js";
|
|
20
|
+
import { i as getStateAdapter } from "./adapter-JARQvoLw.js";
|
|
21
|
+
import { a as fillUtcSixHours, c as trailingUtcDayWindow, d as utcHourKey, i as fillUtcHours, l as trailingUtcHourWindow, n as HOUR_MS$3, o as startOfUtcHour, r as fillUtcDays, s as sumUtcHoursIntoSixHours, t as DAY_MS$3, u as trailingUtcSixHourWindow } from "./reporting-window-C4dbzDiR.js";
|
|
22
|
+
import { y as isOpenTodoStatus } from "./history-CneKY7_V.js";
|
|
23
|
+
import { a as isConnectableProvider, c as startConnection, i as disconnectConnection, o as listConnections, t as escapeHtml, u as htmlCallbackResponse } from "./html-B8rBt7F4.js";
|
|
24
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-BLKtnUL3.js";
|
|
25
|
+
import { n as userCustomizationSchema } from "./user-customization-B27StpVQ.js";
|
|
26
|
+
import { o as getSandboxResources } from "./install-OtFboxOM.js";
|
|
27
|
+
import { t as getCachedSnapshot } from "./resolve-D8CPJcNK.js";
|
|
28
|
+
import { t as getVercelConversationWorkQueue } from "./vercel-queue-nL0Hq3hr.js";
|
|
33
29
|
import { Hono } from "hono";
|
|
34
30
|
import * as z from "zod";
|
|
35
31
|
import path from "node:path";
|
|
@@ -263,7 +259,8 @@ async function postSlackDetachNotice(args) {
|
|
|
263
259
|
/**
|
|
264
260
|
* Detach a root from its Location, or attach it again. Only a participant
|
|
265
261
|
* can change it, the same as rename. A mention in the Location attaches it
|
|
266
|
-
* again too. Each detach tells the Slack thread once.
|
|
262
|
+
* again too. Each detach tells the Slack thread once. Each change pushes
|
|
263
|
+
* the open items of the Conversation without the Slack card wait.
|
|
267
264
|
*/
|
|
268
265
|
async function setConversationDeliveryForViewer(viewer, conversationId, body) {
|
|
269
266
|
const conversation = (await readConversationAccessFromSql(getDb(), [conversationId], viewer)).get(conversationId)?.isParticipant ? await getConversationStore().get({ conversationId }) : void 0;
|
|
@@ -281,39 +278,10 @@ async function setConversationDeliveryForViewer(viewer, conversationId, body) {
|
|
|
281
278
|
location
|
|
282
279
|
})
|
|
283
280
|
}), "conversation.detach_notice.failed", { "app.conversation.id": conversationId });
|
|
284
|
-
|
|
281
|
+
if (detached) await pushConversationInboxItemsNow(conversationId);
|
|
282
|
+
} else if (await resumeConversationDelivery(conversationId)) await pushConversationInboxItemsNow(conversationId);
|
|
285
283
|
return { paused: body.paused };
|
|
286
284
|
}
|
|
287
|
-
// src/chat/conversations/sql/title.ts
|
|
288
|
-
/**
|
|
289
|
-
* Replace one Conversation's title. Returns the stored title, or undefined
|
|
290
|
-
* when the Conversation does not exist.
|
|
291
|
-
*
|
|
292
|
-
* recordActivity reads the title and writes it back under the mutation lock,
|
|
293
|
-
* so this write takes the same lock. A concurrent Turn cannot restore the old
|
|
294
|
-
* title.
|
|
295
|
-
*/
|
|
296
|
-
async function setConversationTitle(executor, conversationId, title) {
|
|
297
|
-
return await withConversationMutationLock(executor, conversationId, async () => {
|
|
298
|
-
const [row] = await executor.db().update(juniorConversations).set({
|
|
299
|
-
detailVersion: nextDetailVersion,
|
|
300
|
-
title
|
|
301
|
-
}).where(eq(juniorConversations.conversationId, conversationId)).returning({ title: juniorConversations.title });
|
|
302
|
-
return row?.title ?? void 0;
|
|
303
|
-
});
|
|
304
|
-
}
|
|
305
|
-
// src/api/conversations/rename.ts
|
|
306
|
-
/**
|
|
307
|
-
* Rename one conversation. The title is shared, so only a participant can
|
|
308
|
-
* change it, the same as pin and archive. Automatic titles are set once, so a
|
|
309
|
-
* later Turn keeps this title.
|
|
310
|
-
*/
|
|
311
|
-
async function renameConversation(viewer, conversationId, body) {
|
|
312
|
-
if (!(await readConversationAccessFromSql(getDb(), [conversationId], viewer)).get(conversationId)?.isParticipant) throwApiError(404, "Conversation not found.");
|
|
313
|
-
const title = await setConversationTitle(getSqlExecutor(), conversationId, body.title);
|
|
314
|
-
if (!title) throwApiError(404, "Conversation not found.");
|
|
315
|
-
return { title };
|
|
316
|
-
}
|
|
317
285
|
// src/api/conversations/child-agents.ts
|
|
318
286
|
/**
|
|
319
287
|
* Load the direct child agents of one Conversation, or throw a standard API
|
|
@@ -600,18 +568,18 @@ function countThreads(rows) {
|
|
|
600
568
|
function serializeConversationFeed(feed, waitingRows) {
|
|
601
569
|
const measured = [
|
|
602
570
|
"activityPreview",
|
|
603
|
-
"annotations",
|
|
604
571
|
"participants",
|
|
572
|
+
"sidebarAnnotations",
|
|
605
573
|
"threads"
|
|
606
574
|
];
|
|
607
575
|
const chars = {
|
|
608
576
|
activityPreview: 0,
|
|
609
|
-
annotations: 0,
|
|
610
577
|
participants: 0,
|
|
578
|
+
sidebarAnnotations: 0,
|
|
611
579
|
threads: 0
|
|
612
580
|
};
|
|
613
581
|
const rows = feed.conversations.map((row) => {
|
|
614
|
-
const { activityPreview: _activityPreview,
|
|
582
|
+
const { activityPreview: _activityPreview, participants: _participants, sidebarAnnotations: _sidebarAnnotations, threads: _threads, ...rest } = row;
|
|
615
583
|
let json = JSON.stringify(rest).slice(0, -1);
|
|
616
584
|
for (const key of measured) {
|
|
617
585
|
if (row[key] === void 0) continue;
|
|
@@ -627,8 +595,8 @@ function serializeConversationFeed(feed, waitingRows) {
|
|
|
627
595
|
sentry_exports.metrics.distribution("conversation_feed.response.chars", body.length);
|
|
628
596
|
for (const [field, value] of [
|
|
629
597
|
["activity_preview", chars.activityPreview],
|
|
630
|
-
["annotations", chars.annotations],
|
|
631
598
|
["participants", chars.participants],
|
|
599
|
+
["sidebar_annotations", chars.sidebarAnnotations],
|
|
632
600
|
["threads", chars.threads]
|
|
633
601
|
]) sentry_exports.metrics.distribution("conversation_feed.response.field_chars", value, { attributes: { "app.api.response.field": field } });
|
|
634
602
|
sentry_exports.metrics.distribution("conversation_feed.rows", feed.conversations.length);
|
|
@@ -637,8 +605,8 @@ function serializeConversationFeed(feed, waitingRows) {
|
|
|
637
605
|
return {
|
|
638
606
|
attributes: {
|
|
639
607
|
"app.api.response.field_chars.activity_preview": chars.activityPreview,
|
|
640
|
-
"app.api.response.field_chars.annotations": chars.annotations,
|
|
641
608
|
"app.api.response.field_chars.participants": chars.participants,
|
|
609
|
+
"app.api.response.field_chars.sidebar_annotations": chars.sidebarAnnotations,
|
|
642
610
|
"app.api.response.field_chars.threads": chars.threads,
|
|
643
611
|
"app.conversation_feed.rows": feed.conversations.length,
|
|
644
612
|
"app.conversation_feed.threads": threads,
|
|
@@ -672,7 +640,7 @@ async function readConversationOutline(conversationId, options = {}) {
|
|
|
672
640
|
seq: row.seq,
|
|
673
641
|
text,
|
|
674
642
|
...row.authorIdentityId && row.authorIdentityId !== "system" ? { actorIdentityId: row.authorIdentityId } : void 0,
|
|
675
|
-
...row
|
|
643
|
+
...reportParentAgentInput(row)
|
|
676
644
|
}];
|
|
677
645
|
});
|
|
678
646
|
let itemIndex = -1;
|
|
@@ -699,7 +667,9 @@ function readMessages(conversationId, role, ...filters) {
|
|
|
699
667
|
return getDb().select({
|
|
700
668
|
agentInvocationId: sql`${payload}->'meta'->>'agentInvocationId'`,
|
|
701
669
|
authorIdentityId: sql`coalesce(${payload}->>'authorIdentityId', ${juniorConversationEvents.actorIdentityId})`,
|
|
670
|
+
authorUserId: sql`${payload}->'meta'->'author'->>'userId'`,
|
|
702
671
|
createdAt: juniorConversationEvents.createdAt,
|
|
672
|
+
messageId: sql`${payload}->>'messageId'`,
|
|
703
673
|
seq: juniorConversationEvents.seq,
|
|
704
674
|
text: sql`coalesce(left(${payload}->>'text', ${200}), '')`
|
|
705
675
|
}).from(juniorConversationEvents).where(and(eq(juniorConversationEvents.conversationId, conversationId), sql`${juniorConversationEvents.type} = 'message'`, sql`${payload}->>'role' = ${role}`, ...filters)).orderBy(asc(juniorConversationEvents.seq));
|
|
@@ -1419,7 +1389,7 @@ function createConversationRoutes(options) {
|
|
|
1419
1389
|
app.patch("/:conversationId/delivery", requireViewer, validateRequest("param", conversationParamsSchema, "Invalid route parameters."), validateRequest("json", conversationDeliveryBodySchema, "Invalid request body."), async (context) => jsonResponse(conversationDeliveryResponseSchema, await setConversationDeliveryForViewer(context.get("viewer"), context.req.valid("param").conversationId, context.req.valid("json"))));
|
|
1420
1390
|
app.patch("/:conversationId/subscription", requireViewer, apiOperationHandler(setConversationSubscriptionOperation, options));
|
|
1421
1391
|
app.post("/:conversationId/invites", requireViewer, validateRequest("param", conversationParamsSchema, "Invalid route parameters."), validateRequest("json", conversationInviteBodySchema, "Invalid request body."), async (context) => jsonResponse(conversationInviteResponseSchema, await inviteToConversation(context.get("viewer"), context.req.valid("param").conversationId, context.req.valid("json"))));
|
|
1422
|
-
app.patch("/:conversationId/title", requireViewer,
|
|
1392
|
+
app.patch("/:conversationId/title", requireViewer, apiOperationHandler(renameConversationOperation, options));
|
|
1423
1393
|
app.post("/:conversationId/annotations", requireViewer, validateRequest("param", conversationParamsSchema, "Invalid route parameters."), validateRequest("json", attachObjectLinkBodySchema, "Invalid request body."), async (context) => jsonResponse(attachObjectLinkResponseSchema, await attachObjectLink(context.get("viewer"), context.req.valid("param").conversationId, context.req.valid("json").url)));
|
|
1424
1394
|
app.put("/:conversationId/read-position", requireViewer, validateRequest("param", conversationParamsSchema, "Invalid route parameters."), validateRequest("json", conversationReadPositionSchema, "Invalid request body."), async (context) => {
|
|
1425
1395
|
const viewer = context.get("viewer");
|
|
@@ -1734,8 +1704,7 @@ const codeChangeReportColumns = {
|
|
|
1734
1704
|
provider: juniorCodeChanges.provider,
|
|
1735
1705
|
repository: juniorCodeRepositories.name,
|
|
1736
1706
|
state: juniorCodeChanges.state,
|
|
1737
|
-
title: juniorCodeChanges.title
|
|
1738
|
-
url: juniorCodeChanges.url
|
|
1707
|
+
title: juniorCodeChanges.title
|
|
1739
1708
|
};
|
|
1740
1709
|
/** Convert one code change row to its report shape. */
|
|
1741
1710
|
function codeChangeReport({ additions, changedFiles, deletions, ...change }) {
|
|
@@ -1751,7 +1720,7 @@ function codeChangeReport({ additions, changedFiles, deletions, ...change }) {
|
|
|
1751
1720
|
mergedAt: change.mergedAt?.toISOString(),
|
|
1752
1721
|
openedAt: change.openedAt.toISOString(),
|
|
1753
1722
|
title: change.title ?? void 0,
|
|
1754
|
-
url: change
|
|
1723
|
+
url: codeChangeUrl(change)
|
|
1755
1724
|
};
|
|
1756
1725
|
}
|
|
1757
1726
|
/** Read code activity created by Junior across installed code plugins. */
|
|
@@ -1771,8 +1740,7 @@ async function readCodeOverview(nowMs = Date.now()) {
|
|
|
1771
1740
|
merged,
|
|
1772
1741
|
name: repositories.name,
|
|
1773
1742
|
open: sql`count(*) filter (where ${changes.state} = 'open')`.mapWith(Number),
|
|
1774
|
-
provider: repositories.provider
|
|
1775
|
-
url: repositories.url
|
|
1743
|
+
provider: repositories.provider
|
|
1776
1744
|
}).from(repositories).innerJoin(changes, eq(changes.repositoryId, repositories.id)).where(recent).groupBy(repositories.id).orderBy(desc(merged), desc(created), asc(repositories.name)).limit(25), db.select(codeChangeReportColumns).from(changes).innerJoin(repositories, eq(changes.repositoryId, repositories.id)).where(recent).orderBy(desc(changes.updatedAt)).limit(25)]);
|
|
1777
1745
|
const repositoryChanges = repositoryRows.length ? await db.select({
|
|
1778
1746
|
conversationIds: changes.conversationIds,
|
|
@@ -1797,7 +1765,7 @@ async function readCodeOverview(nowMs = Date.now()) {
|
|
|
1797
1765
|
...repository,
|
|
1798
1766
|
medianCostUsd: median(repositoryCosts.get(repository.id) ?? []),
|
|
1799
1767
|
mergeRate: mergeRate(repository.merged, repository.closed),
|
|
1800
|
-
url: repository
|
|
1768
|
+
url: codeRepositoryUrl(repository)
|
|
1801
1769
|
})),
|
|
1802
1770
|
summary: windows.summary,
|
|
1803
1771
|
windowEnd: windows.windowEnd.toISOString(),
|
|
@@ -1884,8 +1852,7 @@ async function readCodeRepository(repositoryId, options = {}) {
|
|
|
1884
1852
|
merged: countState("merged"),
|
|
1885
1853
|
name: juniorCodeRepositories.name,
|
|
1886
1854
|
open: countState("open"),
|
|
1887
|
-
provider: juniorCodeRepositories.provider
|
|
1888
|
-
url: juniorCodeRepositories.url
|
|
1855
|
+
provider: juniorCodeRepositories.provider
|
|
1889
1856
|
}).from(juniorCodeRepositories).leftJoin(juniorCodeChanges, eq(juniorCodeChanges.repositoryId, juniorCodeRepositories.id)).where(eq(juniorCodeRepositories.id, repositoryId)).groupBy(juniorCodeRepositories.id);
|
|
1890
1857
|
if (!row) return void 0;
|
|
1891
1858
|
const { closed, merged, open, ...repository } = row;
|
|
@@ -1913,7 +1880,7 @@ async function readCodeRepository(repositoryId, options = {}) {
|
|
|
1913
1880
|
generatedAt: windows.windowEnd.toISOString(),
|
|
1914
1881
|
repository: {
|
|
1915
1882
|
...repository,
|
|
1916
|
-
url: repository
|
|
1883
|
+
url: codeRepositoryUrl(repository)
|
|
1917
1884
|
},
|
|
1918
1885
|
summary: windows.summary,
|
|
1919
1886
|
windowEnd: windows.windowEnd.toISOString(),
|
|
@@ -1938,7 +1905,8 @@ const linked = alias(juniorConversations, "linked_conversation");
|
|
|
1938
1905
|
async function readCodeChangeSearchFromSql(query, viewerUserId) {
|
|
1939
1906
|
const number = /^#?(\d+)$/.exec(query.trim())?.[1];
|
|
1940
1907
|
const terms = number ? [number] : (query.toLowerCase().match(/[\p{L}\p{N}]+/gu) ?? []).slice(0, CODE_CHANGE_SEARCH_TERMS);
|
|
1941
|
-
|
|
1908
|
+
const providers = linkedCodeProviders();
|
|
1909
|
+
if (terms.length === 0 || providers.length === 0) return [];
|
|
1942
1910
|
const everyTerm = terms.map((term) => `${term}:*`).join(" & ");
|
|
1943
1911
|
const anyTerm = terms.map((term) => `${term}:*`).join(" | ");
|
|
1944
1912
|
const db = getDb();
|
|
@@ -1948,14 +1916,20 @@ async function readCodeChangeSearchFromSql(query, viewerUserId) {
|
|
|
1948
1916
|
return (await db.select({
|
|
1949
1917
|
draft: juniorCodeChanges.draft,
|
|
1950
1918
|
number: juniorCodeChanges.number,
|
|
1919
|
+
provider: juniorCodeChanges.provider,
|
|
1951
1920
|
repository: juniorCodeRepositories.name,
|
|
1952
1921
|
state: juniorCodeChanges.state,
|
|
1953
|
-
title: juniorCodeChanges.title
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1922
|
+
title: juniorCodeChanges.title
|
|
1923
|
+
}).from(juniorCodeChanges).innerJoin(juniorCodeRepositories, eq(juniorCodeRepositories.id, juniorCodeChanges.repositoryId)).where(and(matches, inArray(juniorCodeChanges.provider, providers), visible)).orderBy(...number ? [desc(sql`${juniorCodeChanges.number}::text = ${number}`)] : [], desc(sql`coalesce(${juniorCodeChanges.lastActivityAt}, ${juniorCodeChanges.openedAt})`), asc(juniorCodeChanges.id)).limit(CODE_CHANGE_SEARCH_LIMIT)).flatMap(({ provider, ...row }) => {
|
|
1924
|
+
const url = codeChangeUrl({
|
|
1925
|
+
...row,
|
|
1926
|
+
provider
|
|
1927
|
+
});
|
|
1928
|
+
return url ? [{
|
|
1929
|
+
...row,
|
|
1930
|
+
url
|
|
1931
|
+
}] : [];
|
|
1932
|
+
});
|
|
1959
1933
|
}
|
|
1960
1934
|
// src/api/code/routes.ts
|
|
1961
1935
|
/** Create the code analytics API. */
|
|
@@ -2669,10 +2643,12 @@ function createLeadRoutes() {
|
|
|
2669
2643
|
const app = new Hono();
|
|
2670
2644
|
app.get("/", requireViewer, async (context) => {
|
|
2671
2645
|
const lead = await getLeadConversation(context.get("viewer"));
|
|
2646
|
+
const lastSeq = await readConversationLastEventSeq(getSqlExecutor(), lead.conversationId);
|
|
2672
2647
|
const watches = await listWatches({ conversationId: lead.conversationId });
|
|
2673
2648
|
const watchedConversationIds = [...new Set(watches.filter((watch) => watch.namespace === "junior" && watch.resourceType === "conversation").map((watch) => watch.identifier))];
|
|
2674
2649
|
return jsonResponse(leadSchema, {
|
|
2675
2650
|
conversationId: lead.conversationId,
|
|
2651
|
+
lastSeq,
|
|
2676
2652
|
watchedConversationIds
|
|
2677
2653
|
}, { headers: { "cache-control": "private, no-store" } });
|
|
2678
2654
|
});
|
|
@@ -3264,7 +3240,7 @@ async function readPeoplePluginReports(args) {
|
|
|
3264
3240
|
reports: [],
|
|
3265
3241
|
source: "plugins"
|
|
3266
3242
|
});
|
|
3267
|
-
const { getPluginProfileReports } = await import("./credentialed-
|
|
3243
|
+
const { getPluginProfileReports } = await import("./credentialed-dWRA3-oJ.js").then((n) => n.a);
|
|
3268
3244
|
return pluginOperationalReportFeedSchema.parse({
|
|
3269
3245
|
generatedAt: new Date(nowMs).toISOString(),
|
|
3270
3246
|
reports: await getPluginProfileReports({
|
|
@@ -3404,7 +3380,7 @@ async function readPeopleProfileFromSql(email, options = {}) {
|
|
|
3404
3380
|
const channel = channelExpression(turnRoot);
|
|
3405
3381
|
const hourWindow = trailingUtcHourWindow(nowMs, 168);
|
|
3406
3382
|
const [totalsRows, dayRows, hourRows, locationRows, surfaceRows, recentRows] = await Promise.all([
|
|
3407
|
-
getDb().select(personTotalColumns(roots)).from(roots).innerJoin(juniorUsers, eq(juniorUsers.id, roots.userId)).innerJoin(turnRoot, personRootJoin(roots)).groupBy(juniorUsers.id),
|
|
3383
|
+
getDb().select(personTotalColumns(roots)).from(roots).innerJoin(juniorUsers, eq(juniorUsers.id, roots.userId)).innerJoin(turnRoot, personRootJoin(roots)).where(eq(juniorUsers.primaryEmailNormalized, normalizedEmail)).groupBy(juniorUsers.id),
|
|
3408
3384
|
rootBucketRows({
|
|
3409
3385
|
email: normalizedEmail,
|
|
3410
3386
|
since: start,
|
|
@@ -3736,6 +3712,263 @@ function createPersonalTokenRoutes() {
|
|
|
3736
3712
|
});
|
|
3737
3713
|
return app;
|
|
3738
3714
|
}
|
|
3715
|
+
// src/chat/automations/search.ts
|
|
3716
|
+
const EXACT_ID_WEIGHT = 4;
|
|
3717
|
+
/**
|
|
3718
|
+
* Find the Automations that the viewer owns or that are shared to them, as
|
|
3719
|
+
* the Automations list shows them and with its titles. A word of the title, task, or event
|
|
3720
|
+
* trigger starts with each word of the query, the title is close to the
|
|
3721
|
+
* query despite a typo, or the query holds the Automation's id. Best match
|
|
3722
|
+
* first. Reads the GIN indexes `junior_automations_search_idx` and
|
|
3723
|
+
* `junior_automations_title_trgm_idx`.
|
|
3724
|
+
*/
|
|
3725
|
+
async function searchAutomationsForViewer(viewer, query, limit) {
|
|
3726
|
+
const db = getDb();
|
|
3727
|
+
const collection = viewerAutomationCollection(viewer);
|
|
3728
|
+
const automation = alias(juniorAutomations, "search_automation");
|
|
3729
|
+
const candidates = db.select({
|
|
3730
|
+
activityAtMs: collection.activityAtMs,
|
|
3731
|
+
id: collection.id,
|
|
3732
|
+
kind: collection.kind,
|
|
3733
|
+
state: collection.state,
|
|
3734
|
+
task: collection.task,
|
|
3735
|
+
title: collection.title
|
|
3736
|
+
}).from(collection).innerJoin(automation, eq(automation.id, collection.id)).where(and(ne(automation.status, "deleted"), or(prefixMatch(automationSearchDocument(automation), query), fuzzyMatch(automationFuzzyTitle(automation), query), query.tokens.length > 0 ? inArray(automation.id, query.tokens) : void 0))).orderBy(desc(collection.activityAtMs), asc(collection.id)).limit(200).as("automation_candidates");
|
|
3737
|
+
const ranked = alias(juniorAutomations, "ranked_automation");
|
|
3738
|
+
const document = automationSearchDocument(ranked);
|
|
3739
|
+
const title = automationFuzzyTitle(ranked);
|
|
3740
|
+
const rows = await db.select({
|
|
3741
|
+
activityAtMs: candidates.activityAtMs,
|
|
3742
|
+
fuzzy: fuzzyRank(title, query),
|
|
3743
|
+
fuzzyMatched: fuzzyMatch(title, query),
|
|
3744
|
+
id: candidates.id,
|
|
3745
|
+
kind: candidates.kind,
|
|
3746
|
+
lexical: prefixRank(document, query),
|
|
3747
|
+
lexicalMatched: prefixMatch(document, query),
|
|
3748
|
+
state: candidates.state,
|
|
3749
|
+
task: candidates.task,
|
|
3750
|
+
title: candidates.title
|
|
3751
|
+
}).from(candidates).innerJoin(ranked, eq(ranked.id, candidates.id));
|
|
3752
|
+
return rankSearchMatches(scoredSearchMatches(rows, {
|
|
3753
|
+
exact: (row) => query.tokens.includes(row.id) ? 1 : void 0,
|
|
3754
|
+
fuzzy: (row) => row.fuzzyMatched ? Number(row.fuzzy) : void 0,
|
|
3755
|
+
lexical: (row) => row.lexicalMatched ? Number(row.lexical) : void 0
|
|
3756
|
+
}), {
|
|
3757
|
+
key: (row) => row.id,
|
|
3758
|
+
tiebreak: (left, right) => right.activityAtMs - left.activityAtMs || left.id.localeCompare(right.id),
|
|
3759
|
+
weights: { exact: EXACT_ID_WEIGHT }
|
|
3760
|
+
}).slice(0, limit).flatMap((row) => row.state === "deleted" ? [] : [{
|
|
3761
|
+
id: row.id,
|
|
3762
|
+
kind: row.kind,
|
|
3763
|
+
status: row.state,
|
|
3764
|
+
title: collectionRowTitle(row)
|
|
3765
|
+
}]);
|
|
3766
|
+
}
|
|
3767
|
+
// src/chat/inbox-items/search.ts
|
|
3768
|
+
/**
|
|
3769
|
+
* Find the items of the viewer's own Inbox, open and closed, as the Inbox
|
|
3770
|
+
* shows them. A word of the title or body starts with each word of the
|
|
3771
|
+
* query, or the title is close to the query despite a typo. Open items come
|
|
3772
|
+
* first, each group best match first. Reads the GIN indexes
|
|
3773
|
+
* `junior_inbox_items_search_idx` and `junior_inbox_items_title_trgm_idx`.
|
|
3774
|
+
*/
|
|
3775
|
+
async function searchInboxItemsForUser(viewer, query, limit) {
|
|
3776
|
+
const db = getDb();
|
|
3777
|
+
const items = juniorInboxItems;
|
|
3778
|
+
const candidates = db.select({ id: items.id }).from(items).where(and(or(prefixMatch(inboxItemSearchDocument(items), query), fuzzyMatch(inboxItemFuzzyTitle(items), query)), inboxItemVisibleTo(inboxItemReaderForUser(viewer)), inboxItemForUser(viewer.id))).orderBy(desc(items.updatedAt), desc(items.id)).limit(200).as("inbox_item_candidates");
|
|
3779
|
+
const item = alias(juniorInboxItems, "inbox_item");
|
|
3780
|
+
const document = inboxItemSearchDocument(item);
|
|
3781
|
+
const title = inboxItemFuzzyTitle(item);
|
|
3782
|
+
const rows = await db.select({
|
|
3783
|
+
fuzzy: fuzzyRank(title, query),
|
|
3784
|
+
fuzzyMatched: fuzzyMatch(title, query),
|
|
3785
|
+
id: item.id,
|
|
3786
|
+
lexical: prefixRank(document, query),
|
|
3787
|
+
lexicalMatched: prefixMatch(document, query),
|
|
3788
|
+
status: item.status,
|
|
3789
|
+
title: item.title,
|
|
3790
|
+
updatedAt: item.updatedAt
|
|
3791
|
+
}).from(candidates).innerJoin(item, eq(item.id, candidates.id));
|
|
3792
|
+
const ranked = rankSearchMatches(scoredSearchMatches(rows, {
|
|
3793
|
+
fuzzy: (row) => row.fuzzyMatched ? Number(row.fuzzy) : void 0,
|
|
3794
|
+
lexical: (row) => row.lexicalMatched ? Number(row.lexical) : void 0
|
|
3795
|
+
}), {
|
|
3796
|
+
key: (row) => row.id,
|
|
3797
|
+
tiebreak: (left, right) => right.updatedAt.getTime() - left.updatedAt.getTime() || right.id.localeCompare(left.id)
|
|
3798
|
+
});
|
|
3799
|
+
return [...ranked.filter((row) => row.status === "open"), ...ranked.filter((row) => row.status !== "open")].slice(0, limit).map((row) => ({
|
|
3800
|
+
id: row.id,
|
|
3801
|
+
status: row.status,
|
|
3802
|
+
title: row.title
|
|
3803
|
+
}));
|
|
3804
|
+
}
|
|
3805
|
+
// src/chat/memory/search.ts
|
|
3806
|
+
const MEMORY_SEARCH_TITLE_CHARS = 120;
|
|
3807
|
+
const VECTOR_QUERY_MIN_CHARS = 3;
|
|
3808
|
+
const QUERY_EMBEDDING_TTL_MS = 6e5;
|
|
3809
|
+
const QUERY_EMBEDDING_KEY_PREFIX = "memory-search-embedding:v1";
|
|
3810
|
+
/** `junior_stats` counter of the embedding spend of typed memory search. */
|
|
3811
|
+
const EMBEDDING_COST_STAT = {
|
|
3812
|
+
metric: "embedding_cost_micro_usd",
|
|
3813
|
+
namespace: "search"
|
|
3814
|
+
};
|
|
3815
|
+
const cachedEmbeddingSchema = z.object({
|
|
3816
|
+
dimensions: z.number().int(),
|
|
3817
|
+
model: z.string(),
|
|
3818
|
+
provider: z.string(),
|
|
3819
|
+
vectors: z.array(z.array(z.number()))
|
|
3820
|
+
});
|
|
3821
|
+
function queryEmbeddingKey(model, input) {
|
|
3822
|
+
const hash = createHash("sha256").update(JSON.stringify([input.inputType ?? "", ...input.texts])).digest("hex");
|
|
3823
|
+
return `${QUERY_EMBEDDING_KEY_PREFIX}:${model}:${hash}`;
|
|
3824
|
+
}
|
|
3825
|
+
async function recordEmbeddingCost(model, costUsd) {
|
|
3826
|
+
await runBestEffort(() => addStats([{
|
|
3827
|
+
...EMBEDDING_COST_STAT,
|
|
3828
|
+
count: usdToMicroUsdUnbiased(costUsd),
|
|
3829
|
+
name: model
|
|
3830
|
+
}]), "memory.search.embedding_cost_record_failed");
|
|
3831
|
+
}
|
|
3832
|
+
/**
|
|
3833
|
+
* Embed typed search text, and reuse the vector of the same text for a few
|
|
3834
|
+
* minutes, so a person who types it again makes no model call. A search has
|
|
3835
|
+
* no Conversation to bill, so each call adds its cost to a daily
|
|
3836
|
+
* `junior_stats` counter. The write runs with the vector query; `settled`
|
|
3837
|
+
* waits for it.
|
|
3838
|
+
*/
|
|
3839
|
+
function cachedQueryEmbedder() {
|
|
3840
|
+
const embedder = createPluginEmbedder("memory");
|
|
3841
|
+
const costWrites = [];
|
|
3842
|
+
return {
|
|
3843
|
+
embedder: {
|
|
3844
|
+
model: embedder.model,
|
|
3845
|
+
provider: embedder.provider,
|
|
3846
|
+
async embedTexts(input) {
|
|
3847
|
+
const state = getStateAdapter();
|
|
3848
|
+
const key = queryEmbeddingKey(embedder.model, input);
|
|
3849
|
+
const cached = cachedEmbeddingSchema.safeParse(await state.get(key));
|
|
3850
|
+
if (cached.success) return cached.data;
|
|
3851
|
+
const result = await embedder.embedTexts(input);
|
|
3852
|
+
const { costUsd, ...embedding } = result;
|
|
3853
|
+
if (costUsd !== void 0) costWrites.push(recordEmbeddingCost(embedder.model, costUsd));
|
|
3854
|
+
await runBestEffort(() => state.set(key, embedding, QUERY_EMBEDDING_TTL_MS), "memory.search.embedding_cache_write_failed");
|
|
3855
|
+
return result;
|
|
3856
|
+
}
|
|
3857
|
+
},
|
|
3858
|
+
settled: async () => {
|
|
3859
|
+
await Promise.all(costWrites);
|
|
3860
|
+
}
|
|
3861
|
+
};
|
|
3862
|
+
}
|
|
3863
|
+
/**
|
|
3864
|
+
* Find the memories that the Memories page shows every User, active public
|
|
3865
|
+
* memory only, with the hybrid word and vector search of automatic recall.
|
|
3866
|
+
* Text of 3 or more characters is embedded once, from a short cache when it
|
|
3867
|
+
* was typed recently; when that fails, words alone match.
|
|
3868
|
+
*/
|
|
3869
|
+
async function searchPublicMemories(text, limit) {
|
|
3870
|
+
const query = text.trim().length >= VECTOR_QUERY_MIN_CHARS ? cachedQueryEmbedder() : void 0;
|
|
3871
|
+
const memories = await searchTypedMemories({
|
|
3872
|
+
db: memoryDb(getDb()),
|
|
3873
|
+
embedder: query?.embedder,
|
|
3874
|
+
limit,
|
|
3875
|
+
nowMs: Date.now(),
|
|
3876
|
+
query: text
|
|
3877
|
+
});
|
|
3878
|
+
await query?.settled();
|
|
3879
|
+
return memories.map((memory) => ({
|
|
3880
|
+
id: memory.id,
|
|
3881
|
+
title: memory.content.slice(0, MEMORY_SEARCH_TITLE_CHARS)
|
|
3882
|
+
}));
|
|
3883
|
+
}
|
|
3884
|
+
// src/chat/todos/search.ts
|
|
3885
|
+
/**
|
|
3886
|
+
* Find the To-dos whose Conversation shows its private content to the
|
|
3887
|
+
* viewer: its root is public, or the viewer is a Participant of the root,
|
|
3888
|
+
* as `conversationAccessFromRows` decides. Other viewers see only redacted
|
|
3889
|
+
* To-dos, so a title match must not show that the To-do exists. A word of
|
|
3890
|
+
* the title starts with each word of the query, or the title is close to
|
|
3891
|
+
* the query despite a typo. Open To-dos come first, each group best match
|
|
3892
|
+
* first. Reads the GIN indexes `junior_todos_search_idx` and
|
|
3893
|
+
* `junior_todos_title_trgm_idx`.
|
|
3894
|
+
*/
|
|
3895
|
+
async function searchTodosForViewer(viewer, query, limit) {
|
|
3896
|
+
const db = getDb();
|
|
3897
|
+
const todos = juniorTodos;
|
|
3898
|
+
const conversation = alias(juniorConversations, "todo_conversation");
|
|
3899
|
+
const candidates = db.select({
|
|
3900
|
+
conversationId: todos.conversationId,
|
|
3901
|
+
id: todos.id
|
|
3902
|
+
}).from(todos).innerJoin(conversation, eq(conversation.conversationId, todos.conversationId)).innerJoin(juniorConversations, and(eq(juniorConversations.conversationId, conversation.rootConversationId), eq(juniorConversations.rootConversationId, juniorConversations.conversationId), isNull(juniorConversations.parentConversationId))).leftJoin(juniorDestinations, eq(juniorDestinations.id, juniorConversations.destinationId)).where(and(or(prefixMatch(todoSearchDocument(todos), query), fuzzyMatch(todoFuzzyTitle(todos), query)), or(isNotNull(conversation.parentConversationId), eq(conversation.rootConversationId, conversation.conversationId)), rootVisibleToViewer(viewer.id))).orderBy(desc(todos.updatedAt), desc(todos.conversationId), desc(todos.id)).limit(200).as("todo_candidates");
|
|
3903
|
+
const todo = alias(juniorTodos, "todo");
|
|
3904
|
+
const document = todoSearchDocument(todo);
|
|
3905
|
+
const title = todoFuzzyTitle(todo);
|
|
3906
|
+
const rows = await db.select({
|
|
3907
|
+
conversationId: todo.conversationId,
|
|
3908
|
+
fuzzy: fuzzyRank(title, query),
|
|
3909
|
+
fuzzyMatched: fuzzyMatch(title, query),
|
|
3910
|
+
id: todo.id,
|
|
3911
|
+
lexical: prefixRank(document, query),
|
|
3912
|
+
lexicalMatched: prefixMatch(document, query),
|
|
3913
|
+
status: todo.status,
|
|
3914
|
+
title: todo.title,
|
|
3915
|
+
updatedAt: todo.updatedAt
|
|
3916
|
+
}).from(candidates).innerJoin(todo, and(eq(todo.conversationId, candidates.conversationId), eq(todo.id, candidates.id)));
|
|
3917
|
+
const ranked = rankSearchMatches(scoredSearchMatches(rows, {
|
|
3918
|
+
fuzzy: (row) => row.fuzzyMatched ? Number(row.fuzzy) : void 0,
|
|
3919
|
+
lexical: (row) => row.lexicalMatched ? Number(row.lexical) : void 0
|
|
3920
|
+
}), {
|
|
3921
|
+
key: (row) => `${row.conversationId}:${row.id}`,
|
|
3922
|
+
tiebreak: (left, right) => right.updatedAt.getTime() - left.updatedAt.getTime() || right.conversationId.localeCompare(left.conversationId) || right.id - left.id
|
|
3923
|
+
});
|
|
3924
|
+
return [...ranked.filter((row) => isOpenTodoStatus(row.status)), ...ranked.filter((row) => !isOpenTodoStatus(row.status))].slice(0, limit).map(({ conversationId, id, status, title }) => ({
|
|
3925
|
+
conversationId,
|
|
3926
|
+
id,
|
|
3927
|
+
status,
|
|
3928
|
+
title
|
|
3929
|
+
}));
|
|
3930
|
+
}
|
|
3931
|
+
// src/chat/omni-search/search.ts
|
|
3932
|
+
const OMNI_SEARCH_SOURCE_LIMIT = 8;
|
|
3933
|
+
/**
|
|
3934
|
+
* Search the named sources for text that a person types, as `viewer`. Each
|
|
3935
|
+
* source returns only what its own page shows the viewer, ranked by the
|
|
3936
|
+
* shared search ranking, and the sources read at once. Text with no letters
|
|
3937
|
+
* or digits matches nothing and reads nothing.
|
|
3938
|
+
*/
|
|
3939
|
+
async function omniSearch(input) {
|
|
3940
|
+
const query = parseTypedQuery(input.text);
|
|
3941
|
+
const wants = (source) => input.sources.includes(source);
|
|
3942
|
+
const [automations, inboxItems, memories, todos] = await Promise.all([
|
|
3943
|
+
query && wants("automations") ? searchAutomationsForViewer(input.viewer, query, OMNI_SEARCH_SOURCE_LIMIT) : [],
|
|
3944
|
+
query && wants("inboxItems") ? searchInboxItemsForUser(input.viewer, query, OMNI_SEARCH_SOURCE_LIMIT) : [],
|
|
3945
|
+
query && wants("memories") ? searchPublicMemories(input.text, OMNI_SEARCH_SOURCE_LIMIT) : [],
|
|
3946
|
+
query && wants("todos") ? searchTodosForViewer(input.viewer, query, OMNI_SEARCH_SOURCE_LIMIT) : []
|
|
3947
|
+
]);
|
|
3948
|
+
return {
|
|
3949
|
+
...wants("automations") ? { automations } : void 0,
|
|
3950
|
+
...wants("inboxItems") ? { inboxItems } : void 0,
|
|
3951
|
+
...wants("memories") ? { memories } : void 0,
|
|
3952
|
+
...wants("todos") ? { todos } : void 0
|
|
3953
|
+
};
|
|
3954
|
+
}
|
|
3955
|
+
// src/api/search/routes.ts
|
|
3956
|
+
/**
|
|
3957
|
+
* Create the search route that the command palette reads while a person
|
|
3958
|
+
* types: one request, one group for each named source.
|
|
3959
|
+
*/
|
|
3960
|
+
function createSearchRoutes() {
|
|
3961
|
+
const app = new Hono();
|
|
3962
|
+
app.get("/", requireViewer, validateRequest("query", searchQuerySchema, "Invalid search query."), async (context) => {
|
|
3963
|
+
const { q, sources } = context.req.valid("query");
|
|
3964
|
+
return jsonResponse(searchReportSchema, await omniSearch({
|
|
3965
|
+
sources,
|
|
3966
|
+
text: q,
|
|
3967
|
+
viewer: context.get("viewer")
|
|
3968
|
+
}));
|
|
3969
|
+
});
|
|
3970
|
+
return app;
|
|
3971
|
+
}
|
|
3739
3972
|
// src/api/service-accounts/routes.ts
|
|
3740
3973
|
/**
|
|
3741
3974
|
* Public URL of the OAuth callback for one plugin's service account.
|
|
@@ -4627,7 +4860,8 @@ async function rootConversationIds(conversationIds) {
|
|
|
4627
4860
|
async function visibleRowItems(user, root, inboxItemId) {
|
|
4628
4861
|
if (inboxItemId) {
|
|
4629
4862
|
const item = await getInboxItem(getDb(), inboxItemId);
|
|
4630
|
-
const
|
|
4863
|
+
const owner = item && ownerConversationId(item);
|
|
4864
|
+
const inRow = root === void 0 || (item ? await rootConversationIds([...item.conversationIds, ...owner ? [owner] : []]) : []).includes(root);
|
|
4631
4865
|
if (item?.status === "open" && inRow && await canUserReadInboxItem(item, user)) return [{
|
|
4632
4866
|
canAct: canActOnInboxItem(item, user.id),
|
|
4633
4867
|
id: item.id,
|
|
@@ -4663,8 +4897,8 @@ async function namedResources(user, triggers) {
|
|
|
4663
4897
|
/**
|
|
4664
4898
|
* Aim each trigger at its named resource, or at the resource of the item's
|
|
4665
4899
|
* subject. A viewer waits on the subject without a check, as the item
|
|
4666
|
-
* already names it. A `resolve`
|
|
4667
|
-
* who can
|
|
4900
|
+
* already names it. A `resolve` closes the item, so it needs a viewer
|
|
4901
|
+
* who can close it. Returns undefined when a trigger does not apply to
|
|
4668
4902
|
* the item.
|
|
4669
4903
|
*/
|
|
4670
4904
|
function itemTriggers(item, triggers, named) {
|
|
@@ -4790,18 +5024,12 @@ async function readItemRoots(db, items, viewer) {
|
|
|
4790
5024
|
}).from(juniorConversations).leftJoin(juniorAgentBindings, eq(juniorAgentBindings.childConversationId, juniorConversations.conversationId)).where(and(inArray(juniorConversations.conversationId, ids), isNotNull(juniorConversations.parentConversationId)));
|
|
4791
5025
|
if (children.length === 0) return /* @__PURE__ */ new Map();
|
|
4792
5026
|
const childIds = children.map((child) => child.conversationId);
|
|
4793
|
-
const
|
|
4794
|
-
agentName: juniorAgentInvocations.agentName,
|
|
4795
|
-
childConversationId: juniorAgentInvocations.childConversationId,
|
|
4796
|
-
title: juniorAgentInvocations.title
|
|
4797
|
-
}).from(juniorAgentInvocations).where(inArray(juniorAgentInvocations.childConversationId, childIds)).orderBy(juniorAgentInvocations.childConversationId, sql`${juniorAgentInvocations.title} is null`, desc(juniorAgentInvocations.createdAt))]);
|
|
4798
|
-
const invocationByChild = new Map(invocations.map((row) => [row.childConversationId, row]));
|
|
5027
|
+
const access = await readConversationAccessFromSql(db, childIds, viewer);
|
|
4799
5028
|
return new Map(children.flatMap((child) => {
|
|
4800
5029
|
const childAccess = access.get(child.conversationId);
|
|
4801
5030
|
const rootConversationId = childAccess?.rootConversationId;
|
|
4802
5031
|
if (!rootConversationId || !childAccess.canViewPrivateContent) return [];
|
|
4803
|
-
const
|
|
4804
|
-
const label = invocation?.title ?? invocation?.agentName ?? child.title ?? child.bindingName ?? kindLabel(child.kind);
|
|
5032
|
+
const label = child.title ?? child.bindingName ?? kindLabel(child.kind);
|
|
4805
5033
|
return [[child.conversationId, {
|
|
4806
5034
|
label,
|
|
4807
5035
|
rootConversationId
|
|
@@ -4899,6 +5127,7 @@ function wakePayload(reason) {
|
|
|
4899
5127
|
function inboxItemPayload(item, viewer, roots, mentions, related, wake) {
|
|
4900
5128
|
const conversationId = ownerConversationId(item);
|
|
4901
5129
|
const root = conversationId ? roots.get(conversationId) : void 0;
|
|
5130
|
+
const todo = inboxItemTodo(item);
|
|
4902
5131
|
return {
|
|
4903
5132
|
...root ? { addedByLabel: root.label } : void 0,
|
|
4904
5133
|
assignedToEveryone: item.assignedToEveryone,
|
|
@@ -4926,6 +5155,7 @@ function inboxItemPayload(item, viewer, roots, mentions, related, wake) {
|
|
|
4926
5155
|
...related && (related.items.length > 0 || related.conversationIds.length > 0) ? { related } : void 0,
|
|
4927
5156
|
...item.request ? { request: item.request } : void 0,
|
|
4928
5157
|
...item.subject ? { subject: subjectPayload(item.subject) } : void 0,
|
|
5158
|
+
...todo ? { todoId: todo.id } : void 0,
|
|
4929
5159
|
...wake ? { wake: wakePayload(wake) } : void 0
|
|
4930
5160
|
};
|
|
4931
5161
|
}
|
|
@@ -5031,10 +5261,12 @@ function createInboxItemRoutes(services) {
|
|
|
5031
5261
|
let codeChanges = 0;
|
|
5032
5262
|
let decisions = 0;
|
|
5033
5263
|
let needsViewer = 0;
|
|
5264
|
+
let todos = 0;
|
|
5034
5265
|
for (const subject of subjects) {
|
|
5035
5266
|
automations += subject.automations;
|
|
5036
5267
|
needsViewer += subject.total;
|
|
5037
5268
|
decisions += subject.decisions;
|
|
5269
|
+
todos += subject.todos;
|
|
5038
5270
|
if (subject.subjectUrl && readLinkObjectType(subject.subjectUrl, linkTypes) === "code_change") codeChanges += subject.total;
|
|
5039
5271
|
}
|
|
5040
5272
|
return jsonResponse(inboxItemCountSchema, {
|
|
@@ -5042,7 +5274,8 @@ function createInboxItemRoutes(services) {
|
|
|
5042
5274
|
codeChanges,
|
|
5043
5275
|
decisions,
|
|
5044
5276
|
needsViewer,
|
|
5045
|
-
snoozed
|
|
5277
|
+
snoozed,
|
|
5278
|
+
todos
|
|
5046
5279
|
});
|
|
5047
5280
|
});
|
|
5048
5281
|
app.get("/waiting-conversations", requireViewer, async (context) => {
|
|
@@ -5283,7 +5516,7 @@ function readDescriptionText(home) {
|
|
|
5283
5516
|
}
|
|
5284
5517
|
/** Read discovered skills for runtime diagnostics and the Automation editor. */
|
|
5285
5518
|
async function readSkillReports() {
|
|
5286
|
-
const { discoverSkills } = await import("./skills-
|
|
5519
|
+
const { discoverSkills } = await import("./skills-CIosT6bS.js").then((n) => n.s);
|
|
5287
5520
|
const skills = await discoverSkills();
|
|
5288
5521
|
return skillReportsSchema.parse(skills.map((skill) => ({
|
|
5289
5522
|
name: skill.name,
|
|
@@ -5297,7 +5530,7 @@ async function readSkillReports() {
|
|
|
5297
5530
|
* what the skill tells Junior. Returns null when no skill has that name.
|
|
5298
5531
|
*/
|
|
5299
5532
|
async function readSkillDetailReport(name) {
|
|
5300
|
-
const { discoverSkills, findSkillByName, parseSkillFile } = await import("./skills-
|
|
5533
|
+
const { discoverSkills, findSkillByName, parseSkillFile } = await import("./skills-CIosT6bS.js").then((n) => n.s);
|
|
5301
5534
|
const skill = findSkillByName(name, await discoverSkills());
|
|
5302
5535
|
if (!skill) return null;
|
|
5303
5536
|
const parsed = parseSkillFile(await fs.readFile(path.join(skill.skillPath, "SKILL.md"), "utf8"), skill.name);
|
|
@@ -5312,7 +5545,7 @@ async function readSkillDetailReport(name) {
|
|
|
5312
5545
|
}
|
|
5313
5546
|
/** Read safe configured plugin metadata for authenticated runtime diagnostics. */
|
|
5314
5547
|
async function readPlugins() {
|
|
5315
|
-
const { pluginCatalogRuntime } = await import("./catalog-runtime-
|
|
5548
|
+
const { pluginCatalogRuntime } = await import("./catalog-runtime-BLKtnUL3.js").then((n) => n.t);
|
|
5316
5549
|
return pluginsSchema.parse(pluginCatalogRuntime.getProviders().map((plugin) => ({
|
|
5317
5550
|
configKeys: plugin.manifest.configKeys ?? [],
|
|
5318
5551
|
description: plugin.manifest.description,
|
|
@@ -5324,7 +5557,7 @@ async function readPlugins() {
|
|
|
5324
5557
|
async function readRuntimeInfoReport() {
|
|
5325
5558
|
const [{ homeDir }, { pluginCatalogRuntime }, plugins, skills] = await Promise.all([
|
|
5326
5559
|
import("./package-discovery-DD9vencX.js").then((n) => n.r),
|
|
5327
|
-
import("./catalog-runtime-
|
|
5560
|
+
import("./catalog-runtime-BLKtnUL3.js").then((n) => n.t),
|
|
5328
5561
|
readPlugins(),
|
|
5329
5562
|
readSkillReports()
|
|
5330
5563
|
]);
|
|
@@ -5341,7 +5574,7 @@ async function readRuntimeInfoReport() {
|
|
|
5341
5574
|
/** Read sanitized operational summaries contributed by plugins. */
|
|
5342
5575
|
async function readPluginOperationalReportFeed() {
|
|
5343
5576
|
const nowMs = Date.now();
|
|
5344
|
-
const { getPluginOperationalReports } = await import("./credentialed-
|
|
5577
|
+
const { getPluginOperationalReports } = await import("./credentialed-dWRA3-oJ.js").then((n) => n.a);
|
|
5345
5578
|
return pluginOperationalReportFeedSchema.parse({
|
|
5346
5579
|
source: "plugins",
|
|
5347
5580
|
generatedAt: new Date(nowMs).toISOString(),
|
|
@@ -5374,7 +5607,7 @@ function createJuniorApi(options = {}) {
|
|
|
5374
5607
|
}));
|
|
5375
5608
|
app.route("/api/inbox-items", createInboxItemRoutes({ delivery: {
|
|
5376
5609
|
queue,
|
|
5377
|
-
show:
|
|
5610
|
+
show: createInboxItemShow(getProductionSlackAdapter)
|
|
5378
5611
|
} }));
|
|
5379
5612
|
app.route("/api/inbox/snoozes", createInboxSnoozeRoutes());
|
|
5380
5613
|
app.route("/api/code", createCodeRoutes());
|
|
@@ -5389,6 +5622,7 @@ function createJuniorApi(options = {}) {
|
|
|
5389
5622
|
app.route("/api/objects", createObjectRoutes());
|
|
5390
5623
|
app.route("/api/people", createPeopleRoutes({ waitUntil: waitUntil$1 }));
|
|
5391
5624
|
app.route("/api/locations", createLocationRoutes());
|
|
5625
|
+
app.route("/api/search", createSearchRoutes());
|
|
5392
5626
|
app.route("/api/user-pages", createUserPageRoutes());
|
|
5393
5627
|
app.route("/api/user-customization", createUserCustomizationRoutes());
|
|
5394
5628
|
app.route("/api/automations", createAutomationRoutes());
|