@sentry/junior 0.101.0 → 0.102.1

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.
Files changed (70) hide show
  1. package/dist/{agent-hooks-V6KU7PQN.js → agent-hooks-I4I2DHSW.js} +7 -7
  2. package/dist/api/conversations/stats.query.d.ts +1 -1
  3. package/dist/api/locations/list.d.ts +7 -0
  4. package/dist/api/locations/schema.d.ts +13 -0
  5. package/dist/api/people/schema.d.ts +13 -0
  6. package/dist/api/people/shared.d.ts +1 -1
  7. package/dist/api/schema.d.ts +3 -3
  8. package/dist/api/schema.js +4 -2
  9. package/dist/api.js +15 -15
  10. package/dist/app.js +65 -53
  11. package/dist/{catalog-runtime-PFHVMHDR.js → catalog-runtime-5CVM2DOF.js} +2 -2
  12. package/dist/chat/agent/prompt.d.ts +1 -1
  13. package/dist/chat/agent-dispatch/validation.d.ts +1 -1
  14. package/dist/chat/conversation-privacy.d.ts +2 -6
  15. package/dist/chat/credentials/context.d.ts +33 -6
  16. package/dist/chat/credentials/subject.d.ts +15 -1
  17. package/dist/chat/logging.d.ts +4 -2
  18. package/dist/chat/mcp/tool-manager.d.ts +1 -1
  19. package/dist/chat/sandbox/egress/schemas.d.ts +13 -2
  20. package/dist/chat/services/context-compaction-marker.d.ts +8 -0
  21. package/dist/{chunk-XJA7BPHS.js → chunk-3OABPOHR.js} +3 -3
  22. package/dist/{chunk-EBFJOOUE.js → chunk-3UK5DFKW.js} +2 -2
  23. package/dist/{chunk-VFBFK6EY.js → chunk-4XNQSJAX.js} +62 -6
  24. package/dist/{chunk-DBPLXSBK.js → chunk-4YN2ZXKB.js} +9 -1
  25. package/dist/{chunk-XVR4O24H.js → chunk-5K4N73TP.js} +4 -4
  26. package/dist/{chunk-LMJPRYHP.js → chunk-77LHNQK4.js} +32 -8
  27. package/dist/{chunk-I35CTGPO.js → chunk-AEWZ7F65.js} +41 -17
  28. package/dist/{chunk-IQIBZXGB.js → chunk-B5QS4AVO.js} +2 -2
  29. package/dist/{chunk-L2JIOAA2.js → chunk-DTUSCR2Y.js} +8 -11
  30. package/dist/{chunk-VVIXK2BX.js → chunk-EMUZSROX.js} +2 -2
  31. package/dist/{chunk-IVXL57YF.js → chunk-EOB77KME.js} +4 -4
  32. package/dist/{chunk-PGGEOCQY.js → chunk-F4CQEUTP.js} +1 -1
  33. package/dist/{chunk-FP5N5OWZ.js → chunk-IQ36I3DF.js} +2 -2
  34. package/dist/{chunk-GEUUJRQF.js → chunk-KFP3TZOS.js} +2 -2
  35. package/dist/{chunk-JSAANELJ.js → chunk-LJB2TLVT.js} +3 -3
  36. package/dist/{chunk-D5KZYS4T.js → chunk-MJSJAHBW.js} +1 -1
  37. package/dist/{chunk-5VGJJSSV.js → chunk-NSP6OGL2.js} +5 -5
  38. package/dist/{chunk-VHRM6GNH.js → chunk-QZGVPPIJ.js} +27 -3
  39. package/dist/{chunk-LVA4I4H7.js → chunk-RT5BUHR5.js} +15 -44
  40. package/dist/{chunk-A7X2FDUO.js → chunk-SHBPSE7A.js} +88 -66
  41. package/dist/{chunk-CM5EZD5F.js → chunk-UIE3R5XU.js} +1 -1
  42. package/dist/{chunk-JPQISMMJ.js → chunk-VSAFV2GI.js} +7 -6
  43. package/dist/{chunk-HNIT4HXU.js → chunk-WPHCUGN7.js} +10 -1
  44. package/dist/{chunk-3ECW2K2O.js → chunk-WR7H7VLJ.js} +2 -2
  45. package/dist/{chunk-TPTJEHUE.js → chunk-X2IPNCB5.js} +61 -25
  46. package/dist/{chunk-UWGTSF5O.js → chunk-ZIX4PNBI.js} +129 -91
  47. package/dist/{chunk-PWC24W5F.js → chunk-ZSHL44IQ.js} +2 -2
  48. package/dist/cli/chat.js +21 -21
  49. package/dist/cli/check.js +3 -3
  50. package/dist/cli/plugins.js +9 -9
  51. package/dist/cli/snapshot-warmup.js +5 -5
  52. package/dist/cli/upgrade.js +85 -13
  53. package/dist/db/postgres-json.d.ts +5 -0
  54. package/dist/{db-RCZB7KNM.js → db-6QP6HY7U.js} +4 -4
  55. package/dist/{detail-4EPUMSDU.js → detail-OEIVZYXS.js} +11 -11
  56. package/dist/{detail-CD4SPJ4K.js → detail-V37NTVBN.js} +7 -7
  57. package/dist/instrumentation.js +2 -2
  58. package/dist/{legacy-import-VCYLWT2V.js → legacy-import-R3BMM2GH.js} +5 -5
  59. package/dist/{list-J6ROVH56.js → list-AJ6RWBOG.js} +7 -7
  60. package/dist/{list-7L5LY2WU.js → list-FWLIZHSW.js} +7 -7
  61. package/dist/list-NTUT6A5M.js +121 -0
  62. package/dist/{plugin-conversations-JANXC4GA.js → plugin-conversations-F3IBVNFX.js} +7 -7
  63. package/dist/{profile-6NRWEKMZ.js → profile-3FRQP4HP.js} +7 -7
  64. package/dist/{runner-CZIKSWGC.js → runner-C2ZTIOUD.js} +12 -12
  65. package/dist/{skills-MAZXZ2KE.js → skills-722AXRV5.js} +3 -3
  66. package/dist/{stats-Q5FRUXLY.js → stats-7UFY6FPE.js} +6 -6
  67. package/dist/{subagent-YIINCFAS.js → subagent-X3ZWJHR4.js} +10 -10
  68. package/dist/{validation-FMEAEKCY.js → validation-EUI2UFRM.js} +3 -3
  69. package/package.json +6 -6
  70. package/dist/list-DA2ATOM4.js +0 -80
