Skip to content

Commit 7c7159c

Browse files
committed
build: update bundled dist files
1 parent 2a1d4b4 commit 7c7159c

File tree

5 files changed

+140
-12
lines changed

5 files changed

+140
-12
lines changed

dist/index.js

Lines changed: 66 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/env node
22
process.env.VISOR_VERSION = '0.1.42';
33
process.env.PROBE_VERSION = '0.6.0-rc167';
4-
process.env.VISOR_COMMIT_SHA = '22b2c9a394d29a2d8e1b6cb651e93bc3c0264d04';
5-
process.env.VISOR_COMMIT_SHORT = '22b2c9a3';
4+
process.env.VISOR_COMMIT_SHA = '2a1d4b407e71a04f5cc5314cf00f267856d06748';
5+
process.env.VISOR_COMMIT_SHORT = '2a1d4b40';
66
/******/ (() => { // webpackBootstrap
77
/******/ var __webpack_modules__ = ({
88

@@ -111307,6 +111307,7 @@ const session_registry_1 = __nccwpck_require__(46059);
111307111307
const logger_1 = __nccwpck_require__(86999);
111308111308
const tracer_init_1 = __nccwpck_require__(11903);
111309111309
const diff_processor_1 = __nccwpck_require__(29883);
111310+
const comment_metadata_1 = __nccwpck_require__(47284);
111310111311
/**
111311111312
* Helper function to log debug messages using the centralized logger
111312111313
*/
@@ -111843,9 +111844,10 @@ ${this.escapeXml(prInfo.body)}
111843111844
? issueComments.filter(c => c.id !== triggeringComment.id)
111844111845
: issueComments;
111845111846
// For code-review schema checks, filter out previous Visor code-review comments to avoid self-bias
111846-
// Comment IDs look like: <!-- visor-comment-id:pr-review-244-review -->
111847+
// Old format: <!-- visor-comment-id:pr-review-244-review -->
111848+
// New format: <!-- visor:thread={"key":"...","group":"review",...} -->
111847111849
if (isCodeReviewSchema) {
111848-
historicalComments = historicalComments.filter(c => !c.body || !c.body.includes('visor-comment-id:pr-review-'));
111850+
historicalComments = historicalComments.filter(c => !(0, comment_metadata_1.shouldFilterVisorReviewComment)(c.body));
111849111851
}
111850111852
if (historicalComments.length > 0) {
111851111853
context += `
@@ -111974,9 +111976,10 @@ ${this.escapeXml(processedFallbackDiff)}
111974111976
? prComments.filter(c => c.id !== triggeringComment.id)
111975111977
: prComments;
111976111978
// For code-review schema checks, filter out previous Visor code-review comments to avoid self-bias
111977-
// Comment IDs look like: <!-- visor-comment-id:pr-review-244-review -->
111979+
// Old format: <!-- visor-comment-id:pr-review-244-review -->
111980+
// New format: <!-- visor:thread={"key":"...","group":"review",...} -->
111978111981
if (isCodeReviewSchema) {
111979-
historicalComments = historicalComments.filter(c => !c.body || !c.body.includes('visor-comment-id:pr-review-'));
111982+
historicalComments = historicalComments.filter(c => !(0, comment_metadata_1.shouldFilterVisorReviewComment)(c.body));
111980111983
}
111981111984
if (historicalComments.length > 0) {
111982111985
context += `
@@ -144179,6 +144182,63 @@ exports.CommandExecutor = CommandExecutor;
144179144182
exports.commandExecutor = CommandExecutor.getInstance();
144180144183

144181144184

144185+
/***/ }),
144186+
144187+
/***/ 47284:
144188+
/***/ ((__unused_webpack_module, exports) => {
144189+
144190+
"use strict";
144191+
144192+
/**
144193+
* Utility functions for parsing and handling Visor comment metadata
144194+
*/
144195+
Object.defineProperty(exports, "__esModule", ({ value: true }));
144196+
exports.parseVisorThreadMetadata = parseVisorThreadMetadata;
144197+
exports.shouldFilterVisorReviewComment = shouldFilterVisorReviewComment;
144198+
/**
144199+
* Parse visor:thread metadata from a comment body
144200+
* Reuses the same regex pattern from github-frontend.ts for consistency
144201+
*/
144202+
function parseVisorThreadMetadata(commentBody) {
144203+
const headerRe = /<!--\s*visor:thread=(\{[\s\S]*?\})\s*-->/m;
144204+
const match = headerRe.exec(commentBody);
144205+
if (!match) {
144206+
return null;
144207+
}
144208+
try {
144209+
const metadata = JSON.parse(match[1]);
144210+
return metadata && typeof metadata === 'object' && !Array.isArray(metadata) ? metadata : null;
144211+
}
144212+
catch {
144213+
// If parsing fails, return null (graceful handling)
144214+
return null;
144215+
}
144216+
}
144217+
/**
144218+
* Check if a comment should be filtered out when building AI context for code reviews.
144219+
* This filters Visor's own review comments to avoid bias, while keeping user comments
144220+
* and non-review Visor comments (like overview).
144221+
*
144222+
* @param commentBody - The body text of the comment
144223+
* @returns true if the comment should be filtered out (excluded from AI context)
144224+
*/
144225+
function shouldFilterVisorReviewComment(commentBody) {
144226+
if (!commentBody) {
144227+
return false;
144228+
}
144229+
// Old format: check for visor-comment-id:pr-review- pattern
144230+
if (commentBody.includes('visor-comment-id:pr-review-')) {
144231+
return true;
144232+
}
144233+
// New format: check for visor:thread metadata with group="review"
144234+
const metadata = parseVisorThreadMetadata(commentBody);
144235+
if (metadata && metadata.group === 'review') {
144236+
return true;
144237+
}
144238+
return false;
144239+
}
144240+
144241+
144182144242
/***/ }),
144183144243

144184144244
/***/ 51455:

dist/sdk/sdk.js

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4565,6 +4565,39 @@ var init_diff_processor = __esm({
45654565
}
45664566
});
45674567

4568+
// src/utils/comment-metadata.ts
4569+
function parseVisorThreadMetadata(commentBody) {
4570+
const headerRe = /<!--\s*visor:thread=(\{[\s\S]*?\})\s*-->/m;
4571+
const match = headerRe.exec(commentBody);
4572+
if (!match) {
4573+
return null;
4574+
}
4575+
try {
4576+
const metadata = JSON.parse(match[1]);
4577+
return metadata && typeof metadata === "object" && !Array.isArray(metadata) ? metadata : null;
4578+
} catch {
4579+
return null;
4580+
}
4581+
}
4582+
function shouldFilterVisorReviewComment(commentBody) {
4583+
if (!commentBody) {
4584+
return false;
4585+
}
4586+
if (commentBody.includes("visor-comment-id:pr-review-")) {
4587+
return true;
4588+
}
4589+
const metadata = parseVisorThreadMetadata(commentBody);
4590+
if (metadata && metadata.group === "review") {
4591+
return true;
4592+
}
4593+
return false;
4594+
}
4595+
var init_comment_metadata = __esm({
4596+
"src/utils/comment-metadata.ts"() {
4597+
"use strict";
4598+
}
4599+
});
4600+
45684601
// src/ai-review-service.ts
45694602
function log(...args) {
45704603
logger.debug(args.join(" "));
@@ -4578,6 +4611,7 @@ var init_ai_review_service = __esm({
45784611
init_logger();
45794612
init_tracer_init();
45804613
init_diff_processor();
4614+
init_comment_metadata();
45814615
AIReviewService = class {
45824616
config;
45834617
sessionRegistry;
@@ -5052,7 +5086,7 @@ ${this.escapeXml(prInfo.body)}
50525086
let historicalComments = triggeringComment2 ? issueComments.filter((c) => c.id !== triggeringComment2.id) : issueComments;
50535087
if (isCodeReviewSchema) {
50545088
historicalComments = historicalComments.filter(
5055-
(c) => !c.body || !c.body.includes("visor-comment-id:pr-review-")
5089+
(c) => !shouldFilterVisorReviewComment(c.body)
50565090
);
50575091
}
50585092
if (historicalComments.length > 0) {
@@ -5165,7 +5199,7 @@ ${this.escapeXml(processedFallbackDiff)}
51655199
let historicalComments = triggeringComment ? prComments.filter((c) => c.id !== triggeringComment.id) : prComments;
51665200
if (isCodeReviewSchema) {
51675201
historicalComments = historicalComments.filter(
5168-
(c) => !c.body || !c.body.includes("visor-comment-id:pr-review-")
5202+
(c) => !shouldFilterVisorReviewComment(c.body)
51695203
);
51705204
}
51715205
if (historicalComments.length > 0) {

dist/sdk/sdk.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/sdk/sdk.mjs

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -912,6 +912,39 @@ var init_diff_processor = __esm({
912912
}
913913
});
914914

915+
// src/utils/comment-metadata.ts
916+
function parseVisorThreadMetadata(commentBody) {
917+
const headerRe = /<!--\s*visor:thread=(\{[\s\S]*?\})\s*-->/m;
918+
const match = headerRe.exec(commentBody);
919+
if (!match) {
920+
return null;
921+
}
922+
try {
923+
const metadata = JSON.parse(match[1]);
924+
return metadata && typeof metadata === "object" && !Array.isArray(metadata) ? metadata : null;
925+
} catch {
926+
return null;
927+
}
928+
}
929+
function shouldFilterVisorReviewComment(commentBody) {
930+
if (!commentBody) {
931+
return false;
932+
}
933+
if (commentBody.includes("visor-comment-id:pr-review-")) {
934+
return true;
935+
}
936+
const metadata = parseVisorThreadMetadata(commentBody);
937+
if (metadata && metadata.group === "review") {
938+
return true;
939+
}
940+
return false;
941+
}
942+
var init_comment_metadata = __esm({
943+
"src/utils/comment-metadata.ts"() {
944+
"use strict";
945+
}
946+
});
947+
915948
// src/ai-review-service.ts
916949
import { ProbeAgent } from "@probelabs/probe";
917950
function log(...args) {
@@ -925,6 +958,7 @@ var init_ai_review_service = __esm({
925958
init_logger();
926959
init_tracer_init();
927960
init_diff_processor();
961+
init_comment_metadata();
928962
AIReviewService = class {
929963
config;
930964
sessionRegistry;
@@ -1399,7 +1433,7 @@ ${this.escapeXml(prInfo.body)}
13991433
let historicalComments = triggeringComment2 ? issueComments.filter((c) => c.id !== triggeringComment2.id) : issueComments;
14001434
if (isCodeReviewSchema) {
14011435
historicalComments = historicalComments.filter(
1402-
(c) => !c.body || !c.body.includes("visor-comment-id:pr-review-")
1436+
(c) => !shouldFilterVisorReviewComment(c.body)
14031437
);
14041438
}
14051439
if (historicalComments.length > 0) {
@@ -1512,7 +1546,7 @@ ${this.escapeXml(processedFallbackDiff)}
15121546
let historicalComments = triggeringComment ? prComments.filter((c) => c.id !== triggeringComment.id) : prComments;
15131547
if (isCodeReviewSchema) {
15141548
historicalComments = historicalComments.filter(
1515-
(c) => !c.body || !c.body.includes("visor-comment-id:pr-review-")
1549+
(c) => !shouldFilterVisorReviewComment(c.body)
15161550
);
15171551
}
15181552
if (historicalComments.length > 0) {

dist/sdk/sdk.mjs.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)