@sentry/junior 0.224.0 → 0.226.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.
Files changed (63) hide show
  1. package/dist/{agent-hooks-DNLBwmsh.js → agent-hooks-FUetyyLe.js} +23 -16
  2. package/dist/{agent-runner-9g6TQk9y.js → agent-runner-DEF7auSj.js} +3114 -318
  3. package/dist/api/schema.d.ts +353 -10
  4. package/dist/api/schema.js +4 -4
  5. package/dist/api.js +22 -18
  6. package/dist/{app-BbSD6EtD.d.ts → app-TVL42pGL.d.ts} +1 -1
  7. package/dist/app.d.ts +1 -1
  8. package/dist/app.js +893 -7660
  9. package/dist/{briefs-CjXnGKzZ.js → briefs-Cb4T2BUI.js} +5 -5
  10. package/dist/{catalog-runtime-CVZ9TEuK.js → catalog-runtime-BYGR3Dr4.js} +1 -1
  11. package/dist/{checkpoint-Ceck_fLO.js → checkpoint-CJe-dZFF.js} +76 -10
  12. package/dist/cli/chat.js +13 -13
  13. package/dist/cli/check.js +3 -3
  14. package/dist/cli/main.js +1 -1
  15. package/dist/cli/plugins.js +3 -3
  16. package/dist/cli/snapshot-create.js +3 -3
  17. package/dist/cli/upgrade.js +3 -3
  18. package/dist/{client-B27ufhzl.js → client-C2WBBx7m.js} +2 -2
  19. package/dist/{config-BAhl7-RC.js → config-Bws6Rpsh.js} +11 -13
  20. package/dist/{conversation-1HUoZr2l.js → conversation-DPbmIwjy.js} +67 -6
  21. package/dist/{conversation-privacy-C-4JQzKD.js → conversation-privacy-pCcW0a5Y.js} +1 -1
  22. package/dist/{credential-sync-BXHIxbtS.js → credential-sync-ibuNsMyl.js} +14 -134
  23. package/dist/{executor-BG2Armby.js → executor-D36FWjcf.js} +1 -1
  24. package/dist/{history-yaSjGMD_.d.ts → history-DI9KJT3J.d.ts} +38 -1
  25. package/dist/instrumentation.js +2 -2
  26. package/dist/{vercel-queue-DIkVcfK4.js → job-queue-2mFFDMHB.js} +61 -2
  27. package/dist/{logging-iY0ssa2q.js → logging-CvjMHRvg.js} +2 -2
  28. package/dist/{model-profile-CZmVoGdX.js → model-profile-BwU8mqwD.js} +14 -1
  29. package/dist/nitro.d.ts +1 -1
  30. package/dist/nitro.js +3 -4
  31. package/dist/{oauth-authorization-BIijVS2N.js → oauth-authorization-l4O1rXsL.js} +1 -1
  32. package/dist/{oauth-callback-server-DPkK3kzi.js → oauth-callback-server-Ds8M5FFX.js} +2 -2
  33. package/dist/pending-auth-DLNJbD8H.js +59 -0
  34. package/dist/{profile-6KWhg_-U.js → profile-dvV7PB7u.js} +4 -4
  35. package/dist/{prompt-90miy8VV.js → prompt-DehgjkO5.js} +1 -1
  36. package/dist/{registry-Ctgdjt-W.js → registry-C6FHctIu.js} +3 -3
  37. package/dist/{resolve-CB45ZukQ.js → resolve-DqwGI9wq.js} +2 -2
  38. package/dist/{runner-BwKCqoF3.js → runner-CzYEcB73.js} +9 -9
  39. package/dist/{sandbox-egress-signals-Cmy8ODat.js → sandbox-egress-signals-BZOv0fns.js} +1 -1
  40. package/dist/{schema-RpbW5Od2.js → schema-BZg-xzfG.js} +2 -2
  41. package/dist/{skills-c2bMDVRS.js → skills-EhiVbjF4.js} +2 -2
  42. package/dist/{spawn-Cg6lyjE7.js → spawn-Ck3L0rEr.js} +2 -2
  43. package/dist/{task-queue-SL4uLfBB.js → task-queue-TXhAWQwj.js} +3 -4
  44. package/dist/{task-runner-fntmnqzx.js → task-runner-axUJS1No.js} +380 -11
  45. package/dist/{thread-state-Wfr0GdKS.js → thread-state-CTuWhjru.js} +5 -5
  46. package/dist/{turn-failure-response-DLjSEm-R.js → turn-failure-response-csVoLOzx.js} +8 -9
  47. package/dist/{turn-lifecycle-5_jvLqRz.js → turn-lifecycle-C1S6vELh.js} +1 -1
  48. package/dist/{turn-session-routing-CQaysLoe.js → turn-session-routing-5RejBvit.js} +1 -1
  49. package/dist/{validation-CnZkCN7o.js → validation-q2PFxkTQ.js} +1 -1
  50. package/dist/{version-C6lA-h_o.js → version-ByLtIYyy.js} +1 -1
  51. package/dist/version.js +1 -1
  52. package/dist/web-authorization-Biy8nsS7.js +162 -0
  53. package/dist/web-input-DM9LaEdn.js +7774 -0
  54. package/dist/{reporting-window-DbUqng0P.js → web-message-id-xPI_EFSC.js} +11 -1
  55. package/dist/{work-4Nhz9mVv.js → work-QrbHdXTc.js} +7 -8
  56. package/dist/{worker-CdWPsNL2.js → worker-r17aopXW.js} +5 -6
  57. package/package.json +4 -4
  58. package/dist/execution-stats-DikPOxJ1.js +0 -373
  59. package/dist/job-queue-D4oAVrL9.js +0 -63
  60. package/dist/short-title-xEkZwkcV.js +0 -65
  61. package/dist/stats-DP9zl3Jg.js +0 -2758
  62. package/dist/web-authorization-Bbx999_q.js +0 -38
  63. package/dist/web-input-BoE1xE-K.js +0 -899
