@sentry/junior 0.68.0 → 0.69.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 +1464 -732
- package/dist/build/virtual-config.d.ts +2 -2
- package/dist/chat/agent-dispatch/heartbeat.d.ts +2 -2
- package/dist/chat/agent-dispatch/store.d.ts +4 -1
- package/dist/chat/agent-dispatch/types.d.ts +2 -4
- package/dist/chat/agent-dispatch/validation.d.ts +3 -2
- package/dist/chat/credentials/context.d.ts +49 -24
- package/dist/chat/credentials/user-token-store.d.ts +6 -0
- package/dist/chat/destination.d.ts +12 -0
- package/dist/chat/ingress/message-router.d.ts +1 -1
- package/dist/chat/mcp/auth-store.d.ts +2 -0
- package/dist/chat/mcp/oauth.d.ts +2 -0
- package/dist/chat/oauth-flow.d.ts +7 -0
- package/dist/chat/plugins/agent-hooks.d.ts +9 -9
- package/dist/chat/plugins/auth/auth-token-placeholder.d.ts +2 -2
- package/dist/chat/plugins/auth/oauth-request.d.ts +3 -1
- package/dist/chat/plugins/credential-hooks.d.ts +34 -0
- package/dist/chat/plugins/logging.d.ts +1 -1
- package/dist/chat/plugins/state.d.ts +1 -1
- package/dist/chat/plugins/types.d.ts +19 -23
- package/dist/chat/respond.d.ts +2 -0
- package/dist/chat/runtime/reply-executor.d.ts +3 -1
- package/dist/chat/runtime/slack-runtime.d.ts +8 -3
- package/dist/chat/sandbox/egress-credentials.d.ts +33 -0
- package/dist/chat/sandbox/egress-schemas.d.ts +105 -0
- package/dist/chat/sandbox/egress-session.d.ts +17 -17
- package/dist/chat/sandbox/sandbox.d.ts +3 -0
- package/dist/chat/sandbox/session.d.ts +1 -0
- package/dist/chat/services/mcp-auth-orchestration.d.ts +2 -0
- package/dist/chat/services/pending-auth.d.ts +2 -0
- package/dist/chat/services/plugin-auth-orchestration.d.ts +2 -0
- package/dist/chat/services/provider-retry.d.ts +13 -4
- package/dist/chat/services/timeout-resume.d.ts +2 -0
- package/dist/chat/services/turn-session-record.d.ts +6 -0
- package/dist/chat/slack/attachment-fetchers.d.ts +11 -0
- package/dist/chat/state/conversation.d.ts +1 -0
- package/dist/chat/state/turn-session.d.ts +4 -0
- package/dist/chat/task-execution/queue.d.ts +2 -0
- package/dist/chat/task-execution/store.d.ts +5 -0
- package/dist/chat/task-execution/vercel-callback.d.ts +4 -0
- package/dist/chat/task-execution/vercel-queue.d.ts +2 -0
- package/dist/chat/task-execution/worker.d.ts +4 -2
- package/dist/chat/tools/slack/context.d.ts +3 -0
- package/dist/chat/tools/types.d.ts +21 -2
- package/dist/chunk-76YMBKW7.js +326 -0
- package/dist/{chunk-PIVOJIUD.js → chunk-B5HKWWQB.js} +9 -5
- package/dist/chunk-BBXYXOJW.js +1858 -0
- package/dist/{chunk-V47RLIO2.js → chunk-GT67ZWZQ.js} +4 -4
- package/dist/{chunk-75UZ4JLC.js → chunk-IGLNC5H6.js} +21 -9
- package/dist/{chunk-EBVQXCD2.js → chunk-JS4HURDT.js} +362 -280
- package/dist/{chunk-UQQSW7QB.js → chunk-N3MORKTH.js} +74 -331
- package/dist/chunk-R62YWUNO.js +264 -0
- package/dist/{chunk-OIIXZOOC.js → chunk-UXG6TU2U.js} +311 -2015
- package/dist/cli/check.js +4 -4
- package/dist/cli/snapshot-warmup.js +5 -4
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +21 -19
- package/dist/plugins.d.ts +2 -2
- package/dist/reporting.d.ts +2 -2
- package/dist/reporting.js +13 -11
- package/package.json +6 -4
- package/dist/chat/plugins/auth/github-app-broker.d.ts +0 -4
- package/dist/chat/plugins/github-permissions.d.ts +0 -11
- package/dist/chat/queue/thread-message-dispatcher.d.ts +0 -33
- package/dist/chunk-KVZL5NZS.js +0 -519
|
@@ -1,17 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type
|
|
1
|
+
import type { CredentialContext } from "@/chat/credentials/context";
|
|
2
|
+
import { type SandboxEgressAuthRequiredSignal, type SandboxEgressCredentialContext, type SandboxEgressCredentialLease, type SandboxEgressPermissionDeniedSignal } from "@/chat/sandbox/egress-schemas";
|
|
3
3
|
export declare const SANDBOX_EGRESS_PROXY_PATH = "/api/internal/sandbox-egress";
|
|
4
|
-
export
|
|
5
|
-
credentials: CredentialContext;
|
|
6
|
-
egressId: string;
|
|
7
|
-
expiresAtMs: number;
|
|
8
|
-
contextId: string;
|
|
9
|
-
}
|
|
10
|
-
export interface SandboxEgressCredentialLease {
|
|
11
|
-
provider: string;
|
|
12
|
-
expiresAt: string;
|
|
13
|
-
headerTransforms: CredentialHeaderTransform[];
|
|
14
|
-
}
|
|
4
|
+
export type { SandboxEgressAuthRequiredSignal, SandboxEgressCredentialContext, SandboxEgressCredentialLease, SandboxEgressPermissionDeniedSignal, };
|
|
15
5
|
/** Create a signed actor/sandbox context token for lazy sandbox egress auth. */
|
|
16
6
|
export declare function createSandboxEgressCredentialToken(input: {
|
|
17
7
|
credentials: CredentialContext;
|
|
@@ -20,9 +10,19 @@ export declare function createSandboxEgressCredentialToken(input: {
|
|
|
20
10
|
}): string;
|
|
21
11
|
/** Verify a signed actor/sandbox context token from the proxy URL. */
|
|
22
12
|
export declare function parseSandboxEgressCredentialToken(token: string | undefined): SandboxEgressCredentialContext | undefined;
|
|
23
|
-
/** Cache a short-lived credential lease for
|
|
13
|
+
/** Cache a short-lived credential lease for one actor/sandbox context and grant. */
|
|
24
14
|
export declare function setSandboxEgressCredentialLease(context: SandboxEgressCredentialContext, lease: SandboxEgressCredentialLease): Promise<void>;
|
|
25
|
-
/** Load a cached egress credential lease for
|
|
26
|
-
export declare function getSandboxEgressCredentialLease(provider: string, context: SandboxEgressCredentialContext): Promise<SandboxEgressCredentialLease | undefined>;
|
|
15
|
+
/** Load a cached egress credential lease for one actor/sandbox context and grant. */
|
|
16
|
+
export declare function getSandboxEgressCredentialLease(provider: string, grantName: string, context: SandboxEgressCredentialContext): Promise<SandboxEgressCredentialLease | undefined>;
|
|
27
17
|
/** Clear a cached egress credential lease after the provider rejects its headers. */
|
|
28
|
-
export declare function clearSandboxEgressCredentialLease(provider: string, context: SandboxEgressCredentialContext): Promise<void>;
|
|
18
|
+
export declare function clearSandboxEgressCredentialLease(provider: string, grantName: string, context: SandboxEgressCredentialContext): Promise<void>;
|
|
19
|
+
/** Record that host-side sandbox egress returned an auth-required response. */
|
|
20
|
+
export declare function setSandboxEgressAuthRequiredSignal(context: SandboxEgressCredentialContext, signal: Omit<SandboxEgressAuthRequiredSignal, "createdAtMs">): Promise<void>;
|
|
21
|
+
/** Record that host-side sandbox egress saw an upstream permission denial. */
|
|
22
|
+
export declare function setSandboxEgressPermissionDeniedSignal(context: SandboxEgressCredentialContext, signal: Omit<SandboxEgressPermissionDeniedSignal, "createdAtMs">): Promise<void>;
|
|
23
|
+
/** Remove any pending host-side sandbox egress signals for a command. */
|
|
24
|
+
export declare function clearSandboxEgressSignals(egressId: string | undefined): Promise<void>;
|
|
25
|
+
/** Consume the host-side sandbox egress auth signal produced during a command. */
|
|
26
|
+
export declare function consumeSandboxEgressAuthRequiredSignal(egressId: string | undefined): Promise<SandboxEgressAuthRequiredSignal | undefined>;
|
|
27
|
+
/** Consume the host-side sandbox egress permission signal produced during a command. */
|
|
28
|
+
export declare function consumeSandboxEgressPermissionDeniedSignal(egressId: string | undefined): Promise<SandboxEgressPermissionDeniedSignal | undefined>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type LogContext } from "@/chat/logging";
|
|
2
|
+
import { type SandboxEgressAuthRequiredSignal, type SandboxEgressPermissionDeniedSignal } from "@/chat/sandbox/egress-session";
|
|
2
3
|
import type { CredentialContext } from "@/chat/credentials/context";
|
|
3
4
|
import type { AgentPluginHookRunner } from "@/chat/plugins/agent-hooks";
|
|
4
5
|
import type { SandboxInstance } from "@/chat/sandbox/workspace";
|
|
@@ -22,6 +23,8 @@ export interface BashCustomCommandResult {
|
|
|
22
23
|
stderr: string;
|
|
23
24
|
stdout_truncated: boolean;
|
|
24
25
|
stderr_truncated: boolean;
|
|
26
|
+
auth_required?: SandboxEgressAuthRequiredSignal;
|
|
27
|
+
permission_denied?: SandboxEgressPermissionDeniedSignal;
|
|
25
28
|
}
|
|
26
29
|
export interface SandboxAcquiredState {
|
|
27
30
|
sandboxId: string;
|
|
@@ -34,6 +34,7 @@ interface SandboxSessionManager {
|
|
|
34
34
|
configureSkills(skills: SkillMetadata[]): void;
|
|
35
35
|
configureReferenceFiles(files: string[]): void;
|
|
36
36
|
getSandboxId(): string | undefined;
|
|
37
|
+
getSandboxEgressId(): string | undefined;
|
|
37
38
|
getDependencyProfileHash(): string | undefined;
|
|
38
39
|
createSandbox(): Promise<SandboxInstance>;
|
|
39
40
|
ensureToolExecutors(): Promise<SandboxToolExecutors>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { OAuthClientProvider } from "@modelcontextprotocol/sdk/client/auth.js";
|
|
2
|
+
import type { Destination } from "@sentry/junior-plugin-api";
|
|
2
3
|
import { AuthorizationPauseError, type AuthorizationFlowMode } from "@/chat/services/auth-pause";
|
|
3
4
|
import type { ThreadArtifactsState } from "@/chat/state/artifacts";
|
|
4
5
|
import type { ConversationPendingAuthState } from "@/chat/state/conversation";
|
|
@@ -11,6 +12,7 @@ export interface McpAuthOrchestrationDeps {
|
|
|
11
12
|
sessionId?: string;
|
|
12
13
|
requesterId?: string;
|
|
13
14
|
channelId?: string;
|
|
15
|
+
destination?: Destination;
|
|
14
16
|
threadTs?: string;
|
|
15
17
|
toolChannelId?: string;
|
|
16
18
|
userMessage: string;
|
|
@@ -6,12 +6,14 @@ export declare function canReusePendingAuthLink(args: {
|
|
|
6
6
|
pendingAuth?: ConversationPendingAuthState;
|
|
7
7
|
provider: string;
|
|
8
8
|
requesterId: string;
|
|
9
|
+
scope?: string;
|
|
9
10
|
}): boolean;
|
|
10
11
|
export declare function getConversationPendingAuth(args: {
|
|
11
12
|
conversation: ThreadConversationState;
|
|
12
13
|
kind: AuthorizationPauseKind;
|
|
13
14
|
provider: string;
|
|
14
15
|
requesterId: string;
|
|
16
|
+
scope?: string;
|
|
15
17
|
}): ConversationPendingAuthState | undefined;
|
|
16
18
|
export declare function clearPendingAuth(conversation: ThreadConversationState, sessionId?: string): void;
|
|
17
19
|
/**
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Destination } from "@sentry/junior-plugin-api";
|
|
1
2
|
import type { ChannelConfigurationService } from "@/chat/configuration/types";
|
|
2
3
|
import type { UserTokenStore } from "@/chat/credentials/user-token-store";
|
|
3
4
|
import { AuthorizationPauseError, type AuthorizationFlowMode } from "@/chat/services/auth-pause";
|
|
@@ -15,6 +16,7 @@ export interface PluginAuthOrchestrationDeps {
|
|
|
15
16
|
sessionId?: string;
|
|
16
17
|
requesterId?: string;
|
|
17
18
|
channelId?: string;
|
|
19
|
+
destination?: Destination;
|
|
18
20
|
threadTs?: string;
|
|
19
21
|
userMessage: string;
|
|
20
22
|
channelConfiguration?: ChannelConfigurationService;
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import type { AssistantMessage } from "@earendil-works/pi-ai";
|
|
2
2
|
import type { PiMessage } from "@/chat/pi/messages";
|
|
3
|
-
/**
|
|
4
|
-
export declare function
|
|
5
|
-
/**
|
|
6
|
-
export declare function
|
|
3
|
+
/** Mark failures that cross the AI provider boundary for shared retry handling. */
|
|
4
|
+
export declare function createProviderError(error: unknown): Error;
|
|
5
|
+
/** Return whether a provider-boundary error should be retried by the worker. */
|
|
6
|
+
export declare function isProviderRetryError(error: unknown): boolean;
|
|
7
|
+
/** Build the next provider retry step from Pi history, if the turn can resume. */
|
|
8
|
+
export declare function nextProviderRetry(args: {
|
|
9
|
+
attempt: number;
|
|
10
|
+
lastAssistant: Pick<AssistantMessage, "stopReason" | "errorMessage"> | undefined;
|
|
11
|
+
messages: PiMessage[];
|
|
12
|
+
}): {
|
|
13
|
+
delayMs: number;
|
|
14
|
+
messages: PiMessage[];
|
|
15
|
+
} | undefined;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { StateAdapter } from "chat";
|
|
2
|
+
import type { Destination } from "@sentry/junior-plugin-api";
|
|
2
3
|
import type { ConversationWorkQueue } from "@/chat/task-execution/queue";
|
|
3
4
|
export interface TurnContinuationRequest {
|
|
4
5
|
conversationId: string;
|
|
6
|
+
destination: Destination;
|
|
5
7
|
expectedVersion: number;
|
|
6
8
|
sessionId: string;
|
|
7
9
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type AgentTurnSessionRecord, type AgentTurnRequester, type AgentTurnSurface } from "@/chat/state/turn-session";
|
|
2
|
+
import type { Destination } from "@sentry/junior-plugin-api";
|
|
2
3
|
import type { PiMessage } from "@/chat/pi/messages";
|
|
3
4
|
import { type AgentTurnUsage } from "@/chat/usage";
|
|
4
5
|
export declare const AGENT_TURN_TIMEOUT_RESUME_MAX_SLICES = 48;
|
|
@@ -26,6 +27,7 @@ export declare function loadTurnSessionRecord(ctx: TurnSessionContext): Promise<
|
|
|
26
27
|
export declare function persistRunningSessionRecord(args: {
|
|
27
28
|
channelName?: string;
|
|
28
29
|
conversationId: string;
|
|
30
|
+
destination?: Destination;
|
|
29
31
|
sessionId: string;
|
|
30
32
|
sliceId: number;
|
|
31
33
|
messages: PiMessage[];
|
|
@@ -40,6 +42,7 @@ export declare function persistCompletedSessionRecord(args: {
|
|
|
40
42
|
conversationId: string;
|
|
41
43
|
currentDurationMs?: number;
|
|
42
44
|
currentUsage?: AgentTurnUsage;
|
|
45
|
+
destination?: Destination;
|
|
43
46
|
sessionId: string;
|
|
44
47
|
sliceId: number;
|
|
45
48
|
allMessages: PiMessage[];
|
|
@@ -59,6 +62,7 @@ export declare function persistAuthPauseSessionRecord(args: {
|
|
|
59
62
|
currentSliceId: number;
|
|
60
63
|
currentDurationMs?: number;
|
|
61
64
|
currentUsage?: AgentTurnUsage;
|
|
65
|
+
destination?: Destination;
|
|
62
66
|
messages: PiMessage[];
|
|
63
67
|
loadedSkillNames?: string[];
|
|
64
68
|
errorMessage: string;
|
|
@@ -77,6 +81,7 @@ export declare function persistTimeoutSessionRecord(args: {
|
|
|
77
81
|
currentSliceId: number;
|
|
78
82
|
currentDurationMs?: number;
|
|
79
83
|
currentUsage?: AgentTurnUsage;
|
|
84
|
+
destination?: Destination;
|
|
80
85
|
messages: PiMessage[];
|
|
81
86
|
loadedSkillNames?: string[];
|
|
82
87
|
errorMessage: string;
|
|
@@ -94,6 +99,7 @@ export declare function persistYieldSessionRecord(args: {
|
|
|
94
99
|
currentSliceId: number;
|
|
95
100
|
currentDurationMs?: number;
|
|
96
101
|
currentUsage?: AgentTurnUsage;
|
|
102
|
+
destination?: Destination;
|
|
97
103
|
messages: PiMessage[];
|
|
98
104
|
loadedSkillNames?: string[];
|
|
99
105
|
errorMessage: string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { downloadPrivateSlackFile as downloadPrivateSlackFileImpl } from "@/chat/slack/client";
|
|
2
|
+
/**
|
|
3
|
+
* Restore Slack private-file fetchers on message attachments that crossed a
|
|
4
|
+
* serialization boundary.
|
|
5
|
+
*/
|
|
6
|
+
export declare function rehydrateAttachmentFetchers(message: {
|
|
7
|
+
attachments: Array<{
|
|
8
|
+
fetchData?: unknown;
|
|
9
|
+
url?: string;
|
|
10
|
+
}>;
|
|
11
|
+
}, downloadPrivateSlackFile?: typeof downloadPrivateSlackFileImpl): void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Destination } from "@sentry/junior-plugin-api";
|
|
1
2
|
import type { PiMessage } from "@/chat/pi/messages";
|
|
2
3
|
import type { AgentTurnUsage } from "@/chat/usage";
|
|
3
4
|
export type AgentTurnSessionStatus = "running" | "awaiting_resume" | "completed" | "failed" | "abandoned";
|
|
@@ -16,6 +17,7 @@ export interface AgentTurnSessionRecord {
|
|
|
16
17
|
conversationId: string;
|
|
17
18
|
cumulativeDurationMs: number;
|
|
18
19
|
cumulativeUsage?: AgentTurnUsage;
|
|
20
|
+
destination?: Destination;
|
|
19
21
|
errorMessage?: string;
|
|
20
22
|
lastProgressAtMs: number;
|
|
21
23
|
loadedSkillNames?: string[];
|
|
@@ -41,6 +43,7 @@ export declare function upsertAgentTurnSessionRecord(args: {
|
|
|
41
43
|
conversationId: string;
|
|
42
44
|
cumulativeDurationMs?: number;
|
|
43
45
|
cumulativeUsage?: AgentTurnUsage;
|
|
46
|
+
destination?: Destination;
|
|
44
47
|
lastProgressAtMs?: number;
|
|
45
48
|
loadedSkillNames?: string[];
|
|
46
49
|
sessionId: string;
|
|
@@ -62,6 +65,7 @@ export declare function recordAgentTurnSessionSummary(args: {
|
|
|
62
65
|
conversationId: string;
|
|
63
66
|
cumulativeDurationMs?: number;
|
|
64
67
|
cumulativeUsage?: AgentTurnUsage;
|
|
68
|
+
destination?: Destination;
|
|
65
69
|
lastProgressAtMs?: number;
|
|
66
70
|
loadedSkillNames?: string[];
|
|
67
71
|
requester?: AgentTurnRequester;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { StateAdapter } from "chat";
|
|
2
|
+
import type { Destination } from "@sentry/junior-plugin-api";
|
|
2
3
|
import type { ConversationWorkQueue } from "./queue";
|
|
3
4
|
export declare const CONVERSATION_WORK_LEASE_TTL_MS = 90000;
|
|
4
5
|
export declare const CONVERSATION_WORK_CHECK_IN_INTERVAL_MS = 15000;
|
|
@@ -13,6 +14,7 @@ export interface AgentInputMessage {
|
|
|
13
14
|
export interface InboundMessageRecord {
|
|
14
15
|
conversationId: string;
|
|
15
16
|
createdAtMs: number;
|
|
17
|
+
destination: Destination;
|
|
16
18
|
inboundMessageId: string;
|
|
17
19
|
injectedAtMs?: number;
|
|
18
20
|
input: AgentInputMessage;
|
|
@@ -27,6 +29,7 @@ export interface ConversationLease {
|
|
|
27
29
|
}
|
|
28
30
|
export interface ConversationWorkState {
|
|
29
31
|
conversationId: string;
|
|
32
|
+
destination: Destination;
|
|
30
33
|
lastEnqueuedAtMs?: number;
|
|
31
34
|
lease?: ConversationLease;
|
|
32
35
|
messages: InboundMessageRecord[];
|
|
@@ -81,6 +84,7 @@ export declare function appendAndEnqueueInboundMessage(args: {
|
|
|
81
84
|
/** Mark a conversation runnable when there is no new mailbox message. */
|
|
82
85
|
export declare function requestConversationWork(args: {
|
|
83
86
|
conversationId: string;
|
|
87
|
+
destination: Destination;
|
|
84
88
|
nowMs?: number;
|
|
85
89
|
state?: StateAdapter;
|
|
86
90
|
}): Promise<RequestConversationWorkResult>;
|
|
@@ -122,6 +126,7 @@ export declare function markConversationMessagesInjected(args: {
|
|
|
122
126
|
/** Mark the leased conversation as needing another queue-delivered slice. */
|
|
123
127
|
export declare function requestConversationContinuation(args: {
|
|
124
128
|
conversationId: string;
|
|
129
|
+
destination: Destination;
|
|
125
130
|
leaseToken: string;
|
|
126
131
|
nowMs?: number;
|
|
127
132
|
state?: StateAdapter;
|
|
@@ -2,6 +2,7 @@ import type { StateAdapter } from "chat";
|
|
|
2
2
|
import type { ConversationWorkQueue } from "./queue";
|
|
3
3
|
import { type ConversationWorkProcessResult, type ConversationWorkerResult, type ConversationWorkerContext } from "./worker";
|
|
4
4
|
export declare const CONVERSATION_WORK_VISIBILITY_TIMEOUT_BUFFER_SECONDS = 30;
|
|
5
|
+
export declare const CONVERSATION_WORK_DEV_CONSUMER_GROUP = "junior_conversation_work_dev";
|
|
5
6
|
export interface ProcessConversationQueueMessageOptions {
|
|
6
7
|
checkInIntervalMs?: number;
|
|
7
8
|
nowMs?: () => number;
|
|
@@ -11,6 +12,7 @@ export interface ProcessConversationQueueMessageOptions {
|
|
|
11
12
|
state?: StateAdapter;
|
|
12
13
|
}
|
|
13
14
|
export interface VercelConversationWorkCallbackOptions extends ProcessConversationQueueMessageOptions {
|
|
15
|
+
topic?: string;
|
|
14
16
|
visibilityTimeoutSeconds?: number;
|
|
15
17
|
}
|
|
16
18
|
/** Resolve queue visibility so redelivery waits past the host timeout boundary. */
|
|
@@ -19,3 +21,5 @@ export declare function resolveConversationWorkVisibilityTimeoutSeconds(function
|
|
|
19
21
|
export declare function processConversationQueueMessage(message: unknown, options: ProcessConversationQueueMessageOptions): Promise<ConversationWorkProcessResult>;
|
|
20
22
|
/** Create the Vercel Queue push callback for conversation work nudges. */
|
|
21
23
|
export declare function createVercelConversationWorkCallback(options: VercelConversationWorkCallbackOptions): (request: Request) => Promise<Response>;
|
|
24
|
+
/** Register the Vercel Queue local-dev consumer for Nitro's central route dispatcher. */
|
|
25
|
+
export declare function registerVercelConversationWorkDevConsumer(options: VercelConversationWorkCallbackOptions): (() => void) | undefined;
|
|
@@ -9,6 +9,8 @@ export interface VercelConversationWorkQueueOptions {
|
|
|
9
9
|
retentionSeconds?: number;
|
|
10
10
|
topic?: string;
|
|
11
11
|
}
|
|
12
|
+
/** Resolve the Vercel Queue topic used for conversation wake-up nudges. */
|
|
13
|
+
export declare function resolveConversationWorkQueueTopic(options?: Pick<VercelConversationWorkQueueOptions, "topic">): string;
|
|
12
14
|
/** Create the Vercel Queue implementation for conversation wake-up nudges. */
|
|
13
15
|
export declare function createVercelConversationWorkQueue(options?: VercelConversationWorkQueueOptions): ConversationWorkQueue;
|
|
14
16
|
/** Return the default production conversation work queue. */
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { StateAdapter } from "chat";
|
|
2
|
-
import type {
|
|
2
|
+
import type { Destination } from "@sentry/junior-plugin-api";
|
|
3
|
+
import type { ConversationQueueMessage, ConversationWorkQueue } from "./queue";
|
|
3
4
|
import { type InboundMessageRecord } from "./store";
|
|
4
5
|
export declare const CONVERSATION_WORK_DEFER_DELAY_MS = 15000;
|
|
5
6
|
export declare const CONVERSATION_WORK_SOFT_YIELD_AFTER_MS = 240000;
|
|
6
7
|
export interface ConversationWorkerContext {
|
|
7
8
|
checkIn(): Promise<boolean>;
|
|
8
9
|
conversationId: string;
|
|
10
|
+
destination: Destination;
|
|
9
11
|
drainMailbox(inject: (messages: InboundMessageRecord[]) => Promise<void>): Promise<InboundMessageRecord[]>;
|
|
10
12
|
leaseToken: string;
|
|
11
13
|
shouldYield(): boolean;
|
|
@@ -25,4 +27,4 @@ export interface ProcessConversationWorkOptions {
|
|
|
25
27
|
state?: StateAdapter;
|
|
26
28
|
}
|
|
27
29
|
/** Process one queue wake-up for a conversation. */
|
|
28
|
-
export declare function processConversationWork(
|
|
30
|
+
export declare function processConversationWork(message: ConversationQueueMessage, options: ProcessConversationWorkOptions): Promise<ConversationWorkProcessResult>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { FileUpload } from "chat";
|
|
2
|
+
import type { Destination } from "@sentry/junior-plugin-api";
|
|
2
3
|
import type { McpToolManager } from "@/chat/mcp/tool-manager";
|
|
3
4
|
import type { SandboxWorkspace } from "@/chat/sandbox/workspace";
|
|
4
5
|
import type { ThreadArtifactsState } from "@/chat/state/artifacts";
|
|
5
6
|
import type { Skill } from "@/chat/skills";
|
|
6
7
|
import type { LoadSkillMetadata } from "@/chat/tools/skill/load-skill";
|
|
7
|
-
import type { ChannelCapabilities } from "@/chat/tools/channel-capabilities";
|
|
8
8
|
import type { AdvisorToolRuntimeContext } from "@/chat/tools/advisor/tool";
|
|
9
9
|
export interface ImageGenerateToolDeps {
|
|
10
10
|
fetch?: typeof fetch;
|
|
@@ -35,8 +35,27 @@ export interface ToolHooks {
|
|
|
35
35
|
}
|
|
36
36
|
export interface ToolRuntimeContext {
|
|
37
37
|
advisor?: AdvisorToolRuntimeContext;
|
|
38
|
+
/**
|
|
39
|
+
* Raw Slack channel/conversation container for this turn: `C...`, `D...`,
|
|
40
|
+
* or `G...`. Never overridden by assistant context. Stable binding key for
|
|
41
|
+
* state scoped to a Slack conversation. Passed to plugin hooks as-is via
|
|
42
|
+
* `ToolRegistrationHookContext.channelId`.
|
|
43
|
+
*/
|
|
38
44
|
channelId?: string;
|
|
39
|
-
|
|
45
|
+
/**
|
|
46
|
+
* Slack channel used by first-class delivery tools when assistant context
|
|
47
|
+
* points at a source channel different from the raw conversation channel.
|
|
48
|
+
*/
|
|
49
|
+
deliveryChannelId?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Opaque Junior conversation/session identity for this turn.
|
|
52
|
+
* Interactive Slack turns use `slack:{channelId}:{threadTs}`.
|
|
53
|
+
* Scheduled/API turns use an internal id such as `agent-dispatch:{id}`.
|
|
54
|
+
* Do not parse as Slack unless the value starts with `slack:`.
|
|
55
|
+
*/
|
|
56
|
+
conversationId?: string;
|
|
57
|
+
/** Runtime-owned destination for provider-neutral side effects. */
|
|
58
|
+
destination?: Destination;
|
|
40
59
|
requester?: {
|
|
41
60
|
userId?: string;
|
|
42
61
|
userName?: string;
|