@mrrlin-dev/mcp 0.4.270 → 0.4.273

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 +93 -17
  2. package/package.json +1 -1
package/dist/bin.cjs CHANGED
@@ -100244,7 +100244,9 @@ function localLandingNote(outcome, ctx) {
100244
100244
  const { taskId, title, defaultBranch: d, detail } = ctx;
100245
100245
  const prefix = `${taskId} (${title})`;
100246
100246
  const bodies = {
100247
- applied: `${prefix} \u2014 Applied and merged to ${d}. Restart your dev server if running to pick up changes.`,
100247
+ // Dogfood R2-18: this is what a non-technical owner reads when their task finishes. No git words
100248
+ // and no dev-server advice: most projects have none, and a running one reloads on its own.
100249
+ applied: `${prefix} \u2014 Done. The changes are saved in your project folder.`,
100248
100250
  already_applied: `${prefix} \u2014 Already applied to ${d}. No changes needed.`,
100249
100251
  uncommitted_changes: `${prefix} \u2014 Can't apply: you have uncommitted changes in your project folder. Commit or stash them, then ask the Director to apply ${taskId} again.`,
100250
100252
  would_overwrite_files: `${prefix} \u2014 Can't apply: local files (${detail}) would be overwritten. Move them aside, then ask the Director to apply ${taskId} again.`,
@@ -100276,7 +100278,8 @@ async function fileLocalLandingNote(client, projectSlug, outcome, ctx) {
100276
100278
  error: error51 instanceof Error ? error51.message : String(error51)
100277
100279
  })
100278
100280
  );
