@sentry/junior 0.239.0 → 0.241.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 (64) hide show
  1. package/dist/{admin-Cc-iA6z9.js → admin-CJkjl-aN.js} +1 -1
  2. package/dist/{agent-hooks-DzfA5m3R.js → agent-hooks-C5zYOaJk.js} +1972 -1866
  3. package/dist/{agent-runner--1wC26S6.js → agent-runner-CMZ6lFQe.js} +377 -1227
  4. package/dist/api/schema.d.ts +9 -0
  5. package/dist/api/schema.js +2 -2
  6. package/dist/api.d.ts +1 -1
  7. package/dist/api.js +22 -21
  8. package/dist/{app-FB2hmHpZ.d.ts → app-MEd7wbF0.d.ts} +1 -1
  9. package/dist/app.d.ts +1 -1
  10. package/dist/app.js +105 -31
  11. package/dist/{automation-CrQGQ2MT.js → automation-gznOMaQ2.js} +13 -255
  12. package/dist/{briefs-DGc2Thua.js → briefs-CsQbFjRi.js} +2 -2
  13. package/dist/cadence-D00SCzT1.js +256 -0
  14. package/dist/{catalog-runtime-DpB_hG_I.js → catalog-runtime-Tz0O2MZe.js} +1 -1
  15. package/dist/cli/chat.js +12 -12
  16. package/dist/cli/check.js +3 -3
  17. package/dist/cli/main.js +2 -2
  18. package/dist/cli/plugins.js +4 -4
  19. package/dist/cli/snapshot-create.js +3 -3
  20. package/dist/cli/upgrade.d.ts +1 -1
  21. package/dist/cli/upgrade.js +3 -3
  22. package/dist/{client-DNf-sJmM.js → client-CRZ-i1tH.js} +2 -2
  23. package/dist/{config-B8QN-04U.js → config-CCI82OTD.js} +2 -2
  24. package/dist/{conversation-privacy-CrYizZM3.js → conversation-privacy-D5Byl5eC.js} +1 -1
  25. package/dist/{credential-sync-BG_Yvja8.js → credential-sync-DUpSxUum.js} +14 -14
  26. package/dist/{db-CWZP77Ex.d.ts → db-Ca9Nt5ci.d.ts} +1 -1
  27. package/dist/{executor-BQV1Zc1z.js → executor-CewKi7EG.js} +4 -2
  28. package/dist/{images-C_0iwPsW.js → images-DY6Pxq4w.js} +2 -2
  29. package/dist/instrumentation.js +2 -2
  30. package/dist/{job-queue-D82gksYM.js → job-queue-C6o2aJQ6.js} +1 -1
  31. package/dist/{logging-Crg0e1jb.js → logging-LQnLlPf8.js} +1 -1
  32. package/dist/nitro.d.ts +1 -1
  33. package/dist/nitro.js +3 -3
  34. package/dist/{oauth-authorization-Bdu39G-H.js → oauth-authorization-Clzkm-Ts.js} +1 -1
  35. package/dist/{oauth-callback-server-eJfI6skP.js → oauth-callback-server-DcYAJSEz.js} +2 -2
  36. package/dist/{pending-auth-DauOaies.js → pending-auth-CT3ojhKe.js} +2 -2
  37. package/dist/{profile-XzHSfIah.js → profile-mWuVZ8ht.js} +4 -4
  38. package/dist/{registry-BJME30oR.js → registry-DPDH6s5G.js} +1 -1
  39. package/dist/{resolve-ZKXfsZuZ.js → resolve-BAN8BSGy.js} +2 -2
  40. package/dist/{runner-DkHL8vRA.js → runner-CqXZJfzk.js} +9 -9
  41. package/dist/{sandbox-egress-signals-BEQsK7ym.js → sandbox-egress-signals-DFUUokws.js} +1 -1
  42. package/dist/{schema-CxWAN2zq.js → schema-Cabm4jcj.js} +1 -1
  43. package/dist/{skills-CMl248J3.js → skills-BtHhSATy.js} +2 -2
  44. package/dist/{spawn-DrvZYrTQ.js → spawn-BszkFJKJ.js} +2 -2
  45. package/dist/{store-BxxbxBlm.d.ts → store-DoewL5mG.d.ts} +0 -7
  46. package/dist/{task-queue-BMzTARMo.js → task-queue-1LP6benz.js} +3 -3
  47. package/dist/{task-runner-CXTpWSmw.js → task-runner-kLN3HC-_.js} +54 -12
  48. package/dist/{checkpoint-CN7yMfSo.js → tasks-CO52vLkI.js} +1064 -18
  49. package/dist/{thread-state-BM1sLptE.js → thread-state-CaFRG5Mh.js} +6 -6
  50. package/dist/{turn-failure-response-ISrbka5I.js → turn-failure-response-Dmovuiq1.js} +9 -8
  51. package/dist/{turn-lifecycle-f7TPxQsc.js → turn-lifecycle-DGqZgU6J.js} +1 -1
  52. package/dist/{turn-session-routing-BcAD7onh.js → turn-session-routing-B_v8Wbn4.js} +1 -1
  53. package/dist/{validation-Bo6BHmig.js → validation-B4L2Rmiw.js} +1 -1
  54. package/dist/{version-Cv__n5ue.js → version-DiR36OaN.js} +1 -1
  55. package/dist/version.js +1 -1
  56. package/dist/{viewer-EftpWXcF.js → viewer-D6stAU7h.js} +9 -11
  57. package/dist/{web-authorization-BLDXKk2u.js → web-authorization-DLMBx2nL.js} +6 -6
  58. package/dist/{web-input-DSa6geKr.js → web-input---xuox1t.js} +136 -147
  59. package/dist/{work-WOk5DovU.js → work-G-HdoOSF.js} +7 -7
  60. package/dist/{worker-B7rtMFzw.js → worker-CDUDfL9P.js} +5 -5
  61. package/migrations/0049_event_automation_status_reason.sql +1 -0
  62. package/migrations/meta/0049_snapshot.json +3581 -0
  63. package/migrations/meta/_journal.json +8 -1
  64. package/package.json +5 -5
@@ -3417,8 +3417,10 @@ export declare const eventAutomationSummarySchema: z.ZodObject<{
3417
3417
  resource: z.ZodString;
3418
3418
  source: z.ZodString;
3419
3419
  triggerAvailable: z.ZodBoolean;
3420
+ statusReason: z.ZodOptional<z.ZodString>;
3420
3421
  status: z.ZodEnum<{
3421
3422
  paused: "paused";
3423
+ blocked: "blocked";
3422
3424
  active: "active";
3423
3425
  }>;
3424
3426
  }, z.core.$strict>;
@@ -3529,8 +3531,10 @@ export declare const automationSummarySchema: z.ZodDiscriminatedUnion<[z.ZodObje
3529
3531
  resource: z.ZodString;
3530
3532
  source: z.ZodString;
3531
3533
  triggerAvailable: z.ZodBoolean;
3534
+ statusReason: z.ZodOptional<z.ZodString>;
3532
3535
  status: z.ZodEnum<{
3533
3536
  paused: "paused";
3537
+ blocked: "blocked";
3534
3538
  active: "active";
3535
3539
  }>;
3536
3540
  }, z.core.$strict>], "kind">;
@@ -3698,8 +3702,10 @@ export declare const automationListSchema: z.ZodObject<{
3698
3702
  resource: z.ZodString;
3699
3703
  source: z.ZodString;
3700
3704
  triggerAvailable: z.ZodBoolean;
3705
+ statusReason: z.ZodOptional<z.ZodString>;
3701
3706
  status: z.ZodEnum<{
3702
3707
  paused: "paused";
3708
+ blocked: "blocked";
3703
3709
  active: "active";
3704
3710
  }>;
3705
3711
  }, z.core.$strict>], "kind">>;
