@sentry/junior 0.72.0 → 0.74.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/bin/junior.mjs +12 -10
- package/dist/api-reference.d.ts +1 -1
- package/dist/app.d.ts +11 -2
- package/dist/app.js +1233 -13143
- package/dist/chat/agent-dispatch/runner.d.ts +2 -0
- package/dist/chat/agent-dispatch/store.d.ts +2 -2
- package/dist/chat/agent-dispatch/types.d.ts +6 -3
- package/dist/chat/agent-dispatch/validation.d.ts +2 -3
- package/dist/chat/app/production.d.ts +11 -1
- package/dist/chat/app/services.d.ts +7 -0
- package/dist/chat/config.d.ts +3 -0
- package/dist/chat/conversations/configured.d.ts +5 -0
- package/dist/chat/conversations/sql/migrations.d.ts +11 -0
- package/dist/chat/conversations/sql/schema/conversations.d.ts +435 -0
- package/dist/chat/conversations/sql/schema/destinations.d.ts +200 -0
- package/dist/chat/conversations/sql/schema/identities.d.ts +214 -0
- package/dist/chat/conversations/sql/schema/migrations.d.ts +58 -0
- package/dist/chat/conversations/sql/schema/timestamps.d.ts +1 -0
- package/dist/chat/conversations/sql/schema.d.ts +910 -0
- package/dist/chat/conversations/sql/store.d.ts +52 -0
- package/dist/chat/conversations/state.d.ts +4 -0
- package/dist/chat/conversations/store.d.ts +57 -0
- package/dist/chat/destination.d.ts +3 -1
- package/dist/chat/ingress/slack-webhook.d.ts +2 -0
- package/dist/chat/logging.d.ts +3 -0
- package/dist/chat/oauth-flow.d.ts +1 -1
- package/dist/chat/plugins/agent-hooks.d.ts +2 -2
- package/dist/chat/plugins/registry.d.ts +2 -0
- package/dist/chat/plugins/types.d.ts +2 -0
- package/dist/chat/prompt.d.ts +4 -1
- package/dist/chat/requester.d.ts +19 -12
- package/dist/chat/respond.d.ts +7 -3
- package/dist/chat/runtime/agent-continue-runner.d.ts +1 -1
- package/dist/chat/runtime/reply-executor.d.ts +3 -1
- package/dist/chat/runtime/slack-resume.d.ts +3 -3
- package/dist/chat/runtime/slack-runtime.d.ts +13 -3
- package/dist/chat/runtime/turn.d.ts +15 -1
- package/dist/chat/sandbox/egress-credentials.d.ts +5 -2
- package/dist/chat/sandbox/egress-policy.d.ts +5 -1
- package/dist/chat/sandbox/egress-proxy.d.ts +2 -0
- package/dist/chat/sandbox/egress-schemas.d.ts +4 -0
- package/dist/chat/sandbox/egress-session.d.ts +3 -1
- package/dist/chat/sandbox/egress-tracing.d.ts +7 -0
- package/dist/chat/sandbox/sandbox.d.ts +2 -0
- package/dist/chat/sandbox/session.d.ts +3 -2
- package/dist/chat/services/auth-pause-response.d.ts +1 -1
- package/dist/chat/services/auth-pause.d.ts +2 -1
- package/dist/chat/services/mcp-auth-orchestration.d.ts +7 -6
- package/dist/chat/services/message-actor-identity.d.ts +2 -2
- package/dist/chat/services/pending-auth.d.ts +2 -0
- package/dist/chat/services/plugin-auth-orchestration.d.ts +14 -12
- package/dist/chat/services/turn-result.d.ts +3 -0
- package/dist/chat/slack/user.d.ts +2 -2
- package/dist/chat/sql/db.d.ts +20 -0
- package/dist/chat/sql/neon.d.ts +9 -0
- package/dist/chat/sql/schema.d.ts +906 -0
- package/dist/chat/state/turn-session.d.ts +3 -0
- package/dist/chat/task-execution/slack-work.d.ts +2 -0
- package/dist/chat/task-execution/state.d.ts +209 -0
- package/dist/chat/task-execution/store.d.ts +30 -114
- package/dist/chat/task-execution/vercel-callback.d.ts +2 -0
- package/dist/chat/task-execution/worker.d.ts +2 -0
- package/dist/chat/tools/slack/canvas-tools.d.ts +3 -2
- package/dist/chat/tools/slack/channel-list-messages.d.ts +2 -2
- package/dist/chat/tools/slack/channel-post-message.d.ts +3 -2
- package/dist/chat/tools/slack/context.d.ts +15 -2
- package/dist/chat/tools/slack/message-add-reaction.d.ts +3 -2
- package/dist/chat/tools/slack/thread-read.d.ts +2 -2
- package/dist/chat/tools/types.d.ts +19 -19
- package/dist/chunk-2LUZA3LY.js +275 -0
- package/dist/{chunk-6GEYPE6T.js → chunk-3BYAPS6B.js} +30 -6
- package/dist/{chunk-VLIO6RQR.js → chunk-6UP2Z2RZ.js} +4 -4
- package/dist/{chunk-GB3AL54K.js → chunk-7Q5YOUUT.js} +10 -2
- package/dist/{chunk-PP7AGSBU.js → chunk-CYUI7JU5.js} +18 -8
- package/dist/{chunk-3FYPXHPL.js → chunk-F6HWCPOC.js} +1 -1
- package/dist/{chunk-ZJQPA67D.js → chunk-GM7HTXYC.js} +230 -224
- package/dist/{chunk-VSNA5KAB.js → chunk-HYHKTFG2.js} +1338 -1499
- package/dist/chunk-JL2SLRAT.js +1970 -0
- package/dist/{chunk-4JXCSGSA.js → chunk-M4FLLXXD.js} +1 -1
- package/dist/{chunk-55XEZFGD.js → chunk-OR6NQJ5E.js} +2 -2
- package/dist/chunk-SJHUF3DP.js +43 -0
- package/dist/chunk-SQGMG7OD.js +12801 -0
- package/dist/{chunk-QUXPUKBH.js → chunk-Y7X25LFY.js} +1 -1
- package/dist/{chunk-ICKIDP7G.js → chunk-YOHFWWBV.js} +1 -1
- package/dist/{chunk-XC33FJZN.js → chunk-YRDS7VKO.js} +25 -4
- package/dist/cli/chat.js +205 -0
- package/dist/cli/check.js +9 -10
- package/dist/cli/init.js +1 -1
- package/dist/cli/run.js +10 -2
- package/dist/cli/snapshot-warmup.js +7 -7
- package/dist/cli/upgrade.js +81 -11
- package/dist/deployment.d.ts +4 -0
- package/dist/handlers/agent-dispatch.d.ts +6 -1
- package/dist/handlers/mcp-oauth-callback.d.ts +6 -1
- package/dist/handlers/oauth-callback.d.ts +6 -1
- package/dist/handlers/sandbox-egress-proxy.d.ts +2 -0
- package/dist/handlers/webhooks.d.ts +4 -2
- package/dist/instrumentation.js +17 -3
- package/dist/nitro.js +9 -10
- package/dist/reporting/conversations.d.ts +13 -3
- package/dist/reporting.d.ts +9 -2
- package/dist/reporting.js +114 -48
- package/dist/runner-27NP2TEO.js +259 -0
- package/dist/vercel.d.ts +6 -1
- package/dist/vercel.js +1 -1
- package/package.json +9 -4
- package/dist/chunk-6YY4Q3D4.js +0 -12
- package/dist/chunk-HNMUVGSR.js +0 -1119
- package/dist/chunk-Z3YD6NHK.js +0 -12
|
@@ -5,9 +5,10 @@ import type { ThreadArtifactsState } from "@/chat/state/artifacts";
|
|
|
5
5
|
import type { ConversationPendingAuthState } from "@/chat/state/conversation";
|
|
6
6
|
import type { PluginDefinition } from "@/chat/plugins/types";
|
|
7
7
|
export declare class McpAuthorizationPauseError extends AuthorizationPauseError {
|
|
8
|
-
constructor(provider: string, disposition: "link_already_sent" | "link_sent");
|
|
8
|
+
constructor(provider: string, providerDisplayName: string, disposition: "link_already_sent" | "link_sent");
|
|
9
9
|
}
|
|
10
|
-
export interface
|
|
10
|
+
export interface McpAuthOrchestrationInput {
|
|
11
|
+
abortAgent: () => void;
|
|
11
12
|
conversationId?: string;
|
|
12
13
|
sessionId?: string;
|
|
13
14
|
requesterId?: string;
|
|
@@ -16,11 +17,11 @@ export interface McpAuthOrchestrationDeps {
|
|
|
16
17
|
threadTs?: string;
|
|
17
18
|
toolChannelId?: string;
|
|
18
19
|
userMessage: string;
|
|
19
|
-
|
|
20
|
+
pendingAuth?: ConversationPendingAuthState;
|
|
20
21
|
getConfiguration: () => Record<string, unknown>;
|
|
21
22
|
getArtifactState: () => ThreadArtifactsState | undefined;
|
|
22
23
|
getMergedArtifactState: () => ThreadArtifactsState;
|
|
23
|
-
|
|
24
|
+
recordPendingAuth?: (pendingAuth: ConversationPendingAuthState) => void | Promise<void>;
|
|
24
25
|
authorizationFlowMode?: AuthorizationFlowMode;
|
|
25
26
|
}
|
|
26
27
|
export interface McpAuthOrchestration {
|
|
@@ -28,5 +29,5 @@ export interface McpAuthOrchestration {
|
|
|
28
29
|
onAuthorizationRequired: (provider: string) => Promise<boolean>;
|
|
29
30
|
getPendingPause: () => McpAuthorizationPauseError | undefined;
|
|
30
31
|
}
|
|
31
|
-
/** Create MCP authorization orchestration for a single
|
|
32
|
-
export declare function createMcpAuthOrchestration(
|
|
32
|
+
/** Create MCP authorization orchestration for a single agent run. */
|
|
33
|
+
export declare function createMcpAuthOrchestration(input: McpAuthOrchestrationInput): McpAuthOrchestration;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Message } from "chat";
|
|
2
|
-
import { type Requester, type SlackRequesterProfile } from "@/chat/requester";
|
|
2
|
+
import { type Requester, type SlackRequester, type SlackRequesterProfile } from "@/chat/requester";
|
|
3
3
|
interface MessageAuthorIdentity {
|
|
4
4
|
email?: string;
|
|
5
5
|
fullName?: string;
|
|
@@ -12,5 +12,5 @@ export declare function bindMessageActorIdentity(message: Message, requester: Re
|
|
|
12
12
|
/** Read message identity without promoting adapter display fallbacks. */
|
|
13
13
|
export declare function getMessageActorIdentity(message: Message): MessageActorIdentity | undefined;
|
|
14
14
|
/** Attach Slack display fields only after the author id is exact. */
|
|
15
|
-
export declare function ensureSlackMessageActorIdentity(message: Message, teamId: string, lookupSlackUser: (teamId: string, userId: string) => Promise<SlackRequesterProfile | null | undefined>): Promise<
|
|
15
|
+
export declare function ensureSlackMessageActorIdentity(message: Message, teamId: string, lookupSlackUser: (teamId: string, userId: string) => Promise<SlackRequesterProfile | null | undefined>): Promise<SlackRequester>;
|
|
16
16
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AuthorizationPauseKind } from "@/chat/services/auth-pause";
|
|
2
2
|
import type { ConversationPendingAuthState, ThreadConversationState } from "@/chat/state/conversation";
|
|
3
|
+
/** Decide whether the same agent-run session can reuse its fresh auth link. */
|
|
3
4
|
export declare function canReusePendingAuthLink(args: {
|
|
4
5
|
kind: AuthorizationPauseKind;
|
|
5
6
|
nowMs?: number;
|
|
@@ -7,6 +8,7 @@ export declare function canReusePendingAuthLink(args: {
|
|
|
7
8
|
provider: string;
|
|
8
9
|
requesterId: string;
|
|
9
10
|
scope?: string;
|
|
11
|
+
sessionId: string;
|
|
10
12
|
}): boolean;
|
|
11
13
|
export declare function getConversationPendingAuth(args: {
|
|
12
14
|
conversation: ThreadConversationState;
|
|
@@ -3,15 +3,15 @@ import type { ChannelConfigurationService } from "@/chat/configuration/types";
|
|
|
3
3
|
import type { UserTokenStore } from "@/chat/credentials/user-token-store";
|
|
4
4
|
import { AuthorizationPauseError, type AuthorizationFlowMode } from "@/chat/services/auth-pause";
|
|
5
5
|
import type { ConversationPendingAuthState } from "@/chat/state/conversation";
|
|
6
|
-
import type { Skill } from "@/chat/skills";
|
|
7
6
|
export declare class PluginAuthorizationPauseError extends AuthorizationPauseError {
|
|
8
|
-
constructor(provider: string, disposition: "link_already_sent" | "link_sent");
|
|
7
|
+
constructor(provider: string, providerDisplayName: string, disposition: "link_already_sent" | "link_sent");
|
|
9
8
|
}
|
|
10
9
|
export declare class PluginCredentialFailureError extends Error {
|
|
11
10
|
readonly provider: string;
|
|
12
11
|
constructor(provider: string, message: string);
|
|
13
12
|
}
|
|
14
|
-
export interface
|
|
13
|
+
export interface PluginAuthOrchestrationInput {
|
|
14
|
+
abortAgent: () => void;
|
|
15
15
|
conversationId?: string;
|
|
16
16
|
sessionId?: string;
|
|
17
17
|
requesterId?: string;
|
|
@@ -20,20 +20,22 @@ export interface PluginAuthOrchestrationDeps {
|
|
|
20
20
|
threadTs?: string;
|
|
21
21
|
userMessage: string;
|
|
22
22
|
channelConfiguration?: ChannelConfigurationService;
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
pendingAuth?: ConversationPendingAuthState;
|
|
24
|
+
recordPendingAuth?: (pendingAuth: ConversationPendingAuthState) => void | Promise<void>;
|
|
25
25
|
authorizationFlowMode?: AuthorizationFlowMode;
|
|
26
26
|
userTokenStore?: UserTokenStore;
|
|
27
27
|
}
|
|
28
28
|
export interface PluginAuthOrchestration {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Inspect a sandbox tool result for an `auth_required` signal from the
|
|
31
|
+
* egress proxy. If one is present and an OAuth flow is available, parks the
|
|
32
|
+
* current run and sends the user an authorization link. No-ops when the
|
|
33
|
+
* result carries no auth signal.
|
|
34
|
+
*/
|
|
35
|
+
maybeHandleAuthSignal: (details: unknown) => Promise<void>;
|
|
34
36
|
getPendingPause: () => PluginAuthorizationPauseError | undefined;
|
|
35
37
|
}
|
|
36
38
|
/**
|
|
37
|
-
* Start plugin OAuth from
|
|
39
|
+
* Start plugin OAuth from a sandbox egress auth signal and park the run.
|
|
38
40
|
*/
|
|
39
|
-
export declare function createPluginAuthOrchestration(
|
|
41
|
+
export declare function createPluginAuthOrchestration(input: PluginAuthOrchestrationInput): PluginAuthOrchestration;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { FileUpload } from "chat";
|
|
2
2
|
import type { LogContext } from "@/chat/logging";
|
|
3
|
+
import type { PiMessage } from "@/chat/pi/messages";
|
|
3
4
|
import type { TurnThinkingSelection } from "@/chat/services/turn-thinking-level";
|
|
4
5
|
import type { AgentTurnUsage } from "@/chat/usage";
|
|
5
6
|
import { type ReplyDeliveryPlan } from "@/chat/services/reply-delivery-plan";
|
|
@@ -27,6 +28,7 @@ export interface AssistantReply {
|
|
|
27
28
|
deliveryMode?: "thread" | "channel_only";
|
|
28
29
|
sandboxId?: string;
|
|
29
30
|
sandboxDependencyProfileHash?: string;
|
|
31
|
+
piMessages?: PiMessage[];
|
|
30
32
|
diagnostics: AgentTurnDiagnostics;
|
|
31
33
|
}
|
|
32
34
|
export interface TurnResultInput {
|
|
@@ -37,6 +39,7 @@ export interface TurnResultInput {
|
|
|
37
39
|
toolCalls: string[];
|
|
38
40
|
sandboxId?: string;
|
|
39
41
|
sandboxDependencyProfileHash?: string;
|
|
42
|
+
piMessages?: PiMessage[];
|
|
40
43
|
durationMs?: number;
|
|
41
44
|
generatedFileCount: number;
|
|
42
45
|
shouldTrace: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type SlackRequester } from "@/chat/requester";
|
|
2
2
|
interface SlackUserLookupResult {
|
|
3
3
|
userName?: string;
|
|
4
4
|
fullName?: string;
|
|
@@ -7,5 +7,5 @@ interface SlackUserLookupResult {
|
|
|
7
7
|
/** Fetch Slack user profile info with in-memory TTL cache to avoid repeated API calls. */
|
|
8
8
|
export declare function lookupSlackUser(teamId: string, userId?: string): Promise<SlackUserLookupResult | null>;
|
|
9
9
|
/** Resolve the canonical Slack requester from Slack profile data. */
|
|
10
|
-
export declare function lookupSlackRequester(teamId: string, userId: string): Promise<
|
|
10
|
+
export declare function lookupSlackRequester(teamId: string, userId: string): Promise<SlackRequester>;
|
|
11
11
|
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared Junior SQL boundary.
|
|
3
|
+
*
|
|
4
|
+
* Feature schemas compose into `juniorSqlSchema`, and feature stores should use
|
|
5
|
+
* Drizzle through `db()`. Raw SQL exists on this executor for schema migration
|
|
6
|
+
* and catalog checks only.
|
|
7
|
+
*/
|
|
8
|
+
import type { PgDatabase } from "drizzle-orm/pg-core";
|
|
9
|
+
import type { PgQueryResultHKT } from "drizzle-orm/pg-core/session";
|
|
10
|
+
import type { juniorSqlSchema } from "./schema";
|
|
11
|
+
export type JuniorDatabase = PgDatabase<PgQueryResultHKT, typeof juniorSqlSchema>;
|
|
12
|
+
export interface JuniorSqlDatabase {
|
|
13
|
+
db(): JuniorDatabase;
|
|
14
|
+
transaction<T>(callback: () => Promise<T>): Promise<T>;
|
|
15
|
+
withLock<T>(lockName: string, callback: () => Promise<T>): Promise<T>;
|
|
16
|
+
}
|
|
17
|
+
export interface JuniorSqlMigrationExecutor extends JuniorSqlDatabase {
|
|
18
|
+
execute(statement: string, params?: readonly unknown[]): Promise<void>;
|
|
19
|
+
query<T = unknown>(statement: string, params?: readonly unknown[]): Promise<T[]>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { JuniorSqlMigrationExecutor } from "./db";
|
|
2
|
+
/** Neon-backed SQL executor with an owned connection pool lifecycle. */
|
|
3
|
+
export interface NeonJuniorSqlExecutor extends JuniorSqlMigrationExecutor {
|
|
4
|
+
close(): Promise<void>;
|
|
5
|
+
}
|
|
6
|
+
/** Create the shared Neon-backed Junior SQL executor. */
|
|
7
|
+
export declare function createNeonJuniorSqlExecutor(args: {
|
|
8
|
+
connectionString: string;
|
|
9
|
+
}): NeonJuniorSqlExecutor;
|