@sentry/junior 0.296.0 → 0.297.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 (82) hide show
  1. package/dist/{admin-z_lgDi-z.js → admin-tmGIw4KS.js} +2 -2
  2. package/dist/{agent-runner-HoQiUKLL.js → agent-runner-CneTquAE.js} +378 -1919
  3. package/dist/api/schema.d.ts +2 -2
  4. package/dist/api/schema.js +7 -7
  5. package/dist/api.d.ts +1 -1
  6. package/dist/api.js +38 -267
  7. package/dist/{app-C75Ft-A_.d.ts → app-BJojZ7HL.d.ts} +7 -2
  8. package/dist/app.d.ts +1 -1
  9. package/dist/app.js +64 -44
  10. package/dist/attempt-selection-ClP3MMPr.js +61 -0
  11. package/dist/{automation-yJX3C7i3.js → automation-BrP6ImrC.js} +1 -1
  12. package/dist/{background-compaction-queue-Cre1wFt9.js → background-compaction-queue-CwfJy3Cd.js} +4 -88
  13. package/dist/{briefs-BXECHduJ.js → briefs-uFTuhMqA.js} +3 -3
  14. package/dist/{catalog-runtime-CpCmlD9L.js → catalog-runtime-0kuQqYL4.js} +1 -1
  15. package/dist/cli/chat.js +19 -15
  16. package/dist/cli/check.js +3 -3
  17. package/dist/cli/main.js +3 -3
  18. package/dist/cli/plugins.js +4 -4
  19. package/dist/cli/snapshot-create.js +4 -4
  20. package/dist/cli/upgrade.d.ts +1 -1
  21. package/dist/cli/upgrade.js +3 -3
  22. package/dist/{config-CCPHvTqx.js → config-Dj9M_nqB.js} +2 -2
  23. package/dist/{connections-B5pWh8e2.js → connections-B96JUM5o.js} +6 -6
  24. package/dist/{conversation-CMkSmi02.js → conversation-CvcBU1z2.js} +2 -16
  25. package/dist/{conversation-feed-BVAOga0H.js → conversation-feed-BSMlGZnS.js} +1 -1
  26. package/dist/{conversation-privacy-CZD5soDW.js → conversation-privacy-DI29jbZV.js} +1 -1
  27. package/dist/conversation-turn-CZWBr091.js +805 -0
  28. package/dist/{credential-sync-DwLkIvXI.js → credential-sync-Blhx4_xf.js} +14 -13
  29. package/dist/{db-C1M1y-bh.js → db-Br0tfAo7.js} +43 -15
  30. package/dist/{db-B3iyr_Or.d.ts → db-CrtyFRz7.d.ts} +13 -1
  31. package/dist/{executor-DUSEwXaO.js → executor-BMPipFVA.js} +14 -6
  32. package/dist/instrumentation.js +2 -2
  33. package/dist/{logging-D0svFM8r.js → logging-CQjlDQYX.js} +1 -1
  34. package/dist/{message-BFnIwKpx.js → message-BOZEIuxy.js} +15 -13
  35. package/dist/nitro.d.ts +1 -1
  36. package/dist/nitro.js +3 -2
  37. package/dist/{session-stop-hYNTNpVf.js → notification-gusCgdQ6.js} +11 -930
  38. package/dist/{oauth-callback-server-BXRtD6Fk.js → oauth-callback-server-V_DuMuNX.js} +2 -2
  39. package/dist/{projection-B6VS7kbo.js → projection-B08mfi0u.js} +333 -106
  40. package/dist/{prompt-CD11tfG8.js → prompt-BlutWLNt.js} +4 -4
  41. package/dist/prompt-input-Dxn8cDC0.js +1424 -0
  42. package/dist/{registry-CHewwYEo.js → registry-BDWgCJDf.js} +1 -1
  43. package/dist/reporting-window-DopzcOHh.js +137 -0
  44. package/dist/{resolve-1owMH4qo.js → resolve-2Z_o_SsI.js} +3 -3
  45. package/dist/result-CAujiaci.js +463 -0
  46. package/dist/{runner-BtWvJslp.js → runner-D2Chc02N.js} +9 -8
  47. package/dist/{sandbox-egress-signals-ByftwJVt.js → sandbox-egress-signals-CFoJduFj.js} +1 -1
  48. package/dist/{schema-D2iGyYIp.js → schema-Bqa5NbcP.js} +11 -48
  49. package/dist/{schema-Ct1Zf2xy.d.ts → schema-Ce2XCS7O.d.ts} +8 -107
  50. package/dist/{service-account-DLoeoHww.js → service-account-C9kRQEb_.js} +3 -3
  51. package/dist/{service-account-BZEuMKdo.js → service-account-CERfXEVU.js} +3 -3
  52. package/dist/session-stop-B-I1rAS1.js +181 -0
  53. package/dist/{skills-DXgd5Inh.js → skills-B0m1nZ_j.js} +2 -2
  54. package/dist/{spawn-YeqlNDv8.js → spawn-CwMjRRtn.js} +6 -5
  55. package/dist/{state-C3CbtD_m.js → state-DFnmLmfn.js} +2 -2
  56. package/dist/{stop-Cze_pEL8.js → stop-BCH9VNGf.js} +63 -158
  57. package/dist/{store-CZ9vqR4P.js → store-B59rOYbS.js} +11 -4
  58. package/dist/{task-runner-CMiNGsER.js → store-m5bmdmsP.js} +939 -1593
  59. package/dist/task-queue-N0kuCknH.js +89 -0
  60. package/dist/task-runner-COOwR8qm.js +291 -0
  61. package/dist/thread-context-Cd44z_W5.js +248 -0
  62. package/dist/turn-cancel-DDu8TOwt.js +201 -0
  63. package/dist/turn-session-routing-BlCtVFRN.js +380 -0
  64. package/dist/{turn-failure-response-pXhZ2wMK.js → turn-user-message-ygLG3ylQ.js} +183 -361
  65. package/dist/turn-wake-DmQec4AG.js +161 -0
  66. package/dist/{reporting-window-B3Ze-Qnt.js → user-input-request-CXNIov9n.js} +24 -143
  67. package/dist/{validation-Du7NdkOR.js → validation-Ba2OcUse.js} +1 -1
  68. package/dist/{version-EN3Wnq-R.js → version-KNDzIAh6.js} +1 -1
  69. package/dist/version.js +1 -1
  70. package/dist/{viewer-Agxi_o5c.js → viewer-BPpuN2f9.js} +3 -3
  71. package/dist/warmup-Bskrwmk1.js +2697 -0
  72. package/dist/{worker-BALVdWbv.js → worker-B1skZlit.js} +20 -8
  73. package/migrations/0102_code_change_last_activity.sql +1 -0
  74. package/migrations/0103_agent_invocation_fork.sql +8 -0
  75. package/migrations/meta/0102_snapshot.json +4502 -0
  76. package/migrations/meta/0103_snapshot.json +4509 -0
  77. package/migrations/meta/_journal.json +14 -0
  78. package/package.json +4 -4
  79. package/dist/result-CEqQFrEf.js +0 -305
  80. package/dist/result-event-type-DD6BAgT7.js +0 -11
  81. package/dist/warmup-CY2ArYag.js +0 -2017
  82. package/dist/work-EA98F0ia.js +0 -768
@@ -1,6 +1,6 @@
1
1
  import { n as ConversationWorkQueue, t as ConversationQueueMessage } from "./queue-CZyYgPF0.js";
2
- import { t as ConversationStore } from "./db-B3iyr_Or.js";
3
- import "./schema-Ct1Zf2xy.js";
2
+ import { t as ConversationStore } from "./db-CrtyFRz7.js";
3
+ import "./schema-Ce2XCS7O.js";
4
4
  import { n as JuniorPluginSet } from "./plugins-B_0Cr0MO.js";
5
5
  import "./sentry-DrKC2NeM.js";
6
6
  import { Hono } from "hono";
@@ -164,6 +164,11 @@ interface ConversationWorkerContext {
164
164
  shouldYield(): boolean;
165
165
  /** Return an AbortSignal backed by the durable Conversation stop request. */
166
166
  stopSignal?(): AbortSignal;
167
+ /**
168
+ * Read the stored stop of the Conversation once, and abort `stopSignal`
169
+ * when it stopped during this attempt. A Run calls it at each step.
170
+ */
171
+ checkStop?(): Promise<void>;
167
172
  }
