@sentry/junior 0.183.0 → 0.185.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-SNRBZYAU.js → agent-hooks-NGZQLL5O.js} +13 -11
- package/dist/api/acp/auth.d.ts +46 -0
- package/dist/api/acp/authorization-page.d.ts +11 -0
- package/dist/api/acp/conversations.d.ts +70 -0
- package/dist/api/acp/errors.d.ts +6 -0
- package/dist/api/acp/route.d.ts +16 -0
- package/dist/api/acp/schema.d.ts +115 -0
- package/dist/api/acp/sleep.d.ts +2 -0
- package/dist/api/acp/state.d.ts +22 -0
- package/dist/api/acp/transport.d.ts +113 -0
- package/dist/api/code/overview.d.ts +39 -0
- package/dist/api/locations/detail.d.ts +1 -1
- package/dist/api/people/code.d.ts +22 -0
- package/dist/api/schema/code.d.ts +46 -0
- package/dist/api/schema/conversation.d.ts +100 -20
- package/dist/api/schema/location.d.ts +1 -1
- package/dist/api/schema/person.d.ts +1 -1
- package/dist/api/schema.d.ts +4 -4
- package/dist/api/schema.js +12 -1
- package/dist/api.js +358 -76
- package/dist/app.d.ts +0 -4
- package/dist/app.js +2450 -493
- package/dist/{catalog-runtime-3I3JOIIH.js → catalog-runtime-AAEAO2RL.js} +4 -4
- package/dist/chat/api-turns/accepted-reply.d.ts +11 -0
- package/dist/chat/api-turns/cancellation.d.ts +3 -5
- package/dist/chat/api-turns/work.d.ts +4 -9
- package/dist/chat/app/conversation-work.d.ts +1 -1
- package/dist/chat/app/factory.d.ts +4 -0
- package/dist/chat/app/services.d.ts +4 -3
- package/dist/chat/conversations/history.d.ts +83 -9
- package/dist/chat/conversations/turn-lifecycle.d.ts +4 -3
- package/dist/chat/providers/slack/input.d.ts +32 -0
- package/dist/chat/{runtime → providers/slack}/processing-reaction.d.ts +6 -8
- package/dist/chat/{runtime/slack-resume.d.ts → providers/slack/resume.d.ts} +16 -19
- package/dist/chat/providers/slack/runtime.d.ts +1 -10
- package/dist/chat/providers/slack/turn.d.ts +11 -24
- package/dist/chat/resource-events/store.d.ts +1 -1
- package/dist/chat/resource-events/tool-support.d.ts +0 -5
- package/dist/chat/runtime/turn-execution.d.ts +7 -2
- package/dist/chat/sandbox/egress/credentials.d.ts +3 -3
- package/dist/chat/sandbox/egress/session.d.ts +5 -6
- package/dist/chat/scheduled-tasks/tool-support.d.ts +5 -5
- package/dist/chat/scheduled-tasks/tools/create.d.ts +2 -2
- package/dist/chat/scheduled-tasks/tools/delete.d.ts +2 -2
- package/dist/chat/scheduled-tasks/tools/list.d.ts +2 -2
- package/dist/chat/scheduled-tasks/tools/run-now.d.ts +2 -2
- package/dist/chat/scheduled-tasks/tools/update.d.ts +2 -2
- package/dist/chat/scheduled-tasks/types.d.ts +1 -1
- package/dist/chat/services/provider-retry.d.ts +2 -0
- package/dist/chat/services/turn-failure-response.d.ts +4 -0
- package/dist/chat/task-execution/paused-turn.d.ts +0 -2
- package/dist/chat/task-execution/state.d.ts +2 -2
- package/dist/chat/task-execution/store.d.ts +1 -1
- package/dist/chat/task-execution/turn-wake.d.ts +12 -0
- package/dist/chat/tool-support/action-review.d.ts +1 -1
- package/dist/chat/tools/resource-events.d.ts +1 -1
- package/dist/chat/tools/search-conversation-events.d.ts +1 -1
- package/dist/chat/tools/types.d.ts +1 -1
- package/dist/chat/tools/watch-resource-events.d.ts +2 -2
- package/dist/{chunk-2EPYYVJC.js → chunk-4HA36IWS.js} +9 -94
- package/dist/{chunk-WVIA7V3M.js → chunk-4K25ODAO.js} +27 -1
- package/dist/{chunk-V64JCZUV.js → chunk-4S47VHJR.js} +3 -3
- package/dist/{chunk-QZV76CM4.js → chunk-6DOAUXLD.js} +231 -198
- package/dist/{chunk-M3QYTBQ6.js → chunk-6Q7YZLCL.js} +2 -1
- package/dist/{chunk-W46NIB5H.js → chunk-7GAP2XG4.js} +2 -3
- package/dist/{chunk-EENQGEIP.js → chunk-7MHNIGHP.js} +1 -1
- package/dist/{chunk-AX3UDIMA.js → chunk-ABAX75GG.js} +10 -384
- package/dist/{chunk-KTXOGLNE.js → chunk-ATUWN6Z3.js} +2 -2
- package/dist/{chunk-3HJ4F4L7.js → chunk-C6TS47CQ.js} +4 -4
- package/dist/chunk-D4YV5TDV.js +45 -0
- package/dist/{chunk-HUK5XIZL.js → chunk-D63IUQQE.js} +4 -4
- package/dist/{chunk-WOKJRLM2.js → chunk-DAPC2HTM.js} +24 -6
- package/dist/{chunk-2ADFGSUS.js → chunk-EIJCPJOY.js} +1 -1
- package/dist/{chunk-X52ESOBP.js → chunk-EJYP3NQ4.js} +4 -4
- package/dist/{chunk-35PM4YY5.js → chunk-EWEH2PJW.js} +6 -6
- package/dist/{chunk-W5JMPEBO.js → chunk-FFHXG2FX.js} +13 -11
- package/dist/{chunk-FJMTMGBC.js → chunk-FTVMXDNN.js} +1 -1
- package/dist/chunk-GFBR4S3Q.js +406 -0
- package/dist/{chunk-E3OBGRHN.js → chunk-GJTIZQGJ.js} +1 -1
- package/dist/{chunk-IO6KFXYE.js → chunk-HJPC32TQ.js} +12 -50
- package/dist/{chunk-RF6J3DIO.js → chunk-INQHUE72.js} +84 -1
- package/dist/{chunk-LMNMMESF.js → chunk-LRI5IRGY.js} +19 -44
- package/dist/{chunk-6UXDTPEN.js → chunk-LVK4WJKM.js} +1 -1
- package/dist/{chunk-AYW7J6K4.js → chunk-MWOH6CIK.js} +178 -148
- package/dist/{chunk-LZBPGX5A.js → chunk-OMQ2J6F6.js} +1 -1
- package/dist/{chunk-G2B2XZQW.js → chunk-PNYJOEVV.js} +1 -1
- package/dist/{chunk-37IQ6DGU.js → chunk-QCT4226Q.js} +3 -3
- package/dist/{chunk-R767Y7QV.js → chunk-QZKHHG3B.js} +34 -8
- package/dist/{chunk-VOV3SCM3.js → chunk-TVVAMOLS.js} +2 -2
- package/dist/{chunk-56XONJPF.js → chunk-U4CTAVWN.js} +1 -1
- package/dist/{chunk-4WGFWHWP.js → chunk-UUULGCKK.js} +1 -1
- package/dist/{chunk-AHMWPFIW.js → chunk-VH4IU3UC.js} +928 -984
- package/dist/chunk-W7GCLNIV.js +58 -0
- package/dist/{chunk-24OJZ5OU.js → chunk-WLKWN4CD.js} +22 -12
- package/dist/{chunk-T5MTGX2E.js → chunk-X2SS6BF7.js} +201 -210
- package/dist/{chunk-SQHFVIMZ.js → chunk-X7NCJQAA.js} +1 -1
- package/dist/{chunk-PLZT45VC.js → chunk-Y5G23T2D.js} +5 -5
- package/dist/{chunk-3L7CWDQQ.js → chunk-ZIF2S464.js} +1 -1
- package/dist/{chunk-QI5JW5AG.js → chunk-ZKKGFUWM.js} +6 -6
- package/dist/cli/chat.js +35 -33
- package/dist/cli/check.js +5 -5
- package/dist/cli/plugins.js +14 -12
- package/dist/cli/snapshot-create.js +10 -9
- package/dist/cli/upgrade.js +7 -6
- package/dist/{db-K2VMNLHQ.js → db-TRJ77FAU.js} +8 -6
- package/dist/instrumentation.js +3 -3
- package/dist/nitro.js +7 -6
- package/dist/{oauth-callback-server-DZZMTKSS.js → oauth-callback-server-XD5SV3MS.js} +30 -27
- package/dist/{runner-IIAKWDXI.js → runner-KFX7NG6D.js} +24 -19
- package/dist/{skills-EXIQ7BP5.js → skills-J2AH26CW.js} +5 -5
- package/dist/spawn-VU3CSRI6.js +41 -0
- package/dist/task-runner-5JG3VIIY.js +34 -0
- package/dist/{validation-XUGIWBJF.js → validation-O5J4VOPF.js} +5 -5
- package/dist/version.js +1 -1
- package/dist/{work-G4RLJ634.js → work-ECPQTG3U.js} +24 -19
- package/dist/worker-RS3DXUDO.js +24 -0
- package/package.json +5 -6
- package/dist/app-adapter.d.ts +0 -85
- package/dist/chat/api-turns/adapter-conversations.d.ts +0 -15
- package/dist/spawn-ZR6OOEAN.js +0 -37
- package/dist/task-runner-C52HYCVD.js +0 -32
- package/dist/worker-R2JEHK67.js +0 -22
|
@@ -51,9 +51,9 @@ export declare function authorizationForSandboxEgressGrant(provider: string, sel
|
|
|
51
51
|
/**
|
|
52
52
|
* Return cached or newly issued credential header transforms for a selected grant.
|
|
53
53
|
*
|
|
54
|
-
* Leases are cached
|
|
55
|
-
* domains, and reused
|
|
56
|
-
*
|
|
54
|
+
* Leases are cached on the host by provider grant, validated against
|
|
55
|
+
* provider-owned domains, and reused until the provider lease is near expiry.
|
|
56
|
+
* Sandbox context only authorizes the hop.
|
|
57
57
|
*/
|
|
58
58
|
export declare function sandboxEgressCredentialLease(provider: string, selection: SandboxEgressGrantSelection, context: SandboxEgressCredentialContext): Promise<SandboxEgressCredentialLease>;
|
|
59
59
|
/** Return whether a credential lease can modify requests to the target host. */
|
|
@@ -22,15 +22,14 @@ export declare function createSandboxEgressCredentialToken(input: {
|
|
|
22
22
|
*/
|
|
23
23
|
export declare function parseSandboxEgressCredentialToken(token: string | undefined): SandboxEgressCredentialContext | undefined;
|
|
24
24
|
/**
|
|
25
|
-
* Cache credential header transforms for one
|
|
25
|
+
* Cache credential header transforms for one provider grant.
|
|
26
26
|
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
27
|
+
* TTL follows the provider lease expiry. Sandbox context expiry still decides
|
|
28
|
+
* whether a hop may use the cache; it does not shorten a shared installation
|
|
29
|
+
* lease for other sandboxes.
|
|
29
30
|
*/
|
|
30
31
|
export declare function setSandboxEgressCredentialLease(context: SandboxEgressCredentialContext, lease: SandboxEgressCredentialLease): Promise<void>;
|
|
31
|
-
/**
|
|
32
|
-
* Load cached credential header transforms for the exact actor/context/grant.
|
|
33
|
-
*/
|
|
32
|
+
/** Load cached credential header transforms for one provider grant. */
|
|
34
33
|
export declare function getSandboxEgressCredentialLease(provider: string, grant: SandboxEgressCredentialLease["grant"], context: SandboxEgressCredentialContext): Promise<SandboxEgressCredentialLease | undefined>;
|
|
35
34
|
/** Clear a cached lease after the upstream provider rejects its auth headers. */
|
|
36
35
|
export declare function clearSandboxEgressCredentialLease(provider: string, grant: SandboxEgressCredentialLease["grant"], context: SandboxEgressCredentialContext): Promise<void>;
|
|
@@ -34,8 +34,8 @@ declare const compactTaskResultSchema: z.ZodObject<{
|
|
|
34
34
|
}, z.core.$strict>;
|
|
35
35
|
conversation_access: z.ZodObject<{
|
|
36
36
|
audience: z.ZodEnum<{
|
|
37
|
-
channel: "channel";
|
|
38
37
|
direct: "direct";
|
|
38
|
+
channel: "channel";
|
|
39
39
|
group: "group";
|
|
40
40
|
}>;
|
|
41
41
|
visibility: z.ZodEnum<{
|
|
@@ -79,8 +79,8 @@ export declare const scheduleTaskToolResultSchema: z.ZodObject<{
|
|
|
79
79
|
}, z.core.$strict>;
|
|
80
80
|
conversation_access: z.ZodObject<{
|
|
81
81
|
audience: z.ZodEnum<{
|
|
82
|
-
channel: "channel";
|
|
83
82
|
direct: "direct";
|
|
83
|
+
channel: "channel";
|
|
84
84
|
group: "group";
|
|
85
85
|
}>;
|
|
86
86
|
visibility: z.ZodEnum<{
|
|
@@ -124,8 +124,8 @@ export declare const scheduleListToolResultSchema: z.ZodObject<{
|
|
|
124
124
|
}, z.core.$strict>;
|
|
125
125
|
conversation_access: z.ZodObject<{
|
|
126
126
|
audience: z.ZodEnum<{
|
|
127
|
-
channel: "channel";
|
|
128
127
|
direct: "direct";
|
|
128
|
+
channel: "channel";
|
|
129
129
|
group: "group";
|
|
130
130
|
}>;
|
|
131
131
|
visibility: z.ZodEnum<{
|
|
@@ -178,7 +178,7 @@ export declare function scheduleTaskToolResult(target: string, task: CompactTask
|
|
|
178
178
|
channel_id: string;
|
|
179
179
|
};
|
|
180
180
|
conversation_access: {
|
|
181
|
-
audience: "
|
|
181
|
+
audience: "direct" | "channel" | "group";
|
|
182
182
|
visibility: "private" | "public";
|
|
183
183
|
};
|
|
184
184
|
credential_mode: "system" | "creator";
|
|
@@ -208,7 +208,7 @@ export declare function scheduleListToolResult(args: {
|
|
|
208
208
|
channel_id: string;
|
|
209
209
|
};
|
|
210
210
|
conversation_access: {
|
|
211
|
-
audience: "
|
|
211
|
+
audience: "direct" | "channel" | "group";
|
|
212
212
|
visibility: "private" | "public";
|
|
213
213
|
};
|
|
214
214
|
credential_mode: "system" | "creator";
|
|
@@ -47,7 +47,7 @@ export declare function createSlackScheduleCreateTaskTool(context: SchedulerTool
|
|
|
47
47
|
channel_id: string;
|
|
48
48
|
};
|
|
49
49
|
conversation_access: {
|
|
50
|
-
audience: "
|
|
50
|
+
audience: "direct" | "channel" | "group";
|
|
51
51
|
visibility: "private" | "public";
|
|
52
52
|
};
|
|
53
53
|
credential_mode: "system" | "creator";
|
|
@@ -77,7 +77,7 @@ export declare function createSlackScheduleCreateTaskTool(context: SchedulerTool
|
|
|
77
77
|
channel_id: string;
|
|
78
78
|
};
|
|
79
79
|
conversation_access: {
|
|
80
|
-
audience: "
|
|
80
|
+
audience: "direct" | "channel" | "group";
|
|
81
81
|
visibility: "private" | "public";
|
|
82
82
|
};
|
|
83
83
|
credential_mode: "system" | "creator";
|
|
@@ -22,7 +22,7 @@ export declare function createSlackScheduleDeleteTaskTool(context: SchedulerTool
|
|
|
22
22
|
channel_id: string;
|
|
23
23
|
};
|
|
24
24
|
conversation_access: {
|
|
25
|
-
audience: "
|
|
25
|
+
audience: "direct" | "channel" | "group";
|
|
26
26
|
visibility: "private" | "public";
|
|
27
27
|
};
|
|
28
28
|
credential_mode: "system" | "creator";
|
|
@@ -52,7 +52,7 @@ export declare function createSlackScheduleDeleteTaskTool(context: SchedulerTool
|
|
|
52
52
|
channel_id: string;
|
|
53
53
|
};
|
|
54
54
|
conversation_access: {
|
|
55
|
-
audience: "
|
|
55
|
+
audience: "direct" | "channel" | "group";
|
|
56
56
|
visibility: "private" | "public";
|
|
57
57
|
};
|
|
58
58
|
credential_mode: "system" | "creator";
|
|
@@ -23,7 +23,7 @@ export declare function createSlackScheduleListTasksTool(context: SchedulerToolC
|
|
|
23
23
|
channel_id: string;
|
|
24
24
|
};
|
|
25
25
|
conversation_access: {
|
|
26
|
-
audience: "
|
|
26
|
+
audience: "direct" | "channel" | "group";
|
|
27
27
|
visibility: "private" | "public";
|
|
28
28
|
};
|
|
29
29
|
credential_mode: "system" | "creator";
|
|
@@ -53,7 +53,7 @@ export declare function createSlackScheduleListTasksTool(context: SchedulerToolC
|
|
|
53
53
|
channel_id: string;
|
|
54
54
|
};
|
|
55
55
|
conversation_access: {
|
|
56
|
-
audience: "
|
|
56
|
+
audience: "direct" | "channel" | "group";
|
|
57
57
|
visibility: "private" | "public";
|
|
58
58
|
};
|
|
59
59
|
credential_mode: "system" | "creator";
|
|
@@ -22,7 +22,7 @@ export declare function createSlackScheduleRunTaskNowTool(context: SchedulerTool
|
|
|
22
22
|
channel_id: string;
|
|
23
23
|
};
|
|
24
24
|
conversation_access: {
|
|
25
|
-
audience: "
|
|
25
|
+
audience: "direct" | "channel" | "group";
|
|
26
26
|
visibility: "private" | "public";
|
|
27
27
|
};
|
|
28
28
|
credential_mode: "system" | "creator";
|
|
@@ -52,7 +52,7 @@ export declare function createSlackScheduleRunTaskNowTool(context: SchedulerTool
|
|
|
52
52
|
channel_id: string;
|
|
53
53
|
};
|
|
54
54
|
conversation_access: {
|
|
55
|
-
audience: "
|
|
55
|
+
audience: "direct" | "channel" | "group";
|
|
56
56
|
visibility: "private" | "public";
|
|
57
57
|
};
|
|
58
58
|
credential_mode: "system" | "creator";
|
|
@@ -49,7 +49,7 @@ export declare function createSlackScheduleUpdateTaskTool(context: SchedulerTool
|
|
|
49
49
|
channel_id: string;
|
|
50
50
|
};
|
|
51
51
|
conversation_access: {
|
|
52
|
-
audience: "
|
|
52
|
+
audience: "direct" | "channel" | "group";
|
|
53
53
|
visibility: "private" | "public";
|
|
54
54
|
};
|
|
55
55
|
credential_mode: "system" | "creator";
|
|
@@ -79,7 +79,7 @@ export declare function createSlackScheduleUpdateTaskTool(context: SchedulerTool
|
|
|
79
79
|
channel_id: string;
|
|
80
80
|
};
|
|
81
81
|
conversation_access: {
|
|
82
|
-
audience: "
|
|
82
|
+
audience: "direct" | "channel" | "group";
|
|
83
83
|
visibility: "private" | "public";
|
|
84
84
|
};
|
|
85
85
|
credential_mode: "system" | "creator";
|
|
@@ -25,8 +25,8 @@ export declare const scheduledTaskSchema: z.ZodObject<{
|
|
|
25
25
|
id: z.ZodString;
|
|
26
26
|
conversationAccess: z.ZodObject<{
|
|
27
27
|
audience: z.ZodEnum<{
|
|
28
|
-
channel: "channel";
|
|
29
28
|
direct: "direct";
|
|
29
|
+
channel: "channel";
|
|
30
30
|
group: "group";
|
|
31
31
|
}>;
|
|
32
32
|
visibility: z.ZodEnum<{
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type AssistantMessage } from "@earendil-works/pi-ai";
|
|
2
2
|
import type { PiMessage } from "@/chat/pi/messages";
|
|
3
|
+
import { type ProviderError } from "@/chat/services/provider-error";
|
|
3
4
|
/** Apply Junior's retry budget to a retryable Pi assistant failure. */
|
|
4
5
|
export declare function nextProviderRetry(args: {
|
|
5
6
|
attempt: number;
|
|
@@ -8,4 +9,5 @@ export declare function nextProviderRetry(args: {
|
|
|
8
9
|
}): {
|
|
9
10
|
delayMs: number;
|
|
10
11
|
messages: PiMessage[];
|
|
12
|
+
providerError: ProviderError;
|
|
11
13
|
} | undefined;
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
+
import type { ConversationTurnFailureReason } from "@/chat/conversations/history";
|
|
1
2
|
import type { AgentRunResult } from "@/chat/services/turn-result";
|
|
2
3
|
type LogException = (error: unknown, eventName: string, attributes?: Record<string, unknown>) => string | undefined;
|
|
3
4
|
/** Require captured turn failures to carry a real Sentry event reference. */
|
|
4
5
|
export declare function requireTurnFailureEventId(eventId: string | undefined, eventName: string): string;
|
|
6
|
+
/** Return a fixed reason label for a failed model turn. */
|
|
7
|
+
export declare function getTurnFailureReason(reply: AgentRunResult): ConversationTurnFailureReason | undefined;
|
|
5
8
|
/** Keep failed-turn Sentry captures and completion spans on the same keys. */
|
|
6
9
|
export declare function getAgentTurnDiagnosticsAttributes(reply: AgentRunResult): Record<string, unknown>;
|
|
7
10
|
/** Sanitized failure fallback plus its optional captured event ID. */
|
|
8
11
|
export interface FinalizedTurnFailure {
|
|
9
12
|
eventId?: string;
|
|
13
|
+
failureReason?: ConversationTurnFailureReason;
|
|
10
14
|
reply: AgentRunResult;
|
|
11
15
|
}
|
|
12
16
|
/** Enforce one captured failure response and return its structured correlation. */
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { resumeSlackTurn } from "@/chat/runtime/slack-resume";
|
|
2
1
|
import { type PausedTurnRequest } from "@/chat/task-execution/turn-wake";
|
|
3
2
|
import type { AgentRunner } from "@/chat/runtime/agent-runner";
|
|
4
3
|
import type { AgentRun } from "@/chat/agent/types";
|
|
@@ -8,7 +7,6 @@ export interface PausedTurnOptions {
|
|
|
8
7
|
/** Exact persisted input ids accepted while running the paused turn. */
|
|
9
8
|
inputMessageIds?: readonly string[];
|
|
10
9
|
routingContext?: Pick<AgentRun, "actor" | "credentialContext" | "destinationVisibility" | "dispatch" | "surface">;
|
|
11
|
-
resumeTurn?: typeof resumeSlackTurn;
|
|
12
10
|
wakePausedTurn?: (request: PausedTurnRequest) => Promise<void>;
|
|
13
11
|
scheduleSessionCompletedPluginTasks?: (params: {
|
|
14
12
|
conversationId: string;
|
|
@@ -20,8 +20,8 @@ declare const inboundMessageSourceSchema: z.ZodEnum<{
|
|
|
20
20
|
web: "web";
|
|
21
21
|
plugin: "plugin";
|
|
22
22
|
api: "api";
|
|
23
|
-
internal: "internal";
|
|
24
23
|
scheduler: "scheduler";
|
|
24
|
+
internal: "internal";
|
|
25
25
|
resource_event: "resource_event";
|
|
26
26
|
}>;
|
|
27
27
|
export type Source = z.output<typeof inboundMessageSourceSchema>;
|
|
@@ -74,8 +74,8 @@ export declare const inboundMessageSchema: z.ZodObject<{
|
|
|
74
74
|
web: "web";
|
|
75
75
|
plugin: "plugin";
|
|
76
76
|
api: "api";
|
|
77
|
-
internal: "internal";
|
|
78
77
|
scheduler: "scheduler";
|
|
78
|
+
internal: "internal";
|
|
79
79
|
resource_event: "resource_event";
|
|
80
80
|
}>;
|
|
81
81
|
}, z.core.$strict>;
|
|
@@ -139,7 +139,7 @@ export declare function drainConversationMailbox(args: Parameters<typeof workSta
|
|
|
139
139
|
};
|
|
140
140
|
receivedAtMs: number;
|
|
141
141
|
publishExternally: boolean;
|
|
142
|
-
source: "slack" | "local" | "web" | "plugin" | "api" | "
|
|
142
|
+
source: "slack" | "local" | "web" | "plugin" | "api" | "scheduler" | "internal" | "resource_event";
|
|
143
143
|
attemptCount?: number | undefined;
|
|
144
144
|
destination?: {
|
|
145
145
|
platform: "slack";
|
|
@@ -18,6 +18,14 @@ interface TurnWakeOptions {
|
|
|
18
18
|
queue?: ConversationWorkQueue;
|
|
19
19
|
state?: StateAdapter;
|
|
20
20
|
}
|
|
21
|
+
/** Look up and wake paused Turns without exposing queue or storage details. */
|
|
22
|
+
export interface PausedTurns {
|
|
23
|
+
get(args: {
|
|
24
|
+
conversationId: string;
|
|
25
|
+
turnId: string;
|
|
26
|
+
}): Promise<PausedTurnRequest | undefined>;
|
|
27
|
+
wake(request: PausedTurnRequest): Promise<void>;
|
|
28
|
+
}
|
|
21
29
|
/** Build the worker input for a paused turn. */
|
|
22
30
|
export declare function getPausedTurnRequest(args: {
|
|
23
31
|
conversationId: string;
|
|
@@ -26,4 +34,8 @@ export declare function getPausedTurnRequest(args: {
|
|
|
26
34
|
}): Promise<PausedTurnRequest | undefined>;
|
|
27
35
|
/** Wake the conversation worker for a paused turn. */
|
|
28
36
|
export declare function wakePausedTurn(request: PausedTurnRequest, options?: TurnWakeOptions): Promise<void>;
|
|
37
|
+
/** Create paused Turn operations for one app. */
|
|
38
|
+
export declare function createPausedTurns(options?: TurnWakeOptions & {
|
|
39
|
+
conversationStore?: ConversationStore;
|
|
40
|
+
}): PausedTurns;
|
|
29
41
|
export {};
|
|
@@ -88,7 +88,7 @@ export interface ToolActionReviewer {
|
|
|
88
88
|
/** Core-owned context used to prepare one exact action for Guardian. */
|
|
89
89
|
export interface ToolActionReviewContext {
|
|
90
90
|
actor?: Actor;
|
|
91
|
-
conversationId
|
|
91
|
+
conversationId: string;
|
|
92
92
|
credentialContext?: CredentialContext;
|
|
93
93
|
destination: Destination;
|
|
94
94
|
source: Source;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ResourceEventCatalog } from "@/chat/resource-events/catalog";
|
|
2
2
|
import type { ToolRegistry } from "@/chat/tools/definition";
|
|
3
3
|
import type { ToolRuntimeContext } from "@/chat/tools/types";
|
|
4
|
-
/** Build the complete resource-watch tool set
|
|
4
|
+
/** Build the complete resource-watch tool set for this runtime context. */
|
|
5
5
|
export declare function createResourceEventTools(context: ToolRuntimeContext, catalog: ResourceEventCatalog): ToolRegistry;
|
|
@@ -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" | "
|
|
12
|
+
types?: ("message" | "handoff" | "user_message" | "assistant_message" | "tool_result" | "compaction" | "mcp_provider_connected" | "mcp_provider_connected_unowned" | "authorization_requested" | "authorization_completed" | "tool_execution_started" | "guardian_action_reviewed" | "message_updated" | "message_handled" | "messages_summarized" | "turn_started" | "turn_routed" | "turn_context" | "structured_event" | "attachments_delivered" | "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;
|
|
@@ -63,7 +63,7 @@ interface BaseToolRuntimeContext {
|
|
|
63
63
|
* Scheduled/web turns use an internal id such as `agent-dispatch:{id}`.
|
|
64
64
|
* Do not parse as Slack unless the value starts with `slack:`.
|
|
65
65
|
*/
|
|
66
|
-
conversationId
|
|
66
|
+
conversationId: string;
|
|
67
67
|
/** Location associated with this Conversation. */
|
|
68
68
|
locationId?: string;
|
|
69
69
|
/** Runtime-owned default outbound destination for this invocation. */
|
|
@@ -16,7 +16,7 @@ export declare function createWatchResourceEventsTool(context: ToolRuntimeContex
|
|
|
16
16
|
};
|
|
17
17
|
execute?: ((input: unknown, options: import("./definition").ToolExecuteOptions) => {
|
|
18
18
|
id: string;
|
|
19
|
-
subscription_status: "completed" | "
|
|
19
|
+
subscription_status: "completed" | "cancelled" | "active";
|
|
20
20
|
identifier: string;
|
|
21
21
|
events: string[];
|
|
22
22
|
expiresAtMs: number;
|
|
@@ -39,7 +39,7 @@ export declare function createWatchResourceEventsTool(context: ToolRuntimeContex
|
|
|
39
39
|
match?: Record<string, unknown> | undefined;
|
|
40
40
|
} | Promise<{
|
|
41
41
|
id: string;
|
|
42
|
-
subscription_status: "completed" | "
|
|
42
|
+
subscription_status: "completed" | "cancelled" | "active";
|
|
43
43
|
identifier: string;
|
|
44
44
|
events: string[];
|
|
45
45
|
expiresAtMs: number;
|
|
@@ -1,38 +1,32 @@
|
|
|
1
|
-
import {
|
|
2
|
-
isAgentRunFeatureDisabled
|
|
3
|
-
} from "./chunk-RF6J3DIO.js";
|
|
4
1
|
import {
|
|
5
2
|
resolveBaseUrl
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import {
|
|
8
|
-
isExperimentalFeatureEnabled
|
|
9
|
-
} from "./chunk-2LYHWMR4.js";
|
|
3
|
+
} from "./chunk-ZKKGFUWM.js";
|
|
10
4
|
import {
|
|
11
5
|
createPluginLogger,
|
|
12
6
|
getPlugins,
|
|
13
7
|
getSlackClient,
|
|
14
8
|
withSlackRetries
|
|
15
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-VH4IU3UC.js";
|
|
16
10
|
import {
|
|
17
11
|
getDb,
|
|
18
12
|
parseDestination
|
|
19
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-ABAX75GG.js";
|
|
20
14
|
import {
|
|
21
15
|
sleep
|
|
22
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-EJYP3NQ4.js";
|
|
23
17
|
import {
|
|
24
18
|
acquireActiveLock,
|
|
25
19
|
getStateAdapter
|
|
26
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-PNYJOEVV.js";
|
|
27
21
|
import {
|
|
28
22
|
pluginCatalogRuntime
|
|
29
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-GJTIZQGJ.js";
|
|
30
24
|
import {
|
|
31
25
|
fetchWithBoundedOAuthErrorBodies
|
|
32
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-7MHNIGHP.js";
|
|
33
27
|
import {
|
|
34
28
|
isRecord
|
|
35
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-OMQ2J6F6.js";
|
|
36
30
|
|
|
37
31
|
// src/chat/capabilities/router.ts
|
|
38
32
|
var ProviderCredentialRouter = class {
|
|
@@ -144,83 +138,6 @@ async function issueProviderCredentialLease(input) {
|
|
|
144
138
|
return await getSandboxEgressRouter().issue(input);
|
|
145
139
|
}
|
|
146
140
|
|
|
147
|
-
// src/chat/runtime/agent-runner.ts
|
|
148
|
-
var AGENT_ABORT_SETTLE_GRACE_MS = 5e3;
|
|
149
|
-
function createAgentRunner(execute, options) {
|
|
150
|
-
const attachmentStorage = options?.attachmentStorage;
|
|
151
|
-
const streamFn = options?.streamFn;
|
|
152
|
-
const tracePropagation = options?.tracePropagation;
|
|
153
|
-
const bindSpawnAgent = options?.bindSpawnAgent;
|
|
154
|
-
const canBindSpawn = Boolean(bindSpawnAgent) && isExperimentalFeatureEnabled("subagents");
|
|
155
|
-
return {
|
|
156
|
-
run: async (run) => {
|
|
157
|
-
const spawnAgent = bindSpawnAgent && canBindSpawn && !isAgentRunFeatureDisabled(run.disabledFeatures, "subagents") ? bindSpawnAgent(run) : void 0;
|
|
158
|
-
const nextRun = {
|
|
159
|
-
...run,
|
|
160
|
-
environment: {
|
|
161
|
-
...run.environment,
|
|
162
|
-
attachmentStorage: run.environment?.attachmentStorage ?? attachmentStorage,
|
|
163
|
-
sandboxTracePropagation: run.environment?.sandboxTracePropagation ?? tracePropagation
|
|
164
|
-
},
|
|
165
|
-
...spawnAgent ? {
|
|
166
|
-
durability: {
|
|
167
|
-
...run.durability,
|
|
168
|
-
spawnAgent
|
|
169
|
-
}
|
|
170
|
-
} : void 0
|
|
171
|
-
};
|
|
172
|
-
return await execute(nextRun, streamFn);
|
|
173
|
-
}
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
async function waitForAgentSettlement(runPromise) {
|
|
177
|
-
let timeoutId;
|
|
178
|
-
const settleGrace = new Promise((resolve) => {
|
|
179
|
-
timeoutId = setTimeout(resolve, AGENT_ABORT_SETTLE_GRACE_MS);
|
|
180
|
-
timeoutId.unref?.();
|
|
181
|
-
});
|
|
182
|
-
await Promise.race([
|
|
183
|
-
runPromise.then(
|
|
184
|
-
() => void 0,
|
|
185
|
-
() => void 0
|
|
186
|
-
),
|
|
187
|
-
settleGrace
|
|
188
|
-
]);
|
|
189
|
-
if (timeoutId) {
|
|
190
|
-
clearTimeout(timeoutId);
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
async function runAgentWithTimeout(agentRunner, run, timeoutMs) {
|
|
194
|
-
if (typeof timeoutMs !== "number") {
|
|
195
|
-
return await agentRunner.run(run);
|
|
196
|
-
}
|
|
197
|
-
const timeoutError = new Error(
|
|
198
|
-
`executeAgentRun timed out after ${timeoutMs}ms`
|
|
199
|
-
);
|
|
200
|
-
const abortController = new AbortController();
|
|
201
|
-
const signal = run.signal ? AbortSignal.any([run.signal, abortController.signal]) : abortController.signal;
|
|
202
|
-
const runPromise = agentRunner.run({ ...run, signal });
|
|
203
|
-
let timeoutId;
|
|
204
|
-
const timeoutPromise = new Promise((_, reject) => {
|
|
205
|
-
timeoutId = setTimeout(() => {
|
|
206
|
-
abortController.abort(timeoutError);
|
|
207
|
-
reject(timeoutError);
|
|
208
|
-
}, timeoutMs);
|
|
209
|
-
});
|
|
210
|
-
try {
|
|
211
|
-
return await Promise.race([runPromise, timeoutPromise]);
|
|
212
|
-
} catch (error) {
|
|
213
|
-
if (abortController.signal.aborted) {
|
|
214
|
-
await waitForAgentSettlement(runPromise);
|
|
215
|
-
}
|
|
216
|
-
throw error;
|
|
217
|
-
} finally {
|
|
218
|
-
if (timeoutId) {
|
|
219
|
-
clearTimeout(timeoutId);
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
|
|
224
141
|
// src/chat/mcp/errors.ts
|
|
225
142
|
var McpProviderError = class extends Error {
|
|
226
143
|
phase;
|
|
@@ -1241,7 +1158,5 @@ export {
|
|
|
1241
1158
|
deleteMcpStoredOAuthCredentials,
|
|
1242
1159
|
deleteMcpServerSessionId,
|
|
1243
1160
|
createMcpOAuthClientProvider,
|
|
1244
|
-
finalizeMcpAuthorization
|
|
1245
|
-
createAgentRunner,
|
|
1246
|
-
runAgentWithTimeout
|
|
1161
|
+
finalizeMcpAuthorization
|
|
1247
1162
|
};
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
usageSchema
|
|
3
3
|
} from "./chunk-PDO5BLNM.js";
|
|
4
|
+
import {
|
|
5
|
+
conversationTurnFailureCodeSchema,
|
|
6
|
+
conversationTurnFailureReasonSchema
|
|
7
|
+
} from "./chunk-GFBR4S3Q.js";
|
|
4
8
|
import {
|
|
5
9
|
juniorDestinationKindSchema
|
|
6
10
|
} from "./chunk-VFUK3X5B.js";
|
|
@@ -42,16 +46,27 @@ import { z as z2 } from "zod";
|
|
|
42
46
|
import { codeChangeStateSchema } from "@sentry/junior-plugin-api";
|
|
43
47
|
var codeChangeSummarySchema = z2.object({
|
|
44
48
|
closed: z2.number().int().nonnegative(),
|
|
49
|
+
costUsd: z2.number().nonnegative().optional(),
|
|
45
50
|
created: z2.number().int().nonnegative(),
|
|
51
|
+
medianCostUsd: z2.number().nonnegative().optional(),
|
|
52
|
+
medianMergeTimeMs: z2.number().nonnegative().optional(),
|
|
46
53
|
merged: z2.number().int().nonnegative(),
|
|
47
54
|
mergeRate: z2.number().min(0).max(1).optional(),
|
|
48
55
|
open: z2.number().int().nonnegative()
|
|
49
56
|
}).strict();
|
|
57
|
+
var codeActivityDaySchema = z2.object({
|
|
58
|
+
closed: z2.number().int().nonnegative(),
|
|
59
|
+
created: z2.number().int().nonnegative(),
|
|
60
|
+
date: z2.string().date(),
|
|
61
|
+
merged: z2.number().int().nonnegative()
|
|
62
|
+
}).strict();
|
|
50
63
|
var codeRepositorySummarySchema = z2.object({
|
|
51
64
|
closed: z2.number().int().nonnegative(),
|
|
52
65
|
created: z2.number().int().nonnegative(),
|
|
53
66
|
id: z2.string().uuid(),
|
|
67
|
+
medianCostUsd: z2.number().nonnegative().optional(),
|
|
54
68
|
merged: z2.number().int().nonnegative(),
|
|
69
|
+
mergeRate: z2.number().min(0).max(1).optional(),
|
|
55
70
|
name: z2.string().min(1),
|
|
56
71
|
open: z2.number().int().nonnegative(),
|
|
57
72
|
provider: z2.string().min(1),
|
|
@@ -70,6 +85,7 @@ var codeChangeSummaryReportSchema = z2.object({
|
|
|
70
85
|
url: z2.string().url().optional()
|
|
71
86
|
}).strict();
|
|
72
87
|
var codeOverviewReportSchema = z2.object({
|
|
88
|
+
activityDays: z2.array(codeActivityDaySchema),
|
|
73
89
|
changes: z2.array(codeChangeSummaryReportSchema),
|
|
74
90
|
generatedAt: z2.string(),
|
|
75
91
|
repositories: z2.array(codeRepositorySummarySchema),
|
|
@@ -77,6 +93,13 @@ var codeOverviewReportSchema = z2.object({
|
|
|
77
93
|
windowEnd: z2.string(),
|
|
78
94
|
windowStart: z2.string()
|
|
79
95
|
}).strict();
|
|
96
|
+
var codePersonReportSchema = z2.object({
|
|
97
|
+
activityDays: z2.array(codeActivityDaySchema),
|
|
98
|
+
generatedAt: z2.string(),
|
|
99
|
+
summary: codeChangeSummarySchema,
|
|
100
|
+
windowEnd: z2.string(),
|
|
101
|
+
windowStart: z2.string()
|
|
102
|
+
}).strict();
|
|
80
103
|
|
|
81
104
|
// src/api/schema/conversation.ts
|
|
82
105
|
import { z as z3 } from "zod";
|
|
@@ -381,7 +404,8 @@ var conversationReportTurnLifecycleEventDataSchema = z3.discriminatedUnion(
|
|
|
381
404
|
type: z3.literal("turn_lifecycle"),
|
|
382
405
|
turnId: z3.string().min(1),
|
|
383
406
|
state: z3.literal("failed"),
|
|
384
|
-
|
|
407
|
+
failureCode: conversationTurnFailureCodeSchema,
|
|
408
|
+
failureReason: conversationTurnFailureReasonSchema.optional()
|
|
385
409
|
}).strict()
|
|
386
410
|
]
|
|
387
411
|
);
|
|
@@ -933,9 +957,11 @@ export {
|
|
|
933
957
|
conversationFeedSchema,
|
|
934
958
|
conversationStatsReportSchema,
|
|
935
959
|
codeChangeSummarySchema,
|
|
960
|
+
codeActivityDaySchema,
|
|
936
961
|
codeRepositorySummarySchema,
|
|
937
962
|
codeChangeSummaryReportSchema,
|
|
938
963
|
codeOverviewReportSchema,
|
|
964
|
+
codePersonReportSchema,
|
|
939
965
|
dailyConversationActivitySchema,
|
|
940
966
|
activityDays,
|
|
941
967
|
locationParamsSchema,
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
} from "./chunk-7H2VZTWN.js";
|
|
7
7
|
import {
|
|
8
8
|
runWithTurnRequestDeadline
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-FTVMXDNN.js";
|
|
10
10
|
import {
|
|
11
11
|
logWarn
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-OMQ2J6F6.js";
|
|
13
13
|
|
|
14
14
|
// src/chat/plugins/task-queue.ts
|
|
15
15
|
import { createHash } from "crypto";
|
|
@@ -129,7 +129,7 @@ function pluginTaskCallback() {
|
|
|
129
129
|
onRejected: logPluginTaskQueueMessageRejected,
|
|
130
130
|
// Load the runner on first use so this module can send without a cycle.
|
|
131
131
|
run: async (message) => {
|
|
132
|
-
const { processPluginTask } = await import("./task-runner-
|
|
132
|
+
const { processPluginTask } = await import("./task-runner-5JG3VIIY.js");
|
|
133
133
|
await processPluginTask(message);
|
|
134
134
|
},
|
|
135
135
|
topic: PLUGIN_TASK_QUEUE_TOPIC,
|