@sentry/junior-github 0.229.0 → 0.231.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.
@@ -11,6 +11,7 @@ export declare function githubObjectAnnotation(input: {
11
11
  status: string;
12
12
  facts?: ObjectAnnotation["facts"];
13
13
  sourceUpdatedAt?: string;
14
+ description?: string;
14
15
  }): ObjectAnnotation;
15
16
  /** Refresh an existing object's status without selecting a card for delivery. */
16
17
  export declare function updateGitHubAnnotation(store: PluginAnnotations, input: {
package/dist/index.js CHANGED
@@ -241,6 +241,7 @@ function createGitHubCloneRepositoryTool(ctx) {
241
241
  import { z as z2 } from "zod";
242
242
  var person = z2.object({ login: z2.string() });
243
243
  var responseSchema = z2.object({
244
+ body: z2.string().nullable().optional(),
244
245
  user: person.nullable().optional(),
245
246
  requested_reviewers: z2.array(person).optional(),
246
247
  assignees: z2.array(person).optional(),
@@ -257,9 +258,21 @@ var short = (value) => {
257
258
  const text2 = value?.trim();
258
259
  return text2 ? text2.length > 64 ? `${text2.slice(0, 63)}\u2026` : text2 : void 0;
259
260
  };
261
+ function description(body) {
262
+ let text2 = (body ?? "").replace(
263
+ /<!-- junior-(session-footer|request-attribution):start -->[\s\S]*?<!-- junior-\1:end -->/g,
264
+ ""
265
+ );
266
+ while (text2.includes("<!--")) {
267
+ text2 = text2.replace(/<!--[\s\S]*?(?:-->|$)/g, "");
268
+ }
269
+ text2 = text2.trim();
270
+ if (!text2) return void 0;
271
+ return text2.length > 4e3 ? `${text2.slice(0, 3999)}\u2026` : text2;
272
+ }
260
273
  function githubObjectFacts(type, response) {
261
274
  const data = responseSchema.parse(response);
262
- return {
275
+ const result = {
263
276
  sourceUpdatedAt: data.updated_at,
264
277
  facts: type === "code_change" ? {
265
278
  type,
@@ -279,6 +292,8 @@ function githubObjectFacts(type, response) {
279
292
  ).filter(Boolean)
280
293
  }
281
294
  };
295
+ if (type === "code_change") result.description = description(data.body);
296
+ return result;
282
297
  }
283
298
 
284
299
  // src/annotations.ts
@@ -324,6 +339,7 @@ function githubObjectAnnotation(input) {
324
339
  status: input.status,
325
340
  displayType: input.objectType === "code_change" ? "Pull request" : "Issue",
326
341
  facts: input.facts,
342
+ description: input.description,
327
343
  sourceUpdatedAt: input.sourceUpdatedAt
328
344
  };
329
345
  }
@@ -1159,6 +1175,7 @@ var createPullRequestStateSchema = Type2.Union([
1159
1175
  number: Type2.Number(),
1160
1176
  facts: Type2.Optional(Type2.Unknown()),
1161
1177
  sourceUpdatedAt: Type2.Optional(Type2.String()),
1178
+ description: Type2.Optional(Type2.String({ maxLength: 4e3 })),
1162
1179
  status: Type2.Literal("completed"),
1163
1180
  url: Type2.String()
1164
1181
  },
@@ -1356,6 +1373,7 @@ async function gitHubPullRequestStructuredResult(ctx, input, result, subscriptio
1356
1373
  githubObjectAnnotation({
1357
1374
  facts: result.facts,
1358
1375
  sourceUpdatedAt: result.sourceUpdatedAt,
1376
+ description: result.description,
1359
1377
  repo: input.repo,
1360
1378
  number: result.number,
1361
1379
  title: input.title,
@@ -1432,6 +1450,7 @@ function createGitHubPullRequestTool(ctx, subscriptionConfig) {
1432
1450
  const completedResult = {
1433
1451
  facts: state.facts === void 0 ? void 0 : objectFactsSchema2.parse(state.facts),
1434
1452
  sourceUpdatedAt: state.sourceUpdatedAt,
1453
+ description: state.description,
1435
1454
  number: state.number,
1436
1455
  url: state.url
1437
1456
  };
@@ -1,3 +1,3 @@
1
1
  import type { ObjectAnnotation } from "@sentry/junior-plugin-api";
2
2
  /** Select card facts from GitHub REST responses; never infer reviews or checks. */
3
- export declare function githubObjectFacts(type: "task" | "code_change", response: unknown): Pick<ObjectAnnotation, "facts" | "sourceUpdatedAt">;
3
+ export declare function githubObjectFacts(type: "task" | "code_change", response: unknown): Pick<ObjectAnnotation, "facts" | "sourceUpdatedAt" | "description">;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/junior-github",
3
- "version": "0.229.0",
3
+ "version": "0.231.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -31,7 +31,7 @@
31
31
  "@sinclair/typebox": "^0.34.49",
32
32
  "drizzle-orm": "^0.45.2",
33
33
  "zod": "^4.5.4",
34
- "@sentry/junior-plugin-api": "0.229.0"
34
+ "@sentry/junior-plugin-api": "0.231.0"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@oxlint/plugins": "1.79.0",