@@ -11,17 +11,17 @@ import {
11
11
  getPlugins,
12
12
  setPlugins,
13
13
  validatePlugins
14
- } from "./chunk-TPTJEHUE.js";
15
- import "./chunk-FP5N5OWZ.js";
16
- import "./chunk-PWC24W5F.js";
17
- import "./chunk-VHRM6GNH.js";
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-A7X2FDUO.js";
20
+ import "./chunk-SHBPSE7A.js";
21
21
  import "./chunk-FXFQNHRU.js";
22
- import "./chunk-LVA4I4H7.js";
22
+ import "./chunk-RT5BUHR5.js";
23
23
  import "./chunk-B7PUBQQM.js";
24
- import "./chunk-I35CTGPO.js";
24
+ import "./chunk-AEWZ7F65.js";
25
25
  import "./chunk-OB42YVAE.js";
26
26
  import "./chunk-6GWA276C.js";
27
27
  import "./chunk-7FBGKXPE.js";
@@ -1,3 +1,3 @@
1
1
  import type { ConversationStatsReport } from "./schema";
2
- /** Build complete seven-day dashboard stats from normalized durable SQL records. */
2
+ /** Build complete 90-day dashboard stats from normalized durable SQL records. */
3
3
  export declare function readConversationStatsFromSql(): Promise<ConversationStatsReport>;
@@ -1,5 +1,10 @@
1
1
  /** Expose public conversation destinations as the dashboard's location index. */
2
2
  export declare function readLocationDirectory(): Promise<{
3
+ activityDays: {
4
+ date: string;
5
+ privateConversations: number;
6
+ publicConversations: number;
7
+ }[];
3
8
  generatedAt: string;
4
9
  locations: {
5
10
  active: number;
@@ -27,4 +32,6 @@ export declare function readLocationDirectory(): Promise<{
27
32
  tokens?: number | undefined;
28
33
  };
29
34
  source: "conversation_index";
35
+ windowEnd: string;
36
+ windowStart: string;
30
37
  }>;
@@ -37,7 +37,17 @@ export declare const locationActorSummaryReportSchema: z.ZodObject<{
37
37
  slackUserName: z.ZodOptional<z.ZodString>;
38
38
  }, z.core.$strict>;
39
39
  }, z.core.$strict>;
