refactor: trim system infra exports · openclaw/openclaw@536e4f4
steipete
·
2026-05-02
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -194,12 +194,12 @@ function probeLoginShellEnv(params: {
|
194 | 194 | } |
195 | 195 | } |
196 | 196 | |
197 | | -export type ShellEnvFallbackResult = |
| 197 | +type ShellEnvFallbackResult = |
198 | 198 | | { ok: true; applied: string[]; skippedReason?: never } |
199 | 199 | | { ok: true; applied: []; skippedReason: "already-has-keys" | "disabled" } |
200 | 200 | | { ok: false; error: string; applied: [] }; |
201 | 201 | |
202 | | -export type ShellEnvFallbackOptions = { |
| 202 | +type ShellEnvFallbackOptions = { |
203 | 203 | enabled: boolean; |
204 | 204 | env: NodeJS.ProcessEnv; |
205 | 205 | expectedKeys: string[]; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -51,7 +51,7 @@ const SHELL_WRAPPER_SPECS: ReadonlyArray<ShellWrapperSpec> = [
|
51 | 51 | { kind: "powershell", names: POWERSHELL_WRAPPER_CANONICAL }, |
52 | 52 | ]; |
53 | 53 | |
54 | | -export type ShellWrapperCommand = { |
| 54 | +type ShellWrapperCommand = { |
55 | 55 | isWrapper: boolean; |
56 | 56 | command: string | null; |
57 | 57 | }; |
@@ -158,7 +158,7 @@ function findShellWrapperSpec(baseExecutable: string): ShellWrapperSpec | null {
|
158 | 158 | return null; |
159 | 159 | } |
160 | 160 | |
161 | | -export type ShellMultiplexerUnwrapResult = |
| 161 | +type ShellMultiplexerUnwrapResult = |
162 | 162 | | { kind: "not-wrapper" } |
163 | 163 | | { kind: "blocked"; wrapper: string } |
164 | 164 | | { kind: "unwrapped"; wrapper: string; argv: string[] }; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -26,7 +26,7 @@ export type SystemPresence = {
|
26 | 26 | ts: number; |
27 | 27 | }; |
28 | 28 | |
29 | | -export type SystemPresenceUpdate = { |
| 29 | +type SystemPresenceUpdate = { |
30 | 30 | key: string; |
31 | 31 | previous?: SystemPresence; |
32 | 32 | next: SystemPresence; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -11,7 +11,7 @@ import {
|
11 | 11 | resolveInlineCommandMatch, |
12 | 12 | } from "./shell-inline-command.js"; |
13 | 13 | |
14 | | -export type SystemRunCommandValidation = |
| 14 | +type SystemRunCommandValidation = |
15 | 15 | | { |
16 | 16 | ok: true; |
17 | 17 | shellPayload: string | null; |
@@ -24,7 +24,7 @@ export type SystemRunCommandValidation =
|
24 | 24 | details?: Record<string, unknown>; |
25 | 25 | }; |
26 | 26 | |
27 | | -export type ResolvedSystemRunCommand = |
| 27 | +type ResolvedSystemRunCommand = |
28 | 28 | | { |
29 | 29 | ok: true; |
30 | 30 | argv: string[]; |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import { isIpInCidr } from "../shared/net/ip.js"; |
2 | 2 | import { listExternalInterfaceAddresses, readNetworkInterfaces } from "./network-interfaces.js"; |
3 | 3 | |
4 | | -export type TailnetAddresses = { |
| 4 | +type TailnetAddresses = { |
5 | 5 | ipv4: string[]; |
6 | 6 | ipv6: string[]; |
7 | 7 | }; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -166,7 +166,7 @@ export function getTestTailscaleBinaryOverride(
|
166 | 166 | return null; |
167 | 167 | } |
168 | 168 | |
169 | | -export async function getTailscaleBinary(): Promise<string> { |
| 169 | +async function getTailscaleBinary(): Promise<string> { |
170 | 170 | const forcedBinary = getTestTailscaleBinaryOverride(); |
171 | 171 | if (forcedBinary) { |
172 | 172 | cachedTailscaleBinary = forcedBinary; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -8,7 +8,7 @@ const logger = createSubsystemLogger("infra:temp-download");
|
8 | 8 | |
9 | 9 | export { resolvePreferredOpenClawTmpDir } from "./tmp-openclaw-dir.js"; |
10 | 10 | |
11 | | -export type TempDownloadTarget = { |
| 11 | +type TempDownloadTarget = { |
12 | 12 | dir: string; |
13 | 13 | path: string; |
14 | 14 | cleanup: () => Promise<void>; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -21,7 +21,7 @@ export type CommandRunner = (
|
21 | 21 | options: { timeoutMs: number; cwd?: string; env?: NodeJS.ProcessEnv }, |
22 | 22 | ) => Promise<{ stdout: string; stderr: string; code: number | null }>; |
23 | 23 | |
24 | | -export type ResolvedGlobalInstallCommand = { |
| 24 | +type ResolvedGlobalInstallCommand = { |
25 | 25 | manager: GlobalInstallManager; |
26 | 26 | command: string; |
27 | 27 | }; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -4,9 +4,9 @@ import path from "node:path";
|
4 | 4 | import { detectPackageManager as detectPackageManagerImpl } from "./detect-package-manager.js"; |
5 | 5 | import { applyPathPrepend } from "./path-prepend.js"; |
6 | 6 | |
7 | | -export type BuildManager = "pnpm" | "bun" | "npm"; |
| 7 | +type BuildManager = "pnpm" | "bun" | "npm"; |
8 | 8 | |
9 | | -export type UpdatePackageManagerRequirement = "allow-fallback" | "require-preferred"; |
| 9 | +type UpdatePackageManagerRequirement = "allow-fallback" | "require-preferred"; |
10 | 10 | |
11 | 11 | export type UpdatePackageManagerFailureReason = |
12 | 12 | | "preferred-manager-unavailable" |
@@ -19,7 +19,7 @@ export type PackageManagerCommandRunner = (
|
19 | 19 | options: { timeoutMs: number; env?: NodeJS.ProcessEnv }, |
20 | 20 | ) => Promise<{ stdout: string; stderr: string; code: number | null }>; |
21 | 21 | |
22 | | -export type ResolvedBuildManager = |
| 22 | +type ResolvedBuildManager = |
23 | 23 | | { |
24 | 24 | kind: "resolved"; |
25 | 25 | manager: BuildManager; |
@@ -34,7 +34,7 @@ export type ResolvedBuildManager =
|
34 | 34 | reason: UpdatePackageManagerFailureReason; |
35 | 35 | }; |
36 | 36 | |
37 | | -export async function detectBuildManager(root: string): Promise<BuildManager> { |
| 37 | +async function detectBuildManager(root: string): Promise<BuildManager> { |
38 | 38 | return (await detectPackageManagerImpl(root)) ?? "npm"; |
39 | 39 | } |
40 | 40 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -7,12 +7,12 @@ import {
|
7 | 7 | } from "../routing/session-key.js"; |
8 | 8 | import { createAsyncLock, readJsonFile, writeJsonAtomic } from "./json-files.js"; |
9 | 9 | |
10 | | -export type VoiceWakeRouteTarget = |
| 10 | +type VoiceWakeRouteTarget = |
11 | 11 | | { mode: "current"; agentId?: undefined; sessionKey?: undefined } |
12 | 12 | | { agentId: string; sessionKey?: undefined; mode?: undefined } |
13 | 13 | | { sessionKey: string; agentId?: undefined; mode?: undefined }; |
14 | 14 | |
15 | | -export type VoiceWakeRouteRule = { |
| 15 | +type VoiceWakeRouteRule = { |
16 | 16 | trigger: string; |
17 | 17 | target: VoiceWakeRouteTarget; |
18 | 18 | }; |
@@ -288,12 +288,9 @@ export async function setVoiceWakeRoutingConfig(
|
288 | 288 | }); |
289 | 289 | } |
290 | 290 | |
291 | | -export type VoiceWakeResolvedRoute = |
292 | | -| { mode: "current" } |
293 | | -| { agentId: string } |
294 | | -| { sessionKey: string }; |
| 291 | +type VoiceWakeResolvedRoute = { mode: "current" } | { agentId: string } | { sessionKey: string }; |
295 | 292 | |
296 | | -export function resolveVoiceWakeRouteTarget( |
| 293 | +function resolveVoiceWakeRouteTarget( |
297 | 294 | routeTarget: VoiceWakeRouteTarget | undefined, |
298 | 295 | ): VoiceWakeResolvedRoute { |
299 | 296 | if (!routeTarget || ("mode" in routeTarget && routeTarget.mode === "current")) { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。