mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 07:40:44 +00:00
refactor: trim infra path diagnostic exports
This commit is contained in:
@@ -4,7 +4,7 @@ import os from "node:os";
|
||||
import path from "node:path";
|
||||
import { isNotFoundPathError, isPathInside } from "./path-guards.js";
|
||||
|
||||
export type BoundaryPathIntent = "read" | "write" | "create" | "delete" | "stat";
|
||||
type BoundaryPathIntent = "read" | "write" | "create" | "delete" | "stat";
|
||||
|
||||
export type BoundaryPathAliasPolicy = {
|
||||
allowFinalSymlinkForUnlink?: boolean;
|
||||
@@ -22,7 +22,7 @@ export const BOUNDARY_PATH_ALIAS_POLICIES = {
|
||||
}),
|
||||
} as const;
|
||||
|
||||
export type ResolveBoundaryPathParams = {
|
||||
type ResolveBoundaryPathParams = {
|
||||
absolutePath: string;
|
||||
rootPath: string;
|
||||
boundaryLabel: string;
|
||||
@@ -32,7 +32,7 @@ export type ResolveBoundaryPathParams = {
|
||||
rootCanonicalPath?: string;
|
||||
};
|
||||
|
||||
export type ResolvedBoundaryPathKind = "missing" | "file" | "directory" | "symlink" | "other";
|
||||
type ResolvedBoundaryPathKind = "missing" | "file" | "directory" | "symlink" | "other";
|
||||
|
||||
export type ResolvedBoundaryPath = {
|
||||
absolutePath: string;
|
||||
@@ -660,7 +660,7 @@ function buildResolvedBoundaryPath(params: {
|
||||
};
|
||||
}
|
||||
|
||||
export async function resolvePathViaExistingAncestor(targetPath: string): Promise<string> {
|
||||
async function resolvePathViaExistingAncestor(targetPath: string): Promise<string> {
|
||||
const normalized = path.resolve(targetPath);
|
||||
let cursor = normalized;
|
||||
const missingSuffix: string[] = [];
|
||||
|
||||
@@ -3,13 +3,13 @@ import { runCommandWithTimeout } from "../process/exec.js";
|
||||
import { detectBinary } from "./detect-binary.js";
|
||||
import { isWSL } from "./wsl.js";
|
||||
|
||||
export type BrowserOpenCommand = {
|
||||
type BrowserOpenCommand = {
|
||||
argv: string[] | null;
|
||||
reason?: string;
|
||||
command?: string;
|
||||
};
|
||||
|
||||
export type BrowserOpenSupport = {
|
||||
type BrowserOpenSupport = {
|
||||
ok: boolean;
|
||||
reason?: string;
|
||||
command?: string;
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { OpenClawConfig } from "../config/types.openclaw.js";
|
||||
import { isImplicitSameChatApprovalAuthorization } from "../plugin-sdk/approval-auth-helpers.js";
|
||||
import { normalizeMessageChannel } from "../utils/message-channel.js";
|
||||
|
||||
export type ApprovalCommandAuthorization = {
|
||||
type ApprovalCommandAuthorization = {
|
||||
authorized: boolean;
|
||||
reason?: string;
|
||||
explicit: boolean;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import fs from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
|
||||
export type DetectedPackageManager = "pnpm" | "bun" | "npm";
|
||||
type DetectedPackageManager = "pnpm" | "bun" | "npm";
|
||||
|
||||
export async function detectPackageManager(root: string): Promise<DetectedPackageManager | null> {
|
||||
try {
|
||||
|
||||
@@ -15,7 +15,7 @@ const PROVIDER_REQUEST_ID_TEXT_PATTERNS = [
|
||||
/\((?:request_id|trace_id)\s*:\s*([A-Za-z0-9._:-]{1,128})\)/i,
|
||||
] as const;
|
||||
|
||||
export type DiagnosticErrorFailureKind =
|
||||
type DiagnosticErrorFailureKind =
|
||||
| "aborted"
|
||||
| "connection_closed"
|
||||
| "connection_reset"
|
||||
|
||||
@@ -21,7 +21,7 @@ export type DiagnosticTraceContext = {
|
||||
readonly traceFlags?: string;
|
||||
};
|
||||
|
||||
export type DiagnosticTraceContextInput = Partial<DiagnosticTraceContext> & {
|
||||
type DiagnosticTraceContextInput = Partial<DiagnosticTraceContext> & {
|
||||
traceparent?: string;
|
||||
};
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@ import type { OpenClawConfig } from "../config/types.openclaw.js";
|
||||
import { isDiagnosticFlagEnabled } from "./diagnostic-flags.js";
|
||||
import { isTruthyEnvValue } from "./env.js";
|
||||
|
||||
export const OPENCLAW_DIAGNOSTICS_TIMELINE_SCHEMA_VERSION = "openclaw.diagnostics.v1";
|
||||
const OPENCLAW_DIAGNOSTICS_TIMELINE_SCHEMA_VERSION = "openclaw.diagnostics.v1";
|
||||
|
||||
export type DiagnosticsTimelineEventType =
|
||||
type DiagnosticsTimelineEventType =
|
||||
| "span.start"
|
||||
| "span.end"
|
||||
| "span.error"
|
||||
@@ -17,9 +17,9 @@ export type DiagnosticsTimelineEventType =
|
||||
| "provider.request"
|
||||
| "childProcess.exit";
|
||||
|
||||
export type DiagnosticsTimelineAttributes = Record<string, string | number | boolean | null>;
|
||||
type DiagnosticsTimelineAttributes = Record<string, string | number | boolean | null>;
|
||||
|
||||
export type DiagnosticsTimelineEvent = {
|
||||
type DiagnosticsTimelineEvent = {
|
||||
type: DiagnosticsTimelineEventType;
|
||||
name: string;
|
||||
timestamp?: string;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
|
||||
export const LOW_DISK_SPACE_WARNING_THRESHOLD_BYTES = 1024 * 1024 * 1024;
|
||||
const LOW_DISK_SPACE_WARNING_THRESHOLD_BYTES = 1024 * 1024 * 1024;
|
||||
|
||||
export type DiskSpaceSnapshot = {
|
||||
type DiskSpaceSnapshot = {
|
||||
targetPath: string;
|
||||
checkedPath: string;
|
||||
availableBytes: number;
|
||||
|
||||
Reference in New Issue
Block a user