@sentry/junior 0.206.0 → 0.207.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/{agent-C9yuiZUF.js → agent-CmQlX68D.js} +375 -346
  2. package/dist/{agent-hooks-DNjlz2A-.js → agent-hooks-BBX9p6aG.js} +101 -96
  3. package/dist/{agent-runner-E67lFrDG.js → agent-runner-CQD4HKK2.js} +9 -9
  4. package/dist/api/schema.d.ts +39 -39
  5. package/dist/api/schema.js +2 -2
  6. package/dist/api.d.ts +1 -1
  7. package/dist/api.js +154 -154
  8. package/dist/{app-AxGmJHwK.d.ts → app-DfNrn_gS.d.ts} +2 -2
  9. package/dist/app.d.ts +1 -1
  10. package/dist/app.js +185 -183
  11. package/dist/{auth-pause-state-MVZ6xvEK.js → auth-pause-state-uv8on6cT.js} +7 -7
  12. package/dist/{briefs-CvJFQvhJ.js → briefs-BXEmjD9D.js} +3 -3
  13. package/dist/{catalog-runtime-TBR8n4e1.js → catalog-runtime-1BZEOR8J.js} +1 -1
  14. package/dist/{checkpoint-BY47jJCB.js → checkpoint-B-JO5F3c.js} +8 -8
  15. package/dist/cli/chat.js +13 -13
  16. package/dist/cli/check.js +3 -3
  17. package/dist/cli/main.js +1 -1
  18. package/dist/cli/plugins.js +3 -3
  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-ceE7NtvC.js → client-Bp297GA0.js} +4 -4
  23. package/dist/{config-CIE83sR2.js → config-G2gv97R1.js} +4 -4
  24. package/dist/{context-B45_WqVX.js → context-Bplcgypl.js} +13 -13
  25. package/dist/{conversation-privacy-Auyq26XQ.js → conversation-privacy-BUfel19D.js} +1 -1
  26. package/dist/{credential-sync-BO33aNQd.js → credential-sync-D04NWqMR.js} +21 -21
  27. package/dist/{db-BeyXKJOI.d.ts → db-D74z7BZH.d.ts} +1 -1
  28. package/dist/{execution-stats-SiS2FLcv.js → execution-stats-Ds4bSvam.js} +77 -77
  29. package/dist/{executor-BfbYPW63.js → executor-BZu1Ta06.js} +12 -12
  30. package/dist/instrumentation.js +2 -2
  31. package/dist/{job-queue-CyTc24Es.js → job-queue-rnAPfUhP.js} +1 -1
  32. package/dist/{logging-D37bayDc.js → logging-Dx0S5k2z.js} +1 -1
  33. package/dist/nitro.d.ts +1 -1
  34. package/dist/nitro.js +3 -3
  35. package/dist/{oauth-callback-server-BtfOeHTZ.js → oauth-callback-server-xGpwURIj.js} +2 -2
  36. package/dist/{pending-auth-BPUzcs7n.js → pending-auth-DIZ4iZjS.js} +2 -2
  37. package/dist/{profile-CSixooTi.js → profile-d-fKypxo.js} +4 -4
  38. package/dist/{prompt-3gqNY1Ka.js → prompt-x-0ZtTyb.js} +14 -14
  39. package/dist/{registry-DiR0-xRg.js → registry-CWKdLCTG.js} +2 -2
  40. package/dist/{resolve-Bn5q__9b.js → resolve-BhRB1s2A.js} +2 -2
  41. package/dist/{runner-DFx3dIJH.js → runner-DNml3owD.js} +10 -10
  42. package/dist/{sandbox-egress-signals-bwvjihxA.js → sandbox-egress-signals-DUIl3-gW.js} +1 -1
  43. package/dist/{schema-8GXFfclK.js → schema-CwTeb-BF.js} +39 -39
  44. package/dist/{skills-BhM5qyCF.js → skills-D9WesdJJ.js} +2 -2
  45. package/dist/{spawn-Dk0PqdH6.js → spawn-Eh_3-s0M.js} +2 -2
  46. package/dist/{stats-DKRP4rsY.js → stats-CFlUGqVA.js} +292 -268
  47. package/dist/{store-C5qxF2ac.d.ts → store-Det8MQ9g.d.ts} +1 -1
  48. package/dist/{task-queue-CdpTvu4R.js → task-queue-D8I1_5wP.js} +3 -3
  49. package/dist/{task-runner-alpjVSxQ.js → task-runner-DO79gdho.js} +15 -15
  50. package/dist/{thread-state-CRK7aA41.js → thread-state-DD6BA4xz.js} +5 -5
  51. package/dist/{turn-execution-XtyzIHog.js → turn-execution-BSIHxmQJ.js} +3 -3
  52. package/dist/{turn-lifecycle-VbwZLfBv.js → turn-lifecycle-DSBK4Ars.js} +1 -1
  53. package/dist/{usage-D4A48Bdl.js → usage-WRXkNOHp.js} +2 -2
  54. package/dist/{validation-jn_46o4U.js → validation-BbHZ4r4S.js} +1 -1
  55. package/dist/{version-DcfJxB4z.js → version-C71UcRWw.js} +1 -1
  56. package/dist/version.js +1 -1
  57. package/dist/{web-authorization-CsfLSfEs.js → web-authorization-C73gJV7l.js} +1 -1
  58. package/dist/{web-input-BPp_sc7t.js → web-input-Ce1FcNIM.js} +8 -8
  59. package/dist/{work-Di-ubSGg.js → work-BEzDU_2x.js} +9 -9
  60. package/dist/{worker-Cu_D5Mr8.js → worker-MK2ubOv-.js} +5 -5
  61. package/migrations/0041_automation_outcomes_backfill.sql +27 -0
  62. package/migrations/meta/0041_snapshot.json +3516 -0
  63. package/migrations/meta/_journal.json +7 -0
  64. package/package.json +5 -5
@@ -1,20 +1,20 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
2
- import { a as embedTexts, r as completeObject } from "./client-ceE7NtvC.js";
3
- import { C as withSpan, P as normalizeIdentityEmail, _ as setSpanAttributes, d as logInfo, f as logWarn, u as logException, v as setSpanStatus } from "./logging-D37bayDc.js";
2
+ import { a as embedTexts, r as completeObject } from "./client-Bp297GA0.js";
3
+ import { C as withSpan, P as normalizeIdentityEmail, _ as setSpanAttributes, d as logInfo, f as logWarn, u as logException, v as setSpanStatus } from "./logging-Dx0S5k2z.js";
4
4
  import { a as getClient$1 } from "./sentry-CD3SdJl-.js";
