import type { z } from "zod"; import type { OpenClawConfig } from "../config/config.js"; import { hasEnvHttpProxyConfigured } from "../infra/net/proxy-env.js"; import { resolveDefaultSecretProviderAlias } from "../secrets/ref-contract.js"; import { runPassiveAccountLifecycle } from "./channel-lifecycle.core.js"; import { createLoggerBackedRuntime } from "./runtime-logger.js";
export { safeParseJsonWithSchema, safeParseWithSchema } from "../utils/zod-parse.js";
export { buildTimeoutAbortSignal } from "../utils/fetch-timeout.js";
type PassiveChannelStatusSnapshot = {
configured?: boolean;
running?: boolean;
lastStartAt?: number | null;
lastStopAt?: number | null;
lastError?: string | null;
probe?: unknown;
lastProbeAt?: number | null;
};
type TrafficStatusSnapshot = {
lastInboundAt?: number | null;
lastOutboundAt?: number | null;
};
export function readStatusIssueFields<TField extends string>(
value: unknown,
fields: readonly TField[],
): Record<TField, unknown> | null { if (!value || typeof value !== "object") { returnnull;
} const record = value as Record<string, unknown>; const result = {} as Record<TField, unknown>; for (const field of fields) {
result[field] = record[field];
} return result;
}
export function coerceStatusIssueAccountId(value: unknown): string | undefined { returntypeof value === "string" ? value : typeof value === "number" ? String(value) : undefined;
}
export function createDeferred<T>() {
let resolve!: (value: T | PromiseLike<T>) => void;
let reject!: (reason?: unknown) => void; const promise = new Promise<T>((res, rej) => {
resolve = res;
reject = rej;
}); return { promise, resolve, reject };
}
const DEFAULT_PACKAGE_JSON_VERSION_CANDIDATES = [ "../package.json", "./package.json", "../../package.json",
] as const;
type PackageJsonRequire = (id: string) => unknown;
type PluginConfigIssuePathSegment = string | number;
type PluginConfigIssue = {
path: PluginConfigIssuePathSegment[];
message: string;
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.