@sentry/junior 0.86.0 → 0.88.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 (61) hide show
  1. package/dist/{agent-hooks-NWOUB3UR.js → agent-hooks-RIJ5TSWP.js} +8 -8
  2. package/dist/api/people/list.d.ts +4 -0
  3. package/dist/api/people/list.js +83 -0
  4. package/dist/api/people/list.query.d.ts +4 -0
  5. package/dist/api/people/profile.d.ts +4 -0
  6. package/dist/api/people/profile.js +131 -0
  7. package/dist/api/people/profile.query.d.ts +4 -0
  8. package/dist/api/people/shared.d.ts +76 -0
  9. package/dist/api/people/types.d.ts +85 -0
  10. package/dist/app.js +45 -74
  11. package/dist/{catalog-runtime-XOD7YPRS.js → catalog-runtime-MW7XERSU.js} +3 -3
  12. package/dist/chat/conversations/sql/migrations.d.ts +1 -1
  13. package/dist/chat/conversations/sql/schema/identities.d.ts +54 -3
  14. package/dist/chat/conversations/sql/schema/users.d.ts +109 -0
  15. package/dist/chat/conversations/sql/schema.d.ts +164 -3
  16. package/dist/chat/conversations/sql/store.d.ts +0 -1
  17. package/dist/chat/identities/identity.d.ts +18 -0
  18. package/dist/chat/identities/sql.d.ts +4 -0
  19. package/dist/chat/no-reply.d.ts +7 -0
  20. package/dist/chat/runtime/processing-reaction.d.ts +2 -1
  21. package/dist/chat/runtime/slack-resume.d.ts +3 -2
  22. package/dist/chat/runtime/thread-context.d.ts +3 -1
  23. package/dist/chat/runtime/turn-user-message.d.ts +2 -1
  24. package/dist/chat/services/conversation-memory.d.ts +3 -1
  25. package/dist/chat/services/reply-delivery-plan.d.ts +0 -4
  26. package/dist/chat/slack/message.d.ts +2 -1
  27. package/dist/chat/slack/outbound.d.ts +5 -4
  28. package/dist/chat/slack/timestamp.d.ts +6 -0
  29. package/dist/chat/sql/schema.d.ts +163 -3
  30. package/dist/chat/tools/slack/context.d.ts +2 -1
  31. package/dist/{chunk-ENPSU7L7.js → chunk-2DPZRS3B.js} +4 -4
  32. package/dist/{chunk-6I6HBOQM.js → chunk-4IXHIV37.js} +413 -157
  33. package/dist/{chunk-JRXCSSSU.js → chunk-6UPQ5GTJ.js} +3 -3
  34. package/dist/{chunk-64ACM6AP.js → chunk-7ES37H6U.js} +2 -2
  35. package/dist/{chunk-GGD6WK6V.js → chunk-AHLSXMOU.js} +2 -2
  36. package/dist/{chunk-2TAIGJPQ.js → chunk-C5NCV3OB.js} +1 -1
  37. package/dist/{chunk-6O5UI3RG.js → chunk-F22AM3OW.js} +1 -1
  38. package/dist/{chunk-BRSQQRG6.js → chunk-IATAYWFU.js} +2 -2
  39. package/dist/{chunk-BQ3ITJA6.js → chunk-KBFQXJL4.js} +2 -2
  40. package/dist/{chunk-37B2R2QJ.js → chunk-KBSLCOGE.js} +28 -15
  41. package/dist/{chunk-IXTBFABZ.js → chunk-KQKIA4CU.js} +1 -1
  42. package/dist/{chunk-FPHA6GCQ.js → chunk-NYJLQI42.js} +95 -92
  43. package/dist/chunk-PBV4ZIVM.js +261 -0
  44. package/dist/{chunk-ZU2ALUVQ.js → chunk-S35CPNPT.js} +1 -1
  45. package/dist/{chunk-RIB3M6YA.js → chunk-V6XDCS3X.js} +4 -4
  46. package/dist/{chunk-KF7522P3.js → chunk-VMBZFPZM.js} +11 -1
  47. package/dist/{chunk-2NFV5FMB.js → chunk-XS6NLQPA.js} +21 -12
  48. package/dist/{chunk-GB5DFM4D.js → chunk-YPAE5RH3.js} +1 -1
  49. package/dist/cli/chat.js +6 -6
  50. package/dist/cli/check.js +4 -4
  51. package/dist/cli/plugins.js +11 -11
  52. package/dist/cli/snapshot-warmup.js +6 -6
  53. package/dist/cli/upgrade.js +12 -12
  54. package/dist/{db-SZVUU7RB.js → db-37HOGLI7.js} +5 -5
  55. package/dist/nitro.js +4 -4
  56. package/dist/reporting/conversations.d.ts +0 -56
  57. package/dist/reporting.d.ts +2 -8
  58. package/dist/reporting.js +14 -290
  59. package/dist/{runner-HEBRPNN2.js → runner-BCRF2FCI.js} +13 -13
  60. package/dist/{validation-MBNJKWPQ.js → validation-FMJO3L5P.js} +4 -4
  61. package/package.json +14 -6
