@sentry/junior 0.279.0 → 0.280.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{actor-B4DYygOB.js → actor-6jsm_v96.js} +1 -1
- package/dist/{adapter-phTTgw7H.js → adapter-DVN3iwf9.js} +1 -1
- package/dist/{admin-PcpJDugZ.js → admin-Q_UI--9W.js} +1 -1
- package/dist/{agent-runner-DwvT1BY0.js → agent-runner-_PYLv4Qo.js} +26 -27
- package/dist/api/schema.d.ts +2 -2
- package/dist/api/schema.js +7 -7
- package/dist/api.d.ts +3 -3
- package/dist/api.js +181 -85
- package/dist/{app-DVs6noo7.d.ts → app-CL2zzzE0.d.ts} +4 -4
- package/dist/app.d.ts +1 -1
- package/dist/app.js +33 -34
- package/dist/{assistant-reply-BXfxczd7.js → assistant-reply-DbebsAxi.js} +1 -1
- package/dist/{automation-BehArCcq.js → automation-CPqRFjIa.js} +2 -2
- package/dist/{background-compaction-queue-CcbuLJrZ.js → background-compaction-queue-B9lmh8Ml.js} +3 -3
- package/dist/{briefs-Dd_ezwED.js → briefs-Dej7V0Bz.js} +5 -5
- package/dist/{catalog-runtime-BWVMeZhW.js → catalog-runtime-DpN0sWQ6.js} +1 -1
- package/dist/cli/chat.js +15 -15
- package/dist/cli/check.js +3 -3
- package/dist/cli/main.js +3 -3
- package/dist/cli/plugins.js +4 -4
- package/dist/cli/snapshot-create.js +4 -4
- package/dist/cli/upgrade.d.ts +1 -1
- package/dist/cli/upgrade.js +3 -3
- package/dist/{client-Bpxe4vKa.js → client-h2A2ZPzY.js} +2 -2
- package/dist/{config-C_bmRhrJ.js → config-CusBFORe.js} +2 -2
- package/dist/{connections-B2rHe5W5.js → connections-C4h6mGha.js} +11 -11
- package/dist/{conversation-CIiJtx5q.js → conversation-DExTZw8B.js} +16 -6
- package/dist/{conversation-pending-messages-CnBvE6-6.js → conversation-pending-messages-Dgz6hrJs.js} +2 -2
- package/dist/{conversation-privacy-CzOfcz0U.js → conversation-privacy-2cm6OpNg.js} +1 -1
- package/dist/{credential-sync-Dal_unpv.js → credential-sync-DK06Jgt-.js} +16 -16
- package/dist/{db-CyLrV9C7.d.ts → db-Dsvk1Tp1.d.ts} +2 -2
- package/dist/{executor-BfYH-Wws.js → executor-Cmr0J8W3.js} +149 -6
- package/dist/instrumentation.js +2 -2
- package/dist/{logging-CkT3_Xxp.js → logging-CGnh65_X.js} +1 -1
- package/dist/{media-DTAA8Qs_.js → media-Dq9_svfQ.js} +1 -1
- package/dist/{message-Q5dkgaJ5.js → message-RpAnqHPY.js} +9 -9
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +3 -3
- package/dist/{oauth-callback-server-BDRaqe8O.js → oauth-callback-server-BBnhVKuX.js} +2 -2
- package/dist/{oauth-relay-D0G3T16m.js → oauth-relay-D6xxVywK.js} +1 -1
- package/dist/{projection-DWxX7pb1.js → projection-C1MghKyI.js} +148 -106
- package/dist/{prompt--dwus7Y-.js → prompt-BcHg-BMy.js} +2 -2
- package/dist/{queue-C37RbDVc.d.ts → queue-CZyYgPF0.d.ts} +1 -1
- package/dist/{registry-DnrdeO4s.js → registry-DR7DjX9H.js} +3 -3
- package/dist/{reporting-window-DgHgwQB3.js → reporting-window-B-QP9zX1.js} +28 -2
- package/dist/{resolve-C_QXfqD_.js → resolve-0Ful4oDv.js} +4 -4
- package/dist/{result-DNmOxT-N.js → result-Dd9kCuQ-.js} +11 -11
- package/dist/{runner-zd_noJ1l.js → runner-yiY8gUUu.js} +11 -11
- package/dist/{sandbox-egress-signals-DQjv-nbG.js → sandbox-egress-signals-BzQVHCMz.js} +1 -1
- package/dist/{schema-e90H5FIN.d.ts → schema-BkMmF552.d.ts} +28 -5
- package/dist/{schema-CNJNzvr8.js → schema-C5pEgfHc.js} +30 -7
- package/dist/{service-account-BK26XlHo.js → service-account-Cu7HFLZQ.js} +3 -3
- package/dist/{service-account-CCH2Hv4h.js → service-account-PIMpWZHF.js} +3 -3
- package/dist/{session-stop-6Tf--T7G.js → session-stop-CDEMsNtv.js} +13 -14
- package/dist/{skills-BNrk8gi4.js → skills-B2xIoe0f.js} +3 -3
- package/dist/{spawn-C75hAB9l.js → spawn-C0DySQRV.js} +2 -2
- package/dist/{stop-RYbf7PWi.js → stop-Dj5-nrAo.js} +255 -144
- package/dist/{store-CO5vGjwD.js → store-Dlio-o6u.js} +6 -6
- package/dist/{store-G3h2djJU.js → store-QzOfDwKA.js} +3 -3
- package/dist/{task-queue-DlN58XeM.js → task-queue-Cp1V_XW3.js} +4 -4
- package/dist/{task-runner-B-Bdm23d.js → task-runner-CQkkUj3o.js} +8 -8
- package/dist/{thread-state-Cj_7Slru.js → thread-state-Bn87cfzE.js} +4 -4
- package/dist/{turn-failure-response-CE7gaoC7.js → turn-failure-response-CQebxByj.js} +8 -8
- package/dist/{turn-lifecycle-7sXwXLJ6.js → turn-lifecycle-CJJsOhXB.js} +1 -1
- package/dist/{turn-session-routing-FBdaH1zf.js → turn-session-routing-bmG330Cf.js} +10 -11
- package/dist/{validation-DLWxEzWW.js → validation-D1wcf7hp.js} +1 -1
- package/dist/{version-DtQ8WFIZ.js → version-BeHSXUK6.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-vsM8_90o.js → viewer-BZ0Hp5Nb.js} +5 -6
- package/dist/{work-DsoFRO_0.js → work-BTcCIbWu.js} +12 -12
- package/dist/{worker-6kZEsCXs.js → worker-D3fDK6zc.js} +6 -6
- package/package.json +5 -5
- package/dist/agent-invocations-CUg_SODU.js +0 -181
|
@@ -1,26 +1,25 @@
|
|
|
1
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-
|
|
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, _ 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-
|
|
5
|
-
import { t as canExposeConversationPayload } from "./conversation-privacy-
|
|
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-
|
|
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-
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { a as
|
|
11
|
-
import {
|
|
12
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-BWVMeZhW.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-h2A2ZPzY.js";
|
|
3
|
+
import { i as getChatConfig, n as botConfig, o as getSlackBotToken, v as normalizeSlackEmojiName } from "./config-CusBFORe.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-CGnh65_X.js";
|
|
5
|
+
import { t as canExposeConversationPayload } from "./conversation-privacy-2cm6OpNg.js";
|
|
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-6jsm_v96.js";
|
|
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-BZ0Hp5Nb.js";
|
|
8
|
+
import { A as juniorIdentities, D as juniorAttachments, E as juniorCodeRepositories, M as juniorDestinations, S as juniorConversationEvents, T as juniorCodeChanges, _ as juniorConversationParticipants, a as juniorReviewItemAssignees, c as juniorReviewItems, d as juniorAutomations, i as juniorWorkspaces, j as juniorUsers, k as juniorConversations, n as juniorSnapshots, o as juniorReviewItemConversations, p as juniorLocationConfigurations, r as juniorWorkspaceRepos, w as juniorConversationAnnotations, y as juniorConversationBriefs } from "./executor-Cmr0J8W3.js";
|
|
9
|
+
import { a as agentHistoryItemSchema, g as instructionProvenanceFor, h as instructionActors, m as contextProvenance } from "./media-Dq9_svfQ.js";
|
|
10
|
+
import { _ as CredentialUnavailableError, a as resolveAuthTokenPlaceholder, f as credentialContextForActor, h as credentialSubjectSchema, m as credentialLogContext, o as resolvePluginCommandEnv, p as credentialContextSchema } from "./registry-DR7DjX9H.js";
|
|
11
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-DpN0sWQ6.js";
|
|
13
12
|
import { a as withLock, i as fenceLock, n as MUTATION_LOCK_TTL_MS, r as acquireActiveLock } from "./locks-D-0h111u.js";
|
|
14
|
-
import { n as getDefaultRedisStateAdapterFor, r as getStateAdapter } from "./adapter-
|
|
13
|
+
import { n as getDefaultRedisStateAdapterFor, r as getStateAdapter } from "./adapter-DVN3iwf9.js";
|
|
15
14
|
import { i as isValidTimeZone } from "./cadence-R7Em4RjE.js";
|
|
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-
|
|
17
|
-
import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt
|
|
15
|
+
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-DExTZw8B.js";
|
|
16
|
+
import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-BcHg-BMy.js";
|
|
18
17
|
import { n as redactSandboxEgressProxyPath, t as SANDBOX_EGRESS_PROXY_PATH } from "./proxy-path-BHYoKZdq.js";
|
|
19
18
|
import path from "node:path";
|
|
20
19
|
import { isDeepStrictEqual } from "node:util";
|
|
21
20
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
22
21
|
import { createHash, createHmac, createPrivateKey, createPublicKey, generateKeyPairSync, randomBytes, randomUUID, sign, timingSafeEqual } from "node:crypto";
|
|
23
|
-
import
|
|
22
|
+
import * as z from "zod";
|
|
24
23
|
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
24
|
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
25
|
import { alias, union } from "drizzle-orm/pg-core";
|
|
@@ -259,7 +258,7 @@ function historyItemProvenance(data) {
|
|
|
259
258
|
* Host-only events are filtered, completed authorization becomes a synthetic
|
|
260
259
|
* observation, and `maxSeq` reproduces an exact committed boundary.
|
|
261
260
|
*/
|
|
262
|
-
function projectConversationEvents(events, options = {}) {
|
|
261
|
+
function projectConversationEvents$1(events, options = {}) {
|
|
263
262
|
const messages = [];
|
|
264
263
|
const provenance = [];
|
|
265
264
|
const seqs = [];
|
|
@@ -1441,91 +1440,141 @@ async function readConversationEventRows(executor, args) {
|
|
|
1441
1440
|
end`
|
|
1442
1441
|
}).from(juniorConversationEvents).where(and(eq(juniorConversationEvents.conversationId, args.conversationId), args.beforeSeq === void 0 ? void 0 : lt(juniorConversationEvents.seq, args.beforeSeq), args.afterSeq === void 0 ? void 0 : gt(juniorConversationEvents.seq, args.afterSeq), inArray(juniorConversationEvents.type, args.types ?? [...conversationReportSourceEventTypes]), args.subagentInvocationIds === void 0 ? void 0 : inArray(sql`${juniorConversationEvents.payload}->>'subagentInvocationId'`, args.subagentInvocationIds), args.toolCallIds === void 0 ? void 0 : inArray(sql`${juniorConversationEvents.payload}->>'toolCallId'`, args.toolCallIds))).orderBy(args.direction === "forward" ? asc(juniorConversationEvents.seq) : desc(juniorConversationEvents.seq)).limit(args.limit);
|
|
1443
1442
|
}
|
|
1444
|
-
/**
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
limit: 1,
|
|
1462
|
-
types: ["assistant_message"]
|
|
1463
|
-
})])).flat().sort((left, right) => left.seq - right.seq) : [];
|
|
1464
|
-
const endedInvocationIds = [...new Set(events.flatMap((event) => event.data.type === "subagent_ended" ? [event.data.subagentInvocationId] : []))];
|
|
1465
|
-
const subagentStartRows = endedInvocationIds.length === 0 ? [] : await readConversationEventRows(executor, {
|
|
1466
|
-
conversationId: args.conversationId,
|
|
1467
|
-
direction: "forward",
|
|
1468
|
-
limit: endedInvocationIds.length,
|
|
1469
|
-
subagentInvocationIds: endedInvocationIds,
|
|
1470
|
-
types: ["subagent_started"]
|
|
1471
|
-
});
|
|
1472
|
-
const [firstTurnStartRow] = await readConversationEventRows(executor, {
|
|
1473
|
-
conversationId: args.conversationId,
|
|
1443
|
+
/**
|
|
1444
|
+
* Read the last Turn end before the `turns`-th latest Turn start. Its seq is
|
|
1445
|
+
* null when the Conversation has fewer Turns, or no Turn ended before them.
|
|
1446
|
+
*
|
|
1447
|
+
* Input messages are written before their `turn_started`, so a page of the
|
|
1448
|
+
* latest Turns starts after the Turn before them, not at the start event.
|
|
1449
|
+
*/
|
|
1450
|
+
function readLatestTurnsPageStart(executor, conversationId, turns) {
|
|
1451
|
+
const started = alias(juniorConversationEvents, "started");
|
|
1452
|
+
const ended = alias(juniorConversationEvents, "ended");
|
|
1453
|
+
const turnStart = executor.db().select({ seq: started.seq }).from(started).where(and(eq(started.conversationId, conversationId), eq(started.type, "turn_started"))).orderBy(desc(started.seq)).offset(turns - 1).limit(1);
|
|
1454
|
+
return executor.db().select({ seq: max(ended.seq) }).from(ended).where(and(eq(ended.conversationId, conversationId), inArray(ended.type, ["turn_completed", "turn_failed"]), lt(ended.seq, sql`(${turnStart})`)));
|
|
1455
|
+
}
|
|
1456
|
+
/** Read the first Turn start, which marks history inherited from a fork. */
|
|
1457
|
+
async function readFirstTurnStart(executor, conversationId) {
|
|
1458
|
+
const [row] = await readConversationEventRows(executor, {
|
|
1459
|
+
conversationId,
|
|
1474
1460
|
direction: "forward",
|
|
1475
1461
|
limit: 1,
|
|
1476
1462
|
types: ["turn_started"]
|
|
1477
1463
|
});
|
|
1464
|
+
return row ? eventFromRow(row) : void 0;
|
|
1465
|
+
}
|
|
1466
|
+
/** Resolve entity starts that precede the page, then project it once. */
|
|
1467
|
+
async function projectConversationEvents(executor, args) {
|
|
1468
|
+
const events = args.events.sort((left, right) => left.seq - right.seq);
|
|
1469
|
+
const firstSeq = events[0]?.seq;
|
|
1470
|
+
const endedInvocationIds = [...new Set(events.flatMap((event) => event.data.type === "subagent_ended" ? [event.data.subagentInvocationId] : []))];
|
|
1478
1471
|
const toolResultIds = conversationReportToolResultIds(events);
|
|
1479
|
-
const
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1472
|
+
const [turnBoundaryRows, modelCallRows, subagentStartRows, toolStartRows] = await Promise.all([
|
|
1473
|
+
firstSeq === void 0 ? [] : readConversationEventRows(executor, {
|
|
1474
|
+
conversationId: args.conversationId,
|
|
1475
|
+
beforeSeq: firstSeq,
|
|
1476
|
+
direction: "backward",
|
|
1477
|
+
limit: 1,
|
|
1478
|
+
types: [
|
|
1479
|
+
"turn_started",
|
|
1480
|
+
"turn_completed",
|
|
1481
|
+
"turn_failed"
|
|
1482
|
+
]
|
|
1483
|
+
}),
|
|
1484
|
+
firstSeq === void 0 ? [] : readConversationEventRows(executor, {
|
|
1485
|
+
conversationId: args.conversationId,
|
|
1486
|
+
beforeSeq: firstSeq,
|
|
1487
|
+
direction: "backward",
|
|
1488
|
+
limit: 1,
|
|
1489
|
+
types: ["assistant_message"]
|
|
1490
|
+
}),
|
|
1491
|
+
endedInvocationIds.length === 0 ? [] : readConversationEventRows(executor, {
|
|
1492
|
+
conversationId: args.conversationId,
|
|
1493
|
+
direction: "forward",
|
|
1494
|
+
limit: endedInvocationIds.length,
|
|
1495
|
+
subagentInvocationIds: endedInvocationIds,
|
|
1496
|
+
types: ["subagent_started"]
|
|
1497
|
+
}),
|
|
1498
|
+
toolResultIds.length === 0 ? [] : readConversationEventRows(executor, {
|
|
1499
|
+
conversationId: args.conversationId,
|
|
1500
|
+
direction: "forward",
|
|
1501
|
+
limit: toolResultIds.length,
|
|
1502
|
+
toolCallIds: toolResultIds,
|
|
1503
|
+
types: ["tool_execution_started"]
|
|
1504
|
+
}),
|
|
1505
|
+
args.canExposePayload ? hydrateMessageAttachments(executor, args.conversationId, events) : void 0
|
|
1506
|
+
]);
|
|
1487
1507
|
return projectConversationReportEventPage({
|
|
1488
1508
|
canExposePayload: args.canExposePayload,
|
|
1489
1509
|
events,
|
|
1490
|
-
...
|
|
1510
|
+
...args.firstTurnStart ? { firstTurnStart: args.firstTurnStart } : void 0,
|
|
1491
1511
|
subagentStartEvents: subagentStartRows.map(eventFromRow),
|
|
1492
1512
|
toolStartEvents: toolStartRows.map(eventFromRow),
|
|
1493
|
-
modelContextEvents:
|
|
1513
|
+
modelContextEvents: [...turnBoundaryRows, ...modelCallRows].sort((left, right) => left.seq - right.seq).map(eventFromRow)
|
|
1494
1514
|
});
|
|
1495
1515
|
}
|
|
1496
1516
|
/**
|
|
1497
|
-
*
|
|
1517
|
+
* Scan source rows in bounded chunks until more than `limit` reporting
|
|
1518
|
+
* events are known, then project the scanned rows once.
|
|
1498
1519
|
*
|
|
1499
|
-
*
|
|
1500
|
-
*
|
|
1501
|
-
* assuming every agent history event produces a reporting event.
|
|
1520
|
+
* Each chunk is decoded once. A chunk is counted without the entity starts
|
|
1521
|
+
* that precede it, which can only undercount, so the scan never stops early.
|
|
1502
1522
|
*/
|
|
1503
|
-
async function
|
|
1523
|
+
async function scanConversationEventPage(executor, args) {
|
|
1504
1524
|
const scanSize = Math.max(args.limit + 1, MIN_SCAN_SIZE);
|
|
1505
|
-
const
|
|
1506
|
-
|
|
1507
|
-
let
|
|
1508
|
-
|
|
1509
|
-
|
|
1525
|
+
const firstTurnStartRead = readFirstTurnStart(executor, args.conversationId);
|
|
1526
|
+
const events = [];
|
|
1527
|
+
let { afterSeq, beforeSeq } = args;
|
|
1528
|
+
let firstTurnStart;
|
|
1529
|
+
let counted = 0;
|
|
1530
|
+
while (counted <= args.limit) {
|
|
1531
|
+
const [batch, turnStart] = await Promise.all([readConversationEventRows(executor, {
|
|
1532
|
+
afterSeq,
|
|
1510
1533
|
beforeSeq,
|
|
1511
1534
|
conversationId: args.conversationId,
|
|
1512
|
-
direction:
|
|
1535
|
+
direction: args.direction,
|
|
1513
1536
|
limit: scanSize
|
|
1514
|
-
});
|
|
1537
|
+
}), firstTurnStartRead]);
|
|
1538
|
+
firstTurnStart = turnStart;
|
|
1515
1539
|
if (batch.length === 0) break;
|
|
1516
|
-
|
|
1517
|
-
|
|
1540
|
+
const decoded = batch.map(eventFromRow).sort((left, right) => left.seq - right.seq);
|
|
1541
|
+
events.push(...decoded);
|
|
1542
|
+
counted += projectConversationReportEventPage({
|
|
1518
1543
|
canExposePayload: args.canExposePayload,
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
});
|
|
1522
|
-
if (
|
|
1523
|
-
beforeSeq = batch.at(-1).seq;
|
|
1524
|
-
|
|
1544
|
+
events: decoded,
|
|
1545
|
+
...firstTurnStart ? { firstTurnStart } : void 0
|
|
1546
|
+
}).length;
|
|
1547
|
+
if (batch.length < scanSize) break;
|
|
1548
|
+
if (args.direction === "backward") beforeSeq = batch.at(-1).seq;
|
|
1549
|
+
else afterSeq = batch.at(-1).seq;
|
|
1550
|
+
}
|
|
1551
|
+
return projectConversationEvents(executor, {
|
|
1552
|
+
canExposePayload: args.canExposePayload,
|
|
1553
|
+
conversationId: args.conversationId,
|
|
1554
|
+
events,
|
|
1555
|
+
...firstTurnStart ? { firstTurnStart } : void 0
|
|
1556
|
+
});
|
|
1557
|
+
}
|
|
1558
|
+
/**
|
|
1559
|
+
* Read the latest reporting events before an exclusive boundary.
|
|
1560
|
+
*
|
|
1561
|
+
* Not every agent history event produces a reporting event, so source rows
|
|
1562
|
+
* are scanned until the requested page and one older event are known. With
|
|
1563
|
+
* `latestTurns`, the page also starts after the Turn before the latest
|
|
1564
|
+
* Turns, so it holds whole Turns when they fit in `limit`.
|
|
1565
|
+
*/
|
|
1566
|
+
async function readConversationEventPage(executor, args) {
|
|
1567
|
+
const { latestTurns, ...pageArgs } = args;
|
|
1568
|
+
const pageStart = latestTurns === void 0 ? void 0 : readLatestTurnsPageStart(executor, args.conversationId, latestTurns);
|
|
1569
|
+
const [projected, startRows] = await Promise.all([scanConversationEventPage(executor, {
|
|
1570
|
+
...pageArgs,
|
|
1571
|
+
...pageStart ? { afterSeq: sql`coalesce((${pageStart}), -1)` } : void 0,
|
|
1572
|
+
direction: "backward"
|
|
1573
|
+
}), pageStart]);
|
|
1525
1574
|
const events = projected.slice(-args.limit);
|
|
1526
1575
|
return {
|
|
1527
1576
|
events,
|
|
1528
|
-
...projected.length > events.length && events[0] ? { previousSeq: events[0].seq } : void 0
|
|
1577
|
+
...(projected.length > events.length || (startRows?.[0]?.seq ?? null) !== null) && events[0] ? { previousSeq: events[0].seq } : void 0
|
|
1529
1578
|
};
|
|
1530
1579
|
}
|
|
1531
1580
|
/**
|
|
@@ -1561,27 +1610,10 @@ async function readConversationEventPageAround(executor, args) {
|
|
|
1561
1610
|
* page around the read position, so this page reads nothing before it.
|
|
1562
1611
|
*/
|
|
1563
1612
|
async function readConversationEventPageAfter(executor, args) {
|
|
1564
|
-
const
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
while (projected.length <= args.limit) {
|
|
1569
|
-
const batch = await readConversationEventRows(executor, {
|
|
1570
|
-
afterSeq,
|
|
1571
|
-
conversationId: args.conversationId,
|
|
1572
|
-
direction: "forward",
|
|
1573
|
-
limit: scanSize
|
|
1574
|
-
});
|
|
1575
|
-
if (batch.length === 0) break;
|
|
1576
|
-
rows.push(...batch);
|
|
1577
|
-
projected = await projectConversationEventRows(executor, {
|
|
1578
|
-
canExposePayload: args.canExposePayload,
|
|
1579
|
-
conversationId: args.conversationId,
|
|
1580
|
-
rows
|
|
1581
|
-
});
|
|
1582
|
-
if (projected.length > args.limit || batch.length < scanSize) break;
|
|
1583
|
-
afterSeq = batch.at(-1).seq;
|
|
1584
|
-
}
|
|
1613
|
+
const projected = await scanConversationEventPage(executor, {
|
|
1614
|
+
...args,
|
|
1615
|
+
direction: "forward"
|
|
1616
|
+
});
|
|
1585
1617
|
const events = projected.slice(0, args.limit);
|
|
1586
1618
|
return {
|
|
1587
1619
|
events,
|
|
@@ -1819,6 +1851,14 @@ async function readLatestConversationBrief(db, conversationId) {
|
|
|
1819
1851
|
const rows = await db.select().from(juniorConversationBriefs).where(eq(juniorConversationBriefs.conversationId, conversationId)).orderBy(desc(juniorConversationBriefs.version)).limit(1);
|
|
1820
1852
|
return rows[0] ? briefVersionFromRow(rows[0]) : void 0;
|
|
1821
1853
|
}
|
|
1854
|
+
/**
|
|
1855
|
+
* Read the newest Brief version that covers no event after `seq`. That is the
|
|
1856
|
+
* Brief as a reader saw it when they stopped at `seq`.
|
|
1857
|
+
*/
|
|
1858
|
+
async function readConversationBriefThrough(db, conversationId, seq) {
|
|
1859
|
+
const rows = await db.select().from(juniorConversationBriefs).where(and(eq(juniorConversationBriefs.conversationId, conversationId), lte(juniorConversationBriefs.throughSeq, seq))).orderBy(desc(juniorConversationBriefs.version)).limit(1);
|
|
1860
|
+
return rows[0] ? briefVersionFromRow(rows[0]) : void 0;
|
|
1861
|
+
}
|
|
1822
1862
|
// src/chat/briefs/task.ts
|
|
1823
1863
|
const BRIEF_LOCK_TTL_MS = 6e5;
|
|
1824
1864
|
function hasUserInstruction(run) {
|
|
@@ -2114,11 +2154,13 @@ function createPluginConversationEventReader(plugin) {
|
|
|
2114
2154
|
return (await db.select({
|
|
2115
2155
|
content: sql`${juniorConversationEvents.payload}->'content'`,
|
|
2116
2156
|
createdAt: juniorConversationEvents.createdAt,
|
|
2157
|
+
seq: juniorConversationEvents.seq,
|
|
2117
2158
|
turnId: sql`${juniorConversationEvents.payload}->>'turnId'`,
|
|
2118
2159
|
version: sql`(${juniorConversationEvents.payload}->>'version')::integer`
|
|
2119
2160
|
}).from(juniorConversationEvents).where(and(eq(juniorConversationEvents.conversationId, input.conversationId), eq(juniorConversationEvents.type, "structured_event"), sql`${juniorConversationEvents.payload}->>'namespace' = ${plugin.manifest.name}`, sql`${juniorConversationEvents.payload}->>'name' = ${eventName}`)).orderBy(desc(juniorConversationEvents.seq))).map((row) => ({
|
|
2120
2161
|
content: row.content,
|
|
2121
2162
|
createdAt: row.createdAt.toISOString(),
|
|
2163
|
+
seq: row.seq,
|
|
2122
2164
|
...row.turnId ? { turnId: row.turnId } : void 0,
|
|
2123
2165
|
version: row.version
|
|
2124
2166
|
}));
|
|
@@ -12929,7 +12971,7 @@ async function materializeStoredTurnRecord(conversationId, turnId, followCurrent
|
|
|
12929
12971
|
const eventStore = getConversationEventStore();
|
|
12930
12972
|
const currentHistoryVersion = await eventStore.loadCurrentHistoryVersion(conversationId);
|
|
12931
12973
|
const followsReplacement = followCurrentReplacement && (parsed.state === "running" || parsed.state === "paused") && parsed.historyVersion !== void 0 && parsed.historyVersion !== currentHistoryVersion;
|
|
12932
|
-
const piProjection = followsReplacement ? projectConversationEvents(await eventStore.loadCurrentHistory(conversationId)) : pinnedProjection;
|
|
12974
|
+
const piProjection = followsReplacement ? projectConversationEvents$1(await eventStore.loadCurrentHistory(conversationId)) : pinnedProjection;
|
|
12933
12975
|
const turnStartMessageIndex = followsReplacement ? 0 : parsed.turnStartSeq === void 0 ? void 0 : piProjection.seqs.filter((seq) => seq <= parsed.turnStartSeq).length;
|
|
12934
12976
|
const conversationStore = getConversationStore();
|
|
12935
12977
|
const conversation = await conversationStore.get({ conversationId });
|
|
@@ -14487,15 +14529,15 @@ function resolveCommitProvenance(args) {
|
|
|
14487
14529
|
}
|
|
14488
14530
|
/** Load the current Pi agent history for a conversation. */
|
|
14489
14531
|
async function loadProjection(args) {
|
|
14490
|
-
return projectConversationEvents(await getConversationEventStore().loadCurrentHistory(args.conversationId)).messages;
|
|
14532
|
+
return projectConversationEvents$1(await getConversationEventStore().loadCurrentHistory(args.conversationId)).messages;
|
|
14491
14533
|
}
|
|
14492
14534
|
/** Load current Pi context with aligned provenance and source event sequences. */
|
|
14493
14535
|
async function loadConversationProjection(args) {
|
|
14494
|
-
return projectConversationEvents(await getConversationEventStore().loadCurrentHistory(args.conversationId));
|
|
14536
|
+
return projectConversationEvents$1(await getConversationEventStore().loadCurrentHistory(args.conversationId));
|
|
14495
14537
|
}
|
|
14496
14538
|
/** Load the active Pi projection before a conversation's next request. */
|
|
14497
14539
|
async function openConversationProjection(args) {
|
|
14498
|
-
return projectConversationEvents(await getConversationEventStore().loadCurrentHistory(args.conversationId));
|
|
14540
|
+
return projectConversationEvents$1(await getConversationEventStore().loadCurrentHistory(args.conversationId));
|
|
14499
14541
|
}
|
|
14500
14542
|
/**
|
|
14501
14543
|
* Load a turn's committed Pi projection from the durable event store.
|
|
@@ -14510,10 +14552,10 @@ async function openConversationProjection(args) {
|
|
|
14510
14552
|
*/
|
|
14511
14553
|
async function loadTurnProjection(args) {
|
|
14512
14554
|
const eventStore = getConversationEventStore();
|
|
14513
|
-
if (args.committedSeq < 0) return projectConversationEvents(await eventStore.loadCurrentHistory(args.conversationId));
|
|
14555
|
+
if (args.committedSeq < 0) return projectConversationEvents$1(await eventStore.loadCurrentHistory(args.conversationId));
|
|
14514
14556
|
const historyEvents = await eventStore.loadHistoryContaining(args.conversationId, args.committedSeq, args.includeTail ? void 0 : args.committedSeq);
|
|
14515
14557
|
if (!historyEvents) return;
|
|
14516
|
-
return projectConversationEvents(historyEvents);
|
|
14558
|
+
return projectConversationEvents$1(historyEvents);
|
|
14517
14559
|
}
|
|
14518
14560
|
/** Load MCP providers the credential subject connected in this conversation. */
|
|
14519
14561
|
async function loadConnectedMcpProviders(args) {
|
|
@@ -14572,7 +14614,7 @@ async function commitAcceptedReply(args) {
|
|
|
14572
14614
|
async function commitMessagesLocked(args, executor) {
|
|
14573
14615
|
const eventStore = createSqlConversationEventStore(executor);
|
|
14574
14616
|
const currentEvents = await eventStore.loadCurrentHistory(args.conversationId);
|
|
14575
|
-
const current = projectConversationEvents(currentEvents);
|
|
14617
|
+
const current = projectConversationEvents$1(currentEvents);
|
|
14576
14618
|
const nextLocalMessages = args.messages.map(normalizeDurableMessage);
|
|
14577
14619
|
const matchingPrefix = countDurablePrefix(current.messages, nextLocalMessages);
|
|
14578
14620
|
const nextLocalProvenance = resolveCommitProvenance({
|
|
@@ -14812,4 +14854,4 @@ async function recordGuardianActionReviewed(args) {
|
|
|
14812
14854
|
createdAtMs: Date.now()
|
|
14813
14855
|
}]);
|
|
14814
14856
|
}
|
|
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 };
|
|
14857
|
+
export { completeTurnRecord as $, notInheritedByForkChild 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, readLatestConversationBrief 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, readConversationEventPageAround as Ja, isAlreadyExistsError as Ji, getReviewItem as Jn, deleteWorkspace as Jr, hasCurrentInstruction as Jt, clearPendingAuth as K, readConversationEventPage 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, loadForkHistory 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, readConversationBriefThrough as Wa, withSlackRetries as Wi, closeReviewItem as Wn, ToolInputError as Wr, extractAssistantText as Wt, loadTurnCheckpoint as X, readConversationMessageEventSeq as Xa, wrapSandboxSetupError as Xi, listReplyActionItems as Xn, getWorkspaceByName as Xr, instructionTextForProjection as Xt, continuableMessages as Y, readConversationLastEventSeq as Ya, throwSandboxOperationError as Yi, insertReviewItem as Yn, getWorkspace as Yr, hasRuntimeTurnContext as Yt, saveTurnCheckpoint as Z, buildSentryConversationUrl 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, projectConversationEvents$1 as _o, RESOURCE_SUBSCRIPTION_DEFAULT_TTL_MS as _r, drainConversationMailbox as _t, loadProjection as a, parseSandboxEgressCredentialToken as aa, create as ai, trimTrailingAssistantMessages as an, saveObjectAnnotations 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, getConfigDefaults 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, listConversationAnnotationsById as co, requireReviewItemLinks as cr, appendInboundMessage as ct, recordAuthorizationCompleted as d, sleep$2 as da, proxyVercelSandboxEgressRequest as di, SubscribedReplyReason as dn, lookupSlackUser as do, EVERYONE_ASSIGNEE as dr, checkInConversationWork as dt, workspaceSnapshotNotReadyUserMessage as ea, WorkspaceValidationError as ei, isToolResultError as en, getSlackFileId as eo, updateReviewItemContent as er, failTurnRecord as et, recordAuthorizationRequested as f, tryWorkspaceRepoCheckoutPath as fa, deliverOAuthAuthorization as fi, decideSubscribedThreadReply as fn, createPluginCache as fo, automationCreatorUserId as fr, clearConsumedConversationWake as ft, recordToolExecutionStarted as g, createPluginModel as ga, startOAuthFlow as gi, estimateRequestOverheadTokens as gn, piMessageFromHistoryItem as go, getSlackToolContext as gr, deadLetterAttempt as gt, recordSubscribedReplyRoute as h, createPluginEmbedder as ha, resolveBaseUrl as hi, calculateContextCompactionTargetTokens as hn, historyItemFromPiMessage as ho, resolveChannelCapabilities as hr, completeConversationWork as ht, loadConversationProjection as i, createSandboxEgressCredentialToken as ia, setWorkspaceSnapshotBuild as ii, stripRuntimeTurnContext as in, resolveRootVisibility 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, defaultTimezone as lo, reviewItemNeedsUser as lr, beginConversationResume as lt, recordMcpProviderConnected as m, PluginToolDeniedError as ma, parseOAuthStatePayload as mi, getThreadStopDecision as mn, configValueSchema as mo, resolveAssignees as mr, completeConversationStop as mt, commitMessages as n, consumeSandboxEgressAuthRequiredSignal as na, loadSnapshotsForProfile as ni, normalizeToolNameFromResult as nn, readAttachmentVisionSummary as no, canActOnReviewItem as nr, listTurnSummaries as nt, loadTurnProjection as o, sandboxEgressSignalsResponseSchema as oa, hash as oi, REQUEST_CONTEXT_SECTION_TAG as on, createPluginAnnotations as oo, readReviewItemAgentScope as or, ackMessages as ot, recordGuardianActionReviewed as p, workspaceRepoCheckoutPath as pa, formatProviderLabel as pi, getSubscribedReplyPreflightDecision as pn, createDurableLocationConfigurationService as po, resolveAssignee as pr, clearExpiredConversationLease as pt, getConversationPendingAuth as q, readConversationEventPageAfter 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, recordSlackAttachment as ro, canAgentChangeReviewItem as rr, recordTurnSummary as rt, openConversationProjection as s, buildSandboxEgressNetworkPolicy as sa, isStale as si, SESSION_CONTEXT_SECTION_TAG as sn, listConversationAnnotations as so, requireReviewItemAssignees as sr, appendExclusiveInboundMessage as st, commitAcceptedReply as t, clearSandboxEgressSignals as ta, invalidateReadySnapshot as ti, isToolResultMessage as tn, matchSlackAttachments 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, resolveUserTimezone as uo, reviewItemReaderForUser as ur, cancelHumanFacingPendingMessages as ut, hydrateConversationMessages as v, SANDBOX_DATA_ROOT as va, formatSlackLink as vi, getAgentBackgroundCompactionMarkTokens as vn, JUNIOR_NATIVE_EVENT_NAMESPACE 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, setConfigDefaults as xo, cancelSubscriptions as xr, hasRunnableConversationWork as xt, persistConversationMessages as y, SANDBOX_JUNIOR_ROOT as ya, normalizeSlackReplyMarkdown as yi, getAgentContextCompactionTriggerTokens as yn, conversationNoteEvent 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,5 +1,5 @@
|
|
|
1
|
-
import { H as conversationBriefSchema, U as parseBriefInput, V as briefOutcomeStatusSchema } from "./conversation-
|
|
2
|
-
import
|
|
1
|
+
import { H as conversationBriefSchema, U as parseBriefInput, V as briefOutcomeStatusSchema } from "./conversation-DExTZw8B.js";
|
|
2
|
+
import * as z from "zod";
|
|
3
3
|
// src/chat/briefs/generate.ts
|
|
4
4
|
const MAX_INPUT_CHARS = 6e4;
|
|
5
5
|
const MAX_MESSAGE_TEXT_CHARS = 4e3;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { b as setSpanAttributes, h as logWarn, m as logInfo } from "./logging-
|
|
2
|
-
import { o as isUserActor, s as parseActorUserId } from "./actor-
|
|
1
|
+
import { b as setSpanAttributes, h as logWarn, m as logInfo } from "./logging-CGnh65_X.js";
|
|
2
|
+
import { o as isUserActor, s as parseActorUserId } from "./actor-6jsm_v96.js";
|
|
3
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
|
-
import
|
|
6
|
+
import * as z from "zod";
|
|
7
7
|
import { parse } from "yaml";
|
|
8
8
|
import { readFileSync, readdirSync, statSync } from "node:fs";
|
|
9
9
|
// src/chat/plugins/inline-manifest-source.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as z from "zod";
|
|
2
2
|
// src/api/schema/user-customization.ts
|
|
3
3
|
/** Longest customization text one user can save. */
|
|
4
4
|
const USER_CUSTOMIZATION_MAX_CHARS = 1e3;
|
|
@@ -6,6 +6,32 @@ const USER_CUSTOMIZATION_MAX_CHARS = 1e3;
|
|
|
6
6
|
const userCustomizationTextSchema = z.string().trim().max(USER_CUSTOMIZATION_MAX_CHARS);
|
|
7
7
|
/** Request and response body for the viewer's customization. */
|
|
8
8
|
const userCustomizationSchema = z.object({ customization: userCustomizationTextSchema }).strict();
|
|
9
|
+
// src/chat/agent-invocations/statuses.ts
|
|
10
|
+
const AGENT_INVOCATION_STATUSES = [
|
|
11
|
+
"pending",
|
|
12
|
+
"running",
|
|
13
|
+
"paused",
|
|
14
|
+
"blocked",
|
|
15
|
+
"completed",
|
|
16
|
+
"failed",
|
|
17
|
+
"stopped"
|
|
18
|
+
];
|
|
19
|
+
const AGENT_INVOCATION_MAILBOX_STATUSES = ["pending", "appended"];
|
|
20
|
+
/**
|
|
21
|
+
* Parent mailbox append state. Only terminal invocations have a value.
|
|
22
|
+
* `replaced` means the child still had open work, so a later agent invocation
|
|
23
|
+
* on the same child sends the result instead. `skipped` means a stop ended
|
|
24
|
+
* the work, so the result is never used. `steered` means the agent invocation
|
|
25
|
+
* that was running read the input as a steering message, so its result covers
|
|
26
|
+
* this one.
|
|
27
|
+
*/
|
|
28
|
+
const AGENT_INVOCATION_PARENT_MAILBOX_STATUSES = [
|
|
29
|
+
"pending",
|
|
30
|
+
"appended",
|
|
31
|
+
"replaced",
|
|
32
|
+
"skipped",
|
|
33
|
+
"steered"
|
|
34
|
+
];
|
|
9
35
|
// src/chat/conversations/web-message-id.ts
|
|
10
36
|
/**
|
|
11
37
|
* Build the retry-stable Message id shared by web ingress and browser sends.
|
|
@@ -266,4 +292,4 @@ function sumUtcHoursIntoSixHours(args) {
|
|
|
266
292
|
rows: bySix
|
|
267
293
|
});
|
|
268
294
|
}
|
|
269
|
-
export {
|
|
295
|
+
export { AGENT_INVOCATION_STATUSES as C, userCustomizationTextSchema as E, AGENT_INVOCATION_PARENT_MAILBOX_STATUSES as S, userCustomizationSchema as T, isEmptyUserInputAnswer as _, fillUtcSixHours as a, webMessageId as b, trailingUtcDayWindow as c, utcDayKey as d, utcHourKey as f, formatUserInputAnswer as g, buttonUserInputField as h, fillUtcHours as i, trailingUtcHourWindow as l, USER_INPUT_NOTE as m, HOUR_MS as n, startOfUtcHour as o, USER_INPUT_LIMITS as p, fillUtcDays as r, sumUtcHoursIntoSixHours as s, DAY_MS as t, trailingUtcSixHourWindow as u, normalizeUserInputAnswer as v, USER_CUSTOMIZATION_MAX_CHARS as w, AGENT_INVOCATION_MAILBOX_STATUSES as x, userInputRequestSchema as y };
|
|
@@ -1,7 +1,7 @@
|
|
|
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-
|
|
4
|
-
import
|
|
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-C1MghKyI.js";
|
|
2
|
+
import { E as withSpan, b as setSpanAttributes } from "./logging-CGnh65_X.js";
|
|
3
|
+
import { r as getStateAdapter } from "./adapter-DVN3iwf9.js";
|
|
4
|
+
import * as z from "zod";
|
|
5
5
|
// src/chat/sandbox/resources.ts
|
|
6
6
|
let configuredResources;
|
|
7
7
|
function resourcesFromEnv() {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { v as __exportAll } from "./sentry-BRTJqumy.js";
|
|
2
|
-
import { nt as listTurnSummaries, tt as getTurnRecord } from "./projection-
|
|
3
|
-
import { t as createActor } from "./actor-
|
|
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-
|
|
12
|
-
import
|
|
2
|
+
import { nt as listTurnSummaries, tt as getTurnRecord } from "./projection-C1MghKyI.js";
|
|
3
|
+
import { t as createActor } from "./actor-6jsm_v96.js";
|
|
4
|
+
import { F as SYSTEM_IDENTITY_ID } from "./viewer-BZ0Hp5Nb.js";
|
|
5
|
+
import { f as credentialContextForActor } from "./registry-DR7DjX9H.js";
|
|
6
|
+
import { wt as listUnreportedSiblingAgents } from "./agent-runner-_PYLv4Qo.js";
|
|
7
|
+
import { a as EVENT_SYSTEM_ACTOR, i as EVENT_MESSAGE_AUTHOR, o as isEventConversationMessage } from "./prompt-BcHg-BMy.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-Dlio-o6u.js";
|
|
9
|
+
import { a as EVENT_WAIT_MS, c as isEventMailboxMetadata, l as renderEventBatchText, u as timerWatchCredentialSubject } from "./session-stop-CDEMsNtv.js";
|
|
10
|
+
import { r as appendAndEnqueueInboundMessage } from "./store-QzOfDwKA.js";
|
|
11
|
+
import { a as resolveAgentInvocationId, i as enqueueAgentInvocation, t as createAgentInvocationWorker } from "./work-BTcCIbWu.js";
|
|
12
|
+
import * as z from "zod";
|
|
13
13
|
import { createEventSource, createLocalSource, createWebSource } from "@sentry/junior-plugin-api";
|
|
14
14
|
// src/chat/conversations/web-mailbox.ts
|
|
15
15
|
/** Parse web mailbox metadata written before Source and Actor were complete. */
|
|
@@ -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-C1MghKyI.js";
|
|
2
|
+
import { S as setTags, T as withLogContext, p as logException } from "./logging-CGnh65_X.js";
|
|
3
|
+
import { F as SYSTEM_IDENTITY_ID, x as getConversationStore, y as getConversationEventStore } from "./viewer-BZ0Hp5Nb.js";
|
|
4
|
+
import { f as credentialContextForActor } from "./registry-DR7DjX9H.js";
|
|
5
|
+
import { j as messageCardText } from "./conversation-DExTZw8B.js";
|
|
6
|
+
import { $ as markTurnFailed, et as startActiveTurn } from "./store-Dlio-o6u.js";
|
|
7
|
+
import { n as getAssistantReplyText } from "./assistant-reply-DbebsAxi.js";
|
|
8
|
+
import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-CJJsOhXB.js";
|
|
9
|
+
import { a as persistThreadStateById, n as getPersistedSandboxState, o as coerceThreadConversationState, r as getPersistedThreadState } from "./thread-state-Bn87cfzE.js";
|
|
10
|
+
import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-CQkkUj3o.js";
|
|
11
|
+
import { i as completeAuthPauseTurn, l as buildDeliveredTurnStatePatch, t as finalizeFailedTurnReplyWithEvent, u as loadPendingMessageCards } from "./turn-failure-response-CQebxByj.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-C1MghKyI.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;
|