fix: connect L1 Workbench to AgentRun v0.2

This commit is contained in:
root
2026-07-18 04:41:49 +02:00
parent 3bb7b67a4e
commit 3d9c69adaa
10 changed files with 404 additions and 31 deletions
+5 -2
View File
@@ -3,16 +3,19 @@ import path from "node:path";
import { createCloudWorkbenchApplication } from "./cloud-application.ts";
import { createWorkbenchDispatcher } from "./dispatcher.ts";
import { createNativeTestWorkbenchApplication } from "./native-application.ts";
import { createNativeAgentRunWorkbenchApplication } from "./native-agentrun-application.ts";
import { createNativeTestTemporalGateway } from "./native-temporal.ts";
import { createWorkbenchTemporalGateway } from "./temporal.ts";
export function workbenchRuntime(env: Record<string, string | undefined> = process.env) {
const mode = String(env.WORKBENCH_MODE ?? "").trim();
if (mode !== "native-test" && mode !== "temporal") throw codedError("workbench_mode_required", "WORKBENCH_MODE must be native-test or temporal");
if (mode !== "native-test" && mode !== "agentrun-native" && mode !== "temporal") throw codedError("workbench_mode_required", "WORKBENCH_MODE must be native-test, agentrun-native, or temporal");
const stateFile = path.resolve(String(env.WORKBENCH_NATIVE_STATE_FILE ?? ".state/workbench-native/state.json"));
const application = mode === "native-test"
? createNativeTestWorkbenchApplication({ stateFile })
: createCloudWorkbenchApplication({ baseUrl: String(env.WORKBENCH_CLOUD_API_URL ?? ""), authorization: String(env.WORKBENCH_CLOUD_API_AUTHORIZATION ?? "") });
: mode === "agentrun-native"
? createNativeAgentRunWorkbenchApplication({ stateFile, env })
: createCloudWorkbenchApplication({ baseUrl: String(env.WORKBENCH_CLOUD_API_URL ?? ""), authorization: String(env.WORKBENCH_CLOUD_API_AUTHORIZATION ?? "") });
const temporalAddress = String(env.WORKBENCH_TEMPORAL_ADDRESS ?? env.TEMPORAL_ADDRESS ?? "");
const temporalNamespace = String(env.WORKBENCH_TEMPORAL_NAMESPACE ?? "unidesk");
const taskQueue = String(env.WORKBENCH_TEMPORAL_TASK_QUEUE ?? "hwlab-v03-workbench");