mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 06:50:43 +00:00
refactor: trim gateway tail type exports
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user