@sentry/junior 0.246.0 → 0.248.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 (69) hide show
  1. package/dist/{admin-Bh-MYw-j.js → admin-BlHz8fGl.js} +1 -1
  2. package/dist/{agent-hooks-DpklSWZg.js → agent-hooks-DWCHBPYw.js} +25 -12
  3. package/dist/{agent-invocations-BO6ddZax.js → agent-invocations-D_YoNnAn.js} +8 -2
  4. package/dist/{agent-runner-DSKpHjHW.js → agent-runner-CnlFtbzb.js} +608 -2434
  5. package/dist/api/schema.d.ts +171 -3
  6. package/dist/api/schema.js +3 -3
  7. package/dist/api.js +219 -153
  8. package/dist/{app-BYB7szGb.d.ts → app-B0gT1Slp.d.ts} +11 -2
  9. package/dist/app.d.ts +1 -1
  10. package/dist/app.js +30 -27
  11. package/dist/assistant-reply-BxCi7V4v.js +45 -0
  12. package/dist/{briefs-cZ5vWqP_.js → briefs-CdkIl79U.js} +4 -4
  13. package/dist/{catalog-runtime-CTaQXYqS.js → catalog-runtime-CTBsdSam.js} +1 -1
  14. package/dist/cli/chat.js +22 -16
  15. package/dist/cli/check.js +3 -3
  16. package/dist/cli/main.js +2 -2
  17. package/dist/cli/plugins.js +4 -4
  18. package/dist/cli/snapshot-create.js +3 -3
  19. package/dist/cli/upgrade.js +3 -3
  20. package/dist/{client--xtsAxKP.js → client-CWQtbizj.js} +2 -2
  21. package/dist/{config-BK53Ip5C.js → config-aitDvTQm.js} +16 -9
  22. package/dist/{conversation-CvBG57Io.js → conversation-Cjo9tHGm.js} +85 -1
  23. package/dist/{conversation-privacy-BDBFw6Ws.js → conversation-privacy-BsqXHVBz.js} +1 -1
  24. package/dist/{credential-sync-BiuhC9Ds.js → credential-sync-DqZF735a.js} +14 -14
  25. package/dist/{executor-bmmuRY-w.js → executor-oIZAkQZb.js} +3 -3
  26. package/dist/{images-DZliDtSH.js → images-Dzh3RBXY.js} +4 -21
  27. package/dist/instrumentation.js +2 -2
  28. package/dist/{job-queue-Cz3M7gg4.js → job-queue-DyA2AEnY.js} +1 -1
  29. package/dist/{logging-DVtMYOdD.js → logging-OpC2jwiV.js} +1 -1
  30. package/dist/message-EyMrVXEf.js +59 -0
  31. package/dist/nitro.d.ts +1 -1
  32. package/dist/nitro.js +3 -3
  33. package/dist/{oauth-authorization-By_MVRDC.js → oauth-authorization-BA4Dt6a7.js} +1 -45
  34. package/dist/{oauth-callback-server-BrUo6w1e.js → oauth-callback-server-ClDv9Z5Y.js} +2 -2
  35. package/dist/{pending-auth-BuQLZ6dK.js → pending-auth-D_nf121N.js} +2 -2
  36. package/dist/{profile-BevMNSlr.js → profile-Dfg76pvk.js} +4 -4
  37. package/dist/{prompt-C9Q9cjD3.js → prompt-C7bRJ2vg.js} +1 -1
  38. package/dist/{registry-C2rSEio1.js → registry-fpIZHoqE.js} +1 -1
  39. package/dist/{resolve-qPhrznTf.js → resolve-LMCZhQVg.js} +2 -2
  40. package/dist/result-C1ZCRPLx.js +463 -0
  41. package/dist/{runner-CNh5eMWx.js → runner-DNZMviFH.js} +11 -10
  42. package/dist/{sandbox-egress-signals-BnDEKu8d.js → sandbox-egress-signals-Dcc-mwkl.js} +1 -1
  43. package/dist/{schema-BWMRg8JS.js → schema-BRZsYL5-.js} +5 -4
  44. package/dist/session-stop-dyvsZDB0.js +782 -0
  45. package/dist/{skills-C6zJbudq.js → skills-BgGiQt5Y.js} +2 -2
  46. package/dist/{spawn-C3efZSx3.js → spawn-CpqxMPWE.js} +3 -2
  47. package/dist/store-OMQAFrJG.js +1417 -0
  48. package/dist/{task-queue-BX4vG6uA.js → task-queue-SWsXPSp-.js} +3 -3
  49. package/dist/{task-runner-T51kll0U.js → task-runner-BOxv7shv.js} +11 -11
  50. package/dist/{tasks-B9OIjl2K.js → tasks-DREdnhVP.js} +49 -16
  51. package/dist/{thread-state-AGZtVyXp.js → thread-state-BoNCtSwk.js} +7 -7
  52. package/dist/{turn-failure-response-DJ8KU2bo.js → turn-failure-response-C6jrCPjc.js} +9 -9
  53. package/dist/{turn-lifecycle-DZJkJ95q.js → turn-lifecycle-cQFsZFOU.js} +1 -1
  54. package/dist/{turn-session-routing-mRqLbMZW.js → turn-session-routing-Ba12fwXz.js} +1 -1
  55. package/dist/{validation-Dg0Ihxzo.js → validation-Dmfh2cTj.js} +1 -1
  56. package/dist/{version-Deub4try.js → version-ByV7nGOn.js} +1 -1
  57. package/dist/version.js +1 -1
  58. package/dist/{viewer-D5hbx6TE.js → viewer-CX41TWYr.js} +4 -4
  59. package/dist/{web-authorization-DCxixz5S.js → web-authorization-rDLlKIS0.js} +6 -6
  60. package/dist/{web-input-0sorYVLh.js → web-input-Bn9HHZEo.js} +43 -208
  61. package/dist/{work-rm2X7jj4.js → work-CvFoEpRT.js} +90 -14
  62. package/dist/{worker-bnGsAOP3.js → worker-CI5B63vk.js} +7 -7
  63. package/migrations/0053_conversation_stopped_at.sql +1 -0
  64. package/migrations/0054_flowery_rage.sql +1 -0
  65. package/migrations/meta/0053_snapshot.json +3771 -0
  66. package/migrations/meta/0054_snapshot.json +3777 -0
  67. package/migrations/meta/_journal.json +14 -0
  68. package/package.json +6 -5
  69. package/dist/message-BSN-Ma5f.js +0 -317
