@sentry/junior-plugin-api 0.259.0 → 0.261.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/README.md CHANGED
@@ -48,6 +48,12 @@ reports, and other typed hook surfaces exported by this package.
48
48
  - Prompt hooks return bounded structured prompt messages rather than mutate the
49
49
  core prompt.
50
50
  - `formatMarkdown` is a pure text rewrite into ordinary Markdown before delivery.
51
+ - `conversationTitleContext` returns short facts about objects that the first
52
+ human message refers to, such as an issue number and title. The hook gets the
53
+ plugin's config values, such as a default repository. It must read provider
54
+ data through `ctx.egress`, which uses Junior's system identity and never
55
+ starts authorization. Only the title model sees the facts. Junior bounds the
56
+ wait and ignores a failed hook.
51
57
  - User prompt hooks for durable turns may emit registered structured events
52
58
  through `ctx.events` for auxiliary work completed while building context.
53
59
  - Tool hooks return model-visible schemas aligned with their executor inputs.
package/dist/index.d.ts CHANGED
@@ -1164,6 +1164,12 @@ export declare const eventInputSchema: z.ZodObject<{
1164
1164
  }, z.core.$strict>, z.ZodObject<{
1165
1165
  email: z.ZodString;
1166
1166
  }, z.core.$strict>]>>>;
1167
+ doneBy: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
1168
+ provider: z.ZodString;
1169
+ handle: z.ZodString;
1170
+ }, z.core.$strict>, z.ZodObject<{
1171
+ email: z.ZodString;
1172
+ }, z.core.$strict>]>>;
1167
1173
  }, z.core.$strict>;
1168
1174
  export type EventData = z.output<typeof eventDataSchema>;
1169
1175
  export type EventInput = z.output<typeof eventInputSchema>;
@@ -1190,6 +1196,12 @@ export declare const eventSchema: z.ZodObject<{
1190
1196
  }, z.core.$strict>, z.ZodObject<{
1191
1197
  email: z.ZodString;
1192
1198
  }, z.core.$strict>]>>>;
1199
+ doneBy: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
1200
+ provider: z.ZodString;
1201
+ handle: z.ZodString;
1202
+ }, z.core.$strict>, z.ZodObject<{
1203
+ email: z.ZodString;
1204
+ }, z.core.$strict>]>>;
1193
1205
  namespace: z.ZodString;
1194
1206
  }, z.core.$strict>;
1195
1207
  export type Event = z.output<typeof eventSchema>;
@@ -2227,7 +2239,30 @@ export declare function enforceEgressPolicy(input: {
2227
2239
  export interface FormatMarkdownHookContext {
2228
2240
  text: string;
2229
2241
  }
2242
+ /** First human message of a new Conversation, given before title generation. */
2243
+ export interface ConversationTitleContextHookContext extends PluginContext {
2244
+ /**
2245
+ * String config values of this plugin for the Conversation's Location, by
2246
+ * short key. For example, `repo` for the `github.repo` config key.
2247
+ */
2248
+ config: Record<string, string>;
2249
+ /**
2250
+ * Host-owned provider egress for title reads. It uses Junior's system
2251
+ * identity, so it never uses a user's credentials or starts authorization.
2252
+ */
2253
+ egress: PluginEgress;
2254
+ /** Ends the hook when the host stops waiting for title context. */
2255
+ signal: AbortSignal;
2256
+ text: string;
2257
+ }
2230
2258
  export interface PluginHooks {
2259
+ /**
2260
+ * Return short facts that help name a new Conversation, such as
2261
+ * `owner/repo#123: Issue title` for a linked issue. Junior shows these facts
2262
+ * only to the title model. Return nothing when the message has no known
2263
+ * objects.
2264
+ */
2265
+ conversationTitleContext?(ctx: ConversationTitleContextHookContext): Promise<string[] | undefined> | string[] | undefined;
2231
2266
  conversationSidebar?(ctx: ConversationSidebarHookContext): Promise<ConversationSidebarResult> | ConversationSidebarResult;
2232
2267
  systemPrompt?(ctx: SystemPromptContext): Promise<PromptMessage[]> | PromptMessage[];
2233
2268
  userPrompt?(ctx: UserPromptContext): Promise<UserPromptContribution[] | undefined> | UserPromptContribution[] | undefined;
package/dist/index.js CHANGED
@@ -847,7 +847,13 @@ const eventInputSchema = z.object({
847
847
  data: eventDataSchema.optional(),
848
848
  untrustedText: z.string().transform((value) => value.slice(0, EVENT_TEXT_MAX_LENGTH)).optional(),
849
849
  /** People involved in the change. Watch Events list them as mentions. */
850
- people: z.array(eventPersonSchema).max(20).optional()
850
+ people: z.array(eventPersonSchema).max(20).optional(),
851
+ /**
852
+ * The person who did what the Event describes, such as a reviewer or a
853
+ * commenter. Core resolves them like `people`, so the agent knows when a
854
+ * mention and a provider name are the same person.
855
+ */
856
+ doneBy: eventPersonSchema.optional()
851
857
  }).strict();
852
858
  const eventSchema = eventInputSchema.extend({ namespace: z.string().min(1) });
853
859
  // src/tasks.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/junior-plugin-api",
3
- "version": "0.259.0",
3
+ "version": "0.261.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"