@sentry/junior 0.292.0 → 0.293.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 (65) hide show
  1. package/dist/{adapter-Cigb1MTr.js → adapter-CMJfmHso.js} +1 -1
  2. package/dist/{admin-BO9V7vnn.js → admin-uuecrKuD.js} +2 -2
  3. package/dist/{agent-runner-BuH7EHrX.js → agent-runner-DHq1pjUg.js} +272 -151
  4. package/dist/api/schema.d.ts +2 -2
  5. package/dist/api/schema.js +3 -3
  6. package/dist/api.d.ts +1 -1
  7. package/dist/api.js +42 -37
  8. package/dist/{app-C47PT68y.d.ts → app-fWzCHFIb.d.ts} +2 -2
  9. package/dist/app.d.ts +1 -1
  10. package/dist/app.js +422 -394
  11. package/dist/{assistant-reply-ZjLRGHm2.js → assistant-reply-CIApSfor.js} +1 -1
  12. package/dist/{automation-CrsYnvdV.js → automation-BE3z19VN.js} +71 -22
  13. package/dist/{background-compaction-queue-CqZBPe9g.js → background-compaction-queue-D7ncdEa6.js} +4 -4
  14. package/dist/{briefs-DZrhXJss.js → briefs-NpgMEFh1.js} +2 -2
  15. package/dist/{catalog-runtime-Cj9I0dco.js → catalog-runtime-DwbTyNRD.js} +1 -1
  16. package/dist/cli/chat.js +15 -15
  17. package/dist/cli/check.js +3 -3
  18. package/dist/cli/main.js +3 -3
  19. package/dist/cli/plugins.js +4 -4
  20. package/dist/cli/snapshot-create.js +4 -4
  21. package/dist/cli/upgrade.d.ts +1 -1
  22. package/dist/cli/upgrade.js +3 -3
  23. package/dist/{config-BerMjSVL.js → config-B4b-NXH5.js} +2 -2
  24. package/dist/{connections-BWmTOVPB.js → connections-Dz_AQg5p.js} +6 -6
  25. package/dist/{conversation-pending-messages-Cd7ShwBs.js → conversation-pending-messages-1Kad1Mif.js} +4 -1
  26. package/dist/{conversation-privacy-BMfbOUCo.js → conversation-privacy-DRsSgLGO.js} +1 -1
  27. package/dist/{credential-sync-DZDij2CU.js → credential-sync-ClCnnGVj.js} +13 -13
  28. package/dist/{db-7glZCI18.d.ts → db-BbpttyKH.d.ts} +1 -1
  29. package/dist/{db-BlfjuqzW.js → db-CoA7_Xqu.js} +3 -3
  30. package/dist/{executor-ikZvFaMD.js → executor-SWyHhit0.js} +31 -14
  31. package/dist/instrumentation.js +2 -2
  32. package/dist/{logging-CTCH5jOy.js → logging-BN5drSEZ.js} +1 -1
  33. package/dist/{message-C1ID1tKi.js → message-D4qjpW1C.js} +9 -9
  34. package/dist/nitro.d.ts +1 -1
  35. package/dist/nitro.js +2 -2
  36. package/dist/{oauth-callback-server-CStBgDU7.js → oauth-callback-server-Xi-mTLOV.js} +2 -2
  37. package/dist/{projection-DY93nCfX.js → projection-DXl4ftyL.js} +140 -50
  38. package/dist/{prompt-exicBZeb.js → prompt-Dmx6IfWZ.js} +3 -3
  39. package/dist/{registry-X_xdFY9L.js → registry-DosVt9f9.js} +1 -1
  40. package/dist/{resolve-B9dYN-nS.js → resolve-BDjWJC9s.js} +3 -3
  41. package/dist/{result-CC8bV8Fl.js → result-CaAFpf4B.js} +8 -8
  42. package/dist/{runner-D44qp4rc.js → runner-h96Mkss6.js} +7 -7
  43. package/dist/{sandbox-egress-signals-BrH6DWkt.js → sandbox-egress-signals-rK91BW7i.js} +1 -1
  44. package/dist/{schema-CC2RxDAV.d.ts → schema-CHsBmXIj.d.ts} +246 -45
  45. package/dist/{schema-CVV5r-qP.js → schema-C_v8wb80.js} +2 -2
  46. package/dist/{service-account-89JZHWCE.js → service-account-BpGpScaT.js} +3 -3
  47. package/dist/{service-account-DoNZuJb-.js → service-account-WUMVuqVL.js} +3 -3
  48. package/dist/{session-stop-DNucbmPf.js → session-stop-xYK15HUu.js} +20 -41
  49. package/dist/{skills-BeUfmYXL.js → skills-DHApyCjj.js} +10 -9
  50. package/dist/{spawn-CIAcfcvZ.js → spawn-BQQrwGNe.js} +5 -5
  51. package/dist/{stop-Ckd3735h.js → stop-CBeD6_Gs.js} +32 -26
  52. package/dist/{store-CS0xoqXW.js → store-xtibD98L.js} +3 -3
  53. package/dist/{task-runner-DjjHCX_m.js → task-runner-BYPN4BEO.js} +65 -90
  54. package/dist/{turn-failure-response-D0bwI462.js → turn-failure-response-jNVl00MD.js} +7 -7
  55. package/dist/{validation-Cvx_AupF.js → validation-DGeB_moV.js} +1 -1
  56. package/dist/{version-BrDx4Fzc.js → version-C6nqU3Qc.js} +1 -1
  57. package/dist/version.js +1 -1
  58. package/dist/{viewer-4CxdwLLQ.js → viewer-9KLQibjn.js} +3 -3
  59. package/dist/{warmup-B62hd4lD.js → warmup-7S6z068f.js} +56 -24
  60. package/dist/{work-Cu315oJl.js → work-xwX6unUE.js} +11 -11
  61. package/dist/{worker-4ClZu6ry.js → worker-CiCCfwd4.js} +6 -6
  62. package/migrations/0096_automation_task_kind.sql +75 -0
  63. package/migrations/meta/0096_snapshot.json +4490 -0
  64. package/migrations/meta/_journal.json +7 -0
  65. package/package.json +5 -5
@@ -1,13 +1,13 @@
1
1
  import { v as __exportAll } from "./sentry-BRTJqumy.js";
2
- import { $a as readConversationAccessFromSql, Cn as renderUntrustedTag, Xa as canAccessConversation } from "./projection-DY93nCfX.js";
3
- import { n as botConfig } from "./config-BerMjSVL.js";
4
- import { T as SYSTEM_IDENTITY_ID, a as getConversationStore, o as getDb } from "./db-BlfjuqzW.js";
5
- import { fn as actorFromRun, in as AgentMessageTargetError, nn as AgentMessagePausedError, pn as toolInvocationDestination } from "./agent-runner-BuH7EHrX.js";
6
- import { I as PARENT_AGENT_TARGET, v as getActiveAgentInvocationForConversation } from "./turn-failure-response-D0bwI462.js";
7
- import { G as admitAutomatedTurn, S as EVENT_WAIT_MS, V as postAutomatedTurnLimitNoticeForConversation } from "./session-stop-DNucbmPf.js";
8
- import { r as appendAndEnqueueInboundMessage } from "./store-CS0xoqXW.js";
9
- import { a as enqueueAgentInvocation, c as createAgentInvocationForMessage, u as findChildAgentConversationId } from "./work-Cu315oJl.js";
10
- import { r as enqueueAgentMessageToParent } from "./result-CC8bV8Fl.js";
2
+ import { Dn as renderUntrustedTag, io as readConversationAccessFromSql, to as canAccessConversation } from "./projection-DXl4ftyL.js";
3
+ import { n as botConfig } from "./config-B4b-NXH5.js";
4
+ import { T as SYSTEM_IDENTITY_ID, a as getConversationStore, o as getDb } from "./db-CoA7_Xqu.js";
5
+ import { hn as toolInvocationDestination, in as AgentMessageTargetError, mn as actorFromRun, nn as AgentMessagePausedError } from "./agent-runner-DHq1pjUg.js";
6
+ import { I as PARENT_AGENT_TARGET, v as getActiveAgentInvocationForConversation } from "./turn-failure-response-jNVl00MD.js";
7
+ import { G as admitAutomatedTurn, S as EVENT_WAIT_MS, V as postAutomatedTurnLimitNoticeForConversation } from "./session-stop-xYK15HUu.js";
8
+ import { r as appendAndEnqueueInboundMessage } from "./store-xtibD98L.js";
9
+ import { a as enqueueAgentInvocation, c as createAgentInvocationForMessage, u as findChildAgentConversationId } from "./work-xwX6unUE.js";
10
+ import { r as enqueueAgentMessageToParent } from "./result-CaAFpf4B.js";
11
11
  // src/chat/agent-invocations/top-level-message.ts
