@sentry/junior 0.97.0 → 0.98.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 (55) hide show
  1. package/dist/{agent-hooks-XSUIVRQS.js → agent-hooks-OSW6C3CJ.js} +2 -2
  2. package/dist/api/conversations/detail.d.ts +1 -1
  3. package/dist/api/conversations/detail.query.d.ts +1 -1
  4. package/dist/api/conversations/projection.d.ts +0 -1
  5. package/dist/api/conversations/schema.d.ts +31 -8
  6. package/dist/api/people/schema.d.ts +0 -11
  7. package/dist/api/people/shared.d.ts +2 -4
  8. package/dist/api/schema.d.ts +1 -1
  9. package/dist/api/schema.js +2 -2
  10. package/dist/api-reference.d.ts +1 -1
  11. package/dist/api.js +10 -10
  12. package/dist/app.js +40 -29
  13. package/dist/chat/conversations/search.d.ts +24 -0
  14. package/dist/chat/conversations/sql/search.d.ts +4 -0
  15. package/dist/chat/db.d.ts +3 -0
  16. package/dist/chat/runtime/report-progress.d.ts +3 -0
  17. package/dist/chat/runtime/slack-resume.d.ts +2 -0
  18. package/dist/chat/slack/assistant-thread/status-scheduler.d.ts +4 -3
  19. package/dist/chat/slack/outbound.d.ts +6 -0
  20. package/dist/chat/slack/tools/conversation-search.d.ts +71 -0
  21. package/dist/chat/state/turn-session.d.ts +2 -0
  22. package/dist/chat/tool-support/zod-tool.d.ts +1 -1
  23. package/dist/chunk-6DTVCPLO.js +146 -0
  24. package/dist/{chunk-AUUCAFDE.js → chunk-6HHEZENZ.js} +126 -11
  25. package/dist/{chunk-VFH4ZKZT.js → chunk-CRQVIHDI.js} +1 -3
  26. package/dist/{chunk-6U26PYI5.js → chunk-CV22LUIV.js} +7 -17
  27. package/dist/{chunk-GUAP3H7O.js → chunk-DHHU2WSG.js} +2 -2
  28. package/dist/{chunk-XIRPQQVE.js → chunk-DPHWDS6I.js} +297 -171
  29. package/dist/{chunk-T533JLM3.js → chunk-ER45IV77.js} +8 -6
  30. package/dist/{chunk-LUAE4MGW.js → chunk-EUZ44ROE.js} +21 -4
  31. package/dist/{chunk-5HLDPVYS.js → chunk-FTTFV6DC.js} +1 -1
  32. package/dist/{chunk-3F4OPKGF.js → chunk-IO65E4ZD.js} +2 -2
  33. package/dist/{chunk-ON6YKIQ7.js → chunk-KJHAW6VE.js} +4 -10
  34. package/dist/{chunk-FBHZJFHI.js → chunk-NJEDJFK4.js} +1 -1
  35. package/dist/{chunk-35BNLDOJ.js → chunk-OGHXZ4KQ.js} +134 -57
  36. package/dist/{chunk-WJOSZOON.js → chunk-OL6XQ23W.js} +11 -150
  37. package/dist/{chunk-WGXMTFNU.js → chunk-WJ7STXT6.js} +5 -3
  38. package/dist/cli/chat.js +11 -10
  39. package/dist/cli/plugins.js +2 -2
  40. package/dist/cli/upgrade.js +9 -7
  41. package/dist/{db-BWXYIKFQ.js → db-GFSCDAHS.js} +3 -1
  42. package/dist/detail-W4ZSD45K.js +67 -0
  43. package/dist/{legacy-import-3NQJVGQL.js → legacy-import-6WWXMALY.js} +2 -2
  44. package/dist/{list-UXJI5Q5X.js → list-3KZNG3SJ.js} +3 -3
  45. package/dist/{list-A3WFRIYX.js → list-M5BRWW3D.js} +5 -6
  46. package/dist/{plugin-conversations-DDNGC35A.js → plugin-conversations-ZYRWZYEA.js} +2 -2
  47. package/dist/{profile-4RYDXWTF.js → profile-UEIRSVT3.js} +5 -5
  48. package/dist/{runner-JALSYH2P.js → runner-267ZRLZD.js} +8 -7
  49. package/dist/{stats-XKXH3PTY.js → stats-L62E4O4U.js} +7 -17
  50. package/dist/{subagent-TZ55XY37.js → subagent-5HZPQC7V.js} +6 -6
  51. package/migrations/0002_conversation_message_search.sql +1 -0
  52. package/migrations/meta/0002_snapshot.json +987 -0
  53. package/migrations/meta/_journal.json +7 -0
  54. package/package.json +5 -5
  55. package/dist/detail-GA6NXWQJ.js +0 -43
@@ -11,10 +11,10 @@ import {
11
11
  getPlugins,
12
12
  setPlugins,
13
13
  validatePlugins
14
- } from "./chunk-5HLDPVYS.js";
14
+ } from "./chunk-FTTFV6DC.js";
15
15
  import "./chunk-WTYEKPXU.js";
