@sentry/junior 0.114.0 → 0.115.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/{agent-hooks-WNBUY4OB.js → agent-hooks-4EUUXP2F.js} +12 -11
- package/dist/api/conversations/detail.d.ts +2 -0
- package/dist/api/conversations/event-list.d.ts +2 -0
- package/dist/api/health.d.ts +7 -0
- package/dist/api/plugin-reports.d.ts +62 -0
- package/dist/api/plugins.d.ts +9 -0
- package/dist/api/runtime.d.ts +24 -0
- package/dist/api/schema/conversation.d.ts +8 -0
- package/dist/api/schema.d.ts +2 -2
- package/dist/api/schema.js +6 -6
- package/dist/api/skills.d.ts +6 -0
- package/dist/api.js +123 -99
- package/dist/app.js +1104 -5006
- package/dist/catalog-runtime-Y32UEQLB.js +18 -0
- package/dist/chat/agent/request.d.ts +6 -0
- package/dist/chat/agent/sandbox.d.ts +2 -0
- package/dist/chat/agent/tools.d.ts +2 -0
- package/dist/chat/config.d.ts +2 -0
- package/dist/chat/conversations/history.d.ts +6 -0
- package/dist/chat/local/credential-sync.d.ts +5 -0
- package/dist/chat/local/oauth-relay.d.ts +4 -0
- package/dist/chat/mcp/oauth.d.ts +1 -0
- package/dist/chat/oauth-authorization.d.ts +17 -0
- package/dist/chat/oauth-flow.d.ts +9 -0
- package/dist/chat/sandbox/egress/schemas.d.ts +46 -0
- package/dist/chat/sandbox/egress/signals.d.ts +9 -0
- package/dist/chat/sandbox/sandbox.d.ts +2 -0
- package/dist/chat/sentry-payload-filter.d.ts +4 -4
- package/dist/chat/services/mcp-auth-orchestration.d.ts +5 -3
- package/dist/chat/services/plugin-auth-orchestration.d.ts +2 -0
- package/dist/chat/slack/message-control.d.ts +2 -0
- package/dist/chat/slack/oauth-authorization-message.d.ts +3 -0
- package/dist/chat/task-execution/slack-work.d.ts +2 -0
- package/dist/chat/tool-support/zod-tool.d.ts +1 -1
- package/dist/chat/tools/definition.d.ts +5 -0
- package/dist/{chunk-TLGM5X2M.js → chunk-2QG4MZQ7.js} +2 -2
- package/dist/{chunk-WV4UJBAS.js → chunk-43RYMWJ2.js} +523 -2373
- package/dist/chunk-4CODA7P5.js +43 -0
- package/dist/{chunk-YU6PO42Q.js → chunk-67CVNDJ7.js} +1 -1
- package/dist/{chunk-OSKEC4XU.js → chunk-6FKLPVF3.js} +1 -1
- package/dist/{chunk-2ZTTXTSZ.js → chunk-6OPTF4BQ.js} +10 -4
- package/dist/{chunk-W6RDUAO3.js → chunk-6V762AB4.js} +1 -1
- package/dist/{chunk-ABPSDO6M.js → chunk-AGLQYELI.js} +77 -8
- package/dist/{chunk-6QWPVTMO.js → chunk-CEYOL62C.js} +9 -7
- package/dist/{chunk-RD7EJI7H.js → chunk-CWEZEPD4.js} +3 -3
- package/dist/chunk-DIB4GX3G.js +8 -0
- package/dist/{chunk-K2W4CK7K.js → chunk-EW5MLKT5.js} +10 -75
- package/dist/{chunk-42WRQLJ6.js → chunk-F3B2YJ76.js} +0 -14
- package/dist/chunk-FA6POGLH.js +70 -0
- package/dist/{chunk-PM3PX42K.js → chunk-FHC4JUSF.js} +1 -1
- package/dist/{chunk-6Y5L4BOM.js → chunk-FXOYURO4.js} +5 -3
- package/dist/{chunk-S4QDH23A.js → chunk-G36V2YGB.js} +83 -81
- package/dist/{chunk-O4GT7LYB.js → chunk-G5SX4UPR.js} +3 -43
- package/dist/chunk-HDSDCEPK.js +80 -0
- package/dist/{chunk-FIGAF6KL.js → chunk-HWCQRGLL.js} +5 -3
- package/dist/{chunk-C4MZ3GP5.js → chunk-HZF5P5UN.js} +1 -1
- package/dist/chunk-LYA2AB5G.js +1914 -0
- package/dist/{chunk-4FUEG3QY.js → chunk-NVUQSFWX.js} +2 -2
- package/dist/chunk-OB42YVAE.js +16 -0
- package/dist/{chunk-XLFBQJUO.js → chunk-PVZHG2XZ.js} +4 -4
- package/dist/{chunk-VNNBSKCO.js → chunk-RAVKCKXA.js} +7 -7
- package/dist/{chunk-ZGXH3REA.js → chunk-SYJT7AKB.js} +12 -2
- package/dist/{chunk-5CZ7RETL.js → chunk-TVE25LPW.js} +1 -1
- package/dist/chunk-W3U3YQYI.js +71 -0
- package/dist/chunk-YCLO7D7M.js +4267 -0
- package/dist/cli/chat.js +72 -40
- package/dist/cli/check.js +10 -8
- package/dist/cli/init.js +1 -0
- package/dist/cli/plugins.js +16 -14
- package/dist/cli/snapshot-warmup.js +13 -11
- package/dist/cli/upgrade.js +10 -8
- package/dist/{db-4VLP7KBF.js → db-KBSJHAZU.js} +8 -7
- package/dist/handlers/sandbox-egress-signals.d.ts +4 -0
- package/dist/instrumentation.js +72 -4
- package/dist/nitro.js +2 -2
- package/dist/oauth-callback-server-EYRMJTCS.js +231 -0
- package/dist/oauth-relay-3ZU72UGL.js +9 -0
- package/dist/reporting-schema.d.ts +12 -4
- package/dist/reporting.d.ts +5 -5
- package/dist/{runner-IPXLWQOF.js → runner-RQGZ5Z2S.js} +139 -72
- package/dist/sandbox-egress-signals-CDFAP67O.js +75 -0
- package/dist/{skills-QCNZISNF.js → skills-JJQIE3BT.js} +10 -8
- package/dist/validation-MZ47PZP5.js +21 -0
- package/dist/version.js +1 -1
- package/package.json +5 -5
- package/dist/catalog-runtime-6O4M6JGA.js +0 -16
- package/dist/chat/oauth-authorization-message.d.ts +0 -6
- package/dist/validation-I2BW3UHD.js +0 -19
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
pluginCatalogRuntime
|
|
3
|
+
} from "./chunk-6FKLPVF3.js";
|
|
4
|
+
import "./chunk-EW5MLKT5.js";
|
|
5
|
+
import "./chunk-W3U3YQYI.js";
|
|
6
|
+
import "./chunk-HZF5P5UN.js";
|
|
7
|
+
import "./chunk-NVUQSFWX.js";
|
|
8
|
+
import "./chunk-OB42YVAE.js";
|
|
9
|
+
import "./chunk-F3B2YJ76.js";
|
|
10
|
+
import "./chunk-6GWA276C.js";
|
|
11
|
+
import "./chunk-B3IT5END.js";
|
|
12
|
+
import "./chunk-3V7OFJZC.js";
|
|
13
|
+
import "./chunk-TVE25LPW.js";
|
|
14
|
+
import "./chunk-FHC4JUSF.js";
|
|
15
|
+
import "./chunk-MLKGABMK.js";
|
|
16
|
+
export {
|
|
17
|
+
pluginCatalogRuntime
|
|
18
|
+
};
|
|
@@ -15,7 +15,9 @@ import type { PiMessage } from "@/chat/pi/messages";
|
|
|
15
15
|
import type { Actor } from "@/chat/actor";
|
|
16
16
|
import type { SandboxRef } from "@/chat/sandbox/ref";
|
|
17
17
|
import type { SandboxEgressTracePropagationConfig } from "@/chat/sandbox/egress/tracing";
|
|
18
|
+
import type { SandboxEgressSignalTransport } from "@/chat/sandbox/egress/signals";
|
|
18
19
|
import type { AuthorizationFlowMode } from "@/chat/services/auth-pause";
|
|
20
|
+
import type { OAuthAuthorization } from "@/chat/oauth-authorization";
|
|
19
21
|
import type { AssistantStatusSpec } from "@/chat/slack/assistant-thread/status";
|
|
20
22
|
import type { SlackConversationContext } from "@/chat/slack/conversation-context";
|
|
21
23
|
import type { ThreadArtifactsState } from "@/chat/state/artifacts";
|
|
@@ -94,6 +96,8 @@ export interface AgentRunPolicy {
|
|
|
94
96
|
skillDirs?: string[];
|
|
95
97
|
/** Per-slice override for app-owned sandbox egress trace propagation. */
|
|
96
98
|
sandboxTracePropagation?: SandboxEgressTracePropagationConfig;
|
|
99
|
+
/** Per-slice sandbox egress signal storage override. */
|
|
100
|
+
sandboxEgressSignals?: SandboxEgressSignalTransport;
|
|
97
101
|
toolOverrides?: {
|
|
98
102
|
imageGenerate?: ImageGenerateToolDeps;
|
|
99
103
|
webFetch?: WebFetchToolDeps;
|
|
@@ -152,6 +156,8 @@ export interface AgentRunRequest {
|
|
|
152
156
|
runId?: string;
|
|
153
157
|
input: AgentRunInput;
|
|
154
158
|
routing: AgentRunRouting;
|
|
159
|
+
/** Surface-owned OAuth state and private delivery capabilities. */
|
|
160
|
+
authorization?: OAuthAuthorization;
|
|
155
161
|
policy?: AgentRunPolicy;
|
|
156
162
|
state?: AgentRunState;
|
|
157
163
|
observers?: AgentRunObservers;
|
|
@@ -11,6 +11,7 @@ import type { ChannelConfigurationService } from "@/chat/configuration/types";
|
|
|
11
11
|
import type { CredentialContext } from "@/chat/credentials/context";
|
|
12
12
|
import type { LogContext } from "@/chat/logging";
|
|
13
13
|
import type { SandboxEgressTracePropagationConfig } from "@/chat/sandbox/egress/tracing";
|
|
14
|
+
import type { SandboxEgressSignalTransport } from "@/chat/sandbox/egress/signals";
|
|
14
15
|
import type { SandboxRef } from "@/chat/sandbox/ref";
|
|
15
16
|
import { type SandboxTools } from "@/chat/sandbox/sandbox";
|
|
16
17
|
import type { SandboxWorkspace } from "@/chat/sandbox/workspace";
|
|
@@ -21,6 +22,7 @@ export interface AgentSandboxOptions {
|
|
|
21
22
|
skills: SkillMetadata[];
|
|
22
23
|
traceContext: LogContext;
|
|
23
24
|
tracePropagation?: SandboxEgressTracePropagationConfig;
|
|
25
|
+
egressSignals?: SandboxEgressSignalTransport;
|
|
24
26
|
credentialEgress?: CredentialContext;
|
|
25
27
|
actor?: Actor;
|
|
26
28
|
channelConfiguration?: ChannelConfigurationService;
|
|
@@ -20,6 +20,7 @@ import type { SandboxRef } from "@/chat/sandbox/ref";
|
|
|
20
20
|
import type { PiMessage } from "@/chat/pi/messages";
|
|
21
21
|
import type { LogContext } from "@/chat/logging";
|
|
22
22
|
import type { ConversationPrivacy } from "@/chat/conversation-privacy";
|
|
23
|
+
import type { OAuthAuthorization } from "@/chat/oauth-authorization";
|
|
23
24
|
import type { Actor } from "@/chat/actor";
|
|
24
25
|
import type { ThreadArtifactsState } from "@/chat/state/artifacts";
|
|
25
26
|
import type { AuthorizationPauseError } from "@/chat/services/auth-pause";
|
|
@@ -38,6 +39,7 @@ interface ToolWiringArgs {
|
|
|
38
39
|
connectedMcpProviders: Set<string>;
|
|
39
40
|
conversationPrivacy?: ConversationPrivacy;
|
|
40
41
|
durability: AgentRunDurability;
|
|
42
|
+
authorization?: OAuthAuthorization;
|
|
41
43
|
generatedFiles: FileUpload[];
|
|
42
44
|
invokedSkill: SkillMetadata | null;
|
|
43
45
|
observers: AgentRunObservers;
|
package/dist/chat/config.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export declare const FUNCTION_TIMEOUT_BUFFER_SECONDS = 20;
|
|
|
9
9
|
export declare const CONVERSATION_WORK_SOFT_YIELD_BUFFER_SECONDS = 40;
|
|
10
10
|
export interface BotConfig {
|
|
11
11
|
contextWindowTokens: number;
|
|
12
|
+
crossActorMidRunMode: CrossActorMidRunMode;
|
|
12
13
|
embeddingModelId: string;
|
|
13
14
|
fastModelId: string;
|
|
14
15
|
imageGenerationModelId: string;
|
|
@@ -21,6 +22,7 @@ export interface BotConfig {
|
|
|
21
22
|
userName: string;
|
|
22
23
|
webSearchModelId: string;
|
|
23
24
|
}
|
|
25
|
+
export type CrossActorMidRunMode = "follow_up" | "steer";
|
|
24
26
|
export type SqlDriver = "neon" | "postgres";
|
|
25
27
|
export interface ChatConfig {
|
|
26
28
|
bot: BotConfig;
|
|
@@ -27,6 +27,7 @@ export declare const historyReplacementSchema: z.ZodObject<{
|
|
|
27
27
|
modelId: z.ZodString;
|
|
28
28
|
reasoningLevel: z.ZodOptional<z.ZodString>;
|
|
29
29
|
triggeringToolCallId: z.ZodOptional<z.ZodString>;
|
|
30
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
30
31
|
replacementHistory: z.ZodArray<z.ZodObject<{
|
|
31
32
|
message: z.ZodPipe<z.ZodObject<{
|
|
32
33
|
role: z.ZodString;
|
|
@@ -72,6 +73,7 @@ export declare const historyReplacementSchema: z.ZodObject<{
|
|
|
72
73
|
retainedMessageCount: z.ZodNumber;
|
|
73
74
|
summaryChars: z.ZodNumber;
|
|
74
75
|
}, z.core.$strict>>;
|
|
76
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
75
77
|
replacementHistory: z.ZodArray<z.ZodObject<{
|
|
76
78
|
message: z.ZodPipe<z.ZodObject<{
|
|
77
79
|
role: z.ZodString;
|
|
@@ -268,6 +270,7 @@ export declare const conversationEventDataSchema: z.ZodUnion<readonly [z.ZodUnio
|
|
|
268
270
|
modelId: z.ZodString;
|
|
269
271
|
reasoningLevel: z.ZodOptional<z.ZodString>;
|
|
270
272
|
triggeringToolCallId: z.ZodOptional<z.ZodString>;
|
|
273
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
271
274
|
replacementHistory: z.ZodArray<z.ZodObject<{
|
|
272
275
|
message: z.ZodPipe<z.ZodObject<{
|
|
273
276
|
role: z.ZodString;
|
|
@@ -313,6 +316,7 @@ export declare const conversationEventDataSchema: z.ZodUnion<readonly [z.ZodUnio
|
|
|
313
316
|
retainedMessageCount: z.ZodNumber;
|
|
314
317
|
summaryChars: z.ZodNumber;
|
|
315
318
|
}, z.core.$strict>>;
|
|
319
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
316
320
|
replacementHistory: z.ZodArray<z.ZodObject<{
|
|
317
321
|
message: z.ZodPipe<z.ZodObject<{
|
|
318
322
|
role: z.ZodString;
|
|
@@ -539,6 +543,7 @@ export declare const conversationEventSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
539
543
|
modelId: z.ZodString;
|
|
540
544
|
reasoningLevel: z.ZodOptional<z.ZodString>;
|
|
541
545
|
triggeringToolCallId: z.ZodOptional<z.ZodString>;
|
|
546
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
542
547
|
replacementHistory: z.ZodArray<z.ZodObject<{
|
|
543
548
|
message: z.ZodPipe<z.ZodObject<{
|
|
544
549
|
role: z.ZodString;
|
|
@@ -584,6 +589,7 @@ export declare const conversationEventSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
584
589
|
retainedMessageCount: z.ZodNumber;
|
|
585
590
|
summaryChars: z.ZodNumber;
|
|
586
591
|
}, z.core.$strict>>;
|
|
592
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
587
593
|
replacementHistory: z.ZodArray<z.ZodObject<{
|
|
588
594
|
message: z.ZodPipe<z.ZodObject<{
|
|
589
595
|
role: z.ZodString;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type PluginStoredTokens } from "@sentry/junior-plugin-api";
|
|
2
|
+
/** Copy a local user's provider credential to the loopback dev-server broker. */
|
|
3
|
+
export declare function syncLocalOAuthCredential(provider: string, tokens: PluginStoredTokens): Promise<void>;
|
|
4
|
+
/** Verify and store one credential sent by the local CLI over loopback. */
|
|
5
|
+
export declare function receiveLocalOAuthCredential(request: Request): Promise<Response>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Create an OAuth state value that can be safely relayed to a local CLI callback. */
|
|
2
|
+
export declare function createLocalOAuthState(port: number): Promise<string>;
|
|
3
|
+
/** Redirect a provider callback from the public dev URL to the owning local CLI. */
|
|
4
|
+
export declare function relayLocalOAuthCallback(request: Request): Promise<Response | undefined>;
|
package/dist/chat/mcp/oauth.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export declare function createMcpOAuthClientProvider(input: {
|
|
|
17
17
|
toolChannelId?: string;
|
|
18
18
|
configuration?: Record<string, unknown>;
|
|
19
19
|
artifactState?: ThreadArtifactsState;
|
|
20
|
+
createAuthorizationState?: () => Promise<string>;
|
|
20
21
|
}): Promise<StateBackedMcpOAuthClientProvider>;
|
|
21
22
|
/** Exchange a callback code while guarding every shared credential mutation. */
|
|
22
23
|
export declare function finalizeMcpAuthorization(provider: string, authSessionId: string, authorizationCode: string, runCredentialMutation?: <T>(mutation: () => Promise<T>) => Promise<T>): Promise<McpAuthSessionState>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** User-facing link and guidance for one OAuth authorization attempt. */
|
|
2
|
+
export interface OAuthAuthorizationRequest {
|
|
3
|
+
authorizationUrl: string;
|
|
4
|
+
completionText: string;
|
|
5
|
+
label: string;
|
|
6
|
+
}
|
|
7
|
+
/** Surface-owned capabilities for creating and presenting OAuth authorization. */
|
|
8
|
+
export interface OAuthAuthorization {
|
|
9
|
+
createState: () => Promise<string>;
|
|
10
|
+
deliver: (request: OAuthAuthorizationRequest) => void | Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
/** Build the stable event identity shared by authorization request and completion. */
|
|
13
|
+
export declare function authorizationId(args: {
|
|
14
|
+
kind: "mcp" | "plugin";
|
|
15
|
+
provider: string;
|
|
16
|
+
sessionId: string;
|
|
17
|
+
}): string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type Destination, type Source } from "@sentry/junior-plugin-api";
|
|
2
|
+
import type { OAuthAuthorization, OAuthAuthorizationRequest } from "@/chat/oauth-authorization";
|
|
2
3
|
type PrivateDeliveryResult = "in_context" | "fallback_dm" | false;
|
|
3
4
|
export type OAuthStatePayload = {
|
|
4
5
|
userId: string;
|
|
@@ -21,6 +22,7 @@ type OAuthFlowInput = {
|
|
|
21
22
|
resumeConversationId?: string;
|
|
22
23
|
resumeSessionId?: string;
|
|
23
24
|
scope?: string;
|
|
25
|
+
authorization?: OAuthAuthorization;
|
|
24
26
|
};
|
|
25
27
|
/** Parse OAuth callback state that was persisted before a provider redirect. */
|
|
26
28
|
export declare function parseOAuthStatePayload(value: unknown): OAuthStatePayload | undefined;
|
|
@@ -38,6 +40,13 @@ export declare function deliverPrivateMessage(input: {
|
|
|
38
40
|
userId: string;
|
|
39
41
|
text: string;
|
|
40
42
|
}): Promise<PrivateDeliveryResult>;
|
|
43
|
+
/** Present one OAuth request through the active surface's private delivery. */
|
|
44
|
+
export declare function deliverOAuthAuthorization(request: OAuthAuthorizationRequest, input: {
|
|
45
|
+
authorization?: OAuthAuthorization;
|
|
46
|
+
channelId?: string;
|
|
47
|
+
threadTs?: string;
|
|
48
|
+
userId: string;
|
|
49
|
+
}): Promise<PrivateDeliveryResult>;
|
|
41
50
|
/** Initiate an OAuth authorization code flow for a provider and deliver the auth link to the user. */
|
|
42
51
|
export declare function startOAuthFlow(provider: string, input: OAuthFlowInput): Promise<{
|
|
43
52
|
ok: false;
|
|
@@ -113,6 +113,52 @@ export declare const sandboxEgressPermissionDeniedSignalSchema: z.ZodObject<{
|
|
|
113
113
|
upstreamPath: z.ZodString;
|
|
114
114
|
createdAtMs: z.ZodNumber;
|
|
115
115
|
}, z.core.$strict>;
|
|
116
|
+
export declare const sandboxEgressSignalsResponseSchema: z.ZodObject<{
|
|
117
|
+
auth_required: z.ZodOptional<z.ZodObject<{
|
|
118
|
+
authorization: z.ZodOptional<z.ZodObject<{
|
|
119
|
+
provider: z.ZodString;
|
|
120
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
121
|
+
type: z.ZodLiteral<"oauth">;
|
|
122
|
+
}, z.core.$strict>>;
|
|
123
|
+
grant: z.ZodObject<{
|
|
124
|
+
access: z.ZodUnion<readonly [z.ZodLiteral<"read">, z.ZodLiteral<"write">]>;
|
|
125
|
+
leaseScope: z.ZodOptional<z.ZodString>;
|
|
126
|
+
name: z.ZodString;
|
|
127
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
128
|
+
requirements: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
129
|
+
}, z.core.$strict>;
|
|
130
|
+
kind: z.ZodDefault<z.ZodEnum<{
|
|
131
|
+
unavailable: "unavailable";
|
|
132
|
+
auth_required: "auth_required";
|
|
133
|
+
}>>;
|
|
134
|
+
provider: z.ZodString;
|
|
135
|
+
message: z.ZodOptional<z.ZodString>;
|
|
136
|
+
createdAtMs: z.ZodNumber;
|
|
137
|
+
}, z.core.$strict>>;
|
|
138
|
+
permission_denied: z.ZodOptional<z.ZodObject<{
|
|
139
|
+
account: z.ZodOptional<z.ZodObject<{
|
|
140
|
+
id: z.ZodString;
|
|
141
|
+
label: z.ZodOptional<z.ZodString>;
|
|
142
|
+
url: z.ZodOptional<z.ZodString>;
|
|
143
|
+
}, z.core.$strict>>;
|
|
144
|
+
acceptedPermissions: z.ZodOptional<z.ZodString>;
|
|
145
|
+
grant: z.ZodObject<{
|
|
146
|
+
access: z.ZodUnion<readonly [z.ZodLiteral<"read">, z.ZodLiteral<"write">]>;
|
|
147
|
+
leaseScope: z.ZodOptional<z.ZodString>;
|
|
148
|
+
name: z.ZodString;
|
|
149
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
150
|
+
requirements: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
151
|
+
}, z.core.$strict>;
|
|
152
|
+
message: z.ZodString;
|
|
153
|
+
provider: z.ZodString;
|
|
154
|
+
source: z.ZodLiteral<"upstream">;
|
|
155
|
+
sso: z.ZodOptional<z.ZodString>;
|
|
156
|
+
status: z.ZodNumber;
|
|
157
|
+
upstreamHost: z.ZodString;
|
|
158
|
+
upstreamPath: z.ZodString;
|
|
159
|
+
createdAtMs: z.ZodNumber;
|
|
160
|
+
}, z.core.$strict>>;
|
|
161
|
+
}, z.core.$strict>;
|
|
116
162
|
export type SandboxEgressCredentialContext = z.output<typeof sandboxEgressCredentialContextSchema>;
|
|
117
163
|
export type SandboxEgressGrant = z.output<typeof sandboxEgressGrantSchema>;
|
|
118
164
|
export type SandboxEgressCredentialLease = z.output<typeof sandboxEgressCredentialLeaseSchema>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SandboxEgressAuthRequiredSignal, SandboxEgressPermissionDeniedSignal } from "@/chat/sandbox/egress/schemas";
|
|
2
|
+
/** Authenticated transport for signal state owned by another Junior process. */
|
|
3
|
+
export interface SandboxEgressSignalTransport {
|
|
4
|
+
clear: (credentialToken: string) => Promise<void>;
|
|
5
|
+
consume: (credentialToken: string) => Promise<{
|
|
6
|
+
authRequired?: SandboxEgressAuthRequiredSignal;
|
|
7
|
+
permissionDenied?: SandboxEgressPermissionDeniedSignal;
|
|
8
|
+
}>;
|
|
9
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type LogContext } from "@/chat/logging";
|
|
2
|
+
import type { SandboxEgressSignalTransport } from "@/chat/sandbox/egress/signals";
|
|
2
3
|
import type { SandboxEgressTracePropagationConfig } from "@/chat/sandbox/egress/tracing";
|
|
3
4
|
import type { CredentialContext } from "@/chat/credentials/context";
|
|
4
5
|
import type { SandboxRef } from "@/chat/sandbox/ref";
|
|
@@ -26,6 +27,7 @@ export interface SandboxOptions {
|
|
|
26
27
|
traceContext?: LogContext;
|
|
27
28
|
tracePropagation?: SandboxEgressTracePropagationConfig;
|
|
28
29
|
credentialEgress?: CredentialContext;
|
|
30
|
+
egressSignals?: SandboxEgressSignalTransport;
|
|
29
31
|
prepare?: (workspace: SandboxWorkspace) => void | Promise<void>;
|
|
30
32
|
onSandboxRefChanged?: (sandboxRef: SandboxRef) => void | Promise<void>;
|
|
31
33
|
}
|
|
@@ -3,12 +3,12 @@ type SentryErrorEvent = Parameters<NonNullable<Sentry.NodeOptions["beforeSend"]>
|
|
|
3
3
|
type SentryTransactionEvent = Parameters<NonNullable<Sentry.NodeOptions["beforeSendTransaction"]>>[0];
|
|
4
4
|
type SentrySpan = Parameters<Parameters<typeof Sentry.withStreamedSpan>[0]>[0];
|
|
5
5
|
type SentryLog = Parameters<NonNullable<Sentry.NodeOptions["beforeSendLog"]>>[0];
|
|
6
|
-
/** Remove
|
|
6
|
+
/** Remove private conversation payloads and boundary secrets from error events. */
|
|
7
7
|
export declare function scrubPrivateSentryEvent(event: SentryErrorEvent): SentryErrorEvent | null;
|
|
8
|
-
/** Remove
|
|
8
|
+
/** Remove private conversation payloads and boundary secrets from transactions. */
|
|
9
9
|
export declare function scrubPrivateSentryTransaction(event: SentryTransactionEvent): SentryTransactionEvent | null;
|
|
10
|
-
/** Remove
|
|
10
|
+
/** Remove private conversation payloads and boundary secrets from streamed spans. */
|
|
11
11
|
export declare function scrubPrivateSentrySpan(span: SentrySpan): SentrySpan;
|
|
12
|
-
/** Remove
|
|
12
|
+
/** Remove private conversation payloads and boundary secrets from structured logs. */
|
|
13
13
|
export declare function scrubPrivateSentryLog(log: SentryLog): SentryLog | null;
|
|
14
14
|
export {};
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
* MCP authorization pause orchestration.
|
|
3
3
|
*
|
|
4
4
|
* This module turns an MCP client auth challenge into Junior's paused-run
|
|
5
|
-
* model: create provider auth state,
|
|
6
|
-
* record pending auth, and abort the agent so the OAuth callback can resume
|
|
7
|
-
* same session.
|
|
5
|
+
* model: create provider auth state, privately present or reuse its link,
|
|
6
|
+
* record pending auth, and abort the agent so the OAuth callback can resume
|
|
7
|
+
* the same session.
|
|
8
8
|
*/
|
|
9
9
|
import type { OAuthClientProvider } from "@modelcontextprotocol/sdk/client/auth.js";
|
|
10
10
|
import type { Destination, Source } from "@sentry/junior-plugin-api";
|
|
11
|
+
import { type OAuthAuthorization } from "@/chat/oauth-authorization";
|
|
11
12
|
import { AuthorizationPauseError, type AuthorizationFlowMode } from "@/chat/services/auth-pause";
|
|
12
13
|
import type { ThreadArtifactsState } from "@/chat/state/artifacts";
|
|
13
14
|
import type { ConversationPendingAuthState } from "@/chat/state/conversation";
|
|
@@ -32,6 +33,7 @@ export interface McpAuthOrchestrationInput {
|
|
|
32
33
|
getMergedArtifactState: () => ThreadArtifactsState;
|
|
33
34
|
recordPendingAuth?: (pendingAuth: ConversationPendingAuthState | undefined) => void | Promise<void>;
|
|
34
35
|
authorizationFlowMode?: AuthorizationFlowMode;
|
|
36
|
+
authorization?: OAuthAuthorization;
|
|
35
37
|
}
|
|
36
38
|
export interface McpAuthOrchestration {
|
|
37
39
|
authProviderFactory: (plugin: PluginDefinition) => Promise<OAuthClientProvider | undefined>;
|
|
@@ -14,6 +14,7 @@ import type { Destination, Source } from "@sentry/junior-plugin-api";
|
|
|
14
14
|
import type { UserTokenStore } from "@/chat/credentials/user-token-store";
|
|
15
15
|
import { AuthorizationPauseError, type AuthorizationFlowMode } from "@/chat/services/auth-pause";
|
|
16
16
|
import type { ConversationPendingAuthState } from "@/chat/state/conversation";
|
|
17
|
+
import { type OAuthAuthorization } from "@/chat/oauth-authorization";
|
|
17
18
|
export declare class PluginAuthorizationPauseError extends AuthorizationPauseError {
|
|
18
19
|
constructor(provider: string, providerDisplayName: string, disposition: "link_already_sent" | "link_sent", requestText?: string);
|
|
19
20
|
}
|
|
@@ -35,6 +36,7 @@ export interface PluginAuthOrchestrationInput {
|
|
|
35
36
|
recordPendingAuth?: (pendingAuth: ConversationPendingAuthState) => void | Promise<void>;
|
|
36
37
|
authorizationFlowMode?: AuthorizationFlowMode;
|
|
37
38
|
userTokenStore?: UserTokenStore;
|
|
39
|
+
authorization?: OAuthAuthorization;
|
|
38
40
|
}
|
|
39
41
|
export interface PluginAuthOrchestration {
|
|
40
42
|
/**
|
|
@@ -7,6 +7,7 @@ import type { InboundMessage } from "@/chat/task-execution/store";
|
|
|
7
7
|
import type { ConversationWorkerContext, ConversationWorkerResult } from "@/chat/task-execution/worker";
|
|
8
8
|
import { type SlackInstallationContext } from "@/chat/slack/adapter-context";
|
|
9
9
|
import { type SlackActorProfile } from "@/chat/actor";
|
|
10
|
+
import { type CrossActorMidRunMode } from "@/chat/config";
|
|
10
11
|
declare const slackConversationRouteSchema: z.ZodEnum<{
|
|
11
12
|
mention: "mention";
|
|
12
13
|
subscribed: "subscribed";
|
|
@@ -270,6 +271,7 @@ interface SlackResourceEventInboundInput {
|
|
|
270
271
|
text: string;
|
|
271
272
|
}
|
|
272
273
|
export interface CreateSlackConversationWorkerOptions {
|
|
274
|
+
crossActorMidRunMode?: CrossActorMidRunMode;
|
|
273
275
|
getSlackAdapter: () => SlackAdapter;
|
|
274
276
|
lookupSlackUser?: (teamId: string, userId: string) => Promise<SlackActorProfile | null | undefined>;
|
|
275
277
|
resumeAwaitingContinuation: (conversationId: string, options: {
|
|
@@ -2,7 +2,7 @@ import { z, type ZodType, type ZodTypeAny } from "zod";
|
|
|
2
2
|
import { type JuniorToolResult } from "@/chat/tool-support/structured-result";
|
|
3
3
|
import type { ImageContent, TextContent } from "@earendil-works/pi-ai";
|
|
4
4
|
import type { AnyToolDefinition, JsonSchemaObject, ToolExecuteOptions } from "@/chat/tools/definition";
|
|
5
|
-
type ZodToolDefinitionBase<TInputSchema extends ZodTypeAny> = Pick<AnyToolDefinition, "identity" | "source" | "description" | "exposure" | "annotations" | "promptSnippet" | "promptGuidelines" | "executionMode"> & {
|
|
5
|
+
type ZodToolDefinitionBase<TInputSchema extends ZodTypeAny> = Pick<AnyToolDefinition, "approvalMode" | "identity" | "source" | "description" | "exposure" | "annotations" | "promptSnippet" | "promptGuidelines" | "executionMode"> & {
|
|
6
6
|
inputSchema: TInputSchema;
|
|
7
7
|
prepareArguments?: (args: unknown) => z.input<TInputSchema>;
|
|
8
8
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ToolAnnotations } from "@modelcontextprotocol/sdk/types.js";
|
|
2
2
|
import { type Static, type TSchema } from "@sinclair/typebox";
|
|
3
3
|
import type { ToolExecutionMode } from "@earendil-works/pi-agent-core";
|
|
4
|
+
import type { ToolApprovalMode } from "@sentry/junior-plugin-api";
|
|
4
5
|
import type { ConversationPrivacy } from "@/chat/conversation-privacy";
|
|
5
6
|
/**
|
|
6
7
|
* Tool definition boundary for Pi-facing agent tools.
|
|
@@ -17,6 +18,8 @@ export interface ToolExecuteOptions {
|
|
|
17
18
|
toolCallId?: string;
|
|
18
19
|
}
|
|
19
20
|
interface BaseToolDefinition<TInput, TInputSchema extends ToolInputSchema> {
|
|
21
|
+
/** Optional declared approval mode; omission delegates to core defaults. */
|
|
22
|
+
approvalMode?: ToolApprovalMode;
|
|
20
23
|
/** Stable internal owner-qualified identity for plugin-contributed tools. */
|
|
21
24
|
identity?: {
|
|
22
25
|
id: string;
|
|
@@ -56,6 +59,8 @@ export interface ToolDefinition<TInputSchema extends TSchema = TSchema> extends
|
|
|
56
59
|
* Schema-erased view for heterogeneous registries after Pi validates tool input.
|
|
57
60
|
*/
|
|
58
61
|
export interface AnyToolDefinition {
|
|
62
|
+
/** Optional declared approval mode; omission delegates to core defaults. */
|
|
63
|
+
approvalMode?: ToolApprovalMode;
|
|
59
64
|
/** Stable internal owner-qualified identity for plugin-contributed tools. */
|
|
60
65
|
identity?: {
|
|
61
66
|
id: string;
|