Skip to content

Commit 0f7d9c9

Browse files
committed
fix(runtime): split approval and gateway client seams
1 parent 958c34e commit 0f7d9c9

25 files changed

Lines changed: 117 additions & 74 deletions

‎src/acp/server.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import { AgentSideConnection, ndJsonStream } from "@agentclientprotocol/sdk";
55
import { loadConfig } from "../config/config.js";
66
import { resolveGatewayClientBootstrap } from "../gateway/client-bootstrap.js";
77
import { GatewayClient } from "../gateway/client.js";
8+
import { GATEWAY_CLIENT_MODES, GATEWAY_CLIENT_NAMES } from "../gateway/protocol/client-info.js";
89
import { isMainModule } from "../infra/is-main.js";
910
import { normalizeOptionalString } from "../shared/string-coerce.js";
10-
import { GATEWAY_CLIENT_MODES, GATEWAY_CLIENT_NAMES } from "../utils/message-channel.js";
1111
import { readSecretFromFile } from "./secret-file.js";
1212
import { AcpGatewayAgent } from "./translator.js";
1313
import { normalizeAcpProvenanceMode, type AcpServerOptions } from "./types.js";

‎src/agents/tools/gateway.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import {
66
resolveLeastPrivilegeOperatorScopesForMethod,
77
type OperatorScope,
88
} from "../../gateway/method-scopes.js";
9+
import { GATEWAY_CLIENT_MODES, GATEWAY_CLIENT_NAMES } from "../../gateway/protocol/client-info.js";
910
import { formatErrorMessage } from "../../infra/errors.js";
1011
import {
1112
normalizeLowercaseStringOrEmpty,
1213
normalizeOptionalString,
1314
} from "../../shared/string-coerce.js";
14-
import { GATEWAY_CLIENT_MODES, GATEWAY_CLIENT_NAMES } from "../../utils/message-channel.js";
1515
import { readStringParam } from "./common.js";
1616

1717
export const DEFAULT_GATEWAY_URL = "ws://127.0.0.1:18789";

‎src/auto-reply/reply/commands-approve.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import {
33
resolveChannelApprovalCapability,
44
} from "../../channels/plugins/index.js";
55
import { callGateway } from "../../gateway/call.js";
6+
import { GATEWAY_CLIENT_MODES, GATEWAY_CLIENT_NAMES } from "../../gateway/protocol/client-info.js";
67
import { logVerbose } from "../../globals.js";
78
import { isApprovalNotFoundError } from "../../infra/approval-errors.js";
89
import { resolveApprovalCommandAuthorization } from "../../infra/channel-approval-auth.js";
910
import { formatErrorMessage } from "../../infra/errors.js";
1011
import { normalizeLowercaseStringOrEmpty } from "../../shared/string-coerce.js";
11-
import { GATEWAY_CLIENT_MODES, GATEWAY_CLIENT_NAMES } from "../../utils/message-channel.js";
1212
import { resolveChannelAccountId } from "./channel-context.js";
1313
import { requireGatewayClientScopeForInternalChannel } from "./command-gates.js";
1414
import type { CommandHandler } from "./commands-types.js";