@@ -3894,8 +3900,10 @@ export declare const automationExecutionListSchema: z.ZodObject<{
3894
3900
  resource: z.ZodString;
3895
3901
  source: z.ZodString;
3896
3902
  triggerAvailable: z.ZodBoolean;
3903
+ statusReason: z.ZodOptional<z.ZodString>;
3897
3904
  status: z.ZodEnum<{
3898
3905
  paused: "paused";
3906
+ blocked: "blocked";
3899
3907
  active: "active";
3900
3908
  }>;
3901
3909
  }, z.core.$strict>], "kind">;
@@ -4266,6 +4274,7 @@ export declare const automationEditSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
4266
4274
  triggerAvailable: z.ZodBoolean;
4267
4275
  status: z.ZodEnum<{
4268
4276
  paused: "paused";
4277
+ blocked: "blocked";
4269
4278
  active: "active";
4270
4279
  }>;
4271
4280
  }, z.core.$strict>], "kind">;
@@ -1,6 +1,6 @@
1
1
  import { a as conversationTurnFailureReasonSchema, i as conversationTurnFailureCodeSchema } from "../history-BLTUgFYO.js";
2
2
  import { A as forkConversationResponseSchema, C as conversationReportEventSchema, D as createConversationBodySchema, E as conversationSummaryReportSchema, K as resolveMessageCards, M as MAX_INPUT_IMAGE_BYTES, O as createConversationMessageBodySchema, P as INPUT_IMAGE_TYPES, S as conversationReportEventDataSchema, T as conversationStatsReportSchema, U as messageCardText, _ as conversationParamsSchema, a as cancelConversationPendingMessagesBodySchema, b as conversationPendingMessageSchema, d as conversationDetailReportSchema, f as conversationEventHistorySchema, g as conversationFeedSchema, h as conversationFeedQuerySchema, i as archiveConversationResponseSchema, j as MAX_INPUT_IMAGES, k as forkConversationBodySchema, l as conversationAuxiliaryCostsSchema, m as conversationEventsQuerySchema, o as cancelConversationPendingMessagesResponseSchema, p as conversationEventPageSchema, r as archiveConversationBodySchema, s as conversationActivityPreviewSchema, t as acceptedConversationMessageSchema, u as conversationDetailQuerySchema, v as conversationPendingAuthorizationSchema, x as conversationPendingMessagesReportSchema, y as conversationPendingMessageDeliverySchema } from "../conversation-DwD-vquD.js";
3
- import { C as eventAutomationSummarySchema, S as automationVersionSchema, _ as automationSummarySchema, a as automationExecutionSchema, b as automationVersionListSchema, d as automationParamsSchema, f as automationRunListSchema, g as automationSchedulePreviewSchema, h as automationScheduleIntentSchema, i as automationExecutionListSchema, l as automationListQuerySchema, m as automationRunWindowsSchema, n as automationEditSchema, o as automationExecutionStatusDaySchema, p as automationRunSchema, r as automationEventCatalogSchema, s as automationExecutionStatusSchema, t as automationEditErrorSchema, u as automationListSchema, v as automationUpdateSchema, w as scheduledAutomationSummarySchema, x as automationVersionParamsSchema, y as automationVersionActivateSchema } from "../automation-CrQGQ2MT.js";
3
+ import { C as eventAutomationSummarySchema, S as automationVersionSchema, _ as automationSummarySchema, a as automationExecutionSchema, b as automationVersionListSchema, d as automationParamsSchema, f as automationRunListSchema, g as automationSchedulePreviewSchema, h as automationScheduleIntentSchema, i as automationExecutionListSchema, l as automationListQuerySchema, m as automationRunWindowsSchema, n as automationEditSchema, o as automationExecutionStatusDaySchema, p as automationRunSchema, r as automationEventCatalogSchema, s as automationExecutionStatusSchema, t as automationEditErrorSchema, u as automationListSchema, v as automationUpdateSchema, w as scheduledAutomationSummarySchema, x as automationVersionParamsSchema, y as automationVersionActivateSchema } from "../automation-gznOMaQ2.js";
4
4
  import { C as skillReportsSchema, S as skillReportSchema, _ as pluginPackageContentItemReportSchema, b as pluginsSchema, g as pluginOperationalReportSchema, h as pluginOperationalReportFeedSchema, m as healthReportSchema, t as webMessageId, v as pluginPackageContentReportSchema, x as runtimeInfoReportSchema, y as pluginSchema } from "../web-message-id-xPI_EFSC.js";
5
- import { A as codeChangeSummarySchema, C as locationParamsSchema, D as dailyConversationActivitySchema, F as codeRepositorySummarySchema, I as apiErrorSchema, M as codePersonReportSchema, N as codeRepositoryParamsSchema, O as codeActivityDaySchema, P as codeRepositoryReportSchema, S as locationDirectoryReportSchema, _ as actorProfileReportSchema, a as workspaceBodySchema, b as locationActivityDayReportSchema, c as workspaceRepoSchema, d as createdPersonalTokenSchema, f as personalTokenListSchema, g as actorDirectoryReportSchema, h as revokePersonalTokenResponseSchema, i as deleteWorkspaceResponseSchema, j as codeOverviewReportSchema, k as codeChangeSummaryReportSchema, l as workspaceSchema, m as personalTokenParamsSchema, n as statsReportSchema, o as workspaceListSchema, p as personalTokenMetadataSchema, r as baselineSnapshotSchema, s as workspaceParamsSchema, t as statSchema, u as createPersonalTokenBodySchema, v as personParamsSchema, x as locationDetailReportSchema, y as personalSpendReportSchema } from "../schema-CxWAN2zq.js";
5
+ import { A as codeChangeSummarySchema, C as locationParamsSchema, D as dailyConversationActivitySchema, F as codeRepositorySummarySchema, I as apiErrorSchema, M as codePersonReportSchema, N as codeRepositoryParamsSchema, O as codeActivityDaySchema, P as codeRepositoryReportSchema, S as locationDirectoryReportSchema, _ as actorProfileReportSchema, a as workspaceBodySchema, b as locationActivityDayReportSchema, c as workspaceRepoSchema, d as createdPersonalTokenSchema, f as personalTokenListSchema, g as actorDirectoryReportSchema, h as revokePersonalTokenResponseSchema, i as deleteWorkspaceResponseSchema, j as codeOverviewReportSchema, k as codeChangeSummaryReportSchema, l as workspaceSchema, m as personalTokenParamsSchema, n as statsReportSchema, o as workspaceListSchema, p as personalTokenMetadataSchema, r as baselineSnapshotSchema, s as workspaceParamsSchema, t as statSchema, u as createPersonalTokenBodySchema, v as personParamsSchema, x as locationDetailReportSchema, y as personalSpendReportSchema } from "../schema-Cabm4jcj.js";
6
6
  export { INPUT_IMAGE_TYPES, MAX_INPUT_IMAGES, MAX_INPUT_IMAGE_BYTES, acceptedConversationMessageSchema, actorDirectoryReportSchema, actorProfileReportSchema, apiErrorSchema, archiveConversationBodySchema, archiveConversationResponseSchema, automationEditErrorSchema, automationEditSchema, automationEventCatalogSchema, automationExecutionListSchema, automationExecutionSchema, automationExecutionStatusDaySchema, automationExecutionStatusSchema, automationListQuerySchema, automationListSchema, automationParamsSchema, automationRunListSchema, automationRunSchema, automationRunWindowsSchema, automationScheduleIntentSchema, automationSchedulePreviewSchema, automationSummarySchema, automationUpdateSchema, automationVersionActivateSchema, automationVersionListSchema, automationVersionParamsSchema, automationVersionSchema, baselineSnapshotSchema, cancelConversationPendingMessagesBodySchema, cancelConversationPendingMessagesResponseSchema, codeActivityDaySchema, codeChangeSummaryReportSchema, codeChangeSummarySchema, codeOverviewReportSchema, codePersonReportSchema, codeRepositoryParamsSchema, codeRepositoryReportSchema, codeRepositorySummarySchema, conversationActivityPreviewSchema, conversationAuxiliaryCostsSchema, conversationDetailQuerySchema, conversationDetailReportSchema, conversationEventHistorySchema, conversationEventPageSchema, conversationEventsQuerySchema, conversationFeedQuerySchema, conversationFeedSchema, conversationParamsSchema, conversationPendingAuthorizationSchema, conversationPendingMessageDeliverySchema, conversationPendingMessageSchema, conversationPendingMessagesReportSchema, conversationReportEventDataSchema, conversationReportEventSchema, conversationStatsReportSchema, conversationSummaryReportSchema, conversationTurnFailureCodeSchema, conversationTurnFailureReasonSchema, createConversationBodySchema, createConversationMessageBodySchema, createPersonalTokenBodySchema, createdPersonalTokenSchema, dailyConversationActivitySchema, deleteWorkspaceResponseSchema, eventAutomationSummarySchema, forkConversationBodySchema, forkConversationResponseSchema, healthReportSchema, locationActivityDayReportSchema, locationDetailReportSchema, locationDirectoryReportSchema, locationParamsSchema, messageCardText, personParamsSchema, personalSpendReportSchema, personalTokenListSchema, personalTokenMetadataSchema, personalTokenParamsSchema, pluginOperationalReportFeedSchema, pluginOperationalReportSchema, pluginPackageContentItemReportSchema, pluginPackageContentReportSchema, pluginSchema, pluginsSchema, resolveMessageCards, revokePersonalTokenResponseSchema, runtimeInfoReportSchema, scheduledAutomationSummarySchema, skillReportSchema, skillReportsSchema, statSchema, statsReportSchema, webMessageId, workspaceBodySchema, workspaceListSchema, workspaceParamsSchema, workspaceRepoSchema, workspaceSchema };
