@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
package/dist/api.js CHANGED
@@ -1,19 +1,19 @@
1
- import { f as logWarn, u as logException } from "./logging-D37bayDc.js";
2
- import { _ as parseSlackMessageTs, h as parseSlackTeamId, p as parseSlackChannelId } from "./context-B45_WqVX.js";
3
- import { $ as resolveViewerUser, Ct as readConversationEventPage, D as SANDBOX_RUNTIME, Dt as listConversationAnnotationsById, Et as listConversationAnnotations, Ft as getConversationStore, Gt as resolveRootConversationId, Ht as locationFromRow, It as getDb, J as withSlackRetries, Lt as getSqlExecutor, S as WorkspaceValidationError, St as readLatestConversationBrief, U as getSlackClient, Wt as parseSessionSource, Z as findUserByEmail, _ as deleteWorkspace, b as listWorkspaces, bt as createPluginLogger, et as updateViewerDisplayName, g as createWorkspace, j as workspaceRepoCheckoutPath, u as getPlugins, v as getWorkspace, wt as buildSentryConversationUrl, x as updateWorkspace } from "./agent-hooks-DNjlz2A-.js";
1
+ import { f as logWarn, u as logException } from "./logging-Dx0S5k2z.js";
2
+ import { _ as parseSlackMessageTs, h as parseSlackTeamId, p as parseSlackChannelId } from "./context-Bplcgypl.js";
3
+ import { $ as resolveViewerUser, Ct as readConversationEventPage, D as SANDBOX_RUNTIME, Dt as listConversationAnnotationsById, Et as listConversationAnnotations, Ft as getConversationStore, Gt as resolveRootConversationId, Ht as locationFromRow, It as getDb, J as withSlackRetries, Lt as getSqlExecutor, S as WorkspaceValidationError, St as readLatestConversationBrief, U as getSlackClient, Wt as parseSessionSource, Z as findUserByEmail, _ as deleteWorkspace, b as listWorkspaces, bt as createPluginLogger, et as updateViewerDisplayName, g as createWorkspace, j as workspaceRepoCheckoutPath, u as getPlugins, v as getWorkspace, wt as buildSentryConversationUrl, x as updateWorkspace } from "./agent-hooks-BBX9p6aG.js";
4
4
  import { n as juniorDestinations } from "./destinations-BeBiJeEM.js";
5
- import { C as conversationReadColumns, E as juniorUsers, T as juniorIdentities, _ as juniorConversationEvents, b as juniorCodeChanges, g as juniorConversationBriefs, m as juniorConversationParticipants, o as juniorSchedulerTasks, v as juniorApiTokens, w as juniorConversations, x as juniorCodeRepositories } from "./executor-BfbYPW63.js";
5
+ import { C as conversationReadColumns, E as juniorUsers, T as juniorIdentities, _ as juniorConversationEvents, b as juniorCodeChanges, g as juniorConversationBriefs, m as juniorConversationParticipants, o as juniorSchedulerTasks, v as juniorApiTokens, w as juniorConversations, x as juniorCodeRepositories } from "./executor-BZu1Ta06.js";
6
6
  import { D as createConversationBodySchema, O as createConversationMessageBodySchema, T as conversationStatsReportSchema, _ as conversationParamsSchema, a as cancelConversationPendingMessagesBodySchema, c as conversationAttachmentParamsSchema, d as conversationDetailReportSchema, g as conversationFeedSchema, h as conversationFeedQuerySchema, i as archiveConversationResponseSchema, m as conversationEventsQuerySchema, o as cancelConversationPendingMessagesResponseSchema, p as conversationEventPageSchema, r as archiveConversationBodySchema, t as acceptedConversationMessageSchema, u as conversationDetailQuerySchema, x as conversationPendingMessagesReportSchema } from "./conversation-AA4R1VUn.js";
7
- import { a as hasAgentTurnUsage, i as agentTurnUsageSchema, s as fallbackShortTitle } from "./usage-D4A48Bdl.js";
8
- import { n as hash, t as create } from "./profile-CSixooTi.js";
9
- import { A as eventTaskTriggerAvailable, F as effectiveTaskOutcomes, G as listDeletedEventTasksCreatedBy, H as eventTaskBelongsToUser, J as listPublicEventTasksForTeams, K as listEventTasksCreatedBy, Tt as getConversation, V as deleteEventTask, W as getEventTask, X as getResourceEventCatalog, _ as parseScheduledTaskRow, c as parseSlackThreadId, ht as cancelHumanFacingPendingMessages, i as readLiveAttachment, m as listPublicScheduledTasksForTeams, n as readStats, p as isListedScheduledTask, v as readScheduledTask, y as saveScheduledTask } from "./stats-DKRP4rsY.js";
10
- import { t as getCachedSnapshot } from "./resolve-Bn5q__9b.js";
7
+ import { a as hasAgentTurnUsage, i as agentTurnUsageSchema, s as fallbackShortTitle } from "./usage-WRXkNOHp.js";
8
+ import { n as hash, t as create } from "./profile-d-fKypxo.js";
9
+ import { A as eventAutomationTriggerAvailable, F as effectiveTaskOutcomes, G as listDeletedEventAutomationsCreatedBy, H as eventAutomationBelongsToUser, J as listPublicEventAutomationsForTeams, K as listEventAutomationsCreatedBy, Tt as getConversation, V as deleteEventAutomation, W as getEventAutomation, X as getEventCatalog, _ as parseScheduledAutomationRow, c as parseSlackThreadId, ht as cancelHumanFacingPendingMessages, i as readLiveAttachment, m as listPublicScheduledAutomationsForTeams, n as readStats, p as isListedScheduledAutomation, v as readScheduledAutomation, y as saveScheduledAutomation } from "./stats-CFlUGqVA.js";
10
+ import { t as getCachedSnapshot } from "./resolve-BhRB1s2A.js";
11
11
  import { t as getVercelConversationWorkQueue } from "./vercel-queue-DIkVcfK4.js";
12
12
  import { c as runtimeInfoReportSchema, n as pluginOperationalReportFeedSchema, s as pluginsSchema, t as healthReportSchema, u as skillReportsSchema } from "./reporting-schema-DosTN__Q.js";
