@sellable/mcp 0.1.899 → 0.1.900
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.
|
@@ -1155,6 +1155,26 @@ function generatedMessageCountFrom(value) {
|
|
|
1155
1155
|
? count
|
|
1156
1156
|
: null;
|
|
1157
1157
|
}
|
|
1158
|
+
function campaignSettlementIsReady(value) {
|
|
1159
|
+
return (value !== null &&
|
|
1160
|
+
typeof value === "object" &&
|
|
1161
|
+
!Array.isArray(value) &&
|
|
1162
|
+
value.ready === true);
|
|
1163
|
+
}
|
|
1164
|
+
function continuationResultFromAdvance(advanceResult) {
|
|
1165
|
+
if (advanceResult.kind === "advanced") {
|
|
1166
|
+
return { kind: "world_advanced", advanceResult };
|
|
1167
|
+
}
|
|
1168
|
+
if (advanceResult.kind === "run_step_pending") {
|
|
1169
|
+
return { kind: "world_step_pending", advanceResult };
|
|
1170
|
+
}
|
|
1171
|
+
if (advanceResult.kind === "awaiting_external_change" ||
|
|
1172
|
+
advanceResult.kind === "complete" ||
|
|
1173
|
+
advanceResult.kind === "blocked") {
|
|
1174
|
+
return { kind: "world_terminal", advanceResult };
|
|
1175
|
+
}
|
|
1176
|
+
return { kind: "attention_refresh_required", advanceResult };
|
|
1177
|
+
}
|
|
1158
1178
|
/**
|
|
1159
1179
|
* The common refill funnel is mechanical. Keep it out of the model loop.
|
|
1160
1180
|
*
|
|
@@ -1454,6 +1474,31 @@ async function executeRefillV3Continuation(input, dependencies) {
|
|
|
1454
1474
|
};
|
|
1455
1475
|
}
|
|
1456
1476
|
}
|
|
1477
|
+
// RF-HANDOFF-001: a targeted YOLO continuation owns the exact
|
|
1478
|
+
// sender/date/lane/campaign until its settled work is handed back to the
|
|
1479
|
+
// coordinator. Returning at this boundary exposed newly approved,
|
|
1480
|
+
// unassigned rows to the campaign-wide scheduler before the next outer tool
|
|
1481
|
+
// call could run `fill_ready`; another sender could claim the cohort in that
|
|
1482
|
+
// gap. Consume the refreshed run credential here so the next fresh
|
|
1483
|
+
// observation either assigns+schedules the exact lane immediately or
|
|
1484
|
+
// returns its next truthful coordinator state. A guarded/timeout settlement
|
|
1485
|
+
// is deliberately not advanced because its preparation still owns work.
|
|
1486
|
+
if (input.yolo === true &&
|
|
1487
|
+
input.campaignId !== undefined &&
|
|
1488
|
+
(preparationOwnsSettlement || directlyQueuedRowsOwnSettlement) &&
|
|
1489
|
+
campaignSettlementIsReady(settlement)) {
|
|
1490
|
+
const postSettlementAdvance = await reconnectPostAdvanceStage({
|
|
1491
|
+
sleep: dependencies.sleep,
|
|
1492
|
+
operation: () => dependencies.advance({
|
|
1493
|
+
workspaceId,
|
|
1494
|
+
campaignId: input.campaignId,
|
|
1495
|
+
scope: input.scope,
|
|
1496
|
+
yolo: true,
|
|
1497
|
+
runToken,
|
|
1498
|
+
}),
|
|
1499
|
+
});
|
|
1500
|
+
return continuationResultFromAdvance(postSettlementAdvance);
|
|
1501
|
+
}
|
|
1457
1502
|
return {
|
|
1458
1503
|
kind: "campaign_work_completed",
|
|
1459
1504
|
runToken,
|