@sentry/junior 0.151.0 → 0.153.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-EYUAEBMA.js → agent-hooks-7BWOB7SN.js} +10 -10
- package/dist/api/conversations/list.d.ts +11 -5
- package/dist/api/schema/conversation.d.ts +11 -0
- package/dist/api/schema.d.ts +1 -1
- package/dist/api/schema.js +3 -1
- package/dist/api.js +52 -31
- package/dist/app.js +38 -38
- package/dist/{catalog-runtime-2LCLLOBI.js → catalog-runtime-CGUDNL3D.js} +5 -5
- package/dist/chat/api-turns/authorization.d.ts +23 -0
- package/dist/{chunk-QVQBWWXQ.js → chunk-2J4VCHRX.js} +6 -6
- package/dist/{chunk-J5LAA2LI.js → chunk-2NS3ACHB.js} +45 -11
- package/dist/chunk-37LMRT7G.js +89 -0
- package/dist/{chunk-JSKTDBSS.js → chunk-4TWLKHOM.js} +4 -4
- package/dist/{chunk-ZGSL5ARH.js → chunk-5DMPHA4V.js} +141 -66
- package/dist/{chunk-JIJOPRD4.js → chunk-5QBK3QHJ.js} +4 -4
- package/dist/{chunk-KPQBQRNM.js → chunk-5TXDKTET.js} +5 -5
- package/dist/{chunk-OYRFUQOV.js → chunk-5XBRH3N7.js} +59 -12
- package/dist/{chunk-6A46QL4O.js → chunk-A5SROS6H.js} +4 -4
- package/dist/{chunk-WVXFEQXE.js → chunk-COC65LIW.js} +1 -1
- package/dist/{chunk-6DLWRSGV.js → chunk-EPOA52SD.js} +1 -1
- package/dist/{chunk-5N3XLYBW.js → chunk-ET54Q4TD.js} +1 -1
- package/dist/{chunk-M6KRPBXC.js → chunk-FLEY546A.js} +6 -6
- package/dist/{chunk-OAPPJ3TM.js → chunk-HMU2QP5M.js} +1 -1
- package/dist/{chunk-H7ZMEHAN.js → chunk-HOK7MEWG.js} +1 -1
- package/dist/{chunk-6PGJPCN2.js → chunk-HYEAR6HL.js} +1 -1
- package/dist/{chunk-EMB4VY7H.js → chunk-ISEROVYZ.js} +5 -5
- package/dist/{chunk-AGSUPAD5.js → chunk-JAJVUQV7.js} +3 -3
- package/dist/{chunk-DJAOSWB6.js → chunk-JJAMURMR.js} +1 -1
- package/dist/{chunk-2MGJ64SL.js → chunk-JY2HJYJT.js} +1 -1
- package/dist/{chunk-CL5DT6D2.js → chunk-K4LK6KYO.js} +4 -4
- package/dist/{chunk-OFRJXFTH.js → chunk-O2YXWWPM.js} +8 -8
- package/dist/{chunk-D22FO4LW.js → chunk-PGJBNO3I.js} +2 -2
- package/dist/{chunk-6WNWM5JD.js → chunk-PMJAY6JS.js} +5 -5
- package/dist/{chunk-C7D2ONB5.js → chunk-RKW5QGGN.js} +1 -1
- package/dist/{chunk-UDDCHQN2.js → chunk-TIV3PX5H.js} +1 -1
- package/dist/{chunk-XN3QKNQX.js → chunk-UG5UCHHJ.js} +7 -0
- package/dist/{chunk-3WOK4ZLX.js → chunk-URFV5RWN.js} +18 -18
- package/dist/{chunk-PWMVR2MD.js → chunk-VXWTGOLW.js} +1 -1
- package/dist/{chunk-B7KWBJAR.js → chunk-WTKAALLV.js} +6 -6
- package/dist/{chunk-K3QXMZDU.js → chunk-XAYXN4EG.js} +3 -3
- package/dist/{chunk-YN4W5SRJ.js → chunk-XQPKMLRI.js} +1 -1
- package/dist/{chunk-PQUV3NA5.js → chunk-YECBSG77.js} +2 -2
- 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-ALCBI4JZ.js → db-QNQM5YRR.js} +7 -7
- package/dist/handlers/mcp-oauth-callback.d.ts +3 -0
- package/dist/handlers/oauth-callback.d.ts +3 -0
- package/dist/instrumentation.js +4 -4
- package/dist/nitro.js +2 -2
- package/dist/{oauth-callback-server-3RRMG62B.js → oauth-callback-server-ERQPIR27.js} +23 -24
- package/dist/{runner-V6C3EELU.js → runner-BX46SQIE.js} +14 -16
- package/dist/{skills-43PFYZIZ.js → skills-JL44EIRX.js} +6 -6
- package/dist/spawn-W6FO32T4.js +38 -0
- package/dist/{validation-4MNN6QKE.js → validation-UU2AIJIY.js} +6 -6
- package/dist/version.js +1 -1
- package/dist/{work-YZO6XTEB.js → work-SS7RU5CH.js} +17 -17
- package/dist/{worker-42AR7323.js → worker-5P2E7LVI.js} +11 -11
- package/package.json +5 -5
- package/dist/chunk-4ABTAQYC.js +0 -48
- package/dist/chunk-4CODA7P5.js +0 -43
- package/dist/spawn-UZNNTNFU.js +0 -38
|
@@ -11,21 +11,21 @@ import {
|
|
|
11
11
|
getPlugins,
|
|
12
12
|
setPlugins,
|
|
13
13
|
validatePlugins
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-2J4VCHRX.js";
|
|
15
|
+
import "./chunk-JAJVUQV7.js";
|
|
16
|
+
import "./chunk-XAYXN4EG.js";
|
|
17
|
+
import "./chunk-ET54Q4TD.js";
|
|
18
18
|
import "./chunk-EM225ITJ.js";
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-XQPKMLRI.js";
|
|
20
|
+
import "./chunk-PGJBNO3I.js";
|
|
21
21
|
import "./chunk-VFUK3X5B.js";
|
|
22
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-VXWTGOLW.js";
|
|
23
23
|
import "./chunk-HZF5P5UN.js";
|
|
24
24
|
import "./chunk-F3B2YJ76.js";
|
|
25
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-HMU2QP5M.js";
|
|
26
26
|
import "./chunk-6GWA276C.js";
|
|
27
|
-
import "./chunk-
|
|
28
|
-
import "./chunk-
|
|
27
|
+
import "./chunk-JJAMURMR.js";
|
|
28
|
+
import "./chunk-COC65LIW.js";
|
|
29
29
|
import "./chunk-MLKGABMK.js";
|
|
30
30
|
export {
|
|
31
31
|
PluginHookDeniedError,
|
|
@@ -2,7 +2,13 @@ import type { User } from "@sentry/junior-plugin-api";
|
|
|
2
2
|
import type { Conversation } from "@/chat/conversations/store";
|
|
3
3
|
import type { JuniorDatabase } from "@/db/db";
|
|
4
4
|
import type { ConversationFeed } from "../schema/conversation";
|
|
5
|
-
declare function conversationRows(db: JuniorDatabase, limit: number,
|
|
5
|
+
declare function conversationRows(db: JuniorDatabase, limit: number, filter?: {
|
|
6
|
+
kind: "viewer";
|
|
7
|
+
userId: string;
|
|
8
|
+
} | {
|
|
9
|
+
kind: "actorEmail";
|
|
10
|
+
email: string;
|
|
11
|
+
}): Promise<{
|
|
6
12
|
conversation: {
|
|
7
13
|
conversationId: string;
|
|
8
14
|
schemaVersion: number;
|
|
@@ -110,8 +116,8 @@ export declare function readConversationRecordFromSql(conversationId: string): P
|
|
|
110
116
|
rootConversationId: string | null;
|
|
111
117
|
} | undefined>;
|
|
112
118
|
/**
|
|
113
|
-
* Build a bounded dashboard feed
|
|
114
|
-
*
|
|
119
|
+
* Build a bounded dashboard feed. Prefer the viewer user when present; otherwise
|
|
120
|
+
* keep only roots linked to actorEmail before applying the limit.
|
|
115
121
|
*/
|
|
116
122
|
export declare function readConversationFeedFromSql(options?: {
|
|
117
123
|
actorEmail?: string;
|
|
@@ -119,8 +125,8 @@ export declare function readConversationFeedFromSql(options?: {
|
|
|
119
125
|
viewer?: User;
|
|
120
126
|
}): Promise<ConversationFeed>;
|
|
121
127
|
/**
|
|
122
|
-
* Load a bounded feed with an optional
|
|
123
|
-
*
|
|
128
|
+
* Load a bounded feed with an optional viewer-primary linked-user filter.
|
|
129
|
+
* This filter is not an authorization boundary.
|
|
124
130
|
*/
|
|
125
131
|
export declare function readConversationFeed(options?: {
|
|
126
132
|
actorEmail?: string;
|
|
@@ -107,8 +107,19 @@ export declare const conversationPendingMessageSchema: z.ZodObject<{
|
|
|
107
107
|
text: z.ZodOptional<z.ZodString>;
|
|
108
108
|
redacted: z.ZodOptional<z.ZodLiteral<true>>;
|
|
109
109
|
}, z.core.$strict>;
|
|
110
|
+
/** Participant-only authorization prompt for a parked web turn. */
|
|
111
|
+
export declare const conversationPendingAuthorizationSchema: z.ZodObject<{
|
|
112
|
+
authorizationUrl: z.ZodString;
|
|
113
|
+
completionText: z.ZodString;
|
|
114
|
+
label: z.ZodString;
|
|
115
|
+
}, z.core.$strict>;
|
|
110
116
|
/** Bounded mailbox snapshot for one conversation transcript. */
|
|
111
117
|
export declare const conversationPendingMessagesReportSchema: z.ZodObject<{
|
|
118
|
+
authorization: z.ZodOptional<z.ZodObject<{
|
|
119
|
+
authorizationUrl: z.ZodString;
|
|
120
|
+
completionText: z.ZodString;
|
|
121
|
+
label: z.ZodString;
|
|
122
|
+
}, z.core.$strict>>;
|
|
112
123
|
conversationId: z.ZodString;
|
|
113
124
|
generatedAt: z.ZodString;
|
|
114
125
|
messages: z.ZodArray<z.ZodObject<{
|
package/dist/api/schema.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { dailyConversationActivitySchema } from "./activity";
|
|
2
2
|
export type { DailyConversationActivity } from "./activity";
|
|
3
|
-
export { acceptedConversationMessageSchema, archiveConversationBodySchema, archiveConversationResponseSchema, conversationAuxiliaryCostsSchema, conversationDetailQuerySchema, conversationDetailReportSchema, conversationEventPageSchema, conversationEventHistorySchema, conversationEventsQuerySchema, conversationFeedQuerySchema, conversationFeedSchema, conversationParamsSchema, conversationPendingMessageDeliverySchema, conversationPendingMessageSchema, conversationPendingMessagesReportSchema, conversationReportEventDataSchema, conversationReportEventSchema, conversationStatsReportSchema, conversationSummaryReportSchema, createConversationBodySchema, createConversationMessageBodySchema, } from "./schema/conversation";
|
|
3
|
+
export { acceptedConversationMessageSchema, archiveConversationBodySchema, archiveConversationResponseSchema, conversationAuxiliaryCostsSchema, conversationDetailQuerySchema, conversationDetailReportSchema, conversationEventPageSchema, conversationEventHistorySchema, conversationEventsQuerySchema, conversationFeedQuerySchema, conversationFeedSchema, conversationParamsSchema, conversationPendingAuthorizationSchema, conversationPendingMessageDeliverySchema, conversationPendingMessageSchema, conversationPendingMessagesReportSchema, conversationReportEventDataSchema, conversationReportEventSchema, conversationStatsReportSchema, conversationSummaryReportSchema, createConversationBodySchema, createConversationMessageBodySchema, } from "./schema/conversation";
|
|
4
4
|
export type { AcceptedConversationMessage, ArchiveConversationBody, ArchiveConversationResponse, ActorIdentity, ConversationAuxiliaryCosts, ConversationCost, ConversationDetailReport, ConversationEventPage, ConversationEventHistory, ConversationFeed, ConversationPendingMessage, ConversationPendingMessageDelivery, ConversationPendingMessagesReport, ConversationReportEvent, ConversationReportEventData, ConversationReportStatus, ConversationMetricDay, ConversationModelUsage, ConversationParams, ConversationSourceTask, ConversationStatsItem, ConversationStatsReport, ConversationSummaryReport, ConversationSurface, ConversationUsage, CreateConversationBody, CreateConversationMessageBody, GuardianMetricDay, GuardianStats, } from "./schema/conversation";
|
|
5
5
|
export { actorDirectoryReportSchema, actorProfileReportSchema, personalSpendReportSchema, personParamsSchema, } from "./schema/person";
|
|
6
6
|
export { locationActivityDayReportSchema, locationDetailReportSchema, locationDirectoryReportSchema, locationParamsSchema, } from "./schema/location";
|
package/dist/api/schema.js
CHANGED
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
conversationFeedQuerySchema,
|
|
15
15
|
conversationFeedSchema,
|
|
16
16
|
conversationParamsSchema,
|
|
17
|
+
conversationPendingAuthorizationSchema,
|
|
17
18
|
conversationPendingMessageDeliverySchema,
|
|
18
19
|
conversationPendingMessageSchema,
|
|
19
20
|
conversationPendingMessagesReportSchema,
|
|
@@ -49,7 +50,7 @@ import {
|
|
|
49
50
|
taskRunListSchema,
|
|
50
51
|
taskRunSchema,
|
|
51
52
|
taskSummarySchema
|
|
52
|
-
} from "../chunk-
|
|
53
|
+
} from "../chunk-UG5UCHHJ.js";
|
|
53
54
|
import {
|
|
54
55
|
healthReportSchema,
|
|
55
56
|
pluginOperationalReportFeedSchema,
|
|
@@ -81,6 +82,7 @@ export {
|
|
|
81
82
|
conversationFeedQuerySchema,
|
|
82
83
|
conversationFeedSchema,
|
|
83
84
|
conversationParamsSchema,
|
|
85
|
+
conversationPendingAuthorizationSchema,
|
|
84
86
|
conversationPendingMessageDeliverySchema,
|
|
85
87
|
conversationPendingMessageSchema,
|
|
86
88
|
conversationPendingMessagesReportSchema,
|
package/dist/api.js
CHANGED
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
taskListSchema,
|
|
34
34
|
taskParamsSchema,
|
|
35
35
|
taskRunListSchema
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-UG5UCHHJ.js";
|
|
37
37
|
import {
|
|
38
38
|
appendAndEnqueueApiConversationMessage,
|
|
39
39
|
createAndEnqueueApiConversation,
|
|
@@ -42,13 +42,14 @@ import {
|
|
|
42
42
|
readHealthReport,
|
|
43
43
|
resolveSlackConversationContextFromThreadId,
|
|
44
44
|
webActorFromEmail
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-5XBRH3N7.js";
|
|
46
46
|
import {
|
|
47
|
-
buildSentryConversationUrl
|
|
48
|
-
|
|
47
|
+
buildSentryConversationUrl,
|
|
48
|
+
getWebAuthorization
|
|
49
|
+
} from "./chunk-37LMRT7G.js";
|
|
49
50
|
import {
|
|
50
51
|
getConversation
|
|
51
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-A5SROS6H.js";
|
|
52
53
|
import {
|
|
53
54
|
readTaskExecutionByConversationId,
|
|
54
55
|
readTaskExecutionDays,
|
|
@@ -56,8 +57,8 @@ import {
|
|
|
56
57
|
readTaskExecutionSummaries,
|
|
57
58
|
readTaskExecutions,
|
|
58
59
|
readTaskRuns
|
|
59
|
-
} from "./chunk-
|
|
60
|
-
import "./chunk-
|
|
60
|
+
} from "./chunk-2NS3ACHB.js";
|
|
61
|
+
import "./chunk-ISEROVYZ.js";
|
|
61
62
|
import {
|
|
62
63
|
healthReportSchema,
|
|
63
64
|
pluginOperationalReportFeedSchema,
|
|
@@ -81,16 +82,16 @@ import {
|
|
|
81
82
|
listPublicEventTasksForTeams,
|
|
82
83
|
listPublicScheduledTasksForTeams,
|
|
83
84
|
readStats
|
|
84
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-PMJAY6JS.js";
|
|
85
86
|
import {
|
|
86
87
|
parseSlackThreadId
|
|
87
|
-
} from "./chunk-
|
|
88
|
+
} from "./chunk-TIV3PX5H.js";
|
|
88
89
|
import {
|
|
89
90
|
agentTurnUsageSchema,
|
|
90
91
|
fallbackShortTitle,
|
|
91
92
|
hasAgentTurnUsage,
|
|
92
93
|
renderJuniorNativeConversationEvent
|
|
93
|
-
} from "./chunk-
|
|
94
|
+
} from "./chunk-5QBK3QHJ.js";
|
|
94
95
|
import "./chunk-3Y47VMHV.js";
|
|
95
96
|
import "./chunk-PDO5BLNM.js";
|
|
96
97
|
import {
|
|
@@ -100,11 +101,11 @@ import {
|
|
|
100
101
|
renderPluginConversationEvent,
|
|
101
102
|
resolveViewerUser,
|
|
102
103
|
updateViewerDisplayName
|
|
103
|
-
} from "./chunk-
|
|
104
|
+
} from "./chunk-2J4VCHRX.js";
|
|
104
105
|
import {
|
|
105
106
|
getSlackClient,
|
|
106
107
|
withSlackRetries
|
|
107
|
-
} from "./chunk-
|
|
108
|
+
} from "./chunk-JAJVUQV7.js";
|
|
108
109
|
import {
|
|
109
110
|
decodeStoredConversationEvent,
|
|
110
111
|
getConversationStore,
|
|
@@ -112,23 +113,23 @@ import {
|
|
|
112
113
|
getSqlExecutor,
|
|
113
114
|
locationFromRow,
|
|
114
115
|
parseSessionSource
|
|
115
|
-
} from "./chunk-
|
|
116
|
+
} from "./chunk-XAYXN4EG.js";
|
|
116
117
|
import {
|
|
117
118
|
juniorApiTokens,
|
|
118
119
|
juniorConversationEvents,
|
|
119
120
|
juniorConversations,
|
|
120
121
|
juniorIdentities,
|
|
121
122
|
juniorUsers
|
|
122
|
-
} from "./chunk-
|
|
123
|
+
} from "./chunk-ET54Q4TD.js";
|
|
123
124
|
import "./chunk-EM225ITJ.js";
|
|
124
|
-
import "./chunk-
|
|
125
|
-
import "./chunk-
|
|
125
|
+
import "./chunk-XQPKMLRI.js";
|
|
126
|
+
import "./chunk-PGJBNO3I.js";
|
|
126
127
|
import {
|
|
127
128
|
juniorDestinations
|
|
128
129
|
} from "./chunk-VFUK3X5B.js";
|
|
129
130
|
import {
|
|
130
131
|
canExposeConversationPayload
|
|
131
|
-
} from "./chunk-
|
|
132
|
+
} from "./chunk-VXWTGOLW.js";
|
|
132
133
|
import "./chunk-RUIXF3YQ.js";
|
|
133
134
|
import "./chunk-HZF5P5UN.js";
|
|
134
135
|
import {
|
|
@@ -138,10 +139,10 @@ import {
|
|
|
138
139
|
} from "./chunk-F3B2YJ76.js";
|
|
139
140
|
import {
|
|
140
141
|
logException
|
|
141
|
-
} from "./chunk-
|
|
142
|
+
} from "./chunk-HMU2QP5M.js";
|
|
142
143
|
import "./chunk-6GWA276C.js";
|
|
143
|
-
import "./chunk-
|
|
144
|
-
import "./chunk-
|
|
144
|
+
import "./chunk-JJAMURMR.js";
|
|
145
|
+
import "./chunk-COC65LIW.js";
|
|
145
146
|
import "./chunk-MLKGABMK.js";
|
|
146
147
|
|
|
147
148
|
// src/api.ts
|
|
@@ -1532,7 +1533,7 @@ async function readConversationAuxiliaryCostsFromSql(db, conversationIds, option
|
|
|
1532
1533
|
|
|
1533
1534
|
// src/api/conversations/list.ts
|
|
1534
1535
|
var CONVERSATION_FEED_LIMIT = 50;
|
|
1535
|
-
async function conversationRows(db, limit,
|
|
1536
|
+
async function conversationRows(db, limit, filter) {
|
|
1536
1537
|
return db.select({
|
|
1537
1538
|
conversation: juniorConversations,
|
|
1538
1539
|
destination: juniorDestinations,
|
|
@@ -1553,10 +1554,7 @@ async function conversationRows(db, limit, actorEmail) {
|
|
|
1553
1554
|
and6(
|
|
1554
1555
|
isNull3(juniorConversations.parentConversationId),
|
|
1555
1556
|
isNull3(juniorConversations.archivedAt),
|
|
1556
|
-
actorEmail ?
|
|
1557
|
-
eq7(juniorIdentities.emailNormalized, actorEmail),
|
|
1558
|
-
eq7(juniorIdentities.emailVerified, true)
|
|
1559
|
-
) : void 0
|
|
1557
|
+
filter?.kind === "viewer" ? eq7(juniorIdentities.userId, filter.userId) : filter?.kind === "actorEmail" ? eq7(juniorUsers.primaryEmailNormalized, filter.email) : void 0
|
|
1560
1558
|
)
|
|
1561
1559
|
).orderBy(
|
|
1562
1560
|
desc2(juniorConversations.lastActivityAt),
|
|
@@ -1628,13 +1626,22 @@ async function readConversationRecordFromSql(conversationId) {
|
|
|
1628
1626
|
rootConversationId: row.conversation.rootConversationId
|
|
1629
1627
|
} : void 0;
|
|
1630
1628
|
}
|
|
1629
|
+
function conversationFeedFilter(options) {
|
|
1630
|
+
if (options.viewer) {
|
|
1631
|
+
return { kind: "viewer", userId: options.viewer.id };
|
|
1632
|
+
}
|
|
1633
|
+
if (options.actorEmail) {
|
|
1634
|
+
return { kind: "actorEmail", email: options.actorEmail };
|
|
1635
|
+
}
|
|
1636
|
+
return void 0;
|
|
1637
|
+
}
|
|
1631
1638
|
async function readConversationFeedFromSql(options = {}) {
|
|
1632
1639
|
const nowMs = Date.now();
|
|
1633
1640
|
const db = getDb();
|
|
1634
1641
|
const rows = await conversationRows(
|
|
1635
1642
|
db,
|
|
1636
1643
|
options.limit ?? CONVERSATION_FEED_LIMIT,
|
|
1637
|
-
options
|
|
1644
|
+
conversationFeedFilter(options)
|
|
1638
1645
|
);
|
|
1639
1646
|
const conversations = rows.map((row) => conversationFromRow(row));
|
|
1640
1647
|
const conversationIds = conversations.map(
|
|
@@ -2457,8 +2464,15 @@ async function projectPendingMessage(message2, canExposePayload) {
|
|
|
2457
2464
|
async function readConversationPendingMessages(conversationId, options = {}) {
|
|
2458
2465
|
const conversation = await getConversationStore().get({ conversationId });
|
|
2459
2466
|
if (!conversation) return void 0;
|
|
2460
|
-
const access = (await readConversationAccessFromSql(
|
|
2467
|
+
const access = (await readConversationAccessFromSql(
|
|
2468
|
+
getDb(),
|
|
2469
|
+
[conversationId],
|
|
2470
|
+
options.viewer
|
|
2471
|
+
)).get(conversationId);
|
|
2461
2472
|
const canExposePayload = access?.canViewPrivateContent ?? false;
|
|
2473
|
+
const isParticipant = access?.isParticipant ?? false;
|
|
2474
|
+
const actorId = options.viewer?.email ? webActorFromEmail(options.viewer.email).userId : void 0;
|
|
2475
|
+
const authorization = isParticipant && actorId ? await getWebAuthorization({ actorId, conversationId }) : void 0;
|
|
2462
2476
|
const work = await getConversation({ conversationId });
|
|
2463
2477
|
const projectedMessages = await Promise.all(
|
|
2464
2478
|
(work?.execution.pendingMessages ?? []).map(
|
|
@@ -2469,6 +2483,13 @@ async function readConversationPendingMessages(conversationId, options = {}) {
|
|
|
2469
2483
|
(message2) => Boolean(message2)
|
|
2470
2484
|
);
|
|
2471
2485
|
return conversationPendingMessagesReportSchema.parse({
|
|
2486
|
+
...authorization ? {
|
|
2487
|
+
authorization: {
|
|
2488
|
+
authorizationUrl: authorization.authorizationUrl,
|
|
2489
|
+
completionText: authorization.completionText,
|
|
2490
|
+
label: authorization.label
|
|
2491
|
+
}
|
|
2492
|
+
} : {},
|
|
2472
2493
|
conversationId,
|
|
2473
2494
|
generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2474
2495
|
messages
|
|
@@ -4338,7 +4359,7 @@ function readDescriptionText(home) {
|
|
|
4338
4359
|
}
|
|
4339
4360
|
}
|
|
4340
4361
|
async function readSkillReports() {
|
|
4341
|
-
const { discoverSkills } = await import("./skills-
|
|
4362
|
+
const { discoverSkills } = await import("./skills-JL44EIRX.js");
|
|
4342
4363
|
const skills = await discoverSkills();
|
|
4343
4364
|
return skillReportsSchema.parse(
|
|
4344
4365
|
skills.map((skill) => ({
|
|
@@ -4348,7 +4369,7 @@ async function readSkillReports() {
|
|
|
4348
4369
|
);
|
|
4349
4370
|
}
|
|
4350
4371
|
async function readPlugins() {
|
|
4351
|
-
const { pluginCatalogRuntime } = await import("./catalog-runtime-
|
|
4372
|
+
const { pluginCatalogRuntime } = await import("./catalog-runtime-CGUDNL3D.js");
|
|
4352
4373
|
return pluginsSchema.parse(
|
|
4353
4374
|
pluginCatalogRuntime.getProviders().map((plugin) => ({
|
|
4354
4375
|
configKeys: plugin.manifest.configKeys ?? [],
|
|
@@ -4361,7 +4382,7 @@ async function readPlugins() {
|
|
|
4361
4382
|
async function readRuntimeInfoReport() {
|
|
4362
4383
|
const [{ homeDir }, { pluginCatalogRuntime }, plugins, skills] = await Promise.all([
|
|
4363
4384
|
import("./discovery-GUFTFBTL.js"),
|
|
4364
|
-
import("./catalog-runtime-
|
|
4385
|
+
import("./catalog-runtime-CGUDNL3D.js"),
|
|
4365
4386
|
readPlugins(),
|
|
4366
4387
|
readSkillReports()
|
|
4367
4388
|
]);
|
|
@@ -4377,7 +4398,7 @@ async function readRuntimeInfoReport() {
|
|
|
4377
4398
|
}
|
|
4378
4399
|
async function readPluginOperationalReportFeed() {
|
|
4379
4400
|
const nowMs = Date.now();
|
|
4380
|
-
const { getPluginOperationalReports } = await import("./agent-hooks-
|
|
4401
|
+
const { getPluginOperationalReports } = await import("./agent-hooks-7BWOB7SN.js");
|
|
4381
4402
|
return pluginOperationalReportFeedSchema.parse({
|
|
4382
4403
|
source: "plugins",
|
|
4383
4404
|
generatedAt: new Date(nowMs).toISOString(),
|
package/dist/app.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
processConversationWork
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-K4LK6KYO.js";
|
|
4
4
|
import {
|
|
5
5
|
bindSpawnAgent
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-RKW5QGGN.js";
|
|
7
7
|
import {
|
|
8
8
|
createAgentInvocationWorker,
|
|
9
9
|
enqueueAgentInvocation,
|
|
10
10
|
listPendingAgentInvocationMailboxAppends,
|
|
11
11
|
routeAgentInvocationWork
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-WTKAALLV.js";
|
|
13
13
|
import {
|
|
14
14
|
GET as GET2,
|
|
15
15
|
GET2 as GET3,
|
|
@@ -36,16 +36,12 @@ import {
|
|
|
36
36
|
startSlackProcessingReaction,
|
|
37
37
|
stripLeadingBotMention,
|
|
38
38
|
wakePausedTurn
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-5DMPHA4V.js";
|
|
40
40
|
import "./chunk-FA6POGLH.js";
|
|
41
41
|
import {
|
|
42
42
|
getTurnRequestDeadline,
|
|
43
43
|
runWithTurnRequestDeadline
|
|
44
|
-
} from "./chunk-
|
|
45
|
-
import {
|
|
46
|
-
completeAuthPauseTurn,
|
|
47
|
-
persistAuthPauseTurnState
|
|
48
|
-
} from "./chunk-4ABTAQYC.js";
|
|
44
|
+
} from "./chunk-HOK7MEWG.js";
|
|
49
45
|
import {
|
|
50
46
|
GET,
|
|
51
47
|
conversationVisibilityFromSlackChannelType,
|
|
@@ -54,8 +50,8 @@ import {
|
|
|
54
50
|
resolveSlackChannelTypeFromMessage,
|
|
55
51
|
resolveSlackConversationContext,
|
|
56
52
|
routeApiTurnWork
|
|
57
|
-
} from "./chunk-
|
|
58
|
-
import "./chunk-
|
|
53
|
+
} from "./chunk-5XBRH3N7.js";
|
|
54
|
+
import "./chunk-37LMRT7G.js";
|
|
59
55
|
import {
|
|
60
56
|
CONVERSATION_WORK_STALE_ENQUEUE_MS,
|
|
61
57
|
appendAndEnqueueInboundMessage,
|
|
@@ -66,10 +62,11 @@ import {
|
|
|
66
62
|
isInvalidConversationRecordError,
|
|
67
63
|
listActiveConversationIds,
|
|
68
64
|
removeActiveConversation
|
|
69
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-A5SROS6H.js";
|
|
70
66
|
import {
|
|
71
67
|
buildDeliveredTurnStatePatch,
|
|
72
68
|
claimDispatchMailboxAppend,
|
|
69
|
+
completeAuthPauseTurn,
|
|
73
70
|
confirmDispatchMailboxAppend,
|
|
74
71
|
createOrGetDispatch,
|
|
75
72
|
finalizeFailedTurnReplyWithEvent,
|
|
@@ -90,12 +87,13 @@ import {
|
|
|
90
87
|
markDispatchCompleted,
|
|
91
88
|
markDispatchFailed,
|
|
92
89
|
markDispatchRunning,
|
|
90
|
+
persistAuthPauseTurnState,
|
|
93
91
|
processPluginTask,
|
|
94
92
|
recordTaskExecution,
|
|
95
93
|
requireTurnFailureEventId,
|
|
96
94
|
resolveTurnSessionRouting,
|
|
97
95
|
scheduleSessionCompletedPluginTasks
|
|
98
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-2NS3ACHB.js";
|
|
99
97
|
import {
|
|
100
98
|
ConversationTurnLifecycleService,
|
|
101
99
|
coerceThreadConversationState,
|
|
@@ -105,7 +103,7 @@ import {
|
|
|
105
103
|
persistThreadRuntimeState,
|
|
106
104
|
persistThreadState,
|
|
107
105
|
persistThreadStateById
|
|
108
|
-
} from "./chunk-
|
|
106
|
+
} from "./chunk-ISEROVYZ.js";
|
|
109
107
|
import "./chunk-UTL3MHPC.js";
|
|
110
108
|
import {
|
|
111
109
|
getVercelConversationWorkQueue,
|
|
@@ -124,7 +122,7 @@ import {
|
|
|
124
122
|
import {
|
|
125
123
|
validatePluginEgressCredentialHooks,
|
|
126
124
|
validatePluginRegistrations
|
|
127
|
-
} from "./chunk-
|
|
125
|
+
} from "./chunk-HYEAR6HL.js";
|
|
128
126
|
import {
|
|
129
127
|
defineJuniorPlugins,
|
|
130
128
|
pluginCatalogConfigFromEnv,
|
|
@@ -157,18 +155,18 @@ import {
|
|
|
157
155
|
setConfigDefaults,
|
|
158
156
|
shouldEmitDevAgentTrace,
|
|
159
157
|
shouldPropagateSandboxEgressTrace
|
|
160
|
-
} from "./chunk-
|
|
158
|
+
} from "./chunk-URFV5RWN.js";
|
|
161
159
|
import {
|
|
162
160
|
AuthorizationFlowDisabledError,
|
|
163
161
|
PluginCredentialFailureError
|
|
164
|
-
} from "./chunk-
|
|
162
|
+
} from "./chunk-5TXDKTET.js";
|
|
165
163
|
import "./chunk-DIB4GX3G.js";
|
|
166
164
|
import {
|
|
167
165
|
createUserTokenStore,
|
|
168
166
|
deleteMcpAuthSessionsForUserProvider,
|
|
169
167
|
deleteMcpServerSessionId,
|
|
170
168
|
deleteMcpStoredOAuthCredentials
|
|
171
|
-
} from "./chunk-
|
|
169
|
+
} from "./chunk-O2YXWWPM.js";
|
|
172
170
|
import {
|
|
173
171
|
RetryableDeliveryError
|
|
174
172
|
} from "./chunk-RF6J3DIO.js";
|
|
@@ -176,7 +174,7 @@ import {
|
|
|
176
174
|
formatProviderLabel,
|
|
177
175
|
postSlackMessage,
|
|
178
176
|
startOAuthFlow
|
|
179
|
-
} from "./chunk-
|
|
177
|
+
} from "./chunk-FLEY546A.js";
|
|
180
178
|
import "./chunk-HUO3UTAQ.js";
|
|
181
179
|
import {
|
|
182
180
|
getExperimentalFeatures,
|
|
@@ -185,16 +183,16 @@ import {
|
|
|
185
183
|
import {
|
|
186
184
|
getSandboxResourceConfig,
|
|
187
185
|
setSandboxResourceConfig
|
|
188
|
-
} from "./chunk-
|
|
186
|
+
} from "./chunk-4TWLKHOM.js";
|
|
189
187
|
import {
|
|
190
188
|
createSchedulerSqlStore,
|
|
191
189
|
findMatchingEventTasks,
|
|
192
190
|
logScheduledTaskRunSkipped,
|
|
193
191
|
scheduledTaskRunAttributes
|
|
194
|
-
} from "./chunk-
|
|
192
|
+
} from "./chunk-PMJAY6JS.js";
|
|
195
193
|
import {
|
|
196
194
|
parseSlackThreadId
|
|
197
|
-
} from "./chunk-
|
|
195
|
+
} from "./chunk-TIV3PX5H.js";
|
|
198
196
|
import {
|
|
199
197
|
ConversationTurnBoundaryError,
|
|
200
198
|
CooperativeTurnYieldError,
|
|
@@ -244,7 +242,7 @@ import {
|
|
|
244
242
|
trimTrailingAssistantMessages,
|
|
245
243
|
turnHasReply,
|
|
246
244
|
upsertConversationMessage
|
|
247
|
-
} from "./chunk-
|
|
245
|
+
} from "./chunk-5QBK3QHJ.js";
|
|
248
246
|
import "./chunk-3Y47VMHV.js";
|
|
249
247
|
import "./chunk-PDO5BLNM.js";
|
|
250
248
|
import "./chunk-UIE3R5XU.js";
|
|
@@ -264,7 +262,7 @@ import {
|
|
|
264
262
|
verifyEventTaskCredentialSubject,
|
|
265
263
|
verifyScheduledTaskCredentialSubject,
|
|
266
264
|
verifySlackDirectCredentialSubject
|
|
267
|
-
} from "./chunk-
|
|
265
|
+
} from "./chunk-2J4VCHRX.js";
|
|
268
266
|
import {
|
|
269
267
|
SlackActionError,
|
|
270
268
|
downloadPrivateSlackFile,
|
|
@@ -274,7 +272,7 @@ import {
|
|
|
274
272
|
normalizeSlackConversationId,
|
|
275
273
|
runWithSlackInstallationToken,
|
|
276
274
|
runWithWorkspaceTeamId
|
|
277
|
-
} from "./chunk-
|
|
275
|
+
} from "./chunk-JAJVUQV7.js";
|
|
278
276
|
import {
|
|
279
277
|
contextProvenance,
|
|
280
278
|
createSlackDestination,
|
|
@@ -287,19 +285,19 @@ import {
|
|
|
287
285
|
requireSlackDestination,
|
|
288
286
|
withConversationEventLock,
|
|
289
287
|
withConversationMutationLock
|
|
290
|
-
} from "./chunk-
|
|
288
|
+
} from "./chunk-XAYXN4EG.js";
|
|
291
289
|
import {
|
|
292
290
|
juniorAgentBindings,
|
|
293
291
|
juniorAgentInvocations,
|
|
294
292
|
juniorConversationEvents,
|
|
295
293
|
juniorConversations
|
|
296
|
-
} from "./chunk-
|
|
294
|
+
} from "./chunk-ET54Q4TD.js";
|
|
297
295
|
import "./chunk-EM225ITJ.js";
|
|
298
296
|
import {
|
|
299
297
|
acquireActiveLock,
|
|
300
298
|
getStateAdapter,
|
|
301
299
|
withActiveLock
|
|
302
|
-
} from "./chunk-
|
|
300
|
+
} from "./chunk-XQPKMLRI.js";
|
|
303
301
|
import {
|
|
304
302
|
STANDARD_MODEL_PROFILE,
|
|
305
303
|
botConfig,
|
|
@@ -317,16 +315,16 @@ import {
|
|
|
317
315
|
modelIdForProfile,
|
|
318
316
|
setSlackReactionConfig,
|
|
319
317
|
standardModelId
|
|
320
|
-
} from "./chunk-
|
|
318
|
+
} from "./chunk-PGJBNO3I.js";
|
|
321
319
|
import {
|
|
322
320
|
juniorDestinations
|
|
323
321
|
} from "./chunk-VFUK3X5B.js";
|
|
324
|
-
import "./chunk-
|
|
325
|
-
import "./chunk-
|
|
322
|
+
import "./chunk-VXWTGOLW.js";
|
|
323
|
+
import "./chunk-YECBSG77.js";
|
|
326
324
|
import {
|
|
327
325
|
pluginCatalogRuntime
|
|
328
|
-
} from "./chunk-
|
|
329
|
-
import "./chunk-
|
|
326
|
+
} from "./chunk-EPOA52SD.js";
|
|
327
|
+
import "./chunk-JY2HJYJT.js";
|
|
330
328
|
import {
|
|
331
329
|
credentialContextForActor
|
|
332
330
|
} from "./chunk-RUIXF3YQ.js";
|
|
@@ -360,7 +358,7 @@ import {
|
|
|
360
358
|
withContext,
|
|
361
359
|
withLogContext,
|
|
362
360
|
withSpan
|
|
363
|
-
} from "./chunk-
|
|
361
|
+
} from "./chunk-HMU2QP5M.js";
|
|
364
362
|
import {
|
|
365
363
|
continueTrace
|
|
366
364
|
} from "./chunk-6GWA276C.js";
|
|
@@ -368,10 +366,10 @@ import "./chunk-OOUNJNMR.js";
|
|
|
368
366
|
import "./chunk-H4HBKISO.js";
|
|
369
367
|
import {
|
|
370
368
|
JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE
|
|
371
|
-
} from "./chunk-
|
|
369
|
+
} from "./chunk-JJAMURMR.js";
|
|
372
370
|
import {
|
|
373
371
|
JUNIOR_VERSION
|
|
374
|
-
} from "./chunk-
|
|
372
|
+
} from "./chunk-COC65LIW.js";
|
|
375
373
|
import "./chunk-MLKGABMK.js";
|
|
376
374
|
|
|
377
375
|
// src/app.ts
|
|
@@ -9098,12 +9096,14 @@ async function createApp(options) {
|
|
|
9098
9096
|
app.get("/health", () => GET());
|
|
9099
9097
|
app.get("/api/oauth/callback/mcp/:provider", (c) => {
|
|
9100
9098
|
return GET2(c.req.raw, c.req.param("provider"), waitUntil, {
|
|
9101
|
-
agentRunner
|
|
9099
|
+
agentRunner,
|
|
9100
|
+
conversationWorkQueue: getVercelConversationWorkQueue()
|
|
9102
9101
|
});
|
|
9103
9102
|
});
|
|
9104
9103
|
app.get("/api/oauth/callback/:provider", (c) => {
|
|
9105
9104
|
return GET3(c.req.raw, c.req.param("provider"), waitUntil, {
|
|
9106
|
-
agentRunner
|
|
9105
|
+
agentRunner,
|
|
9106
|
+
conversationWorkQueue: getVercelConversationWorkQueue()
|
|
9107
9107
|
});
|
|
9108
9108
|
});
|
|
9109
9109
|
app.get("/api/internal/sandbox-egress/signals", (c) => {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pluginCatalogRuntime
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-EPOA52SD.js";
|
|
4
|
+
import "./chunk-JY2HJYJT.js";
|
|
5
5
|
import "./chunk-RUIXF3YQ.js";
|
|
6
6
|
import "./chunk-HZF5P5UN.js";
|
|
7
7
|
import "./chunk-F3B2YJ76.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-HMU2QP5M.js";
|
|
9
9
|
import "./chunk-6GWA276C.js";
|
|
10
10
|
import "./chunk-OOUNJNMR.js";
|
|
11
11
|
import "./chunk-H4HBKISO.js";
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-JJAMURMR.js";
|
|
13
|
+
import "./chunk-COC65LIW.js";
|
|
14
14
|
import "./chunk-MLKGABMK.js";
|
|
15
15
|
export {
|
|
16
16
|
pluginCatalogRuntime
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { OAuthAuthorizationRequest } from "@/chat/oauth-authorization";
|
|
2
|
+
export interface WebAuthorizationState extends OAuthAuthorizationRequest {
|
|
3
|
+
actorId: string;
|
|
4
|
+
conversationId: string;
|
|
5
|
+
}
|
|
6
|
+
/** Build authorization delivery for one web turn. */
|
|
7
|
+
export declare function createWebAuthorization(args: {
|
|
8
|
+
actorId: string;
|
|
9
|
+
conversationId: string;
|
|
10
|
+
}): {
|
|
11
|
+
createState: () => Promise<`${string}-${string}-${string}-${string}-${string}`>;
|
|
12
|
+
deliver: (request: OAuthAuthorizationRequest) => Promise<void>;
|
|
13
|
+
};
|
|
14
|
+
/** Read the pending authorization request for one web actor. */
|
|
15
|
+
export declare function getWebAuthorization(args: {
|
|
16
|
+
actorId: string;
|
|
17
|
+
conversationId: string;
|
|
18
|
+
}): Promise<WebAuthorizationState | undefined>;
|
|
19
|
+
/** Remove a web authorization request after the parked turn continues. */
|
|
20
|
+
export declare function deleteWebAuthorization(args: {
|
|
21
|
+
actorId: string;
|
|
22
|
+
conversationId: string;
|
|
23
|
+
}): Promise<void>;
|