13
- import { C as createVercelAttachmentStorage, S as legacyWebMailboxMetadataSchema, T as readHealthReport, _ as formatSlackConversationRedactedLabel, a as webActorFromEmail, b as resolveSlackConversationContextFromThreadId, c as conversationArchivedForEmail, d as conversationHasParticipantUser, f as conversationNotArchivedForEmail, l as conversationArchivedForUser, m as viewerConversationMembership, o as readConversationAccessFromSql, p as conversationNotArchivedForUser, r as createAndEnqueueConversation, s as conversationArchiveTimes, t as appendAndEnqueueWebMessage, u as conversationHasParticipantEmail, x as lookupSlackUser } from "./web-input-BPp_sc7t.js";
14
- import { a as readTaskExecutionStatusDays, c as readTaskExecutions, d as conversationActiveDaysColumn, f as conversationAggregateColumns, i as readTaskExecutionHours, l as readTaskRuns, n as readTaskExecutionByConversationId, o as readTaskExecutionStatusHours, p as conversationRangeColumns, r as readTaskExecutionDays, s as readTaskExecutionSummaries, t as emptyTaskRunWindows } from "./execution-stats-SiS2FLcv.js";
15
- import { r as getWebAuthorization } from "./web-authorization-CsfLSfEs.js";
16
- import { $ as sumUtcHoursIntoSixHours, A as actorProfileReportSchema, C as createPersonalTokenBodySchema, D as personalTokenParamsSchema, F as locationDirectoryReportSchema, G as codePersonReportSchema, I as locationParamsSchema, J as HOUR_MS$1, L as activityDays$1, M as personalSpendReportSchema, O as revokePersonalTokenResponseSchema, P as locationDetailReportSchema, Q as startOfUtcHour, R as activityHours$1, T as personalTokenListSchema, W as codeOverviewReportSchema, X as fillUtcHours, Y as fillUtcDays, Z as fillUtcSixHours, _ as taskListSchema, a as workspaceBodySchema, at as apiErrorSchema, et as trailingUtcDayWindow, f as taskExecutionListSchema, g as taskListQuerySchema, i as deleteWorkspaceResponseSchema, it as utcHourKey, j as personParamsSchema, k as actorDirectoryReportSchema, l as workspaceSchema, n as statsReportSchema, nt as trailingUtcSixHourWindow, o as workspaceListSchema, q as DAY_MS$1, rt as utcDayKey, s as workspaceParamsSchema, tt as trailingUtcHourWindow, v as taskParamsSchema, w as createdPersonalTokenSchema, y as taskRunListSchema, z as activitySixHours$1 } from "./schema-8GXFfclK.js";
13
+ import { C as createVercelAttachmentStorage, S as legacyWebMailboxMetadataSchema, T as readHealthReport, _ as formatSlackConversationRedactedLabel, a as webActorFromEmail, b as resolveSlackConversationContextFromThreadId, c as conversationArchivedForEmail, d as conversationHasParticipantUser, f as conversationNotArchivedForEmail, l as conversationArchivedForUser, m as viewerConversationMembership, o as readConversationAccessFromSql, p as conversationNotArchivedForUser, r as createAndEnqueueConversation, s as conversationArchiveTimes, t as appendAndEnqueueWebMessage, u as conversationHasParticipantEmail, x as lookupSlackUser } from "./web-input-Ce1FcNIM.js";
14
+ import { a as readAutomationExecutionStatusDays, c as readAutomationExecutions, d as conversationActiveDaysColumn, f as conversationAggregateColumns, i as readAutomationExecutionHours, l as readAutomationRuns, n as readAutomationExecutionByConversationId, o as readAutomationExecutionStatusHours, p as conversationRangeColumns, r as readAutomationExecutionDays, s as readAutomationExecutionSummaries, t as emptyAutomationRunWindows } from "./execution-stats-Ds4bSvam.js";
15
+ import { r as getWebAuthorization } from "./web-authorization-C73gJV7l.js";
16
+ import { $ as sumUtcHoursIntoSixHours, A as actorProfileReportSchema, C as createPersonalTokenBodySchema, D as personalTokenParamsSchema, F as locationDirectoryReportSchema, G as codePersonReportSchema, I as locationParamsSchema, J as HOUR_MS$1, L as activityDays$1, M as personalSpendReportSchema, O as revokePersonalTokenResponseSchema, P as locationDetailReportSchema, Q as startOfUtcHour, R as activityHours$1, T as personalTokenListSchema, W as codeOverviewReportSchema, X as fillUtcHours, Y as fillUtcDays, Z as fillUtcSixHours, _ as automationRunListSchema, a as workspaceBodySchema, at as apiErrorSchema, et as trailingUtcDayWindow, g as automationParamsSchema, h as automationListSchema, i as deleteWorkspaceResponseSchema, it as utcHourKey, j as personParamsSchema, k as actorDirectoryReportSchema, l as workspaceSchema, m as automationListQuerySchema, n as statsReportSchema, nt as trailingUtcSixHourWindow, o as workspaceListSchema, q as DAY_MS$1, rt as utcDayKey, s as workspaceParamsSchema, tt as trailingUtcHourWindow, u as automationExecutionListSchema, w as createdPersonalTokenSchema, z as activitySixHours$1 } from "./schema-CwTeb-BF.js";
17
17
  import { Hono } from "hono";
18
18
  import path from "node:path";
19
19
  import { z } from "zod";
@@ -1081,23 +1081,23 @@ async function readConversationFeed(options = {}) {
1081
1081
  return conversationFeedSchema.parse(await readConversationFeedFromSql(options));
1082
1082
  }
1083
1083
  //#endregion
1084
- //#region src/chat/scheduled-tasks/personal.ts
1084
+ //#region src/chat/scheduled-automations/personal.ts
1085
1085
  const cursorSchema = z.object({
1086
1086
  createdAtMs: z.number().finite(),
1087
1087
  id: z.string().min(1),
1088
1088
  query: z.string().max(200).optional(),
1089
1089
  version: z.literal(1)
1090
1090
  }).strict();
