@sentry/junior 0.302.0 → 0.303.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-context-Cx9fn9B3.js → adapter-context-BdVnSuY5.js} +2 -2
- package/dist/{admin-_poE5NKL.js → admin-AfeAdS3J.js} +2 -2
- package/dist/{agent-runner-CY9RvsTX.js → agent-runner-BP8_DLUv.js} +2987 -2948
- package/dist/api/schema.d.ts +2 -2
- package/dist/api/schema.js +6 -6
- package/dist/api.d.ts +13 -12
- package/dist/api.js +207 -80
- package/dist/{app-BpY3wtRP.d.ts → app-Dd9v1mNx.d.ts} +15 -15
- package/dist/app.d.ts +1 -1
- package/dist/app.js +63 -64
- package/dist/{automation-Cva5ZOwW.js → automation-D9MvhOWY.js} +3 -1
- package/dist/{background-compaction-queue-CXFq1_Cz.js → background-compaction-queue-xaE05jxH.js} +6 -6
- package/dist/{briefs-B3NG-pid.js → briefs-D8i-dKTp.js} +4 -4
- package/dist/{catalog-runtime-Dss0lSV6.js → catalog-runtime-d1EM6Z0V.js} +2 -2
- package/dist/cli/chat.d.ts +1 -1
- package/dist/cli/chat.js +21 -21
- package/dist/cli/check.js +8 -8
- package/dist/cli/env.d.ts +1 -0
- package/dist/cli/env.js +8 -7
- package/dist/cli/init.js +13 -4
- package/dist/cli/main.js +4 -4
- package/dist/cli/plugins.js +6 -6
- package/dist/cli/snapshot-create.js +7 -5
- package/dist/cli/upgrade.d.ts +2 -2
- package/dist/cli/upgrade.js +5 -5
- package/dist/{config-CzeZiMKs.js → config-oGM7KA9M.js} +44 -63
- package/dist/{connections-CDYhMfrs.js → connections-BlikzEJv.js} +6 -6
- package/dist/{continue-in-slack-7Uf05ndC.js → continue-in-slack-BZnYifiG.js} +5 -5
- package/dist/{conversation-BNXfq6Lb.js → conversation-CY1jnBiC.js} +1 -1
- package/dist/{conversation-feed-Clf_cv0n.js → conversation-feed-BZJRk6UV.js} +1 -1
- package/dist/{conversation-privacy-D9xnM5mK.js → conversation-privacy-Cx515ddM.js} +7 -7
- package/dist/{conversation-turn-D7SEZgTG.js → conversation-turn-DAhRdX4m.js} +20 -23
- package/dist/{credential-sync-DoD0gW-j.js → credential-sync-DfhmWFeo.js} +18 -18
- package/dist/{db-B-gtnNjr.js → db-C-2tFxk3.js} +15 -15
- package/dist/{db-BdsCzytP.d.ts → db-DPqcEM9_.d.ts} +25 -25
- package/dist/{executor-DZg20EqU.js → executor-NVfS8aQ2.js} +14 -8
- package/dist/{history-IjdmO_r6.js → history-UZ3M2M9r.js} +13 -10
- package/dist/{install-t1KQyTUs.js → install-CHLrpRZc.js} +3 -3
- package/dist/instrumentation.d.ts +4 -4
- package/dist/instrumentation.js +10 -10
- package/dist/{lineage-C79GjoQr.js → lineage-HGLhd_-N.js} +2 -2
- package/dist/{logging-C9oDAg4M.js → logging-DiyqRLBx.js} +19 -19
- package/dist/{message-BLUCzJXN.js → message-CkCOcbFH.js} +9 -9
- package/dist/{model-input-5jwNC45G.js → model-input-DmoPPtPE.js} +4 -9
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +7 -7
- package/dist/{oauth-callback-server-BBl66vCb.js → oauth-callback-server-CIf_6YmA.js} +5 -4
- package/dist/{oauth-relay-DRzq73b6.js → oauth-relay-DAmfVmJu.js} +3 -6
- package/dist/{package-discovery-DJhGdS4c.js → package-discovery-x4AvVhMj.js} +1 -1
- package/dist/{plugin-module-Cf5gVPWP.js → plugin-module-Cv2ETe8Y.js} +1 -1
- package/dist/{plugins-BBX07Jzt.js → plugins-Bkk0XRo2.js} +3 -3
- package/dist/{projection-CIBwgD3s.js → projection-DBq8tsA5.js} +221 -173
- package/dist/{prompt-CRQbzp5e.js → prompt-D2KlJopL.js} +4 -4
- package/dist/{queue-CZyYgPF0.d.ts → queue-CbEHUO0l.d.ts} +1 -1
- package/dist/{queue-DtCDaIct.js → queue-DFaOscp5.js} +4 -4
- package/dist/{registry-DdFQHZ_d.js → registry-Bu0Z9BEO.js} +37 -37
- package/dist/{resolve-CdW4BdrK.js → resolve-DXuA3G0g.js} +3 -3
- package/dist/{result-oOMv1t4O.js → result-DpiNseDA.js} +10 -15
- package/dist/rolldown-runtime-BKpuH2hG.js +26 -0
- package/dist/{runner-DqitLtm-.js → runner-iu1heRFv.js} +10 -10
- package/dist/{sandbox-egress-signals-Bw9I0yfJ.js → sandbox-egress-signals-2HFYDcQf.js} +1 -1
- package/dist/{schema-BIFM-U1a.d.ts → schema-DHMOaRzC.d.ts} +520 -13
- package/dist/{schema-DnVQepWP.js → schema-DvfX3Gq_.js} +77 -13
- package/dist/{secrets-DebYU866.js → secrets-DHaJ5TTn.js} +4 -4
- package/dist/{sentry-BRTJqumy.js → sentry-CPbZjomA.js} +3 -28
- package/dist/{sentry-route-name-BhwWnfqj.js → sentry-route-name-C6EIzAGP.js} +1 -1
- package/dist/{service-account-CrZftRTb.js → service-account-BcT5LR7V.js} +47 -47
- package/dist/{service-account-B6mKAPVo.js → service-account-xYkaQTrw.js} +3 -3
- package/dist/{session-stop-DW63Z3kj.js → session-stop-BLLp1IP_.js} +28 -35
- package/dist/{skills-C16fz60Z.js → skills-CNAGH4ju.js} +6 -9
- package/dist/{slack-conversation-unfurl-BHhefEb7.js → slack-conversation-unfurl-DYnqe5ci.js} +10 -15
- package/dist/{spawn-D_RnFYfy.js → spawn-cGasWW33.js} +7 -7
- package/dist/{legacy-web-actor-id-C-cEeWqL.js → state-CDS6h_Wv.js} +32 -32
- package/dist/{stop-7p1i08CY.js → stop-DMMA67yT.js} +221 -139
- package/dist/{store-C28I0CVW.js → store-Dgs7Oe44.js} +5 -5
- package/dist/{task-queue-BVUJbQ28.js → task-queue-DcF0nhhz.js} +3 -3
- package/dist/{task-runner-CWi8j7Z6.js → task-runner-BGXF7Fo7.js} +15 -18
- package/dist/{thread-context-D3-yYUd0.js → thread-context-BPky1KBe.js} +12 -12
- package/dist/{turn-session-routing-BFMS9ATF.js → turn-session-routing-DGvn9MSl.js} +32 -32
- package/dist/{turn-user-message-C3-O8Omt.js → turn-user-message-19CkuUvM.js} +3 -3
- package/dist/{validation-BSFKUIb4.js → validation-lu1DgjNQ.js} +2 -2
- package/dist/vercel.js +1 -1
- package/dist/{version-BHHXNi-0.js → version-Uo3c94Dx.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-B1SO21Qa.js → viewer-BPQHMx3-.js} +3 -3
- package/dist/{warmup-Bz9bzkzN.js → warmup-H8uLvW9e.js} +149 -130
- package/dist/{worker-BspReIIK.js → worker-B-pM_-3K.js} +9 -12
- package/migrations/0109_user_preferences.sql +1 -0
- package/migrations/0110_code_change_repository_state_index.sql +1 -0
- package/migrations/meta/0109_snapshot.json +4925 -0
- package/migrations/meta/0110_snapshot.json +4952 -0
- package/migrations/meta/_journal.json +15 -1
- package/package.json +16 -19
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { d as contextProvenance, f as instructionActors, n as agentHistoryItemSchema, p as instructionProvenanceFor } from "./history-IjdmO_r6.js";
|
|
9
|
-
import { _ as CredentialUnavailableError, a as resolveAuthTokenPlaceholder, f as credentialContextForActor, g as credentialUserSubjectId, h as credentialSubjectSchema, m as credentialLogContext, o as resolvePluginCommandEnv, p as credentialContextSchema } from "./registry-DdFQHZ_d.js";
|
|
10
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-Dss0lSV6.js";
|
|
11
|
-
import { _ as renderJuniorNativeConversationEvent, d as embedTexts$1, f as JUNIOR_NATIVE_EVENT_NAMESPACE, h as authenticationUnlinkedEvent, l as completeObject$1, m as authenticationLinkedEvent, n as briefEntriesFromReportEvents, o as isEventConversationMessage, p as agentsInstructionsUpdatedEvent, s as generateBrief, t as BRIEF_PROMPT, u as completeText } from "./prompt-CRQbzp5e.js";
|
|
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-UZ3M2M9r.js";
|
|
3
|
+
import { _ as renderJuniorNativeConversationEvent, d as embedTexts, f as JUNIOR_NATIVE_EVENT_NAMESPACE, h as authenticationUnlinkedEvent, l as completeObject, m as authenticationLinkedEvent, n as briefEntriesFromReportEvents, o as isEventConversationMessage, p as agentsInstructionsUpdatedEvent, s as generateBrief, t as BRIEF_PROMPT, u as completeText } from "./prompt-D2KlJopL.js";
|
|
4
|
+
import { $ as fenceLock, C as isPersonInput, G as createCache, J as getStateAdapter, P as resolveActorIdentityId, Q as acquireActiveLock, V as saveUserTimezone, X as setStateValues, Y as getStateValues, Z as MUTATION_LOCK_TTL_MS, _t as sameDestination, a as getConversationStore, b as createSqlStore, c as hasAnnotationKey, ct as hasAgentTurnUsage, d as eventFromRow, dt as conversationDetailTouch, et as withLock, f as withConversationEventLock, ht as parseDestination, it as addAgentTurnUsage, j as startLocationThread, l as treeHasAnnotationKey, o as getDb, q as getDefaultRedisStateAdapterFor, r as getConversationEventStore, s as getSqlExecutor, tt as claimProviderConversation, u as createSqlConversationEventStore, z as readUserTimezone } from "./db-C-2tFxk3.js";
|
|
5
|
+
import { D as juniorConversationAnnotations, F as juniorDestinations, M as juniorConversations, N as juniorIdentities, O as juniorCodeChanges, P as juniorUsers, T as juniorConversationEvents, a as juniorPushSubscriptions, b as juniorConversationEmbeddings, f as juniorAutomations, i as juniorWorkspaces, j as juniorAttachments, k as juniorCodeRepositories, l as juniorReviewItems, m as juniorLocationConfigurations, n as juniorSnapshots, o as juniorReviewItemAssignees, r as juniorWorkspaceRepos, s as juniorReviewItemConversations, v as juniorConversationParticipants, x as juniorConversationBriefs } from "./executor-NVfS8aQ2.js";
|
|
6
|
+
import { E as withSpan, J as toOptionalString, K as isRecord$2, _ 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-DiyqRLBx.js";
|
|
7
|
+
import { _ as CredentialUnavailableError, a as resolveAuthTokenPlaceholder, f as credentialContextForActor, g as credentialUserSubjectId, h as credentialSubjectSchema, m as credentialLogContext, o as resolvePluginCommandEnv, p as credentialContextSchema } from "./registry-Bu0Z9BEO.js";
|
|
12
8
|
import { n as isWithinNotificationSchedule, r as notificationScheduleSchema, s as isValidTimeZone, t as DEFAULT_NOTIFICATION_SCHEDULE } from "./schedule-cP0AACm1.js";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
9
|
+
import { C as completeObject$1, D as resolveGatewayModel, E as rerankTexts, L as unwrapCurrentInstruction, Q as toOptionalTrimmed, R as escapeXml, S as completeDecision, T as embedTexts$1, b as GEN_AI_PROVIDER_NAME, i as getChatConfig, j as estimateTextTokens, n as botConfig, o as getSlackBotToken, y as normalizeSlackEmojiName } from "./config-oGM7KA9M.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-D2iXzvlN.js";
|
|
11
|
+
import { i as readActorIdentity, l as resolveViewerUser, n as findUserByEmailFromSql, o as readIdentityById, p as parseAvatarUrl, s as readIdentityByIdFromSql } from "./viewer-BPQHMx3-.js";
|
|
12
|
+
import { $ as briefResourceLabel, B as messageCardRef, H as readMessageCardRefs, R as reviewItemChangeRecordSchema, Y as readMessageAttachments, _ as conversationReportEventSchema, et as conversationBriefSchema, nt as parseStoredBrief, tt as parseBriefInput, v as conversationReportMessageEventSchema } from "./conversation-CY1jnBiC.js";
|
|
13
|
+
import { a as getClient$1, h as startSpan, n as captureMessage, r as continueTrace } from "./sentry-CPbZjomA.js";
|
|
14
|
+
import { t as canExposeConversationPayload } from "./conversation-privacy-Cx515ddM.js";
|
|
15
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-d1EM6Z0V.js";
|
|
15
16
|
import { n as redactSandboxEgressProxyPath, t as SANDBOX_EGRESS_PROXY_PATH } from "./proxy-path-BHYoKZdq.js";
|
|
16
|
-
import {
|
|
17
|
-
import { i as readWebPushPrivateKey, t as readJuniorSecret } from "./secrets-
|
|
17
|
+
import { n as readEncryptedState, r as findLegacyWebActorUserId, t as createEncryptedState } from "./state-CDS6h_Wv.js";
|
|
18
|
+
import { i as readWebPushPrivateKey, t as readJuniorSecret } from "./secrets-DHaJ5TTn.js";
|
|
18
19
|
import * as z from "zod";
|
|
19
20
|
import path from "node:path";
|
|
20
21
|
import { isDeepStrictEqual } from "node:util";
|
|
@@ -212,27 +213,27 @@ function validateConfigValue(value) {
|
|
|
212
213
|
// src/chat/configuration/service.ts
|
|
213
214
|
function sanitizeEntry(value) {
|
|
214
215
|
if (!isRecord$2(value)) return;
|
|
215
|
-
const key = toOptionalString(value
|
|
216
|
+
const key = toOptionalString(value["key"]);
|
|
216
217
|
if (!key || validateConfigKey(key)) return;
|
|
217
|
-
const updatedAt = toOptionalString(value
|
|
218
|
+
const updatedAt = toOptionalString(value["updatedAt"]);
|
|
218
219
|
if (!updatedAt) return;
|
|
219
|
-
if (value
|
|
220
|
-
const parsedValue = configValueSchema.safeParse(value
|
|
220
|
+
if (value["scope"] !== "channel" && value["scope"] !== "conversation" && value["scope"] !== "location") return;
|
|
221
|
+
const parsedValue = configValueSchema.safeParse(value["value"]);
|
|
221
222
|
if (!parsedValue.success) return;
|
|
222
223
|
return {
|
|
223
224
|
key,
|
|
224
225
|
value: parsedValue.data,
|
|
225
226
|
scope: "location",
|
|
226
227
|
updatedAt,
|
|
227
|
-
updatedBy: toOptionalString(value
|
|
228
|
-
source: toOptionalString(value
|
|
229
|
-
expiresAt: toOptionalString(value
|
|
228
|
+
updatedBy: toOptionalString(value["updatedBy"]),
|
|
229
|
+
source: toOptionalString(value["source"]),
|
|
230
|
+
expiresAt: toOptionalString(value["expiresAt"])
|
|
230
231
|
};
|
|
231
232
|
}
|
|
232
233
|
/** Coerce legacy persisted configuration into current Location entries. */
|
|
233
234
|
function coerceLegacyLocationConfig(raw) {
|
|
234
|
-
const rawConfig = isRecord$2(raw) && isRecord$2(raw
|
|
235
|
-
const rawEntries = isRecord$2(rawConfig
|
|
235
|
+
const rawConfig = isRecord$2(raw) && isRecord$2(raw["configuration"]) ? raw["configuration"] : {};
|
|
236
|
+
const rawEntries = isRecord$2(rawConfig["entries"]) ? rawConfig["entries"] : {};
|
|
236
237
|
return Object.values(rawEntries).flatMap((value) => {
|
|
237
238
|
const entry = sanitizeEntry(value);
|
|
238
239
|
return entry ? [entry] : [];
|
|
@@ -714,7 +715,7 @@ async function replaceSlackMentions(value, provider) {
|
|
|
714
715
|
});
|
|
715
716
|
const matches = [...tokens.values()].flat();
|
|
716
717
|
if (matches.length === 0) return value;
|
|
717
|
-
const people = await readSlackPeople([...new Set(matches.flatMap((match) => match.groups?.user ?? []))], provider);
|
|
718
|
+
const people = await readSlackPeople([...new Set(matches.flatMap((match) => match.groups?.["user"] ?? []))], provider);
|
|
718
719
|
return mapStrings(value, (text) => {
|
|
719
720
|
let result = "";
|
|
720
721
|
let cursor = 0;
|
|
@@ -852,7 +853,7 @@ async function lookupSlackUserNames(teamId, userIds) {
|
|
|
852
853
|
const DEFAULT_TIMEZONE = "America/Los_Angeles";
|
|
853
854
|
/** The install timezone, used when Junior does not know a person's timezone. */
|
|
854
855
|
function defaultTimezone() {
|
|
855
|
-
return process.env
|
|
856
|
+
return process.env["JUNIOR_TIMEZONE"]?.trim() || DEFAULT_TIMEZONE;
|
|
856
857
|
}
|
|
857
858
|
/**
|
|
858
859
|
* Pick a person's timezone: their Slack profile, then the saved user
|
|
@@ -974,18 +975,23 @@ async function saveObjectAnnotations(conversationId, plugin, value) {
|
|
|
974
975
|
plugin
|
|
975
976
|
}));
|
|
976
977
|
}
|
|
977
|
-
/**
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
978
|
+
/**
|
|
979
|
+
* Save annotations from a successful plugin tool result and attach their cards.
|
|
980
|
+
* An Annotation marks work that the Conversation did, so a read-only tool must
|
|
981
|
+
* not return one: looking up an object does not link it.
|
|
982
|
+
*/
|
|
983
|
+
async function annotateToolResult(conversationId, plugin, result, options) {
|
|
984
|
+
if (!isRecord$2(result) || result["isError"] === true) return result;
|
|
985
|
+
const details = isRecord$2(result["details"]) ? result["details"] : result;
|
|
986
|
+
if (details["timed_out"] === true || details["isError"] === true || !Array.isArray(details["objectAnnotations"])) return result;
|
|
987
|
+
if (options.readOnly) throw new Error(`Read-only ${plugin} tool returned objectAnnotations. Return them only from tools that change the object.`);
|
|
988
|
+
const cards = await saveObjectAnnotations(conversationId, plugin, details["objectAnnotations"]);
|
|
983
989
|
const { objectAnnotations: _annotations, ...rest } = details;
|
|
984
990
|
const annotated = {
|
|
985
991
|
...rest,
|
|
986
992
|
objectCards: cards
|
|
987
993
|
};
|
|
988
|
-
if (isRecord$2(result
|
|
994
|
+
if (isRecord$2(result["details"])) return {
|
|
989
995
|
...result,
|
|
990
996
|
details: annotated
|
|
991
997
|
};
|
|
@@ -1002,7 +1008,7 @@ const MAX_EMBEDDED_CHARS = 8e3;
|
|
|
1002
1008
|
/** Create the embedder that charges its cost to one Conversation. */
|
|
1003
1009
|
function createConversationEmbedder(args) {
|
|
1004
1010
|
return async ({ inputType, text }) => {
|
|
1005
|
-
const result = await embedTexts
|
|
1011
|
+
const result = await embedTexts({
|
|
1006
1012
|
cost: args.cost,
|
|
1007
1013
|
inputType,
|
|
1008
1014
|
modelId: botConfig.embeddingModelId,
|
|
@@ -1202,10 +1208,10 @@ function createPluginConversations(conversationId) {
|
|
|
1202
1208
|
*/
|
|
1203
1209
|
async function recordToolReply(args) {
|
|
1204
1210
|
const { result } = args;
|
|
1205
|
-
if (!isRecord$2(result) || result
|
|
1206
|
-
const details = isRecord$2(result
|
|
1207
|
-
if (details
|
|
1208
|
-
const reply = pluginToolReplySchema.parse(details
|
|
1211
|
+
if (!isRecord$2(result) || result["isError"] === true) return result;
|
|
1212
|
+
const details = isRecord$2(result["details"]) ? result["details"] : result;
|
|
1213
|
+
if (details["reply"] === void 0) return result;
|
|
1214
|
+
const reply = pluginToolReplySchema.parse(details["reply"]);
|
|
1209
1215
|
if (args.toolCallId) await getConversationEventStore().append(args.conversationId, [{
|
|
1210
1216
|
idempotencyKey: `reply_posted:tool:${args.toolCallId}`,
|
|
1211
1217
|
data: {
|
|
@@ -1218,7 +1224,7 @@ async function recordToolReply(args) {
|
|
|
1218
1224
|
createdAtMs: Date.now()
|
|
1219
1225
|
}]);
|
|
1220
1226
|
const { reply: _reply, ...rest } = details;
|
|
1221
|
-
if (isRecord$2(result
|
|
1227
|
+
if (isRecord$2(result["details"])) return {
|
|
1222
1228
|
...result,
|
|
1223
1229
|
details: rest
|
|
1224
1230
|
};
|
|
@@ -1472,7 +1478,7 @@ function mapSlackError(error) {
|
|
|
1472
1478
|
statusCode: candidate.statusCode,
|
|
1473
1479
|
requestId: getHeaderString(candidate.headers, "x-slack-req-id"),
|
|
1474
1480
|
errorData: serializeSlackErrorData(candidate.data),
|
|
1475
|
-
...parseSlackCanvasDetail(candidate.data?.detail)
|
|
1481
|
+
...parseSlackCanvasDetail(candidate.data?.["detail"])
|
|
1476
1482
|
};
|
|
1477
1483
|
if (apiError === "missing_scope") return new SlackActionError(message, "missing_scope", {
|
|
1478
1484
|
...baseOptions,
|
|
@@ -1746,9 +1752,9 @@ function slackAttachmentsVersionQuery(db, conversationId) {
|
|
|
1746
1752
|
}
|
|
1747
1753
|
/** Read the Slack file identity retained by the Chat SDK. */
|
|
1748
1754
|
function getSlackFileId(attachment) {
|
|
1749
|
-
const metadataId = attachment.fetchMetadata?.fileId;
|
|
1755
|
+
const metadataId = attachment.fetchMetadata?.["fileId"];
|
|
1750
1756
|
if (metadataId) return metadataId;
|
|
1751
|
-
return (attachment.url ?? attachment.fetchMetadata?.url ?? "").match(/(?:^|[-/])(F[A-Z0-9]+)(?:[-/]|$)/)?.[1];
|
|
1757
|
+
return (attachment.url ?? attachment.fetchMetadata?.["url"] ?? "").match(/(?:^|[-/])(F[A-Z0-9]+)(?:[-/]|$)/)?.[1];
|
|
1752
1758
|
}
|
|
1753
1759
|
/**
|
|
1754
1760
|
* Look up a Slack file that Junior recorded without storing it.
|
|
@@ -1786,7 +1792,7 @@ async function hydrateMessageAttachments(db, conversationId, events) {
|
|
|
1786
1792
|
});
|
|
1787
1793
|
const byFileId = new Map(attachments.map(({ providerId, ...attachment }) => [providerId, attachment]));
|
|
1788
1794
|
for (const message of messages) {
|
|
1789
|
-
const stored = readMessageAttachments(message.meta?.attachments);
|
|
1795
|
+
const stored = readMessageAttachments(message.meta?.["attachments"]);
|
|
1790
1796
|
const matched = slackFileIds(message.meta).flatMap((id) => {
|
|
1791
1797
|
const attachment = byFileId.get(id);
|
|
1792
1798
|
return attachment ? [attachment] : [];
|
|
@@ -1798,7 +1804,7 @@ async function hydrateMessageAttachments(db, conversationId, events) {
|
|
|
1798
1804
|
}
|
|
1799
1805
|
}
|
|
1800
1806
|
function slackFileIds(meta) {
|
|
1801
|
-
const ids = meta?.slackFileIds ?? meta?.imageFileIds;
|
|
1807
|
+
const ids = meta?.["slackFileIds"] ?? meta?.["imageFileIds"];
|
|
1802
1808
|
return Array.isArray(ids) ? ids.filter((id) => typeof id === "string") : [];
|
|
1803
1809
|
}
|
|
1804
1810
|
// src/chat/agent-invocations/fork-history.ts
|
|
@@ -1854,7 +1860,7 @@ function notInheritedByForkChild() {
|
|
|
1854
1860
|
}
|
|
1855
1861
|
// src/chat/sentry-links.ts
|
|
1856
1862
|
function getSentryOrgSlug() {
|
|
1857
|
-
return process.env
|
|
1863
|
+
return process.env["SENTRY_ORG_SLUG"]?.trim() || void 0;
|
|
1858
1864
|
}
|
|
1859
1865
|
function isSentrySaasDsnHost(host) {
|
|
1860
1866
|
return host === "sentry.io" || host.endsWith(".sentry.io");
|
|
@@ -1893,22 +1899,22 @@ function buildSentryEventUrl(eventId) {
|
|
|
1893
1899
|
function conversationEventModel(data, current) {
|
|
1894
1900
|
if (data.type === "turn_started") return void 0;
|
|
1895
1901
|
if (data.type === "assistant_message") {
|
|
1896
|
-
const model = text
|
|
1897
|
-
const provider = text
|
|
1902
|
+
const model = text(data["model"]);
|
|
1903
|
+
const provider = text(data["provider"]);
|
|
1898
1904
|
if (model) return { modelId: model.includes("/") || !provider ? model : `${provider}/${model}` };
|
|
1899
1905
|
}
|
|
1900
1906
|
return current;
|
|
1901
1907
|
}
|
|
1902
|
-
function text
|
|
1908
|
+
function text(value) {
|
|
1903
1909
|
return typeof value === "string" && value.length > 0 ? value : void 0;
|
|
1904
1910
|
}
|
|
1905
1911
|
/** Allowlist model-call diagnostics; never expose opaque provider metadata. */
|
|
1906
1912
|
function conversationEventModelCall(data) {
|
|
1907
1913
|
if (data.type !== "assistant_message") return void 0;
|
|
1908
1914
|
const usage = extractGenAiUsageSummary(data);
|
|
1909
|
-
const provider = text
|
|
1910
|
-
const api = text
|
|
1911
|
-
const stopReason = text
|
|
1915
|
+
const provider = text(data["provider"]);
|
|
1916
|
+
const api = text(data["api"]);
|
|
1917
|
+
const stopReason = text(data["stopReason"]);
|
|
1912
1918
|
return {
|
|
1913
1919
|
...provider ? { provider } : void 0,
|
|
1914
1920
|
...api ? { api } : void 0,
|
|
@@ -2001,7 +2007,7 @@ function modelVisibleToolOutput(content) {
|
|
|
2001
2007
|
}
|
|
2002
2008
|
function reportMessageActorIdentity(data) {
|
|
2003
2009
|
if (data.role !== "user") return void 0;
|
|
2004
|
-
const author = reportingMessageAuthorSchema.safeParse(data.meta?.author);
|
|
2010
|
+
const author = reportingMessageAuthorSchema.safeParse(data.meta?.["author"]);
|
|
2005
2011
|
if (!author.success) return void 0;
|
|
2006
2012
|
const actorIdentity = {
|
|
2007
2013
|
...author.data.fullName ? { fullName: author.data.fullName } : void 0,
|
|
@@ -2106,13 +2112,13 @@ function conversationReportToolResultIds(events) {
|
|
|
2106
2112
|
const storedMessageEventsSchema = z.array(conversationReportMessageEventSchema);
|
|
2107
2113
|
/** Read the Events listed on a message that holds several Events. */
|
|
2108
2114
|
function reportMessageEvents(meta) {
|
|
2109
|
-
const parsed = storedMessageEventsSchema.safeParse(meta?.events);
|
|
2115
|
+
const parsed = storedMessageEventsSchema.safeParse(meta?.["events"]);
|
|
2110
2116
|
return parsed.success ? { events: parsed.data } : void 0;
|
|
2111
2117
|
}
|
|
2112
2118
|
const storedReviewItemChangesSchema = z.array(reviewItemChangeRecordSchema).min(1);
|
|
2113
2119
|
/** Read the Review item changes that a message records. */
|
|
2114
2120
|
function reportReviewItemChanges(meta) {
|
|
2115
|
-
const parsed = storedReviewItemChangesSchema.safeParse(meta?.reviewItemChanges);
|
|
2121
|
+
const parsed = storedReviewItemChangesSchema.safeParse(meta?.["reviewItemChanges"]);
|
|
2116
2122
|
return parsed.success ? { reviewItemChanges: parsed.data } : void 0;
|
|
2117
2123
|
}
|
|
2118
2124
|
const TURN_COMPLETED_STATES = {
|
|
@@ -2143,22 +2149,22 @@ function reportEventData(args) {
|
|
|
2143
2149
|
type: "message",
|
|
2144
2150
|
messageId: data.messageId,
|
|
2145
2151
|
role: data.role,
|
|
2146
|
-
...data.meta?.source === "web" || data.meta?.source === "slack" ? { source: data.meta
|
|
2152
|
+
...data.meta?.["source"] === "web" || data.meta?.["source"] === "slack" ? { source: data.meta["source"] } : void 0,
|
|
2147
2153
|
...actorIdentity ? { actorIdentity } : void 0,
|
|
2148
2154
|
...args.canExposePayload && data.role === "user" && data.authorIdentityId && data.authorIdentityId !== "system" ? { actorIdentityId: data.authorIdentityId } : void 0,
|
|
2149
|
-
...typeof data.meta?.agentInvocationId === "string" ? { agentInvocationId: data.meta
|
|
2155
|
+
...typeof data.meta?.["agentInvocationId"] === "string" ? { agentInvocationId: data.meta["agentInvocationId"] } : void 0,
|
|
2150
2156
|
...args.canExposePayload ? reportReviewItemChanges(data.meta) : void 0,
|
|
2151
|
-
eventObjectType: objectTypeSchema.safeParse(data.meta?.eventObjectType).data,
|
|
2152
|
-
...typeof data.meta?.eventType === "string" ? { eventType: data.meta
|
|
2153
|
-
...typeof data.meta?.eventNamespace === "string" ? { eventNamespace: data.meta
|
|
2154
|
-
...typeof data.meta?.explicitMention === "boolean" ? { explicitMention: data.meta
|
|
2155
|
-
...data.meta?.quiet === true ? { quiet: true } : void 0,
|
|
2156
|
-
...args.canExposePayload && typeof data.meta?.trustedSummary === "string" ? { trustedSummary: data.meta
|
|
2157
|
+
eventObjectType: objectTypeSchema.safeParse(data.meta?.["eventObjectType"]).data,
|
|
2158
|
+
...typeof data.meta?.["eventType"] === "string" ? { eventType: data.meta["eventType"] } : void 0,
|
|
2159
|
+
...typeof data.meta?.["eventNamespace"] === "string" ? { eventNamespace: data.meta["eventNamespace"] } : void 0,
|
|
2160
|
+
...typeof data.meta?.["explicitMention"] === "boolean" ? { explicitMention: data.meta["explicitMention"] } : void 0,
|
|
2161
|
+
...data.meta?.["quiet"] === true ? { quiet: true } : void 0,
|
|
2162
|
+
...args.canExposePayload && typeof data.meta?.["trustedSummary"] === "string" ? { trustedSummary: data.meta["trustedSummary"] } : void 0,
|
|
2157
2163
|
...args.canExposePayload ? reportMessageEvents(data.meta) : void 0,
|
|
2158
|
-
...args.canExposePayload && (data.meta?.cards || data.meta?.objectCards) ? { cards: readMessageCardRefs(data.meta) } : void 0,
|
|
2164
|
+
...args.canExposePayload && (data.meta?.["cards"] || data.meta?.["objectCards"]) ? { cards: readMessageCardRefs(data.meta) } : void 0,
|
|
2159
2165
|
...args.canExposePayload ? {
|
|
2160
2166
|
text: data.text,
|
|
2161
|
-
...data.meta?.attachments ? { attachments: readMessageAttachments(data.meta
|
|
2167
|
+
...data.meta?.["attachments"] ? { attachments: readMessageAttachments(data.meta["attachments"]) } : void 0
|
|
2162
2168
|
} : { redacted: true }
|
|
2163
2169
|
};
|
|
2164
2170
|
}
|
|
@@ -2888,7 +2894,7 @@ async function updateConversationBrief(context) {
|
|
|
2888
2894
|
const input = await briefInputFromSql(executor, run.conversationId, terminalSeq);
|
|
2889
2895
|
const modelId = botConfig.fastModelId;
|
|
2890
2896
|
const generation = await generateBrief({
|
|
2891
|
-
completeObject: (request) => completeObject
|
|
2897
|
+
completeObject: (request) => completeObject({
|
|
2892
2898
|
...request,
|
|
2893
2899
|
modelId,
|
|
2894
2900
|
operation: "brief_update",
|
|
@@ -3263,7 +3269,7 @@ function createPluginLogger(plugin) {
|
|
|
3263
3269
|
});
|
|
3264
3270
|
},
|
|
3265
3271
|
warn(message, metadata) {
|
|
3266
|
-
logWarn("plugin.log.
|
|
3272
|
+
logWarn("plugin.log.warning", {
|
|
3267
3273
|
"app.log.message": message,
|
|
3268
3274
|
"app.plugin.name": plugin,
|
|
3269
3275
|
...metadata
|
|
@@ -3335,7 +3341,7 @@ const RUNTIME_GIT_CONFIG = [["credential.helper", ""], ["http.emptyAuth", "true"
|
|
|
3335
3341
|
* always wins.
|
|
3336
3342
|
*/
|
|
3337
3343
|
function gitConfigEnv(env) {
|
|
3338
|
-
const count = Number.parseInt(env
|
|
3344
|
+
const count = Number.parseInt(env["GIT_CONFIG_COUNT"] ?? "0", 10) || 0;
|
|
3339
3345
|
const entries = [];
|
|
3340
3346
|
for (let index = 0; index < count; index++) {
|
|
3341
3347
|
const key = env[`GIT_CONFIG_KEY_${index}`];
|
|
@@ -3403,7 +3409,7 @@ function normalizeWorkspaceRoot(input) {
|
|
|
3403
3409
|
const normalized = candidate.replace(/\/+$/, "");
|
|
3404
3410
|
return normalized.startsWith("/") ? normalized : `/${normalized}`;
|
|
3405
3411
|
}
|
|
3406
|
-
const SANDBOX_WORKSPACE_ROOT = normalizeWorkspaceRoot(process.env
|
|
3412
|
+
const SANDBOX_WORKSPACE_ROOT = normalizeWorkspaceRoot(process.env["VERCEL_SANDBOX_WORKSPACE_DIR"]);
|
|
3407
3413
|
const SANDBOX_REPOS_ROOT = `${SANDBOX_WORKSPACE_ROOT}/repos`;
|
|
3408
3414
|
const SANDBOX_SKILLS_ROOT = `${SANDBOX_WORKSPACE_ROOT}/skills`;
|
|
3409
3415
|
const SANDBOX_DATA_ROOT = `${SANDBOX_WORKSPACE_ROOT}/data`;
|
|
@@ -3489,7 +3495,7 @@ function createSandboxCapability(workspace, ownerSignal) {
|
|
|
3489
3495
|
function createPluginModel(pluginName, options = {}, runtime = {}) {
|
|
3490
3496
|
return { async completeObject(input) {
|
|
3491
3497
|
const modelId = options.structuredModelId ?? (options.structuredModel === "default" ? botConfig.modelId : botConfig.fastModelId);
|
|
3492
|
-
const result = await completeObject({
|
|
3498
|
+
const result = await completeObject$1({
|
|
3493
3499
|
modelId,
|
|
3494
3500
|
schema: input.schema,
|
|
3495
3501
|
prompt: input.prompt,
|
|
@@ -3518,7 +3524,7 @@ function createPluginEmbedder(pluginName, runtime = {}) {
|
|
|
3518
3524
|
model: botConfig.embeddingModelId,
|
|
3519
3525
|
provider: GEN_AI_PROVIDER_NAME,
|
|
3520
3526
|
async embedTexts(input) {
|
|
3521
|
-
const result = await embedTexts({
|
|
3527
|
+
const result = await embedTexts$1({
|
|
3522
3528
|
modelId: botConfig.embeddingModelId,
|
|
3523
3529
|
texts: input.texts,
|
|
3524
3530
|
...input.inputType !== void 0 ? { inputType: input.inputType } : void 0,
|
|
@@ -3636,7 +3642,7 @@ var DockerApiError = class extends Error {
|
|
|
3636
3642
|
};
|
|
3637
3643
|
/** Return the unix socket path of the Docker daemon from `DOCKER_HOST`. */
|
|
3638
3644
|
function dockerSocketPath() {
|
|
3639
|
-
const host = process.env
|
|
3645
|
+
const host = process.env["DOCKER_HOST"]?.trim();
|
|
3640
3646
|
if (!host) return DEFAULT_SOCKET_PATH;
|
|
3641
3647
|
if (!host.startsWith("unix://")) throw new Error(`The Docker sandbox provider supports only unix sockets. DOCKER_HOST is ${host}`);
|
|
3642
3648
|
return host.slice(7);
|
|
@@ -3919,7 +3925,7 @@ const DOCKER_SANDBOX_LABEL = "dev.junior.sandbox";
|
|
|
3919
3925
|
* `JUNIOR_DOCKER_SANDBOX_DIR` overrides the default.
|
|
3920
3926
|
*/
|
|
3921
3927
|
function dockerSandboxDir() {
|
|
3922
|
-
const configured = process.env
|
|
3928
|
+
const configured = process.env["JUNIOR_DOCKER_SANDBOX_DIR"]?.trim();
|
|
3923
3929
|
if (configured) return configured;
|
|
3924
3930
|
return path.join(os.homedir(), ".cache", "junior", "docker-sandbox");
|
|
3925
3931
|
}
|
|
@@ -3931,7 +3937,7 @@ function dockerSandboxDir() {
|
|
|
3931
3937
|
* verify the certificates that this proxy shows.
|
|
3932
3938
|
*/
|
|
3933
3939
|
function dockerSandboxExtraCaFile() {
|
|
3934
|
-
return process.env
|
|
3940
|
+
return process.env["JUNIOR_DOCKER_SANDBOX_EXTRA_CA_CERTS"]?.trim() || void 0;
|
|
3935
3941
|
}
|
|
3936
3942
|
// src/chat/sandbox/docker/tar.ts
|
|
3937
3943
|
const BLOCK = 512;
|
|
@@ -4354,7 +4360,7 @@ const octetString = (value) => tlv(4, value);
|
|
|
4354
4360
|
const bitString = (value) => tlv(3, Buffer.concat([Buffer.from([0]), value]));
|
|
4355
4361
|
const explicit = (index, value) => tlv(160 + index, value);
|
|
4356
4362
|
const booleanTrue = () => tlv(1, Buffer.from([255]));
|
|
4357
|
-
function integer
|
|
4363
|
+
function integer(value) {
|
|
4358
4364
|
return tlv(2, (value[0] ?? 0) & 128 ? Buffer.concat([Buffer.from([0]), value]) : value);
|
|
4359
4365
|
}
|
|
4360
4366
|
function oid(value) {
|
|
@@ -4391,7 +4397,7 @@ function certificate(input) {
|
|
|
4391
4397
|
serial[0] = (serial[0] ?? 0) & 127;
|
|
4392
4398
|
const algorithm = sequence(oid(OID.ecdsaWithSha256));
|
|
4393
4399
|
const now = Date.now();
|
|
4394
|
-
const tbs = sequence(explicit(0, integer
|
|
4400
|
+
const tbs = sequence(explicit(0, integer(Buffer.from([2]))), integer(serial), algorithm, input.issuer, sequence(time(/* @__PURE__ */ new Date(now - DAY_MS)), time(new Date(now + input.validDays * DAY_MS))), input.subject, publicKeyInfo(input.publicKey), explicit(3, sequence(...input.extensions)));
|
|
4395
4401
|
const signature = sign("sha256", tbs, {
|
|
4396
4402
|
key: input.signingKey,
|
|
4397
4403
|
dsaEncoding: "der"
|
|
@@ -5854,7 +5860,7 @@ function absolute(filePath, cwd) {
|
|
|
5854
5860
|
function notFound(filePath) {
|
|
5855
5861
|
return Object.assign(/* @__PURE__ */ new Error(`ENOENT: no such file or directory, '${filePath}'`), { code: "ENOENT" });
|
|
5856
5862
|
}
|
|
5857
|
-
async function readFile
|
|
5863
|
+
async function readFile(id, filePath, signal) {
|
|
5858
5864
|
try {
|
|
5859
5865
|
return unpackFirstFile(await dockerRequest({
|
|
5860
5866
|
path: `/containers/${id}/archive`,
|
|
@@ -5907,7 +5913,7 @@ function fileSystem(id) {
|
|
|
5907
5913
|
return {
|
|
5908
5914
|
async readFile(filePath, options) {
|
|
5909
5915
|
const target = absolute(filePath);
|
|
5910
|
-
const content = await readFile
|
|
5916
|
+
const content = await readFile(id, target, options.signal);
|
|
5911
5917
|
if (!content) throw notFound(target);
|
|
5912
5918
|
return content.toString(options.encoding);
|
|
5913
5919
|
},
|
|
@@ -5982,7 +5988,7 @@ function adaptSession$1(container, options) {
|
|
|
5982
5988
|
const result = await runRawExec(id, { cmd: ["mkdir", target] });
|
|
5983
5989
|
if (result.exitCode !== 0) throw new Error(`mkdir ${target} failed: ${result.stderr.trim()}`);
|
|
5984
5990
|
}),
|
|
5985
|
-
readFileToBuffer: (input) => run(() => readFile
|
|
5991
|
+
readFileToBuffer: (input) => run(() => readFile(id, absolute(input.path, input.cwd))),
|
|
5986
5992
|
runCommand: (input) => run(() => runSandboxCommand(id, {
|
|
5987
5993
|
...input,
|
|
5988
5994
|
cwd: input.cwd ?? SANDBOX_WORKSPACE_ROOT,
|
|
@@ -6113,9 +6119,9 @@ const dockerSandboxProvider = {
|
|
|
6113
6119
|
* the SDK read ambient Vercel auth from its own environment detection.
|
|
6114
6120
|
*/
|
|
6115
6121
|
function getVercelSandboxCredentials() {
|
|
6116
|
-
const token = toOptionalTrimmed(process.env
|
|
6117
|
-
const teamId = toOptionalTrimmed(process.env
|
|
6118
|
-
const projectId = toOptionalTrimmed(process.env
|
|
6122
|
+
const token = toOptionalTrimmed(process.env["VERCEL_TOKEN"]);
|
|
6123
|
+
const teamId = toOptionalTrimmed(process.env["VERCEL_TEAM_ID"]);
|
|
6124
|
+
const projectId = toOptionalTrimmed(process.env["VERCEL_PROJECT_ID"]);
|
|
6119
6125
|
if (token && teamId && projectId) return {
|
|
6120
6126
|
token,
|
|
6121
6127
|
teamId,
|
|
@@ -6834,24 +6840,24 @@ function optionalString(value) {
|
|
|
6834
6840
|
/** Parse OAuth callback state that was persisted before a provider redirect. */
|
|
6835
6841
|
function parseOAuthStatePayload(value) {
|
|
6836
6842
|
if (!isRecord$2(value)) return;
|
|
6837
|
-
if (typeof value
|
|
6838
|
-
const actor = value
|
|
6839
|
-
if (value
|
|
6840
|
-
const destination = parseDestination(value
|
|
6841
|
-
if (value
|
|
6842
|
-
const source = value
|
|
6843
|
-
if (value
|
|
6843
|
+
if (typeof value["userId"] !== "string" || typeof value["provider"] !== "string") return;
|
|
6844
|
+
const actor = value["actor"] === void 0 ? void 0 : actorSchema.safeParse(value["actor"]);
|
|
6845
|
+
if (value["actor"] !== void 0 && (!actor || !actor.success)) return;
|
|
6846
|
+
const destination = parseDestination(value["destination"]);
|
|
6847
|
+
if (value["destination"] !== void 0 && !destination) return;
|
|
6848
|
+
const source = value["source"] === void 0 ? void 0 : sourceSchema.safeParse(value["source"]);
|
|
6849
|
+
if (value["source"] !== void 0 && (!source || !source.success)) return;
|
|
6844
6850
|
return {
|
|
6845
|
-
userId: value
|
|
6846
|
-
provider: value
|
|
6851
|
+
userId: value["userId"],
|
|
6852
|
+
provider: value["provider"],
|
|
6847
6853
|
...actor?.success ? { actor: actor.data } : void 0,
|
|
6848
|
-
...optionalString(value
|
|
6854
|
+
...optionalString(value["channelId"]) ? { channelId: optionalString(value["channelId"]) } : void 0,
|
|
6849
6855
|
...destination ? { destination } : void 0,
|
|
6850
6856
|
...source?.success ? { source: source.data } : void 0,
|
|
6851
|
-
...optionalString(value
|
|
6852
|
-
...optionalString(value
|
|
6853
|
-
...optionalString(value
|
|
6854
|
-
...optionalString(value
|
|
6857
|
+
...optionalString(value["threadTs"]) ? { threadTs: optionalString(value["threadTs"]) } : void 0,
|
|
6858
|
+
...optionalString(value["resumeConversationId"]) ? { resumeConversationId: optionalString(value["resumeConversationId"]) } : void 0,
|
|
6859
|
+
...optionalString(value["resumeSessionId"]) ? { resumeSessionId: optionalString(value["resumeSessionId"]) } : void 0,
|
|
6860
|
+
...optionalString(value["scope"]) ? { scope: optionalString(value["scope"]) } : void 0
|
|
6855
6861
|
};
|
|
6856
6862
|
}
|
|
6857
6863
|
/** Return the manifest-owned display label for a provider. */
|
|
@@ -6862,11 +6868,11 @@ function formatProviderLabel(provider) {
|
|
|
6862
6868
|
}
|
|
6863
6869
|
/** Resolve the public base URL from environment variables (JUNIOR_BASE_URL or Vercel). */
|
|
6864
6870
|
function resolveBaseUrl() {
|
|
6865
|
-
const explicit = process.env
|
|
6871
|
+
const explicit = process.env["JUNIOR_BASE_URL"]?.trim();
|
|
6866
6872
|
if (explicit) return explicit;
|
|
6867
|
-
const vercelProd = process.env
|
|
6873
|
+
const vercelProd = process.env["VERCEL_PROJECT_PRODUCTION_URL"]?.trim();
|
|
6868
6874
|
if (vercelProd) return `https://${vercelProd}`;
|
|
6869
|
-
const vercelUrl = process.env
|
|
6875
|
+
const vercelUrl = process.env["VERCEL_URL"]?.trim();
|
|
6870
6876
|
if (vercelUrl) return `https://${vercelUrl}`;
|
|
6871
6877
|
}
|
|
6872
6878
|
/**
|
|
@@ -7108,7 +7114,7 @@ function normalizePort(value) {
|
|
|
7108
7114
|
return port >= 1 && port <= 65535 ? trimmed : void 0;
|
|
7109
7115
|
}
|
|
7110
7116
|
function sandboxIdFromPayload(payload) {
|
|
7111
|
-
return typeof payload
|
|
7117
|
+
return typeof payload["sandbox_id"] === "string" ? payload["sandbox_id"] : void 0;
|
|
7112
7118
|
}
|
|
7113
7119
|
function normalizedForwardedPath(path) {
|
|
7114
7120
|
if (!path.startsWith("/") || path.startsWith("//") || path.includes("#") || /[\r\n]/.test(path)) return {
|
|
@@ -7253,9 +7259,9 @@ function searchableText(error) {
|
|
|
7253
7259
|
}
|
|
7254
7260
|
function isInvalidSandboxSessionError(error) {
|
|
7255
7261
|
if (!isRecord$1(error)) return false;
|
|
7256
|
-
if (isRecord$1(error
|
|
7257
|
-
const response = error
|
|
7258
|
-
return isRecord$1(response) && response
|
|
7262
|
+
if (isRecord$1(error["json"]) && error["json"]["invalidToken"] === true) return true;
|
|
7263
|
+
const response = error["response"];
|
|
7264
|
+
return isRecord$1(response) && response["status"] === 403 && typeof response["url"] === "string" && response["url"].includes("/sandboxes/sessions");
|
|
7259
7265
|
}
|
|
7260
7266
|
function isUnavailable(error) {
|
|
7261
7267
|
return findInErrorChain(error, (candidate) => {
|
|
@@ -7285,13 +7291,13 @@ function isTransient(error) {
|
|
|
7285
7291
|
const searchable = searchableText(candidate);
|
|
7286
7292
|
if (searchable.includes("internal_server_error") || searchable.includes("status=500") || searchable.includes("status code 500") || searchable.includes("status=502") || searchable.includes("status code 502") || searchable.includes("status=503") || searchable.includes("status code 503") || searchable.includes("status=504") || searchable.includes("status code 504")) return true;
|
|
7287
7293
|
if (!isRecord$1(candidate)) return false;
|
|
7288
|
-
const response = candidate
|
|
7289
|
-
return isRecord$1(response) && typeof response
|
|
7294
|
+
const response = candidate["response"];
|
|
7295
|
+
return isRecord$1(response) && typeof response["status"] === "number" && response["status"] >= 500 && response["status"] < 600;
|
|
7290
7296
|
});
|
|
7291
7297
|
}
|
|
7292
7298
|
const SOCKET_FAILURE_CODES = /* @__PURE__ */ new Set(["ECONNRESET", "UND_ERR_SOCKET"]);
|
|
7293
7299
|
function isFetchSocketFailure(error) {
|
|
7294
|
-
return error.name === "TypeError" && (error.message === "terminated" || error.message === "fetch failed") && isRecord$1(error.cause) && typeof error.cause
|
|
7300
|
+
return error.name === "TypeError" && (error.message === "terminated" || error.message === "fetch failed") && isRecord$1(error.cause) && typeof error.cause["code"] === "string" && SOCKET_FAILURE_CODES.has(error.cause["code"]);
|
|
7295
7301
|
}
|
|
7296
7302
|
function isCommandStreamInterrupted(error) {
|
|
7297
7303
|
return findInErrorChain(error, (candidate) => {
|
|
@@ -7357,6 +7363,9 @@ function adaptSession(sandbox, options) {
|
|
|
7357
7363
|
return session.domain(port);
|
|
7358
7364
|
});
|
|
7359
7365
|
},
|
|
7366
|
+
previewUrls() {
|
|
7367
|
+
return session.routes.map((route) => session.domain(route.port));
|
|
7368
|
+
},
|
|
7360
7369
|
extendTimeout(duration) {
|
|
7361
7370
|
return run(async () => await session.extendTimeout(duration));
|
|
7362
7371
|
},
|
|
@@ -7664,7 +7673,7 @@ function mergeDependencies(dependencies) {
|
|
|
7664
7673
|
return merged;
|
|
7665
7674
|
}
|
|
7666
7675
|
function floatingMaxAgeMs() {
|
|
7667
|
-
const raw = process.env
|
|
7676
|
+
const raw = process.env["SANDBOX_SNAPSHOT_FLOATING_MAX_AGE_MS"];
|
|
7668
7677
|
if (!raw?.trim()) return DEFAULT_FLOATING_MAX_AGE_MS;
|
|
7669
7678
|
const parsed = Number.parseInt(raw, 10);
|
|
7670
7679
|
return Number.isFinite(parsed) && parsed >= 0 ? parsed : DEFAULT_FLOATING_MAX_AGE_MS;
|
|
@@ -7699,7 +7708,7 @@ function create(runtime, workspace) {
|
|
|
7699
7708
|
const { dependencies, postinstall } = getSandboxProvider().selectSnapshotRuntime?.(declared) ?? declared;
|
|
7700
7709
|
const pluginPostinstall = postinstall.filter((command) => !GLOBAL_RUNTIME_POSTINSTALL.includes(command));
|
|
7701
7710
|
if (dependencies.length === 0 && postinstall.length === 0 && !workspace) return null;
|
|
7702
|
-
const rebuildEpoch = process.env
|
|
7711
|
+
const rebuildEpoch = process.env["SANDBOX_SNAPSHOT_REBUILD_EPOCH"]?.trim() ?? "";
|
|
7703
7712
|
const floating = dependencies.some((dependency) => isFloating(dependency)) || pluginPostinstall.length > 0 || Boolean(workspace);
|
|
7704
7713
|
return {
|
|
7705
7714
|
hash: createHash("sha256").update(JSON.stringify({
|
|
@@ -8240,11 +8249,11 @@ function normalizeDashboardPath(path, fallback) {
|
|
|
8240
8249
|
return stripTrailingSlashes(value.startsWith("/") ? value : `/${value}`);
|
|
8241
8250
|
}
|
|
8242
8251
|
function resolveDashboardBaseURL(config) {
|
|
8243
|
-
const explicit = config.baseURL ?? process.env
|
|
8252
|
+
const explicit = config.baseURL ?? process.env["JUNIOR_BASE_URL"];
|
|
8244
8253
|
if (explicit?.trim()) return stripTrailingSlashes(withHttps(explicit.trim()));
|
|
8245
|
-
const vercelProd = process.env
|
|
8254
|
+
const vercelProd = process.env["VERCEL_PROJECT_PRODUCTION_URL"]?.trim();
|
|
8246
8255
|
if (vercelProd) return stripTrailingSlashes(withHttps(vercelProd));
|
|
8247
|
-
const vercelUrl = process.env
|
|
8256
|
+
const vercelUrl = process.env["VERCEL_URL"]?.trim();
|
|
8248
8257
|
if (vercelUrl) return stripTrailingSlashes(withHttps(vercelUrl));
|
|
8249
8258
|
return "http://localhost:3000";
|
|
8250
8259
|
}
|
|
@@ -9220,7 +9229,7 @@ function publicIn(tenants) {
|
|
|
9220
9229
|
* Review item access test checks that they agree.
|
|
9221
9230
|
*/
|
|
9222
9231
|
function reviewItemVisibleTo(reader) {
|
|
9223
|
-
return or(
|
|
9232
|
+
return or(...publicIn(reader.tenants ?? []), ...reader.userId ? [reviewItemAssignedTo(reader.userId)] : [], ...reader.conversationId ? [reviewItemLinkedTo(reader.conversationId)] : [], ...reader.automationId ? [eq(juniorReviewItems.automationId, reader.automationId)] : []) ?? sql`false`;
|
|
9224
9233
|
}
|
|
9225
9234
|
/** Return whether a reader can see one Review item. */
|
|
9226
9235
|
function canReadReviewItem(item, reader) {
|
|
@@ -9341,6 +9350,14 @@ function canActOnReviewItem(item, userId) {
|
|
|
9341
9350
|
if (item.assignees.length === 0) return true;
|
|
9342
9351
|
return item.assignees.some((assignee) => assignee.userId === userId);
|
|
9343
9352
|
}
|
|
9353
|
+
/**
|
|
9354
|
+
* Return whether a Review item needs a User: an open `action` item that is
|
|
9355
|
+
* assigned to them. `reviewItemNeedsUser` is the SQL form; keep the two the
|
|
9356
|
+
* same.
|
|
9357
|
+
*/
|
|
9358
|
+
function itemNeedsUser(item, userId) {
|
|
9359
|
+
return item.status === "open" && item.kind === "action" && item.assignees.some((assignee) => assignee.userId === userId);
|
|
9360
|
+
}
|
|
9344
9361
|
/** Return whether a User is already the only assignee, so take does nothing. */
|
|
9345
9362
|
function isOnlyAssignee(item, userId) {
|
|
9346
9363
|
return !item.assignedToEveryone && item.assignees.length === 1 && item.assignees[0]?.userId === userId;
|
|
@@ -9550,6 +9567,14 @@ async function takeReviewItem(db, input) {
|
|
|
9550
9567
|
function searchConditions(reader, filters) {
|
|
9551
9568
|
const conditions = [reviewItemVisibleTo(reader), inArray(juniorReviewItems.status, [...filters.statuses])];
|
|
9552
9569
|
if (filters.after) conditions.push(or(gt(juniorReviewItems.createdAt, filters.after.createdAt), and(eq(juniorReviewItems.createdAt, filters.after.createdAt), gt(juniorReviewItems.id, filters.after.id))));
|
|
9570
|
+
if (filters.afterWaiting) {
|
|
9571
|
+
if (typeof filters.order !== "object") throw new Error("afterWaiting needs the waiting-first order");
|
|
9572
|
+
const needs = reviewItemNeedsUser(filters.order.needsUserId);
|
|
9573
|
+
const { createdAt, id, needsUser } = filters.afterWaiting;
|
|
9574
|
+
const older = or(lt(juniorReviewItems.createdAt, createdAt), and(eq(juniorReviewItems.createdAt, createdAt), lt(juniorReviewItems.id, id)));
|
|
9575
|
+
conditions.push(needsUser ? or(not(needs), and(needs, older)) : and(not(needs), older));
|
|
9576
|
+
}
|
|
9577
|
+
if (filters.closedBefore) conditions.push(or(lt(juniorReviewItems.closedAt, filters.closedBefore.closedAt), and(eq(juniorReviewItems.closedAt, filters.closedBefore.closedAt), lt(juniorReviewItems.id, filters.closedBefore.id))));
|
|
9553
9578
|
if (filters.subjectId) conditions.push(eq(juniorReviewItems.subjectId, filters.subjectId));
|
|
9554
9579
|
if (filters.automationId) conditions.push(eq(juniorReviewItems.automationId, filters.automationId));
|
|
9555
9580
|
if (filters.conversationId) conditions.push(reviewItemLinkedTo(filters.conversationId));
|
|
@@ -9561,9 +9586,26 @@ function searchConditions(reader, filters) {
|
|
|
9561
9586
|
}
|
|
9562
9587
|
return conditions;
|
|
9563
9588
|
}
|
|
9564
|
-
/**
|
|
9565
|
-
|
|
9566
|
-
|
|
9589
|
+
/**
|
|
9590
|
+
* Count the open Review items that need a User (`reviewItemNeedsUser`), one
|
|
9591
|
+
* row per subject URL, with the ones that ask with a form as `decisions`.
|
|
9592
|
+
* The nav count and the Inbox bundle counts all read this one query.
|
|
9593
|
+
*/
|
|
9594
|
+
async function countReviewItemsNeedingUserBySubject(db, userId) {
|
|
9595
|
+
return await db.select({
|
|
9596
|
+
decisions: count(juniorReviewItems.request),
|
|
9597
|
+
subjectUrl: juniorReviewItems.subjectUrl,
|
|
9598
|
+
total: count()
|
|
9599
|
+
}).from(juniorReviewItems).where(reviewItemNeedsUser(userId)).groupBy(juniorReviewItems.subjectUrl);
|
|
9600
|
+
}
|
|
9601
|
+
/**
|
|
9602
|
+
* Count the items in `ids` that are still open and that the reader's Inbox
|
|
9603
|
+
* lists (`reviewItemForUser`). Snoozes live in the browser, so the
|
|
9604
|
+
* dashboard names the newest item of each snoozed row.
|
|
9605
|
+
*/
|
|
9606
|
+
async function countOpenReviewItemsForUser(db, reader, ids) {
|
|
9607
|
+
if (ids.length === 0) return 0;
|
|
9608
|
+
return (await db.select({ count: count() }).from(juniorReviewItems).where(and(inArray(juniorReviewItems.id, [...ids]), eq(juniorReviewItems.status, "open"), reviewItemVisibleTo(reader), reviewItemForUser(reader.userId))))[0]?.count ?? 0;
|
|
9567
9609
|
}
|
|
9568
9610
|
/**
|
|
9569
9611
|
* Return a query for a token that changes when the open Review items that
|
|
@@ -9578,10 +9620,18 @@ function reviewItemsNeedingUserVersionQuery(db, userId) {
|
|
|
9578
9620
|
* the limit never drops an open item for a closed one. Then the newest
|
|
9579
9621
|
* change comes first: `updated_at`, then `id`, both descending. With
|
|
9580
9622
|
* `order: "oldest"`, the oldest item comes first: `created_at`, then `id`,
|
|
9581
|
-
* both ascending. `after` pages through that order.
|
|
9623
|
+
* both ascending. `after` pages through that order. With `order: "closed"`,
|
|
9624
|
+
* the item closed last comes first: `closed_at`, then `id`, both
|
|
9625
|
+
* descending. `closedBefore` pages through that order. With
|
|
9626
|
+
* `order: { needsUserId }`, the items that need the User come first, then
|
|
9627
|
+
* `created_at` and `id`, both descending. `afterWaiting` pages through it.
|
|
9582
9628
|
*/
|
|
9583
9629
|
async function searchReviewItems(db, reader, filters) {
|
|
9584
|
-
return await hydrate(db, await db.select().from(juniorReviewItems).where(and(...searchConditions(reader, filters))).orderBy(desc(eq(juniorReviewItems.status, "open")), ...filters.order === "
|
|
9630
|
+
return await hydrate(db, await db.select().from(juniorReviewItems).where(and(...searchConditions(reader, filters))).orderBy(desc(eq(juniorReviewItems.status, "open")), ...typeof filters.order === "object" ? [
|
|
9631
|
+
desc(reviewItemNeedsUser(filters.order.needsUserId)),
|
|
9632
|
+
desc(juniorReviewItems.createdAt),
|
|
9633
|
+
desc(juniorReviewItems.id)
|
|
9634
|
+
] : 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));
|
|
9585
9635
|
}
|
|
9586
9636
|
/**
|
|
9587
9637
|
* List the root Conversations that wait on a User: each root or one of its
|
|
@@ -9701,8 +9751,8 @@ function isMessageEvent(event) {
|
|
|
9701
9751
|
}
|
|
9702
9752
|
function splitMeta(meta) {
|
|
9703
9753
|
const rest = { ...meta ?? {} };
|
|
9704
|
-
const author = rest
|
|
9705
|
-
delete rest
|
|
9754
|
+
const author = rest["author"];
|
|
9755
|
+
delete rest["author"];
|
|
9706
9756
|
return {
|
|
9707
9757
|
...author ? { author } : void 0,
|
|
9708
9758
|
...Object.keys(rest).length > 0 ? { meta: rest } : void 0
|
|
@@ -9905,7 +9955,7 @@ async function resolveNotificationTimezone(args) {
|
|
|
9905
9955
|
const PUSH_TTL_SECONDS = 43200;
|
|
9906
9956
|
const PUSH_TIMEOUT_MS = 1e4;
|
|
9907
9957
|
function subjectFromBaseUrl() {
|
|
9908
|
-
const baseUrl = process.env
|
|
9958
|
+
const baseUrl = process.env["JUNIOR_BASE_URL"]?.trim();
|
|
9909
9959
|
if (!baseUrl) return void 0;
|
|
9910
9960
|
return baseUrl.startsWith("https://") || baseUrl.startsWith("http://") ? baseUrl : `https://${baseUrl}`;
|
|
9911
9961
|
}
|
|
@@ -9919,10 +9969,10 @@ function isVapidSubject(subject) {
|
|
|
9919
9969
|
* an `http://` base URL.
|
|
9920
9970
|
*/
|
|
9921
9971
|
function readWebPushConfig() {
|
|
9922
|
-
const publicKey = process.env
|
|
9972
|
+
const publicKey = process.env["JUNIOR_WEB_PUSH_PUBLIC_KEY"]?.trim();
|
|
9923
9973
|
const privateKey = readWebPushPrivateKey();
|
|
9924
9974
|
if (!publicKey || !privateKey) return void 0;
|
|
9925
|
-
const subject = process.env
|
|
9975
|
+
const subject = process.env["JUNIOR_WEB_PUSH_SUBJECT"]?.trim() || subjectFromBaseUrl();
|
|
9926
9976
|
if (!subject || !isVapidSubject(subject)) return void 0;
|
|
9927
9977
|
return {
|
|
9928
9978
|
privateKey,
|
|
@@ -10005,8 +10055,7 @@ function notificationPreview(text) {
|
|
|
10005
10055
|
}
|
|
10006
10056
|
/**
|
|
10007
10057
|
* Return the stored reply of the Turn: the text that the person sees. The
|
|
10008
|
-
* run transcript has the raw model text, which can be a no-reply marker
|
|
10009
|
-
* does not say whether the reply was quiet.
|
|
10058
|
+
* run transcript has the raw model text, which can be a no-reply marker.
|
|
10010
10059
|
*/
|
|
10011
10060
|
async function readTurnReply(run) {
|
|
10012
10061
|
const prefix = `${run.runId}:assistant:`;
|
|
@@ -10047,7 +10096,6 @@ async function notifyReply(context) {
|
|
|
10047
10096
|
if (!url) return skip("no_dashboard");
|
|
10048
10097
|
const reply = await readTurnReply(run);
|
|
10049
10098
|
if (!reply) return skip("no_reply");
|
|
10050
|
-
if (reply.meta?.quiet) return skip("quiet");
|
|
10051
10099
|
const db = context.db;
|
|
10052
10100
|
const userId = await recipientUserId(db, run);
|
|
10053
10101
|
if (!userId) return skip("no_user");
|
|
@@ -10098,11 +10146,7 @@ const notificationsTaskRegistration = {
|
|
|
10098
10146
|
} } }
|
|
10099
10147
|
};
|
|
10100
10148
|
// src/chat/briefs/registration.ts
|
|
10101
|
-
var registration_exports = /* @__PURE__ */ __exportAll({
|
|
10102
|
-
coreTaskRegistrations: () => coreTaskRegistrations,
|
|
10103
|
-
isBriefsEnabled: () => isBriefsEnabled,
|
|
10104
|
-
setBriefsConfig: () => setBriefsConfig
|
|
10105
|
-
});
|
|
10149
|
+
var registration_exports = /* @__PURE__ */ __exportAll({ setBriefsConfig: () => setBriefsConfig });
|
|
10106
10150
|
let configuredBriefs = {};
|
|
10107
10151
|
/** Replace app-level Brief settings and return the previous setting. */
|
|
10108
10152
|
function setBriefsConfig(config) {
|
|
@@ -10296,10 +10340,11 @@ function toUserPromptContributionContext(args) {
|
|
|
10296
10340
|
message: message.data,
|
|
10297
10341
|
pluginName: args.pluginName
|
|
10298
10342
|
});
|
|
10299
|
-
if (!isRecord(args.value) || typeof args.value
|
|
10300
|
-
const context = promptContextSchema.safeParse(args.value
|
|
10343
|
+
if (!isRecord(args.value) || typeof args.value["renderPrompt"] !== "function") return;
|
|
10344
|
+
const context = promptContextSchema.safeParse(args.value["context"]);
|
|
10301
10345
|
if (!context.success) return;
|
|
10302
|
-
const
|
|
10346
|
+
const renderPrompt = args.value["renderPrompt"];
|
|
10347
|
+
const text = promptMessageSchema.safeParse({ text: renderPrompt.call(args.value) });
|
|
10303
10348
|
if (!text.success) return;
|
|
10304
10349
|
return {
|
|
10305
10350
|
id: `userPrompt:${args.index}`,
|
|
@@ -10502,7 +10547,9 @@ function pluginToolDefinitions(plugin) {
|
|
|
10502
10547
|
}
|
|
10503
10548
|
/** Model-facing definitions of every plugin tool, with no Turn. */
|
|
10504
10549
|
function getStaticPluginToolDefinitions() {
|
|
10505
|
-
|
|
10550
|
+
const definitions = {};
|
|
10551
|
+
for (const plugin of getPlugins()) Object.assign(definitions, pluginToolDefinitions(plugin));
|
|
10552
|
+
return definitions;
|
|
10506
10553
|
}
|
|
10507
10554
|
/** Collect turn-scoped tools exposed by plugins. */
|
|
10508
10555
|
function getPluginTools(context, sandbox = createSandboxCapability(context.workspace)) {
|
|
@@ -10669,7 +10716,7 @@ function getPluginTools(context, sandbox = createSandboxCapability(context.works
|
|
|
10669
10716
|
plugin: pluginName,
|
|
10670
10717
|
result: await execute(input, options, pluginContext),
|
|
10671
10718
|
toolCallId: options.toolCallId
|
|
10672
|
-
})) } : void 0
|
|
10719
|
+
}), { readOnly: definition.annotations?.readOnlyHint === true }) } : void 0
|
|
10673
10720
|
};
|
|
10674
10721
|
}
|
|
10675
10722
|
}
|
|
@@ -11133,7 +11180,7 @@ function createPluginHookRunner(input = {}) {
|
|
|
11133
11180
|
juniorRoot: SANDBOX_JUNIOR_ROOT,
|
|
11134
11181
|
env: {
|
|
11135
11182
|
get(key) {
|
|
11136
|
-
return env[key] ?? normalizeEnv(nextInput
|
|
11183
|
+
return env[key] ?? normalizeEnv(nextInput["env"])[key];
|
|
11137
11184
|
},
|
|
11138
11185
|
set(key, value) {
|
|
11139
11186
|
env[key] = value;
|
|
@@ -12640,6 +12687,7 @@ function parseAnswer(toolName, details, toolCallId) {
|
|
|
12640
12687
|
case "misconfigured": return { blocked: { missing: parsed.data.reason } };
|
|
12641
12688
|
}
|
|
12642
12689
|
}
|
|
12690
|
+
default: return;
|
|
12643
12691
|
}
|
|
12644
12692
|
}
|
|
12645
12693
|
/**
|
|
@@ -12755,7 +12803,7 @@ const inboundMessageSenderSchema = z.object({
|
|
|
12755
12803
|
}).strict();
|
|
12756
12804
|
/** Read the sender fields that one inbound message stores, if any. */
|
|
12757
12805
|
function readInboundMessageSender(message) {
|
|
12758
|
-
const parsed = inboundMessageSenderSchema.safeParse(message.input.metadata?.sender);
|
|
12806
|
+
const parsed = inboundMessageSenderSchema.safeParse(message.input.metadata?.["sender"]);
|
|
12759
12807
|
return parsed.success ? parsed.data : void 0;
|
|
12760
12808
|
}
|
|
12761
12809
|
/**
|
|
@@ -12947,10 +12995,10 @@ function normalizeActor(value) {
|
|
|
12947
12995
|
}
|
|
12948
12996
|
function normalizeLease(value) {
|
|
12949
12997
|
if (!isRecord$2(value)) return;
|
|
12950
|
-
const token = toOptionalString(value
|
|
12951
|
-
const acquiredAtMs = toOptionalNumber(value
|
|
12952
|
-
const lastCheckInAtMs = toOptionalNumber(value
|
|
12953
|
-
const expiresAtMs = toOptionalNumber(value
|
|
12998
|
+
const token = toOptionalString(value["token"]);
|
|
12999
|
+
const acquiredAtMs = toOptionalNumber(value["acquiredAtMs"]);
|
|
13000
|
+
const lastCheckInAtMs = toOptionalNumber(value["lastCheckInAtMs"]);
|
|
13001
|
+
const expiresAtMs = toOptionalNumber(value["expiresAtMs"]);
|
|
12954
13002
|
if (!token || typeof acquiredAtMs !== "number" || typeof lastCheckInAtMs !== "number" || typeof expiresAtMs !== "number") return;
|
|
12955
13003
|
return {
|
|
12956
13004
|
token,
|
|
@@ -12961,8 +13009,8 @@ function normalizeLease(value) {
|
|
|
12961
13009
|
}
|
|
12962
13010
|
function normalizeStop(value) {
|
|
12963
13011
|
if (!isRecord$2(value)) return;
|
|
12964
|
-
const inboundMessageIds = Array.isArray(value
|
|
12965
|
-
const runId = toOptionalString(value
|
|
13012
|
+
const inboundMessageIds = Array.isArray(value["inboundMessageIds"]) ? uniqueStrings(value["inboundMessageIds"].filter((id) => typeof id === "string")) : [];
|
|
13013
|
+
const runId = toOptionalString(value["runId"]);
|
|
12966
13014
|
return runId ? {
|
|
12967
13015
|
inboundMessageIds,
|
|
12968
13016
|
runId
|
|
@@ -12971,44 +13019,44 @@ function normalizeStop(value) {
|
|
|
12971
13019
|
/** Decode stored execution state. */
|
|
12972
13020
|
function normalizeExecution(conversationId, value) {
|
|
12973
13021
|
if (!isRecord$2(value)) return;
|
|
12974
|
-
const status = normalizeExecutionStatus(value
|
|
13022
|
+
const status = normalizeExecutionStatus(value["status"]);
|
|
12975
13023
|
if (!status) return;
|
|
12976
13024
|
const pendingMessages = [];
|
|
12977
|
-
if (Array.isArray(value
|
|
12978
|
-
for (const rawMessage of value
|
|
13025
|
+
if (Array.isArray(value["pendingMessages"])) {
|
|
13026
|
+
for (const rawMessage of value["pendingMessages"]) {
|
|
12979
13027
|
const message = normalizeMessage(rawMessage);
|
|
12980
13028
|
if (!message || message.conversationId !== conversationId) return;
|
|
12981
13029
|
pendingMessages.push(message);
|
|
12982
13030
|
}
|
|
12983
13031
|
pendingMessages.sort(compareMessages);
|
|
12984
13032
|
}
|
|
12985
|
-
const inboundMessageIds = Array.isArray(value
|
|
12986
|
-
const messageSenders = withMessageSenders(normalizeMessageSenders(value
|
|
13033
|
+
const inboundMessageIds = Array.isArray(value["inboundMessageIds"]) ? uniqueStrings(value["inboundMessageIds"].map((id) => typeof id === "string" ? id : void 0).filter((id) => Boolean(id))) : [];
|
|
13034
|
+
const messageSenders = withMessageSenders(normalizeMessageSenders(value["messageSenders"]), pendingMessages);
|
|
12987
13035
|
return {
|
|
12988
13036
|
status,
|
|
12989
13037
|
inboundMessageIds: uniqueStrings([...inboundMessageIds, ...pendingMessages.map((message) => message.inboundMessageId)]),
|
|
12990
13038
|
...messageSenders ? { messageSenders } : void 0,
|
|
12991
13039
|
pendingCount: pendingMessages.length,
|
|
12992
13040
|
pendingMessages,
|
|
12993
|
-
lease: normalizeLease(value
|
|
12994
|
-
lastCheckpointAtMs: toOptionalNumber(value
|
|
12995
|
-
lastEnqueuedAtMs: toOptionalNumber(value
|
|
12996
|
-
lastProgressAtMs: toOptionalNumber(value
|
|
12997
|
-
retryCount: toOptionalNumber(value
|
|
12998
|
-
runId: toOptionalString(value
|
|
12999
|
-
updatedAtMs: toOptionalNumber(value
|
|
13041
|
+
lease: normalizeLease(value["lease"]),
|
|
13042
|
+
lastCheckpointAtMs: toOptionalNumber(value["lastCheckpointAtMs"]),
|
|
13043
|
+
lastEnqueuedAtMs: toOptionalNumber(value["lastEnqueuedAtMs"]),
|
|
13044
|
+
lastProgressAtMs: toOptionalNumber(value["lastProgressAtMs"]),
|
|
13045
|
+
retryCount: toOptionalNumber(value["retryCount"]),
|
|
13046
|
+
runId: toOptionalString(value["runId"]),
|
|
13047
|
+
updatedAtMs: toOptionalNumber(value["updatedAtMs"])
|
|
13000
13048
|
};
|
|
13001
13049
|
}
|
|
13002
13050
|
/** Decode current conversation records. */
|
|
13003
13051
|
function normalizeConversation(conversationId, value) {
|
|
13004
|
-
if (!isRecord$2(value) || value
|
|
13005
|
-
const storedConversationId = toOptionalString(value
|
|
13006
|
-
const createdAtMs = toOptionalNumber(value
|
|
13007
|
-
const lastActivityAtMs = toOptionalNumber(value
|
|
13008
|
-
const updatedAtMs = toOptionalNumber(value
|
|
13009
|
-
const execution = normalizeExecution(conversationId, value
|
|
13010
|
-
const destination = value
|
|
13011
|
-
if (storedConversationId !== conversationId || typeof createdAtMs !== "number" || typeof lastActivityAtMs !== "number" || typeof updatedAtMs !== "number" || !execution || value
|
|
13052
|
+
if (!isRecord$2(value) || value["schemaVersion"] !== CONVERSATION_SCHEMA_VERSION) return;
|
|
13053
|
+
const storedConversationId = toOptionalString(value["conversationId"]);
|
|
13054
|
+
const createdAtMs = toOptionalNumber(value["createdAtMs"]);
|
|
13055
|
+
const lastActivityAtMs = toOptionalNumber(value["lastActivityAtMs"]);
|
|
13056
|
+
const updatedAtMs = toOptionalNumber(value["updatedAtMs"]);
|
|
13057
|
+
const execution = normalizeExecution(conversationId, value["execution"]);
|
|
13058
|
+
const destination = value["destination"] === void 0 ? void 0 : parseDestination(value["destination"]);
|
|
13059
|
+
if (storedConversationId !== conversationId || typeof createdAtMs !== "number" || typeof lastActivityAtMs !== "number" || typeof updatedAtMs !== "number" || !execution || value["destination"] !== void 0 && !destination) return;
|
|
13012
13060
|
if (execution.pendingMessages.length > 0 && execution.pendingMessages.some((message) => {
|
|
13013
13061
|
if (!message.destination) return false;
|
|
13014
13062
|
return !destination || !sameDestination(message.destination, destination);
|
|
@@ -13021,10 +13069,10 @@ function normalizeConversation(conversationId, value) {
|
|
|
13021
13069
|
updatedAtMs,
|
|
13022
13070
|
execution,
|
|
13023
13071
|
...destination ? { destination } : void 0,
|
|
13024
|
-
...toOptionalString(value
|
|
13025
|
-
...toOptionalString(value
|
|
13026
|
-
...normalizeActor(value
|
|
13027
|
-
...normalizeSource(value
|
|
13072
|
+
...toOptionalString(value["title"]) ? { title: toOptionalString(value["title"]) } : void 0,
|
|
13073
|
+
...toOptionalString(value["channelName"]) ? { channelName: toOptionalString(value["channelName"]) } : void 0,
|
|
13074
|
+
...normalizeActor(value["actor"]) ? { actor: normalizeActor(value["actor"]) } : void 0,
|
|
13075
|
+
...normalizeSource(value["source"]) ? { source: normalizeSource(value["source"]) } : void 0
|
|
13028
13076
|
};
|
|
13029
13077
|
}
|
|
13030
13078
|
function emptyConversation(args) {
|
|
@@ -13116,8 +13164,8 @@ async function withIndexLock(state, indexKey, callback) {
|
|
|
13116
13164
|
}
|
|
13117
13165
|
function normalizeIndexEntry(value) {
|
|
13118
13166
|
if (!isRecord$2(value)) return;
|
|
13119
|
-
const conversationId = toOptionalString(value
|
|
13120
|
-
const score = toOptionalNumber(value
|
|
13167
|
+
const conversationId = toOptionalString(value["conversationId"]);
|
|
13168
|
+
const score = toOptionalNumber(value["score"]);
|
|
13121
13169
|
if (!conversationId || typeof score !== "number") return;
|
|
13122
13170
|
return {
|
|
13123
13171
|
conversationId,
|
|
@@ -13149,7 +13197,8 @@ function parseRedisIndexEntries(values) {
|
|
|
13149
13197
|
const entries = [];
|
|
13150
13198
|
for (let index = 0; index < values.length; index += 2) {
|
|
13151
13199
|
const conversationId = toOptionalString(values[index]);
|
|
13152
|
-
const
|
|
13200
|
+
const rawScore = values[index + 1];
|
|
13201
|
+
const score = typeof rawScore === "number" ? rawScore : Number(rawScore);
|
|
13153
13202
|
if (!conversationId || !Number.isFinite(score)) continue;
|
|
13154
13203
|
entries.push({
|
|
13155
13204
|
conversationId,
|
|
@@ -15390,7 +15439,6 @@ function recordDeliveredAssistantMessage(args) {
|
|
|
15390
15439
|
},
|
|
15391
15440
|
meta: {
|
|
15392
15441
|
...objectCards?.length ? { objectCards } : void 0,
|
|
15393
|
-
...args.quiet ? { quiet: args.quiet } : void 0,
|
|
15394
15442
|
replied: true,
|
|
15395
15443
|
...args.source ? { source: args.source } : void 0
|
|
15396
15444
|
}
|
|
@@ -15761,10 +15809,10 @@ async function resolveConversationTitle(args) {
|
|
|
15761
15809
|
/** Serialize one in-memory message into its event-backed write shape. */
|
|
15762
15810
|
function toStoredConversationMessage(message) {
|
|
15763
15811
|
const meta = {};
|
|
15764
|
-
if (message.author) meta
|
|
15812
|
+
if (message.author) meta["author"] = message.author;
|
|
15765
15813
|
const { replied, ...restMeta } = message.meta ?? {};
|
|
15766
15814
|
Object.assign(meta, restMeta);
|
|
15767
|
-
if (replied === false) meta
|
|
15815
|
+
if (replied === false) meta["replied"] = false;
|
|
15768
15816
|
return {
|
|
15769
15817
|
messageId: message.id,
|
|
15770
15818
|
role: message.role,
|
|
@@ -16332,4 +16380,4 @@ async function recordGuardianActionReviewed(args) {
|
|
|
16332
16380
|
createdAtMs: Date.now()
|
|
16333
16381
|
}]);
|
|
16334
16382
|
}
|
|
16335
|
-
export { loadTurnCheckpoint as $, workspaceRepoCheckoutPath as $a, setWorkspaceSnapshotBuild as $i, resolvePluginOAuthAccount as $n, isSlackRequestTimeout as $o, EVERYONE_ASSIGNEE as $r, TurnSliceLimitExceededError as $t, latestConversationMessageSeq as A, updateSlackMessage as Aa, getDashboardLinkFilter as Ai, isStandaloneRuntimeContextMessage as An, readLatestConversationBrief as Ao, countReviewItemsNeedingUser as Ar, getConversationWorkStates as At, getAgentContextInputLimitTokens as B, isWorkspaceSnapshotNotReadyError as Ba, createPluginState as Bi, SCRIPT_TOOLS_SECTION_TAG as Bn, getSlackFileId as Bo, updateReviewItemContent as Br, recordConversationRetry as Bt, settleConversationTitleWork as C, getSlackMessagePermalink as Ca, bindSlackDirectCredentialSubject as Ci, getTerminalAssistantMessages as Cn, conversationIsMemberRoot as Co, saveNotificationSchedule as Cr, configValueSchema as Cs, countPendingConversationMessages as Ct, estimateConversationMessagesTokens as D, postSlackMessage as Da, verifyTimerWatchCredentialSubject as Di, instructionTextForProjection as Dn, viewerMarksFromParticipant as Do, createPluginReviewItems as Dr, getConfigDefaults as Ds, dropPendingMessages as Dt, buildConversationContext as E, postSlackEphemeralMessage as Ea, verifySlackDirectCredentialSubject as Ei, hasTurnInput as En, conversationViewerMarks as Eo, projectConversationMessages as Er, projectConversationEvents$1 as Es, drainConversationMailbox as Et, turnHasReply as F, isAlreadyExistsError as Fa, getDashboardTaskLink as Fi, retainRuntimeTurnContext as Fn, readConversationMessageEventSeq as Fo, listReplyActionItems as Fr, listActiveConversationIds as Ft, AuthPausePersistenceError as G, createSandboxEgressCredentialToken as Ga, getWorkspaceByName as Gi, readParentAgentTask as Gn, slackAttachmentsVersionQuery as Go, canUserReadReviewItem as Gr, startConversationWork as Gt, PluginCredentialFailureError as H, clearSandboxEgressSignals as Ha, createWorkspace as Hi, TURN_CONTEXT_TAG as Hn, readAttachmentVisionSummary as Ho, canActOnReviewItem as Hr, releaseInboundMessage as Ht, upsertConversationMessage as I, throwSandboxOperationError as Ia, isDashboardLink as Ii, stripRuntimeTurnContext as In, buildSentryConversationUrl as Io, listWaitingConversations as Ir, markConversationWorkEnqueued as It, abandonReplacedPendingAuth as J, buildSandboxEgressNetworkPolicy as Ja, updateWorkspace as Ji, renderUntrustedTag as Jn, getFilePermalink as Jo, requireReviewItemAssignees as Jr, takeDeferredConversationMove as Jt, AuthorizationFlowDisabledError as K, parseSandboxEgressCredentialToken as Ka, listWorkspaces as Ki, renderChildTag as Kn, SlackActionError as Ko, isOnlyAssignee as Kr, steerWebPendingMessages as Kt, calculateContextCompactionTargetTokens as L, wrapSandboxSetupError as La, parseDashboardConversationLink as Li, trimTrailingAssistantMessages as Ln, FORK_INSTRUCTIONS as Lo, reviewItemsNeedingUserVersionQuery as Lr, moveIdleConversationDestination as Lt, normalizeConversationText as M, slackEntitySchema as Ma, getDashboardPersonLink as Mi, isToolResultMessage as Mn, readConversationEventPageAfter as Mo, getOpenReviewItemByDedupeKey as Mr, hasRunnableConversationWork as Mt, recordDeliveredAssistantMessage as N, slackExternalRefIdSchema as Na, getDashboardReviewItemLink as Ni, latestTurnContextSection as Nn, readConversationEventPageAround as No, getReviewItem as Nr, isFinalAttempt as Nt, getConversationMessageSlackTs as O, removeReactionFromMessage as Oa, JUNIOR_THREAD_STATE_TTL_MS as Oi, isAssistantMessage as On, createPluginConversationEvents as Oo, REVIEW_ITEM_REPLIED_REASON as Or, setConfigDefaults as Os, getConversation as Ot, trimConversationMessages as P, isAbortError as Pa, getDashboardSettingsLink as Pi, normalizeToolNameFromResult as Pn, readConversationLastEventSeq as Po, insertReviewItem as Pr, isInvalidConversationRecordError as Pt, continuableMessages as Q, tryWorkspaceRepoCheckoutPath as Qa, setWorkspaceSnapshot as Qi, getOAuthAccountProviders as Qn, isDmChannel as Qo, reviewItemReaderForUserInConversation as Qr, TurnBudgetExceededError as Qt, getAgentBackgroundCompactionMarkTokens as R, WorkspaceSnapshotNotReadyError as Ra, parseDashboardPersonLink as Ri, CAPABILITY_SECTION_TAG as Rn, loadForkHistory as Ro, searchReviewItems as Rr, pruneActiveConversation as Rt, resolveConversationTitle as S, deleteSlackMessage as Sa, bindScheduledAutomationCredentialSubject as Si, getPiMessageRole as Sn, conversationHasParticipantUser as So, readNotificationSchedule as Sr, createDurableLocationConfigurationService as Ss, completeConversationWork as St, resolveTaskTitle as T, openSlackModal as Ta, verifyScheduledAutomationCredentialSubject as Ti, hasRuntimeTurnContext as Tn, conversationPinnedForUser as To, isPausedBySlack as Tr, piMessageFromHistoryItem as Ts, deferConversationMove as Tt, createPluginAuthOrchestration as U, consumeSandboxEgressAuthRequiredSignal as Ua, deleteWorkspace as Ui, escapeClosingTags as Un, readSlackAttachmentSource as Uo, canAgentChangeReviewItem as Ur, requestAnotherSlice as Ut, createPluginEgress as V, workspaceSnapshotNotReadyUserMessage as Va, renderToolResultNudge as Vi, SESSION_CONTEXT_SECTION_TAG as Vn, matchSlackAttachments as Vo, PLUGIN_REVIEW_ITEM_KEY_PREFIX as Vr, releaseConversationWork as Vt, authorizationId as W, consumeSandboxEgressPermissionDeniedSignal as Wa, getWorkspace as Wi, escapeTagText as Wn, recordSlackAttachment as Wo, canReadReviewItem as Wr, requestConversationWork as Wt, clearPendingAuth as X, normalizeSandboxEgressTracePropagationDomains as Xa, invalidateReadySnapshot as Xi, SANDBOX_EGRESS_AUTH_REQUIRED_MARKER as Xn, getSlackClient as Xo, reviewItemNeedsSomeone as Xr, GATED_TURN_LIMIT_WRAP_UP_MESSAGE as Xt, canReusePendingAuthLink as Y, resolveSandboxCommandEnvironment as Ya, WorkspaceValidationError as Yi, tagJson as Yn, getHeaderString as Yo, requireReviewItemLinks as Yr, readInboundMessageSender as Yt, getConversationPendingAuth as Z, SANDBOX_RUNTIME as Za, loadSnapshotsForProfile as Zi, createUserTokenStore as Zn, isConversationScopedChannel as Zo, reviewItemReaderForUser as Zr, TURN_LIMIT_WRAP_UP_MESSAGE as Zt, appendConversationMessages as _, slackMention as _a, findMatchingWatches as _i, CODE_MODE_CALL_STATUS_TEXT as _n, createPluginLogger as _o, readWebPushConfig as _r, lookupSlackUser as _s, checkInConversationWork as _t, loadProjection as a, isVercelSandboxEgressRequest as aa, resolveChannelCapabilities as ai, isAnswerToolName as an, SANDBOX_COMMAND_PATH as ao, getPluginRoutes as ar, getWorkspaceTeamId as as, failTurnRecord as at, persistConversationMessages as b, truncateStatusText as ba, takeDueTimerWatches as bi, persistWithRetry as bn, createConversationAccessReader as bo, deletePushSubscription as br, credentialAuditSource as bs, clearExpiredConversationLease as bt, recordAgentsInstructionsUpdated as c, formatProviderLabel as ca, RESOURCE_SUBSCRIPTION_MAX_TTL_MS as ci, replyTextSchema as cn, SANDBOX_SKILLS_ROOT as co, getPluginTools as cr, resolveRootVisibility as cs, listTurnSummaries as ct, recordAuthorizationCompleted as d, startOAuthFlow as da, cancelSubscriptions as di, sanitizeAssistantText as dn, sandboxSkillFile as do, getStaticPluginToolDefinitions as dr, saveObjectAnnotations as ds, CONVERSATION_WORK_STALE_ENQUEUE_MS as dt, create as ea, activeParticipantUserIds as ei, TurnToolCallLimitExceededError as en, ToolInputError as eo, agent_hooks_exports as er, normalizeSlackConversationId as es, lostWorkerBeforeFirstSave as et, recordAuthorizationRequested as f, SLACK_USER_MENTION_RE as fa, cancelWatch as fi, NO_REPLY_TOOL_NAME as fn, sandboxSkillPathResolution as fo, setPlugins as fr, createPluginAnnotations as fs, ackMessages as ft, recordToolExecutionStarted as g, normalizeSlackStatusText as ga, deliverWatch as gi, CODEMODE_TOOL_NAME as gn, createPluginModelCostRecorder as go, setBriefsConfig as gr, resolveUserTimezone as gs, cancelHumanFacingPendingMessages as gt, recordSubscribedReplyRoute as h, normalizeSlackReplyMarkdown as ha, createWatch as hi, readNoReply as hn, runNonInteractiveCommand as ho, registration_exports as hr, defaultTimezone as hs, beginConversationResume as ht, loadConversationProjection as i, getSandboxProvider as ia, createCodeChangePublisher as ii, REPLY_TOOL_NAME as in, createPluginModel as io, getPluginApiRoutes as ir, sleep$2 as is, completeTurnRecord as it, markConversationMessage as j, uploadFilesToConversation as ja, getDashboardObjectIconLink as ji, isToolResultError as jn, readConversationEventPage as jo, dismissOpenReviewItems as jr, hasConversationStop as jt, isHumanConversationMessage as k, unfurlSlackLinks as ka, getDashboardConversationLink as ki, isContinuablePiBoundary as kn, readConversationBriefThrough as ko, closeReviewItem as kr, getConversationWorkState as kt, recordAttachmentsDelivered as l, parseOAuthStatePayload as la, RESOURCE_WATCH_TOOL_SOURCE as li, decideReply as ln, SANDBOX_WORKSPACE_ROOT as lo, getPluginUserPromptContributions as lr, searchConversations as ls, recordTurnSummary as lt, recordMcpProviderConnected as m, formatSlackLink as ma, createTimerWatch as mi, isLegacyNoReplyMarker as mn, buildNonInteractiveShellScript as mo, coreTaskRegistrations as mr, listConversationAnnotationsById as ms, appendInboundMessage as mt, commitMessages as n, isStale as na, resolveAssignee as ni, createTurnLimitGate as nn, PluginToolDeniedError as no, createPluginEventPublisher as nr, streamPrivateSlackFile as ns, saveTurnCheckpoint as nt, loadTurnProjection as o, proxyVercelSandboxEgressRequest as oa, getSlackToolContext as oi, readTurnAnswer as on, SANDBOX_DATA_ROOT as oo, getPluginSlackConversationLink as or, runWithWorkspaceTeamId as os, getStoredTurnFields as ot, recordGuardianActionReviewed as p, escapeSlackMrkdwnText as pa, collectEventMatchKeys as pi, findLegacyNoReplyMarker as pn, buildCommandScript as po, validatePlugins as pr, listConversationAnnotations as ps, appendExclusiveInboundMessage as pt, AuthorizationPauseError as q, sandboxEgressSignalsResponseSchema as qa, listWorkspacesByRepository as qi, renderTag as qn, downloadPrivateSlackFile as qo, readReviewItemAgentScope as qr, stopConversationWork as qt, loadConnectedMcpProviders as r, ensureDockerDaemon as ra, resolveAssignees as ri, isTurnExecutionLimitExceededError as rn, createPluginEmbedder as ro, createPluginHookRunner as rr, withSlackRetries as rs, abandonTurnRecord as rt, openConversationProjection as s, deliverOAuthAuthorization as sa, RESOURCE_SUBSCRIPTION_DEFAULT_TTL_MS as si, remindMissingAnswer as sn, SANDBOX_REPOS_ROOT as so, getPluginSystemPromptContributions as sr, AttachmentSourceUnavailableError as ss, getTurnRecord as st, commitAcceptedReply as t, hash as ta, automationCreatorUserId as ti, buildTurnErrorResponse as tn, isToolInputError as to, applyPluginFormatMarkdown as tr, runWithSlackInstallationToken as ts, pauseLostWorkerTurn as tt, recordAuthenticationLinked as u, resolveBaseUrl as ua, STOP_WATCHING_TOOL_NAME as ui, getAssistantReplyText as un, sandboxSkillDir as uo, getPlugins as ur, createConversationEmbedder as us, CONVERSATION_WORK_CHECK_IN_INTERVAL_MS as ut, hydrateConversationMessages as v, slackMentionedUserIds as va, getWatch as vi, REPORT_BLOCKED_TOOL_NAME as vn, canAccessConversation as vo, sendPushNotificationToUser as vr, lookupSlackUserNames as vs, claimInboundMessage as vt, fallbackShortTitle as w, openSlackDirectMessage as wa, verifyEventAutomationCredentialSubject as wi, getUserMessageInstructionText as wn, conversationIsNotUnsubscribedRoot as wo, savePushSubscription as wr, historyItemFromPiMessage as ws, deadLetterAttempt as wt, toStoredConversationMessage as x, addReactionToMessage as xa, bindEventAutomationCredentialSubject as xi, extractAssistantText as xn, readConversationAccessFromSql as xo, listPushSubscriptions as xr, createPluginCache as xs, completeConversationStop as xt, persistConversationMessageWindow as y, wrapBareSlackUserIds as ya, listWatches as yi, readBlockedReport as yn, canAddConversationMessages as yo, resolveNotificationTimezone as yr, credentialAuditAttributes as ys, clearConsumedConversationWake as yt, getAgentContextCompactionTriggerTokens as z, getWorkspaceSnapshotNotReadyError as za, setDashboardConversationLinkOptions as zi, REQUEST_CONTEXT_SECTION_TAG as zn, notInheritedByForkChild as zo, takeReviewItem as zr, recordAttemptFailure as zt };
|
|
16383
|
+
export { loadTurnCheckpoint as $, SANDBOX_RUNTIME as $a, loadSnapshotsForProfile as $i, resolvePluginOAuthAccount as $n, isConversationScopedChannel as $o, reviewItemReaderForUser as $r, TurnSliceLimitExceededError as $t, latestConversationMessageSeq as A, removeReactionFromMessage as Aa, JUNIOR_THREAD_STATE_TTL_MS as Ai, isStandaloneRuntimeContextMessage as An, createPluginConversationEvents as Ao, countOpenReviewItemsForUser as Ar, setConfigDefaults as As, getConversationWorkStates as At, getAgentContextInputLimitTokens as B, WorkspaceSnapshotNotReadyError as Ba, parseDashboardPersonLink as Bi, SCRIPT_TOOLS_SECTION_TAG as Bn, loadForkHistory as Bo, takeReviewItem as Br, recordConversationRetry as Bt, settleConversationTitleWork as C, addReactionToMessage as Ca, bindEventAutomationCredentialSubject as Ci, getTerminalAssistantMessages as Cn, readConversationAccessFromSql as Co, saveNotificationSchedule as Cr, createPluginCache as Cs, countPendingConversationMessages as Ct, estimateConversationMessagesTokens as D, openSlackModal as Da, verifyScheduledAutomationCredentialSubject as Di, instructionTextForProjection as Dn, conversationPinnedForUser as Do, createPluginReviewItems as Dr, piMessageFromHistoryItem as Ds, dropPendingMessages as Dt, buildConversationContext as E, openSlackDirectMessage as Ea, verifyEventAutomationCredentialSubject as Ei, hasTurnInput as En, conversationIsNotUnsubscribedRoot as Eo, projectConversationMessages as Er, historyItemFromPiMessage as Es, drainConversationMailbox as Et, turnHasReply as F, slackExternalRefIdSchema as Fa, getDashboardReviewItemLink as Fi, retainRuntimeTurnContext as Fn, readConversationEventPageAround as Fo, insertReviewItem as Fr, listActiveConversationIds as Ft, AuthPausePersistenceError as G, consumeSandboxEgressAuthRequiredSignal as Ga, deleteWorkspace as Gi, readParentAgentTask as Gn, readSlackAttachmentSource as Go, canReadReviewItem as Gr, startConversationWork as Gt, PluginCredentialFailureError as H, isWorkspaceSnapshotNotReadyError as Ha, createPluginState as Hi, TURN_CONTEXT_TAG as Hn, getSlackFileId as Ho, PLUGIN_REVIEW_ITEM_KEY_PREFIX as Hr, releaseInboundMessage as Ht, upsertConversationMessage as I, isAbortError as Ia, getDashboardSettingsLink as Ii, stripRuntimeTurnContext as In, readConversationLastEventSeq as Io, listReplyActionItems as Ir, markConversationWorkEnqueued as It, abandonReplacedPendingAuth as J, parseSandboxEgressCredentialToken as Ja, listWorkspaces as Ji, renderUntrustedTag as Jn, SlackActionError as Jo, itemNeedsUser as Jr, takeDeferredConversationMove as Jt, AuthorizationFlowDisabledError as K, consumeSandboxEgressPermissionDeniedSignal as Ka, getWorkspace as Ki, renderChildTag as Kn, recordSlackAttachment as Ko, canUserReadReviewItem as Kr, steerWebPendingMessages as Kt, calculateContextCompactionTargetTokens as L, isAlreadyExistsError as La, getDashboardTaskLink as Li, trimTrailingAssistantMessages as Ln, readConversationMessageEventSeq as Lo, listWaitingConversations as Lr, moveIdleConversationDestination as Lt, normalizeConversationText as M, updateSlackMessage as Ma, getDashboardLinkFilter as Mi, isToolResultMessage as Mn, readLatestConversationBrief as Mo, dismissOpenReviewItems as Mr, hasRunnableConversationWork as Mt, recordDeliveredAssistantMessage as N, uploadFilesToConversation as Na, getDashboardObjectIconLink as Ni, latestTurnContextSection as Nn, readConversationEventPage as No, getOpenReviewItemByDedupeKey as Nr, isFinalAttempt as Nt, getConversationMessageSlackTs as O, postSlackEphemeralMessage as Oa, verifySlackDirectCredentialSubject as Oi, isAssistantMessage as On, conversationViewerMarks as Oo, REVIEW_ITEM_REPLIED_REASON as Or, projectConversationEvents$1 as Os, getConversation as Ot, trimConversationMessages as P, slackEntitySchema as Pa, getDashboardPersonLink as Pi, normalizeToolNameFromResult as Pn, readConversationEventPageAfter as Po, getReviewItem as Pr, isInvalidConversationRecordError as Pt, continuableMessages as Q, normalizeSandboxEgressTracePropagationDomains as Qa, invalidateReadySnapshot as Qi, getOAuthAccountProviders as Qn, getSlackClient as Qo, reviewItemNeedsSomeone as Qr, TurnBudgetExceededError as Qt, getAgentBackgroundCompactionMarkTokens as R, throwSandboxOperationError as Ra, isDashboardLink as Ri, CAPABILITY_SECTION_TAG as Rn, buildSentryConversationUrl as Ro, reviewItemsNeedingUserVersionQuery as Rr, pruneActiveConversation as Rt, resolveConversationTitle as S, truncateStatusText as Sa, takeDueTimerWatches as Si, getPiMessageRole as Sn, createConversationAccessReader as So, readNotificationSchedule as Sr, credentialAuditSource as Ss, completeConversationWork as St, resolveTaskTitle as T, getSlackMessagePermalink as Ta, bindSlackDirectCredentialSubject as Ti, hasRuntimeTurnContext as Tn, conversationIsMemberRoot as To, isPausedBySlack as Tr, configValueSchema as Ts, deferConversationMove as Tt, createPluginAuthOrchestration as U, workspaceSnapshotNotReadyUserMessage as Ua, renderToolResultNudge as Ui, escapeClosingTags as Un, matchSlackAttachments as Uo, canActOnReviewItem as Ur, requestAnotherSlice as Ut, createPluginEgress as V, getWorkspaceSnapshotNotReadyError as Va, setDashboardConversationLinkOptions as Vi, SESSION_CONTEXT_SECTION_TAG as Vn, notInheritedByForkChild as Vo, updateReviewItemContent as Vr, releaseConversationWork as Vt, authorizationId as W, clearSandboxEgressSignals as Wa, createWorkspace as Wi, escapeTagText as Wn, readAttachmentVisionSummary as Wo, canAgentChangeReviewItem as Wr, requestConversationWork as Wt, clearPendingAuth as X, buildSandboxEgressNetworkPolicy as Xa, updateWorkspace as Xi, SANDBOX_EGRESS_AUTH_REQUIRED_MARKER as Xn, getFilePermalink as Xo, requireReviewItemAssignees as Xr, GATED_TURN_LIMIT_WRAP_UP_MESSAGE as Xt, canReusePendingAuthLink as Y, sandboxEgressSignalsResponseSchema as Ya, listWorkspacesByRepository as Yi, tagJson as Yn, downloadPrivateSlackFile as Yo, readReviewItemAgentScope as Yr, readInboundMessageSender as Yt, getConversationPendingAuth as Z, resolveSandboxCommandEnvironment as Za, WorkspaceValidationError as Zi, createUserTokenStore as Zn, getHeaderString as Zo, requireReviewItemLinks as Zr, TURN_LIMIT_WRAP_UP_MESSAGE as Zt, appendConversationMessages as _, normalizeSlackReplyMarkdown as _a, createWatch as _i, CODE_MODE_CALL_STATUS_TEXT as _n, runNonInteractiveCommand as _o, readWebPushConfig as _r, defaultTimezone as _s, checkInConversationWork as _t, loadProjection as a, ensureDockerDaemon as aa, resolveAssignees as ai, isAnswerToolName as an, createPluginEmbedder as ao, getPluginRoutes as ar, withSlackRetries as as, failTurnRecord as at, persistConversationMessages as b, slackMentionedUserIds as ba, getWatch as bi, persistWithRetry as bn, canAccessConversation as bo, deletePushSubscription as br, lookupSlackUserNames as bs, clearExpiredConversationLease as bt, recordAgentsInstructionsUpdated as c, proxyVercelSandboxEgressRequest as ca, getSlackToolContext as ci, replyTextSchema as cn, SANDBOX_DATA_ROOT as co, getPluginTools as cr, runWithWorkspaceTeamId as cs, listTurnSummaries as ct, recordAuthorizationCompleted as d, parseOAuthStatePayload as da, RESOURCE_WATCH_TOOL_SOURCE as di, sanitizeAssistantText as dn, SANDBOX_WORKSPACE_ROOT as do, getStaticPluginToolDefinitions as dr, searchConversations as ds, CONVERSATION_WORK_STALE_ENQUEUE_MS as dt, setWorkspaceSnapshot as ea, reviewItemReaderForUserInConversation as ei, TurnToolCallLimitExceededError as en, tryWorkspaceRepoCheckoutPath as eo, agent_hooks_exports as er, isDmChannel as es, lostWorkerBeforeFirstSave as et, recordAuthorizationRequested as f, resolveBaseUrl as fa, STOP_WATCHING_TOOL_NAME as fi, NO_REPLY_TOOL_NAME as fn, sandboxSkillDir as fo, setPlugins as fr, createConversationEmbedder as fs, ackMessages as ft, recordToolExecutionStarted as g, formatSlackLink as ga, createTimerWatch as gi, CODEMODE_TOOL_NAME as gn, buildNonInteractiveShellScript as go, setBriefsConfig as gr, listConversationAnnotationsById as gs, cancelHumanFacingPendingMessages as gt, recordSubscribedReplyRoute as h, escapeSlackMrkdwnText as ha, collectEventMatchKeys as hi, readNoReply as hn, buildCommandScript as ho, registration_exports as hr, listConversationAnnotations as hs, beginConversationResume as ht, loadConversationProjection as i, isStale as ia, resolveAssignee as ii, REPLY_TOOL_NAME as in, PluginToolDeniedError as io, getPluginApiRoutes as ir, streamPrivateSlackFile as is, completeTurnRecord as it, markConversationMessage as j, unfurlSlackLinks as ja, getDashboardConversationLink as ji, isToolResultError as jn, readConversationBriefThrough as jo, countReviewItemsNeedingUserBySubject as jr, hasConversationStop as jt, isHumanConversationMessage as k, postSlackMessage as ka, verifyTimerWatchCredentialSubject as ki, isContinuablePiBoundary as kn, viewerMarksFromParticipant as ko, closeReviewItem as kr, getConfigDefaults as ks, getConversationWorkState as kt, recordAttachmentsDelivered as l, deliverOAuthAuthorization as la, RESOURCE_SUBSCRIPTION_DEFAULT_TTL_MS as li, decideReply as ln, SANDBOX_REPOS_ROOT as lo, getPluginUserPromptContributions as lr, AttachmentSourceUnavailableError as ls, recordTurnSummary as lt, recordMcpProviderConnected as m, SLACK_USER_MENTION_RE as ma, cancelWatch as mi, isLegacyNoReplyMarker as mn, sandboxSkillPathResolution as mo, coreTaskRegistrations as mr, createPluginAnnotations as ms, appendInboundMessage as mt, commitMessages as n, create as na, activeParticipantUserIds as ni, createTurnLimitGate as nn, ToolInputError as no, createPluginEventPublisher as nr, normalizeSlackConversationId as ns, saveTurnCheckpoint as nt, loadTurnProjection as o, getSandboxProvider as oa, createCodeChangePublisher as oi, readTurnAnswer as on, createPluginModel as oo, getPluginSlackConversationLink as or, sleep$2 as os, getStoredTurnFields as ot, recordGuardianActionReviewed as p, startOAuthFlow as pa, cancelSubscriptions as pi, findLegacyNoReplyMarker as pn, sandboxSkillFile as po, validatePlugins as pr, saveObjectAnnotations as ps, appendExclusiveInboundMessage as pt, AuthorizationPauseError as q, createSandboxEgressCredentialToken as qa, getWorkspaceByName as qi, renderTag as qn, slackAttachmentsVersionQuery as qo, isOnlyAssignee as qr, stopConversationWork as qt, loadConnectedMcpProviders as r, hash as ra, automationCreatorUserId as ri, isTurnExecutionLimitExceededError as rn, isToolInputError as ro, createPluginHookRunner as rr, runWithSlackInstallationToken as rs, abandonTurnRecord as rt, openConversationProjection as s, isVercelSandboxEgressRequest as sa, resolveChannelCapabilities as si, remindMissingAnswer as sn, SANDBOX_COMMAND_PATH as so, getPluginSystemPromptContributions as sr, getWorkspaceTeamId as ss, getTurnRecord as st, commitAcceptedReply as t, setWorkspaceSnapshotBuild as ta, EVERYONE_ASSIGNEE as ti, buildTurnErrorResponse as tn, workspaceRepoCheckoutPath as to, applyPluginFormatMarkdown as tr, isSlackRequestTimeout as ts, pauseLostWorkerTurn as tt, recordAuthenticationLinked as u, formatProviderLabel as ua, RESOURCE_SUBSCRIPTION_MAX_TTL_MS as ui, getAssistantReplyText as un, SANDBOX_SKILLS_ROOT as uo, getPlugins as ur, resolveRootVisibility as us, CONVERSATION_WORK_CHECK_IN_INTERVAL_MS as ut, hydrateConversationMessages as v, normalizeSlackStatusText as va, deliverWatch as vi, REPORT_BLOCKED_TOOL_NAME as vn, createPluginModelCostRecorder as vo, sendPushNotificationToUser as vr, resolveUserTimezone as vs, claimInboundMessage as vt, fallbackShortTitle as w, deleteSlackMessage as wa, bindScheduledAutomationCredentialSubject as wi, getUserMessageInstructionText as wn, conversationHasParticipantUser as wo, savePushSubscription as wr, createDurableLocationConfigurationService as ws, deadLetterAttempt as wt, toStoredConversationMessage as x, wrapBareSlackUserIds as xa, listWatches as xi, extractAssistantText as xn, canAddConversationMessages as xo, listPushSubscriptions as xr, credentialAuditAttributes as xs, completeConversationStop as xt, persistConversationMessageWindow as y, slackMention as ya, findMatchingWatches as yi, readBlockedReport as yn, createPluginLogger as yo, resolveNotificationTimezone as yr, lookupSlackUser as ys, clearConsumedConversationWake as yt, getAgentContextCompactionTriggerTokens as z, wrapSandboxSetupError as za, parseDashboardConversationLink as zi, REQUEST_CONTEXT_SECTION_TAG as zn, FORK_INSTRUCTIONS as zo, searchReviewItems as zr, recordAttemptFailure as zt };
|