@@ -1,4 +1,4 @@
1
- import { a as setUserAdminFromSql, d as getDb, n as listAdminUsersFromSql } from "./viewer-D5hbx6TE.js";
1
+ import { a as setUserAdminFromSql, d as getDb, n as listAdminUsersFromSql } from "./viewer-CX41TWYr.js";
2
2
  import { CLI_USAGE } from "./cli/run.js";
3
3
  //#region src/cli/admin.ts
4
4
  /**
@@ -1,20 +1,20 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
2
- import { a as embedTexts, r as completeObject } from "./client--xtsAxKP.js";
3
- import { I as isRecord$1, a as extractGenAiUsageSummary, d as logException, f as logInfo, p as logWarn, v as setSpanAttributes, w as withSpan, y as setSpanStatus } from "./logging-DVtMYOdD.js";
2
+ import { a as embedTexts, r as completeObject } from "./client-CWQtbizj.js";
3
+ import { I as isRecord$1, a as extractGenAiUsageSummary, d as logException, f as logInfo, p as logWarn, v as setSpanAttributes, w as withSpan, y as setSpanStatus } from "./logging-OpC2jwiV.js";
4
4
  import { a as getClient$1 } from "./sentry-CgWZM_kV.js";
5
- import { t as canExposeConversationPayload } from "./conversation-privacy-BDBFw6Ws.js";
6
- import { i as getChatConfig, n as botConfig, o as getSlackBotToken } from "./config-BK53Ip5C.js";
5
+ import { t as canExposeConversationPayload } from "./conversation-privacy-BsqXHVBz.js";
6
+ import { i as getChatConfig, n as botConfig, o as getSlackBotToken } from "./config-aitDvTQm.js";
7
7
  import { r as defaultModelId } from "./model-profile-BwU8mqwD.js";
8
8
  import { d as parseSlackTeamId, g as parseSlackMessageTs, i as isActorUserId, o as parseActorUserId, u as parseSlackChannelReferenceId } from "./actor-BTtLaeWy.js";
9
- import { O as readUserTimezone, T as hasAgentTurnUsage, c as getConversationEventStore, d as getDb, f as getSqlExecutor, h as createSqlStore, i as resolveViewerUser, k as saveUserTimezone, r as readActorIdentity } from "./viewer-D5hbx6TE.js";
10
- import { c as juniorIdentities, d as juniorDestinations, l as juniorUsers, s as juniorConversations } from "./agent-invocations-BO6ddZax.js";
11
- import { S as juniorAttachments, _ as juniorConversationEvents, b as juniorCodeChanges, f as juniorConversationParticipants, i as juniorWorkspaces, m as juniorConversationBriefs, n as juniorSnapshots, r as juniorWorkspaceRepos, x as juniorCodeRepositories, y as juniorConversationAnnotations } from "./executor-bmmuRY-w.js";
9
+ import { O as readUserTimezone, T as hasAgentTurnUsage, c as getConversationEventStore, d as getDb, f as getSqlExecutor, h as createSqlStore, i as resolveViewerUser, k as saveUserTimezone, r as readActorIdentity } from "./viewer-CX41TWYr.js";
10
+ import { c as juniorIdentities, d as juniorDestinations, l as juniorUsers, s as juniorConversations } from "./agent-invocations-D_YoNnAn.js";
11
+ import { S as juniorAttachments, _ as juniorConversationEvents, b as juniorCodeChanges, f as juniorConversationParticipants, i as juniorWorkspaces, m as juniorConversationBriefs, n as juniorSnapshots, r as juniorWorkspaceRepos, x as juniorCodeRepositories, y as juniorConversationAnnotations } from "./executor-oIZAkQZb.js";
12
12
  import { o as decodeStoredConversationEvent } from "./history-Nte1oVed.js";
13
- import { p as credentialSubjectSchema } from "./registry-C2rSEio1.js";
14
- import { B as conversationBriefSchema, C as conversationReportEventSchema, G as readMessageCardRefs, P as readMessageAttachments, V as parseBriefInput } from "./conversation-CvBG57Io.js";
15
- 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-BevMNSlr.js";
13
+ import { p as credentialSubjectSchema } from "./registry-fpIZHoqE.js";
14
+ import { C as conversationReportEventSchema, F as readMessageAttachments, H as conversationBriefSchema, U as parseBriefInput, q as readMessageCardRefs } from "./conversation-Cjo9tHGm.js";
15
+ 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-Dfg76pvk.js";
16
16
  import { i as isValidTimeZone } from "./cadence-D00SCzT1.js";
17
- import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-C9Q9cjD3.js";
17
+ import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-C7bRJ2vg.js";
18
18
  import { AsyncLocalStorage } from "node:async_hooks";
19
19
  import { z } from "zod";
20
20
  import { createHash, createHmac, randomUUID, timingSafeEqual } from "node:crypto";
@@ -2832,6 +2832,19 @@ function getSlackToolContext(context) {
2832
2832
  threadTs: parseSlackMessageTs(location.threadTs)
2833
2833
  };
2834
2834
  }
2835
+ /**
2836
+ * Return whether a person started this Turn with a Slack message.
2837
+ *
2838
+ * Only these Turns act with that person's Slack authority. Event, automation,
2839
+ * Agent invocation, and dashboard Turns in the same Conversation do not.
2840
+ */
2841
+ function isSlackMessageTurn(context) {
2842
+ return context.source.kind === "slack" && context.destination.platform === "slack" && context.actor?.platform === "slack" && context.actor.teamId === context.source.teamId;
2843
+ }
2844
+ /** Disable reason for tools that need a Slack message Turn. */
2845
+ function slackMessageTurnDisabledReason(context) {
2846
+ return isSlackMessageTurn(context) ? void 0 : "It needs a Turn that a person started with a Slack message.";
2847
+ }
2835
2848
  //#endregion
