@sentry/junior 0.66.2 → 0.67.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.
@@ -27,6 +27,7 @@ export interface ChatConfig {
27
27
  clientId?: string;
28
28
  clientSecret?: string;
29
29
  signingSecret?: string;
30
+ slashCommand: string;
30
31
  };
31
32
  state: {
32
33
  adapter: "memory" | "redis";
@@ -1,3 +1,3 @@
1
1
  import type { SlashCommandEvent } from "chat";
2
- /** Route `/jr link` and `/jr unlink` slash commands to the appropriate OAuth flow. */
2
+ /** Route link and unlink slash commands to the appropriate OAuth flow. */
3
3
  export declare function handleSlashCommand(event: SlashCommandEvent): Promise<void>;
@@ -1,4 +1,4 @@
1
- import type { AgentPluginRequester, AgentPluginRoute, SlackConversationLink, JuniorPluginRegistration } from "@sentry/junior-plugin-api";
1
+ import type { AgentPluginRequester, AgentPluginRoute, PluginOperationalReport, SlackConversationLink, JuniorPluginRegistration } from "@sentry/junior-plugin-api";
2
2
  import type { ToolDefinition } from "@/chat/tools/definition";
3
3
  import type { ToolRuntimeContext } from "@/chat/tools/types";
4
4
  import type { SandboxInstance } from "@/chat/sandbox/workspace";
@@ -33,6 +33,8 @@ export declare function getAgentPluginTools(context: ToolRuntimeContext): Record
33
33
  export declare function getAgentPluginRoutes(): AgentPluginRouteRegistration[];
34
34
  /** Resolve the first trusted plugin conversation URL for finalized Slack footers. */
35
35
  export declare function getAgentPluginSlackConversationLink(conversationId: string): SlackConversationLink | undefined;
36
+ /** Collect read-only operational summaries exposed by trusted plugins. */
37
+ export declare function getAgentPluginOperationalReports(nowMs?: number): Promise<PluginOperationalReport[]>;
36
38
  /** Create one runner over trusted agent plugins registered by the app. */
37
39
  export declare function createAgentPluginHookRunner(input?: {
38
40
  requester?: AgentPluginRequester;
@@ -7,6 +7,7 @@ import { type SandboxAcquiredState } from "@/chat/sandbox/sandbox";
7
7
  import type { AssistantStatusSpec } from "@/chat/slack/assistant-thread/status";
8
8
  import type { SlackConversationContext } from "@/chat/slack/conversation-context";
9
9
  import { type AssistantReply, type AgentTurnDiagnostics } from "@/chat/services/turn-result";
10
+ import type { AgentTurnSurface } from "@/chat/state/turn-session";
10
11
  import type { CredentialContext } from "@/chat/credentials/context";
11
12
  import { type AuthorizationFlowMode } from "@/chat/services/auth-pause";
12
13
  export type { AssistantReply, AgentTurnDiagnostics };
@@ -20,6 +21,7 @@ export interface ReplyRequestContext {
20
21
  email?: string;
21
22
  };
22
23
  slackConversation?: SlackConversationContext;
24
+ surface?: AgentTurnSurface;
23
25
  correlation?: {
24
26
  conversationId?: string;
25
27
  threadId?: string;
@@ -1,4 +1,4 @@
1
- import { type AgentTurnSessionRecord, type AgentTurnRequester } from "@/chat/state/turn-session";
1
+ import { type AgentTurnSessionRecord, type AgentTurnRequester, type AgentTurnSurface } from "@/chat/state/turn-session";
2
2
  import type { PiMessage } from "@/chat/pi/messages";
3
3
  import { type AgentTurnUsage } from "@/chat/usage";
4
4
  export declare const AGENT_TURN_TIMEOUT_RESUME_MAX_SLICES = 48;
@@ -32,6 +32,7 @@ export declare function persistRunningSessionRecord(args: {
32
32
  loadedSkillNames?: string[];
33
33
  logContext: SessionRecordLogContext;
34
34
  requester?: AgentTurnRequester;
35
+ surface?: AgentTurnSurface;
35
36
  }): Promise<boolean>;
36
37
  /** Persist a completed turn session record. */
37
38
  export declare function persistCompletedSessionRecord(args: {
@@ -45,6 +46,7 @@ export declare function persistCompletedSessionRecord(args: {
45
46
  loadedSkillNames?: string[];
46
47
  logContext: SessionRecordLogContext;
47
48
  requester?: AgentTurnRequester;
49
+ surface?: AgentTurnSurface;
48
50
  }): Promise<void>;
49
51
  /**
50
52
  * Persist an auth-pause session record. Returns the durable record only when
@@ -62,6 +64,7 @@ export declare function persistAuthPauseSessionRecord(args: {
62
64
  errorMessage: string;
63
65
  logContext: SessionRecordLogContext;
64
66
  requester?: AgentTurnRequester;
67
+ surface?: AgentTurnSurface;
65
68
  }): Promise<AgentTurnSessionRecord | undefined>;
66
69
  /**
67
70
  * Persist a timeout session record at the last safe boundary. Returns the durable
@@ -79,6 +82,7 @@ export declare function persistTimeoutSessionRecord(args: {
79
82
  errorMessage: string;
80
83
  logContext: SessionRecordLogContext;
81
84
  requester?: AgentTurnRequester;
85
+ surface?: AgentTurnSurface;
82
86
  }): Promise<AgentTurnSessionRecord | undefined>;
83
87
  /**
84
88
  * Persist a cooperative-yield boundary without advancing timeout slice counts.
@@ -95,5 +99,6 @@ export declare function persistYieldSessionRecord(args: {
95
99
  errorMessage: string;
96
100
  logContext: SessionRecordLogContext;
97
101
  requester?: AgentTurnRequester;
102
+ surface?: AgentTurnSurface;
98
103
  }): Promise<AgentTurnSessionRecord | undefined>;
99
104
  export {};
@@ -1,6 +1,7 @@
1
1
  import type { PiMessage } from "@/chat/pi/messages";
2
2
  import type { AgentTurnUsage } from "@/chat/usage";
3
3
  export type AgentTurnSessionStatus = "running" | "awaiting_resume" | "completed" | "failed" | "abandoned";
4
+ export type AgentTurnSurface = "slack" | "api" | "scheduler" | "internal";
4
5
  export type AgentTurnResumeReason = "timeout" | "auth" | "yield";
5
6
  export interface AgentTurnRequester {
6
7
  email?: string;
@@ -26,6 +27,7 @@ export interface AgentTurnSessionRecord {
26
27
  sliceId: number;
27
28
  startedAtMs: number;
28
29
  state: AgentTurnSessionStatus;
30
+ surface?: AgentTurnSurface;
29
31
  traceId?: string;
30
32
  updatedAtMs: number;
31
33
  }
@@ -44,6 +46,7 @@ export declare function upsertAgentTurnSessionRecord(args: {
44
46
  sessionId: string;
45
47
  sliceId: number;
46
48
  state: AgentTurnSessionStatus;
49
+ surface?: AgentTurnSurface;
47
50
  piMessages: PiMessage[];
48
51
  requester?: AgentTurnRequester;
49
52
  resumeReason?: AgentTurnResumeReason;
@@ -67,6 +70,7 @@ export declare function recordAgentTurnSessionSummary(args: {
67
70
  sliceId: number;
68
71
  startedAtMs?: number;
69
72
  state: AgentTurnSessionStatus;
73
+ surface?: AgentTurnSurface;
70
74
  traceId?: string;
71
75
  ttlMs?: number;
72
76
  }): Promise<void>;