@sentry/junior 0.128.0 → 0.129.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 (73) hide show
  1. package/dist/{agent-hooks-F75ANGBV.js → agent-hooks-ZM4WMZCN.js} +9 -9
  2. package/dist/api/schema/task.d.ts +152 -0
  3. package/dist/api/schema.d.ts +2 -0
  4. package/dist/api/schema.js +13 -3
  5. package/dist/api/tasks/routes.d.ts +4 -0
  6. package/dist/api.js +425 -23
  7. package/dist/app.d.ts +2 -1
  8. package/dist/app.js +315 -27
  9. package/dist/{catalog-runtime-ZPSA5QM2.js → catalog-runtime-TN2GPVEI.js} +5 -5
  10. package/dist/chat/agent-dispatch/context.d.ts +18 -0
  11. package/dist/chat/event-tasks/store.d.ts +7 -1
  12. package/dist/chat/event-tasks/tool-support.d.ts +1 -0
  13. package/dist/chat/resource-events/runtime-catalog.d.ts +3 -0
  14. package/dist/chat/sandbox/resources.d.ts +12 -1
  15. package/dist/chat/scheduled-tasks/cadence.d.ts +27 -0
  16. package/dist/chat/scheduled-tasks/heartbeat.d.ts +6 -0
  17. package/dist/chat/scheduled-tasks/identity.d.ts +6 -0
  18. package/dist/chat/scheduled-tasks/personal.d.ts +26 -0
  19. package/dist/chat/scheduled-tasks/schedule-intent.d.ts +61 -0
  20. package/dist/chat/scheduled-tasks/store.d.ts +77 -0
  21. package/dist/chat/scheduled-tasks/tool-support.d.ts +203 -0
  22. package/dist/chat/scheduled-tasks/tools/create.d.ts +80 -0
  23. package/dist/chat/scheduled-tasks/tools/delete.d.ts +56 -0
  24. package/dist/chat/scheduled-tasks/tools/list.d.ts +54 -0
  25. package/dist/chat/scheduled-tasks/tools/run-now.d.ts +56 -0
  26. package/dist/chat/scheduled-tasks/tools/update.d.ts +82 -0
  27. package/dist/chat/scheduled-tasks/tools.d.ts +6 -0
  28. package/dist/chat/scheduled-tasks/types.d.ts +81 -0
  29. package/dist/chat/tasks/read.d.ts +9 -0
  30. package/dist/chat/tools/scheduled-tasks.d.ts +4 -0
  31. package/dist/{chunk-K5ZB3WWH.js → chunk-2BCQKJTX.js} +2 -2
  32. package/dist/{chunk-G6XQODHM.js → chunk-3N4MWF3R.js} +1 -1
  33. package/dist/{chunk-NHWE6Y7G.js → chunk-6CMYU62S.js} +7 -7
  34. package/dist/{chunk-YY6CVET7.js → chunk-6QQOLIJJ.js} +1308 -804
  35. package/dist/{chunk-WZ365SQC.js → chunk-A6QQPVSH.js} +1 -1
  36. package/dist/chunk-BDIEEZK7.js +1470 -0
  37. package/dist/{chunk-AFJF3RGU.js → chunk-BVKP37NE.js} +61 -13
  38. package/dist/{chunk-5KKIBIIP.js → chunk-CZJUBH6O.js} +12 -12
  39. package/dist/{chunk-OLGB5Y7R.js → chunk-CZQ2DSQZ.js} +1 -1
  40. package/dist/{chunk-3PKF6YNU.js → chunk-E4UCPRYL.js} +1 -1
  41. package/dist/{chunk-KNRODVH2.js → chunk-ESYXDXNX.js} +6 -6
  42. package/dist/{chunk-Z4KTQMWW.js → chunk-GPWHBHAG.js} +1 -1
  43. package/dist/{chunk-JDCPDJ54.js → chunk-GURSWCI4.js} +2 -2
  44. package/dist/{chunk-RYWMDDWK.js → chunk-K3U5447S.js} +1 -1
  45. package/dist/{chunk-SHMHHXD5.js → chunk-KB2M27DL.js} +58 -0
  46. package/dist/{chunk-PBWUUVVG.js → chunk-LV2BQ26V.js} +1 -1
  47. package/dist/{chunk-KTGJAWRO.js → chunk-NNRV4T2C.js} +1 -2
  48. package/dist/{chunk-B6E3YA2H.js → chunk-P6I7LFKC.js} +1 -1
  49. package/dist/{chunk-B7FPRGUJ.js → chunk-PQFNTLZI.js} +3 -3
  50. package/dist/{chunk-A76LKS5W.js → chunk-QAOA4GUG.js} +5 -5
  51. package/dist/{chunk-BY43CEXN.js → chunk-R62DRNKB.js} +2 -2
  52. package/dist/{chunk-HBFQLSGV.js → chunk-U23X4ASF.js} +4 -4
  53. package/dist/{chunk-2HTHX6XV.js → chunk-XENYUOZG.js} +38 -17
  54. package/dist/cli/chat.js +24 -24
  55. package/dist/cli/check.js +6 -6
  56. package/dist/cli/plugins.js +12 -12
  57. package/dist/cli/snapshot-create.js +9 -9
  58. package/dist/cli/upgrade.js +9 -17
  59. package/dist/db/schema/scheduled-tasks.d.ts +257 -0
  60. package/dist/db/schema.d.ts +258 -1
  61. package/dist/{db-FYJYPAKG.js → db-ZI6TBXIS.js} +7 -7
  62. package/dist/instrumentation.js +4 -4
  63. package/dist/nitro.js +2 -2
  64. package/dist/{oauth-callback-server-W3PPIHCS.js → oauth-callback-server-TLA4GARF.js} +17 -17
  65. package/dist/{runner-5NOFUYKR.js → runner-23YFRWQJ.js} +11 -11
  66. package/dist/{skills-ENIBKF5V.js → skills-QIUG4D6M.js} +6 -6
  67. package/dist/{validation-BHLBOO6K.js → validation-3KGEBATS.js} +6 -6
  68. package/dist/version.js +1 -1
  69. package/migrations/0016_neat_the_anarchist.sql +171 -0
  70. package/migrations/meta/0016_snapshot.json +1617 -0
  71. package/migrations/meta/_journal.json +7 -0
  72. package/package.json +5 -6
  73. package/dist/chunk-FJEIX3AH.js +0 -37