40
+ export declare const locationActivityDayReportSchema: z.ZodObject<{
41
+ date: z.ZodString;
42
+ privateConversations: z.ZodNumber;
43
+ publicConversations: z.ZodNumber;
44
+ }, z.core.$strict>;
40
45
  export declare const locationDirectoryReportSchema: z.ZodObject<{
46
+ activityDays: z.ZodArray<z.ZodObject<{
47
+ date: z.ZodString;
48
+ privateConversations: z.ZodNumber;
49
+ publicConversations: z.ZodNumber;
50
+ }, z.core.$strict>>;
41
51
  generatedAt: z.ZodString;
42
52
  locations: z.ZodArray<z.ZodObject<{
43
53
  active: z.ZodNumber;
@@ -72,6 +82,8 @@ export declare const locationDirectoryReportSchema: z.ZodObject<{
72
82
  tokens: z.ZodOptional<z.ZodNumber>;
73
83
  }, z.core.$strict>;
74
84
  source: z.ZodLiteral<"conversation_index">;
85
+ windowEnd: z.ZodString;
86
+ windowStart: z.ZodString;
75
87
  }, z.core.$strict>;
76
88
  export declare const locationDetailReportSchema: z.ZodObject<{
77
89
  active: z.ZodNumber;
@@ -171,5 +183,6 @@ export declare const locationDetailReportSchema: z.ZodObject<{
171
183
  }, z.core.$strict>;
172
184
  export type LocationSummaryReport = z.infer<typeof locationSummaryReportSchema>;
173
185
  export type LocationActorSummaryReport = z.infer<typeof locationActorSummaryReportSchema>;
186
+ export type LocationActivityDayReport = z.infer<typeof locationActivityDayReportSchema>;
174
187
  export type LocationDirectoryReport = z.infer<typeof locationDirectoryReportSchema>;
175
188
  export type LocationDetailReport = z.infer<typeof locationDetailReportSchema>;
@@ -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>;
@@ -1,6 +1,6 @@
1
1
  import type { ActorActivityDayReport, ConversationStatsItem, ActorTotalsReport } from "./schema";
2
2
  export declare const RECENT_LIMIT = 25;
3
- export declare const ACTIVITY_DAYS = 366;
3
+ export declare const ACTIVITY_DAYS = 90;
4
4
  /** Normalize emails before matching people API rows. */
5
5
  export declare function normalizeEmail(email: string | undefined): string | undefined;
6
6
  /** Build a zeroed totals object for people API aggregations. */
@@ -3,9 +3,9 @@ export type { DailyConversationActivity } from "./activity";
3
3
  export { conversationDetailReportSchema, conversationFeedSchema, conversationStatsReportSchema, conversationSubagentTranscriptReportSchema, } from "./conversations/schema";
4
4
  export type { ActorIdentity, ConversationActivityReport, ConversationActivityStatus, ConversationContextEvent, ConversationCost, ConversationDetailReport, ConversationFeed, ConversationReportStatus, ConversationStatsItem, ConversationStatsReport, ConversationSubagentActivityReport, ConversationSubagentTranscriptReport, ConversationSummaryReport, ConversationSurface, ConversationToolActivityReport, ConversationUsage, TranscriptMessage, TranscriptPart, TranscriptPartType, TranscriptRole, } from "./conversations/schema";
5
5
  export { actorDirectoryReportSchema, actorProfileReportSchema, } from "./people/schema";
6
- export { locationDetailReportSchema, locationDirectoryReportSchema, } from "./locations/schema";
7
- export type { LocationActorSummaryReport, LocationDetailReport, LocationDirectoryReport, LocationSummaryReport, } from "./locations/schema";
8
- export type { ActorActivityDayReport, ActorDirectoryReport, ActorProfileReport, ActorSummaryReport, ActorTotalsReport, } from "./people/schema";
6
+ export { locationActivityDayReportSchema, locationDetailReportSchema, locationDirectoryReportSchema, } from "./locations/schema";
7
+ export type { LocationActorSummaryReport, LocationActivityDayReport, LocationDetailReport, LocationDirectoryReport, LocationSummaryReport, } from "./locations/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";
@@ -7,13 +7,14 @@ import {
7
7
  } from "../chunk-2RNOB32R.js";
8
8
  import {
9
9
  dailyConversationActivitySchema,
10
+ locationActivityDayReportSchema,
10
11
  locationDetailReportSchema,
11
12
  locationDirectoryReportSchema
12
- } from "../chunk-HNIT4HXU.js";
13
+ } from "../chunk-WPHCUGN7.js";
13
14
  import {
14
15
  actorDirectoryReportSchema,
15
16
  actorProfileReportSchema
16
- } from "../chunk-DBPLXSBK.js";
17
+ } from "../chunk-4YN2ZXKB.js";
17
18
  import {
18
19
  conversationDetailReportSchema,
19
20
  conversationFeedSchema,
@@ -46,6 +47,7 @@ export {
46
47
  conversationSubagentTranscriptReportSchema,
47
48
  dailyConversationActivitySchema,
48
49
  healthReportSchema,
50
+ locationActivityDayReportSchema,
49
51
  locationDetailReportSchema,
50
52
  locationDirectoryReportSchema,
51
53
  locationParamsSchema,
package/dist/api.js CHANGED
@@ -5,8 +5,8 @@ import {
5
5
  personParamsSchema,
6
6
  subagentParamsSchema
7
7
  } from "./chunk-2RNOB32R.js";
8
- import "./chunk-HNIT4HXU.js";
9
- import "./chunk-DBPLXSBK.js";
8
+ import "./chunk-WPHCUGN7.js";
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-MAZXZ2KE.js");
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-PFHVMHDR.js");
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-PFHVMHDR.js"),
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-JANXC4GA.js");
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-V6KU7PQN.js");
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-J6ROVH56.js");
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-Q5FRUXLY.js");
137
+ const { readConversationStats } = await import("./stats-7UFY6FPE.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-4EPUMSDU.js");
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-YIINCFAS.js");
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-DA2ATOM4.js");
162
+ const { readPeopleList } = await import("./list-NTUT6A5M.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-6NRWEKMZ.js");
167
+ const { readPeopleProfile } = await import("./profile-3FRQP4HP.js");
168
168
  return Response.json(await readPeopleProfile(email));
169
169
  });
