@sentry/junior 0.132.0 → 0.134.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 (83) hide show
  1. package/dist/{agent-hooks-ONXOJDR6.js → agent-hooks-HGXNYOOD.js} +9 -9
  2. package/dist/api/schema/task.d.ts +60 -0
  3. package/dist/api/schema.d.ts +2 -2
  4. package/dist/api/schema.js +3 -1
  5. package/dist/api.js +90 -20
  6. package/dist/app.js +110 -39
  7. package/dist/{catalog-runtime-BATAY4R7.js → catalog-runtime-P6QHU6XE.js} +5 -5
  8. package/dist/chat/agent/prompt.d.ts +7 -5
  9. package/dist/chat/agent/repository-context.d.ts +20 -0
  10. package/dist/chat/agent/sandbox.d.ts +8 -0
  11. package/dist/chat/agent/tools.d.ts +3 -0
  12. package/dist/chat/config.d.ts +2 -0
  13. package/dist/chat/conversations/projection.d.ts +3 -1
  14. package/dist/chat/conversations/sql/bindings.d.ts +13 -0
  15. package/dist/chat/conversations/sql/store.d.ts +3 -0
  16. package/dist/chat/conversations/store.d.ts +15 -0
  17. package/dist/chat/plugins/agent-hooks.d.ts +2 -2
  18. package/dist/chat/repository-instructions.d.ts +44 -0
  19. package/dist/chat/runtime/reply-executor.d.ts +1 -0
  20. package/dist/chat/runtime/slack-runtime.d.ts +2 -0
  21. package/dist/chat/sandbox/noninteractive-command.d.ts +2 -0
  22. package/dist/chat/sandbox/sandbox.d.ts +3 -0
  23. package/dist/chat/sandbox/session.d.ts +1 -0
  24. package/dist/chat/services/context-compaction.d.ts +1 -0
  25. package/dist/chat/slack/dispatch-turn.d.ts +1 -0
  26. package/dist/chat/slack/reply.d.ts +1 -1
  27. package/dist/chat/slack/tools/user-lookup.d.ts +2 -6
  28. package/dist/chat/tasks/execution-stats.d.ts +29 -0
  29. package/dist/chat/tasks/registered.d.ts +3 -0
  30. package/dist/chat/tools/index.d.ts +2 -0
  31. package/dist/chat/tools/sandbox/bash.d.ts +1 -0
  32. package/dist/chat/tools/system-time.d.ts +11 -1
  33. package/dist/{chunk-O2UXPUVQ.js → chunk-52DIKFJV.js} +14 -6
  34. package/dist/{chunk-GOEZU33G.js → chunk-6T3AYZT7.js} +1 -1
  35. package/dist/{chunk-GPXVDJML.js → chunk-7GKQ7UIO.js} +449 -39
  36. package/dist/{chunk-QVEXYYFM.js → chunk-7UTBPDXK.js} +24 -1
  37. package/dist/{chunk-U76PS7AT.js → chunk-AS3I7OIL.js} +2 -2
  38. package/dist/{chunk-HX236W2U.js → chunk-CDQ4YIZM.js} +9 -0
  39. package/dist/{chunk-ODIP5CEM.js → chunk-FDNAUM7X.js} +32 -32
  40. package/dist/{chunk-GTKNPQNN.js → chunk-FL466XX5.js} +36 -24
  41. package/dist/{chunk-2425Q4OR.js → chunk-GSP5SMZJ.js} +1 -1
  42. package/dist/{chunk-XN656LB4.js → chunk-KWGJG4HO.js} +6 -12
  43. package/dist/{chunk-ISNRPCPG.js → chunk-LKK4XMUV.js} +1 -1
  44. package/dist/{chunk-G3WYA2RS.js → chunk-MFERLE3G.js} +1 -1
  45. package/dist/{chunk-ZMV2YBT6.js → chunk-NF2TNZPD.js} +788 -674
  46. package/dist/chunk-NOA34AJY.js +122 -0
  47. package/dist/{chunk-JYQAE2ZU.js → chunk-NYWSCJVW.js} +1 -1
  48. package/dist/{chunk-KB2M27DL.js → chunk-QLEKAO7O.js} +130 -40
  49. package/dist/{chunk-BKE47OOW.js → chunk-S6DMTEOM.js} +2 -2
  50. package/dist/{chunk-ALDPUN3Z.js → chunk-TR6UEEYD.js} +8 -6
  51. package/dist/{chunk-WEJIS7OC.js → chunk-U3ZI7CCW.js} +1 -1
  52. package/dist/{chunk-B7IY6SVJ.js → chunk-VEGF62FV.js} +1 -1
  53. package/dist/{chunk-SKWIIUS7.js → chunk-VGXJMECA.js} +7 -7
  54. package/dist/{chunk-V44FFBO3.js → chunk-VP6NCPRS.js} +1 -1
  55. package/dist/{chunk-WYQP7QSB.js → chunk-VPYKNCTN.js} +101 -61
  56. package/dist/{chunk-NNHUGGO4.js → chunk-XG5PHKPM.js} +19 -3
  57. package/dist/{chunk-AW5Z3T7V.js → chunk-YNLQQ622.js} +9 -8
  58. package/dist/cli/chat.js +25 -25
  59. package/dist/cli/check.js +6 -6
  60. package/dist/cli/init.js +1 -1
  61. package/dist/cli/plugins.js +12 -12
  62. package/dist/cli/snapshot-create.js +9 -9
  63. package/dist/cli/upgrade.js +9 -8
  64. package/dist/db/executor.d.ts +2 -1
  65. package/dist/db/neon.d.ts +1 -0
  66. package/dist/db/postgres.d.ts +1 -0
  67. package/dist/db/schema/conversation-bindings.d.ts +110 -0
  68. package/dist/db/schema/task-executions.d.ts +110 -0
  69. package/dist/db/schema.d.ts +221 -1
  70. package/dist/{db-QFFZACXF.js → db-GFK4NHWJ.js} +7 -7
  71. package/dist/instrumentation.js +4 -4
  72. package/dist/nitro.js +2 -2
  73. package/dist/{oauth-callback-server-5WXLD533.js → oauth-callback-server-HUJLAQ5N.js} +19 -18
  74. package/dist/{runner-Y3LTUNAA.js → runner-T77AFAH4.js} +13 -12
  75. package/dist/{skills-7M5C24GM.js → skills-3KUFJOOR.js} +6 -6
  76. package/dist/{validation-MRILMYDI.js → validation-FMWDHKYU.js} +6 -6
  77. package/dist/version.js +1 -1
  78. package/migrations/0018_curvy_excalibur.sql +12 -0
  79. package/migrations/0019_lowly_valkyrie.sql +14 -0
  80. package/migrations/meta/0018_snapshot.json +1756 -0
  81. package/migrations/meta/0019_snapshot.json +1904 -0
  82. package/migrations/meta/_journal.json +15 -1
  83. package/package.json +5 -5