168
173
  interface InboxAttempt {
169
174
  ack(): Promise<void>;
package/dist/app.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { i as JuniorDashboardOptions, n as JuniorAppOptions, r as createApp, t as JuniorApp } from "./app-C75Ft-A_.js";
1
+ import { i as JuniorDashboardOptions, n as JuniorAppOptions, r as createApp, t as JuniorApp } from "./app-BJojZ7HL.js";
2
2
  import { i as defineJuniorPlugins, n as JuniorPluginSet, r as JuniorPluginSetOptions, t as JuniorPluginInput } from "./plugins-B_0Cr0MO.js";
3
3
  import { t as JUNIOR_VERSION } from "./version-Cc2OFd9G.js";
4
4
  export { JUNIOR_VERSION, JuniorApp, JuniorAppOptions, type JuniorDashboardOptions, type JuniorPluginInput, type JuniorPluginSet, type JuniorPluginSetOptions, createApp, defineJuniorPlugins };
package/dist/app.js CHANGED
@@ -1,41 +1,45 @@
1
1
  import { i as getActiveSpan, n as captureMessage, u as sentry_exports } from "./sentry-BRTJqumy.js";
2
- import { $r as verifyScheduledAutomationCredentialSubject, Aa as normalizeSandboxEgressTracePropagationDomains, Ai as isVercelSandboxEgressRequest, At as isInvalidConversationRecordError, Bn as getPlugins, Bo as getConfigDefaults, C as settleConversationTitleWork, Ca as consumeSandboxEgressAuthRequiredSignal, Co as resolveRootVisibility, Dr as reviewItemReaderForUserInConversation, Ea as parseSandboxEgressCredentialToken, En as createUserTokenStore, Eo as listConversationAnnotations, Er as reviewItemReaderForUser, Fi as resolveBaseUrl, Fn as getPluginRoutes, Gn as setBriefsConfig, Gr as findMatchingWatches, Hn as validatePlugins, Ia as createPluginEmbedder, Ji as postSlackEphemeralMessage, Jr as takeDueTimerWatches, Li as escapeSlackMrkdwnText, Mn as createPluginEventPublisher, Ot as hasRunnableConversationWork, Pn as getPluginApiRoutes, Po as createPluginCache, Pt as pruneActiveConversation, Qr as verifyEventAutomationCredentialSubject, Ri as formatSlackLink, Sa as clearSandboxEgressSignals, Vi as slackMention, Vn as setPlugins, Vo as setConfigDefaults, Vr as collectEventMatchKeys, Xa as createPluginLogger, Xr as bindScheduledAutomationCredentialSubject, Yr as bindEventAutomationCredentialSubject, Zi as unfurlSlackLinks, Zr as bindSlackDirectCredentialSubject, _ as appendConversationMessages, ai as getDashboardReviewItemLink, ar as dismissOpenReviewItems, ca as isDmChannel, ci as parseDashboardConversationLink, di as createPluginState, do as readConversationEventPageAfter, ea as slackEntitySchema, ei as verifySlackDirectCredentialSubject, eo as readConversationAccessFromSql, fa as getWorkspaceTeamId, fr as searchReviewItems, gr as canActOnReviewItem, ji as proxyVercelSandboxEgressRequest, li as setDashboardConversationLinkOptions, lo as readLatestConversationBrief, mo as readConversationMessageEventSeq, oa as getSlackClient, pa as runWithWorkspaceTeamId, po as readConversationLastEventSeq, qi as openSlackModal, ri as getDashboardConversationLink, si as getDashboardTaskLink, ta as slackExternalRefIdSchema, tr as projectConversationMessages, uo as readConversationEventPage, ut as CONVERSATION_WORK_STALE_ENQUEUE_MS, wa as consumeSandboxEgressPermissionDeniedSignal } from "./projection-B6VS7kbo.js";
3
- import { Y as getAttachmentStorage, d as restoreRuntimeConfig, f as setBotModelConfig, h as snapshotRuntimeConfig, i as getChatConfig, m as setSlackReactionConfig, n as botConfig, o as getSlackBotToken, p as setRuntimeLimits, u as resetRuntimeConfig } from "./config-CCPHvTqx.js";
4
- import { A as JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE, E as withSpan, H as GOOGLE_IDENTITY_PROVIDER, L as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, O as JUNIOR_AUTO_ARCHIVE_ROUTE, P as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, T as withLogContext, W as normalizeIdentityEmail, b as setSpanAttributes, h as logWarn, k as JUNIOR_CACHE_WARMUP_CALLBACK_ROUTE, m as logInfo, p as logException, r as createRequestContext, w as withContext } from "./logging-D0svFM8r.js";
5
- import { t as JUNIOR_VERSION } from "./version-EN3Wnq-R.js";
2
+ import { $i as escapeSlackMrkdwnText, Ao as readConversationMessageEventSeq, Ba as consumeSandboxEgressPermissionDeniedSignal, Bo as resolveRootVisibility, C as settleConversationTitleWork, Ci as getDashboardTaskLink, Di as createPluginState, Do as readConversationEventPageAfter, Eo as readConversationEventPage, Ft as pruneActiveConversation, Ha as parseSandboxEgressCredentialToken, Hn as createUserTokenStore, Ho as createPluginAnnotations, Hr as reviewItemReaderForUserInConversation, Jn as createPluginEventPublisher, Jr as createCodeChangePublisher, Ka as normalizeSandboxEgressTracePropagationDomains, Ki as isVercelSandboxEgressRequest, Mr as canActOnReviewItem, Oa as getWorkspaceTeamId, Or as searchReviewItems, Qa as createPluginEmbedder, Ra as clearSandboxEgressSignals, Sa as getSlackClient, Ti as setDashboardConversationLinkOptions, To as readLatestConversationBrief, Uo as listConversationAnnotations, Vr as reviewItemReaderForUser, Xn as getPluginApiRoutes, Zi as resolveBaseUrl, Zn as getPluginRoutes, Zo as createPluginCache, _ as appendConversationMessages, _a as slackExternalRefIdSchema, _r as projectConversationMessages, di as bindEventAutomationCredentialSubject, ea as formatSlackLink, fi as bindScheduledAutomationCredentialSubject, fo as createPluginLogger, ga as slackEntitySchema, gi as verifySlackDirectCredentialSubject, go as readConversationAccessFromSql, hi as verifyScheduledAutomationCredentialSubject, ir as validatePlugins, is as setConfigDefaults, jt as isInvalidConversationRecordError, ka as runWithWorkspaceTeamId, ko as readConversationLastEventSeq, kt as hasRunnableConversationWork, la as openSlackModal, mi as verifyEventAutomationCredentialSubject, nr as getPlugins, pa as unfurlSlackLinks, pi as bindSlackDirectCredentialSubject, qi as proxyVercelSandboxEgressRequest, ra as slackMention, ri as collectEventMatchKeys, rr as setPlugins, rs as getConfigDefaults, si as findMatchingWatches, sr as setBriefsConfig, ua as postSlackEphemeralMessage, ui as takeDueTimerWatches, ut as CONVERSATION_WORK_STALE_ENQUEUE_MS, wa as isDmChannel, wi as parseDashboardConversationLink, xi as getDashboardReviewItemLink, xr as dismissOpenReviewItems, yi as getDashboardConversationLink, za as consumeSandboxEgressAuthRequiredSignal } from "./projection-B08mfi0u.js";
3
+ import { Y as getAttachmentStorage, d as restoreRuntimeConfig, f as setBotModelConfig, h as snapshotRuntimeConfig, i as getChatConfig, m as setSlackReactionConfig, n as botConfig, o as getSlackBotToken, p as setRuntimeLimits, u as resetRuntimeConfig } from "./config-Dj9M_nqB.js";
4
+ import { A as JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE, E as withSpan, H as GOOGLE_IDENTITY_PROVIDER, L as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, O as JUNIOR_AUTO_ARCHIVE_ROUTE, P as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, T as withLogContext, W as normalizeIdentityEmail, b as setSpanAttributes, h as logWarn, k as JUNIOR_CACHE_WARMUP_CALLBACK_ROUTE, m as logInfo, p as logException, r as createRequestContext, w as withContext } from "./logging-CQjlDQYX.js";
5
+ import { t as JUNIOR_VERSION } from "./version-KNDzIAh6.js";
6
6
  import { _ as slackMessageTsSchema, f as parseSlackTeamId, g as slackMessageTsFromMs, h as parseSlackMessageTs, m as slackChannelIdSchema, n as createSlackActor, p as parseSlackUserId, s as parseActorUserId, u as parseSlackChannelId } from "./actor-6jsm_v96.js";
7
- import { B as recordGoogleSignIn, G as getConversationIdByProviderConversation, O as conversationKindFromRow, P as resolveActorIdentityId, S as withConversationMutationLock, a as getConversationStore, nt as touchConversationDetail, o as getDb, p as withConversationEventLock, r as getConversationEventStore, rt as createSlackDestination, s as getSqlExecutor, t as closeDb } from "./db-C1M1y-bh.js";
8
- import { A as juniorConversations, N as juniorDestinations, b as juniorConversationBriefs, f as juniorAutomations, g as juniorAgentInvocations, h as juniorAgentBindings, l as juniorReviewItems, u as juniorAutomationRuns, w as juniorConversationEvents } from "./executor-DUSEwXaO.js";
9
- import { n as pluginCatalogRuntime } from "./catalog-runtime-CpCmlD9L.js";
10
- import { $ as readViewerAutomationSummary, $t as resumeConversationDelivery, A as runWithSlackInstallation, C as readSlackReviewItemCardConversationId, D as parseSlackReviewItemClick, E as buildSlackReviewItemModal, H as logScheduledAutomationRunSkipped, I as checkSlackChannelReadAccess, M as parseSlackThreadId, O as parseSlackReviewItemFormTarget, Ot as recordSubagentEnded, S as createSlackReviewItemShow, St as markConversationRead, U as scheduledAutomationRunAttributes, Y as ViewerTaskNotFoundError, Z as readViewerAutomationExecutions, _ as unpublishedArtifactHeaders, at as deliverReviewItemChange, bt as archiveConversation, dn as findAutomationSkill, fn as missingAutomationSkillReason, g as readPublicArtifact, gt as collectAttachmentGarbage, h as publicArtifactHeaders, j as verifySlackSignature, k as parseSlackUserInputSubmission, ln as processWorkspaceSnapshotJob, lt as appendAndEnqueueWebMessage, mt as webActorFromUser, n as executeAgentRun, ot as renderReviewItemMessage, pt as recordWebConversationActivity, r as processBackgroundCompaction, rt as effectiveTaskOutcomes, st as reviewItemChangeRecord, t as createAgentRunner, tt as readViewerAutomations, un as ingestEvent, ut as conversationTurnIdForMessage, v as setConversationSubscription, vt as requestAttachmentDeletion, w as syncReviewItemSlackCards, y as lookupSlackUserProfile, z as joinPublicChannel } from "./agent-runner-HoQiUKLL.js";
7
+ import { B as recordGoogleSignIn, O as conversationKindFromRow, P as resolveActorIdentityId, S as withConversationMutationLock, W as getConversationIdByProviderConversation, a as getConversationStore, nt as createSlackDestination, o as getDb, p as withConversationEventLock, r as getConversationEventStore, s as getSqlExecutor, t as closeDb, tt as touchConversationDetail } from "./db-Br0tfAo7.js";
8
+ import { A as juniorConversations, N as juniorDestinations, b as juniorConversationBriefs, f as juniorAutomations, g as juniorAgentInvocations, h as juniorAgentBindings, l as juniorReviewItems, u as juniorAutomationRuns, w as juniorConversationEvents } from "./executor-BMPipFVA.js";
9
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-0kuQqYL4.js";
10
+ import { A as parseSlackUserInputSubmission, At as processWorkspaceSnapshotJob, B as joinPublicChannel, C as createSlackReviewItemShow, D as buildSlackReviewItemModal, L as checkSlackChannelReadAccess, M as verifySlackSignature, Mt as findAutomationSkill, N as parseSlackThreadId, Nt as missingAutomationSkillReason, O as parseSlackReviewItemClick, Q as readViewerAutomationExecutions, St as archiveConversation, T as syncReviewItemSlackCards, U as logScheduledAutomationRunSkipped, W as scheduledAutomationRunAttributes, X as ViewerTaskNotFoundError, _ as readPublicArtifact, b as lookupSlackUserProfile, bt as requestAttachmentDeletion, ct as reviewItemChangeRecord, dt as conversationTurnIdForMessage, et as readViewerAutomationSummary, g as publicArtifactHeaders, ht as webActorFromUser, it as effectiveTaskOutcomes, j as runWithSlackInstallation, jt as ingestEvent, k as parseSlackReviewItemFormTarget, mt as recordWebConversationActivity, n as executeAgentRun, nt as readViewerAutomations, ot as deliverReviewItemChange, r as processBackgroundCompaction, st as renderReviewItemMessage, t as createAgentRunner, ut as appendAndEnqueueWebMessage, v as unpublishedArtifactHeaders, vt as collectAttachmentGarbage, w as readSlackReviewItemCardConversationId, wt as markConversationRead, y as setConversationSubscription } from "./agent-runner-CneTquAE.js";
11
11
  import { a as withLock, i as fenceLock, n as MUTATION_LOCK_TTL_MS } from "./locks-D-0h111u.js";
12
- import { g as createCache, i as readActorIdentity, l as resolveViewerUser, p as parseAvatarUrl } from "./viewer-Agxi_o5c.js";
13
- import { a as getStateAdapter, r as disconnectStateAdapter } from "./state-C3CbtD_m.js";
12
+ import { g as createCache, i as readActorIdentity, l as resolveViewerUser, p as parseAvatarUrl } from "./viewer-BPpuN2f9.js";
13
+ import { a as getStateAdapter, r as disconnectStateAdapter } from "./state-DFnmLmfn.js";
14
14
  import { a as getNextRunAtMs } from "./schedule-cP0AACm1.js";
15
- import { J as conversationBriefSchema, O as conversationTitleSchema, P as annotationCard, b as conversationSurfaceSchema, p as conversationFeedQuerySchema, v as conversationReportStatusSchema } from "./conversation-CMkSmi02.js";
15
+ import { N as annotationCard, O as conversationTitleSchema, b as conversationSurfaceSchema, p as conversationFeedQuerySchema, q as conversationBriefSchema, v as conversationReportStatusSchema } from "./conversation-CvcBU1z2.js";
16
16
  import { t as SANDBOX_EGRESS_PROXY_PATH } from "./proxy-path-BHYoKZdq.js";
17
17
  import { n as readSchedulerSecret, r as readSignInSecret } from "./secrets-DebYU866.js";
18
- import { a as segmentGapsKey, f as MINUTE_MS, g as gapSegment, m as NO_REPLY_GAP_MS, n as GLOBAL_GAPS_MAX, p as MIN_WARMUP_PREFIX_TOKENS, r as GLOBAL_GAPS_TTL_MS, t as CONVERSATION_STATE_TTL_MS } from "./warmup-CY2ArYag.js";
19
- import { A as getQueueProvider, C as cacheWarmupQueueConsumer, O as queueCallback, T as registerVercelCacheWarmupDevConsumer, _ as resolveConversationWorkQueueTopic, b as conversationQueueMessageSchema, f as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC, g as getVercelConversationWorkQueue, h as verifyWorkspaceSnapshotJobMessage, i as verifyBackgroundCompactionMessage, l as pluginTaskQueueConsumer, o as createVercelPluginTaskCallback, r as vercelBackgroundCompactionQueue, t as BACKGROUND_COMPACTION_QUEUE_TOPIC, u as registerVercelPluginTaskDevConsumer, v as verifyConversationQueueMessage, w as createVercelCacheWarmupCallback, x as isConversationQueueMessageRejectedError } from "./background-compaction-queue-Cre1wFt9.js";
20
- import { D as listPendingAgentInvocationResults, E as listPendingAgentInvocationMailboxAppends } from "./turn-failure-response-pXhZ2wMK.js";
21
- import { M as slackChannelMessageReplyThreadTs, N as slackChannelMessageRunsAutomation, O as getEventCatalog, W as renderSlackObjectCard, d as getAuthPausedConversationTurnId, it as setExperimentalFeatures, j as slackChannelMessageEvent, k as SLACK_EVENT_NAMESPACE, nt as getExperimentalFeatures, rt as isExperimentalFeatureEnabled, z as renderTaskInput } from "./session-stop-hYNTNpVf.js";
22
- import { _ as buttonUserInputField } from "./reporting-window-B3Ze-Qnt.js";
23
- import { c as setSandboxResourceConfig, o as getSandboxResourceConfig } from "./resolve-1owMH4qo.js";
24
- import { _ as listActiveConversationIds, g as getConversationWorkState, h as getConversation, l as clearExpiredConversationLease, m as ensureConversationWake, r as appendAndEnqueueInboundMessage } from "./store-CZ9vqR4P.js";
25
- import { $ as automationVersionOf, B as blockEventAutomation, C as listPendingDispatchMailboxAppends, Ct as eventGuidance, D as markDispatchFailed, F as readScheduledAutomation, L as saveScheduledAutomationInLock, N as listScheduledAutomationsForTeam, R as scheduledRunId, S as isTerminalDispatchStatus, V as collectEventAutomationMatchKeys, W as findMatchingEventAutomations, X as admitEventAutomationRun, Z as eventAutomationRunLimitReason, d as coerceThreadConversationState, f as buildDispatchId, g as getDispatchConversationId, h as createOrGetDispatch, ht as recordAutomationExecution, k as notifyAutomationBlocked, m as confirmDispatchMailboxAppend, st as existingConversationId, t as processPluginTask, x as getPluginDispatchProjection, y as getDispatchRecord, z as withScheduledAutomationLock } from "./task-runner-CMiNGsER.js";
26
- import { H as automationTaskSchema, N as scheduledRunSchema, U as automationTaskText, l as automationListQuerySchema, s as automationExecutionStatusSchema } from "./automation-yJX3C7i3.js";
27
- import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-Du7NdkOR.js";
18
+ import { f as getExperimentalFeatures, g as getAuthPausedConversationTurnId, m as setExperimentalFeatures, p as isExperimentalFeatureEnabled } from "./prompt-input-Dxn8cDC0.js";
19
+ import { B as MIN_WARMUP_PREFIX_TOKENS, D as recordSubagentEnded, U as gapSegment, V as NO_REPLY_GAP_MS, a as segmentGapsKey, n as GLOBAL_GAPS_MAX, r as GLOBAL_GAPS_TTL_MS, t as CONVERSATION_STATE_TTL_MS, x as enqueueAgentInvocation, z as MINUTE_MS } from "./warmup-Bskrwmk1.js";
20
+ import { C as queueCallback, T as getQueueProvider, _ as createVercelCacheWarmupCallback, a as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC, c as verifyWorkspaceSnapshotJobMessage, d as verifyConversationQueueMessage, g as cacheWarmupQueueConsumer, i as verifyBackgroundCompactionMessage, l as getVercelConversationWorkQueue, m as isConversationQueueMessageRejectedError, p as conversationQueueMessageSchema, r as vercelBackgroundCompactionQueue, t as BACKGROUND_COMPACTION_QUEUE_TOPIC, u as resolveConversationWorkQueueTopic, v as registerVercelCacheWarmupDevConsumer } from "./background-compaction-queue-CwfJy3Cd.js";
21
+ import { M as listPendingAgentInvocationMailboxAppends, N as listPendingAgentInvocationResults } from "./turn-user-message-ygLG3ylQ.js";
22
+ import { C as renderSlackObjectCard, c as SLACK_EVENT_NAMESPACE, d as slackChannelMessageReplyThreadTs, f as slackChannelMessageRunsAutomation, s as getEventCatalog, u as slackChannelMessageEvent, v as renderTaskInput } from "./notification-gusCgdQ6.js";
23
+ import { _ as getConversationWorkState, g as getConversation, h as ensureConversationWake, l as clearExpiredConversationLease, r as appendAndEnqueueInboundMessage, v as listActiveConversationIds } from "./store-B59rOYbS.js";
24
+ import { c as coerceThreadConversationState, p as eventGuidance } from "./turn-session-routing-BlCtVFRN.js";
25
+ import { r as buttonUserInputField } from "./user-input-request-CXNIov9n.js";
26
+ import { c as setSandboxResourceConfig, o as getSandboxResourceConfig } from "./resolve-2Z_o_SsI.js";
27
+ import { H as automationTaskSchema, N as scheduledRunSchema, U as automationTaskText, l as automationListQuerySchema, s as automationExecutionStatusSchema } from "./automation-BrP6ImrC.js";
28
+ import { $ as eventAutomationRunLimitReason, B as scheduledRunId, F as listScheduledAutomationsForTeam, H as blockEventAutomation, K as findMatchingEventAutomations, L as readScheduledAutomation, O as recordAutomationExecution, Q as admitEventAutomationRun, U as collectEventAutomationMatchKeys, V as withScheduledAutomationLock, a as getDispatchConversationId, b as existingConversationId, c as getDispatchRecord, d as isTerminalDispatchStatus, f as listPendingDispatchMailboxAppends, g as markDispatchFailed, i as createOrGetDispatch, r as confirmDispatchMailboxAppend, t as buildDispatchId, tt as automationVersionOf, u as getPluginDispatchProjection, v as notifyAutomationBlocked, z as saveScheduledAutomationInLock } from "./store-m5bmdmsP.js";
29
+ import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-Ba2OcUse.js";
28
30
  import { a as pluginRuntimeRegistrationsFromPluginSet, n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "./plugins-HYh_JOdw.js";
29
- import { s as conversationPendingMessageDeliverySchema } from "./conversation-feed-BVAOga0H.js";
30
- import { $ as actOnReviewItem, A as createProductionConversationWorkOptions, B as clearSlackPendingReactions, C as createConversationForViewer, D as readConversationPendingMessages, E as cancelConversationPendingMessagesForViewer, F as isAllowedSignInEmail, G as createSlackWebApiStatusSender, H as stripLeadingBotMention, I as readEnvList, J as stopConversation, K as SubscribedReplyReason, L as resolveAllowedDomains, M as getProductionSlackAdapter, N as assertNoLegacyAllowedDomains, P as isAllowedDomain, Q as ReviewItemActionError, R as startProcessingReaction, S as appendConversationMessageForViewer, T as encodeConversationCursor, U as normalizeIncomingSlackThreadId, V as slackInboundMessageId, W as withNormalizedThreadId, X as recordSkippedConversationMessage, Y as parseContent, Z as bindMessageAuthorIdentityId, a as pinConversation, at as continueConversationInSlack, ct as archiveViewerDoneConversations, dt as setConversationAutoArchive, et as closeReviewItemsAnsweredByReply, ht as GET$4, i as readConversationFeed, it as canContinueInSlack, j as createProductionSlackWebhookServices, mt as enqueueAgentDispatch, n as steerConversationPendingMessagesForViewer, nt as reviewItemChange, ot as isMovableToSlack, q as getThreadStopDecision, rt as alreadyContinuesInSlackMessage, s as readConversationDetail, t as stopConversationTurnForViewer, tt as readReviewItemForUser, ut as runAutoArchiveSweep, w as decodeConversationCursor, y as readConversationRecordFromSql, z as buildSlackInboundMessage } from "./stop-Cze_pEL8.js";
31
- import { a as enqueueAgentInvocation, i as endAgentInvocationsOfStoppedWork } from "./work-EA98F0ia.js";
32
- import { n as enqueueAgentInvocationResult } from "./result-CEqQFrEf.js";
33
- import { o as unlinkProvider } from "./connections-B5pWh8e2.js";
34
- import { a as GET$5, i as publishAppHomeView, r as GET$6, t as receiveLocalOAuthCredential } from "./credential-sync-DwLkIvXI.js";
31
+ import { s as conversationPendingMessageDeliverySchema } from "./conversation-feed-BSMlGZnS.js";
32
+ import { $ as reviewItemChange, A as assertNoLegacyAllowedDomains, B as normalizeIncomingSlackThreadId, C as cancelConversationPendingMessagesForViewer, D as createProductionConversationWorkOptions, F as startProcessingReaction, G as stopConversation, H as createSlackWebApiStatusSender, I as buildSlackInboundMessage, J as bindMessageAuthorIdentityId, K as parseContent, L as clearSlackPendingReactions, M as isAllowedSignInEmail, N as readEnvList, O as createProductionSlackWebhookServices, P as resolveAllowedDomains, Q as readReviewItemForUser, R as slackInboundMessageId, S as encodeConversationCursor, U as SubscribedReplyReason, V as withNormalizedThreadId, W as getThreadStopDecision, X as actOnReviewItem, Y as ReviewItemActionError, Z as closeReviewItemsAnsweredByReply, a as pinConversation, at as archiveViewerDoneConversations, b as createConversationForViewer, ct as setConversationAutoArchive, dt as enqueueAgentDispatch, et as alreadyContinuesInSlackMessage, ft as GET$4, g as readConversationRecordFromSql, i as readConversationFeed, j as isAllowedDomain, k as getProductionSlackAdapter, n as steerConversationPendingMessagesForViewer, nt as continueConversationInSlack, q as recordSkippedConversationMessage, rt as isMovableToSlack, s as readConversationDetail, st as runAutoArchiveSweep, t as stopConversationTurnForViewer, tt as canContinueInSlack, w as readConversationPendingMessages, x as decodeConversationCursor, y as appendConversationMessageForViewer, z as stripLeadingBotMention } from "./stop-BCH9VNGf.js";
33
+ import { i as enqueueAgentInvocationResult, r as createEndStoppedChildWork } from "./result-CAujiaci.js";
34
+ import { o as unlinkProvider } from "./connections-B96JUM5o.js";
35
+ import { a as GET$5, i as publishAppHomeView, r as GET$6, t as receiveLocalOAuthCredential } from "./credential-sync-Blhx4_xf.js";
35
36
  import { t as nameRequestRoute } from "./sentry-route-name-BhwWnfqj.js";
36
- import { t as processConversationWork } from "./worker-BALVdWbv.js";
37
- import { t as bindMessageAgent } from "./message-BFnIwKpx.js";
38
- import { t as bindSpawnAgent } from "./spawn-YeqlNDv8.js";
37
+ import { c as resumeConversationDelivery } from "./conversation-turn-CZWBr091.js";
38
+ import { t as processConversationWork } from "./worker-B1skZlit.js";
39
+ import { t as bindMessageAgent } from "./message-BOZEIuxy.js";
40
+ import { t as bindSpawnAgent } from "./spawn-CwMjRRtn.js";
41
+ import { a as pluginTaskQueueConsumer, n as createVercelPluginTaskCallback, o as registerVercelPluginTaskDevConsumer } from "./task-queue-N0kuCknH.js";
42
+ import { t as processPluginTask } from "./task-runner-COOwR8qm.js";
39
43
  import { createRequire } from "node:module";
40
44
  import { Hono } from "hono";
41
45
  import { createHash, randomBytes, randomUUID, timingSafeEqual } from "node:crypto";
@@ -418,7 +422,13 @@ function createHeartbeatContext(args) {
418
422
  let dispatchCount = 0;
419
423
  return {
420
424
  plugin: { name: pluginName },
425
+ annotations: { forConversation: (conversationId) => createPluginAnnotations({
426
+ conversationId,
427
+ db: getDb(),
428
+ plugin: pluginName
429
+ }) },
421
430
  cache: createPluginCache(pluginName),
431
+ codeChanges: createCodeChangePublisher(pluginName),
422
432
  nowMs: args.nowMs,
423
433
  db: getDb(),
424
434
  embedder: createPluginEmbedder(pluginName),
@@ -1560,7 +1570,7 @@ async function runHeartbeat(args) {
1560
1570
  const queue = args.conversationWorkQueue ?? getVercelConversationWorkQueue();
1561
1571
  const events = args.events ?? createEventAppPublisher({ conversationWork: () => ({ queue }) });
1562
1572
  await recoverConversationWork({
1563
- beforeWorkStops: endAgentInvocationsOfStoppedWork,
1573
+ beforeWorkStops: createEndStoppedChildWork({ queue }),
1564
1574
  nowMs: args.nowMs,
1565
1575
  queue
1566
1576
  });
@@ -2465,11 +2475,12 @@ async function refreshCards(services, user, itemId) {
2465
2475
  });
2466
2476
  }
2467
2477
  /**
2468
- * Do one person action from a Slack card. The thread of the card gets the
2469
- * action as Slack input from the person, like a typed reply. The other
2470
- * linked Conversations get messages from
2471
- * `actOnReviewItem`. An expected failure, such as an item that is already
2472
- * closed, goes to the person as an ephemeral message.
2478
+ * Do one person action from a Slack card. The thread of the card gets an
2479
+ * answer as Slack input from the person, like a typed reply. A dismiss
2480
+ * starts no Turn, so the thread gets the same recorded Message as the other
2481
+ * linked Conversations, from `actOnReviewItem`. An expected failure, such as
2482
+ * an item that is already closed, goes to the person as an ephemeral
2483
+ * message.
2473
2484
  */
2474
2485
  async function act(args) {
2475
2486
  const { services, target } = args;
@@ -2483,12 +2494,13 @@ async function act(args) {
2483
2494
  queue: services.queue,
2484
2495
  show: createSlackReviewItemShow(() => services.adapter)
2485
2496
  };
2497
+ const recordOnly = args.action === "dismiss";
2486
2498
  let item;
2487
2499
  try {
2488
2500
  const current = await readReviewItemForUser(actor.user, args.itemId);
2489
2501
  item = await actOnReviewItem({
2490
2502
  action: args.action,
2491
- exceptConversationId: conversationId,
2503
+ ...recordOnly ? void 0 : { exceptConversationId: conversationId },
2492
2504
  firstCloseOnly: true,
2493
2505
  delivery,
2494
2506
  id: current.id,
@@ -2501,7 +2513,7 @@ async function act(args) {
2501
2513
  await refreshCards(services, actor.user, args.itemId);
2502
2514
  return;
2503
2515
  }
2504
- if (!item.conversationIds.includes(conversationId)) return;
2516
+ if (recordOnly || !item.conversationIds.includes(conversationId)) return;
2505
2517
  const change = reviewItemChange(args.action, actor.user);
2506
2518
  try {
2507
2519
  await services.persistMessage(buildSlackInteractionInput({
@@ -3214,12 +3226,20 @@ async function resolveSlackConversationId(args) {
3214
3226
  const providerThread = parseSlackThreadId(args.canonicalThreadId);
3215
3227
  const conversationStore = args.conversationStore ?? getConversationStore();
3216
3228
  if (!providerThread) return args.canonicalThreadId;
3217
- return await conversationStore.getConversationIdByProviderConversation({
3229
+ const thread = {
3218
3230
  provider: "slack",
3219
3231
  providerDestinationId: providerThread.channelId,
3220
3232
  providerTenantId: args.installation.teamId ?? "",
3221
3233
  providerConversationId: providerThread.threadTs
3222
- }) ?? args.canonicalThreadId;
3234
+ };
3235
+ const ownerId = await conversationStore.getConversationIdByProviderConversation(thread);
3236
+ if (ownerId) return ownerId;
3237
+ if (args.claimAtMs === void 0 || !args.installation.teamId) return args.canonicalThreadId;
3238
+ return await conversationStore.claimProviderConversation({
3239
+ ...thread,
3240
+ atMs: args.claimAtMs,
3241
+ conversationId: args.canonicalThreadId
3242
+ });
3223
3243
  }
3224
3244
  /**
3225
3245
  * Build the mailbox input for one Slack message. A message and a `stop` get
@@ -3244,6 +3264,7 @@ async function persistSlackMessage(args) {
3244
3264
  const canonicalThreadId = normalizeIncomingSlackThreadId(args.message.threadId, args.message);
3245
3265
  const conversationId = args.conversationId ?? await resolveSlackConversationId({
3246
3266
  canonicalThreadId,
3267
+ ...args.route === "mention" ? { claimAtMs: args.receivedAtMs } : void 0,
3247
3268
  conversationStore: args.conversationStore,
3248
3269
  installation: args.installation
3249
3270
  });
@@ -3323,6 +3344,7 @@ async function routeParsedMessage(args) {
3323
3344
  await bindSlackAuthorIdentity(message, args.installation);
3324
3345
  const conversationId = await resolveSlackConversationId({
3325
3346
  canonicalThreadId,
3347
+ ...route === "mention" && !stopDecision ? { claimAtMs: args.receivedAtMs } : void 0,
3326
3348
  conversationStore: args.conversationStore,
3327
3349
  installation: args.installation
3328
3350
  });
@@ -7031,8 +7053,8 @@ function registerGetConversationTool(server, { user }) {
7031
7053
  /**
7032
7054
  * Own the MCP view of one Review item, shared by the review item tools.
7033
7055
  *
7034
- * MCP Review items stay read-only. An answer or dismissal sends a message to
7035
- * the linked Conversations, which can start a Turn.
7056
+ * MCP Review items stay read-only. An answer sends a message to the linked
7057
+ * Conversations, which can start a Turn. A dismiss starts no Turn.
7036
7058
  */
7037
7059
  /** MCP view of one Review item. Answers happen in Slack or the dashboard. */
7038
7060
  const mcpReviewItemSchema = z.object({
@@ -7956,7 +7978,6 @@ function dashboardHostRoutePaths(dashboard, authenticatedRoutes = []) {
7956
7978
  const pagePaths = [
7957
7979
  basePath,
7958
7980
  pagePath("admin"),
7959
- pagePath("board"),
7960
7981
  pagePath("code"),
7961
7982
  `${pagePath("code")}/*`,
7962
7983
  conversationsPath,
@@ -8003,7 +8024,6 @@ function dashboardHostRoutePaths(dashboard, authenticatedRoutes = []) {
8003
8024
  "/api/automations/*",
8004
8025
  "/api/skills",
8005
8026
  "/api/skills/*",
8006
- "/api/board",
8007
8027
  "/api/code",
8008
8028
  "/api/code/*",
8009
8029
  "/api/connections",
@@ -0,0 +1,61 @@
1
+ import { o as isUserActor } from "./actor-6jsm_v96.js";
2
+ // src/chat/task-execution/attempt-selection.ts
3
+ function inputOwner(message) {
4
+ return {
5
+ authorId: message.input.authorId,
6
+ identityId: message.input.authorIdentityId,
7
+ source: message.source
8
+ };
9
+ }
10
+ function turnOwner(turn) {
11
+ return {
12
+ authorId: isUserActor(turn.actor) ? turn.actor.userId : void 0,
13
+ identityId: turn.actorIdentityId,
14
+ source: turn.source?.kind
15
+ };
16
+ }
17
+ /**
18
+ * One Turn has one Actor and one Source: it runs with that Actor's
19
+ * credentials, so input from anyone else must not join it. Every value that
20
+ * both sides know must match, and they must share an Identity id or an author
21
+ * id. Input with no known author matches nothing.
22
+ */
23
+ function hasSameOwner(a, b) {
24
+ if (a.source && b.source && a.source !== b.source) return false;
25
+ const sameIdentity = a.identityId && b.identityId ? a.identityId === b.identityId : void 0;
26
+ const sameAuthor = a.authorId && b.authorId ? a.authorId === b.authorId : void 0;
27
+ return sameIdentity !== false && sameAuthor !== false && (sameIdentity ?? sameAuthor) === true;
28
+ }
29
+ /** True when two Inbound messages may share one Turn. */
30
+ function canShareTurn(a, b) {
31
+ return hasSameOwner(inputOwner(a), inputOwner(b));
32
+ }
33
+ /** True when an Inbound message may join `turn`. */
34
+ function canJoinTurn(turn, message) {
35
+ return hasSameOwner(turnOwner(turn), inputOwner(message));
36
+ }
37
+ function selectContiguousTurnBatch(messages) {
38
+ const first = messages[0];
39
+ if (!first) return [];
40
+ const nextTurnIndex = messages.findIndex((message, index) => index > 0 && !canShareTurn(first, message));
41
+ return messages.slice(0, nextTurnIndex === -1 ? messages.length : nextTurnIndex);
42
+ }
43
+ /**
44
+ * True when an interrupt can start its own attempt.
45
+ *
46
+ * A steered web message must not start a second Turn while a yielded Turn
47
+ * waits to resume. It stays pending for that Turn's drain or the next attempt.
48
+ */
49
+ function isAttemptInterrupt(message, work) {
50
+ return message.delivery === "interrupt" && !(work.execution.status === "paused" && message.source === "web");
51
+ }
52
+ /** Prioritize interrupts while keeping each attempt to one Actor and Source. */
53
+ function selectAttemptMessages(work) {
54
+ const messages = work.messages;
55
+ const interrupts = messages.filter((message) => isAttemptInterrupt(message, work));
56
+ if (interrupts.length > 0) return selectContiguousTurnBatch(interrupts);
57
+ if (work.execution.status === "paused") return [];
58
+ const nonEventMessages = messages.filter((message) => message.source !== "event");
59
+ return selectContiguousTurnBatch(nonEventMessages.length > 0 ? nonEventMessages : messages);
60
+ }
61
+ export { selectAttemptMessages as i, canShareTurn as n, isAttemptInterrupt as r, canJoinTurn as t };
@@ -1,5 +1,5 @@
1
1
  import { c as resolveLocalScheduleAtMs, i as getFirstRunAtMs, o as getZonedDateTimeParts, s as isValidTimeZone } from "./schedule-cP0AACm1.js";
2
- import { i as actorIdentitySchema } from "./conversation-CMkSmi02.js";
2
+ import { i as actorIdentitySchema } from "./conversation-CvcBU1z2.js";
3
3
  import * as z from "zod";
4
4
  import { actorUserIdSchema, destinationVisibilitySchema, eventMatchFieldsSchema, eventMatchSchema, eventReachSchema, eventTypeSchema, pluginEventTypeSchema, slackDestinationSchema, taskOutcomeSchema } from "@sentry/junior-plugin-api";
5
5
  // src/chat/automations/task.ts
@@ -1,5 +1,5 @@
1
- import { i as getChatConfig } from "./config-CCPHvTqx.js";
2
- import { E as withSpan, h as logWarn, m as logInfo, p as logException } from "./logging-D0svFM8r.js";
1
+ import { i as getChatConfig } from "./config-Dj9M_nqB.js";
2
+ import { E as withSpan, h as logWarn, m as logInfo, p as logException } from "./logging-CQjlDQYX.js";
3
3
  import { t as readJuniorSecret } from "./secrets-DebYU866.js";
4
4
  import { AsyncLocalStorage } from "node:async_hooks";
5
5
  import { createHash, createHmac, timingSafeEqual } from "node:crypto";
@@ -369,7 +369,7 @@ function cacheWarmupCallback() {
369
369
  maxDeliveries: 1,
370
370
  onRejected: logCacheWarmupRejected,
371
371
  run: async (message) => {
372
- const { runCacheWarmup } = await import("./warmup-CY2ArYag.js").then((n) => n.o);
372
+ const { runCacheWarmup } = await import("./warmup-Bskrwmk1.js").then((n) => n.o);
373
373
  await runCacheWarmup(message);
374
374
  },
375
375
  skip: () => !getChatConfig().cacheWarmingEnabled,
@@ -500,90 +500,6 @@ async function sendWorkspaceSnapshotJob(message) {
500
500
  async function sendNextWorkspaceSnapshotJob(message) {
501
501
  await send(message);
502
502
  }
503
- // src/chat/plugins/task-queue.ts
504
- /**
505
- * Delivery for plugin-registered tasks.
506
- *
507
- * Plugins register named tasks. This module owns the shared signed message,
508
- * send path, and HTTP/local callback. Core keeps one topic and one runner.
509
- */
510
- /** Deploy topic name. Keep stable for Vercel queue wiring. */
511
- const PLUGIN_TASK_QUEUE_TOPIC = "junior_plugin_tasks";
512
- const PLUGIN_TASK_DEV_CONSUMER_GROUP = "junior_plugin_tasks_dev";
513
- const PLUGIN_TASK_MAX_DELIVERIES = 5;
514
- const PLUGIN_TASK_SIGN_CONTEXT = "junior.plugin_task_queue.v1";
515
- const PLUGIN_TASK_SIGN_VERSION = "v1";
516
- const pluginTaskParamsSchema = z.object({
517
- conversationId: z.string().min(1),
518
- sessionId: z.string().min(1)
519
- }).strict();
520
- const pluginTaskSign = {
521
- context: PLUGIN_TASK_SIGN_CONTEXT,
522
- schema: z.object({
523
- name: z.string().min(1),
524
- params: pluginTaskParamsSchema,
525
- plugin: z.string().min(1)
526
- }).strict(),
527
- signatureVersion: PLUGIN_TASK_SIGN_VERSION,
528
- parts: (message) => [
529
- message.plugin,
530
- message.name,
531
- message.params.conversationId,
532
- message.params.sessionId
533
- ]
534
- };
535
- /** Build the stable id used for delivery dedupe and tracing. */
536
- function pluginTaskId(args) {
537
- return `plugin-task_${createHash("sha256").update(args.plugin).update("\0").update(args.name).update("\0").update(args.params.conversationId).update("\0").update(args.params.sessionId).digest("hex").slice(0, 32)}`;
538
- }
539
- /** Sign a plugin task message for tests and local checks. */
540
- function signPluginTaskQueueMessage(message, nowMs = Date.now()) {
541
- return signQueueMessage(pluginTaskSign, message, nowMs);
542
- }
543
- function verifyPluginTaskQueueMessage(value, nowMs = Date.now()) {
544
- return verifyQueueMessage(pluginTaskSign, value, nowMs);
545
- }
546
- function logPluginTaskQueueMessageRejected(reason, metadata) {
547
- logWarn("plugin.task.queue_message.rejected", {
548
- "app.queue.consumer_group": metadata.consumerGroup,
549
- "app.queue.delivery_count": metadata.deliveryCount,
550
- "app.queue.message_id": metadata.messageId,
551
- "app.queue.reject_reason": reason,
552
- "app.queue.topic_name": metadata.topicName
553
- });
554
- }
555
- function pluginTaskCallback() {
556
- return queueCallback({
557
- consumerGroup: PLUGIN_TASK_DEV_CONSUMER_GROUP,
558
- maxDeliveries: PLUGIN_TASK_MAX_DELIVERIES,
559
- onRejected: logPluginTaskQueueMessageRejected,
560
- run: async (message) => {
561
- const { processPluginTask } = await import("./task-runner-CMiNGsER.js").then((n) => n.r);
562
- await processPluginTask(message);
563
- },
564
- topic: PLUGIN_TASK_QUEUE_TOPIC,
565
- verify: verifyPluginTaskQueueMessage
566
- });
567
- }
568
- /** Send one plugin task through the shared signed delivery path. */
569
- async function sendVercelPluginTask(message) {
570
- await getQueueProvider().send(PLUGIN_TASK_QUEUE_TOPIC, signPluginTaskQueueMessage(message), {
571
- idempotencyKey: pluginTaskId(message),
572
- retentionSeconds: QUEUE_SIGNATURE_MAX_AGE_MS / 1e3
573
- });
574
- }
575
- /** Create the HTTP callback for plugin tasks. */
576
- function createVercelPluginTaskCallback() {
577
- return pluginTaskCallback().create();
578
- }
579
- /** Return the queue consumer for plugin tasks, for a pulling queue worker. */
580
- function pluginTaskQueueConsumer() {
581
- return pluginTaskCallback().consumer;
582
- }
583
- /** Register the local-dev consumer for plugin tasks. */
584
- function registerVercelPluginTaskDevConsumer() {
585
- return pluginTaskCallback().registerDev();
586
- }
587
503
  // src/chat/services/background-compaction-queue.ts
588
504
  /**
589
505
  * Messages of background compaction jobs.
@@ -623,4 +539,4 @@ const vercelBackgroundCompactionQueue = { send: async (message) => {
623
539
  retentionSeconds: QUEUE_SIGNATURE_MAX_AGE_MS / 1e3
624
540
  });
625
541
  } };
626
- export { getQueueProvider as A, cacheWarmupQueueConsumer as C, QUEUE_SIGNATURE_MAX_AGE_MS as D, sendCacheWarmup as E, queueCallback as O, CACHE_WARMUP_QUEUE_TOPIC as S, registerVercelCacheWarmupDevConsumer as T, resolveConversationWorkQueueTopic as _, PLUGIN_TASK_QUEUE_TOPIC as a, conversationQueueMessageSchema as b, pluginTaskParamsSchema as c, sendVercelPluginTask as d, WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC as f, getVercelConversationWorkQueue as g, verifyWorkspaceSnapshotJobMessage as h, verifyBackgroundCompactionMessage as i, getTurnRequestDeadline as k, pluginTaskQueueConsumer as l, sendWorkspaceSnapshotJob as m, backgroundCompactionId as n, createVercelPluginTaskCallback as o, sendNextWorkspaceSnapshotJob as p, vercelBackgroundCompactionQueue as r, pluginTaskId as s, BACKGROUND_COMPACTION_QUEUE_TOPIC as t, registerVercelPluginTaskDevConsumer as u, verifyConversationQueueMessage as v, createVercelCacheWarmupCallback as w, isConversationQueueMessageRejectedError as x, ConversationQueueMessageRejectedError as y };
542
+ export { queueCallback as C, verifyQueueMessage as S, getQueueProvider as T, createVercelCacheWarmupCallback as _, WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC as a, QUEUE_SIGNATURE_MAX_AGE_MS as b, verifyWorkspaceSnapshotJobMessage as c, verifyConversationQueueMessage as d, ConversationQueueMessageRejectedError as f, cacheWarmupQueueConsumer as g, CACHE_WARMUP_QUEUE_TOPIC as h, verifyBackgroundCompactionMessage as i, getVercelConversationWorkQueue as l, isConversationQueueMessageRejectedError as m, backgroundCompactionId as n, sendNextWorkspaceSnapshotJob as o, conversationQueueMessageSchema as p, vercelBackgroundCompactionQueue as r, sendWorkspaceSnapshotJob as s, BACKGROUND_COMPACTION_QUEUE_TOPIC as t, resolveConversationWorkQueueTopic as u, registerVercelCacheWarmupDevConsumer as v, getTurnRequestDeadline as w, signQueueMessage as x, sendCacheWarmup as y };
@@ -1,5 +1,5 @@
1
- import { l as completeObject, n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-CD11tfG8.js";
2
- import { W as briefCodeChangeSchema, Y as parseBriefInput, d as conversationEventPageSchema, l as conversationDetailReportSchema, q as briefResourceLabel } from "./conversation-CMkSmi02.js";
1
+ import { l as completeObject, n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-BlutWLNt.js";
2
+ import { J as parseBriefInput, K as briefResourceLabel, U as briefCodeChangeSchema, d as conversationEventPageSchema, l as conversationDetailReportSchema } from "./conversation-CvcBU1z2.js";
3
3
  import { CLI_USAGE } from "./cli/run.js";
4
4
  import path from "node:path";
5
5
  import * as z from "zod";
@@ -262,7 +262,7 @@ async function parseRunOptions(argv) {
262
262
  * token.
263
263
  */
264
264
  async function configuredBriefModelId() {
265
- const { botConfig } = await import("./config-CCPHvTqx.js").then((n) => n.r);
265
+ const { botConfig } = await import("./config-Dj9M_nqB.js").then((n) => n.r);
266
266
  return botConfig.fastModelId;
267
267
  }
268
268
  function apiUrl(baseUrl, pathname) {
@@ -1,5 +1,5 @@
1
1
  import { v as __exportAll } from "./sentry-BRTJqumy.js";
2
- import { t as createPluginCatalogRuntime } from "./registry-CHewwYEo.js";
2
+ import { t as createPluginCatalogRuntime } from "./registry-BDWgCJDf.js";
3
3
  // src/chat/plugins/catalog-runtime.ts
4
4
  var catalog_runtime_exports = /* @__PURE__ */ __exportAll({ pluginCatalogRuntime: () => pluginCatalogRuntime });
5
5
  const pluginCatalogRuntime = createPluginCatalogRuntime();
package/dist/cli/chat.js CHANGED
@@ -1,4 +1,4 @@
1
- import { n as executeAgentRun, t as createAgentRunner } from "../agent-runner-HoQiUKLL.js";
1
+ import { n as executeAgentRun, t as createAgentRunner } from "../agent-runner-CneTquAE.js";
2
2
  import { t as loadAppPluginSet } from "../plugin-module-Cf5gVPWP.js";
3
3
  import path from "node:path";
4
4
  import { createHash, randomUUID } from "node:crypto";
@@ -99,10 +99,10 @@ async function loadLocalPluginSet() {
99
99
  async function configureLocalChatPlugins(pluginSet) {
100
100
  const [pluginsModule, agentHooksModule, catalogRuntimeModule, validationModule, databaseModule] = await Promise.all([
101
101
  import("../plugins-HYh_JOdw.js").then((n) => n.o),
102
- import("../projection-B6VS7kbo.js").then((n) => n.jn),
103
- import("../catalog-runtime-CpCmlD9L.js").then((n) => n.t),
104
- import("../validation-Du7NdkOR.js").then((n) => n.r),
105
- import("../db-C1M1y-bh.js").then((n) => n.n)
102
+ import("../projection-B08mfi0u.js").then((n) => n.qn),
103
+ import("../catalog-runtime-0kuQqYL4.js").then((n) => n.t),
104
+ import("../validation-Ba2OcUse.js").then((n) => n.r),
105
+ import("../db-Br0tfAo7.js").then((n) => n.n)
106
106
  ]);
107
107
  const resolvedPluginSet = pluginSet === void 0 ? await loadLocalPluginSet() : pluginSet ?? void 0;
108
108
  const plugins = pluginsModule.pluginRuntimeRegistrationsFromPluginSet(resolvedPluginSet);
@@ -152,22 +152,26 @@ function localDevServerUrl() {
152
152
  async function prepareLocalChatRun(io, pluginSet) {
153
153
  defaultStateAdapterForLocalChat();
154
154
  await configureLocalChatPlugins(pluginSet);
155
- const { setBriefsConfig } = await import("../projection-B6VS7kbo.js").then((n) => n.Wn);
155
+ const { setBriefsConfig } = await import("../projection-B08mfi0u.js").then((n) => n.or);
156
156
  setBriefsConfig({ enabled: true });
157
- const { runLocalAgentTurn } = await import("../runner-BtWvJslp.js");
158
- const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-BXRtD6Fk.js");
157
+ const { runLocalAgentTurn } = await import("../runner-D2Chc02N.js");
158
+ const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-V_DuMuNX.js");
159
159
  const { createLocalOAuthState } = await import("../oauth-relay-CsfIazeF.js").then((n) => n.t);
160
- const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-ByftwJVt.js");
161
- const { bindSpawnAgent } = await import("../spawn-YeqlNDv8.js").then((n) => n.n);
162
- const { bindMessageAgent } = await import("../message-BFnIwKpx.js").then((n) => n.n);
163
- const { createChildConversationWorker } = await import("../result-CEqQFrEf.js").then((n) => n.i);
164
- const { skipInputAfterConversationStop } = await import("../session-stop-hYNTNpVf.js").then((n) => n.a);
160
+ const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-CFoJduFj.js");
161
+ const { bindSpawnAgent } = await import("../spawn-CwMjRRtn.js").then((n) => n.n);
162
+ const { bindMessageAgent } = await import("../message-BOZEIuxy.js").then((n) => n.n);
163
+ const { createChildConversationWorker, createDeliverToParent } = await import("../result-CAujiaci.js").then((n) => n.o);
164
+ const { createConversationTurnWorker } = await import("../conversation-turn-CZWBr091.js").then((n) => n.t);
165
+ const { skipInputAfterConversationStop } = await import("../session-stop-B-I1rAS1.js").then((n) => n.a);
165
166
  const { createLocalConversationWork } = await import("../conversation-work-BaT_T6EB.js");
166
- const { processConversationWork } = await import("../worker-BALVdWbv.js").then((n) => n.n);
167
+ const { processConversationWork } = await import("../worker-B1skZlit.js").then((n) => n.n);
167
168
  let agentRunner;
168
169
  const localConversationWork = createLocalConversationWork(async (message) => {
169
170
  if (!agentRunner) throw new Error("Local agent runner is not ready");
170
- const childWorker = createChildConversationWorker(agentRunner, { queue: localConversationWork.queue });
171
+ const childWorker = createChildConversationWorker(agentRunner, {
172
+ queue: localConversationWork.queue,
173
+ runTurn: createConversationTurnWorker(agentRunner, void 0, createDeliverToParent({ queue: localConversationWork.queue }))
174
+ });
171
175
  await processConversationWork(message, {
172
176
  queue: localConversationWork.queue,
173
177
  run: async (context) => {
package/dist/cli/check.js CHANGED
@@ -1,6 +1,6 @@
1
- import { N as JUNIOR_HEARTBEAT_ROUTE, R as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, j as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "../logging-D0svFM8r.js";
2
- import { v as parseInlinePluginManifest, y as parsePluginManifest } from "../registry-CHewwYEo.js";
3
- import { i as parseSkillFile } from "../skills-DXgd5Inh.js";
1
+ import { N as JUNIOR_HEARTBEAT_ROUTE, R as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, j as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "../logging-CQjlDQYX.js";
2
+ import { v as parseInlinePluginManifest, y as parsePluginManifest } from "../registry-BDWgCJDf.js";
3
+ import { i as parseSkillFile } from "../skills-B0m1nZ_j.js";
4
4
  import path from "node:path";
5
5
  import fs from "node:fs/promises";
6
6
  import { pathToFileURL } from "node:url";
package/dist/cli/main.js CHANGED
@@ -45,13 +45,13 @@ async function runChat(argv, pluginSet) {
45
45
  return await (await import("./chat.js")).runChat(argv, void 0, { pluginSet });
46
46
  }
47
47
  async function runAdmin(argv) {
48
- return await (await import("../admin-z_lgDi-z.js")).runAdmin(argv);
48
+ return await (await import("../admin-tmGIw4KS.js")).runAdmin(argv);
49
49
  }
50
50
  async function runServiceAccount(argv) {
51
- return await (await import("../service-account-BZEuMKdo.js")).runServiceAccount(argv);
51
+ return await (await import("../service-account-CERfXEVU.js")).runServiceAccount(argv);
52
52
  }
53
53
  async function runBriefs(argv) {
54
- return await (await import("../briefs-BXECHduJ.js")).runBriefs(argv);
54
+ return await (await import("../briefs-uFTuhMqA.js")).runBriefs(argv);
55
55
  }
56
56
  function topLevelCommand(argv) {
57
57
  return (argv[0] === "--" ? argv.slice(1) : argv)[0];
@@ -1,7 +1,7 @@
1
- import { Hn as validatePlugins, Vn as setPlugins, Xa as createPluginLogger } from "../projection-B6VS7kbo.js";
2
- import { o as getDb } from "../db-C1M1y-bh.js";
3
- import { n as pluginCatalogRuntime } from "../catalog-runtime-CpCmlD9L.js";
4
- import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-Du7NdkOR.js";
1
+ import { fo as createPluginLogger, ir as validatePlugins, rr as setPlugins } from "../projection-B08mfi0u.js";
2
+ import { o as getDb } from "../db-Br0tfAo7.js";
3
+ import { n as pluginCatalogRuntime } from "../catalog-runtime-0kuQqYL4.js";
4
+ import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-Ba2OcUse.js";
5
5
  import { a as pluginRuntimeRegistrationsFromPluginSet, i as pluginCliRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "../plugins-HYh_JOdw.js";
6
6
  import { t as loadAppPluginSet } from "../plugin-module-Cf5gVPWP.js";
7
7
  import { stderr, stdout } from "node:process";
@@ -1,7 +1,7 @@
1
- import { Ti as create, ja as SANDBOX_RUNTIME } from "../projection-B6VS7kbo.js";
2
- import { n as pluginCatalogRuntime } from "../catalog-runtime-CpCmlD9L.js";
3
- import { r as disconnectStateAdapter } from "../state-C3CbtD_m.js";
4
- import { n as resolve } from "../resolve-1owMH4qo.js";
1
+ import { Vi as create, qa as SANDBOX_RUNTIME } from "../projection-B08mfi0u.js";
2
+ import { n as pluginCatalogRuntime } from "../catalog-runtime-0kuQqYL4.js";
3
+ import { r as disconnectStateAdapter } from "../state-DFnmLmfn.js";
4
+ import { n as resolve } from "../resolve-2Z_o_SsI.js";
5
5
  // src/cli/snapshot-create.ts
6
6
  const DEFAULT_TIMEOUT_MS = 6e5;
7
7
  function progressMessage(phase) {
@@ -1,4 +1,4 @@
1
- import "../db-B3iyr_Or.js";
1
+ import "../db-CrtyFRz7.js";
2
2
  import { n as JuniorPluginSet } from "../plugins-B_0Cr0MO.js";
3
3
  interface UpgradeIo {
4
4
  info: (line: string) => void;