@mrrlin-dev/mcp 0.4.204 → 0.4.205

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 +29 -11
  2. package/package.json +1 -1
package/dist/bin.cjs CHANGED
@@ -77229,16 +77229,28 @@ function telemetryDay(now = /* @__PURE__ */ new Date()) {
77229
77229
  }
77230
77230
 
77231
77231
  // src/consensus/resolve-gated-task.ts
77232
- async function resolveGatedTaskId(client, projectSlug, page) {
77233
- const tasks = await client.listTasks(projectSlug);
77234
- const linking = tasks.find((t) => t.specWikiPageId === page.id);
77235
- if (linking) {
77236
- if (page.taskId !== linking.id) {
77232
+ function useLinkedTaskLookupV1(value = process.env.MRRLIN_MCP_LINKED_TASK_V1) {
77233
+ const flag = value?.trim().toLowerCase();
77234
+ if (!flag || flag === "0" || flag === "false") return false;
77235
+ if (flag === "1") return true;
77236
+ throw new Error("Invalid MRRLIN_MCP_LINKED_TASK_V1");
77237
+ }
77238
+ async function resolveGatedTaskId(client, projectSlug, page, useV1 = useLinkedTaskLookupV1()) {
77239
+ let linkingId;
77240
+ if (useV1) {
77241
+ if (!client.getWikiPageLinkedTaskV1) throw new Error("Linked task lookup v1 is unavailable");
77242
+ linkingId = await client.getWikiPageLinkedTaskV1(projectSlug, page.id);
77243
+ } else {
77244
+ const tasks = await client.listTasks(projectSlug);
77245
+ linkingId = tasks.find((task) => task.specWikiPageId === page.id)?.id ?? null;
77246
+ }
77247
+ if (linkingId !== null) {
77248
+ if (page.taskId !== linkingId) {
77237
77249
  throw new Error(
77238
- `spec page ${page.id} is linked by task ${linking.id} (tasks.spec_wiki_page_id) but its wiki_pages.task_id back-pointer is ${page.taskId === null ? "null" : page.taskId} \u2014 refusing to gate with a drifted identity`
77250
+ `spec page ${page.id} is linked by task ${linkingId} (tasks.spec_wiki_page_id) but its wiki_pages.task_id back-pointer is ${page.taskId === null ? "null" : page.taskId} \u2014 refusing to gate with a drifted identity`
77239
77251
  );
77240
77252
  }
77241
- return linking.id;
77253
+ return linkingId;
77242
77254
  }
77243
77255
  return page.taskId;
77244
77256
  }
@@ -77248,8 +77260,13 @@ function domainScopedReviewHash2(rawHash, domain2) {
77248
77260
  return domainScopedReviewHash(rawHash, domain2);
77249
77261
  }
77250
77262
  async function resolveSpecDomains(client, projectSlug, page) {
77263
+ const useV1 = useLinkedTaskLookupV1();
77264
+ const linkedTaskId = useV1 ? await resolveGatedTaskId(client, projectSlug, page, true) : void 0;
77265
+ return resolveSpecDomainsForTask(client, projectSlug, page, linkedTaskId);
77266
+ }
77267
+ async function resolveSpecDomainsForTask(client, projectSlug, page, linkedTaskId) {
77251
77268
  try {
77252
- const taskId = await resolveGatedTaskId(client, projectSlug, page);
77269
+ const taskId = linkedTaskId === void 0 ? await resolveGatedTaskId(client, projectSlug, page, false) : linkedTaskId;
77253
77270
  if (taskId !== null) {
77254
77271
  const task = await client.getTask(projectSlug, taskId);
77255
77272
  const taskRecord = task;
@@ -77277,11 +77294,12 @@ async function resolveSpecDomain(client, projectSlug, page) {
77277
77294
  return normalizeDomain(domains);
77278
77295
  }
77279
77296
  async function resolveCurrentSpecReview(client, projectSlug, page) {
77280
- const taskId = await resolveGatedTaskId(client, projectSlug, page);
77297
+ const useV1 = useLinkedTaskLookupV1();
77298
+ const taskId = await resolveGatedTaskId(client, projectSlug, page, useV1);
77281
77299
  const task = taskId !== null ? await client.getTask(projectSlug, taskId) : null;
77282
77300
  const scope = task ? mixedCodeReviewScope(task) : void 0;
77283
77301
  if (scope) return { taskId, reviewHash: mixedCodeSpecReviewHash(scope, page), mixedCode: true };
77284
- const domains = task?.domains ?? await resolveSpecDomains(client, projectSlug, page);
77302
+ const domains = task?.domains ?? await resolveSpecDomainsForTask(client, projectSlug, page, useV1 ? taskId : void 0);
77285
77303
  return { taskId, reviewHash: domainScopedReviewHash2(page.contentHash, domains), mixedCode: false };
77286
77304
  }
77287
77305
 
@@ -99310,7 +99328,7 @@ Do NOT derail the current task - if the operator has an in-flight question, answ
99310
99328
  }
99311
99329
 
99312
99330
  // src/_generated/version.ts
99313
- var PKG_VERSION = "0.4.204";
99331
+ var PKG_VERSION = "0.4.205";
99314
99332
 
99315
99333
  // src/bridge-allowed-origins.ts
99316
99334
  var DEFAULT_DIRECTOR_BRIDGE_ALLOWED_ORIGINS = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrrlin-dev/mcp",
3
- "version": "0.4.204",
3
+ "version": "0.4.205",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "mrrlin-mcp": "dist/bin.cjs"