@sentry/junior 0.150.0 → 0.151.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-SEOGOGKX.js → agent-hooks-EYUAEBMA.js} +10 -10
- package/dist/api/schema/conversation.d.ts +24 -4
- package/dist/api/schema.js +1 -1
- package/dist/api.js +63 -35
- package/dist/app.js +123 -200
- package/dist/{catalog-runtime-HA7RIWYT.js → catalog-runtime-2LCLLOBI.js} +5 -5
- package/dist/chat/agent/skills.d.ts +5 -4
- package/dist/chat/agent/tools.d.ts +5 -5
- package/dist/chat/conversations/history.d.ts +12 -3
- package/dist/chat/conversations/projection.d.ts +7 -3
- package/dist/chat/mcp/tool-manager.d.ts +0 -4
- package/dist/chat/runtime/agent-run-outcome.d.ts +4 -0
- package/dist/chat/tools/search-conversation-events.d.ts +1 -1
- package/dist/chat/tools/skill/call-mcp-tool.d.ts +0 -1
- package/dist/chat/tools/skill/load-skill.d.ts +2 -5
- package/dist/chat/tools/types.d.ts +1 -2
- package/dist/{chunk-ZUQT35YC.js → chunk-2MGJ64SL.js} +1 -1
- package/dist/{chunk-TZLYAO2J.js → chunk-3WOK4ZLX.js} +72 -218
- package/dist/{chunk-7D4GNUV2.js → chunk-4ABTAQYC.js} +3 -3
- package/dist/{chunk-F5NMSEBL.js → chunk-5N3XLYBW.js} +1 -1
- package/dist/{chunk-M5OZSVJI.js → chunk-6A46QL4O.js} +4 -4
- package/dist/{chunk-7NLW2NF5.js → chunk-6DLWRSGV.js} +1 -1
- package/dist/{chunk-3GL327SC.js → chunk-6PGJPCN2.js} +1 -1
- package/dist/{chunk-P43QM7JY.js → chunk-6WNWM5JD.js} +5 -5
- package/dist/{chunk-64K7GKRW.js → chunk-AGSUPAD5.js} +2 -2
- package/dist/{chunk-NCGVQXX5.js → chunk-B7KWBJAR.js} +6 -6
- package/dist/{chunk-Y2VZ54CQ.js → chunk-C7D2ONB5.js} +1 -1
- package/dist/{chunk-SH6ZKJFZ.js → chunk-CL5DT6D2.js} +4 -4
- package/dist/{chunk-3ZMKDHCT.js → chunk-D22FO4LW.js} +2 -2
- package/dist/{chunk-IZRSLANA.js → chunk-DJAOSWB6.js} +1 -1
- package/dist/{chunk-FEFEIA3Z.js → chunk-EMB4VY7H.js} +5 -5
- package/dist/{chunk-4KAYAIBV.js → chunk-H7ZMEHAN.js} +1 -1
- package/dist/{chunk-UIMBNY6O.js → chunk-J5LAA2LI.js} +9 -9
- package/dist/{chunk-IPGNWXA3.js → chunk-JIJOPRD4.js} +16 -10
- package/dist/{chunk-ZBOGYZ53.js → chunk-JSKTDBSS.js} +4 -4
- package/dist/{chunk-ILYL6YFD.js → chunk-K3QXMZDU.js} +11 -4
- package/dist/{chunk-QPIPYVGE.js → chunk-KPQBQRNM.js} +5 -5
- package/dist/{chunk-DWETNV66.js → chunk-M6KRPBXC.js} +6 -6
- package/dist/{chunk-JQXJ2E53.js → chunk-OAPPJ3TM.js} +1 -1
- package/dist/{chunk-MCNP7A7T.js → chunk-OFRJXFTH.js} +8 -8
- package/dist/{chunk-7GOP6VFJ.js → chunk-OYRFUQOV.js} +106 -16
- package/dist/{chunk-NNOCRVQO.js → chunk-PQUV3NA5.js} +2 -2
- package/dist/{chunk-SHDREBGC.js → chunk-PWMVR2MD.js} +1 -1
- package/dist/{chunk-UOFQEVR5.js → chunk-QVQBWWXQ.js} +6 -6
- package/dist/{chunk-H2RLIJ7G.js → chunk-UDDCHQN2.js} +1 -1
- package/dist/{chunk-7QB2CKCW.js → chunk-WVXFEQXE.js} +1 -1
- package/dist/{chunk-3JVUWLR7.js → chunk-XN3QKNQX.js} +8 -1
- package/dist/{chunk-6PFDWAK2.js → chunk-YN4W5SRJ.js} +1 -1
- package/dist/{chunk-4VH7KLGC.js → chunk-ZGSL5ARH.js} +50 -22
- package/dist/cli/chat.js +30 -30
- package/dist/cli/check.js +6 -6
- package/dist/cli/plugins.js +13 -13
- package/dist/cli/snapshot-create.js +9 -9
- package/dist/cli/upgrade.js +7 -7
- package/dist/{db-HUW75QG7.js → db-ALCBI4JZ.js} +7 -7
- package/dist/instrumentation.js +4 -4
- package/dist/nitro.js +2 -2
- package/dist/{oauth-callback-server-DP7NIZPQ.js → oauth-callback-server-3RRMG62B.js} +23 -23
- package/dist/{runner-AINV7K3M.js → runner-V6C3EELU.js} +14 -14
- package/dist/{skills-PKS37E6B.js → skills-43PFYZIZ.js} +6 -6
- package/dist/spawn-UZNNTNFU.js +38 -0
- package/dist/{validation-PDC3MVMM.js → validation-4MNN6QKE.js} +6 -6
- package/dist/version.js +1 -1
- package/dist/{work-KJLJRPXS.js → work-YZO6XTEB.js} +17 -17
- package/dist/{worker-TYQ7YVIR.js → worker-42AR7323.js} +11 -11
- package/migrations/0025_mcp_credential_subject.sql +8 -0
- package/migrations/meta/0025_snapshot.json +2275 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +5 -5
- package/dist/chat/pi/derived-state.d.ts +0 -5
- package/dist/spawn-NJCDEPPL.js +0 -38
|
@@ -230,6 +230,7 @@ export declare const conversationEventDataSchema: z.ZodUnion<readonly [z.ZodUnio
|
|
|
230
230
|
}, z.core.$loose>], "type">, z.ZodObject<{
|
|
231
231
|
type: z.ZodLiteral<"mcp_provider_connected">;
|
|
232
232
|
provider: z.ZodString;
|
|
233
|
+
credentialSubjectId: z.ZodString;
|
|
233
234
|
}, z.core.$strict>, z.ZodObject<{
|
|
234
235
|
type: z.ZodLiteral<"authorization_requested">;
|
|
235
236
|
kind: z.ZodUnion<readonly [z.ZodLiteral<"plugin">, z.ZodLiteral<"mcp">]>;
|
|
@@ -455,11 +456,14 @@ export declare const conversationEventDataSchema: z.ZodUnion<readonly [z.ZodUnio
|
|
|
455
456
|
}, z.core.$loose>], "type">;
|
|
456
457
|
sourceEventSeq: z.ZodOptional<z.ZodNumber>;
|
|
457
458
|
}, z.core.$strict>>;
|
|
458
|
-
}, z.core.$strict>], "type"
|
|
459
|
+
}, z.core.$strict>], "type">, z.ZodObject<{
|
|
460
|
+
type: z.ZodLiteral<"mcp_provider_connected_unowned">;
|
|
461
|
+
provider: z.ZodString;
|
|
462
|
+
}, z.core.$strict>]>;
|
|
459
463
|
/** One durable conversation event's validated data. */
|
|
460
464
|
export type ConversationEventData = z.output<typeof conversationEventDataSchema>;
|
|
461
465
|
/** Event type names recognized by current readers and observational queries. */
|
|
462
|
-
export declare const KNOWN_CONVERSATION_EVENT_TYPES: readonly ["message", "message_updated", "user_message", "assistant_message", "tool_result", "mcp_provider_connected", "authorization_requested", "authorization_completed", "tool_execution_started", "guardian_action_reviewed", "message_handled", "messages_summarized", "turn_started", "turn_context", "structured_event", "turn_routed", "turn_completed", "turn_failed", "subagent_started", "subagent_ended", "handoff", "compaction"];
|
|
466
|
+
export declare const KNOWN_CONVERSATION_EVENT_TYPES: readonly ["message", "message_updated", "user_message", "assistant_message", "tool_result", "mcp_provider_connected", "mcp_provider_connected_unowned", "authorization_requested", "authorization_completed", "tool_execution_started", "guardian_action_reviewed", "message_handled", "messages_summarized", "turn_started", "turn_context", "structured_event", "turn_routed", "turn_completed", "turn_failed", "subagent_started", "subagent_ended", "handoff", "compaction"];
|
|
463
467
|
/** One known durable conversation event type name. */
|
|
464
468
|
export type KnownConversationEventType = (typeof KNOWN_CONVERSATION_EVENT_TYPES)[number];
|
|
465
469
|
declare const unknownConversationEventDataSchema: z.ZodObject<{
|
|
@@ -531,6 +535,7 @@ export declare const conversationEventSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
531
535
|
}, z.core.$loose>], "type">, z.ZodObject<{
|
|
532
536
|
type: z.ZodLiteral<"mcp_provider_connected">;
|
|
533
537
|
provider: z.ZodString;
|
|
538
|
+
credentialSubjectId: z.ZodString;
|
|
534
539
|
}, z.core.$strict>, z.ZodObject<{
|
|
535
540
|
type: z.ZodLiteral<"authorization_requested">;
|
|
536
541
|
kind: z.ZodUnion<readonly [z.ZodLiteral<"plugin">, z.ZodLiteral<"mcp">]>;
|
|
@@ -756,7 +761,10 @@ export declare const conversationEventSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
756
761
|
}, z.core.$loose>], "type">;
|
|
757
762
|
sourceEventSeq: z.ZodOptional<z.ZodNumber>;
|
|
758
763
|
}, z.core.$strict>>;
|
|
759
|
-
}, z.core.$strict>], "type"
|
|
764
|
+
}, z.core.$strict>], "type">, z.ZodObject<{
|
|
765
|
+
type: z.ZodLiteral<"mcp_provider_connected_unowned">;
|
|
766
|
+
provider: z.ZodString;
|
|
767
|
+
}, z.core.$strict>]>;
|
|
760
768
|
}, z.core.$strict>, z.ZodObject<{
|
|
761
769
|
schemaVersion: z.ZodNumber;
|
|
762
770
|
seq: z.ZodNumber;
|
|
@@ -855,6 +863,7 @@ export declare const newConversationEventSchema: z.ZodObject<{
|
|
|
855
863
|
}, z.core.$loose>], "type">, z.ZodObject<{
|
|
856
864
|
type: z.ZodLiteral<"mcp_provider_connected">;
|
|
857
865
|
provider: z.ZodString;
|
|
866
|
+
credentialSubjectId: z.ZodString;
|
|
858
867
|
}, z.core.$strict>, z.ZodObject<{
|
|
859
868
|
type: z.ZodLiteral<"authorization_requested">;
|
|
860
869
|
kind: z.ZodUnion<readonly [z.ZodLiteral<"plugin">, z.ZodLiteral<"mcp">]>;
|
|
@@ -39,8 +39,11 @@ export declare function loadTurnProjection(args: {
|
|
|
39
39
|
committedSeq: number;
|
|
40
40
|
includeTail: boolean;
|
|
41
41
|
}): Promise<PiConversationEventProjection | undefined>;
|
|
42
|
-
/** Load MCP providers connected in
|
|
43
|
-
export declare function loadConnectedMcpProviders(args:
|
|
42
|
+
/** Load MCP providers the credential subject connected in this conversation. */
|
|
43
|
+
export declare function loadConnectedMcpProviders(args: {
|
|
44
|
+
conversationId: string;
|
|
45
|
+
credentialSubjectId: string;
|
|
46
|
+
}): Promise<string[]>;
|
|
44
47
|
/**
|
|
45
48
|
* Append newly stable native history items.
|
|
46
49
|
*
|
|
@@ -90,10 +93,11 @@ export declare function commitAcceptedReply(args: {
|
|
|
90
93
|
providerConversationBindings?: Array<Omit<ProviderConversationBinding, "conversationId">>;
|
|
91
94
|
repliedAtMs?: number;
|
|
92
95
|
}): Promise<void>;
|
|
93
|
-
/** Record a successful MCP provider connection without duplicating
|
|
96
|
+
/** Record a successful MCP provider connection for one credential subject without duplicating it. */
|
|
94
97
|
export declare function recordMcpProviderConnected(args: {
|
|
95
98
|
conversationId: string;
|
|
96
99
|
provider: string;
|
|
100
|
+
credentialSubjectId: string;
|
|
97
101
|
}): Promise<void>;
|
|
98
102
|
/** Record that an OAuth/MCP authorization link was delivered or reused. */
|
|
99
103
|
export declare function recordAuthorizationRequested(args: {
|
|
@@ -10,7 +10,6 @@ import type { ImageContent, TextContent } from "@earendil-works/pi-ai";
|
|
|
10
10
|
import type { OAuthClientProvider } from "@modelcontextprotocol/sdk/client/auth.js";
|
|
11
11
|
import { type PluginMcpToolResult, type ToolAnnotations } from "@sentry/junior-plugin-api";
|
|
12
12
|
import type { ConversationPrivacy } from "@/chat/conversation-privacy";
|
|
13
|
-
import type { SkillMetadata } from "@/chat/skills";
|
|
14
13
|
import type { PluginDefinition } from "@/chat/plugins/types";
|
|
15
14
|
import { McpAuthorizationRequiredError } from "./client";
|
|
16
15
|
export interface McpToolSuccessHookInput {
|
|
@@ -50,7 +49,6 @@ export interface ManagedMcpToolDescriptor {
|
|
|
50
49
|
annotations?: ToolAnnotations;
|
|
51
50
|
provider: string;
|
|
52
51
|
}
|
|
53
|
-
type ActiveMcpSkill = Pick<SkillMetadata, "name" | "pluginProvider">;
|
|
54
52
|
export interface ManagedMcpTool extends ManagedMcpToolDescriptor {
|
|
55
53
|
execute: (args: Record<string, unknown>, options?: {
|
|
56
54
|
conversationPrivacy?: ConversationPrivacy;
|
|
@@ -73,7 +71,6 @@ export declare class McpToolManager {
|
|
|
73
71
|
description: string;
|
|
74
72
|
active: boolean;
|
|
75
73
|
}>;
|
|
76
|
-
activateForSkill(skill: ActiveMcpSkill): Promise<boolean>;
|
|
77
74
|
activateProvider(provider: string): Promise<boolean>;
|
|
78
75
|
close(): Promise<void>;
|
|
79
76
|
/** Return descriptors for all active MCP provider tools, optionally filtered by provider. */
|
|
@@ -96,4 +93,3 @@ export declare class McpToolManager {
|
|
|
96
93
|
}): Promise<PluginMcpToolResult>;
|
|
97
94
|
private toToolDescriptor;
|
|
98
95
|
}
|
|
99
|
-
export {};
|
|
@@ -8,11 +8,15 @@ import type { AgentTurnUsage } from "@/chat/usage";
|
|
|
8
8
|
* the session record's optimistic-concurrency version. `awaiting_auth` means
|
|
9
9
|
* the run parked for user authorization.
|
|
10
10
|
*/
|
|
11
|
+
/** Why a run parked at a safe boundary and may continue. */
|
|
12
|
+
export type AgentSuspensionReason = "timeout" | "yield" | "retry";
|
|
11
13
|
export type AgentRunOutcome = {
|
|
12
14
|
status: "completed";
|
|
13
15
|
result: AgentRunResult;
|
|
14
16
|
} | {
|
|
15
17
|
status: "suspended";
|
|
18
|
+
/** Why this slice stopped. Callers use this to choose wake vs yield. */
|
|
19
|
+
reason: AgentSuspensionReason;
|
|
16
20
|
resumeVersion: number;
|
|
17
21
|
usage?: AgentTurnUsage;
|
|
18
22
|
} | {
|
|
@@ -9,7 +9,7 @@ export declare function createSearchConversationEventsTool(context: ToolRuntimeC
|
|
|
9
9
|
after_seq?: number | null | undefined;
|
|
10
10
|
before_seq?: number | null | undefined;
|
|
11
11
|
limit?: number | null | undefined;
|
|
12
|
-
types?: ("message" | "message_handled" | "assistant_message" | "turn_routed" | "guardian_action_reviewed" | "turn_context" | "structured_event" | "compaction" | "handoff" | "user_message" | "tool_result" | "mcp_provider_connected" | "authorization_requested" | "authorization_completed" | "tool_execution_started" | "message_updated" | "messages_summarized" | "turn_started" | "turn_completed" | "turn_failed" | "subagent_started" | "subagent_ended")[] | null | undefined;
|
|
12
|
+
types?: ("message" | "message_handled" | "assistant_message" | "turn_routed" | "guardian_action_reviewed" | "turn_context" | "structured_event" | "compaction" | "handoff" | "user_message" | "tool_result" | "mcp_provider_connected" | "mcp_provider_connected_unowned" | "authorization_requested" | "authorization_completed" | "tool_execution_started" | "message_updated" | "messages_summarized" | "turn_started" | "turn_completed" | "turn_failed" | "subagent_started" | "subagent_ended")[] | null | undefined;
|
|
13
13
|
};
|
|
14
14
|
execute?: ((input: unknown, options: import("./definition").ToolExecuteOptions) => {
|
|
15
15
|
[x: string]: unknown;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { ManagedMcpTool } from "@/chat/mcp/tool-manager";
|
|
2
2
|
interface CallMcpToolManager {
|
|
3
|
-
activateProvider(provider: string): Promise<boolean>;
|
|
4
3
|
getResolvedActiveTools(): ManagedMcpTool[];
|
|
5
4
|
}
|
|
6
5
|
/** Create the stable dispatcher for active MCP provider tools. */
|
|
@@ -7,13 +7,10 @@ export type LoadSkillResult = {
|
|
|
7
7
|
location?: string;
|
|
8
8
|
path_resolution?: string;
|
|
9
9
|
instructions?: string;
|
|
10
|
-
mcp_provider?: string;
|
|
11
|
-
available_tool_count?: number;
|
|
12
10
|
} & Record<string, unknown>;
|
|
13
|
-
|
|
14
|
-
/** Create the skill-loading tool that injects skill instructions and activates provider catalogs. */
|
|
11
|
+
/** Create the tool that loads skill instructions for the current turn. */
|
|
15
12
|
export declare function createLoadSkillTool(availableSkills: SkillMetadata[], options?: {
|
|
16
|
-
onSkillLoaded?: (skill: Skill) => void |
|
|
13
|
+
onSkillLoaded?: (skill: Skill) => void | Promise<void>;
|
|
17
14
|
}): Omit<import("../definition").AnyToolDefinition, "inputSchema" | "outputSchema" | "prepareArguments" | "execute"> & {
|
|
18
15
|
inputSchema: import("../definition").JsonSchemaObject;
|
|
19
16
|
outputSchema: import("../definition").JsonSchemaObject;
|
|
@@ -4,7 +4,6 @@ import type { McpToolManager } from "@/chat/mcp/tool-manager";
|
|
|
4
4
|
import type { SandboxWorkspace } from "@/chat/sandbox/workspace";
|
|
5
5
|
import type { AgentTurnSurface } from "@/chat/task-execution/checkpoint";
|
|
6
6
|
import type { Skill } from "@/chat/skills";
|
|
7
|
-
import type { LoadSkillMetadata } from "@/chat/tools/skill/load-skill";
|
|
8
7
|
import type { JuniorToolOutput } from "@/chat/tool-support/structured-result";
|
|
9
8
|
import type { WebActor, LocalActor, Actor, SlackActor } from "@/chat/actor";
|
|
10
9
|
import type { SlackActionToken } from "@/chat/slack/action-token";
|
|
@@ -44,7 +43,7 @@ export interface ToolHooks {
|
|
|
44
43
|
* generating tool reports success.
|
|
45
44
|
*/
|
|
46
45
|
writeGeneratedArtifacts?: (files: FileUpload[]) => GeneratedArtifactFileRef[] | Promise<GeneratedArtifactFileRef[]>;
|
|
47
|
-
onSkillLoaded?: (skill: Skill) => void |
|
|
46
|
+
onSkillLoaded?: (skill: Skill) => void | Promise<void>;
|
|
48
47
|
toolOverrides?: {
|
|
49
48
|
imageGenerate?: ImageGenerateToolDeps;
|
|
50
49
|
viewImage?: ViewImageToolDeps;
|