@@ -11,19 +11,19 @@ import {
11
11
  getPlugins,
12
12
  setPlugins,
13
13
  validatePlugins
14
- } from "./chunk-ALDPUN3Z.js";
15
- import "./chunk-WYQP7QSB.js";
16
- import "./chunk-KB2M27DL.js";
17
- import "./chunk-ODIP5CEM.js";
18
- import "./chunk-NNHUGGO4.js";
14
+ } from "./chunk-TR6UEEYD.js";
15
+ import "./chunk-VPYKNCTN.js";
16
+ import "./chunk-QLEKAO7O.js";
17
+ import "./chunk-FDNAUM7X.js";
18
+ import "./chunk-XG5PHKPM.js";
19
19
  import "./chunk-VFUK3X5B.js";
20
- import "./chunk-ISNRPCPG.js";
20
+ import "./chunk-LKK4XMUV.js";
21
21
  import "./chunk-HZF5P5UN.js";
22
22
  import "./chunk-F3B2YJ76.js";
23
- import "./chunk-GOEZU33G.js";
23
+ import "./chunk-6T3AYZT7.js";
24
24
  import "./chunk-6GWA276C.js";
25
- import "./chunk-WEJIS7OC.js";
26
- import "./chunk-2425Q4OR.js";
25
+ import "./chunk-U3ZI7CCW.js";
26
+ import "./chunk-GSP5SMZJ.js";
27
27
  import "./chunk-MLKGABMK.js";