package/dist/api.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { n as ConversationWorkQueue } from "./queue-B5SnqRln.js";
2
- import "./db-CWZP77Ex.js";
2
+ import "./db-Ca9Nt5ci.js";
3
3
  import { Hono } from "hono";
4
4
  import { z } from "zod";
5
5
  import { User } from "@sentry/junior-plugin-api";
package/dist/api.js CHANGED
@@ -1,23 +1,24 @@
1
- import { $ as eventAutomationBelongsToUser, Et as pluginEventCatalog, F as lookupSlackUser, H as saveScheduledAutomation, J as eventAutomationTriggerAvailable, K as editEventAutomation, O as parseSlackThreadId, P as editScheduledAutomation, T as readLiveAttachment, V as readScheduledAutomation, Vt as getConversation, X as resolveTaskOutcomes, at as setEventAutomationStatus, ct as readAutomationVersion, dt as automationRevision, ft as requireAutomationRevision, g as readStats, it as saveEventAutomation, jt as cancelHumanFacingPendingMessages, lt as sameDefinitionValue, ot as automationDefinition, q as AutomationEditError, tt as getEventAutomation, ut as AutomationConflictError, wt as getEventCatalog } from "./agent-runner--1wC26S6.js";
2
- import { d as logException, p as logWarn } from "./logging-Crg0e1jb.js";
1
+ import { $ as getEventCatalog, L as editEventAutomation, O as parseSlackThreadId, P as editScheduledAutomation, R as AutomationEditError, T as readLiveAttachment, V as resolveTaskOutcomes, g as readStats, gt as getConversation, ot as cancelHumanFacingPendingMessages, tt as pluginEventCatalog, z as eventAutomationTriggerAvailable } from "./agent-runner-CMZ6lFQe.js";
2
+ import { d as logException, p as logWarn } from "./logging-LQnLlPf8.js";
3
3
  import { d as parseSlackTeamId, g as parseSlackMessageTs, l as parseSlackChannelId } from "./actor-BTtLaeWy.js";
4
- import { C as agentTurnUsageSchema, T as resolveRootConversationId, _ as locationFromRow, c as getConversationEventStore, d as getDb, f as getSqlExecutor, i as resolveViewerUser, m as withConversationEventLock, o as updateViewerDisplayName, t as findUserByEmail, u as getConversationStore, w as hasAgentTurnUsage, y as parseSessionSource } from "./viewer-EftpWXcF.js";
4
+ import { E as resolveRootConversationId, T as hasAgentTurnUsage, _ as locationFromRow, b as parseSessionSource, c as getConversationEventStore, d as getDb, f as getSqlExecutor, i as resolveViewerUser, m as withConversationEventLock, o as updateViewerDisplayName, t as findUserByEmail, u as getConversationStore, w as agentTurnUsageSchema } from "./viewer-D6stAU7h.js";
5
5
  import { n as juniorDestinations } from "./destinations-BeBiJeEM.js";
6
- import { C as juniorCodeChanges, D as juniorConversations, E as conversationReadColumns, O as juniorIdentities, _ as juniorConversationBriefs, b as juniorConversationEvents, h as juniorConversationParticipants, k as juniorUsers, w as juniorCodeRepositories, x as juniorApiTokens, y as juniorConversationMetrics } from "./executor-BQV1Zc1z.js";
6
+ import { C as juniorCodeChanges, D as juniorConversations, E as conversationReadColumns, O as juniorIdentities, _ as juniorConversationBriefs, b as juniorConversationEvents, h as juniorConversationParticipants, k as juniorUsers, w as juniorCodeRepositories, x as juniorApiTokens, y as juniorConversationMetrics } from "./executor-CewKi7EG.js";
7
7
  import { u as contextProvenance } from "./history-BLTUgFYO.js";
