@sentry/junior 0.56.0 → 0.57.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.
- package/dist/app.js +2222 -3730
- package/dist/chat/agent-dispatch/context.d.ts +1 -0
- package/dist/chat/plugins/state.d.ts +4 -1
- package/package.json +4 -3
- package/dist/chat/scheduler/cadence.d.ts +0 -24
- package/dist/chat/scheduler/plugin.d.ts +0 -2
- package/dist/chat/scheduler/prompt.d.ts +0 -7
- package/dist/chat/scheduler/store.d.ts +0 -49
- package/dist/chat/scheduler/types.d.ts +0 -86
- package/dist/chat/tools/slack/schedule-tools.d.ts +0 -29
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { HeartbeatHookContext } from "@sentry/junior-plugin-api";
|
|
2
2
|
/** Build the plugin-scoped heartbeat context that gates durable dispatch access. */
|
|
3
3
|
export declare function createHeartbeatContext(args: {
|
|
4
|
+
legacyStatePrefixes?: string[];
|
|
4
5
|
nowMs: number;
|
|
5
6
|
plugin: string;
|
|
6
7
|
}): HeartbeatHookContext;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import type { AgentPluginState } from "@sentry/junior-plugin-api";
|
|
2
|
+
export interface PluginStateOptions {
|
|
3
|
+
legacyStatePrefixes?: string[];
|
|
4
|
+
}
|
|
2
5
|
/** Create a durable state namespace scoped to one trusted plugin. */
|
|
3
|
-
export declare function createPluginState(plugin: string): AgentPluginState;
|
|
6
|
+
export declare function createPluginState(plugin: string, options?: PluginStateOptions): AgentPluginState;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/junior",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.57.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"node-html-markdown": "^2.0.0",
|
|
47
47
|
"yaml": "^2.9.0",
|
|
48
48
|
"zod": "^4.4.3",
|
|
49
|
-
"@sentry/junior-plugin-api": "0.
|
|
49
|
+
"@sentry/junior-plugin-api": "0.57.0"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"@sentry/node": ">=10.0.0"
|
|
@@ -61,7 +61,8 @@
|
|
|
61
61
|
"tsup": "^8.5.1",
|
|
62
62
|
"typescript": "^6.0.3",
|
|
63
63
|
"vercel": "^54.4.0",
|
|
64
|
-
"vitest": "^4.1.7"
|
|
64
|
+
"vitest": "^4.1.7",
|
|
65
|
+
"@sentry/junior-scheduler": "0.57.0"
|
|
65
66
|
},
|
|
66
67
|
"scripts": {
|
|
67
68
|
"build": "tsup && tsc -p tsconfig.build.json --emitDeclarationOnly",
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { ScheduledCalendarFrequency, ScheduledTask, ScheduledTaskRecurrence } from "@/chat/scheduler/types";
|
|
2
|
-
/** Parse an ISO timestamp into a finite Unix timestamp in milliseconds. */
|
|
3
|
-
export declare function parseScheduleTimestamp(value: string): number | undefined;
|
|
4
|
-
export interface ZonedDateTimeParts {
|
|
5
|
-
day: number;
|
|
6
|
-
hour: number;
|
|
7
|
-
minute: number;
|
|
8
|
-
month: number;
|
|
9
|
-
second: number;
|
|
10
|
-
weekday: number;
|
|
11
|
-
year: number;
|
|
12
|
-
}
|
|
13
|
-
/** Resolve a UTC timestamp into calendar parts for a named time zone. */
|
|
14
|
-
export declare function getZonedDateTimeParts(timestampMs: number, timezone: string): ZonedDateTimeParts;
|
|
15
|
-
/** Build a calendar recurrence anchored to an exact first run timestamp. */
|
|
16
|
-
export declare function buildCalendarRecurrence(args: {
|
|
17
|
-
frequency: ScheduledCalendarFrequency;
|
|
18
|
-
interval?: number;
|
|
19
|
-
nextRunAtMs: number;
|
|
20
|
-
timezone: string;
|
|
21
|
-
weekdays?: number[];
|
|
22
|
-
}): ScheduledTaskRecurrence;
|
|
23
|
-
/** Return the next fire time after a completed run, when the task recurs. */
|
|
24
|
-
export declare function getNextRunAtMs(task: ScheduledTask, scheduledForMs: number, afterMs?: number): number | undefined;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type ScheduledRun, type ScheduledTask } from "@/chat/scheduler/types";
|
|
2
|
-
/** Build the marker-delimited user prompt for one scheduled task execution. */
|
|
3
|
-
export declare function buildScheduledTaskRunPrompt(args: {
|
|
4
|
-
nowMs: number;
|
|
5
|
-
run: ScheduledRun;
|
|
6
|
-
task: ScheduledTask;
|
|
7
|
-
}): string;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { StateAdapter } from "chat";
|
|
2
|
-
import type { ScheduledRun, ScheduledTask } from "@/chat/scheduler/types";
|
|
3
|
-
export interface SchedulerStore {
|
|
4
|
-
claimDueRun(args: {
|
|
5
|
-
nowMs: number;
|
|
6
|
-
}): Promise<ScheduledRun | undefined>;
|
|
7
|
-
getRun(runId: string): Promise<ScheduledRun | undefined>;
|
|
8
|
-
getTask(taskId: string): Promise<ScheduledTask | undefined>;
|
|
9
|
-
listIncompleteRuns(): Promise<ScheduledRun[]>;
|
|
10
|
-
listTasksForTeam(teamId: string): Promise<ScheduledTask[]>;
|
|
11
|
-
markRunBlocked(args: {
|
|
12
|
-
completedAtMs: number;
|
|
13
|
-
errorMessage: string;
|
|
14
|
-
runId: string;
|
|
15
|
-
startedAtMs?: number;
|
|
16
|
-
}): Promise<ScheduledRun | undefined>;
|
|
17
|
-
markRunCompleted(args: {
|
|
18
|
-
completedAtMs: number;
|
|
19
|
-
resultMessageTs?: string;
|
|
20
|
-
runId: string;
|
|
21
|
-
startedAtMs: number;
|
|
22
|
-
}): Promise<ScheduledRun | undefined>;
|
|
23
|
-
markRunFailed(args: {
|
|
24
|
-
completedAtMs: number;
|
|
25
|
-
errorMessage: string;
|
|
26
|
-
startedAtMs?: number;
|
|
27
|
-
runId: string;
|
|
28
|
-
}): Promise<ScheduledRun | undefined>;
|
|
29
|
-
markRunSkipped(args: {
|
|
30
|
-
completedAtMs: number;
|
|
31
|
-
errorMessage: string;
|
|
32
|
-
runId: string;
|
|
33
|
-
}): Promise<ScheduledRun | undefined>;
|
|
34
|
-
markRunDispatched(args: {
|
|
35
|
-
claimedAtMs: number;
|
|
36
|
-
dispatchId: string;
|
|
37
|
-
nowMs: number;
|
|
38
|
-
runId: string;
|
|
39
|
-
}): Promise<ScheduledRun | undefined>;
|
|
40
|
-
saveTask(task: ScheduledTask): Promise<void>;
|
|
41
|
-
updateTaskAfterRun(args: {
|
|
42
|
-
errorMessage?: string;
|
|
43
|
-
nowMs: number;
|
|
44
|
-
run: ScheduledRun;
|
|
45
|
-
status: "blocked" | "completed" | "failed";
|
|
46
|
-
}): Promise<void>;
|
|
47
|
-
}
|
|
48
|
-
/** Create the production scheduler store backed by Junior's state adapter. */
|
|
49
|
-
export declare function createStateSchedulerStore(stateAdapter?: StateAdapter): SchedulerStore;
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
export type ScheduledTaskStatus = "active" | "paused" | "blocked" | "deleted";
|
|
2
|
-
export type ScheduledRunStatus = "pending" | "running" | "completed" | "failed" | "blocked" | "skipped";
|
|
3
|
-
export interface ScheduledTaskPrincipal {
|
|
4
|
-
slackUserId: string;
|
|
5
|
-
fullName?: string;
|
|
6
|
-
userName?: string;
|
|
7
|
-
}
|
|
8
|
-
export interface ScheduledTaskExecutionActor {
|
|
9
|
-
type: "system";
|
|
10
|
-
id: string;
|
|
11
|
-
}
|
|
12
|
-
export declare const SCHEDULED_TASK_SYSTEM_ACTOR: Readonly<{
|
|
13
|
-
type: "system";
|
|
14
|
-
id: string;
|
|
15
|
-
}>;
|
|
16
|
-
export interface ScheduledTaskDestination {
|
|
17
|
-
platform: "slack";
|
|
18
|
-
teamId: string;
|
|
19
|
-
channelId: string;
|
|
20
|
-
}
|
|
21
|
-
export interface ScheduledTaskConversationAccess {
|
|
22
|
-
audience: "direct" | "group" | "channel";
|
|
23
|
-
visibility: "private" | "public" | "unknown";
|
|
24
|
-
}
|
|
25
|
-
export interface ScheduledTaskCredentialSubject {
|
|
26
|
-
type: "user";
|
|
27
|
-
userId: string;
|
|
28
|
-
allowedWhen: "private-direct-conversation";
|
|
29
|
-
}
|
|
30
|
-
export type ScheduledCalendarFrequency = "daily" | "weekly" | "monthly" | "yearly";
|
|
31
|
-
export interface ScheduledLocalTime {
|
|
32
|
-
hour: number;
|
|
33
|
-
minute: number;
|
|
34
|
-
}
|
|
35
|
-
export interface ScheduledTaskRecurrence {
|
|
36
|
-
dayOfMonth?: number;
|
|
37
|
-
frequency: ScheduledCalendarFrequency;
|
|
38
|
-
interval: number;
|
|
39
|
-
month?: number;
|
|
40
|
-
startDate: string;
|
|
41
|
-
time: ScheduledLocalTime;
|
|
42
|
-
weekdays?: number[];
|
|
43
|
-
}
|
|
44
|
-
export interface ScheduledTaskSchedule {
|
|
45
|
-
description: string;
|
|
46
|
-
timezone: string;
|
|
47
|
-
kind: "one_off" | "recurring";
|
|
48
|
-
recurrence?: ScheduledTaskRecurrence;
|
|
49
|
-
}
|
|
50
|
-
export interface ScheduledTaskSpec {
|
|
51
|
-
text: string;
|
|
52
|
-
}
|
|
53
|
-
export interface ScheduledTask {
|
|
54
|
-
id: string;
|
|
55
|
-
createdAtMs: number;
|
|
56
|
-
createdBy: ScheduledTaskPrincipal;
|
|
57
|
-
conversationAccess?: ScheduledTaskConversationAccess;
|
|
58
|
-
credentialSubject?: ScheduledTaskCredentialSubject;
|
|
59
|
-
destination: ScheduledTaskDestination;
|
|
60
|
-
executionActor?: ScheduledTaskExecutionActor;
|
|
61
|
-
lastRunAtMs?: number;
|
|
62
|
-
nextRunAtMs?: number;
|
|
63
|
-
originalRequest?: string;
|
|
64
|
-
runNowAtMs?: number;
|
|
65
|
-
schedule: ScheduledTaskSchedule;
|
|
66
|
-
status: ScheduledTaskStatus;
|
|
67
|
-
statusReason?: string;
|
|
68
|
-
task: ScheduledTaskSpec;
|
|
69
|
-
updatedAtMs: number;
|
|
70
|
-
version: number;
|
|
71
|
-
}
|
|
72
|
-
export interface ScheduledRun {
|
|
73
|
-
id: string;
|
|
74
|
-
attempt: number;
|
|
75
|
-
claimedAtMs: number;
|
|
76
|
-
completedAtMs?: number;
|
|
77
|
-
dispatchId?: string;
|
|
78
|
-
errorMessage?: string;
|
|
79
|
-
idempotencyKey: string;
|
|
80
|
-
resultMessageTs?: string;
|
|
81
|
-
scheduledForMs: number;
|
|
82
|
-
startedAtMs?: number;
|
|
83
|
-
status: ScheduledRunStatus;
|
|
84
|
-
taskId: string;
|
|
85
|
-
taskVersion: number;
|
|
86
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { ToolRuntimeContext } from "@/chat/tools/types";
|
|
2
|
-
/** Create a tool that stores a scheduled task for the active Slack context. */
|
|
3
|
-
export declare function createSlackScheduleCreateTaskTool(context: ToolRuntimeContext): import("@/chat/tools/definition").ToolDefinition<import("@sinclair/typebox").TObject<{
|
|
4
|
-
task: import("@sinclair/typebox").TString;
|
|
5
|
-
schedule: import("@sinclair/typebox").TString;
|
|
6
|
-
timezone: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
7
|
-
next_run_at: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
8
|
-
recurrence: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"daily">, import("@sinclair/typebox").TLiteral<"weekly">, import("@sinclair/typebox").TLiteral<"monthly">, import("@sinclair/typebox").TLiteral<"yearly">]>>;
|
|
9
|
-
}>>;
|
|
10
|
-
/** Create a tool that lists scheduled tasks for the active Slack destination. */
|
|
11
|
-
export declare function createSlackScheduleListTasksTool(context: ToolRuntimeContext): import("@/chat/tools/definition").ToolDefinition<import("@sinclair/typebox").TObject<{}>>;
|
|
12
|
-
/** Create a tool that edits a scheduled task in the active Slack destination. */
|
|
13
|
-
export declare function createSlackScheduleUpdateTaskTool(context: ToolRuntimeContext): import("@/chat/tools/definition").ToolDefinition<import("@sinclair/typebox").TObject<{
|
|
14
|
-
task_id: import("@sinclair/typebox").TString;
|
|
15
|
-
task: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
16
|
-
schedule: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
17
|
-
timezone: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
18
|
-
next_run_at: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
19
|
-
recurrence: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"daily">, import("@sinclair/typebox").TLiteral<"weekly">, import("@sinclair/typebox").TLiteral<"monthly">, import("@sinclair/typebox").TLiteral<"yearly">]>, import("@sinclair/typebox").TNull]>>;
|
|
20
|
-
status: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"active">, import("@sinclair/typebox").TLiteral<"paused">, import("@sinclair/typebox").TLiteral<"blocked">]>>;
|
|
21
|
-
}>>;
|
|
22
|
-
/** Create a tool that removes a scheduled task from the active Slack destination. */
|
|
23
|
-
export declare function createSlackScheduleDeleteTaskTool(context: ToolRuntimeContext): import("@/chat/tools/definition").ToolDefinition<import("@sinclair/typebox").TObject<{
|
|
24
|
-
task_id: import("@sinclair/typebox").TString;
|
|
25
|
-
}>>;
|
|
26
|
-
/** Create a tool that marks an existing scheduled task due immediately. */
|
|
27
|
-
export declare function createSlackScheduleRunTaskNowTool(context: ToolRuntimeContext): import("@/chat/tools/definition").ToolDefinition<import("@sinclair/typebox").TObject<{
|
|
28
|
-
task_id: import("@sinclair/typebox").TString;
|
|
29
|
-
}>>;
|