12
12
  const AGENT_MESSAGE_EVENT_NAMESPACE = "junior";
13
13
  /** Event type of a message from another top-level agent. */
package/dist/nitro.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { i as JuniorDashboardOptions } from "./app-C47PT68y.js";
1
+ import { i as JuniorDashboardOptions } from "./app-fWzCHFIb.js";
2
2
  import { n as JuniorPluginSet } from "./plugins-DtmjkTza.js";
3
3
  import { withSentryConfig as withSentryConfig$1 } from "@sentry/nitro";
4
4
  type SentryNitroConfig = Parameters<typeof withSentryConfig$1>[0];
package/dist/nitro.js CHANGED
@@ -1,6 +1,6 @@
1
- import { A as JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE, D as JUNIOR_AUTO_ARCHIVE_CRON_SCHEDULE, F as JUNIOR_RETENTION_CRON_SCHEDULE, I as JUNIOR_RETENTION_ROUTE, L as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, M as JUNIOR_HEARTBEAT_CRON_SCHEDULE, N as JUNIOR_HEARTBEAT_ROUTE, O as JUNIOR_AUTO_ARCHIVE_ROUTE, P as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, j as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, k as JUNIOR_CACHE_WARMUP_CALLBACK_ROUTE, z as getDeploymentServiceVersion } from "./logging-CTCH5jOy.js";
1
+ import { A as JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE, D as JUNIOR_AUTO_ARCHIVE_CRON_SCHEDULE, F as JUNIOR_RETENTION_CRON_SCHEDULE, I as JUNIOR_RETENTION_ROUTE, L as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, M as JUNIOR_HEARTBEAT_CRON_SCHEDULE, N as JUNIOR_HEARTBEAT_ROUTE, O as JUNIOR_AUTO_ARCHIVE_ROUTE, P as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, j as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, k as JUNIOR_CACHE_WARMUP_CALLBACK_ROUTE, z as getDeploymentServiceVersion } from "./logging-BN5drSEZ.js";
2
2
  import { d as resolvePackageDir, t as discoverInstalledPluginPackageContent, u as isValidPackageName } from "./package-discovery-DJhGdS4c.js";