8
- import { F as loadTurnProjection, vt as piMessageFromHistoryItem } from "./checkpoint-CN7yMfSo.js";
9
- import { At as viewerConversationMembership, C as WorkspaceValidationError, Ct as conversationArchiveTimes, Dt as conversationHasParticipantUser, Et as conversationHasParticipantEmail, Ht as listConversationAnnotations, M as workspaceRepoCheckoutPath, Mt as readLatestConversationBrief, Nt as readConversationEventPage, O as SANDBOX_RUNTIME, Ot as conversationNotArchivedForEmail, Pt as buildSentryConversationUrl, S as updateWorkspace, St as readConversationAccessFromSql, Tt as conversationArchivedForUser, Ut as listConversationAnnotationsById, _ as deleteWorkspace, at as getSlackClient, b as listWorkspaces, g as createWorkspace, kt as conversationNotArchivedForUser, u as getPlugins, ut as withSlackRetries, v as getWorkspace, wt as conversationArchivedForEmail, x as listWorkspacesByRepository, xt as createPluginLogger } from "./agent-hooks-DzfA5m3R.js";
8
+ import { D as automationRevision, E as AutomationConflictError, O as requireAutomationRevision, S as automationDefinition, T as sameDefinitionValue, Tt as loadTurnProjection, a as readScheduledAutomation, b as saveEventAutomation, cn as piMessageFromHistoryItem, g as getEventAutomation, m as eventAutomationBelongsToUser, o as saveScheduledAutomation, w as readAutomationVersion, x as setEventAutomationStatus } from "./tasks-CO52vLkI.js";
9
+ import { At as listConversationAnnotations, C as WorkspaceValidationError, M as workspaceRepoCheckoutPath, O as SANDBOX_RUNTIME, Pt as lookupSlackUser, S as updateWorkspace, St as buildSentryConversationUrl, Wt as withSlackRetries, _ as deleteWorkspace, _t as conversationNotArchivedForUser, b as listWorkspaces, bt as readLatestConversationBrief, dt as conversationArchiveTimes, ft as conversationArchivedForEmail, g as createWorkspace, gt as conversationNotArchivedForEmail, ht as conversationHasParticipantUser, jt as listConversationAnnotationsById, lt as createPluginLogger, mt as conversationHasParticipantEmail, pt as conversationArchivedForUser, u as getPlugins, ut as readConversationAccessFromSql, v as getWorkspace, vt as viewerConversationMembership, x as listWorkspacesByRepository, xt as readConversationEventPage, zt as getSlackClient } from "./agent-hooks-C5zYOaJk.js";
10
10
  import { A as forkConversationResponseSchema, D as createConversationBodySchema, N as readMessageAttachments, O as createConversationMessageBodySchema, P as INPUT_IMAGE_TYPES, T as conversationStatsReportSchema, _ as conversationParamsSchema, a as cancelConversationPendingMessagesBodySchema, c as conversationAttachmentParamsSchema, d as conversationDetailReportSchema, g as conversationFeedSchema, h as conversationFeedQuerySchema, i as archiveConversationResponseSchema, k as forkConversationBodySchema, m as conversationEventsQuerySchema, o as cancelConversationPendingMessagesResponseSchema, p as conversationEventPageSchema, r as archiveConversationBodySchema, t as acceptedConversationMessageSchema, u as conversationDetailQuerySchema, x as conversationPendingMessagesReportSchema } from "./conversation-DwD-vquD.js";
11
- import { n as hash, t as create } from "./profile-XzHSfIah.js";
12
- import { t as getCachedSnapshot } from "./resolve-ZKXfsZuZ.js";
13
- import { a as getVercelConversationWorkQueue } from "./job-queue-D82gksYM.js";
14
- import { F as weekdaySchema, I as getFirstRunAtMs, M as compileScheduleIntent, _ as automationSummarySchema, b as automationVersionListSchema, c as automationLifecycleSchema, d as automationParamsSchema, f as automationRunListSchema, g as automationSchedulePreviewSchema, h as automationScheduleIntentSchema, i as automationExecutionListSchema, j as ScheduleIntentError, l as automationListQuerySchema, n as automationEditSchema, r as automationEventCatalogSchema, t as automationEditErrorSchema, u as automationListSchema, v as automationUpdateSchema, x as automationVersionParamsSchema, y as automationVersionActivateSchema } from "./automation-CrQGQ2MT.js";
11
+ import { n as hash, t as create } from "./profile-mWuVZ8ht.js";
12
+ import { t as getFirstRunAtMs } from "./cadence-D00SCzT1.js";
13
+ import { t as getCachedSnapshot } from "./resolve-BAN8BSGy.js";
14
+ import { a as getVercelConversationWorkQueue } from "./job-queue-C6o2aJQ6.js";
15
+ import { M as compileScheduleIntent, P as weekdaySchema, _ as automationSummarySchema, b as automationVersionListSchema, c as automationLifecycleSchema, d as automationParamsSchema, f as automationRunListSchema, g as automationSchedulePreviewSchema, h as automationScheduleIntentSchema, i as automationExecutionListSchema, j as ScheduleIntentError, l as automationListQuerySchema, n as automationEditSchema, r as automationEventCatalogSchema, t as automationEditErrorSchema, u as automationListSchema, v as automationUpdateSchema, x as automationVersionParamsSchema, y as automationVersionActivateSchema } from "./automation-gznOMaQ2.js";
15
16
  import { C as skillReportsSchema, a as fillUtcHours, b as pluginsSchema, c as sumUtcHoursIntoSixHours, d as trailingUtcSixHourWindow, f as utcDayKey, h as pluginOperationalReportFeedSchema, i as fillUtcDays, l as trailingUtcDayWindow, m as healthReportSchema, n as DAY_MS$1, o as fillUtcSixHours, p as utcHourKey, r as HOUR_MS$1, s as startOfUtcHour, u as trailingUtcHourWindow, x as runtimeInfoReportSchema } from "./web-message-id-xPI_EFSC.js";
16
- import { B as readHealthReport, C as clearSlackPendingReactions, I as createVercelAttachmentStorage, _ as readViewerAutomationSummary, a as recordWebConversationActivity, b as resolveViewerTaskCandidate, d as resolveSlackConversationContextFromThreadId, f as ViewerTaskNotFoundError, g as readViewerAutomationRuns, h as readViewerAutomationExecutions, i as createConversationId, j as legacyWebMailboxMetadataSchema, l as getProductionSlackAdapter, m as readConversationSourceTask, o as webActorFromEmail, p as deleteViewerTask, r as createAndEnqueueConversation, t as appendAndEnqueueWebMessage, u as formatSlackConversationRedactedLabel, v as readViewerAutomationVersions, y as readViewerAutomations } from "./web-input-DSa6geKr.js";
17
- import { A as conversationAggregateColumns, j as conversationRangeColumns, k as conversationActiveDaysColumn } from "./task-runner-CXTpWSmw.js";
18
- import { r as getWebAuthorization } from "./web-authorization-BLDXKk2u.js";
19
- import { t as decodeInputImages } from "./images-C_0iwPsW.js";
20
- import { C as locationParamsSchema, E as activitySixHours$1, I as apiErrorSchema, M as codePersonReportSchema, N as codeRepositoryParamsSchema, P as codeRepositoryReportSchema, S as locationDirectoryReportSchema, T as activityHours$1, _ as actorProfileReportSchema, a as workspaceBodySchema, d as createdPersonalTokenSchema, f as personalTokenListSchema, g as actorDirectoryReportSchema, h as revokePersonalTokenResponseSchema, i as deleteWorkspaceResponseSchema, j as codeOverviewReportSchema, l as workspaceSchema, m as personalTokenParamsSchema, n as statsReportSchema, o as workspaceListSchema, s as workspaceParamsSchema, u as createPersonalTokenBodySchema, v as personParamsSchema, w as activityDays$1, x as locationDetailReportSchema, y as personalSpendReportSchema } from "./schema-CxWAN2zq.js";
17
+ import { L as createVercelAttachmentStorage, M as legacyWebMailboxMetadataSchema, V as readHealthReport, _ as readViewerAutomationRuns, a as recordWebConversationActivity, b as readViewerAutomations, d as resolveSlackConversationContextFromThreadId, g as readViewerAutomationExecutions, h as readConversationSourceTask, i as createConversationId, l as getProductionSlackAdapter, m as deleteViewerTask, o as webActorFromEmail, p as ViewerTaskNotFoundError, r as createAndEnqueueConversation, t as appendAndEnqueueWebMessage, u as formatSlackConversationRedactedLabel, v as readViewerAutomationSummary, w as clearSlackPendingReactions, x as resolveViewerTaskCandidate, y as readViewerAutomationVersions } from "./web-input---xuox1t.js";
18
+ import { A as conversationActiveDaysColumn, M as conversationRangeColumns, j as conversationAggregateColumns } from "./task-runner-kLN3HC-_.js";
19
+ import { r as getWebAuthorization } from "./web-authorization-DLMBx2nL.js";
20
+ import { t as decodeInputImages } from "./images-DY6Pxq4w.js";
21
+ import { C as locationParamsSchema, E as activitySixHours$1, I as apiErrorSchema, M as codePersonReportSchema, N as codeRepositoryParamsSchema, P as codeRepositoryReportSchema, S as locationDirectoryReportSchema, T as activityHours$1, _ as actorProfileReportSchema, a as workspaceBodySchema, d as createdPersonalTokenSchema, f as personalTokenListSchema, g as actorDirectoryReportSchema, h as revokePersonalTokenResponseSchema, i as deleteWorkspaceResponseSchema, j as codeOverviewReportSchema, l as workspaceSchema, m as personalTokenParamsSchema, n as statsReportSchema, o as workspaceListSchema, s as workspaceParamsSchema, u as createPersonalTokenBodySchema, v as personParamsSchema, w as activityDays$1, x as locationDetailReportSchema, y as personalSpendReportSchema } from "./schema-Cabm4jcj.js";
21
22
  import { Hono } from "hono";