16
16
  import "./chunk-EOWXRY5E.js";
17
- import "./chunk-35BNLDOJ.js";
17
+ import "./chunk-OGHXZ4KQ.js";
18
18
  import "./chunk-G3E7SCME.js";
19
19
  import "./chunk-4ZNGQH7C.js";
20
20
  import "./chunk-EEZCY5WX.js";
@@ -1,3 +1,3 @@
1
1
  import type { ConversationDetailReport } from "./schema";
2
- /** Load one conversation directly from durable SQL records. */
2
+ /** Load one conversation with durable content and recent run diagnostics. */
3
3
  export declare function readConversationDetail(conversationId: string): Promise<ConversationDetailReport | undefined>;
@@ -1,3 +1,3 @@
1
1
  import type { ConversationDetailReport } from "./schema";
2
- /** Read one conversation and its cumulative metrics from durable SQL. */
2
+ /** Read one SQL conversation with its latest operational run settings. */
3
3
  export declare function readConversationDetailFromSql(conversationId: string): Promise<ConversationDetailReport | undefined>;
@@ -9,6 +9,5 @@ export declare function titleFromConversation(args: {
9
9
  export declare function conversationSummaryFromStoredConversation(args: {
10
10
  conversation: StoredConversation;
11
11
  durationMs: number;
12
- nowMs: number;
13
12
  usage?: ConversationUsage;
14
13
  }): ConversationSummaryReport;
@@ -3,7 +3,6 @@ export declare const conversationReportStatusSchema: z.ZodEnum<{
3
3
  active: "active";
4
4
  completed: "completed";
5
5
  failed: "failed";
6
- hung: "hung";
7
6
  }>;
8
7
  export declare const conversationSurfaceSchema: z.ZodEnum<{
9
8
  api: "api";
@@ -62,7 +61,6 @@ export declare const conversationSummaryReportSchema: z.ZodObject<{
62
61
  active: "active";
63
62
  completed: "completed";
64
63
  failed: "failed";
65
- hung: "hung";
66
64
  }>;
67
65
  startedAt: z.ZodString;
68
66
  lastSeenAt: z.ZodString;
@@ -301,6 +299,20 @@ export declare const conversationActivityReportSchema: z.ZodDiscriminatedUnion<[
301
299
  subagentKind: z.ZodString;
302
300
  transcriptAvailable: z.ZodOptional<z.ZodBoolean>;
303
301
  }, z.core.$strict>], "type">;
302
+ export declare const conversationContextEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
303
+ type: z.ZodLiteral<"context_compacted">;
304
+ createdAt: z.ZodString;
305
+ modelId: z.ZodOptional<z.ZodString>;
306
+ summary: z.ZodOptional<z.ZodString>;
307
+ transcriptIndex: z.ZodNumber;
308
+ }, z.core.$strict>, z.ZodObject<{
309
+ type: z.ZodLiteral<"model_handoff">;
310
+ createdAt: z.ZodString;
311
+ fromModelId: z.ZodOptional<z.ZodString>;
312
+ summary: z.ZodOptional<z.ZodString>;
313
+ toModelId: z.ZodString;
314
+ transcriptIndex: z.ZodNumber;
315
+ }, z.core.$strict>], "type">;
304
316
  export declare const conversationDetailReportSchema: z.ZodObject<{
305
317
  displayTitle: z.ZodString;
306
318
  cumulativeDurationMs: z.ZodNumber;
@@ -324,7 +336,6 @@ export declare const conversationDetailReportSchema: z.ZodObject<{
324
336
  active: "active";
325
337
  completed: "completed";
326
338
  failed: "failed";
327
- hung: "hung";
328
339
  }>;
329
340
  startedAt: z.ZodString;
330
341
  lastSeenAt: z.ZodString;
@@ -411,6 +422,22 @@ export declare const conversationDetailReportSchema: z.ZodObject<{
411
422
  subagentKind: z.ZodString;
412
423
  transcriptAvailable: z.ZodOptional<z.ZodBoolean>;
413
424
  }, z.core.$strict>], "type">>>;
425
+ modelId: z.ZodOptional<z.ZodString>;
426
+ reasoningLevel: z.ZodOptional<z.ZodString>;
427
+ contextEvents: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
428
+ type: z.ZodLiteral<"context_compacted">;
429
+ createdAt: z.ZodString;
430
+ modelId: z.ZodOptional<z.ZodString>;
431
+ summary: z.ZodOptional<z.ZodString>;
432
+ transcriptIndex: z.ZodNumber;
433
+ }, z.core.$strict>, z.ZodObject<{
434
+ type: z.ZodLiteral<"model_handoff">;
435
+ createdAt: z.ZodString;
436
+ fromModelId: z.ZodOptional<z.ZodString>;
437
+ summary: z.ZodOptional<z.ZodString>;
438
+ toModelId: z.ZodString;
439
+ transcriptIndex: z.ZodNumber;
440
+ }, z.core.$strict>], "type">>>;
414
441
  transcriptAvailable: z.ZodBoolean;
