@sentry/junior 0.99.0 → 0.101.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.
Files changed (91) hide show
  1. package/README.md +0 -1
  2. package/dist/{agent-hooks-OSW6C3CJ.js → agent-hooks-V6KU7PQN.js} +6 -5
  3. package/dist/api/activity.d.ts +14 -0
  4. package/dist/api/conversations/aggregate.d.ts +16 -0
  5. package/dist/api/conversations/detail-projection.d.ts +1 -0
  6. package/dist/api/conversations/list.query.d.ts +3 -0
  7. package/dist/api/conversations/projection.d.ts +1 -0
  8. package/dist/api/conversations/reporting.d.ts +42 -0
  9. package/dist/api/conversations/schema.d.ts +9 -9
  10. package/dist/api/conversations/stats.query.d.ts +1 -1
  11. package/dist/api/locations/detail.d.ts +81 -0
  12. package/dist/api/locations/list.d.ts +30 -0
  13. package/dist/api/locations/query.d.ts +5 -0
  14. package/dist/api/locations/schema.d.ts +175 -0
  15. package/dist/api/people/list.query.d.ts +1 -1
  16. package/dist/api/people/profile.query.d.ts +1 -1
  17. package/dist/api/people/schema.d.ts +10 -14
  18. package/dist/api/people/shared.d.ts +38 -78
  19. package/dist/api/schema.d.ts +8 -0
  20. package/dist/api/schema.js +14 -3
  21. package/dist/api.js +24 -11
  22. package/dist/app.js +126 -70
  23. package/dist/chat/agent/request.d.ts +4 -1
  24. package/dist/chat/config.d.ts +2 -0
  25. package/dist/chat/conversations/store.d.ts +1 -1
  26. package/dist/chat/mcp/auth-store.d.ts +1 -0
  27. package/dist/chat/mcp/client.d.ts +2 -0
  28. package/dist/chat/mcp/oauth-provider.d.ts +4 -1
  29. package/dist/chat/mcp/oauth.d.ts +3 -1
  30. package/dist/chat/mcp/tool-manager.d.ts +2 -0
  31. package/dist/chat/reasoning-level.d.ts +4 -0
  32. package/dist/chat/services/mcp-auth-orchestration.d.ts +1 -1
  33. package/dist/chat/services/pending-auth.d.ts +17 -9
  34. package/dist/chat/services/{turn-thinking-level.d.ts → turn-reasoning-level.d.ts} +11 -10
  35. package/dist/chat/services/turn-result.d.ts +3 -3
  36. package/dist/chat/state/conversation.d.ts +7 -3
  37. package/dist/chat/tools/search-tools.d.ts +2 -2
  38. package/dist/{chunk-T55RBE4Z.js → chunk-2RNOB32R.js} +3 -1
  39. package/dist/{chunk-ZZUBLPXD.js → chunk-5VGJJSSV.js} +9 -7
  40. package/dist/{chunk-EEZCY5WX.js → chunk-A7X2FDUO.js} +18 -2
  41. package/dist/{chunk-CRQVIHDI.js → chunk-DBPLXSBK.js} +2 -8
  42. package/dist/{chunk-NJEDJFK4.js → chunk-EBFJOOUE.js} +2 -2
  43. package/dist/{chunk-WTYEKPXU.js → chunk-FP5N5OWZ.js} +1 -1
  44. package/dist/chunk-FXFQNHRU.js +48 -0
  45. package/dist/chunk-GEUUJRQF.js +102 -0
  46. package/dist/chunk-HNIT4HXU.js +75 -0
  47. package/dist/{chunk-EUZ44ROE.js → chunk-HYDQULR2.js} +2 -4
  48. package/dist/{chunk-DHHU2WSG.js → chunk-IQIBZXGB.js} +2 -2
  49. package/dist/{chunk-OL6XQ23W.js → chunk-IVXL57YF.js} +3 -3
  50. package/dist/{chunk-IO65E4ZD.js → chunk-JPQISMMJ.js} +3 -3
  51. package/dist/{chunk-KFUSLFLL.js → chunk-JSAANELJ.js} +11 -4
  52. package/dist/{chunk-ER45IV77.js → chunk-L2JIOAA2.js} +10 -10
  53. package/dist/chunk-PGGEOCQY.js +77 -0
  54. package/dist/{chunk-EOWXRY5E.js → chunk-PWC24W5F.js} +1 -1
  55. package/dist/chunk-QOZOJNSE.js +96 -0
  56. package/dist/{chunk-FTTFV6DC.js → chunk-TPTJEHUE.js} +4 -4
  57. package/dist/{chunk-PYK7R5A7.js → chunk-UWGTSF5O.js} +285 -174
  58. package/dist/chunk-VFBFK6EY.js +275 -0
  59. package/dist/{chunk-OGHXZ4KQ.js → chunk-VHRM6GNH.js} +88 -122
  60. package/dist/{chunk-NG2AV7IB.js → chunk-VVIXK2BX.js} +1 -1
  61. package/dist/{chunk-6DTVCPLO.js → chunk-XIMUQ4IU.js} +4 -3
  62. package/dist/{chunk-H66UCBPW.js → chunk-XJA7BPHS.js} +1 -1
  63. package/dist/{chunk-WJ7STXT6.js → chunk-XVR4O24H.js} +8 -10
  64. package/dist/cli/chat.js +16 -15
  65. package/dist/cli/plugins.js +6 -5
  66. package/dist/cli/snapshot-warmup.js +2 -2
  67. package/dist/cli/upgrade.js +126 -8
  68. package/dist/db/schema/conversations.d.ts +17 -0
  69. package/dist/db/schema/destinations.d.ts +12 -3
  70. package/dist/db/schema.d.ts +19 -2
  71. package/dist/{db-GFSCDAHS.js → db-RCZB7KNM.js} +3 -2
  72. package/dist/{detail-Q4IVDNGS.js → detail-4EPUMSDU.js} +11 -10
  73. package/dist/detail-CD4SPJ4K.js +29 -0
  74. package/dist/{legacy-import-6WWXMALY.js → legacy-import-VCYLWT2V.js} +4 -3
  75. package/dist/list-7L5LY2WU.js +30 -0
  76. package/dist/list-DA2ATOM4.js +80 -0
  77. package/dist/{list-A3F5JDYV.js → list-J6ROVH56.js} +7 -6
  78. package/dist/{plugin-conversations-PDCQWU3O.js → plugin-conversations-JANXC4GA.js} +6 -5
  79. package/dist/profile-6NRWEKMZ.js +212 -0
  80. package/dist/{runner-267ZRLZD.js → runner-CZIKSWGC.js} +13 -12
  81. package/dist/stats-Q5FRUXLY.js +174 -0
  82. package/dist/{subagent-UN3MP6LV.js → subagent-YIINCFAS.js} +10 -9
  83. package/migrations/0003_peaceful_scalphunter.sql +4 -0
  84. package/migrations/meta/0003_snapshot.json +1035 -0
  85. package/migrations/meta/_journal.json +8 -1
  86. package/package.json +6 -6
  87. package/dist/api-reference.d.ts +0 -14
  88. package/dist/chunk-CV22LUIV.js +0 -261
  89. package/dist/list-M5BRWW3D.js +0 -92
  90. package/dist/profile-UEIRSVT3.js +0 -146
  91. package/dist/stats-L62E4O4U.js +0 -207
