@sentry/junior-plugin-api 0.61.0 → 0.63.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
@@ -146,11 +146,30 @@ export interface HeartbeatHookContext extends AgentPluginContext {
146
146
  export interface HeartbeatResult {
147
147
  dispatchCount?: number;
148
148
  }
149
+ export type AgentPluginRouteMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS" | "ALL";
150
+ export type AgentPluginRouteHandler = {
151
+ bivarianceHack(request: Request): Promise<Response> | Response;
152
+ }["bivarianceHack"];
153
+ export interface AgentPluginRoute {
154
+ handler: AgentPluginRouteHandler;
155
+ method?: AgentPluginRouteMethod | AgentPluginRouteMethod[];
156
+ path: string;
157
+ }
158
+ export interface RouteRegistrationHookContext extends AgentPluginContext {
159
+ }
160
+ export interface SlackConversationLink {
161
+ url: string;
162
+ }
163
+ export interface SlackConversationLinkHookContext extends AgentPluginContext {
164
+ conversationId: string;
165
+ }
149
166
  export interface AgentPluginHooks {
150
167
  sandboxPrepare?(ctx: SandboxPrepareHookContext): Promise<void> | void;
151
168
  beforeToolExecute?(ctx: BeforeToolExecuteHookContext): Promise<void> | void;
169
+ routes?(ctx: RouteRegistrationHookContext): AgentPluginRoute[];
152
170
  tools?(ctx: ToolRegistrationHookContext): Record<string, AgentPluginToolDefinition>;
153
171
  heartbeat?(ctx: HeartbeatHookContext): Promise<HeartbeatResult | void> | HeartbeatResult | void;
172
+ slackConversationLink?(ctx: SlackConversationLinkHookContext): SlackConversationLink | undefined;
154
173
  }
155
174
  export interface JuniorPluginConfig {
156
175
  legacyStatePrefixes?: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/junior-plugin-api",
3
- "version": "0.61.0",
3
+ "version": "0.63.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
package/src/index.ts CHANGED
@@ -177,15 +177,49 @@ export interface HeartbeatResult {
177
177
  dispatchCount?: number;
178
178
  }
179
179
 
180
+ export type AgentPluginRouteMethod =
181
+ | "GET"
182
+ | "POST"
183
+ | "PUT"
184
+ | "PATCH"
185
+ | "DELETE"
186
+ | "HEAD"
187
+ | "OPTIONS"
188
+ | "ALL";
189
+
190
+ export type AgentPluginRouteHandler = {
191
+ bivarianceHack(request: Request): Promise<Response> | Response;
192
+ }["bivarianceHack"];
193
+
194
+ export interface AgentPluginRoute {
195
+ handler: AgentPluginRouteHandler;
196
+ method?: AgentPluginRouteMethod | AgentPluginRouteMethod[];
197
+ path: string;
198
+ }
199
+
200
+ export interface RouteRegistrationHookContext extends AgentPluginContext {}
201
+
202
+ export interface SlackConversationLink {
203
+ url: string;
204
+ }
205
+
206
+ export interface SlackConversationLinkHookContext extends AgentPluginContext {
207
+ conversationId: string;
208
+ }
209
+
180
210
  export interface AgentPluginHooks {
181
211
  sandboxPrepare?(ctx: SandboxPrepareHookContext): Promise<void> | void;
182
212
  beforeToolExecute?(ctx: BeforeToolExecuteHookContext): Promise<void> | void;
213
+ routes?(ctx: RouteRegistrationHookContext): AgentPluginRoute[];
183
214
  tools?(
184
215
  ctx: ToolRegistrationHookContext,
185
216
  ): Record<string, AgentPluginToolDefinition>;
186
217
  heartbeat?(
187
218
  ctx: HeartbeatHookContext,
188
219
  ): Promise<HeartbeatResult | void> | HeartbeatResult | void;
220
+ slackConversationLink?(
221
+ ctx: SlackConversationLinkHookContext,
222
+ ): SlackConversationLink | undefined;
189
223
  }
190
224
 
191
225
  export interface JuniorPluginConfig {