28
28
  export {
29
29
  PluginHookDeniedError,
@@ -14,7 +14,11 @@ export declare const scheduledTaskSummarySchema: z.ZodObject<{
14
14
  }, z.core.$strict>;
15
15
  id: z.ZodString;
16
16
  instruction: z.ZodString;
17
+ lastConversationId: z.ZodOptional<z.ZodString>;
18
+ lastRunAt: z.ZodOptional<z.ZodString>;
17
19
  ownedByViewer: z.ZodBoolean;
20
+ runsLast7Days: z.ZodNumber;
21
+ totalRuns: z.ZodNumber;
18
22
  kind: z.ZodLiteral<"scheduled">;
19
23
  nextRunAt: z.ZodOptional<z.ZodString>;
20
24
  schedule: z.ZodString;
@@ -38,7 +42,11 @@ export declare const eventTaskSummarySchema: z.ZodObject<{
38
42
  }, z.core.$strict>;
39
43
  id: z.ZodString;
40
44
  instruction: z.ZodString;
45
+ lastConversationId: z.ZodOptional<z.ZodString>;
46
+ lastRunAt: z.ZodOptional<z.ZodString>;
41
47
  ownedByViewer: z.ZodBoolean;
48
+ runsLast7Days: z.ZodNumber;
49
+ totalRuns: z.ZodNumber;
42
50
  events: z.ZodArray<z.ZodString>;
43
51
  kind: z.ZodLiteral<"event">;
44
52
  resource: z.ZodString;
@@ -60,7 +68,11 @@ export declare const taskSummarySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
60
68
  }, z.core.$strict>;
61
69
  id: z.ZodString;
62
70
  instruction: z.ZodString;
71
+ lastConversationId: z.ZodOptional<z.ZodString>;
72
+ lastRunAt: z.ZodOptional<z.ZodString>;
63
73
  ownedByViewer: z.ZodBoolean;
74
+ runsLast7Days: z.ZodNumber;
75
+ totalRuns: z.ZodNumber;
64
76
  kind: z.ZodLiteral<"scheduled">;
65
77
  nextRunAt: z.ZodOptional<z.ZodString>;
66
78
  schedule: z.ZodString;
@@ -83,14 +95,52 @@ export declare const taskSummarySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
83
95
  }, z.core.$strict>;
84
96
  id: z.ZodString;
85
97
  instruction: z.ZodString;
98
+ lastConversationId: z.ZodOptional<z.ZodString>;
99
+ lastRunAt: z.ZodOptional<z.ZodString>;
86
100
  ownedByViewer: z.ZodBoolean;
101
+ runsLast7Days: z.ZodNumber;
102
+ totalRuns: z.ZodNumber;
87
103
  events: z.ZodArray<z.ZodString>;
88
104
  kind: z.ZodLiteral<"event">;
89
105
  resource: z.ZodString;
90
106
  source: z.ZodString;
91
107
  triggerAvailable: z.ZodBoolean;
92
108
  }, z.core.$strict>], "kind">;
