@sentry/junior 0.308.0 → 0.310.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/{actor-D2iXzvlN.js → actor-BsBdxDXQ.js} +0 -1
- package/dist/{adapter-context-BO432242.js → adapter-context-BhKpjpGD.js} +2 -2
- package/dist/{admin-vSmheo3Z.js → admin-tgZEZAk2.js} +2 -2
- package/dist/{agent-runner-BnOofGFG.js → agent-runner-D9cvNlQl.js} +245 -204
- package/dist/api/schema.d.ts +1 -1
- package/dist/api/schema.js +5 -5
- package/dist/api.d.ts +4 -2
- package/dist/api.js +416 -272
- package/dist/{app-CqYqy541.d.ts → app-B_7Wn0en.d.ts} +4 -6
- package/dist/app.d.ts +1 -1
- package/dist/app.js +74 -193
- package/dist/{background-compaction-queue-BpmDEQf6.js → background-compaction-queue-BGHqkhkY.js} +4 -4
- package/dist/{briefs-Dbh94cRp.js → briefs-DKxkoruh.js} +3 -3
- package/dist/{catalog-runtime-q9AJjuUN.js → catalog-runtime-BxwzbLKY.js} +1 -1
- package/dist/cli/chat.js +16 -16
- package/dist/cli/check.js +10 -10
- package/dist/cli/main.js +3 -3
- package/dist/cli/plugins.js +4 -4
- package/dist/cli/snapshot-create.js +5 -5
- package/dist/cli/upgrade.d.ts +1 -1
- package/dist/cli/upgrade.js +3 -3
- package/dist/{config-Cx8H0MRw.js → config-Dkt2Le2b.js} +51 -92
- package/dist/{continue-in-slack-CtTv1tkn.js → continue-in-slack-BWVwePKD.js} +6 -6
- package/dist/{conversation--f85g4zL.js → conversation-M9KZ5JxF.js} +7 -2
- package/dist/{conversation-feed-BNs9KiqC.js → conversation-feed-Ci6YD1N-.js} +1 -1
- package/dist/{conversation-privacy-CivmFlWP.js → conversation-privacy-C39g8BY4.js} +1 -1
- package/dist/{conversation-turn-C9-Nfnsy.js → conversation-turn-CBlZIH02.js} +20 -21
- package/dist/{credential-sync-CWIORwD9.js → credential-sync-vGnrB0BY.js} +31 -23
- package/dist/{db-C41UgdBj.d.ts → db-B4Hjxr-u.d.ts} +2 -2
- package/dist/{db-CO6Y10eM.js → db-CFZggNoy.js} +20 -10
- package/dist/{executor-Doo-N6Yn.js → executor-BPkZDx5-.js} +12 -4
- package/dist/fan-out-Cod-yEHG.js +10 -0
- package/dist/{history-N7IVbUom.js → history-CYstOMKX.js} +6 -0
- package/dist/{connections-DUylBPiR.js → html-2r2KmLwi.js} +146 -11
- package/dist/{install-Y2s9ZPvk.js → install-C-oE6C_u.js} +2 -2
- package/dist/instrumentation.js +2 -2
- package/dist/{lineage-BcqyhMyp.js → lineage-CsvrEFQe.js} +2 -2
- package/dist/{logging-DnBYBM8z.js → logging-D5gkyvnK.js} +1 -1
- package/dist/{message-fSnXIqvl.js → message-DwvJ-I3w.js} +8 -8
- package/dist/{model-input-DRChpXJ7.js → model-input-MAq2881y.js} +15 -10
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +4 -4
- package/dist/{oauth-callback-server-BUU6zd_T.js → oauth-callback-server-DIF6Li06.js} +2 -2
- package/dist/{oauth-relay-gO_Ynmpb.js → oauth-relay-DPE-wrwO.js} +1 -1
- package/dist/{package-discovery-x4AvVhMj.js → package-discovery-DD9vencX.js} +0 -1
- package/dist/{projection-Bqn6zdVT.js → projection-jZSlEAXG.js} +116 -123
- package/dist/{prompt-DAjjk5fm.js → prompt-CaMyeCpA.js} +25 -14
- package/dist/{registry-tHJLCtKS.js → registry-BBkWFCl8.js} +3 -3
- package/dist/{resolve-z2sKt8xM.js → resolve-B38MkHXE.js} +3 -3
- package/dist/{result-D2wshngt.js → result-BaqSZcJb.js} +12 -13
- package/dist/{runner-BvNPWLAy.js → runner-11h8PrHh.js} +10 -10
- package/dist/{sandbox-egress-signals-CmHD-6vr.js → sandbox-egress-signals-CTcACAtJ.js} +1 -1
- package/dist/{schedule-BG1tEbRF.js → schedule-DWxZ3kja.js} +1 -1
- package/dist/{schema-CRXcj4fj.d.ts → schema-DriSvB40.d.ts} +43 -43
- package/dist/{schema-D4jdesIu.js → schema-obw5jvR4.js} +65 -28
- package/dist/{service-account-B2d1Er_r.js → service-account-Bx93N1n1.js} +3 -3
- package/dist/{service-account-CddxU-yC.js → service-account-Zc5bUcIJ.js} +7 -8
- package/dist/{session-stop-BQ0J0Fph.js → session-stop-BfY4rhJs.js} +179 -199
- package/dist/{skills-Dm2-5nn5.js → skills-C8Npu5zO.js} +99 -57
- package/dist/{slack-conversation-unfurl-CLH0tTLk.js → slack-conversation-unfurl-DlRVA02H.js} +18 -15
- package/dist/{spawn-PwAuSN59.js → spawn-CXr58R0x.js} +6 -6
- package/dist/{state-rXH58smZ.js → state-CGrGVeQC.js} +4 -4
- package/dist/{stop-CcHPEcFE.js → stop-DYzjRf2U.js} +176 -135
- package/dist/{store-7QA00oK6.js → store-D4FQ1Nml.js} +5 -5
- package/dist/{task-queue-DvQZH5rG.js → task-queue-CaZffYaH.js} +7 -4
- package/dist/{task-runner-CyZMcuZy.js → task-runner-Dm7BHbGp.js} +11 -12
- package/dist/{thread-context-C-hLTQST.js → thread-context-Dyj1KWaY.js} +13 -11
- package/dist/{turn-session-routing-Cqjj1B3i.js → turn-session-routing-CD0BRCex.js} +4 -4
- package/dist/{turn-user-message-DbU7MNd9.js → turn-user-message-9IxeEv5v.js} +14 -5
- package/dist/{queue-CbEHUO0l.d.ts → types-fnU7Xs__.d.ts} +3 -1
- package/dist/{users-B-UpCmw9.js → users-CaUAYMb3.js} +1 -1
- package/dist/{validation-BEUlev32.js → validation-DxVNIxA0.js} +1 -1
- package/dist/{version-BE1OyrXV.js → version-Cr7Z71yG.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-CqOkWizK.js → viewer-AHldghAD.js} +7 -5
- package/dist/{warmup-HFgFZFwS.js → warmup-C6LOZ2d2.js} +138 -80
- package/dist/{worker-CCEDWbsY.js → worker-CUBtu1Li.js} +8 -8
- package/migrations/0121_people_list_metric_index.sql +1 -0
- package/migrations/0122_automation_rollout_repair.sql +56 -0
- package/migrations/0123_cache_warming_history_reset.sql +10 -0
- package/migrations/0124_artifact_visibility.sql +9 -0
- package/migrations/0125_artifact_public_sha_index.sql +1 -0
- package/migrations/meta/0121_snapshot.json +5481 -0
- package/migrations/meta/0122_snapshot.json +5481 -0
- package/migrations/meta/0123_snapshot.json +5481 -0
- package/migrations/meta/0124_snapshot.json +5516 -0
- package/migrations/meta/0125_snapshot.json +5516 -0
- package/migrations/meta/_journal.json +35 -0
- package/package.json +7 -7
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
|
|
2
|
-
import { d as contextProvenance, f as instructionActors, n as agentHistoryItemSchema, p as instructionProvenanceFor } from "./history-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { A as juniorConversationEvents, B as juniorUsers, C as juniorConversationEventLexemes, E as juniorConversationBriefs, I as juniorAttachments, L as juniorMessageAttachments, M as juniorConversationAnnotations, N as juniorCodeChanges, P as juniorCodeRepositories, R as juniorConversations, T as juniorConversationEmbeddings, V as juniorDestinations, _ as juniorLocationConfigurations, a as juniorWorkspaces, f as juniorReviewItems, h as juniorAutomations, i as juniorWorkspaceRepos, l as juniorReviewItemAssignees, m as juniorAutomationVersions, n as isPostgresErrorCode, o as juniorPushSubscriptions, p as juniorAutomationRuns, r as juniorSnapshots, u as juniorReviewItemConversations, w as juniorConversationEventEmbeddings, x as juniorConversationParticipants, z as juniorIdentities } from "./executor-
|
|
6
|
-
import { E as withSpan, J as toOptionalString, K as isRecord$3, _ as runBestEffort, a as extractGenAiUsageSummary, b as setSpanAttributes, c as getLogContextAttributes, d as logAudit, h as logWarn, m as logInfo, o as getActiveTraceContext, p as logException, q as toOptionalNumber, t as buildTurnFailureResponse, x as setSpanStatus, y as setSentryUser } from "./logging-
|
|
7
|
-
import { _ as credentialUserSubjectId, a as HOST_MANAGED_CREDENTIAL_PLACEHOLDER, g as credentialSubjectSchema, h as credentialLogContext, m as credentialContextSchema, o as resolveAuthTokenPlaceholder, p as credentialContextForActor, s as resolvePluginCommandEnv, v as CredentialUnavailableError } from "./registry-
|
|
8
|
-
import { D as automationVersionSchema, J as automationSkillNameSchema, L as scheduledAutomationSchema, P as eventAutomationSchema, X as automationTaskDescription, Y as automationTaskColumns, Z as automationTaskSchema, n as isWithinNotificationSchedule, q as isValidTimeZone, r as notificationScheduleSchema, t as DEFAULT_NOTIFICATION_SCHEDULE } from "./schedule-
|
|
9
|
-
import {
|
|
10
|
-
import { c as parseStoredSlackActor, d as parseSlackChannelReferenceId, f as parseSlackTeamId, i as isActorUserId, l as toStoredSlackActor, p as parseSlackUserId, s as parseActorUserId, v as parseSlackMessageTs } from "./actor-
|
|
2
|
+
import { d as contextProvenance, f as instructionActors, n as agentHistoryItemSchema, p as instructionProvenanceFor } from "./history-CYstOMKX.js";
|
|
3
|
+
import { _ as JUNIOR_NATIVE_EVENT_NAMESPACE, c as generateBrief, d as completeText, f as embedTexts, n as briefEntriesFromReportEvents, s as isEventConversationMessage, t as BRIEF_PROMPT, u as completeObject, v as agentsInstructionsUpdatedEvent, x as renderJuniorNativeConversationEvent, y as authenticationLinkedEvent } from "./prompt-CaMyeCpA.js";
|
|
4
|
+
import { Dt as touchConversationDetail, E as isPersonInput, G as readUserTimezone, L as resolveActorIdentityId, P as startLocationThread, Q as createCache, S as createSqlStore, St as hasAgentTurnUsage, Tt as conversationDetailTouch, W as linkedSlackUser, a as getConversationStore, at as acquireActiveLock, bt as agentTurnTotalTokens, c as hasAnnotationKey, ct as claimProviderConversation, d as eventFromRow, dt as conversationCostOf, et as getDefaultRedisStateAdapterFor, it as MUTATION_LOCK_TTL_MS, jt as sameDestination, kt as parseDestination, l as treeHasAnnotationKey, m as withConversationEventLock, mt as usdToMicroUsd, nt as getStateValues, o as getDb, ot as fenceLock, pt as microUsdToUsd, q as saveUserTimezone, r as getConversationEventStore, rt as setStateValues, s as getSqlExecutor, st as withLock, tt as getStateAdapter, u as createSqlConversationEventStore, vt as addAgentTurnUsage, yt as agentTurnCostUsd } from "./db-CFZggNoy.js";
|
|
5
|
+
import { A as juniorConversationEvents, B as juniorUsers, C as juniorConversationEventLexemes, E as juniorConversationBriefs, I as juniorAttachments, L as juniorMessageAttachments, M as juniorConversationAnnotations, N as juniorCodeChanges, P as juniorCodeRepositories, R as juniorConversations, T as juniorConversationEmbeddings, V as juniorDestinations, _ as juniorLocationConfigurations, a as juniorWorkspaces, f as juniorReviewItems, h as juniorAutomations, i as juniorWorkspaceRepos, l as juniorReviewItemAssignees, m as juniorAutomationVersions, n as isPostgresErrorCode, o as juniorPushSubscriptions, p as juniorAutomationRuns, r as juniorSnapshots, u as juniorReviewItemConversations, w as juniorConversationEventEmbeddings, x as juniorConversationParticipants, z as juniorIdentities } from "./executor-BPkZDx5-.js";
|
|
6
|
+
import { E as withSpan, J as toOptionalString, K as isRecord$3, _ as runBestEffort, a as extractGenAiUsageSummary, b as setSpanAttributes, c as getLogContextAttributes, d as logAudit, h as logWarn, m as logInfo, o as getActiveTraceContext, p as logException, q as toOptionalNumber, t as buildTurnFailureResponse, x as setSpanStatus, y as setSentryUser } from "./logging-D5gkyvnK.js";
|
|
7
|
+
import { _ as credentialUserSubjectId, a as HOST_MANAGED_CREDENTIAL_PLACEHOLDER, g as credentialSubjectSchema, h as credentialLogContext, m as credentialContextSchema, o as resolveAuthTokenPlaceholder, p as credentialContextForActor, s as resolvePluginCommandEnv, v as CredentialUnavailableError } from "./registry-BBkWFCl8.js";
|
|
8
|
+
import { D as automationVersionSchema, J as automationSkillNameSchema, L as scheduledAutomationSchema, P as eventAutomationSchema, X as automationTaskDescription, Y as automationTaskColumns, Z as automationTaskSchema, n as isWithinNotificationSchedule, q as isValidTimeZone, r as notificationScheduleSchema, t as DEFAULT_NOTIFICATION_SCHEDULE } from "./schedule-DWxZ3kja.js";
|
|
9
|
+
import { C as completeObject$1, G as readParentAgentTask, H as THREAD_CONTEXT_TAGS, O as rerankTexts, P as estimateTextTokens, S as completeDecision, T as embedTexts$1, U as authorAttrs, V as unwrapCurrentInstruction, W as isRuntimeInputText, at as bufferBody, b as GEN_AI_PROVIDER_NAME, i as getChatConfig, k as resolveGatewayModel, n as botConfig, o as getSlackBotToken, q as renderThreadContext, st as toOptionalTrimmed, y as normalizeSlackEmojiName, z as hasCurrentInstruction } from "./config-Dkt2Le2b.js";
|
|
10
|
+
import { c as parseStoredSlackActor, d as parseSlackChannelReferenceId, f as parseSlackTeamId, i as isActorUserId, l as toStoredSlackActor, p as parseSlackUserId, s as parseActorUserId, v as parseSlackMessageTs } from "./actor-BsBdxDXQ.js";
|
|
11
11
|
import { a as getClient$1, h as startSpan, n as captureMessage, r as continueTrace } from "./sentry-CPbZjomA.js";
|
|
12
|
-
import { i as readActorIdentity, l as resolveViewerUser, n as findUserByEmailFromSql, o as readIdentityById, p as parseAvatarUrl, s as readIdentityByIdFromSql } from "./viewer-
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
12
|
+
import { i as readActorIdentity, l as resolveViewerUser, n as findUserByEmailFromSql, o as readIdentityById, p as parseAvatarUrl, s as readIdentityByIdFromSql } from "./viewer-AHldghAD.js";
|
|
13
|
+
import { t as mapBounded } from "./fan-out-Cod-yEHG.js";
|
|
14
|
+
import { F as briefResourceLabel, I as conversationBriefSchema, J as readMessageCardRefs, K as messageCardRef, L as parseBriefInput, R as parseStoredBrief, W as reviewItemChangeRecordSchema, _ as conversationReportMessageEventSchema, g as conversationReportEventSchema, tt as readMessageAttachments } from "./conversation-M9KZ5JxF.js";
|
|
15
|
+
import { d as readJuniorSecret, m as readWebPushPrivateKey, r as pluginTaskId } from "./task-queue-CaZffYaH.js";
|
|
16
|
+
import { t as canExposeConversationPayload } from "./conversation-privacy-C39g8BY4.js";
|
|
17
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-BxwzbLKY.js";
|
|
17
18
|
import { n as redactSandboxEgressProxyPath, t as SANDBOX_EGRESS_PROXY_PATH } from "./proxy-path-BHYoKZdq.js";
|
|
18
|
-
import { n as readEncryptedState, r as findLegacyWebActorUserId, t as createEncryptedState } from "./state-
|
|
19
|
-
import pLimit from "p-limit";
|
|
19
|
+
import { n as readEncryptedState, r as findLegacyWebActorUserId, t as createEncryptedState } from "./state-CGrGVeQC.js";
|
|
20
20
|
import * as z from "zod";
|
|
21
|
+
import pLimit from "p-limit";
|
|
21
22
|
import path from "node:path";
|
|
22
23
|
import { isDeepStrictEqual } from "node:util";
|
|
23
24
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
24
25
|
import { createHash, createHmac, createPrivateKey, createPublicKey, generateKeyPairSync, randomBytes, randomUUID, sign, timingSafeEqual } from "node:crypto";
|
|
26
|
+
import { EgressAuthRequired, EgressPolicyDenied, PluginToolInputError, actorSchema, agentEventMatchSchema, anyResourceMatchFields, codeChangeInputSchema, conversationAnnotationInputSchema, defineConversationEvent, describeEventTrigger, destinationSchema, destinationVisibilitySchema, escapeTagTextAndQuotes, eventDataSchema, eventInputSchema, eventMatchSchema, eventMatches, eventTriggerChoices, eventTriggerProblems, eventTypeSchema, indentTagLines, isPluginModelCostEventName, isSlackDestination, missingToolAnnotationKeys, normalizeEventIdentifier, normalizeEventMatch, objectAnnotationSchema, objectIconPath, objectLinkFilterSchema, objectTypeSchema, openingTag, pluginAuditAttributesSchema, pluginAuthorizationSchema, pluginCredentialHeaderTransformSchema, pluginCredentialResultSchema, pluginEventsSchema, pluginGrantSchema, pluginModelCostEventNames, pluginProviderAccountSchema, pluginStoredTokensSchema, pluginToolReplySchema, promptContextSchema, promptMessageSchema, renderInlineTag, renderTag, replyAttributionSchema, sourceSchema, stableEventMatchKey, stripTags, taskOutcomeSchema } from "@sentry/junior-plugin-api";
|
|
25
27
|
import { and, arrayContains, asc, count, desc, eq, exists, getTableColumns, gt, gte, ilike, inArray, isNotNull, isNull, lt, lte, max, ne, not, notExists, notLike, or, sql } from "drizzle-orm";
|
|
26
|
-
import { EgressAuthRequired, EgressPolicyDenied, PluginToolInputError, actorSchema, agentEventMatchSchema, anyResourceMatchFields, codeChangeInputSchema, conversationAnnotationInputSchema, defineConversationEvent, describeEventTrigger, destinationSchema, destinationVisibilitySchema, eventDataSchema, eventInputSchema, eventMatchSchema, eventMatches, eventTriggerChoices, eventTriggerProblems, eventTypeSchema, isPluginModelCostEventName, isSlackDestination, missingToolAnnotationKeys, normalizeEventIdentifier, normalizeEventMatch, objectAnnotationSchema, objectIconPath, objectLinkFilterSchema, objectTypeSchema, pluginAuditAttributesSchema, pluginAuthorizationSchema, pluginCredentialHeaderTransformSchema, pluginCredentialResultSchema, pluginEventsSchema, pluginGrantSchema, pluginModelCostEventNames, pluginProviderAccountSchema, pluginStoredTokensSchema, pluginToolReplySchema, promptContextSchema, promptMessageSchema, replyAttributionSchema, sourceSchema, stableEventMatchKey, taskOutcomeSchema } from "@sentry/junior-plugin-api";
|
|
27
28
|
import { alias } from "drizzle-orm/pg-core";
|
|
28
29
|
import { embedText, guardedCosineDistance, refreshEmbeddings } from "@sentry/junior-plugin-api/embeddings";
|
|
29
30
|
import fs from "node:fs/promises";
|
|
@@ -62,10 +63,6 @@ function getConfigDefaults() {
|
|
|
62
63
|
// src/chat/pi/messages.ts
|
|
63
64
|
/** Permissive schema for durable Pi SDK messages whose content shape may evolve. */
|
|
64
65
|
const piMessageSchema = z.object({ role: z.string() }).passthrough().transform((value) => value);
|
|
65
|
-
z.object({
|
|
66
|
-
content: z.array(z.unknown()),
|
|
67
|
-
role: z.string().min(1)
|
|
68
|
-
}).passthrough().transform((value) => value);
|
|
69
66
|
// src/chat/pi/conversation-events.ts
|
|
70
67
|
function authorizationObservationMessage(data, createdAtMs) {
|
|
71
68
|
const label = data.kind === "mcp" ? "MCP authorization" : "Authorization";
|
|
@@ -3725,8 +3722,7 @@ async function lookupSlackUserNames(teamId, userIds) {
|
|
|
3725
3722
|
if (parsed.success) names.set(userId, parsed.data);
|
|
3726
3723
|
else missing.push(userId);
|
|
3727
3724
|
}
|
|
3728
|
-
const
|
|
3729
|
-
const profiles = await Promise.all(missing.map((userId) => limit(() => lookupSlackUser(teamId, userId))));
|
|
3725
|
+
const profiles = await mapBounded(missing, (userId) => lookupSlackUser(teamId, userId), USER_NAMES_LOOKUP_CONCURRENCY);
|
|
3730
3726
|
const found = [];
|
|
3731
3727
|
for (const [index, userId] of missing.entries()) {
|
|
3732
3728
|
const profile = profiles[index];
|
|
@@ -4722,8 +4718,7 @@ async function readLiveAttachment(args) {
|
|
|
4722
4718
|
}
|
|
4723
4719
|
/** Persist many conversation-owned files. */
|
|
4724
4720
|
async function storeAttachments(args) {
|
|
4725
|
-
|
|
4726
|
-
return await Promise.all(args.files.map((file) => limit(() => storeAttachment({
|
|
4721
|
+
return await mapBounded(args.files, (file) => storeAttachment({
|
|
4727
4722
|
conversationId: args.conversationId,
|
|
4728
4723
|
db: args.db,
|
|
4729
4724
|
file: {
|
|
@@ -4733,7 +4728,7 @@ async function storeAttachments(args) {
|
|
|
4733
4728
|
},
|
|
4734
4729
|
...args.nowMs !== void 0 ? { nowMs: args.nowMs } : void 0,
|
|
4735
4730
|
storage: args.storage
|
|
4736
|
-
}))
|
|
4731
|
+
}));
|
|
4737
4732
|
}
|
|
4738
4733
|
/** Mark attachments unavailable when their conversation content is purged. */
|
|
4739
4734
|
async function requestAttachmentDeletion(db, conversationIds, nowMs) {
|
|
@@ -5763,11 +5758,13 @@ async function buildBriefsOperationalReport(args) {
|
|
|
5763
5758
|
const newestDay = startOfUtcDay(args.nowMs);
|
|
5764
5759
|
const windowStart = /* @__PURE__ */ new Date(newestDay.getTime() - 29 * DAY_MS$2);
|
|
5765
5760
|
const windowEnd = new Date(newestDay.getTime() + DAY_MS$2);
|
|
5766
|
-
const
|
|
5761
|
+
const inWindow = and(gte(juniorConversationBriefs.createdAt, windowStart), lt(juniorConversationBriefs.createdAt, windowEnd));
|
|
5762
|
+
const [[counts], briefDays] = await Promise.all([args.db.select({
|
|
5767
5763
|
conversations: sql`count(distinct ${juniorConversationBriefs.conversationId})`.mapWith(Number),
|
|
5764
|
+
recent: sql`count(*) filter (where ${inWindow})`.mapWith(Number),
|
|
5768
5765
|
stored: sql`count(*)`.mapWith(Number)
|
|
5769
|
-
}).from(juniorConversationBriefs), args.
|
|
5770
|
-
const recentDays =
|
|
5766
|
+
}).from(juniorConversationBriefs), args.briefDays]);
|
|
5767
|
+
const recentDays = briefDays.filter((day) => {
|
|
5771
5768
|
const dayStart = Date.parse(`${day.date}T00:00:00.000Z`);
|
|
5772
5769
|
return dayStart >= windowStart.getTime() && dayStart < windowEnd.getTime();
|
|
5773
5770
|
});
|
|
@@ -5788,7 +5785,7 @@ async function buildBriefsOperationalReport(args) {
|
|
|
5788
5785
|
},
|
|
5789
5786
|
{
|
|
5790
5787
|
label: "briefs · 30d",
|
|
5791
|
-
value: formatCount(
|
|
5788
|
+
value: formatCount(counts?.recent ?? 0)
|
|
5792
5789
|
},
|
|
5793
5790
|
{
|
|
5794
5791
|
label: "cost · 30d · retained",
|
|
@@ -5800,7 +5797,7 @@ async function buildBriefsOperationalReport(args) {
|
|
|
5800
5797
|
}
|
|
5801
5798
|
],
|
|
5802
5799
|
widgets: [{
|
|
5803
|
-
categories:
|
|
5800
|
+
categories: briefDays.map((day) => ({
|
|
5804
5801
|
id: day.date,
|
|
5805
5802
|
label: day.date,
|
|
5806
5803
|
values: {
|
|
@@ -6055,7 +6052,7 @@ const briefsTaskRegistration = {
|
|
|
6055
6052
|
conversationEvents: [briefUpdatedEventV1, briefUpdatedEvent],
|
|
6056
6053
|
hooks: { async operationalReport(context) {
|
|
6057
6054
|
return await buildBriefsOperationalReport({
|
|
6058
|
-
briefDays:
|
|
6055
|
+
briefDays: context.eventStats.costsByDay({
|
|
6059
6056
|
days: 90,
|
|
6060
6057
|
eventName: "brief_updated"
|
|
6061
6058
|
}),
|
|
@@ -7201,11 +7198,10 @@ async function pruneNetworks() {
|
|
|
7201
7198
|
const containers = await listSandboxResources("containers");
|
|
7202
7199
|
const used = new Set(containers.map((container) => container.Labels[DOCKER_SANDBOX_LABEL]));
|
|
7203
7200
|
const networks = await listSandboxResources("networks");
|
|
7204
|
-
|
|
7205
|
-
await Promise.all(networks.filter((network) => !used.has(network.Labels[DOCKER_SANDBOX_LABEL])).map((network) => limit(async () => {
|
|
7201
|
+
await mapBounded(networks.filter((network) => !used.has(network.Labels[DOCKER_SANDBOX_LABEL])), async (network) => {
|
|
7206
7202
|
await forceRemove(egressRelayName(network.Name));
|
|
7207
7203
|
await removeNetwork(network.Name);
|
|
7208
|
-
})
|
|
7204
|
+
});
|
|
7209
7205
|
}
|
|
7210
7206
|
async function createNetwork(name, signal) {
|
|
7211
7207
|
await pruneNetworks();
|
|
@@ -9268,7 +9264,6 @@ async function deleteSnapshotTag(name) {
|
|
|
9268
9264
|
*/
|
|
9269
9265
|
async function deleteWorkspaceSnapshotBuilders$1(names) {
|
|
9270
9266
|
const failures = [];
|
|
9271
|
-
const limit = pLimit(8);
|
|
9272
9267
|
const removeAll = async (name) => {
|
|
9273
9268
|
for (const remove of [removeContainer, deleteSnapshotTag]) try {
|
|
9274
9269
|
await remove(name);
|
|
@@ -9276,7 +9271,7 @@ async function deleteWorkspaceSnapshotBuilders$1(names) {
|
|
|
9276
9271
|
failures.push(error);
|
|
9277
9272
|
}
|
|
9278
9273
|
};
|
|
9279
|
-
await
|
|
9274
|
+
await mapBounded([...new Set(names)], (name) => removeAll(name));
|
|
9280
9275
|
if (failures.length > 0) throw failures[0];
|
|
9281
9276
|
}
|
|
9282
9277
|
const DOCKER_SNAPSHOT_PACKAGES = /* @__PURE__ */ new Set([
|
|
@@ -9987,8 +9982,7 @@ async function getWorkspaceSnapshotBuilder(name, signal) {
|
|
|
9987
9982
|
async function deleteWorkspaceSnapshotBuilders(names) {
|
|
9988
9983
|
let hasError = false;
|
|
9989
9984
|
let firstError;
|
|
9990
|
-
|
|
9991
|
-
await Promise.all([...new Set(names)].map((name) => limit(async () => {
|
|
9985
|
+
await mapBounded([...new Set(names)], async (name) => {
|
|
9992
9986
|
try {
|
|
9993
9987
|
await (await Sandbox.get({
|
|
9994
9988
|
name,
|
|
@@ -10001,7 +9995,7 @@ async function deleteWorkspaceSnapshotBuilders(names) {
|
|
|
10001
9995
|
hasError = true;
|
|
10002
9996
|
}
|
|
10003
9997
|
}
|
|
10004
|
-
})
|
|
9998
|
+
});
|
|
10005
9999
|
if (hasError) throw firstError;
|
|
10006
10000
|
}
|
|
10007
10001
|
/** Vercel Sandbox implementation of the sandbox provider contract. */
|
|
@@ -10606,7 +10600,7 @@ async function deleteWorkspace(id) {
|
|
|
10606
10600
|
// src/chat/plugins/after-tool-hooks.ts
|
|
10607
10601
|
/** Render a nudge as the marked text the agent reads. */
|
|
10608
10602
|
function renderToolResultNudge(nudge) {
|
|
10609
|
-
return
|
|
10603
|
+
return renderInlineTag("plugin-note", escapeTagTextAndQuotes(nudge.message), { plugin: nudge.pluginName });
|
|
10610
10604
|
}
|
|
10611
10605
|
async function activeWorkspace(sandbox) {
|
|
10612
10606
|
const id = sandbox.workspaceId();
|
|
@@ -11343,16 +11337,20 @@ async function collectEventMatchKeys(input) {
|
|
|
11343
11337
|
if (eventTypes.size === 0) return [];
|
|
11344
11338
|
const keys = /* @__PURE__ */ new Set();
|
|
11345
11339
|
const identifiers = new Set(input.identifiers.map((value) => value.trim()).filter(Boolean));
|
|
11346
|
-
|
|
11347
|
-
const
|
|
11348
|
-
|
|
11349
|
-
|
|
11350
|
-
|
|
11351
|
-
|
|
11352
|
-
|
|
11353
|
-
|
|
11354
|
-
|
|
11355
|
-
|
|
11340
|
+
const recordsByIdentifier = await mapBounded(identifiers, async (identifier) => {
|
|
11341
|
+
const ids = await readSubscriptionIdIndex(state, resourceIndexKey(input.namespace, identifier));
|
|
11342
|
+
return {
|
|
11343
|
+
identifier,
|
|
11344
|
+
records: await readSubscriptions(state, ids)
|
|
11345
|
+
};
|
|
11346
|
+
});
|
|
11347
|
+
for (const { identifier, records } of recordsByIdentifier) for (const record of records) {
|
|
11348
|
+
if (!record) continue;
|
|
11349
|
+
if (record.namespace !== input.namespace) continue;
|
|
11350
|
+
if (record.identifier !== identifier) continue;
|
|
11351
|
+
if (!activeAt(record, nowMs)) continue;
|
|
11352
|
+
if (!record.events.some((eventType) => eventTypes.has(eventType))) continue;
|
|
11353
|
+
for (const key of Object.keys(record.match ?? {})) keys.add(key);
|
|
11356
11354
|
}
|
|
11357
11355
|
return [...keys].sort();
|
|
11358
11356
|
}
|
|
@@ -11559,26 +11557,26 @@ async function resolveAssignee(db, value, tenant, findMentionedUserId) {
|
|
|
11559
11557
|
/** Resolve the assignees of a Review item. One is required. */
|
|
11560
11558
|
async function resolveAssignees(db, values, tenant, findMentionedUserId) {
|
|
11561
11559
|
if (values.length === 0) throw new ToolInputError("A review item needs at least one assignee.");
|
|
11562
|
-
const resolved = await
|
|
11560
|
+
const resolved = await mapBounded(values, (value) => resolveAssignee(db, value, tenant, findMentionedUserId));
|
|
11563
11561
|
return {
|
|
11564
11562
|
everyone: resolved.some((assignee) => "everyone" in assignee),
|
|
11565
11563
|
userIds: [...new Set(resolved.flatMap((assignee) => "userId" in assignee ? [assignee.userId] : []))]
|
|
11566
11564
|
};
|
|
11567
11565
|
}
|
|
11568
|
-
async function participantUserIds(db,
|
|
11569
|
-
return (await db.select({ userId: juniorConversationParticipants.userId }).from(juniorConversationParticipants).innerJoin(juniorConversations, eq(juniorConversationParticipants.rootConversationId, sql`coalesce(${juniorConversations.rootConversationId}, ${juniorConversations.conversationId})`)).where(and(
|
|
11566
|
+
async function participantUserIds(db, conversationIds, condition) {
|
|
11567
|
+
return (await db.select({ userId: juniorConversationParticipants.userId }).from(juniorConversationParticipants).innerJoin(juniorConversations, eq(juniorConversationParticipants.rootConversationId, sql`coalesce(${juniorConversations.rootConversationId}, ${juniorConversations.conversationId})`)).where(and(inArray(juniorConversations.conversationId, [...conversationIds]), condition))).map((row) => row.userId);
|
|
11570
11568
|
}
|
|
11571
|
-
/** Return which of the Users are Participants of
|
|
11572
|
-
async function conversationParticipantUserIds(db,
|
|
11573
|
-
if (userIds.length === 0) return /* @__PURE__ */ new Set();
|
|
11574
|
-
return new Set(await participantUserIds(db,
|
|
11569
|
+
/** Return which of the Users are Participants of any of the Conversations. */
|
|
11570
|
+
async function conversationParticipantUserIds(db, conversationIds, userIds) {
|
|
11571
|
+
if (conversationIds.length === 0 || userIds.length === 0) return /* @__PURE__ */ new Set();
|
|
11572
|
+
return new Set(await participantUserIds(db, conversationIds, inArray(juniorConversationParticipants.userId, [...userIds])));
|
|
11575
11573
|
}
|
|
11576
11574
|
/**
|
|
11577
11575
|
* Return the active Participants of a Conversation: the people who have not
|
|
11578
11576
|
* unsubscribed from it.
|
|
11579
11577
|
*/
|
|
11580
11578
|
async function activeParticipantUserIds(db, conversationId) {
|
|
11581
|
-
return await participantUserIds(db, conversationId, isNull(juniorConversationParticipants.unsubscribedAt));
|
|
11579
|
+
return await participantUserIds(db, [conversationId], isNull(juniorConversationParticipants.unsubscribedAt));
|
|
11582
11580
|
}
|
|
11583
11581
|
/** Return the User who created an Automation, if Junior knows them. */
|
|
11584
11582
|
async function automationCreatorUserId(db, automationId) {
|
|
@@ -11749,9 +11747,7 @@ async function requireReviewItemAssignees(args) {
|
|
|
11749
11747
|
if (args.assignees.everyone) throw new ToolInputError("A private item cannot be assigned to Everyone. Assign Users instead.");
|
|
11750
11748
|
const creatorId = args.automationId ? await automationCreatorUserId(getDb(), args.automationId) : void 0;
|
|
11751
11749
|
const others = args.assignees.userIds.filter((id) => id !== args.scope.user?.id && id !== creatorId);
|
|
11752
|
-
const
|
|
11753
|
-
const participants = await Promise.all([...new Set(args.conversationIds)].map((conversationId) => limit(() => conversationParticipantUserIds(getDb(), conversationId, others))));
|
|
11754
|
-
const inConversation = new Set(participants.flatMap((ids) => [...ids]));
|
|
11750
|
+
const inConversation = await conversationParticipantUserIds(getDb(), args.conversationIds, others);
|
|
11755
11751
|
if (others.some((id) => !inConversation.has(id))) throw new ToolInputError("A private item can be assigned only to people in its Conversation.");
|
|
11756
11752
|
}
|
|
11757
11753
|
/**
|
|
@@ -12043,11 +12039,18 @@ function reviewItemsNeedingUserVersionQuery(db, userId) {
|
|
|
12043
12039
|
* `created_at` and `id`, both descending. `afterWaiting` pages through it.
|
|
12044
12040
|
*/
|
|
12045
12041
|
async function searchReviewItems(db, reader, filters) {
|
|
12046
|
-
|
|
12042
|
+
const rows = await db.select({
|
|
12043
|
+
item: juniorReviewItems,
|
|
12044
|
+
addedByRootConversationId: juniorConversations.rootConversationId
|
|
12045
|
+
}).from(juniorReviewItems).leftJoin(juniorConversations, eq(juniorConversations.conversationId, juniorReviewItems.addedByConversationId)).where(and(...searchConditions(reader, filters))).orderBy(desc(eq(juniorReviewItems.status, "open")), ...typeof filters.order === "object" ? [
|
|
12047
12046
|
desc(reviewItemNeedsUser(filters.order.needsUserId)),
|
|
12048
12047
|
desc(juniorReviewItems.createdAt),
|
|
12049
12048
|
desc(juniorReviewItems.id)
|
|
12050
|
-
] : filters.order === "oldest" ? [asc(juniorReviewItems.createdAt), asc(juniorReviewItems.id)] : filters.order === "closed" ? [desc(juniorReviewItems.closedAt), desc(juniorReviewItems.id)] : [desc(juniorReviewItems.updatedAt), desc(juniorReviewItems.id)]).limit(filters.limit)
|
|
12049
|
+
] : filters.order === "oldest" ? [asc(juniorReviewItems.createdAt), asc(juniorReviewItems.id)] : filters.order === "closed" ? [desc(juniorReviewItems.closedAt), desc(juniorReviewItems.id)] : [desc(juniorReviewItems.updatedAt), desc(juniorReviewItems.id)]).limit(filters.limit);
|
|
12050
|
+
return (await hydrate(db, rows.map((row) => row.item))).map((item, index) => ({
|
|
12051
|
+
...item,
|
|
12052
|
+
addedByRootConversationId: rows[index].addedByRootConversationId
|
|
12053
|
+
}));
|
|
12051
12054
|
}
|
|
12052
12055
|
/**
|
|
12053
12056
|
* List the root Conversations that wait on a User: each root or one of its
|
|
@@ -12089,12 +12092,11 @@ async function listWaitingConversations(db, userId) {
|
|
|
12089
12092
|
* User and a User who is not in the Conversation.
|
|
12090
12093
|
*/
|
|
12091
12094
|
async function assigneeUserIds(db, identityIds, conversationId) {
|
|
12092
|
-
|
|
12093
|
-
return (await Promise.all([...new Set(identityIds)].map((identityId) => limit(async () => {
|
|
12095
|
+
return (await mapBounded([...new Set(identityIds)], async (identityId) => {
|
|
12094
12096
|
const user = (await readIdentityByIdFromSql(db, identityId))?.user;
|
|
12095
12097
|
if (!user) return [];
|
|
12096
12098
|
return (await readConversationAccessFromSql(db, [conversationId], user)).get(conversationId)?.isParticipant ? [user.id] : [];
|
|
12097
|
-
}))
|
|
12099
|
+
})).flat();
|
|
12098
12100
|
}
|
|
12099
12101
|
/**
|
|
12100
12102
|
* Connect a plugin to the review desk for one Conversation. Dedupe keys are
|
|
@@ -12423,7 +12425,7 @@ async function sendToDevice(subscription, body, config) {
|
|
|
12423
12425
|
async function sendPushNotificationToUser(args) {
|
|
12424
12426
|
const subscriptions = await listPushSubscriptions(args.db, args.userId);
|
|
12425
12427
|
const body = JSON.stringify(args.payload);
|
|
12426
|
-
const outcomes = await
|
|
12428
|
+
const outcomes = await mapBounded(subscriptions, (subscription) => sendToDevice(subscription, body, args.config));
|
|
12427
12429
|
const gone = subscriptions.filter((_, index) => outcomes[index] === "gone").map((subscription) => subscription.id);
|
|
12428
12430
|
await deletePushSubscriptionsById(args.db, gone);
|
|
12429
12431
|
const result = {
|
|
@@ -12576,7 +12578,7 @@ const REQUEST_CONTEXT_SECTION_TAG = {
|
|
|
12576
12578
|
turnInput: "turn-input"
|
|
12577
12579
|
};
|
|
12578
12580
|
/** Starts of user text parts that hold runtime context, not a person's words. */
|
|
12579
|
-
const RUNTIME_CONTEXT_TEXT_STARTS = [
|
|
12581
|
+
const RUNTIME_CONTEXT_TEXT_STARTS = [openingTag(TURN_CONTEXT_TAG), "# AGENTS.md instructions"];
|
|
12580
12582
|
function isRecord$1(value) {
|
|
12581
12583
|
return typeof value === "object" && value !== null;
|
|
12582
12584
|
}
|
|
@@ -12604,7 +12606,7 @@ function isRuntimeTurnContextPart(part) {
|
|
|
12604
12606
|
function hasTurnInput(message) {
|
|
12605
12607
|
return userMessageContent(message)?.some((part) => {
|
|
12606
12608
|
const text = textPartValue(part);
|
|
12607
|
-
return text !== void 0 && (text
|
|
12609
|
+
return text !== void 0 && (hasCurrentInstruction(text) || isRuntimeInputText(text));
|
|
12608
12610
|
}) ?? false;
|
|
12609
12611
|
}
|
|
12610
12612
|
/** Return whether the message is a Turn's context, paired with the instruction after it. */
|
|
@@ -12613,13 +12615,6 @@ function isStandaloneRuntimeContextMessage(messages, index) {
|
|
|
12613
12615
|
const next = messages[index + 1];
|
|
12614
12616
|
return Boolean(message && next && userMessageContent(message) && userMessageContent(next) && message.timestamp === next.timestamp && !hasTurnInput(message) && hasTurnInput(next));
|
|
12615
12617
|
}
|
|
12616
|
-
const EMBEDDED_THREAD_CONTEXT_PATTERN = new RegExp(`<(${[
|
|
12617
|
-
"thread-context",
|
|
12618
|
-
"recent-thread-messages",
|
|
12619
|
-
"thread-compactions",
|
|
12620
|
-
"thread-transcript",
|
|
12621
|
-
"thread-background"
|
|
12622
|
-
].join("|")})(?:\\s[^>]*)?>[\\s\\S]*</\\1>`, "g");
|
|
12623
12618
|
/** Type guard for Pi SDK assistant messages. */
|
|
12624
12619
|
function isAssistantMessage(value) {
|
|
12625
12620
|
return isRecord$1(value) && value["role"] === "assistant";
|
|
@@ -12696,7 +12691,7 @@ function retainRuntimeTurnContext(messages) {
|
|
|
12696
12691
|
* a live run.
|
|
12697
12692
|
*/
|
|
12698
12693
|
function instructionTextForProjection(text) {
|
|
12699
|
-
const withoutContext = text
|
|
12694
|
+
const withoutContext = stripTags(text, THREAD_CONTEXT_TAGS).trim();
|
|
12700
12695
|
return unwrapCurrentInstruction(withoutContext) ?? withoutContext;
|
|
12701
12696
|
}
|
|
12702
12697
|
/**
|
|
@@ -12710,7 +12705,7 @@ function getUserMessageInstructionText(message) {
|
|
|
12710
12705
|
if (message.role !== "user") return "";
|
|
12711
12706
|
const texts = typeof message.content === "string" ? [message.content] : message.content.flatMap((part) => textPartValue(part) ?? []);
|
|
12712
12707
|
const inputs = texts.flatMap((text) => {
|
|
12713
|
-
const withoutContext = text
|
|
12708
|
+
const withoutContext = stripTags(text, THREAD_CONTEXT_TAGS).trim();
|
|
12714
12709
|
if (isRuntimeInputText(withoutContext)) return [readParentAgentTask(withoutContext) ?? withoutContext];
|
|
12715
12710
|
const instruction = unwrapCurrentInstruction(withoutContext);
|
|
12716
12711
|
return instruction === void 0 ? [] : [instruction.trim()];
|
|
@@ -17939,8 +17934,6 @@ function getConversationContextCompactionTriggerTokens() {
|
|
|
17939
17934
|
const CONTEXT_MIN_LIVE_MESSAGES = 12;
|
|
17940
17935
|
const CONTEXT_MAX_MESSAGE_CHARS = 3200;
|
|
17941
17936
|
const THREAD_CONTEXT_MAX_CHARS = 6e4;
|
|
17942
|
-
const THREAD_CONTEXT_OPEN = "<thread-context authority=\"evidence-only\">";
|
|
17943
|
-
const THREAD_CONTEXT_CLOSE = "</thread-context>";
|
|
17944
17937
|
const THREAD_CONTEXT_OMITTED_NOTE = "Older Messages of this thread are not shown. Find them with a searchConversationEvents query, then read them with readConversationEvent.";
|
|
17945
17938
|
const SLACK_USER_ID_DISPLAY_PATTERN = /^[UW][A-Z0-9]{5,}$/;
|
|
17946
17939
|
/** Normalize message boundaries without changing transcript formatting. */
|
|
@@ -17953,13 +17946,13 @@ function buildImageContextSuffix(message, conversation) {
|
|
|
17953
17946
|
if (!byFileId || imageFileIds.length === 0) return "";
|
|
17954
17947
|
const summaries = imageFileIds.map((fileId) => byFileId[fileId]?.summary?.trim()).filter((summary) => Boolean(summary));
|
|
17955
17948
|
if (summaries.length === 0) return "";
|
|
17956
|
-
return ` [image context: ${
|
|
17949
|
+
return ` [image context: ${escapeTagTextAndQuotes(summaries.join(" | "))}]`;
|
|
17957
17950
|
}
|
|
17958
17951
|
function renderConversationMessageLine(message, conversation) {
|
|
17959
|
-
const displayName =
|
|
17960
|
-
const text =
|
|
17952
|
+
const displayName = escapeTagTextAndQuotes(conversationAuthorDisplayName(message));
|
|
17953
|
+
const text = escapeTagTextAndQuotes(message.text.replace(/\s+/g, " ").slice(0, CONTEXT_MAX_MESSAGE_CHARS));
|
|
17961
17954
|
const markers = [];
|
|
17962
|
-
if (message.meta?.replied === false) markers.push(
|
|
17955
|
+
if (message.meta?.replied === false) markers.push(escapeTagTextAndQuotes(`assistant skipped: ${message.meta?.skippedReason ?? "no-reply route"}`));
|
|
17963
17956
|
if (message.meta?.explicitMention) markers.push("explicit mention");
|
|
17964
17957
|
const markerSuffix = markers.length > 0 ? ` (${markers.join("; ")})` : "";
|
|
17965
17958
|
const imageContext = buildImageContextSuffix(message, conversation);
|
|
@@ -18045,20 +18038,16 @@ function isTakeOrDismissOnly(message) {
|
|
|
18045
18038
|
return Boolean(changes?.length && changes.every((change) => change.kind === "taken" || change.kind === "dismissed"));
|
|
18046
18039
|
}
|
|
18047
18040
|
function renderThreadContextMessage(message, conversation, index) {
|
|
18048
|
-
return
|
|
18049
|
-
|
|
18050
|
-
|
|
18051
|
-
|
|
18052
|
-
|
|
18053
|
-
|
|
18054
|
-
|
|
18055
|
-
|
|
18056
|
-
|
|
18057
|
-
|
|
18058
|
-
})}`,
|
|
18059
|
-
renderConversationMessageLine(message, conversation),
|
|
18060
|
-
" </message>"
|
|
18061
|
-
].join("\n");
|
|
18041
|
+
return indentTagLines(renderTag("message", {
|
|
18042
|
+
index,
|
|
18043
|
+
ts: new Date(message.createdAtMs).toISOString(),
|
|
18044
|
+
role: message.role,
|
|
18045
|
+
...authorAttrs({
|
|
18046
|
+
authorId: message.author?.userId,
|
|
18047
|
+
authorName: conversationAuthorDisplayName(message)
|
|
18048
|
+
}),
|
|
18049
|
+
slack_ts: message.meta?.slackTs
|
|
18050
|
+
}, [renderConversationMessageLine(message, conversation)]), " ");
|
|
18062
18051
|
}
|
|
18063
18052
|
function isUntaggedThreadMessage(message) {
|
|
18064
18053
|
return message.role === "user" && !message.meta?.explicitMention && !isEventConversationMessage(message);
|
|
@@ -18095,11 +18084,7 @@ function buildConversationContext(conversation, options = {}) {
|
|
|
18095
18084
|
omittedMessages: candidates.length - shown.length
|
|
18096
18085
|
};
|
|
18097
18086
|
if (shown.length === 0) return counts;
|
|
18098
|
-
const lines = [
|
|
18099
|
-
THREAD_CONTEXT_OPEN,
|
|
18100
|
-
...shown,
|
|
18101
|
-
THREAD_CONTEXT_CLOSE
|
|
18102
|
-
];
|
|
18087
|
+
const lines = [renderThreadContext(shown)];
|
|
18103
18088
|
if (shown.length < candidates.length || !history && conversation.historyFromSeq !== void 0) lines.push(THREAD_CONTEXT_OMITTED_NOTE);
|
|
18104
18089
|
return {
|
|
18105
18090
|
...counts,
|
|
@@ -18681,6 +18666,23 @@ async function recordMcpProviderConnected(args) {
|
|
|
18681
18666
|
isSameFact: (data) => data.type === "mcp_provider_connected" && data.provider === args.provider && data.credentialSubjectId === args.credentialSubjectId
|
|
18682
18667
|
});
|
|
18683
18668
|
}
|
|
18669
|
+
/** Record once that `loadSkill` loaded a manual-only skill in this Conversation. */
|
|
18670
|
+
async function recordSkillLoaded(args) {
|
|
18671
|
+
await appendHostFactOnce({
|
|
18672
|
+
conversationId: args.conversationId,
|
|
18673
|
+
idempotencyKey: `skill_loaded:${args.skillName}`,
|
|
18674
|
+
data: {
|
|
18675
|
+
type: "skill_loaded",
|
|
18676
|
+
skillName: args.skillName
|
|
18677
|
+
},
|
|
18678
|
+
isSameFact: (data) => data.type === "skill_loaded" && data.skillName === args.skillName
|
|
18679
|
+
});
|
|
18680
|
+
}
|
|
18681
|
+
/** Load the manual-only skills that `loadSkill` loaded in this Conversation. */
|
|
18682
|
+
async function loadConversationSkillNames(conversationId) {
|
|
18683
|
+
const events = await getConversationEventStore().loadEventsOfType(conversationId, "skill_loaded");
|
|
18684
|
+
return [...new Set(events.flatMap((event) => event.data.type === "skill_loaded" ? [event.data.skillName] : []))];
|
|
18685
|
+
}
|
|
18684
18686
|
/** Record that an OAuth/MCP authorization link was delivered or reused. */
|
|
18685
18687
|
async function recordAuthorizationRequested(args) {
|
|
18686
18688
|
await appendHostFactOnce({
|
|
@@ -18712,13 +18714,13 @@ async function recordAuthorizationCompleted(args) {
|
|
|
18712
18714
|
isSameFact: (data) => data.type === "authorization_completed" && data.authorizationId === args.authorizationId
|
|
18713
18715
|
});
|
|
18714
18716
|
}
|
|
18715
|
-
function
|
|
18716
|
-
if (args.authorizationId) return `native:${JUNIOR_NATIVE_EVENT_NAMESPACE}:
|
|
18717
|
-
return `native:${JUNIOR_NATIVE_EVENT_NAMESPACE}:
|
|
18717
|
+
function authenticationLinkedIdempotencyKey(args) {
|
|
18718
|
+
if (args.authorizationId) return `native:${JUNIOR_NATIVE_EVENT_NAMESPACE}:authentication_linked:authorization:${args.authorizationId}`;
|
|
18719
|
+
return `native:${JUNIOR_NATIVE_EVENT_NAMESPACE}:authentication_linked:${args.provider}:actor:${args.actorId}`;
|
|
18718
18720
|
}
|
|
18719
|
-
|
|
18720
|
-
|
|
18721
|
-
const content =
|
|
18721
|
+
/** Record a successful conversation-bound account link as host transcript metadata. */
|
|
18722
|
+
async function recordAuthenticationLinked(args) {
|
|
18723
|
+
const content = authenticationLinkedEvent.parse({
|
|
18722
18724
|
actorId: args.actorId,
|
|
18723
18725
|
provider: args.provider,
|
|
18724
18726
|
...args.accountLabel ? { accountLabel: args.accountLabel } : void 0,
|
|
@@ -18727,26 +18729,17 @@ async function recordAuthenticationAccountChange(action, args) {
|
|
|
18727
18729
|
});
|
|
18728
18730
|
await getConversationEventStore().append(args.conversationId, [{
|
|
18729
18731
|
createdAtMs: Date.now(),
|
|
18730
|
-
idempotencyKey:
|
|
18731
|
-
action,
|
|
18732
|
-
actorId: args.actorId,
|
|
18733
|
-
authorizationId: args.authorizationId,
|
|
18734
|
-
provider: args.provider
|
|
18735
|
-
}),
|
|
18732
|
+
idempotencyKey: authenticationLinkedIdempotencyKey(args),
|
|
18736
18733
|
data: {
|
|
18737
18734
|
type: "structured_event",
|
|
18738
18735
|
namespace: JUNIOR_NATIVE_EVENT_NAMESPACE,
|
|
18739
|
-
name:
|
|
18740
|
-
version:
|
|
18736
|
+
name: authenticationLinkedEvent.eventName,
|
|
18737
|
+
version: authenticationLinkedEvent.version,
|
|
18741
18738
|
...args.turnId ? { turnId: args.turnId } : void 0,
|
|
18742
18739
|
content
|
|
18743
18740
|
}
|
|
18744
18741
|
}]);
|
|
18745
18742
|
}
|
|
18746
|
-
/** Record a successful conversation-bound account link as host transcript metadata. */
|
|
18747
|
-
async function recordAuthenticationLinked(args) {
|
|
18748
|
-
await recordAuthenticationAccountChange("linked", args);
|
|
18749
|
-
}
|
|
18750
18743
|
async function loadAgentsEvent(conversationId) {
|
|
18751
18744
|
const event = await getConversationEventStore().loadLatestStructuredEvent(conversationId, JUNIOR_NATIVE_EVENT_NAMESPACE, agentsInstructionsUpdatedEvent.eventName);
|
|
18752
18745
|
if (!event || event.data.type !== "structured_event") return void 0;
|
|
@@ -18867,4 +18860,4 @@ async function recordGuardianActionReviewed(args) {
|
|
|
18867
18860
|
createdAtMs: Date.now()
|
|
18868
18861
|
}]);
|
|
18869
18862
|
}
|
|
18870
|
-
export { pauseLostWorkerTurn as $, viewerMarksFromParticipant as $a, readAutomationExecutionSummaries as $c, proxyVercelSandboxEgressRequest as $i, getTerminalAssistantMessages as $n, listPendingDispatchMailboxAppends as $o, reviewItemReaderForUser as $r, scheduledRunId as $s, buildTurnErrorResponse as $t, normalizeConversationText as A, SANDBOX_COMMAND_PATH as Aa, eventWatchUnavailable as Ac, verifySlackDirectCredentialSubject as Ai, getPluginSystemPromptContributions as An, createConversationEmbedder as Ao, countOpenReviewItemsForUser as Ar, streamPrivateSlackFile as As, hasRunnableConversationWork as At, PluginCredentialFailureError as B, buildNonInteractiveShellScript as Ba, listAutomationVersions as Bc, updateWorkspace as Bi, registration_exports as Bn, lookupSlackUserNames as Bo, takeReviewItem as Br, normalizeSlackStatusText as Bs, releaseInboundMessage as Bt, settleConversationTitleWork as C, normalizeSandboxEgressTracePropagationDomains as Ca, eventAutomationRunLimitReason as Cc, takeDueTimerWatches as Ci, agent_hooks_exports as Cn, storeAttachment as Co, saveNotificationSchedule as Cr, getHeaderString as Cs, deferConversationMove as Ct, isHumanConversationMessage as D, PluginToolDeniedError as Da, eventCatalogEntry as Dc, bindSlackDirectCredentialSubject as Di, getPluginApiRoutes as Dn, resolveRootVisibility as Do, createPluginReviewItems as Dr, isSlackRequestTimeout as Ds, getConversationWorkState as Dt, getConversationMessageSlackTs as E, workspaceRepoCheckoutPath as Ea, describeRegisteredEventTrigger as Ec, bindScheduledAutomationCredentialSubject as Ei, createPluginHookRunner as En, AttachmentSourceUnavailableError as Eo, projectConversationMessages as Er, isDmChannel as Es, getConversation as Et, calculateContextCompactionTargetTokens as F, SANDBOX_WORKSPACE_ROOT as Fa, registeredResourceTypeSchema as Fc, deleteWorkspace as Fi, setPlugins as Fn, listConversationAnnotationsById as Fo, insertReviewItem as Fr, SLACK_USER_MENTION_RE as Fs, moveIdleConversationDestination as Ft, AuthorizationPauseError as G, canAddConversationMessages as Ga, requireAutomationRevision as Gc, setWorkspaceSnapshotBuild as Gi, seqIn as Gn, createOrGetDispatch as Go, canReadReviewItem as Gr, blockScheduledAutomation as Gs, stopConversationWork as Gt, authorizationId as H, createPluginModelCostRecorder as Ha, sameDefinitionValue as Hc, invalidateReadySnapshot as Hi, setEventEmbeddingsConfig as Hn, buildDispatchId as Ho, PLUGIN_REVIEW_ITEM_KEY_PREFIX as Hr, slackMentionedUserIds as Hs, requestConversationWork as Ht, getAgentBackgroundCompactionMarkTokens as I, sandboxSkillDir as Ia, requireEventIdentifier as Ic, getWorkspace as Ii, validatePlugins as In, defaultTimezone as Io, listReplyActionItems as Ir, escapeSlackMrkdwnText as Is, pruneActiveConversation as It, clearPendingAuth as J, conversationHasParticipantUser as Ja, emptyAutomationRunWindows as Jc, isStale as Ji, eventExcerpt as Jn, getDispatchInputMessageId as Jo, itemNeedsUser as Jr, listScheduledAutomationsForTeam as Js, GATED_TURN_LIMIT_WRAP_UP_MESSAGE as Jt, abandonReplacedPendingAuth as K, createConversationAccessReader as Ka, ToolInputError as Kc, create as Ki, SEARCHABLE_EVENT_TYPES as Kn, getDispatchConversationId as Ko, canUserReadReviewItem as Kr, createScheduledAutomation as Ks, takeDeferredConversationMove as Kt, getAgentContextCompactionTriggerTokens as L, sandboxSkillFile as La, requireValidEventTrigger as Lc, getWorkspaceByName as Li, coreTaskRegistrations as Ln, findActorTimezone as Lo, listWaitingConversations as Lr, formatSlackLink as Ls, recordAttemptFailure as Lt, trimConversationMessages as M, SANDBOX_REPOS_ROOT as Ma, registeredEventMatchSchema as Mc, createPluginState as Mi, getPluginUserPromptContributions as Mn, saveObjectAnnotations as Mo, dismissOpenReviewItems as Mr, sleep$2 as Ms, isInvalidConversationRecordError as Mt, turnHasReply as N, SANDBOX_SCRATCH_ROOT as Na, registeredEventTriggerProblems as Nc, renderToolResultNudge as Ni, getPlugins as Nn, createPluginAnnotations as No, getOpenReviewItemByDedupeKey as Nr, getWorkspaceTeamId as Ns, listActiveConversationIds as Nt, latestConversationMessageSeq as O, createPluginEmbedder as Oa, eventGuidance as Oc, verifyEventAutomationCredentialSubject as Oi, getPluginRoutes as On, searchConversations as Oo, REVIEW_ITEM_REPLIED_REASON as Or, normalizeSlackConversationId as Os, getConversationWorkStates as Ot, upsertConversationMessage as P, SANDBOX_SKILLS_ROOT as Pa, registeredEventTypeSchema as Pc, createWorkspace as Pi, getStaticPluginToolDefinitions as Pn, listConversationAnnotations as Po, getReviewItem as Pr, runWithWorkspaceTeamId as Ps, markConversationWorkEnqueued as Pt, lostWorkerBeforeFirstSave as Q, conversationViewerMarks as Qa, readAutomationExecutionStatusHours as Qc, isVercelSandboxEgressRequest as Qi, getPiMessageRole as Qn, isTerminalDispatchStatus as Qo, reviewItemNeedsSomeone as Qr, saveScheduledAutomationInLock as Qs, TurnToolCallLimitExceededError as Qt, getAgentContextInputLimitTokens as R, sandboxSkillPathResolution as Ra, automationDefinition as Rc, listWorkspaces as Ri, isBriefsEnabled as Rn, resolveUserTimezone as Ro, reviewItemsNeedingUserVersionQuery as Rr, isTableRow as Rs, recordConversationRetry as Rt, resolveConversationTitle as S, resolveSandboxCommandEnvironment as Sa, admitEventAutomationRun as Sc, listWatches as Si, resolvePluginOAuthAccount as Sn, requestAttachmentDeletion as So, readNotificationSchedule as Sr, getFilePermalink as Ss, deadLetterAttempt as St, estimateConversationMessagesTokens as T, tryWorkspaceRepoCheckoutPath as Ta, automationEventCatalog as Tc, bindEventAutomationCredentialSubject as Ti, createPluginEventPublisher as Tn, storeDeferredAttachment as To, isPausedBySlack as Tr, isConversationScopedChannel as Ts, dropPendingMessages as Tt, AuthPausePersistenceError as U, createPluginLogger as Ua, AutomationConflictError as Uc, loadSnapshotsForProfile as Ui, lexemesSql as Un, claimDispatchMailboxAppend as Uo, canActOnReviewItem as Ur, wrapBareSlackUserIds as Us, startConversationWork as Ut, createPluginAuthOrchestration as V, runNonInteractiveCommand as Va, readAutomationVersion as Vc, WorkspaceValidationError as Vi, setBriefsConfig as Vn, readConversationAutomationRun as Vo, updateReviewItemContent as Vr, slackMention as Vs, requestAnotherSlice as Vt, AuthorizationFlowDisabledError as W, canAccessConversation as Wa, automationRevision as Wc, setWorkspaceSnapshot as Wi, searchedEventTextSql as Wn, confirmDispatchMailboxAppend as Wo, canAgentChangeReviewItem as Wr, truncateStatusText as Ws, steerWebPendingMessages as Wt, continuableMessages as X, conversationIsNotUnsubscribedRoot as Xa, readAutomationExecutionByConversationId as Xc, getSandboxProvider as Xi, storedMessageJson as Xn, getDispatchTurnId as Xo, requireReviewItemAssignees as Xr, readScheduledAutomation as Xs, TurnBudgetExceededError as Xt, getConversationPendingAuth as Y, conversationIsMemberRoot as Ya, existingConversationId as Yc, ensureDockerDaemon as Yi, excerptTerms as Yn, getDispatchRecord as Yo, readReviewItemAgentScope as Yr, parseScheduledAutomationRow as Ys, TURN_LIMIT_WRAP_UP_MESSAGE as Yt, loadTurnCheckpoint as Z, conversationPinnedForUser as Za, readAutomationExecutionStatusDays as Zc, isRetryableSandboxFailure as Zi, extractAssistantText as Zn, getPluginDispatchProjection as Zo, requireReviewItemLinks as Zr, saveScheduledAutomation as Zs, TurnSliceLimitExceededError as Zt, appendConversationMessages as _, consumeSandboxEgressPermissionDeniedSignal as _a, getEventAutomation as _c, createWatch as _i, getConfigDefaults as _l, readBlockedReport as _n, slackAttachmentsVersionQuery as _o, readWebPushConfig as _r, fitsSlackMetadataLimit as _s, clearConsumedConversationWake as _t, loadProjection as a, SandboxCallTimeoutError as aa, getDashboardReviewItemLink as ac, resolveAssignees as ai, refreshAutomationLastRun as al, remindMissingAnswer as an, readConversationEventPageAround as ao, isContinuablePiBoundary as ar, notifyAutomationBlocked as as, getTurnRecord as at, persistConversationMessages as b, sandboxEgressSignalsResponseSchema as ba, saveEventAutomation as bc, getWatch as bi, createUserTokenStore as bn, readLiveAttachment as bo, deletePushSubscription as br, SlackActionError as bs, completeConversationWork as bt, recordAgentsInstructionsUpdated as c, isAlreadyExistsError as ca, isDashboardLink as cc, getSlackToolContext as ci, JUNIOR_THREAD_STATE_TTL_MS as cl, getAssistantReplyText as cn, buildSentryConversationUrl as co, isToolResultMessage as cr, getSlackMessagePermalink as cs, CONVERSATION_WORK_CHECK_IN_INTERVAL_MS as ct, recordAuthorizationCompleted as d, WorkspaceSnapshotNotReadyError as da, setDashboardConversationLinkOptions as dc, RESOURCE_WATCH_TOOL_SOURCE as di, createPluginCache as dl, findLegacyNoReplyMarker as dn, notInheritedByForkChild as do, stripRuntimeTurnContext as dr, postSlackEphemeralMessage as ds, appendExclusiveInboundMessage as dt, deliverOAuthAuthorization as ea, withScheduledAutomationLock as ec, reviewItemReaderForUserInConversation as ei, readAutomationExecutions as el, createTurnLimitGate as en, createPluginConversationEvents as eo, getUserMessageInstructionText as er, markDispatchAwaitingResume as es, saveTurnCheckpoint as et, recordAuthorizationRequested as f, getWorkspaceSnapshotNotReadyError as fa, blockEventAutomation as fc, STOP_WATCHING_TOOL_NAME as fi, createDurableLocationConfigurationService as fl, isLegacyNoReplyMarker as fn, getSlackFileId as fo, trimTrailingAssistantMessages as fr, postSlackMessage as fs, appendInboundMessage as ft, recordToolExecutionStarted as g, consumeSandboxEgressAuthRequiredSignal as ga, findMatchingEventAutomations as gc, createTimerWatch as gi, projectConversationEvents$1 as gl, REPORT_BLOCKED_TOOL_NAME as gn, recordSlackAttachment as go, TURN_CONTEXT_TAG as gr, uploadFilesToConversation as gs, claimInboundMessage as gt, recordSubscribedReplyRoute as h, clearSandboxEgressSignals as ha, deleteEventAutomation as hc, collectEventMatchKeys as hi, piMessageFromHistoryItem as hl, CODE_MODE_CALL_STATUS_TEXT as hn, readSlackAttachmentSource as ho, SESSION_CONTEXT_SECTION_TAG as hr, updateSlackMessage as hs, checkInConversationWork as ht, loadConversationProjection as i, startOAuthFlow as ia, getDashboardPersonLink as ic, resolveAssignee as ii, recordAutomationExecution as il, readTurnAnswer as in, readConversationEventPageAfter as io, isAssistantMessage as ir, markDispatchRunning as is, getStoredTurnFields as it, recordDeliveredAssistantMessage as j, SANDBOX_DATA_ROOT as ja, hasEventCatalogEntries as jc, verifyTimerWatchCredentialSubject as ji, getPluginTools as jn, embedConversationQuery as jo, countReviewItemsNeedingUserBySubject as jr, withSlackRetries as js, isFinalAttempt as jt, markConversationMessage as k, createPluginModel as ka, eventNamespaceSchema as kc, verifyScheduledAutomationCredentialSubject as ki, getPluginSlackConversationLink as kn, backfillConversationEmbeddings as ko, closeReviewItem as kr, runWithSlackInstallationToken as ks, hasConversationStop as kt, recordAttachmentsDelivered as l, throwSandboxOperationError as la, parseDashboardConversationLink as lc, RESOURCE_SUBSCRIPTION_DEFAULT_TTL_MS as li, credentialAuditAttributes as ll, sanitizeAssistantText as ln, FORK_INSTRUCTIONS as lo, normalizeToolNameFromResult as lr, openSlackDirectMessage as ls, CONVERSATION_WORK_STALE_ENQUEUE_MS as lt, recordMcpProviderConnected as m, workspaceSnapshotNotReadyUserMessage as ma, createEventAutomation as mc, cancelWatch as mi, historyItemFromPiMessage as ml, CODEMODE_TOOL_NAME as mn, readAttachmentVisionSummary as mo, REQUEST_CONTEXT_SECTION_TAG as mr, unfurlSlackLinks as ms, cancelHumanFacingPendingMessages as mt, commitMessages as n, parseOAuthStatePayload as na, getDashboardLinkFilter as nc, activeParticipantUserIds as ni, readAutomationRuns as nl, REPLY_TOOL_NAME as nn, readLatestConversationBrief as no, hasTurnInput as nr, markDispatchCompleted as ns, completeTurnRecord as nt, loadTurnProjection as o, findInErrorChain as oa, getDashboardSettingsLink as oc, createCodeChangePublisher as oi, fallbackShortTitle as ol, replyTextSchema as on, readConversationLastEventSeq as oo, isStandaloneRuntimeContextMessage as or, addReactionToMessage as os, listTurnSummaries as ot, recordGuardianActionReviewed as p, isWorkspaceSnapshotNotReadyError as pa, collectEventAutomationMatchKeys as pc, cancelSubscriptions as pi, configValueSchema as pl, readNoReply as pn, matchSlackAttachments as po, CAPABILITY_SECTION_TAG as pr, removeReactionFromMessage as ps, beginConversationResume as pt, canReusePendingAuthLink as q, readConversationAccessFromSql as qa, isToolInputError as qc, hash as qi, callsToolSql as qn, getDispatchIdForConversation as qo, isOnlyAssignee as qr, deleteScheduledAutomation as qs, readInboundMessageSender as qt, loadConnectedMcpProviders as r, resolveBaseUrl as ra, getDashboardObjectIconLink as rc, automationCreatorUserId as ri, readAutomationTitlesByConversationId as rl, isAnswerToolName as rn, readConversationEventPage as ro, instructionTextForProjection as rr, markDispatchFailed as rs, failTurnRecord as rt, openConversationProjection as s, isAbortError as sa, getDashboardTaskLink as sc, resolveChannelCapabilities as si, resolveTaskTitle as sl, decideReply as sn, readConversationMessageEventSeq as so, isToolResultError as sr, deleteSlackMessage as ss, recordTurnSummary as st, commitAcceptedReply as t, formatProviderLabel as ta, getDashboardConversationLink as tc, EVERYONE_ASSIGNEE as ti, readAutomationRowStats as tl, isTurnExecutionLimitExceededError as tn, readConversationBriefThrough as to, hasRuntimeTurnContext as tr, markDispatchBlocked as ts, abandonTurnRecord as tt, recordAuthenticationLinked as u, wrapSandboxSetupError as ua, parseDashboardPersonLink as uc, RESOURCE_SUBSCRIPTION_MAX_TTL_MS as ui, credentialAuditSource as ul, NO_REPLY_TOOL_NAME as un, loadForkHistory as uo, retainRuntimeTurnContext as ur, openSlackModal as us, ackMessages as ut, hydrateConversationMessages as v, createSandboxEgressCredentialToken as va, listDeletedEventAutomationsCreatedBy as vc, deliverWatch as vi, setConfigDefaults as vl, persistWithRetry as vn, collectAttachmentGarbage as vo, sendPushNotificationToUser as vr, slackEntitySchema as vs, clearExpiredConversationLease as vt, buildConversationContext as w, SANDBOX_RUNTIME as wa, CORE_EVENT_NAMESPACE as wc, turnEvents as wi, applyPluginFormatMarkdown as wn, storeAttachments as wo, savePushSubscription as wr, getSlackClient as ws, drainConversationMailbox as wt, toStoredConversationMessage as x, buildSandboxEgressNetworkPolicy as xa, setEventAutomationStatus as xc, isQuietEvent as xi, getOAuthAccountProviders as xn, recordUploadedAttachment as xo, listPushSubscriptions as xr, downloadPrivateSlackFile as xs, countPendingConversationMessages as xt, persistConversationMessageWindow as y, parseSandboxEgressCredentialToken as ya, parseEventAutomationRow as yc, findMatchingWatches as yi, SANDBOX_EGRESS_AUTH_REQUIRED_MARKER as yn, isFileAttachment as yo, resolveNotificationTimezone as yr, slackExternalRefIdSchema as ys, completeConversationStop as yt, createPluginEgress as z, buildCommandScript as za, automationVersionOf as zc, listWorkspacesByRepository as zi, isEventEmbeddingsEnabled as zn, lookupSlackUser as zo, searchReviewItems as zr, normalizeSlackReplyMarkdown as zs, releaseConversationWork as zt };
|
|
18863
|
+
export { loadTurnCheckpoint as $, conversationIsNotUnsubscribedRoot as $a, readAutomationExecutionByConversationId as $c, getSandboxProvider as $i, extractAssistantText as $n, getDispatchTurnId as $o, requireReviewItemLinks as $r, readScheduledAutomation as $s, TurnSliceLimitExceededError as $t, latestConversationMessageSeq as A, PluginToolDeniedError as Aa, eventCatalogEntry as Ac, bindSlackDirectCredentialSubject as Ai, getPluginRoutes as An, resolveRootVisibility as Ao, REVIEW_ITEM_REPLIED_REASON as Ar, isSlackRequestTimeout as As, getConversationWorkStates as At, getAgentContextInputLimitTokens as B, sandboxSkillFile as Ba, requireValidEventTrigger as Bc, getWorkspaceByName as Bi, isBriefsEnabled as Bn, findActorTimezone as Bo, reviewItemsNeedingUserVersionQuery as Br, formatSlackLink as Bs, recordConversationRetry as Bt, toStoredConversationMessage as C, sandboxEgressSignalsResponseSchema as Ca, saveEventAutomation as Cc, getWatch as Ci, getOAuthAccountProviders as Cn, readLiveAttachment as Co, listPushSubscriptions as Cr, SlackActionError as Cs, countPendingConversationMessages as Ct, estimateConversationMessagesTokens as D, SANDBOX_RUNTIME as Da, CORE_EVENT_NAMESPACE as Dc, turnEvents as Di, createPluginEventPublisher as Dn, storeAttachments as Do, isPausedBySlack as Dr, getSlackClient as Ds, dropPendingMessages as Dt, buildConversationContext as E, normalizeSandboxEgressTracePropagationDomains as Ea, eventAutomationRunLimitReason as Ec, takeDueTimerWatches as Ei, applyPluginFormatMarkdown as En, storeAttachment as Eo, savePushSubscription as Er, getHeaderString as Es, drainConversationMailbox as Et, turnHasReply as F, SANDBOX_REPOS_ROOT as Fa, registeredEventMatchSchema as Fc, createPluginState as Fi, getPlugins as Fn, saveObjectAnnotations as Fo, getOpenReviewItemByDedupeKey as Fr, sleep$2 as Fs, listActiveConversationIds as Ft, AuthPausePersistenceError as G, createPluginModelCostRecorder as Ga, sameDefinitionValue as Gc, invalidateReadySnapshot as Gi, lexemesSql as Gn, buildDispatchId as Go, canActOnReviewItem as Gr, slackMentionedUserIds as Gs, startConversationWork as Gt, PluginCredentialFailureError as H, buildCommandScript as Ha, automationVersionOf as Hc, listWorkspacesByRepository as Hi, registration_exports as Hn, lookupSlackUser as Ho, takeReviewItem as Hr, normalizeSlackReplyMarkdown as Hs, releaseInboundMessage as Ht, upsertConversationMessage as I, SANDBOX_SCRATCH_ROOT as Ia, registeredEventTriggerProblems as Ic, renderToolResultNudge as Ii, getStaticPluginToolDefinitions as In, createPluginAnnotations as Io, getReviewItem as Ir, getWorkspaceTeamId as Is, markConversationWorkEnqueued as It, abandonReplacedPendingAuth as J, canAddConversationMessages as Ja, requireAutomationRevision as Jc, setWorkspaceSnapshotBuild as Ji, SEARCHABLE_EVENT_TYPES as Jn, createOrGetDispatch as Jo, canUserReadReviewItem as Jr, blockScheduledAutomation as Js, takeDeferredConversationMove as Jt, AuthorizationFlowDisabledError as K, createPluginLogger as Ka, AutomationConflictError as Kc, loadSnapshotsForProfile as Ki, searchedEventTextSql as Kn, claimDispatchMailboxAppend as Ko, canAgentChangeReviewItem as Kr, wrapBareSlackUserIds as Ks, steerWebPendingMessages as Kt, calculateContextCompactionTargetTokens as L, SANDBOX_SKILLS_ROOT as La, registeredEventTypeSchema as Lc, createWorkspace as Li, setPlugins as Ln, listConversationAnnotations as Lo, insertReviewItem as Lr, runWithWorkspaceTeamId as Ls, moveIdleConversationDestination as Lt, normalizeConversationText as M, createPluginModel as Ma, eventNamespaceSchema as Mc, verifyScheduledAutomationCredentialSubject as Mi, getPluginSystemPromptContributions as Mn, backfillConversationEmbeddings as Mo, countOpenReviewItemsForUser as Mr, runWithSlackInstallationToken as Ms, hasRunnableConversationWork as Mt, recordDeliveredAssistantMessage as N, SANDBOX_COMMAND_PATH as Na, eventWatchUnavailable as Nc, verifySlackDirectCredentialSubject as Ni, getPluginTools as Nn, createConversationEmbedder as No, countReviewItemsNeedingUserBySubject as Nr, streamPrivateSlackFile as Ns, isFinalAttempt as Nt, getConversationMessageSlackTs as O, tryWorkspaceRepoCheckoutPath as Oa, automationEventCatalog as Oc, bindEventAutomationCredentialSubject as Oi, createPluginHookRunner as On, storeDeferredAttachment as Oo, projectConversationMessages as Or, isConversationScopedChannel as Os, getConversation as Ot, trimConversationMessages as P, SANDBOX_DATA_ROOT as Pa, hasEventCatalogEntries as Pc, verifyTimerWatchCredentialSubject as Pi, getPluginUserPromptContributions as Pn, embedConversationQuery as Po, dismissOpenReviewItems as Pr, withSlackRetries as Ps, isInvalidConversationRecordError as Pt, continuableMessages as Q, conversationIsMemberRoot as Qa, existingConversationId as Qc, ensureDockerDaemon as Qi, storedMessageJson as Qn, getDispatchRecord as Qo, requireReviewItemAssignees as Qr, parseScheduledAutomationRow as Qs, TurnBudgetExceededError as Qt, getAgentBackgroundCompactionMarkTokens as R, SANDBOX_WORKSPACE_ROOT as Ra, registeredResourceTypeSchema as Rc, deleteWorkspace as Ri, validatePlugins as Rn, listConversationAnnotationsById as Ro, listReplyActionItems as Rr, SLACK_USER_MENTION_RE as Rs, pruneActiveConversation as Rt, persistConversationMessages as S, parseSandboxEgressCredentialToken as Sa, parseEventAutomationRow as Sc, findMatchingWatches as Si, createUserTokenStore as Sn, isFileAttachment as So, deletePushSubscription as Sr, slackExternalRefIdSchema as Ss, completeConversationWork as St, settleConversationTitleWork as T, resolveSandboxCommandEnvironment as Ta, admitEventAutomationRun as Tc, listWatches as Ti, agent_hooks_exports as Tn, requestAttachmentDeletion as To, saveNotificationSchedule as Tr, getFilePermalink as Ts, deferConversationMove as Tt, createPluginAuthOrchestration as U, buildNonInteractiveShellScript as Ua, listAutomationVersions as Uc, updateWorkspace as Ui, setBriefsConfig as Un, lookupSlackUserNames as Uo, updateReviewItemContent as Ur, normalizeSlackStatusText as Us, requestAnotherSlice as Ut, createPluginEgress as V, sandboxSkillPathResolution as Va, automationDefinition as Vc, listWorkspaces as Vi, isEventEmbeddingsEnabled as Vn, resolveUserTimezone as Vo, searchReviewItems as Vr, isTableRow as Vs, releaseConversationWork as Vt, authorizationId as W, runNonInteractiveCommand as Wa, readAutomationVersion as Wc, WorkspaceValidationError as Wi, setEventEmbeddingsConfig as Wn, readConversationAutomationRun as Wo, PLUGIN_REVIEW_ITEM_KEY_PREFIX as Wr, slackMention as Ws, requestConversationWork as Wt, clearPendingAuth as X, readConversationAccessFromSql as Xa, isToolInputError as Xc, hash as Xi, eventExcerpt as Xn, getDispatchIdForConversation as Xo, itemNeedsUser as Xr, deleteScheduledAutomation as Xs, GATED_TURN_LIMIT_WRAP_UP_MESSAGE as Xt, canReusePendingAuthLink as Y, createConversationAccessReader as Ya, ToolInputError as Yc, create as Yi, callsToolSql as Yn, getDispatchConversationId as Yo, isOnlyAssignee as Yr, createScheduledAutomation as Ys, readInboundMessageSender as Yt, getConversationPendingAuth as Z, conversationHasParticipantUser as Za, emptyAutomationRunWindows as Zc, isStale as Zi, excerptTerms as Zn, getDispatchInputMessageId as Zo, readReviewItemAgentScope as Zr, listScheduledAutomationsForTeam as Zs, TURN_LIMIT_WRAP_UP_MESSAGE as Zt, recordSubscribedReplyRoute as _, workspaceSnapshotNotReadyUserMessage as _a, createEventAutomation as _c, cancelWatch as _i, historyItemFromPiMessage as _l, CODE_MODE_CALL_STATUS_TEXT as _n, readAttachmentVisionSummary as _o, SESSION_CONTEXT_SECTION_TAG as _r, unfurlSlackLinks as _s, checkInConversationWork as _t, loadConversationSkillNames as a, parseOAuthStatePayload as aa, getDashboardLinkFilter as ac, activeParticipantUserIds as ai, readAutomationRuns as al, isAnswerToolName as an, readLatestConversationBrief as ao, instructionTextForProjection as ar, markDispatchCompleted as as, failTurnRecord as at, hydrateConversationMessages as b, consumeSandboxEgressPermissionDeniedSignal as ba, getEventAutomation as bc, createWatch as bi, getConfigDefaults as bl, persistWithRetry as bn, slackAttachmentsVersionQuery as bo, sendPushNotificationToUser as br, fitsSlackMetadataLimit as bs, clearExpiredConversationLease as bt, openConversationProjection as c, SandboxCallTimeoutError as ca, getDashboardReviewItemLink as cc, resolveAssignees as ci, refreshAutomationLastRun as cl, replyTextSchema as cn, readConversationEventPageAround as co, isStandaloneRuntimeContextMessage as cr, notifyAutomationBlocked as cs, listTurnSummaries as ct, recordAuthenticationLinked as d, isAlreadyExistsError as da, isDashboardLink as dc, getSlackToolContext as di, JUNIOR_THREAD_STATE_TTL_MS as dl, sanitizeAssistantText as dn, buildSentryConversationUrl as do, normalizeToolNameFromResult as dr, getSlackMessagePermalink as ds, CONVERSATION_WORK_STALE_ENQUEUE_MS as dt, isRetryableSandboxFailure as ea, saveScheduledAutomation as ec, reviewItemNeedsSomeone as ei, readAutomationExecutionStatusDays as el, TurnToolCallLimitExceededError as en, conversationPinnedForUser as eo, getPiMessageRole as er, getPluginDispatchProjection as es, lostWorkerBeforeFirstSave as et, recordAuthorizationCompleted as f, throwSandboxOperationError as fa, parseDashboardConversationLink as fc, RESOURCE_SUBSCRIPTION_DEFAULT_TTL_MS as fi, credentialAuditAttributes as fl, NO_REPLY_TOOL_NAME as fn, FORK_INSTRUCTIONS as fo, retainRuntimeTurnContext as fr, openSlackDirectMessage as fs, ackMessages as ft, recordSkillLoaded as g, isWorkspaceSnapshotNotReadyError as ga, collectEventAutomationMatchKeys as gc, cancelSubscriptions as gi, configValueSchema as gl, CODEMODE_TOOL_NAME as gn, matchSlackAttachments as go, REQUEST_CONTEXT_SECTION_TAG as gr, removeReactionFromMessage as gs, cancelHumanFacingPendingMessages as gt, recordMcpProviderConnected as h, getWorkspaceSnapshotNotReadyError as ha, blockEventAutomation as hc, STOP_WATCHING_TOOL_NAME as hi, createDurableLocationConfigurationService as hl, readNoReply as hn, getSlackFileId as ho, CAPABILITY_SECTION_TAG as hr, postSlackMessage as hs, beginConversationResume as ht, loadConversationProjection as i, formatProviderLabel as ia, getDashboardConversationLink as ic, EVERYONE_ASSIGNEE as ii, readAutomationRowStats as il, REPLY_TOOL_NAME as in, readConversationBriefThrough as io, hasTurnInput as ir, markDispatchBlocked as is, completeTurnRecord as it, markConversationMessage as j, createPluginEmbedder as ja, eventGuidance as jc, verifyEventAutomationCredentialSubject as ji, getPluginSlackConversationLink as jn, searchConversations as jo, closeReviewItem as jr, normalizeSlackConversationId as js, hasConversationStop as jt, isHumanConversationMessage as k, workspaceRepoCheckoutPath as ka, describeRegisteredEventTrigger as kc, bindScheduledAutomationCredentialSubject as ki, getPluginApiRoutes as kn, AttachmentSourceUnavailableError as ko, createPluginReviewItems as kr, isDmChannel as ks, getConversationWorkState as kt, recordAgentsInstructionsUpdated as l, findInErrorChain as la, getDashboardSettingsLink as lc, createCodeChangePublisher as li, fallbackShortTitle as ll, decideReply as ln, readConversationLastEventSeq as lo, isToolResultError as lr, addReactionToMessage as ls, recordTurnSummary as lt, recordGuardianActionReviewed as m, WorkspaceSnapshotNotReadyError as ma, setDashboardConversationLinkOptions as mc, RESOURCE_WATCH_TOOL_SOURCE as mi, createPluginCache as ml, isLegacyNoReplyMarker as mn, notInheritedByForkChild as mo, trimTrailingAssistantMessages as mr, postSlackEphemeralMessage as ms, appendInboundMessage as mt, commitMessages as n, proxyVercelSandboxEgressRequest as na, scheduledRunId as nc, reviewItemReaderForUserInConversation as ni, readAutomationExecutionSummaries as nl, createTurnLimitGate as nn, viewerMarksFromParticipant as no, getUserMessageInstructionText as nr, listPendingDispatchMailboxAppends as ns, saveTurnCheckpoint as nt, loadProjection as o, resolveBaseUrl as oa, getDashboardObjectIconLink as oc, automationCreatorUserId as oi, readAutomationTitlesByConversationId as ol, readTurnAnswer as on, readConversationEventPage as oo, isAssistantMessage as or, markDispatchFailed as os, getStoredTurnFields as ot, recordAuthorizationRequested as p, wrapSandboxSetupError as pa, parseDashboardPersonLink as pc, RESOURCE_SUBSCRIPTION_MAX_TTL_MS as pi, credentialAuditSource as pl, findLegacyNoReplyMarker as pn, loadForkHistory as po, stripRuntimeTurnContext as pr, openSlackModal as ps, appendExclusiveInboundMessage as pt, AuthorizationPauseError as q, canAccessConversation as qa, automationRevision as qc, setWorkspaceSnapshot as qi, seqIn as qn, confirmDispatchMailboxAppend as qo, canReadReviewItem as qr, truncateStatusText as qs, stopConversationWork as qt, loadConnectedMcpProviders as r, deliverOAuthAuthorization as ra, withScheduledAutomationLock as rc, reviewItemVisibleTo as ri, readAutomationExecutions as rl, isTurnExecutionLimitExceededError as rn, createPluginConversationEvents as ro, hasRuntimeTurnContext as rr, markDispatchAwaitingResume as rs, abandonTurnRecord as rt, loadTurnProjection as s, startOAuthFlow as sa, getDashboardPersonLink as sc, resolveAssignee as si, recordAutomationExecution as sl, remindMissingAnswer as sn, readConversationEventPageAfter as so, isContinuablePiBoundary as sr, markDispatchRunning as ss, getTurnRecord as st, commitAcceptedReply as t, isVercelSandboxEgressRequest as ta, saveScheduledAutomationInLock as tc, reviewItemReaderForUser as ti, readAutomationExecutionStatusHours as tl, buildTurnErrorResponse as tn, conversationViewerMarks as to, getTerminalAssistantMessages as tr, isTerminalDispatchStatus as ts, pauseLostWorkerTurn as tt, recordAttachmentsDelivered as u, isAbortError as ua, getDashboardTaskLink as uc, resolveChannelCapabilities as ui, resolveTaskTitle as ul, getAssistantReplyText as un, readConversationMessageEventSeq as uo, isToolResultMessage as ur, deleteSlackMessage as us, CONVERSATION_WORK_CHECK_IN_INTERVAL_MS as ut, recordToolExecutionStarted as v, clearSandboxEgressSignals as va, deleteEventAutomation as vc, collectEventMatchKeys as vi, piMessageFromHistoryItem as vl, REPORT_BLOCKED_TOOL_NAME as vn, readSlackAttachmentSource as vo, TURN_CONTEXT_TAG as vr, updateSlackMessage as vs, claimInboundMessage as vt, resolveConversationTitle as w, buildSandboxEgressNetworkPolicy as wa, setEventAutomationStatus as wc, isQuietEvent as wi, resolvePluginOAuthAccount as wn, recordUploadedAttachment as wo, readNotificationSchedule as wr, downloadPrivateSlackFile as ws, deadLetterAttempt as wt, persistConversationMessageWindow as x, createSandboxEgressCredentialToken as xa, listDeletedEventAutomationsCreatedBy as xc, deliverWatch as xi, setConfigDefaults as xl, SANDBOX_EGRESS_AUTH_REQUIRED_MARKER as xn, collectAttachmentGarbage as xo, resolveNotificationTimezone as xr, slackEntitySchema as xs, completeConversationStop as xt, appendConversationMessages as y, consumeSandboxEgressAuthRequiredSignal as ya, findMatchingEventAutomations as yc, createTimerWatch as yi, projectConversationEvents$1 as yl, readBlockedReport as yn, recordSlackAttachment as yo, readWebPushConfig as yr, uploadFilesToConversation as ys, clearConsumedConversationWake as yt, getAgentContextCompactionTriggerTokens as z, sandboxSkillDir as za, requireEventIdentifier as zc, getWorkspace as zi, coreTaskRegistrations as zn, defaultTimezone as zo, listWaitingConversations as zr, escapeSlackMrkdwnText as zs, recordAttemptFailure as zt };
|