co-maintainer 0.7.6-beta.1 → 0.7.6-beta.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "co-maintainer",
3
- "version": "0.7.6-beta.1",
3
+ "version": "0.7.6-beta.2",
4
4
  "description": "An imitator of yours, A PR review tool like co-maintainer.",
5
5
  "keywords": [
6
6
  "ai",
@@ -1,3 +1,4 @@
1
+ import { safeCopy } from "../util/redact.js";
1
2
  import { parseStoredReferences, referenceLine } from "../review/references.js";
2
3
  import { FakeAiProvider } from "../ai/fake.js";
3
4
  import { completeWithMermaidTools, } from "../ai/mermaid_loop.js";
@@ -253,7 +254,11 @@ async function runReplyJobCore(job, log, client, ai, signal) {
253
254
  log("info", "stopped before posting the reply, nothing was posted");
254
255
  return;
255
256
  }
256
- const { text, withdrawn } = takeWithdrawLine(answer);
257
+ const taken = takeWithdrawLine(answer);
258
+ // The copy rule is asked of the model, and a model can still break it. A
259
+ // reply's prose loses its em dashes and semicolons here, code keeps them.
260
+ const text = safeCopy(taken.text);
261
+ const withdrawn = taken.withdrawn;
257
262
  const body = `${marker}\n${plainSuggestionFences(text)}`;
258
263
  setReplyStatus(request.id, "posting");
259
264
  const posted = await postReply(github, request, body);
@@ -29,5 +29,5 @@ export function outsideCode(text, clean) {
29
29
  * semicolon. Code keeps its own punctuation or it stops compiling. */
30
30
  export function safeCopy(text) {
31
31
  // punctuation: code, this cleaner must name the semicolon it removes from AI text
32
- return outsideCode(redact(text), (prose) => prose.replaceAll("\u2014", ", ").replaceAll(";", "."));
32
+ return outsideCode(redact(text), (prose) => prose.replace(/\s*\u2014\s*/g, ", ").replaceAll(";", "."));
33
33
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "co-maintainer",
3
- "version": "0.7.6-beta.1",
3
+ "version": "0.7.6-beta.2",
4
4
  "description": "An imitator of yours, A PR review tool like co-maintainer.",
5
5
  "keywords": [
6
6
  "ai",