@mrrlin-dev/mcp 0.4.174 → 0.4.175

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.
Files changed (2) hide show
  1. package/dist/bin.cjs +33 -10
  2. package/package.json +1 -1
package/dist/bin.cjs CHANGED
@@ -45860,14 +45860,21 @@ var QA_QUESTION_MIN_CHARS = 120;
45860
45860
  function cutHead(text, max) {
45861
45861
  return text.length > max ? `${text.slice(0, Math.max(0, max - 1))}\u2026` : text;
45862
45862
  }
45863
- function cutNoteBody(flat) {
45863
+ function flattenNote(text) {
45864
+ return text.replace(/[\p{Cc}\u2028\u2029]+/gu, " ").replace(/ {2,}/g, " ").trim();
45865
+ }
45866
+ function needsTaskNoteAnswer(body) {
45867
+ const flat = flattenNote(body);
45868
+ return flat.length > NOTE_BODY_MAX_CHARS && flat.startsWith("Q: ") && flat.indexOf(" A: ") !== flat.lastIndexOf(" A: ");
45869
+ }
45870
+ function cutNoteBody(flat, questionAnswer) {
45864
45871
  if (flat.length <= NOTE_BODY_MAX_CHARS)
45865
45872
  return flat;
45866
45873
  const split2 = flat.startsWith("Q: ") ? flat.lastIndexOf(" A: ") : -1;
45867
- if (split2 < 0)
45874
+ if (!questionAnswer && split2 < 0)
45868
45875
  return cutHead(flat, NOTE_BODY_MAX_CHARS);
45869
- const question = flat.slice(3, split2);
45870
- const answer = flat.slice(split2 + 4);
45876
+ const question = questionAnswer ? flattenNote(questionAnswer.question) : flat.slice(3, split2);
45877
+ const answer = questionAnswer ? flattenNote(questionAnswer.answer) : flat.slice(split2 + 4);
45871
45878
  const frame = "Q: A: ".length;
45872
45879
  const answerPart = cutHead(answer, NOTE_BODY_MAX_CHARS - frame - QA_QUESTION_MIN_CHARS);
45873
45880
  const questionPart = cutHead(question, NOTE_BODY_MAX_CHARS - frame - answerPart.length);
@@ -45878,10 +45885,7 @@ function renderTaskNotes(events, heading, maxChars = NOTES_SECTION_MAX_CHARS) {
45878
45885
  const notes = events.filter((e) => e.eventType === "note" && typeof e.body === "string" && e.body.trim() !== "");
45879
45886
  if (notes.length === 0)
45880
45887
  return "";
45881
- const lineOf = (note) => {
45882
- const flat = note.body.replace(/[\p{Cc}\u2028\u2029]+/gu, " ").replace(/ {2,}/g, " ").trim();
45883
- return `- ${note.createdAt}: ${cutNoteBody(flat)}`;
45884
- };
45888
+ const lineOf = (note) => `- ${note.createdAt}: ${cutNoteBody(flattenNote(note.body), note.questionAnswer)}`;
45885
45889
  const reserve = heading.length + 1 + `(+${notes.length} older notes omitted)`.length + 1;
45886
45890
  const keptNewestFirst = [];
45887
45891
  let used = reserve;
@@ -66806,7 +66810,7 @@ Do NOT derail the current task - if the operator has an in-flight question, answ
66806
66810
  }
66807
66811
 
66808
66812
  // src/_generated/version.ts
66809
- var PKG_VERSION = "0.4.174";
66813
+ var PKG_VERSION = "0.4.175";
66810
66814
 
66811
66815
  // src/bridge-allowed-origins.ts
66812
66816
  var DEFAULT_DIRECTOR_BRIDGE_ALLOWED_ORIGINS = [
@@ -70990,7 +70994,26 @@ async function gatherContext(client, projectSlug, task, openRunId, rawProjectInp
70990
70994
  const omittedArtifactCount = allArtifacts.length - artifacts.length;
70991
70995
  const events = await client.listTaskEvents(projectSlug, task.id);
70992
70996
  const autonomyEvents = events.filter((event) => event.eventType === "autonomy_set").sort((a, b) => a.createdAt.localeCompare(b.createdAt));
70993
- const noteEvents = events.filter((event) => event.eventType === "note").sort((a, b) => a.createdAt.localeCompare(b.createdAt));
70997
+ let noteEvents = events.filter((event) => event.eventType === "note").sort((a, b) => a.createdAt.localeCompare(b.createdAt));
70998
+ const ambiguousNotes = new Set(noteEvents.flatMap(
70999
+ ({ body }) => body && needsTaskNoteAnswer(body) ? [body] : []
71000
+ ));
71001
+ if (ambiguousNotes.size > 0) {
71002
+ const items = await client.listInboxItems(projectSlug, { kind: "question", taskId: task.id }).catch(() => []);
71003
+ const byNoteBody = /* @__PURE__ */ new Map();
71004
+ for (const item of items) {
71005
+ if (item.kind !== "question" || item.taskId !== task.id || item.status !== "acknowledged" || !item.answer) continue;
71006
+ if (item.origin === "gate" || item.origin === "capability") continue;
71007
+ const body = `Q: ${item.body} A: ${item.answer}`;
71008
+ if (!ambiguousNotes.has(body)) continue;
71009
+ const previous = byNoteBody.get(body);
71010
+ byNoteBody.set(body, previous === null || previous && previous.answer !== item.answer ? null : { question: item.body, answer: item.answer });
71011
+ }
71012
+ noteEvents = noteEvents.map((event) => {
71013
+ const questionAnswer = event.body ? byNoteBody.get(event.body) : void 0;
71014
+ return questionAnswer ? { ...event, questionAnswer } : event;
71015
+ });
71016
+ }
70994
71017
  let specMarkdown = verifiedSpecMarkdown ?? null;
70995
71018
  if (verifiedSpecMarkdown === void 0 && task.specWikiPageId) {
70996
71019
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrrlin-dev/mcp",
3
- "version": "0.4.174",
3
+ "version": "0.4.175",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "mrrlin-mcp": "dist/bin.cjs"