109
+ /** One registered plugin background task with run frequency and recency. */
110
+ export declare const registeredTaskSummarySchema: z.ZodObject<{
111
+ id: z.ZodString;
112
+ lastConversationId: z.ZodOptional<z.ZodString>;
113
+ lastRunAt: z.ZodOptional<z.ZodString>;
114
+ name: z.ZodString;
115
+ pluginDisplayName: z.ZodString;
116
+ pluginName: z.ZodString;
117
+ runsLast7Days: z.ZodNumber;
118
+ totalRuns: z.ZodNumber;
119
+ }, z.core.$strict>;
120
+ /** One UTC day of successful task executions stacked by task type. */
121
+ export declare const taskExecutionDaySchema: z.ZodObject<{
122
+ date: z.ZodString;
123
+ event: z.ZodNumber;
124
+ registered: z.ZodNumber;
125
+ scheduled: z.ZodNumber;
126
+ }, z.core.$strict>;
93
127
  export declare const taskListSchema: z.ZodObject<{
128
+ executionDays: z.ZodArray<z.ZodObject<{
129
+ date: z.ZodString;
130
+ event: z.ZodNumber;
131
+ registered: z.ZodNumber;
132
+ scheduled: z.ZodNumber;
133
+ }, z.core.$strict>>;
134
+ registeredTasks: z.ZodArray<z.ZodObject<{
135
+ id: z.ZodString;
136
+ lastConversationId: z.ZodOptional<z.ZodString>;
137
+ lastRunAt: z.ZodOptional<z.ZodString>;
138
+ name: z.ZodString;
139
+ pluginDisplayName: z.ZodString;
140
+ pluginName: z.ZodString;
141
+ runsLast7Days: z.ZodNumber;
142
+ totalRuns: z.ZodNumber;
143
+ }, z.core.$strict>>;
94
144
  tasks: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
95
145
  createdAt: z.ZodString;
96
146
  createdBy: z.ZodString;
@@ -106,7 +156,11 @@ export declare const taskListSchema: z.ZodObject<{
106
156
  }, z.core.$strict>;
107
157
  id: z.ZodString;
108
158
  instruction: z.ZodString;
159
+ lastConversationId: z.ZodOptional<z.ZodString>;
160
+ lastRunAt: z.ZodOptional<z.ZodString>;
109
161
  ownedByViewer: z.ZodBoolean;
162
+ runsLast7Days: z.ZodNumber;
163
+ totalRuns: z.ZodNumber;
110
164
  kind: z.ZodLiteral<"scheduled">;
111
165
  nextRunAt: z.ZodOptional<z.ZodString>;
112
166
  schedule: z.ZodString;
@@ -129,7 +183,11 @@ export declare const taskListSchema: z.ZodObject<{
129
183
  }, z.core.$strict>;
130
184
  id: z.ZodString;
131
185
  instruction: z.ZodString;
186
+ lastConversationId: z.ZodOptional<z.ZodString>;
187
+ lastRunAt: z.ZodOptional<z.ZodString>;
132
188
  ownedByViewer: z.ZodBoolean;
189
+ runsLast7Days: z.ZodNumber;
190
+ totalRuns: z.ZodNumber;
133
191
  events: z.ZodArray<z.ZodString>;
134
192
  kind: z.ZodLiteral<"event">;
135
193
  resource: z.ZodString;
@@ -145,5 +203,7 @@ export declare const taskParamsSchema: z.ZodObject<{
145
203
  scheduled: "scheduled";
146
204
  }>;
147
205
  }, z.core.$strict>;
206
+ export type RegisteredTaskSummary = z.output<typeof registeredTaskSummarySchema>;
207
+ export type TaskExecutionDay = z.output<typeof taskExecutionDaySchema>;
148
208
  export type TaskSummary = z.output<typeof taskSummarySchema>;
149
209
  export type TaskList = z.output<typeof taskListSchema>;
@@ -10,8 +10,8 @@ export { apiErrorSchema } from "./schema/common";
10
10
  export type { ApiError } from "./schema/common";
11
11
  export { createPersonalTokenBodySchema, createdPersonalTokenSchema, personalTokenListSchema, personalTokenMetadataSchema, personalTokenParamsSchema, revokePersonalTokenResponseSchema, } from "./schema/personal-token";
12
12
  export type { PersonalTokenMetadata } from "./schema/personal-token";
13
- export { eventTaskSummarySchema, scheduledTaskSummarySchema, taskListSchema, taskParamsSchema, taskSummarySchema, } from "./schema/task";
14
- export type { TaskList, TaskSummary } from "./schema/task";
13
+ export { eventTaskSummarySchema, registeredTaskSummarySchema, scheduledTaskSummarySchema, taskListSchema, taskParamsSchema, taskSummarySchema, } from "./schema/task";
14
+ export type { RegisteredTaskSummary, TaskExecutionDay, TaskList, TaskSummary, } from "./schema/task";
15
15
  export { statSchema, statsReportSchema } from "./schema/stats";
16
16
  export type { StatReport, StatsReport } from "./schema/stats";
17
17
  export { healthReportSchema, pluginOperationalReportFeedSchema, pluginOperationalReportSchema, pluginPackageContentItemReportSchema, pluginPackageContentReportSchema, pluginSchema, pluginsSchema, runtimeInfoReportSchema, skillReportSchema, skillReportsSchema, } from "../reporting-schema";