22
23
  import path from "node:path";
23
24
  import { z } from "zod";
@@ -3356,7 +3357,7 @@ async function readPeoplePluginReports(args) {
3356
3357
  reports: [],
3357
3358
  source: "plugins"
3358
3359
  });
3359
- const { getPluginProfileReports } = await import("./agent-hooks-DzfA5m3R.js").then((n) => n.t);
3360
+ const { getPluginProfileReports } = await import("./agent-hooks-C5zYOaJk.js").then((n) => n.t);
3360
3361
  return pluginOperationalReportFeedSchema.parse({
3361
3362
  generatedAt: new Date(nowMs).toISOString(),
3362
3363
  reports: await getPluginProfileReports({
@@ -3873,7 +3874,7 @@ function editView(automation, ownedByViewer) {
3873
3874
  return {
3874
3875
  ...common,
3875
3876
  kind: "event",
3876
- status: automation.task.status === "paused" ? "paused" : "active",
3877
+ status: automation.task.status === "deleted" ? "active" : automation.task.status,
3877
3878
  trigger: automation.task.trigger,
3878
3879
  triggerAvailable: eventAutomationTriggerAvailable(automation.task, getEventCatalog())
3879
3880
  };
@@ -4324,7 +4325,7 @@ function readDescriptionText(home) {
4324
4325
  }
4325
4326
  /** Read discovered skill names for authenticated runtime diagnostics. */
4326
4327
  async function readSkillReports() {
4327
- const { discoverSkills } = await import("./skills-CMl248J3.js").then((n) => n.o);
4328
+ const { discoverSkills } = await import("./skills-BtHhSATy.js").then((n) => n.o);
4328
4329
  const skills = await discoverSkills();
4329
4330
  return skillReportsSchema.parse(skills.map((skill) => ({
4330
4331
  name: skill.name,
@@ -4333,7 +4334,7 @@ async function readSkillReports() {
4333
4334
  }
4334
4335
  /** Read safe configured plugin metadata for authenticated runtime diagnostics. */
4335
4336
  async function readPlugins() {
4336
- const { pluginCatalogRuntime } = await import("./catalog-runtime-DpB_hG_I.js").then((n) => n.t);
4337
+ const { pluginCatalogRuntime } = await import("./catalog-runtime-Tz0O2MZe.js").then((n) => n.t);
4337
4338
  return pluginsSchema.parse(pluginCatalogRuntime.getProviders().map((plugin) => ({
4338
4339
  configKeys: plugin.manifest.configKeys ?? [],
4339
4340
  description: plugin.manifest.description,
@@ -4345,7 +4346,7 @@ async function readPlugins() {
4345
4346
  async function readRuntimeInfoReport() {
4346
4347
  const [{ homeDir }, { pluginCatalogRuntime }, plugins, skills] = await Promise.all([
4347
4348
  import("./package-discovery-BVvSnQBB.js").then((n) => n.r),
4348
- import("./catalog-runtime-DpB_hG_I.js").then((n) => n.t),
4349
+ import("./catalog-runtime-Tz0O2MZe.js").then((n) => n.t),
4349
4350
  readPlugins(),
4350
4351
  readSkillReports()
4351
4352
  ]);
@@ -4362,7 +4363,7 @@ async function readRuntimeInfoReport() {
4362
4363
  /** Read sanitized operational summaries contributed by plugins. */
4363
4364
  async function readPluginOperationalReportFeed() {
4364
4365
  const nowMs = Date.now();
4365
- const { getPluginOperationalReports } = await import("./agent-hooks-DzfA5m3R.js").then((n) => n.t);
4366
+ const { getPluginOperationalReports } = await import("./agent-hooks-C5zYOaJk.js").then((n) => n.t);
4366
4367
  return pluginOperationalReportFeedSchema.parse({
4367
4368
  source: "plugins",
4368
4369
  generatedAt: new Date(nowMs).toISOString(),
@@ -1,5 +1,5 @@
1
1
  import { n as ConversationWorkQueue, t as ConversationQueueMessage } from "./queue-B5SnqRln.js";
2
- import { t as ConversationStore } from "./store-BxxbxBlm.js";
2
+ import { t as ConversationStore } from "./store-DoewL5mG.js";
3
3
  import "./history-DvqWZlYX.js";
4
4
  import { n as JuniorPluginSet } from "./plugins-CjfUP5gJ.js";
5
5
  import { Hono } from "hono";
package/dist/app.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { i as ModelProfileInput, n as createApp, r as JuniorDashboardOptions, t as JuniorAppOptions } from "./app-FB2hmHpZ.js";
1
+ import { i as ModelProfileInput, n as createApp, r as JuniorDashboardOptions, t as JuniorAppOptions } from "./app-MEd7wbF0.js";
2
2
  import { i as defineJuniorPlugins, n as JuniorPluginSet, r as JuniorPluginSetOptions, t as JuniorPluginInput } from "./plugins-CjfUP5gJ.js";
3
3
  import { t as JUNIOR_VERSION } from "./version-CnXZ614E.js";
4
4
  export { JUNIOR_VERSION, JuniorAppOptions, type JuniorDashboardOptions, type JuniorPluginInput, type JuniorPluginSet, type JuniorPluginSetOptions, type ModelProfileInput, createApp, defineJuniorPlugins };
package/dist/app.js CHANGED
@@ -1,32 +1,33 @@
1
- import { An as slackEntitySchema, Bn as setConfigDefaults, Bt as ensureConversationWake, E as requestAttachmentDeletion, G as withScheduledAutomationLock, Ht as getConversationWorkState, I as logScheduledAutomationRunSkipped, Jt as removeActiveConversation, L as scheduledAutomationRunAttributes, Mn as createUserTokenStore, O as parseSlackThreadId, Pt as clearExpiredConversationLease, Qt as stopConversationWork, R as listScheduledAutomations, Tn as slackMention, Tt as eventGuidance, U as saveScheduledAutomationInLock, Ut as hasRunnableConversationWork, V as readScheduledAutomation, Vt as getConversation, W as scheduledRunId, Wt as listActiveConversationIds, Xt as requestConversationWork, Y as effectiveTaskOutcomes, Z as collectEventAutomationMatchKeys, _n as formatProviderLabel, an as renderTaskInput, b as unpublishedArtifactHeaders, bn as startOAuthFlow, bt as ingestEvent, c as deleteMcpAuthSessionsForUserProvider, cn as resolveSandboxEgressProviderForHost, dn as SANDBOX_EGRESS_PROXY_PATH, en as CONVERSATION_WORK_STALE_ENQUEUE_MS, et as findMatchingEventAutomations, fn as clearSandboxEgressSignals, hn as parseSandboxEgressCredentialToken, i as executeCredentialedEgressRequest, in as isInvalidConversationRecordError, jn as slackExternalRefIdSchema, kt as appendAndEnqueueInboundMessage, l as deleteMcpServerSessionId, ln as normalizeSandboxEgressTracePropagationDomains, mn as consumeSandboxEgressPermissionDeniedSignal, n as executeAgentRun, nn as hasRunnableConversationWork$1, pn as consumeSandboxEgressAuthRequiredSignal, t as createAgentRunner, u as deleteMcpStoredOAuthCredentials, un as shouldPropagateSandboxEgressTrace, v as publicArtifactHeaders, w as collectAttachmentGarbage, wt as getEventCatalog, x as lookupSlackUserProfile, y as readPublicArtifact, yt as processWorkspaceSnapshotJob, z as listScheduledAutomationsForTeam, zn as getConfigDefaults } from "./agent-runner--1wC26S6.js";
2
- import { C as withLogContext, O as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, S as withContext, d as logException, f as logInfo, j as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, p as logWarn, r as createRequestContext, v as setSpanAttributes, w as withSpan, y as setSpanStatus } from "./logging-Crg0e1jb.js";
1
+ import { $ as getEventCatalog, B as effectiveTaskOutcomes, Bt as SANDBOX_EGRESS_PROXY_PATH, Ct as removeActiveConversation, Dt as stopConversationWork, E as requestAttachmentDeletion, F as logScheduledAutomationRunSkipped, Ht as consumeSandboxEgressAuthRequiredSignal, I as scheduledAutomationRunAttributes, J as processWorkspaceSnapshotJob, Kt as formatProviderLabel, Lt as resolveSandboxEgressProviderForHost, Nt as isInvalidConversationRecordError, O as parseSlackThreadId, Pt as renderTaskInput, Rt as normalizeSandboxEgressTracePropagationDomains, Tt as requestConversationWork, Ut as consumeSandboxEgressPermissionDeniedSignal, Vt as clearSandboxEgressSignals, Wt as parseSandboxEgressCredentialToken, Xt as createUserTokenStore, Y as ingestEvent, Yt as startOAuthFlow, _t as getConversationWorkState, b as unpublishedArtifactHeaders, c as deleteMcpAuthSessionsForUserProvider, et as eventGuidance, gt as getConversation, ht as ensureConversationWake, i as executeCredentialedEgressRequest, it as appendAndEnqueueInboundMessage, jt as hasRunnableConversationWork$1, kt as CONVERSATION_WORK_STALE_ENQUEUE_MS, l as deleteMcpServerSessionId, lt as clearExpiredConversationLease, n as executeAgentRun, on as getConfigDefaults, sn as setConfigDefaults, t as createAgentRunner, u as deleteMcpStoredOAuthCredentials, v as publicArtifactHeaders, vt as hasRunnableConversationWork, w as collectAttachmentGarbage, x as lookupSlackUserProfile, y as readPublicArtifact, yt as listActiveConversationIds, zt as shouldPropagateSandboxEgressTrace } from "./agent-runner-CMZ6lFQe.js";
2
+ import { C as withLogContext, O as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, S as withContext, d as logException, f as logInfo, j as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, p as logWarn, r as createRequestContext, v as setSpanAttributes, w as withSpan, y as setSpanStatus } from "./logging-LQnLlPf8.js";
3
3
  import { r as continueTrace } from "./sentry-CgWZM_kV.js";
4
- import { t as JUNIOR_VERSION } from "./version-Cv__n5ue.js";
5
- import { _ as snapshotRuntimeConfig, d as restoreRuntimeConfig, f as setBotModelConfig, g as setSlackReactionConfig, h as setRuntimeLimits, i as getChatConfig, m as setProfiles, n as botConfig, o as getSlackBotToken, p as setCrossActorMidRunMode, u as resetRuntimeConfig } from "./config-B8QN-04U.js";
4
+ import { t as JUNIOR_VERSION } from "./version-DiR36OaN.js";
5
+ import { _ as snapshotRuntimeConfig, d as restoreRuntimeConfig, f as setBotModelConfig, g as setSlackReactionConfig, h as setRuntimeLimits, i as getChatConfig, m as setProfiles, n as botConfig, o as getSlackBotToken, p as setCrossActorMidRunMode, u as resetRuntimeConfig } from "./config-CCI82OTD.js";
6
6
  import { _ as slackMessageTsSchema, d as parseSlackTeamId, f as parseSlackUserId, h as slackUserIdSchema, m as slackTeamIdSchema, o as parseActorUserId, p as slackChannelIdSchema } from "./actor-BTtLaeWy.js";
7
- import { E as deleteProviderIdentityForSlackUser, c as getConversationEventStore, d as getDb, f as getSqlExecutor, g as withConversationMutationLock, m as withConversationEventLock, r as readActorIdentity, u as getConversationStore } from "./viewer-EftpWXcF.js";
7
+ import { D as deleteProviderIdentityForSlackUser, c as getConversationEventStore, d as getDb, f as getSqlExecutor, g as withConversationMutationLock, m as withConversationEventLock, r as readActorIdentity, u as getConversationStore } from "./viewer-D6stAU7h.js";
8
8
  import { n as juniorDestinations } from "./destinations-BeBiJeEM.js";
9
- import { D as juniorConversations, _ as juniorConversationBriefs, a as juniorSchedulerRuns, b as juniorConversationEvents, m as juniorAgentInvocations, o as juniorSchedulerTasks, p as juniorAgentBindings } from "./executor-BQV1Zc1z.js";
10
- import { n as pluginCatalogRuntime } from "./catalog-runtime-DpB_hG_I.js";
11
- import { J as appendConversationMessages, Z as projectConversationMessages, et as settleConversationTitleWork } from "./checkpoint-CN7yMfSo.js";
12
- import { $ as verifySlackDirectCredentialSubject, G as findMatchingWatches, Ht as listConversationAnnotations, J as bindEventAutomationCredentialSubject, Q as verifyScheduledAutomationCredentialSubject, St as readConversationAccessFromSql, V as collectEventMatchKeys, X as bindSlackDirectCredentialSubject, Y as bindScheduledAutomationCredentialSubject, Z as verifyEventAutomationCredentialSubject, _t as setDashboardConversationLinkOptions, a as getPluginRoutes, at as getSlackClient, d as setPlugins, dt as getWorkspaceTeamId, f as validatePlugins, ft as runWithWorkspaceTeamId, gt as getDashboardTaskLink, h as setBriefsConfig, i as getPluginApiRoutes, mt as getDashboardConversationLink, q as takeDueTimerWatches, st as isDmChannel, u as getPlugins, vt as createPluginState, xt as createPluginLogger, z as cancelSubscriptions, zt as resolveRootVisibility } from "./agent-hooks-DzfA5m3R.js";
9
+ import { D as juniorConversations, _ as juniorConversationBriefs, a as juniorSchedulerRuns, b as juniorConversationEvents, m as juniorAgentInvocations, o as juniorSchedulerTasks, p as juniorAgentBindings } from "./executor-CewKi7EG.js";
10
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-Tz0O2MZe.js";
11
+ import { H as slackEntitySchema, N as slackMention, Rt as appendConversationMessages, U as slackExternalRefIdSchema, Vt as projectConversationMessages, Wt as settleConversationTitleWork, a as readScheduledAutomation, c as scheduledRunId, d as collectEventAutomationMatchKeys, h as findMatchingEventAutomations, l as withScheduledAutomationLock, n as listScheduledAutomations, r as listScheduledAutomationsForTeam, s as saveScheduledAutomationInLock } from "./tasks-CO52vLkI.js";
12
+ import { $ as verifySlackDirectCredentialSubject, At as listConversationAnnotations, Dt as resolveRootVisibility, G as findMatchingWatches, Gt as getWorkspaceTeamId, J as bindEventAutomationCredentialSubject, Kt as runWithWorkspaceTeamId, Q as verifyScheduledAutomationCredentialSubject, V as collectEventMatchKeys, Vt as isDmChannel, X as bindSlackDirectCredentialSubject, Y as bindScheduledAutomationCredentialSubject, Z as verifyEventAutomationCredentialSubject, a as getPluginRoutes, at as setDashboardConversationLinkOptions, d as setPlugins, f as validatePlugins, h as setBriefsConfig, i as getPluginApiRoutes, it as getDashboardTaskLink, lt as createPluginLogger, nt as getDashboardConversationLink, ot as createPluginState, q as takeDueTimerWatches, u as getPlugins, ut as readConversationAccessFromSql, z as cancelSubscriptions, zt as getSlackClient } from "./agent-hooks-C5zYOaJk.js";
13
13
  import { V as annotationCard } from "./conversation-DwD-vquD.js";
14
- import { O as withLock$1, w as getStateAdapter } from "./profile-XzHSfIah.js";
15
- import { c as getThreadStopDecision } from "./pending-auth-DauOaies.js";
16
- import { f as setSandboxResourceConfig, u as getSandboxResourceConfig } from "./resolve-ZKXfsZuZ.js";
17
- import { a as getVercelConversationWorkQueue, g as isConversationQueueMessageRejectedError, h as conversationQueueMessageSchema, i as verifyWorkspaceSnapshotJobMessage, o as resolveConversationWorkQueueTopic, s as verifyConversationQueueMessage, t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-D82gksYM.js";
18
- import { D as scheduledRunSchema, L as getNextRunAtMs } from "./automation-CrQGQ2MT.js";
14
+ import { O as withLock$1, w as getStateAdapter } from "./profile-mWuVZ8ht.js";
15
+ import { c as getThreadStopDecision } from "./pending-auth-CT3ojhKe.js";
16
+ import { n as getNextRunAtMs } from "./cadence-D00SCzT1.js";
17
+ import { f as setSandboxResourceConfig, u as getSandboxResourceConfig } from "./resolve-BAN8BSGy.js";
18
+ import { a as getVercelConversationWorkQueue, g as isConversationQueueMessageRejectedError, h as conversationQueueMessageSchema, i as verifyWorkspaceSnapshotJobMessage, o as resolveConversationWorkQueueTopic, s as verifyConversationQueueMessage, t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-C6o2aJQ6.js";
19
+ import { D as scheduledRunSchema } from "./automation-gznOMaQ2.js";
19
20
  import { i as setExperimentalFeatures, n as getExperimentalFeatures, r as isExperimentalFeatureEnabled } from "./experimental-Qn9rKLgx.js";
20
- import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-Bo6BHmig.js";
21
+ import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "./validation-B4L2Rmiw.js";
21
22
  import { a as pluginRuntimeRegistrationsFromPluginSet, n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "./plugins-egKWjgue.js";
22
- import { A as getAuthPausedConversationTurnId, C as clearSlackPendingReactions, D as stopSlackThread, E as isSlackMessageStopped, F as renderSlackObjectCard, I as createVercelAttachmentStorage, M as THREAD_OPTOUT_ACK, N as startProcessingReaction, O as normalizeIncomingSlackThreadId, P as parseContent, R as enqueueAgentDispatch, S as buildSlackInboundMessage, T as verifySlackSignature, _ as readViewerAutomationSummary, a as recordWebConversationActivity, c as createProductionSlackWebhookServices, k as withNormalizedThreadId, l as getProductionSlackAdapter, n as conversationTurnIdForMessage, o as webActorFromEmail, s as createProductionConversationWorkOptions, t as appendAndEnqueueWebMessage, w as runWithSlackInstallation, x as recordSkippedConversationMessage, z as GET$3 } from "./web-input-DSa6geKr.js";
23
- import { O as recordAutomationExecution, _ as markDispatchFailed, a as confirmDispatchMailboxAppend, d as getPluginDispatchProjection, f as isTerminalDispatchStatus, l as getDispatchRecord, o as createOrGetDispatch, p as listPendingDispatchMailboxAppends, s as getDispatchConversationId, t as processPluginTask } from "./task-runner-CXTpWSmw.js";
24
- import { c as listPendingAgentInvocationMailboxAppends, r as enqueueAgentInvocation } from "./work-WOk5DovU.js";
25
- import { s as coerceThreadConversationState } from "./thread-state-BM1sLptE.js";
26
- import { a as GET$4, i as publishAppHomeView, r as GET$5, t as receiveLocalOAuthCredential } from "./credential-sync-BG_Yvja8.js";
27
- import { a as registerVercelPluginTaskDevConsumer, n as createVercelPluginTaskCallback, s as queueCallback } from "./task-queue-BMzTARMo.js";
28
- import { t as processConversationWork } from "./worker-B7rtMFzw.js";
29
- import { t as bindSpawnAgent } from "./spawn-DrvZYrTQ.js";
23
+ import { A as withNormalizedThreadId, B as GET$3, C as buildSlackInboundMessage, D as isSlackMessageStopped, E as verifySlackSignature, F as parseContent, I as renderSlackObjectCard, L as createVercelAttachmentStorage, N as THREAD_OPTOUT_ACK, O as stopSlackThread, P as startProcessingReaction, S as recordSkippedConversationMessage, T as runWithSlackInstallation, a as recordWebConversationActivity, c as createProductionSlackWebhookServices, f as createSlackWebApiStatusSender, j as getAuthPausedConversationTurnId, k as normalizeIncomingSlackThreadId, l as getProductionSlackAdapter, n as conversationTurnIdForMessage, o as webActorFromEmail, s as createProductionConversationWorkOptions, t as appendAndEnqueueWebMessage, v as readViewerAutomationSummary, w as clearSlackPendingReactions, z as enqueueAgentDispatch } from "./web-input---xuox1t.js";
24
+ import { _ as markDispatchFailed, a as confirmDispatchMailboxAppend, d as getPluginDispatchProjection, f as isTerminalDispatchStatus, k as recordAutomationExecution, l as getDispatchRecord, o as createOrGetDispatch, p as listPendingDispatchMailboxAppends, s as getDispatchConversationId, t as processPluginTask, y as notifyAutomationBlocked } from "./task-runner-kLN3HC-_.js";
25
+ import { c as listPendingAgentInvocationMailboxAppends, r as enqueueAgentInvocation } from "./work-G-HdoOSF.js";
26
+ import { s as coerceThreadConversationState } from "./thread-state-CaFRG5Mh.js";
27
+ import { a as GET$4, i as publishAppHomeView, r as GET$5, t as receiveLocalOAuthCredential } from "./credential-sync-DUpSxUum.js";
28
+ import { a as registerVercelPluginTaskDevConsumer, n as createVercelPluginTaskCallback, s as queueCallback } from "./task-queue-1LP6benz.js";
29
+ import { t as processConversationWork } from "./worker-CDUDfL9P.js";
30
+ import { t as bindSpawnAgent } from "./spawn-BszkFJKJ.js";
30
31
  import { createRequire } from "node:module";
31
32
  import { Hono } from "hono";
32
33
  import { z } from "zod";
@@ -574,11 +575,16 @@ async function markScheduledRunSkipped(db, args) {
574
575
  status: "skipped"
575
576
  } : void 0);
576
577
  }
577
- /** Advance a scheduled automation after a terminal run under its task lock. */
578
+ /**
579
+ * Advance a scheduled automation after a terminal run under its task lock.
580
+ * Returns true only when this call set the automation to blocked, so the
581
+ * caller can tell the creator once and only when the dashboard agrees. A
582
+ * paused automation keeps the reason and stays paused.
583
+ */
578
584
  async function advanceScheduledAutomationAfterRun(db, args) {
579
- await withScheduledAutomationLock(db, args.run.taskId, async (tx) => {
585
+ return await withScheduledAutomationLock(db, args.run.taskId, async (tx) => {
580
586
  const current = await readScheduledAutomation(tx, args.run.taskId);
581
- if (!current || current.status === "deleted" || current.status === "completed") return;
587
+ if (!current || current.status === "deleted" || current.status === "completed") return false;
582
588
  if (current.status === "paused") {
583
589
  await saveScheduledAutomationInLock(tx, {
584
590
  ...current,
@@ -586,7 +592,7 @@ async function advanceScheduledAutomationAfterRun(db, args) {
586
592
  statusReason: args.status === "blocked" ? args.errorMessage : current.statusReason,
587
593
  updatedAtMs: args.nowMs
588
594
  }, current);
589
- return;
595
+ return false;
590
596
  }
591
597
  if (current.runNowAtMs === args.run.scheduledForMs) {
592
598
  let nextRunAtMs = current.nextRunAtMs;
@@ -604,7 +610,7 @@ async function advanceScheduledAutomationAfterRun(db, args) {
604
610
  statusReason: args.status === "blocked" ? args.errorMessage : void 0,
605
611
  updatedAtMs: args.nowMs
606
612
  }, current);
607
- return;
613
+ return args.status === "blocked";
608
614
  }
609
615
  if (current.status !== "active" || current.nextRunAtMs !== args.run.scheduledForMs) {
610
616
  await saveScheduledAutomationInLock(tx, {
@@ -612,7 +618,7 @@ async function advanceScheduledAutomationAfterRun(db, args) {
612
618
  lastRunAtMs: args.run.scheduledForMs,
613
619
  updatedAtMs: args.nowMs
614
620
  }, current);
615
- return;
621
+ return false;
616
622
  }
617
623
  const nextRunAtMs = args.status === "blocked" ? void 0 : getNextRunAtMs(current, args.run.scheduledForMs, args.nowMs);
618
624
  await saveScheduledAutomationInLock(tx, {
@@ -626,6 +632,7 @@ async function advanceScheduledAutomationAfterRun(db, args) {
626
632
  statusReason: args.status === "blocked" ? args.errorMessage : void 0,
627
633
  updatedAtMs: args.nowMs
628
634
  }, current);
635
+ return args.status === "blocked";
629
636
  });
630
637
  }
631
638
  //#endregion
@@ -761,11 +768,16 @@ async function applyDispatchResult(args) {
761
768
  startedAtMs: args.run.startedAtMs
762
769
  });
763
770
  if (!blocked) return false;
764
- await advanceScheduledAutomationAfterRun(args.db, {
771
+ if (await advanceScheduledAutomationAfterRun(args.db, {
765
772
  errorMessage: blocked.errorMessage,
766
773
  nowMs: args.nowMs,
767
774
  run: args.run,
768
775
  status: "blocked"
776
+ })) await notifyAutomationBlocked({
777
+ automationId: args.run.taskId,
778
+ dispatchId: args.dispatch.id,
779
+ kind: "scheduled",
780
+ reason: blocked.errorMessage ?? "Dispatch blocked."
769
781
  });
770
782
  await recordScheduledExecution({
771
783
  nowMs: args.nowMs,
@@ -821,11 +833,15 @@ async function finishClaimedRun(args) {
821
833
  startedAtMs: args.run.startedAtMs
822
834
  });
823
835
  if (!finished) return;
824
- await advanceScheduledAutomationAfterRun(args.db, {
836
+ if (await advanceScheduledAutomationAfterRun(args.db, {
825
837
  errorMessage: args.errorMessage,
826
838
  nowMs: args.nowMs,
827
839
  run: args.run,
828
840
  status: args.status
841
+ })) await notifyAutomationBlocked({
842
+ automationId: args.run.taskId,
843
+ kind: "scheduled",
844
+ reason: args.errorMessage
829
845
  });
830
846
  await recordScheduledExecution({
831
847
  nowMs: args.nowMs,
@@ -2447,6 +2463,46 @@ async function handleSlackThreadStop(args) {
2447
2463
  });
2448
2464
  await thread.post(THREAD_OPTOUT_ACK);
2449
2465
  }
2466
+ /** Acknowledge a native Slack stop that interrupted active work. */
2467
+ const SLACK_SESSION_STOP_ACK = "Stopped.";
2468
+ /**
2469
+ * Stop the active Turn when a user clicks Slack's native agent stop button.
2470
+ *
2471
+ * Unlike the `stop` keyword, this only interrupts current work. The thread
2472
+ * stays subscribed and resource watches stay active. Slack does not leave the
2473
+ * `processing` status by itself, so clear the status even when no work runs.
2474
+ * https://docs.slack.dev/reference/events/agent_session_stopped
2475
+ */
2476
+ async function handleSlackSessionStop(args) {
2477
+ const canonicalThreadId = `slack:${args.channelId}:${args.threadTs}`;
2478
+ const stopped = await stopConversationTurn({
2479
+ conversationId: await resolveSlackConversationId({
2480
+ canonicalThreadId,
2481
+ conversationStore: args.conversationStore,
2482
+ installation: args.installation
2483
+ }),
2484
+ conversationStore: args.conversationStore,
2485
+ queue: args.queue,
2486
+ state: args.state
2487
+ });
2488
+ await createSlackWebApiStatusSender({
2489
+ channelId: args.channelId,
2490
+ threadTs: args.threadTs
2491
+ })("");
2492
+ if (stopped.status !== "requested") return;
2493
+ await clearSlackPendingReactions({
2494
+ getSlackAdapter: () => args.adapter,
2495
+ messages: stopped.pendingMessages,
2496
+ state: args.state
2497
+ });
2498
+ await new ThreadImpl({
2499
+ adapter: args.adapter,
2500
+ stateAdapter: args.state,
2501
+ id: canonicalThreadId,
2502
+ channelId: args.adapter.channelIdFromThreadId(canonicalThreadId),
2503
+ isDM: args.adapter.isDM(canonicalThreadId)
2504
+ }).post(SLACK_SESSION_STOP_ACK);
2505
+ }
2450
2506
  async function routeParsedMessage(args) {
2451
2507
  if (shouldIgnoreMessage(args.message)) return;
2452
2508
  const normalized = normalizeMessageThreadId(args.message);
@@ -2564,6 +2620,24 @@ async function handleSlackEvent(args) {
2564
2620
  await publishAppHomeViewBestEffort(event.user);
2565
2621
  return;
2566
2622
  }
2623
+ if (event.type === "agent_session_stopped" && event.channel && event.thread_ts) {
2624
+ if (!await isSlackWorkspaceMember(event, state)) return;
2625
+ const channelId = event.channel;
2626
+ const threadTs = event.thread_ts;
2627
+ if (!(await withLock$1(state, `slack:ingress:slack:${channelId}:${threadTs}`, () => handleSlackSessionStop({
2628
+ adapter,
2629
+ channelId,
2630
+ conversationStore: args.services.conversationStore,
2631
+ installation,
2632
+ queue: args.services.queue,
2633
+ state,
2634
+ threadTs
2635
+ }), {
2636
+ keepAlive: true,
2637
+ waitMs: 1e4
2638
+ })).acquired) throw new Error("Could not acquire Slack ingress lock");
2639
+ return;
2640
+ }
2567
2641
  if ((event.type === "message" || event.type === "app_mention") && !shouldIgnoreMessageSubtype(event) && event.channel && event.ts) {
2568
2642
  const member = await isSlackWorkspaceMember(event, state);
2569
2643
  setSpanAttributes({ "app.slack.membership": member ? "verified" : "unverified" });