@@ -1,16 +1,16 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
2
- import { a as embedTexts, r as completeObject } from "./client-B27ufhzl.js";
3
- import { C as withSpan, F as isRecord$2, P as normalizeIdentityEmail, _ as setSpanAttributes, d as logInfo, f as logWarn, u as logException, v as setSpanStatus } from "./logging-iY0ssa2q.js";
2
+ import { a as embedTexts, r as completeObject } from "./client-C2WBBx7m.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-CvjMHRvg.js";
4
4
  import { a as getClient$1 } from "./sentry-CgWZM_kV.js";
5
- import { t as canExposeConversationPayload } from "./conversation-privacy-C-4JQzKD.js";
6
- import { a as getChatConfig, n as botConfig, s as getSlackBotToken } from "./config-BAhl7-RC.js";
7
- import { n as defaultModelId } from "./model-profile-CZmVoGdX.js";
5
+ import { t as canExposeConversationPayload } from "./conversation-privacy-pCcW0a5Y.js";
6
+ import { a as getChatConfig, n as botConfig, s as getSlackBotToken } from "./config-Bws6Rpsh.js";
7
+ import { r as defaultModelId } from "./model-profile-BwU8mqwD.js";
8
8
  import { _ as parseSlackMessageTs, c as isActorUserId, h as parseSlackTeamId, m as parseSlackChannelReferenceId, u as parseActorUserId } from "./context-Bplcgypl.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, x as juniorConversationAnnotations, y as juniorConversationEvents } from "./executor-BG2Armby.js";
