@sentry/junior 0.227.0 → 0.229.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/{agent-hooks-bEwEJhlg.js → agent-hooks-BfjhfMIy.js} +18 -10
- package/dist/{agent-runner-BGDSjciH.js → agent-runner-DtrpkWV5.js} +59 -39
- package/dist/api/schema.d.ts +139 -27
- package/dist/api/schema.js +2 -2
- package/dist/api.js +71 -54
- package/dist/{app-CjRIKZb5.d.ts → app-BRZB3MuD.d.ts} +1 -1
- package/dist/app.d.ts +1 -1
- package/dist/app.js +94 -28
- package/dist/{briefs-BkM_ZW4B.js → briefs-B6KfFLRA.js} +4 -4
- package/dist/{catalog-runtime-Cw9V2jpn.js → catalog-runtime-Byr3trKF.js} +1 -1
- package/dist/{checkpoint-oZYD3-Ar.js → checkpoint-DEYb3Fqm.js} +6 -6
- package/dist/cli/chat.js +13 -13
- package/dist/cli/check.js +3 -3
- package/dist/cli/main.js +1 -1
- package/dist/cli/plugins.js +3 -3
- package/dist/cli/snapshot-create.js +3 -3
- package/dist/cli/upgrade.js +3 -3
- package/dist/{client-Pcxo3lGn.js → client-BN5U3CGw.js} +3 -5
- package/dist/{config-CYvEow1F.js → config-C4xZrx7G.js} +2 -2
- package/dist/{conversation-BnhOMfEB.js → conversation-DOI6Y60M.js} +3 -2
- package/dist/{conversation-privacy-hQmyZbOC.js → conversation-privacy-CB7wx_tP.js} +1 -1
- package/dist/{credential-sync-CUGbiiCM.js → credential-sync-CuEwdxwY.js} +13 -13
- package/dist/{executor-BXMlFrV6.js → executor-DUqeOd8y.js} +1 -1
- package/dist/{history-nukv1YN8.d.ts → history-H-SI5Dej.d.ts} +1 -0
- package/dist/{images-8siTAUNW.js → images-B5JLFwJR.js} +3 -3
- package/dist/instrumentation.js +2 -2
- package/dist/{job-queue-AI0_QAgc.js → job-queue-C1AJ5uJt.js} +1 -1
- package/dist/{logging-BPBx6WF-.js → logging-Muw6EXro.js} +1 -1
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +3 -3
- package/dist/{oauth-authorization-Cq1GaLIP.js → oauth-authorization-CrD-xb8a.js} +1 -1
- package/dist/{oauth-callback-server-CnF03VYh.js → oauth-callback-server-DfQos1K1.js} +2 -2
- package/dist/{pending-auth-CHUjr_6d.js → pending-auth-pYQpJmtu.js} +1 -1
- package/dist/{profile-upzC-wN1.js → profile-25NkcK4S.js} +4 -4
- package/dist/{prompt-CZIQcPHy.js → prompt-9C-wUwwx.js} +1 -1
- package/dist/{registry-DM5aMhjm.js → registry-DrcbAs8o.js} +1 -1
- package/dist/{resolve-sF6Lg7Ay.js → resolve-D9kl_rkl.js} +2 -2
- package/dist/{runner-Bu2wYpK8.js → runner-D3rf-_hT.js} +9 -9
- package/dist/{sandbox-egress-signals-Dgerhizb.js → sandbox-egress-signals-BfQQz6cs.js} +1 -1
- package/dist/{schema-BSiwcvjm.js → schema-CXmCvVLn.js} +1 -1
- package/dist/{skills-CAI5s___.js → skills-rwWf3XjQ.js} +2 -2
- package/dist/{spawn-DRK9TBgY.js → spawn-z0fRvZH9.js} +2 -2
- package/dist/{task-queue-iuDAqfZg.js → task-queue-BGo6K-BX.js} +3 -3
- package/dist/{task-runner-S3QtH38c.js → task-runner-DH8M0m7l.js} +9 -9
- package/dist/{thread-state-C_arVuaN.js → thread-state-CS67FjfN.js} +5 -5
- package/dist/{turn-failure-response-DarwGYgC.js → turn-failure-response-DcaALKfm.js} +8 -8
- package/dist/{turn-lifecycle-CdiIejXH.js → turn-lifecycle-DHcpS20C.js} +1 -1
- package/dist/{turn-session-routing-DyLGd_wU.js → turn-session-routing-DlaCHHlu.js} +1 -1
- package/dist/{validation-BMig74Zp.js → validation-CNUPIKMW.js} +1 -1
- package/dist/{version-lhQSfLjx.js → version-B0eXuHqw.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{web-authorization-r2lKYKJ2.js → web-authorization-DrXlSd3Y.js} +6 -6
- package/dist/{web-input-BU-Fu7iq.js → web-input-WFoSdz8L.js} +50 -28
- package/dist/{work-B9koS8sW.js → work-B0cAo7nv.js} +7 -7
- package/dist/{worker-C_iJSRgG.js → worker-DNklqmhH.js} +5 -5
- package/package.json +5 -5
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { a as embedTexts, r as completeObject } from "./client-
|
|
3
|
-
import { F as normalizeIdentityEmail, I as isRecord$2, d as logException, f as logInfo, p as logWarn, v as setSpanAttributes, w as withSpan, y as setSpanStatus } from "./logging-
|
|
2
|
+
import { a as embedTexts, r as completeObject } from "./client-BN5U3CGw.js";
|
|
3
|
+
import { F as normalizeIdentityEmail, I as isRecord$2, d as logException, f as logInfo, p as logWarn, v as setSpanAttributes, w as withSpan, y as setSpanStatus } from "./logging-Muw6EXro.js";
|
|
4
4
|
import { a as getClient$1 } from "./sentry-CgWZM_kV.js";
|
|
5
|
-
import { t as canExposeConversationPayload } from "./conversation-privacy-
|
|
6
|
-
import { a as getChatConfig, n as botConfig, s as getSlackBotToken } from "./config-
|
|
5
|
+
import { t as canExposeConversationPayload } from "./conversation-privacy-CB7wx_tP.js";
|
|
6
|
+
import { a as getChatConfig, n as botConfig, s as getSlackBotToken } from "./config-C4xZrx7G.js";
|
|
7
7
|
import { r as defaultModelId } from "./model-profile-BwU8mqwD.js";
|
|
8
8
|
import { b as parseSlackMessageTs, c as isActorUserId, h as parseSlackTeamId, m as parseSlackChannelReferenceId, u as parseActorUserId } from "./context-0Et9iVSB.js";
|
|
9
9
|
import { n as juniorDestinations } from "./destinations-BeBiJeEM.js";
|
|
10
|
-
import { C as juniorCodeRepositories, D as juniorIdentities, E as juniorConversations, O as juniorUsers, S as juniorCodeChanges, T as conversationReadColumns, _ as CONVERSATION_METRICS, g as juniorConversationBriefs, h as juniorConversationBindings, i as juniorWorkspaces, m as juniorConversationParticipants, n as juniorSnapshots, r as juniorWorkspaceRepos, t as createJuniorSqlExecutor, v as juniorConversationMetrics, w as juniorAttachments, x as juniorConversationAnnotations, y as juniorConversationEvents } from "./executor-
|
|
11
|
-
import { C as conversationReportEventSchema, H as conversationBriefSchema, I as readMessageAttachments, K as conversationEventDataSchema, N as readMessageCards, Q as encodeHistoryPayload, U as parseBriefInput, X as historyReplacementSchema, Y as decodeStoredConversationEvent, Z as newConversationEventSchema, rt as usageSchema } from "./conversation-
|
|
12
|
-
import { C as getDefaultRedisStateAdapterFor, N as SANDBOX_WORKSPACE_ROOT, k as sleep$1, l as isSandboxMissingError, n as hash, v as getVercelSandboxCredentials, w as getStateAdapter, x as runNonInteractiveCommand } from "./profile-
|
|
13
|
-
import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-
|
|
10
|
+
import { C as juniorCodeRepositories, D as juniorIdentities, E as juniorConversations, O as juniorUsers, S as juniorCodeChanges, T as conversationReadColumns, _ as CONVERSATION_METRICS, g as juniorConversationBriefs, h as juniorConversationBindings, i as juniorWorkspaces, m as juniorConversationParticipants, n as juniorSnapshots, r as juniorWorkspaceRepos, t as createJuniorSqlExecutor, v as juniorConversationMetrics, w as juniorAttachments, x as juniorConversationAnnotations, y as juniorConversationEvents } from "./executor-DUqeOd8y.js";
|
|
11
|
+
import { C as conversationReportEventSchema, H as conversationBriefSchema, I as readMessageAttachments, K as conversationEventDataSchema, N as readMessageCards, Q as encodeHistoryPayload, U as parseBriefInput, X as historyReplacementSchema, Y as decodeStoredConversationEvent, Z as newConversationEventSchema, rt as usageSchema } from "./conversation-DOI6Y60M.js";
|
|
12
|
+
import { C as getDefaultRedisStateAdapterFor, N as SANDBOX_WORKSPACE_ROOT, k as sleep$1, l as isSandboxMissingError, n as hash, v as getVercelSandboxCredentials, w as getStateAdapter, x as runNonInteractiveCommand } from "./profile-25NkcK4S.js";
|
|
13
|
+
import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-9C-wUwwx.js";
|
|
14
14
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
15
15
|
import { z } from "zod";
|
|
16
16
|
import { createHash, createHmac, randomUUID, timingSafeEqual } from "node:crypto";
|
|
17
17
|
import { and, arrayContains, asc, desc, eq, exists, getTableColumns, gt, gte, inArray, isNotNull, isNull, lt, lte, max, ne, notExists, or, sql } from "drizzle-orm";
|
|
18
|
-
import { codeChangeInputSchema, conversationAnnotationInputSchema, conversationEventPresentationSchema, defineConversationEvent, destinationSchema, eventInputSchema, eventMatchSchema, eventMatches, eventTypeSchema, identitySchema, locationSchema, missingToolAnnotationKeys, normalizeEventIdentifier, objectAnnotationSchema, pluginEventsSchema, promptContextSchema, promptMessageSchema, sourceSchema, stableEventMatchKey, userSchema } from "@sentry/junior-plugin-api";
|
|
18
|
+
import { codeChangeInputSchema, conversationAnnotationInputSchema, conversationEventPresentationSchema, defineConversationEvent, destinationSchema, eventInputSchema, eventMatchSchema, eventMatches, eventTypeSchema, identitySchema, locationSchema, missingToolAnnotationKeys, normalizeEventIdentifier, objectAnnotationSchema, objectIconPath, objectTypeSchema, pluginEventsSchema, promptContextSchema, promptMessageSchema, sourceSchema, stableEventMatchKey, userSchema } from "@sentry/junior-plugin-api";
|
|
19
19
|
import { alias } from "drizzle-orm/pg-core";
|
|
20
20
|
import { WebClient } from "@slack/web-api";
|
|
21
21
|
import { Sandbox } from "@vercel/sandbox";
|
|
@@ -2111,6 +2111,7 @@ function reportEventData(args) {
|
|
|
2111
2111
|
role: data.role,
|
|
2112
2112
|
...data.meta?.source === "web" || data.meta?.source === "slack" ? { source: data.meta.source } : void 0,
|
|
2113
2113
|
...actorIdentity ? { actorIdentity } : void 0,
|
|
2114
|
+
eventObjectType: objectTypeSchema.safeParse(data.meta?.eventObjectType).data,
|
|
2114
2115
|
...typeof data.meta?.eventType === "string" ? { eventType: data.meta.eventType } : void 0,
|
|
2115
2116
|
...typeof data.meta?.explicitMention === "boolean" ? { explicitMention: data.meta.explicitMention } : void 0,
|
|
2116
2117
|
...args.canExposePayload && typeof data.meta?.trustedSummary === "string" ? { trustedSummary: data.meta.trustedSummary } : void 0,
|
|
@@ -3135,6 +3136,13 @@ function getDashboardConversationLink(conversationId) {
|
|
|
3135
3136
|
function getDashboardTaskLink(taskId) {
|
|
3136
3137
|
return resolveDashboardPath(`/automations/${encodeURIComponent(taskId)}`);
|
|
3137
3138
|
}
|
|
3139
|
+
/** Public icon asset URL. Headless and local installs keep text-only identity. */
|
|
3140
|
+
function getDashboardObjectIconLink(icon) {
|
|
3141
|
+
if (!dashboardConversationLinkOptions) return void 0;
|
|
3142
|
+
const url = new URL(objectIconPath(icon), resolveDashboardBaseURL(dashboardConversationLinkOptions));
|
|
3143
|
+
if (url.protocol !== "https:" || url.hostname === "localhost") return void 0;
|
|
3144
|
+
return url.href;
|
|
3145
|
+
}
|
|
3138
3146
|
//#endregion
|
|
3139
3147
|
//#region src/chat/state/ttl.ts
|
|
3140
3148
|
/** Retain expiring conversation/runtime state long enough for resume and dashboard history. */
|
|
@@ -5651,4 +5659,4 @@ function createPluginHookRunner(input = {}) {
|
|
|
5651
5659
|
};
|
|
5652
5660
|
}
|
|
5653
5661
|
//#endregion
|
|
5654
|
-
export { resolveViewerUser as $,
|
|
5662
|
+
export { resolveViewerUser as $, getConversationStore as $t, tryWorkspaceRepoCheckoutPath as A, conversationNotArchivedForEmail as At, downloadPrivateSlackFile as B, recordSlackAttachment as Bt, invalidateReadySnapshot as C, createPluginLogger as Ct, SANDBOX_RUNTIME as D, conversationArchivedForUser as Dt, setWorkspaceSnapshotBuild as E, conversationArchivedForEmail as Et, bindSlackDirectCredentialSubject as F, readConversationEventPage as Ft, isDmChannel as G, listConversationAnnotationsById as Gt, getHeaderString as H, saveObjectAnnotations as Ht, verifyEventAutomationCredentialSubject as I, buildSentryConversationUrl as It, withSlackRetries as J, authenticationLinkedEvent as Jt, normalizeSlackConversationId as K, JUNIOR_NATIVE_EVENT_NAMESPACE as Kt, verifyScheduledAutomationCredentialSubject as L, getSlackFileId as Lt, resolveChannelCapabilities as M, viewerConversationMembership as Mt, bindEventAutomationCredentialSubject as N, createPluginConversationEvents as Nt, deleteWorkspaceSnapshotBuilders as O, conversationHasParticipantEmail as Ot, bindScheduledAutomationCredentialSubject as P, readLatestConversationBrief as Pt, readActorIdentity as Q, getConversationMessageSearchStore as Qt, verifySlackDirectCredentialSubject as R, matchSlackAttachments as Rt, WorkspaceValidationError as S, createPluginModel as St, setWorkspaceSnapshot as T, conversationArchiveTimes as Tt, getSlackClient as U, createPluginAnnotations as Ut, getFilePermalink as V, resolveRootVisibility as Vt, isConversationScopedChannel as W, listConversationAnnotations as Wt, runWithWorkspaceTeamId as X, db_exports as Xt, getWorkspaceTeamId as Y, authenticationUnlinkedEvent as Yt, findUserByEmail as Z, getConversationEventStore as Zt, deleteWorkspace as _, createSlackDestination as _n, getDashboardObjectIconLink as _t, getPluginRoutes as a, locationFromRow as an, STOP_WATCHING_TOOL_NAME as at, listWorkspaces as b, sameDestination as bn, createPluginState as bt, getPluginTools as c, addAgentTurnUsage as cn, collectEventMatchKeys as ct, setPlugins as d, agentTurnUsageSchema as dn, deliverWatch as dt, getDb as en, updateViewerDisplayName as et, validatePlugins as f, hasAgentTurnUsage as fn, findMatchingWatches as ft, createWorkspace as g, upsertLinkedIdentity as gn, getDashboardConversationLink as gt, setBriefsConfig as h, upsertIdentity as hn, JUNIOR_THREAD_STATE_TTL_MS as ht, getPluginApiRoutes as i, withConversationMutationLock as in, RESOURCE_WATCH_TOOL_SOURCE as it, workspaceRepoCheckoutPath as j, conversationNotArchivedForUser as jt, getWorkspaceSnapshotBuilder as k, conversationHasParticipantUser as kt, getPluginUserPromptContributions as l, agentTurnCostUsd as ln, createTimerWatch as lt, registration_exports as m, deleteProviderIdentityForSlackUser as mn, takeDueTimerWatches as mt, applyPluginFormatMarkdown as n, createSqlConversationEventStore as nn, RESOURCE_SUBSCRIPTION_DEFAULT_TTL_MS as nt, getPluginSlackConversationLink as o, bindProviderConversation as on, cancelSubscriptions as ot, coreTaskRegistrations as p, resolveRootConversationId as pn, listWatches as pt, runWithSlackInstallationToken as q, agentsInstructionsUpdatedEvent as qt, createPluginHookRunner as r, withConversationEventLock as rn, RESOURCE_SUBSCRIPTION_MAX_TTL_MS as rt, getPluginSystemPromptContributions as s, parseSessionSource as sn, cancelWatch as st, agent_hooks_exports as t, getSqlExecutor as tn, getSlackToolContext as tt, getPlugins as u, agentTurnTotalTokens as un, createWatch as ut, getWorkspace as v, parseDestination as vn, getDashboardTaskLink as vt, loadSnapshotsForProfile as w, readConversationAccessFromSql as wt, updateWorkspace as x, createPluginEmbedder as xt, getWorkspaceByName as y, requireSlackDestination as yn, setDashboardConversationLinkOptions as yt, SlackActionError as z, readAttachmentVisionSummary as zt };
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import {
|
|
3
|
-
import { C as withLogContext, F as normalizeIdentityEmail, I as isRecord$3, L as toOptionalNumber, R as toOptionalString, a as extractGenAiUsageSummary, b as setTags, c as getLogContextAttributesForSpan, d as logException, f as logInfo, g as serializeGenAiAttribute, i as extractGenAiUsageAttributes, l as getTracePropagationHeaders, m as normalizeGenAiFinishReason, p as logWarn, s as getLogContextAttributes, u as logError, v as setSpanAttributes, w as withSpan, x as summarizeMessageText, y as setSpanStatus } from "./logging-
|
|
2
|
+
import { b as getGatewayApiKey, c as hasCompactedConversationContext, d as unwrapCurrentInstruction, f as escapeXml, g as getProviderErrorAttributes, h as findProviderError, i as completeText, l as isCompactionSummaryText, m as createProviderError, n as GEN_AI_SERVER_ADDRESS, o as resolveGatewayModel, p as ProviderError, r as completeObject, s as COMPACTION_SUMMARY_PREFIX, t as GEN_AI_PROVIDER_NAME, u as renderCurrentInstruction, v as isProviderRetryError, x as resolveGatewayCredential, y as MISSING_GATEWAY_CREDENTIALS_ERROR } from "./client-BN5U3CGw.js";
|
|
3
|
+
import { C as withLogContext, F as normalizeIdentityEmail, I as isRecord$3, L as toOptionalNumber, R as toOptionalString, a as extractGenAiUsageSummary, b as setTags, c as getLogContextAttributesForSpan, d as logException, f as logInfo, g as serializeGenAiAttribute, i as extractGenAiUsageAttributes, l as getTracePropagationHeaders, m as normalizeGenAiFinishReason, p as logWarn, s as getLogContextAttributes, u as logError, v as setSpanAttributes, w as withSpan, x as summarizeMessageText, y as setSpanStatus } from "./logging-Muw6EXro.js";
|
|
4
4
|
import { m as startInactiveSpan, n as captureMessage, v as withActiveSpan } from "./sentry-CgWZM_kV.js";
|
|
5
|
-
import { a as toCanonicalInputMessage, c as toGenAiPayloadMetadata, i as runWithConversationPrivacy, l as toGenAiPayloadTraceAttributes, o as toCanonicalOutputMessage, r as resolveConversationPrivacy, s as toGenAiMessagesTraceAttributes, t as canExposeConversationPayload } from "./conversation-privacy-
|
|
6
|
-
import { a as getChatConfig, h as normalizeSlackEmojiName, n as botConfig } from "./config-
|
|
5
|
+
import { a as toCanonicalInputMessage, c as toGenAiPayloadMetadata, i as runWithConversationPrivacy, l as toGenAiPayloadTraceAttributes, o as toCanonicalOutputMessage, r as resolveConversationPrivacy, s as toGenAiMessagesTraceAttributes, t as canExposeConversationPayload } from "./conversation-privacy-CB7wx_tP.js";
|
|
6
|
+
import { a as getChatConfig, h as normalizeSlackEmojiName, n as botConfig } from "./config-C4xZrx7G.js";
|
|
7
7
|
import { a as formatModelProfiles, c as profileConfig, i as formatModelProfile, l as TURN_REASONING_LEVELS, n as ModelProfileNotConfiguredError, o as modelIdForProfile, s as modelProfileSchema } from "./model-profile-BwU8mqwD.js";
|
|
8
8
|
import { b as parseSlackMessageTs, d as parseStoredSlackActor, g as parseSlackUserId, h as parseSlackTeamId, i as credentialUserSubjectId, l as isUserActor, m as parseSlackChannelReferenceId, n as credentialContextSchema, p as parseSlackChannelId, t as credentialContextForActor } from "./context-0Et9iVSB.js";
|
|
9
|
-
import { $t as
|
|
9
|
+
import { $t as getConversationStore, A as tryWorkspaceRepoCheckoutPath, B as downloadPrivateSlackFile, C as invalidateReadySnapshot, Ct as createPluginLogger, D as SANDBOX_RUNTIME, E as setWorkspaceSnapshotBuild, G as isDmChannel$1, Ht as saveObjectAnnotations, J as withSlackRetries, K as normalizeSlackConversationId, M as resolveChannelCapabilities, O as deleteWorkspaceSnapshotBuilders, Q as readActorIdentity, Qt as getConversationMessageSearchStore, Rt as matchSlackAttachments, S as WorkspaceValidationError, T as setWorkspaceSnapshot, U as getSlackClient, Ut as createPluginAnnotations, V as getFilePermalink, W as isConversationScopedChannel, Zt as getConversationEventStore, _ as deleteWorkspace, at as STOP_WATCHING_TOOL_NAME, b as listWorkspaces, bn as sameDestination$1, c as getPluginTools, cn as addAgentTurnUsage, dt as deliverWatch, en as getDb, fn as hasAgentTurnUsage, ft as findMatchingWatches, g as createWorkspace, gt as getDashboardConversationLink, ht as JUNIOR_THREAD_STATE_TTL_MS, it as RESOURCE_WATCH_TOOL_SOURCE, j as workspaceRepoCheckoutPath, k as getWorkspaceSnapshotBuilder, l as getPluginUserPromptContributions, lt as createTimerWatch, n as applyPluginFormatMarkdown, nt as RESOURCE_SUBSCRIPTION_DEFAULT_TTL_MS, ot as cancelSubscriptions, pt as listWatches, r as createPluginHookRunner, rt as RESOURCE_SUBSCRIPTION_MAX_TTL_MS, s as getPluginSystemPromptContributions, st as cancelWatch, tn as getSqlExecutor, tt as getSlackToolContext, u as getPlugins, ut as createWatch, v as getWorkspace, vn as parseDestination, vt as getDashboardTaskLink, w as loadSnapshotsForProfile, x as updateWorkspace, y as getWorkspaceByName, z as SlackActionError } from "./agent-hooks-BfjhfMIy.js";
|
|
10
10
|
import { n as juniorDestinations } from "./destinations-BeBiJeEM.js";
|
|
11
|
-
import { D as juniorIdentities, E as juniorConversations, a as juniorSchedulerRuns, c as juniorStats, d as AGENT_INVOCATION_MAILBOX_STATUSES, g as juniorConversationBriefs, k as juniorArtifacts, l as juniorEventAutomations, o as juniorSchedulerTasks, w as juniorAttachments, x as juniorConversationAnnotations } from "./executor-
|
|
12
|
-
import { $ as contextProvenance, B as briefLinkSchema, H as conversationBriefSchema, R as isVisionImageMediaType, V as briefOutcomeStatusSchema, W as KNOWN_CONVERSATION_EVENT_TYPES, et as instructionActors, j as messageCardRefSchema, nt as sameActorIdentity, tt as instructionProvenanceFor } from "./conversation-
|
|
11
|
+
import { D as juniorIdentities, E as juniorConversations, a as juniorSchedulerRuns, c as juniorStats, d as AGENT_INVOCATION_MAILBOX_STATUSES, g as juniorConversationBriefs, k as juniorArtifacts, l as juniorEventAutomations, o as juniorSchedulerTasks, w as juniorAttachments, x as juniorConversationAnnotations } from "./executor-DUqeOd8y.js";
|
|
12
|
+
import { $ as contextProvenance, B as briefLinkSchema, H as conversationBriefSchema, R as isVisionImageMediaType, V as briefOutcomeStatusSchema, W as KNOWN_CONVERSATION_EVENT_TYPES, et as instructionActors, j as messageCardRefSchema, nt as sameActorIdentity, tt as instructionProvenanceFor } from "./conversation-DOI6Y60M.js";
|
|
13
13
|
import { a as listReferenceFiles, c as soulPathCandidates, l as worldPathCandidates } from "./package-discovery-7a9YqLhE.js";
|
|
14
|
-
import { a as resolveAuthTokenPlaceholder, c as fetchWithBoundedOAuthErrorBodies, d as CredentialUnavailableError, i as resolvePluginHeaderEnvRefs, l as getOAuthProviderErrorAttributes, o as resolvePluginCommandEnv, s as OAuthProviderError } from "./registry-
|
|
15
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
16
|
-
import { a as parseSkillInvocation, n as findSkillByName, r as loadSkillsByName, t as discoverSkills } from "./skills-
|
|
17
|
-
import { $ as fallbackShortTitle, C as isToolResultError, D as stripRuntimeTurnContext, E as retainRuntimeTurnContext, F as loadTurnRoute, G as recordToolExecutionStarted, H as recordGuardianActionReviewed, I as openConversationProjection, K as recordTurnRoute, L as recordAgentsInstructionsUpdated, M as loadConnectedMcpProviders, N as loadConversationProjection, O as trimTrailingAssistantMessages, R as recordAttachmentsDelivered, S as isContinuablePiBoundary, T as normalizeToolNameFromResult, U as recordMcpProviderConnected, V as recordAuthorizationRequested, _ as getTerminalAssistantMessages, _t as piMessageFromHistoryItem, d as TurnSliceLimitExceededError, et as generateShortTitle, f as assertTurnToolCallLimit, g as getPiMessageRole, gt as historyItemFromPiMessage, h as extractAssistantText, ht as getAgentContextInputLimitTokens, k as TURN_CONTEXT_TAG, m as isTurnExecutionLimitExceededError, mt as getAgentContextCompactionTriggerTokens, n as loadTurnCheckpoint, pt as estimateTextTokens, r as saveTurnCheckpoint, t as continuableMessages, tt as resolveTaskTitle, v as getUserMessageInstructionText, w as isToolResultMessage, x as isAssistantMessage, y as hasRuntimeTurnContext } from "./checkpoint-
|
|
18
|
-
import { A as SANDBOX_DATA_ROOT, C as getDefaultRedisStateAdapterFor, D as fenceLock, E as acquireActiveLock, F as sandboxSkillFile, I as sandboxSkillPathResolution, M as SANDBOX_SKILLS_ROOT, N as SANDBOX_WORKSPACE_ROOT, O as withLock, P as sandboxSkillDir, _ as workspaceSnapshotNotReadyUserMessage, a as isAbortError, b as buildNonInteractiveShellScript, c as isSandboxCommandStreamInterruptedError, d as isSnapshottingError, f as throwSandboxOperationError, g as isWorkspaceSnapshotNotReadyError, h as getWorkspaceSnapshotNotReadyError, i as ensureDockerDaemon, j as SANDBOX_REPOS_ROOT, k as sleep$2, l as isSandboxMissingError, m as WorkspaceSnapshotNotReadyError, n as hash, o as isAlreadyExistsError, p as wrapSandboxSetupError, r as isStale, s as isSandboxApiTransientError, t as create, u as isSandboxUnavailableError, v as getVercelSandboxCredentials, w as getStateAdapter, x as runNonInteractiveCommand, y as buildCommandScript } from "./profile-
|
|
19
|
-
import { n as canReusePendingAuthLink, t as abandonReplacedPendingAuth } from "./pending-auth-
|
|
20
|
-
import { a as NO_REPLY_MARKER, c as CooperativeTurnYieldError, i as sanitizeAssistantText, l as TurnInputCommitLostError, n as decideReply, o as isNoReplyMarker, p as isTurnInputCommitLostError, r as getAssistantReplyText, t as authorizationId } from "./oauth-authorization-
|
|
21
|
-
import { r as EVENT_AUTHOR_ID } from "./prompt-
|
|
22
|
-
import { a as createSandboxSession, c as postinstall, d as getSandboxResources, i as bindSandboxFileSystem, l as setSnapshotSpanAttributes, n as isMissingError, o as stopSession, r as resolve$1, s as dependencies } from "./resolve-
|
|
23
|
-
import { a as getVercelConversationWorkQueue, f as getTurnRequestDeadline, n as sendNextWorkspaceSnapshotJob, r as sendWorkspaceSnapshotJob } from "./job-queue-
|
|
14
|
+
import { a as resolveAuthTokenPlaceholder, c as fetchWithBoundedOAuthErrorBodies, d as CredentialUnavailableError, i as resolvePluginHeaderEnvRefs, l as getOAuthProviderErrorAttributes, o as resolvePluginCommandEnv, s as OAuthProviderError } from "./registry-DrcbAs8o.js";
|
|
15
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-Byr3trKF.js";
|
|
16
|
+
import { a as parseSkillInvocation, n as findSkillByName, r as loadSkillsByName, t as discoverSkills } from "./skills-rwWf3XjQ.js";
|
|
17
|
+
import { $ as fallbackShortTitle, C as isToolResultError, D as stripRuntimeTurnContext, E as retainRuntimeTurnContext, F as loadTurnRoute, G as recordToolExecutionStarted, H as recordGuardianActionReviewed, I as openConversationProjection, K as recordTurnRoute, L as recordAgentsInstructionsUpdated, M as loadConnectedMcpProviders, N as loadConversationProjection, O as trimTrailingAssistantMessages, R as recordAttachmentsDelivered, S as isContinuablePiBoundary, T as normalizeToolNameFromResult, U as recordMcpProviderConnected, V as recordAuthorizationRequested, _ as getTerminalAssistantMessages, _t as piMessageFromHistoryItem, d as TurnSliceLimitExceededError, et as generateShortTitle, f as assertTurnToolCallLimit, g as getPiMessageRole, gt as historyItemFromPiMessage, h as extractAssistantText, ht as getAgentContextInputLimitTokens, k as TURN_CONTEXT_TAG, m as isTurnExecutionLimitExceededError, mt as getAgentContextCompactionTriggerTokens, n as loadTurnCheckpoint, pt as estimateTextTokens, r as saveTurnCheckpoint, t as continuableMessages, tt as resolveTaskTitle, v as getUserMessageInstructionText, w as isToolResultMessage, x as isAssistantMessage, y as hasRuntimeTurnContext } from "./checkpoint-DEYb3Fqm.js";
|
|
18
|
+
import { A as SANDBOX_DATA_ROOT, C as getDefaultRedisStateAdapterFor, D as fenceLock, E as acquireActiveLock, F as sandboxSkillFile, I as sandboxSkillPathResolution, M as SANDBOX_SKILLS_ROOT, N as SANDBOX_WORKSPACE_ROOT, O as withLock, P as sandboxSkillDir, _ as workspaceSnapshotNotReadyUserMessage, a as isAbortError, b as buildNonInteractiveShellScript, c as isSandboxCommandStreamInterruptedError, d as isSnapshottingError, f as throwSandboxOperationError, g as isWorkspaceSnapshotNotReadyError, h as getWorkspaceSnapshotNotReadyError, i as ensureDockerDaemon, j as SANDBOX_REPOS_ROOT, k as sleep$2, l as isSandboxMissingError, m as WorkspaceSnapshotNotReadyError, n as hash, o as isAlreadyExistsError, p as wrapSandboxSetupError, r as isStale, s as isSandboxApiTransientError, t as create, u as isSandboxUnavailableError, v as getVercelSandboxCredentials, w as getStateAdapter, x as runNonInteractiveCommand, y as buildCommandScript } from "./profile-25NkcK4S.js";
|
|
19
|
+
import { n as canReusePendingAuthLink, t as abandonReplacedPendingAuth } from "./pending-auth-pYQpJmtu.js";
|
|
20
|
+
import { a as NO_REPLY_MARKER, c as CooperativeTurnYieldError, i as sanitizeAssistantText, l as TurnInputCommitLostError, n as decideReply, o as isNoReplyMarker, p as isTurnInputCommitLostError, r as getAssistantReplyText, t as authorizationId } from "./oauth-authorization-CrD-xb8a.js";
|
|
21
|
+
import { r as EVENT_AUTHOR_ID } from "./prompt-9C-wUwwx.js";
|
|
22
|
+
import { a as createSandboxSession, c as postinstall, d as getSandboxResources, i as bindSandboxFileSystem, l as setSnapshotSpanAttributes, n as isMissingError, o as stopSession, r as resolve$1, s as dependencies } from "./resolve-D9kl_rkl.js";
|
|
23
|
+
import { a as getVercelConversationWorkQueue, f as getTurnRequestDeadline, n as sendNextWorkspaceSnapshotJob, r as sendWorkspaceSnapshotJob } from "./job-queue-C1AJ5uJt.js";
|
|
24
24
|
import { n as privateTraceResultAttributes } from "./private-trace-result-BLvBjy_e.js";
|
|
25
25
|
import { streamSimple } from "@earendil-works/pi-ai/compat";
|
|
26
26
|
import { createGatewayProvider } from "@ai-sdk/gateway";
|
|
@@ -31,7 +31,7 @@ import { AsyncLocalStorage } from "node:async_hooks";
|
|
|
31
31
|
import { z } from "zod";
|
|
32
32
|
import { createHash, createHmac, randomBytes, randomUUID, timingSafeEqual } from "node:crypto";
|
|
33
33
|
import { and, asc, desc, eq, gt, gte, inArray, isNotNull, isNull, lt, lte, ne, notExists, notInArray, or, sql } from "drizzle-orm";
|
|
34
|
-
import { EgressAuthRequired, EgressPolicyDenied, PluginToolInputError, actorSchema, actorUserIdSchema, destinationSchema, destinationVisibilitySchema, eventMatchSchema, eventMatches, eventSchema, eventTypeSchema, missingToolAnnotationKeys, normalizeEventIdentifier, ownedObjectAnnotationSchema, pluginAuthorizationSchema, pluginCredentialHeaderTransformSchema, pluginCredentialResultSchema, pluginGrantSchema, pluginProviderAccountSchema, pluginStoredTokensSchema, slackDestinationSchema, sourceSchema, stableEventMatchKey, taskOutcomeSchema, watchResultSchema } from "@sentry/junior-plugin-api";
|
|
34
|
+
import { EgressAuthRequired, EgressPolicyDenied, PluginToolInputError, actorSchema, actorUserIdSchema, destinationSchema, destinationVisibilitySchema, eventMatchSchema, eventMatches, eventSchema, eventTypeSchema, missingToolAnnotationKeys, normalizeEventIdentifier, objectTypeSchema, ownedObjectAnnotationSchema, pluginAuthorizationSchema, pluginCredentialHeaderTransformSchema, pluginCredentialResultSchema, pluginGrantSchema, pluginProviderAccountSchema, pluginStoredTokensSchema, slackDestinationSchema, sourceSchema, stableEventMatchKey, taskOutcomeSchema, watchResultSchema } from "@sentry/junior-plugin-api";
|
|
35
35
|
import { alias } from "drizzle-orm/pg-core";
|
|
36
36
|
import { Agent, estimateContextTokens } from "@earendil-works/pi-agent-core";
|
|
37
37
|
import fs from "node:fs/promises";
|
|
@@ -2683,7 +2683,11 @@ const payload = z.strictObject({
|
|
|
2683
2683
|
title: z.strictObject({ text: z.string().min(1) }),
|
|
2684
2684
|
display_id: z.string().optional(),
|
|
2685
2685
|
display_type: z.string().optional(),
|
|
2686
|
-
product_name: z.string().optional()
|
|
2686
|
+
product_name: z.string().optional(),
|
|
2687
|
+
product_icon: z.strictObject({
|
|
2688
|
+
url,
|
|
2689
|
+
alt_text: z.string().min(1)
|
|
2690
|
+
}).optional()
|
|
2687
2691
|
}),
|
|
2688
2692
|
custom_fields: z.array(customField).optional(),
|
|
2689
2693
|
display_order: z.array(z.string()).optional()
|
|
@@ -5595,7 +5599,7 @@ function isEventMailboxMetadata(value) {
|
|
|
5595
5599
|
const event = record.event;
|
|
5596
5600
|
if (!event || typeof event !== "object" || Array.isArray(event)) return false;
|
|
5597
5601
|
const fields = event;
|
|
5598
|
-
return typeof fields.eventKey === "string" && typeof fields.eventType === "string" && typeof fields.namespace === "string" && typeof fields.identifier === "string" && typeof fields.subscriptionId === "string" && (fields.trustedSummary === void 0 || typeof fields.trustedSummary === "string");
|
|
5602
|
+
return typeof fields.eventKey === "string" && typeof fields.eventType === "string" && typeof fields.namespace === "string" && typeof fields.identifier === "string" && typeof fields.subscriptionId === "string" && (fields.objectType === void 0 || objectTypeSchema.safeParse(fields.objectType).success) && (fields.trustedSummary === void 0 || typeof fields.trustedSummary === "string");
|
|
5599
5603
|
}
|
|
5600
5604
|
/** Build plain conversation mailbox input for one matched watch. */
|
|
5601
5605
|
function createEventInboundMessage(input) {
|
|
@@ -5607,7 +5611,8 @@ function createEventInboundMessage(input) {
|
|
|
5607
5611
|
namespace: input.event.namespace,
|
|
5608
5612
|
identifier: input.event.identifier,
|
|
5609
5613
|
subscriptionId: input.subscription.id,
|
|
5610
|
-
trustedSummary: input.event.trustedSummary
|
|
5614
|
+
trustedSummary: input.event.trustedSummary,
|
|
5615
|
+
objectType: input.event.objectType
|
|
5611
5616
|
}
|
|
5612
5617
|
};
|
|
5613
5618
|
return {
|
|
@@ -20517,6 +20522,15 @@ async function summarizeContext(args, deps) {
|
|
|
20517
20522
|
if (!summary) throw new Error("Compaction summary was empty");
|
|
20518
20523
|
return summary.slice(0, MAX_SUMMARY_CHARS);
|
|
20519
20524
|
}
|
|
20525
|
+
/** Keep generated text inside the existing evidence-only prompt boundary. */
|
|
20526
|
+
function renderCompactionSummary(summary) {
|
|
20527
|
+
return [
|
|
20528
|
+
COMPACTION_SUMMARY_PREFIX,
|
|
20529
|
+
"<thread-context authority=\"evidence-only\">",
|
|
20530
|
+
escapeXml(summary),
|
|
20531
|
+
"</thread-context>"
|
|
20532
|
+
].join("\n");
|
|
20533
|
+
}
|
|
20520
20534
|
/** Measure provider-visible history without counting host-only message fields. */
|
|
20521
20535
|
function estimateHistoryTokens(messages) {
|
|
20522
20536
|
return estimateContextTokens(messages).tokens;
|
|
@@ -20593,8 +20607,8 @@ async function writeCompactedThreadContext(args, sourceMessages, summary, contex
|
|
|
20593
20607
|
const eventStore = getConversationEventStore();
|
|
20594
20608
|
const sourceProjection = await loadConversationProjection({ conversationId: args.conversationId });
|
|
20595
20609
|
const retained = selectRetainedUserMessageEntries(trimTrailingAssistantMessages(sourceProjection.messages));
|
|
20596
|
-
const continuation = appendOpenPlan(summary, sourceMessages);
|
|
20597
|
-
const replacement = [...retained.map((entry) => entry.message), userMessage(
|
|
20610
|
+
const continuation = appendOpenPlan(renderCompactionSummary(summary), sourceMessages);
|
|
20611
|
+
const replacement = [...retained.map((entry) => entry.message), userMessage(continuation)];
|
|
20598
20612
|
const replacementInputTokens = estimateHistoryTokens(replacement);
|
|
20599
20613
|
const replacementProvenance = buildReplacementProvenance({
|
|
20600
20614
|
retained,
|
|
@@ -20644,19 +20658,23 @@ function createContextCompactor(deps) {
|
|
|
20644
20658
|
}
|
|
20645
20659
|
/** Compact the active conversation and durably bind its selected handoff profile. */
|
|
20646
20660
|
async function compactContextForHandoff(args, deps) {
|
|
20647
|
-
const
|
|
20661
|
+
const retainedInstruction = await loadLastInstruction(args.conversationId);
|
|
20662
|
+
const contextMessage = runtimeContextMessage(args.runtimeContext, retainedInstruction?.message.timestamp);
|
|
20648
20663
|
if (!contextMessage) throw new Error("Handoff requires the current runtime turn context");
|
|
20649
20664
|
const generatedSummary = await summarizeContext(args, deps);
|
|
20650
|
-
const continuation = appendOpenPlan(generatedSummary, args.piMessages);
|
|
20651
|
-
const
|
|
20652
|
-
|
|
20653
|
-
|
|
20654
|
-
|
|
20655
|
-
|
|
20656
|
-
|
|
20657
|
-
|
|
20658
|
-
|
|
20659
|
-
|
|
20665
|
+
const continuation = appendOpenPlan(renderCompactionSummary(generatedSummary), args.piMessages);
|
|
20666
|
+
const replacement = [
|
|
20667
|
+
{
|
|
20668
|
+
message: contextMessage,
|
|
20669
|
+
provenance: contextProvenance
|
|
20670
|
+
},
|
|
20671
|
+
...retainedInstruction ? [retainedInstruction] : [],
|
|
20672
|
+
{
|
|
20673
|
+
message: userMessage(`${continuation}\n\nModel handoff completed: ${JSON.stringify(args.target)}.`),
|
|
20674
|
+
provenance: contextProvenance
|
|
20675
|
+
}
|
|
20676
|
+
];
|
|
20677
|
+
const messages = replacement.map((entry) => entry.message);
|
|
20660
20678
|
args.signal?.throwIfAborted();
|
|
20661
20679
|
await getConversationEventStore().replaceHistory(args.conversationId, {
|
|
20662
20680
|
createdAtMs: Date.now(),
|
|
@@ -20667,7 +20685,10 @@ async function compactContextForHandoff(args, deps) {
|
|
|
20667
20685
|
...args.target.reasoningLevel ? { reasoningLevel: args.target.reasoningLevel } : void 0,
|
|
20668
20686
|
...args.triggeringToolCallId ? { triggeringToolCallId: args.triggeringToolCallId } : void 0,
|
|
20669
20687
|
summary: generatedSummary,
|
|
20670
|
-
replacementHistory:
|
|
20688
|
+
replacementHistory: replacement.map((entry) => ({
|
|
20689
|
+
item: historyItemFromPiMessage(entry.message, entry.provenance),
|
|
20690
|
+
..."sourceEventSeq" in entry ? { sourceEventSeq: entry.sourceEventSeq } : void 0
|
|
20691
|
+
}))
|
|
20671
20692
|
}
|
|
20672
20693
|
});
|
|
20673
20694
|
return messages;
|
|
@@ -20708,8 +20729,7 @@ async function compactActiveContextIfNeeded(args, deps) {
|
|
|
20708
20729
|
reason: "summary_failed"
|
|
20709
20730
|
};
|
|
20710
20731
|
}
|
|
20711
|
-
const
|
|
20712
|
-
const summaryMessage = userMessage(`${ACTIVE_TURN_COMPACTION_SUMMARY_PREFIX}\n${continuation}`);
|
|
20732
|
+
const summaryMessage = userMessage(appendOpenPlan(renderCompactionSummary(summary), source.messages));
|
|
20713
20733
|
const retainedInstruction = pendingMessages.length === 0 ? await loadLastInstruction(args.conversationId) : void 0;
|
|
20714
20734
|
const instructionMessages = retainedInstruction ? [retainedInstruction.message] : pendingMessages.map((entry) => entry.message);
|
|
20715
20735
|
const instructionProvenance = retainedInstruction ? [retainedInstruction.provenance] : pendingMessages.map((entry) => entry.provenance);
|
|
@@ -21565,7 +21585,7 @@ async function executeAgentRunInPrivacyContext(run, conversationPrivacy, runLogC
|
|
|
21565
21585
|
...agent.state.messages,
|
|
21566
21586
|
...contextMessage ? [contextMessage] : [],
|
|
21567
21587
|
freshPromptMessage
|
|
21568
|
-
])) await runResume.commitInput();
|
|
21588
|
+
], [instructionProvenanceFor(actor)])) await runResume.commitInput();
|
|
21569
21589
|
}
|
|
21570
21590
|
if (contextMessage) agent.state.messages = [...agent.state.messages, contextMessage];
|
|
21571
21591
|
if (!shouldPromptAgent) await repositoryInstructionsContext.applyUpdate(void 0, {
|
|
@@ -21909,7 +21929,7 @@ function createAgentRunner(execute, options) {
|
|
|
21909
21929
|
} } : void 0
|
|
21910
21930
|
};
|
|
21911
21931
|
if (run.instruction.storedAttachments?.length) {
|
|
21912
|
-
const { loadInputImages } = await import("./images-
|
|
21932
|
+
const { loadInputImages } = await import("./images-B5JLFwJR.js").then((n) => n.n);
|
|
21913
21933
|
const storage = nextRun.environment?.attachmentStorage;
|
|
21914
21934
|
if (!storage) throw new Error("Attachment storage is unavailable.");
|
|
21915
21935
|
nextRun.instruction = {
|