refactor: trim infra path diagnostic exports · openclaw/openclaw@ebece95
steipete
·
2026-05-02
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -4,7 +4,7 @@ import os from "node:os";
|
4 | 4 | import path from "node:path"; |
5 | 5 | import { isNotFoundPathError, isPathInside } from "./path-guards.js"; |
6 | 6 | |
7 | | -export type BoundaryPathIntent = "read" | "write" | "create" | "delete" | "stat"; |
| 7 | +type BoundaryPathIntent = "read" | "write" | "create" | "delete" | "stat"; |
8 | 8 | |
9 | 9 | export type BoundaryPathAliasPolicy = { |
10 | 10 | allowFinalSymlinkForUnlink?: boolean; |
@@ -22,7 +22,7 @@ export const BOUNDARY_PATH_ALIAS_POLICIES = {
|
22 | 22 | }), |
23 | 23 | } as const; |
24 | 24 | |
25 | | -export type ResolveBoundaryPathParams = { |
| 25 | +type ResolveBoundaryPathParams = { |
26 | 26 | absolutePath: string; |
27 | 27 | rootPath: string; |
28 | 28 | boundaryLabel: string; |
@@ -32,7 +32,7 @@ export type ResolveBoundaryPathParams = {
|
32 | 32 | rootCanonicalPath?: string; |
33 | 33 | }; |
34 | 34 | |
35 | | -export type ResolvedBoundaryPathKind = "missing" | "file" | "directory" | "symlink" | "other"; |
| 35 | +type ResolvedBoundaryPathKind = "missing" | "file" | "directory" | "symlink" | "other"; |
36 | 36 | |
37 | 37 | export type ResolvedBoundaryPath = { |
38 | 38 | absolutePath: string; |
@@ -660,7 +660,7 @@ function buildResolvedBoundaryPath(params: {
|
660 | 660 | }; |
661 | 661 | } |
662 | 662 | |
663 | | -export async function resolvePathViaExistingAncestor(targetPath: string): Promise<string> { |
| 663 | +async function resolvePathViaExistingAncestor(targetPath: string): Promise<string> { |
664 | 664 | const normalized = path.resolve(targetPath); |
665 | 665 | let cursor = normalized; |
666 | 666 | const missingSuffix: string[] = []; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -3,13 +3,13 @@ import { runCommandWithTimeout } from "../process/exec.js";
|
3 | 3 | import { detectBinary } from "./detect-binary.js"; |
4 | 4 | import { isWSL } from "./wsl.js"; |
5 | 5 | |
6 | | -export type BrowserOpenCommand = { |
| 6 | +type BrowserOpenCommand = { |
7 | 7 | argv: string[] | null; |
8 | 8 | reason?: string; |
9 | 9 | command?: string; |
10 | 10 | }; |
11 | 11 | |
12 | | -export type BrowserOpenSupport = { |
| 12 | +type BrowserOpenSupport = { |
13 | 13 | ok: boolean; |
14 | 14 | reason?: string; |
15 | 15 | command?: string; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -3,7 +3,7 @@ import type { OpenClawConfig } from "../config/types.openclaw.js";
|
3 | 3 | import { isImplicitSameChatApprovalAuthorization } from "../plugin-sdk/approval-auth-helpers.js"; |
4 | 4 | import { normalizeMessageChannel } from "../utils/message-channel.js"; |
5 | 5 | |
6 | | -export type ApprovalCommandAuthorization = { |
| 6 | +type ApprovalCommandAuthorization = { |
7 | 7 | authorized: boolean; |
8 | 8 | reason?: string; |
9 | 9 | explicit: boolean; |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import fs from "node:fs/promises"; |
2 | 2 | import path from "node:path"; |
3 | 3 | |
4 | | -export type DetectedPackageManager = "pnpm" | "bun" | "npm"; |
| 4 | +type DetectedPackageManager = "pnpm" | "bun" | "npm"; |
5 | 5 | |
6 | 6 | export async function detectPackageManager(root: string): Promise<DetectedPackageManager | null> { |
7 | 7 | try { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -15,7 +15,7 @@ const PROVIDER_REQUEST_ID_TEXT_PATTERNS = [
|
15 | 15 | /\((?:request_id|trace_id)\s*:\s*([A-Za-z0-9._:-]{1,128})\)/i, |
16 | 16 | ] as const; |
17 | 17 | |
18 | | -export type DiagnosticErrorFailureKind = |
| 18 | +type DiagnosticErrorFailureKind = |
19 | 19 | | "aborted" |
20 | 20 | | "connection_closed" |
21 | 21 | | "connection_reset" |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -21,7 +21,7 @@ export type DiagnosticTraceContext = {
|
21 | 21 | readonly traceFlags?: string; |
22 | 22 | }; |
23 | 23 | |
24 | | -export type DiagnosticTraceContextInput = Partial<DiagnosticTraceContext> & { |
| 24 | +type DiagnosticTraceContextInput = Partial<DiagnosticTraceContext> & { |
25 | 25 | traceparent?: string; |
26 | 26 | }; |
27 | 27 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -6,9 +6,9 @@ import type { OpenClawConfig } from "../config/types.openclaw.js";
|
6 | 6 | import { isDiagnosticFlagEnabled } from "./diagnostic-flags.js"; |
7 | 7 | import { isTruthyEnvValue } from "./env.js"; |
8 | 8 | |
9 | | -export const OPENCLAW_DIAGNOSTICS_TIMELINE_SCHEMA_VERSION = "openclaw.diagnostics.v1"; |
| 9 | +const OPENCLAW_DIAGNOSTICS_TIMELINE_SCHEMA_VERSION = "openclaw.diagnostics.v1"; |
10 | 10 | |
11 | | -export type DiagnosticsTimelineEventType = |
| 11 | +type DiagnosticsTimelineEventType = |
12 | 12 | | "span.start" |
13 | 13 | | "span.end" |
14 | 14 | | "span.error" |
@@ -17,9 +17,9 @@ export type DiagnosticsTimelineEventType =
|
17 | 17 | | "provider.request" |
18 | 18 | | "childProcess.exit"; |
19 | 19 | |
20 | | -export type DiagnosticsTimelineAttributes = Record<string, string | number | boolean | null>; |
| 20 | +type DiagnosticsTimelineAttributes = Record<string, string | number | boolean | null>; |
21 | 21 | |
22 | | -export type DiagnosticsTimelineEvent = { |
| 22 | +type DiagnosticsTimelineEvent = { |
23 | 23 | type: DiagnosticsTimelineEventType; |
24 | 24 | name: string; |
25 | 25 | timestamp?: string; |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import fs from "node:fs"; |
2 | 2 | import path from "node:path"; |
3 | 3 | |
4 | | -export const LOW_DISK_SPACE_WARNING_THRESHOLD_BYTES = 1024 * 1024 * 1024; |
| 4 | +const LOW_DISK_SPACE_WARNING_THRESHOLD_BYTES = 1024 * 1024 * 1024; |
5 | 5 | |
6 | | -export type DiskSpaceSnapshot = { |
| 6 | +type DiskSpaceSnapshot = { |
7 | 7 | targetPath: string; |
8 | 8 | checkedPath: string; |
9 | 9 | availableBytes: number; |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。