refactor: trim gateway tail type exports · openclaw/openclaw@13d1983
steipete
·
2026-05-02
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -18,14 +18,14 @@ export type GatewaySessionsDefaults = {
|
18 | 18 | thinkingDefault?: string; |
19 | 19 | }; |
20 | 20 | |
21 | | -export type GatewayThinkingLevelOption = { |
| 21 | +type GatewayThinkingLevelOption = { |
22 | 22 | id: string; |
23 | 23 | label: string; |
24 | 24 | }; |
25 | 25 | |
26 | 26 | export type SessionRunStatus = "running" | "done" | "failed" | "killed" | "timeout"; |
27 | 27 | |
28 | | -export type SubagentRunState = "active" | "interrupted" | "historical"; |
| 28 | +type SubagentRunState = "active" | "interrupted" | "historical"; |
29 | 29 | |
30 | 30 | export type GatewaySessionRow = { |
31 | 31 | key: string; |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import { formatErrorMessage } from "../infra/errors.js"; |
2 | 2 | |
3 | | -export type StartupTaskResult = |
| 3 | +type StartupTaskResult = |
4 | 4 | | { status: "skipped"; reason: string } |
5 | 5 | | { status: "ran" } |
6 | 6 | | { status: "failed"; reason: string }; |
@@ -13,7 +13,7 @@ export type StartupTask = {
|
13 | 13 | run: () => Promise<StartupTaskResult>; |
14 | 14 | }; |
15 | 15 | |
16 | | -export type StartupTaskLogger = { |
| 16 | +type StartupTaskLogger = { |
17 | 17 | debug: (message: string, meta?: Record<string, unknown>) => void; |
18 | 18 | warn: (message: string, meta?: Record<string, unknown>) => void; |
19 | 19 | }; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -18,7 +18,7 @@ const MAX_RELAY_SESSIONS_PER_CONN = 2;
|
18 | 18 | const MAX_RELAY_SESSIONS_GLOBAL = 64; |
19 | 19 | const RELAY_EVENT = "talk.realtime.relay"; |
20 | 20 | |
21 | | -export type TalkRealtimeRelayEvent = |
| 21 | +type TalkRealtimeRelayEvent = |
22 | 22 | | { relaySessionId: string; type: "ready" } |
23 | 23 | | { relaySessionId: string; type: "audio"; audioBase64: string } |
24 | 24 | | { relaySessionId: string; type: "clear" } |
@@ -50,7 +50,7 @@ type RelaySession = {
|
50 | 50 | cleanupTimer: ReturnType<typeof setTimeout>; |
51 | 51 | }; |
52 | 52 | |
53 | | -export type CreateTalkRealtimeRelaySessionParams = { |
| 53 | +type CreateTalkRealtimeRelaySessionParams = { |
54 | 54 | context: GatewayRequestContext; |
55 | 55 | connId: string; |
56 | 56 | provider: RealtimeVoiceProviderPlugin; |
@@ -61,7 +61,7 @@ export type CreateTalkRealtimeRelaySessionParams = {
|
61 | 61 | voice?: string; |
62 | 62 | }; |
63 | 63 | |
64 | | -export type TalkRealtimeRelaySessionResult = { |
| 64 | +type TalkRealtimeRelaySessionResult = { |
65 | 65 | provider: string; |
66 | 66 | transport: "gateway-relay"; |
67 | 67 | relaySessionId: string; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -2,8 +2,8 @@ import { afterAll, beforeAll, beforeEach } from "vitest";
|
2 | 2 | import { connectOk, startServerWithClient, testState } from "./test-helpers.js"; |
3 | 3 | |
4 | 4 | type StartServerWithClient = typeof startServerWithClient; |
5 | | -export type GatewayWs = Awaited<ReturnType<StartServerWithClient>>["ws"]; |
6 | | -export type GatewayServer = Awaited<ReturnType<StartServerWithClient>>["server"]; |
| 5 | +type GatewayWs = Awaited<ReturnType<StartServerWithClient>>["ws"]; |
| 6 | +type GatewayServer = Awaited<ReturnType<StartServerWithClient>>["server"]; |
7 | 7 | |
8 | 8 | export async function withServer<T>(run: (ws: GatewayWs) => Promise<T>): Promise<T> { |
9 | 9 | const { server, ws, envSnapshot } = await startServerWithClient("secret"); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -24,7 +24,7 @@ import { logWarn } from "../logger.js";
|
24 | 24 | import { getPluginToolMeta } from "../plugins/tools.js"; |
25 | 25 | import { DEFAULT_GATEWAY_HTTP_TOOL_DENY } from "../security/dangerous-tools.js"; |
26 | 26 | |
27 | | -export type GatewayScopedToolSurface = "http" | "loopback"; |
| 27 | +type GatewayScopedToolSurface = "http" | "loopback"; |
28 | 28 | |
29 | 29 | export function resolveGatewayScopedTools(params: { |
30 | 30 | cfg: OpenClawConfig; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -30,13 +30,9 @@ export type ToolsInvokeInput = {
|
30 | 30 | dryRun?: unknown; |
31 | 31 | }; |
32 | 32 | |
33 | | -export type ToolsInvokeErrorType = |
34 | | -| "invalid_request" |
35 | | -| "not_found" |
36 | | -| "tool_call_blocked" |
37 | | -| "tool_error"; |
| 33 | +type ToolsInvokeErrorType = "invalid_request" | "not_found" | "tool_call_blocked" | "tool_error"; |
38 | 34 | |
39 | | -export type ToolsInvokeOutcome = |
| 35 | +type ToolsInvokeOutcome = |
40 | 36 | | { |
41 | 37 | ok: true; |
42 | 38 | status: 200; |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。