@@ -30,6 +30,7 @@ import {
30
30
  personalTokenListSchema,
31
31
  personalTokenMetadataSchema,
32
32
  personalTokenParamsSchema,
33
+ registeredTaskSummarySchema,
33
34
  revokePersonalTokenResponseSchema,
34
35
  scheduledTaskSummarySchema,
35
36
  statSchema,
@@ -37,7 +38,7 @@ import {
37
38
  taskListSchema,
38
39
  taskParamsSchema,
39
40
  taskSummarySchema
40
- } from "../chunk-QVEXYYFM.js";
41
+ } from "../chunk-7UTBPDXK.js";
41
42
  import {
42
43
  healthReportSchema,
43
44
  pluginOperationalReportFeedSchema,
@@ -92,6 +93,7 @@ export {
92
93
  pluginPackageContentReportSchema,
93
94
  pluginSchema,
94
95
  pluginsSchema,
96
+ registeredTaskSummarySchema,
95
97
  revokePersonalTokenResponseSchema,
96
98
  runtimeInfoReportSchema,
97
99
  scheduledTaskSummarySchema,
package/dist/api.js CHANGED
@@ -27,15 +27,19 @@ import {
27
27
  statsReportSchema,
28
28
  taskListSchema,
29
29
  taskParamsSchema
30
- } from "./chunk-QVEXYYFM.js";
30
+ } from "./chunk-7UTBPDXK.js";
31
31
  import {
32
32
  formatSlackConversationRedactedLabel,
33
33
  readHealthReport,
34
34
  resolveSlackConversationContextFromThreadId
35
- } from "./chunk-U76PS7AT.js";
35
+ } from "./chunk-AS3I7OIL.js";
36
36
  import {
37
37
  buildSentryConversationUrl
38
38
  } from "./chunk-4CODA7P5.js";
39
+ import {
40
+ readTaskExecutionDays,
41
+ readTaskExecutionSummaries
42
+ } from "./chunk-NOA34AJY.js";
39
43
  import {
40
44
  healthReportSchema,
41
45
  pluginOperationalReportFeedSchema,
@@ -54,15 +58,15 @@ import {
54
58
  listPublicEventTasksForTeams,
55
59
  listPublicScheduledTasksForTeams,
56
60
  readStats
57
- } from "./chunk-XN656LB4.js";
61
+ } from "./chunk-KWGJG4HO.js";
58
62
  import {
59
63
  parseSlackThreadId
60
- } from "./chunk-G3WYA2RS.js";
64
+ } from "./chunk-MFERLE3G.js";
61
65
  import {
62
66
  agentTurnUsageSchema,
63
67
  hasAgentTurnUsage,
64
68
  renderJuniorNativeConversationEvent
65
- } from "./chunk-HX236W2U.js";
69
+ } from "./chunk-CDQ4YIZM.js";
66
70
  import "./chunk-PDO5BLNM.js";
67
71
  import {
68
72
  createPluginLogger,
@@ -70,38 +74,38 @@ import {
70
74
  listConversationAnnotations,
71
75
  renderPluginConversationEvent,
72
76
  resolveViewerUser
73
- } from "./chunk-ALDPUN3Z.js";
77
+ } from "./chunk-TR6UEEYD.js";
74
78
  import {
75
79
  decodeStoredConversationEvent,
76
80
  getDb,
77
81
  getSqlExecutor,
78
82
  locationFromRow,
79
83
  parseSessionSource
80
- } from "./chunk-WYQP7QSB.js";
84
+ } from "./chunk-VPYKNCTN.js";
81
85
  import {
82
86
  juniorApiTokens,
83
87
  juniorConversationEvents,
84
88
  juniorConversations,
85
89
  juniorIdentities,
86
90
  juniorUsers
87
- } from "./chunk-KB2M27DL.js";
88
- import "./chunk-ODIP5CEM.js";
89
- import "./chunk-NNHUGGO4.js";
91
+ } from "./chunk-QLEKAO7O.js";
92
+ import "./chunk-FDNAUM7X.js";
93
+ import "./chunk-XG5PHKPM.js";
90
94
  import {
91
95
  juniorDestinations
92
96
  } from "./chunk-VFUK3X5B.js";
93
97
  import {
94
98
  canExposeConversationPayload
95
- } from "./chunk-ISNRPCPG.js";
99
+ } from "./chunk-LKK4XMUV.js";
96
100
  import "./chunk-HZF5P5UN.js";
97
101
  import {
98
102
  parseSlackChannelId,
99
103
  parseSlackTeamId
100
104
  } from "./chunk-F3B2YJ76.js";
101
- import "./chunk-GOEZU33G.js";
105
+ import "./chunk-6T3AYZT7.js";
102
106
  import "./chunk-6GWA276C.js";
103
- import "./chunk-WEJIS7OC.js";
104
- import "./chunk-2425Q4OR.js";
107
+ import "./chunk-U3ZI7CCW.js";
108
+ import "./chunk-GSP5SMZJ.js";
105
109
  import "./chunk-MLKGABMK.js";