@@ -0,0 +1,82 @@
1
+ import { type SchedulerToolContext } from "../tool-support";
2
+ /** Create a tool that edits a scheduled task in the active Slack conversation. */
3
+ export declare function createSlackScheduleUpdateTaskTool(context: SchedulerToolContext): Omit<import("../../tools/definition").AnyToolDefinition, "inputSchema" | "outputSchema" | "prepareArguments" | "execute"> & {
4
+ inputSchema: import("../../tools/definition").JsonSchemaObject;
5
+ outputSchema: import("../../tools/definition").JsonSchemaObject;
6
+ prepareArguments(args: unknown): {
7
+ task_id: string;
8
+ task?: string | undefined;
9
+ schedule?: {
10
+ kind: "recurring";
11
+ frequency: "daily" | "weekly" | "monthly" | "yearly";
12
+ time: string;
13
+ interval?: number | null | undefined;
14
+ weekdays?: ("sunday" | "monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday")[] | null | undefined;
15
+ day_of_month?: number | null | undefined;
16
+ month?: number | null | undefined;
17
+ start_date?: string | null | undefined;
18
+ timezone?: string | null | undefined;
19
+ } | {
20
+ kind: "one_off";
21
+ timing: {
22
+ type: "after";
23
+ value: number;
24
+ unit: "day" | "hour" | "minute" | "second" | "week";
25
+ } | {
26
+ type: "at";
27
+ date: string;
28
+ time: string;
29
+ };
30
+ timezone?: string | null | undefined;
31
+ } | null | undefined;
32
+ status?: "blocked" | "active" | "paused" | undefined;
33
+ credential_mode?: "system" | "creator" | null | undefined;
34
+ };
35
+ execute?: ((input: unknown, options: import("../../tools/definition").ToolExecuteOptions) => {
36
+ target: string;
37
+ task: {
38
+ id: string;
39
+ status: "blocked" | "active" | "paused" | "deleted";
40
+ task: string;
41
+ schedule: string;
42
+ timezone: string;
43
+ recurrence: unknown;
44
+ next_run_at: string | null;
45
+ conversation_access: {
46
+ audience: "direct" | "channel" | "group";
47
+ visibility: "public" | "private";
48
+ };
49
+ credential_mode: "system" | "creator";
50
+ last_run_at: string | null;
51
+ run_now_at: string | null;
52
+ };
53
+ truncated?: boolean | undefined;
54
+ continuation?: {
55
+ arguments: Record<string, unknown>;
56
+ reason?: string | undefined;
57
+ } | undefined;
58
+ } | Promise<{
59
+ target: string;
60
+ task: {
61
+ id: string;
62
+ status: "blocked" | "active" | "paused" | "deleted";
63
+ task: string;
64
+ schedule: string;
65
+ timezone: string;
66
+ recurrence: unknown;
67
+ next_run_at: string | null;
68
+ conversation_access: {
69
+ audience: "direct" | "channel" | "group";
70
+ visibility: "public" | "private";
71
+ };
72
+ credential_mode: "system" | "creator";
73
+ last_run_at: string | null;
74
+ run_now_at: string | null;
75
+ };
76
+ truncated?: boolean | undefined;
77
+ continuation?: {
78
+ arguments: Record<string, unknown>;
79
+ reason?: string | undefined;
80
+ } | undefined;
81
+ }>) | undefined;
82
+ };
@@ -0,0 +1,6 @@
1
+ export { createSlackScheduleCreateTaskTool } from "./tools/create";
2
+ export { createSlackScheduleDeleteTaskTool } from "./tools/delete";
3
+ export { createSlackScheduleListTasksTool } from "./tools/list";
4
+ export { createSlackScheduleRunTaskNowTool } from "./tools/run-now";
5
+ export { createSlackScheduleUpdateTaskTool } from "./tools/update";
6
+ export type { SchedulerToolContext } from "./tool-support";
@@ -0,0 +1,81 @@
1
+ /** Durable scheduled-task domain types owned by Junior core. */
2
+ import type { SlackDestination, SystemActor } from "@sentry/junior-plugin-api";
3
+ import { z } from "zod";
4
+ export type ScheduledTaskStatus = "active" | "paused" | "blocked" | "deleted";
5
+ export declare const scheduledTaskCredentialModeSchema: z.ZodEnum<{
6
+ system: "system";
7
+ creator: "creator";
8
+ }>;
9
+ export type ScheduledTaskCredentialMode = z.infer<typeof scheduledTaskCredentialModeSchema>;
10
+ export type ScheduledRunStatus = "pending" | "running" | "completed" | "failed" | "blocked" | "skipped";
11
+ export interface ScheduledTaskPrincipal {
12
+ slackUserId: string;
13
+ fullName?: string;
14
+ userName?: string;
15
+ }
16
+ export type ScheduledTaskExecutionActor = SystemActor;
17
+ export declare const SCHEDULED_TASK_SYSTEM_ACTOR: Readonly<{
18
+ platform: "system";
19
+ name: string;
20
+ }>;
21
+ export interface ScheduledTaskConversationAccess {
22
+ audience: "direct" | "group" | "channel";
23
+ visibility: "private" | "public";
24
+ }
25
+ export type ScheduledCalendarFrequency = "daily" | "weekly" | "monthly" | "yearly";
26
+ export interface ScheduledLocalTime {
27
+ hour: number;
28
+ minute: number;
29
+ }
30
+ export interface ScheduledTaskRecurrence {
31
+ dayOfMonth?: number;
32
+ frequency: ScheduledCalendarFrequency;
33
+ interval: number;
34
+ month?: number;
35
+ startDate: string;
36
+ time: ScheduledLocalTime;
37
+ weekdays?: number[];
38
+ }
39
+ export interface ScheduledTaskSchedule {
40
+ description: string;
41
+ timezone: string;
42
+ kind: "one_off" | "recurring";
43
+ recurrence?: ScheduledTaskRecurrence;
44
+ }
45
+ export interface ScheduledTaskSpec {
46
+ text: string;
47
+ }
48
+ export interface ScheduledTask {
49
+ id: string;
50
+ createdAtMs: number;
51
+ createdBy: ScheduledTaskPrincipal;
52
+ /** Authoritative provider identity that created the task. */
53
+ creatorIdentityId: string;
54
+ conversationAccess: ScheduledTaskConversationAccess;
55
+ /** Selects system credentials or task-bound creator credential delegation. */
56
+ credentialMode: ScheduledTaskCredentialMode;
57
+ destination: SlackDestination;
58
+ executionActor?: ScheduledTaskExecutionActor;
59
+ lastRunAtMs?: number;
60
+ nextRunAtMs?: number;
61
+ originalRequest?: string;
62
+ runNowAtMs?: number;
63
+ schedule: ScheduledTaskSchedule;
64
+ status: ScheduledTaskStatus;
65
+ statusReason?: string;
66
+ task: ScheduledTaskSpec;
67
+ updatedAtMs: number;
68
+ }
69
+ export interface ScheduledRun {
70
+ id: string;
71
+ attempt: number;
72
+ claimedAtMs: number;
73
+ completedAtMs?: number;
74
+ dispatchId?: string;
75
+ errorMessage?: string;
76
+ resultMessageTs?: string;
77
+ scheduledForMs: number;
78
+ startedAtMs?: number;
79
+ status: ScheduledRunStatus;
80
+ taskId: string;
81
+ }
@@ -0,0 +1,9 @@
1
+ import type { User } from "@sentry/junior-plugin-api";
2
+ import type { TaskList } from "@/api/schema/task";
3
+ /** Read viewer-owned and public-workspace tasks as one bounded newest-first projection. */
4
+ export declare function readViewerTasks(user: User): Promise<TaskList>;
5
+ export declare class ViewerTaskNotFoundError extends Error {
6
+ constructor();
7
+ }
8
+ /** Delete one viewer-owned scheduled or event task. */
9
+ export declare function deleteViewerTask(user: User, kind: "scheduled" | "event", id: string): Promise<void>;
@@ -0,0 +1,4 @@
1
+ import type { ToolRegistry } from "@/chat/tools/definition";
2
+ import type { ToolRuntimeContext } from "@/chat/tools/types";
3
+ /** Build scheduled-task tools for an interactive Slack actor. */
4
+ export declare function createScheduledTaskTools(context: ToolRuntimeContext): ToolRegistry;
@@ -3,7 +3,7 @@ import {
3
3
  toCanonicalInputMessage,
4
4
  toCanonicalOutputMessage,
5
5
  toGenAiMessagesTraceAttributes
6
- } from "./chunk-Z4KTQMWW.js";
6
+ } from "./chunk-GPWHBHAG.js";
7
7
  import {
8
8
  extractGenAiUsageAttributes,
9
9
  logException,
@@ -11,7 +11,7 @@ import {
11
11
  normalizeGenAiFinishReason,
12
12
  serializeGenAiAttribute,
13
13
  withSpan
14
- } from "./chunk-B6E3YA2H.js";
14
+ } from "./chunk-P6I7LFKC.js";
15
15
 
