@sentry/junior 0.101.0 → 0.102.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-V6KU7PQN.js → agent-hooks-I4I2DHSW.js} +7 -7
- package/dist/api/people/schema.d.ts +13 -0
- package/dist/api/schema.d.ts +1 -1
- package/dist/api/schema.js +1 -1
- package/dist/api.js +14 -14
- package/dist/app.js +64 -53
- package/dist/{catalog-runtime-PFHVMHDR.js → catalog-runtime-5CVM2DOF.js} +2 -2
- package/dist/chat/agent/prompt.d.ts +1 -1
- package/dist/chat/agent-dispatch/validation.d.ts +1 -1
- package/dist/chat/conversation-privacy.d.ts +2 -6
- package/dist/chat/credentials/context.d.ts +33 -6
- package/dist/chat/credentials/subject.d.ts +15 -1
- package/dist/chat/logging.d.ts +4 -2
- package/dist/chat/mcp/tool-manager.d.ts +1 -1
- package/dist/chat/sandbox/egress/schemas.d.ts +13 -2
- package/dist/chat/services/context-compaction-marker.d.ts +8 -0
- package/dist/{chunk-XJA7BPHS.js → chunk-3OABPOHR.js} +3 -3
- package/dist/{chunk-EBFJOOUE.js → chunk-3UK5DFKW.js} +2 -2
- package/dist/{chunk-DBPLXSBK.js → chunk-4YN2ZXKB.js} +9 -1
- package/dist/{chunk-XVR4O24H.js → chunk-5K4N73TP.js} +4 -4
- package/dist/{chunk-LMJPRYHP.js → chunk-77LHNQK4.js} +32 -8
- package/dist/{chunk-I35CTGPO.js → chunk-AEWZ7F65.js} +41 -17
- package/dist/{chunk-IQIBZXGB.js → chunk-B5QS4AVO.js} +2 -2
- package/dist/{chunk-L2JIOAA2.js → chunk-DTUSCR2Y.js} +8 -11
- package/dist/{chunk-GEUUJRQF.js → chunk-E4EMFKGB.js} +1 -1
- package/dist/{chunk-VVIXK2BX.js → chunk-EMUZSROX.js} +2 -2
- package/dist/{chunk-IVXL57YF.js → chunk-EOB77KME.js} +4 -4
- package/dist/{chunk-PGGEOCQY.js → chunk-F4CQEUTP.js} +1 -1
- package/dist/{chunk-FP5N5OWZ.js → chunk-IQ36I3DF.js} +2 -2
- package/dist/{chunk-JSAANELJ.js → chunk-LJB2TLVT.js} +3 -3
- package/dist/{chunk-D5KZYS4T.js → chunk-MJSJAHBW.js} +1 -1
- package/dist/{chunk-VFBFK6EY.js → chunk-MR6H67P2.js} +2 -2
- package/dist/{chunk-5VGJJSSV.js → chunk-NSP6OGL2.js} +5 -5
- package/dist/{chunk-VHRM6GNH.js → chunk-QZGVPPIJ.js} +27 -3
- package/dist/{chunk-LVA4I4H7.js → chunk-RT5BUHR5.js} +15 -44
- package/dist/{chunk-A7X2FDUO.js → chunk-SHBPSE7A.js} +88 -66
- package/dist/{chunk-CM5EZD5F.js → chunk-UIE3R5XU.js} +1 -1
- package/dist/{chunk-JPQISMMJ.js → chunk-VSAFV2GI.js} +7 -6
- package/dist/{chunk-3ECW2K2O.js → chunk-WR7H7VLJ.js} +2 -2
- package/dist/{chunk-TPTJEHUE.js → chunk-X2IPNCB5.js} +61 -25
- package/dist/{chunk-UWGTSF5O.js → chunk-ZIX4PNBI.js} +129 -91
- package/dist/{chunk-PWC24W5F.js → chunk-ZSHL44IQ.js} +2 -2
- package/dist/cli/chat.js +21 -21
- package/dist/cli/check.js +3 -3
- package/dist/cli/plugins.js +9 -9
- package/dist/cli/snapshot-warmup.js +5 -5
- package/dist/cli/upgrade.js +85 -13
- package/dist/db/postgres-json.d.ts +5 -0
- package/dist/{db-RCZB7KNM.js → db-6QP6HY7U.js} +4 -4
- package/dist/{detail-4EPUMSDU.js → detail-OEIVZYXS.js} +11 -11
- package/dist/{detail-CD4SPJ4K.js → detail-U6IP2Z4N.js} +6 -6
- package/dist/instrumentation.js +2 -2
- package/dist/{legacy-import-VCYLWT2V.js → legacy-import-R3BMM2GH.js} +5 -5
- package/dist/{list-J6ROVH56.js → list-AJ6RWBOG.js} +7 -7
- package/dist/list-UMZKA5AI.js +121 -0
- package/dist/{list-7L5LY2WU.js → list-Z3CC52CZ.js} +6 -6
- package/dist/{plugin-conversations-JANXC4GA.js → plugin-conversations-F3IBVNFX.js} +7 -7
- package/dist/{profile-6NRWEKMZ.js → profile-CQMPFKED.js} +7 -7
- package/dist/{runner-CZIKSWGC.js → runner-C2ZTIOUD.js} +12 -12
- package/dist/{skills-MAZXZ2KE.js → skills-722AXRV5.js} +3 -3
- package/dist/{stats-Q5FRUXLY.js → stats-ZYFQFCTL.js} +5 -5
- package/dist/{subagent-YIINCFAS.js → subagent-X3ZWJHR4.js} +10 -10
- package/dist/{validation-FMEAEKCY.js → validation-EUI2UFRM.js} +3 -3
- package/package.json +5 -5
- package/dist/list-DA2ATOM4.js +0 -80
|
@@ -11,17 +11,17 @@ 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-X2IPNCB5.js";
|
|
15
|
+
import "./chunk-IQ36I3DF.js";
|
|
16
|
+
import "./chunk-ZSHL44IQ.js";
|
|
17
|
+
import "./chunk-QZGVPPIJ.js";
|
|
18
18
|
import "./chunk-G3E7SCME.js";
|
|
19
19
|
import "./chunk-4ZNGQH7C.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-SHBPSE7A.js";
|
|
21
21
|
import "./chunk-FXFQNHRU.js";
|
|
22
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-RT5BUHR5.js";
|
|
23
23
|
import "./chunk-B7PUBQQM.js";
|
|
24
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-AEWZ7F65.js";
|
|
25
25
|
import "./chunk-OB42YVAE.js";
|
|
26
26
|
import "./chunk-6GWA276C.js";
|
|
27
27
|
import "./chunk-7FBGKXPE.js";
|
|
@@ -45,6 +45,11 @@ export declare const actorActivityDayReportSchema: z.ZodObject<{
|
|
|
45
45
|
failed: z.ZodNumber;
|
|
46
46
|
tokens: z.ZodOptional<z.ZodNumber>;
|
|
47
47
|
}, z.core.$strict>;
|
|
48
|
+
export declare const peopleActivityDayReportSchema: z.ZodObject<{
|
|
49
|
+
activePeople: z.ZodNumber;
|
|
50
|
+
conversations: z.ZodNumber;
|
|
51
|
+
date: z.ZodString;
|
|
52
|
+
}, z.core.$strict>;
|
|
48
53
|
export declare const actorTotalsReportSchema: z.ZodObject<{
|
|
49
54
|
active: z.ZodNumber;
|
|
50
55
|
activeDays: z.ZodNumber;
|
|
@@ -76,6 +81,11 @@ export declare const actorSummaryReportSchema: z.ZodObject<{
|
|
|
76
81
|
}, z.core.$strict>;
|
|
77
82
|
}, z.core.$strict>;
|
|
78
83
|
export declare const actorDirectoryReportSchema: z.ZodObject<{
|
|
84
|
+
activityDays: z.ZodArray<z.ZodObject<{
|
|
85
|
+
activePeople: z.ZodNumber;
|
|
86
|
+
conversations: z.ZodNumber;
|
|
87
|
+
date: z.ZodString;
|
|
88
|
+
}, z.core.$strict>>;
|
|
79
89
|
generatedAt: z.ZodString;
|
|
80
90
|
people: z.ZodArray<z.ZodObject<{
|
|
81
91
|
active: z.ZodNumber;
|
|
@@ -94,6 +104,8 @@ export declare const actorDirectoryReportSchema: z.ZodObject<{
|
|
|
94
104
|
}, z.core.$strict>;
|
|
95
105
|
}, z.core.$strict>>;
|
|
96
106
|
source: z.ZodLiteral<"conversation_index">;
|
|
107
|
+
windowEnd: z.ZodString;
|
|
108
|
+
windowStart: z.ZodString;
|
|
97
109
|
}, z.core.$strict>;
|
|
98
110
|
export declare const actorProfileReportSchema: z.ZodObject<{
|
|
99
111
|
activityDays: z.ZodArray<z.ZodObject<{
|
|
@@ -172,6 +184,7 @@ export type ActorIdentity = z.infer<typeof actorIdentitySchema>;
|
|
|
172
184
|
export type ConversationSummaryReport = z.infer<typeof peopleConversationSummaryReportSchema>;
|
|
173
185
|
export type ConversationStatsItem = z.infer<typeof peopleConversationStatsItemSchema>;
|
|
174
186
|
export type ActorActivityDayReport = z.infer<typeof actorActivityDayReportSchema>;
|
|
187
|
+
export type PeopleActivityDayReport = z.infer<typeof peopleActivityDayReportSchema>;
|
|
175
188
|
export type ActorTotalsReport = z.infer<typeof actorTotalsReportSchema>;
|
|
176
189
|
export type ActorSummaryReport = z.infer<typeof actorSummaryReportSchema>;
|
|
177
190
|
export type ActorDirectoryReport = z.infer<typeof actorDirectoryReportSchema>;
|
package/dist/api/schema.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export type { ActorIdentity, ConversationActivityReport, ConversationActivitySta
|
|
|
5
5
|
export { actorDirectoryReportSchema, actorProfileReportSchema, } from "./people/schema";
|
|
6
6
|
export { locationDetailReportSchema, locationDirectoryReportSchema, } from "./locations/schema";
|
|
7
7
|
export type { LocationActorSummaryReport, LocationDetailReport, LocationDirectoryReport, LocationSummaryReport, } from "./locations/schema";
|
|
8
|
-
export type { ActorActivityDayReport, ActorDirectoryReport, ActorProfileReport, ActorSummaryReport, ActorTotalsReport, } from "./people/schema";
|
|
8
|
+
export type { ActorActivityDayReport, ActorDirectoryReport, ActorProfileReport, ActorSummaryReport, ActorTotalsReport, PeopleActivityDayReport, } from "./people/schema";
|
|
9
9
|
export { healthReportSchema, pluginOperationalReportFeedSchema, pluginOperationalReportSchema, pluginPackageContentItemReportSchema, pluginPackageContentReportSchema, pluginReportSchema, pluginReportsSchema, runtimeInfoReportSchema, skillReportSchema, skillReportsSchema, } from "../reporting-schema";
|
|
10
10
|
export type { HealthReport, PluginOperationalReport, PluginOperationalReportFeed, PluginPackageContentItemReport, PluginPackageContentReport, PluginReport, PluginReports, RuntimeInfoReport, SkillReport, SkillReports, } from "../reporting-schema";
|
|
11
11
|
import { z } from "zod";
|
package/dist/api/schema.js
CHANGED
package/dist/api.js
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
subagentParamsSchema
|
|
7
7
|
} from "./chunk-2RNOB32R.js";
|
|
8
8
|
import "./chunk-HNIT4HXU.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-4YN2ZXKB.js";
|
|
10
10
|
import "./chunk-HYDQULR2.js";
|
|
11
11
|
import {
|
|
12
12
|
readHealthReport
|
|
@@ -37,7 +37,7 @@ function readDescriptionText(home) {
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
async function readSkillReports() {
|
|
40
|
-
const { discoverSkills } = await import("./skills-
|
|
40
|
+
const { discoverSkills } = await import("./skills-722AXRV5.js");
|
|
41
41
|
const skills = await discoverSkills();
|
|
42
42
|
return skillReportsSchema.parse(
|
|
43
43
|
skills.map((skill) => ({
|
|
@@ -47,7 +47,7 @@ async function readSkillReports() {
|
|
|
47
47
|
);
|
|
48
48
|
}
|
|
49
49
|
async function readPluginReports() {
|
|
50
|
-
const { pluginCatalogRuntime } = await import("./catalog-runtime-
|
|
50
|
+
const { pluginCatalogRuntime } = await import("./catalog-runtime-5CVM2DOF.js");
|
|
51
51
|
return pluginReportsSchema.parse(
|
|
52
52
|
pluginCatalogRuntime.getProviders().map((plugin) => ({
|
|
53
53
|
name: plugin.manifest.name
|
|
@@ -57,7 +57,7 @@ async function readPluginReports() {
|
|
|
57
57
|
async function readRuntimeInfoReport() {
|
|
58
58
|
const [{ homeDir }, { pluginCatalogRuntime }, plugins, skills] = await Promise.all([
|
|
59
59
|
import("./discovery-RMHYSRL7.js"),
|
|
60
|
-
import("./catalog-runtime-
|
|
60
|
+
import("./catalog-runtime-5CVM2DOF.js"),
|
|
61
61
|
readPluginReports(),
|
|
62
62
|
readSkillReports()
|
|
63
63
|
]);
|
|
@@ -73,11 +73,11 @@ async function readRuntimeInfoReport() {
|
|
|
73
73
|
}
|
|
74
74
|
async function readPluginOperationalReportFeed() {
|
|
75
75
|
const listRecent = async (listOptions) => {
|
|
76
|
-
const { listRecentConversationSummaries } = await import("./plugin-conversations-
|
|
76
|
+
const { listRecentConversationSummaries } = await import("./plugin-conversations-F3IBVNFX.js");
|
|
77
77
|
return listRecentConversationSummaries(listOptions?.limit);
|
|
78
78
|
};
|
|
79
79
|
const nowMs = Date.now();
|
|
80
|
-
const { getPluginOperationalReports } = await import("./agent-hooks-
|
|
80
|
+
const { getPluginOperationalReports } = await import("./agent-hooks-I4I2DHSW.js");
|
|
81
81
|
return pluginOperationalReportFeedSchema.parse({
|
|
82
82
|
source: "plugins",
|
|
83
83
|
generatedAt: new Date(nowMs).toISOString(),
|
|
@@ -126,7 +126,7 @@ function createJuniorApi() {
|
|
|
126
126
|
return Response.json(await readPluginOperationalReportFeed());
|
|
127
127
|
});
|
|
128
128
|
app.get("/api/conversations", async (c) => {
|
|
129
|
-
const { readConversationFeed } = await import("./list-
|
|
129
|
+
const { readConversationFeed } = await import("./list-AJ6RWBOG.js");
|
|
130
130
|
const { actorEmail } = parseQuery(
|
|
131
131
|
conversationFeedQuerySchema,
|
|
132
132
|
c.req.query()
|
|
@@ -134,11 +134,11 @@ function createJuniorApi() {
|
|
|
134
134
|
return Response.json(await readConversationFeed({ actorEmail }));
|
|
135
135
|
});
|
|
136
136
|
app.get("/api/conversations/stats", async () => {
|
|
137
|
-
const { readConversationStats } = await import("./stats-
|
|
137
|
+
const { readConversationStats } = await import("./stats-ZYFQFCTL.js");
|
|
138
138
|
return Response.json(await readConversationStats());
|
|
139
139
|
});
|
|
140
140
|
app.get("/api/conversations/:conversationId", async (c) => {
|
|
141
|
-
const { readConversationDetail } = await import("./detail-
|
|
141
|
+
const { readConversationDetail } = await import("./detail-OEIVZYXS.js");
|
|
142
142
|
const { conversationId } = parseParams(
|
|
143
143
|
conversationParamsSchema,
|
|
144
144
|
c.req.param()
|
|
@@ -149,7 +149,7 @@ function createJuniorApi() {
|
|
|
149
149
|
app.get(
|
|
150
150
|
"/api/conversations/:conversationId/subagents/:subagentId",
|
|
151
151
|
async (c) => {
|
|
152
|
-
const { readConversationSubagent } = await import("./subagent-
|
|
152
|
+
const { readConversationSubagent } = await import("./subagent-X3ZWJHR4.js");
|
|
153
153
|
const { conversationId, subagentId } = parseParams(
|
|
154
154
|
subagentParamsSchema,
|
|
155
155
|
c.req.param()
|
|
@@ -159,21 +159,21 @@ function createJuniorApi() {
|
|
|
159
159
|
}
|
|
160
160
|
);
|
|
161
161
|
app.get("/api/people", async () => {
|
|
162
|
-
const { readPeopleList } = await import("./list-
|
|
162
|
+
const { readPeopleList } = await import("./list-UMZKA5AI.js");
|
|
163
163
|
return Response.json(await readPeopleList());
|
|
164
164
|
});
|
|
165
165
|
app.get("/api/people/:email", async (c) => {
|
|
166
166
|
const { email } = parseParams(personParamsSchema, c.req.param());
|
|
167
|
-
const { readPeopleProfile } = await import("./profile-
|
|
167
|
+
const { readPeopleProfile } = await import("./profile-CQMPFKED.js");
|
|
168
168
|
return Response.json(await readPeopleProfile(email));
|
|
169
169
|
});
|
|
170
170
|
app.get("/api/locations", async () => {
|
|
171
|
-
const { readLocationDirectory } = await import("./list-
|
|
171
|
+
const { readLocationDirectory } = await import("./list-Z3CC52CZ.js");
|
|
172
172
|
return Response.json(await readLocationDirectory());
|
|
173
173
|
});
|
|
174
174
|
app.get("/api/locations/:locationId", async (c) => {
|
|
175
175
|
const { locationId } = parseParams(locationParamsSchema, c.req.param());
|
|
176
|
-
const { readLocationDetail } = await import("./detail-
|
|
176
|
+
const { readLocationDetail } = await import("./detail-U6IP2Z4N.js");
|
|
177
177
|
const report = await readLocationDetail(locationId);
|
|
178
178
|
return report ? Response.json(report) : Response.json({ error: "Location not found." }, { status: 404 });
|
|
179
179
|
});
|
package/dist/app.js
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
processPluginTask,
|
|
6
6
|
requireTurnFailureEventId,
|
|
7
7
|
scheduleSessionCompletedPluginTasks
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-DTUSCR2Y.js";
|
|
9
9
|
import {
|
|
10
10
|
buildSentryConversationUrl
|
|
11
11
|
} from "./chunk-LVUKF5CE.js";
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
conversationVisibilityFromSlackChannelType,
|
|
14
14
|
resolveSlackChannelTypeFromMessage,
|
|
15
15
|
resolveSlackConversationContext
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-EMUZSROX.js";
|
|
17
17
|
import {
|
|
18
18
|
CONVERSATION_WORK_CHECK_IN_INTERVAL_MS,
|
|
19
19
|
CONVERSATION_WORK_STALE_ENQUEUE_MS,
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
requestConversationContinuation,
|
|
38
38
|
requestConversationWork,
|
|
39
39
|
startConversationWork
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-3UK5DFKW.js";
|
|
41
41
|
import {
|
|
42
42
|
GET
|
|
43
43
|
} from "./chunk-QNVHH5PU.js";
|
|
@@ -55,7 +55,7 @@ import {
|
|
|
55
55
|
import {
|
|
56
56
|
validatePluginEgressCredentialHooks,
|
|
57
57
|
validatePluginRegistrations
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-MJSJAHBW.js";
|
|
59
59
|
import {
|
|
60
60
|
defineJuniorPlugins,
|
|
61
61
|
pluginCatalogConfigFromEnv,
|
|
@@ -106,7 +106,7 @@ import {
|
|
|
106
106
|
splitSlackReplyText,
|
|
107
107
|
startOAuthFlow,
|
|
108
108
|
truncateStatusText
|
|
109
|
-
} from "./chunk-
|
|
109
|
+
} from "./chunk-ZIX4PNBI.js";
|
|
110
110
|
import {
|
|
111
111
|
CooperativeTurnYieldError,
|
|
112
112
|
TurnInputCommitLostError,
|
|
@@ -134,7 +134,7 @@ import {
|
|
|
134
134
|
persistWithRetry,
|
|
135
135
|
persistYieldSessionRecord,
|
|
136
136
|
startActiveTurn
|
|
137
|
-
} from "./chunk-
|
|
137
|
+
} from "./chunk-5K4N73TP.js";
|
|
138
138
|
import {
|
|
139
139
|
JUNIOR_THREAD_STATE_TTL_MS,
|
|
140
140
|
coerceThreadConversationState
|
|
@@ -145,13 +145,13 @@ import {
|
|
|
145
145
|
getAgentTurnSessionRecord,
|
|
146
146
|
listAgentTurnSessionSummariesForConversation,
|
|
147
147
|
recordAgentTurnSessionSummary
|
|
148
|
-
} from "./chunk-
|
|
148
|
+
} from "./chunk-EOB77KME.js";
|
|
149
149
|
import {
|
|
150
150
|
commitMessages,
|
|
151
151
|
loadConversationProjection,
|
|
152
152
|
loadProjection,
|
|
153
153
|
recordAuthorizationCompleted
|
|
154
|
-
} from "./chunk-
|
|
154
|
+
} from "./chunk-B5QS4AVO.js";
|
|
155
155
|
import {
|
|
156
156
|
buildConversationContext,
|
|
157
157
|
createConversationMemoryService,
|
|
@@ -166,11 +166,12 @@ import {
|
|
|
166
166
|
persistConversationMessages,
|
|
167
167
|
updateConversationStats,
|
|
168
168
|
upsertConversationMessage
|
|
169
|
-
} from "./chunk-
|
|
170
|
-
import "./chunk-
|
|
169
|
+
} from "./chunk-VSAFV2GI.js";
|
|
170
|
+
import "./chunk-3OABPOHR.js";
|
|
171
171
|
import "./chunk-PDO5BLNM.js";
|
|
172
|
-
import "./chunk-
|
|
172
|
+
import "./chunk-UIE3R5XU.js";
|
|
173
173
|
import {
|
|
174
|
+
bindScheduledTaskCredentialSubject,
|
|
174
175
|
bindSlackDirectCredentialSubject,
|
|
175
176
|
getPluginApiRoutes,
|
|
176
177
|
getPluginRoutes,
|
|
@@ -178,8 +179,9 @@ import {
|
|
|
178
179
|
getPlugins,
|
|
179
180
|
setPlugins,
|
|
180
181
|
validatePlugins,
|
|
182
|
+
verifyScheduledTaskCredentialSubject,
|
|
181
183
|
verifySlackDirectCredentialSubject
|
|
182
|
-
} from "./chunk-
|
|
184
|
+
} from "./chunk-X2IPNCB5.js";
|
|
183
185
|
import {
|
|
184
186
|
SlackActionError,
|
|
185
187
|
downloadPrivateSlackFile,
|
|
@@ -190,11 +192,11 @@ import {
|
|
|
190
192
|
normalizeSlackConversationId,
|
|
191
193
|
runWithSlackInstallationToken,
|
|
192
194
|
runWithWorkspaceTeamId
|
|
193
|
-
} from "./chunk-
|
|
195
|
+
} from "./chunk-IQ36I3DF.js";
|
|
194
196
|
import {
|
|
195
197
|
createPluginLogger,
|
|
196
198
|
createPluginState
|
|
197
|
-
} from "./chunk-
|
|
199
|
+
} from "./chunk-ZSHL44IQ.js";
|
|
198
200
|
import {
|
|
199
201
|
contextProvenance,
|
|
200
202
|
getConversationStore,
|
|
@@ -204,7 +206,7 @@ import {
|
|
|
204
206
|
juniorAgentSteps,
|
|
205
207
|
juniorConversationMessages,
|
|
206
208
|
juniorConversations
|
|
207
|
-
} from "./chunk-
|
|
209
|
+
} from "./chunk-QZGVPPIJ.js";
|
|
208
210
|
import "./chunk-G3E7SCME.js";
|
|
209
211
|
import {
|
|
210
212
|
sleep
|
|
@@ -232,7 +234,7 @@ import {
|
|
|
232
234
|
setSlackReactionConfig,
|
|
233
235
|
stripRuntimeTurnContext,
|
|
234
236
|
trimTrailingAssistantMessages
|
|
235
|
-
} from "./chunk-
|
|
237
|
+
} from "./chunk-SHBPSE7A.js";
|
|
236
238
|
import {
|
|
237
239
|
juniorDestinations
|
|
238
240
|
} from "./chunk-FXFQNHRU.js";
|
|
@@ -241,7 +243,7 @@ import {
|
|
|
241
243
|
readSlackRawMessageContext,
|
|
242
244
|
resolveSlackChannelIdFromMessage,
|
|
243
245
|
resolveSlackChannelIdFromThreadId
|
|
244
|
-
} from "./chunk-
|
|
246
|
+
} from "./chunk-RT5BUHR5.js";
|
|
245
247
|
import {
|
|
246
248
|
createSlackDestination,
|
|
247
249
|
destinationKey,
|
|
@@ -251,13 +253,14 @@ import {
|
|
|
251
253
|
} from "./chunk-B7PUBQQM.js";
|
|
252
254
|
import {
|
|
253
255
|
discoverSkills
|
|
254
|
-
} from "./chunk-
|
|
256
|
+
} from "./chunk-WR7H7VLJ.js";
|
|
255
257
|
import {
|
|
256
258
|
buildOAuthTokenRequest,
|
|
259
|
+
credentialSubjectSchema,
|
|
257
260
|
hasRequiredOAuthScope,
|
|
258
261
|
parseOAuthTokenResponse,
|
|
259
262
|
pluginCatalogRuntime
|
|
260
|
-
} from "./chunk-
|
|
263
|
+
} from "./chunk-77LHNQK4.js";
|
|
261
264
|
import {
|
|
262
265
|
buildTurnFailureResponse,
|
|
263
266
|
createActor,
|
|
@@ -279,7 +282,7 @@ import {
|
|
|
279
282
|
setTags,
|
|
280
283
|
withContext,
|
|
281
284
|
withSpan
|
|
282
|
-
} from "./chunk-
|
|
285
|
+
} from "./chunk-AEWZ7F65.js";
|
|
283
286
|
import {
|
|
284
287
|
toOptionalString
|
|
285
288
|
} from "./chunk-OB42YVAE.js";
|
|
@@ -570,7 +573,6 @@ async function verifyDispatchCallbackRequest(request) {
|
|
|
570
573
|
// src/chat/agent-dispatch/store.ts
|
|
571
574
|
import { createHash } from "crypto";
|
|
572
575
|
import {
|
|
573
|
-
pluginCredentialSubjectSchema,
|
|
574
576
|
destinationSchema,
|
|
575
577
|
isSlackDestination,
|
|
576
578
|
sourceSchema
|
|
@@ -596,20 +598,11 @@ var dispatchActorSchema = z.object({
|
|
|
596
598
|
platform: z.literal("system"),
|
|
597
599
|
name: nonEmptyExactStringSchema
|
|
598
600
|
}).strict();
|
|
599
|
-
var credentialSubjectBindingSchema = z.object({
|
|
600
|
-
type: z.literal("slack-direct-conversation"),
|
|
601
|
-
teamId: z.string().min(1),
|
|
602
|
-
channelId: z.string().min(1),
|
|
603
|
-
signature: z.string().min(1)
|
|
604
|
-
}).strict();
|
|
605
|
-
var boundCredentialSubjectSchema = pluginCredentialSubjectSchema.extend({
|
|
606
|
-
binding: credentialSubjectBindingSchema
|
|
607
|
-
}).strict();
|
|
608
601
|
var dispatchRecordSchema = z.object({
|
|
609
602
|
actor: dispatchActorSchema,
|
|
610
603
|
attempt: z.number().int().nonnegative(),
|
|
611
604
|
createdAtMs: z.number().finite(),
|
|
612
|
-
credentialSubject:
|
|
605
|
+
credentialSubject: credentialSubjectSchema.optional(),
|
|
613
606
|
destination: destinationSchema,
|
|
614
607
|
errorMessage: z.string().optional(),
|
|
615
608
|
id: nonEmptyExactStringSchema,
|
|
@@ -638,18 +631,28 @@ var dispatchRecordSchema = z.object({
|
|
|
638
631
|
if (!subject) {
|
|
639
632
|
return;
|
|
640
633
|
}
|
|
641
|
-
if (
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
634
|
+
if (subject.allowedWhen === "private-direct-conversation") {
|
|
635
|
+
if (!record.destination.channelId.startsWith("D")) {
|
|
636
|
+
ctx.addIssue({
|
|
637
|
+
code: z.ZodIssueCode.custom,
|
|
638
|
+
message: "Dispatch credentialSubject requires a private direct Slack destination",
|
|
639
|
+
path: ["credentialSubject"]
|
|
640
|
+
});
|
|
641
|
+
return;
|
|
642
|
+
}
|
|
643
|
+
if (subject.binding.type !== "slack-direct-conversation" || subject.binding.teamId !== record.destination.teamId || subject.binding.channelId !== record.destination.channelId) {
|
|
644
|
+
ctx.addIssue({
|
|
645
|
+
code: z.ZodIssueCode.custom,
|
|
646
|
+
message: "Dispatch credentialSubject binding must match destination",
|
|
647
|
+
path: ["credentialSubject", "binding"]
|
|
648
|
+
});
|
|
649
|
+
}
|
|
647
650
|
return;
|
|
648
651
|
}
|
|
649
|
-
if (subject.binding.
|
|
652
|
+
if (subject.binding.type !== "scheduled-task" || subject.binding.plugin !== record.plugin || subject.binding.taskId !== subject.taskId) {
|
|
650
653
|
ctx.addIssue({
|
|
651
654
|
code: z.ZodIssueCode.custom,
|
|
652
|
-
message: "Dispatch credentialSubject binding must match
|
|
655
|
+
message: "Dispatch credentialSubject binding must match task",
|
|
653
656
|
path: ["credentialSubject", "binding"]
|
|
654
657
|
});
|
|
655
658
|
}
|
|
@@ -2745,7 +2748,7 @@ function dispatchOptionsErrorMessage(issues) {
|
|
|
2745
2748
|
return "Dispatch credentialSubject userId is required";
|
|
2746
2749
|
}
|
|
2747
2750
|
if (hasIssueUnderPath(issues, ["credentialSubject", "allowedWhen"])) {
|
|
2748
|
-
return "Dispatch credentialSubject allowedWhen
|
|
2751
|
+
return "Dispatch credentialSubject allowedWhen is invalid";
|
|
2749
2752
|
}
|
|
2750
2753
|
if (hasIssueUnderPath(issues, ["credentialSubject"])) {
|
|
2751
2754
|
return "Dispatch credentialSubject type must be user";
|
|
@@ -2772,26 +2775,27 @@ function validateDispatchOptions(options) {
|
|
|
2772
2775
|
throw new Error("Dispatch destination platform must be slack");
|
|
2773
2776
|
}
|
|
2774
2777
|
if (credentialSubject !== void 0) {
|
|
2775
|
-
if (!isDmChannel(destination.channelId)) {
|
|
2778
|
+
if (credentialSubject.allowedWhen === "private-direct-conversation" && !isDmChannel(destination.channelId)) {
|
|
2776
2779
|
throw new Error(
|
|
2777
2780
|
"Dispatch credentialSubject requires a private direct Slack destination"
|
|
2778
2781
|
);
|
|
2779
2782
|
}
|
|
2780
2783
|
}
|
|
2781
2784
|
}
|
|
2782
|
-
async function verifyDispatchCredentialSubjectAccess(options) {
|
|
2785
|
+
async function verifyDispatchCredentialSubjectAccess(options, plugin) {
|
|
2783
2786
|
if (!options.credentialSubject) {
|
|
2784
2787
|
return;
|
|
2785
2788
|
}
|
|
2786
|
-
const verified =
|
|
2789
|
+
const verified = options.credentialSubject.allowedWhen === "scheduled-task" ? verifyScheduledTaskCredentialSubject({
|
|
2790
|
+
plugin,
|
|
2791
|
+
subject: options.credentialSubject
|
|
2792
|
+
}) : verifySlackDirectCredentialSubject({
|
|
2787
2793
|
channelId: options.destination.channelId,
|
|
2788
2794
|
teamId: options.destination.teamId,
|
|
2789
2795
|
subject: options.credentialSubject
|
|
2790
2796
|
});
|
|
2791
2797
|
if (!verified) {
|
|
2792
|
-
throw new Error(
|
|
2793
|
-
"Dispatch credentialSubject must match the private direct Slack destination"
|
|
2794
|
-
);
|
|
2798
|
+
throw new Error("Dispatch credentialSubject is not valid for this action");
|
|
2795
2799
|
}
|
|
2796
2800
|
}
|
|
2797
2801
|
|
|
@@ -2803,7 +2807,7 @@ function shouldScheduleDispatch(record, nowMs) {
|
|
|
2803
2807
|
}
|
|
2804
2808
|
return record.status !== "running" || typeof record.leaseExpiresAtMs !== "number" || record.leaseExpiresAtMs <= nowMs;
|
|
2805
2809
|
}
|
|
2806
|
-
function bindDispatchCredentialSubject(options) {
|
|
2810
|
+
function bindDispatchCredentialSubject(options, plugin) {
|
|
2807
2811
|
const { credentialSubject, ...baseOptions } = options;
|
|
2808
2812
|
if (!credentialSubject) {
|
|
2809
2813
|
return baseOptions;
|
|
@@ -2811,15 +2815,16 @@ function bindDispatchCredentialSubject(options) {
|
|
|
2811
2815
|
if ("binding" in credentialSubject) {
|
|
2812
2816
|
throw new Error("Dispatch credentialSubject binding is runtime-owned");
|
|
2813
2817
|
}
|
|
2814
|
-
const boundSubject =
|
|
2818
|
+
const boundSubject = credentialSubject.allowedWhen === "scheduled-task" ? bindScheduledTaskCredentialSubject({
|
|
2819
|
+
plugin,
|
|
2820
|
+
subject: credentialSubject
|
|
2821
|
+
}) : bindSlackDirectCredentialSubject({
|
|
2815
2822
|
channelId: options.destination.channelId,
|
|
2816
2823
|
teamId: options.destination.teamId,
|
|
2817
2824
|
subject: credentialSubject
|
|
2818
2825
|
});
|
|
2819
2826
|
if (!boundSubject) {
|
|
2820
|
-
throw new Error(
|
|
2821
|
-
"Dispatch credentialSubject must match the private direct Slack destination"
|
|
2822
|
-
);
|
|
2827
|
+
throw new Error("Dispatch credentialSubject is not valid for this action");
|
|
2823
2828
|
}
|
|
2824
2829
|
return {
|
|
2825
2830
|
...baseOptions,
|
|
@@ -2838,11 +2843,17 @@ function createHeartbeatContext(args) {
|
|
|
2838
2843
|
agent: {
|
|
2839
2844
|
async dispatch(options) {
|
|
2840
2845
|
validateDispatchOptions(options);
|
|
2841
|
-
const dispatchOptions = bindDispatchCredentialSubject(
|
|
2846
|
+
const dispatchOptions = bindDispatchCredentialSubject(
|
|
2847
|
+
options,
|
|
2848
|
+
pluginName
|
|
2849
|
+
);
|
|
2842
2850
|
if (dispatchCount >= MAX_DISPATCHES_PER_HEARTBEAT) {
|
|
2843
2851
|
throw new Error("Plugin heartbeat exceeded the dispatch limit");
|
|
2844
2852
|
}
|
|
2845
|
-
await verifyDispatchCredentialSubjectAccess(
|
|
2853
|
+
await verifyDispatchCredentialSubjectAccess(
|
|
2854
|
+
dispatchOptions,
|
|
2855
|
+
pluginName
|
|
2856
|
+
);
|
|
2846
2857
|
const result = await createOrGetDispatch({
|
|
2847
2858
|
plugin: pluginName,
|
|
2848
2859
|
options: dispatchOptions,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PiMessage } from "@/chat/pi/messages";
|
|
2
2
|
import { type LogContext } from "@/chat/logging";
|
|
3
|
-
import {
|
|
3
|
+
import type { ConversationPrivacy } from "@/chat/conversation-privacy";
|
|
4
4
|
import type { SkillInvocation, SkillMetadata } from "@/chat/skills";
|
|
5
5
|
import type { ActiveMcpCatalogSummary } from "@/chat/tool-support/skill/mcp-tool-summary";
|
|
6
6
|
import type { ToolRuntimeContext } from "@/chat/tools/types";
|
|
@@ -2,4 +2,4 @@ import type { BoundDispatchOptions, SlackDispatchOptions } from "./types";
|
|
|
2
2
|
/** Validate plugin-provided dispatch options before core persists them. */
|
|
3
3
|
export declare function validateDispatchOptions(options: unknown): asserts options is SlackDispatchOptions;
|
|
4
4
|
/** Verify runtime-owned access requirements for delegated dispatch credentials. */
|
|
5
|
-
export declare function verifyDispatchCredentialSubjectAccess(options: BoundDispatchOptions): Promise<void>;
|
|
5
|
+
export declare function verifyDispatchCredentialSubjectAccess(options: BoundDispatchOptions, plugin: string): Promise<void>;
|
|
@@ -25,14 +25,10 @@ export declare function canExposeConversationPayload(input: {
|
|
|
25
25
|
export declare function getCurrentConversationPrivacy(): ConversationPrivacy | undefined;
|
|
26
26
|
/** Bind one conversation privacy mode to all async work in a turn. */
|
|
27
27
|
export declare function runWithConversationPrivacy<T>(privacy: ConversationPrivacy, callback: () => T): T;
|
|
28
|
-
/** Convert a GenAI message into safe metadata for private trace contexts. */
|
|
29
|
-
export declare function toGenAiMessageMetadata(message: unknown): Record<string, unknown>;
|
|
30
|
-
/** Convert raw text into size-only metadata for private trace contexts. */
|
|
31
|
-
export declare function toGenAiTextMetadata(text: string): Record<string, unknown>;
|
|
32
28
|
/** Convert an arbitrary payload into safe structured metadata for trace data fields. */
|
|
33
29
|
export declare function toGenAiPayloadMetadata(payload: unknown): Record<string, unknown>;
|
|
34
30
|
/** Convert an arbitrary payload into safe flattened trace attributes. */
|
|
35
|
-
export declare function toGenAiPayloadTraceAttributes(prefix:
|
|
31
|
+
export declare function toGenAiPayloadTraceAttributes(prefix: "gen_ai.tool.call.arguments" | "gen_ai.tool.call.result", payload: unknown): Record<string, TraceAttributeValue>;
|
|
36
32
|
/**
|
|
37
33
|
* Map a pi-ai AssistantMessage to the canonical gen_ai.output.messages shape:
|
|
38
34
|
* `{ role, parts: [...], finish_reason }` — drops provider noise fields.
|
|
@@ -44,5 +40,5 @@ export declare function toCanonicalOutputMessage(message: AssistantMessage): Rec
|
|
|
44
40
|
*/
|
|
45
41
|
export declare function toCanonicalInputMessage(message: Message): Record<string, unknown>;
|
|
46
42
|
/** Summarize a message list without exposing raw message content. */
|
|
47
|
-
export declare function toGenAiMessagesTraceAttributes(prefix:
|
|
43
|
+
export declare function toGenAiMessagesTraceAttributes(prefix: "gen_ai.input" | "gen_ai.output", messages: unknown[]): Record<string, TraceAttributeValue>;
|
|
48
44
|
export {};
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
declare const credentialSubjectBindingSchema: z.ZodObject<{
|
|
2
|
+
declare const credentialSubjectBindingSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
3
3
|
type: z.ZodLiteral<"slack-direct-conversation">;
|
|
4
4
|
teamId: z.ZodString;
|
|
5
5
|
channelId: z.ZodString;
|
|
6
6
|
signature: z.ZodString;
|
|
7
|
-
}, z.core.$strict
|
|
7
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
8
|
+
type: z.ZodLiteral<"scheduled-task">;
|
|
9
|
+
plugin: z.ZodString;
|
|
10
|
+
taskId: z.ZodString;
|
|
11
|
+
signature: z.ZodString;
|
|
12
|
+
}, z.core.$strict>], "type">;
|
|
8
13
|
declare const credentialSystemActorSchema: z.ZodObject<{
|
|
9
14
|
platform: z.ZodLiteral<"system">;
|
|
10
15
|
name: z.ZodString;
|
|
11
16
|
}, z.core.$strict>;
|
|
12
|
-
export declare const credentialSubjectSchema: z.ZodObject<{
|
|
17
|
+
export declare const credentialSubjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
13
18
|
type: z.ZodLiteral<"user">;
|
|
14
19
|
userId: z.ZodString;
|
|
15
20
|
allowedWhen: z.ZodLiteral<"private-direct-conversation">;
|
|
@@ -19,7 +24,18 @@ export declare const credentialSubjectSchema: z.ZodObject<{
|
|
|
19
24
|
channelId: z.ZodString;
|
|
20
25
|
signature: z.ZodString;
|
|
21
26
|
}, z.core.$strict>;
|
|
22
|
-
}, z.core.$strict
|
|
27
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
28
|
+
type: z.ZodLiteral<"user">;
|
|
29
|
+
userId: z.ZodString;
|
|
30
|
+
allowedWhen: z.ZodLiteral<"scheduled-task">;
|
|
31
|
+
taskId: z.ZodString;
|
|
32
|
+
binding: z.ZodObject<{
|
|
33
|
+
type: z.ZodLiteral<"scheduled-task">;
|
|
34
|
+
plugin: z.ZodString;
|
|
35
|
+
taskId: z.ZodString;
|
|
36
|
+
signature: z.ZodString;
|
|
37
|
+
}, z.core.$strict>;
|
|
38
|
+
}, z.core.$strict>], "allowedWhen">;
|
|
23
39
|
export declare const credentialContextSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
24
40
|
actor: z.ZodObject<{
|
|
25
41
|
type: z.ZodLiteral<"user">;
|
|
@@ -30,7 +46,7 @@ export declare const credentialContextSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
30
46
|
platform: z.ZodLiteral<"system">;
|
|
31
47
|
name: z.ZodString;
|
|
32
48
|
}, z.core.$strict>;
|
|
33
|
-
subject: z.ZodOptional<z.ZodObject<{
|
|
49
|
+
subject: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
34
50
|
type: z.ZodLiteral<"user">;
|
|
35
51
|
userId: z.ZodString;
|
|
36
52
|
allowedWhen: z.ZodLiteral<"private-direct-conversation">;
|
|
@@ -40,7 +56,18 @@ export declare const credentialContextSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
40
56
|
channelId: z.ZodString;
|
|
41
57
|
signature: z.ZodString;
|
|
42
58
|
}, z.core.$strict>;
|
|
43
|
-
}, z.core.$strict
|
|
59
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
60
|
+
type: z.ZodLiteral<"user">;
|
|
61
|
+
userId: z.ZodString;
|
|
62
|
+
allowedWhen: z.ZodLiteral<"scheduled-task">;
|
|
63
|
+
taskId: z.ZodString;
|
|
64
|
+
binding: z.ZodObject<{
|
|
65
|
+
type: z.ZodLiteral<"scheduled-task">;
|
|
66
|
+
plugin: z.ZodString;
|
|
67
|
+
taskId: z.ZodString;
|
|
68
|
+
signature: z.ZodString;
|
|
69
|
+
}, z.core.$strict>;
|
|
70
|
+
}, z.core.$strict>], "allowedWhen">>;
|
|
44
71
|
}, z.core.$strict>]>;
|
|
45
72
|
export type CredentialSubjectBinding = z.output<typeof credentialSubjectBindingSchema>;
|
|
46
73
|
export type CredentialSystemActor = z.output<typeof credentialSystemActorSchema>;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import type { PluginCredentialSubject } from "@sentry/junior-plugin-api";
|
|
2
2
|
import type { CredentialSubject } from "@/chat/credentials/context";
|
|
3
|
+
type SlackDirectPluginCredentialSubject = Extract<PluginCredentialSubject, {
|
|
4
|
+
allowedWhen: "private-direct-conversation";
|
|
5
|
+
}>;
|
|
3
6
|
/** Create a delegated user credential subject for a verified Slack DM turn. */
|
|
4
7
|
export declare function createSlackDirectCredentialSubject(input: {
|
|
5
8
|
channelId: string | undefined;
|
|
6
9
|
teamId: string | undefined;
|
|
7
10
|
userId: string | undefined;
|
|
8
|
-
}):
|
|
11
|
+
}): SlackDirectPluginCredentialSubject | undefined;
|
|
9
12
|
/** Bind a delegated user subject to the Slack DM destination being dispatched. */
|
|
10
13
|
export declare function bindSlackDirectCredentialSubject(input: {
|
|
11
14
|
channelId: string;
|
|
@@ -18,3 +21,14 @@ export declare function verifySlackDirectCredentialSubject(input: {
|
|
|
18
21
|
subject: CredentialSubject;
|
|
19
22
|
teamId: string;
|
|
20
23
|
}): boolean;
|
|
24
|
+
/** Bind a delegated user subject to one scheduler task dispatch. */
|
|
25
|
+
export declare function bindScheduledTaskCredentialSubject(input: {
|
|
26
|
+
plugin: string;
|
|
27
|
+
subject: PluginCredentialSubject;
|
|
28
|
+
}): CredentialSubject | undefined;
|
|
29
|
+
/** Verify that a delegated subject was signed for one scheduler task. */
|
|
30
|
+
export declare function verifyScheduledTaskCredentialSubject(input: {
|
|
31
|
+
plugin: string;
|
|
32
|
+
subject: CredentialSubject;
|
|
33
|
+
}): boolean;
|
|
34
|
+
export {};
|