415
442
  transcriptMetadata: z.ZodOptional<z.ZodArray<z.ZodObject<{
416
443
  parts: z.ZodArray<z.ZodObject<{
@@ -590,7 +617,6 @@ export declare const conversationFeedSchema: z.ZodObject<{
590
617
  active: "active";
591
618
  completed: "completed";
592
619
  failed: "failed";
593
- hung: "hung";
594
620
  }>;
595
621
  startedAt: z.ZodString;
596
622
  lastSeenAt: z.ZodString;
@@ -621,7 +647,6 @@ export declare const conversationStatsItemSchema: z.ZodObject<{
621
647
  conversations: z.ZodNumber;
622
648
  durationMs: z.ZodNumber;
623
649
  failed: z.ZodNumber;
624
- hung: z.ZodNumber;
625
650
  label: z.ZodString;
626
651
  costUsd: z.ZodOptional<z.ZodNumber>;
627
652
  tokens: z.ZodOptional<z.ZodNumber>;
@@ -632,13 +657,11 @@ export declare const conversationStatsReportSchema: z.ZodObject<{
632
657
  durationMs: z.ZodNumber;
633
658
  failed: z.ZodNumber;
634
659
  generatedAt: z.ZodString;
635
- hung: z.ZodNumber;
636
660
  locations: z.ZodArray<z.ZodObject<{
637
661
  active: z.ZodNumber;
638
662
  conversations: z.ZodNumber;
639
663
  durationMs: z.ZodNumber;
640
664
  failed: z.ZodNumber;
641
- hung: z.ZodNumber;
642
665
  label: z.ZodString;
643
666
  costUsd: z.ZodOptional<z.ZodNumber>;
644
667
  tokens: z.ZodOptional<z.ZodNumber>;
@@ -648,7 +671,6 @@ export declare const conversationStatsReportSchema: z.ZodObject<{
648
671
  conversations: z.ZodNumber;
649
672
  durationMs: z.ZodNumber;
650
673
  failed: z.ZodNumber;
651
- hung: z.ZodNumber;
652
674
  label: z.ZodString;
653
675
  costUsd: z.ZodOptional<z.ZodNumber>;
654
676
  tokens: z.ZodOptional<z.ZodNumber>;
@@ -672,6 +694,7 @@ export type TranscriptPartType = z.infer<typeof transcriptPartTypeSchema>;
672
694
  export type TranscriptPart = z.infer<typeof transcriptPartSchema>;
673
695
  export type TranscriptRole = z.infer<typeof transcriptRoleSchema>;
674
696
  export type TranscriptMessage = z.infer<typeof transcriptMessageSchema>;
697
+ export type ConversationContextEvent = z.infer<typeof conversationContextEventSchema>;
675
698
  export type ConversationActivityStatus = z.infer<typeof conversationActivityStatusSchema>;
676
699
  export type ConversationSubagentActivityReport = z.infer<typeof conversationSubagentActivityReportSchema>;
677
700
  export type ConversationToolActivityReport = z.infer<typeof conversationToolActivityReportSchema>;
@@ -5,7 +5,6 @@ export declare const peopleConversationSummaryReportSchema: z.ZodObject<{
5
5
  active: "active";
6
6
  completed: "completed";
7
7
  failed: "failed";
8
- hung: "hung";
9
8
  }>;
10
9
  surface: z.ZodEnum<{
11
10
  api: "api";
@@ -32,7 +31,6 @@ export declare const peopleConversationSummaryReportSchema: z.ZodObject<{
32
31
  export declare const peopleConversationStatsItemSchema: z.ZodObject<{
33
32
  active: z.ZodNumber;
34
33
  failed: z.ZodNumber;
35
- hung: z.ZodNumber;
36
34
  conversations: z.ZodNumber;
37
35
  durationMs: z.ZodNumber;
38
36
  label: z.ZodString;
@@ -44,7 +42,6 @@ export declare const actorActivityDayReportSchema: z.ZodObject<{
44
42
  date: z.ZodString;
45
43
  durationMs: z.ZodNumber;
46
44
  failed: z.ZodNumber;
47
- hung: z.ZodNumber;
48
45
  tokens: z.ZodOptional<z.ZodNumber>;
49
46
  }, z.core.$strict>;
50
47
  export declare const actorTotalsReportSchema: z.ZodObject<{
@@ -53,7 +50,6 @@ export declare const actorTotalsReportSchema: z.ZodObject<{
53
50
  conversations: z.ZodNumber;
54
51
  durationMs: z.ZodNumber;
55
52
  failed: z.ZodNumber;
56
- hung: z.ZodNumber;
57
53
  tokens: z.ZodOptional<z.ZodNumber>;
58
54
  }, z.core.$strict>;
59
55
  export declare const identifiedActorSchema: z.ZodObject<{
@@ -68,7 +64,6 @@ export declare const actorSummaryReportSchema: z.ZodObject<{
68
64
  conversations: z.ZodNumber;
69
65
  durationMs: z.ZodNumber;
70
66
  failed: z.ZodNumber;
71
- hung: z.ZodNumber;
72
67
  tokens: z.ZodOptional<z.ZodNumber>;
73
68
  firstSeenAt: z.ZodString;
74
69
  lastSeenAt: z.ZodString;
@@ -87,7 +82,6 @@ export declare const actorDirectoryReportSchema: z.ZodObject<{
87
82
  conversations: z.ZodNumber;
88
83
  durationMs: z.ZodNumber;
89
84
  failed: z.ZodNumber;
90
- hung: z.ZodNumber;
91
85
  tokens: z.ZodOptional<z.ZodNumber>;
92
86
  firstSeenAt: z.ZodString;
93
87
  lastSeenAt: z.ZodString;
@@ -110,14 +104,12 @@ export declare const actorProfileReportSchema: z.ZodObject<{
110
104
  date: z.ZodString;
111
105
  durationMs: z.ZodNumber;
112
106
  failed: z.ZodNumber;
113
- hung: z.ZodNumber;
114
107
  tokens: z.ZodOptional<z.ZodNumber>;
115
108
  }, z.core.$strict>>;
116
109
  generatedAt: z.ZodString;
117
110
  locations: z.ZodArray<z.ZodObject<{
118
111
  active: z.ZodNumber;
119
112
  failed: z.ZodNumber;
120
- hung: z.ZodNumber;
121
113
  conversations: z.ZodNumber;
122
114
  durationMs: z.ZodNumber;
123
115
  label: z.ZodString;
@@ -128,7 +120,6 @@ export declare const actorProfileReportSchema: z.ZodObject<{
128
120
  active: "active";
129
121
  completed: "completed";
130
122
  failed: "failed";
131
- hung: "hung";
132
123
  }>;
133
124
  surface: z.ZodEnum<{
134
125
  api: "api";
@@ -164,7 +155,6 @@ export declare const actorProfileReportSchema: z.ZodObject<{
164
155
  surfaces: z.ZodArray<z.ZodObject<{
165
156
  active: z.ZodNumber;
166
157
  failed: z.ZodNumber;
167
- hung: z.ZodNumber;
168
158
  conversations: z.ZodNumber;
169
159
  durationMs: z.ZodNumber;
170
160
  label: z.ZodString;
@@ -176,7 +166,6 @@ export declare const actorProfileReportSchema: z.ZodObject<{
176
166
  conversations: z.ZodNumber;
177
167
  durationMs: z.ZodNumber;
178
168
  failed: z.ZodNumber;
179
- hung: z.ZodNumber;
180
169
  tokens: z.ZodOptional<z.ZodNumber>;
181
170
  }, z.core.$strict>;
182
171
  truncated: z.ZodBoolean;
@@ -18,7 +18,7 @@ export declare function slackLocationLabel(args: {
18
18
  channelNameRedacted?: boolean;
19
19
  }): string | undefined;
20
20
  /** Project one SQL conversation row into the people API conversation summary. */
21
- export declare function summaryFromRow(row: PeopleConversationRow, nowMs: number): ConversationSummaryReport;
21
+ export declare function summaryFromRow(row: PeopleConversationRow): ConversationSummaryReport;
22
22
  /** Collapse stored conversation usage into the dashboard token total. */
23
23
  export declare function usageTokens(row: PeopleConversationRow): number | undefined;
24
24
  /** Build a zeroed totals object for people API aggregations. */
@@ -31,10 +31,9 @@ export declare function emptyActivityDay(date: string): ActorActivityDayReport;
31
31
  export declare function signals(summary: ConversationSummaryReport): {
32
32
  active: boolean;
33
33
  failed: boolean;
34
- hung: boolean;
35
34
  };
36
35
  /** Add status counters into a people API aggregate row. */
37
- export declare function addSignals(target: Pick<ActorTotalsReport, "active" | "failed" | "hung">, value: ReturnType<typeof signals>): void;
36
+ export declare function addSignals(target: Pick<ActorTotalsReport, "active" | "failed">, value: ReturnType<typeof signals>): void;
38
37
  /** Return only actor identities that can be grouped by normalized email. */
39
38
  export declare function identityWithEmail(actor: ActorIdentity | undefined): (ActorIdentity & {
40
39
  email: string;
@@ -53,7 +52,6 @@ export declare function activityDays(days: Map<string, ActorActivityDayReport>,
53
52
  export declare function statsItems(map: Map<string, ConversationStatsItem>): {
54
53
  active: number;
55
54
  failed: number;
56
- hung: number;
57
55
  conversations: number;
58
56
  durationMs: number;
59
57
  label: string;
@@ -1,5 +1,5 @@
1
1
  export { conversationDetailReportSchema, conversationFeedSchema, conversationStatsReportSchema, conversationSubagentTranscriptReportSchema, } from "./conversations/schema";
2
- export type { ActorIdentity, ConversationActivityReport, ConversationActivityStatus, ConversationCost, ConversationDetailReport, ConversationFeed, ConversationReportStatus, ConversationStatsItem, ConversationStatsReport, ConversationSubagentActivityReport, ConversationSubagentTranscriptReport, ConversationSummaryReport, ConversationSurface, ConversationToolActivityReport, ConversationUsage, TranscriptMessage, TranscriptPart, TranscriptPartType, TranscriptRole, } from "./conversations/schema";
2
+ 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
3
  export { actorDirectoryReportSchema, actorProfileReportSchema, } from "./people/schema";
4
4
  export type { ActorActivityDayReport, ActorDirectoryReport, ActorProfileReport, ActorSummaryReport, ActorTotalsReport, } from "./people/schema";
5
5
  export { healthReportSchema, pluginOperationalReportFeedSchema, pluginOperationalReportSchema, pluginPackageContentItemReportSchema, pluginPackageContentReportSchema, pluginReportSchema, pluginReportsSchema, runtimeInfoReportSchema, skillReportSchema, skillReportsSchema, } from "../reporting-schema";
@@ -6,13 +6,13 @@ import {
6
6
  import {
7
7
  actorDirectoryReportSchema,
8
8
  actorProfileReportSchema
9
- } from "../chunk-VFH4ZKZT.js";
9
+ } from "../chunk-CRQVIHDI.js";
10
10
  import {
11
11
  conversationDetailReportSchema,
12
12
  conversationFeedSchema,
13
13
  conversationStatsReportSchema,
14
14
  conversationSubagentTranscriptReportSchema
15
- } from "../chunk-LUAE4MGW.js";
15
+ } from "../chunk-EUZ44ROE.js";
16
16
  import {
17
17
  healthReportSchema,
18
18
  pluginOperationalReportFeedSchema,
@@ -9,6 +9,6 @@ export type { JuniorPluginInput, JuniorPluginSet, JuniorPluginSetOptions, } from
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
11
  export { actorDirectoryReportSchema, actorProfileReportSchema, conversationDetailReportSchema, conversationFeedSchema, conversationParamsSchema, conversationStatsReportSchema, conversationSubagentTranscriptReportSchema, healthReportSchema, personParamsSchema, pluginOperationalReportFeedSchema, pluginOperationalReportSchema, pluginPackageContentItemReportSchema, pluginPackageContentReportSchema, pluginReportSchema, pluginReportsSchema, runtimeInfoReportSchema, skillReportSchema, skillReportsSchema, subagentParamsSchema, } from "./api/schema";
12
- export type { ActorActivityDayReport, ActorDirectoryReport, ActorIdentity, ActorProfileReport, ActorSummaryReport, ActorTotalsReport, ConversationActivityReport, ConversationActivityStatus, 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";
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
@@ -3,8 +3,8 @@ import {
3
3
  personParamsSchema,
4
4
  subagentParamsSchema
5
5
  } from "./chunk-UAMKJPDF.js";
6
- import "./chunk-VFH4ZKZT.js";
7
- import "./chunk-LUAE4MGW.js";
6
+ import "./chunk-CRQVIHDI.js";
7
+ import "./chunk-EUZ44ROE.js";
8
8
  import {
9
9
  readHealthReport
10
10
  } from "./chunk-QNVHH5PU.js";
@@ -69,11 +69,11 @@ async function readRuntimeInfoReport() {
69
69
  }
70
70
  async function readPluginOperationalReportFeed() {
71
71
  const listRecent = async (listOptions) => {
72
- const { listRecentConversationSummaries } = await import("./plugin-conversations-DDNGC35A.js");
72
+ const { listRecentConversationSummaries } = await import("./plugin-conversations-ZYRWZYEA.js");
73
73
  return listRecentConversationSummaries(listOptions?.limit);
74
74
  };
75
75
  const nowMs = Date.now();
76
- const { getPluginOperationalReports } = await import("./agent-hooks-XSUIVRQS.js");
76
+ const { getPluginOperationalReports } = await import("./agent-hooks-OSW6C3CJ.js");
77
77
  return pluginOperationalReportFeedSchema.parse({
78
78
  source: "plugins",
79
79
  generatedAt: new Date(nowMs).toISOString(),
@@ -112,15 +112,15 @@ function createJuniorApi() {
112
112
  return Response.json(await readPluginOperationalReportFeed());
113
113
  });
114
114
  app.get("/api/conversations", async () => {
115
- const { readConversationFeed } = await import("./list-UXJI5Q5X.js");
115
+ const { readConversationFeed } = await import("./list-3KZNG3SJ.js");
116
116
  return Response.json(await readConversationFeed());
117
117
  });
118
118
  app.get("/api/conversations/stats", async () => {
119
- const { readConversationStats } = await import("./stats-XKXH3PTY.js");
119
+ const { readConversationStats } = await import("./stats-L62E4O4U.js");
120
120
  return Response.json(await readConversationStats());
121
121
  });
122
122
  app.get("/api/conversations/:conversationId", async (c) => {
123
- const { readConversationDetail } = await import("./detail-GA6NXWQJ.js");
123
+ const { readConversationDetail } = await import("./detail-W4ZSD45K.js");
124
124
  const { conversationId } = parseParams(
125
125
  conversationParamsSchema,
126
126
  c.req.param()
@@ -131,7 +131,7 @@ function createJuniorApi() {
131
131
  app.get(
132
132
  "/api/conversations/:conversationId/subagents/:subagentId",
133
133
  async (c) => {
134
- const { readConversationSubagent } = await import("./subagent-TZ55XY37.js");
134
+ const { readConversationSubagent } = await import("./subagent-5HZPQC7V.js");
135
135
  const { conversationId, subagentId } = parseParams(
136
136
  subagentParamsSchema,
137
137
  c.req.param()
@@ -141,12 +141,12 @@ function createJuniorApi() {
141
141
  }
142
142
  );
143
143
  app.get("/api/people", async () => {
144
- const { readPeopleList } = await import("./list-A3WFRIYX.js");
144
+ const { readPeopleList } = await import("./list-M5BRWW3D.js");
145
145
  return Response.json(await readPeopleList());
146
146
  });
147
147
  app.get("/api/people/:email", async (c) => {
148
148
  const { email } = parseParams(personParamsSchema, c.req.param());
149
- const { readPeopleProfile } = await import("./profile-4RYDXWTF.js");
149
+ const { readPeopleProfile } = await import("./profile-UEIRSVT3.js");
150
150
  return Response.json(await readPeopleProfile(email));
151
151
  });
152
152
  return app;
package/dist/app.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  processPluginTask,
6
6
  requireTurnFailureEventId,
7
7
  scheduleSessionCompletedPluginTasks
8
- } from "./chunk-T533JLM3.js";
8
+ } from "./chunk-ER45IV77.js";
9
9
  import {
10
10
  buildSentryConversationUrl
11
11
  } from "./chunk-LVUKF5CE.js";
@@ -37,7 +37,7 @@ import {
37
37
  requestConversationContinuation,
38
38
  requestConversationWork,
39
39
  startConversationWork
40
- } from "./chunk-FBHZJFHI.js";
40
+ } from "./chunk-NJEDJFK4.js";
41
41
  import {
42
42
  GET
43
43
  } from "./chunk-QNVHH5PU.js";
@@ -87,6 +87,7 @@ import {
87
87
  formatSlackLink,
88
88
  getConfigDefaults,
89
89
  getMcpStoredOAuthCredentials,
90
+ latestReportedProgress,
90
91
  listThreadReplies,
91
92
  normalizeSandboxEgressTracePropagationDomains,
92
93
  normalizeSlackStatusText,
@@ -104,7 +105,7 @@ import {
104
105
  splitSlackReplyText,
105
106
  startOAuthFlow,
106
107
  truncateStatusText
107
- } from "./chunk-XIRPQQVE.js";
108
+ } from "./chunk-DPHWDS6I.js";
108
109
  import {
109
110
  CooperativeTurnYieldError,
110
111
  TurnInputCommitLostError,
@@ -133,22 +134,24 @@ import {
133
134
  persistWithRetry,
134
135
  persistYieldSessionRecord,
135
136
  startActiveTurn
136
- } from "./chunk-WGXMTFNU.js";
137
+ } from "./chunk-WJ7STXT6.js";
137
138
  import {
138
139
  JUNIOR_THREAD_STATE_TTL_MS,
140
+ coerceThreadConversationState
141
+ } from "./chunk-6DTVCPLO.js";
142
+ import {
139
143
  abandonAgentTurnSessionRecord,
140
- coerceThreadConversationState,
141
144
  failAgentTurnSessionRecord,
142
145
  getAgentTurnSessionRecord,
143
146
  listAgentTurnSessionSummariesForConversation,
144
147
  recordAgentTurnSessionSummary
145
- } from "./chunk-WJOSZOON.js";
148
+ } from "./chunk-OL6XQ23W.js";
146
149
  import {
147
150
  commitMessages,
148
151
  loadConversationProjection,
149
152
  loadProjection,
150
153
  recordAuthorizationCompleted
151
- } from "./chunk-GUAP3H7O.js";
154
+ } from "./chunk-DHHU2WSG.js";
152
155
  import {
153
156
  buildConversationContext,
154
157
  createConversationMemoryService,
@@ -163,7 +166,7 @@ import {
163
166
  persistConversationMessages,
164
167
  updateConversationStats,
165
168
  upsertConversationMessage
166
- } from "./chunk-3F4OPKGF.js";
169
+ } from "./chunk-IO65E4ZD.js";
167
170
  import "./chunk-H66UCBPW.js";
168
171
  import "./chunk-PDO5BLNM.js";
169
172
  import "./chunk-CM5EZD5F.js";
@@ -176,7 +179,7 @@ import {
176
179
  setPlugins,
177
180
  validatePlugins,
178
181
  verifySlackDirectCredentialSubject
179
- } from "./chunk-5HLDPVYS.js";
182
+ } from "./chunk-FTTFV6DC.js";
180
183
  import {
181
184
  SlackActionError,
182
185
  downloadPrivateSlackFile,
@@ -202,7 +205,7 @@ import {
202
205
  juniorConversationMessages,
203
206
  juniorConversations,
204
207
  juniorDestinations
205
- } from "./chunk-35BNLDOJ.js";
208
+ } from "./chunk-OGHXZ4KQ.js";
206
209
  import "./chunk-G3E7SCME.js";
207
210
  import {
208
211
  sleep
@@ -315,7 +318,7 @@ function normalizeDashboardPath(path2, fallback) {
315
318
  return stripTrailingSlashes(withSlash);
316
319
  }
317
320
  function resolveDashboardBaseURL(config) {
318
- const explicit = config.baseURL ?? process.env.BETTER_AUTH_URL ?? process.env.JUNIOR_BASE_URL;
321
+ const explicit = config.baseURL ?? process.env.JUNIOR_BASE_URL;
319
322
  if (explicit?.trim()) {
320
323
  return stripTrailingSlashes(withHttps(explicit.trim()));
321
324
  }
@@ -3451,17 +3454,7 @@ function createAssistantStatusScheduler(args) {
3451
3454
  }
3452
3455
  };
3453
3456
  return {
3454
- start(status) {
3455
- active = true;
3456
- clearPending();
3457
- if (status) {
3458
- void postRenderedStatus(status);
3459
- return;
3460
- }
3461
- currentKey = "initial";
3462
- void postStatus(getInitialStatusText(), loadingMessages);
3463
- },
3464
- async stop() {
3457
+ async clear() {
3465
3458
  active = false;
3466
3459
  clearPending();
3467
3460
  if (rotationTimer) {
@@ -3473,6 +3466,20 @@ function createAssistantStatusScheduler(args) {
3473
3466
  },
3474
3467
  update(status) {
3475
3468
  if (!active) {
3469
+ active = true;
3470
+ clearPending();
3471
+ if (status) {
3472
+ void postRenderedStatus(status);
3473
+ return;
3474
+ }
3475
+ currentKey = "initial";
3476
+ void postStatus(getInitialStatusText(), loadingMessages);
3477
+ return;
3478
+ }
3479
+ if (!status) {
3480
+ clearPending();
3481
+ currentKey = "initial";
3482
+ void postStatus(getInitialStatusText(), loadingMessages);
3476
3483
  return;
3477
3484
  }
3478
3485
  const presentation = renderAssistantStatus({
@@ -4168,7 +4175,7 @@ async function resumeSlackTurn(args) {
4168
4175
  runArgs.initialText
4169
4176
  );
4170
4177
  }
4171
- status.start();
4178
+ status.update(runArgs.initialStatus);
4172
4179
  const replyContext = createResumeReplyContext(runArgs, status);
4173
4180
  const replyPromise = runArgs.agentRunner.run(replyContext);
4174
4181
  const replyTimeoutMs = resolveReplyTimeoutMs(runArgs.replyTimeoutMs);
@@ -4186,7 +4193,7 @@ async function resumeSlackTurn(args) {
4186
4193
  )
4187
4194
  ]) : await replyPromise;
4188
4195
  if (outcome.status !== "completed") {
4189
- await status.stop();
4196
+ await status.clear();
4190
4197
  const onAuthPause = runArgs.onAuthPause;
4191
4198
  const onTimeoutPause = runArgs.onTimeoutPause;
4192
4199
  if (outcome.status === "awaiting_auth" && onAuthPause) {
@@ -4225,7 +4232,7 @@ async function resumeSlackTurn(args) {
4225
4232
  logException,
4226
4233
  context: getResumeLogContext(runArgs, lockKey)
4227
4234
  });
4228
- await status.stop();
4235
+ await status.clear();
4229
4236
  const footer = buildSlackReplyFooter({
4230
4237
  conversationId: getResumeConversationId(runArgs, lockKey)
4231
4238
  });
@@ -4281,7 +4288,7 @@ async function resumeSlackTurn(args) {
4281
4288
  }
4282
4289
  }
4283
4290
  } catch (error) {
4284
- await status.stop();
4291
+ await status.clear();
4285
4292
  if (finalReplyDelivered) {
4286
4293
  postDeliveryCommitError = error;
4287
4294
  try {
@@ -9908,7 +9915,7 @@ function createReplyToThread(deps) {
9908
9915
  channelId,
9909
9916
  runId
9910
9917
  },
9911
- onCompactionStart: () => status.start(compactingStatus),
9918
+ onCompactionStart: () => status.update(compactingStatus),
9912
9919
  piMessages
9913
9920
  });
9914
9921
  if (compaction.compacted) {
@@ -9943,7 +9950,7 @@ function createReplyToThread(deps) {
9943
9950
  piMessages = [...piMessages ?? [], ...newlyBatched];
9944
9951
  }
9945
9952
  }
9946
- status.start();
9953
+ status.update();
9947
9954
  const assistantTitleTask = maybeUpdateAssistantTitle({
9948
9955
  assistantThreadContext,
9949
9956
  assistantUserName: botConfig.userName,
@@ -10526,7 +10533,7 @@ function createReplyToThread(deps) {
10526
10533
  );
10527
10534
  }
10528
10535
  }
10529
- await status.stop();
10536
+ await status.clear();
10530
10537
  }
10531
10538
  }
10532
10539
  );
@@ -11150,9 +11157,13 @@ async function continueSlackAgentRun(payload, options) {
11150
11157
  });
11151
11158
  return false;
11152
11159
  }
11160
+ const turnMessages = activeSessionRecord.turnStartMessageIndex === void 0 ? [] : activeSessionRecord.piMessages.slice(
11161
+ activeSessionRecord.turnStartMessageIndex
11162
+ );
11153
11163
  return {
11154
11164
  messageText: userMessage.text,
11155
11165
  messageTs: getTurnUserSlackMessageTs(userMessage),
11166
+ initialStatus: latestReportedProgress(turnMessages),
11156
11167
  replyContext: {
11157
11168
  input: {
11158
11169
  conversationContext,
@@ -0,0 +1,24 @@
1
+ /** One relevant visible-message match from a prior conversation. */
2
+ export interface ConversationSearchResult {
3
+ conversationId: string;
4
+ excerpt: string;
5
+ messageCreatedAtMs: number;
6
+ messageId: string;
7
+ providerDestinationId: string;
8
+ role: "assistant" | "user";
9
+ }
10
+ /** Runtime-derived public workspace scope for cross-conversation search. */
11
+ export interface ConversationSearchScope {
12
+ kind: "public_provider_tenant";
13
+ provider: "slack";
14
+ providerTenantId: string;
15
+ }
16
+ /** Search retained public visible messages within an authorized workspace. */
17
+ export interface ConversationSearchStore {
18
+ search(args: {
19
+ currentConversationId: string;
20
+ limit: number;
21
+ query: string;
22
+ scope: ConversationSearchScope;
23
+ }): Promise<ConversationSearchResult[]>;
24
+ }
@@ -0,0 +1,4 @@
1
+ import type { JuniorSqlDatabase } from "@/db/db";
2
+ import type { ConversationSearchStore } from "../search";
3
+ /** Create a SQL-backed public workspace conversation search store. */
4
+ export declare function createSqlConversationSearchStore(executor: JuniorSqlDatabase): ConversationSearchStore;
package/dist/chat/db.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import type { ConversationStore } from "@/chat/conversations/store";
2
2
  import type { AgentStepStore } from "@/chat/conversations/history";
3
3
  import type { ConversationMessageStore } from "@/chat/conversations/messages";
4
+ import type { ConversationSearchStore } from "@/chat/conversations/search";
4
5
  import type { JuniorDatabase, JuniorSqlExecutor } from "@/db/db";
5
6
  /**
6
7
  * Return the process SQL executor. Exposed for the one-time legacy import
@@ -15,5 +16,7 @@ export declare function getConversationStore(): ConversationStore;
15
16
  export declare function getAgentStepStore(): AgentStepStore;
16
17
  /** Return the SQL-backed visible conversation message store. */
17
18
  export declare function getConversationMessageStore(): ConversationMessageStore;
19
+ /** Return the SQL-backed public provider-tenant conversation search store. */
20
+ export declare function getConversationSearchStore(): ConversationSearchStore;
18
21
  /** Close the process SQL database when it has been opened. */
19
22
  export declare function closeDb(): Promise<void>;
@@ -1,3 +1,6 @@
1
+ import type { PiMessage } from "@/chat/pi/messages";
1
2
  import type { AssistantStatusSpec } from "@/chat/slack/assistant-thread/status-render";
2
3
  /** Convert a `reportProgress` tool payload into assistant status text. */
3
4
  export declare function buildReportedProgressStatus(input: unknown): AssistantStatusSpec | undefined;
5
+ /** Recover the latest explicit progress update from a resumable Pi transcript. */
6
+ export declare function latestReportedProgress(messages: readonly PiMessage[]): AssistantStatusSpec | undefined;
@@ -1,6 +1,7 @@
1
1
  import type { AgentRunRequest } from "@/chat/agent/request";
2
2
  import type { AgentRunResult } from "@/chat/services/turn-result";
3
3
  import type { AgentRunner } from "@/chat/runtime/agent-runner";
4
+ import { type AssistantStatusSpec } from "@/chat/slack/assistant-thread/status";
4
5
  import type { SlackMessageTs } from "@/chat/slack/timestamp";
5
6
  /** Error raised when another worker already owns the resume lock. */
6
7
  export declare class ResumeTurnBusyError extends Error {
@@ -14,6 +15,7 @@ interface ResumeSlackTurnArgs {
14
15
  replyContext?: ResumeReplyContext;
15
16
  lockKey?: string;
16
17
  initialText?: string;
18
+ initialStatus?: AssistantStatusSpec;
17
19
  agentRunner: AgentRunner;
18
20
  scheduleSessionCompletedPluginTasks?: (params: {
19
21
  conversationId: string;
@@ -1,9 +1,10 @@
1
1
  import { type AssistantStatusSpec } from "@/chat/slack/assistant-thread/status-render";
2
2
  export type TimerHandle = ReturnType<typeof setTimeout>;
3
3
  export interface AssistantStatusSession {
4
- start: (status?: AssistantStatusSpec) => void;
5
- stop: () => Promise<void>;
6
- update: (status: AssistantStatusSpec) => void;
4
+ /** Activate or replace the loading state; omit status to show generic loading. */
5
+ update: (status?: AssistantStatusSpec) => void;
6
+ /** Stop refresh scheduling and clear the loading state. */
7
+ clear: () => Promise<void>;
7
8
  }
8
9
  /**
9
10
  * Pace assistant loading-state writes for a single turn.