@sentry/junior-plugin-api 0.310.0 → 0.312.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.
package/dist/index.d.ts CHANGED
@@ -1,7 +1,13 @@
1
- import { $ as eventSourceSchema, A as Source, B as createWebSource, C as PluginReranker, D as SlackInvocationContext, E as SlackDestination, F as WebInvocationContext, G as PluginCache, H as isPrivateSource, I as WebSource, J as agentInvocationSourceSchema, K as actorSchema, L as createEventSource, M as SystemActor, N as User, O as SlackLocation, P as WebActor, Q as eventAutomationSourceSchema, R as createLocalSource, S as PluginModel, St as webSourceSchema, T as SlackActor, U as isSlackDestination, V as getSourceKey, W as CacheEntry, X as destinationVisibilitySchema, Y as destinationSchema, Z as dispatchOptionsSchema, _ as PluginDispatchSource, _t as sourceVisibilitySchema, a as EventInvocationContext, at as locationSchema, b as PluginLogger, bt as userSchema, c as InvocationContext, ct as pluginCredentialSubjectSchema, d as LocalInvocationContext, dt as scheduledAutomationSourceSchema, et as identityDispatchOptionsSchema, f as LocalSource, ft as slackActorSchema, g as PluginDecider, gt as sourceSchema, h as PluginContext, ht as slackSourceSchema, i as EventAutomationSource, it as localSourceSchema, j as SourceVisibility, k as SlackSource, l as LocalActor, lt as pluginDispatchSourceSchema, m as Platform, mt as slackLocationSchema, n as AgentInvocationSource, nt as localActorSchema, o as EventSource, ot as nonBlankStringSchema, p as Location, pt as slackDestinationSchema, q as actorUserIdSchema, r as Destination, rt as localDestinationSchema, s as Identity, st as platformSchema, t as Actor, tt as identitySchema, u as LocalDestination, ut as replyAttributionSchema, v as PluginEmbedder, vt as systemActorSchema, w as ScheduledAutomationSource, x as PluginMetadata, xt as webActorSchema, y as PluginEmbeddingInputType, yt as taskOutcomeSchema, z as createSlackSource } from "./context-Buwf8ZyW.js";
2
1
  import * as z from "zod";
3
2
  import { ZodTypeAny } from "zod";
4
3
  import { Command } from "commander";
4
+ /** A code change's size as its provider counts it. Unknown parts stay unset. */
5
+ export declare const codeChangeSizeSchema: z.ZodObject<{
6
+ changedFiles: z.ZodOptional<z.ZodNumber>;
7
+ additions: z.ZodOptional<z.ZodNumber>;
8
+ deletions: z.ZodOptional<z.ZodNumber>;
9
+ }, z.core.$strict>;
10
+ export type CodeChangeSize = z.output<typeof codeChangeSizeSchema>;
5
11
  /** The longest object summary, in UTF-16 code units. */
6
12
  export declare const OBJECT_SUMMARY_MAX_LENGTH = 280;
7
13
  /** Small, provider-neutral facts. Missing values mean unknown, not success. */
@@ -735,6 +741,526 @@ export declare const objectIconPaths: {
735
741
  package: string[];
736
742
  apps: string[];
737
743
  };