@@ -2,7 +2,8 @@ import { juniorConversations } from "./schema/conversations";
2
2
  import { juniorDestinations } from "./schema/destinations";
3
3
  import { juniorIdentities } from "./schema/identities";
4
4
  import { juniorSchemaMigrations } from "./schema/migrations";
5
- export { juniorConversations, juniorDestinations, juniorIdentities, juniorSchemaMigrations, };
5
+ import { juniorUsers } from "./schema/users";
6
+ export { juniorConversations, juniorDestinations, juniorIdentities, juniorSchemaMigrations, juniorUsers, };
6
7
  export declare const schema: {
7
8
  juniorConversations: import("drizzle-orm/pg-core").PgTableWithColumns<{
8
9
  name: "junior_conversations";
@@ -662,7 +663,7 @@ export declare const schema: {
662
663
  tableName: "junior_identities";
663
664
  dataType: "string";
664
665
  columnType: "PgText";
665
- data: import("./schema/identities").JuniorIdentityKind;
666
+ data: import("../../identities/identity").IdentityKind;
666
667
  driverParam: string;
667
668
  notNull: true;
668
669
  hasDefault: false;
@@ -674,7 +675,7 @@ export declare const schema: {
674
675
  identity: undefined;
675
676
  generated: undefined;
676
677
  }, {}, {
677
- $type: import("./schema/identities").JuniorIdentityKind;
678
+ $type: import("../../identities/identity").IdentityKind;
678
679
  }>;
679
680
  provider: import("drizzle-orm/pg-core").PgColumn<{
680
681
  name: "provider";
@@ -846,6 +847,57 @@ export declare const schema: {
846
847
  identity: undefined;
847
848
  generated: undefined;
848
849
  }, {}, {}>;
850
+ userId: import("drizzle-orm/pg-core").PgColumn<{
851
+ name: "user_id";
852
+ tableName: "junior_identities";
853
+ dataType: "string";
854
+ columnType: "PgText";
855
+ data: string;
856
+ driverParam: string;
857
+ notNull: false;
858
+ hasDefault: false;
859
+ isPrimaryKey: false;
860
+ isAutoincrement: false;
861
+ hasRuntimeDefault: false;
862
+ enumValues: [string, ...string[]];
863
+ baseColumn: never;
864
+ identity: undefined;
865
+ generated: undefined;
866
+ }, {}, {}>;
867
+ emailNormalized: import("drizzle-orm/pg-core").PgColumn<{
868
+ name: "email_normalized";
869
+ tableName: "junior_identities";
870
+ dataType: "string";
871
+ columnType: "PgText";
872
+ data: string;
873
+ driverParam: string;
874
+ notNull: false;
875
+ hasDefault: false;
876
+ isPrimaryKey: false;
877
+ isAutoincrement: false;
878
+ hasRuntimeDefault: false;
879
+ enumValues: [string, ...string[]];
880
+ baseColumn: never;
881
+ identity: undefined;
882
+ generated: undefined;
883
+ }, {}, {}>;
884
+ emailVerified: import("drizzle-orm/pg-core").PgColumn<{
885
+ name: "email_verified";
886
+ tableName: "junior_identities";
887
+ dataType: "boolean";
888
+ columnType: "PgBoolean";
889
+ data: boolean;
890
+ driverParam: boolean;
891
+ notNull: true;
892
+ hasDefault: true;
893
+ isPrimaryKey: false;
894
+ isAutoincrement: false;
895
+ hasRuntimeDefault: false;
896
+ enumValues: undefined;
897
+ baseColumn: never;
898
+ identity: undefined;
899
+ generated: undefined;
900
+ }, {}, {}>;
849
901
  };
850
902
  dialect: "pg";
851
903
  }>;
@@ -907,4 +959,113 @@ export declare const schema: {
907
959
  };
908
960
  dialect: "pg";
909
961
  }>;
962
+ juniorUsers: import("drizzle-orm/pg-core").PgTableWithColumns<{
963
+ name: "junior_users";
964
+ schema: undefined;
965
+ columns: {
966
+ id: import("drizzle-orm/pg-core").PgColumn<{
967
+ name: "id";
968
+ tableName: "junior_users";
969
+ dataType: "string";
970
+ columnType: "PgText";
971
+ data: string;
972
+ driverParam: string;
973
+ notNull: true;
974
+ hasDefault: false;
975
+ isPrimaryKey: true;
976
+ isAutoincrement: false;
977
+ hasRuntimeDefault: false;
978
+ enumValues: [string, ...string[]];
979
+ baseColumn: never;
980
+ identity: undefined;
981
+ generated: undefined;
982
+ }, {}, {}>;
983
+ primaryEmail: import("drizzle-orm/pg-core").PgColumn<{
984
+ name: "primary_email";
985
+ tableName: "junior_users";
986
+ dataType: "string";
987
+ columnType: "PgText";
988
+ data: string;
989
+ driverParam: string;
990
+ notNull: true;
991
+ hasDefault: false;
992
+ isPrimaryKey: false;
993
+ isAutoincrement: false;
994
+ hasRuntimeDefault: false;
995
+ enumValues: [string, ...string[]];
996
+ baseColumn: never;
997
+ identity: undefined;
998
+ generated: undefined;
999
+ }, {}, {}>;
1000
+ primaryEmailNormalized: import("drizzle-orm/pg-core").PgColumn<{
1001
+ name: "primary_email_normalized";
1002
+ tableName: "junior_users";
1003
+ dataType: "string";
1004
+ columnType: "PgText";
1005
+ data: string;
1006
+ driverParam: string;
1007
+ notNull: true;
1008
+ hasDefault: false;
1009
+ isPrimaryKey: false;
1010
+ isAutoincrement: false;
1011
+ hasRuntimeDefault: false;
1012
+ enumValues: [string, ...string[]];
1013
+ baseColumn: never;
1014
+ identity: undefined;
1015
+ generated: undefined;
1016
+ }, {}, {}>;
1017
+ displayName: import("drizzle-orm/pg-core").PgColumn<{
1018
+ name: "display_name";
1019
+ tableName: "junior_users";
1020
+ dataType: "string";
1021
+ columnType: "PgText";
1022
+ data: string;
1023
+ driverParam: string;
1024
+ notNull: false;
1025
+ hasDefault: false;
1026
+ isPrimaryKey: false;
1027
+ isAutoincrement: false;
1028
+ hasRuntimeDefault: false;
1029
+ enumValues: [string, ...string[]];
1030
+ baseColumn: never;
1031
+ identity: undefined;
1032
+ generated: undefined;
1033
+ }, {}, {}>;
1034
+ createdAt: import("drizzle-orm/pg-core").PgColumn<{
1035
+ name: string;
1036
+ tableName: "junior_users";
1037
+ dataType: "date";
1038
+ columnType: "PgTimestamp";
1039
+ data: Date;
1040
+ driverParam: string;
1041
+ notNull: true;
1042
+ hasDefault: false;
1043
+ isPrimaryKey: false;
1044
+ isAutoincrement: false;
1045
+ hasRuntimeDefault: false;
1046
+ enumValues: undefined;
1047
+ baseColumn: never;
1048
+ identity: undefined;
1049
+ generated: undefined;
1050
+ }, {}, {}>;
1051
+ updatedAt: import("drizzle-orm/pg-core").PgColumn<{
1052
+ name: string;
1053
+ tableName: "junior_users";
1054
+ dataType: "date";
1055
+ columnType: "PgTimestamp";
1056
+ data: Date;
1057
+ driverParam: string;
1058
+ notNull: true;
1059
+ hasDefault: false;
1060
+ isPrimaryKey: false;
1061
+ isAutoincrement: false;
1062
+ hasRuntimeDefault: false;
1063
+ enumValues: undefined;
1064
+ baseColumn: never;
1065
+ identity: undefined;
1066
+ generated: undefined;
1067
+ }, {}, {}>;
1068
+ };
1069
+ dialect: "pg";
1070
+ }>;
910
1071
  };