106
110
 
107
111
  // src/api.ts
@@ -2027,7 +2031,7 @@ function readDescriptionText(home) {
2027
2031
  }
2028
2032
  }
2029
2033
  async function readSkillReports() {
2030
- const { discoverSkills } = await import("./skills-7M5C24GM.js");
2034
+ const { discoverSkills } = await import("./skills-3KUFJOOR.js");
2031
2035
  const skills = await discoverSkills();
2032
2036
  return skillReportsSchema.parse(
2033
2037
  skills.map((skill) => ({
@@ -2037,7 +2041,7 @@ async function readSkillReports() {
2037
2041
  );
2038
2042
  }
2039
2043
  async function readPlugins() {
2040
- const { pluginCatalogRuntime } = await import("./catalog-runtime-BATAY4R7.js");
2044
+ const { pluginCatalogRuntime } = await import("./catalog-runtime-P6QHU6XE.js");
2041
2045
  return pluginsSchema.parse(
2042
2046
  pluginCatalogRuntime.getProviders().map((plugin) => ({
2043
2047
  configKeys: plugin.manifest.configKeys ?? [],
@@ -2050,7 +2054,7 @@ async function readPlugins() {
2050
2054
  async function readRuntimeInfoReport() {
2051
2055
  const [{ homeDir }, { pluginCatalogRuntime }, plugins, skills] = await Promise.all([
2052
2056
  import("./discovery-GUFTFBTL.js"),
2053
- import("./catalog-runtime-BATAY4R7.js"),
2057
+ import("./catalog-runtime-P6QHU6XE.js"),
2054
2058
  readPlugins(),
2055
2059
  readSkillReports()
2056
2060
  ]);
@@ -2066,7 +2070,7 @@ async function readRuntimeInfoReport() {
2066
2070
  }
2067
2071
  async function readPluginOperationalReportFeed() {
2068
2072
  const nowMs = Date.now();
2069
- const { getPluginOperationalReports } = await import("./agent-hooks-ONXOJDR6.js");
2073
+ const { getPluginOperationalReports } = await import("./agent-hooks-HGXNYOOD.js");
2070
2074
  return pluginOperationalReportFeedSchema.parse({
2071
2075
  source: "plugins",
2072
2076
  generatedAt: new Date(nowMs).toISOString(),
@@ -3351,6 +3355,53 @@ import { Hono as Hono6 } from "hono";
3351
3355
  // src/chat/tasks/read.ts
3352
3356
  import { and as and14, eq as eq15, or as or3 } from "drizzle-orm";
3353
3357
 
3358
+ // src/chat/tasks/registered.ts
3359
+ async function readRegisteredTasks() {
3360
+ const [{ getPlugins: getPlugins2 }, { pluginCatalogRuntime }] = await Promise.all([
3361
+ import("./agent-hooks-HGXNYOOD.js"),
3362
+ import("./catalog-runtime-P6QHU6XE.js")
3363
+ ]);
3364
+ const runtimePlugins = new Map(
3365
+ getPlugins2().map((plugin) => [plugin.manifest.name, plugin])
3366
+ );
3367
+ const providers = pluginCatalogRuntime.getProviders();
3368
+ const pluginTaskStats = new Map(
3369
+ await Promise.all(
3370
+ providers.map(
3371
+ async (plugin) => [
3372
+ plugin.manifest.name,
3373
+ await readTaskExecutionSummaries(
3374
+ "registered",
3375
+ plugin.manifest.name
3376
+ )
3377
+ ]
3378
+ )
3379
+ )
3380
+ );
3381
+ return providers.flatMap((plugin) => {
3382
+ const taskNames = Object.keys(
3383
+ runtimePlugins.get(plugin.manifest.name)?.tasks ?? {}
3384
+ ).sort((left, right) => left.localeCompare(right));
3385
+ return taskNames.map((name) => {
3386
+ const stats = pluginTaskStats.get(plugin.manifest.name)?.get(name);
3387
+ return {
3388
+ id: `${plugin.manifest.name}:${name}`,
3389
+ name,
3390
+ pluginDisplayName: plugin.manifest.displayName,
3391
+ pluginName: plugin.manifest.name,
3392
+ runsLast7Days: stats?.runsLast7Days ?? 0,
3393
+ totalRuns: stats?.totalRuns ?? 0,
3394
+ ...stats?.lastConversationId ? { lastConversationId: stats.lastConversationId } : {},
3395
+ ...stats?.lastExecutedAtMs ? {
3396
+ lastRunAt: new Date(stats.lastExecutedAtMs).toISOString()
3397
+ } : {}
3398
+ };
3399
+ });
3400
+ }).sort(
3401
+ (left, right) => left.pluginDisplayName.localeCompare(right.pluginDisplayName) || left.name.localeCompare(right.name)
3402
+ );
3403
+ }
3404
+
3354
3405
  // src/chat/scheduled-tasks/personal.ts
3355
3406
  import { z as z3 } from "zod";
3356
3407
  var cursorSchema = z3.object({
@@ -3522,7 +3573,15 @@ async function destinationDetails(destinations) {
3522
3573
  })
3523
3574
  );
3524
3575
  }
3525
- function scheduledTaskSummary(task, ownedByViewer, destination) {
3576
+ function executionSummaryFields(stats) {
3577
+ return {
3578
+ ...stats?.lastConversationId ? { lastConversationId: stats.lastConversationId } : {},
3579
+ ...stats?.lastExecutedAtMs ? { lastRunAt: new Date(stats.lastExecutedAtMs).toISOString() } : {},
3580
+ runsLast7Days: stats?.runsLast7Days ?? 0,
3581
+ totalRuns: stats?.totalRuns ?? 0
3582
+ };
3583
+ }
3584
+ function scheduledTaskSummary(task, ownedByViewer, destination, stats) {
3526
3585
  if (task.status === "deleted") {
3527
3586
  throw new Error("Deleted scheduled tasks cannot enter the Tasks view");
3528
3587
  }
@@ -3539,6 +3598,7 @@ function scheduledTaskSummary(task, ownedByViewer, destination) {
3539
3598
  id: task.id,
3540
3599
  instruction: displayText(task.task.text, "Untitled scheduled task"),
3541
3600
  kind: "scheduled",
3601
+ ...executionSummaryFields(stats),
3542
3602
  ...nextRunAtMs !== void 0 ? { nextRunAt: new Date(nextRunAtMs).toISOString() } : {},
3543
3603
  ownedByViewer,
3544
3604
  schedule: displayText(task.schedule.description, "Schedule unavailable"),
@@ -3605,6 +3665,12 @@ async function readViewerTasks(user) {
3605
3665
  const visible = selected.filter(
3606
3666
  (candidate) => candidate.ownedByViewer || destinations.get(destinationKey(candidate.task.destination))?.visibility === "public"
3607
3667
  );
3668
+ const [registeredTasks, executionDays, scheduledStats, eventStats] = await Promise.all([
3669
+ readRegisteredTasks(),
3670
+ readTaskExecutionDays(),
3671
+ readTaskExecutionSummaries("scheduled", "junior"),
3672
+ readTaskExecutionSummaries("event", "junior")
3673
+ ]);
3608
3674
  const tasks = visible.map((candidate) => {
3609
3675
  const destination = destinations.get(
3610
3676
  destinationKey(candidate.task.destination)
@@ -3622,7 +3688,8 @@ async function readViewerTasks(user) {
3622
3688
  const summary = scheduledTaskSummary(
3623
3689
  candidate.task,
3624
3690
  candidate.ownedByViewer,
3625
- destination
3691
+ destination,
3692
+ scheduledStats.get(candidate.task.id)
3626
3693
  );
3627
3694
  return {
3628
3695
  ...summary,
@@ -3644,6 +3711,7 @@ async function readViewerTasks(user) {
3644
3711
  id: task.id,
3645
3712
  instruction: task.task.text,
3646
3713
  kind: "event",
3714
+ ...executionSummaryFields(eventStats.get(task.id)),
3647
3715
  ownedByViewer: candidate.ownedByViewer,
3648
3716
  resource: `${task.trigger.label} \xB7 ${task.trigger.identifier}`,
3649
3717
  source: task.trigger.namespace,
@@ -3651,6 +3719,8 @@ async function readViewerTasks(user) {
3651
3719
  };
3652
3720
  });
3653
3721
  return {
3722
+ executionDays,
3723
+ registeredTasks,
3654
3724
  tasks,
3655
3725
  truncated: ownedCandidates.length > TASK_LIST_LIMIT || publicCandidates.length > TASK_LIST_LIMIT
3656
3726
  };