@sentry/junior 0.98.0 → 0.100.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 (82) hide show
  1. package/dist/{agent-hooks-OSW6C3CJ.js → agent-hooks-V6KU7PQN.js} +6 -5
  2. package/dist/api/activity.d.ts +14 -0
  3. package/dist/api/conversations/aggregate.d.ts +16 -0
  4. package/dist/api/conversations/detail-projection.d.ts +1 -0
  5. package/dist/api/conversations/list.d.ts +7 -2
  6. package/dist/api/conversations/list.query.d.ts +12 -3
  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 +7 -7
  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 +11 -0
  20. package/dist/api/schema.js +16 -3
  21. package/dist/api-reference.d.ts +1 -1
  22. package/dist/api.js +41 -13
  23. package/dist/app.js +35 -27
  24. package/dist/chat/agent/request.d.ts +3 -0
  25. package/dist/chat/config.d.ts +2 -0
  26. package/dist/chat/reasoning-level.d.ts +4 -0
  27. package/dist/chat/services/context-compaction.d.ts +1 -0
  28. package/dist/chat/services/{turn-thinking-level.d.ts → turn-reasoning-level.d.ts} +11 -10
  29. package/dist/chat/services/turn-result.d.ts +3 -3
  30. package/dist/chat/tools/search-tools.d.ts +2 -2
  31. package/dist/{chunk-UAMKJPDF.js → chunk-2RNOB32R.js} +7 -1
  32. package/dist/{chunk-NJEDJFK4.js → chunk-2T7DCRAW.js} +1 -1
  33. package/dist/{chunk-DPHWDS6I.js → chunk-45DMFMY2.js} +81 -69
  34. package/dist/chunk-4AQUWWEM.js +75 -0
  35. package/dist/{chunk-EEZCY5WX.js → chunk-A7X2FDUO.js} +18 -2
  36. package/dist/{chunk-WTYEKPXU.js → chunk-FP5N5OWZ.js} +1 -1
  37. package/dist/chunk-FXFQNHRU.js +48 -0
  38. package/dist/chunk-GEUUJRQF.js +102 -0
  39. package/dist/{chunk-CRQVIHDI.js → chunk-IDZBM3NW.js} +2 -8
  40. package/dist/{chunk-DHHU2WSG.js → chunk-IQIBZXGB.js} +2 -2
  41. package/dist/{chunk-OL6XQ23W.js → chunk-IVXL57YF.js} +3 -3
  42. package/dist/{chunk-IO65E4ZD.js → chunk-JPQISMMJ.js} +3 -3
  43. package/dist/{chunk-KJHAW6VE.js → chunk-JSAANELJ.js} +28 -9
  44. package/dist/{chunk-EUZ44ROE.js → chunk-MM5UFDAC.js} +1 -3
  45. package/dist/{chunk-WJ7STXT6.js → chunk-NSOCZGOH.js} +3 -3
  46. package/dist/chunk-PGGEOCQY.js +77 -0
  47. package/dist/{chunk-EOWXRY5E.js → chunk-PWC24W5F.js} +1 -1
  48. package/dist/chunk-QOZOJNSE.js +96 -0
  49. package/dist/chunk-QSBQJ3PA.js +275 -0
  50. package/dist/{chunk-FTTFV6DC.js → chunk-TPTJEHUE.js} +4 -4
  51. package/dist/{chunk-OGHXZ4KQ.js → chunk-VHRM6GNH.js} +88 -122
  52. package/dist/{chunk-NG2AV7IB.js → chunk-VVIXK2BX.js} +1 -1
  53. package/dist/{chunk-6HHEZENZ.js → chunk-VY7BT4SM.js} +16 -7
  54. package/dist/{chunk-H66UCBPW.js → chunk-XJA7BPHS.js} +1 -1
  55. package/dist/{chunk-ER45IV77.js → chunk-XSBIISXS.js} +9 -9
  56. package/dist/cli/chat.js +15 -14
  57. package/dist/cli/plugins.js +6 -5
  58. package/dist/cli/snapshot-warmup.js +2 -2
  59. package/dist/cli/upgrade.js +8 -7
  60. package/dist/db/schema/conversations.d.ts +17 -0
  61. package/dist/db/schema/destinations.d.ts +12 -3
  62. package/dist/db/schema.d.ts +19 -2
  63. package/dist/{db-GFSCDAHS.js → db-RCZB7KNM.js} +3 -2
  64. package/dist/detail-5SLCGT6J.js +29 -0
  65. package/dist/{detail-W4ZSD45K.js → detail-LU6COZO6.js} +11 -10
  66. package/dist/{legacy-import-6WWXMALY.js → legacy-import-VCYLWT2V.js} +4 -3
  67. package/dist/list-2FI5SFV7.js +80 -0
  68. package/dist/list-4ALSU6ZW.js +30 -0
  69. package/dist/{list-3KZNG3SJ.js → list-KHRAWZWU.js} +11 -8
  70. package/dist/{plugin-conversations-ZYRWZYEA.js → plugin-conversations-JANXC4GA.js} +7 -6
  71. package/dist/profile-3O3OVENT.js +212 -0
  72. package/dist/{runner-267ZRLZD.js → runner-BM7D35YW.js} +12 -11
  73. package/dist/stats-J3YGCYDF.js +174 -0
  74. package/dist/{subagent-5HZPQC7V.js → subagent-P7HOSMVC.js} +10 -9
  75. package/migrations/0003_peaceful_scalphunter.sql +4 -0
  76. package/migrations/meta/0003_snapshot.json +1035 -0
  77. package/migrations/meta/_journal.json +8 -1
  78. package/package.json +5 -5
  79. package/dist/chunk-CV22LUIV.js +0 -261
  80. package/dist/list-M5BRWW3D.js +0 -92
  81. package/dist/profile-UEIRSVT3.js +0 -146
  82. 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";