16
16
  // src/chat/config.ts
17
17
  import { getModel as getModel2 } from "@earendil-works/pi-ai/compat";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getChatConfig
3
- } from "./chunk-K5ZB3WWH.js";
3
+ } from "./chunk-2BCQKJTX.js";
4
4
 
5
5
  // src/chat/state/adapter.ts
6
6
  import { createMemoryState } from "@chat-adapter/state-memory";
@@ -6,25 +6,25 @@ import {
6
6
  isDmChannel,
7
7
  normalizeSlackConversationId,
8
8
  withSlackRetries
9
- } from "./chunk-A76LKS5W.js";
9
+ } from "./chunk-QAOA4GUG.js";
10
10
  import {
11
11
  getDb,
12
12
  parseDestination
13
- } from "./chunk-B7FPRGUJ.js";
13
+ } from "./chunk-PQFNTLZI.js";
14
14
  import {
15
15
  acquireActiveLock,
16
16
  getStateAdapter,
17
17
  sleep
18
- } from "./chunk-G6XQODHM.js";
18
+ } from "./chunk-3N4MWF3R.js";
19
19
  import {
20
20
  normalizeSlackEmojiName
21
- } from "./chunk-K5ZB3WWH.js";
21
+ } from "./chunk-2BCQKJTX.js";
22
22
  import {
23
23
  pluginCatalogRuntime
24
- } from "./chunk-WZ365SQC.js";
24
+ } from "./chunk-A6QQPVSH.js";
25
25
  import {
26
26
  fetchWithBoundedOAuthErrorBodies
27
- } from "./chunk-OLGB5Y7R.js";
27
+ } from "./chunk-CZQ2DSQZ.js";
28
28
  import {
29
29
  parseSlackMessageTs,
30
30
  parseSlackUserId
@@ -33,7 +33,7 @@ import {
33
33
  isRecord,
34
34
  logInfo,
35
35
  logWarn
36
- } from "./chunk-B6E3YA2H.js";
36
+ } from "./chunk-P6I7LFKC.js";
37
37
 
38
38
  // src/chat/capabilities/router.ts
39
39
  var ProviderCredentialRouter = class {