3
- import { S as CACHE_WARMUP_QUEUE_TOPIC, _ as resolveConversationWorkQueueTopic, a as PLUGIN_TASK_QUEUE_TOPIC, f as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC, t as BACKGROUND_COMPACTION_QUEUE_TOPIC } from "./background-compaction-queue-CqZBPe9g.js";
3
+ import { S as CACHE_WARMUP_QUEUE_TOPIC, _ as resolveConversationWorkQueueTopic, a as PLUGIN_TASK_QUEUE_TOPIC, f as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC, t as BACKGROUND_COMPACTION_QUEUE_TOPIC } from "./background-compaction-queue-D7ncdEa6.js";
4
4
  import { a as pluginRuntimeRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "./plugins-HYh_JOdw.js";
5
5
  import { n as loadPluginSetFromModule, r as resolvePluginModule } from "./plugin-module-Cf5gVPWP.js";
6
6
  import path from "node:path";
@@ -1,5 +1,5 @@
1
- import { En as createUserTokenStore } from "./projection-DY93nCfX.js";
2
- import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-DZDij2CU.js";
1
+ import { An as createUserTokenStore } from "./projection-DXl4ftyL.js";
2
+ import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-ClCnnGVj.js";
3
3
  import { createServer } from "node:http";
4
4
  // src/chat/local/oauth-callback-server.ts
5
5
  const LOCAL_OAUTH_TIMEOUT_MS = 6e5;
@@ -1,17 +1,17 @@
1
1
  import { a as getClient$1, h as startSpan, n as captureMessage, r as continueTrace, v as __exportAll } from "./sentry-BRTJqumy.js";
2
- import { A as estimateTextTokens, E as resolveGatewayModel, I as unwrapCurrentInstruction, J as toOptionalTrimmed, L as escapeXml, S as completeObject, T as rerankTexts, i as getChatConfig, n as botConfig, o as getSlackBotToken, v as normalizeSlackEmojiName, w as embedTexts, x as completeDecision, y as GEN_AI_PROVIDER_NAME } from "./config-BerMjSVL.js";
3
- import { E as withSpan, G as isRecord$2, K as toOptionalNumber, _ 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, q as toOptionalString, t as buildTurnFailureResponse, x as setSpanStatus, y as setSentryUser } from "./logging-CTCH5jOy.js";
4
- import { t as canExposeConversationPayload } from "./conversation-privacy-BMfbOUCo.js";
2
+ import { A as estimateTextTokens, E as resolveGatewayModel, I as unwrapCurrentInstruction, J as toOptionalTrimmed, L as escapeXml, S as completeObject, T as rerankTexts, i as getChatConfig, n as botConfig, o as getSlackBotToken, v as normalizeSlackEmojiName, w as embedTexts, x as completeDecision, y as GEN_AI_PROVIDER_NAME } from "./config-B4b-NXH5.js";
3
+ import { E as withSpan, G as isRecord$2, K as toOptionalNumber, _ 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, q as toOptionalString, t as buildTurnFailureResponse, x as setSpanStatus, y as setSentryUser } from "./logging-BN5drSEZ.js";
4
+ import { t as canExposeConversationPayload } from "./conversation-privacy-DRsSgLGO.js";
5
5
  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";
6
- import { $ as sameDestination, B as addAgentTurnUsage, D as resolveActorIdentityId, I as bindProviderConversation, M as readUserTimezone, P as saveUserTimezone, W as hasAgentTurnUsage, Z as parseDestination, a as getConversationStore, d as createSqlConversationEventStore, f as eventFromRow, o as getDb, p as withConversationEventLock, q as conversationDetailTouch, r as getConversationEventStore, s as getSqlExecutor, w as startLocationThread, y as createSqlStore } from "./db-BlfjuqzW.js";
7
- import { A as juniorConversations, D as juniorCodeChanges, E as juniorConversationAnnotations, M as juniorUsers, N as juniorDestinations, O as juniorCodeRepositories, a as juniorPushSubscriptions, b as juniorConversationBriefs, f as juniorAutomations, i as juniorWorkspaces, j as juniorIdentities, k as juniorAttachments, l as juniorReviewItems, m as juniorLocationConfigurations, n as juniorSnapshots, o as juniorReviewItemAssignees, r as juniorWorkspaceRepos, s as juniorReviewItemConversations, v as juniorConversationParticipants, w as juniorConversationEvents } from "./executor-ikZvFaMD.js";
6
+ import { $ as sameDestination, B as addAgentTurnUsage, D as resolveActorIdentityId, I as bindProviderConversation, M as readUserTimezone, P as saveUserTimezone, W as hasAgentTurnUsage, Z as parseDestination, a as getConversationStore, d as createSqlConversationEventStore, f as eventFromRow, o as getDb, p as withConversationEventLock, q as conversationDetailTouch, r as getConversationEventStore, s as getSqlExecutor, w as startLocationThread, y as createSqlStore } from "./db-CoA7_Xqu.js";
7
+ import { A as juniorConversations, D as juniorCodeChanges, E as juniorConversationAnnotations, M as juniorUsers, N as juniorDestinations, O as juniorCodeRepositories, a as juniorPushSubscriptions, b as juniorConversationBriefs, f as juniorAutomations, i as juniorWorkspaces, j as juniorIdentities, k as juniorAttachments, l as juniorReviewItems, m as juniorLocationConfigurations, n as juniorSnapshots, o as juniorReviewItemAssignees, r as juniorWorkspaceRepos, s as juniorReviewItemConversations, v as juniorConversationParticipants, w as juniorConversationEvents } from "./executor-SWyHhit0.js";
8
8
  import { _ as instructionProvenanceFor, g as instructionActors, h as contextProvenance, o as agentHistoryItemSchema } from "./media-BepyEUNm.js";
9
- import { _ as CredentialUnavailableError, a as resolveAuthTokenPlaceholder, f as credentialContextForActor, h as credentialSubjectSchema, m as credentialLogContext, o as resolvePluginCommandEnv, p as credentialContextSchema } from "./registry-X_xdFY9L.js";
10
- import { n as pluginCatalogRuntime } from "./catalog-runtime-Cj9I0dco.js";
11
- import { d as JUNIOR_NATIVE_EVENT_NAMESPACE, f as agentsInstructionsUpdatedEvent, g as renderJuniorNativeConversationEvent, l as completeObject$1, m as authenticationUnlinkedEvent, n as briefEntriesFromReportEvents, o as isEventConversationMessage, p as authenticationLinkedEvent, s as generateBrief, t as BRIEF_PROMPT, u as completeText } from "./prompt-exicBZeb.js";
9
+ import { _ as CredentialUnavailableError, a as resolveAuthTokenPlaceholder, f as credentialContextForActor, h as credentialSubjectSchema, m as credentialLogContext, o as resolvePluginCommandEnv, p as credentialContextSchema } from "./registry-DosVt9f9.js";
10
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-DwbTyNRD.js";
11
+ import { d as JUNIOR_NATIVE_EVENT_NAMESPACE, f as agentsInstructionsUpdatedEvent, g as renderJuniorNativeConversationEvent, l as completeObject$1, m as authenticationUnlinkedEvent, n as briefEntriesFromReportEvents, o as isEventConversationMessage, p as authenticationLinkedEvent, s as generateBrief, t as BRIEF_PROMPT, u as completeText } from "./prompt-Dmx6IfWZ.js";
12
12
  import { a as withLock, i as fenceLock, n as MUTATION_LOCK_TTL_MS, r as acquireActiveLock } from "./locks-D-0h111u.js";
13
- import { g as createCache, i as readActorIdentity, l as resolveViewerUser, n as findUserByEmailFromSql, o as readIdentityById, p as parseAvatarUrl, s as readIdentityByIdFromSql } from "./viewer-4CxdwLLQ.js";
14
- import { a as setStateValues, i as getStateValues, n as getDefaultRedisStateAdapterFor, r as getStateAdapter } from "./adapter-Cigb1MTr.js";
13
+ import { g as createCache, i as readActorIdentity, l as resolveViewerUser, n as findUserByEmailFromSql, o as readIdentityById, p as parseAvatarUrl, s as readIdentityByIdFromSql } from "./viewer-9KLQibjn.js";
14
+ import { a as setStateValues, i as getStateValues, n as getDefaultRedisStateAdapterFor, r as getStateAdapter } from "./adapter-CMJfmHso.js";
15
15
  import { n as isWithinNotificationSchedule, r as notificationScheduleSchema, s as isValidTimeZone, t as DEFAULT_NOTIFICATION_SCHEDULE } from "./schedule-cP0AACm1.js";
16
16
  import { I as messageCardRef, J as briefResourceLabel, P as reviewItemChangeRecordSchema, R as readMessageCardRefs, W as readMessageAttachments, X as parseBriefInput, Y as conversationBriefSchema, Z as parseStoredBrief, _ as conversationReportEventSchema, v as conversationReportMessageEventSchema } from "./conversation-CtjR1Zcx.js";
17
17
  import { n as redactSandboxEgressProxyPath, t as SANDBOX_EGRESS_PROXY_PATH } from "./proxy-path-BHYoKZdq.js";
@@ -9359,6 +9359,7 @@ function coreTaskRegistrations() {
9359
9359
  // src/chat/plugins/agent-hooks.ts
9360
9360
  var agent_hooks_exports = /* @__PURE__ */ __exportAll({
9361
9361
  applyPluginFormatMarkdown: () => applyPluginFormatMarkdown,
9362
+ createPluginEventPublisher: () => createPluginEventPublisher,
9362
9363
  createPluginHookRunner: () => createPluginHookRunner,
9363
9364
  getPluginApiRoutes: () => getPluginApiRoutes,
9364
9365
  getPluginOperationalReports: () => getPluginOperationalReports,
@@ -9885,6 +9886,47 @@ function requirePublishedEvent(plugin, eventType) {
9885
9886
  if (!registration || registration.isEnabled?.() === false) throw new Error(`Plugin "${plugin.manifest.name}" cannot publish events without an active registration`);
9886
9887
  if (!registration.resourceTypes.some((resourceType) => resourceType.supportedEvents.includes(eventType))) throw new Error(`Plugin "${plugin.manifest.name}" did not register event "${eventType}"`);
9887
9888
  }
9889
+ /**
9890
+ * Bind the core event publisher to one plugin. Events get the plugin's
9891
+ * namespace, and the plugin can publish only the event types it registered.
9892
+ */
9893
+ function createPluginEventPublisher(plugin, appEvents) {
9894
+ const pluginName = plugin.manifest.name;
9895
+ return {
9896
+ async hasMatch(events) {
9897
+ if (!appEvents.hasMatch) return false;
9898
+ return await appEvents.hasMatch(events.map((event) => {
9899
+ const parsed = eventInputSchema.parse(event);
9900
+ requirePublishedEvent(plugin, parsed.eventType);
9901
+ return {
9902
+ ...parsed,
9903
+ identifier: normalizeEventIdentifier(plugin.events, parsed.identifier),
9904
+ namespace: pluginName
9905
+ };
9906
+ }));
9907
+ },
9908
+ async neededMatchKeys(input) {
9909
+ if (!appEvents.neededMatchKeys) return [];
9910
+ const identifiers = [...new Set(input.identifiers.map((identifier) => normalizeEventIdentifier(plugin.events, identifier)).filter(Boolean))];
9911
+ if (identifiers.length === 0 || input.eventTypes.length === 0) return [];
9912
+ return await appEvents.neededMatchKeys({
9913
+ ...input.data ? { data: eventDataSchema.parse(input.data) } : void 0,
9914
+ eventTypes: input.eventTypes,
9915
+ identifiers,
9916
+ namespace: pluginName
9917
+ });
9918
+ },
9919
+ async publish(event) {
9920
+ const parsed = eventInputSchema.parse(event);
9921
+ requirePublishedEvent(plugin, parsed.eventType);
9922
+ await appEvents.publish({
9923
+ ...parsed,
9924
+ identifier: normalizeEventIdentifier(plugin.events, parsed.identifier),
9925
+ namespace: pluginName
9926
+ });
9927
+ }
9928
+ };
9929
+ }
9888
9930
  /** Collect route handlers exposed by plugins for app-level mounting. */
9889
9931
  function getPluginRoutes(options) {
9890
9932
  const routes = [];
@@ -9902,46 +9944,14 @@ function getPluginRoutes(options) {
9902
9944
  plugin: pluginName
9903
9945
  }) },
9904
9946
  codeChanges: createCodeChangePublisher(pluginName),
9947
+ state: createPluginState(pluginName),
9905
9948
  reviewItems: { forConversation: (conversationId) => createPluginReviewItems({
9906
9949
  conversationId,
9907
9950
  plugin: pluginName,
9908
9951
  show: options.showReviewItem ?? (async () => {})
9909
9952
  }) },
9910
9953
  users: { readIdentity: readIdentityById },
9911
- events: {
9912
- async hasMatch(events) {
9913
- if (!options.events.hasMatch) return false;
9914
- return await options.events.hasMatch(events.map((event) => {
9915
- const parsed = eventInputSchema.parse(event);
9916
- requirePublishedEvent(plugin, parsed.eventType);
9917
- return {
9918
- ...parsed,
9919
- identifier: normalizeEventIdentifier(plugin.events, parsed.identifier),
9920
- namespace: pluginName
9921
- };
9922
- }));
9923
- },
9924
- async neededMatchKeys(input) {
9925
- if (!options.events.neededMatchKeys) return [];
9926
- const identifiers = [...new Set(input.identifiers.map((identifier) => normalizeEventIdentifier(plugin.events, identifier)).filter(Boolean))];
9927
- if (identifiers.length === 0 || input.eventTypes.length === 0) return [];
9928
- return await options.events.neededMatchKeys({
9929
- ...input.data ? { data: eventDataSchema.parse(input.data) } : void 0,
9930
- eventTypes: input.eventTypes,
9931
- identifiers,
9932
- namespace: pluginName
9933
- });
9934
- },
9935
- async publish(event) {
9936
- const parsed = eventInputSchema.parse(event);
9937
- requirePublishedEvent(plugin, parsed.eventType);
9938
- await options.events.publish({
9939
- ...parsed,
9940
- identifier: normalizeEventIdentifier(plugin.events, parsed.identifier),
9941
- namespace: pluginName
9942
- });
9943
- }
9944
- }
9954
+ events: createPluginEventPublisher(plugin, options.events)
9945
9955
  });
9946
9956
  if (!Array.isArray(pluginRoutes)) throw new Error(`Plugin routes hook from plugin "${pluginName}" must return an array`);
9947
9957
  for (const route of pluginRoutes) {
@@ -11692,6 +11702,89 @@ function buildTurnLimitResponse(eventId) {
11692
11702
  function buildTurnErrorResponse(error, eventId) {
11693
11703
  return isTurnExecutionLimitExceededError(error) ? buildTurnLimitResponse(eventId) : buildTurnFailureResponse(eventId);
11694
11704
  }
11705
+ // src/chat/conversations/kind-behavior.ts
11706
+ const ROOT = {
11707
+ delivery: "location",
11708
+ promptMode: "conversation",
11709
+ gated: false,
11710
+ tools: {
11711
+ agents: "children",
11712
+ reviewDesk: true,
11713
+ subscriptions: true,
11714
+ userCustomization: true,
11715
+ reportBlocked: false,
11716
+ noReply: true,
11717
+ finishAutomationRun: false
11718
+ }
11719
+ };
11720
+ const PERSON_IN_THREAD = {
11721
+ ...ROOT,
11722
+ tools: {
11723
+ ...ROOT.tools,
11724
+ agents: "none"
11725
+ }
11726
+ };
11727
+ const AGENT_IN_CHILD = {
11728
+ delivery: "conversation",
11729
+ promptMode: "child_agent",
11730
+ gated: false,
11731
+ tools: {
11732
+ agents: "children_and_parent",
11733
+ reviewDesk: false,
11734
+ subscriptions: false,
11735
+ userCustomization: false,
11736
+ reportBlocked: true,
11737
+ noReply: true,
11738
+ finishAutomationRun: false
11739
+ }
11740
+ };
11741
+ const AUTOMATION_RUN = {
11742
+ delivery: "conversation",
11743
+ promptMode: "automation",
11744
+ gated: true,
11745
+ tools: {
11746
+ ...ROOT.tools,
11747
+ noReply: false,
11748
+ finishAutomationRun: true
11749
+ }
11750
+ };
11751
+ /**
11752
+ * Return the behavior of one Turn. `automationRun` marks a Scheduled or Event
11753
+ * automation run. It is a temporary bridge until Conversation kind
11754
+ * `automation` replaces it.
11755
+ *
11756
+ * TODO(dcramer): Remove `automationRun` when kind `automation` ships.
11757
+ */
11758
+ function turnBehavior(args) {
11759
+ if (args.automationRun) return AUTOMATION_RUN;
11760
+ if (args.kind === "root") return ROOT;
11761
+ if (!args.personInput) return AGENT_IN_CHILD;
11762
+ if (args.kind === "thread") return PERSON_IN_THREAD;
11763
+ throw new Error("A task Conversation cannot have a person's input");
11764
+ }
11765
+ /** Return whether a person sent input from this Source. */
11766
+ function isPersonInput(source) {
11767
+ return source === "web" || source === "slack";
11768
+ }
11769
+ /**
11770
+ * Return whether the runtime delivers the final response of a Slack or
11771
+ * dispatch run. Only root Conversations reach these paths, so only an
11772
+ * Automation run keeps its final response in the Conversation. A dispatch
11773
+ * with no outcomes delivers nothing.
11774
+ */
11775
+ function deliversFinalText(dispatch) {
11776
+ return dispatch?.outcomes?.length !== 0 && !dispatch?.declaresResult;
11777
+ }
11778
+ /**
11779
+ * Return whether the runtime may post a failure reply or a status notice,
11780
+ * such as an auth prompt, for a run outside `finishedRunReply`. The rule is
11781
+ * the same as for a final response. A chat Turn may post, also in a thread
11782
+ * that an Automation Conversation owns. An Automation run posts only a
11783
+ * declared message; its failed execution shows on the Automation.
11784
+ */
11785
+ function postsRunNotices(dispatch) {
11786
+ return deliversFinalText(dispatch);
11787
+ }
11695
11788
  // src/chat/task-execution/state.ts
11696
11789
  /**
11697
11790
  * Expiring conversation mailbox and execution index store.
@@ -12610,9 +12703,6 @@ async function ackMessages(args) {
12610
12703
  return true;
12611
12704
  });
12612
12705
  }
12613
- function isHumanFacingMessage(message) {
12614
- return message.source === "web" || message.source === "slack";
12615
- }
12616
12706
  async function readConversationStop(state, conversationId) {
12617
12707
  return normalizeStop(await state.get(conversationStopKey(conversationId)));
12618
12708
  }
@@ -12630,7 +12720,7 @@ async function stopConversationWork(args) {
12630
12720
  const current = await readConversation(state, args.conversationId);
12631
12721
  if (!current || !hasRunnableWork(current)) return { status: "no_work" };
12632
12722
  const runId = current.execution.runId ?? randomUUID();
12633
- const pendingMessages = current.execution.pendingMessages.filter((message) => isHumanFacingMessage(message) && (args.sentAtOrBeforeMs === void 0 || message.createdAtMs <= args.sentAtOrBeforeMs));
12723
+ const pendingMessages = current.execution.pendingMessages.filter((message) => isPersonInput(message.source) && (args.sentAtOrBeforeMs === void 0 || message.createdAtMs <= args.sentAtOrBeforeMs));
12634
12724
  const inboundMessageIds = pendingMessages.map((message) => message.inboundMessageId);
12635
12725
  if (current.execution.runId === void 0) await writeConversation(state, lock, withExecutionUpdate(current, {
12636
12726
  ...current.execution,
@@ -12698,7 +12788,7 @@ async function cancelHumanFacingPendingMessages(args) {
12698
12788
  for (const message of current.execution.pendingMessages) {
12699
12789
  const isRequested = requestedIds === void 0 || requestedIds.has(message.inboundMessageId);
12700
12790
  const isInSnapshot = args.receivedBeforeMs === void 0 || message.receivedAtMs <= args.receivedBeforeMs;
12701
- if (isHumanFacingMessage(message) && isRequested && isInSnapshot) {
12791
+ if (isPersonInput(message.source) && isRequested && isInSnapshot) {
12702
12792
  cancelledInboundMessageIds.push(message.inboundMessageId);
12703
12793
  cancelledMessages.push(message);
12704
12794
  continue;
@@ -15135,4 +15225,4 @@ async function recordGuardianActionReviewed(args) {
15135
15225
  createdAtMs: Date.now()
15136
15226
  }]);
15137
15227
  }
15138
- export { loadTurnCheckpoint as $, readConversationAccessFromSql as $a, slackEntitySchema as $i, isPausedBySlack as $n, verifySlackDirectCredentialSubject as $r, extractAssistantText as $t, latestConversationMessageSeq as A, SANDBOX_RUNTIME as Aa, proxyVercelSandboxEgressRequest as Ai, resolvePluginOAuthAccount as An, lookupSlackUserNames as Ao, resolveAssignee as Ar, isInvalidConversationRecordError as At, getAgentContextInputLimitTokens as B, SANDBOX_SKILLS_ROOT as Ba, slackMention as Bi, setPlugins as Bn, collectEventMatchKeys as Br, requestConversationWork as Bt, settleConversationTitleWork as C, consumeSandboxEgressPermissionDeniedSignal as Ca, setWorkspaceSnapshotBuild as Ci, renderUntrustedTag as Cn, saveObjectAnnotations as Co, reviewItemNeedsSomeone as Cr, deadLetterAttempt as Ct, estimateConversationMessagesTokens as D, buildSandboxEgressNetworkPolicy as Da, ensureDockerDaemon as Di, findLegacyWebActorUserId as Dn, defaultTimezone as Do, EVERYONE_ASSIGNEE as Dr, hasConversationStop as Dt, buildConversationContext as E, sandboxEgressSignalsResponseSchema as Ea, isStale as Ei, createUserTokenStore as En, listConversationAnnotationsById as Eo, reviewItemReaderForUserInConversation as Er, getConversationWorkState as Et, turnHasReply as F, createPluginEmbedder as Fa, startOAuthFlow as Fi, getPluginSlackConversationLink as Fn, piMessageFromHistoryItem as Fo, RESOURCE_SUBSCRIPTION_MAX_TTL_MS as Fr, recordAttemptFailure as Ft, AuthPausePersistenceError as G, buildCommandScript as Ga, openSlackDirectMessage as Gi, readWebPushConfig as Gn, getWatch as Gr, TurnBudgetExceededError as Gt, PluginCredentialFailureError as H, sandboxSkillDir as Ha, addReactionToMessage as Hi, coreTaskRegistrations as Hn, createWatch as Hr, steerWebPendingMessages as Ht, upsertConversationMessage as I, createPluginModel as Ia, escapeSlackMrkdwnText as Ii, getPluginSystemPromptContributions as In, projectConversationEvents$1 as Io, RESOURCE_WATCH_TOOL_SOURCE as Ir, recordConversationRetry as It, abandonReplacedPendingAuth as J, createPluginModelCostRecorder as Ja, postSlackMessage as Ji, deletePushSubscription as Jn, bindEventAutomationCredentialSubject as Jr, buildTurnErrorResponse as Jt, AuthorizationFlowDisabledError as K, buildNonInteractiveShellScript as Ka, openSlackModal as Ki, sendPushNotificationToUser as Kn, listWatches as Kr, TurnSliceLimitExceededError as Kt, calculateContextCompactionTargetTokens as L, SANDBOX_COMMAND_PATH as La, formatSlackLink as Li, getPluginTools as Ln, getConfigDefaults as Lo, STOP_WATCHING_TOOL_NAME as Lr, releaseConversationWork as Lt, normalizeConversationText as M, tryWorkspaceRepoCheckoutPath as Ma, formatProviderLabel as Mi, createPluginHookRunner as Mn, createDurableLocationConfigurationService as Mo, resolveChannelCapabilities as Mr, markConversationWorkEnqueued as Mt, recordDeliveredAssistantMessage as N, workspaceRepoCheckoutPath as Na, parseOAuthStatePayload as Ni, getPluginApiRoutes as Nn, configValueSchema as No, getSlackToolContext as Nr, moveIdleConversationDestination as Nt, getConversationMessageSlackTs as O, resolveSandboxCommandEnvironment as Oa, getSandboxProvider as Oi, webActorUserIds as On, resolveUserTimezone as Oo, activeParticipantUserIds as Or, hasRunnableConversationWork as Ot, trimConversationMessages as P, PluginToolDeniedError as Pa, resolveBaseUrl as Pi, getPluginRoutes as Pn, historyItemFromPiMessage as Po, RESOURCE_SUBSCRIPTION_DEFAULT_TTL_MS as Pr, pruneActiveConversation as Pt, continuableMessages as Q, createConversationAccessReader as Qa, uploadFilesToConversation as Qi, savePushSubscription as Qn, verifyScheduledAutomationCredentialSubject as Qr, persistWithRetry as Qt, getAgentBackgroundCompactionMarkTokens as R, SANDBOX_DATA_ROOT as Ra, normalizeSlackReplyMarkdown as Ri, getPluginUserPromptContributions as Rn, setConfigDefaults as Ro, cancelSubscriptions as Rr, releaseInboundMessage as Rt, resolveConversationTitle as S, consumeSandboxEgressAuthRequiredSignal as Sa, setWorkspaceSnapshot as Si, renderTag as Sn, resolveRootVisibility as So, requireReviewItemLinks as Sr, countPendingConversationMessages as St, resolveTaskTitle as T, parseSandboxEgressCredentialToken as Ta, hash as Ti, SANDBOX_EGRESS_AUTH_REQUIRED_MARKER as Tn, listConversationAnnotations as To, reviewItemReaderForUser as Tr, getConversation as Tt, createPluginAuthOrchestration as U, sandboxSkillFile as Ua, deleteSlackMessage as Ui, registration_exports as Un, deliverWatch as Ur, stopConversationWork as Ut, createPluginEgress as V, SANDBOX_WORKSPACE_ROOT as Va, truncateStatusText as Vi, validatePlugins as Vn, createTimerWatch as Vr, startConversationWork as Vt, authorizationId as W, sandboxSkillPathResolution as Wa, getSlackMessagePermalink as Wi, setBriefsConfig as Wn, findMatchingWatches as Wr, TURN_LIMIT_WRAP_UP_MESSAGE as Wt, clearPendingAuth as X, canAccessConversation as Xa, unfurlSlackLinks as Xi, readNotificationSchedule as Xn, bindSlackDirectCredentialSubject as Xr, isTurnExecutionLimitExceededError as Xt, canReusePendingAuthLink as Y, createPluginLogger as Ya, removeReactionFromMessage as Yi, listPushSubscriptions as Yn, bindScheduledAutomationCredentialSubject as Yr, createTurnLimitGate as Yt, getConversationPendingAuth as Z, canAddConversationMessages as Za, updateSlackMessage as Zi, saveNotificationSchedule as Zn, verifyEventAutomationCredentialSubject as Zr, CODEMODE_TOOL_NAME as Zt, appendConversationMessages as _, WorkspaceSnapshotNotReadyError as _a, listWorkspacesByRepository as _i, TURN_CONTEXT_TAG as _n, getSlackFileId as _o, canReadReviewItem as _r, claimInboundMessage as _t, loadProjection as a, getSlackClient as aa, getDashboardSettingsLink as ai, instructionTextForProjection as an, viewerMarksFromParticipant as ao, getOpenReviewItemByDedupeKey as ar, failTurnRecord as at, persistConversationMessages as b, workspaceSnapshotNotReadyUserMessage as ba, invalidateReadySnapshot as bi, readParentAgentTask as bn, recordSlackAttachment as bo, readReviewItemAgentScope as br, completeConversationStop as bt, recordAgentsInstructionsUpdated as c, normalizeSlackConversationId as ca, setDashboardConversationLinkOptions as ci, isStandaloneRuntimeContextMessage as cn, readLatestConversationBrief as co, listReplyActionItems as cr, recordTurnSummary as ct, recordAuthorizationCompleted as d, getWorkspaceTeamId as da, renderToolResultNudge as di, normalizeToolNameFromResult as dn, readConversationEventPageAround as do, searchReviewItems as dr, ackMessages as dt, slackExternalRefIdSchema as ea, verifyTimerWatchCredentialSubject as ei, getPiMessageRole as en, conversationHasParticipantUser as eo, projectConversationMessages as er, lostWorkerBeforeFirstSave as et, recordAuthorizationRequested as f, runWithWorkspaceTeamId as fa, createWorkspace as fi, retainRuntimeTurnContext as fn, readConversationLastEventSeq as fo, takeReviewItem as fr, appendExclusiveInboundMessage as ft, recordToolExecutionStarted as g, wrapSandboxSetupError as ga, listWorkspaces as gi, SESSION_CONTEXT_SECTION_TAG as gn, notInheritedByForkChild as go, canAgentChangeReviewItem as gr, checkInConversationWork as gt, recordSubscribedReplyRoute as h, throwSandboxOperationError as ha, getWorkspaceByName as hi, REQUEST_CONTEXT_SECTION_TAG as hn, loadForkHistory as ho, canActOnReviewItem as hr, cancelHumanFacingPendingMessages as ht, loadConversationProjection as i, getHeaderString as ia, getDashboardReviewItemLink as ii, hasTurnInput as in, conversationViewerMarks as io, dismissOpenReviewItems as ir, completeTurnRecord as it, markConversationMessage as j, sleep$2 as ja, deliverOAuthAuthorization as ji, agent_hooks_exports as jn, createPluginCache as jo, resolveAssignees as jr, listActiveConversationIds as jt, isHumanConversationMessage as k, normalizeSandboxEgressTracePropagationDomains as ka, isVercelSandboxEgressRequest as ki, getOAuthAccountProviders as kn, lookupSlackUser as ko, automationCreatorUserId as kr, isFinalAttempt as kt, recordAttachmentsDelivered as l, runWithSlackInstallationToken as la, ToolInputError as li, isToolResultError as ln, readConversationEventPage as lo, listWaitingConversations as lr, CONVERSATION_WORK_CHECK_IN_INTERVAL_MS as lt, recordMcpProviderConnected as m, isAlreadyExistsError as ma, getWorkspace as mi, trimTrailingAssistantMessages as mn, buildSentryConversationUrl as mo, PLUGIN_REVIEW_ITEM_KEY_PREFIX as mr, beginConversationResume as mt, commitMessages as n, downloadPrivateSlackFile as na, getDashboardConversationLink as ni, getUserMessageInstructionText as nn, conversationIsNotUnsubscribedRoot as no, closeReviewItem as nr, saveTurnCheckpoint as nt, loadTurnProjection as o, isConversationScopedChannel as oa, getDashboardTaskLink as oi, isAssistantMessage as on, createPluginConversationEvents as oo, getReviewItem as or, getTurnRecord as ot, recordGuardianActionReviewed as p, isAbortError as pa, deleteWorkspace as pi, stripRuntimeTurnContext as pn, readConversationMessageEventSeq as po, updateReviewItemContent as pr, appendInboundMessage as pt, AuthorizationPauseError as q, runNonInteractiveCommand as qa, postSlackEphemeralMessage as qi, resolveNotificationTimezone as qn, takeDueTimerWatches as qr, TurnToolCallLimitExceededError as qt, loadConnectedMcpProviders as r, getFilePermalink as ra, getDashboardObjectIconLink as ri, hasRuntimeTurnContext as rn, conversationPinnedForUser as ro, countReviewItemsNeedingUser as rr, abandonTurnRecord as rt, openConversationProjection as s, isDmChannel as sa, parseDashboardConversationLink as si, isContinuablePiBoundary as sn, readConversationBriefThrough as so, insertReviewItem as sr, listTurnSummaries as st, commitAcceptedReply as t, SlackActionError as ta, JUNIOR_THREAD_STATE_TTL_MS as ti, getTerminalAssistantMessages as tn, conversationIsMemberRoot as to, REVIEW_ITEM_REPLIED_REASON as tr, pauseLostWorkerTurn as tt, recordAuthenticationLinked as u, withSlackRetries as ua, createPluginState as ui, isToolResultMessage as un, readConversationEventPageAfter as uo, reviewItemsNeedingUserVersionQuery as ur, CONVERSATION_WORK_STALE_ENQUEUE_MS as ut, hydrateConversationMessages as v, getWorkspaceSnapshotNotReadyError as va, updateWorkspace as vi, escapeClosingTags as vn, matchSlackAttachments as vo, canUserReadReviewItem as vr, clearConsumedConversationWake as vt, fallbackShortTitle as w, createSandboxEgressCredentialToken as wa, create as wi, tagJson as wn, createPluginAnnotations as wo, reviewItemNeedsUser as wr, drainConversationMailbox as wt, toStoredConversationMessage as x, clearSandboxEgressSignals as xa, loadSnapshotsForProfile as xi, renderChildTag as xn, slackAttachmentsVersionQuery as xo, requireReviewItemAssignees as xr, completeConversationWork as xt, persistConversationMessageWindow as y, isWorkspaceSnapshotNotReadyError as ya, WorkspaceValidationError as yi, escapeTagText as yn, readAttachmentVisionSummary as yo, isOnlyAssignee as yr, clearExpiredConversationLease as yt, getAgentContextCompactionTriggerTokens as z, SANDBOX_REPOS_ROOT as za, normalizeSlackStatusText as zi, getPlugins as zn, cancelWatch as zr, requestAnotherSlice as zt };
15228
+ export { loadTurnCheckpoint as $, createPluginModelCostRecorder as $a, postSlackMessage as $i, deletePushSubscription as $n, bindEventAutomationCredentialSubject as $r, createTurnLimitGate as $t, latestConversationMessageSeq as A, parseSandboxEgressCredentialToken as Aa, hash as Ai, createUserTokenStore as An, listConversationAnnotations as Ao, reviewItemReaderForUser as Ar, isInvalidConversationRecordError as At, getAgentContextInputLimitTokens as B, createPluginEmbedder as Ba, startOAuthFlow as Bi, getPluginSlackConversationLink as Bn, piMessageFromHistoryItem as Bo, RESOURCE_SUBSCRIPTION_MAX_TTL_MS as Br, requestConversationWork as Bt, settleConversationTitleWork as C, getWorkspaceSnapshotNotReadyError as Ca, updateWorkspace as Ci, escapeTagText as Cn, matchSlackAttachments as Co, canUserReadReviewItem as Cr, deadLetterAttempt as Ct, estimateConversationMessagesTokens as D, consumeSandboxEgressAuthRequiredSignal as Da, setWorkspaceSnapshot as Di, renderUntrustedTag as Dn, resolveRootVisibility as Do, requireReviewItemLinks as Dr, hasConversationStop as Dt, buildConversationContext as E, clearSandboxEgressSignals as Ea, loadSnapshotsForProfile as Ei, renderTag as En, slackAttachmentsVersionQuery as Eo, requireReviewItemAssignees as Er, getConversationWorkState as Et, turnHasReply as F, SANDBOX_RUNTIME as Fa, proxyVercelSandboxEgressRequest as Fi, agent_hooks_exports as Fn, lookupSlackUserNames as Fo, resolveAssignee as Fr, recordAttemptFailure as Ft, AuthPausePersistenceError as G, SANDBOX_SKILLS_ROOT as Ga, slackMention as Gi, setPlugins as Gn, collectEventMatchKeys as Gr, isPersonInput as Gt, PluginCredentialFailureError as H, SANDBOX_COMMAND_PATH as Ha, formatSlackLink as Hi, getPluginTools as Hn, getConfigDefaults as Ho, STOP_WATCHING_TOOL_NAME as Hr, steerWebPendingMessages as Ht, upsertConversationMessage as I, sleep$2 as Ia, deliverOAuthAuthorization as Ii, createPluginEventPublisher as In, createPluginCache as Io, resolveAssignees as Ir, recordConversationRetry as It, abandonReplacedPendingAuth as J, sandboxSkillFile as Ja, deleteSlackMessage as Ji, registration_exports as Jn, deliverWatch as Jr, TURN_LIMIT_WRAP_UP_MESSAGE as Jt, AuthorizationFlowDisabledError as K, SANDBOX_WORKSPACE_ROOT as Ka, truncateStatusText as Ki, validatePlugins as Kn, createTimerWatch as Kr, postsRunNotices as Kt, calculateContextCompactionTargetTokens as L, tryWorkspaceRepoCheckoutPath as La, formatProviderLabel as Li, createPluginHookRunner as Ln, createDurableLocationConfigurationService as Lo, resolveChannelCapabilities as Lr, releaseConversationWork as Lt, normalizeConversationText as M, buildSandboxEgressNetworkPolicy as Ma, ensureDockerDaemon as Mi, webActorUserIds as Mn, defaultTimezone as Mo, EVERYONE_ASSIGNEE as Mr, markConversationWorkEnqueued as Mt, recordDeliveredAssistantMessage as N, resolveSandboxCommandEnvironment as Na, getSandboxProvider as Ni, getOAuthAccountProviders as Nn, resolveUserTimezone as No, activeParticipantUserIds as Nr, moveIdleConversationDestination as Nt, getConversationMessageSlackTs as O, consumeSandboxEgressPermissionDeniedSignal as Oa, setWorkspaceSnapshotBuild as Oi, tagJson as On, saveObjectAnnotations as Oo, reviewItemNeedsSomeone as Or, hasRunnableConversationWork as Ot, trimConversationMessages as P, normalizeSandboxEgressTracePropagationDomains as Pa, isVercelSandboxEgressRequest as Pi, resolvePluginOAuthAccount as Pn, lookupSlackUser as Po, automationCreatorUserId as Pr, pruneActiveConversation as Pt, continuableMessages as Q, runNonInteractiveCommand as Qa, postSlackEphemeralMessage as Qi, resolveNotificationTimezone as Qn, takeDueTimerWatches as Qr, buildTurnErrorResponse as Qt, getAgentBackgroundCompactionMarkTokens as R, workspaceRepoCheckoutPath as Ra, parseOAuthStatePayload as Ri, getPluginApiRoutes as Rn, configValueSchema as Ro, getSlackToolContext as Rr, releaseInboundMessage as Rt, resolveConversationTitle as S, WorkspaceSnapshotNotReadyError as Sa, listWorkspacesByRepository as Si, escapeClosingTags as Sn, getSlackFileId as So, canReadReviewItem as Sr, countPendingConversationMessages as St, resolveTaskTitle as T, workspaceSnapshotNotReadyUserMessage as Ta, invalidateReadySnapshot as Ti, renderChildTag as Tn, recordSlackAttachment as To, readReviewItemAgentScope as Tr, getConversation as Tt, createPluginAuthOrchestration as U, SANDBOX_DATA_ROOT as Ua, normalizeSlackReplyMarkdown as Ui, getPluginUserPromptContributions as Un, setConfigDefaults as Uo, cancelSubscriptions as Ur, stopConversationWork as Ut, createPluginEgress as V, createPluginModel as Va, escapeSlackMrkdwnText as Vi, getPluginSystemPromptContributions as Vn, projectConversationEvents$1 as Vo, RESOURCE_WATCH_TOOL_SOURCE as Vr, startConversationWork as Vt, authorizationId as W, SANDBOX_REPOS_ROOT as Wa, normalizeSlackStatusText as Wi, getPlugins as Wn, cancelWatch as Wr, deliversFinalText as Wt, clearPendingAuth as X, buildCommandScript as Xa, openSlackDirectMessage as Xi, readWebPushConfig as Xn, getWatch as Xr, TurnSliceLimitExceededError as Xt, canReusePendingAuthLink as Y, sandboxSkillPathResolution as Ya, getSlackMessagePermalink as Yi, setBriefsConfig as Yn, findMatchingWatches as Yr, TurnBudgetExceededError as Yt, getConversationPendingAuth as Z, buildNonInteractiveShellScript as Za, openSlackModal as Zi, sendPushNotificationToUser as Zn, listWatches as Zr, TurnToolCallLimitExceededError as Zt, appendConversationMessages as _, runWithWorkspaceTeamId as _a, createWorkspace as _i, stripRuntimeTurnContext as _n, readConversationLastEventSeq as _o, takeReviewItem as _r, claimInboundMessage as _t, loadProjection as a, slackExternalRefIdSchema as aa, verifyTimerWatchCredentialSubject as ai, getTerminalAssistantMessages as an, conversationHasParticipantUser as ao, projectConversationMessages as ar, failTurnRecord as at, persistConversationMessages as b, throwSandboxOperationError as ba, getWorkspaceByName as bi, SESSION_CONTEXT_SECTION_TAG as bn, loadForkHistory as bo, canActOnReviewItem as br, completeConversationStop as bt, recordAgentsInstructionsUpdated as c, getFilePermalink as ca, getDashboardObjectIconLink as ci, hasTurnInput as cn, conversationPinnedForUser as co, countReviewItemsNeedingUser as cr, recordTurnSummary as ct, recordAuthorizationCompleted as d, isConversationScopedChannel as da, getDashboardTaskLink as di, isContinuablePiBoundary as dn, createPluginConversationEvents as do, getReviewItem as dr, ackMessages as dt, removeReactionFromMessage as ea, bindScheduledAutomationCredentialSubject as ei, isTurnExecutionLimitExceededError as en, createPluginLogger as eo, listPushSubscriptions as er, lostWorkerBeforeFirstSave as et, recordAuthorizationRequested as f, isDmChannel as fa, parseDashboardConversationLink as fi, isStandaloneRuntimeContextMessage as fn, readConversationBriefThrough as fo, insertReviewItem as fr, appendExclusiveInboundMessage as ft, recordToolExecutionStarted as g, getWorkspaceTeamId as ga, renderToolResultNudge as gi, retainRuntimeTurnContext as gn, readConversationEventPageAround as go, searchReviewItems as gr, checkInConversationWork as gt, recordSubscribedReplyRoute as h, withSlackRetries as ha, createPluginState as hi, normalizeToolNameFromResult as hn, readConversationEventPageAfter as ho, reviewItemsNeedingUserVersionQuery as hr, cancelHumanFacingPendingMessages as ht, loadConversationProjection as i, slackEntitySchema as ia, verifySlackDirectCredentialSubject as ii, getPiMessageRole as in, readConversationAccessFromSql as io, isPausedBySlack as ir, completeTurnRecord as it, markConversationMessage as j, sandboxEgressSignalsResponseSchema as ja, isStale as ji, findLegacyWebActorUserId as jn, listConversationAnnotationsById as jo, reviewItemReaderForUserInConversation as jr, listActiveConversationIds as jt, isHumanConversationMessage as k, createSandboxEgressCredentialToken as ka, create as ki, SANDBOX_EGRESS_AUTH_REQUIRED_MARKER as kn, createPluginAnnotations as ko, reviewItemNeedsUser as kr, isFinalAttempt as kt, recordAttachmentsDelivered as l, getHeaderString as la, getDashboardReviewItemLink as li, instructionTextForProjection as ln, conversationViewerMarks as lo, dismissOpenReviewItems as lr, CONVERSATION_WORK_CHECK_IN_INTERVAL_MS as lt, recordMcpProviderConnected as m, runWithSlackInstallationToken as ma, ToolInputError as mi, isToolResultMessage as mn, readConversationEventPage as mo, listWaitingConversations as mr, beginConversationResume as mt, commitMessages as n, updateSlackMessage as na, verifyEventAutomationCredentialSubject as ni, persistWithRetry as nn, canAddConversationMessages as no, saveNotificationSchedule as nr, saveTurnCheckpoint as nt, loadTurnProjection as o, SlackActionError as oa, JUNIOR_THREAD_STATE_TTL_MS as oi, getUserMessageInstructionText as on, conversationIsMemberRoot as oo, REVIEW_ITEM_REPLIED_REASON as or, getTurnRecord as ot, recordGuardianActionReviewed as p, normalizeSlackConversationId as pa, setDashboardConversationLinkOptions as pi, isToolResultError as pn, readLatestConversationBrief as po, listReplyActionItems as pr, appendInboundMessage as pt, AuthorizationPauseError as q, sandboxSkillDir as qa, addReactionToMessage as qi, coreTaskRegistrations as qn, createWatch as qr, turnBehavior as qt, loadConnectedMcpProviders as r, uploadFilesToConversation as ra, verifyScheduledAutomationCredentialSubject as ri, extractAssistantText as rn, createConversationAccessReader as ro, savePushSubscription as rr, abandonTurnRecord as rt, openConversationProjection as s, downloadPrivateSlackFile as sa, getDashboardConversationLink as si, hasRuntimeTurnContext as sn, conversationIsNotUnsubscribedRoot as so, closeReviewItem as sr, listTurnSummaries as st, commitAcceptedReply as t, unfurlSlackLinks as ta, bindSlackDirectCredentialSubject as ti, CODEMODE_TOOL_NAME as tn, canAccessConversation as to, readNotificationSchedule as tr, pauseLostWorkerTurn as tt, recordAuthenticationLinked as u, getSlackClient as ua, getDashboardSettingsLink as ui, isAssistantMessage as un, viewerMarksFromParticipant as uo, getOpenReviewItemByDedupeKey as ur, CONVERSATION_WORK_STALE_ENQUEUE_MS as ut, hydrateConversationMessages as v, isAbortError as va, deleteWorkspace as vi, trimTrailingAssistantMessages as vn, readConversationMessageEventSeq as vo, updateReviewItemContent as vr, clearConsumedConversationWake as vt, fallbackShortTitle as w, isWorkspaceSnapshotNotReadyError as wa, WorkspaceValidationError as wi, readParentAgentTask as wn, readAttachmentVisionSummary as wo, isOnlyAssignee as wr, drainConversationMailbox as wt, toStoredConversationMessage as x, wrapSandboxSetupError as xa, listWorkspaces as xi, TURN_CONTEXT_TAG as xn, notInheritedByForkChild as xo, canAgentChangeReviewItem as xr, completeConversationWork as xt, persistConversationMessageWindow as y, isAlreadyExistsError as ya, getWorkspace as yi, REQUEST_CONTEXT_SECTION_TAG as yn, buildSentryConversationUrl as yo, PLUGIN_REVIEW_ITEM_KEY_PREFIX as yr, clearExpiredConversationLease as yt, getAgentContextCompactionTriggerTokens as z, PluginToolDeniedError as za, resolveBaseUrl as zi, getPluginRoutes as zn, historyItemFromPiMessage as zo, RESOURCE_SUBSCRIPTION_DEFAULT_TTL_MS as zr, requestAnotherSlice as zt };
@@ -1,6 +1,6 @@
1
- import { C as completeText$1, S as completeObject$1, x as completeDecision$1 } from "./config-BerMjSVL.js";
2
- import { _ as runBestEffort, a as extractGenAiUsageSummary } from "./logging-CTCH5jOy.js";
3
- import { V as agentTurnCostUsd, r as getConversationEventStore } from "./db-BlfjuqzW.js";
1
+ import { C as completeText$1, S as completeObject$1, x as completeDecision$1 } from "./config-B4b-NXH5.js";
2
+ import { _ as runBestEffort, a as extractGenAiUsageSummary } from "./logging-BN5drSEZ.js";
3
+ import { V as agentTurnCostUsd, r as getConversationEventStore } from "./db-CoA7_Xqu.js";
4
4
  import { X as parseBriefInput, Y as conversationBriefSchema, q as briefOutcomeStatusSchema } from "./conversation-CtjR1Zcx.js";
5
5
  import * as z from "zod";
6
6
  import { conversationEventPresentationSchema, defineConversationEvent } from "@sentry/junior-plugin-api";
@@ -1,4 +1,4 @@
1
- import { b as setSpanAttributes, h as logWarn, m as logInfo } from "./logging-CTCH5jOy.js";
1
+ import { b as setSpanAttributes, h as logWarn, m as logInfo } from "./logging-BN5drSEZ.js";
2
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";
@@ -1,6 +1,6 @@
1
- import { Ei as isStale, La as SANDBOX_COMMAND_PATH, Oi as getSandboxProvider, Va as SANDBOX_WORKSPACE_ROOT, ja as sleep, qa as runNonInteractiveCommand, wi as create } from "./projection-DY93nCfX.js";
2
- import { E as withSpan, b as setSpanAttributes } from "./logging-CTCH5jOy.js";
3
- import { r as getStateAdapter } from "./adapter-Cigb1MTr.js";
1
+ import { Ha as SANDBOX_COMMAND_PATH, Ia as sleep, Ka as SANDBOX_WORKSPACE_ROOT, Ni as getSandboxProvider, Qa as runNonInteractiveCommand, ji as isStale, ki as create } from "./projection-DXl4ftyL.js";
2
+ import { E as withSpan, b as setSpanAttributes } from "./logging-BN5drSEZ.js";
3
+ import { r as getStateAdapter } from "./adapter-CMJfmHso.js";
4
4
  import * as z from "zod";
5
5
  // src/chat/sandbox/resources.ts
6
6
  let configuredResources;
@@ -1,12 +1,12 @@
1
1
  import { v as __exportAll } from "./sentry-BRTJqumy.js";
2
- import { Cn as renderUntrustedTag } from "./projection-DY93nCfX.js";
3
- import { T as SYSTEM_IDENTITY_ID } from "./db-BlfjuqzW.js";
4
- import { f as credentialContextForActor } from "./registry-X_xdFY9L.js";
5
- import { cn as listUnreportedSiblingAgents } from "./agent-runner-BuH7EHrX.js";
6
- import { C as isTerminalAgentInvocation, G as getAgentInvocationIdForEvents, K as getAgentInvocationIdForMessage, Y as getAgentInvocationResultMessageId, k as markAgentInvocationParentMailboxAppended, q as getAgentInvocationIdForResult, x as getLatestAgentInvocationForConversation, y as getAgentInvocation } from "./turn-failure-response-D0bwI462.js";
7
- import { D as timerWatchCredentialSubject, E as renderEventBatchInputs, S as EVENT_WAIT_MS, T as isEventMailboxMetadata, f as getEventBatchDelayMs, m as parseEventMessages, n as isWatchEvent, s as eventReviewItemInputs, w as eventBatchMessageMeta } from "./session-stop-DNucbmPf.js";
8
- import { r as appendAndEnqueueInboundMessage } from "./store-CS0xoqXW.js";
9
- import { a as enqueueAgentInvocation, l as createAgentInvocationFromLatest, o as resolveAgentInvocationId, t as createAgentInvocationWorker } from "./work-Cu315oJl.js";
2
+ import { Dn as renderUntrustedTag } from "./projection-DXl4ftyL.js";
3
+ import { T as SYSTEM_IDENTITY_ID } from "./db-CoA7_Xqu.js";
4
+ import { f as credentialContextForActor } from "./registry-DosVt9f9.js";
5
+ import { cn as listUnreportedSiblingAgents } from "./agent-runner-DHq1pjUg.js";
6
+ import { C as isTerminalAgentInvocation, G as getAgentInvocationIdForEvents, K as getAgentInvocationIdForMessage, Y as getAgentInvocationResultMessageId, k as markAgentInvocationParentMailboxAppended, q as getAgentInvocationIdForResult, x as getLatestAgentInvocationForConversation, y as getAgentInvocation } from "./turn-failure-response-jNVl00MD.js";
7
+ import { D as timerWatchCredentialSubject, E as renderEventBatchInputs, S as EVENT_WAIT_MS, T as isEventMailboxMetadata, f as getEventBatchDelayMs, m as parseEventMessages, n as isWatchEvent, s as eventReviewItemInputs, w as eventBatchMessageMeta } from "./session-stop-xYK15HUu.js";
8
+ import { r as appendAndEnqueueInboundMessage } from "./store-xtibD98L.js";
9
+ import { a as enqueueAgentInvocation, l as createAgentInvocationFromLatest, o as resolveAgentInvocationId, t as createAgentInvocationWorker } from "./work-xwX6unUE.js";
10
10
  import { n as isAgentInvocationResultEventType, t as agentInvocationResultEventType } from "./result-event-type-DD6BAgT7.js";
11
11
  // src/chat/agent-invocations/result.ts
12
12
  var result_exports = /* @__PURE__ */ __exportAll({
@@ -1,11 +1,11 @@
1
- import { A as latestConversationMessageSeq, I as upsertConversationMessage, M as normalizeConversationText, N as recordDeliveredAssistantMessage, Qt as persistWithRetry, W as authorizationId, a as loadProjection, b as persistConversationMessages, d as recordAuthorizationCompleted, j as markConversationMessage, nt as saveTurnCheckpoint, t as commitAcceptedReply, v as hydrateConversationMessages } from "./projection-DY93nCfX.js";
2
- import { S as setTags, T as withLogContext, p as logException } from "./logging-CTCH5jOy.js";
3
- import { T as SYSTEM_IDENTITY_ID, a as getConversationStore, r as getConversationEventStore } from "./db-BlfjuqzW.js";
4
- import { f as credentialContextForActor } from "./registry-X_xdFY9L.js";
1
+ import { A as latestConversationMessageSeq, I as upsertConversationMessage, M as normalizeConversationText, N as recordDeliveredAssistantMessage, W as authorizationId, a as loadProjection, b as persistConversationMessages, d as recordAuthorizationCompleted, j as markConversationMessage, nn as persistWithRetry, nt as saveTurnCheckpoint, t as commitAcceptedReply, v as hydrateConversationMessages } from "./projection-DXl4ftyL.js";
2
+ import { S as setTags, T as withLogContext, p as logException } from "./logging-BN5drSEZ.js";
3
+ import { T as SYSTEM_IDENTITY_ID, a as getConversationStore, r as getConversationEventStore } from "./db-CoA7_Xqu.js";
4
+ import { f as credentialContextForActor } from "./registry-DosVt9f9.js";
5
5
  import { L as messageCardText } from "./conversation-CtjR1Zcx.js";
6
- import { dt as markTurnFailed, f as ConversationTurnLifecycleService, ft as startActiveTurn, i as completeAuthPauseTurn, l as buildDeliveredTurnStatePatch, m as loadPendingMessageCards, t as finalizeFailedTurnReplyWithEvent, u as buildTurnThreadContext } from "./turn-failure-response-D0bwI462.js";
7
- import { n as getAssistantReplyText } from "./assistant-reply-ZjLRGHm2.js";
8
- import { _t as persistThreadStateById, ht as getPersistedThreadState, mt as getPersistedSandboxState, n as scheduleSessionCompletedPluginTasks, t as processPluginTask, vt as coerceThreadConversationState } from "./task-runner-DjjHCX_m.js";
6
+ import { dt as markTurnFailed, f as ConversationTurnLifecycleService, ft as startActiveTurn, i as completeAuthPauseTurn, l as buildDeliveredTurnStatePatch, m as loadPendingMessageCards, t as finalizeFailedTurnReplyWithEvent, u as buildTurnThreadContext } from "./turn-failure-response-jNVl00MD.js";
7
+ import { n as getAssistantReplyText } from "./assistant-reply-CIApSfor.js";
8
+ import { ft as getPersistedSandboxState, gt as coerceThreadConversationState, ht as persistThreadStateById, n as scheduleSessionCompletedPluginTasks, pt as getPersistedThreadState, t as processPluginTask } from "./task-runner-BYPN4BEO.js";
9
9
  import { randomUUID } from "node:crypto";
10
10
  import { createLocalSource, localDestinationSchema } from "@sentry/junior-plugin-api";
11
11
  // src/chat/local/runner.ts
@@ -1,4 +1,4 @@
1
- import { Ea as sandboxEgressSignalsResponseSchema } from "./projection-DY93nCfX.js";
1
+ import { ja as sandboxEgressSignalsResponseSchema } from "./projection-DXl4ftyL.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;