@sentry/junior 0.66.3 → 0.67.1

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.
@@ -7,10 +7,12 @@ export type AdvisorThinkingLevel = (typeof ADVISOR_THINKING_LEVELS)[number];
7
7
  export declare const FUNCTION_TIMEOUT_BUFFER_SECONDS = 20;
8
8
  export interface BotConfig {
9
9
  advisor: AdvisorConfig;
10
+ completedReactionEmoji: string;
10
11
  fastModelId: string;
11
12
  loadingMessages: string[];
12
13
  modelId: string;
13
14
  modelContextWindowTokens?: number;
15
+ processingReactionEmoji: string;
14
16
  visionModelId?: string;
15
17
  turnTimeoutMs: number;
16
18
  userName: string;
@@ -27,6 +29,7 @@ export interface ChatConfig {
27
29
  clientId?: string;
28
30
  clientSecret?: string;
29
31
  signingSecret?: string;
32
+ slashCommand: string;
30
33
  };
31
34
  state: {
32
35
  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;
@@ -0,0 +1,8 @@
1
+ import type { Message } from "chat";
2
+ import { type ActorIdentityInput, type SlackActorProfile } from "@/chat/services/requester-identity";
3
+ /** Preserve runtime-owned identity on Chat SDK messages before persistence. */
4
+ export declare function bindMessageActorIdentity(message: Message, identity: ActorIdentityInput): ActorIdentityInput;
5
+ /** Read message identity without promoting adapter display fallbacks. */
6
+ export declare function getMessageActorIdentity(message: Message): ActorIdentityInput | undefined;
7
+ /** Attach Slack display fields only after the author id is exact. */
8
+ export declare function ensureSlackMessageActorIdentity(message: Message, lookupSlackUser: (userId: string) => Promise<SlackActorProfile | null | undefined>): Promise<ActorIdentityInput>;
@@ -0,0 +1,19 @@
1
+ export interface ActorIdentityInput {
2
+ email?: string;
3
+ fullName?: string;
4
+ userId?: string;
5
+ userName?: string;
6
+ }
7
+ export interface SlackActorProfile {
8
+ email?: string;
9
+ fullName?: string;
10
+ userName?: string;
11
+ }
12
+ /** Keep actor ids exact at platform boundaries before they enter owned state. */
13
+ export declare function parseActorUserId(value: unknown): string | undefined;
14
+ /** Assert persisted actor ids without read-side repair. */
15
+ export declare function isActorUserId(value: string | undefined): value is string;
16
+ /** Keep authority ids exact while attaching optional presentation fields. */
17
+ export declare function buildActorIdentity(requester: ActorIdentityInput | undefined, requesterId?: string): ActorIdentityInput | undefined;
18
+ /** Use Slack profile data only as presentation around the exact user id. */
19
+ export declare function slackActorIdentity(userId: string, profile: SlackActorProfile | null | undefined): ActorIdentityInput;
@@ -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,3 +1,4 @@
1
+ import { type ActorIdentityInput } from "@/chat/services/requester-identity";
1
2
  interface SlackUserLookupResult {
2
3
  userName?: string;
3
4
  fullName?: string;
@@ -5,4 +6,6 @@ interface SlackUserLookupResult {
5
6
  }
6
7
  /** Fetch Slack user profile info with in-memory TTL cache to avoid repeated API calls. */
7
8
  export declare function lookupSlackUser(userId?: string): Promise<SlackUserLookupResult | null>;
9
+ /** Resolve the canonical Slack actor identity from Slack profile data. */
10
+ export declare function lookupSlackActorIdentity(userId: string): Promise<ActorIdentityInput>;
8
11
  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>;
@@ -4,6 +4,7 @@ import type { SlackTurnRuntime } from "@/chat/runtime/slack-runtime";
4
4
  import type { InboundMessageRecord } from "@/chat/task-execution/store";
5
5
  import type { ConversationWorkerContext, ConversationWorkerResult } from "@/chat/task-execution/worker";
6
6
  import { type SlackInstallationContext } from "@/chat/slack/adapter-context";
7
+ import { type SlackActorProfile } from "@/chat/services/requester-identity";
7
8
  export type SlackConversationRoute = "mention" | "subscribed";
8
9
  export interface SlackConversationMessageMetadata {
9
10
  [key: string]: unknown;
@@ -15,6 +16,7 @@ export interface SlackConversationMessageMetadata {
15
16
  }
16
17
  export interface CreateSlackConversationWorkerOptions {
17
18
  getSlackAdapter: () => SlackAdapter;
19
+ lookupSlackUser?: (userId: string) => Promise<SlackActorProfile | null | undefined>;
18
20
  resumeAwaitingContinuation?: (conversationId: string) => Promise<boolean>;
19
21
  runtime: Pick<SlackTurnRuntime<unknown>, "handleNewMention" | "handleSubscribedMessage">;
20
22
  state?: StateAdapter;