Step 382: add orchestrator RPC and MCP tools

This commit is contained in:
Bill
2026-02-16 12:47:58 -07:00
parent 5300be080a
commit 448d051077
8 changed files with 703 additions and 2 deletions

View File

@@ -1522,6 +1522,86 @@ private:
};
}
void registerOrchestratorTools() {
// whetstone_orchestrate_step
tools_.push_back({"whetstone_orchestrate_step",
"Advance one ready workflow item through the orchestration loop. "
"Returns one orchestrator event (routed/executed/completed/blocked).",
{{"type", "object"}, {"properties", json::object()}}
});
toolHandlers_["whetstone_orchestrate_step"] =
[this](const json& args) {
return callWhetstone("orchestrateStep", args);
};
// whetstone_orchestrate_advance
tools_.push_back({"whetstone_orchestrate_advance",
"Advance all currently ready workflow items in one batch. "
"Returns event stream and batch counters.",
{{"type", "object"}, {"properties", json::object()}}
});
toolHandlers_["whetstone_orchestrate_advance"] =
[this](const json& args) {
return callWhetstone("orchestrateAdvance", args);
};
// whetstone_orchestrate_run_deterministic
tools_.push_back({"whetstone_orchestrate_run_deterministic",
"Run deterministic/template workflow items to completion. "
"Stops automatically at human or external-model blockers.",
{{"type", "object"}, {"properties", json::object()}}
});
toolHandlers_["whetstone_orchestrate_run_deterministic"] =
[this](const json& args) {
return callWhetstone("orchestrateRunDeterministic", args);
};
// whetstone_get_blockers
tools_.push_back({"whetstone_get_blockers",
"Get current workflow blockers grouped by type: needs-human, "
"needs-review, and needs-external-model.",
{{"type", "object"}, {"properties", json::object()}}
});
toolHandlers_["whetstone_get_blockers"] =
[this](const json& args) {
return callWhetstone("getBlockers", args);
};
// whetstone_get_progress
tools_.push_back({"whetstone_get_progress",
"Get workflow progress snapshot: completion %, throughput, ETA, "
"worker stats, and active blockers.",
{{"type", "object"}, {"properties", json::object()}}
});
toolHandlers_["whetstone_get_progress"] =
[this](const json& args) {
return callWhetstone("getProgress", args);
};
// whetstone_submit_result
tools_.push_back({"whetstone_submit_result",
"Submit external SLM/LLM output for a prepared workflow item. "
"Orchestrator applies review gate and advances lifecycle.",
{{"type", "object"}, {"properties", {
{"itemId", {{"type", "string"},
{"description", "Workflow item ID receiving external output"}}},
{"result", {{"type", "object"}, {"properties", {
{"generatedCode", {{"type", "string"}}},
{"confidence", {{"type", "number"}}},
{"reasoning", {{"type", "string"}}},
{"tokensGenerated", {{"type", "integer"}}},
{"tokensBudget", {{"type", "integer"}}},
{"astJson", {{"type", "object"}}},
{"diagnostics", {{"type", "array"}, {"items", {{"type", "object"}}}}}
}}}}
}}, {"required", json::array({"itemId", "result"})}}
});
toolHandlers_["whetstone_submit_result"] =
[this](const json& args) {
return callWhetstone("submitExternalResult", args);
};
}
void registerReviewTools() {
// whetstone_set_review_policy
tools_.push_back({"whetstone_set_review_policy",
@@ -1566,6 +1646,7 @@ private:
registerWorkflowTools();
registerWorkflowExecutionTools();
registerRoutingTools();
registerOrchestratorTools();
registerReviewTools();
}
};