11
- import { C as conversationReportEventSchema, G as historyReplacementSchema, K as newConversationEventSchema, L as conversationBriefSchema, N as readMessageCards, R as parseBriefInput, V as conversationEventDataSchema, W as decodeStoredConversationEvent, Z as usageSchema } from "./conversation-1HUoZr2l.js";
12
- import { 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-6KWhg_-U.js";
13
- import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-90miy8VV.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, x as juniorConversationAnnotations, y as juniorConversationEvents } from "./executor-D36FWjcf.js";
11
+ import { C as conversationReportEventSchema, G as historyReplacementSchema, K as newConversationEventSchema, L as conversationBriefSchema, N as readMessageCards, Q as usageSchema, R as parseBriefInput, V as conversationEventDataSchema, W as decodeStoredConversationEvent, q as encodeHistoryPayload } from "./conversation-DPbmIwjy.js";
12
+ import { 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-dvV7PB7u.js";
13
+ import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-DehgjkO5.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";
@@ -1189,15 +1189,16 @@ function eventUnarchivesConversation(data) {
1189
1189
  /** Split validated event data into column-lifted and JSON payload fields. */
1190
1190
  function insertFromEvent(conversationId, seq, historyVersion, event, actorIdentityId) {
1191
1191
  const stripped = stripPayloadAuthorIdentityId(event.data);
1192
- const { type, ...payload } = conversationEventDataSchema.parse(stripped);
1192
+ const data = conversationEventDataSchema.parse(stripped);
1193
+ const encoded = encodeHistoryPayload(data);
1193
1194
  return {
1194
1195
  conversationId,
1195
1196
  seq,
1196
1197
  historyVersion,
1197
- schemaVersion: 1,
1198
+ schemaVersion: encoded.schemaVersion,
1198
1199
  idempotencyKey: event.idempotencyKey ?? null,
1199
- type,
1200
- payload: sanitizePostgresJson(payload),
1200
+ type: data.type,
1201
+ payload: sanitizePostgresJson(encoded.payload),
1201
1202
  actorIdentityId: actorIdentityId ?? null,
1202
1203
  createdAt: new Date(event.createdAtMs)
1203
1204
  };
@@ -1733,8 +1734,9 @@ async function annotateToolResult(conversationId, plugin, result) {
1733
1734
  const details = isRecord$2(result.details) ? result.details : result;
1734
1735
  if (details.timed_out === true || details.isError === true || !Array.isArray(details.objectAnnotations)) return result;
1735
1736
  const cards = await saveObjectAnnotations(conversationId, plugin, details.objectAnnotations);
1737
+ const { objectAnnotations: _annotations, ...rest } = details;
1736
1738
  const annotated = {
1737
- ...details,
1739
+ ...rest,
1738
1740
  objectCards: cards
1739
1741
  };
1740
1742
  if (isRecord$2(result.details)) return {
@@ -3769,7 +3771,12 @@ async function withSlackRetries(task, maxAttempts = 3, context = {}) {
3769
3771
  * is workspace-scoped and no installation token can be resolved, so a write
3770
3772
  * never goes out with another workspace's credentials.
3771
3773
  */
3772
- function getSlackClient() {
3774
+ function getSlackClient(options) {
3775
+ if (options) return new WebClient(resolveSlackToken(), {
3776
+ retryConfig: { retries: 0 },
3777
+ rejectRateLimitedCalls: true,
3778
+ timeout: options.timeoutMs
3779
+ });
3773
3780
  return getClient();
3774
3781
  }
3775
3782
  /**
@@ -5437,4 +5444,4 @@ function createPluginHookRunner(input = {}) {
5437
5444
  };
5438
5445
  }
5439
5446
  //#endregion
5440
- export { resolveViewerUser as $, locationFromRow as $t, tryWorkspaceRepoCheckoutPath as A, createPluginConversationEvents as At, downloadPrivateSlackFile as B, agentsInstructionsUpdatedEvent as Bt, invalidateReadySnapshot as C, conversationArchivedForEmail as Ct, SANDBOX_RUNTIME as D, conversationNotArchivedForEmail as Dt, setWorkspaceSnapshotBuild as E, conversationHasParticipantUser as Et, bindSlackDirectCredentialSubject as F, saveObjectAnnotations as Ft, isDmChannel as G, getConversationMessageSearchStore as Gt, getHeaderString as H, authenticationUnlinkedEvent as Ht, verifyEventAutomationCredentialSubject as I, createPluginAnnotations as It, withSlackRetries as J, getSqlExecutor as Jt, normalizeSlackConversationId as K, getConversationStore as Kt, verifyScheduledAutomationCredentialSubject as L, listConversationAnnotations as Lt, resolveChannelCapabilities as M, readConversationEventPage as Mt, bindEventAutomationCredentialSubject as N, buildSentryConversationUrl as Nt, deleteWorkspaceSnapshotBuilders as O, conversationNotArchivedForUser as Ot, bindScheduledAutomationCredentialSubject as P, resolveRootVisibility as Pt, readActorIdentity as Q, withConversationMutationLock as Qt, verifySlackDirectCredentialSubject as R, listConversationAnnotationsById as Rt, WorkspaceValidationError as S, conversationArchiveTimes as St, setWorkspaceSnapshot as T, conversationHasParticipantEmail as Tt, getSlackClient as U, db_exports as Ut, getFilePermalink as V, authenticationLinkedEvent as Vt, isConversationScopedChannel as W, getConversationEventStore as Wt, runWithWorkspaceTeamId as X, withConversationEventLock as Xt, getWorkspaceTeamId as Y, createSqlConversationEventStore as Yt, findUserByEmail as Z, sanitizePostgresJson as Zt, deleteWorkspace as _, createPluginState as _t, getPluginRoutes as a, agentTurnUsageSchema as an, STOP_WATCHING_TOOL_NAME as at, listWorkspaces as b, createPluginLogger as bt, getPluginTools as c, deleteProviderIdentityForSlackUser as cn, collectEventMatchKeys as ct, setPlugins as d, createSlackDestination as dn, findMatchingWatches as dt, bindProviderConversation as en, updateViewerDisplayName as et, validatePlugins as f, parseDestination as fn, listWatches as ft, createWorkspace as g, setDashboardConversationLinkOptions as gt, setBriefsConfig as h, getDashboardTaskLink as ht, getPluginApiRoutes as i, agentTurnTotalTokens as in, RESOURCE_WATCH_TOOL_SOURCE as it, workspaceRepoCheckoutPath as j, readLatestConversationBrief as jt, getWorkspaceSnapshotBuilder as k, viewerConversationMembership as kt, getPluginUserPromptContributions as l, upsertIdentity as ln, createWatch as lt, registration_exports as m, sameDestination as mn, getDashboardConversationLink as mt, applyPluginFormatMarkdown as n, addAgentTurnUsage as nn, RESOURCE_SUBSCRIPTION_DEFAULT_TTL_MS as nt, getPluginSlackConversationLink as o, hasAgentTurnUsage as on, cancelSubscriptions as ot, coreTaskRegistrations as p, requireSlackDestination as pn, JUNIOR_THREAD_STATE_TTL_MS as pt, runWithSlackInstallationToken as q, getDb as qt, createPluginHookRunner as r, agentTurnCostUsd as rn, RESOURCE_SUBSCRIPTION_MAX_TTL_MS as rt, getPluginSystemPromptContributions as s, resolveRootConversationId as sn, cancelWatch as st, agent_hooks_exports as t, parseSessionSource as tn, getSlackToolContext as tt, getPlugins as u, upsertLinkedIdentity as un, deliverWatch as ut, getWorkspace as v, createPluginEmbedder as vt, loadSnapshotsForProfile as w, conversationArchivedForUser as wt, updateWorkspace as x, readConversationAccessFromSql as xt, getWorkspaceByName as y, createPluginModel as yt, SlackActionError as z, JUNIOR_NATIVE_EVENT_NAMESPACE as zt };
5447
+ export { resolveViewerUser as $, bindProviderConversation as $t, tryWorkspaceRepoCheckoutPath as A, createPluginConversationEvents as At, downloadPrivateSlackFile as B, agentsInstructionsUpdatedEvent as Bt, invalidateReadySnapshot as C, conversationArchivedForEmail as Ct, SANDBOX_RUNTIME as D, conversationNotArchivedForEmail as Dt, setWorkspaceSnapshotBuild as E, conversationHasParticipantUser as Et, bindSlackDirectCredentialSubject as F, saveObjectAnnotations as Ft, isDmChannel as G, getConversationMessageSearchStore as Gt, getHeaderString as H, authenticationUnlinkedEvent as Ht, verifyEventAutomationCredentialSubject as I, createPluginAnnotations as It, withSlackRetries as J, getSqlExecutor as Jt, normalizeSlackConversationId as K, getConversationStore as Kt, verifyScheduledAutomationCredentialSubject as L, listConversationAnnotations as Lt, resolveChannelCapabilities as M, readConversationEventPage as Mt, bindEventAutomationCredentialSubject as N, buildSentryConversationUrl as Nt, deleteWorkspaceSnapshotBuilders as O, conversationNotArchivedForUser as Ot, bindScheduledAutomationCredentialSubject as P, resolveRootVisibility as Pt, readActorIdentity as Q, locationFromRow as Qt, verifySlackDirectCredentialSubject as R, listConversationAnnotationsById as Rt, WorkspaceValidationError as S, conversationArchiveTimes as St, setWorkspaceSnapshot as T, conversationHasParticipantEmail as Tt, getSlackClient as U, db_exports as Ut, getFilePermalink as V, authenticationLinkedEvent as Vt, isConversationScopedChannel as W, getConversationEventStore as Wt, runWithWorkspaceTeamId as X, withConversationEventLock as Xt, getWorkspaceTeamId as Y, createSqlConversationEventStore as Yt, findUserByEmail as Z, withConversationMutationLock as Zt, deleteWorkspace as _, createPluginState as _t, getPluginRoutes as a, hasAgentTurnUsage as an, STOP_WATCHING_TOOL_NAME as at, listWorkspaces as b, createPluginLogger as bt, getPluginTools as c, upsertIdentity as cn, collectEventMatchKeys as ct, setPlugins as d, parseDestination as dn, findMatchingWatches as dt, parseSessionSource as en, updateViewerDisplayName as et, validatePlugins as f, requireSlackDestination as fn, listWatches as ft, createWorkspace as g, setDashboardConversationLinkOptions as gt, setBriefsConfig as h, getDashboardTaskLink as ht, getPluginApiRoutes as i, agentTurnUsageSchema as in, RESOURCE_WATCH_TOOL_SOURCE as it, workspaceRepoCheckoutPath as j, readLatestConversationBrief as jt, getWorkspaceSnapshotBuilder as k, viewerConversationMembership as kt, getPluginUserPromptContributions as l, upsertLinkedIdentity as ln, createWatch as lt, registration_exports as m, getDashboardConversationLink as mt, applyPluginFormatMarkdown as n, agentTurnCostUsd as nn, RESOURCE_SUBSCRIPTION_DEFAULT_TTL_MS as nt, getPluginSlackConversationLink as o, resolveRootConversationId as on, cancelSubscriptions as ot, coreTaskRegistrations as p, sameDestination as pn, JUNIOR_THREAD_STATE_TTL_MS as pt, runWithSlackInstallationToken as q, getDb as qt, createPluginHookRunner as r, agentTurnTotalTokens as rn, RESOURCE_SUBSCRIPTION_MAX_TTL_MS as rt, getPluginSystemPromptContributions as s, deleteProviderIdentityForSlackUser as sn, cancelWatch as st, agent_hooks_exports as t, addAgentTurnUsage as tn, getSlackToolContext as tt, getPlugins as u, createSlackDestination as un, deliverWatch as ut, getWorkspace as v, createPluginEmbedder as vt, loadSnapshotsForProfile as w, conversationArchivedForUser as wt, updateWorkspace as x, readConversationAccessFromSql as xt, getWorkspaceByName as y, createPluginModel as yt, SlackActionError as z, JUNIOR_NATIVE_EVENT_NAMESPACE as zt };