refactor: trim gateway tail type exports

This commit is contained in:
Peter Steinberger
2026-05-01 23:09:28 +01:00
parent bac552faf7
commit 13d1983ec7
6 changed files with 12 additions and 16 deletions

View File

@@ -18,14 +18,14 @@ export type GatewaySessionsDefaults = {
thinkingDefault?: string;
};
export type GatewayThinkingLevelOption = {
type GatewayThinkingLevelOption = {
id: string;
label: string;
};
export type SessionRunStatus = "running" | "done" | "failed" | "killed" | "timeout";
export type SubagentRunState = "active" | "interrupted" | "historical";
type SubagentRunState = "active" | "interrupted" | "historical";
export type GatewaySessionRow = {
key: string;

View File

@@ -1,6 +1,6 @@
import { formatErrorMessage } from "../infra/errors.js";
export type StartupTaskResult =
type StartupTaskResult =
| { status: "skipped"; reason: string }
| { status: "ran" }
| { status: "failed"; reason: string };
@@ -13,7 +13,7 @@ export type StartupTask = {
run: () => Promise<StartupTaskResult>;
};
export type StartupTaskLogger = {
type StartupTaskLogger = {
debug: (message: string, meta?: Record<string, unknown>) => void;
warn: (message: string, meta?: Record<string, unknown>) => void;
};

View File

@@ -18,7 +18,7 @@ const MAX_RELAY_SESSIONS_PER_CONN = 2;
const MAX_RELAY_SESSIONS_GLOBAL = 64;
const RELAY_EVENT = "talk.realtime.relay";
export type TalkRealtimeRelayEvent =
type TalkRealtimeRelayEvent =
| { relaySessionId: string; type: "ready" }
| { relaySessionId: string; type: "audio"; audioBase64: string }
| { relaySessionId: string; type: "clear" }
@@ -50,7 +50,7 @@ type RelaySession = {
cleanupTimer: ReturnType<typeof setTimeout>;
};
export type CreateTalkRealtimeRelaySessionParams = {
type CreateTalkRealtimeRelaySessionParams = {
context: GatewayRequestContext;
connId: string;
provider: RealtimeVoiceProviderPlugin;
@@ -61,7 +61,7 @@ export type CreateTalkRealtimeRelaySessionParams = {
voice?: string;
};
export type TalkRealtimeRelaySessionResult = {
type TalkRealtimeRelaySessionResult = {
provider: string;
transport: "gateway-relay";
relaySessionId: string;

View File

@@ -2,8 +2,8 @@ import { afterAll, beforeAll, beforeEach } from "vitest";
import { connectOk, startServerWithClient, testState } from "./test-helpers.js";
type StartServerWithClient = typeof startServerWithClient;
export type GatewayWs = Awaited<ReturnType<StartServerWithClient>>["ws"];
export type GatewayServer = Awaited<ReturnType<StartServerWithClient>>["server"];
type GatewayWs = Awaited<ReturnType<StartServerWithClient>>["ws"];
type GatewayServer = Awaited<ReturnType<StartServerWithClient>>["server"];
export async function withServer<T>(run: (ws: GatewayWs) => Promise<T>): Promise<T> {
const { server, ws, envSnapshot } = await startServerWithClient("secret");

View File

@@ -24,7 +24,7 @@ import { logWarn } from "../logger.js";
import { getPluginToolMeta } from "../plugins/tools.js";
import { DEFAULT_GATEWAY_HTTP_TOOL_DENY } from "../security/dangerous-tools.js";
export type GatewayScopedToolSurface = "http" | "loopback";
type GatewayScopedToolSurface = "http" | "loopback";
export function resolveGatewayScopedTools(params: {
cfg: OpenClawConfig;

View File

@@ -30,13 +30,9 @@ export type ToolsInvokeInput = {
dryRun?: unknown;
};
export type ToolsInvokeErrorType =
| "invalid_request"
| "not_found"
| "tool_call_blocked"
| "tool_error";
type ToolsInvokeErrorType = "invalid_request" | "not_found" | "tool_call_blocked" | "tool_error";
export type ToolsInvokeOutcome =
type ToolsInvokeOutcome =
| {
ok: true;
status: 200;