@@ -1,96 +1,56 @@
1
- import type { ConversationStatsItem, ConversationSummaryReport, ActorActivityDayReport, ActorIdentity, ActorTotalsReport } from "./schema";
2
- import type { ConversationSurface } from "../conversations/schema";
3
- export declare const SAMPLE_LIMIT = 5000;
1
+ import type { ActorActivityDayReport, ConversationStatsItem, ActorTotalsReport } from "./schema";
4
2
  export declare const RECENT_LIMIT = 25;
5
3
  export declare const ACTIVITY_DAYS = 366;
6
4
  /** Normalize emails before matching people API rows. */
7
5
  export declare function normalizeEmail(email: string | undefined): string | undefined;
8
- /** Parse report timestamps without throwing on malformed legacy values. */
9
- export declare function reportTime(value: string): number | undefined;
10
- /** Convert a report timestamp into the UTC day used for people activity. */
11
- export declare function reportDate(value: string): string | undefined;
12
- /** Return the dashboard label for a conversation surface. */
13
- export declare function surfaceLabel(surface: ConversationSurface): string;
14
- /** Return the dashboard-safe Slack location label for a conversation. */
15
- export declare function slackLocationLabel(args: {
16
- channel?: string;
17
- channelName?: string;
18
- channelNameRedacted?: boolean;
19
- }): string | undefined;
20
- /** Project one SQL conversation row into the people API conversation summary. */
21
- export declare function summaryFromRow(row: PeopleConversationRow): ConversationSummaryReport;
22
- /** Collapse stored conversation usage into the dashboard token total. */
23
- export declare function usageTokens(row: PeopleConversationRow): number | undefined;
24
6
  /** Build a zeroed totals object for people API aggregations. */
