@sentry/junior 0.274.0 → 0.275.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{adapter-4qThDhgF.js → adapter-dE2BiWP_.js} +1 -1
- package/dist/{admin-c7ASvs6x.js → admin-CkPaAYuZ.js} +1 -1
- package/dist/{agent-runner-CLHM48dh.js → agent-runner-bE7aH7ew.js} +877 -217
- package/dist/api.js +22 -22
- package/dist/{app-BlmPpPoR.d.ts → app-CgkquhZ8.d.ts} +16 -0
- package/dist/app.d.ts +1 -1
- package/dist/app.js +72 -28
- package/dist/{assistant-reply-2IwdFWuQ.js → assistant-reply-CjRU9Z59.js} +1 -1
- package/dist/{job-queue-Bh9sFO9t.js → background-compaction-queue-BYuOt3qK.js} +42 -3
- package/dist/{briefs-C1-NOh8m.js → briefs-6xUvmGos.js} +2 -2
- package/dist/{catalog-runtime-BnIJimKZ.js → catalog-runtime-DcJ5NHDW.js} +1 -1
- package/dist/cli/chat.js +14 -14
- package/dist/cli/check.js +3 -3
- package/dist/cli/main.js +3 -3
- package/dist/cli/plugins.js +4 -4
- package/dist/cli/snapshot-create.js +4 -4
- package/dist/cli/upgrade.js +3 -3
- package/dist/{client-C0ZIxoDr.js → client-gnKpkpqP.js} +2 -2
- package/dist/{config-DS-QLVSL.js → config-D0GKc9sC.js} +2 -2
- package/dist/{connections-Djb6ANAh.js → connections-DLqP5Bp1.js} +10 -10
- package/dist/{conversation-privacy-3IMUZSHC.js → conversation-privacy-BCXFshP9.js} +1 -1
- package/dist/{credential-sync-ig88EB_v.js → credential-sync-BjihXFF2.js} +13 -13
- package/dist/{executor-C2moGIHS.js → executor-j8VMt-To.js} +2 -2
- package/dist/instrumentation.js +2 -2
- package/dist/{logging-DYRS7E8s.js → logging-CFHIO4Vs.js} +3 -2
- package/dist/{message-CicNrhCv.js → message-DH0cqFRS.js} +9 -9
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +13 -3
- package/dist/{oauth-callback-server-BXyrepfY.js → oauth-callback-server-BgU4EZsJ.js} +2 -2
- package/dist/{projection-CMRrv9Pt.js → projection-CTvLSwcm.js} +20 -10
- package/dist/{registry-D92WLl5I.js → registry-OsyWR4GO.js} +1 -1
- package/dist/{resolve-C-Dh14ps.js → resolve-DCrKjmVP.js} +3 -3
- package/dist/{result-DZ8TCQkd.js → result-Btdt5bSl.js} +8 -8
- package/dist/{runner-BBmhrQTM.js → runner-C1AwS93W.js} +10 -10
- package/dist/{sandbox-egress-signals-Cehpq6hC.js → sandbox-egress-signals-C-5i7Zxm.js} +1 -1
- package/dist/{service-account-Bapo6l0R.js → service-account-CQIW6At4.js} +3 -3
- package/dist/{service-account-Ce1465Fn.js → service-account-DZX1KlQl.js} +3 -3
- package/dist/{session-stop-CI5qJU7a.js → session-stop-DjIyORJw.js} +10 -10
- package/dist/{skills-D-d79XQ6.js → skills-BEfAAT6p.js} +2 -2
- package/dist/{spawn-C_FETz5x.js → spawn-Dgj4xxvO.js} +2 -2
- package/dist/{stop-CmwFHwiN.js → stop-DomyNvuv.js} +53 -64
- package/dist/{store-BIQYXvoV.js → store-B7Z6zIc7.js} +3 -3
- package/dist/{store-BvI3yBGS.js → store-Dp3RMEQd.js} +3 -3
- package/dist/{task-queue-BdB0pab8.js → task-queue-CVQ9cWnC.js} +3 -3
- package/dist/{task-runner-DQr2QfvJ.js → task-runner-DHBG47gS.js} +6 -6
- package/dist/{thread-state-ngCvtWNa.js → thread-state-BF8VwIxd.js} +4 -4
- package/dist/{turn-failure-response-BDT3sT2v.js → turn-failure-response-Di7TbgsF.js} +6 -6
- package/dist/{turn-lifecycle-B7O6rZEX.js → turn-lifecycle-DzXwXmLg.js} +1 -1
- package/dist/{turn-session-routing-DIeqG2pO.js → turn-session-routing-CIWhXKeT.js} +8 -8
- package/dist/{validation-D3Xik64v.js → validation-BRmwRaXc.js} +1 -1
- package/dist/{version-BoWLhNzj.js → version-DBVMsgvA.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-D25XOUHc.js → viewer-BFADRGP8.js} +3 -3
- package/dist/{work-D12-wcf4.js → work-DDaoxZAw.js} +10 -10
- package/dist/{worker-DGxfDtES.js → worker-Bub0fDtW.js} +6 -6
- package/package.json +4 -4
package/dist/api.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { m as escapeXml } from "./client-
|
|
3
|
-
import { m as logInfo, p as logException } from "./logging-
|
|
4
|
-
import { C as getSqlExecutor, D as loadConversationSlackTenantIds, S as getDb, c as readViewerAvatarUrl, d as updateViewerDisplayName, l as resolveViewerUser, m as readAvatarImage, t as findUserByEmail, x as getConversationStore } from "./viewer-
|
|
1
|
+
import { Da as createPluginLogger, Dr as hash, En as createUserTokenStore, Er as create, Gn as countReviewItemsNeedingUser, Ln as getPlugins, Oa as readConversationAccessFromSql, Qn as searchReviewItems, Zn as listWaitingConversations, ar as isOnlyAssignee, br as updateWorkspace, eo as lookupSlackUser, gr as getWorkspace, hr as deleteWorkspace, lr as reviewItemReaderForUser, mr as createWorkspace, nr as canActOnReviewItem, to as createPluginCache, vr as listWorkspaces, wn as isExperimentalFeatureEnabled, xi as workspaceRepoCheckoutPath, xr as WorkspaceValidationError, yi as SANDBOX_RUNTIME, yr as listWorkspacesByRepository, za as readConversationEventPage } from "./projection-CTvLSwcm.js";
|
|
2
|
+
import { m as escapeXml } from "./client-gnKpkpqP.js";
|
|
3
|
+
import { m as logInfo, p as logException } from "./logging-CFHIO4Vs.js";
|
|
4
|
+
import { C as getSqlExecutor, D as loadConversationSlackTenantIds, S as getDb, c as readViewerAvatarUrl, d as updateViewerDisplayName, l as resolveViewerUser, m as readAvatarImage, t as findUserByEmail, x as getConversationStore } from "./viewer-BFADRGP8.js";
|
|
5
5
|
import { c as juniorIdentities, d as juniorDestinations, l as juniorUsers, s as juniorConversations } from "./agent-invocations-C1RNOCs8.js";
|
|
6
|
-
import { C as juniorCodeChanges, b as juniorConversationEvents, w as juniorCodeRepositories, x as juniorApiTokens, y as juniorConversationMetrics } from "./executor-
|
|
6
|
+
import { C as juniorCodeChanges, b as juniorConversationEvents, w as juniorCodeRepositories, x as juniorApiTokens, y as juniorConversationMetrics } from "./executor-j8VMt-To.js";
|
|
7
7
|
import { t as INPUT_IMAGE_TYPES } from "./media-DstkkoNP.js";
|
|
8
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
9
|
-
import { $ as readViewerAutomations, At as readUserCustomization, G as readViewerAutomationEdit, H as activateViewerAutomationVersion, K as updateViewerAutomation, Q as readViewerAutomationVersions, S as createSlackReviewItemShow, St as listChildAgents, U as changeViewerAutomationLifecycle, W as deleteViewerTask, X as readViewerAutomationRuns, Y as readViewerAutomationExecutions, Z as readViewerAutomationSummary, at as acceptsWebMessages, ct as createAndEnqueueConversation, dt as webActorFromEmail, et as AutomationEditError, h as readStats, ht as readLiveAttachment, jt as saveUserCustomization, nt as listOwnedWatches, ot as appendAndEnqueueWebMessage, pt as decodeInputImages, q as ViewerTaskNotFoundError } from "./agent-runner-
|
|
10
|
-
import { r as getStateAdapter } from "./adapter-
|
|
8
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-DcJ5NHDW.js";
|
|
9
|
+
import { $ as readViewerAutomations, At as readUserCustomization, G as readViewerAutomationEdit, H as activateViewerAutomationVersion, K as updateViewerAutomation, Q as readViewerAutomationVersions, S as createSlackReviewItemShow, St as listChildAgents, U as changeViewerAutomationLifecycle, W as deleteViewerTask, X as readViewerAutomationRuns, Y as readViewerAutomationExecutions, Z as readViewerAutomationSummary, at as acceptsWebMessages, ct as createAndEnqueueConversation, dt as webActorFromEmail, et as AutomationEditError, h as readStats, ht as readLiveAttachment, jt as saveUserCustomization, nt as listOwnedWatches, ot as appendAndEnqueueWebMessage, pt as decodeInputImages, q as ViewerTaskNotFoundError } from "./agent-runner-bE7aH7ew.js";
|
|
10
|
+
import { r as getStateAdapter } from "./adapter-dE2BiWP_.js";
|
|
11
11
|
import { A as createConversationMessageBodySchema, G as readMessageAttachments, I as conversationReadPositionSchema, M as forkConversationResponseSchema, N as steerConversationPendingMessagesBodySchema, P as steerConversationPendingMessagesResponseSchema, _ as conversationParamsSchema, a as cancelConversationPendingMessagesBodySchema, c as conversationAttachmentParamsSchema, d as conversationDetailReportSchema, g as conversationFeedSchema, h as conversationFeedQuerySchema, i as archiveConversationResponseSchema, j as forkConversationBodySchema, k as createConversationBodySchema, m as conversationEventsQuerySchema, o as cancelConversationPendingMessagesResponseSchema, p as conversationEventPageSchema, r as archiveConversationBodySchema, t as acceptedConversationMessageSchema, u as conversationDetailQuerySchema, x as conversationPendingMessagesReportSchema } from "./conversation-BjTo9ZFL.js";
|
|
12
|
-
import { d as getEventCatalog } from "./session-stop-
|
|
12
|
+
import { d as getEventCatalog } from "./session-stop-DjIyORJw.js";
|
|
13
13
|
import { S as userCustomizationSchema, a as fillUtcSixHours, b as webMessageId, c as trailingUtcDayWindow, d as utcDayKey, f as utcHourKey, i as fillUtcHours, l as trailingUtcHourWindow, n as HOUR_MS$1, o as startOfUtcHour, r as fillUtcDays, s as sumUtcHoursIntoSixHours, t as DAY_MS$1, u as trailingUtcSixHourWindow } from "./reporting-window-DgHgwQB3.js";
|
|
14
|
-
import { s as getSandboxResources, t as getCachedSnapshot } from "./resolve-
|
|
15
|
-
import {
|
|
16
|
-
import { E as steerWebPendingMessages, a as cancelHumanFacingPendingMessages, g as getConversationWorkState, h as getConversation } from "./store-
|
|
17
|
-
import { F as conversationRangeColumns, N as conversationActiveDaysColumn, P as conversationAggregateColumns, ct as AutomationConflictError, ft as automationEventCatalog, j as readAutomationTitlesByConversationId } from "./turn-session-routing-
|
|
18
|
-
import { n as finishServiceAccountSignIn, o as serviceAccountPlugins, r as getServiceAccountStatus, s as startServiceAccountSignIn, t as disconnectServiceAccount } from "./service-account-
|
|
14
|
+
import { s as getSandboxResources, t as getCachedSnapshot } from "./resolve-DCrKjmVP.js";
|
|
15
|
+
import { l as getVercelConversationWorkQueue } from "./background-compaction-queue-BYuOt3qK.js";
|
|
16
|
+
import { E as steerWebPendingMessages, a as cancelHumanFacingPendingMessages, g as getConversationWorkState, h as getConversation } from "./store-Dp3RMEQd.js";
|
|
17
|
+
import { F as conversationRangeColumns, N as conversationActiveDaysColumn, P as conversationAggregateColumns, ct as AutomationConflictError, ft as automationEventCatalog, j as readAutomationTitlesByConversationId } from "./turn-session-routing-CIWhXKeT.js";
|
|
18
|
+
import { n as finishServiceAccountSignIn, o as serviceAccountPlugins, r as getServiceAccountStatus, s as startServiceAccountSignIn, t as disconnectServiceAccount } from "./service-account-CQIW6At4.js";
|
|
19
19
|
import { N as ScheduleIntentError, P as compileScheduleIntent, _ as automationSummarySchema, b as automationVersionListSchema, c as automationLifecycleSchema, d as automationParamsSchema, f as automationRunListSchema, g as automationSchedulePreviewSchema, h as automationScheduleIntentSchema, i as automationExecutionListSchema, 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-BGrd03QO.js";
|
|
20
20
|
import { c as pluginsSchema, d as skillReportsSchema, l as runtimeInfoReportSchema, n as healthReportSchema, r as pluginOperationalReportFeedSchema, t as apiErrorSchema } from "./common-Eu6sx09c.js";
|
|
21
|
-
import { C as getProductionSlackAdapter, D as isAllowedSignInEmail, G as closeReviewItemsAnsweredByReply, H as parseContent, J as getAttachmentStorage, K as readReviewItemForUser, M as clearSlackPendingReactions, Q as readHealthReport, U as ReviewItemActionError, W as actOnReviewItem, _ as archiveConversation, a as readConversationFeed, b as throwApiError, c as childAgentTotalsReport, d as conversationSummaryFromStoredConversation, f as attachConversationMentions, g as encodeConversationCursor, h as decodeConversationCursor, i as forkConversationForViewer, l as readConversationTreeMetricsFromSql, m as readFirstHumanMessageTexts, n as readConversationDetail, o as readConversationRecordFromSql, p as resolveMentions, r as markConversationRead, s as readConversationAuxiliaryCostsFromSql, t as stopConversationTurnForViewer, u as conversationEventHistory, v as emptyResponse, y as jsonResponse } from "./stop-
|
|
22
|
-
import { f as legacyWebMailboxMetadataSchema } from "./result-
|
|
23
|
-
import { a as startConnection, l as getWebAuthorization, n as isConnectableProvider, r as listConnections, t as disconnectConnection, u as htmlCallbackResponse } from "./connections-
|
|
21
|
+
import { C as getProductionSlackAdapter, D as isAllowedSignInEmail, G as closeReviewItemsAnsweredByReply, H as parseContent, J as getAttachmentStorage, K as readReviewItemForUser, M as clearSlackPendingReactions, Q as readHealthReport, U as ReviewItemActionError, W as actOnReviewItem, _ as archiveConversation, a as readConversationFeed, b as throwApiError, c as childAgentTotalsReport, d as conversationSummaryFromStoredConversation, f as attachConversationMentions, g as encodeConversationCursor, h as decodeConversationCursor, i as forkConversationForViewer, l as readConversationTreeMetricsFromSql, m as readFirstHumanMessageTexts, n as readConversationDetail, o as readConversationRecordFromSql, p as resolveMentions, r as markConversationRead, s as readConversationAuxiliaryCostsFromSql, t as stopConversationTurnForViewer, u as conversationEventHistory, v as emptyResponse, y as jsonResponse } from "./stop-DomyNvuv.js";
|
|
22
|
+
import { f as legacyWebMailboxMetadataSchema } from "./result-Btdt5bSl.js";
|
|
23
|
+
import { a as startConnection, l as getWebAuthorization, n as isConnectableProvider, r as listConnections, t as disconnectConnection, u as htmlCallbackResponse } from "./connections-DLqP5Bp1.js";
|
|
24
24
|
import { A as avatarParamsSchema, C as createdPersonalTokenSchema, D as revokePersonalTokenResponseSchema, E as personalTokenParamsSchema, F as locationDirectoryReportSchema, G as startConnectionResponseSchema, H as connectionParamsSchema, I as locationParamsSchema, L as activityDays$1, M as personalSpendReportSchema, O as actorDirectoryReportSchema, P as locationDetailReportSchema, Q as codeRepositoryReportSchema, R as activityHours$1, S as createPersonalTokenBodySchema, V as connectionListSchema, W as disconnectConnectionResponseSchema, X as codePersonReportSchema, Y as codeOverviewReportSchema, Z as codeRepositoryParamsSchema, _ as disconnectServiceAccountResponseSchema, a as workspaceBodySchema, at as conversationStatsReportSchema, d as reviewItemCountSchema, f as reviewItemListQuerySchema, g as reviewItemWaitingConversationsSchema, h as reviewItemSchema, i as deleteWorkspaceResponseSchema, it as stopConversationTurnResponseSchema, j as personParamsSchema, k as actorProfileReportSchema, l as workspaceSchema, m as reviewItemParamsSchema, n as statsReportSchema, o as workspaceListSchema, p as reviewItemListSchema, rt as conversationChildAgentsReportSchema, s as workspaceParamsSchema, tt as conversationWatchesReportSchema, u as reviewItemActionSchema, v as serviceAccountListSchema, w as personalTokenListSchema, x as startServiceAccountSignInResponseSchema, y as serviceAccountParamsSchema, z as activitySixHours$1 } from "./schema-CX9XGKCm.js";
|
|
25
25
|
import { Hono } from "hono";
|
|
26
26
|
import path from "node:path";
|
|
@@ -2239,7 +2239,7 @@ async function readPeoplePluginReports(args) {
|
|
|
2239
2239
|
reports: [],
|
|
2240
2240
|
source: "plugins"
|
|
2241
2241
|
});
|
|
2242
|
-
const { getPluginProfileReports } = await import("./projection-
|
|
2242
|
+
const { getPluginProfileReports } = await import("./projection-CTvLSwcm.js").then((n) => n.kn);
|
|
2243
2243
|
return pluginOperationalReportFeedSchema.parse({
|
|
2244
2244
|
generatedAt: new Date(nowMs).toISOString(),
|
|
2245
2245
|
reports: await getPluginProfileReports({
|
|
@@ -3267,7 +3267,7 @@ function readDescriptionText(home) {
|
|
|
3267
3267
|
}
|
|
3268
3268
|
/** Read discovered skill names for authenticated runtime diagnostics. */
|
|
3269
3269
|
async function readSkillReports() {
|
|
3270
|
-
const { discoverSkills } = await import("./skills-
|
|
3270
|
+
const { discoverSkills } = await import("./skills-BEfAAT6p.js").then((n) => n.o);
|
|
3271
3271
|
const skills = await discoverSkills();
|
|
3272
3272
|
return skillReportsSchema.parse(skills.map((skill) => ({
|
|
3273
3273
|
name: skill.name,
|
|
@@ -3276,7 +3276,7 @@ async function readSkillReports() {
|
|
|
3276
3276
|
}
|
|
3277
3277
|
/** Read safe configured plugin metadata for authenticated runtime diagnostics. */
|
|
3278
3278
|
async function readPlugins() {
|
|
3279
|
-
const { pluginCatalogRuntime } = await import("./catalog-runtime-
|
|
3279
|
+
const { pluginCatalogRuntime } = await import("./catalog-runtime-DcJ5NHDW.js").then((n) => n.t);
|
|
3280
3280
|
return pluginsSchema.parse(pluginCatalogRuntime.getProviders().map((plugin) => ({
|
|
3281
3281
|
configKeys: plugin.manifest.configKeys ?? [],
|
|
3282
3282
|
description: plugin.manifest.description,
|
|
@@ -3288,7 +3288,7 @@ async function readPlugins() {
|
|
|
3288
3288
|
async function readRuntimeInfoReport() {
|
|
3289
3289
|
const [{ homeDir }, { pluginCatalogRuntime }, plugins, skills] = await Promise.all([
|
|
3290
3290
|
import("./package-discovery-DJBompdd.js").then((n) => n.r),
|
|
3291
|
-
import("./catalog-runtime-
|
|
3291
|
+
import("./catalog-runtime-DcJ5NHDW.js").then((n) => n.t),
|
|
3292
3292
|
readPlugins(),
|
|
3293
3293
|
readSkillReports()
|
|
3294
3294
|
]);
|
|
@@ -3305,7 +3305,7 @@ async function readRuntimeInfoReport() {
|
|
|
3305
3305
|
/** Read sanitized operational summaries contributed by plugins. */
|
|
3306
3306
|
async function readPluginOperationalReportFeed() {
|
|
3307
3307
|
const nowMs = Date.now();
|
|
3308
|
-
const { getPluginOperationalReports } = await import("./projection-
|
|
3308
|
+
const { getPluginOperationalReports } = await import("./projection-CTvLSwcm.js").then((n) => n.kn);
|
|
3309
3309
|
return pluginOperationalReportFeedSchema.parse({
|
|
3310
3310
|
source: "plugins",
|
|
3311
3311
|
generatedAt: new Date(nowMs).toISOString(),
|
|
@@ -104,6 +104,17 @@ declare const pluginTaskQueueMessageSchema: z.ZodObject<{
|
|
|
104
104
|
plugin: z.ZodString;
|
|
105
105
|
}, z.core.$strict>;
|
|
106
106
|
type PluginTaskQueueMessage = z.output<typeof pluginTaskQueueMessageSchema>;
|
|
107
|
+
declare const backgroundCompactionMessageSchema: z.ZodObject<{
|
|
108
|
+
conversationId: z.ZodString;
|
|
109
|
+
historyVersion: z.ZodNumber;
|
|
110
|
+
markSeq: z.ZodNumber;
|
|
111
|
+
}, z.core.$strict>;
|
|
112
|
+
/** One background compaction job: the request that it prepares a summary for. */
|
|
113
|
+
type BackgroundCompactionMessage = z.output<typeof backgroundCompactionMessageSchema>;
|
|
114
|
+
/** Sends background compaction jobs. Tests and evals can run them in process. */
|
|
115
|
+
interface BackgroundCompactionQueue {
|
|
116
|
+
send(message: BackgroundCompactionMessage): Promise<void>;
|
|
117
|
+
}
|
|
107
118
|
/** Canonical durable mailbox entry owned by task execution. */
|
|
108
119
|
declare const inboundMessageSchema: z.ZodObject<{
|
|
109
120
|
attemptCount: z.ZodOptional<z.ZodNumber>;
|
|
@@ -294,6 +305,11 @@ interface JuniorAppOptions extends BotModelConfig {
|
|
|
294
305
|
pluginTaskQueue?: (consume: (message: PluginTaskQueueMessage) => Promise<void>) => {
|
|
295
306
|
send(message: PluginTaskQueueMessage): Promise<void>;
|
|
296
307
|
};
|
|
308
|
+
/**
|
|
309
|
+
* Replace the Vercel Queue transport for background compaction jobs, for
|
|
310
|
+
* example with an in-process queue. `consume` runs one job.
|
|
311
|
+
*/
|
|
312
|
+
backgroundCompactionQueue?: (consume: (message: BackgroundCompactionMessage) => Promise<void>) => BackgroundCompactionQueue;
|
|
297
313
|
/** Direct plugin set override. Usually omitted when `juniorNitro()` uses a plugin module. */
|
|
298
314
|
plugins?: JuniorPluginSet;
|
|
299
315
|
/** Sandbox execution options. */
|
package/dist/app.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as ModelProfileInput, i as JuniorDashboardOptions, n as JuniorAppOptions, r as createApp, t as JuniorApp } from "./app-
|
|
1
|
+
import { a as ModelProfileInput, i as JuniorDashboardOptions, n as JuniorAppOptions, r as createApp, t as JuniorApp } from "./app-CgkquhZ8.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, JuniorApp, JuniorAppOptions, type JuniorDashboardOptions, type JuniorPluginInput, type JuniorPluginSet, type JuniorPluginSetOptions, type ModelProfileInput, createApp, defineJuniorPlugins };
|
package/dist/app.js
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { d as restoreRuntimeConfig, f as setBotModelConfig, g as snapshotRuntimeConfig, h as setSlackReactionConfig, i as getChatConfig, m as setRuntimeLimits, n as botConfig, o as getSlackBotToken, p as setProfiles, u as resetRuntimeConfig } from "./config-
|
|
3
|
-
import {
|
|
1
|
+
import { Ai as collectEventMatchKeys, Bi as bindSlackDirectCredentialSubject, C as projectConversationMessages, Cn as getExperimentalFeatures, Da as createPluginLogger, E as settleConversationTitleWork, En as createUserTokenStore, Et as isInvalidConversationRecordError, Hi as verifyScheduledAutomationCredentialSubject, Hn as setBriefsConfig, Hr as slackMention, Ir as resolveBaseUrl, Jr as openSlackModal, Kn as dismissOpenReviewItems, Li as takeDueTimerWatches, Ln as getPlugins, Mn as getPluginRoutes, Mr as proxyVercelSandboxEgressRequest, Oa as readConversationAccessFromSql, Pi as findMatchingWatches, Qn as searchReviewItems, Ri as bindEventAutomationCredentialSubject, Rn as setPlugins, Ta as createPluginEmbedder, Tn as setExperimentalFeatures, Ui as verifySlackDirectCredentialSubject, Vi as verifyEventAutomationCredentialSubject, Xa as listConversationAnnotations, Yi as getSlackClient, Yr as postSlackEphemeralMessage, Zi as isDmChannel, _n as getThreadStopDecision, aa as getDashboardConversationLink, b as appendConversationMessages, ca as getDashboardTaskLink, ct as CONVERSATION_WORK_STALE_ENQUEUE_MS, di as consumeSandboxEgressAuthRequiredSignal, ei as slackEntitySchema, fi as consumeSandboxEgressPermissionDeniedSignal, jn as getPluginApiRoutes, jr as isVercelSandboxEgressRequest, la as setDashboardConversationLinkOptions, lo as getConfigDefaults, lr as reviewItemReaderForUser, mi as parseSandboxEgressCredentialToken, mn as SubscribedReplyReason, na as getWorkspaceTeamId, nr as canActOnReviewItem, qa as resolveRootVisibility, ra as runWithWorkspaceTeamId, sa as getDashboardReviewItemLink, ti as slackExternalRefIdSchema, to as createPluginCache, ui as clearSandboxEgressSignals, uo as setConfigDefaults, vi as normalizeSandboxEgressTracePropagationDomains, wa as createPluginState, wn as isExperimentalFeatureEnabled, wt as hasRunnableConversationWork, za as readConversationEventPage, zi as bindScheduledAutomationCredentialSubject, zn as validatePlugins } from "./projection-CTvLSwcm.js";
|
|
2
|
+
import { d as restoreRuntimeConfig, f as setBotModelConfig, g as snapshotRuntimeConfig, h as setSlackReactionConfig, i as getChatConfig, m as setRuntimeLimits, n as botConfig, o as getSlackBotToken, p as setProfiles, u as resetRuntimeConfig } from "./config-D0GKc9sC.js";
|
|
3
|
+
import { D as JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE, E as withSpan, P as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, T as withLogContext, V as normalizeIdentityEmail, b as setSpanAttributes, h as logWarn, j as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, m as logInfo, p as logException, r as createRequestContext, w as withContext, z as GOOGLE_IDENTITY_PROVIDER } from "./logging-CFHIO4Vs.js";
|
|
4
4
|
import { n as captureMessage } from "./sentry-MDkYAVPV.js";
|
|
5
|
-
import { t as JUNIOR_VERSION } from "./version-
|
|
5
|
+
import { t as JUNIOR_VERSION } from "./version-DBVMsgvA.js";
|
|
6
6
|
import { _ as slackMessageTsSchema, f as parseSlackTeamId, g as slackMessageTsFromMs, h as parseSlackMessageTs, m as slackChannelIdSchema, n as createSlackActor, p as parseSlackUserId, s as parseActorUserId, u as parseSlackChannelId } from "./actor-B4DYygOB.js";
|
|
7
|
-
import { C as getSqlExecutor, E as withConversationEventLock, N as resolveActorIdentityId, S as getDb, _ as closeDb, g as createCache, i as readActorIdentity, k as withConversationMutationLock, l as resolveViewerUser, p as parseAvatarUrl, x as getConversationStore, y as getConversationEventStore, z as recordGoogleSignIn } from "./viewer-
|
|
7
|
+
import { C as getSqlExecutor, E as withConversationEventLock, N as resolveActorIdentityId, S as getDb, _ as closeDb, g as createCache, i as readActorIdentity, k as withConversationMutationLock, l as resolveViewerUser, p as parseAvatarUrl, x as getConversationStore, y as getConversationEventStore, z as recordGoogleSignIn } from "./viewer-BFADRGP8.js";
|
|
8
8
|
import { a as juniorAgentInvocations, d as juniorDestinations, i as juniorAgentBindings, s as juniorConversations } from "./agent-invocations-C1RNOCs8.js";
|
|
9
|
-
import { _ as juniorConversationBriefs, b as juniorConversationEvents, c as juniorReviewItems, d as juniorAutomations, l as juniorAutomationRuns } from "./executor-
|
|
10
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
11
|
-
import { $ as readViewerAutomations, A as runWithSlackInstallation, B as logScheduledAutomationRunSkipped, C as readSlackReviewItemCardConversationId, D as parseSlackReviewItemClick, Dt as ingestEvent, E as buildSlackReviewItemModal, Et as processWorkspaceSnapshotJob, L as joinPublicChannel, M as parseSlackThreadId, O as parseSlackReviewItemFormTarget, S as createSlackReviewItemShow, V as scheduledAutomationRunAttributes, Y as readViewerAutomationExecutions, Z as readViewerAutomationSummary, _ as readPublicArtifact, bt as recordSubagentEnded, dt as webActorFromEmail, g as publicArtifactHeaders, gt as requestAttachmentDeletion, it as renderReviewItemMessage, j as verifySlackSignature, k as parseSlackUserInputSubmission, mt as collectAttachmentGarbage, n as executeAgentRun, ot as appendAndEnqueueWebMessage, q as ViewerTaskNotFoundError, rt as deliverReviewItemChange, st as conversationTurnIdForMessage, t as createAgentRunner, tt as effectiveTaskOutcomes, ut as recordWebConversationActivity, v as unpublishedArtifactHeaders, w as syncReviewItemSlackCards, y as lookupSlackUserProfile, yt as stopConversationSession } from "./agent-runner-
|
|
9
|
+
import { _ as juniorConversationBriefs, b as juniorConversationEvents, c as juniorReviewItems, d as juniorAutomations, l as juniorAutomationRuns } from "./executor-j8VMt-To.js";
|
|
10
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-DcJ5NHDW.js";
|
|
11
|
+
import { $ as readViewerAutomations, A as runWithSlackInstallation, B as logScheduledAutomationRunSkipped, C as readSlackReviewItemCardConversationId, D as parseSlackReviewItemClick, Dt as ingestEvent, E as buildSlackReviewItemModal, Et as processWorkspaceSnapshotJob, L as joinPublicChannel, M as parseSlackThreadId, O as parseSlackReviewItemFormTarget, S as createSlackReviewItemShow, V as scheduledAutomationRunAttributes, Y as readViewerAutomationExecutions, Z as readViewerAutomationSummary, _ as readPublicArtifact, bt as recordSubagentEnded, dt as webActorFromEmail, g as publicArtifactHeaders, gt as requestAttachmentDeletion, it as renderReviewItemMessage, j as verifySlackSignature, k as parseSlackUserInputSubmission, mt as collectAttachmentGarbage, n as executeAgentRun, ot as appendAndEnqueueWebMessage, q as ViewerTaskNotFoundError, r as processBackgroundCompaction, rt as deliverReviewItemChange, st as conversationTurnIdForMessage, t as createAgentRunner, tt as effectiveTaskOutcomes, ut as recordWebConversationActivity, v as unpublishedArtifactHeaders, w as syncReviewItemSlackCards, y as lookupSlackUserProfile, yt as stopConversationSession } from "./agent-runner-bE7aH7ew.js";
|
|
12
12
|
import { a as withLock, i as fenceLock, n as MUTATION_LOCK_TTL_MS } from "./locks-D-0h111u.js";
|
|
13
|
-
import { r as getStateAdapter, t as disconnectStateAdapter } from "./adapter-
|
|
13
|
+
import { r as getStateAdapter, t as disconnectStateAdapter } from "./adapter-dE2BiWP_.js";
|
|
14
14
|
import { n as getNextRunAtMs } from "./cadence-R7Em4RjE.js";
|
|
15
15
|
import { D as conversationSurfaceSchema, L as annotationCard, T as conversationReportStatusSchema, Y as conversationBriefSchema, h as conversationFeedQuerySchema } from "./conversation-BjTo9ZFL.js";
|
|
16
|
-
import { b as listPendingAgentInvocationMailboxAppends, x as listPendingAgentInvocationResults } from "./store-
|
|
17
|
-
import { C as renderTaskInput, O as renderSlackObjectCard, d as getEventCatalog, f as SLACK_EVENT_NAMESPACE, g as slackChannelMessageRunsAutomation, h as slackChannelMessageReplyThreadTs, m as slackChannelMessageEvent } from "./session-stop-
|
|
16
|
+
import { b as listPendingAgentInvocationMailboxAppends, x as listPendingAgentInvocationResults } from "./store-B7Z6zIc7.js";
|
|
17
|
+
import { C as renderTaskInput, O as renderSlackObjectCard, d as getEventCatalog, f as SLACK_EVENT_NAMESPACE, g as slackChannelMessageRunsAutomation, h as slackChannelMessageReplyThreadTs, m as slackChannelMessageEvent } from "./session-stop-DjIyORJw.js";
|
|
18
18
|
import { h as buttonUserInputField } from "./reporting-window-DgHgwQB3.js";
|
|
19
|
-
import { c as setSandboxResourceConfig, o as getSandboxResourceConfig } from "./resolve-
|
|
20
|
-
import { a as
|
|
21
|
-
import { S as removeActiveConversation, _ as hasRunnableConversationWork$1, c as clearExpiredConversationLease, g as getConversationWorkState, h as getConversation, m as ensureConversationWake, r as appendAndEnqueueInboundMessage, v as listActiveConversationIds } from "./store-
|
|
22
|
-
import { B as readScheduledAutomation, G as blockEventAutomation, H as saveScheduledAutomationInLock, K as collectEventAutomationMatchKeys, M as recordAutomationExecution, R as listScheduledAutomationsForTeam, S as existingConversationId, U as scheduledRunId, W as withScheduledAutomationLock, Y as findMatchingEventAutomations, a as confirmDispatchMailboxAppend, b as notifyAutomationBlocked, f as getPluginDispatchProjection, ht as eventGuidance, it as automationVersionOf, m as listPendingDispatchMailboxAppends, nt as eventAutomationRunLimitReason, o as createOrGetDispatch, p as isTerminalDispatchStatus, r as buildDispatchId, s as getDispatchConversationId, tt as admitEventAutomationRun, u as getDispatchRecord, v as markDispatchFailed } from "./turn-session-routing-
|
|
19
|
+
import { c as setSandboxResourceConfig, o as getSandboxResourceConfig } from "./resolve-DCrKjmVP.js";
|
|
20
|
+
import { a as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC, b as isConversationQueueMessageRejectedError, c as verifyWorkspaceSnapshotJobMessage, d as verifyConversationQueueMessage, h as getQueueProvider, i as verifyBackgroundCompactionMessage, l as getVercelConversationWorkQueue, r as vercelBackgroundCompactionQueue, t as BACKGROUND_COMPACTION_QUEUE_TOPIC, u as resolveConversationWorkQueueTopic, y as conversationQueueMessageSchema } from "./background-compaction-queue-BYuOt3qK.js";
|
|
21
|
+
import { S as removeActiveConversation, _ as hasRunnableConversationWork$1, c as clearExpiredConversationLease, g as getConversationWorkState, h as getConversation, m as ensureConversationWake, r as appendAndEnqueueInboundMessage, v as listActiveConversationIds } from "./store-Dp3RMEQd.js";
|
|
22
|
+
import { B as readScheduledAutomation, G as blockEventAutomation, H as saveScheduledAutomationInLock, K as collectEventAutomationMatchKeys, M as recordAutomationExecution, R as listScheduledAutomationsForTeam, S as existingConversationId, U as scheduledRunId, W as withScheduledAutomationLock, Y as findMatchingEventAutomations, a as confirmDispatchMailboxAppend, b as notifyAutomationBlocked, f as getPluginDispatchProjection, ht as eventGuidance, it as automationVersionOf, m as listPendingDispatchMailboxAppends, nt as eventAutomationRunLimitReason, o as createOrGetDispatch, p as isTerminalDispatchStatus, r as buildDispatchId, s as getDispatchConversationId, tt as admitEventAutomationRun, u as getDispatchRecord, v as markDispatchFailed } from "./turn-session-routing-CIWhXKeT.js";
|
|
23
23
|
import { M as scheduledRunSchema, l as automationListQuerySchema, s as automationExecutionStatusSchema } from "./automation-BGrd03QO.js";
|
|
24
|
-
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-
|
|
24
|
+
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-BRmwRaXc.js";
|
|
25
25
|
import { a as pluginRuntimeRegistrationsFromPluginSet, n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "./plugins-DOm9Y6qI.js";
|
|
26
|
-
import { A as recordSkippedConversationMessage, B as startProcessingReaction, C as getProductionSlackAdapter, D as isAllowedSignInEmail, E as isAllowedDomain, F as normalizeIncomingSlackThreadId, G as closeReviewItemsAnsweredByReply, H as parseContent, I as withNormalizedThreadId, J as getAttachmentStorage, K as readReviewItemForUser, L as stopConversationTurn, M as clearSlackPendingReactions, N as isSlackMessageStopped, O as readEnvList, P as stopSlackThread, R as THREAD_OPTOUT_ACK, S as createProductionSlackWebhookServices, T as assertNoLegacyAllowedDomains, U as ReviewItemActionError, V as stripLeadingBotMention, W as actOnReviewItem, X as enqueueAgentDispatch, Z as GET$3, _ as archiveConversation, a as readConversationFeed, g as encodeConversationCursor, h as decodeConversationCursor, j as buildSlackInboundMessage, k as resolveAllowedDomains, n as readConversationDetail, o as readConversationRecordFromSql, q as reviewItemChange, t as stopConversationTurnForViewer, w as createSlackWebApiStatusSender, x as createProductionConversationWorkOptions, z as bindMessageAuthorIdentityId } from "./stop-
|
|
27
|
-
import { n as enqueueAgentInvocationResult, o as getAuthPausedConversationTurnId } from "./result-
|
|
28
|
-
import { r as enqueueAgentInvocation } from "./work-
|
|
29
|
-
import { o as coerceThreadConversationState } from "./thread-state-
|
|
30
|
-
import { o as unlinkProvider } from "./connections-
|
|
31
|
-
import { a as GET$4, i as publishAppHomeView, r as GET$5, t as receiveLocalOAuthCredential } from "./credential-sync-
|
|
32
|
-
import { a as pluginTaskQueueConsumer, c as queueCallback, n as createVercelPluginTaskCallback, o as registerVercelPluginTaskDevConsumer } from "./task-queue-
|
|
33
|
-
import { t as processConversationWork } from "./worker-
|
|
34
|
-
import { t as bindMessageAgent } from "./message-
|
|
35
|
-
import { t as bindSpawnAgent } from "./spawn-
|
|
36
|
-
import { t as processPluginTask } from "./task-runner-
|
|
26
|
+
import { A as recordSkippedConversationMessage, B as startProcessingReaction, C as getProductionSlackAdapter, D as isAllowedSignInEmail, E as isAllowedDomain, F as normalizeIncomingSlackThreadId, G as closeReviewItemsAnsweredByReply, H as parseContent, I as withNormalizedThreadId, J as getAttachmentStorage, K as readReviewItemForUser, L as stopConversationTurn, M as clearSlackPendingReactions, N as isSlackMessageStopped, O as readEnvList, P as stopSlackThread, R as THREAD_OPTOUT_ACK, S as createProductionSlackWebhookServices, T as assertNoLegacyAllowedDomains, U as ReviewItemActionError, V as stripLeadingBotMention, W as actOnReviewItem, X as enqueueAgentDispatch, Z as GET$3, _ as archiveConversation, a as readConversationFeed, g as encodeConversationCursor, h as decodeConversationCursor, j as buildSlackInboundMessage, k as resolveAllowedDomains, n as readConversationDetail, o as readConversationRecordFromSql, q as reviewItemChange, t as stopConversationTurnForViewer, w as createSlackWebApiStatusSender, x as createProductionConversationWorkOptions, z as bindMessageAuthorIdentityId } from "./stop-DomyNvuv.js";
|
|
27
|
+
import { n as enqueueAgentInvocationResult, o as getAuthPausedConversationTurnId } from "./result-Btdt5bSl.js";
|
|
28
|
+
import { r as enqueueAgentInvocation } from "./work-DDaoxZAw.js";
|
|
29
|
+
import { o as coerceThreadConversationState } from "./thread-state-BF8VwIxd.js";
|
|
30
|
+
import { o as unlinkProvider } from "./connections-DLqP5Bp1.js";
|
|
31
|
+
import { a as GET$4, i as publishAppHomeView, r as GET$5, t as receiveLocalOAuthCredential } from "./credential-sync-BjihXFF2.js";
|
|
32
|
+
import { a as pluginTaskQueueConsumer, c as queueCallback, n as createVercelPluginTaskCallback, o as registerVercelPluginTaskDevConsumer } from "./task-queue-CVQ9cWnC.js";
|
|
33
|
+
import { t as processConversationWork } from "./worker-Bub0fDtW.js";
|
|
34
|
+
import { t as bindMessageAgent } from "./message-DH0cqFRS.js";
|
|
35
|
+
import { t as bindSpawnAgent } from "./spawn-Dgj4xxvO.js";
|
|
36
|
+
import { t as processPluginTask } from "./task-runner-DHBG47gS.js";
|
|
37
37
|
import { createRequire } from "node:module";
|
|
38
38
|
import { Hono } from "hono";
|
|
39
39
|
import { createHash, randomBytes, randomUUID, timingSafeEqual } from "node:crypto";
|
|
@@ -3230,6 +3230,41 @@ function workspaceSnapshotJobQueueConsumer() {
|
|
|
3230
3230
|
function registerVercelWorkspaceSnapshotJobDevConsumer() {
|
|
3231
3231
|
return workspaceSnapshotJobCallback().registerDev();
|
|
3232
3232
|
}
|
|
3233
|
+
// src/chat/services/background-compaction-callback.ts
|
|
3234
|
+
/** Receive background compaction jobs from the queue. */
|
|
3235
|
+
const BACKGROUND_COMPACTION_DEV_CONSUMER_GROUP = "junior_context_compaction_dev";
|
|
3236
|
+
const BACKGROUND_COMPACTION_MAX_DELIVERIES = 3;
|
|
3237
|
+
function logRejected(reason, metadata) {
|
|
3238
|
+
logWarn("context_compaction.queue_message.rejected", {
|
|
3239
|
+
"app.queue.consumer_group": metadata.consumerGroup,
|
|
3240
|
+
"app.queue.delivery_count": metadata.deliveryCount,
|
|
3241
|
+
"app.queue.message_id": metadata.messageId,
|
|
3242
|
+
"app.queue.reject_reason": reason,
|
|
3243
|
+
"app.queue.topic_name": metadata.topicName
|
|
3244
|
+
});
|
|
3245
|
+
}
|
|
3246
|
+
function backgroundCompactionCallback() {
|
|
3247
|
+
return queueCallback({
|
|
3248
|
+
consumerGroup: BACKGROUND_COMPACTION_DEV_CONSUMER_GROUP,
|
|
3249
|
+
maxDeliveries: BACKGROUND_COMPACTION_MAX_DELIVERIES,
|
|
3250
|
+
onRejected: logRejected,
|
|
3251
|
+
run: async (message, metadata) => await processBackgroundCompaction(message, { enqueuedAtMs: metadata.createdAt.getTime() }),
|
|
3252
|
+
topic: BACKGROUND_COMPACTION_QUEUE_TOPIC,
|
|
3253
|
+
verify: verifyBackgroundCompactionMessage
|
|
3254
|
+
});
|
|
3255
|
+
}
|
|
3256
|
+
/** Create the HTTP route for background compaction jobs. */
|
|
3257
|
+
function createVercelBackgroundCompactionCallback() {
|
|
3258
|
+
return backgroundCompactionCallback().create();
|
|
3259
|
+
}
|
|
3260
|
+
/** Return the queue consumer for background compaction, for a pulling worker. */
|
|
3261
|
+
function backgroundCompactionQueueConsumer() {
|
|
3262
|
+
return backgroundCompactionCallback().consumer;
|
|
3263
|
+
}
|
|
3264
|
+
/** Receive background compaction jobs during local development. */
|
|
3265
|
+
function registerVercelBackgroundCompactionDevConsumer() {
|
|
3266
|
+
return backgroundCompactionCallback().registerDev();
|
|
3267
|
+
}
|
|
3233
3268
|
// src/handlers/artifacts.ts
|
|
3234
3269
|
/** Serve one content-addressed public artifact without authentication. */
|
|
3235
3270
|
async function publicArtifactGET(args) {
|
|
@@ -7173,9 +7208,11 @@ async function createApp(options) {
|
|
|
7173
7208
|
messageId: delivery.messageId
|
|
7174
7209
|
})) ?? getVercelConversationWorkQueue();
|
|
7175
7210
|
const pluginTaskQueue = options?.pluginTaskQueue?.(processPluginTask);
|
|
7211
|
+
const backgroundCompactionQueue = options?.backgroundCompactionQueue?.((message) => processBackgroundCompaction(message)) ?? vercelBackgroundCompactionQueue;
|
|
7176
7212
|
const attachmentStorage = getAttachmentStorage();
|
|
7177
7213
|
const agentRunner = createAgentRunner(executeAgentRun, {
|
|
7178
7214
|
attachmentStorage,
|
|
7215
|
+
backgroundCompactionQueue,
|
|
7179
7216
|
bindMessageAgent: (request) => bindMessageAgent(request, { queue: conversationWorkQueue }),
|
|
7180
7217
|
bindSpawnAgent: (request) => bindSpawnAgent(request, { queue: conversationWorkQueue }),
|
|
7181
7218
|
conversationWorkQueue,
|
|
@@ -7341,6 +7378,7 @@ async function createApp(options) {
|
|
|
7341
7378
|
registerVercelConversationWorkDevConsumer(getConversationWorkOptions());
|
|
7342
7379
|
registerVercelPluginTaskDevConsumer();
|
|
7343
7380
|
registerVercelWorkspaceSnapshotJobDevConsumer();
|
|
7381
|
+
registerVercelBackgroundCompactionDevConsumer();
|
|
7344
7382
|
}
|
|
7345
7383
|
app.post("/api/internal/agent/continue", (c) => {
|
|
7346
7384
|
agentContinuePOST ??= createVercelConversationWorkCallback(getConversationWorkOptions());
|
|
@@ -7355,6 +7393,11 @@ async function createApp(options) {
|
|
|
7355
7393
|
workspaceSnapshotJobPOST ??= createVercelWorkspaceSnapshotJobCallback();
|
|
7356
7394
|
return workspaceSnapshotJobPOST(c.req.raw);
|
|
7357
7395
|
});
|
|
7396
|
+
let backgroundCompactionPOST;
|
|
7397
|
+
app.post(JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE, (c) => {
|
|
7398
|
+
backgroundCompactionPOST ??= createVercelBackgroundCompactionCallback();
|
|
7399
|
+
return backgroundCompactionPOST(c.req.raw);
|
|
7400
|
+
});
|
|
7358
7401
|
app.get("/api/internal/heartbeat", (c) => {
|
|
7359
7402
|
return GET$2(c.req.raw, waitUntil, { conversationWorkQueue });
|
|
7360
7403
|
});
|
|
@@ -7370,7 +7413,8 @@ async function createApp(options) {
|
|
|
7370
7413
|
return Object.assign(app, { startQueueWorker: () => startQueueWorker([
|
|
7371
7414
|
conversationWorkQueueConsumer(getConversationWorkOptions()),
|
|
7372
7415
|
pluginTaskQueueConsumer(),
|
|
7373
|
-
workspaceSnapshotJobQueueConsumer()
|
|
7416
|
+
workspaceSnapshotJobQueueConsumer(),
|
|
7417
|
+
backgroundCompactionQueueConsumer()
|
|
7374
7418
|
], backgroundWork) });
|
|
7375
7419
|
}
|
|
7376
7420
|
export { JUNIOR_VERSION, createApp, defineJuniorPlugins };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as getChatConfig } from "./config-
|
|
2
|
-
import { E as withSpan, m as logInfo, p as logException } from "./logging-
|
|
1
|
+
import { i as getChatConfig } from "./config-D0GKc9sC.js";
|
|
2
|
+
import { E as withSpan, m as logInfo, p as logException } from "./logging-CFHIO4Vs.js";
|
|
3
3
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
4
4
|
import { createHash, createHmac, timingSafeEqual } from "node:crypto";
|
|
5
5
|
import { z } from "zod";
|
|
@@ -381,4 +381,43 @@ async function sendWorkspaceSnapshotJob(message) {
|
|
|
381
381
|
async function sendNextWorkspaceSnapshotJob(message) {
|
|
382
382
|
await send(message);
|
|
383
383
|
}
|
|
384
|
-
|
|
384
|
+
// src/chat/services/background-compaction-queue.ts
|
|
385
|
+
/**
|
|
386
|
+
* Messages of background compaction jobs.
|
|
387
|
+
*
|
|
388
|
+
* A message names one `compaction_requested` event. The event log holds the
|
|
389
|
+
* request, and the State adapter holds the request snapshot, so the message
|
|
390
|
+
* stays small.
|
|
391
|
+
*/
|
|
392
|
+
/** Deploy topic name. Keep stable for Vercel queue wiring. */
|
|
393
|
+
const BACKGROUND_COMPACTION_QUEUE_TOPIC = "junior_context_compaction";
|
|
394
|
+
const backgroundCompactionSign = {
|
|
395
|
+
context: "junior.context_compaction_queue.v1",
|
|
396
|
+
schema: z.object({
|
|
397
|
+
conversationId: z.string().min(1),
|
|
398
|
+
historyVersion: z.number().int().nonnegative(),
|
|
399
|
+
markSeq: z.number().int().nonnegative()
|
|
400
|
+
}).strict(),
|
|
401
|
+
signatureVersion: "v1",
|
|
402
|
+
parts: (message) => [
|
|
403
|
+
message.conversationId,
|
|
404
|
+
String(message.historyVersion),
|
|
405
|
+
String(message.markSeq)
|
|
406
|
+
]
|
|
407
|
+
};
|
|
408
|
+
/** Stable id of one request, for event, snapshot, and delivery dedupe. */
|
|
409
|
+
function backgroundCompactionId(message) {
|
|
410
|
+
return `context-compaction_${createHash("sha256").update(message.conversationId).update("\0").update(String(message.historyVersion)).update("\0").update(String(message.markSeq)).digest("hex").slice(0, 32)}`;
|
|
411
|
+
}
|
|
412
|
+
/** Check that a recent queue message came from Junior. */
|
|
413
|
+
function verifyBackgroundCompactionMessage(value) {
|
|
414
|
+
return verifyQueueMessage(backgroundCompactionSign, value);
|
|
415
|
+
}
|
|
416
|
+
/** The production queue for background compaction jobs. */
|
|
417
|
+
const vercelBackgroundCompactionQueue = { send: async (message) => {
|
|
418
|
+
await getQueueProvider().send(BACKGROUND_COMPACTION_QUEUE_TOPIC, signQueueMessage(backgroundCompactionSign, message), {
|
|
419
|
+
idempotencyKey: backgroundCompactionId(message),
|
|
420
|
+
retentionSeconds: QUEUE_SIGNATURE_MAX_AGE_MS / 1e3
|
|
421
|
+
});
|
|
422
|
+
} };
|
|
423
|
+
export { runWithTurnRequestDeadline as _, WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC as a, isConversationQueueMessageRejectedError as b, verifyWorkspaceSnapshotJobMessage as c, verifyConversationQueueMessage as d, QUEUE_SIGNATURE_MAX_AGE_MS as f, getTurnRequestDeadline as g, getQueueProvider as h, verifyBackgroundCompactionMessage as i, getVercelConversationWorkQueue as l, verifyQueueMessage as m, backgroundCompactionId as n, sendNextWorkspaceSnapshotJob as o, signQueueMessage as p, vercelBackgroundCompactionQueue as r, sendWorkspaceSnapshotJob as s, BACKGROUND_COMPACTION_QUEUE_TOPIC as t, resolveConversationWorkQueueTopic as u, ConversationQueueMessageRejectedError as v, conversationQueueMessageSchema as y };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as completeObject } from "./client-
|
|
1
|
+
import { i as completeObject } from "./client-gnKpkpqP.js";
|
|
2
2
|
import { i as defaultModelId } from "./model-profile-B998sjVd.js";
|
|
3
3
|
import { K as briefCodeChangeSchema, X as parseBriefInput, d as conversationDetailReportSchema, p as conversationEventPageSchema } from "./conversation-BjTo9ZFL.js";
|
|
4
4
|
import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-JEWUUpLW.js";
|
|
@@ -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-D0GKc9sC.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-OsyWR4GO.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-bE7aH7ew.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("../projection-
|
|
103
|
-
import("../catalog-runtime-
|
|
104
|
-
import("../validation-
|
|
105
|
-
import("../viewer-
|
|
102
|
+
import("../projection-CTvLSwcm.js").then((n) => n.kn),
|
|
103
|
+
import("../catalog-runtime-DcJ5NHDW.js").then((n) => n.t),
|
|
104
|
+
import("../validation-BRmwRaXc.js").then((n) => n.r),
|
|
105
|
+
import("../viewer-BFADRGP8.js").then((n) => n.v)
|
|
106
106
|
]);
|
|
107
107
|
const resolvedPluginSet = pluginSet === void 0 ? await loadLocalPluginSet() : pluginSet ?? void 0;
|
|
108
108
|
const plugins = pluginsModule.pluginRuntimeRegistrationsFromPluginSet(resolvedPluginSet);
|
|
@@ -152,18 +152,18 @@ function localDevServerUrl() {
|
|
|
152
152
|
async function prepareLocalChatRun(io, pluginSet) {
|
|
153
153
|
defaultStateAdapterForLocalChat();
|
|
154
154
|
await configureLocalChatPlugins(pluginSet);
|
|
155
|
-
const { setBriefsConfig } = await import("../projection-
|
|
155
|
+
const { setBriefsConfig } = await import("../projection-CTvLSwcm.js").then((n) => n.Vn);
|
|
156
156
|
setBriefsConfig({ enabled: true });
|
|
157
|
-
const { runLocalAgentTurn } = await import("../runner-
|
|
158
|
-
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-
|
|
157
|
+
const { runLocalAgentTurn } = await import("../runner-C1AwS93W.js");
|
|
158
|
+
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-BgU4EZsJ.js");
|
|
159
159
|
const { createLocalOAuthState } = await import("../oauth-relay-C6ZAyJgf.js").then((n) => n.t);
|
|
160
|
-
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-
|
|
161
|
-
const { bindSpawnAgent } = await import("../spawn-
|
|
162
|
-
const { bindMessageAgent } = await import("../message-
|
|
163
|
-
const { createChildConversationWorker } = await import("../result-
|
|
164
|
-
const { skipInputBeforeConversationStop } = await import("../session-stop-
|
|
160
|
+
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-C-5i7Zxm.js");
|
|
161
|
+
const { bindSpawnAgent } = await import("../spawn-Dgj4xxvO.js").then((n) => n.n);
|
|
162
|
+
const { bindMessageAgent } = await import("../message-DH0cqFRS.js").then((n) => n.n);
|
|
163
|
+
const { createChildConversationWorker } = await import("../result-Btdt5bSl.js").then((n) => n.i);
|
|
164
|
+
const { skipInputBeforeConversationStop } = await import("../session-stop-DjIyORJw.js").then((n) => n.r);
|
|
165
165
|
const { createLocalConversationWork } = await import("../conversation-work-BaT_T6EB.js");
|
|
166
|
-
const { processConversationWork } = await import("../worker-
|
|
166
|
+
const { processConversationWork } = await import("../worker-Bub0fDtW.js").then((n) => n.n);
|
|
167
167
|
let agentRunner;
|
|
168
168
|
const localConversationWork = createLocalConversationWork(async (message) => {
|
|
169
169
|
if (!agentRunner) throw new Error("Local agent runner is not ready");
|
package/dist/cli/check.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { v as parseInlinePluginManifest, y as parsePluginManifest } from "../registry-
|
|
3
|
-
import { i as parseSkillFile } from "../skills-
|
|
1
|
+
import { A as JUNIOR_HEARTBEAT_ROUTE, F as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, O as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "../logging-CFHIO4Vs.js";
|
|
2
|
+
import { v as parseInlinePluginManifest, y as parsePluginManifest } from "../registry-OsyWR4GO.js";
|
|
3
|
+
import { i as parseSkillFile } from "../skills-BEfAAT6p.js";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import fs from "node:fs/promises";
|
|
6
6
|
import { pathToFileURL } from "node:url";
|
package/dist/cli/main.js
CHANGED
|
@@ -25,13 +25,13 @@ async function runChat(argv, pluginSet) {
|
|
|
25
25
|
return await (await import("./chat.js")).runChat(argv, void 0, { pluginSet });
|
|
26
26
|
}
|
|
27
27
|
async function runAdmin(argv) {
|
|
28
|
-
return await (await import("../admin-
|
|
28
|
+
return await (await import("../admin-CkPaAYuZ.js")).runAdmin(argv);
|
|
29
29
|
}
|
|
30
30
|
async function runServiceAccount(argv) {
|
|
31
|
-
return await (await import("../service-account-
|
|
31
|
+
return await (await import("../service-account-DZX1KlQl.js")).runServiceAccount(argv);
|
|
32
32
|
}
|
|
33
33
|
async function runBriefs(argv) {
|
|
34
|
-
return await (await import("../briefs-
|
|
34
|
+
return await (await import("../briefs-6xUvmGos.js")).runBriefs(argv);
|
|
35
35
|
}
|
|
36
36
|
function topLevelCommand(argv) {
|
|
37
37
|
return (argv[0] === "--" ? argv.slice(1) : argv)[0];
|
package/dist/cli/plugins.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { S as getDb } from "../viewer-
|
|
3
|
-
import { n as pluginCatalogRuntime } from "../catalog-runtime-
|
|
4
|
-
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-
|
|
1
|
+
import { Da as createPluginLogger, Rn as setPlugins, zn as validatePlugins } from "../projection-CTvLSwcm.js";
|
|
2
|
+
import { S as getDb } from "../viewer-BFADRGP8.js";
|
|
3
|
+
import { n as pluginCatalogRuntime } from "../catalog-runtime-DcJ5NHDW.js";
|
|
4
|
+
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-BRmwRaXc.js";
|
|
5
5
|
import { a as pluginRuntimeRegistrationsFromPluginSet, i as pluginCliRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "../plugins-DOm9Y6qI.js";
|
|
6
6
|
import { t as loadAppPluginSet } from "../plugin-module-Cf5gVPWP.js";
|
|
7
7
|
import { stderr, stdout } from "node:process";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as pluginCatalogRuntime } from "../catalog-runtime-
|
|
3
|
-
import { t as disconnectStateAdapter } from "../adapter-
|
|
4
|
-
import { n as resolve } from "../resolve-
|
|
1
|
+
import { Er as create } from "../projection-CTvLSwcm.js";
|
|
2
|
+
import { n as pluginCatalogRuntime } from "../catalog-runtime-DcJ5NHDW.js";
|
|
3
|
+
import { t as disconnectStateAdapter } from "../adapter-dE2BiWP_.js";
|
|
4
|
+
import { n as resolve } from "../resolve-DCrKjmVP.js";
|
|
5
5
|
// src/cli/snapshot-create.ts
|
|
6
6
|
const DEFAULT_RUNTIME = "node22";
|
|
7
7
|
const DEFAULT_TIMEOUT_MS = 6e5;
|
package/dist/cli/upgrade.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as getChatConfig } from "../config-
|
|
2
|
-
import { t as createJuniorSqlExecutor } from "../executor-
|
|
3
|
-
import { t as createPluginCatalogRuntime } from "../registry-
|
|
1
|
+
import { i as getChatConfig } from "../config-D0GKc9sC.js";
|
|
2
|
+
import { t as createJuniorSqlExecutor } from "../executor-j8VMt-To.js";
|
|
3
|
+
import { t as createPluginCatalogRuntime } from "../registry-OsyWR4GO.js";
|
|
4
4
|
import { n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "../plugins-DOm9Y6qI.js";
|
|
5
5
|
import { t as loadAppPluginSet } from "../plugin-module-Cf5gVPWP.js";
|
|
6
6
|
import { basename, dirname, join, resolve } from "node:path";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as withSpan, g as normalizeGenAiFinishReason, h as logWarn, i as extractGenAiUsageAttributes, p as logException, v as serializeGenAiAttribute } from "./logging-
|
|
2
|
-
import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-
|
|
1
|
+
import { E as withSpan, g as normalizeGenAiFinishReason, h as logWarn, i as extractGenAiUsageAttributes, p as logException, v as serializeGenAiAttribute } from "./logging-CFHIO4Vs.js";
|
|
2
|
+
import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-BCXFshP9.js";
|
|
3
3
|
import { calculateCost, completeSimple, getEnvApiKey, getModels, registerApiProvider } from "@earendil-works/pi-ai/compat";
|
|
4
4
|
import { stream as streamAnthropic, streamSimple as streamSimpleAnthropic } from "@earendil-works/pi-ai/api/anthropic-messages";
|
|
5
5
|
import { createGatewayProvider } from "@ai-sdk/gateway";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
|
|
2
|
-
import { C as toOptionalTrimmed, c as resolveGatewayModel } from "./client-
|
|
3
|
-
import { h as logWarn } from "./logging-
|
|
2
|
+
import { C as toOptionalTrimmed, c as resolveGatewayModel } from "./client-gnKpkpqP.js";
|
|
3
|
+
import { h as logWarn } from "./logging-CFHIO4Vs.js";
|
|
4
4
|
import { c as modelProfileSchema, d as parseTurnReasoningLevel, t as DEFAULT_MODEL_PROFILES, u as TURN_REASONING_LEVELS } from "./model-profile-B998sjVd.js";
|
|
5
5
|
import { AwsClient } from "aws4fetch";
|
|
6
6
|
// src/chat/attachments/s3.ts
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { $ as loadTurnCheckpoint,
|
|
2
|
-
import { n as botConfig } from "./config-
|
|
3
|
-
import { C as getSqlExecutor, F as deleteProviderIdentityForSlackUser, I as deleteProviderIdentityForUser, y as getConversationEventStore } from "./viewer-
|
|
4
|
-
import { u as hasRequiredOAuthScope } from "./registry-
|
|
5
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
6
|
-
import { c as deleteMcpAuthSessionsForUserProvider, l as deleteMcpServerSessionId, u as deleteMcpStoredOAuthCredentials } from "./agent-runner-
|
|
7
|
-
import { r as getStateAdapter } from "./adapter-
|
|
8
|
-
import {
|
|
9
|
-
import { m as ensureConversationWake, w as requestConversationWork } from "./store-
|
|
10
|
-
import { n as resolveTurnSessionRouting } from "./turn-session-routing-
|
|
1
|
+
import { $ as loadTurnCheckpoint, Lr as startOAuthFlow, it as getTurnRecord, rt as failTurnRecord } from "./projection-CTvLSwcm.js";
|
|
2
|
+
import { n as botConfig } from "./config-D0GKc9sC.js";
|
|
3
|
+
import { C as getSqlExecutor, F as deleteProviderIdentityForSlackUser, I as deleteProviderIdentityForUser, y as getConversationEventStore } from "./viewer-BFADRGP8.js";
|
|
4
|
+
import { u as hasRequiredOAuthScope } from "./registry-OsyWR4GO.js";
|
|
5
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-DcJ5NHDW.js";
|
|
6
|
+
import { c as deleteMcpAuthSessionsForUserProvider, l as deleteMcpServerSessionId, u as deleteMcpStoredOAuthCredentials } from "./agent-runner-bE7aH7ew.js";
|
|
7
|
+
import { r as getStateAdapter } from "./adapter-dE2BiWP_.js";
|
|
8
|
+
import { l as getVercelConversationWorkQueue } from "./background-compaction-queue-BYuOt3qK.js";
|
|
9
|
+
import { m as ensureConversationWake, w as requestConversationWork } from "./store-Dp3RMEQd.js";
|
|
10
|
+
import { n as resolveTurnSessionRouting } from "./turn-session-routing-CIWhXKeT.js";
|
|
11
11
|
import { randomBytes, randomUUID } from "node:crypto";
|
|
12
12
|
import { z } from "zod";
|
|
13
13
|
// src/chat/task-execution/authorized-turn.ts
|