@@ -8,6 +12,9 @@ import { z } from "zod";
8
12
  export declare const conversationParamsSchema: z.ZodObject<{
9
13
  conversationId: z.ZodString;
10
14
  }, z.core.$strict>;
15
+ export declare const conversationFeedQuerySchema: z.ZodObject<{
16
+ actorEmail: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
17
+ }, z.core.$strict>;
11
18
  export declare const subagentParamsSchema: z.ZodObject<{
12
19
  conversationId: z.ZodString;
13
20
  subagentId: z.ZodString;
@@ -15,6 +22,10 @@ export declare const subagentParamsSchema: z.ZodObject<{
15
22
  export declare const personParamsSchema: z.ZodObject<{
16
23
  email: z.ZodString;
17
24
  }, z.core.$strict>;
25
+ export declare const locationParamsSchema: z.ZodObject<{
26
+ locationId: z.ZodString;
27
+ }, z.core.$strict>;
18
28
  export type ConversationParams = z.infer<typeof conversationParamsSchema>;
19
29
  export type SubagentParams = z.infer<typeof subagentParamsSchema>;
20
30
  export type PersonParams = z.infer<typeof personParamsSchema>;
31
+ export type LocationParams = z.infer<typeof locationParamsSchema>;
@@ -1,18 +1,25 @@
1
1
  import {
2
+ conversationFeedQuerySchema,
2
3
  conversationParamsSchema,
4
+ locationParamsSchema,
3
5
  personParamsSchema,
4
6
  subagentParamsSchema
5
- } from "../chunk-UAMKJPDF.js";
7
+ } from "../chunk-2RNOB32R.js";
8
+ import {
9
+ dailyConversationActivitySchema,
10
+ locationDetailReportSchema,
11
+ locationDirectoryReportSchema
12
+ } from "../chunk-4AQUWWEM.js";
6
13
  import {
7
14
  actorDirectoryReportSchema,
8
15
  actorProfileReportSchema
9
- } from "../chunk-CRQVIHDI.js";
16
+ } from "../chunk-IDZBM3NW.js";
10
17
  import {
11
18
  conversationDetailReportSchema,
12
19
  conversationFeedSchema,
13
20
  conversationStatsReportSchema,
14
21
  conversationSubagentTranscriptReportSchema
15
- } from "../chunk-EUZ44ROE.js";
22
+ } from "../chunk-MM5UFDAC.js";
16
23
  import {
17
24
  healthReportSchema,
18
25
  pluginOperationalReportFeedSchema,
@@ -26,16 +33,22 @@ import {
26
33
  skillReportsSchema
27
34
  } from "../chunk-CEA3A3UA.js";
28
35
  import "../chunk-PDO5BLNM.js";
36
+ import "../chunk-FXFQNHRU.js";
29
37
  import "../chunk-MLKGABMK.js";
30
38
  export {
31
39
  actorDirectoryReportSchema,
32
40
  actorProfileReportSchema,
33
41
  conversationDetailReportSchema,
42
+ conversationFeedQuerySchema,
34
43
  conversationFeedSchema,
35
44
  conversationParamsSchema,
36
45
  conversationStatsReportSchema,
37
46
  conversationSubagentTranscriptReportSchema,
47
+ dailyConversationActivitySchema,
38
48
  healthReportSchema,
49
+ locationDetailReportSchema,
50
+ locationDirectoryReportSchema,
51
+ locationParamsSchema,
39
52
  personParamsSchema,
40
53
  pluginOperationalReportFeedSchema,
41
54
  pluginOperationalReportSchema,
@@ -8,7 +8,7 @@ export { defineJuniorPlugins } from "./plugins";
8
8
  export type { JuniorPluginInput, JuniorPluginSet, JuniorPluginSetOptions, } from "./plugins";
9
9
  export type { PluginRunContext, PluginRunTranscriptEntry, PluginTaskContext, PluginTaskDefinition, PluginTasks, PluginConversationStatus, PluginConversations, PluginConversationSummary, SubscribableResource, } from "@sentry/junior-plugin-api";
10
10
  export { definePluginTool, pluginRunContextSchema, pluginRunTranscriptEntrySchema, zodTool, } from "@sentry/junior-plugin-api";
11
- export { actorDirectoryReportSchema, actorProfileReportSchema, conversationDetailReportSchema, conversationFeedSchema, conversationParamsSchema, conversationStatsReportSchema, conversationSubagentTranscriptReportSchema, healthReportSchema, personParamsSchema, pluginOperationalReportFeedSchema, pluginOperationalReportSchema, pluginPackageContentItemReportSchema, pluginPackageContentReportSchema, pluginReportSchema, pluginReportsSchema, runtimeInfoReportSchema, skillReportSchema, skillReportsSchema, subagentParamsSchema, } from "./api/schema";
11
+ export { actorDirectoryReportSchema, actorProfileReportSchema, conversationDetailReportSchema, conversationFeedSchema, conversationFeedQuerySchema, conversationParamsSchema, conversationStatsReportSchema, conversationSubagentTranscriptReportSchema, healthReportSchema, personParamsSchema, pluginOperationalReportFeedSchema, pluginOperationalReportSchema, pluginPackageContentItemReportSchema, pluginPackageContentReportSchema, pluginReportSchema, pluginReportsSchema, runtimeInfoReportSchema, skillReportSchema, skillReportsSchema, subagentParamsSchema, } from "./api/schema";
12
12
  export type { ActorActivityDayReport, ActorDirectoryReport, ActorIdentity, ActorProfileReport, ActorSummaryReport, ActorTotalsReport, ConversationActivityReport, ConversationActivityStatus, ConversationContextEvent, ConversationCost, ConversationDetailReport, ConversationFeed, ConversationParams, ConversationReportStatus, ConversationStatsItem, ConversationStatsReport, ConversationSubagentActivityReport, ConversationSubagentTranscriptReport, ConversationSummaryReport, ConversationSurface, ConversationToolActivityReport, ConversationUsage, HealthReport, PersonParams, PluginOperationalReport, PluginOperationalReportFeed, PluginPackageContentItemReport, PluginPackageContentReport, PluginReport, PluginReports, RuntimeInfoReport, SkillReport, SkillReports, SubagentParams, TranscriptMessage, TranscriptPart, TranscriptPartType, TranscriptRole, } from "./api/schema";
13
13
  export { juniorVercelConfig } from "./vercel";
14
14
  export type { JuniorVercelConfigOptions } from "./vercel";
package/dist/api.js CHANGED
@@ -1,10 +1,13 @@
1
1
  import {
2
+ conversationFeedQuerySchema,
2
3
  conversationParamsSchema,
4
+ locationParamsSchema,
3
5
  personParamsSchema,
4
6
  subagentParamsSchema
5
- } from "./chunk-UAMKJPDF.js";
6
- import "./chunk-CRQVIHDI.js";
7
- import "./chunk-EUZ44ROE.js";
7
+ } from "./chunk-2RNOB32R.js";
8
+ import "./chunk-4AQUWWEM.js";
9
+ import "./chunk-IDZBM3NW.js";
10
+ import "./chunk-MM5UFDAC.js";
8
11
  import {
9
12
  readHealthReport
10
13
  } from "./chunk-QNVHH5PU.js";
@@ -15,6 +18,7 @@ import {
15
18
  skillReportsSchema
16
19
  } from "./chunk-CEA3A3UA.js";
17
20
  import "./chunk-PDO5BLNM.js";
21
+ import "./chunk-FXFQNHRU.js";
18
22
  import "./chunk-MLKGABMK.js";
19
23
 
20
24
  // src/api.ts
@@ -69,11 +73,11 @@ async function readRuntimeInfoReport() {
69
73
  }
70
74
  async function readPluginOperationalReportFeed() {
71
75
  const listRecent = async (listOptions) => {
72
- const { listRecentConversationSummaries } = await import("./plugin-conversations-ZYRWZYEA.js");
76
+ const { listRecentConversationSummaries } = await import("./plugin-conversations-JANXC4GA.js");
73
77
  return listRecentConversationSummaries(listOptions?.limit);
74
78
  };
75
79
  const nowMs = Date.now();
76
- const { getPluginOperationalReports } = await import("./agent-hooks-OSW6C3CJ.js");
80
+ const { getPluginOperationalReports } = await import("./agent-hooks-V6KU7PQN.js");
77
81
  return pluginOperationalReportFeedSchema.parse({
78
82
  source: "plugins",
79
83
  generatedAt: new Date(nowMs).toISOString(),
@@ -94,6 +98,16 @@ function parseParams(schema, params) {
94
98
  message: "Invalid route parameters."
95
99
  });
96
100
  }
101
+ function parseQuery(schema, query) {
102
+ const result = schema.safeParse(query);
103
+ if (result.success) {
104
+ return result.data;
105
+ }
106
+ throw new HTTPException(400, {
107
+ cause: result.error,
108
+ message: "Invalid query parameters."
109
+ });
110
+ }
97
111
  function createJuniorApi() {
98
112
  const app = new Hono();
99
113
  app.get("/api/health", async () => {
@@ -111,16 +125,20 @@ function createJuniorApi() {
111
125
  app.get("/api/plugin-reports", async () => {
112
126
  return Response.json(await readPluginOperationalReportFeed());
113
127
  });
114
- app.get("/api/conversations", async () => {
115
- const { readConversationFeed } = await import("./list-3KZNG3SJ.js");
116
- return Response.json(await readConversationFeed());
128
+ app.get("/api/conversations", async (c) => {
129
+ const { readConversationFeed } = await import("./list-KHRAWZWU.js");
130
+ const { actorEmail } = parseQuery(
131
+ conversationFeedQuerySchema,
132
+ c.req.query()
133
+ );
134
+ return Response.json(await readConversationFeed({ actorEmail }));
117
135
  });
118
136
  app.get("/api/conversations/stats", async () => {
119
- const { readConversationStats } = await import("./stats-L62E4O4U.js");
137
+ const { readConversationStats } = await import("./stats-J3YGCYDF.js");
120
138
  return Response.json(await readConversationStats());
121
139
  });
122
140
  app.get("/api/conversations/:conversationId", async (c) => {
123
- const { readConversationDetail } = await import("./detail-W4ZSD45K.js");
141
+ const { readConversationDetail } = await import("./detail-LU6COZO6.js");
124
142
  const { conversationId } = parseParams(
125
143
  conversationParamsSchema,
126
144
  c.req.param()
@@ -131,7 +149,7 @@ function createJuniorApi() {
131
149
  app.get(
132
150
  "/api/conversations/:conversationId/subagents/:subagentId",
133
151
  async (c) => {
134
- const { readConversationSubagent } = await import("./subagent-5HZPQC7V.js");
152
+ const { readConversationSubagent } = await import("./subagent-P7HOSMVC.js");
135
153
  const { conversationId, subagentId } = parseParams(
136
154
  subagentParamsSchema,
137
155
  c.req.param()
@@ -141,14 +159,24 @@ function createJuniorApi() {
141
159
  }
142
160
  );
143
161
  app.get("/api/people", async () => {
144
- const { readPeopleList } = await import("./list-M5BRWW3D.js");
162
+ const { readPeopleList } = await import("./list-2FI5SFV7.js");
145
163
  return Response.json(await readPeopleList());
146
164
  });
147
165
  app.get("/api/people/:email", async (c) => {
148
166
  const { email } = parseParams(personParamsSchema, c.req.param());
149
- const { readPeopleProfile } = await import("./profile-UEIRSVT3.js");
167
+ const { readPeopleProfile } = await import("./profile-3O3OVENT.js");
150
168
  return Response.json(await readPeopleProfile(email));
151
169
  });
170
+ app.get("/api/locations", async () => {
171
+ const { readLocationDirectory } = await import("./list-4ALSU6ZW.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-5SLCGT6J.js");
177
+ const report = await readLocationDetail(locationId);
178
+ return report ? Response.json(report) : Response.json({ error: "Location not found." }, { status: 404 });
179
+ });
152
180
  return app;
153
181
  }
154
182
  export {
package/dist/app.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  processPluginTask,
6
6
  requireTurnFailureEventId,
7
7
  scheduleSessionCompletedPluginTasks
8
- } from "./chunk-ER45IV77.js";
8
+ } from "./chunk-XSBIISXS.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-NG2AV7IB.js";
16
+ } from "./chunk-VVIXK2BX.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-NJEDJFK4.js";
40
+ } from "./chunk-2T7DCRAW.js";
41
41
  import {
42
42
  GET
43
43
  } from "./chunk-QNVHH5PU.js";
@@ -105,7 +105,7 @@ import {
105
105
  splitSlackReplyText,
106
106
  startOAuthFlow,
107
107
  truncateStatusText
108
- } from "./chunk-DPHWDS6I.js";
108
+ } from "./chunk-45DMFMY2.js";
109
109
  import {
110
110
  CooperativeTurnYieldError,
111
111
  TurnInputCommitLostError,
@@ -134,7 +134,7 @@ import {
134
134
  persistWithRetry,
135
135
  persistYieldSessionRecord,
136
136
  startActiveTurn
137
- } from "./chunk-WJ7STXT6.js";
137
+ } from "./chunk-NSOCZGOH.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-OL6XQ23W.js";
148
+ } from "./chunk-IVXL57YF.js";
149
149
  import {
150
150
  commitMessages,
151
151
  loadConversationProjection,
152
152
  loadProjection,
153
153
  recordAuthorizationCompleted
154
- } from "./chunk-DHHU2WSG.js";
154
+ } from "./chunk-IQIBZXGB.js";
155
155
  import {
156
156
  buildConversationContext,
157
157
  createConversationMemoryService,
@@ -166,8 +166,8 @@ import {
166
166
  persistConversationMessages,
167
167
  updateConversationStats,
168
168
  upsertConversationMessage
169
- } from "./chunk-IO65E4ZD.js";
170
- import "./chunk-H66UCBPW.js";
169
+ } from "./chunk-JPQISMMJ.js";
170
+ import "./chunk-XJA7BPHS.js";
171
171
  import "./chunk-PDO5BLNM.js";
172
172
  import "./chunk-CM5EZD5F.js";
173
173
  import {
@@ -179,7 +179,7 @@ import {
179
179
  setPlugins,
180
180
  validatePlugins,
181
181
  verifySlackDirectCredentialSubject
182
- } from "./chunk-FTTFV6DC.js";
182
+ } from "./chunk-TPTJEHUE.js";
183
183
  import {
184
184
  SlackActionError,
185
185
  downloadPrivateSlackFile,
@@ -190,11 +190,11 @@ import {
190
190
  normalizeSlackConversationId,
191
191
  runWithSlackInstallationToken,
192
192
  runWithWorkspaceTeamId
193
- } from "./chunk-WTYEKPXU.js";
193
+ } from "./chunk-FP5N5OWZ.js";
194
194
  import {
195
195
  createPluginLogger,
196
196
  createPluginState
197
- } from "./chunk-EOWXRY5E.js";
197
+ } from "./chunk-PWC24W5F.js";
198
198
  import {
199
199
  contextProvenance,
200
200
  getConversationStore,
@@ -203,9 +203,8 @@ import {
203
203
  instructionProvenanceFor,
204
204
  juniorAgentSteps,
205
205
  juniorConversationMessages,
206
- juniorConversations,
207
- juniorDestinations
208
- } from "./chunk-OGHXZ4KQ.js";
206
+ juniorConversations
207
+ } from "./chunk-VHRM6GNH.js";
209
208
  import "./chunk-G3E7SCME.js";
210
209
  import {
211
210
  sleep
@@ -233,7 +232,10 @@ import {
233
232
  setSlackReactionConfig,
234
233
  stripRuntimeTurnContext,
235
234
  trimTrailingAssistantMessages
236
- } from "./chunk-EEZCY5WX.js";
235
+ } from "./chunk-A7X2FDUO.js";
236
+ import {
237
+ juniorDestinations
238
+ } from "./chunk-FXFQNHRU.js";
237
239
  import {
238
240
  parseSlackThreadId,
239
241
  readSlackRawMessageContext,
@@ -1153,7 +1155,7 @@ async function runAgentDispatchSlice(callback, deps) {
1153
1155
  modelId: reply.diagnostics.modelId,
1154
1156
  durationMs: reply.diagnostics.durationMs,
1155
1157
  usage: reply.diagnostics.usage,
1156
- reasoningLevel: reply.diagnostics.thinkingLevel,
1158
+ reasoningLevel: reply.diagnostics.reasoningLevel,
1157
1159
  destination: dispatch.destination,
1158
1160
  source: dispatch.source,
1159
1161
  actor: dispatch.actor,
@@ -10304,7 +10306,7 @@ function createReplyToThread(deps) {
10304
10306
  conversationId,
10305
10307
  durationMs: reply.diagnostics.durationMs,
10306
10308
  usage: reply.diagnostics.usage,
10307
- reasoningLevel: reply.diagnostics.thinkingLevel,
10309
+ reasoningLevel: reply.diagnostics.reasoningLevel,
10308
10310
  destination,
10309
10311
  destinationVisibility,
10310
10312
  source,
@@ -11667,15 +11669,19 @@ function normalizeDashboardPath2(path2, fallback) {
11667
11669
  function dashboardHostRoutePaths(dashboard) {
11668
11670
  const basePath = normalizeDashboardPath2(dashboard.basePath, "/");
11669
11671
  const authPath = normalizeDashboardPath2(dashboard.authPath, "/api/auth");
11670
- const pagePaths = basePath === "/" ? [
11671
- "/",
11672
- "/conversations",
11673
- "/conversations/*",
11674
- "/people",
11675
- "/people/*",
11676
- "/plugins",
11677
- "/plugins/*"
11678
- ] : [basePath, `${basePath}/*`];
11672
+ const pagePath = (suffix) => basePath === "/" ? `/${suffix}` : `${basePath}/${suffix}`;
11673
+ const conversationsPath = pagePath("conversations");
11674
+ const peoplePath = pagePath("people");
11675
+ const pagePaths = [
11676
+ basePath,
11677
+ conversationsPath,
11678
+ `${conversationsPath}/*`,
11679
+ pagePath("locations"),
11680
+ `${pagePath("locations")}/*`,
11681
+ peoplePath,
11682
+ `${peoplePath}/*`,
11683
+ pagePath("system")
11684
+ ];
11679
11685
  const loginPath = basePath === "/" ? "/auth/login" : `${basePath}/auth/login`;
11680
11686
  return [
11681
11687
  ...pagePaths,
@@ -11690,6 +11696,8 @@ function dashboardHostRoutePaths(dashboard) {
11690
11696
  "/api/skills",
11691
11697
  "/api/conversations",
11692
11698
  "/api/conversations/*",
11699
+ "/api/locations",
11700
+ "/api/locations/*",
11693
11701
  "/api/people",
11694
11702
  "/api/people/*",
11695
11703
  "/api/config",
@@ -22,6 +22,7 @@ import type { ConversationPendingAuthState } from "@/chat/state/conversation";
22
22
  import type { PiMessageProvenance } from "@/chat/state/session-log";
23
23
  import type { AgentTurnSurface } from "@/chat/state/turn-session";
24
24
  import type { ToolExecutionReport } from "@/chat/tool-support/tool-execution-report";
25
+ import type { TurnReasoningLevel } from "@/chat/reasoning-level";
25
26
  import type { ImageGenerateToolDeps, WebFetchToolDeps, WebSearchToolDeps } from "@/chat/tools/types";
26
27
  export interface AgentRunAttachment {
27
28
  data?: Buffer;
@@ -89,6 +90,8 @@ export interface AgentRunPolicy {
89
90
  /** Cancels provider work when the owning host request is abandoned. */
90
91
  signal?: AbortSignal;
91
92
  authorizationFlowMode?: AuthorizationFlowMode;
93
+ /** Explicit per-agent reasoning level. When set, adaptive routing is disabled. */
94
+ reasoningLevel?: TurnReasoningLevel;
92
95
  configuration?: Record<string, unknown>;
93
96
  channelConfiguration?: ChannelConfigurationService;
94
97
  skillDirs?: string[];
@@ -1,3 +1,4 @@
1
+ import { type TurnReasoningLevel } from "@/chat/reasoning-level";
1
2
  /**
2
3
  * Buffer between the Vercel function timeout and the agent turn timeout so
3
4
  * Junior can abort, persist, and schedule continuation before host teardown.
@@ -9,6 +10,7 @@ export interface BotConfig {
9
10
  loadingMessages: string[];
10
11
  modelId: string;
11
12
  modelProfiles: Readonly<Record<string, string>>;
13
+ reasoningLevel?: TurnReasoningLevel;
12
14
  modelContextWindowTokens?: number;
13
15
  visionModelId?: string;
14
16
  turnTimeoutMs: number;
@@ -0,0 +1,4 @@
1
+ export declare const TURN_REASONING_LEVELS: readonly ["none", "low", "medium", "high", "xhigh"];
2
+ export type TurnReasoningLevel = (typeof TURN_REASONING_LEVELS)[number];
3
+ /** Validate a configured main-agent reasoning level. */
4
+ export declare function parseTurnReasoningLevel(value: unknown): TurnReasoningLevel;
@@ -32,6 +32,7 @@ interface HandoffContextArgs {
32
32
  conversationId: string;
33
33
  metadata?: CompactContextArgs["metadata"];
34
34
  piMessages: PiMessage[];
35
+ runtimeContext: PiMessage[];
35
36
  signal?: AbortSignal;
36
37
  target: {
37
38
  modelId: string;
@@ -1,9 +1,9 @@
1
1
  import type { ThinkingLevel as AgentThinkingLevel } from "@earendil-works/pi-agent-core";
2
2
  import type { ThinkingLevel as ProviderThinkingLevel } from "@earendil-works/pi-ai";
3
3
  import { z } from "zod";
4
- declare const TURN_THINKING_LEVELS: readonly ["none", "low", "medium", "high", "xhigh"];
4
+ import { type TurnReasoningLevel } from "@/chat/reasoning-level";
5
5
  declare const turnExecutionProfileSchema: z.ZodObject<{
6
- thinking_level: z.ZodEnum<{
6
+ reasoning_level: z.ZodEnum<{
7
7
  low: "low";
8
8
  medium: "medium";
9
9
  high: "high";
@@ -13,14 +13,15 @@ declare const turnExecutionProfileSchema: z.ZodObject<{
13
13
  confidence: z.ZodPreprocess<z.ZodNumber>;
14
14
  reason: z.ZodString;
15
15
  }, z.core.$strip>;
16
- type TurnThinkingLevel = (typeof TURN_THINKING_LEVELS)[number];
17
- export interface TurnThinkingSelection {
16
+ export interface TurnReasoningSelection {
18
17
  confidence?: number;
19
- thinkingLevel: TurnThinkingLevel;
18
+ reasoningLevel: TurnReasoningLevel;
20
19
  reason: string;
21
20
  }
22
- /** Choose the thinking level for the upcoming assistant turn. */
23
- export declare function selectTurnThinkingLevel(args: {
21
+ /** Preserve an explicitly configured reasoning level without invoking the router. */
22
+ export declare function configuredTurnReasoningLevel(reasoningLevel: TurnReasoningLevel, source: "agent_config" | "default"): TurnReasoningSelection;
23
+ /** Choose the reasoning level for the upcoming assistant turn when none is configured. */
24
+ export declare function selectTurnReasoningLevel(args: {
24
25
  completeObject: (args: {
25
26
  modelId: string;
26
27
  schema: typeof turnExecutionProfileSchema;
@@ -43,7 +44,7 @@ export declare function selectTurnThinkingLevel(args: {
43
44
  currentTurnBlocks?: string[];
44
45
  fastModelId: string;
45
46
  messageText: string;
46
- }): Promise<TurnThinkingSelection>;
47
- /** Convert a routing bucket into the Pi Agent thinking level for a main turn. */
48
- export declare function toAgentThinkingLevel(level: TurnThinkingSelection["thinkingLevel"]): AgentThinkingLevel | "off";
47
+ }): Promise<TurnReasoningSelection>;
48
+ /** Convert a routing bucket into the Pi Agent reasoning setting for a main turn. */
49
+ export declare function toPiReasoningLevel(level: TurnReasoningSelection["reasoningLevel"]): AgentThinkingLevel | "off";
49
50
  export {};
@@ -1,6 +1,6 @@
1
1
  import type { LogContext } from "@/chat/logging";
2
2
  import type { PiMessage } from "@/chat/pi/messages";
3
- import type { TurnThinkingSelection } from "@/chat/services/turn-thinking-level";
3
+ import type { TurnReasoningSelection } from "@/chat/services/turn-reasoning-level";
4
4
  import type { AgentTurnUsage } from "@/chat/usage";
5
5
  import type { ReplyDeliveryPlan } from "@/chat/services/reply-delivery-plan";
6
6
  import type { ThreadArtifactsState } from "@/chat/state/artifacts";
@@ -11,7 +11,7 @@ export interface AgentTurnDiagnostics {
11
11
  providerError?: unknown;
12
12
  modelId: string;
13
13
  outcome: "success" | "execution_failure" | "provider_error";
14
- thinkingLevel?: TurnThinkingSelection["thinkingLevel"];
14
+ reasoningLevel?: TurnReasoningSelection["reasoningLevel"];
15
15
  stopReason?: string;
16
16
  toolCalls: string[];
17
17
  toolErrorCount: number;
@@ -42,7 +42,7 @@ export interface TurnResultInput {
42
42
  shouldTrace: boolean;
43
43
  spanContext: LogContext;
44
44
  usage?: AgentTurnUsage;
45
- thinkingSelection: TurnThinkingSelection;
45
+ reasoningSelection: TurnReasoningSelection;
46
46
  correlation?: {
47
47
  threadId?: string;
48
48
  actorId?: string;
@@ -32,7 +32,7 @@ export declare function createSearchToolsTool(catalogTools: Record<string, AnyTo
32
32
  tools: {
33
33
  tool_name: string;
34
34
  description: string;
35
- exposure: "hidden" | "direct" | "deferred" | "modelOnly";
35
+ exposure: "direct" | "hidden" | "deferred" | "modelOnly";
36
36
  signature: string;
37
37
  call: {
38
38
  tool_name: string;
@@ -77,7 +77,7 @@ export declare function createSearchToolsTool(catalogTools: Record<string, AnyTo
77
77
  tools: {
78
78
  tool_name: string;
79
79
  description: string;
80
- exposure: "hidden" | "direct" | "deferred" | "modelOnly";
80
+ exposure: "direct" | "hidden" | "deferred" | "modelOnly";
81
81
  signature: string;
82
82
  call: {
83
83
  tool_name: string;