25
7
  export declare function emptyTotals(): ActorTotalsReport;
26
- /** Build a zeroed labeled stats row for people API aggregations. */
27
- export declare function emptyStatsItem(label: string): ConversationStatsItem;
28
8
  /** Build a zeroed activity day for the people profile window. */
29
9
  export declare function emptyActivityDay(date: string): ActorActivityDayReport;
30
- /** Collapse a conversation summary status into aggregate counters. */
31
- export declare function signals(summary: ConversationSummaryReport): {
32
- active: boolean;
33
- failed: boolean;
34
- };
35
- /** Add status counters into a people API aggregate row. */
36
- export declare function addSignals(target: Pick<ActorTotalsReport, "active" | "failed">, value: ReturnType<typeof signals>): void;
37
- /** Return only actor identities that can be grouped by normalized email. */
38
- export declare function identityWithEmail(actor: ActorIdentity | undefined): (ActorIdentity & {
39
- email: string;
40
- }) | undefined;
41
- /** Preserve the first observed person fields while filling missing details. */
42
- export declare function mergeIdentity(current: ActorIdentity & {
43
- email: string;
44
- }, next: ActorIdentity & {
45
- email: string;
46
- }): ActorIdentity & {
47
- email: string;
48
- };
49
10
  /** Fill the fixed people profile activity window from sparse day totals. */
50
11
  export declare function activityDays(days: Map<string, ActorActivityDayReport>, nowMs: number): ActorActivityDayReport[];
51
12
  /** Return deterministic stats rows for people API responses. */
52
13
  export declare function statsItems(map: Map<string, ConversationStatsItem>): {
53
14
  active: number;
54
- failed: number;
55
15
  conversations: number;
56
16
  durationMs: number;
17
+ failed: number;
57
18
  label: string;
58
19
  tokens?: number | undefined;
59
20
  }[];
