@mrrlin-dev/mcp 0.4.104 → 0.4.106
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.
- package/dist/bin.cjs +40 -25
- package/package.json +1 -1
package/dist/bin.cjs
CHANGED
|
@@ -42283,7 +42283,8 @@ function normalizeDomains(value) {
|
|
|
42283
42283
|
return normalized.length > 0 ? normalized.sort() : [DEFAULT_DOMAIN];
|
|
42284
42284
|
}
|
|
42285
42285
|
function normalizeDomain(value) {
|
|
42286
|
-
|
|
42286
|
+
const domains = normalizeDomains(value);
|
|
42287
|
+
return domains[0] ?? DEFAULT_DOMAIN;
|
|
42287
42288
|
}
|
|
42288
42289
|
function normalizeImpact(value) {
|
|
42289
42290
|
if (typeof value !== "string") return null;
|
|
@@ -42313,8 +42314,9 @@ var PERSONAS_BY_DOMAIN = {
|
|
|
42313
42314
|
function resolveProducerPersona(domain2) {
|
|
42314
42315
|
const domains = normalizeDomains(domain2);
|
|
42315
42316
|
for (const d of domains) {
|
|
42316
|
-
|
|
42317
|
-
|
|
42317
|
+
const persona = PERSONAS_BY_DOMAIN[d];
|
|
42318
|
+
if (d !== "code" && persona) {
|
|
42319
|
+
return persona;
|
|
42318
42320
|
}
|
|
42319
42321
|
}
|
|
42320
42322
|
return null;
|
|
@@ -44345,6 +44347,11 @@ var import_promises4 = require("node:timers/promises");
|
|
|
44345
44347
|
var MODEL_ID_REGEX = /^[a-zA-Z0-9][a-zA-Z0-9._-]{1,63}$/;
|
|
44346
44348
|
var CONVERSATION_ID_REGEX = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;
|
|
44347
44349
|
var activeProcesses = /* @__PURE__ */ new Set();
|
|
44350
|
+
function signalStartedChild(child, signal) {
|
|
44351
|
+
if (child.pid === void 0 || child.pid <= 0)
|
|
44352
|
+
return;
|
|
44353
|
+
child.kill(signal);
|
|
44354
|
+
}
|
|
44348
44355
|
var globalCleanupInstalled = false;
|
|
44349
44356
|
function installGlobalCleanupOnce() {
|
|
44350
44357
|
if (globalCleanupInstalled)
|
|
@@ -44353,7 +44360,7 @@ function installGlobalCleanupOnce() {
|
|
|
44353
44360
|
process.once("exit", () => {
|
|
44354
44361
|
for (const child of activeProcesses) {
|
|
44355
44362
|
try {
|
|
44356
|
-
child
|
|
44363
|
+
signalStartedChild(child, "SIGKILL");
|
|
44357
44364
|
} catch {
|
|
44358
44365
|
}
|
|
44359
44366
|
}
|
|
@@ -44361,14 +44368,14 @@ function installGlobalCleanupOnce() {
|
|
|
44361
44368
|
const sigHandler = async () => {
|
|
44362
44369
|
for (const child of activeProcesses) {
|
|
44363
44370
|
try {
|
|
44364
|
-
child
|
|
44371
|
+
signalStartedChild(child, "SIGTERM");
|
|
44365
44372
|
} catch {
|
|
44366
44373
|
}
|
|
44367
44374
|
}
|
|
44368
44375
|
await (0, import_promises4.setTimeout)(1e3);
|
|
44369
44376
|
for (const child of activeProcesses) {
|
|
44370
44377
|
try {
|
|
44371
|
-
child
|
|
44378
|
+
signalStartedChild(child, "SIGKILL");
|
|
44372
44379
|
} catch {
|
|
44373
44380
|
}
|
|
44374
44381
|
}
|
|
@@ -44499,11 +44506,11 @@ var AgyProcess = class _AgyProcess {
|
|
|
44499
44506
|
return () => this.exitHandlers.delete(handler);
|
|
44500
44507
|
}
|
|
44501
44508
|
async dispose() {
|
|
44502
|
-
if (this.exited || this.child.killed) {
|
|
44509
|
+
if (this.exited || this.child.killed || this.child.pid === void 0 || this.child.pid <= 0) {
|
|
44503
44510
|
activeProcesses.delete(this.child);
|
|
44504
44511
|
return;
|
|
44505
44512
|
}
|
|
44506
|
-
this.child
|
|
44513
|
+
signalStartedChild(this.child, "SIGTERM");
|
|
44507
44514
|
try {
|
|
44508
44515
|
await Promise.race([
|
|
44509
44516
|
(0, import_node_events2.once)(this.child, "exit"),
|
|
@@ -44513,7 +44520,7 @@ var AgyProcess = class _AgyProcess {
|
|
|
44513
44520
|
}
|
|
44514
44521
|
if (!this.exited) {
|
|
44515
44522
|
try {
|
|
44516
|
-
this.child
|
|
44523
|
+
signalStartedChild(this.child, "SIGKILL");
|
|
44517
44524
|
} catch {
|
|
44518
44525
|
}
|
|
44519
44526
|
}
|
|
@@ -45295,7 +45302,7 @@ function extractOneShotResult2(stdout) {
|
|
|
45295
45302
|
} catch {
|
|
45296
45303
|
return { ok: false, error: "agy exec produced no parseable JSON output" };
|
|
45297
45304
|
}
|
|
45298
|
-
if (parsed.status !== "SUCCESS" || typeof parsed.response !== "string") {
|
|
45305
|
+
if (!parsed || parsed.status !== "SUCCESS" || typeof parsed.response !== "string") {
|
|
45299
45306
|
return { ok: false, error: `agy exec failed or returned invalid response format: ${JSON.stringify(parsed)}` };
|
|
45300
45307
|
}
|
|
45301
45308
|
return {
|
|
@@ -45486,19 +45493,22 @@ async function resolveSpecDomains(client, projectSlug, page) {
|
|
|
45486
45493
|
const taskId = await resolveGatedTaskId(client, projectSlug, page);
|
|
45487
45494
|
if (taskId !== null) {
|
|
45488
45495
|
const task = await client.getTask(projectSlug, taskId);
|
|
45489
|
-
|
|
45496
|
+
const taskRecord = task;
|
|
45497
|
+
return normalizeDomainArray(taskRecord?.domains ?? taskRecord?.domain);
|
|
45490
45498
|
}
|
|
45491
45499
|
const plans = await client.listPlans(projectSlug);
|
|
45492
45500
|
const plan = plans.find((p) => p.specWikiPageId === page.id);
|
|
45493
45501
|
if (plan) {
|
|
45494
|
-
const
|
|
45502
|
+
const planRecord = plan;
|
|
45503
|
+
const rawPlanDomains = planRecord?.domains ?? planRecord?.domain;
|
|
45495
45504
|
const substantivePlanDomains = (Array.isArray(rawPlanDomains) ? rawPlanDomains : rawPlanDomains != null ? [rawPlanDomains] : []).map(String).map((d) => d.trim().toLowerCase()).filter(Boolean);
|
|
45496
45505
|
if (substantivePlanDomains.length > 0) {
|
|
45497
45506
|
return normalizeDomainArray(substantivePlanDomains);
|
|
45498
45507
|
}
|
|
45499
45508
|
}
|
|
45500
45509
|
const project = await client.getProject(projectSlug);
|
|
45501
|
-
|
|
45510
|
+
const projectRecord = project;
|
|
45511
|
+
return normalizeDomainArray(projectRecord?.defaultDomains ?? projectRecord?.defaultDomain);
|
|
45502
45512
|
} catch {
|
|
45503
45513
|
return ["code"];
|
|
45504
45514
|
}
|
|
@@ -45914,14 +45924,16 @@ function buildSpecGateDeps(args) {
|
|
|
45914
45924
|
const plan = plans.find((p) => p.specWikiPageId === specPageId);
|
|
45915
45925
|
if (plan) {
|
|
45916
45926
|
const project2 = await client.getProject(projectSlug);
|
|
45917
|
-
const
|
|
45927
|
+
const planRecord = plan;
|
|
45928
|
+
const projectRecord = project2;
|
|
45929
|
+
const rawPlanDomains = planRecord.domains ?? planRecord.domain;
|
|
45918
45930
|
const substantivePlanDomains = (Array.isArray(rawPlanDomains) ? rawPlanDomains : rawPlanDomains != null ? [rawPlanDomains] : []).map(String).map((d) => d.trim().toLowerCase()).filter(Boolean);
|
|
45919
|
-
const planDomains = substantivePlanDomains.length > 0 ? substantivePlanDomains :
|
|
45931
|
+
const planDomains = substantivePlanDomains.length > 0 ? substantivePlanDomains : projectRecord?.defaultDomains ?? (projectRecord?.defaultDomain ? [projectRecord.defaultDomain] : void 0);
|
|
45920
45932
|
return {
|
|
45921
45933
|
taskId: null,
|
|
45922
45934
|
planId: plan.id,
|
|
45923
45935
|
seed: null,
|
|
45924
|
-
title:
|
|
45936
|
+
title: planRecord.title ?? plan.name ?? null,
|
|
45925
45937
|
domains: planDomains,
|
|
45926
45938
|
notes: null
|
|
45927
45939
|
};
|
|
@@ -46300,7 +46312,8 @@ async function buildDeliverableGateDeps(args) {
|
|
|
46300
46312
|
let criteria = [];
|
|
46301
46313
|
if (taskId) {
|
|
46302
46314
|
const task = await client.getTask(projectSlug, taskId);
|
|
46303
|
-
|
|
46315
|
+
const taskRecord = task;
|
|
46316
|
+
domain2 = normalizeDomain(taskRecord?.domains ?? taskRecord?.domain);
|
|
46304
46317
|
impact = task?.impact;
|
|
46305
46318
|
taskTitle = task?.title ?? "";
|
|
46306
46319
|
if (task?.specWikiPageId) {
|
|
@@ -53478,7 +53491,8 @@ async function handleConsensusBlocked(result, ctx, input, resolvedTaskId) {
|
|
|
53478
53491
|
...groupId ? { groupId } : {}
|
|
53479
53492
|
});
|
|
53480
53493
|
} catch (err) {
|
|
53481
|
-
const
|
|
53494
|
+
const errObj = err;
|
|
53495
|
+
const isConflict = errObj?.status === 409 || errObj?.statusCode === 409 || errObj?.code === "23505" || String(errObj?.message ?? "").includes("already exists") || String(errObj?.message ?? "").includes("duplicate key");
|
|
53482
53496
|
if (!isConflict) {
|
|
53483
53497
|
throw err;
|
|
53484
53498
|
}
|
|
@@ -53502,7 +53516,8 @@ async function handleConsensusBlocked(result, ctx, input, resolvedTaskId) {
|
|
|
53502
53516
|
...groupId ? { groupId } : {}
|
|
53503
53517
|
});
|
|
53504
53518
|
} catch (err) {
|
|
53505
|
-
const
|
|
53519
|
+
const errObj = err;
|
|
53520
|
+
const isConflict = errObj?.status === 409 || errObj?.statusCode === 409 || errObj?.code === "23505" || String(errObj?.message ?? "").includes("already exists") || String(errObj?.message ?? "").includes("duplicate key");
|
|
53506
53521
|
if (!isConflict) {
|
|
53507
53522
|
throw err;
|
|
53508
53523
|
}
|
|
@@ -59530,7 +59545,7 @@ Do NOT derail the current task - if the operator has an in-flight question, answ
|
|
|
59530
59545
|
}
|
|
59531
59546
|
|
|
59532
59547
|
// src/_generated/version.ts
|
|
59533
|
-
var PKG_VERSION = "0.4.
|
|
59548
|
+
var PKG_VERSION = "0.4.106";
|
|
59534
59549
|
|
|
59535
59550
|
// src/director-closure.ts
|
|
59536
59551
|
var CLOSURE_SNAPSHOT_TIMEOUT_MS = 2e3;
|
|
@@ -61481,7 +61496,7 @@ async function uploadPendingDays(stateDir, client, bridgeHealth, gateCtx) {
|
|
|
61481
61496
|
...gateCalls.length > 0 ? { gateCalls } : {}
|
|
61482
61497
|
};
|
|
61483
61498
|
const gateResult = await gate(batch, [], gateCtx);
|
|
61484
|
-
const
|
|
61499
|
+
const _gateMarker = gateResult.gated ? "gated" : "projection-only";
|
|
61485
61500
|
if (cur.projectSlug === "_unattributed") {
|
|
61486
61501
|
await client.postOperatorTelemetry(gateResult.artifact);
|
|
61487
61502
|
} else {
|
|
@@ -64105,7 +64120,7 @@ ${renderTaskStateSection(taskState)}`;
|
|
|
64105
64120
|
}
|
|
64106
64121
|
}
|
|
64107
64122
|
const removeWtFn = deps.removeRunWorktree ?? removeRunWorktree;
|
|
64108
|
-
const
|
|
64123
|
+
const _pushFn = deps.pushRunBranch ?? pushRunBranch;
|
|
64109
64124
|
try {
|
|
64110
64125
|
const startParams = {
|
|
64111
64126
|
cwd: turnCwd,
|
|
@@ -64366,10 +64381,10 @@ Continue executing task ${task.id}. Make the next concrete increment of progress
|
|
|
64366
64381
|
if (!expectedRepoFullName) {
|
|
64367
64382
|
throw new Error(`push aborted: project ${projectSlug} has no bound GitHub repository`);
|
|
64368
64383
|
}
|
|
64369
|
-
const
|
|
64384
|
+
const pushFn = deps.pushRunBranch ?? pushRunBranch;
|
|
64370
64385
|
const locksDir = deps.locksDir ?? "/tmp/mrrlin-locks";
|
|
64371
64386
|
await withCheckoutLock(locksDir, projectSlug, async () => {
|
|
64372
|
-
await
|
|
64387
|
+
await pushFn({
|
|
64373
64388
|
worktreePath,
|
|
64374
64389
|
locksDir,
|
|
64375
64390
|
slug: projectSlug,
|
|
@@ -73071,7 +73086,7 @@ async function startDirectorBridge() {
|
|
|
73071
73086
|
await tokenRefresher.start();
|
|
73072
73087
|
process.stderr.write("[mrrlin-mcp director-bridge] agent credential active; operator token auto-refresh enabled.\n");
|
|
73073
73088
|
} else {
|
|
73074
|
-
|
|
73089
|
+
const apiToken = envToken ?? readOperatorToken() ?? void 0;
|
|
73075
73090
|
if (envToken) {
|
|
73076
73091
|
try {
|
|
73077
73092
|
persistOperatorToken(envToken);
|