744
+ /** Exact non-blank actor user id that rejects the sentinel "unknown". */
745
+ export declare const actorUserIdSchema: z.ZodString;
746
+ export declare const nonBlankStringSchema: z.ZodString;
747
+ /** Complete Slack Location associated with a Conversation. */
748
+ export declare const slackLocationSchema: z.ZodObject<{
749
+ id: z.ZodString;
750
+ provider: z.ZodLiteral<"slack">;
751
+ teamId: z.ZodString;
752
+ channelId: z.ZodString;
753
+ threadTs: z.ZodOptional<z.ZodString>;
754
+ }, z.core.$strict>;
755
+ /** Complete Location types supported by Junior. */
756
+ export declare const locationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
757
+ id: z.ZodString;
758
+ provider: z.ZodLiteral<"slack">;
759
+ teamId: z.ZodString;
760
+ channelId: z.ZodString;
761
+ threadTs: z.ZodOptional<z.ZodString>;
762
+ }, z.core.$strict>], "provider">;
763
+ /** Runtime platform names supported by plugin public contracts. */
764
+ export declare const platformSchema: z.ZodEnum<{
765
+ local: "local";
766
+ slack: "slack";
767
+ }>;
768
+ /** Runtime source visibility visible to plugins. */
769
+ export declare const sourceVisibilitySchema: z.ZodEnum<{
770
+ private: "private";
771
+ public: "public";
772
+ }>;
773
+ /** Provider-neutral visibility of a routed destination. */
774
+ export declare const destinationVisibilitySchema: z.ZodEnum<{
775
+ private: "private";
776
+ public: "public";
777
+ }>;
778
+ /** Runtime-owned Slack address for routing future work or side effects. */
779
+ export declare const slackDestinationSchema: z.ZodObject<{
780
+ platform: z.ZodLiteral<"slack">;
781
+ teamId: z.ZodString;
782
+ channelId: z.ZodString;
783
+ threadTs: z.ZodOptional<z.ZodString>;
784
+ }, z.core.$strict>;
785
+ /** Runtime-owned local CLI conversation address. */
786
+ export declare const localDestinationSchema: z.ZodObject<{
787
+ platform: z.ZodLiteral<"local">;
788
+ conversationId: z.ZodString;
789
+ }, z.core.$strict>;
790
+ /** Runtime-owned provider-neutral address for routing future work or side effects. */
791
+ export declare const destinationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
792
+ platform: z.ZodLiteral<"slack">;
793
+ teamId: z.ZodString;
794
+ channelId: z.ZodString;
795
+ threadTs: z.ZodOptional<z.ZodString>;
796
+ }, z.core.$strict>, z.ZodObject<{
797
+ platform: z.ZodLiteral<"local">;
798
+ conversationId: z.ZodString;
799
+ }, z.core.$strict>], "platform">;
800
+ /** One visible effect after successful automated work. */
801
+ export declare const taskOutcomeSchema: z.ZodObject<{
802
+ action: z.ZodLiteral<"send_message">;
803
+ destination: z.ZodObject<{
804
+ platform: z.ZodLiteral<"slack">;
805
+ teamId: z.ZodString;
806
+ channelId: z.ZodString;
807
+ threadTs: z.ZodOptional<z.ZodString>;
808
+ }, z.core.$strict>;
809
+ }, z.core.$strict>;
810
+ /** Runtime-owned Slack input Source. */
811
+ export declare const slackSourceSchema: z.ZodObject<{
812
+ kind: z.ZodLiteral<"slack">;
813
+ teamId: z.ZodString;
814
+ channelId: z.ZodString;
815
+ visibility: z.ZodEnum<{
816
+ private: "private";
817
+ public: "public";
818
+ }>;
819
+ messageTs: z.ZodOptional<z.ZodString>;
820
+ threadTs: z.ZodOptional<z.ZodString>;
821
+ }, z.core.$strict>;
822
+ /** Runtime-owned local CLI input Source. */
823
+ export declare const localSourceSchema: z.ZodObject<{
824
+ kind: z.ZodLiteral<"local">;
825
+ visibility: z.ZodLiteral<"private">;
826
+ conversationId: z.ZodString;
827
+ }, z.core.$strict>;
828
+ /** Runtime-owned dashboard input Source. */
829
+ export declare const webSourceSchema: z.ZodObject<{
830
+ kind: z.ZodLiteral<"web">;
831
+ visibility: z.ZodEnum<{
832
+ private: "private";
833
+ public: "public";
834
+ }>;
835
+ conversationId: z.ZodString;
836
+ }, z.core.$strict>;
837
+ /** Runtime-owned Event input Source. */
838
+ export declare const eventSourceSchema: z.ZodObject<{
839
+ kind: z.ZodLiteral<"event">;
840
+ eventKey: z.ZodString;
841
+ eventType: z.ZodString;
842
+ identifier: z.ZodString;
843
+ namespace: z.ZodString;
844
+ }, z.core.$strict>;
845
+ /** Runtime-owned Scheduled automation input Source. */
846
+ export declare const scheduledAutomationSourceSchema: z.ZodObject<{
847
+ automationId: z.ZodOptional<z.ZodString>;
848
+ automationRunId: z.ZodOptional<z.ZodString>;
849
+ kind: z.ZodLiteral<"scheduled_automation">;
850
+ }, z.core.$strict>;
851
+ /** Runtime-owned Event automation input Source. */
852
+ export declare const eventAutomationSourceSchema: z.ZodObject<{
853
+ automationId: z.ZodOptional<z.ZodString>;
854
+ automationRunId: z.ZodOptional<z.ZodString>;
855
+ kind: z.ZodLiteral<"event_automation">;
856
+ }, z.core.$strict>;
857
+ /** Runtime-owned Plugin dispatch input Source. */
858
+ export declare const pluginDispatchSourceSchema: z.ZodObject<{
859
+ kind: z.ZodLiteral<"plugin_dispatch">;
860
+ }, z.core.$strict>;
861
+ /** Runtime-owned Agent invocation input Source. */
862
+ export declare const agentInvocationSourceSchema: z.ZodObject<{
863
+ kind: z.ZodLiteral<"agent_invocation">;
864
+ }, z.core.$strict>;
865
+ /** Runtime-owned input Source. Stored `platform` and Location fields normalize on read. */
866
+ export declare const sourceSchema: z.ZodPreprocess<z.ZodDiscriminatedUnion<[z.ZodObject<{
867
+ kind: z.ZodLiteral<"slack">;
868
+ teamId: z.ZodString;
869
+ channelId: z.ZodString;
870
+ visibility: z.ZodEnum<{
871
+ private: "private";
872
+ public: "public";
873
+ }>;
874
+ messageTs: z.ZodOptional<z.ZodString>;
875
+ threadTs: z.ZodOptional<z.ZodString>;
876
+ }, z.core.$strict>, z.ZodObject<{
877
+ kind: z.ZodLiteral<"local">;
878
+ visibility: z.ZodLiteral<"private">;
879
+ conversationId: z.ZodString;
880
+ }, z.core.$strict>, z.ZodObject<{
881
+ kind: z.ZodLiteral<"web">;
882
+ visibility: z.ZodEnum<{
883
+ private: "private";
884
+ public: "public";
885
+ }>;
886
+ conversationId: z.ZodString;
887
+ }, z.core.$strict>, z.ZodObject<{
888
+ kind: z.ZodLiteral<"event">;
889
+ eventKey: z.ZodString;
890
+ eventType: z.ZodString;
891
+ identifier: z.ZodString;
892
+ namespace: z.ZodString;
893
+ }, z.core.$strict>, z.ZodObject<{
894
+ automationId: z.ZodOptional<z.ZodString>;
895
+ automationRunId: z.ZodOptional<z.ZodString>;
896
+ kind: z.ZodLiteral<"scheduled_automation">;
897
+ }, z.core.$strict>, z.ZodObject<{
898
+ automationId: z.ZodOptional<z.ZodString>;
899
+ automationRunId: z.ZodOptional<z.ZodString>;
900
+ kind: z.ZodLiteral<"event_automation">;
901
+ }, z.core.$strict>, z.ZodObject<{
902
+ kind: z.ZodLiteral<"plugin_dispatch">;
903
+ }, z.core.$strict>, z.ZodObject<{
904
+ kind: z.ZodLiteral<"agent_invocation">;
905
+ }, z.core.$strict>], "kind">, unknown>;
906
+ /** Stable user credential subject shape accepted from plugins. */
907
+ export declare const pluginCredentialSubjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
908
+ type: z.ZodLiteral<"user">;
909
+ userId: z.ZodString;
910
+ allowedWhen: z.ZodLiteral<"private-direct-conversation">;
911
+ }, z.core.$strict>, z.ZodObject<{
912
+ type: z.ZodLiteral<"user">;
913
+ userId: z.ZodString;
914
+ allowedWhen: z.ZodLiteral<"scheduled-automation">;
915
+ taskId: z.ZodString;
916
+ }, z.core.$strict>], "allowedWhen">;
917
+ export declare const slackActorSchema: z.ZodObject<{
918
+ email: z.ZodOptional<z.ZodString>;
919
+ fullName: z.ZodOptional<z.ZodString>;
920
+ userId: z.ZodString;
921
+ userName: z.ZodOptional<z.ZodString>;
922
+ platform: z.ZodLiteral<"slack">;
923
+ teamId: z.ZodString;
924
+ }, z.core.$strict>;
925
+ export declare const localActorSchema: z.ZodObject<{
926
+ email: z.ZodOptional<z.ZodString>;
927
+ fullName: z.ZodOptional<z.ZodString>;
928
+ userId: z.ZodString;
929
+ userName: z.ZodOptional<z.ZodString>;
930
+ platform: z.ZodLiteral<"local">;
931
+ }, z.core.$strict>;
932
+ export declare const webActorSchema: z.ZodObject<{
933
+ email: z.ZodOptional<z.ZodString>;
934
+ fullName: z.ZodOptional<z.ZodString>;
935
+ userId: z.ZodString;
936
+ userName: z.ZodOptional<z.ZodString>;
937
+ platform: z.ZodLiteral<"web">;
938
+ }, z.core.$strict>;
939
+ export declare const systemActorSchema: z.ZodObject<{
940
+ platform: z.ZodLiteral<"system">;
941
+ name: z.ZodString;
942
+ }, z.core.$strict>;
943
+ /** Runtime-provided actor identity visible to plugin hooks. */
944
+ export declare const actorSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
945
+ email: z.ZodOptional<z.ZodString>;
946
+ fullName: z.ZodOptional<z.ZodString>;
947
+ userId: z.ZodString;
948
+ userName: z.ZodOptional<z.ZodString>;
949
+ platform: z.ZodLiteral<"slack">;
950
+ teamId: z.ZodString;
951
+ }, z.core.$strict>, z.ZodObject<{
952
+ email: z.ZodOptional<z.ZodString>;
953
+ fullName: z.ZodOptional<z.ZodString>;
954
+ userId: z.ZodString;
955
+ userName: z.ZodOptional<z.ZodString>;
956
+ platform: z.ZodLiteral<"local">;
957
+ }, z.core.$strict>, z.ZodObject<{
958
+ email: z.ZodOptional<z.ZodString>;
959
+ fullName: z.ZodOptional<z.ZodString>;
960
+ userId: z.ZodString;
961
+ userName: z.ZodOptional<z.ZodString>;
962
+ platform: z.ZodLiteral<"web">;
963
+ }, z.core.$strict>, z.ZodObject<{
964
+ platform: z.ZodLiteral<"system">;
965
+ name: z.ZodString;
966
+ }, z.core.$strict>], "platform">;
967
+ /** Core-owned provider account linked to a user when verified. */
968
+ export declare const identitySchema: z.ZodObject<{
969
+ displayName: z.ZodOptional<z.ZodString>;
970
+ handle: z.ZodOptional<z.ZodString>;
971
+ id: z.ZodString;
972
+ provider: z.ZodString;
973
+ providerSubjectId: z.ZodString;
974
+ providerTenantId: z.ZodOptional<z.ZodString>;
975
+ }, z.core.$strict>;
976
+ /** Core-owned person with every linked provider identity. */
977
+ export declare const userSchema: z.ZodObject<{
978
+ displayName: z.ZodOptional<z.ZodString>;
979
+ email: z.ZodString;
980
+ id: z.ZodString;
981
+ identities: z.ZodArray<z.ZodObject<{
982
+ displayName: z.ZodOptional<z.ZodString>;
983
+ handle: z.ZodOptional<z.ZodString>;
984
+ id: z.ZodString;
985
+ provider: z.ZodString;
986
+ providerSubjectId: z.ZodString;
987
+ providerTenantId: z.ZodOptional<z.ZodString>;
988
+ }, z.core.$strict>>;
989
+ isAdmin: z.ZodOptional<z.ZodLiteral<true>>;
990
+ }, z.core.$strict>;
991
+ /** Compact destination-visible context explaining what produced a reply. */
992
+ export declare const replyAttributionSchema: z.ZodObject<{
993
+ label: z.ZodPipe<z.ZodString, z.ZodString>;
994
+ detail: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodString>>;
995
+ }, z.core.$strict>;
996
+ /**
997
+ * Plugin request to start work for one person. `input` becomes that person's
998
+ * first Message in a new public Conversation, so it must be what they asked
999
+ * for, not text that someone else wrote. Name the person by exactly one of:
1000
+ *
1001
+ * - `subjectId`: the provider account id that the OAuth account-linking flow
1002
+ * stored. Core binds the provider to the calling plugin.
1003
+ * - `verifiedEmail`: an address that the plugin proved this person sent from,
1004
+ * such as the From address of an email that passed DMARC. Never an address
1005
+ * that only appears in content.
1006
+ */
1007
+ export declare const identityDispatchOptionsSchema: z.ZodUnion<readonly [z.ZodObject<{
1008
+ idempotencyKey: z.ZodPipe<z.ZodString, z.ZodString>;
1009
+ input: z.ZodPipe<z.ZodString, z.ZodString>;
1010
+ subjectId: z.ZodPipe<z.ZodString, z.ZodString>;
1011
+ }, z.core.$strict>, z.ZodObject<{
1012
+ idempotencyKey: z.ZodPipe<z.ZodString, z.ZodString>;
1013
+ input: z.ZodPipe<z.ZodString, z.ZodString>;
1014
+ verifiedEmail: z.ZodEmail;
1015
+ }, z.core.$strict>]>;
1016
+ /** Plugin dispatch request accepted by Junior core. */
1017
+ export declare const dispatchOptionsSchema: z.ZodObject<{
1018
+ idempotencyKey: z.ZodPipe<z.ZodString, z.ZodString>;
1019
+ credentialSubject: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
1020
+ type: z.ZodLiteral<"user">;
1021
+ userId: z.ZodString;
1022
+ allowedWhen: z.ZodLiteral<"private-direct-conversation">;
1023
+ }, z.core.$strict>, z.ZodObject<{
1024
+ type: z.ZodLiteral<"user">;
1025
+ userId: z.ZodString;
1026
+ allowedWhen: z.ZodLiteral<"scheduled-automation">;
1027
+ taskId: z.ZodString;
1028
+ }, z.core.$strict>], "allowedWhen">>;
1029
+ destination: z.ZodObject<{
1030
+ platform: z.ZodLiteral<"slack">;
1031
+ teamId: z.ZodString;
1032
+ channelId: z.ZodString;
1033
+ threadTs: z.ZodOptional<z.ZodString>;
1034
+ }, z.core.$strict>;
1035
+ destinationVisibility: z.ZodEnum<{
1036
+ private: "private";
1037
+ public: "public";
1038
+ }>;
1039
+ input: z.ZodPipe<z.ZodString, z.ZodString>;
1040
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1041
+ replyAttribution: z.ZodOptional<z.ZodObject<{
1042
+ label: z.ZodPipe<z.ZodString, z.ZodString>;
1043
+ detail: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodString>>;
1044
+ }, z.core.$strict>>;
1045
+ title: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodString>>;
1046
+ }, z.core.$strict>;
1047
+ /** A loaded value and how long to cache it. */
1048
+ export interface CacheEntry<T> {
1049
+ /** Omit to return the value without caching it, such as for an incomplete response. */
1050
+ ttlMs?: number;
1051
+ /** Must survive JSON serialization. */
1052
+ value: T;
1053
+ }
1054
+ /**
1055
+ * Short-lived copies of values that are slow or costly to load, such as
1056
+ * provider API reads. Junior can drop an entry at any time. A lost entry only
1057
+ * costs a reload, so never keep data here that Junior must not lose. Use
1058
+ * `PluginState` for that.
1059
+ */
1060
+ export interface PluginCache {
1061
+ /**
1062
+ * Return the cached value for `key`, or call `load` and cache its result.
1063
+ * Concurrent callers share one load. A load that throws is not cached.
1064
+ * `refresh` ignores the cached value and replaces it.
1065
+ */
1066
+ getOrLoad<T>(key: string, load: () => Promise<CacheEntry<T>>, options?: {
1067
+ refresh?: boolean;
1068
+ }): Promise<T>;
1069
+ }
1070
+ /** Runtime platform name without source or destination coordinates. */
1071
+ export type Platform = z.output<typeof platformSchema>;
1072
+ export type Actor = z.output<typeof actorSchema>;
1073
+ export type SlackActor = z.output<typeof slackActorSchema>;
1074
+ export type LocalActor = z.output<typeof localActorSchema>;
1075
+ export type WebActor = z.output<typeof webActorSchema>;
1076
+ export type SystemActor = z.output<typeof systemActorSchema>;
1077
+ export type Identity = z.output<typeof identitySchema>;
1078
+ export type User = z.output<typeof userSchema>;
1079
+ export type Source = z.output<typeof sourceSchema>;
1080
+ /** Validated Location associated with a Conversation. */
1081
+ export type Location = z.output<typeof locationSchema>;
1082
+ /** Complete Slack Location associated with a Conversation. */
1083
+ export type SlackLocation = z.output<typeof slackLocationSchema>;
1084
+ export type SlackSource = Extract<Source, {
1085
+ kind: "slack";
1086
+ }>;
1087
+ export type LocalSource = Extract<Source, {
1088
+ kind: "local";
1089
+ }>;
1090
+ export type WebSource = Extract<Source, {
1091
+ kind: "web";
1092
+ }>;
1093
+ export type EventSource = Extract<Source, {
1094
+ kind: "event";
1095
+ }>;
1096
+ export type ScheduledAutomationSource = Extract<Source, {
1097
+ kind: "scheduled_automation";
1098
+ }>;
1099
+ export type EventAutomationSource = Extract<Source, {
1100
+ kind: "event_automation";
1101
+ }>;
1102
+ export type PluginDispatchSource = Extract<Source, {
1103
+ kind: "plugin_dispatch";
1104
+ }>;
1105
+ export type AgentInvocationSource = Extract<Source, {
1106
+ kind: "agent_invocation";
1107
+ }>;
1108
+ export type SourceVisibility = z.output<typeof sourceVisibilitySchema>;
1109
+ export type Destination = z.output<typeof destinationSchema>;
1110
+ export type SlackDestination = Extract<Destination, {
1111
+ platform: "slack";
1112
+ }>;
1113
+ export type LocalDestination = Extract<Destination, {
1114
+ platform: "local";
1115
+ }>;
1116
+ export interface PluginMetadata {
1117
+ name: string;
1118
+ }
1119
+ export interface PluginLogger {
1120
+ error(message: string, metadata?: Record<string, unknown>): void;
1121
+ info(message: string, metadata?: Record<string, unknown>): void;
1122
+ warn(message: string, metadata?: Record<string, unknown>): void;
1123
+ }
1124
+ export interface PluginModel {
1125
+ /** Run a host-owned structured model call without exposing provider credentials. */
1126
+ completeObject<TSchema extends ZodTypeAny>(input: {
1127
+ /** Tokens for the object itself. The host adds room for reasoning. */
1128
+ maxTokens?: number;
1129
+ prompt: string;
1130
+ schema: TSchema;
1131
+ system?: string;
1132
+ }): Promise<{
1133
+ /** Best-effort estimated provider cost for this completion. */
1134
+ costUsd?: number;
1135
+ object: z.infer<TSchema>;
1136
+ }>;
1137
+ }
1138
+ /** Host decision model: a fast classifier for one narrow choice, with no reasoning. */
1139
+ export interface PluginDecider {
1140
+ /**
1141
+ * Pick the choice whose criteria fit `state`. `instructions` say what to
1142
+ * judge. Keep the state as evidence only; it is not instructions.
1143
+ */
1144
+ decide<TChoice extends string>(input: {
1145
+ criteria: Record<TChoice, string>;
1146
+ instructions: string;
1147
+ state: string;
1148
+ }): Promise<{
1149
+ choice: TChoice;
1150
+ /** Best-effort estimated provider cost for this decision. */
1151
+ costUsd?: number;
1152
+ /** Probability of each choice, when the provider returns them. */
1153
+ probabilities?: Partial<Record<TChoice, number>>;
1154
+ }>;
1155
+ }
1156
+ /** How embedded text is used. Some models embed queries and documents differently. */
1157
+ export type PluginEmbeddingInputType = "document" | "query";
1158
+ export interface PluginEmbedder {
1159
+ /** Configured embedding model id; embedTexts() reports the same value. */
1160
+ model: string;
1161
+ /** Provider name that embedTexts() reports. */
1162
+ provider: string;
1163
+ /** Embed plugin-owned text for derived retrieval without exposing provider credentials. */
1164
+ embedTexts(input: {
1165
+ inputType?: PluginEmbeddingInputType;
1166
+ texts: string[];
1167
+ }): Promise<{
1168
+ /** Best-effort estimated provider cost for this embedding call. */
1169
+ costUsd?: number;
1170
+ dimensions: number;
1171
+ model: string;
1172
+ provider: string;
1173
+ vectors: number[][];
1174
+ }>;
1175
+ }
1176
+ export interface PluginReranker {
1177
+ /** Score plugin-owned documents against one query without exposing provider credentials. */
1178
+ rerank(input: {
1179
+ documents: string[];
1180
+ query: string;
1181
+ }): Promise<{
1182
+ /** Best-effort provider cost for this reranking call. */
1183
+ costUsd?: number;
1184
+ /** One relevance score per document, in input order. Higher is more relevant. */
1185
+ scores: number[];
1186
+ }>;
1187
+ }
1188
+ export interface PluginContext {
1189
+ /** Short-lived cache scoped to this plugin. */
1190
+ cache: PluginCache;
1191
+ /** Shared Drizzle database connection for plugin runtime code. */
1192
+ db: unknown;
1193
+ log: PluginLogger;
1194
+ plugin: PluginMetadata;
1195
+ }
1196
+ interface BaseInvocationContext {
1197
+ /**
1198
+ * Opaque Junior conversation/session identity for this invocation.
1199
+ * Interactive Slack turns use `slack:{channelId}:{threadTs}`.
1200
+ */
1201
+ conversationId?: string;
1202
+ /** Location associated with this Conversation. */
1203
+ locationId?: string | undefined;
1204
+ }
1205
+ export interface SlackInvocationContext extends BaseInvocationContext {
1206
+ /** Runtime-owned default outbound destination for this invocation. */
1207
+ destination: SlackDestination;
1208
+ actor?: SlackActor | undefined;
1209
+ /** Runtime-owned source where the invocation came from. */
1210
+ source: SlackSource;
1211
+ }
1212
+ export interface LocalInvocationContext extends BaseInvocationContext {
1213
+ /** Runtime-owned default outbound destination for this invocation. */
1214
+ destination: LocalDestination;
1215
+ actor?: LocalActor | undefined;
1216
+ /** Runtime-owned source where the invocation came from. */
1217
+ source: LocalSource;
1218
+ }
1219
+ export interface WebInvocationContext extends BaseInvocationContext {
1220
+ /** Existing conversation destination used for location and tool context. */
1221
+ destination: Destination;
1222
+ actor?: WebActor | undefined;
1223
+ /** Runtime-owned dashboard/web source for this invocation. */
1224
+ source: WebSource;
1225
+ }
1226
+ export interface EventInvocationContext extends BaseInvocationContext {
1227
+ /** Existing conversation destination used for tool context. */
1228
+ destination: Destination;
1229
+ actor?: Actor;
1230
+ /** Runtime-owned Event Source for this invocation. */
1231
+ source: EventSource;
1232
+ }
1233
+ export type InvocationContext = LocalInvocationContext | SlackInvocationContext | WebInvocationContext | (BaseInvocationContext & {
1234
+ destination: Destination;
1235
+ actor?: Actor | undefined;
1236
+ source: AgentInvocationSource | EventAutomationSource | PluginDispatchSource | EventSource | ScheduledAutomationSource;
1237
+ });
1238
+ /** Build a normalized Slack source from runtime-owned Slack coordinates. */
1239
+ export declare function createSlackSource(input: {
1240
+ channelId: string;
1241
+ messageTs?: string | undefined;
1242
+ teamId: string;
1243
+ threadTs?: string | undefined;
1244
+ /** Runtime-normalized source visibility. */
1245
+ visibility: SourceVisibility;
1246
+ }): SlackSource;
1247
+ /** Build a normalized local source from a local conversation id. */
1248
+ export declare function createLocalSource(conversationId: string): LocalSource;
1249
+ /** Build a normalized web/dashboard source from a conversation id. */
1250
+ export declare function createWebSource(conversationId: string, visibility?: SourceVisibility): WebSource;
1251
+ /** Build a normalized Event Source from one matched event. */
1252
+ export declare function createEventSource(input: {
1253
+ eventKey: string;
1254
+ eventType: string;
1255
+ identifier: string;
1256
+ namespace: string;
1257
+ }): EventSource;
1258
+ /** Return whether a source is private to a person or restricted group. */
1259
+ export declare function isPrivateSource(source: Source): boolean;
1260
+ /** Return the stable source identity used for idempotency and attribution. */
1261
+ export declare function getSourceKey(source: Source): string | undefined;
1262
+ /** Narrow a runtime destination to the Slack-specific address shape. */
1263
+ export declare function isSlackDestination(destination: Destination | undefined): destination is SlackDestination;
738
1264
  declare const pluginGrantAccessSchema: z.ZodUnion<readonly [z.ZodLiteral<"read">, z.ZodLiteral<"write">]>;