2836
2849
  //#region src/chat/slack/tool-support/channel-capabilities.ts
2837
2850
  /** Resolve channel capabilities from a Slack channel ID. */
@@ -4320,4 +4333,4 @@ function createPluginHookRunner(input = {}) {
4320
4333
  };
4321
4334
  }
4322
4335
  //#endregion
4323
- export { verifySlackDirectCredentialSubject as $, getWorkspaceSnapshotBuilder as A, listConversationAnnotations as At, cancelWatch as B, isConversationScopedChannel as Bt, WorkspaceValidationError as C, getSlackFileId as Ct, setWorkspaceSnapshotBuild as D, resolveRootVisibility as Dt, setWorkspaceSnapshot as E, recordSlackAttachment as Et, RESOURCE_SUBSCRIPTION_DEFAULT_TTL_MS as F, SlackActionError as Ft, findMatchingWatches as G, getWorkspaceTeamId as Gt, createTimerWatch as H, normalizeSlackConversationId as Ht, RESOURCE_SUBSCRIPTION_MAX_TTL_MS as I, downloadPrivateSlackFile as It, bindEventAutomationCredentialSubject as J, agentsInstructionsUpdatedEvent as Jt, listWatches as K, runWithWorkspaceTeamId as Kt, RESOURCE_WATCH_TOOL_SOURCE as L, getFilePermalink as Lt, workspaceRepoCheckoutPath as M, defaultTimezone as Mt, resolveChannelCapabilities as N, resolveUserTimezone as Nt, SANDBOX_RUNTIME as O, saveObjectAnnotations as Ot, getSlackToolContext as P, lookupSlackUser as Pt, verifyScheduledAutomationCredentialSubject as Q, STOP_WATCHING_TOOL_NAME as R, getHeaderString as Rt, updateWorkspace as S, buildSentryConversationUrl as St, loadSnapshotsForProfile as T, readAttachmentVisionSummary as Tt, createWatch as U, runWithSlackInstallationToken as Ut, collectEventMatchKeys as V, isDmChannel as Vt, deliverWatch as W, withSlackRetries as Wt, bindSlackDirectCredentialSubject as X, authenticationUnlinkedEvent as Xt, bindScheduledAutomationCredentialSubject as Y, authenticationLinkedEvent as Yt, verifyEventAutomationCredentialSubject as Z, deleteWorkspace as _, conversationNotArchivedForUser as _t, getPluginRoutes as a, setDashboardConversationLinkOptions as at, listWorkspaces as b, readLatestConversationBrief as bt, getPluginTools as c, createPluginModel as ct, setPlugins as d, conversationArchiveTimes as dt, verifyTimerWatchCredentialSubject as et, validatePlugins as f, conversationArchivedForEmail as ft, createWorkspace as g, conversationNotArchivedForEmail as gt, setBriefsConfig as h, conversationHasParticipantUser as ht, getPluginApiRoutes as i, getDashboardTaskLink as it, tryWorkspaceRepoCheckoutPath as j, listConversationAnnotationsById as jt, deleteWorkspaceSnapshotBuilders as k, createPluginAnnotations as kt, getPluginUserPromptContributions as l, createPluginLogger as lt, registration_exports as m, conversationHasParticipantEmail as mt, applyPluginFormatMarkdown as n, getDashboardConversationLink as nt, getPluginSlackConversationLink as o, createPluginState as ot, coreTaskRegistrations as p, conversationArchivedForUser as pt, takeDueTimerWatches as q, JUNIOR_NATIVE_EVENT_NAMESPACE as qt, createPluginHookRunner as r, getDashboardObjectIconLink as rt, getPluginSystemPromptContributions as s, createPluginEmbedder as st, agent_hooks_exports as t, JUNIOR_THREAD_STATE_TTL_MS as tt, getPlugins as u, readConversationAccessFromSql as ut, getWorkspace as v, viewerConversationMembership as vt, invalidateReadySnapshot as w, matchSlackAttachments as wt, listWorkspacesByRepository as x, readConversationEventPage as xt, getWorkspaceByName as y, createPluginConversationEvents as yt, cancelSubscriptions as z, getSlackClient as zt };
4336
+ export { verifyEventAutomationCredentialSubject as $, getWorkspaceSnapshotBuilder as A, saveObjectAnnotations as At, STOP_WATCHING_TOOL_NAME as B, getHeaderString as Bt, WorkspaceValidationError as C, readConversationEventPage as Ct, setWorkspaceSnapshotBuild as D, readAttachmentVisionSummary as Dt, setWorkspaceSnapshot as E, matchSlackAttachments as Et, isSlackMessageTurn as F, resolveUserTimezone as Ft, createWatch as G, runWithSlackInstallationToken as Gt, cancelWatch as H, isConversationScopedChannel as Ht, slackMessageTurnDisabledReason as I, lookupSlackUser as It, listWatches as J, runWithWorkspaceTeamId as Jt, deliverWatch as K, withSlackRetries as Kt, RESOURCE_SUBSCRIPTION_DEFAULT_TTL_MS as L, SlackActionError as Lt, workspaceRepoCheckoutPath as M, listConversationAnnotations as Mt, resolveChannelCapabilities as N, listConversationAnnotationsById as Nt, SANDBOX_RUNTIME as O, recordSlackAttachment as Ot, getSlackToolContext as P, defaultTimezone as Pt, bindSlackDirectCredentialSubject as Q, authenticationUnlinkedEvent as Qt, RESOURCE_SUBSCRIPTION_MAX_TTL_MS as R, downloadPrivateSlackFile as Rt, updateWorkspace as S, readLatestConversationBrief as St, loadSnapshotsForProfile as T, getSlackFileId as Tt, collectEventMatchKeys as U, isDmChannel as Ut, cancelSubscriptions as V, getSlackClient as Vt, createTimerWatch as W, normalizeSlackConversationId as Wt, bindEventAutomationCredentialSubject as X, agentsInstructionsUpdatedEvent as Xt, takeDueTimerWatches as Y, JUNIOR_NATIVE_EVENT_NAMESPACE as Yt, bindScheduledAutomationCredentialSubject as Z, authenticationLinkedEvent as Zt, deleteWorkspace as _, conversationHasParticipantUser as _t, getPluginRoutes as a, getDashboardObjectIconLink as at, listWorkspaces as b, viewerConversationMembership as bt, getPluginTools as c, createPluginState as ct, setPlugins as d, createPluginLogger as dt, verifyScheduledAutomationCredentialSubject as et, validatePlugins as f, readConversationAccessFromSql as ft, createWorkspace as g, conversationHasParticipantEmail as gt, setBriefsConfig as h, conversationArchivedForUser as ht, getPluginApiRoutes as i, getDashboardConversationLink as it, tryWorkspaceRepoCheckoutPath as j, createPluginAnnotations as jt, deleteWorkspaceSnapshotBuilders as k, resolveRootVisibility as kt, getPluginUserPromptContributions as l, createPluginEmbedder as lt, registration_exports as m, conversationArchivedForEmail as mt, applyPluginFormatMarkdown as n, verifyTimerWatchCredentialSubject as nt, getPluginSlackConversationLink as o, getDashboardTaskLink as ot, coreTaskRegistrations as p, conversationArchiveTimes as pt, findMatchingWatches as q, getWorkspaceTeamId as qt, createPluginHookRunner as r, JUNIOR_THREAD_STATE_TTL_MS as rt, getPluginSystemPromptContributions as s, setDashboardConversationLinkOptions as st, agent_hooks_exports as t, verifySlackDirectCredentialSubject as tt, getPlugins as u, createPluginModel as ut, getWorkspace as v, conversationNotArchivedForEmail as vt, invalidateReadySnapshot as w, buildSentryConversationUrl as wt, listWorkspacesByRepository as x, createPluginConversationEvents as xt, getWorkspaceByName as y, conversationNotArchivedForUser as yt, RESOURCE_WATCH_TOOL_SOURCE as z, getFilePermalink as zt };
@@ -96,6 +96,8 @@ const juniorConversations = pgTable("junior_conversations", {
96
96
  forkedFromConversationId: text("forked_from_conversation_id").references(() => juniorConversations.conversationId, { onDelete: "set null" }),
97
97
  rootConversationId: text("root_conversation_id").references(() => juniorConversations.conversationId),
98
98
  transcriptPurgedAt: timestamptz("transcript_purged_at"),
99
+ /** Latest session stop. Automated input received before it is dropped. */
100
+ stoppedAt: timestamptz("stopped_at"),
99
101
  durationMs: integer("duration_ms").notNull().default(0),
100
102
  usage: jsonb("usage_json").$type(),
101
103
  executionDurationMs: integer("execution_duration_ms").notNull().default(0),
@@ -133,13 +135,16 @@ const AGENT_INVOCATION_MAILBOX_STATUSES = ["pending", "appended"];
133
135
  * Parent mailbox append state. Only terminal invocations have a value.
134
136
  * `replaced` means the child still had open work, so a later agent invocation
135
137
  * on the same child sends the result instead. `skipped` means a stop ended
136
- * the work, so the result is never used.
138
+ * the work, so the result is never used. `steered` means the agent invocation
139
+ * that was running read the input as a steering message, so its result covers
140
+ * this one.
137
141
  */
138
142
  const AGENT_INVOCATION_PARENT_MAILBOX_STATUSES = [
139
143
  "pending",
140
144
  "appended",
141
145
  "replaced",
142
- "skipped"
146
+ "skipped",
147
+ "steered"
143
148
  ];
144
149
  const juniorAgentBindings = pgTable("junior_agent_bindings", {
145
150
  parentConversationId: text("parent_conversation_id").notNull().references(() => juniorConversations.conversationId),
@@ -158,6 +163,7 @@ const juniorAgentInvocations = pgTable("junior_agent_invocations", {
158
163
  source: jsonb("source_json").$type().notNull(),
159
164
  destination: jsonb("destination_json").$type().notNull(),
160
165
  destinationVisibility: text("destination_visibility").$type(),
166
+ modelProfile: text("model_profile").$type(),
161
167
  reasoningLevel: text("reasoning_level").$type(),
162
168
  parentToolCallId: text("parent_tool_call_id"),
163
169
  status: text("status").$type().notNull(),