@sentry/junior 0.56.0 → 0.58.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 +4239 -5724
- package/dist/chat/agent-dispatch/context.d.ts +1 -0
- package/dist/chat/agent-dispatch/types.d.ts +0 -1
- package/dist/chat/conversation-privacy.d.ts +23 -0
- package/dist/chat/logging.d.ts +2 -0
- package/dist/chat/mcp/tool-manager.d.ts +18 -5
- package/dist/chat/mcp/tool-name.d.ts +2 -0
- package/dist/chat/pi/client.d.ts +2 -0
- package/dist/chat/pi/derived-state.d.ts +5 -0
- package/dist/chat/pi/traced-stream.d.ts +5 -1
- package/dist/chat/plugins/state.d.ts +4 -1
- package/dist/chat/prompt.d.ts +3 -9
- package/dist/chat/respond-helpers.d.ts +5 -3
- package/dist/chat/respond.d.ts +1 -0
- package/dist/chat/runtime/conversation-message.d.ts +10 -0
- package/dist/chat/runtime/processing-reaction.d.ts +2 -4
- package/dist/chat/runtime/reply-executor.d.ts +13 -16
- package/dist/chat/runtime/slack-runtime.d.ts +19 -32
- package/dist/chat/runtime/thread-state.d.ts +1 -1
- package/dist/chat/runtime/turn-input.d.ts +29 -0
- package/dist/chat/runtime/turn-preparation.d.ts +4 -24
- package/dist/chat/runtime/turn.d.ts +2 -3
- package/dist/chat/sentry-links.d.ts +4 -0
- package/dist/chat/services/context-compaction.d.ts +3 -4
- package/dist/chat/services/pending-auth.d.ts +1 -1
- package/dist/chat/services/subscribed-reply-policy.d.ts +2 -13
- package/dist/chat/services/timeout-resume.d.ts +1 -2
- package/dist/chat/services/turn-session-record.d.ts +82 -0
- package/dist/chat/slack/assistant-thread/title.d.ts +4 -1
- package/dist/chat/state/artifacts.d.ts +1 -0
- package/dist/chat/state/conversation.d.ts +0 -1
- package/dist/chat/state/session-log.d.ts +117 -0
- package/dist/chat/state/ttl.d.ts +2 -0
- package/dist/chat/state/turn-session.d.ts +89 -0
- package/dist/chat/tools/advisor/tool.d.ts +2 -0
- package/dist/chat/tools/agent-tools.d.ts +2 -1
- package/dist/chat/tools/skill/call-mcp-tool.d.ts +7 -3
- package/dist/chat/tools/skill/search-mcp-tools.d.ts +15 -3
- package/dist/chat/tools/types.d.ts +0 -1
- package/dist/{chunk-AA5TIFN5.js → chunk-FKEKRBUB.js} +267 -735
- package/dist/{chunk-TTUY467K.js → chunk-H652GMDH.js} +30 -14
- package/dist/chunk-I4FDGMFI.js +950 -0
- package/dist/{chunk-D3G3YOU4.js → chunk-ITOW4DED.js} +1 -1
- package/dist/chunk-QDGD5WVN.js +708 -0
- package/dist/cli/check.js +2 -2
- package/dist/cli/init.js +0 -1
- package/dist/cli/snapshot-warmup.js +5 -3
- package/dist/instrumentation.js +3 -0
- package/dist/reporting.d.ts +113 -0
- package/dist/reporting.js +390 -0
- package/package.json +26 -11
- 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/services/turn-checkpoint.d.ts +0 -74
- package/dist/chat/state/pi-session-message-store.d.ts +0 -15
- package/dist/chat/state/turn-session-store.d.ts +0 -49
- package/dist/chat/tools/slack/schedule-tools.d.ts +0 -29
- package/dist/handlers/diagnostics-dashboard.d.ts +0 -2
- package/dist/handlers/diagnostics.d.ts +0 -2
|
@@ -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,74 +0,0 @@
|
|
|
1
|
-
import { type AgentTurnSessionCheckpoint } from "@/chat/state/turn-session-store";
|
|
2
|
-
import type { PiMessage } from "@/chat/pi/messages";
|
|
3
|
-
import { type AgentTurnUsage } from "@/chat/usage";
|
|
4
|
-
export interface TurnCheckpointContext {
|
|
5
|
-
conversationId?: string;
|
|
6
|
-
sessionId?: string;
|
|
7
|
-
}
|
|
8
|
-
export interface TurnCheckpointState {
|
|
9
|
-
canUseTurnSession: boolean;
|
|
10
|
-
resumedFromCheckpoint: boolean;
|
|
11
|
-
currentSliceId: number;
|
|
12
|
-
existingCheckpoint?: AgentTurnSessionCheckpoint;
|
|
13
|
-
}
|
|
14
|
-
interface CheckpointLogContext {
|
|
15
|
-
threadId?: string;
|
|
16
|
-
requesterId?: string;
|
|
17
|
-
channelId?: string;
|
|
18
|
-
runId?: string;
|
|
19
|
-
assistantUserName?: string;
|
|
20
|
-
modelId: string;
|
|
21
|
-
}
|
|
22
|
-
/** Load turn checkpoint state for a conversation/session pair. */
|
|
23
|
-
export declare function loadTurnCheckpoint(ctx: TurnCheckpointContext): Promise<TurnCheckpointState>;
|
|
24
|
-
/** Persist the latest safe in-progress boundary without scheduling continuation. */
|
|
25
|
-
export declare function persistRunningCheckpoint(args: {
|
|
26
|
-
conversationId: string;
|
|
27
|
-
sessionId: string;
|
|
28
|
-
sliceId: number;
|
|
29
|
-
messages: PiMessage[];
|
|
30
|
-
loadedSkillNames: string[];
|
|
31
|
-
logContext: CheckpointLogContext;
|
|
32
|
-
}): Promise<void>;
|
|
33
|
-
/** Persist a completed turn checkpoint. */
|
|
34
|
-
export declare function persistCompletedCheckpoint(args: {
|
|
35
|
-
conversationId: string;
|
|
36
|
-
currentDurationMs?: number;
|
|
37
|
-
currentUsage?: AgentTurnUsage;
|
|
38
|
-
sessionId: string;
|
|
39
|
-
sliceId: number;
|
|
40
|
-
allMessages: PiMessage[];
|
|
41
|
-
loadedSkillNames: string[];
|
|
42
|
-
logContext: CheckpointLogContext;
|
|
43
|
-
}): Promise<void>;
|
|
44
|
-
/**
|
|
45
|
-
* Persist an auth-pause checkpoint. Returns the durable checkpoint only when
|
|
46
|
-
* the caller can safely hand the user to an authorization resume flow.
|
|
47
|
-
*/
|
|
48
|
-
export declare function persistAuthPauseCheckpoint(args: {
|
|
49
|
-
conversationId: string;
|
|
50
|
-
sessionId: string;
|
|
51
|
-
currentSliceId: number;
|
|
52
|
-
currentDurationMs?: number;
|
|
53
|
-
currentUsage?: AgentTurnUsage;
|
|
54
|
-
messages: PiMessage[];
|
|
55
|
-
loadedSkillNames: string[];
|
|
56
|
-
errorMessage: string;
|
|
57
|
-
logContext: CheckpointLogContext;
|
|
58
|
-
}): Promise<AgentTurnSessionCheckpoint | undefined>;
|
|
59
|
-
/**
|
|
60
|
-
* Persist a timeout checkpoint at the last safe boundary. Returns the durable
|
|
61
|
-
* checkpoint when persistence succeeds so callers can enqueue a continuation.
|
|
62
|
-
*/
|
|
63
|
-
export declare function persistTimeoutCheckpoint(args: {
|
|
64
|
-
conversationId: string;
|
|
65
|
-
sessionId: string;
|
|
66
|
-
currentSliceId: number;
|
|
67
|
-
currentDurationMs?: number;
|
|
68
|
-
currentUsage?: AgentTurnUsage;
|
|
69
|
-
messages: PiMessage[];
|
|
70
|
-
loadedSkillNames: string[];
|
|
71
|
-
errorMessage: string;
|
|
72
|
-
logContext: CheckpointLogContext;
|
|
73
|
-
}): Promise<AgentTurnSessionCheckpoint | undefined>;
|
|
74
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { PiMessage } from "@/chat/pi/messages";
|
|
2
|
-
interface PiSessionScope {
|
|
3
|
-
conversationId: string;
|
|
4
|
-
sessionId: string;
|
|
5
|
-
}
|
|
6
|
-
/** Load the exact stable Pi message prefix for a session. */
|
|
7
|
-
export declare function loadPiSessionMessages(args: PiSessionScope & {
|
|
8
|
-
messageCount: number;
|
|
9
|
-
}): Promise<PiMessage[] | undefined>;
|
|
10
|
-
/** Commit new stable Pi messages before the caller advances its cursor. */
|
|
11
|
-
export declare function commitPiSessionMessages(args: PiSessionScope & {
|
|
12
|
-
messages: PiMessage[];
|
|
13
|
-
ttlMs: number;
|
|
14
|
-
}): Promise<void>;
|
|
15
|
-
export {};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { PiMessage } from "@/chat/pi/messages";
|
|
2
|
-
import type { AgentTurnUsage } from "@/chat/usage";
|
|
3
|
-
export type AgentTurnSessionStatus = "running" | "awaiting_resume" | "completed" | "failed" | "superseded";
|
|
4
|
-
export type AgentTurnResumeReason = "timeout" | "auth";
|
|
5
|
-
export interface AgentTurnSessionCheckpoint {
|
|
6
|
-
checkpointVersion: number;
|
|
7
|
-
conversationId: string;
|
|
8
|
-
cumulativeDurationMs?: number;
|
|
9
|
-
cumulativeUsage?: AgentTurnUsage;
|
|
10
|
-
errorMessage?: string;
|
|
11
|
-
loadedSkillNames?: string[];
|
|
12
|
-
piMessages: PiMessage[];
|
|
13
|
-
resumeReason?: AgentTurnResumeReason;
|
|
14
|
-
resumedFromSliceId?: number;
|
|
15
|
-
sessionId: string;
|
|
16
|
-
sliceId: number;
|
|
17
|
-
state: AgentTurnSessionStatus;
|
|
18
|
-
updatedAtMs: number;
|
|
19
|
-
}
|
|
20
|
-
/** Read a materialized turn-session checkpoint for resume and history loading. */
|
|
21
|
-
export declare function getAgentTurnSessionCheckpoint(conversationId: string, sessionId: string): Promise<AgentTurnSessionCheckpoint | undefined>;
|
|
22
|
-
/** Commit stable Pi session state and advance the turn-session checkpoint cursor. */
|
|
23
|
-
export declare function upsertAgentTurnSessionCheckpoint(args: {
|
|
24
|
-
conversationId: string;
|
|
25
|
-
cumulativeDurationMs?: number;
|
|
26
|
-
cumulativeUsage?: AgentTurnUsage;
|
|
27
|
-
sessionId: string;
|
|
28
|
-
sliceId: number;
|
|
29
|
-
state: AgentTurnSessionStatus;
|
|
30
|
-
piMessages: PiMessage[];
|
|
31
|
-
loadedSkillNames?: string[];
|
|
32
|
-
resumeReason?: AgentTurnResumeReason;
|
|
33
|
-
errorMessage?: string;
|
|
34
|
-
resumedFromSliceId?: number;
|
|
35
|
-
ttlMs?: number;
|
|
36
|
-
}): Promise<AgentTurnSessionCheckpoint>;
|
|
37
|
-
/** Mark an unfinished turn-session checkpoint as superseded when a newer turn wins. */
|
|
38
|
-
export declare function supersedeAgentTurnSessionCheckpoint(args: {
|
|
39
|
-
conversationId: string;
|
|
40
|
-
sessionId: string;
|
|
41
|
-
errorMessage?: string;
|
|
42
|
-
}): Promise<AgentTurnSessionCheckpoint | undefined>;
|
|
43
|
-
/** Mark an unfinished turn-session checkpoint as failed so it cannot resume. */
|
|
44
|
-
export declare function failAgentTurnSessionCheckpoint(args: {
|
|
45
|
-
conversationId: string;
|
|
46
|
-
expectedCheckpointVersion?: number;
|
|
47
|
-
sessionId: string;
|
|
48
|
-
errorMessage?: string;
|
|
49
|
-
}): Promise<AgentTurnSessionCheckpoint | undefined>;
|
|
@@ -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
|
-
}>>;
|