5
- import { a as getChatConfig, n as botConfig, s as getSlackBotToken } from "./config-CIE83sR2.js";
5
+ import { a as getChatConfig, n as botConfig, s as getSlackBotToken } from "./config-G2gv97R1.js";
6
6
  import { n as defaultModelId } from "./model-profile-CZmVoGdX.js";
7
- import { _ as parseSlackMessageTs, c as isActorUserId, h as parseSlackTeamId, m as parseSlackChannelReferenceId, u as parseActorUserId } from "./context-B45_WqVX.js";
7
+ import { _ as parseSlackMessageTs, c as isActorUserId, h as parseSlackTeamId, m as parseSlackChannelReferenceId, u as parseActorUserId } from "./context-Bplcgypl.js";
8
8
  import { n as juniorDestinations } from "./destinations-BeBiJeEM.js";
9
- import { C as conversationReadColumns, E as juniorUsers, T as juniorIdentities, _ as juniorConversationEvents, b as juniorCodeChanges, g as juniorConversationBriefs, h as juniorConversationBindings, i as juniorWorkspaces, m as juniorConversationParticipants, n as juniorSnapshots, r as juniorWorkspaceRepos, t as createJuniorSqlExecutor, w as juniorConversations, x as juniorCodeRepositories, y as juniorConversationAnnotations } from "./executor-BfbYPW63.js";
9
+ import { C as conversationReadColumns, E as juniorUsers, T as juniorIdentities, _ as juniorConversationEvents, b as juniorCodeChanges, g as juniorConversationBriefs, h as juniorConversationBindings, i as juniorWorkspaces, m as juniorConversationParticipants, n as juniorSnapshots, r as juniorWorkspaceRepos, t as createJuniorSqlExecutor, w as juniorConversations, x as juniorCodeRepositories, y as juniorConversationAnnotations } from "./executor-BZu1Ta06.js";
10
10
  import { B as decodeStoredConversationEvent, C as conversationReportEventSchema, H as newConversationEventSchema, L as conversationEventDataSchema, M as conversationBriefSchema, N as parseBriefInput, V as historyReplacementSchema } from "./conversation-AA4R1VUn.js";
11
- import { A as sleep$1, P as SANDBOX_WORKSPACE_ROOT, l as isSandboxMissingError, n as hash, v as getVercelSandboxCredentials, w as getStateAdapter, x as runNonInteractiveCommand } from "./profile-CSixooTi.js";
12
- import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-3gqNY1Ka.js";
11
+ import { A as sleep$1, P as SANDBOX_WORKSPACE_ROOT, l as isSandboxMissingError, n as hash, v as getVercelSandboxCredentials, w as getStateAdapter, x as runNonInteractiveCommand } from "./profile-d-fKypxo.js";
12
+ import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-x-0ZtTyb.js";
13
13
  import { AsyncLocalStorage } from "node:async_hooks";
14
14
  import { z } from "zod";
15
15
  import { createHash, createHmac, randomUUID, timingSafeEqual } from "node:crypto";
16
16
  import { and, arrayContains, asc, desc, eq, getTableColumns, gt, gte, inArray, isNotNull, isNull, lt, lte, max, ne, or, sql } from "drizzle-orm";
17
- import { codeChangeInputSchema, conversationAnnotationInputSchema, conversationEventPresentationSchema, defineConversationEvent, destinationSchema, identitySchema, locationSchema, missingToolAnnotationKeys, normalizeResourceEventIdentifier, pluginResourceEventsSchema, promptContextSchema, promptMessageSchema, resourceEventInputSchema, resourceEventMatchSchema, resourceEventMatches, resourceEventTypeSchema, sourceSchema, stableResourceEventMatchKey, userSchema } from "@sentry/junior-plugin-api";
17
+ import { codeChangeInputSchema, conversationAnnotationInputSchema, conversationEventPresentationSchema, defineConversationEvent, destinationSchema, eventInputSchema, eventMatchSchema, eventMatches, eventTypeSchema, identitySchema, locationSchema, missingToolAnnotationKeys, normalizeEventIdentifier, pluginEventsSchema, promptContextSchema, promptMessageSchema, sourceSchema, stableEventMatchKey, userSchema } from "@sentry/junior-plugin-api";
18
18
  import { alias } from "drizzle-orm/pg-core";
19
19
  import { WebClient } from "@slack/web-api";
20
20
  import { Sandbox } from "@vercel/sandbox";
@@ -207,7 +207,7 @@ function normalizeSessionSource(value) {
207
207
  visibility: value.visibility,
208
208
  conversationId: value.conversationId
209
209
  };
210
- if (value.kind === "resource_event" || value.kind === "scheduled_task" || value.kind === "event_task" || value.kind === "plugin_dispatch" || value.kind === "agent_invocation") return;
210
+ if (value.kind === "event" || value.kind === "scheduled_automation" || value.kind === "event_automation" || value.kind === "plugin_dispatch" || value.kind === "agent_invocation") return;
211
211
  const threadTs = value.threadTs?.trim();
