@sentry/junior 0.278.0 → 0.279.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-BXosqTMx.js → adapter-phTTgw7H.js} +1 -1
- package/dist/{admin-Thn7NfOi.js → admin-PcpJDugZ.js} +1 -1
- package/dist/{agent-invocations-D7c4BQGc.js → agent-invocations-CUg_SODU.js} +0 -1
- package/dist/{agent-runner-DE-43MPb.js → agent-runner-DwvT1BY0.js} +76 -35
- package/dist/api/schema.d.ts +2 -2
- package/dist/api/schema.js +5 -5
- package/dist/api.d.ts +1 -1
- package/dist/api.js +37 -367
- package/dist/{app-CHNS-AX2.d.ts → app-DVs6noo7.d.ts} +3 -3
- package/dist/app.d.ts +1 -1
- package/dist/app.js +460 -77
- package/dist/{assistant-reply-pauL6qyn.js → assistant-reply-BXfxczd7.js} +1 -1
- package/dist/{automation-DphoTRYl.js → automation-BehArCcq.js} +1 -1
- package/dist/{background-compaction-queue-CAL4A2y7.js → background-compaction-queue-CcbuLJrZ.js} +2 -2
- package/dist/{briefs-4fyPJJEu.js → briefs-Dd_ezwED.js} +10 -9
- package/dist/{catalog-runtime-BoOb5oUv.js → catalog-runtime-BWVMeZhW.js} +2 -2
- package/dist/cli/chat.js +16 -16
- package/dist/cli/check.js +3 -3
- package/dist/cli/main.js +4 -4
- package/dist/cli/plugins.js +5 -5
- package/dist/cli/snapshot-create.js +4 -4
- package/dist/cli/upgrade.d.ts +1 -1
- package/dist/cli/upgrade.js +4 -4
- package/dist/{client-v_OVYuHZ.js → client-Bpxe4vKa.js} +7 -3
- package/dist/{config-o2jLRY5J.js → config-C_bmRhrJ.js} +2 -2
- package/dist/{connections-RC4NXAx8.js → connections-B2rHe5W5.js} +10 -10
- package/dist/{conversation-CZfyQvdm.js → conversation-CIiJtx5q.js} +6 -1
- package/dist/conversation-pending-messages-CnBvE6-6.js +173 -0
- package/dist/{conversation-privacy-C23M8KaD.js → conversation-privacy-CzOfcz0U.js} +1 -1
- package/dist/{credential-sync-Dd0WyNfF.js → credential-sync-Dal_unpv.js} +15 -15
- package/dist/{db-BjLzDJCt.d.ts → db-CyLrV9C7.d.ts} +1 -1
- package/dist/{executor-CJfsD0VX.js → executor-BfYH-Wws.js} +6 -4
- package/dist/instrumentation.d.ts +12 -0
- package/dist/instrumentation.js +56 -23
- package/dist/{logging-dFaXvBRK.js → logging-CkT3_Xxp.js} +2 -2
- package/dist/{message-DSwxIZet.js → message-Q5dkgaJ5.js} +10 -10
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +18 -6
- package/dist/{oauth-callback-server-CDcuCp27.js → oauth-callback-server-BDRaqe8O.js} +2 -2
- package/dist/{oauth-relay-C6ZAyJgf.js → oauth-relay-D0G3T16m.js} +1 -1
- package/dist/{package-discovery-DJBompdd.js → package-discovery-DJhGdS4c.js} +1 -1
- package/dist/{plugins-DOm9Y6qI.js → plugins-HYh_JOdw.js} +1 -1
- package/dist/{projection-BTge9wrH.js → projection-DWxX7pb1.js} +122 -44
- package/dist/{prompt-DDtCnlHP.js → prompt--dwus7Y-.js} +1 -1
- package/dist/proxy-path-BHYoKZdq.js +15 -0
- package/dist/{registry-Cp6CNmtP.js → registry-DnrdeO4s.js} +2 -2
- package/dist/{resolve-B_7h2cXx.js → resolve-C_QXfqD_.js} +3 -3
- package/dist/{result-5LBEfnLX.js → result-DNmOxT-N.js} +10 -10
- package/dist/{runner-C5-S4oq-.js → runner-zd_noJ1l.js} +11 -11
- package/dist/{sandbox-egress-signals-B4GehT1L.js → sandbox-egress-signals-DQjv-nbG.js} +1 -1
- package/dist/{schema-B5fpczDw.js → schema-CNJNzvr8.js} +5 -68
- package/dist/{schema-Tr484cCC.d.ts → schema-e90H5FIN.d.ts} +988 -1
- package/dist/sentry-BRTJqumy.js +51 -0
- package/dist/sentry-DrKC2NeM.d.ts +1 -0
- package/dist/sentry-route-name-BhwWnfqj.js +51 -0
- package/dist/{service-account-Cq_dLrZJ.js → service-account-BK26XlHo.js} +3 -3
- package/dist/{service-account-BkEv20zf.js → service-account-CCH2Hv4h.js} +3 -3
- package/dist/{session-stop-BsS4qFS2.js → session-stop-6Tf--T7G.js} +14 -14
- package/dist/{skills-M0BA0_s6.js → skills-BNrk8gi4.js} +4 -4
- package/dist/{spawn-BO3y7H4d.js → spawn-C75hAB9l.js} +3 -3
- package/dist/{stop-D5R82Wla.js → stop-RYbf7PWi.js} +516 -172
- package/dist/{store-BGBzQWNf.js → store-CO5vGjwD.js} +5 -5
- package/dist/{store-CGJZTEVz.js → store-G3h2djJU.js} +3 -3
- package/dist/{task-queue-UD27ei2U.js → task-queue-DlN58XeM.js} +3 -3
- package/dist/{task-runner-noxjOjkM.js → task-runner-B-Bdm23d.js} +21 -9
- package/dist/{thread-state-BSu6rM6p.js → thread-state-Cj_7Slru.js} +4 -4
- package/dist/{turn-failure-response-wahwyPrZ.js → turn-failure-response-CE7gaoC7.js} +7 -7
- package/dist/{turn-lifecycle-Bo4Trccw.js → turn-lifecycle-7sXwXLJ6.js} +1 -1
- package/dist/{turn-session-routing-DnSaaEpn.js → turn-session-routing-FBdaH1zf.js} +10 -10
- package/dist/{validation-B9-8iKyw.js → validation-DLWxEzWW.js} +2 -2
- package/dist/{version-C7HejFP2.js → version-DtQ8WFIZ.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-DLXajQZE.js → viewer-vsM8_90o.js} +5 -5
- package/dist/{work-DRGSlfia.js → work-DsoFRO_0.js} +10 -10
- package/dist/{worker-BGh5Dwc6.js → worker-6kZEsCXs.js} +7 -7
- package/migrations/0077_drop_agent_invocation_model_profile.sql +1 -0
- package/migrations/0078_plugin_conversation_index.sql +20 -0
- package/migrations/0079_conversation_event_author_index.sql +20 -0
- package/migrations/meta/0077_snapshot.json +4141 -0
- package/migrations/meta/0078_snapshot.json +4175 -0
- package/migrations/meta/0079_snapshot.json +4203 -0
- package/migrations/meta/_journal.json +21 -0
- package/package.json +5 -5
- package/dist/common-Eu6sx09c.js +0 -107
- package/dist/rolldown-runtime-nwUcYXjP.js +0 -27
- package/dist/sentry-MDkYAVPV.js +0 -23
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { i as getChatConfig, n as botConfig, o as getSlackBotToken, v as normalizeSlackEmojiName } from "./config-
|
|
4
|
-
import { E as withSpan, G as toOptionalNumber, K as toOptionalString, W as isRecord$2, a as extractGenAiUsageSummary, b as setSpanAttributes, c as getLogContextAttributes, d as logAudit, h as logWarn, m as logInfo, o as getActiveTraceContext, p as logException, t as buildTurnFailureResponse, y as setSentryUser } from "./logging-
|
|
5
|
-
import {
|
|
6
|
-
import { t as canExposeConversationPayload } from "./conversation-privacy-C23M8KaD.js";
|
|
1
|
+
import { a as getClient$1, n as captureMessage, r as continueTrace, v as __exportAll } from "./sentry-BRTJqumy.js";
|
|
2
|
+
import { a as completeText, c as resolveGatewayModel, i as completeObject, m as escapeXml, o as embedTexts, p as unwrapCurrentInstruction, r as completeDecision, s as rerankTexts, t as GEN_AI_PROVIDER_NAME, w as toOptionalTrimmed, x as isProviderRetryError } from "./client-Bpxe4vKa.js";
|
|
3
|
+
import { i as getChatConfig, n as botConfig, o as getSlackBotToken, v as normalizeSlackEmojiName } from "./config-C_bmRhrJ.js";
|
|
4
|
+
import { E as withSpan, G as toOptionalNumber, K as toOptionalString, W 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, t as buildTurnFailureResponse, y as setSentryUser } from "./logging-CkT3_Xxp.js";
|
|
5
|
+
import { t as canExposeConversationPayload } from "./conversation-privacy-CzOfcz0U.js";
|
|
7
6
|
import { c as parseStoredSlackActor, d as parseSlackChannelReferenceId, f as parseSlackTeamId, h as parseSlackMessageTs, i as isActorUserId, l as toStoredSlackActor, p as parseSlackUserId, s as parseActorUserId } from "./actor-B4DYygOB.js";
|
|
8
|
-
import { C as getSqlExecutor, D as createSqlConversationEventStore, G as bindProviderConversation, I as resolveActorIdentityId, O as eventFromRow, P as startLocationThread, S as getDb, U as saveUserTimezone, V as readUserTimezone, X as addAgentTurnUsage, at as sameDestination, et as hasAgentTurnUsage, g as createCache, i as readActorIdentity, j as createSqlStore, k as withConversationEventLock, l as resolveViewerUser, n as findUserByEmailFromSql, o as readIdentityById, p as parseAvatarUrl, q as conversationDetailTouch, rt as parseDestination, s as readIdentityByIdFromSql, tt as resolveRootConversationId, x as getConversationStore, y as getConversationEventStore } from "./viewer-
|
|
9
|
-
import { c as juniorIdentities, d as juniorDestinations, l as juniorUsers, s as juniorConversations } from "./agent-invocations-
|
|
10
|
-
import { C as juniorCodeChanges, S as juniorConversationAnnotations, T as juniorAttachments, _ as juniorConversationBriefs, a as juniorReviewItemAssignees, b as juniorConversationEvents, c as juniorReviewItems, d as juniorAutomations, h as juniorConversationParticipants, i as juniorWorkspaces, n as juniorSnapshots, o as juniorReviewItemConversations, p as juniorLocationConfigurations, r as juniorWorkspaceRepos, w as juniorCodeRepositories } from "./executor-
|
|
7
|
+
import { C as getSqlExecutor, D as createSqlConversationEventStore, G as bindProviderConversation, I as resolveActorIdentityId, O as eventFromRow, P as startLocationThread, S as getDb, U as saveUserTimezone, V as readUserTimezone, X as addAgentTurnUsage, at as sameDestination, et as hasAgentTurnUsage, g as createCache, i as readActorIdentity, j as createSqlStore, k as withConversationEventLock, l as resolveViewerUser, n as findUserByEmailFromSql, o as readIdentityById, p as parseAvatarUrl, q as conversationDetailTouch, rt as parseDestination, s as readIdentityByIdFromSql, tt as resolveRootConversationId, x as getConversationStore, y as getConversationEventStore } from "./viewer-vsM8_90o.js";
|
|
8
|
+
import { c as juniorIdentities, d as juniorDestinations, l as juniorUsers, s as juniorConversations } from "./agent-invocations-CUg_SODU.js";
|
|
9
|
+
import { C as juniorCodeChanges, S as juniorConversationAnnotations, T as juniorAttachments, _ as juniorConversationBriefs, a as juniorReviewItemAssignees, b as juniorConversationEvents, c as juniorReviewItems, d as juniorAutomations, h as juniorConversationParticipants, i as juniorWorkspaces, n as juniorSnapshots, o as juniorReviewItemConversations, p as juniorLocationConfigurations, r as juniorWorkspaceRepos, w as juniorCodeRepositories } from "./executor-BfYH-Wws.js";
|
|
11
10
|
import { a as agentHistoryItemSchema, g as instructionProvenanceFor, h as instructionActors, m as contextProvenance } from "./media-DTAA8Qs_.js";
|
|
12
|
-
import { _ as CredentialUnavailableError, a as resolveAuthTokenPlaceholder, f as credentialContextForActor, h as credentialSubjectSchema, m as credentialLogContext, o as resolvePluginCommandEnv, p as credentialContextSchema } from "./registry-
|
|
13
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
11
|
+
import { _ as CredentialUnavailableError, a as resolveAuthTokenPlaceholder, f as credentialContextForActor, h as credentialSubjectSchema, m as credentialLogContext, o as resolvePluginCommandEnv, p as credentialContextSchema } from "./registry-DnrdeO4s.js";
|
|
12
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-BWVMeZhW.js";
|
|
14
13
|
import { a as withLock, i as fenceLock, n as MUTATION_LOCK_TTL_MS, r as acquireActiveLock } from "./locks-D-0h111u.js";
|
|
15
|
-
import { n as getDefaultRedisStateAdapterFor, r as getStateAdapter } from "./adapter-
|
|
14
|
+
import { n as getDefaultRedisStateAdapterFor, r as getStateAdapter } from "./adapter-phTTgw7H.js";
|
|
16
15
|
import { i as isValidTimeZone } from "./cadence-R7Em4RjE.js";
|
|
17
|
-
import { A as messageCardRef, H as conversationBriefSchema, M as readMessageCardRefs, O as reviewItemChangeRecordSchema, R as readMessageAttachments, U as parseBriefInput, _ as conversationReportMessageEventSchema, g as conversationReportEventSchema } from "./conversation-
|
|
18
|
-
import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt
|
|
16
|
+
import { A as messageCardRef, H as conversationBriefSchema, M as readMessageCardRefs, O as reviewItemChangeRecordSchema, R as readMessageAttachments, U as parseBriefInput, _ as conversationReportMessageEventSchema, g as conversationReportEventSchema } from "./conversation-CIiJtx5q.js";
|
|
17
|
+
import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt--dwus7Y-.js";
|
|
18
|
+
import { n as redactSandboxEgressProxyPath, t as SANDBOX_EGRESS_PROXY_PATH } from "./proxy-path-BHYoKZdq.js";
|
|
19
19
|
import path from "node:path";
|
|
20
20
|
import { isDeepStrictEqual } from "node:util";
|
|
21
21
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
22
22
|
import { createHash, createHmac, createPrivateKey, createPublicKey, generateKeyPairSync, randomBytes, randomUUID, sign, timingSafeEqual } from "node:crypto";
|
|
23
23
|
import { z } from "zod";
|
|
24
24
|
import { and, arrayContains, asc, count, desc, eq, exists, getTableColumns, gt, gte, ilike, inArray, isNotNull, isNull, lt, lte, max, ne, notExists, or, sql } from "drizzle-orm";
|
|
25
|
-
import { EgressAuthRequired, EgressPolicyDenied, actorSchema, codeChangeInputSchema, conversationAnnotationInputSchema, conversationEventPresentationSchema, defineConversationEvent, destinationSchema, eventDataSchema, eventInputSchema, eventMatchSchema, eventMatches, eventTypeSchema, missingToolAnnotationKeys, normalizeEventIdentifier, objectAnnotationSchema, objectIconPath, objectTypeSchema, pluginAuthorizationSchema, pluginCredentialHeaderTransformSchema, pluginCredentialResultSchema, pluginEventsSchema, pluginGrantSchema, pluginProviderAccountSchema, pluginStoredTokensSchema, promptContextSchema, promptMessageSchema, sourceSchema, stableEventMatchKey } from "@sentry/junior-plugin-api";
|
|
25
|
+
import { EgressAuthRequired, EgressPolicyDenied, actorSchema, codeChangeInputSchema, conversationAnnotationInputSchema, conversationEventPresentationSchema, defineConversationEvent, destinationSchema, eventDataSchema, eventInputSchema, eventMatchSchema, eventMatches, eventTypeSchema, isPluginModelCostEventName, missingToolAnnotationKeys, normalizeEventIdentifier, objectAnnotationSchema, objectIconPath, objectTypeSchema, pluginAuthorizationSchema, pluginCredentialHeaderTransformSchema, pluginCredentialResultSchema, pluginEventsSchema, pluginGrantSchema, pluginModelCostEventNames, pluginProviderAccountSchema, pluginStoredTokensSchema, promptContextSchema, promptMessageSchema, sourceSchema, stableEventMatchKey } from "@sentry/junior-plugin-api";
|
|
26
26
|
import { alias, union } from "drizzle-orm/pg-core";
|
|
27
27
|
import fs from "node:fs/promises";
|
|
28
28
|
import http from "node:http";
|
|
@@ -1588,6 +1588,16 @@ async function readConversationEventPageAfter(executor, args) {
|
|
|
1588
1588
|
...projected.length > events.length ? { nextSeq: events.at(-1).seq } : void 0
|
|
1589
1589
|
};
|
|
1590
1590
|
}
|
|
1591
|
+
/** Read the newest event position, or -1 before the first event. */
|
|
1592
|
+
async function readConversationLastEventSeq(executor, conversationId) {
|
|
1593
|
+
const [row] = await executor.db().select({ seq: max(juniorConversationEvents.seq) }).from(juniorConversationEvents).where(eq(juniorConversationEvents.conversationId, conversationId));
|
|
1594
|
+
return row?.seq ?? -1;
|
|
1595
|
+
}
|
|
1596
|
+
/** Read the transcript position of one Message, when a Turn has read it. */
|
|
1597
|
+
async function readConversationMessageEventSeq(executor, conversationId, messageId) {
|
|
1598
|
+
const [row] = await executor.db().select({ seq: juniorConversationEvents.seq }).from(juniorConversationEvents).where(and(eq(juniorConversationEvents.conversationId, conversationId), eq(juniorConversationEvents.type, "message"), sql`${juniorConversationEvents.payload}->>'messageId' = ${messageId}`)).orderBy(asc(juniorConversationEvents.seq)).limit(1);
|
|
1599
|
+
return row?.seq;
|
|
1600
|
+
}
|
|
1591
1601
|
// src/chat/briefs/input.ts
|
|
1592
1602
|
const EVENT_PAGE_SIZE = 500;
|
|
1593
1603
|
async function readReportEventsThrough(executor, conversationId, throughSeq) {
|
|
@@ -1873,7 +1883,7 @@ async function updateConversationBrief(context) {
|
|
|
1873
1883
|
return;
|
|
1874
1884
|
}
|
|
1875
1885
|
const input = await briefInputFromSql(executor, run.conversationId, terminalSeq);
|
|
1876
|
-
const modelId = botConfig.
|
|
1886
|
+
const modelId = botConfig.fastModelId;
|
|
1877
1887
|
const generation = await generateBrief({
|
|
1878
1888
|
completeObject: (request) => completeObject({
|
|
1879
1889
|
...request,
|
|
@@ -2127,7 +2137,7 @@ function startOfUtcDay(value) {
|
|
|
2127
2137
|
return date;
|
|
2128
2138
|
}
|
|
2129
2139
|
function registeredEventName(plugin, eventName) {
|
|
2130
|
-
if (!plugin.conversationEvents?.some((definition) => definition.eventName === eventName)) throw new TypeError(`Plugin "${plugin.manifest.name}" did not register event "${eventName}"`);
|
|
2140
|
+
if (!isPluginModelCostEventName(eventName) && !plugin.conversationEvents?.some((definition) => definition.eventName === eventName)) throw new TypeError(`Plugin "${plugin.manifest.name}" did not register event "${eventName}"`);
|
|
2131
2141
|
return eventName;
|
|
2132
2142
|
}
|
|
2133
2143
|
/** Create aggregate event-cost reads bound to one plugin's registered namespace. */
|
|
@@ -2221,6 +2231,37 @@ function createPluginLogger(plugin) {
|
|
|
2221
2231
|
}
|
|
2222
2232
|
};
|
|
2223
2233
|
}
|
|
2234
|
+
// src/chat/plugins/model-cost.ts
|
|
2235
|
+
/**
|
|
2236
|
+
* Bind plugin model cost to one Conversation. Each priced call becomes an
|
|
2237
|
+
* event in the plugin's namespace, so Conversation cost counts it without
|
|
2238
|
+
* the plugin reporting it. A failed write is logged, not thrown, so it
|
|
2239
|
+
* cannot discard a model result that already succeeded.
|
|
2240
|
+
*/
|
|
2241
|
+
function createPluginModelCostRecorder(args) {
|
|
2242
|
+
return async ({ costUsd, modelRole }) => {
|
|
2243
|
+
await runBestEffort(async () => {
|
|
2244
|
+
await getConversationEventStore().append(args.conversationId, [{
|
|
2245
|
+
createdAtMs: Date.now(),
|
|
2246
|
+
data: {
|
|
2247
|
+
type: "structured_event",
|
|
2248
|
+
namespace: args.pluginName,
|
|
2249
|
+
name: pluginModelCostEventNames[args.source],
|
|
2250
|
+
version: 1,
|
|
2251
|
+
...args.turnId ? { turnId: args.turnId } : void 0,
|
|
2252
|
+
content: {
|
|
2253
|
+
costUsd,
|
|
2254
|
+
modelRole,
|
|
2255
|
+
...args.toolName ? { toolName: args.toolName } : void 0
|
|
2256
|
+
}
|
|
2257
|
+
}
|
|
2258
|
+
}], { activity: "preserve" });
|
|
2259
|
+
}, "plugin.model_cost.record.failed", {
|
|
2260
|
+
"app.plugin.name": args.pluginName,
|
|
2261
|
+
"gen_ai.tool.name": args.toolName
|
|
2262
|
+
});
|
|
2263
|
+
};
|
|
2264
|
+
}
|
|
2224
2265
|
// src/chat/sandbox/noninteractive-command.ts
|
|
2225
2266
|
const NON_INTERACTIVE_ENV = {
|
|
2226
2267
|
CI: "1",
|
|
@@ -2410,6 +2451,10 @@ function createPluginModel(pluginName, options = {}, runtime = {}) {
|
|
|
2410
2451
|
pluginModelRole: "structured"
|
|
2411
2452
|
}
|
|
2412
2453
|
});
|
|
2454
|
+
if (result.costUsd !== void 0) await runtime.onCost?.({
|
|
2455
|
+
costUsd: result.costUsd,
|
|
2456
|
+
modelRole: "structured"
|
|
2457
|
+
});
|
|
2413
2458
|
return {
|
|
2414
2459
|
object: result.object,
|
|
2415
2460
|
...result.costUsd !== void 0 ? { costUsd: result.costUsd } : void 0
|
|
@@ -2422,7 +2467,7 @@ function createPluginEmbedder(pluginName, runtime = {}) {
|
|
|
2422
2467
|
model: botConfig.embeddingModelId,
|
|
2423
2468
|
provider: GEN_AI_PROVIDER_NAME,
|
|
2424
2469
|
async embedTexts(input) {
|
|
2425
|
-
|
|
2470
|
+
const result = await embedTexts({
|
|
2426
2471
|
modelId: botConfig.embeddingModelId,
|
|
2427
2472
|
texts: input.texts,
|
|
2428
2473
|
...input.inputType !== void 0 ? { inputType: input.inputType } : void 0,
|
|
@@ -2432,13 +2477,18 @@ function createPluginEmbedder(pluginName, runtime = {}) {
|
|
|
2432
2477
|
pluginModelRole: "embedding"
|
|
2433
2478
|
}
|
|
2434
2479
|
});
|
|
2480
|
+
if (result.costUsd !== void 0) await runtime.onCost?.({
|
|
2481
|
+
costUsd: result.costUsd,
|
|
2482
|
+
modelRole: "embedding"
|
|
2483
|
+
});
|
|
2484
|
+
return result;
|
|
2435
2485
|
}
|
|
2436
2486
|
};
|
|
2437
2487
|
}
|
|
2438
2488
|
/** Create the host-owned reranking capability exposed to prompt hooks. */
|
|
2439
|
-
function createPluginReranker(pluginName) {
|
|
2489
|
+
function createPluginReranker(pluginName, runtime = {}) {
|
|
2440
2490
|
return { async rerank(input) {
|
|
2441
|
-
|
|
2491
|
+
const result = await rerankTexts({
|
|
2442
2492
|
documents: input.documents,
|
|
2443
2493
|
modelId: botConfig.rerankingModelId,
|
|
2444
2494
|
query: input.query,
|
|
@@ -2447,6 +2497,11 @@ function createPluginReranker(pluginName) {
|
|
|
2447
2497
|
pluginModelRole: "reranking"
|
|
2448
2498
|
}
|
|
2449
2499
|
});
|
|
2500
|
+
if (result.costUsd !== void 0) await runtime.onCost?.({
|
|
2501
|
+
costUsd: result.costUsd,
|
|
2502
|
+
modelRole: "reranking"
|
|
2503
|
+
});
|
|
2504
|
+
return result;
|
|
2450
2505
|
} };
|
|
2451
2506
|
}
|
|
2452
2507
|
/** Create the host-owned decision model capability exposed to tool hooks. */
|
|
@@ -2467,6 +2522,10 @@ function createPluginDecider(pluginName, runtime = {}) {
|
|
|
2467
2522
|
pluginModelRole: "decision"
|
|
2468
2523
|
}
|
|
2469
2524
|
});
|
|
2525
|
+
if (result.costUsd !== void 0) await runtime.onCost?.({
|
|
2526
|
+
costUsd: result.costUsd,
|
|
2527
|
+
modelRole: "decision"
|
|
2528
|
+
});
|
|
2470
2529
|
const answer = result.answers.answer;
|
|
2471
2530
|
return {
|
|
2472
2531
|
choice: answer.choice,
|
|
@@ -3776,7 +3835,6 @@ function parseSandboxEgressPermissionDeniedSignal(value) {
|
|
|
3776
3835
|
return result.success ? result.data : void 0;
|
|
3777
3836
|
}
|
|
3778
3837
|
// src/chat/sandbox/egress/session.ts
|
|
3779
|
-
const SANDBOX_EGRESS_PROXY_PATH = "/api/internal/sandbox-egress";
|
|
3780
3838
|
const SANDBOX_EGRESS_TOKEN_VERSION = "v1";
|
|
3781
3839
|
const SANDBOX_EGRESS_HMAC_CONTEXT = "junior.sandbox_egress.v1";
|
|
3782
3840
|
const SANDBOX_EGRESS_AUTH_SIGNAL_PREFIX = "sandbox-egress-auth-required";
|
|
@@ -3998,14 +4056,10 @@ function sandboxEgressAttributes(input) {
|
|
|
3998
4056
|
...input.status ? { "http.response.status_code": input.status } : void 0
|
|
3999
4057
|
};
|
|
4000
4058
|
}
|
|
4001
|
-
/** Hide the credential token in a sandbox egress proxy path before logging. */
|
|
4002
|
-
function redactSandboxEgressProxyPath(pathname) {
|
|
4003
|
-
if (pathname.startsWith(`/api/internal/sandbox-egress/`)) return `${SANDBOX_EGRESS_PROXY_PATH}/<token>`;
|
|
4004
|
-
return pathname;
|
|
4005
|
-
}
|
|
4006
4059
|
/** Return log attributes for the proxy route and the upstream path. */
|
|
4007
4060
|
function sandboxEgressRoutingAttributes(request, upstreamUrl) {
|
|
4008
|
-
const
|
|
4061
|
+
const proxyUrl = new URL(request.url);
|
|
4062
|
+
const attributes = { "app.sandbox.egress.proxy_path": redactSandboxEgressProxyPath(proxyUrl.pathname) };
|
|
4009
4063
|
if (upstreamUrl) {
|
|
4010
4064
|
attributes["app.sandbox.egress.upstream_path"] = upstreamUrl.pathname;
|
|
4011
4065
|
const gitService = upstreamUrl.searchParams.get("service");
|
|
@@ -7268,11 +7322,20 @@ async function runAfterToolExecuteHooks(args) {
|
|
|
7268
7322
|
for (const plugin of hooked) {
|
|
7269
7323
|
if (signal?.aborted) break;
|
|
7270
7324
|
const pluginName = plugin.manifest.name;
|
|
7325
|
+
const onCost = createPluginModelCostRecorder({
|
|
7326
|
+
...args.turn,
|
|
7327
|
+
pluginName,
|
|
7328
|
+
source: "afterToolExecute",
|
|
7329
|
+
toolName: args.tool.name
|
|
7330
|
+
});
|
|
7271
7331
|
let denial;
|
|
7272
7332
|
try {
|
|
7273
7333
|
await withPluginHookSpan(pluginName, "afterToolExecute", async () => await plugin.hooks.afterToolExecute({
|
|
7274
7334
|
...basePluginContext$1(plugin),
|
|
7275
|
-
decider: createPluginDecider(pluginName, {
|
|
7335
|
+
decider: createPluginDecider(pluginName, {
|
|
7336
|
+
onCost,
|
|
7337
|
+
signal
|
|
7338
|
+
}),
|
|
7276
7339
|
decision: {
|
|
7277
7340
|
deny(reason) {
|
|
7278
7341
|
denial = reason;
|
|
@@ -7284,7 +7347,10 @@ async function runAfterToolExecuteHooks(args) {
|
|
|
7284
7347
|
});
|
|
7285
7348
|
}
|
|
7286
7349
|
},
|
|
7287
|
-
model: createPluginModel(pluginName, plugin.model, {
|
|
7350
|
+
model: createPluginModel(pluginName, plugin.model, {
|
|
7351
|
+
onCost,
|
|
7352
|
+
signal
|
|
7353
|
+
}),
|
|
7288
7354
|
sandbox,
|
|
7289
7355
|
...signal ? { signal } : void 0,
|
|
7290
7356
|
tool: {
|
|
@@ -8838,19 +8904,26 @@ function pluginSpanAttributeSetter(pluginName, setSpanAttributes) {
|
|
|
8838
8904
|
};
|
|
8839
8905
|
}
|
|
8840
8906
|
function invocationPluginContext(plugin, context, setSpanAttributes, turnId) {
|
|
8907
|
+
const base = basePluginContext$1(plugin);
|
|
8908
|
+
const onCost = context.conversationId ? createPluginModelCostRecorder({
|
|
8909
|
+
conversationId: context.conversationId,
|
|
8910
|
+
pluginName: plugin.manifest.name,
|
|
8911
|
+
source: "userPrompt",
|
|
8912
|
+
...turnId ? { turnId } : void 0
|
|
8913
|
+
}) : void 0;
|
|
8841
8914
|
return {
|
|
8842
|
-
...
|
|
8915
|
+
...base,
|
|
8843
8916
|
conversationId: context.conversationId,
|
|
8844
8917
|
locationId: context.locationId,
|
|
8845
|
-
embedder: createPluginEmbedder(plugin.manifest.name),
|
|
8918
|
+
embedder: createPluginEmbedder(plugin.manifest.name, { onCost }),
|
|
8846
8919
|
...context.conversationId && turnId ? { events: createPluginConversationEvents({
|
|
8847
8920
|
conversationId: context.conversationId,
|
|
8848
8921
|
operationId: `user-prompt:${turnId}`,
|
|
8849
8922
|
plugin,
|
|
8850
8923
|
turnId
|
|
8851
8924
|
}) } : void 0,
|
|
8852
|
-
model: createPluginModel(plugin.manifest.name, plugin.model),
|
|
8853
|
-
reranker: createPluginReranker(plugin.manifest.name),
|
|
8925
|
+
model: createPluginModel(plugin.manifest.name, plugin.model, { onCost }),
|
|
8926
|
+
reranker: createPluginReranker(plugin.manifest.name, { onCost }),
|
|
8854
8927
|
setSpanAttributes: pluginSpanAttributeSetter(plugin.manifest.name, setSpanAttributes),
|
|
8855
8928
|
source: context.source,
|
|
8856
8929
|
text: context.userText ?? "",
|
|
@@ -9115,6 +9188,12 @@ function getPluginTools(context, sandbox = createSandboxCapability(context.works
|
|
|
9115
9188
|
};
|
|
9116
9189
|
const resolveActor = context.resolveActorIdentity ?? (async () => void 0);
|
|
9117
9190
|
const automationUrl = (context.source.kind === "event_automation" || context.source.kind === "scheduled_automation") && context.source.automationId ? getDashboardTaskLink(context.source.automationId) : void 0;
|
|
9191
|
+
const onCost = createPluginModelCostRecorder({
|
|
9192
|
+
conversationId: context.conversationId,
|
|
9193
|
+
pluginName,
|
|
9194
|
+
source: "tool",
|
|
9195
|
+
...context.turnId ? { turnId: context.turnId } : void 0
|
|
9196
|
+
});
|
|
9118
9197
|
const common = {
|
|
9119
9198
|
...basePluginContext$1(plugin),
|
|
9120
9199
|
annotations,
|
|
@@ -9123,10 +9202,10 @@ function getPluginTools(context, sandbox = createSandboxCapability(context.works
|
|
|
9123
9202
|
locationId: context.locationId,
|
|
9124
9203
|
...slackContext ? { slack: slackContext } : void 0,
|
|
9125
9204
|
userText: context.userText,
|
|
9126
|
-
embedder: createPluginEmbedder(pluginName),
|
|
9205
|
+
embedder: createPluginEmbedder(pluginName, { onCost }),
|
|
9127
9206
|
egress: context.egress,
|
|
9128
9207
|
...mcp ? { mcp } : void 0,
|
|
9129
|
-
model: createPluginModel(pluginName, plugin.model),
|
|
9208
|
+
model: createPluginModel(pluginName, plugin.model, { onCost }),
|
|
9130
9209
|
events,
|
|
9131
9210
|
sandbox,
|
|
9132
9211
|
state: createPluginState(pluginName),
|
|
@@ -9560,11 +9639,13 @@ function createPluginHookRunner(input = {}) {
|
|
|
9560
9639
|
const loaded = getPlugins();
|
|
9561
9640
|
return {
|
|
9562
9641
|
async afterToolExecute(tool) {
|
|
9563
|
-
if (!input.
|
|
9642
|
+
if (!input.toolRun) return [];
|
|
9643
|
+
const { sandbox, ...turn } = input.toolRun;
|
|
9564
9644
|
return await runAfterToolExecuteHooks({
|
|
9565
9645
|
plugins: loaded,
|
|
9566
|
-
sandbox:
|
|
9567
|
-
tool
|
|
9646
|
+
sandbox: sandbox(),
|
|
9647
|
+
tool,
|
|
9648
|
+
turn
|
|
9568
9649
|
});
|
|
9569
9650
|
},
|
|
9570
9651
|
async afterMcpTool(tool) {
|
|
@@ -10218,12 +10299,9 @@ function egressAttributes(input) {
|
|
|
10218
10299
|
...input.status ? { "http.response.status_code": input.status } : void 0
|
|
10219
10300
|
};
|
|
10220
10301
|
}
|
|
10221
|
-
function redactedProxyPath(pathname) {
|
|
10222
|
-
if (pathname.startsWith(`/api/internal/sandbox-egress/`)) return `${SANDBOX_EGRESS_PROXY_PATH}/<token>`;
|
|
10223
|
-
return pathname;
|
|
10224
|
-
}
|
|
10225
10302
|
function routingAttributes(request, upstreamUrl) {
|
|
10226
|
-
const
|
|
10303
|
+
const proxyUrl = new URL(request.url);
|
|
10304
|
+
const attributes = { "app.sandbox.egress.proxy_path": redactSandboxEgressProxyPath(proxyUrl.pathname) };
|
|
10227
10305
|
if (upstreamUrl) {
|
|
10228
10306
|
attributes["app.sandbox.egress.upstream_path"] = upstreamUrl.pathname;
|
|
10229
10307
|
const gitService = upstreamUrl.searchParams.get("service");
|
|
@@ -14734,4 +14812,4 @@ async function recordGuardianActionReviewed(args) {
|
|
|
14734
14812
|
createdAtMs: Date.now()
|
|
14735
14813
|
}]);
|
|
14736
14814
|
}
|
|
14737
|
-
export { completeTurnRecord as $, recordSlackAttachment as $a, isWorkspaceSnapshotNotReadyError as $i, takeReviewItem as $n, updateWorkspace as $r, isStandaloneRuntimeContextMessage as $t, getConversationMessageSlackTs as A, canAccessConversation as Aa, removeReactionFromMessage as Ai, createPluginHookRunner as An, takeDueTimerWatches as Ar, requestAnotherSlice as At, authorizationId as B, readConversationViewerMarks as Ba, isConversationScopedChannel as Bi, coreTaskRegistrations as Bn, getDashboardObjectIconLink as Br, createTurnLimitGate as Bt, settleConversationTitleWork as C, sandboxSkillDir as Ca, addReactionToMessage as Ci, setExperimentalFeatures as Cn, collectEventMatchKeys as Cr, isInvalidConversationRecordError as Ct, buildConversationContext as D, buildNonInteractiveShellScript as Da, openSlackModal as Di, getOAuthAccountProviders as Dn, findMatchingWatches as Dr, recordConversationRetry as Dt, appendThreadContextMessages as E, buildCommandScript as Ea, openSlackDirectMessage as Ei, webActorUserIds as En, deliverWatch as Er, recordAttemptFailure as Et, turnHasReply as F, conversationIsMemberRoot as Fa, SlackActionError as Fi, getPluginTools as Fn, verifyScheduledAutomationCredentialSubject as Fr, TURN_LIMIT_WRAP_UP_MESSAGE as Ft, canReusePendingAuthLink as G, readConversationEventPageAfter as Ga, getWorkspaceTeamId as Gi, countReviewItemsNeedingUser as Gn, createPluginState as Gr, getPiMessageRole as Gt, AuthorizationFlowDisabledError as H, createPluginConversationEvents as Ha, normalizeSlackConversationId as Hi, setBriefsConfig as Hn, getDashboardTaskLink as Hr, CODEMODE_TOOL_NAME as Ht, upsertConversationMessage as I, conversationNotArchivedForEmail as Ia, downloadPrivateSlackFile as Ii, getPluginUserPromptContributions as In, verifySlackDirectCredentialSubject as Ir, TurnBudgetExceededError as It, wasPendingAuthStopped as J, loadForkHistory as Ja, isAlreadyExistsError as Ji, getReviewItem as Jn, deleteWorkspace as Jr, hasCurrentInstruction as Jt, clearPendingAuth as K, readConversationEventPageAround as Ka, runWithWorkspaceTeamId as Ki, dismissOpenReviewItems as Kn, renderToolResultNudge as Kr, getTerminalAssistantMessages as Kt, createPluginEgress as L, conversationNotArchivedForUser as La, getFilePermalink as Li, getPlugins as Ln, verifyTimerWatchCredentialSubject as Lr, TurnSliceLimitExceededError as Lt, markConversationMessage as M, conversationArchivedForEmail as Ma, uploadFilesToConversation as Mi, getPluginRoutes as Mn, bindScheduledAutomationCredentialSubject as Mr, startConversationWork as Mt, normalizeConversationText as N, conversationArchivedForUser as Na, slackEntitySchema as Ni, getPluginSlackConversationLink as Nn, bindSlackDirectCredentialSubject as Nr, steerWebPendingMessages as Nt, createConversationMemoryService as O, runNonInteractiveCommand as Oa, postSlackEphemeralMessage as Oi, resolvePluginOAuthAccount as On, getWatch as Or, releaseConversationWork as Ot, recordDeliveredAssistantMessage as P, conversationHasParticipantUser as Pa, slackExternalRefIdSchema as Pi, getPluginSystemPromptContributions as Pn, verifyEventAutomationCredentialSubject as Pr, stopConversationWork as Pt, abandonTurnRecord as Q, readAttachmentVisionSummary as Qa, getWorkspaceSnapshotNotReadyError as Qi, searchReviewItems as Qn, listWorkspacesByRepository as Qr, isContinuablePiBoundary as Qt, PluginCredentialFailureError as R, conversationPinnedForUser as Ra, getHeaderString as Ri, setPlugins as Rn, JUNIOR_THREAD_STATE_TTL_MS as Rr, TurnToolCallLimitExceededError as Rt, resolveConversationTitle as S, SANDBOX_WORKSPACE_ROOT as Sa, truncateStatusText as Si, isExperimentalFeatureEnabled as Sn, cancelWatch as Sr, isFinalAttempt as St, resolveTaskTitle as T, sandboxSkillPathResolution as Ta, getSlackMessagePermalink as Ti, findLegacyWebActorUserId as Tn, createWatch as Tr, markConversationWorkEnqueued as Tt, AuthorizationPauseError as U, readLatestConversationBrief as Ua, runWithSlackInstallationToken as Ui, REVIEW_ITEM_REPLIED_REASON as Un, setDashboardConversationLinkOptions as Ur, persistWithRetry as Ut, AuthPausePersistenceError as V, viewerConversationMembership as Va, isDmChannel as Vi, registration_exports as Vn, getDashboardReviewItemLink as Vr, isTurnExecutionLimitExceededError as Vt, abandonReplacedPendingAuth as W, readConversationEventPage as Wa, withSlackRetries as Wi, closeReviewItem as Wn, ToolInputError as Wr, extractAssistantText as Wt, loadTurnCheckpoint as X, getSlackFileId as Xa, wrapSandboxSetupError as Xi, listReplyActionItems as Xn, getWorkspaceByName as Xr, instructionTextForProjection as Xt, continuableMessages as Y, notInheritedByForkChild as Ya, throwSandboxOperationError as Yi, insertReviewItem as Yn, getWorkspace as Yr, hasRuntimeTurnContext as Yt, saveTurnCheckpoint as Z, matchSlackAttachments as Za, WorkspaceSnapshotNotReadyError as Zi, listWaitingConversations as Zn, listWorkspaces as Zr, isAssistantMessage as Zt, appendConversationMessages as _, SANDBOX_COMMAND_PATH as _a, escapeSlackMrkdwnText as _i, estimateTextTokens as _n, setConfigDefaults as _o, RESOURCE_SUBSCRIPTION_DEFAULT_TTL_MS as _r, drainConversationMailbox as _t, loadProjection as a, parseSandboxEgressCredentialToken as aa, create as ai, trimTrailingAssistantMessages as an, defaultTimezone as ao, isOnlyAssignee as ar, CONVERSATION_WORK_STALE_ENQUEUE_MS as at, projectConversationMessages as b, SANDBOX_REPOS_ROOT as ba, normalizeSlackStatusText as bi, getAgentContextInputLimitTokens as bn, STOP_WATCHING_TOOL_NAME as br, hasConversationStop as bt, recordAgentsInstructionsUpdated as c, resolveSandboxCommandEnvironment as ca, ensureDockerDaemon as ci, TURN_CONTEXT_TAG as cn, createPluginCache as co, requireReviewItemLinks as cr, appendInboundMessage as ct, recordAuthorizationCompleted as d, sleep$2 as da, proxyVercelSandboxEgressRequest as di, SubscribedReplyReason as dn, historyItemFromPiMessage as do, EVERYONE_ASSIGNEE as dr, checkInConversationWork as dt, workspaceSnapshotNotReadyUserMessage as ea, WorkspaceValidationError as ei, isToolResultError as en, resolveRootVisibility as eo, updateReviewItemContent as er, failTurnRecord as et, recordAuthorizationRequested as f, tryWorkspaceRepoCheckoutPath as fa, deliverOAuthAuthorization as fi, decideSubscribedThreadReply as fn, piMessageFromHistoryItem as fo, automationCreatorUserId as fr, clearConsumedConversationWake as ft, recordToolExecutionStarted as g, createPluginModel as ga, startOAuthFlow as gi, estimateRequestOverheadTokens as gn, getConfigDefaults as go, getSlackToolContext as gr, deadLetterAttempt as gt, recordSubscribedReplyRoute as h, createPluginEmbedder as ha, resolveBaseUrl as hi, calculateContextCompactionTargetTokens as hn, conversationNoteEvent as ho, resolveChannelCapabilities as hr, completeConversationWork as ht, loadConversationProjection as i, createSandboxEgressCredentialToken as ia, setWorkspaceSnapshotBuild as ii, stripRuntimeTurnContext as in, listConversationAnnotationsById as io, canReadReviewItem as ir, CONVERSATION_WORK_CHECK_IN_INTERVAL_MS as it, isHumanConversationMessage as j, readConversationAccessFromSql as ja, updateSlackMessage as ji, getPluginApiRoutes as jn, bindEventAutomationCredentialSubject as jr, requestConversationWork as jt, estimateConversationContextTokens as k, createPluginLogger as ka, postSlackMessage as ki, agent_hooks_exports as kn, listWatches as kr, removeActiveConversation as kt, recordAttachmentsDelivered as l, normalizeSandboxEgressTracePropagationDomains as la, getSandboxProvider as li, buildDeterministicAssistantMessageId as ln, createDurableLocationConfigurationService as lo, reviewItemNeedsUser as lr, beginConversationResume as lt, recordMcpProviderConnected as m, PluginToolDeniedError as ma, parseOAuthStatePayload as mi, getThreadStopDecision as mn, JUNIOR_NATIVE_EVENT_NAMESPACE as mo, resolveAssignees as mr, completeConversationStop as mt, commitMessages as n, consumeSandboxEgressAuthRequiredSignal as na, loadSnapshotsForProfile as ni, normalizeToolNameFromResult as nn, createPluginAnnotations as no, canActOnReviewItem as nr, listTurnSummaries as nt, loadTurnProjection as o, sandboxEgressSignalsResponseSchema as oa, hash as oi, REQUEST_CONTEXT_SECTION_TAG as on, resolveUserTimezone as oo, readReviewItemAgentScope as or, ackMessages as ot, recordGuardianActionReviewed as p, workspaceRepoCheckoutPath as pa, formatProviderLabel as pi, getSubscribedReplyPreflightDecision as pn, projectConversationEvents as po, resolveAssignee as pr, clearExpiredConversationLease as pt, getConversationPendingAuth as q, buildSentryConversationUrl as qa, isAbortError as qi, getOpenReviewItemByDedupeKey as qn, createWorkspace as qr, getUserMessageInstructionText as qt, loadConnectedMcpProviders as r, consumeSandboxEgressPermissionDeniedSignal as ra, setWorkspaceSnapshot as ri, retainRuntimeTurnContext as rn, listConversationAnnotations as ro, canAgentChangeReviewItem as rr, recordTurnSummary as rt, openConversationProjection as s, buildSandboxEgressNetworkPolicy as sa, isStale as si, SESSION_CONTEXT_SECTION_TAG as sn, lookupSlackUser as so, requireReviewItemAssignees as sr, appendExclusiveInboundMessage as st, commitAcceptedReply as t, clearSandboxEgressSignals as ta, invalidateReadySnapshot as ti, isToolResultMessage as tn, saveObjectAnnotations as to, PLUGIN_REVIEW_ITEM_KEY_PREFIX as tr, getTurnRecord as tt, recordAuthenticationLinked as u, SANDBOX_RUNTIME as ua, isVercelSandboxEgressRequest as ui, buildDeterministicTurnId as un, configValueSchema as uo, reviewItemReaderForUser as ur, cancelHumanFacingPendingMessages as ut, hydrateConversationMessages as v, SANDBOX_DATA_ROOT as va, formatSlackLink as vi, getAgentBackgroundCompactionMarkTokens as vn, RESOURCE_SUBSCRIPTION_MAX_TTL_MS as vr, getConversation as vt, fallbackShortTitle as w, sandboxSkillFile as wa, deleteSlackMessage as wi, createUserTokenStore as wn, createTimerWatch as wr, listActiveConversationIds as wt, persistConversationMessageSummaries as x, SANDBOX_SKILLS_ROOT as xa, slackMention as xi, getExperimentalFeatures as xn, cancelSubscriptions as xr, hasRunnableConversationWork as xt, persistConversationMessages as y, SANDBOX_JUNIOR_ROOT as ya, normalizeSlackReplyMarkdown as yi, getAgentContextCompactionTriggerTokens as yn, RESOURCE_WATCH_TOOL_SOURCE as yr, getConversationWorkState as yt, createPluginAuthOrchestration as z, conversationViewerMarks as za, getSlackClient as zi, validatePlugins as zn, getDashboardConversationLink as zr, buildTurnErrorResponse as zt };
|
|
14815
|
+
export { completeTurnRecord as $, getSlackFileId as $a, isWorkspaceSnapshotNotReadyError as $i, takeReviewItem as $n, updateWorkspace as $r, isStandaloneRuntimeContextMessage as $t, getConversationMessageSlackTs as A, createPluginLogger as Aa, removeReactionFromMessage as Ai, createPluginHookRunner as An, takeDueTimerWatches as Ar, requestAnotherSlice as At, authorizationId as B, conversationViewerMarks as Ba, isConversationScopedChannel as Bi, coreTaskRegistrations as Bn, getDashboardObjectIconLink as Br, createTurnLimitGate as Bt, settleConversationTitleWork as C, sandboxSkillDir as Ca, addReactionToMessage as Ci, setExperimentalFeatures as Cn, collectEventMatchKeys as Cr, isInvalidConversationRecordError as Ct, buildConversationContext as D, buildNonInteractiveShellScript as Da, openSlackModal as Di, getOAuthAccountProviders as Dn, findMatchingWatches as Dr, recordConversationRetry as Dt, appendThreadContextMessages as E, buildCommandScript as Ea, openSlackDirectMessage as Ei, webActorUserIds as En, deliverWatch as Er, recordAttemptFailure as Et, turnHasReply as F, conversationHasParticipantUser as Fa, SlackActionError as Fi, getPluginTools as Fn, verifyScheduledAutomationCredentialSubject as Fr, TURN_LIMIT_WRAP_UP_MESSAGE as Ft, canReusePendingAuthLink as G, readConversationEventPage as Ga, getWorkspaceTeamId as Gi, countReviewItemsNeedingUser as Gn, createPluginState as Gr, getPiMessageRole as Gt, AuthorizationFlowDisabledError as H, viewerConversationMembership as Ha, normalizeSlackConversationId as Hi, setBriefsConfig as Hn, getDashboardTaskLink as Hr, CODEMODE_TOOL_NAME as Ht, upsertConversationMessage as I, conversationIsMemberRoot as Ia, downloadPrivateSlackFile as Ii, getPluginUserPromptContributions as In, verifySlackDirectCredentialSubject as Ir, TurnBudgetExceededError as It, wasPendingAuthStopped as J, readConversationLastEventSeq as Ja, isAlreadyExistsError as Ji, getReviewItem as Jn, deleteWorkspace as Jr, hasCurrentInstruction as Jt, clearPendingAuth as K, readConversationEventPageAfter as Ka, runWithWorkspaceTeamId as Ki, dismissOpenReviewItems as Kn, renderToolResultNudge as Kr, getTerminalAssistantMessages as Kt, createPluginEgress as L, conversationNotArchivedForEmail as La, getFilePermalink as Li, getPlugins as Ln, verifyTimerWatchCredentialSubject as Lr, TurnSliceLimitExceededError as Lt, markConversationMessage as M, readConversationAccessFromSql as Ma, uploadFilesToConversation as Mi, getPluginRoutes as Mn, bindScheduledAutomationCredentialSubject as Mr, startConversationWork as Mt, normalizeConversationText as N, conversationArchivedForEmail as Na, slackEntitySchema as Ni, getPluginSlackConversationLink as Nn, bindSlackDirectCredentialSubject as Nr, steerWebPendingMessages as Nt, createConversationMemoryService as O, runNonInteractiveCommand as Oa, postSlackEphemeralMessage as Oi, resolvePluginOAuthAccount as On, getWatch as Or, releaseConversationWork as Ot, recordDeliveredAssistantMessage as P, conversationArchivedForUser as Pa, slackExternalRefIdSchema as Pi, getPluginSystemPromptContributions as Pn, verifyEventAutomationCredentialSubject as Pr, stopConversationWork as Pt, abandonTurnRecord as Q, notInheritedByForkChild as Qa, getWorkspaceSnapshotNotReadyError as Qi, searchReviewItems as Qn, listWorkspacesByRepository as Qr, isContinuablePiBoundary as Qt, PluginCredentialFailureError as R, conversationNotArchivedForUser as Ra, getHeaderString as Ri, setPlugins as Rn, JUNIOR_THREAD_STATE_TTL_MS as Rr, TurnToolCallLimitExceededError as Rt, resolveConversationTitle as S, SANDBOX_WORKSPACE_ROOT as Sa, truncateStatusText as Si, isExperimentalFeatureEnabled as Sn, cancelWatch as Sr, isFinalAttempt as St, resolveTaskTitle as T, sandboxSkillPathResolution as Ta, getSlackMessagePermalink as Ti, findLegacyWebActorUserId as Tn, createWatch as Tr, markConversationWorkEnqueued as Tt, AuthorizationPauseError as U, createPluginConversationEvents as Ua, runWithSlackInstallationToken as Ui, REVIEW_ITEM_REPLIED_REASON as Un, setDashboardConversationLinkOptions as Ur, persistWithRetry as Ut, AuthPausePersistenceError as V, readConversationViewerMarks as Va, isDmChannel as Vi, registration_exports as Vn, getDashboardReviewItemLink as Vr, isTurnExecutionLimitExceededError as Vt, abandonReplacedPendingAuth as W, readLatestConversationBrief as Wa, withSlackRetries as Wi, closeReviewItem as Wn, ToolInputError as Wr, extractAssistantText as Wt, loadTurnCheckpoint as X, buildSentryConversationUrl as Xa, wrapSandboxSetupError as Xi, listReplyActionItems as Xn, getWorkspaceByName as Xr, instructionTextForProjection as Xt, continuableMessages as Y, readConversationMessageEventSeq as Ya, throwSandboxOperationError as Yi, insertReviewItem as Yn, getWorkspace as Yr, hasRuntimeTurnContext as Yt, saveTurnCheckpoint as Z, loadForkHistory as Za, WorkspaceSnapshotNotReadyError as Zi, listWaitingConversations as Zn, listWorkspaces as Zr, isAssistantMessage as Zt, appendConversationMessages as _, SANDBOX_COMMAND_PATH as _a, escapeSlackMrkdwnText as _i, estimateTextTokens as _n, JUNIOR_NATIVE_EVENT_NAMESPACE as _o, RESOURCE_SUBSCRIPTION_DEFAULT_TTL_MS as _r, drainConversationMailbox as _t, loadProjection as a, parseSandboxEgressCredentialToken as aa, create as ai, trimTrailingAssistantMessages as an, createPluginAnnotations as ao, isOnlyAssignee as ar, CONVERSATION_WORK_STALE_ENQUEUE_MS as at, projectConversationMessages as b, SANDBOX_REPOS_ROOT as ba, normalizeSlackStatusText as bi, getAgentContextInputLimitTokens as bn, setConfigDefaults as bo, STOP_WATCHING_TOOL_NAME as br, hasConversationStop as bt, recordAgentsInstructionsUpdated as c, resolveSandboxCommandEnvironment as ca, ensureDockerDaemon as ci, TURN_CONTEXT_TAG as cn, defaultTimezone as co, requireReviewItemLinks as cr, appendInboundMessage as ct, recordAuthorizationCompleted as d, sleep$2 as da, proxyVercelSandboxEgressRequest as di, SubscribedReplyReason as dn, createPluginCache as do, EVERYONE_ASSIGNEE as dr, checkInConversationWork as dt, workspaceSnapshotNotReadyUserMessage as ea, WorkspaceValidationError as ei, isToolResultError as en, matchSlackAttachments as eo, updateReviewItemContent as er, failTurnRecord as et, recordAuthorizationRequested as f, tryWorkspaceRepoCheckoutPath as fa, deliverOAuthAuthorization as fi, decideSubscribedThreadReply as fn, createDurableLocationConfigurationService as fo, automationCreatorUserId as fr, clearConsumedConversationWake as ft, recordToolExecutionStarted as g, createPluginModel as ga, startOAuthFlow as gi, estimateRequestOverheadTokens as gn, projectConversationEvents as go, getSlackToolContext as gr, deadLetterAttempt as gt, recordSubscribedReplyRoute as h, createPluginEmbedder as ha, resolveBaseUrl as hi, calculateContextCompactionTargetTokens as hn, piMessageFromHistoryItem as ho, resolveChannelCapabilities as hr, completeConversationWork as ht, loadConversationProjection as i, createSandboxEgressCredentialToken as ia, setWorkspaceSnapshotBuild as ii, stripRuntimeTurnContext as in, saveObjectAnnotations as io, canReadReviewItem as ir, CONVERSATION_WORK_CHECK_IN_INTERVAL_MS as it, isHumanConversationMessage as j, canAccessConversation as ja, updateSlackMessage as ji, getPluginApiRoutes as jn, bindEventAutomationCredentialSubject as jr, requestConversationWork as jt, estimateConversationContextTokens as k, createPluginModelCostRecorder as ka, postSlackMessage as ki, agent_hooks_exports as kn, listWatches as kr, removeActiveConversation as kt, recordAttachmentsDelivered as l, normalizeSandboxEgressTracePropagationDomains as la, getSandboxProvider as li, buildDeterministicAssistantMessageId as ln, resolveUserTimezone as lo, reviewItemNeedsUser as lr, beginConversationResume as lt, recordMcpProviderConnected as m, PluginToolDeniedError as ma, parseOAuthStatePayload as mi, getThreadStopDecision as mn, historyItemFromPiMessage as mo, resolveAssignees as mr, completeConversationStop as mt, commitMessages as n, consumeSandboxEgressAuthRequiredSignal as na, loadSnapshotsForProfile as ni, normalizeToolNameFromResult as nn, recordSlackAttachment as no, canActOnReviewItem as nr, listTurnSummaries as nt, loadTurnProjection as o, sandboxEgressSignalsResponseSchema as oa, hash as oi, REQUEST_CONTEXT_SECTION_TAG as on, listConversationAnnotations as oo, readReviewItemAgentScope as or, ackMessages as ot, recordGuardianActionReviewed as p, workspaceRepoCheckoutPath as pa, formatProviderLabel as pi, getSubscribedReplyPreflightDecision as pn, configValueSchema as po, resolveAssignee as pr, clearExpiredConversationLease as pt, getConversationPendingAuth as q, readConversationEventPageAround as qa, isAbortError as qi, getOpenReviewItemByDedupeKey as qn, createWorkspace as qr, getUserMessageInstructionText as qt, loadConnectedMcpProviders as r, consumeSandboxEgressPermissionDeniedSignal as ra, setWorkspaceSnapshot as ri, retainRuntimeTurnContext as rn, resolveRootVisibility as ro, canAgentChangeReviewItem as rr, recordTurnSummary as rt, openConversationProjection as s, buildSandboxEgressNetworkPolicy as sa, isStale as si, SESSION_CONTEXT_SECTION_TAG as sn, listConversationAnnotationsById as so, requireReviewItemAssignees as sr, appendExclusiveInboundMessage as st, commitAcceptedReply as t, clearSandboxEgressSignals as ta, invalidateReadySnapshot as ti, isToolResultMessage as tn, readAttachmentVisionSummary as to, PLUGIN_REVIEW_ITEM_KEY_PREFIX as tr, getTurnRecord as tt, recordAuthenticationLinked as u, SANDBOX_RUNTIME as ua, isVercelSandboxEgressRequest as ui, buildDeterministicTurnId as un, lookupSlackUser as uo, reviewItemReaderForUser as ur, cancelHumanFacingPendingMessages as ut, hydrateConversationMessages as v, SANDBOX_DATA_ROOT as va, formatSlackLink as vi, getAgentBackgroundCompactionMarkTokens as vn, conversationNoteEvent as vo, RESOURCE_SUBSCRIPTION_MAX_TTL_MS as vr, getConversation as vt, fallbackShortTitle as w, sandboxSkillFile as wa, deleteSlackMessage as wi, createUserTokenStore as wn, createTimerWatch as wr, listActiveConversationIds as wt, persistConversationMessageSummaries as x, SANDBOX_SKILLS_ROOT as xa, slackMention as xi, getExperimentalFeatures as xn, cancelSubscriptions as xr, hasRunnableConversationWork as xt, persistConversationMessages as y, SANDBOX_JUNIOR_ROOT as ya, normalizeSlackReplyMarkdown as yi, getAgentContextCompactionTriggerTokens as yn, getConfigDefaults as yo, RESOURCE_WATCH_TOOL_SOURCE as yr, getConversationWorkState as yt, createPluginAuthOrchestration as z, conversationPinnedForUser as za, getSlackClient as zi, validatePlugins as zn, getDashboardConversationLink as zr, buildTurnErrorResponse as zt };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { H as conversationBriefSchema, U as parseBriefInput, V as briefOutcomeStatusSchema } from "./conversation-
|
|
1
|
+
import { H as conversationBriefSchema, U as parseBriefInput, V as briefOutcomeStatusSchema } from "./conversation-CIiJtx5q.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
// src/chat/briefs/generate.ts
|
|
4
4
|
const MAX_INPUT_CHARS = 6e4;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// src/chat/sandbox/egress/proxy-path.ts
|
|
2
|
+
const SANDBOX_EGRESS_PROXY_PATH = "/api/internal/sandbox-egress";
|
|
3
|
+
const PROXY_PATH_PREFIX = `${SANDBOX_EGRESS_PROXY_PATH}/`;
|
|
4
|
+
const SIGNALS_SEGMENT = "signals";
|
|
5
|
+
/**
|
|
6
|
+
* Replace the credential token and everything after it in a sandbox egress
|
|
7
|
+
* proxy path or URL. Other values are returned unchanged.
|
|
8
|
+
*/
|
|
9
|
+
function redactSandboxEgressProxyPath(value) {
|
|
10
|
+
const index = value.indexOf(PROXY_PATH_PREFIX);
|
|
11
|
+
if (index === -1) return value;
|
|
12
|
+
if (value.slice(index + PROXY_PATH_PREFIX.length).split(/[/?#]/, 1)[0] === SIGNALS_SEGMENT) return value;
|
|
13
|
+
return `${value.slice(0, index)}${PROXY_PATH_PREFIX}<token>`;
|
|
14
|
+
}
|
|
15
|
+
export { redactSandboxEgressProxyPath as n, SANDBOX_EGRESS_PROXY_PATH as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { b as setSpanAttributes, h as logWarn, m as logInfo } from "./logging-
|
|
1
|
+
import { b as setSpanAttributes, h as logWarn, m as logInfo } from "./logging-CkT3_Xxp.js";
|
|
2
2
|
import { o as isUserActor, s as parseActorUserId } from "./actor-B4DYygOB.js";
|
|
3
|
-
import { n as normalizePluginPackageNames, o as pluginRoots, t as discoverInstalledPluginPackageContent } from "./package-discovery-
|
|
3
|
+
import { n as normalizePluginPackageNames, o as pluginRoots, t as discoverInstalledPluginPackageContent } from "./package-discovery-DJhGdS4c.js";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { randomUUID } from "node:crypto";
|
|
6
6
|
import { z } from "zod";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Oa as runNonInteractiveCommand, Sa as SANDBOX_WORKSPACE_ROOT, _a as SANDBOX_COMMAND_PATH, ai as create, da as sleep, li as getSandboxProvider, si as isStale } from "./projection-
|
|
2
|
-
import { E as withSpan, b as setSpanAttributes } from "./logging-
|
|
3
|
-
import { r as getStateAdapter } from "./adapter-
|
|
1
|
+
import { Oa as runNonInteractiveCommand, Sa as SANDBOX_WORKSPACE_ROOT, _a as SANDBOX_COMMAND_PATH, ai as create, da as sleep, li as getSandboxProvider, si as isStale } from "./projection-DWxX7pb1.js";
|
|
2
|
+
import { E as withSpan, b as setSpanAttributes } from "./logging-CkT3_Xxp.js";
|
|
3
|
+
import { r as getStateAdapter } from "./adapter-phTTgw7H.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
// src/chat/sandbox/resources.ts
|
|
6
6
|
let configuredResources;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { nt as listTurnSummaries, tt as getTurnRecord } from "./projection-
|
|
1
|
+
import { v as __exportAll } from "./sentry-BRTJqumy.js";
|
|
2
|
+
import { nt as listTurnSummaries, tt as getTurnRecord } from "./projection-DWxX7pb1.js";
|
|
3
3
|
import { t as createActor } from "./actor-B4DYygOB.js";
|
|
4
|
-
import { F as SYSTEM_IDENTITY_ID } from "./viewer-
|
|
5
|
-
import { f as credentialContextForActor } from "./registry-
|
|
6
|
-
import { wt as listUnreportedSiblingAgents } from "./agent-runner-
|
|
7
|
-
import { a as EVENT_SYSTEM_ACTOR, i as EVENT_MESSAGE_AUTHOR, o as isEventConversationMessage } from "./prompt
|
|
8
|
-
import { _ as getLatestAgentInvocationForConversation, c as getAgentInvocation, d as getAgentInvocationIdForResult, l as getAgentInvocationIdForEvents, o as createAgentInvocationFromLatest, p as getAgentInvocationResultMessageId, u as getAgentInvocationIdForMessage, w as markAgentInvocationParentMailboxAppended, y as isTerminalAgentInvocation } from "./store-
|
|
9
|
-
import { a as EVENT_WAIT_MS, c as isEventMailboxMetadata, l as renderEventBatchText, u as timerWatchCredentialSubject } from "./session-stop-
|
|
10
|
-
import { r as appendAndEnqueueInboundMessage } from "./store-
|
|
11
|
-
import { a as resolveAgentInvocationId, i as enqueueAgentInvocation, t as createAgentInvocationWorker } from "./work-
|
|
4
|
+
import { F as SYSTEM_IDENTITY_ID } from "./viewer-vsM8_90o.js";
|
|
5
|
+
import { f as credentialContextForActor } from "./registry-DnrdeO4s.js";
|
|
6
|
+
import { wt as listUnreportedSiblingAgents } from "./agent-runner-DwvT1BY0.js";
|
|
7
|
+
import { a as EVENT_SYSTEM_ACTOR, i as EVENT_MESSAGE_AUTHOR, o as isEventConversationMessage } from "./prompt--dwus7Y-.js";
|
|
8
|
+
import { _ as getLatestAgentInvocationForConversation, c as getAgentInvocation, d as getAgentInvocationIdForResult, l as getAgentInvocationIdForEvents, o as createAgentInvocationFromLatest, p as getAgentInvocationResultMessageId, u as getAgentInvocationIdForMessage, w as markAgentInvocationParentMailboxAppended, y as isTerminalAgentInvocation } from "./store-CO5vGjwD.js";
|
|
9
|
+
import { a as EVENT_WAIT_MS, c as isEventMailboxMetadata, l as renderEventBatchText, u as timerWatchCredentialSubject } from "./session-stop-6Tf--T7G.js";
|
|
10
|
+
import { r as appendAndEnqueueInboundMessage } from "./store-G3h2djJU.js";
|
|
11
|
+
import { a as resolveAgentInvocationId, i as enqueueAgentInvocation, t as createAgentInvocationWorker } from "./work-DsoFRO_0.js";
|
|
12
12
|
import { z } from "zod";
|
|
13
13
|
import { createEventSource, createLocalSource, createWebSource } from "@sentry/junior-plugin-api";
|
|
14
14
|
// src/chat/conversations/web-mailbox.ts
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { B as authorizationId, D as buildConversationContext, I as upsertConversationMessage, M as markConversationMessage, N as normalizeConversationText, P as recordDeliveredAssistantMessage, Ut as persistWithRetry, Z as saveTurnCheckpoint, a as loadProjection, d as recordAuthorizationCompleted, t as commitAcceptedReply, v as hydrateConversationMessages, y as persistConversationMessages } from "./projection-
|
|
2
|
-
import { S as setTags, T as withLogContext, p as logException } from "./logging-
|
|
3
|
-
import { F as SYSTEM_IDENTITY_ID, x as getConversationStore, y as getConversationEventStore } from "./viewer-
|
|
4
|
-
import { f as credentialContextForActor } from "./registry-
|
|
5
|
-
import { j as messageCardText } from "./conversation-
|
|
6
|
-
import { $ as markTurnFailed, et as startActiveTurn } from "./store-
|
|
7
|
-
import { n as getAssistantReplyText } from "./assistant-reply-
|
|
8
|
-
import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-
|
|
9
|
-
import { a as persistThreadStateById, n as getPersistedSandboxState, o as coerceThreadConversationState, r as getPersistedThreadState } from "./thread-state-
|
|
10
|
-
import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-
|
|
11
|
-
import { i as completeAuthPauseTurn, l as buildDeliveredTurnStatePatch, t as finalizeFailedTurnReplyWithEvent, u as loadPendingMessageCards } from "./turn-failure-response-
|
|
1
|
+
import { B as authorizationId, D as buildConversationContext, I as upsertConversationMessage, M as markConversationMessage, N as normalizeConversationText, P as recordDeliveredAssistantMessage, Ut as persistWithRetry, Z as saveTurnCheckpoint, a as loadProjection, d as recordAuthorizationCompleted, t as commitAcceptedReply, v as hydrateConversationMessages, y as persistConversationMessages } from "./projection-DWxX7pb1.js";
|
|
2
|
+
import { S as setTags, T as withLogContext, p as logException } from "./logging-CkT3_Xxp.js";
|
|
3
|
+
import { F as SYSTEM_IDENTITY_ID, x as getConversationStore, y as getConversationEventStore } from "./viewer-vsM8_90o.js";
|
|
4
|
+
import { f as credentialContextForActor } from "./registry-DnrdeO4s.js";
|
|
5
|
+
import { j as messageCardText } from "./conversation-CIiJtx5q.js";
|
|
6
|
+
import { $ as markTurnFailed, et as startActiveTurn } from "./store-CO5vGjwD.js";
|
|
7
|
+
import { n as getAssistantReplyText } from "./assistant-reply-BXfxczd7.js";
|
|
8
|
+
import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-7sXwXLJ6.js";
|
|
9
|
+
import { a as persistThreadStateById, n as getPersistedSandboxState, o as coerceThreadConversationState, r as getPersistedThreadState } from "./thread-state-Cj_7Slru.js";
|
|
10
|
+
import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-B-Bdm23d.js";
|
|
11
|
+
import { i as completeAuthPauseTurn, l as buildDeliveredTurnStatePatch, t as finalizeFailedTurnReplyWithEvent, u as loadPendingMessageCards } from "./turn-failure-response-CE7gaoC7.js";
|
|
12
12
|
import { randomUUID } from "node:crypto";
|
|
13
13
|
import { createLocalSource, localDestinationSchema } from "@sentry/junior-plugin-api";
|
|
14
14
|
// src/chat/local/runner.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { oa as sandboxEgressSignalsResponseSchema } from "./projection-
|
|
1
|
+
import { oa as sandboxEgressSignalsResponseSchema } from "./projection-DWxX7pb1.js";
|
|
2
2
|
// src/chat/local/sandbox-egress-signals.ts
|
|
3
3
|
const SANDBOX_EGRESS_SIGNALS_PATH = "/api/internal/sandbox-egress/signals";
|
|
4
4
|
const LOCAL_DEV_SERVER_TIMEOUT_MS = 1e3;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { r as AGENT_INVOCATION_STATUSES, u as juniorDestinationKindSchema } from "./agent-invocations-
|
|
2
|
-
import { E as conversationChildAgentTotalsSchema,
|
|
1
|
+
import { r as AGENT_INVOCATION_STATUSES, u as juniorDestinationKindSchema } from "./agent-invocations-CUg_SODU.js";
|
|
2
|
+
import { E as conversationChildAgentTotalsSchema, o as conversationAuxiliaryCostsSchema, r as actorIdentitySchema, x as conversationUsageSchema, y as conversationSummaryReportSchema } from "./conversation-CIiJtx5q.js";
|
|
3
3
|
import { i as fillUtcHours, r as fillUtcDays, s as sumUtcHoursIntoSixHours, y as userInputRequestSchema } from "./reporting-window-DgHgwQB3.js";
|
|
4
|
-
import "./automation-
|
|
5
|
-
import "./
|
|
4
|
+
import "./automation-BehArCcq.js";
|
|
5
|
+
import "./conversation-pending-messages-CnBvE6-6.js";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
import { codeChangeStateSchema, eventMatchSchema } from "@sentry/junior-plugin-api";
|
|
8
8
|
// src/api/schema/conversation-pin.ts
|
|
@@ -20,69 +20,6 @@ const archiveConversationResponseSchema = z.object({ archivedAt: z.string().date
|
|
|
20
20
|
const conversationAutoArchiveSchema = z.object({ autoArchive: z.boolean() }).strict();
|
|
21
21
|
/** Result of archiving all of the viewer's done conversations once. */
|
|
22
22
|
const archiveDoneConversationsResponseSchema = z.object({ archived: z.number().int().nonnegative() }).strict();
|
|
23
|
-
// src/api/schema/conversation-pending-messages.ts
|
|
24
|
-
/** Mailbox delivery mode for one accepted inbound message. */
|
|
25
|
-
const conversationPendingMessageDeliverySchema = z.enum(["defer", "interrupt"]);
|
|
26
|
-
/** One accepted mailbox message that has not reached durable history yet. */
|
|
27
|
-
const conversationPendingMessageSchema = z.object({
|
|
28
|
-
actorIdentity: actorIdentitySchema.optional(),
|
|
29
|
-
/** Identity id of the author. Detail `authors` maps it to the person. */
|
|
30
|
-
actorIdentityId: z.string().min(1).optional(),
|
|
31
|
-
createdAt: z.string().datetime(),
|
|
32
|
-
delivery: conversationPendingMessageDeliverySchema,
|
|
33
|
-
inboundMessageId: z.string().min(1),
|
|
34
|
-
messageId: z.string().min(1),
|
|
35
|
-
receivedAt: z.string().datetime(),
|
|
36
|
-
role: z.literal("user"),
|
|
37
|
-
source: z.enum(["slack", "web"]),
|
|
38
|
-
text: z.string().optional(),
|
|
39
|
-
/** People mentioned in the text, resolved at read time. */
|
|
40
|
-
mentions: z.array(actorIdentitySchema).optional(),
|
|
41
|
-
attachments: z.array(messageAttachmentSchema).optional(),
|
|
42
|
-
/** Review item change that this Message records. */
|
|
43
|
-
reviewItemChange: reviewItemChangeRecordSchema.optional(),
|
|
44
|
-
redacted: z.literal(true).optional()
|
|
45
|
-
}).strict().superRefine((data, context) => {
|
|
46
|
-
if (data.text === void 0 === (data.redacted !== true)) context.addIssue({
|
|
47
|
-
code: "custom",
|
|
48
|
-
message: "pending message content must be text or explicitly redacted"
|
|
49
|
-
});
|
|
50
|
-
if (data.redacted && (data.actorIdentity || data.attachments || data.mentions || data.reviewItemChange)) context.addIssue({
|
|
51
|
-
code: "custom",
|
|
52
|
-
message: "redacted pending messages must not expose actor identity, attachments, mentions, or a review item"
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
/** Participant-only authorization prompt for a parked web turn. */
|
|
56
|
-
const conversationPendingAuthorizationSchema = z.object({
|
|
57
|
-
authorizationUrl: z.string().url(),
|
|
58
|
-
completionText: z.string().min(1),
|
|
59
|
-
label: z.string().min(1)
|
|
60
|
-
}).strict();
|
|
61
|
-
/** Bounded mailbox snapshot for one conversation transcript. */
|
|
62
|
-
const conversationPendingMessagesReportSchema = z.object({
|
|
63
|
-
authorization: conversationPendingAuthorizationSchema.optional(),
|
|
64
|
-
conversationId: z.string().min(1),
|
|
65
|
-
generatedAt: z.string().datetime(),
|
|
66
|
-
messages: z.array(conversationPendingMessageSchema)
|
|
67
|
-
}).strict();
|
|
68
|
-
/** Optional filters for cancelling accepted mailbox rows. */
|
|
69
|
-
const cancelConversationPendingMessagesBodySchema = z.object({
|
|
70
|
-
inboundMessageIds: z.array(z.string().min(1)).min(1).optional(),
|
|
71
|
-
receivedBefore: z.string().datetime().optional()
|
|
72
|
-
}).strict();
|
|
73
|
-
/** Result of cancelling accepted human-facing mailbox rows. */
|
|
74
|
-
const cancelConversationPendingMessagesResponseSchema = z.object({
|
|
75
|
-
cancelledCount: z.number().int().nonnegative(),
|
|
76
|
-
cancelledInboundMessageIds: z.array(z.string().min(1)),
|
|
77
|
-
conversationId: z.string().min(1)
|
|
78
|
-
}).strict();
|
|
79
|
-
/** Queued web messages that the viewer wants Junior to read now. */
|
|
80
|
-
const steerConversationPendingMessagesBodySchema = z.object({ inboundMessageIds: z.array(z.string().min(1)).min(1) }).strict();
|
|
81
|
-
/** Result of steering queued web messages into the conversation. */
|
|
82
|
-
const steerConversationPendingMessagesResponseSchema = z.object({
|
|
83
|
-
conversationId: z.string().min(1),
|
|
84
|
-
steeredInboundMessageIds: z.array(z.string().min(1))
|
|
85
|
-
}).strict();
|
|
86
23
|
// src/api/schema/conversation-stats.ts
|
|
87
24
|
const conversationStatsItemSchema = z.object({
|
|
88
25
|
active: z.number(),
|
|
@@ -712,4 +649,4 @@ const statsReportSchema = z.object({
|
|
|
712
649
|
windowEnd: z.string(),
|
|
713
650
|
windowStart: z.string()
|
|
714
651
|
}).strict();
|
|
715
|
-
export { codeRepositorySummarySchema as $, avatarParamsSchema as A, dailyConversationActivitySchema as B, createdPersonalTokenSchema as C, revokePersonalTokenResponseSchema as D, personalTokenParamsSchema as E, locationDirectoryReportSchema as F, startConnectionResponseSchema as G, connectionParamsSchema as H, locationParamsSchema as I, codeChangeSummarySchema as J, codeActivityDaySchema as K, activityDays as L, personalSpendReportSchema as M, locationActivityDayReportSchema as N, actorDirectoryReportSchema as O, locationDetailReportSchema as P, codeRepositoryReportSchema as Q, activityHours as R, createPersonalTokenBodySchema as S, personalTokenMetadataSchema as T, connectionSchema as U, connectionListSchema as V, disconnectConnectionResponseSchema as W, codePersonReportSchema as X, codeOverviewReportSchema as Y, codeRepositoryParamsSchema as Z, disconnectServiceAccountResponseSchema as _,
|
|
652
|
+
export { codeRepositorySummarySchema as $, avatarParamsSchema as A, dailyConversationActivitySchema as B, createdPersonalTokenSchema as C, revokePersonalTokenResponseSchema as D, personalTokenParamsSchema as E, locationDirectoryReportSchema as F, startConnectionResponseSchema as G, connectionParamsSchema as H, locationParamsSchema as I, codeChangeSummarySchema as J, codeActivityDaySchema as K, activityDays as L, personalSpendReportSchema as M, locationActivityDayReportSchema as N, actorDirectoryReportSchema as O, locationDetailReportSchema as P, codeRepositoryReportSchema as Q, activityHours as R, createPersonalTokenBodySchema as S, personalTokenMetadataSchema as T, connectionSchema as U, connectionListSchema as V, disconnectConnectionResponseSchema as W, codePersonReportSchema as X, codeOverviewReportSchema as Y, codeRepositoryParamsSchema as Z, disconnectServiceAccountResponseSchema as _, workspaceBodySchema as a, conversationStatsReportSchema as at, serviceAccountSchema as b, workspaceRepoSchema as c, archiveDoneConversationsResponseSchema as ct, reviewItemCountSchema as d, pinConversationResponseSchema as dt, conversationWatchSchema as et, reviewItemListQuerySchema as f, reviewItemWaitingConversationsSchema as g, reviewItemSchema as h, deleteWorkspaceResponseSchema as i, stopConversationTurnResponseSchema as it, personParamsSchema as j, actorProfileReportSchema as k, workspaceSchema as l, conversationAutoArchiveSchema as lt, reviewItemParamsSchema as m, statsReportSchema as n, conversationChildAgentSchema as nt, workspaceListSchema as o, archiveConversationBodySchema as ot, reviewItemListSchema as p, codeChangeSummaryReportSchema as q, baselineSnapshotSchema as r, conversationChildAgentsReportSchema as rt, workspaceParamsSchema as s, archiveConversationResponseSchema as st, statSchema as t, conversationWatchesReportSchema as tt, reviewItemActionSchema as u, pinConversationBodySchema as ut, serviceAccountListSchema as v, personalTokenListSchema as w, startServiceAccountSignInResponseSchema as x, serviceAccountParamsSchema as y, activitySixHours as z };
|