100279
- await client.createInboxItem(projectSlug, { id: note.id, kind: "info", taskId: ctx.taskId, body: note.body }).catch(logFailure("inbox_note"));
100281
+ const kind = outcome === "applied" ? "completed" : "info";
100282
+ await client.createInboxItem(projectSlug, { id: note.id, kind, taskId: ctx.taskId, body: note.body }).catch(logFailure("inbox_note"));
100280
100283
  await client.appendExecutionArtifact(projectSlug, ctx.runId, {
100281
100284
  id: `EA-${import_node_crypto21.default.randomUUID()}`,
100282
100285
  kind: "checkpoint",
@@ -101625,6 +101628,24 @@ var runSpecConsensusInputSchema = external_exports.object({
101625
101628
  'Opt-in reviewer personas to add on top of the fixed four (plan-reviewer, architect, security-analyst, scope-analyst). "researcher" \u2014 for specs that reference external libraries, frameworks, or APIs; validates dependency/version/behavior claims. "debugger" \u2014 for root-cause/investigation specs; stress-tests hypotheses, evidence, and repro steps. Both are OFF by default.'
101626
101629
  )
101627
101630
  });
101631
+ var TERMINAL_TASK_STATUSES = new Set(mrrlinTerminalTaskStatuses);
101632
+ async function refuseSpecReviewOfNonSpec(client, projectSlug, pageId) {
101633
+ const page = await client.getWikiPage(projectSlug, pageId);
101634
+ if (page.folder !== "Specs") {
101635
+ throw new McpToolCodedError(
101636
+ "SPEC_REVIEW_NOT_A_SPEC",
101637
+ `${pageId} is in the ${page.folder} folder, not Specs, so it is not a spec and was not reviewed. If this is the spec you meant, move it into the Specs folder; otherwise check the page id.`
101638
+ );
101639
+ }
101640
+ if (!page.taskId) return;
101641
+ const task = await client.getTask(projectSlug, page.taskId).catch(() => null);
101642
+ if (task && TERMINAL_TASK_STATUSES.has(task.status)) {
101643
+ throw new McpToolCodedError(
101644
+ "SPEC_REVIEW_TASK_CLOSED",
101645
+ `${pageId} is the spec of ${task.id}, which is closed, so it was not reviewed. Check the page id; to change finished work, propose a new task.`
101646
+ );
101647
+ }
101648
+ }
101628
101649
  var runCodeReviewerGateInputSchema = external_exports.object({
101629
101650
  projectSlug: external_exports.string().min(1),
101630
101651
  baseRef: external_exports.string().min(1),
@@ -101863,7 +101884,7 @@ var mcpToolDescriptions = {
101863
101884
  [mcpToolNames.createTaxonomyEntry]: "Create an allowed category/subcategory pair.",
101864
101885
  [mcpToolNames.renameTaxonomyEntry]: "Rename a category/subcategory pair; cascades to every task that uses it.",
101865
101886
  [mcpToolNames.deleteTaxonomyEntry]: "Delete a category/subcategory pair (rejected while tasks still use it).",
101866
- [mcpToolNames.listProjectMembers]: "List a project's teammates (the owner is derived from github.operator, not a member row).",
101887
+ [mcpToolNames.listProjectMembers]: "List a project's teammates. The owner is not a row here (derived from github.operator) but is always a member: an empty list means the owner works alone, never that the project has no members.",
101867
101888
  [mcpToolNames.addProjectMember]: "Add a teammate to a project by email (owner-only).",
101868
101889
  [mcpToolNames.removeProjectMember]: "Remove a teammate from a project by email (owner-only); returns the updated list.",
101869
101890
  [mcpToolNames.appendTaskJournal]: "Append a progress entry to the task journal. Generate one operationId UUID per logical entry and reuse it for retries; the same UUID with different text is rejected.",
@@ -102737,6 +102758,7 @@ function createMrrlinTools(options) {
102737
102758
  "Unable to enqueue spec consensus.",
102738
102759
  async (c, { projectSlug, pageId, extraHeads }) => {
102739
102760
  await checkTenantBoundary(projectSlug, "spec consensus");
102761
+ await refuseSpecReviewOfNonSpec(c, projectSlug, pageId);
102740
102762
  const result = await enqueueAsyncTool(c, consensusDescriptor, { projectSlug, pageId, extraHeads });
102741
102763
  if (result.status === "queued") pingAsyncWorkerDispatch(projectSlug, result.jobId);
102742
102764
  return result;
@@ -106970,7 +106992,7 @@ Do NOT derail the current task - if the operator has an in-flight question, answ
106970
106992
  }
106971
106993
 
106972
106994
  // src/_generated/version.ts
106973
- var PKG_VERSION = "0.4.270";
106995
+ var PKG_VERSION = "0.4.273";
106974
106996
 
106975
106997
  // src/bridge-allowed-origins.ts
106976
106998
  var DEFAULT_DIRECTOR_BRIDGE_ALLOWED_ORIGINS = [
@@ -115528,7 +115550,15 @@ function buildDeliverableAuthorPrompt(task, specMarkdown, project, journalMarkdo
115528
115550
  `- negative_result: the work was actually attempted and valid evidence shows the requested positive result did not materialize.`,
115529
115551
  ``,
115530
115552
  `The markdown body must justify the declared outcome and satisfy every applicable item in the spec's`,
115531
- `"## Acceptance criteria" checklist. Do not add commentary before the opening delimiter.`
115553
+ `"## Acceptance criteria" checklist. Do not add commentary before the opening delimiter.`,
115554
+ // Dogfood v4 R2-1: GT-1's deliverable told the operator to "tap Approve on the task page", a button
115555
+ // that did not exist. Name the review exactly as the task page offers it.
115556
+ ...task.autonomyLevel === "human_review" ? [
115557
+ ``,
115558
+ `This task needs the operator's sign-off: when it finishes, it waits on its task page, where the operator`,
115559
+ `chooses Accept or Request changes. If you mention that review, name exactly those two actions; never`,
115560
+ `invent other buttons, links or steps.`
115561
+ ] : []
115532
115562
  ].join("\n");
115533
115563
  }
115534
115564
  async function writeDeliverablePage(client, projectSlug, task, markdown) {
@@ -116434,6 +116464,26 @@ async function deliverLocalRun(deps, input) {
116434
116464
  return;
116435
116465
  }
116436
116466
  const landingClient = deps.activeLease?.landingClient ?? deps.client;
116467
+ const settledTask = await landingClient.getTask(projectSlug, task.id).catch(() => null);
116468
+ if (settledTask?.status !== "closed_done") {
116469
+ console.warn(JSON.stringify({
116470
+ event: "landing_held_for_operator",
116471
+ projectSlug,
116472
+ runId,
116473
+ taskId: task.id,
116474
+ taskStatus: settledTask?.status ?? null
116475
+ }));
116476
+ if (settledTask?.status === "awaiting_verification") {
116477
+ await landingClient.createInboxItem(projectSlug, {
116478
+ id: `II-local-review-${runId}`,
116479
+ kind: "info",
116480
+ taskId: task.id,
116481
+ body: `${task.id} (${task.title}) \u2014 the change is built and checked on branch mrrlin/run-${runId}. It lands on ${input.defaultBranch} only after you accept it: open the task and choose Accept or Request changes.`
116482
+ }).catch(() => {
116483
+ });
116484
+ }
116485
+ return;
116486
+ }
116437
116487
  const locksDir = deps.locksDir ?? "/tmp/mrrlin-locks";
116438
116488
  const headSha = verifiedSettlement ? verifiedSettlement.git.head_oid : outcome.evidence.headSha;
116439
116489
  const expectedOldSha = verifiedSettlement ? verifiedSettlement.git.base_oid : input.integration ? input.integration.defaultTipSha : void 0;
@@ -125187,6 +125237,14 @@ function toDeclinedProposalContext(proposals) {
125187
125237
  };
125188
125238
  });
125189
125239
  }
125240
+ function resolveOperatorTimeZone() {
125241
+ try {
125242
+ const zone = Intl.DateTimeFormat().resolvedOptions().timeZone;
125243
+ return typeof zone === "string" && zone.trim() ? zone.trim() : null;
125244
+ } catch {
125245
+ return null;
125246
+ }
125247
+ }
125190
125248
  var COMPACT_REQUEST_HISTORY_MAX_ITEMS = 500;
125191
125249
  function isValidChatHistoryMessage(value) {
125192
125250
  if (!value || typeof value !== "object") return false;
@@ -125374,11 +125432,13 @@ function buildThreadStartParams(msg, config2, desiredModel) {
125374
125432
  "- QUESTION LIFECYCLE: every question you asked must end in exactly one state \u2014 answered by the operator, assumed (you state the default you took), or blocker (you state what it blocks). The open-question list in the turn context is authoritative: resolve each item explicitly and never drop one silently.",
125375
125433
  "Core guards:",
125376
125434
  "- Never claim a deliverable, file, test result, or running execution exists unless a tool actually produced it. Never claim autopilot is running unless an execution run is active; for a human_review task say it waits in To Do for your approval.",
125435
+ // Dogfood R2-10: GT-2's journal said all 24 spec checks ran and passed; the Director said it had not run them.
125436
+ "- Report a task's checks from its record (get_task journalMarkdown, run artifacts): if they say checks ran, report that and the result; never call them not run because you did not run them in this chat.",
125377
125437
  "- Mention a GT- or WK- id only if a tool returned it in this conversation (server-authoritative receipts).",
125378
125438
  "- Reply in the operator's language for the whole turn (questions, task scopes, summaries).",
125379
125439
  "- Keep chat short and human. No code blocks, DDL, terminal output, local filesystem paths, internal job/inbox UUIDs or alert markers in chat \u2014 put long content into a wiki page and link it.",
125380
125440
  "- Spec pages in folder Specs must contain `## Acceptance criteria` followed by `- [ ]` items.",
125381
- "- AGNOSTIC DELIVERY MANDATE: Mrrlin is an Agnostic Delivery Platform decoupled from mandatory GitHub. Delivery is routed strictly by artifact kind: (1) document -> wiki; (2) page -> publish (web pages, landing pages, interactive HTML previews); (3) file_set -> artifacts (file uploads, bundles, build zips); (4) message -> send (outbound webhooks, Slack, notifications); (5) code_change -> repo_host (no host: local repo; register_local_checkout w/o repo; init_local_repo after a yes; a done local run lands on main by itself, apply_local_run retries, get_execution_run's localLanding says if it landed; NEVER edit or commit code yourself, only a code run does). NEVER stall or refuse non-code tasks by demanding a Git repository. Non-code tasks deliver directly via page (Publish) or document (Wiki). A page goes live only via a publish route, and a new project has none until the operator adds a publisher on the Integrations page: never promise or give a live link until publishing has produced one.",
125441
+ "- AGNOSTIC DELIVERY MANDATE: Mrrlin is an Agnostic Delivery Platform decoupled from mandatory GitHub. Delivery is routed strictly by artifact kind: (1) document -> wiki; (2) page -> publish (web pages, landing pages, interactive HTML previews); (3) file_set -> artifacts (file uploads, bundles, build zips); (4) message -> send (outbound webhooks, Slack, notifications); (5) code_change -> repo_host (no host: local repo; register_local_checkout w/o repo; init_local_repo after a yes; a done local run lands on main (human_review: after Accept), apply_local_run retries, get_execution_run's localLanding says if it landed; NEVER edit or commit code yourself, only a code run does). NEVER stall or refuse non-code tasks by demanding a Git repository. Non-code tasks deliver directly via page (Publish) or document (Wiki). A page goes live only via a publish route, and a new project has none until the operator adds a publisher on the Integrations page: never promise or give a live link until publishing has produced one.",
125382
125442
  // Dogfood N28: a free-text "update the bridge" got an improvised install and a promised restart.
125383
125443
  "- BRIDGE UPDATE: to update the Mrrlin bridge run `npm install -g @mrrlin-dev/mcp@latest && mrrlin-mcp configure bridge && mrrlin-mcp restart-service`, then say in plain words what it reported. You run inside that bridge, so it cannot restart during your reply: never say it restarted, never promise a time, never run `pm2 restart` yourself.",
125384
125444
  "- 3-TIER COMMERCIAL SCOPE GOVERNANCE: Treat tasks by domain governance tier. (1) Tier 1 Core Tech Delivery (backend, frontend, SRE, databases): decompose autonomously into repository code changes (when a repo is bound) or code artifacts. (2) Tier 2 Planning & Content (landing pages, SEO, marketing): create actionable drafts; when details such as a phone number, brand name or copy are missing, do not loop on questions \u2014 create the task, record `## Placeholders: [NEED_INPUT: <item>]` in the Wiki spec, and set `autonomyLevel: 'human_review'`. (3) Tier 3 Guardrailed Advisory (high risk: privacy/GDPR, security/SOC 2, billing, production database migrations, infrastructure): always set `autonomyLevel: 'human_review'`, put the domain's standard safety controls into the spec, and state that irreversible actions need human sign-off.",
@@ -125786,19 +125846,17 @@ function buildThreadStartParams(msg, config2, desiredModel) {
125786
125846
  " or they explicitly ask to set up the project), OR when a request clearly needs missing",
125787
125847
  " project context \u2014 in which case OFFER to onboard once. Do NOT turn every turn on an",
125788
125848
  " un-onboarded project into an interrogation.",
125789
- "- Gather context by asking a focused set of high-value questions: what the project/product",
125790
- " is; primary goal/outcome; domain or URL; target audience; key constraints; how success is",
125791
- " measured; current state. Ask ~5-7 \u2014 gather, don't interrogate.",
125849
+ // Dogfood R2-15: setup ran one question per turn (~6 round-trips) while the goal sat unplanned.
125850
+ "- Ask every setup question still needed in ONE message, numbered, each with a default the operator",
125851
+ ' can accept with "ok" \u2014 never one per turn. Skip what their messages or project state already answer.',
125852
+ " Setup never blocks stated work: if they said what they want, start on it in the same turn.",
125853
+ ' "None yet", "local only" or "skip" is a complete answer: record it, never list it as open again.',
125792
125854
  `- Write the answers into a wiki page at path \`${PROJECT_CONSTITUTION_PAGE.path}\` (folder`,
125793
125855
  ` \`${PROJECT_CONSTITUTION_PAGE.folder}\`, title \`${PROJECT_CONSTITUTION_PAGE.title}\`) via`,
125794
125856
  " `create_wiki_page` if it does not exist yet, else `update_wiki_page` \u2014 never create a",
125795
- " duplicate. Seed it once you have a meaningful answer or two, then keep extending it.",
125796
- "- These onboarding questions are ordinary TASKLESS `question` inbox items: follow the",
125797
- " clarifying-question contract above \u2014 when answered, write it into the constitution page AND",
125798
- ' close the item with `decide_inbox_item` `verdict="acknowledged"` + `answer`; `reject` (with',
125799
- " a reason) any that become moot. Never leave stale pending onboarding questions.",
125800
- "- v1 captures the domain as prose in the constitution page (no structured domain field, no",
125801
- " web research) \u2014 just record what the operator tells you."
125857
+ " duplicate. It is project memory, not a spec: never list it among the specs.",
125858
+ "- An empty `list_project_members` means the owner works alone: the owner is always a member.",
125859
+ " If an onboarding question was banked in the Inbox, close it with `decide_inbox_item` once answered."
125802
125860
  ].join("\n");
125803
125861
  return {
125804
125862
  // No project checkout for this turn → run in a dedicated EMPTY scratch dir, never the bridge's own
@@ -126069,6 +126127,15 @@ async function recoverSingleLanding(client, checkoutPath, projectSlug, runId, re
126069
126127
  });
126070
126128
  return success2;
126071
126129
  }
126130
+ async function landingAuthorized(client, projectSlug, runId, receiptId) {
126131
+ try {
126132
+ const run5 = await client.getExecutionRun(projectSlug, runId);
126133
+ const task = await client.getTask(projectSlug, run5.taskId);
126134
+ return task.status === "closed_done" && (task.terminalReceiptId == null || task.terminalReceiptId === receiptId);
126135
+ } catch {
126136
+ return false;
126137
+ }
126138
+ }
126072
126139
  async function recoverPendingSettlementJournals(client, opts) {
126073
126140
  const stateDir = resolveStateDir(process.env);
126074
126141
  const pendingJournals = listPendingSettlementJournalsSync(stateDir);
@@ -126084,6 +126151,7 @@ async function recoverPendingSettlementJournals(client, opts) {
126084
126151
  }
126085
126152
  }
126086
126153
  if (!journal.receipt) continue;
126154
+ if (!await landingAuthorized(client, journal.projectSlug, journal.runId, journal.receipt.receiptId)) continue;
126087
126155
  try {
126088
126156
  await recoverSingleLanding(
126089
126157
  client,
@@ -126115,6 +126183,7 @@ async function recoverPendingSettlementJournals(client, opts) {
126115
126183
  if (!lookup || !("data" in lookup) || !("receipt" in lookup.data)) continue;
126116
126184
  const settlement = lookup.data;
126117
126185
  const journal = journals.find((j) => j.receipt?.receiptId === settlement.receipt.receiptId);
126186
+ if (!await landingAuthorized(client, project.slug, landing.runId, settlement.receipt.receiptId)) continue;
126118
126187
  try {
126119
126188
  await recoverSingleLanding(
126120
126189
  client,
@@ -127241,6 +127310,7 @@ function createBridgeMessageHandler(deps) {
127241
127310
  answeredQuestions,
127242
127311
  declinedProposals,
127243
127312
  openQuestions: presentedLedger.shown.length ? presentedLedger.shown : void 0,
127313
+ operatorTimeZone: resolveOperatorTimeZone() ?? void 0,
127244
127314
  clarifications: msg.context?.clarifications ?? (presentedLedger.shown.some((i) => i.id) ? presentedLedger.shown.map(({ id, round, ordinal, question, status, answer, actor }) => ({
127245
127315
  id,
127246
127316
  round,
@@ -129321,7 +129391,13 @@ function renderContextPrefix(context) {
129321
129391
  }
129322
129392
  if (openQuestions && !context?.clarifications?.length) {
129323
129393
  parts.push(
129324
- "[OPEN QUESTIONS] `openQuestions` lists questions you asked earlier in this chat. For each one, state in this reply whether it is answered (by the operator), assumed (say the default you took) or a blocker (say what it blocks). Do not ask it again unless the answer would change the architecture or the deliverable."
129394
+ '[OPEN QUESTIONS] `openQuestions` lists questions you asked earlier in this chat. For each one with status `open` or `reasked`, state in this reply whether it is answered (by the operator), assumed (say the default you took) or a blocker (say what it blocks). Any reply that settles it counts as an answer, including "none yet", "not now", "local only" or "skip" -- say it is answered. Do not mention items with any other status again: they are closed. Do not ask a question again unless the answer would change the architecture or the deliverable.'
129395
+ );
129396
+ }
129397
+ const operatorTimeZone = context?.operatorTimeZone?.trim();
129398
+ if (operatorTimeZone) {
129399
+ parts.push(
129400
+ `[LOCAL TIME] The operator's time zone is ${operatorTimeZone}. Tool timestamps are UTC: convert any clock time to this zone before you state it, or say how long ago it was. Never quote a raw UTC clock time.`
129325
129401
  );
129326
129402
  }
129327
129403
  return parts.join("\n\n");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrrlin-dev/mcp",
3
- "version": "0.4.270",
3
+ "version": "0.4.273",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "mrrlin-mcp": "dist/bin.cjs"