@@ -53,7 +53,6 @@ export declare class SqlStore implements ConversationStore {
53
53
  private readConversationRow;
54
54
  /** Upsert the conversation row while preserving previously discovered nullable metadata fields. */
55
55
  private upsertConversation;
56
- private upsertIdentity;
57
56
  private upsertDestination;
58
57
  }
59
58
  /** Create a SQL-backed conversation store. */
@@ -0,0 +1,18 @@
1
+ export type IdentityKind = "service" | "system" | "user";
2
+ export interface IdentityUpsert {
3
+ displayName?: string;
4
+ email?: string;
5
+ emailVerified?: boolean;
6
+ handle?: string;
7
+ kind: IdentityKind;
8
+ metadata?: Record<string, unknown>;
9
+ provider: string;
10
+ providerSubjectId: string;
11
+ providerTenantId?: string;
12
+ }
13
+ export interface StoredIdentity {
14
+ id: string;
15
+ userId?: string;
16
+ }
17
+ /** Canonicalize email addresses for identity lookup and linking. */
18
+ export declare function normalizeIdentityEmail(email: string | undefined): string | undefined;
@@ -0,0 +1,4 @@
1
+ import type { JuniorSqlDatabase } from "@/chat/sql/db";
2
+ import { type IdentityUpsert, type StoredIdentity } from "./identity";
3
+ /** Persist one provider identity observation and link verified emails to users. */
4
+ export declare function upsertIdentity(executor: JuniorSqlDatabase, identity: IdentityUpsert, nowMs?: number): Promise<StoredIdentity>;
@@ -0,0 +1,7 @@
1
+ export declare const NO_REPLY_MARKER = "[[NO_REPLY]]";
2
+ /** Detect the reserved marker so Slack side effects can intentionally complete without thread text. */
3
+ export declare function isNoReplyMarker(text: string): boolean;
4
+ /** Detect marker leaks before publication strips or rejects them. */
5
+ export declare function containsNoReplyMarker(text: string): boolean;
6
+ /** Remove the reserved marker from mixed assistant text so it is never shown to users. */
7
+ export declare function stripNoReplyMarker(text: string): string;
@@ -1,5 +1,6 @@
1
1
  import type { Message, Thread } from "chat";