170
170
  app.get("/api/locations", async () => {
171
- const { readLocationDirectory } = await import("./list-7L5LY2WU.js");
171
+ const { readLocationDirectory } = await import("./list-FWLIZHSW.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-CD4SPJ4K.js");
176
+ const { readLocationDetail } = await import("./detail-V37NTVBN.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-L2JIOAA2.js";
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-VVIXK2BX.js";
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-EBFJOOUE.js";
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-D5KZYS4T.js";
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-UWGTSF5O.js";
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-XVR4O24H.js";
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-IVXL57YF.js";
148
+ } from "./chunk-EOB77KME.js";
149
149
  import {
150
150
  commitMessages,
151
151
  loadConversationProjection,
152
152
  loadProjection,
153
153
  recordAuthorizationCompleted
154
- } from "./chunk-IQIBZXGB.js";
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-JPQISMMJ.js";
170
- import "./chunk-XJA7BPHS.js";
169
+ } from "./chunk-VSAFV2GI.js";
170
+ import "./chunk-3OABPOHR.js";
171
171
  import "./chunk-PDO5BLNM.js";
172
- import "./chunk-CM5EZD5F.js";
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-TPTJEHUE.js";
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-FP5N5OWZ.js";
195
+ } from "./chunk-IQ36I3DF.js";
194
196
  import {
195
197
  createPluginLogger,
196
198
  createPluginState
197
- } from "./chunk-PWC24W5F.js";
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-VHRM6GNH.js";
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-A7X2FDUO.js";
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-LVA4I4H7.js";
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-3ECW2K2O.js";
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-LMJPRYHP.js";
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-I35CTGPO.js";
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: boundCredentialSubjectSchema.optional(),
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 (!record.destination.channelId.startsWith("D")) {
642
- ctx.addIssue({
643
- code: z.ZodIssueCode.custom,
644
- message: "Dispatch credentialSubject requires a private direct Slack destination",
645
- path: ["credentialSubject"]
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.teamId !== record.destination.teamId || subject.binding.channelId !== record.destination.channelId) {
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 destination",
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 must be private-direct-conversation";
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 = verifySlackDirectCredentialSubject({
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 = bindSlackDirectCredentialSubject({
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(options);
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(dispatchOptions);
2853
+ await verifyDispatchCredentialSubjectAccess(
2854
+ dispatchOptions,
2855
+ pluginName
2856
+ );
2846
2857
  const result = await createOrGetDispatch({
2847
2858
  plugin: pluginName,
2848
2859
  options: dispatchOptions,
@@ -11736,6 +11747,7 @@ function dashboardHostRoutePaths(dashboard) {
11736
11747
  return [
11737
11748
  ...pagePaths,
11738
11749
  "/favicon.ico",
11750
+ "/_junior/dashboard/avatar.png",
11739
11751
  "/_junior/dashboard/client.js",
11740
11752
  loginPath,
11741
11753
  "/api/health",
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  pluginCatalogRuntime
3
- } from "./chunk-LMJPRYHP.js";
4
- import "./chunk-I35CTGPO.js";
3
+ } from "./chunk-77LHNQK4.js";
4
+ import "./chunk-AEWZ7F65.js";
5
5
  import "./chunk-OB42YVAE.js";
6
6
  import "./chunk-6GWA276C.js";
7
7
  import "./chunk-B3IT5END.js";
@@ -1,6 +1,6 @@
1
1
  import type { PiMessage } from "@/chat/pi/messages";
2
2
  import { type LogContext } from "@/chat/logging";
3
- import { type ConversationPrivacy } from "@/chat/conversation-privacy";
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: string, payload: unknown): Record<string, TraceAttributeValue>;
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: string, messages: unknown[]): Record<string, TraceAttributeValue>;
43
+ export declare function toGenAiMessagesTraceAttributes(prefix: "gen_ai.input" | "gen_ai.output", messages: unknown[]): Record<string, TraceAttributeValue>;
48
44
  export {};