60
- /** Read verified actor conversation rows directly from the SQL identity model. */
61
- export declare function actorRows(email?: string): Promise<{
62
- rows: {
63
- channelName: string | null;
64
- conversationId: string;
65
- createdAt: Date;
66
- destinationVisibility: import("../../db/schema/destinations").JuniorDestinationVisibility | null;
67
- durationMs: number;
68
- email: string;
69
- executionStatus: import("../../chat/conversations/store").ConversationStatus;
70
- executionUpdatedAt: Date | null;
71
- fullName: string | null;
72
- handle: string | null;
73
- lastActivityAt: Date;
74
- providerSubjectId: string;
75
- source: import("../../chat/conversations/store").ConversationSource | null;
76
- title: string | null;
77
- updatedAt: Date;
78
- usage: {
79
- inputTokens?: number | undefined;
80
- outputTokens?: number | undefined;
81
- cachedInputTokens?: number | undefined;
82
- cacheCreationTokens?: number | undefined;
83
- reasoningTokens?: number | undefined;
84
- totalTokens?: number | undefined;
85
- cost?: {
86
- input?: number | undefined;
87
- output?: number | undefined;
88
- cacheRead?: number | undefined;
89
- cacheWrite?: number | undefined;
90
- total?: number | undefined;
91
- } | undefined;
92
- } | null;
93
- }[];
94
- truncated: boolean;
95
- }>;
96
- export type PeopleConversationRow = Awaited<ReturnType<typeof actorRows>>["rows"][number];
21
+ /** Build the verified Slack actor predicate shared by People aggregate and recent-row queries. */
22
+ export declare function verifiedActorWhere(email?: string): import("drizzle-orm").SQL<unknown> | undefined;
23
+ /** Read only the recent conversation rows required by a People profile. */
24
+ export declare function recentActorRows(email: string): Promise<{
25
+ channelName: string | null;
26
+ conversationId: string;
27
+ createdAt: Date;
28
+ destinationId: string | null;
29
+ destinationVisibility: import("../../db/schema/destinations").JuniorDestinationVisibility | null;
30
+ durationMs: number;
31
+ email: string;
32
+ executionStatus: import("../../chat/conversations/store").ConversationStatus;
33
+ executionUpdatedAt: Date | null;
34
+ fullName: string | null;
35
+ handle: string | null;
36
+ lastActivityAt: Date;
37
+ providerSubjectId: string;
38
+ source: import("../../chat/conversations/store").ConversationSource | null;
39
+ title: string | null;
40
+ updatedAt: Date;
41
+ usage: {
42
+ inputTokens?: number | undefined;
43
+ outputTokens?: number | undefined;
44
+ cachedInputTokens?: number | undefined;
45
+ cacheCreationTokens?: number | undefined;
46
+ reasoningTokens?: number | undefined;
47
+ totalTokens?: number | undefined;
48
+ cost?: {
49
+ input?: number | undefined;
50
+ output?: number | undefined;
51
+ cacheRead?: number | undefined;
52
+ cacheWrite?: number | undefined;
53
+ total?: number | undefined;
54
+ } | undefined;
55
+ } | null;
56
+ }[]>;
@@ -1,6 +1,10 @@
1
+ export { dailyConversationActivitySchema } from "./activity";
2
+ export type { DailyConversationActivity } from "./activity";
1
3
  export { conversationDetailReportSchema, conversationFeedSchema, conversationStatsReportSchema, conversationSubagentTranscriptReportSchema, } from "./conversations/schema";
2
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";
3
5
  export { actorDirectoryReportSchema, actorProfileReportSchema, } from "./people/schema";
6
+ export { locationDetailReportSchema, locationDirectoryReportSchema, } from "./locations/schema";
7
+ export type { LocationActorSummaryReport, LocationDetailReport, LocationDirectoryReport, LocationSummaryReport, } from "./locations/schema";
4
8
  export type { ActorActivityDayReport, ActorDirectoryReport, ActorProfileReport, ActorSummaryReport, ActorTotalsReport, } from "./people/schema";
5
9
  export { healthReportSchema, pluginOperationalReportFeedSchema, pluginOperationalReportSchema, pluginPackageContentItemReportSchema, pluginPackageContentReportSchema, pluginReportSchema, pluginReportsSchema, runtimeInfoReportSchema, skillReportSchema, skillReportsSchema, } from "../reporting-schema";
6
10
  export type { HealthReport, PluginOperationalReport, PluginOperationalReportFeed, PluginPackageContentItemReport, PluginPackageContentReport, PluginReport, PluginReports, RuntimeInfoReport, SkillReport, SkillReports, } from "../reporting-schema";
