feat: 拉通 Workbench 纯 Kafka 实时链路

This commit is contained in:
root
2026-07-10 10:22:28 +02:00
parent d5230cb923
commit 8ad5976a07
59 changed files with 4700 additions and 498 deletions
@@ -17,6 +17,7 @@ import { createWorkbenchReadModel } from "./workbench-read-model.ts";
import { createWorkbenchRuntimeClient } from "./workbench-runtime-client.ts";
import { buildWorkbenchSessionDetail, compactLaunchContext, includeMessagesForSessionDetail } from "./workbench-session-detail-response.ts";
import { handleWorkbenchSyncHttp } from "./workbench-realtime-authority.ts";
import { workbenchRealtimeCapabilities } from "./workbench-realtime-capabilities.ts";
import { durableTraceStatus, RUNNING_STATUSES, terminalFinalResponse, TERMINAL_STATUSES } from "./workbench-turn-projection.ts";
import { emitCodeAgentOtelSpan, emitHttpServerRequestSpan } from "./otel-trace.ts";
import * as workbenchFacts from "./server-workbench-facts.ts";
@@ -156,6 +157,19 @@ export async function handleWorkbenchReadModelHttp(request, response, url, optio
if (!auth) return;
if (url.pathname === "/v1/workbench/sync") {
const capabilities = workbenchRealtimeCapabilities(options.env ?? process.env);
if (!capabilities.projectionRealtime) {
sendJson(response, 503, {
ok: false,
error: {
code: "workbench_projection_realtime_disabled",
message: "Workbench projection sync/replay capability is disabled.",
capabilities,
valuesRedacted: true
}
});
return;
}
await (perf ? perf.measure("workbench_sync", () => handleWorkbenchSyncHttp(request, response, url, options, auth.actor)) : handleWorkbenchSyncHttp(request, response, url, options, auth.actor));
return;
}