‎src/channels/registry.ts‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
import {
2-
getActivePluginChannelRegistryFromState,
3-
getPluginRegistryState,
4-
} from "../plugins/runtime-state.js";
1+
import { getActivePluginChannelRegistryFromState } from "../plugins/runtime-channel-state.js";
52
import {
63
normalizeOptionalLowercaseString,
74
normalizeOptionalString,
@@ -32,7 +29,7 @@ function listRegisteredChannelPluginEntries(): RegisteredChannelPluginEntry[] {
3229
if (channelRegistry && channelRegistry.channels && channelRegistry.channels.length > 0) {
3330
return channelRegistry.channels;
3431
}
35-
return getPluginRegistryState()?.activeRegistry?.channels ?? [];
32+
return [];
3633
}
3734

3835
function findRegisteredChannelPluginEntry(

‎src/cli/capability-cli.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import type { OpenClawConfig } from "../config/types.openclaw.js";
1717
import { callGateway, randomIdempotencyKey } from "../gateway/call.js";
1818
import { buildGatewayConnectionDetailsWithResolvers } from "../gateway/connection-details.js";
1919
import { isLoopbackHost } from "../gateway/net.js";
20+
import { GATEWAY_CLIENT_MODES, GATEWAY_CLIENT_NAMES } from "../gateway/protocol/client-info.js";
2021
import { generateImage, listRuntimeImageGenerationProviders } from "../image-generation/runtime.js";
2122
import { buildMediaUnderstandingRegistry } from "../media-understanding/provider-registry.js";
2223
import {
@@ -54,7 +55,6 @@ import {
5455
setTtsProvider,
5556
textToSpeech,
5657
} from "../tts/tts.js";
57-
import { GATEWAY_CLIENT_MODES, GATEWAY_CLIENT_NAMES } from "../utils/message-channel.js";
5858
import { generateVideo, listRuntimeVideoGenerationProviders } from "../video-generation/runtime.js";
5959
import {
6060
isWebFetchProviderConfigured,

‎src/cli/command-secret-gateway.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { OpenClawConfig } from "../config/types.openclaw.js";
22
import { resolveSecretInputRef } from "../config/types.secrets.js";
33
import { callGateway } from "../gateway/call.js";
4+
import { GATEWAY_CLIENT_MODES, GATEWAY_CLIENT_NAMES } from "../gateway/protocol/client-info.js";
45
import { validateSecretsResolveResult } from "../gateway/protocol/index.js";
56
import { formatErrorMessage } from "../infra/errors.js";
67
import { resolveManifestContractOwnerPluginId } from "../plugins/manifest-registry.js";
@@ -19,7 +20,6 @@ import {
1920
type DiscoveredConfigSecretTarget,
2021
} from "../secrets/target-registry.js";
2122
import { normalizeLowercaseStringOrEmpty } from "../shared/string-coerce.js";
22-
import { GATEWAY_CLIENT_MODES, GATEWAY_CLIENT_NAMES } from "../utils/message-channel.js";
2323

2424
type ResolveCommandSecretsResult = {
2525
resolvedConfig: OpenClawConfig;

‎src/cli/devices-cli.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { Command } from "commander";
22
import { buildGatewayConnectionDetails, callGateway } from "../gateway/call.js";
33
import { isLoopbackHost } from "../gateway/net.js";
4+
import { GATEWAY_CLIENT_MODES, GATEWAY_CLIENT_NAMES } from "../gateway/protocol/client-info.js";
45
import {
56
approveDevicePairing,
67
formatDevicePairingForbiddenMessage,
@@ -17,7 +18,6 @@ import {
1718
} from "../shared/string-coerce.js";
1819
import { getTerminalTableWidth, renderTable } from "../terminal/table.js";
1920
import { theme } from "../terminal/theme.js";
20-
import { GATEWAY_CLIENT_MODES, GATEWAY_CLIENT_NAMES } from "../utils/message-channel.js";
2121
import { withProgress } from "./progress.js";
2222

2323
type DevicesRpcOpts = {

‎src/cli/gateway-cli/call.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { Command } from "commander";
22
import type { OpenClawConfig } from "../../config/types.openclaw.js";
33
import { callGateway } from "../../gateway/call.js";
4-
import { GATEWAY_CLIENT_MODES, GATEWAY_CLIENT_NAMES } from "../../utils/message-channel.js";
4+
import { GATEWAY_CLIENT_MODES, GATEWAY_CLIENT_NAMES } from "../../gateway/protocol/client-info.js";
55
import { withProgress } from "../progress.js";
66

77
export type GatewayRpcOpts = {

‎src/cli/gateway-rpc.runtime.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { callGateway } from "../gateway/call.js";
2-
import { GATEWAY_CLIENT_MODES, GATEWAY_CLIENT_NAMES } from "../utils/message-channel.js";
2+
import { GATEWAY_CLIENT_MODES, GATEWAY_CLIENT_NAMES } from "../gateway/protocol/client-info.js";
33
import type { GatewayRpcOpts } from "./gateway-rpc.types.js";
44
import { withProgress } from "./progress.js";
55

‎src/cli/nodes-cli/rpc.runtime.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { callGateway } from "../../gateway/call.js";
2-
import { GATEWAY_CLIENT_MODES, GATEWAY_CLIENT_NAMES } from "../../utils/message-channel.js";
2+
import { GATEWAY_CLIENT_MODES, GATEWAY_CLIENT_NAMES } from "../../gateway/protocol/client-info.js";
33
import { withProgress } from "../progress.js";
44
import type { NodesRpcOpts } from "./types.js";
55

0 commit comments

Comments
 (0)