739
1265
  /** Runtime schema for provider authorization a plugin may request. */
740
1266
  export declare const pluginAuthorizationSchema: z.ZodObject<{
@@ -1006,6 +1532,13 @@ export interface PluginTokenStore {
1006
1532
  credentialSubject?: PluginUserTokenSlot;
1007
1533
  currentUser?: PluginUserTokenSlot;
1008
1534
  }
1535
+ /** Input for a search of one provider's accounts by person. */
1536
+ export interface SearchUsersHookContext extends PluginContext {
1537
+ /** Fetch provider URLs with host-owned credentials. */
1538
+ egress: PluginEgress;
1539
+ /** The text to match: an ID, handle, email, mention, or name. */
1540
+ query: string;
1541
+ }
1009
1542
  export interface ResolveOAuthAccountHookContext extends PluginContext {
1010
1543
  tokens: PluginStoredTokens;
1011
1544
  /**
@@ -1378,6 +1911,11 @@ export declare const conversationSidebarAnnotationSchema: z.ZodObject<{
1378
1911
  title: z.ZodOptional<z.ZodString>;
1379
1912
  url: z.ZodOptional<z.ZodString>;
1380
1913
  imageUrl: z.ZodOptional<z.ZodString>;
1914
+ size: z.ZodOptional<z.ZodObject<{
1915
+ changedFiles: z.ZodOptional<z.ZodNumber>;
1916
+ additions: z.ZodOptional<z.ZodNumber>;
1917
+ deletions: z.ZodOptional<z.ZodNumber>;
1918
+ }, z.core.$strict>>;
1381
1919
  }, z.core.$strict>;
1382
1920
  export type ConversationSidebarAnnotation = z.output<typeof conversationSidebarAnnotationSchema>;
1383
1921
  export interface ConversationSidebarHookContext extends PluginContext {
@@ -1530,6 +2068,7 @@ export declare const pluginEventDeclarationSchema: z.ZodObject<{
1530
2068
  anyOf: z.ZodArray<z.ZodString>;
1531
2069
  }, z.core.$strict>]>;
1532
2070
  guidance: z.ZodOptional<z.ZodString>;
2071
+ phrase: z.ZodOptional<z.ZodString>;
1533
2072
  }, z.core.$strict>;
1534
2073
  export type PluginEventDeclaration = z.output<typeof pluginEventDeclarationSchema>;
1535
2074
  export declare const pluginEventsSchema: z.ZodObject<{
@@ -1562,6 +2101,7 @@ export declare const pluginEventsSchema: z.ZodObject<{
1562
2101
  anyOf: z.ZodArray<z.ZodString>;
1563
2102
  }, z.core.$strict>]>;
1564
2103
  guidance: z.ZodOptional<z.ZodString>;
2104
+ phrase: z.ZodOptional<z.ZodString>;
1565
2105
  }, z.core.$strict>>;
1566
2106
  isEnabled: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodBoolean>>;
1567
2107
  normalizeIdentifier: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodString], null>, z.ZodString>>;
@@ -1569,6 +2109,10 @@ export declare const pluginEventsSchema: z.ZodObject<{
1569
2109
  identifier: z.ZodString;
1570
2110
  resourceType: z.ZodString;
1571
2111
  }, z.core.$strip>], null>, z.ZodOptional<z.ZodString>>>;
2112
+ resourceForUrl: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodString], null>, z.ZodOptional<z.ZodObject<{
2113
+ identifier: z.ZodString;
2114
+ resourceType: z.ZodString;
2115
+ }, z.core.$strip>>>>;
1572
2116
  }, z.core.$strict>;
1573
2117
  export type PluginEventType = z.output<typeof pluginEventTypeSchema>;
1574
2118
  export type PluginEvents = z.output<typeof pluginEventsSchema>;
@@ -1838,6 +2382,24 @@ export interface PluginEgress {
1838
2382
  request: Request;
1839
2383
  }): Promise<Response>;
1840
2384
  }
2385
+ /** Public artifacts that a plugin tool publishes for the conversation. */
2386
+ export interface PluginArtifacts {
2387
+ /**
2388
+ * Publish image bytes at a public HTTPS URL that anyone with the URL can
2389
+ * open. With `expiresInMs`, the URL stops serving after that long. PNG,
2390
+ * JPEG, GIF, or WebP up to 10 MB; other input throws a tool input error.
2391
+ */
2392
+ publishImage(input: {
2393
+ body: Uint8Array;
2394
+ expiresInMs?: number;
2395
+ }): Promise<{
2396
+ url: string;
2397
+ /** ISO time when the URL stops serving. Absent when it does not expire. */
2398
+ expiresAt?: string;
2399
+ }>;
2400
+ /** Stop serving an image that this conversation published, by its URL. */
2401
+ unpublishImage(url: string): Promise<void>;
2402
+ }
1841
2403
  export declare const pluginToolContentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1842
2404
  type: z.ZodLiteral<"text">;
1843
2405
  text: z.ZodString;
@@ -2482,6 +3044,16 @@ export type PluginWorkOwner = {
2482
3044
  /** Host-owned dashboard link to the record. */
2483
3045
  url?: string;
2484
3046
  };
3047
+ /**
3048
+ * Result of `users.findLinkedHandle`. `unlinked` means one person matched
3049
+ * but has no linked account at the provider.
3050
+ */
3051
+ export type PluginLinkedHandleLookup = {
3052
+ status: "found";
3053
+ handle: string;
3054
+ } | {
3055
+ status: "ambiguous" | "not_found" | "unlinked";
3056
+ };
2485
3057
  interface BaseToolRegistrationHookContext extends PluginContext {
2486
3058
  /**
2487
3059
  * Opaque Junior conversation/session identity for this turn.
@@ -2503,6 +3075,8 @@ interface BaseToolRegistrationHookContext extends PluginContext {
2503
3075
  conversationLink?: {
2504
3076
  url: string;
2505
3077
  };
3078
+ /** Absent when the install has no artifact storage or public base URL. */
3079
+ artifacts?: PluginArtifacts;
2506
3080
  /** Decision model for narrow choices, such as checks on text a tool writes. */
2507
3081
  decider: PluginDecider;
2508
3082
  embedder: PluginEmbedder;
@@ -2531,6 +3105,13 @@ interface BaseToolRegistrationHookContext extends PluginContext {
2531
3105
  * written. Call it before you send model text out.
2532
3106
  */
2533
3107
  replaceSlackMentions<T>(value: T, provider: string): Promise<T>;
3108
+ /**
3109
+ * Find the one person that `query` names, such as an email, a Slack
3110
+ * mention, or a name, and return the handle of their linked `provider`
3111
+ * account. Only accounts that people linked count, so the handle is
3112
+ * verified.
3113
+ */
3114
+ findLinkedHandle(query: string, provider: string): Promise<PluginLinkedHandleLookup>;
2534
3115
  };
2535
3116
  userText?: string;
2536
3117
  workspaces: PluginWorkspaceToolContext;
@@ -2720,6 +3301,11 @@ export declare const codeChangeInputSchema: z.ZodObject<{
2720
3301
  providerId: z.ZodString;
2721
3302
  url: z.ZodOptional<z.ZodString>;
2722
3303
  }, z.core.$strict>;
3304
+ size: z.ZodOptional<z.ZodObject<{
3305
+ changedFiles: z.ZodOptional<z.ZodNumber>;
3306
+ additions: z.ZodOptional<z.ZodNumber>;
3307
+ deletions: z.ZodOptional<z.ZodNumber>;
3308
+ }, z.core.$strict>>;
2723
3309
  state: z.ZodEnum<{
2724
3310
  closed: "closed";
2725
3311
  merged: "merged";
@@ -2832,6 +3418,15 @@ export interface PluginConversationEventReader {
2832
3418
  viewer: User;
2833
3419
  }): Promise<PluginConversationEventRecord[] | undefined>;
2834
3420
  }
3421
+ /**
3422
+ * Read events that the current plugin emitted in one Turn. The Turn is bound,
3423
+ * so no Conversation access check is needed.
3424
+ */
3425
+ export interface PluginTurnEventReader {
3426
+ list(input: {
3427
+ eventName: string;
3428
+ }): Promise<PluginConversationEventRecord[]>;
3429
+ }
2835
3430
  /**
2836
3431
  * Events that Junior writes in a plugin's namespace for the cost of each
2837
3432
  * priced `model`, `decider`, `embedder`, or `reranker` call in a
@@ -2892,6 +3487,21 @@ type UserPromptContribution = PromptMessage | PromptContextContribution;
2892
3487
  type SystemPromptContext = Pick<PluginContext, "db" | "log" | "plugin"> & {
2893
3488
  platform: Platform;
2894
3489
  };
3490
+ /** One prompt context that this plugin gave an earlier Turn. */
3491
+ type PromptHistoryContext = PromptContext & {
3492
+ /** When the plugin made it. */
3493
+ loadedAtMs: number;
3494
+ };
3495
+ /** What the model history that a new prompt replays holds. */
3496
+ interface PromptHistory {
3497
+ /**
3498
+ * When this history started: the time of the last History replacement.
3499
+ * Undefined when it holds the whole Conversation.
3500
+ */
3501
+ startedAtMs?: number;
3502
+ /** This plugin's prompt contexts in this history, oldest first. */
3503
+ contexts: PromptHistoryContext[];
3504
+ }
2895
3505
  /** Runtime facts available while building plugin user prompt context. */
2896
3506
  type UserPromptContext = Pick<PluginContext, "db" | "log" | "plugin"> & {
2897
3507
  conversationId?: string;
@@ -2910,9 +3520,20 @@ type UserPromptContext = Pick<PluginContext, "db" | "log" | "plugin"> & {
2910
3520
  setSpanAttributes(attributes: Record<string, number>): void;
2911
3521
  /** Location associated with this Conversation. */
2912
3522
  locationId?: string | undefined;
3523
+ /**
3524
+ * Read the model history that this prompt replays, such as to skip context
3525
+ * that the model still has. Undefined when the prompt has no Conversation.
3526
+ */
3527
+ loadHistory?(): Promise<PromptHistory>;
2913
3528
  actor?: Actor | undefined;
2914
3529
  source: Source;
2915
3530
  state: PluginState;
3531
+ /**
3532
+ * The request of this Turn: what a person wrote, the task or message of a
3533
+ * parent agent, or the instructions of an Automation. Runtime text, such as
3534
+ * tags, generic instructions, Events, child agent results, and the question
3535
+ * of an Inbox item, is not in it. Empty when the Turn has no request.
3536
+ */
2916
3537
  text: string;
2917
3538
  users: {
2918
3539
  /** Resolve the current Actor's Identity and User. */
@@ -3391,6 +4012,8 @@ export interface PluginTaskContext extends PluginContext {
3391
4012
  load(): Promise<PluginRunContext>;
3392
4013
  };
3393
4014
  state: PluginState;
4015
+ /** Events that this plugin emitted in the completed Turn, oldest first. */
4016
+ turnEvents: PluginTurnEventReader;
3394
4017
  }
3395
4018
  /** Plugin task handler registered by name in a plugin manifest module. */
3396
4019
  export interface PluginTaskDefinition {
@@ -3399,7 +4022,30 @@ export interface PluginTaskDefinition {
3399
4022
  /** Task handlers keyed by the plugin-owned task name. */
3400
4023
  export type PluginTasks = Record<string, PluginTaskDefinition>;
3401
4024
  /**
3402
- * An item that a plugin puts on the review desk: a notice for information,
4025
+ * A code change title split by Conventional Commits, such as
4026
+ * `feat(api)!: Add retries`. The plugin that owns the code change parses it,
4027
+ * so the Inbox can lead with the words and show the rest as pills.
4028
+ */
4029
+ export interface InboxItemSubjectTitleParts {
4030
+ /** The title without its type prefix, such as `Add retries`. */
4031
+ text: string;
4032
+ /** The change type as one word, such as `Feature`. Unset when unknown. */
4033
+ type?: string;
4034
+ /** The scope, such as `api`. */
4035
+ scope?: string;
4036
+ /** The title marks a breaking change, such as with `!`. */
4037
+ breaking?: boolean;
4038
+ }
4039
+ /** What a plugin item is about, such as a pull request. */
4040
+ export interface InboxItemSubjectInput {
4041
+ id: string;
4042
+ title?: string;
4043
+ url?: string;
4044
+ /** Set only for a code change whose title follows Conventional Commits. */
4045
+ titleParts?: InboxItemSubjectTitleParts;
4046
+ }
4047
+ /**
4048
+ * An item that a plugin puts in the Inbox: a notice for information,
3403
4049
  * or an ask that waits on its assignees.
3404
4050
  */
3405
4051
  export interface PluginReviewNotice {
@@ -3416,16 +4062,22 @@ export interface PluginReviewNotice {
3416
4062
  */
3417
4063
  dedupeKey: string;
3418
4064
  /** What the notice is about, such as a pull request. Search matches `id`. */
3419
- subject?: {
3420
- id: string;
3421
- title?: string;
3422
- url?: string;
3423
- };
4065
+ subject?: InboxItemSubjectInput;
3424
4066
  /**
3425
4067
  * For an item that waits on its assignees, name their step, such as
3426
4068
  * `Ready to merge · #946`. It is the reason that the dashboard shows.
3427
4069
  */
3428
4070
  title: string;
4071
+ /**
4072
+ * Buttons that answer the item, in display order, such as `Resume`. An
4073
+ * item with choices waits on its assignees. The first click closes it as
4074
+ * done and calls the plugin's `inboxItemAnswered` hook with the choice.
4075
+ * The answer starts no Turn: the plugin does the work.
4076
+ */
4077
+ choices?: Array<{
4078
+ label: string;
4079
+ description?: string;
4080
+ }>;
3429
4081
  /**
3430
4082
  * The assignees must act, such as merge a pull request that is ready. The
3431
4083
  * item then waits on them: its Conversation shows in their Needs you, and
@@ -3435,23 +4087,57 @@ export interface PluginReviewNotice {
3435
4087
  waitsOnAssignees?: boolean;
3436
4088
  }
3437
4089
  /**
3438
- * Review items that a plugin adds and closes from its own events. Each item
4090
+ * Inbox items that a plugin adds and closes from its own events. Each item
3439
4091
  * belongs to one Conversation. Core owns visibility, assignment rules, and
3440
4092
  * the Slack cards.
3441
4093
  */
3442
- export interface PluginReviewItems {
4094
+ export interface PluginInboxItems {
3443
4095
  /** Add an open item, or replace the content of the open one with the key. */
3444
4096
  upsert(notice: PluginReviewNotice): Promise<void>;
3445
- /** Close the open item with the key. Do nothing when no item is open. */
4097
+ /**
4098
+ * Close the open item with the key. Do nothing when no item is open, such
4099
+ * as after a person dismissed it. Return whether an open item closed.
4100
+ */
3446
4101
  close(input: {
3447
4102
  dedupeKey: string;
3448
4103
  reason: string;
3449
4104
  status: "done" | "dismissed";
3450
- }): Promise<void>;
4105
+ }): Promise<boolean>;
3451
4106
  }
3452
- /** Review items of a plugin, for the Conversation that each item belongs to. */
3453
- export interface PluginConversationReviewItems {
3454
- forConversation(conversationId: string): PluginReviewItems;
4107
+ /** Inbox items of a plugin, for the Conversation that each item belongs to. */
4108
+ export interface PluginConversationInboxItems {
4109
+ forConversation(conversationId: string): PluginInboxItems;
4110
+ }
4111
+ /** A person picked one of the `choices` of an item that this plugin added. */
4112
+ export interface InboxItemAnsweredHookContext extends PluginContext {
4113
+ /** The label of the picked choice. */
4114
+ choice: string;
4115
+ /** The Conversation that the item belongs to. */
4116
+ conversationId: string;
4117
+ /** The plugin's own dedupe key of the item. */
4118
+ dedupeKey: string;
4119
+ /** Publish events, as from a plugin route. */
4120
+ events: EventPublisher;
4121
+ /** The closed item's id. It is the same on a retry of the same answer. */
4122
+ itemId: string;
4123
+ nowMs: number;
4124
+ /** Inbox items, as from a plugin route. */
4125
+ inboxItems: PluginConversationInboxItems;
4126
+ state: PluginState;
4127
+ /** Watches of the item's Conversation. */
4128
+ watches: PluginConversationWatches;
4129
+ }
4130
+ /** Watches of one Conversation, for a plugin outside a tool call. */
4131
+ export interface PluginConversationWatches extends PluginEventToolContext {
4132
+ /**
4133
+ * Whether an active Watch of this Conversation starts a Turn for this
4134
+ * event type on this plugin resource. Watches of other Conversations and
4135
+ * event automations do not count.
4136
+ */
4137
+ watching(input: {
4138
+ eventType: string;
4139
+ identifier: string;
4140
+ }): Promise<boolean>;
3455
4141
  }
3456
4142
  export interface HeartbeatHookContext extends PluginContext {
3457
4143
  agent: {
@@ -3472,8 +4158,8 @@ export interface HeartbeatHookContext extends PluginContext {
3472
4158
  /** Publish events, as from a plugin route. */
3473
4159
  events: EventPublisher;
3474
4160
  nowMs: number;
3475
- /** Review desk items, as from a plugin route. */
3476
- reviewItems: PluginConversationReviewItems;
4161
+ /** Inbox items, as from a plugin route. */
4162
+ inboxItems: PluginConversationInboxItems;
3477
4163
  state: PluginState;
3478
4164
  }
3479
4165
  export interface HeartbeatResult {
@@ -3603,8 +4289,8 @@ export interface RouteRegistrationHookContext extends PluginContext {
3603
4289
  codeChanges: CodeChangePublisher;
3604
4290
  /** Core-owned delivery boundary for provider webhook events. */
3605
4291
  events: EventPublisher;
3606
- /** Review desk items that the plugin adds and closes from its events. */
3607
- reviewItems: PluginConversationReviewItems;
4292
+ /** Inbox items that the plugin adds and closes from its events. */
4293
+ inboxItems: PluginConversationInboxItems;
3608
4294
  /** Plugin-namespaced state, the same as in heartbeats. */
3609
4295
  state: PluginState;
3610
4296
  users: {
@@ -3760,6 +4446,12 @@ export interface PluginHooks {
3760
4446
  * return undefined to use those credentials for this request.
3761
4447
  */
3762
4448
  grantForEgress?(ctx: EgressHookContext): Promise<PluginGrant | undefined> | PluginGrant | undefined;
4449
+ /**
4450
+ * Do the work that a person asked for with a choice on an item that this
4451
+ * plugin added. Junior calls it again when the person retries after a
4452
+ * failure, so it must be safe to repeat.
4453
+ */
4454
+ inboxItemAnswered?(ctx: InboxItemAnsweredHookContext): Promise<void> | void;
3763
4455
  heartbeat?(ctx: HeartbeatHookContext): Promise<HeartbeatResult | void> | HeartbeatResult | void;
3764
4456
  unfinishedWork?(ctx: UnfinishedWorkHookContext): Promise<UnfinishedWorkResult> | UnfinishedWorkResult;
3765
4457
  issueCredential?(ctx: IssueCredentialHookContext): Promise<PluginCredentialResult> | PluginCredentialResult;
@@ -3773,6 +4465,12 @@ export interface PluginHooks {
3773
4465
  /** Return plugin-owned product API routes mounted under Junior's authenticated plugin namespace. */
3774
4466
  apiRoutes?(ctx: ApiRouteRegistrationHookContext): PluginRouteApp | undefined;
3775
4467
  resolveOAuthAccount?(ctx: ResolveOAuthAccountHookContext): Promise<PluginProviderAccount | undefined> | PluginProviderAccount | undefined;
4468
+ /**
4469
+ * Return the provider accounts that match a person search. Return only
4470
+ * close matches, such as an exact login, so the agent can choose between
4471
+ * them. `userLookup` links each account to a known person.
4472
+ */
4473
+ searchUsers?(ctx: SearchUsersHookContext): Promise<PluginProviderAccount[]> | PluginProviderAccount[];
3776
4474
  routes?(ctx: RouteRegistrationHookContext): PluginRoute[];
3777
4475
  sandboxPrepare?(ctx: SandboxPrepareHookContext): Promise<void> | void;
3778
4476
  workspacePrepare?(ctx: WorkspacePrepareHookContext): Promise<WorkspaceFinalize | void> | WorkspaceFinalize | void;
@@ -4087,4 +4785,4 @@ export type PluginRegistrationInput = {
4087
4785
  export interface PluginRegistration extends PluginRegistrationInput {}
4088
4786
  /** Define one Junior plugin registration for app and build-time wiring. */
4089
4787
  export declare function defineJuniorPlugin(plugin: PluginRegistrationInput): PluginRegistration;
4090
- export { Actor, AgentInvocationSource, CacheEntry, Destination, EventAutomationSource, EventInvocationContext, EventSource, Identity, InvocationContext, LocalActor, LocalDestination, LocalInvocationContext, LocalSource, Location, Platform, PluginCache, PluginContext, PluginDecider, PluginDispatchSource, PluginEmbedder, PluginEmbeddingInputType, PluginLogger, PluginMetadata, PluginModel, PluginReranker, type PromptContext, type PromptContextContribution, type PromptMessage, ScheduledAutomationSource, SlackActor, SlackDestination, SlackInvocationContext, SlackLocation, SlackSource, Source, SourceVisibility, SystemActor, type SystemPromptContext, User, type UserPromptContext, type UserPromptContribution, WebActor, WebInvocationContext, WebSource, actorSchema, actorUserIdSchema, agentInvocationSourceSchema, createEventSource, createLocalSource, createSlackSource, createWebSource, destinationSchema, destinationVisibilitySchema, dispatchOptionsSchema, eventAutomationSourceSchema, eventSourceSchema, getSourceKey, identityDispatchOptionsSchema, identitySchema, isPrivateSource, isSlackDestination, localActorSchema, localDestinationSchema, localSourceSchema, locationSchema, nonBlankStringSchema, platformSchema, pluginCredentialSubjectSchema, pluginDispatchSourceSchema, replyAttributionSchema, scheduledAutomationSourceSchema, slackActorSchema, slackDestinationSchema, slackLocationSchema, slackSourceSchema, sourceSchema, sourceVisibilitySchema, systemActorSchema, taskOutcomeSchema, userSchema, webActorSchema, webSourceSchema };
4788
+ export type { PromptContext, PromptContextContribution, PromptHistory, PromptHistoryContext, PromptMessage, SystemPromptContext, UserPromptContext, UserPromptContribution };