212
212
  return {
213
213
  kind: "slack",
@@ -278,11 +278,11 @@ function systemIdentityFromSource(source) {
278
278
  providerSubjectId: "local-cli",
279
279
  displayName: "Local CLI"
280
280
  };
281
- if (source === "resource_event") return {
281
+ if (source === "event") return {
282
282
  kind: "system",
283
283
  provider: "junior",
284
- providerSubjectId: "resource-event",
285
- displayName: "Resource Event"
284
+ providerSubjectId: "event",
285
+ displayName: "Event"
286
286
  };
287
287
  }
288
288
  /** Prefer the user actor identity, else a source-derived system identity. */
@@ -403,7 +403,7 @@ function tenantId(value) {
403
403
  return value ?? "";
404
404
  }
405
405
  function sourceFromValue(value) {
406
- if (value === "api" || value === "internal" || value === "local" || value === "plugin" || value === "resource_event" || value === "scheduler" || value === "slack" || value === "web") return value;
406
+ if (value === "api" || value === "internal" || value === "local" || value === "plugin" || value === "event" || value === "scheduler" || value === "slack" || value === "web") return value;
407
407
  }
408
408
  function originTypeFromSource(source) {
409
409
  return source;
@@ -1005,7 +1005,7 @@ const HUMAN_INSTRUCTION_PLATFORMS = /* @__PURE__ */ new Set([
1005
1005
  /**
1006
1006
  * Whether one event should restore an archived conversation to the feed.
1007
1007
  *
1008
- * Archive hides finished noise until a human comes back. Resource events,
1008
+ * Archive hides finished noise until a human comes back. Events,
1009
1009
  * turn lifecycle, compaction, and other system writes may still refresh
1010
1010
  * activity clocks, but they must not unarchive on their own.
1011
1011
  */
@@ -2751,15 +2751,15 @@ function getDashboardConversationLink(conversationId) {
2751
2751
  }
2752
2752
  /** Build the dashboard task detail URL when the core dashboard is enabled. */
2753
2753
  function getDashboardTaskLink(taskId) {
2754
- return resolveDashboardPath(`/tasks/${encodeURIComponent(taskId)}`);
2754
+ return resolveDashboardPath(`/automations/${encodeURIComponent(taskId)}`);
2755
2755
  }
2756
2756
  //#endregion
2757
2757
  //#region src/chat/state/ttl.ts
2758
2758
  /** Retain expiring conversation/runtime state long enough for resume and dashboard history. */
2759
2759
  const JUNIOR_THREAD_STATE_TTL_MS = 6048e5;
2760
2760
  //#endregion
2761
- //#region src/chat/resource-events/store.ts
2762
- const RESOURCE_EVENT_PREFIX = "junior:resource_event_subscription:v5";
2761
+ //#region src/chat/events/store.ts
2762
+ const EVENT_PREFIX = "junior:resource_event_subscription:v5";
2763
2763
  const INDEX_LOCK_TTL_MS = 1e4;
2764
2764
  const SUBSCRIPTION_LOCK_TTL_MS = 1e4;
2765
2765
  const SUBSCRIPTION_LOCK_WAIT_MS = 1e4;
@@ -2774,12 +2774,12 @@ const subscriptionIdIndexSchema = z.array(z.string().min(1));
2774
2774
  const subscriptionSchema = z.object({
2775
2775
  conversationId: z.string().min(1),
2776
2776
  createdAtMs: z.number().finite(),
2777
- events: z.array(resourceEventTypeSchema).min(1),
2777
+ events: z.array(eventTypeSchema).min(1),
2778
2778
  expiresAtMs: z.number().finite(),
2779
2779
  id: z.string().min(1),
2780
2780
  intent: z.string().min(1),
2781
2781
  label: z.string().min(1),
2782
- match: resourceEventMatchSchema.optional(),
2782
+ match: eventMatchSchema.optional(),
2783
2783
  namespace: z.string().min(1),
2784
2784
  identifier: z.string().min(1),
2785
2785
  resourceType: z.string().min(1),
@@ -2790,16 +2790,16 @@ function digest(value) {
2790
2790
  return createHash("sha256").update(value).digest("hex").slice(0, 32);
2791
2791
  }
2792
2792
  function subscriptionKey(id) {
2793
- return `${RESOURCE_EVENT_PREFIX}:record:${id}`;
2793
+ return `${EVENT_PREFIX}:record:${id}`;
2794
2794
  }
2795
2795
  function subscriptionLockKey(id) {
2796
- return `${RESOURCE_EVENT_PREFIX}:lock:${id}`;
2796
+ return `${EVENT_PREFIX}:lock:${id}`;
2797
2797
  }
2798
2798
  function resourceIndexKey(namespace, identifier) {
2799
- return `${RESOURCE_EVENT_PREFIX}:resource:${digest(`${namespace}\0${identifier}`)}`;
2799
+ return `${EVENT_PREFIX}:resource:${digest(`${namespace}\0${identifier}`)}`;
2800
2800
  }
2801
2801
  function conversationIndexKey(conversationId) {
2802
- return `${RESOURCE_EVENT_PREFIX}:conversation:${digest(conversationId)}`;
2802
+ return `${EVENT_PREFIX}:conversation:${digest(conversationId)}`;
2803
2803
  }
2804
2804
  function indexLockKey(key) {
2805
2805
  return `${key}:lock`;
@@ -2813,7 +2813,7 @@ async function acquireSubscriptionLock(state, subscriptionId, waitDeadlineMs = D
2813
2813
  while (true) {
2814
2814
  const lock = await state.acquireLock(subscriptionLockKey(subscriptionId), SUBSCRIPTION_LOCK_TTL_MS);
2815
2815
  if (lock) return lock;
2816
- if (Date.now() >= waitDeadlineMs) throw new Error(`Could not acquire resource event subscription lock for ${subscriptionId}`);
2816
+ if (Date.now() >= waitDeadlineMs) throw new Error(`Could not acquire watch lock for ${subscriptionId}`);
2817
2817
  await sleep(SUBSCRIPTION_LOCK_RETRY_MS);
2818
2818
  }
2819
2819
  }
@@ -2827,7 +2827,7 @@ async function withSubscriptionLock(state, subscriptionId, callback, waitDeadlin
2827
2827
  if (heartbeat) return;
2828
2828
  heartbeat = state.extendLock(lock, SUBSCRIPTION_LOCK_TTL_MS).then((extended) => {
2829
2829
  if (extended) heartbeatError = void 0;
2830
- else lockLostError = /* @__PURE__ */ new Error(`Resource event subscription lock was lost for ${subscriptionId}`);
2830
+ else lockLostError = /* @__PURE__ */ new Error(`Watch lock was lost for ${subscriptionId}`);
2831
2831
  }).catch((error) => {
2832
2832
  heartbeatError = error instanceof Error ? error : /* @__PURE__ */ new Error(`Failed to extend subscription lock: ${String(error)}`);
2833
2833
  }).finally(() => {
@@ -2857,12 +2857,12 @@ async function readSubscriptionIdIndex(state, key) {
2857
2857
  }
2858
2858
  function buildSubscriptionId(input) {
2859
2859
  const eventKey = [...new Set(input.events)].sort().join("\0");
2860
- const matchKey = stableResourceEventMatchKey(input.match);
2860
+ const matchKey = stableEventMatchKey(input.match);
2861
2861
  return `resub_${digest(matchKey ? `${input.namespace}\0${input.identifier}\0${input.conversationId}\0${eventKey}\0${matchKey}` : `${input.namespace}\0${input.identifier}\0${input.conversationId}\0${eventKey}`)}`;
2862
2862
  }
2863
2863
  async function withIndexLock(state, key, callback) {
2864
2864
  const lock = await state.acquireLock(indexLockKey(key), INDEX_LOCK_TTL_MS);
2865
- if (!lock) throw new Error(`Could not acquire resource event index lock for ${key}`);
2865
+ if (!lock) throw new Error(`Could not acquire event index lock for ${key}`);
2866
2866
  try {
2867
2867
  return await callback();
2868
2868
  } finally {
@@ -2894,16 +2894,16 @@ function activeAt(subscription, nowMs) {
2894
2894
  return subscription.status === "active" && subscription.expiresAtMs > nowMs;
2895
2895
  }
2896
2896
  function matchesEvent(subscription, input) {
2897
- return subscription.namespace === input.namespace && subscription.identifier === input.identifier && subscription.events.includes(input.eventType) && activeAt(subscription, input.nowMs) && resourceEventMatches(subscription.match, input.data);
2897
+ return subscription.namespace === input.namespace && subscription.identifier === input.identifier && subscription.events.includes(input.eventType) && activeAt(subscription, input.nowMs) && eventMatches(subscription.match, input.data);
2898
2898
  }
2899
2899
  /** Create or replace the active subscription for one conversation/resource/event set. */
2900
- async function createResourceEventSubscription(input, options = {}) {
2900
+ async function createWatch(input, options = {}) {
2901
2901
  const state = options.state ?? getStateAdapter();
2902
2902
  await state.connect();
2903
2903
  const nowMs = options.nowMs ?? Date.now();
2904
2904
  const events = [...new Set(input.events.map((event) => event.trim()))].filter(Boolean);
2905
- if (events.length === 0) throw new Error("Resource event subscription requires at least one event");
2906
- if (input.expiresAtMs <= nowMs) throw new Error("Resource event subscription expiry must be in the future");
2905
+ if (events.length === 0) throw new Error("Watch requires at least one event");
2906
+ if (input.expiresAtMs <= nowMs) throw new Error("Watch expiry must be in the future");
2907
2907
  const match = input.match && Object.keys(input.match).length > 0 ? input.match : void 0;
2908
2908
  const id = buildSubscriptionId({
2909
2909
  conversationId: input.conversationId,
@@ -2934,7 +2934,7 @@ async function createResourceEventSubscription(input, options = {}) {
2934
2934
  return parsed;
2935
2935
  }
2936
2936
  /** List active subscriptions bound to one conversation. */
2937
- async function listResourceEventSubscriptions(input) {
2937
+ async function listWatches(input) {
2938
2938
  const state = input.state ?? getStateAdapter();
2939
2939
  await state.connect();
2940
2940
  const nowMs = input.nowMs ?? Date.now();
@@ -2942,7 +2942,7 @@ async function listResourceEventSubscriptions(input) {
2942
2942
  return (await Promise.all(ids.map(async (id) => parseSubscription(await state.get(subscriptionKey(id)))))).filter((record) => record !== void 0 && record.conversationId === input.conversationId && activeAt(record, nowMs)).sort((left, right) => left.createdAtMs - right.createdAtMs);
2943
2943
  }
2944
2944
  /** Cancel a current-conversation subscription and remove it from match indexes. */
2945
- async function cancelResourceEventSubscription(input) {
2945
+ async function cancelWatch(input) {
2946
2946
  const state = input.state ?? getStateAdapter();
2947
2947
  await state.connect();
2948
2948
  return await withSubscriptionLock(state, input.id, async () => {
@@ -2960,10 +2960,10 @@ async function cancelResourceEventSubscription(input) {
2960
2960
  return next;
2961
2961
  });
2962
2962
  }
2963
- /** Cancel every active resource event subscription bound to one conversation. */
2963
+ /** Cancel every active watch bound to one conversation. */
2964
2964
  async function cancelSubscriptions(input) {
2965
- const subscriptions = await listResourceEventSubscriptions(input);
2966
- for (const subscription of subscriptions) await cancelResourceEventSubscription({
2965
+ const subscriptions = await listWatches(input);
2966
+ for (const subscription of subscriptions) await cancelWatch({
2967
2967
  conversationId: input.conversationId,
2968
2968
  id: subscription.id,
2969
2969
  nowMs: input.nowMs,
@@ -2974,7 +2974,7 @@ async function cancelSubscriptions(input) {
2974
2974
  * Collect match keys from active watches for these identifiers and event types.
2975
2975
  * Does not evaluate match values — only reports keys that filters use.
2976
2976
  */
2977
- async function collectResourceEventMatchKeys(input) {
2977
+ async function collectEventMatchKeys(input) {
2978
2978
  const state = input.state ?? getStateAdapter();
2979
2979
  await state.connect();
2980
2980
  const nowMs = input.nowMs ?? Date.now();
@@ -2996,8 +2996,8 @@ async function collectResourceEventMatchKeys(input) {
2996
2996
  }
2997
2997
  return [...keys].sort();
2998
2998
  }
2999
- /** Find active subscriptions interested in a normalized resource event. */
3000
- async function findMatchingResourceEventSubscriptions(input) {
2999
+ /** Find active subscriptions interested in a normalized event. */
3000
+ async function findMatchingWatches(input) {
3001
3001
  const state = input.state ?? getStateAdapter();
3002
3002
  await state.connect();
3003
3003
  const nowMs = input.nowMs ?? Date.now();
@@ -3011,7 +3011,7 @@ async function findMatchingResourceEventSubscriptions(input) {
3011
3011
  }));
3012
3012
  }
3013
3013
  /** Recheck and deliver a matched subscription while holding its status lock. */
3014
- async function deliverResourceEventSubscription(input) {
3014
+ async function deliverWatch(input) {
3015
3015
  const state = input.state ?? getStateAdapter();
3016
3016
  await state.connect();
3017
3017
  return await withSubscriptionLock(state, input.subscription.id, async () => {
@@ -3041,15 +3041,15 @@ async function deliverResourceEventSubscription(input) {
3041
3041
  }, input.waitDeadlineMs);
3042
3042
  }
3043
3043
  //#endregion
3044
- //#region src/chat/resource-events/tool-support.ts
3045
- /** Default lifetime for temporary resource subscriptions. */
3044
+ //#region src/chat/events/tool-support.ts
3045
+ /** Default lifetime for temporary watches. */
3046
3046
  const RESOURCE_SUBSCRIPTION_DEFAULT_TTL_MS = 12096e5;
3047
- /** Hard upper bound for temporary resource subscriptions. */
3047
+ /** Hard upper bound for temporary watches. */
3048
3048
  const RESOURCE_SUBSCRIPTION_MAX_TTL_MS = 2592e6;
3049
3049
  const STOP_WATCHING_TOOL_NAME = "stopWatchingResources";
3050
3050
  const RESOURCE_WATCH_TOOL_SOURCE = {
3051
3051
  id: "resource-watches",
3052
- description: "Inspect or stop resource watches for the current conversation."
3052
+ description: "Inspect or stop watches for the current conversation."
3053
3053
  };
3054
3054
  //#endregion
3055
3055
  //#region src/chat/slack/tool-support/context.ts
@@ -3578,24 +3578,24 @@ function verifySlackDirectCredentialSubject(input) {
3578
3578
  ])), binding.signature);
3579
3579
  }
3580
3580
  /** Bind a delegated user subject to one scheduler task dispatch. */
3581
- function bindScheduledTaskCredentialSubject(input) {
3581
+ function bindScheduledAutomationCredentialSubject(input) {
3582
3582
  const secret = getCredentialSubjectSecret();
3583
3583
  const plugin = input.plugin.trim();
3584
3584
  const userId = parseActorUserId(input.subject.userId);
3585
- if (!secret || plugin !== "scheduler" || !userId || input.subject.allowedWhen !== "scheduled-task") return;
3585
+ if (!secret || plugin !== "scheduler" || !userId || input.subject.allowedWhen !== "scheduled-automation") return;
3586
3586
  const taskId = input.subject.taskId;
3587
3587
  if (!taskId || taskId !== taskId.trim()) return;
3588
3588
  return {
3589
3589
  type: "user",
3590
3590
  userId,
3591
- allowedWhen: "scheduled-task",
3591
+ allowedWhen: "scheduled-automation",
3592
3592
  taskId,
3593
3593
  binding: {
3594
- type: "scheduled-task",
3594
+ type: "scheduled-automation",
3595
3595
  plugin,
3596
3596
  taskId,
3597
3597
  signature: signPayload(secret, buildPayload([
3598
- "scheduled-task",
3598
+ "scheduled-automation",
3599
3599
  plugin,
3600
3600
  taskId,
3601
3601
  userId
@@ -3604,37 +3604,37 @@ function bindScheduledTaskCredentialSubject(input) {
3604
3604
  };
3605
3605
  }
3606
3606
  /** Verify that a delegated subject was signed for one scheduler task. */
3607
- function verifyScheduledTaskCredentialSubject(input) {
3607
+ function verifyScheduledAutomationCredentialSubject(input) {
3608
3608
  const secret = getCredentialSubjectSecret();
3609
3609
  const { subject } = input;
3610
3610
  const binding = subject.binding;
3611
- if (!secret || input.plugin !== "scheduler" || subject.type !== "user" || !isActorUserId(subject.userId) || subject.allowedWhen !== "scheduled-task" || !subject.taskId || binding.type !== "scheduled-task" || binding.plugin !== input.plugin || binding.taskId !== subject.taskId) return false;
3611
+ if (!secret || input.plugin !== "scheduler" || subject.type !== "user" || !isActorUserId(subject.userId) || subject.allowedWhen !== "scheduled-automation" || !subject.taskId || binding.type !== "scheduled-automation" || binding.plugin !== input.plugin || binding.taskId !== subject.taskId) return false;
3612
3612
  return timingSafeMatch(signPayload(secret, buildPayload([
3613
- "scheduled-task",
3613
+ "scheduled-automation",
3614
3614
  binding.plugin,
3615
3615
  binding.taskId,
3616
3616
  subject.userId
3617
3617
  ])), binding.signature);
3618
3618
  }
3619
- /** Bind a delegated user subject to one event task dispatch. */
3620
- function bindEventTaskCredentialSubject(input) {
3619
+ /** Bind a delegated user subject to one event automation dispatch. */
3620
+ function bindEventAutomationCredentialSubject(input) {
3621
3621
  const secret = getCredentialSubjectSecret();
3622
3622
  const plugin = input.plugin.trim();
3623
3623
  const userId = parseActorUserId(input.subject.userId);
3624
- if (!secret || plugin !== "junior" || !userId || input.subject.allowedWhen !== "event-task") return;
3624
+ if (!secret || plugin !== "junior" || !userId || input.subject.allowedWhen !== "event-automation") return;
3625
3625
  const taskId = input.subject.taskId;
3626
3626
  if (!taskId || taskId !== taskId.trim()) return;
3627
3627
  return {
3628
3628
  type: "user",
3629
3629
  userId,
3630
- allowedWhen: "event-task",
3630
+ allowedWhen: "event-automation",
3631
3631
  taskId,
3632
3632
  binding: {
3633
- type: "event-task",
3633
+ type: "event-automation",
3634
3634
  plugin,
3635
3635
  taskId,
3636
3636
  signature: signPayload(secret, buildPayload([
3637
- "event-task",
3637
+ "event-automation",
3638
3638
  plugin,
3639
3639
  taskId,
3640
3640
  userId
@@ -3642,14 +3642,14 @@ function bindEventTaskCredentialSubject(input) {
3642
3642
  }
3643
3643
  };
3644
3644
  }
3645
- /** Verify that a delegated subject was signed for one event task. */
3646
- function verifyEventTaskCredentialSubject(input) {
3645
+ /** Verify that a delegated subject was signed for one event automation. */
3646
+ function verifyEventAutomationCredentialSubject(input) {
3647
3647
  const secret = getCredentialSubjectSecret();
3648
3648
  const { subject } = input;
3649
3649
  const binding = subject.binding;
3650
- if (!secret || input.plugin !== "junior" || subject.type !== "user" || !isActorUserId(subject.userId) || subject.allowedWhen !== "event-task" || !subject.taskId || binding.type !== "event-task" || binding.plugin !== input.plugin || binding.taskId !== subject.taskId) return false;
3650
+ if (!secret || input.plugin !== "junior" || subject.type !== "user" || !isActorUserId(subject.userId) || subject.allowedWhen !== "event-automation" || !subject.taskId || binding.type !== "event-automation" || binding.plugin !== input.plugin || binding.taskId !== subject.taskId) return false;
3651
3651
  return timingSafeMatch(signPayload(secret, buildPayload([
3652
- "event-task",
3652
+ "event-automation",
3653
3653
  binding.plugin,
3654
3654
  binding.taskId,
3655
3655
  subject.userId
@@ -4256,9 +4256,9 @@ function pluginInvocationContext(context) {
4256
4256
  destination: context.destination,
4257
4257
  source: context.source
4258
4258
  };
4259
- case "resource_event":
4260
- case "scheduled_task":
4261
- case "event_task":
4259
+ case "event":
4260
+ case "scheduled_automation":
4261
+ case "event_automation":
4262
4262
  case "plugin_dispatch":
4263
4263
  case "agent_invocation": return {
4264
4264
  ...common,
@@ -4362,7 +4362,7 @@ function validatePlugins(plugins) {
4362
4362
  const name = plugin.manifest.name;
4363
4363
  if (!PLUGIN_NAME_RE.test(name)) throw new Error(`Plugin name "${name}" must be a lowercase plugin identifier`);
4364
4364
  if (seen.has(name)) throw new Error(`Duplicate plugin name "${name}"`);
4365
- if (plugin.resourceEvents !== void 0 && !pluginResourceEventsSchema.safeParse(plugin.resourceEvents).success) throw new Error(`Plugin "${name}" resourceEvents is invalid`);
4365
+ if (plugin.events !== void 0 && !pluginEventsSchema.safeParse(plugin.events).success) throw new Error(`Plugin "${name}" events is invalid`);
4366
4366
  for (const [taskName, task] of Object.entries(plugin.tasks ?? {})) {
4367
4367
  if (!PLUGIN_TOOL_NAME_RE.test(taskName)) throw new Error(`Plugin task "${taskName}" from plugin "${name}" must be a camelCase identifier`);
4368
4368
  if (typeof task.run !== "function") throw new Error(`Plugin task "${taskName}" from plugin "${name}" must define a run function`);
@@ -4517,22 +4517,22 @@ function getPluginTools(context, sandbox = createSandboxCapability(context.works
4517
4517
  plugin: pluginName
4518
4518
  });
4519
4519
  const mcp = pluginMcpContext(plugin, context);
4520
- const canSubscribe = Boolean(plugin.resourceEvents) && plugin.resourceEvents?.isEnabled?.() !== false;
4521
- const resourceEvents = {
4520
+ const canSubscribe = Boolean(plugin.events) && plugin.events?.isEnabled?.() !== false;
4521
+ const events = {
4522
4522
  canSubscribe,
4523
4523
  async subscribe(input) {
4524
- if (!canSubscribe) throw new Error("Resource subscriptions are not available in this conversation.");
4525
- const registration = plugin.resourceEvents;
4524
+ if (!canSubscribe) throw new Error("Watches are not available in this conversation.");
4525
+ const registration = plugin.events;
4526
4526
  const resourceType = registration?.resourceTypes.find((candidate) => candidate.type === input.resource.type);
4527
- if (input.resource.namespace !== pluginName || !resourceType || input.events.length === 0 || input.events.some((eventType) => !resourceType.supportedEvents.includes(eventType))) throw new Error("Resource subscription contains an event or resource that the plugin does not support.");
4528
- const subscription = await createResourceEventSubscription({
4527
+ if (input.resource.namespace !== pluginName || !resourceType || input.events.length === 0 || input.events.some((eventType) => !resourceType.supportedEvents.includes(eventType))) throw new Error("Watch contains an event or resource that the plugin does not support.");
4528
+ const subscription = await createWatch({
4529
4529
  conversationId: context.conversationId,
4530
4530
  events: input.events,
4531
4531
  expiresAtMs: Date.now() + RESOURCE_SUBSCRIPTION_DEFAULT_TTL_MS,
4532
4532
  intent: input.intent,
4533
4533
  label: input.resource.label,
4534
4534
  namespace: pluginName,
4535
- identifier: normalizeResourceEventIdentifier(registration, input.resource.identifier),
4535
+ identifier: normalizeEventIdentifier(registration, input.resource.identifier),
4536
4536
  resourceType: input.resource.type
4537
4537
  });
4538
4538
  return {
@@ -4553,7 +4553,7 @@ function getPluginTools(context, sandbox = createSandboxCapability(context.works
4553
4553
  egress: context.egress,
4554
4554
  ...mcp ? { mcp } : void 0,
4555
4555
  model: createPluginModel(pluginName, plugin.model),
4556
- resourceEvents,
4556
+ events,
4557
4557
  sandbox,
4558
4558
  state: createPluginState(pluginName),
4559
4559
  users: { resolveActor },
@@ -4589,9 +4589,9 @@ function getPluginTools(context, sandbox = createSandboxCapability(context.works
4589
4589
  source: context.source
4590
4590
  };
4591
4591
  break;
4592
- case "resource_event":
4593
- case "scheduled_task":
4594
- case "event_task":
4592
+ case "event":
4593
+ case "scheduled_automation":
4594
+ case "event_automation":
4595
4595
  case "plugin_dispatch":
4596
4596
  case "agent_invocation": pluginContext = {
4597
4597
  ...common,
@@ -4637,10 +4637,10 @@ function routeMethods(route, pluginName) {
4637
4637
  if (methods.includes("ALL") && methods.length > 1) throw new Error(`Plugin route "${route.path}" from plugin "${pluginName}" must not combine ALL with explicit methods`);
4638
4638
  return methods;
4639
4639
  }
4640
- function requirePublishedResourceEvent(plugin, eventType) {
4641
- const registration = plugin.resourceEvents;
4642
- if (!registration || registration.isEnabled?.() === false) throw new Error(`Plugin "${plugin.manifest.name}" cannot publish resource events without an active registration`);
4643
- if (!registration.resourceTypes.some((resourceType) => resourceType.supportedEvents.includes(eventType))) throw new Error(`Plugin "${plugin.manifest.name}" did not register resource event "${eventType}"`);
4640
+ function requirePublishedEvent(plugin, eventType) {
4641
+ const registration = plugin.events;
4642
+ if (!registration || registration.isEnabled?.() === false) throw new Error(`Plugin "${plugin.manifest.name}" cannot publish events without an active registration`);
4643
+ if (!registration.resourceTypes.some((resourceType) => resourceType.supportedEvents.includes(eventType))) throw new Error(`Plugin "${plugin.manifest.name}" did not register event "${eventType}"`);
4644
4644
  }
4645
4645
  /** Collect route handlers exposed by plugins for app-level mounting. */
4646
4646
  function getPluginRoutes(options) {
@@ -4659,33 +4659,33 @@ function getPluginRoutes(options) {
4659
4659
  plugin: pluginName
4660
4660
  }) },
4661
4661
  codeChanges: createCodeChangePublisher(pluginName),
4662
- resourceEvents: {
4662
+ events: {
4663
4663
  async hasMatch(event) {
4664
- if (!options.resourceEvents.hasMatch) return false;
4665
- const parsed = resourceEventInputSchema.parse(event);
4666
- requirePublishedResourceEvent(plugin, parsed.eventType);
4667
- return await options.resourceEvents.hasMatch({
4664
+ if (!options.events.hasMatch) return false;
4665
+ const parsed = eventInputSchema.parse(event);
4666
+ requirePublishedEvent(plugin, parsed.eventType);
4667
+ return await options.events.hasMatch({
4668
4668
  ...parsed,
4669
- identifier: normalizeResourceEventIdentifier(plugin.resourceEvents, parsed.identifier),
4669
+ identifier: normalizeEventIdentifier(plugin.events, parsed.identifier),
4670
4670
  namespace: pluginName
4671
4671
  });
4672
4672
  },
4673
4673
  async neededMatchKeys(input) {
4674
- if (!options.resourceEvents.neededMatchKeys) return [];
4675
- const identifiers = [...new Set(input.identifiers.map((identifier) => normalizeResourceEventIdentifier(plugin.resourceEvents, identifier)).filter(Boolean))];
4674
+ if (!options.events.neededMatchKeys) return [];
4675
+ const identifiers = [...new Set(input.identifiers.map((identifier) => normalizeEventIdentifier(plugin.events, identifier)).filter(Boolean))];
4676
4676
  if (identifiers.length === 0 || input.eventTypes.length === 0) return [];
4677
- return await options.resourceEvents.neededMatchKeys({
4677
+ return await options.events.neededMatchKeys({
4678
4678
  eventTypes: input.eventTypes,
4679
4679
  identifiers,
4680
4680
  namespace: pluginName
4681
4681
  });
4682
4682
  },
4683
4683
  async publish(event) {
4684
- const parsed = resourceEventInputSchema.parse(event);
4685
- requirePublishedResourceEvent(plugin, parsed.eventType);
4686
- await options.resourceEvents.publish({
4684
+ const parsed = eventInputSchema.parse(event);
4685
+ requirePublishedEvent(plugin, parsed.eventType);
4686
+ await options.events.publish({
4687
4687
  ...parsed,
4688
- identifier: normalizeResourceEventIdentifier(plugin.resourceEvents, parsed.identifier),
4688
+ identifier: normalizeEventIdentifier(plugin.events, parsed.identifier),
4689
4689
  namespace: pluginName
4690
4690
  });
4691
4691
  }
@@ -5026,6 +5026,7 @@ function createPluginHookRunner(input = {}) {
5026
5026
  paths.add(key);
5027
5027
  }
5028
5028
  const sandboxCapability = createSandboxCapability(sandbox, signal);
5029
+ const finalizers = [];
5029
5030
  for (const plugin of loaded) {
5030
5031
  const hook = plugin.hooks?.workspacePrepare;
5031
5032
  if (!hook) continue;
@@ -5034,12 +5035,16 @@ function createPluginHookRunner(input = {}) {
5034
5035
  repo: repo.repo
5035
5036
  }));
5036
5037
  if (selected.length === 0) continue;
5037
- await hook({
5038
+ const finalize = await hook({
5038
5039
  ...basePluginContext(plugin),
5039
5040
  repos: selected,
5040
5041
  sandbox: sandboxCapability
5041
5042
  });
5043
+ if (finalize) finalizers.push(finalize);
5042
5044
  }
5045
+ return async () => {
5046
+ for (const finalize of finalizers) await finalize();
5047
+ };
5043
5048
  },
5044
5049
  async prepareSandbox(sandbox) {
5045
5050
  const sandboxCapability = createSandboxCapability(sandbox);
@@ -5105,4 +5110,4 @@ function createPluginHookRunner(input = {}) {
5105
5110
  };
5106
5111
  }
5107
5112
  //#endregion
5108
- export { resolveViewerUser as $, tryWorkspaceRepoCheckoutPath as A, authenticationLinkedEvent as At, downloadPrivateSlackFile as B, sanitizePostgresJson as Bt, invalidateReadySnapshot as C, readConversationEventPage as Ct, SANDBOX_RUNTIME as D, listConversationAnnotationsById as Dt, setWorkspaceSnapshotBuild as E, listConversationAnnotations as Et, bindSlackDirectCredentialSubject as F, getConversationStore as Ft, isDmChannel as G, resolveRootConversationId as Gt, getHeaderString as H, locationFromRow as Ht, verifyEventTaskCredentialSubject as I, getDb as It, withSlackRetries as J, upsertLinkedIdentity as Jt, normalizeSlackConversationId as K, deleteProviderIdentityForSlackUser as Kt, verifyScheduledTaskCredentialSubject as L, getSqlExecutor as Lt, resolveChannelCapabilities as M, db_exports as Mt, bindEventTaskCredentialSubject as N, getConversationEventStore as Nt, deleteWorkspaceSnapshotBuilders as O, JUNIOR_NATIVE_EVENT_NAMESPACE as Ot, bindScheduledTaskCredentialSubject as P, getConversationMessageSearchStore as Pt, readActorIdentity as Q, sameDestination as Qt, verifySlackDirectCredentialSubject as R, createSqlConversationEventStore as Rt, WorkspaceValidationError as S, readLatestConversationBrief as St, setWorkspaceSnapshot as T, resolveRootVisibility as Tt, getSlackClient as U, bindProviderConversation as Ut, getFilePermalink as V, withConversationMutationLock as Vt, isConversationScopedChannel as W, parseSessionSource as Wt, runWithWorkspaceTeamId as X, parseDestination as Xt, getWorkspaceTeamId as Y, createSlackDestination as Yt, findUserByEmail as Z, requireSlackDestination as Zt, deleteWorkspace as _, createPluginState as _t, getPluginRoutes as a, STOP_WATCHING_TOOL_NAME as at, listWorkspaces as b, createPluginLogger as bt, getPluginTools as c, collectResourceEventMatchKeys as ct, setPlugins as d, findMatchingResourceEventSubscriptions as dt, updateViewerDisplayName as et, validatePlugins as f, listResourceEventSubscriptions as ft, createWorkspace as g, setDashboardConversationLinkOptions as gt, setBriefsConfig as h, getDashboardTaskLink as ht, getPluginApiRoutes as i, RESOURCE_WATCH_TOOL_SOURCE as it, workspaceRepoCheckoutPath as j, authenticationUnlinkedEvent as jt, getWorkspaceSnapshotBuilder as k, agentsInstructionsUpdatedEvent as kt, getPluginUserPromptContributions as l, createResourceEventSubscription as lt, registration_exports as m, getDashboardConversationLink as mt, applyPluginFormatMarkdown as n, RESOURCE_SUBSCRIPTION_DEFAULT_TTL_MS as nt, getPluginSlackConversationLink as o, cancelResourceEventSubscription as ot, coreTaskRegistrations as p, JUNIOR_THREAD_STATE_TTL_MS as pt, runWithSlackInstallationToken as q, upsertIdentity as qt, createPluginHookRunner as r, RESOURCE_SUBSCRIPTION_MAX_TTL_MS as rt, getPluginSystemPromptContributions as s, cancelSubscriptions as st, agent_hooks_exports as t, getSlackToolContext as tt, getPlugins as u, deliverResourceEventSubscription as ut, getWorkspace as v, createPluginEmbedder as vt, loadSnapshotsForProfile as w, buildSentryConversationUrl as wt, updateWorkspace as x, createPluginConversationEvents as xt, getWorkspaceByName as y, createPluginModel as yt, SlackActionError as z, withConversationEventLock as zt };
5113
+ export { resolveViewerUser as $, tryWorkspaceRepoCheckoutPath as A, authenticationLinkedEvent as At, downloadPrivateSlackFile as B, sanitizePostgresJson as Bt, invalidateReadySnapshot as C, readConversationEventPage as Ct, SANDBOX_RUNTIME as D, listConversationAnnotationsById as Dt, setWorkspaceSnapshotBuild as E, listConversationAnnotations as Et, bindSlackDirectCredentialSubject as F, getConversationStore as Ft, isDmChannel as G, resolveRootConversationId as Gt, getHeaderString as H, locationFromRow as Ht, verifyEventAutomationCredentialSubject as I, getDb as It, withSlackRetries as J, upsertLinkedIdentity as Jt, normalizeSlackConversationId as K, deleteProviderIdentityForSlackUser as Kt, verifyScheduledAutomationCredentialSubject as L, getSqlExecutor as Lt, resolveChannelCapabilities as M, db_exports as Mt, bindEventAutomationCredentialSubject as N, getConversationEventStore as Nt, deleteWorkspaceSnapshotBuilders as O, JUNIOR_NATIVE_EVENT_NAMESPACE as Ot, bindScheduledAutomationCredentialSubject as P, getConversationMessageSearchStore as Pt, readActorIdentity as Q, sameDestination as Qt, verifySlackDirectCredentialSubject as R, createSqlConversationEventStore as Rt, WorkspaceValidationError as S, readLatestConversationBrief as St, setWorkspaceSnapshot as T, resolveRootVisibility as Tt, getSlackClient as U, bindProviderConversation as Ut, getFilePermalink as V, withConversationMutationLock as Vt, isConversationScopedChannel as W, parseSessionSource as Wt, runWithWorkspaceTeamId as X, parseDestination as Xt, getWorkspaceTeamId as Y, createSlackDestination as Yt, findUserByEmail as Z, requireSlackDestination as Zt, deleteWorkspace as _, createPluginState as _t, getPluginRoutes as a, STOP_WATCHING_TOOL_NAME as at, listWorkspaces as b, createPluginLogger as bt, getPluginTools as c, collectEventMatchKeys as ct, setPlugins as d, findMatchingWatches as dt, updateViewerDisplayName as et, validatePlugins as f, listWatches as ft, createWorkspace as g, setDashboardConversationLinkOptions as gt, setBriefsConfig as h, getDashboardTaskLink as ht, getPluginApiRoutes as i, RESOURCE_WATCH_TOOL_SOURCE as it, workspaceRepoCheckoutPath as j, authenticationUnlinkedEvent as jt, getWorkspaceSnapshotBuilder as k, agentsInstructionsUpdatedEvent as kt, getPluginUserPromptContributions as l, createWatch as lt, registration_exports as m, getDashboardConversationLink as mt, applyPluginFormatMarkdown as n, RESOURCE_SUBSCRIPTION_DEFAULT_TTL_MS as nt, getPluginSlackConversationLink as o, cancelSubscriptions as ot, coreTaskRegistrations as p, JUNIOR_THREAD_STATE_TTL_MS as pt, runWithSlackInstallationToken as q, upsertIdentity as qt, createPluginHookRunner as r, RESOURCE_SUBSCRIPTION_MAX_TTL_MS as rt, getPluginSystemPromptContributions as s, cancelWatch as st, agent_hooks_exports as t, getSlackToolContext as tt, getPlugins as u, deliverWatch as ut, getWorkspace as v, createPluginEmbedder as vt, loadSnapshotsForProfile as w, buildSentryConversationUrl as wt, updateWorkspace as x, createPluginConversationEvents as xt, getWorkspaceByName as y, createPluginModel as yt, SlackActionError as z, withConversationEventLock as zt };
@@ -1,9 +1,9 @@
1
- import { F as isRecord, d as logInfo, f as logWarn } from "./logging-D37bayDc.js";
2
- import { h as normalizeSlackEmojiName } from "./config-CIE83sR2.js";
3
- import { _ as parseSlackMessageTs, g as parseSlackUserId } from "./context-B45_WqVX.js";
4
- import { G as isDmChannel, J as withSlackRetries, K as normalizeSlackConversationId, U as getSlackClient, Xt as parseDestination, n as applyPluginFormatMarkdown, z as SlackActionError } from "./agent-hooks-DNjlz2A-.js";
5
- import { n as pluginCatalogRuntime } from "./catalog-runtime-TBR8n4e1.js";
6
- import { w as getStateAdapter } from "./profile-CSixooTi.js";
1
+ import { F as isRecord, d as logInfo, f as logWarn } from "./logging-Dx0S5k2z.js";
2
+ import { h as normalizeSlackEmojiName } from "./config-G2gv97R1.js";
3
+ import { _ as parseSlackMessageTs, g as parseSlackUserId } from "./context-Bplcgypl.js";
4
+ import { G as isDmChannel, J as withSlackRetries, K as normalizeSlackConversationId, U as getSlackClient, Xt as parseDestination, n as applyPluginFormatMarkdown, z as SlackActionError } from "./agent-hooks-BBX9p6aG.js";
5
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-1BZEOR8J.js";
6
+ import { w as getStateAdapter } from "./profile-d-fKypxo.js";
7
7
  import { r as isExperimentalFeatureEnabled } from "./experimental-CIXf7Uye.js";
8
8
  import { randomBytes } from "node:crypto";
9
9
  import { actorSchema, sourceSchema } from "@sentry/junior-plugin-api";
@@ -46,9 +46,9 @@ function assertRunConsistency(run) {
46
46
  if (run.surface !== "internal" && destination.conversationId !== run.conversationId) throw new TypeError("Source, destination, and run conversation IDs do not match");
47
47
  }
48
48
  break;
49
- case "resource_event":
50
- case "scheduled_task":
51
- case "event_task":
49
+ case "event":
50
+ case "scheduled_automation":
51
+ case "event_automation":
52
52
  case "plugin_dispatch":
53
53
  case "agent_invocation": return;
54
54
  }