@mrrlin-dev/mcp 0.4.119 → 0.4.121

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 +69 -10
  2. package/package.json +1 -1
package/dist/bin.cjs CHANGED
@@ -37299,6 +37299,21 @@ function describeCapabilityRefusal(input) {
37299
37299
  return `${happened} ${template.action(ctx)}`;
37300
37300
  }
37301
37301
 
37302
+ // ../../packages/schemas/dist/legalVersions.js
37303
+ var recordLegalConsentRequestSchema = external_exports.object({
37304
+ source: external_exports.enum(["director_setup", "login", "onboarding_v2"]).default("director_setup"),
37305
+ termsVersion: external_exports.string().min(1, "termsVersion is required"),
37306
+ privacyVersion: external_exports.string().min(1, "privacyVersion is required")
37307
+ });
37308
+ var legalConsentResponseSchema = external_exports.object({
37309
+ data: external_exports.object({
37310
+ hasConsented: external_exports.boolean(),
37311
+ termsVersion: external_exports.string(),
37312
+ privacyVersion: external_exports.string(),
37313
+ agreedAt: external_exports.string().nullable()
37314
+ })
37315
+ });
37316
+
37302
37317
  // ../../packages/schemas/dist/operationIds.js
37303
37318
  var openApiOperationIds = {
37304
37319
  appendExecutionArtifact: "appendExecutionArtifact",
@@ -37392,6 +37407,8 @@ var openApiOperationIds = {
37392
37407
  issueOperatorAgentCredential: "issueOperatorAgentCredential",
37393
37408
  listOperatorAgentCredentials: "listOperatorAgentCredentials",
37394
37409
  revokeOperatorAgentCredential: "revokeOperatorAgentCredential",
37410
+ recordLegalConsent: "recordLegalConsent",
37411
+ getLegalConsent: "getLegalConsent",
37395
37412
  createArtifactFile: "createArtifactFile",
37396
37413
  completeArtifactFile: "completeArtifactFile",
37397
37414
  getArtifactFile: "getArtifactFile",
@@ -37480,6 +37497,7 @@ var operatorSessionSchema = external_exports.object({
37480
37497
  scope: external_exports.enum(["project", "operator"]).default("project"),
37481
37498
  accountId: external_exports.string().uuid().optional(),
37482
37499
  identitySubject: external_exports.string().min(1).optional(),
37500
+ githubId: external_exports.union([external_exports.number().int(), external_exports.string().min(1)]).optional(),
37483
37501
  purpose: external_exports.enum(["session", "identity_assertion"]).default("session"),
37484
37502
  // Billing entitlement carried on the session. Optional because a GitHub session never has one
37485
37503
  // and a Firebase session has one only once the claims exist. `determinedAt` is what makes it
@@ -41695,6 +41713,18 @@ function createMrrlinClient(config2) {
41695
41713
  method: "DELETE"
41696
41714
  });
41697
41715
  },
41716
+ async recordLegalConsent(input) {
41717
+ const body = await request("/operator/legal-consent", {
41718
+ body: JSON.stringify(input),
41719
+ headers: { "content-type": "application/json" },
41720
+ method: "POST"
41721
+ });
41722
+ return legalConsentResponseSchema.parse(body).data;
41723
+ },
41724
+ async getLegalConsent() {
41725
+ const body = await request("/operator/legal-consent");
41726
+ return legalConsentResponseSchema.parse(body).data;
41727
+ },
41698
41728
  // ── Server-Authoritative Intent Methods ─────────────────────────────────
41699
41729
  async appendOperatorTranscriptMessage(projectSlug, content) {
41700
41730
  const body = await request(`${projectPath(projectSlug)}/intent/transcript`, {
@@ -62072,7 +62102,7 @@ Do NOT derail the current task - if the operator has an in-flight question, answ
62072
62102
  }
62073
62103
 
62074
62104
  // src/_generated/version.ts
62075
- var PKG_VERSION = "0.4.119";
62105
+ var PKG_VERSION = "0.4.121";
62076
62106
 
62077
62107
  // src/receipt-signing.ts
62078
62108
  var import_node_crypto13 = __toESM(require("node:crypto"), 1);
@@ -66072,7 +66102,27 @@ function completionTurnMinBudgetMs() {
66072
66102
  function isCompletionTurnDisabled() {
66073
66103
  return (process.env.MRRLIN_COMPLETION_TURN_DISABLED ?? "").trim() === "1";
66074
66104
  }
66075
- function buildCompletionTurnPrompt(taskId, currentStatus) {
66105
+ function buildCompletionTurnPrompt(taskId, currentStatus, options = {}) {
66106
+ if (options.localGit) {
66107
+ return [
66108
+ `Your work turn ended but task ${taskId} is still in status "${currentStatus}".`,
66109
+ "",
66110
+ "This project's code lives only on the operator's computer; the bridge verifies and closes the task.",
66111
+ "",
66112
+ "If the work IS genuinely complete:",
66113
+ "1. Make sure every change is committed on the current run branch (never push, never touch the default branch).",
66114
+ "2. Update the task notes with a markdown summary of what you accomplished.",
66115
+ "3. Call update_task with status=awaiting_verification (NOT closed_done) \u2014 the bridge then runs the",
66116
+ " build and tests itself and closes the task on a signed receipt.",
66117
+ "",
66118
+ "If the work is NOT complete \u2014 be honest, do not close incomplete work:",
66119
+ "1. If you are blocked and need an operator decision, call update_task with status=handoff_needed and",
66120
+ " explain what remains in the notes.",
66121
+ "2. Append a handoff_judgement artifact explaining what the operator needs to do.",
66122
+ "",
66123
+ "You must pick one of these paths \u2014 do not leave the task in_progress."
66124
+ ].join("\n");
66125
+ }
66076
66126
  return [
66077
66127
  `Your work turn ended but task ${taskId} is still in status "${currentStatus}".`,
66078
66128
  "",
@@ -66290,8 +66340,9 @@ var LOCAL_GIT_EXECUTOR_INSTRUCTIONS = [
66290
66340
  "This project's code lives only in a git repository on the operator's own computer; it has no",
66291
66341
  "remote. Your worktree is on the run branch. Commit your work on THIS branch. Never run `git push`,",
66292
66342
  "never add a remote, never open a pull request, and never switch to or merge into the default branch.",
66293
- "When your turn ends, the bridge itself commits anything left uncommitted, runs the project's build",
66294
- "and tests, and records the result \u2014 you do not need to report a link."
66343
+ "When the work is done, set the task to status awaiting_verification (never closed_done): the bridge",
66344
+ "then commits anything left uncommitted, runs the project's build and tests itself, and closes the",
66345
+ "task on a signed receipt \u2014 you do not need to report a link."
66295
66346
  ].join("\n");
66296
66347
  var EXECUTOR_LOCAL_GIT_BASE_INSTRUCTIONS = `${EXECUTOR_BASE_INSTRUCTIONS}
66297
66348
  ${LOCAL_GIT_EXECUTOR_INSTRUCTIONS}`;
@@ -66313,6 +66364,7 @@ function artifactKindForEvent(event) {
66313
66364
  }
66314
66365
  var COMPLETED_TASK_STATUSES = /* @__PURE__ */ new Set(["closed_done"]);
66315
66366
  var CODE_PR_READY_TASK_STATUSES = /* @__PURE__ */ new Set(["closed_done", "awaiting_verification"]);
66367
+ var LOCAL_GIT_READY_TASK_STATUSES = /* @__PURE__ */ new Set(["awaiting_verification"]);
66316
66368
  var COMPLETION_EVIDENCE_KINDS = /* @__PURE__ */ new Set([
66317
66369
  "checkpoint",
66318
66370
  "test_result",
@@ -66446,7 +66498,7 @@ async function gatherContext(client, projectSlug, task, openRunId, rawProjectInp
66446
66498
  autonomyEvents
66447
66499
  };
66448
66500
  }
66449
- async function assertRunCompletionReady(deps, projectSlug, taskId, runId, allowedStatuses) {
66501
+ async function assertRunCompletionReady(deps, projectSlug, taskId, runId, allowedStatuses, options = {}) {
66450
66502
  const task = await deps.client.getTask(projectSlug, taskId);
66451
66503
  if (!allowedStatuses.has(task.status)) {
66452
66504
  return {
@@ -66455,6 +66507,7 @@ async function assertRunCompletionReady(deps, projectSlug, taskId, runId, allowe
66455
66507
  task
66456
66508
  };
66457
66509
  }
66510
+ if (options.bridgeVerifiesDelivery) return { ok: true, task };
66458
66511
  const runs = await deps.client.listExecutionRuns(projectSlug, { taskId });
66459
66512
  const runIds = new Set(runs.map((run3) => run3.id));
66460
66513
  runIds.add(runId);
@@ -67213,8 +67266,10 @@ Continue executing task ${task.id}. Make the next concrete increment of progress
67213
67266
  );
67214
67267
  return;
67215
67268
  }
67216
- const prReadyStatuses = useExecutor ? CODE_PR_READY_TASK_STATUSES : COMPLETED_TASK_STATUSES;
67217
- let readiness = await assertRunCompletionReady(deps, projectSlug, task.id, runId, prReadyStatuses);
67269
+ const prReadyStatuses = useExecutor ? localGitMode ? LOCAL_GIT_READY_TASK_STATUSES : CODE_PR_READY_TASK_STATUSES : COMPLETED_TASK_STATUSES;
67270
+ let readiness = await assertRunCompletionReady(deps, projectSlug, task.id, runId, prReadyStatuses, {
67271
+ bridgeVerifiesDelivery: useExecutor && localGitMode === true
67272
+ });
67218
67273
  if (!readiness.ok) {
67219
67274
  const completionBudget = Math.min(completionTurnBudgetMs(), remainingTurnBudgetMs());
67220
67275
  if (isCompletionTurnDisabled() || completionBudget < completionTurnMinBudgetMs()) {
@@ -67230,7 +67285,9 @@ Continue executing task ${task.id}. Make the next concrete increment of progress
67230
67285
  previousStatus: readiness.task.status
67231
67286
  })
67232
67287
  );
67233
- const completionPrompt = buildCompletionTurnPrompt(task.id, readiness.task.status);
67288
+ const completionPrompt = buildCompletionTurnPrompt(task.id, readiness.task.status, {
67289
+ localGit: useExecutor && localGitMode === true
67290
+ });
67234
67291
  const completionOutcome = recordTurn2(
67235
67292
  await driveTurn(
67236
67293
  deps,
@@ -67250,7 +67307,9 @@ Continue executing task ${task.id}. Make the next concrete increment of progress
67250
67307
  await failRun(deps, projectSlug, readiness.task, runId, leaseId, completionOutcome.error);
67251
67308
  return;
67252
67309
  }
67253
- readiness = await assertRunCompletionReady(deps, projectSlug, task.id, runId, prReadyStatuses);
67310
+ readiness = await assertRunCompletionReady(deps, projectSlug, task.id, runId, prReadyStatuses, {
67311
+ bridgeVerifiesDelivery: useExecutor && localGitMode === true
67312
+ });
67254
67313
  if (!readiness.ok) {
67255
67314
  await failRun(deps, projectSlug, readiness.task, runId, leaseId, readiness.reason);
67256
67315
  return;
@@ -75099,7 +75158,7 @@ function buildThreadStartParams(msg, config2, desiredModel) {
75099
75158
  "- Reply in the operator's language for the whole turn (questions, task scopes, summaries).",
75100
75159
  "- 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.",
75101
75160
  "- Spec pages in folder Specs must contain `## Acceptance criteria` followed by `- [ ]` items.",
75102
- "- 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 (GitHub; with no GitHub, a local git repo on the operator's computer: register_local_checkout without repo, init_local_repo only after an explicit yes, record their push choice with set_project_code_host). NEVER stall or refuse non-code tasks by demanding a Git repository. Non-code tasks deliver directly via page (Publish) or document (Wiki).",
75161
+ "- 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 (GitHub, or with none a local repo: register_local_checkout without repo; init_local_repo only after a yes; push choice via set_project_code_host; NEVER edit or commit project 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).",
75103
75162
  "- 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.",
75104
75163
  "- INBOX QUESTION RETIREMENT MANDATE \u2014 Retiring answered questions: Before creating a task/plan, retire only pending Inbox questions the operator actually answered. Call `decide_inbox_item(itemId: <exact id>, decidedBy: 'director', verdict: 'acknowledged', answer: <actual answer>)`. Use `verdict: 'rejected', reason: ...` only if moot. Never close an unrelated item.",
75105
75164
  "- CHAT CLARIFICATIONS ARE IN CHAT ONLY: During synchronous interactive Director chat, ask clarifying questions directly in your chat response. DO NOT call `create_inbox_item(kind: 'question')` for routine conversational clarifications in Turn 1 \u2014 Inbox questions are reserved for autonomous background workers or asynchronous gate pauses that occur while the operator is away.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrrlin-dev/mcp",
3
- "version": "0.4.119",
3
+ "version": "0.4.121",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "mrrlin-mcp": "dist/bin.cjs"