1091
- var InvalidScheduledTaskCursorError = class extends Error {
1091
+ var InvalidScheduledAutomationCursorError = class extends Error {
1092
1092
  constructor() {
1093
- super("Scheduled task cursor is invalid.");
1094
- this.name = "InvalidScheduledTaskCursorError";
1093
+ super("Scheduled automation cursor is invalid.");
1094
+ this.name = "InvalidScheduledAutomationCursorError";
1095
1095
  }
1096
1096
  };
1097
- var PersonalScheduledTaskNotFoundError = class extends Error {
1097
+ var PersonalScheduledAutomationNotFoundError = class extends Error {
1098
1098
  constructor() {
1099
- super("Scheduled task was not found.");
1100
- this.name = "PersonalScheduledTaskNotFoundError";
1099
+ super("Scheduled automation was not found.");
1100
+ this.name = "PersonalScheduledAutomationNotFoundError";
1101
1101
  }
1102
1102
  };
1103
1103
  function normalizeQuery(query) {
@@ -1107,13 +1107,13 @@ function decodeCursor(value, query) {
1107
1107
  if (!value) return void 0;
1108
1108
  try {
1109
1109
  const parsed = cursorSchema.parse(JSON.parse(Buffer.from(value, "base64url").toString("utf8")));
1110
- if (parsed.query !== query) throw new InvalidScheduledTaskCursorError();
1110
+ if (parsed.query !== query) throw new InvalidScheduledAutomationCursorError();
1111
1111
  return {
1112
1112
  createdAtMs: parsed.createdAtMs,
1113
1113
  id: parsed.id
1114
1114
  };
1115
1115
  } catch {
1116
- throw new InvalidScheduledTaskCursorError();
1116
+ throw new InvalidScheduledAutomationCursorError();
1117
1117
  }
1118
1118
  }
1119
1119
  function encodeCursor(task, query) {
@@ -1124,12 +1124,12 @@ function encodeCursor(task, query) {
1124
1124
  version: 1
1125
1125
  }), "utf8").toString("base64url");
1126
1126
  }
1127
- /** Delete one scheduled task created by the viewer. */
1128
- async function deleteViewerScheduledTask(db, user, id, nowMs = Date.now()) {
1127
+ /** Delete one scheduled automation created by the viewer. */
1128
+ async function deleteViewerScheduledAutomation(db, user, id, nowMs = Date.now()) {
1129
1129
  const identityIds = new Set(user.identities.map((identity) => identity.id));
1130
- const task = await readScheduledTask(db, id);
1131
- if (!task || task.status === "deleted" || !identityIds.has(task.creatorIdentityId)) throw new PersonalScheduledTaskNotFoundError();
1132
- await saveScheduledTask(db, {
1130
+ const task = await readScheduledAutomation(db, id);
1131
+ if (!task || task.status === "deleted" || !identityIds.has(task.creatorIdentityId)) throw new PersonalScheduledAutomationNotFoundError();
1132
+ await saveScheduledAutomation(db, {
1133
1133
  ...task,
1134
1134
  nextRunAtMs: void 0,
1135
1135
  runNowAtMs: void 0,
@@ -1137,16 +1137,16 @@ async function deleteViewerScheduledTask(db, user, id, nowMs = Date.now()) {
1137
1137
  updatedAtMs: nowMs
1138
1138
  });
1139
1139
  }
1140
- /** List scheduled tasks created by the viewer with a stable SQL cursor. */
1141
- async function listViewerScheduledTasks(db, user, input) {
1140
+ /** List scheduled automations created by the viewer with a stable SQL cursor. */
1141
+ async function listViewerScheduledAutomations(db, user, input) {
1142
1142
  const identityIds = user.identities.map((identity) => identity.id);
1143
- if (identityIds.length === 0) return { tasks: [] };
1143
+ if (identityIds.length === 0) return { automations: [] };
1144
1144
  const query = normalizeQuery(input.query);
1145
1145
  const cursor = decodeCursor(input.cursor, query);
1146
- const tasks = [];
1146
+ const automations = [];
1147
1147
  let before = cursor;
1148
1148
  const fetchLimit = input.limit + 1;
1149
- while (tasks.length < fetchLimit) {
1149
+ while (automations.length < fetchLimit) {
1150
1150
  const cursorFilter = before ? or(lt(juniorSchedulerTasks.createdAtMs, before.createdAtMs), and(eq(juniorSchedulerTasks.createdAtMs, before.createdAtMs), lt(juniorSchedulerTasks.id, before.id))) : void 0;
1151
1151
  const search = query ? sql`strpos(lower(coalesce(${juniorSchedulerTasks.title}, ${juniorSchedulerTasks.record}->'task'->>'text')), ${query}) > 0` : void 0;
1152
1152
  const rows = await db.select({
@@ -1156,7 +1156,7 @@ async function listViewerScheduledTasks(db, user, input) {
1156
1156
  record: juniorSchedulerTasks.record,
1157
1157
  title: juniorSchedulerTasks.title
1158
1158
  }).from(juniorSchedulerTasks).where(and(notInArray(juniorSchedulerTasks.status, ["deleted", "paused"]), inArray(juniorSchedulerTasks.creatorIdentityId, identityIds), cursorFilter, search)).orderBy(desc(juniorSchedulerTasks.createdAtMs), desc(juniorSchedulerTasks.id)).limit(fetchLimit);
1159
- tasks.push(...rows.map(parseScheduledTaskRow).filter(isListedScheduledTask));
1159
+ automations.push(...rows.map(parseScheduledAutomationRow).filter(isListedScheduledAutomation));
1160
1160
  if (rows.length < fetchLimit) break;
1161
1161
  const last = rows.at(-1);
1162
1162
  before = {
@@ -1164,14 +1164,14 @@ async function listViewerScheduledTasks(db, user, input) {
1164
1164
  id: last.id
1165
1165
  };
1166
1166
  }
1167
- const page = tasks.slice(0, input.limit);
1167
+ const page = automations.slice(0, input.limit);
1168
1168
  return {
1169
- tasks: page,
1170
- ...tasks.length > input.limit && page.length > 0 ? { nextCursor: encodeCursor(page.at(-1), query) } : void 0
1169
+ automations: page,
1170
+ ...automations.length > input.limit && page.length > 0 ? { nextCursor: encodeCursor(page.at(-1), query) } : void 0
1171
1171
  };
1172
1172
  }
1173
1173
  //#endregion
1174
- //#region src/chat/tasks/read.ts
1174
+ //#region src/chat/automations/read.ts
1175
1175
  const TASK_LIST_LIMIT = 100;
1176
1176
  const TASK_FETCH_LIMIT = 101;
1177
1177
  const TASK_EXECUTION_LIST_LIMIT = 100;
@@ -1232,14 +1232,14 @@ function executionSummaryFields(stats) {
1232
1232
  return {
1233
1233
  ...stats?.lastConversationId ? { lastConversationId: stats.lastConversationId } : void 0,
1234
1234
  ...stats?.lastExecutedAtMs ? { lastRunAt: new Date(stats.lastExecutedAtMs).toISOString() } : void 0,
1235
- runs: stats?.runs ?? emptyTaskRunWindows(),
1235
+ runs: stats?.runs ?? emptyAutomationRunWindows(),
1236
1236
  totalRuns: stats?.totalRuns ?? 0
1237
1237
  };
1238
1238
  }
1239
- function scheduledTaskSummary(task, ownedByViewer, destination, stats, createdByEmail) {
1240
- if (task.status === "deleted") throw new Error("Deleted scheduled tasks cannot enter the Tasks view");
1239
+ function scheduledAutomationSummary(task, ownedByViewer, destination, stats, createdByEmail) {
1240
+ if (task.status === "deleted") throw new Error("Deleted scheduled automations cannot enter the Automations view");
1241
1241
  const nextRunAtMs = task.runNowAtMs ?? task.nextRunAtMs;
1242
- const instruction = displayText(task.task.text, "Untitled scheduled task");
1242
+ const instruction = displayText(task.task.text, "Untitled scheduled automation");
1243
1243
  return {
1244
1244
  createdAt: new Date(task.createdAtMs).toISOString(),
1245
1245
  createdBy: creatorLabel(task.createdBy),
@@ -1259,10 +1259,10 @@ function scheduledTaskSummary(task, ownedByViewer, destination, stats, createdBy
1259
1259
  schedule: displayText(task.schedule.description, "Schedule unavailable"),
1260
1260
  status: task.status,
1261
1261
  outcomes: effectiveTaskOutcomes(task.outcomes, task.destination),
1262
- title: taskDisplayTitle(task.title, instruction, "Untitled scheduled task")
1262
+ title: taskDisplayTitle(task.title, instruction, "Untitled scheduled automation")
1263
1263
  };
1264
1264
  }
1265
- function eventTaskSummary(task, ownedByViewer, destination, stats, createdByEmail) {
1265
+ function eventAutomationSummary(task, ownedByViewer, destination, stats, createdByEmail) {
1266
1266
  const instruction = task.task.text;
1267
1267
  return {
1268
1268
  createdAt: new Date(task.createdAtMs).toISOString(),
@@ -1283,8 +1283,8 @@ function eventTaskSummary(task, ownedByViewer, destination, stats, createdByEmai
1283
1283
  resource: `${task.trigger.label} · ${task.trigger.identifier}`,
1284
1284
  source: task.trigger.namespace,
1285
1285
  outcomes: effectiveTaskOutcomes(task.outcomes, task.destination),
1286
- title: taskDisplayTitle(task.title, instruction, "Untitled event task"),
1287
- triggerAvailable: eventTaskTriggerAvailable(task, getResourceEventCatalog())
1286
+ title: taskDisplayTitle(task.title, instruction, "Untitled event automation"),
1287
+ triggerAvailable: eventAutomationTriggerAvailable(task, getEventCatalog())
1288
1288
  };
1289
1289
  }
1290
1290
  function viewerTeamIds(user) {
@@ -1295,7 +1295,7 @@ async function resolveViewerTaskCandidate(user, kind, id) {
1295
1295
  const identityIds = new Set(user.identities.map((identity) => identity.id));
1296
1296
  const teamIds = viewerTeamIds(user);
1297
1297
  if (kind === "scheduled") {
1298
- const task = await readScheduledTask(db, id);
1298
+ const task = await readScheduledAutomation(db, id);
1299
1299
  if (!task || task.status === "deleted") return void 0;
1300
1300
  const ownedByViewer = identityIds.has(task.creatorIdentityId);
1301
1301
  const destination = (await destinationDetails([task.destination])).get(destinationKey(task.destination));
@@ -1308,9 +1308,9 @@ async function resolveViewerTaskCandidate(user, kind, id) {
1308
1308
  task
1309
1309
  };
1310
1310
  }
1311
- const task = await getEventTask(db, id);
1311
+ const task = await getEventAutomation(db, id);
1312
1312
  if (!task || task.status === "deleted") return void 0;
1313
- const ownedByViewer = eventTaskBelongsToUser(task, user);
1313
+ const ownedByViewer = eventAutomationBelongsToUser(task, user);
1314
1314
  const destination = (await destinationDetails([task.destination])).get(destinationKey(task.destination));
1315
1315
  const publicToViewer = teamIds.includes(task.destination.teamId) && destination?.visibility === "public";
1316
1316
  if (!ownedByViewer && !publicToViewer) return void 0;
@@ -1321,22 +1321,22 @@ async function resolveViewerTaskCandidate(user, kind, id) {
1321
1321
  task
1322
1322
  };
1323
1323
  }
1324
- async function taskSummaryForCandidate(candidate) {
1324
+ async function automationSummaryForCandidate(candidate) {
1325
1325
  const [destinations, creatorEmails, stats] = await Promise.all([
1326
1326
  destinationDetails([candidate.task.destination]),
1327
1327
  creatorProfileEmails([candidate]),
1328
- readTaskExecutionSummaries(candidate.kind, "junior")
1328
+ readAutomationExecutionSummaries(candidate.kind, "junior")
1329
1329
  ]);
1330
1330
  const destination = destinations.get(destinationKey(candidate.task.destination)) ?? {
1331
1331
  label: `Channel ${candidate.task.destination.channelId}`,
1332
1332
  visibility: "private"
1333
1333
  };
1334
1334
  const createdByEmail = creatorEmails.get(creatorKey(candidate.task.destination.teamId, candidate.task.createdBy.slackUserId));
1335
- if (candidate.kind === "scheduled") return scheduledTaskSummary(candidate.task, candidate.ownedByViewer, destination, stats.get(candidate.task.id), createdByEmail);
1336
- return eventTaskSummary(candidate.task, candidate.ownedByViewer, destination, stats.get(candidate.task.id), createdByEmail);
1335
+ if (candidate.kind === "scheduled") return scheduledAutomationSummary(candidate.task, candidate.ownedByViewer, destination, stats.get(candidate.task.id), createdByEmail);
1336
+ return eventAutomationSummary(candidate.task, candidate.ownedByViewer, destination, stats.get(candidate.task.id), createdByEmail);
1337
1337
  }
1338
- /** Read viewer-owned and public-workspace tasks as one bounded newest-first projection. */
1339
- function emptyTaskExecutionDay(date) {
1338
+ /** Read viewer-owned and public-workspace automations as one bounded newest-first projection. */
1339
+ function emptyAutomationExecutionDay(date) {
1340
1340
  return {
1341
1341
  costUsd: 0,
1342
1342
  date,
@@ -1344,7 +1344,7 @@ function emptyTaskExecutionDay(date) {
1344
1344
  scheduled: 0
1345
1345
  };
1346
1346
  }
1347
- function emptyTaskExecutionStatusDay(date) {
1347
+ function emptyAutomationExecutionStatusDay(date) {
1348
1348
  return {
1349
1349
  blocked: 0,
1350
1350
  completed: 0,
@@ -1352,51 +1352,51 @@ function emptyTaskExecutionStatusDay(date) {
1352
1352
  failed: 0
1353
1353
  };
1354
1354
  }
1355
- function taskExecutionSixHours(hours, nowMs = Date.now()) {
1355
+ function automationExecutionSixHours(hours, nowMs = Date.now()) {
1356
1356
  return sumUtcHoursIntoSixHours({
1357
- empty: emptyTaskExecutionDay,
1357
+ empty: emptyAutomationExecutionDay,
1358
1358
  hours,
1359
1359
  nowMs
1360
1360
  });
1361
1361
  }
1362
- function taskExecutionStatusSixHours(hours, nowMs = Date.now()) {
1362
+ function automationExecutionStatusSixHours(hours, nowMs = Date.now()) {
1363
1363
  return sumUtcHoursIntoSixHours({
1364
- empty: emptyTaskExecutionStatusDay,
1364
+ empty: emptyAutomationExecutionStatusDay,
1365
1365
  hours,
1366
1366
  nowMs
1367
1367
  });
1368
1368
  }
1369
- /** List one viewer's scheduled and event tasks, optionally filtered by title or instruction search. */
1370
- async function readViewerTasks(user, input = {}) {
1369
+ /** List one viewer's scheduled and event automations, optionally filtered by title or instruction search. */
1370
+ async function readViewerAutomations(user, input = {}) {
1371
1371
  const db = getDb();
1372
1372
  const query = input.q?.trim().toLowerCase() || void 0;
1373
1373
  const identityIds = new Set(user.identities.map((identity) => identity.id));
1374
1374
  const teamIds = viewerTeamIds(user);
1375
- const [scheduledPage, publicScheduled, eventTasks, publicEventTasks] = await Promise.all([
1376
- listViewerScheduledTasks(db, user, {
1375
+ const [scheduledPage, publicScheduled, eventAutomations, publicEventAutomations] = await Promise.all([
1376
+ listViewerScheduledAutomations(db, user, {
1377
1377
  limit: TASK_FETCH_LIMIT,
1378
1378
  query
1379
1379
  }),
1380
- listPublicScheduledTasksForTeams(db, teamIds, {
1380
+ listPublicScheduledAutomationsForTeams(db, teamIds, {
1381
1381
  limit: TASK_FETCH_LIMIT,
1382
1382
  query
1383
1383
  }),
1384
- listEventTasksCreatedBy(db, user, TASK_FETCH_LIMIT, query),
1385
- listPublicEventTasksForTeams(db, teamIds, TASK_FETCH_LIMIT, query)
1384
+ listEventAutomationsCreatedBy(db, user, TASK_FETCH_LIMIT, query),
1385
+ listPublicEventAutomationsForTeams(db, teamIds, TASK_FETCH_LIMIT, query)
1386
1386
  ]);
1387
1387
  const candidatesById = /* @__PURE__ */ new Map();
1388
1388
  const publicScheduledIds = new Set(publicScheduled.map((task) => task.id));
1389
- const publicEventTaskIds = new Set(publicEventTasks.map((task) => task.id));
1390
- for (const task of [...scheduledPage.tasks, ...publicScheduled]) candidatesById.set(`scheduled:${task.id}`, {
1389
+ const publicEventAutomationIds = new Set(publicEventAutomations.map((task) => task.id));
1390
+ for (const task of [...scheduledPage.automations, ...publicScheduled]) candidatesById.set(`scheduled:${task.id}`, {
1391
1391
  kind: "scheduled",
1392
1392
  ownedByViewer: identityIds.has(task.creatorIdentityId),
1393
1393
  publicToViewer: publicScheduledIds.has(task.id),
1394
1394
  task
1395
1395
  });
1396
- for (const task of [...eventTasks, ...publicEventTasks]) candidatesById.set(`event:${task.id}`, {
1396
+ for (const task of [...eventAutomations, ...publicEventAutomations]) candidatesById.set(`event:${task.id}`, {
1397
1397
  kind: "event",
1398
- ownedByViewer: eventTaskBelongsToUser(task, user),
1399
- publicToViewer: publicEventTaskIds.has(task.id),
1398
+ ownedByViewer: eventAutomationBelongsToUser(task, user),
1399
+ publicToViewer: publicEventAutomationIds.has(task.id),
1400
1400
  task
1401
1401
  });
1402
1402
  const candidates = [...candidatesById.values()].sort((left, right) => right.task.createdAtMs - left.task.createdAtMs || right.task.id.localeCompare(left.task.id));
@@ -1407,30 +1407,30 @@ async function readViewerTasks(user, input = {}) {
1407
1407
  const [destinations, creatorEmails] = await Promise.all([destinationDetails(selected.map(({ task }) => task.destination)), creatorProfileEmails(selected)]);
1408
1408
  const visible = selected.filter((candidate) => candidate.ownedByViewer || destinations.get(destinationKey(candidate.task.destination))?.visibility === "public");
1409
1409
  const [executionDays, executionHours, scheduledStats, eventStats] = await Promise.all([
1410
- readTaskExecutionDays(),
1411
- readTaskExecutionHours(),
1412
- readTaskExecutionSummaries("scheduled", "junior"),
1413
- readTaskExecutionSummaries("event", "junior")
1410
+ readAutomationExecutionDays(),
1411
+ readAutomationExecutionHours(),
1412
+ readAutomationExecutionSummaries("scheduled", "junior"),
1413
+ readAutomationExecutionSummaries("event", "junior")
1414
1414
  ]);
1415
- const tasks = visible.map((candidate) => {
1415
+ const automations = visible.map((candidate) => {
1416
1416
  const destination = destinations.get(destinationKey(candidate.task.destination)) ?? {
1417
1417
  label: `Channel ${candidate.task.destination.channelId}`,
1418
1418
  visibility: "private"
1419
1419
  };
1420
1420
  const createdByEmail = creatorEmails.get(creatorKey(candidate.task.destination.teamId, candidate.task.createdBy.slackUserId));
1421
- if (candidate.kind === "scheduled") return scheduledTaskSummary(candidate.task, candidate.ownedByViewer, destination, scheduledStats.get(candidate.task.id), createdByEmail);
1422
- return eventTaskSummary(candidate.task, candidate.ownedByViewer, destination, eventStats.get(candidate.task.id), createdByEmail);
1421
+ if (candidate.kind === "scheduled") return scheduledAutomationSummary(candidate.task, candidate.ownedByViewer, destination, scheduledStats.get(candidate.task.id), createdByEmail);
1422
+ return eventAutomationSummary(candidate.task, candidate.ownedByViewer, destination, eventStats.get(candidate.task.id), createdByEmail);
1423
1423
  });
1424
1424
  return {
1425
1425
  executionDays,
1426
1426
  executionHours,
1427
- executionSixHours: taskExecutionSixHours(executionHours),
1428
- tasks,
1427
+ executionSixHours: automationExecutionSixHours(executionHours),
1428
+ automations,
1429
1429
  truncated: ownedCandidates.length > TASK_LIST_LIMIT || publicCandidates.length > TASK_LIST_LIMIT
1430
1430
  };
1431
1431
  }
1432
- /** Load deleted scheduled tasks the viewer still owns, newest first. */
1433
- async function readDeletedOwnedScheduledTasks(user) {
1432
+ /** Load deleted scheduled automations the viewer still owns, newest first. */
1433
+ async function readDeletedOwnedScheduledAutomations(user) {
1434
1434
  const identityIds = user.identities.map((identity) => identity.id);
1435
1435
  if (identityIds.length === 0) return [];
1436
1436
  return (await getDb().select({
@@ -1438,68 +1438,68 @@ async function readDeletedOwnedScheduledTasks(user) {
1438
1438
  id: juniorSchedulerTasks.id,
1439
1439
  record: juniorSchedulerTasks.record,
1440
1440
  title: juniorSchedulerTasks.title
1441
- }).from(juniorSchedulerTasks).where(and(eq(juniorSchedulerTasks.status, "deleted"), inArray(juniorSchedulerTasks.creatorIdentityId, identityIds))).orderBy(desc(juniorSchedulerTasks.createdAtMs), desc(juniorSchedulerTasks.id)).limit(TASK_EXECUTION_LIST_LIMIT)).map(parseScheduledTaskRow).filter((task) => task?.status === "deleted");
1441
+ }).from(juniorSchedulerTasks).where(and(eq(juniorSchedulerTasks.status, "deleted"), inArray(juniorSchedulerTasks.creatorIdentityId, identityIds))).orderBy(desc(juniorSchedulerTasks.createdAtMs), desc(juniorSchedulerTasks.id)).limit(TASK_EXECUTION_LIST_LIMIT)).map(parseScheduledAutomationRow).filter((task) => task?.status === "deleted");
1442
1442
  }
1443
- /** Load deleted event tasks the viewer still owns, newest first. */
1444
- async function readDeletedOwnedEventTasks(user) {
1445
- return await listDeletedEventTasksCreatedBy(getDb(), user, TASK_EXECUTION_LIST_LIMIT);
1443
+ /** Load deleted event automations the viewer still owns, newest first. */
1444
+ async function readDeletedOwnedEventAutomations(user) {
1445
+ return await listDeletedEventAutomationsCreatedBy(getDb(), user, TASK_EXECUTION_LIST_LIMIT);
1446
1446
  }
1447
- function taskTitleForRun(run, taskTitles) {
1448
- return taskTitles.get(`${run.kind}:${run.taskId}`) ?? run.title?.trim() ?? "Untitled task";
1447
+ function automationTitleForRun(run, automationTitles) {
1448
+ return automationTitles.get(`${run.kind}:${run.automationId}`) ?? run.title?.trim() ?? "Untitled task";
1449
1449
  }
1450
- function addDeletedTaskRun(args, taskTitles, tasks) {
1451
- const key = `${args.kind}:${args.taskId}`;
1452
- if (taskTitles.has(key)) return;
1453
- taskTitles.set(key, args.title);
1454
- tasks.push({
1450
+ function addDeletedAutomationRun(args, automationTitles, automations) {
1451
+ const key = `${args.kind}:${args.automationId}`;
1452
+ if (automationTitles.has(key)) return;
1453
+ automationTitles.set(key, args.title);
1454
+ automations.push({
1455
1455
  kind: args.kind,
1456
- taskId: args.taskId
1456
+ automationId: args.automationId
1457
1457
  });
1458
1458
  }
1459
1459
  /**
1460
- * Read newest runs across live viewer-visible tasks and deleted tasks the
1460
+ * Read newest runs across live viewer-visible automations and deleted automations the
1461
1461
  * viewer owns. Deleted task rows stay available so history does not depend on
1462
1462
  * conversation actor membership.
1463
1463
  */
1464
- async function readViewerTaskRuns(user) {
1464
+ async function readViewerAutomationRuns(user) {
1465
1465
  const [taskList, deletedScheduled, deletedEvent] = await Promise.all([
1466
- readViewerTasks(user),
1467
- readDeletedOwnedScheduledTasks(user),
1468
- readDeletedOwnedEventTasks(user)
1466
+ readViewerAutomations(user),
1467
+ readDeletedOwnedScheduledAutomations(user),
1468
+ readDeletedOwnedEventAutomations(user)
1469
1469
  ]);
1470
- const taskTitles = /* @__PURE__ */ new Map();
1471
- const tasks = [];
1472
- for (const task of taskList.tasks) {
1473
- taskTitles.set(`${task.kind}:${task.id}`, task.title);
1474
- tasks.push({
1470
+ const automationTitles = /* @__PURE__ */ new Map();
1471
+ const automations = [];
1472
+ for (const task of taskList.automations) {
1473
+ automationTitles.set(`${task.kind}:${task.id}`, task.title);
1474
+ automations.push({
1475
1475
  kind: task.kind,
1476
- taskId: task.id
1476
+ automationId: task.id
1477
1477
  });
1478
1478
  }
1479
1479
  for (const task of deletedScheduled) {
1480
- const instruction = displayText(task.task.text, "Untitled scheduled task");
1481
- addDeletedTaskRun({
1480
+ const instruction = displayText(task.task.text, "Untitled scheduled automation");
1481
+ addDeletedAutomationRun({
1482
1482
  kind: "scheduled",
1483
- taskId: task.id,
1484
- title: taskDisplayTitle(task.title, instruction, "Untitled scheduled task")
1485
- }, taskTitles, tasks);
1483
+ automationId: task.id,
1484
+ title: taskDisplayTitle(task.title, instruction, "Untitled scheduled automation")
1485
+ }, automationTitles, automations);
1486
1486
  }
1487
1487
  for (const task of deletedEvent) {
1488
- const instruction = displayText(task.task.text, "Untitled event task");
1489
- addDeletedTaskRun({
1488
+ const instruction = displayText(task.task.text, "Untitled event automation");
1489
+ addDeletedAutomationRun({
1490
1490
  kind: "event",
1491
- taskId: task.id,
1492
- title: taskDisplayTitle(task.title, instruction, "Untitled event task")
1493
- }, taskTitles, tasks);
1491
+ automationId: task.id,
1492
+ title: taskDisplayTitle(task.title, instruction, "Untitled event automation")
1493
+ }, automationTitles, automations);
1494
1494
  }
1495
- const runs = await readTaskRuns({
1495
+ const runs = await readAutomationRuns({
1496
1496
  limit: 101,
1497
- tasks
1497
+ automations
1498
1498
  });
1499
1499
  return {
1500
1500
  runs: runs.slice(0, TASK_EXECUTION_LIST_LIMIT).map((run) => ({
1501
1501
  ...run,
1502
- taskTitle: taskTitleForRun(run, taskTitles)
1502
+ automationTitle: automationTitleForRun(run, automationTitles)
1503
1503
  })),
1504
1504
  truncated: runs.length > TASK_EXECUTION_LIST_LIMIT
1505
1505
  };
@@ -1511,70 +1511,70 @@ var ViewerTaskNotFoundError = class extends Error {
1511
1511
  }
1512
1512
  };
1513
1513
  /** Read one viewer-visible task and its newest terminal executions. */
1514
- async function readViewerTaskExecutions(user, kind, id) {
1514
+ async function readViewerAutomationExecutions(user, kind, id) {
1515
1515
  const candidate = await resolveViewerTaskCandidate(user, kind, id);
1516
1516
  if (!candidate) throw new ViewerTaskNotFoundError();
1517
- const [task, executions, executionDays, executionHours] = await Promise.all([
1518
- taskSummaryForCandidate(candidate),
1519
- readTaskExecutions({
1517
+ const [automation, executions, executionDays, executionHours] = await Promise.all([
1518
+ automationSummaryForCandidate(candidate),
1519
+ readAutomationExecutions({
1520
1520
  kind,
1521
1521
  limit: 101,
1522
- taskId: id
1522
+ automationId: id
1523
1523
  }),
1524
- readTaskExecutionStatusDays({
1524
+ readAutomationExecutionStatusDays({
1525
1525
  kind,
1526
- taskId: id
1526
+ automationId: id
1527
1527
  }),
1528
- readTaskExecutionStatusHours({
1528
+ readAutomationExecutionStatusHours({
1529
1529
  kind,
1530
- taskId: id
1530
+ automationId: id
1531
1531
  })
1532
1532
  ]);
1533
1533
  return {
1534
1534
  executionDays,
1535
1535
  executionHours,
1536
- executionSixHours: taskExecutionStatusSixHours(executionHours),
1536
+ executionSixHours: automationExecutionStatusSixHours(executionHours),
1537
1537
  executions: executions.slice(0, TASK_EXECUTION_LIST_LIMIT),
1538
- task,
1538
+ automation,
1539
1539
  truncated: executions.length > TASK_EXECUTION_LIST_LIMIT
1540
1540
  };
1541
1541
  }
1542
1542
  /** Resolve the source task for one conversation when a terminal execution links it. */
1543
1543
  async function readConversationSourceTask(args) {
1544
- const execution = await readTaskExecutionByConversationId({ conversationId: args.conversationId });
1544
+ const execution = await readAutomationExecutionByConversationId({ conversationId: args.conversationId });
1545
1545
  if (!execution) return void 0;
1546
1546
  if (!args.viewer) return { kind: execution.kind };
1547
- const candidate = await resolveViewerTaskCandidate(args.viewer, execution.kind, execution.taskId);
1547
+ const candidate = await resolveViewerTaskCandidate(args.viewer, execution.kind, execution.automationId);
1548
1548
  if (!candidate) return { kind: execution.kind };
1549
1549
  if (candidate.kind === "scheduled") {
1550
- const instruction = displayText(candidate.task.task.text, "Untitled scheduled task");
1550
+ const instruction = displayText(candidate.task.task.text, "Untitled scheduled automation");
1551
1551
  return {
1552
1552
  id: candidate.task.id,
1553
1553
  kind: "scheduled",
1554
1554
  label: instruction,
1555
- title: taskDisplayTitle(candidate.task.title, instruction, "Untitled scheduled task")
1555
+ title: taskDisplayTitle(candidate.task.title, instruction, "Untitled scheduled automation")
1556
1556
  };
1557
1557
  }
1558
- const instruction = displayText(candidate.task.task.text, "Untitled event task");
1558
+ const instruction = displayText(candidate.task.task.text, "Untitled event automation");
1559
1559
  return {
1560
1560
  id: candidate.task.id,
1561
1561
  kind: "event",
1562
1562
  label: instruction,
1563
- title: taskDisplayTitle(candidate.task.title, instruction, "Untitled event task")
1563
+ title: taskDisplayTitle(candidate.task.title, instruction, "Untitled event automation")
1564
1564
  };
1565
1565
  }
1566
- /** Delete one viewer-owned scheduled or event task. */
1566
+ /** Delete one viewer-owned scheduled or event automation. */
1567
1567
  async function deleteViewerTask(user, kind, id) {
1568
1568
  if (kind === "scheduled") try {
1569
- await deleteViewerScheduledTask(getDb(), user, id);
1569
+ await deleteViewerScheduledAutomation(getDb(), user, id);
1570
1570
  return;
1571
1571
  } catch (error) {
1572
- if (error instanceof PersonalScheduledTaskNotFoundError) throw new ViewerTaskNotFoundError();
1572
+ if (error instanceof PersonalScheduledAutomationNotFoundError) throw new ViewerTaskNotFoundError();
1573
1573
  throw error;
1574
1574
  }
1575
- const task = await getEventTask(getDb(), id);
1576
- if (!task || task.status === "deleted" || !eventTaskBelongsToUser(task, user)) throw new ViewerTaskNotFoundError();
1577
- await deleteEventTask(getDb(), id);
1575
+ const task = await getEventAutomation(getDb(), id);
1576
+ if (!task || task.status === "deleted" || !eventAutomationBelongsToUser(task, user)) throw new ViewerTaskNotFoundError();
1577
+ await deleteEventAutomation(getDb(), id);
1578
1578
  }
1579
1579
  //#endregion
1580
1580
  //#region src/api/conversations/detail.ts
@@ -3409,7 +3409,7 @@ async function readPeoplePluginReports(args) {
3409
3409
  reports: [],
3410
3410
  source: "plugins"
3411
3411
  });
3412
- const { getPluginProfileReports } = await import("./agent-hooks-DNjlz2A-.js").then((n) => n.t);
3412
+ const { getPluginProfileReports } = await import("./agent-hooks-BBX9p6aG.js").then((n) => n.t);
3413
3413
  return pluginOperationalReportFeedSchema.parse({
3414
3414
  generatedAt: new Date(nowMs).toISOString(),
3415
3415
  reports: await getPluginProfileReports({
@@ -3857,30 +3857,30 @@ function createUserPageRoutes() {
3857
3857
  return app;
3858
3858
  }
3859
3859
  //#endregion
3860
- //#region src/api/tasks/routes.ts
3860
+ //#region src/api/automations/routes.ts
3861
3861
  /** Create authenticated native task list and action routes. */
3862
- function createTaskRoutes() {
3862
+ function createAutomationRoutes() {
3863
3863
  const app = new Hono();
3864
- app.get("/", requireViewer, validateRequest("query", taskListQuerySchema, "Invalid task list query."), async (context) => {
3864
+ app.get("/", requireViewer, validateRequest("query", automationListQuerySchema, "Invalid task list query."), async (context) => {
3865
3865
  const user = context.get("viewer");
3866
3866
  const query = context.req.valid("query");
3867
- return jsonResponse(taskListSchema, await readViewerTasks(user, query));
3867
+ return jsonResponse(automationListSchema, await readViewerAutomations(user, query));
3868
3868
  });
3869
3869
  app.get("/runs", requireViewer, async (context) => {
3870
3870
  const user = context.get("viewer");
3871
- return jsonResponse(taskRunListSchema, await readViewerTaskRuns(user));
3871
+ return jsonResponse(automationRunListSchema, await readViewerAutomationRuns(user));
3872
3872
  });
3873
- app.get("/:kind/:id/executions", requireViewer, validateRequest("param", taskParamsSchema, "Invalid task."), async (context) => {
3873
+ app.get("/:kind/:id/executions", requireViewer, validateRequest("param", automationParamsSchema, "Invalid task."), async (context) => {
3874
3874
  const user = context.get("viewer");
3875
3875
  const params = context.req.valid("param");
3876
3876
  try {
3877
- return jsonResponse(taskExecutionListSchema, await readViewerTaskExecutions(user, params.kind, params.id));
3877
+ return jsonResponse(automationExecutionListSchema, await readViewerAutomationExecutions(user, params.kind, params.id));
3878
3878
  } catch (error) {
3879
3879
  if (error instanceof ViewerTaskNotFoundError) return jsonResponse(apiErrorSchema, { error: error.message }, { status: 404 });
3880
3880
  throw error;
3881
3881
  }
3882
3882
  });
3883
- app.delete("/:kind/:id", requireViewer, validateRequest("param", taskParamsSchema, "Invalid task."), async (context) => {
3883
+ app.delete("/:kind/:id", requireViewer, validateRequest("param", automationParamsSchema, "Invalid task."), async (context) => {
3884
3884
  const user = context.get("viewer");
3885
3885
  const params = context.req.valid("param");
3886
3886
  try {
@@ -4018,7 +4018,7 @@ function readDescriptionText(home) {
4018
4018
  }
4019
4019
  /** Read discovered skill names for authenticated runtime diagnostics. */
4020
4020
  async function readSkillReports() {
4021
- const { discoverSkills } = await import("./skills-BhM5qyCF.js").then((n) => n.o);
4021
+ const { discoverSkills } = await import("./skills-D9WesdJJ.js").then((n) => n.o);
4022
4022
  const skills = await discoverSkills();
4023
4023
  return skillReportsSchema.parse(skills.map((skill) => ({
4024
4024
  name: skill.name,
@@ -4027,7 +4027,7 @@ async function readSkillReports() {
4027
4027
  }
4028
4028
  /** Read safe configured plugin metadata for authenticated runtime diagnostics. */
4029
4029
  async function readPlugins() {
4030
- const { pluginCatalogRuntime } = await import("./catalog-runtime-TBR8n4e1.js").then((n) => n.t);
4030
+ const { pluginCatalogRuntime } = await import("./catalog-runtime-1BZEOR8J.js").then((n) => n.t);
4031
4031
  return pluginsSchema.parse(pluginCatalogRuntime.getProviders().map((plugin) => ({
4032
4032
  configKeys: plugin.manifest.configKeys ?? [],
4033
4033
  description: plugin.manifest.description,
@@ -4039,7 +4039,7 @@ async function readPlugins() {
4039
4039
  async function readRuntimeInfoReport() {
4040
4040
  const [{ homeDir }, { pluginCatalogRuntime }, plugins, skills] = await Promise.all([
4041
4041
  import("./package-discovery-7a9YqLhE.js").then((n) => n.r),
4042
- import("./catalog-runtime-TBR8n4e1.js").then((n) => n.t),
4042
+ import("./catalog-runtime-1BZEOR8J.js").then((n) => n.t),
4043
4043
  readPlugins(),
4044
4044
  readSkillReports()
4045
4045
  ]);
@@ -4056,7 +4056,7 @@ async function readRuntimeInfoReport() {
4056
4056
  /** Read sanitized operational summaries contributed by plugins. */
4057
4057
  async function readPluginOperationalReportFeed() {
4058
4058
  const nowMs = Date.now();
4059
- const { getPluginOperationalReports } = await import("./agent-hooks-DNjlz2A-.js").then((n) => n.t);
4059
+ const { getPluginOperationalReports } = await import("./agent-hooks-BBX9p6aG.js").then((n) => n.t);
4060
4060
  return pluginOperationalReportFeedSchema.parse({
4061
4061
  source: "plugins",
4062
4062
  generatedAt: new Date(nowMs).toISOString(),
@@ -4080,7 +4080,7 @@ function createJuniorApi() {
4080
4080
  app.route("/api/people", createPeopleRoutes());
4081
4081
  app.route("/api/locations", createLocationRoutes());
4082
4082
  app.route("/api/user-pages", createUserPageRoutes());
4083
- app.route("/api/tasks", createTaskRoutes());
4083
+ app.route("/api/automations", createAutomationRoutes());
4084
4084
  app.route("/api/workspaces", createWorkspaceRoutes());
4085
4085
  app.notFound(() => jsonResponse(apiErrorSchema, { error: "Resource not found." }, { status: 404 }));
4086
4086
  app.onError((error, _context) => {