@mrrlin-dev/mcp 0.4.203 → 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 +42 -11
  2. package/package.json +1 -1
package/dist/bin.cjs CHANGED
@@ -64306,6 +64306,7 @@ var openApiOperationIds = {
64306
64306
  takeOverTask: "takeOverTask",
64307
64307
  closeTaskAsWontDo: "closeTaskAsWontDo",
64308
64308
  getWikiPage: "getWikiPage",
64309
+ getWikiPageLinkedTaskV1: "getWikiPageLinkedTaskV1",
64309
64310
  listExecutionArtifacts: "listExecutionArtifacts",
64310
64311
  listExecutionRuns: "listExecutionRuns",
64311
64312
  listPlans: "listPlans",
@@ -66505,6 +66506,11 @@ var githubRepositorySelectionSchema = external_exports.enum(["all", "selected"])
66505
66506
  var mrrlinTaskIdSchema = external_exports.string().regex(/^GT-\d+$/);
66506
66507
  var mrrlinPlanIdSchema = external_exports.string().regex(/^PL-\d+$/);
66507
66508
  var mrrlinWikiPageIdSchema = external_exports.string().regex(/^WK-\d+$/);
66509
+ var linkedTaskPageIdSchema = mrrlinWikiPageIdSchema.max(128);
66510
+ var linkedTaskResponseSchema = external_exports.object({
66511
+ contract: external_exports.literal("spec-linked-task-v1"),
66512
+ taskId: mrrlinTaskIdSchema.max(128).nullable()
66513
+ }).strict();
66508
66514
  function nextMrrlinWikiPageId(existingIds) {
66509
66515
  let max = 0n;
66510
66516
  for (const id of existingIds) {
@@ -69285,6 +69291,13 @@ function createMrrlinClient(config2) {
69285
69291
  const body = await request(`${projectPath(projectSlug)}/tasks/${encodeURIComponent(taskId)}`);
69286
69292
  return taskResponseSchema.parse(body).data;
69287
69293
  },
69294
+ async getWikiPageLinkedTaskV1(projectSlug, pageId) {
69295
+ const path40 = `${projectPath(projectSlug)}/wiki/${encodeURIComponent(pageId)}/linked-task/v1`;
69296
+ const response = await executeFetch(path40);
69297
+ if (response.status !== 200)
69298
+ await handleResponseError(response, "GET", path40);
69299
+ return linkedTaskResponseSchema.parse(await response.json()).taskId;
69300
+ },
69288
69301
  async getWikiPage(projectSlug, pageId) {
69289
69302
  const body = await request(`${projectPath(projectSlug)}/wiki/${encodeURIComponent(pageId)}`);
69290
69303
  return wikiPageResponseSchema.parse(body).data;
@@ -77216,16 +77229,28 @@ function telemetryDay(now = /* @__PURE__ */ new Date()) {
77216
77229
  }
77217
77230
 
77218
77231
  // src/consensus/resolve-gated-task.ts
77219
- async function resolveGatedTaskId(client, projectSlug, page) {
77220
- const tasks = await client.listTasks(projectSlug);
77221
- const linking = tasks.find((t) => t.specWikiPageId === page.id);
77222
- if (linking) {
77223
- 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) {
77224
77249
  throw new Error(
77225
- `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`
77226
77251
  );
77227
77252
  }
77228
- return linking.id;
77253
+ return linkingId;
77229
77254
  }
77230
77255
  return page.taskId;
77231
77256
  }
@@ -77235,8 +77260,13 @@ function domainScopedReviewHash2(rawHash, domain2) {
77235
77260
  return domainScopedReviewHash(rawHash, domain2);
77236
77261
  }
77237
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) {
77238
77268
  try {
77239
- const taskId = await resolveGatedTaskId(client, projectSlug, page);
77269
+ const taskId = linkedTaskId === void 0 ? await resolveGatedTaskId(client, projectSlug, page, false) : linkedTaskId;
77240
77270
  if (taskId !== null) {
77241
77271
  const task = await client.getTask(projectSlug, taskId);
77242
77272
  const taskRecord = task;
@@ -77264,11 +77294,12 @@ async function resolveSpecDomain(client, projectSlug, page) {
77264
77294
  return normalizeDomain(domains);
77265
77295
  }
77266
77296
  async function resolveCurrentSpecReview(client, projectSlug, page) {
77267
- const taskId = await resolveGatedTaskId(client, projectSlug, page);
77297
+ const useV1 = useLinkedTaskLookupV1();
77298
+ const taskId = await resolveGatedTaskId(client, projectSlug, page, useV1);
77268
77299
  const task = taskId !== null ? await client.getTask(projectSlug, taskId) : null;
77269
77300
  const scope = task ? mixedCodeReviewScope(task) : void 0;
77270
77301
  if (scope) return { taskId, reviewHash: mixedCodeSpecReviewHash(scope, page), mixedCode: true };
77271
- const domains = task?.domains ?? await resolveSpecDomains(client, projectSlug, page);
77302
+ const domains = task?.domains ?? await resolveSpecDomainsForTask(client, projectSlug, page, useV1 ? taskId : void 0);
77272
77303
  return { taskId, reviewHash: domainScopedReviewHash2(page.contentHash, domains), mixedCode: false };
77273
77304
  }
77274
77305
 
@@ -99297,7 +99328,7 @@ Do NOT derail the current task - if the operator has an in-flight question, answ
99297
99328
  }
99298
99329
 
99299
99330
  // src/_generated/version.ts
99300
- var PKG_VERSION = "0.4.203";
99331
+ var PKG_VERSION = "0.4.205";
99301
99332
 
99302
99333
  // src/bridge-allowed-origins.ts
99303
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.203",
3
+ "version": "0.4.205",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "mrrlin-mcp": "dist/bin.cjs"