@@ -18,6 +22,10 @@ export declare const subagentParamsSchema: z.ZodObject<{
18
22
  export declare const personParamsSchema: z.ZodObject<{
19
23
  email: z.ZodString;
20
24
  }, z.core.$strict>;
25
+ export declare const locationParamsSchema: z.ZodObject<{
26
+ locationId: z.ZodString;
27
+ }, z.core.$strict>;
21
28
  export type ConversationParams = z.infer<typeof conversationParamsSchema>;
22
29
  export type SubagentParams = z.infer<typeof subagentParamsSchema>;
23
30
  export type PersonParams = z.infer<typeof personParamsSchema>;
31
+ export type LocationParams = z.infer<typeof locationParamsSchema>;
@@ -1,19 +1,25 @@
1
1
  import {
2
2
  conversationFeedQuerySchema,
3
3
  conversationParamsSchema,
4
+ locationParamsSchema,
4
5
  personParamsSchema,
5
6
  subagentParamsSchema
6
- } from "../chunk-T55RBE4Z.js";
7
+ } from "../chunk-2RNOB32R.js";
8
+ import {
9
+ dailyConversationActivitySchema,
10
+ locationDetailReportSchema,
11
+ locationDirectoryReportSchema
12
+ } from "../chunk-HNIT4HXU.js";
7
13
  import {
8
14
  actorDirectoryReportSchema,
9
15
  actorProfileReportSchema
10
- } from "../chunk-CRQVIHDI.js";
16
+ } from "../chunk-DBPLXSBK.js";
11
17
  import {
12
18
  conversationDetailReportSchema,
13
19
  conversationFeedSchema,
14
20
  conversationStatsReportSchema,
15
21
  conversationSubagentTranscriptReportSchema
16
- } from "../chunk-EUZ44ROE.js";
22
+ } from "../chunk-HYDQULR2.js";
17
23
  import {
18
24
  healthReportSchema,
19
25
  pluginOperationalReportFeedSchema,
@@ -27,6 +33,7 @@ import {
27
33
  skillReportsSchema
28
34
  } from "../chunk-CEA3A3UA.js";
29
35
  import "../chunk-PDO5BLNM.js";
36
+ import "../chunk-FXFQNHRU.js";
30
37
  import "../chunk-MLKGABMK.js";
31
38
  export {
32
39
  actorDirectoryReportSchema,
@@ -37,7 +44,11 @@ export {
37
44
  conversationParamsSchema,
38
45
  conversationStatsReportSchema,
39
46
  conversationSubagentTranscriptReportSchema,
47
+ dailyConversationActivitySchema,
40
48
  healthReportSchema,
49
+ locationDetailReportSchema,
50
+ locationDirectoryReportSchema,
51
+ locationParamsSchema,
41
52
  personParamsSchema,
42
53
  pluginOperationalReportFeedSchema,
43
54
  pluginOperationalReportSchema,
package/dist/api.js CHANGED
@@ -1,11 +1,13 @@
1
1
  import {
2
2
  conversationFeedQuerySchema,
3
3
  conversationParamsSchema,
4
+ locationParamsSchema,
4
5
  personParamsSchema,
5
6
  subagentParamsSchema
6
- } from "./chunk-T55RBE4Z.js";
7
- import "./chunk-CRQVIHDI.js";
8
- import "./chunk-EUZ44ROE.js";
7
+ } from "./chunk-2RNOB32R.js";
8
+ import "./chunk-HNIT4HXU.js";
9
+ import "./chunk-DBPLXSBK.js";
10
+ import "./chunk-HYDQULR2.js";
9
11
  import {
10
12
  readHealthReport
11
13
  } from "./chunk-QNVHH5PU.js";
@@ -16,6 +18,7 @@ import {
16
18
  skillReportsSchema
17
19
  } from "./chunk-CEA3A3UA.js";
18
20
  import "./chunk-PDO5BLNM.js";
21
+ import "./chunk-FXFQNHRU.js";
19
22
  import "./chunk-MLKGABMK.js";
20
23
 
21
24
  // src/api.ts
@@ -70,11 +73,11 @@ async function readRuntimeInfoReport() {
70
73
  }
71
74
  async function readPluginOperationalReportFeed() {
72
75
  const listRecent = async (listOptions) => {
73
- const { listRecentConversationSummaries } = await import("./plugin-conversations-PDCQWU3O.js");
76
+ const { listRecentConversationSummaries } = await import("./plugin-conversations-JANXC4GA.js");
74
77
  return listRecentConversationSummaries(listOptions?.limit);
75
78
  };
76
79
  const nowMs = Date.now();
77
- const { getPluginOperationalReports } = await import("./agent-hooks-OSW6C3CJ.js");
80
+ const { getPluginOperationalReports } = await import("./agent-hooks-V6KU7PQN.js");
78
81
  return pluginOperationalReportFeedSchema.parse({
79
82
  source: "plugins",
80
83
  generatedAt: new Date(nowMs).toISOString(),
@@ -123,7 +126,7 @@ function createJuniorApi() {
123
126
  return Response.json(await readPluginOperationalReportFeed());
124
127
  });
125
128
  app.get("/api/conversations", async (c) => {
126
- const { readConversationFeed } = await import("./list-A3F5JDYV.js");
129
+ const { readConversationFeed } = await import("./list-J6ROVH56.js");
127
130
  const { actorEmail } = parseQuery(
128
131
  conversationFeedQuerySchema,
129
132
  c.req.query()
@@ -131,11 +134,11 @@ function createJuniorApi() {
131
134
  return Response.json(await readConversationFeed({ actorEmail }));
132
135
  });
133
136
  app.get("/api/conversations/stats", async () => {
134
- const { readConversationStats } = await import("./stats-L62E4O4U.js");
137
+ const { readConversationStats } = await import("./stats-Q5FRUXLY.js");
135
138
  return Response.json(await readConversationStats());
136
139
  });
137
140
  app.get("/api/conversations/:conversationId", async (c) => {
138
- const { readConversationDetail } = await import("./detail-Q4IVDNGS.js");
141
+ const { readConversationDetail } = await import("./detail-4EPUMSDU.js");
139
142
  const { conversationId } = parseParams(
140
143
  conversationParamsSchema,
141
144
  c.req.param()
@@ -146,7 +149,7 @@ function createJuniorApi() {
146
149
  app.get(
147
150
  "/api/conversations/:conversationId/subagents/:subagentId",
148
151
  async (c) => {
149
- const { readConversationSubagent } = await import("./subagent-UN3MP6LV.js");
152
+ const { readConversationSubagent } = await import("./subagent-YIINCFAS.js");
150
153
  const { conversationId, subagentId } = parseParams(
151
154
  subagentParamsSchema,
152
155
  c.req.param()
@@ -156,14 +159,24 @@ function createJuniorApi() {
156
159
  }
157
160
  );
158
161
  app.get("/api/people", async () => {
159
- const { readPeopleList } = await import("./list-M5BRWW3D.js");
162
+ const { readPeopleList } = await import("./list-DA2ATOM4.js");
160
163
  return Response.json(await readPeopleList());
161
164
  });
162
165
  app.get("/api/people/:email", async (c) => {
163
166
  const { email } = parseParams(personParamsSchema, c.req.param());
164
- const { readPeopleProfile } = await import("./profile-UEIRSVT3.js");
167
+ const { readPeopleProfile } = await import("./profile-6NRWEKMZ.js");
165
168
  return Response.json(await readPeopleProfile(email));
166
169
  });
170
+ app.get("/api/locations", async () => {
171
+ const { readLocationDirectory } = await import("./list-7L5LY2WU.js");
172
+ return Response.json(await readLocationDirectory());
173
+ });
174
+ app.get("/api/locations/:locationId", async (c) => {
175
+ const { locationId } = parseParams(locationParamsSchema, c.req.param());
176
+ const { readLocationDetail } = await import("./detail-CD4SPJ4K.js");
177
+ const report = await readLocationDetail(locationId);
178
+ return report ? Response.json(report) : Response.json({ error: "Location not found." }, { status: 404 });
179
+ });
167
180
  return app;
168
181
  }
169
182
  export {