2
2
  import type { TurnToolInvocation } from "@/chat/runtime/turn-input";
3
+ import type { SlackMessageTs } from "@/chat/slack/timestamp";
3
4
  /** Controls the automatic Slack processing reaction lifecycle for one message. */
4
5
  export interface ProcessingReactionSession {
5
6
  complete: () => Promise<void>;
@@ -18,7 +19,7 @@ export declare function startSlackProcessingReaction(args: {
18
19
  /** Start Junior's automatic Slack processing reaction for a known Slack message. */
19
20
  export declare function startSlackProcessingReactionForMessage(args: {
20
21
  channelId: string;
21
- timestamp: string;
22
+ timestamp: SlackMessageTs;
22
23
  logException: (error: unknown, eventName: string, context?: Record<string, unknown>, attributes?: Record<string, unknown>, body?: string) => string | undefined;
23
24
  logContext: Record<string, unknown>;
24
25
  }): Promise<ProcessingReactionSession>;
@@ -1,5 +1,6 @@
1
1
  import { generateAssistantReply, type AssistantReply, type AssistantReplyRequestContext } from "@/chat/respond";
2
2
  import type { Source } from "@sentry/junior-plugin-api";
3
+ import type { SlackMessageTs } from "@/chat/slack/timestamp";
3
4
  /** Error raised when another worker already owns the resume lock. */
4
5
  export declare class ResumeTurnBusyError extends Error {
5
6
  constructor(lockKey: string);
@@ -8,7 +9,7 @@ interface ResumeSlackTurnArgs {
8
9
  messageText: string;
9
10
  channelId: string;
10
11
  threadTs: string;
11
- messageTs?: string;
12
+ messageTs?: SlackMessageTs;
12
13
  replyContext?: ResumeReplyContext;
13
14
  lockKey?: string;
14
15
  initialText?: string;
@@ -41,7 +42,7 @@ export declare function resumeAuthorizedRequest(args: {
41
42
  messageText: string;
42
43
  channelId: string;
43
44
  threadTs: string;
44
- messageTs?: string;
45
+ messageTs?: SlackMessageTs;
45
46
  connectedText: string;
46
47
  replyContext?: ResumeReplyContext;
47
48
  lockKey?: string;
@@ -1,4 +1,5 @@
1
1
  import type { Message, Thread } from "chat";
2
+ import { type SlackMessageTs } from "@/chat/slack/timestamp";
2
3
  interface StripLeadingBotMentionOptions {
3
4
  botUserId?: string;
4
5
  stripLeadingSlackMentionToken?: boolean;
@@ -21,7 +22,8 @@ export declare function getAssistantThreadContext(message: Message): {
21
22
  channelId: string;
22
23
  threadTs: string;
23
24
  } | undefined;
24
- export declare function getMessageTs(message: Message): string | undefined;
25
+ /** Resolve the native Slack timestamp for a message that can target Slack APIs. */
26
+ export declare function getMessageTs(message: Message): SlackMessageTs | undefined;
25
27
  /** Resolve the Slack workspace/team id from the raw inbound message payload. */
26
28
  export declare function getTeamId(message: Message): string | undefined;
27
29
  export {};
@@ -1,10 +1,11 @@
1
1
  import type { ConversationMessage, ThreadConversationState } from "@/chat/state/conversation";
2
+ import { type SlackMessageTs } from "@/chat/slack/timestamp";
2
3
  /** Return the user message for a persisted turn/session, if one exists. */
3
4
  export declare function getTurnUserMessage(conversation: ThreadConversationState, sessionId: string): ConversationMessage | undefined;
4
5
  /** Return the persisted user-message id for a turn/session, if one exists. */
5
6
  export declare function getTurnUserMessageId(conversation: ThreadConversationState, sessionId: string): string | undefined;
6
7
  /** Return the Slack timestamp for the user message that a resumed turn acts on. */
7
- export declare function getTurnUserSlackMessageTs(message: ConversationMessage | undefined): string | undefined;
8
+ export declare function getTurnUserSlackMessageTs(message: ConversationMessage | undefined): SlackMessageTs | undefined;
8
9
  /** Rebuild attachment context for a resumed turn from the persisted user message. */
9
10
  export declare function getTurnUserReplyAttachmentContext(message: ConversationMessage | undefined): {
10
11
  inboundAttachmentCount?: number;
@@ -1,5 +1,6 @@
1
1
  import type { completeText } from "@/chat/pi/client";
2
2
  import type { ConversationMessage, ThreadConversationState } from "@/chat/state/conversation";
3
+ import { type SlackMessageTs } from "@/chat/slack/timestamp";
3
4
  export interface ConversationMemoryDeps {
4
5
  completeText: typeof completeText;
5
6
  }
@@ -30,4 +31,5 @@ export declare function getThreadTitleSourceMessage(conversation: ThreadConversa
30
31
  /** Build the service that owns durable conversation memory compaction and titles. */
31
32
  export declare function createConversationMemoryService(deps: ConversationMemoryDeps): ConversationMemoryService;
32
33
  export declare function isHumanConversationMessage(message: ConversationMessage): boolean;
33
- export declare function getConversationMessageSlackTs(message: ConversationMessage): string | undefined;
34
+ /** Return the native Slack timestamp for a persisted conversation message. */
35
+ export declare function getConversationMessageSlackTs(message: ConversationMessage): SlackMessageTs | undefined;
@@ -5,10 +5,6 @@ export interface ReplyDeliveryPlan {
5
5
  postThreadText: boolean;
6
6
  attachFiles: ReplyFileDelivery;
7
7
  }
8
- /** Check if text is a short acknowledgment (emoji, "ok", etc.) that a reaction already covers. */
9
- export declare function isRedundantReactionAckText(text: string): boolean;
10
- /** Check if the user asked for a reaction without also asking for text. */
11
- export declare function isReactionOnlyIntent(text: string): boolean;
12
8
  /** Determine how a reply should be delivered (thread vs channel, file handling). */
13
9
  export declare function buildReplyDeliveryPlan(args: {
14
10
  explicitChannelPostIntent: boolean;
@@ -1,6 +1,7 @@
1
1
  import type { Message } from "chat";
2
+ import { type SlackMessageTs } from "@/chat/slack/timestamp";
2
3
  /**
3
4
  * Preserve the native Slack message timestamp when a synthetic message ID is
4
5
  * used for routing or deduplication.
5
6
  */
6
- export declare function getSlackMessageTs(message: Pick<Message, "id" | "raw">): string;
7
+ export declare function getSlackMessageTs(message: Pick<Message, "id" | "raw">): SlackMessageTs | undefined;
@@ -1,4 +1,5 @@
1
1
  import type { SlackMessageBlock } from "@/chat/slack/footer";
2
+ import { type SlackMessageTs } from "@/chat/slack/timestamp";
2
3
  /** Post Slack `mrkdwn` text to a conversation or thread via the shared outbound boundary. */
3
4
  export declare function postSlackMessage(input: {
4
5
  blocks?: SlackMessageBlock[];
@@ -7,13 +8,13 @@ export declare function postSlackMessage(input: {
7
8
  threadTs?: string;
8
9
  includePermalink?: boolean;
9
10
  }): Promise<{
10
- ts: string;
11
+ ts: SlackMessageTs;
11
12
  permalink?: string;
12
13
  }>;
13
14
  /** Delete a previously posted Slack message through the shared outbound boundary. */
14
15
  export declare function deleteSlackMessage(input: {
15
16
  channelId: string;
16
- timestamp: string;
17
+ timestamp: SlackMessageTs;
17
18
  }): Promise<void>;
18
19
  /**
19
20
  * Post an ephemeral Slack message. Delivery is best-effort on Slack's side, but
@@ -39,7 +40,7 @@ export declare function uploadFilesToThread(input: {
39
40
  /** Add a reaction to a Slack message, treating `already_reacted` as idempotent success. */
40
41
  export declare function addReactionToMessage(input: {
41
42
  channelId: string;
42
- timestamp: string;
43
+ timestamp: SlackMessageTs;
43
44
  emoji: string;
44
45
  }): Promise<{
45
46
  ok: true;
@@ -47,7 +48,7 @@ export declare function addReactionToMessage(input: {
47
48
  /** Remove a reaction from a Slack message, treating `no_reaction` as idempotent success. */
48
49
  export declare function removeReactionFromMessage(input: {
49
50
  channelId: string;
50
- timestamp: string;
51
+ timestamp: SlackMessageTs;
51
52
  emoji: string;
52
53
  }): Promise<{
53
54
  ok: true;
@@ -0,0 +1,6 @@
1
+ import { z } from "zod";
2
+ /** Native Slack message timestamp, safe to pass as Slack Web API `message_ts`. */
3
+ export declare const slackMessageTsSchema: z.core.$ZodBranded<z.ZodString, "SlackMessageTs", "out">;
4
+ export type SlackMessageTs = z.output<typeof slackMessageTsSchema>;
5
+ /** Parse a native Slack message timestamp from untrusted message metadata. */
6
+ export declare function parseSlackMessageTs(value: unknown): SlackMessageTs | undefined;
@@ -1,4 +1,4 @@
1
- export { juniorConversations, juniorDestinations, juniorIdentities, juniorSchemaMigrations, } from "@/chat/conversations/sql/schema";
1
+ export { juniorConversations, juniorDestinations, juniorIdentities, juniorSchemaMigrations, juniorUsers, } from "@/chat/conversations/sql/schema";
2
2
  export declare const juniorSqlSchema: {
3
3
  juniorConversations: import("drizzle-orm/pg-core").PgTableWithColumns<{
4
4
  name: "junior_conversations";
@@ -658,7 +658,7 @@ export declare const juniorSqlSchema: {
658
658
  tableName: "junior_identities";
659
659
  dataType: "string";
660
660
  columnType: "PgText";
661
- data: import("../conversations/sql/schema/identities").JuniorIdentityKind;
661
+ data: import("../identities/identity").IdentityKind;
662
662
  driverParam: string;
663
663
  notNull: true;
664
664
  hasDefault: false;
@@ -670,7 +670,7 @@ export declare const juniorSqlSchema: {
670
670
  identity: undefined;
671
671
  generated: undefined;
672
672
  }, {}, {
673
- $type: import("../conversations/sql/schema/identities").JuniorIdentityKind;
673
+ $type: import("../identities/identity").IdentityKind;
674
674
  }>;
675
675
  provider: import("drizzle-orm/pg-core").PgColumn<{
676
676
  name: "provider";
@@ -842,6 +842,57 @@ export declare const juniorSqlSchema: {
842
842
  identity: undefined;
843
843
  generated: undefined;
844
844
  }, {}, {}>;
845
+ userId: import("drizzle-orm/pg-core").PgColumn<{
846
+ name: "user_id";
847
+ tableName: "junior_identities";
848
+ dataType: "string";
849
+ columnType: "PgText";
850
+ data: string;
851
+ driverParam: string;
852
+ notNull: false;
853
+ hasDefault: false;
854
+ isPrimaryKey: false;
855
+ isAutoincrement: false;
856
+ hasRuntimeDefault: false;
857
+ enumValues: [string, ...string[]];
858
+ baseColumn: never;
859
+ identity: undefined;
860
+ generated: undefined;
861
+ }, {}, {}>;
862
+ emailNormalized: import("drizzle-orm/pg-core").PgColumn<{
863
+ name: "email_normalized";
864
+ tableName: "junior_identities";
865
+ dataType: "string";
866
+ columnType: "PgText";
867
+ data: string;
868
+ driverParam: string;
869
+ notNull: false;
870
+ hasDefault: false;
871
+ isPrimaryKey: false;
872
+ isAutoincrement: false;
873
+ hasRuntimeDefault: false;
874
+ enumValues: [string, ...string[]];
875
+ baseColumn: never;
876
+ identity: undefined;
877
+ generated: undefined;
878
+ }, {}, {}>;
879
+ emailVerified: import("drizzle-orm/pg-core").PgColumn<{
880
+ name: "email_verified";
881
+ tableName: "junior_identities";
882
+ dataType: "boolean";
883
+ columnType: "PgBoolean";
884
+ data: boolean;
885
+ driverParam: boolean;
886
+ notNull: true;
887
+ hasDefault: true;
888
+ isPrimaryKey: false;
889
+ isAutoincrement: false;
890
+ hasRuntimeDefault: false;
891
+ enumValues: undefined;
892
+ baseColumn: never;
893
+ identity: undefined;
894
+ generated: undefined;
895
+ }, {}, {}>;
845
896
  };
846
897
  dialect: "pg";
847
898
  }>;
@@ -903,4 +954,113 @@ export declare const juniorSqlSchema: {
903
954
  };
904
955
  dialect: "pg";
905
956
  }>;
957
+ juniorUsers: import("drizzle-orm/pg-core").PgTableWithColumns<{
958
+ name: "junior_users";
959
+ schema: undefined;
960
+ columns: {
961
+ id: import("drizzle-orm/pg-core").PgColumn<{
962
+ name: "id";
963
+ tableName: "junior_users";
964
+ dataType: "string";
965
+ columnType: "PgText";
966
+ data: string;
967
+ driverParam: string;
968
+ notNull: true;
969
+ hasDefault: false;
970
+ isPrimaryKey: true;
971
+ isAutoincrement: false;
972
+ hasRuntimeDefault: false;
973
+ enumValues: [string, ...string[]];
974
+ baseColumn: never;
975
+ identity: undefined;
976
+ generated: undefined;
977
+ }, {}, {}>;
978
+ primaryEmail: import("drizzle-orm/pg-core").PgColumn<{
979
+ name: "primary_email";
980
+ tableName: "junior_users";
981
+ dataType: "string";
982
+ columnType: "PgText";
983
+ data: string;
984
+ driverParam: string;
985
+ notNull: true;
986
+ hasDefault: false;
987
+ isPrimaryKey: false;
988
+ isAutoincrement: false;
989
+ hasRuntimeDefault: false;
990
+ enumValues: [string, ...string[]];
991
+ baseColumn: never;
992
+ identity: undefined;
993
+ generated: undefined;
994
+ }, {}, {}>;
995
+ primaryEmailNormalized: import("drizzle-orm/pg-core").PgColumn<{
996
+ name: "primary_email_normalized";
997
+ tableName: "junior_users";
998
+ dataType: "string";
999
+ columnType: "PgText";
1000
+ data: string;
1001
+ driverParam: string;
1002
+ notNull: true;
1003
+ hasDefault: false;
1004
+ isPrimaryKey: false;
1005
+ isAutoincrement: false;
1006
+ hasRuntimeDefault: false;
1007
+ enumValues: [string, ...string[]];
1008
+ baseColumn: never;
1009
+ identity: undefined;
1010
+ generated: undefined;
1011
+ }, {}, {}>;
1012
+ displayName: import("drizzle-orm/pg-core").PgColumn<{
1013
+ name: "display_name";
1014
+ tableName: "junior_users";
1015
+ dataType: "string";
1016
+ columnType: "PgText";
1017
+ data: string;
1018
+ driverParam: string;
1019
+ notNull: false;
1020
+ hasDefault: false;
1021
+ isPrimaryKey: false;
1022
+ isAutoincrement: false;
1023
+ hasRuntimeDefault: false;
1024
+ enumValues: [string, ...string[]];
1025
+ baseColumn: never;
1026
+ identity: undefined;
1027
+ generated: undefined;
1028
+ }, {}, {}>;
1029
+ createdAt: import("drizzle-orm/pg-core").PgColumn<{
1030
+ name: string;
1031
+ tableName: "junior_users";
1032
+ dataType: "date";
1033
+ columnType: "PgTimestamp";
1034
+ data: Date;
1035
+ driverParam: string;
1036
+ notNull: true;
1037
+ hasDefault: false;
1038
+ isPrimaryKey: false;
1039
+ isAutoincrement: false;
1040
+ hasRuntimeDefault: false;
1041
+ enumValues: undefined;
1042
+ baseColumn: never;
1043
+ identity: undefined;
1044
+ generated: undefined;
1045
+ }, {}, {}>;
1046
+ updatedAt: import("drizzle-orm/pg-core").PgColumn<{
1047
+ name: string;
1048
+ tableName: "junior_users";
1049
+ dataType: "date";
1050
+ columnType: "PgTimestamp";
1051
+ data: Date;
1052
+ driverParam: string;
1053
+ notNull: true;
1054
+ hasDefault: false;
1055
+ isPrimaryKey: false;
1056
+ isAutoincrement: false;
1057
+ hasRuntimeDefault: false;
1058
+ enumValues: undefined;
1059
+ baseColumn: never;
1060
+ identity: undefined;
1061
+ generated: undefined;
1062
+ }, {}, {}>;
1063
+ };
1064
+ dialect: "pg";
1065
+ }>;
906
1066
  };
@@ -2,12 +2,13 @@ import type { ToolRuntimeContext } from "@/chat/tools/types";
2
2
  import type { SlackDestination } from "@sentry/junior-plugin-api";
3
3
  import type { SlackSource } from "@sentry/junior-plugin-api";
4
4
  import type { SlackRequester } from "@/chat/requester";
5
+ import { type SlackMessageTs } from "@/chat/slack/timestamp";
5
6
  export interface SlackToolContext {
6
7
  destination: SlackDestination;
7
8
  source: SlackSource;
8
9
  requester?: SlackRequester;
9
10
  destinationChannelId: string;
10
- messageTs?: string;
11
+ messageTs?: SlackMessageTs;
11
12
  sourceChannelId: string;
12
13
  teamId: string;
13
14
  threadTs?: string;
@@ -4,17 +4,17 @@ import {
4
4
  import {
5
5
  getDefaultRedisStateAdapterFor,
6
6
  getStateAdapter
7
- } from "./chunk-GB5DFM4D.js";
7
+ } from "./chunk-YPAE5RH3.js";
8
8
  import {
9
9
  parseDestination,
10
10
  sameDestination
11
- } from "./chunk-GGD6WK6V.js";
11
+ } from "./chunk-AHLSXMOU.js";
12
12
  import {
13
13
  getChatConfig
14
- } from "./chunk-ZU2ALUVQ.js";
14
+ } from "./chunk-S35CPNPT.js";
15
15
  import {
16
16
  parseStoredSlackRequester
17
- } from "./chunk-IXTBFABZ.js";
17
+ } from "./chunk-KQKIA4CU.js";
18
18
  import {
19
19
  isRecord,
20
20
  toOptionalNumber,