refactor: trim install infra exports · openclaw/openclaw@194c516
steipete
·
2026-05-02
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -9,18 +9,18 @@ import { setActivePluginRegistry } from "../plugins/runtime.js";
|
9 | 9 | import { createTestRegistry } from "../test-utils/channel-plugins.js"; |
10 | 10 | import type { HeartbeatDeps } from "./heartbeat-runner.js"; |
11 | 11 | |
12 | | -export type HeartbeatSessionSeed = { |
| 12 | +type HeartbeatSessionSeed = { |
13 | 13 | sessionId?: string; |
14 | 14 | updatedAt?: number; |
15 | 15 | lastChannel: string; |
16 | 16 | lastProvider: string; |
17 | 17 | lastTo: string; |
18 | 18 | }; |
19 | 19 | |
20 | | -export type HeartbeatReplyFn = NonNullable<HeartbeatDeps["getReplyFromConfig"]>; |
| 20 | +type HeartbeatReplyFn = NonNullable<HeartbeatDeps["getReplyFromConfig"]>; |
21 | 21 | export type HeartbeatReplySpy = ReturnType<typeof vi.fn<HeartbeatReplyFn>>; |
22 | 22 | |
23 | | -export function createHeartbeatReplySpy(): HeartbeatReplySpy { |
| 23 | +function createHeartbeatReplySpy(): HeartbeatReplySpy { |
24 | 24 | const replySpy: HeartbeatReplySpy = vi.fn<HeartbeatReplyFn>(); |
25 | 25 | replySpy.mockResolvedValue({ text: "ok" }); |
26 | 26 | return replySpy; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -5,7 +5,7 @@ import { resolveUserPath } from "../utils.js";
|
5 | 5 | import { type ArchiveLogger, extractArchive, fileExists, resolvePackedRootDir } from "./archive.js"; |
6 | 6 | import { withTempDir } from "./install-source-utils.js"; |
7 | 7 | |
8 | | -export type ExistingInstallPathResult = |
| 8 | +type ExistingInstallPathResult = |
9 | 9 | | { |
10 | 10 | ok: true; |
11 | 11 | resolvedPath: string; |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | | -export type InstallMode = "install" | "update"; |
| 1 | +type InstallMode = "install" | "update"; |
2 | 2 | |
3 | | -export type InstallModeOptions<TLogger> = { |
| 3 | +type InstallModeOptions<TLogger> = { |
4 | 4 | logger?: TLogger; |
5 | 5 | mode?: InstallMode; |
6 | 6 | dryRun?: boolean; |
7 | 7 | }; |
8 | 8 | |
9 | | -export type TimedInstallModeOptions<TLogger> = InstallModeOptions<TLogger> & { |
| 9 | +type TimedInstallModeOptions<TLogger> = InstallModeOptions<TLogger> & { |
10 | 10 | timeoutMs?: number; |
11 | 11 | }; |
12 | 12 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -2,7 +2,7 @@ import type { GatewayBindMode } from "../config/types.js";
|
2 | 2 | import { pickPrimaryLanIPv4, resolveGatewayBindHost } from "../gateway/net.js"; |
3 | 3 | import { pickPrimaryTailnetIPv4 } from "./tailnet.js"; |
4 | 4 | |
5 | | -export function summarizeDisplayNetworkError(error: unknown): string { |
| 5 | +function summarizeDisplayNetworkError(error: unknown): string { |
6 | 6 | if (error instanceof Error) { |
7 | 7 | const message = error.message.trim(); |
8 | 8 | if (message) { |
@@ -12,10 +12,7 @@ export function summarizeDisplayNetworkError(error: unknown): string {
|
12 | 12 | return "network interface discovery failed"; |
13 | 13 | } |
14 | 14 | |
15 | | -export function fallbackBindHostForDisplay( |
16 | | -bindMode: GatewayBindMode, |
17 | | -customBindHost?: string, |
18 | | -): string { |
| 15 | +function fallbackBindHostForDisplay(bindMode: GatewayBindMode, customBindHost?: string): string { |
19 | 16 | if (bindMode === "lan") { |
20 | 17 | return "0.0.0.0"; |
21 | 18 | } |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import os from "node:os"; |
2 | 2 | |
3 | 3 | export type NetworkInterfacesSnapshot = ReturnType<typeof os.networkInterfaces>; |
4 | | -export type NetworkInterfaceFamily = "IPv4" | "IPv6"; |
5 | | -export type ExternalNetworkInterfaceAddress = { |
| 4 | +type NetworkInterfaceFamily = "IPv4" | "IPv6"; |
| 5 | +type ExternalNetworkInterfaceAddress = { |
6 | 6 | name: string; |
7 | 7 | address: string; |
8 | 8 | family: NetworkInterfaceFamily; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -2,9 +2,9 @@ import { NODE_SYSTEM_RUN_COMMANDS } from "./node-commands.js";
|
2 | 2 | |
3 | 3 | export type NodeApprovalScope = "operator.pairing" | "operator.write" | "operator.admin"; |
4 | 4 | |
5 | | -export const OPERATOR_PAIRING_SCOPE: NodeApprovalScope = "operator.pairing"; |
6 | | -export const OPERATOR_WRITE_SCOPE: NodeApprovalScope = "operator.write"; |
7 | | -export const OPERATOR_ADMIN_SCOPE: NodeApprovalScope = "operator.admin"; |
| 5 | +const OPERATOR_PAIRING_SCOPE: NodeApprovalScope = "operator.pairing"; |
| 6 | +const OPERATOR_WRITE_SCOPE: NodeApprovalScope = "operator.write"; |
| 7 | +const OPERATOR_ADMIN_SCOPE: NodeApprovalScope = "operator.admin"; |
8 | 8 | |
9 | 9 | export function resolveNodePairApprovalScopes(commands: unknown): NodeApprovalScope[] { |
10 | 10 | const normalized = Array.isArray(commands) |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -14,7 +14,7 @@ import {
|
14 | 14 | import { rejectPendingPairingRequest } from "./pairing-pending.js"; |
15 | 15 | import { generatePairingToken, verifyPairingToken } from "./pairing-token.js"; |
16 | 16 | |
17 | | -export type NodeDeclaredSurface = { |
| 17 | +type NodeDeclaredSurface = { |
18 | 18 | nodeId: string; |
19 | 19 | displayName?: string; |
20 | 20 | platform?: string; |
@@ -29,7 +29,7 @@ export type NodeDeclaredSurface = {
|
29 | 29 | remoteIp?: string; |
30 | 30 | }; |
31 | 31 | |
32 | | -export type NodeApprovedSurface = NodeDeclaredSurface; |
| 32 | +type NodeApprovedSurface = NodeDeclaredSurface; |
33 | 33 | |
34 | 34 | export type NodePairingRequestInput = NodeDeclaredSurface & { |
35 | 35 | silent?: boolean; |
@@ -41,7 +41,7 @@ export type NodePairingPendingRequest = NodePairingRequestInput & {
|
41 | 41 | ts: number; |
42 | 42 | }; |
43 | 43 | |
44 | | -export type NodePairingPendingEntry = NodePairingPendingRequest & { |
| 44 | +type NodePairingPendingEntry = NodePairingPendingRequest & { |
45 | 45 | requiredApproveScopes: NodeApprovalScope[]; |
46 | 46 | }; |
47 | 47 | |
@@ -55,7 +55,7 @@ export type NodePairingPairedNode = NodeApprovedSurface & {
|
55 | 55 | lastSeenReason?: string; |
56 | 56 | }; |
57 | 57 | |
58 | | -export type NodePairingList = { |
| 58 | +type NodePairingList = { |
59 | 59 | pending: NodePairingPendingEntry[]; |
60 | 60 | paired: NodePairingPairedNode[]; |
61 | 61 | }; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -21,7 +21,7 @@ type ResolveNpmIntegrityDriftParams<TPayload> = {
|
21 | 21 | warn?: (payload: TPayload) => void; |
22 | 22 | }; |
23 | 23 | |
24 | | -export type ResolveNpmIntegrityDriftResult<TPayload> = { |
| 24 | +type ResolveNpmIntegrityDriftResult<TPayload> = { |
25 | 25 | integrityDrift?: NpmIntegrityDrift; |
26 | 26 | proceed: boolean; |
27 | 27 | payload?: TPayload; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -14,7 +14,7 @@ import {
|
14 | 14 | parseRegistryNpmSpec, |
15 | 15 | } from "./npm-registry-spec.js"; |
16 | 16 | |
17 | | -export type NpmSpecArchiveInstallFlowResult<TResult extends { ok: boolean }> = |
| 17 | +type NpmSpecArchiveInstallFlowResult<TResult extends { ok: boolean }> = |
18 | 18 | | { |
19 | 19 | ok: false; |
20 | 20 | error: string; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -2,7 +2,7 @@ import { spawnSync } from "node:child_process";
|
2 | 2 | import os from "node:os"; |
3 | 3 | import { normalizeOptionalString } from "../shared/string-coerce.js"; |
4 | 4 | |
5 | | -export type OsSummary = { |
| 5 | +type OsSummary = { |
6 | 6 | platform: NodeJS.Platform; |
7 | 7 | arch: string; |
8 | 8 | release: string; |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。