UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

94 lines (93 loc) • 26.4 kB
import { A as resolveExpiresAtMsFromEpochSeconds, C as parseStrictNonNegativeInteger, M as resolveNonNegativeIntegerOption, O as resolveExpiresAtMsFromDurationOrEpoch, S as parseStrictInteger, T as positiveSecondsToSafeMilliseconds, _ as nonNegativeSecondsToSafeMilliseconds, b as parseFiniteNumber, h as finiteSecondsToTimerSafeMilliseconds, k as resolveExpiresAtMsFromDurationSeconds, m as clampTimerTimeoutMs, n as MAX_TIMER_TIMEOUT_MS, r as MAX_TIMER_TIMEOUT_SECONDS, w as parseStrictPositiveInteger, x as parseStrictFiniteNumber } from "../number-coercion-Dq1l5muL.mjs"; import { c as readErrorName, i as extractErrorCode, l as stringifyNonErrorCause, n as collectErrorGraphCandidates, u as toErrorObject } from "../error-coercion-1P2One0X.mjs"; import { n as resolveEffectiveHomeDir, r as resolveOsHomeDir } from "../home-dir-D0b-ywue.mjs"; import { a as resolveRequiredOsHomeDir, i as resolveRequiredHomeDir, n as resolveHomeRelativePath, o as resolveUserPath, r as resolveOsHomeRelativePath, t as expandHomePrefix } from "../home-dir-CjKH62jd.mjs"; import { n as isVitestRuntimeEnv, t as isFastTestRuntimeEnv } from "../test-runtime-env-mVzBKwSd.mjs"; import { a as normalizeZaiEnv, i as normalizeEnv, n as isTruthyEnvValue, o as resolveEnvNormalizationKeys, r as logAcceptedEnvOption, t as expandEnvNormalizationKeys } from "../env-Bw1K_ti_.mjs"; import { A as withTimeout, C as resolveRegularFileAppendFlags, D as statRegularFileSync, E as statRegularFile, M as writeFileWithinRoot, O as walkDirectory, S as resolveOpenedFileRealPathForHandle, T as sanitizeUntrustedFileName, _ as readRegularFileSync, a as canonicalPathFromExistingAncestor, b as resolveAbsolutePathForWrite, c as isPathInside, d as pathExists, f as pathExistsSync, g as readRegularFile, h as readLocalFileSafely, i as assertAbsolutePathInput, j as writeExternalFileWithinRoot, k as walkDirectorySync, l as movePathToTrash, m as readLocalFileFromRoots, n as appendRegularFile, o as ensureAbsoluteDirectory, p as readFileWithinRoot, r as appendRegularFileSync, s as findExistingAncestor, t as FsSafeError, u as openLocalFileSafely, v as readSecureFile, w as root, x as resolveLocalPathFromRootsSync, y as resolveAbsolutePathForRead } from "../fs-safe-CS1DrPTK.mjs"; import { t as pruneMapToMaxSize } from "../map-size-CNcWiFKu.mjs"; import { a as resolveRetryConfig, c as sleepWithAbort, n as computeBackoff } from "../src-DqaLEvc_.mjs"; import { n as isErrno, t as hasErrnoCode } from "../errno-FR4CRyya.mjs"; import { r as formatUncaughtError, t as formatErrorMessage } from "../errors-BSdPMFao.mjs"; import { h as onDiagnosticEvent, p as isDiagnosticsEnabled, r as emitDiagnosticEvent, t as areDiagnosticsEnabledForProcess } from "../diagnostic-events-BflWr4hm.mjs"; import { n as resolvePreferredOpenClawTmpDir, t as DEFAULT_POSIX_TMP_ROOT } from "../tmp-openclaw-dir-BSb3HetY.mjs"; import { a as resetWSLStateForTests, i as isWSLSync, n as isWSL2Sync, r as isWSLEnv, t as isWSL } from "../wsl-BsdoMNVM.mjs"; import "../backoff-DG9ukw7j.mjs"; import { _ as writeJsonSync, a as readJsonFile, c as readJsonIfExists, d as readRootJsonSync, f as readRootStructuredFileSync, g as writeJsonAtomic, h as writeJson, i as readJson, l as readJsonSync, m as tryReadJsonSync, n as createAsyncLock, o as readJsonFileStrict, p as tryReadJson, r as readDurableJsonFile, s as readJsonFileSync, t as JsonFileReadError, u as readRootJsonObjectSync, v as writeTextAtomic } from "../json-files-Br8qKrAz.mjs"; import { a as isRequestBodyLimitError, c as requestBodyErrorToText, i as installRequestBodyLimitGuard, l as testApi, n as DEFAULT_WEBHOOK_MAX_BODY_BYTES, o as readJsonBodyWithLimit, r as RequestBodyLimitError, s as readRequestBodyWithLimit, t as DEFAULT_WEBHOOK_BODY_TIMEOUT_MS } from "../http-body-CZtbU96N.mjs"; import { n as buildTimeoutAbortSignal, r as fetchWithTimeout, t as bindAbortRelay } from "../fetch-timeout-DySwRfSX.mjs"; import { n as resolveGlobalDedupeCache, t as createDedupeCache } from "../dedupe-B0_bknse.mjs"; import { i as drainFileLockStateForTest, n as FILE_LOCK_TIMEOUT_ERROR_CODE, o as resetFileLockStateForTest, r as acquireFileLock, s as withFileLock } from "../file-lock-bsl71RWY.mjs"; import "../file-lock-BaXCvmXR.mjs"; import { n as matchesDiagnosticFlag, r as resolveDiagnosticFlags, t as isDiagnosticFlagEnabled } from "../diagnostic-flags-D-ufKEa3.mjs"; import { _ as resolvePolicyTargetCandidatePath, a as matchAllowlist, c as resolveApprovalAuditCandidatePath, d as resolveCommandResolutionFromArgv, f as resolveExecutableTrustPath, g as resolvePolicyAllowlistCandidatePath, h as resolveExecutionTargetTrustPath, l as resolveApprovalAuditTrustPath, m as resolveExecutionTargetResolution, o as parseExecArgvToken, p as resolveExecutionTargetCandidatePath, s as resolveAllowlistCandidatePath, u as resolveCommandResolution, v as resolvePolicyTargetResolution, y as resolvePolicyTargetTrustPath } from "../exec-command-resolution-BbXiIa7C.mjs"; import { a as normalizeExecMode, c as requireValidExecTarget, i as normalizeExecHost, n as EXEC_TARGET_VALUES, o as normalizeExecSecurity, r as normalizeExecAsk, s as normalizeExecTarget, t as DEFAULT_EXEC_APPROVAL_TIMEOUT_MS } from "../exec-approvals-core-GflUelcW.mjs"; import { i as formatDurationSeconds, n as formatDurationHuman, r as formatDurationPrecise, t as formatDurationCompact } from "../format-duration-BIQQYTeV.mjs"; import { t as runTasksWithConcurrency } from "../run-with-concurrency-Dtu208ef.mjs"; import { t as normalizeHostname } from "../hostname-KSsoqRD2.mjs"; import { a as matchesNoProxy, c as shouldUseEnvHttpProxyForUrl, i as hasProxyEnvConfigured, n as hasEnvHttpProxyAgentConfigured, o as resolveEnvHttpProxyAgentOptions, r as hasEnvHttpProxyConfigured, s as resolveEnvHttpProxyUrl, t as PROXY_ENV_KEYS } from "../proxy-env-DxV5eJIK.mjs"; import { _ as resolvePinnedHostnameWithPolicy, a as createPinnedDispatcher, b as ssrfPolicyFromHttpBaseUrlAllowedOrigin, c as isBlockedHostnameOrIp, d as isPrivateNetworkAllowedByPolicy, f as isSameSsrFPolicy, g as resolvePinnedHostname, h as normalizeHostnameAllowlist, i as closeDispatcher, l as isHostnameAllowedByPattern, m as mergeSsrFPolicies, n as assertHostnameAllowedWithPolicy, o as createPinnedLookup, p as matchesHostnameAllowlist, r as assertPublicHostname, s as isBlockedHostname, t as SsrFBlockedError, u as isPrivateIpAddress, v as resolveSsrFPolicyForUrl, x as ssrfPolicyFromHttpBaseUrlFakeIpHostnameAllowlist, y as ssrfPolicyFromHttpBaseUrlAllowedHostname } from "../ssrf-D5TD9F1s.mjs"; import { c as withTrustedEnvProxyGuardedFetchMode, i as fetchWithSsrFGuard, l as withTrustedExplicitProxyGuardedFetchMode, o as retainSafeHeadersForCrossOriginRedirectHeaders, s as withStrictGuardedFetchMode, t as GUARDED_FETCH_MODE } from "../fetch-guard-CIAMeSj8.mjs"; import { n as fetchWithRuntimeDispatcher } from "../runtime-fetch-BRqf2mvl.mjs"; import { a as forceResetGlobalDispatcher, i as ensureGlobalUndiciStreamTimeouts, n as ensureGlobalUndiciDispatcherStreamTimeouts, o as globalUndiciStreamTimeoutMs, r as ensureGlobalUndiciEnvProxyDispatcher, s as resetGlobalUndiciStreamTimeoutsForTests, t as DEFAULT_UNDICI_STREAM_TIMEOUT_MS } from "../undici-global-dispatcher-CPCsqe0k.mjs"; import { a as generateSecureUuid, i as generateSecureToken, n as generateSecureHex, r as generateSecureInt, t as generateSecureFraction } from "../secure-random-BCtWGJkH.mjs"; import { c as emitHeartbeatEvent, d as resetHeartbeatEventsForTest, f as resolveIndicatorType, l as getLastHeartbeatEvent, u as onHeartbeatEvent } from "../system-event-ownership-rW7KBn85.mjs"; import { d as resetSystemEventsForTest, f as resolveSystemEventDeliveryContext } from "../system-events-BxmpB_BU.mjs"; import { a as enqueueSystemEventEntryFromSdk, c as isSystemEventContextChangedFromSdk, l as peekSystemEventEntriesFromSdk, n as drainSystemEventEntriesFromSdk, o as enqueueSystemEventFromSdk, r as drainSystemEventsFromSdk, s as hasSystemEventsFromSdk, t as consumeSelectedSystemEventEntriesFromSdk, u as peekSystemEventsFromSdk } from "../system-events-BkdW61X4.mjs"; import { t as retryAsync } from "../retry-LzDnlq6b.mjs"; import { a as mergeExecApprovalsSocketDefaults, c as resolveExecApprovalsDisplayPath, d as resolveExecApprovalsTranscriptPath, l as resolveExecApprovalsPath, t as DEFAULT_EXEC_APPROVAL_ASK_FALLBACK, u as resolveExecApprovalsSocketPath } from "../exec-approvals-config-BF54IW19.mjs"; import { a as addDurableCommandApproval, c as hasDurableExecApproval, f as persistAllowAlwaysDecision, h as resolveAllowAlwaysPersistenceDecision, i as addAllowlistEntry, l as hasExactCommandDurableExecApproval, m as resolveAllowAlwaysPatternCoverage, p as persistAllowAlwaysPatterns, u as hasNodeCommandAllowAlwaysMarker } from "../exec-approvals-authorization.kernel-BwTTU2c4.mjs"; import { c as readExecApprovalsSnapshot, f as saveExecApprovals, i as loadExecApprovals, n as ensureExecApprovals, u as restoreExecApprovalsSnapshot } from "../exec-approvals-store-B3Dzx_vP.mjs"; import { a as isWindowsPlatform, i as analyzeWindowsShellCommand, n as resolvePlannedSegmentArgv, o as tokenizeWindowsSegment, r as analyzeArgvCommand, s as windowsEscapeArg, t as buildEnforcedShellCommand } from "../exec-approvals-analysis-DRan0KvC.mjs"; import { a as isSafeBinUsage, c as resolveAllowAlwaysPatterns, i as evaluateShellAllowlistWithAuthorization, l as resolveSafeBins, n as evaluateExecAllowlistWithAuthorization, o as normalizeSafeBins, r as evaluateShellAllowlist, s as resolveAllowAlwaysPatternEntries, t as evaluateExecAllowlist } from "../exec-approvals-allowlist-4YPZdW-H.mjs"; import { c as requiresExecApproval, d as resolveExecApprovalUnavailableDecisions, i as isExecApprovalDecisionAllowed, l as resolveExecApprovalAllowedDecisions, n as OPTIONAL_EXEC_APPROVAL_DECISIONS, r as commandRequiresSecurityAuditSuppressionApproval, s as normalizeExecApprovalUnavailableDecisions, t as DEFAULT_EXEC_APPROVAL_DECISIONS, u as resolveExecApprovalRequestAllowedDecisions } from "../exec-approvals-policy-CMlDajgd.mjs"; import { i as resolveExecApprovalsFromFile, l as recordAllowlistMatchesUse, o as requestExecApprovalViaSocket, r as resolveExecApprovals, t as normalizeExecApprovals, u as recordAllowlistUse } from "../exec-approvals-BYWWK6_e.mjs"; import { t as stripInternalRuntimeScaffolding } from "../protocol-scaffolding-eM3dJlej.mjs"; import { a as PLUGIN_APPROVAL_DETAIL_MAX_LENGTH, c as buildPluginApprovalExpiredMessage, d as resolvePluginApprovalRequestAllowedDecisions, f as resolvePluginApprovalTimeoutMs, i as PLUGIN_APPROVAL_DESCRIPTION_MAX_LENGTH, l as buildPluginApprovalRequestMessage, n as DEFAULT_PLUGIN_APPROVAL_TIMEOUT_MS, o as PLUGIN_APPROVAL_TITLE_MAX_LENGTH, p as truncatePluginApprovalDetail, r as MAX_PLUGIN_APPROVAL_TIMEOUT_MS, s as approvalDecisionLabel, t as DEFAULT_PLUGIN_APPROVAL_DECISIONS, u as buildPluginApprovalResolvedMessage } from "../plugin-approvals-BL3jD3Ct.mjs"; import { i as normalizeScpRemotePath, n as isSafeScpRemotePath, r as normalizeScpRemoteHost, t as isSafeScpRemoteHost } from "../scp-host-Dr2V-FVZ.mjs"; import { i as resolveProxyFetchFromEnv, n as getProxyUrlFromFetch, r as makeProxyFetch, t as PROXY_FETCH_PROXY_URL } from "../proxy-fetch-DgBTkLL3.mjs"; import { n as wrapFetchWithAbortSignal, t as resolveFetch } from "../fetch-DnPozUXn.mjs"; import { n as createChannelApiRetryRunner, r as createRateLimitRetryRunner, t as CHANNEL_API_RETRY_DEFAULTS } from "../retry-policy-BVxOakZq.mjs"; import { a as loadSecretFileSync, c as tryReadSecretFileSync, l as writePrivateSecretFileAtomic, n as PRIVATE_SECRET_DIR_MODE, r as PRIVATE_SECRET_FILE_MODE, s as readSecretFileSync, t as DEFAULT_SECRET_FILE_MAX_BYTES } from "../secret-file-BUNgfGOI.mjs"; import { n as recordChannelActivity, t as getChannelActivity } from "../channel-activity-KGHrbxIK.mjs"; import { n as hasSystemMark, r as prefixSystemMessage, t as SYSTEM_MARK } from "../system-message-C34aMvlW.mjs"; import { o as resolveHeartbeatIntervalMs } from "../heartbeat-config-VnFirEcJ.mjs"; import { n as resolveHeartbeatSummaryForAgent, t as isHeartbeatEnabledForAgent } from "../heartbeat-summary-DNvcxTMh.mjs"; import { n as hasLegacyFlatAllowPrivateNetworkAlias, r as migrateLegacyFlatAllowPrivateNetworkAlias, t as createLegacyPrivateNetworkDoctorContract } from "../legacy-private-network-migration-CKFdg9Ho.mjs"; import { t as formatApprovalDisplayPath } from "../approval-display-paths-DlQSsCnq.mjs"; import { a as buildExecApprovalPendingReplyPayload, c as buildTypedApprovalActionDescriptors, d as buildTypedExecApprovalPresentation, f as formatExecApprovalExpiresIn, h as parseExecApprovalCommandText, i as buildExecApprovalCommandText, l as buildTypedApprovalPresentation, m as getExecApprovalReplyMetadata, n as buildApprovalPresentationFromActionDescriptors, o as buildExecApprovalPresentation, p as getExecApprovalApproverDmNoticeText, r as buildExecApprovalActionDescriptors, s as buildExecApprovalUnavailableReplyPayload, t as buildApprovalButtonPresentation, u as buildTypedExecApprovalPendingReplyPayload } from "../exec-approval-reply-KgDIYTbF.mjs"; import { i as resolveExecApprovalSessionTarget, n as resolveApprovalRequestSessionConversation, r as resolveApprovalRequestSessionTarget, t as resolveApprovalRequestOriginTarget } from "../exec-approval-session-target-C_g3JNgD.mjs"; import { a as isExecApprovalChannelRuntimeTerminalStartError, i as createExecApprovalChannelRuntime, n as deliverApprovalRequestViaChannelNativePlan, o as resolveChannelNativeApprovalDeliveryPlan, r as ExecApprovalChannelRuntimeTerminalStartError, t as createChannelNativeApprovalRuntime } from "../approval-native-runtime-MFbYOAf4.mjs"; import { t as resolveExecApprovalCommandDisplay } from "../exec-approval-command-display-D1Zo4AoM.mjs"; import { n as createRuntimeOutboundDelegates } from "../runtime-forwarders-hKzOfisj.mjs"; import { n as resolveAgentOutboundIdentity, t as normalizeOutboundIdentity } from "../identity-Ccy_uLJp.mjs"; import { n as resolveOutboundSendDep, t as resolveLegacyOutboundSendDepKeys } from "../send-deps-BMukjUa9.mjs"; import { t as sanitizeForPlainText } from "../sanitize-text-DNqwrwvR.mjs"; import { t as drainPendingDeliveries } from "../delivery-queue-runtime-CNV9wiJq.mjs"; import { t as waitForTransportReady } from "../transport-ready-CPGkXUOn.mjs"; import { t as resolveHeartbeatVisibility } from "../heartbeat-visibility-zKS5YYvG.mjs"; import { a as normalizeHostnameSuffixAllowlist, c as ssrfPolicyFromPrivateNetworkOptIn, i as isPrivateNetworkOptInEnabled, n as buildHostnameAllowlistPolicyFromSuffixAllowlist, o as ssrfPolicyFromAllowPrivateNetwork, r as isHttpsUrlAllowedByHostnameSuffixAllowlist, s as ssrfPolicyFromDangerouslyAllowPrivateNetwork, t as assertHttpUrlTargetsPrivateNetwork } from "../ssrf-policy-BeLYFp5h.mjs"; import { assertNoWindowsNetworkPath, basenameFromMediaSource, hasEncodedFileUrlSeparator, isWindowsNetworkPath, safeFileURLToPath, trySafeFileURLToPath } from "@openclaw/fs-safe/advanced"; //#region src/plugin-sdk/infra-runtime.ts /** * @deprecated Compatibility shim only. Keep old plugins working, but do not * add new imports here and do not use this subpath from repo code. * Prefer injected runtime APIs or documented typed-public subpaths instead. */ /** * @deprecated Shipped compat only; preserves the old substring semantics for * external plugins. Core chat classification now maps canonical failover * reasons (see gateway resolveChatErrorKindFromError). Removal with the next * plugin-SDK major. */ function detectErrorKind(err) { if (err === void 0) return; const message = formatErrorMessage(err).toLowerCase(); const code = extractErrorCode(err)?.toLowerCase(); if (message.includes("refusal") || message.includes("content_filter") || message.includes("sensitive") || message.includes("unhandled stop reason: refusal_policy")) return "refusal"; if (message.includes("rate limit") || message.includes("too many requests") || message.includes("429") || code === "429") return "rate_limit"; if (message.includes("timeout") || code === "etimedout" || code === "timeout") return "timeout"; if (message.includes("context length") || message.includes("too many tokens") || message.includes("token limit") || message.includes("context_window")) return "context_length"; } //#endregion export { CHANNEL_API_RETRY_DEFAULTS, DEFAULT_EXEC_APPROVAL_ASK_FALLBACK, DEFAULT_EXEC_APPROVAL_DECISIONS, DEFAULT_EXEC_APPROVAL_TIMEOUT_MS, DEFAULT_PLUGIN_APPROVAL_DECISIONS, DEFAULT_PLUGIN_APPROVAL_TIMEOUT_MS, DEFAULT_POSIX_TMP_ROOT, DEFAULT_SECRET_FILE_MAX_BYTES, DEFAULT_UNDICI_STREAM_TIMEOUT_MS, DEFAULT_WEBHOOK_BODY_TIMEOUT_MS, DEFAULT_WEBHOOK_MAX_BODY_BYTES, EXEC_TARGET_VALUES, ExecApprovalChannelRuntimeTerminalStartError, FILE_LOCK_TIMEOUT_ERROR_CODE, FsSafeError, GUARDED_FETCH_MODE, JsonFileReadError, MAX_PLUGIN_APPROVAL_TIMEOUT_MS, MAX_TIMER_TIMEOUT_MS, MAX_TIMER_TIMEOUT_SECONDS, OPTIONAL_EXEC_APPROVAL_DECISIONS, PLUGIN_APPROVAL_DESCRIPTION_MAX_LENGTH, PLUGIN_APPROVAL_DETAIL_MAX_LENGTH, PLUGIN_APPROVAL_TITLE_MAX_LENGTH, PRIVATE_SECRET_DIR_MODE, PRIVATE_SECRET_FILE_MODE, PROXY_ENV_KEYS, PROXY_FETCH_PROXY_URL, RequestBodyLimitError, SYSTEM_MARK, SsrFBlockedError, testApi as __test__, testApi, acquireFileLock, addAllowlistEntry, addDurableCommandApproval, analyzeArgvCommand, analyzeWindowsShellCommand, appendRegularFile, appendRegularFileSync, approvalDecisionLabel, areDiagnosticsEnabledForProcess, assertAbsolutePathInput, assertHostnameAllowedWithPolicy, assertHttpUrlTargetsPrivateNetwork, assertNoWindowsNetworkPath, assertPublicHostname, basenameFromMediaSource, bindAbortRelay, buildApprovalButtonPresentation, buildApprovalPresentationFromActionDescriptors, buildEnforcedShellCommand, buildExecApprovalActionDescriptors, buildExecApprovalCommandText, buildExecApprovalPendingReplyPayload, buildExecApprovalPresentation, buildExecApprovalUnavailableReplyPayload, buildHostnameAllowlistPolicyFromSuffixAllowlist, buildPluginApprovalExpiredMessage, buildPluginApprovalRequestMessage, buildPluginApprovalResolvedMessage, buildTimeoutAbortSignal, buildTypedApprovalActionDescriptors, buildTypedApprovalPresentation, buildTypedExecApprovalPendingReplyPayload, buildTypedExecApprovalPresentation, canonicalPathFromExistingAncestor, clampTimerTimeoutMs, closeDispatcher, collectErrorGraphCandidates, commandRequiresSecurityAuditSuppressionApproval, computeBackoff, consumeSelectedSystemEventEntriesFromSdk as consumeSelectedSystemEventEntries, consumeSelectedSystemEventEntriesFromSdk as consumeSystemEventEntries, createAsyncLock, createChannelApiRetryRunner, createChannelNativeApprovalRuntime, createDedupeCache, createExecApprovalChannelRuntime, createLegacyPrivateNetworkDoctorContract, createPinnedDispatcher, createPinnedLookup, createRateLimitRetryRunner, createRuntimeOutboundDelegates, deliverApprovalRequestViaChannelNativePlan, detectErrorKind, drainFileLockStateForTest, drainPendingDeliveries, drainSystemEventEntriesFromSdk as drainSystemEventEntries, drainSystemEventsFromSdk as drainSystemEvents, emitDiagnosticEvent, emitHeartbeatEvent, enqueueSystemEventFromSdk as enqueueSystemEvent, enqueueSystemEventEntryFromSdk as enqueueSystemEventEntry, ensureAbsoluteDirectory, ensureExecApprovals, ensureGlobalUndiciDispatcherStreamTimeouts, ensureGlobalUndiciEnvProxyDispatcher, ensureGlobalUndiciStreamTimeouts, evaluateExecAllowlist, evaluateExecAllowlistWithAuthorization, evaluateShellAllowlist, evaluateShellAllowlistWithAuthorization, expandEnvNormalizationKeys, expandHomePrefix, extractErrorCode, fetchWithRuntimeDispatcher, fetchWithSsrFGuard, fetchWithTimeout, findExistingAncestor, finiteSecondsToTimerSafeMilliseconds, forceResetGlobalDispatcher, formatApprovalDisplayPath, formatDurationCompact, formatDurationHuman, formatDurationPrecise, formatDurationSeconds, formatErrorMessage, formatExecApprovalExpiresIn, formatUncaughtError, generateSecureFraction, generateSecureHex, generateSecureInt, generateSecureToken, generateSecureUuid, getChannelActivity, getExecApprovalApproverDmNoticeText, getExecApprovalReplyMetadata, getLastHeartbeatEvent, getProxyUrlFromFetch, globalUndiciStreamTimeoutMs, hasDurableExecApproval, hasEncodedFileUrlSeparator, hasEnvHttpProxyAgentConfigured, hasEnvHttpProxyConfigured, hasErrnoCode, hasExactCommandDurableExecApproval, hasLegacyFlatAllowPrivateNetworkAlias, hasNodeCommandAllowAlwaysMarker, hasProxyEnvConfigured, hasSystemEventsFromSdk as hasSystemEvents, hasSystemMark, installRequestBodyLimitGuard, isBlockedHostname, isBlockedHostnameOrIp, isDiagnosticFlagEnabled, isDiagnosticsEnabled, isErrno, isExecApprovalChannelRuntimeTerminalStartError, isExecApprovalDecisionAllowed, isFastTestRuntimeEnv, isHeartbeatEnabledForAgent, isHostnameAllowedByPattern, isHttpsUrlAllowedByHostnameSuffixAllowlist, isPathInside, isPrivateIpAddress, isPrivateNetworkAllowedByPolicy, isPrivateNetworkOptInEnabled, isRequestBodyLimitError, isSafeBinUsage, isSafeScpRemoteHost, isSafeScpRemotePath, isSameSsrFPolicy, isSystemEventContextChangedFromSdk as isSystemEventContextChanged, isTruthyEnvValue, isVitestRuntimeEnv, isWSL, isWSL2Sync, isWSLEnv, isWSLSync, isWindowsNetworkPath, isWindowsPlatform, loadExecApprovals, loadSecretFileSync, logAcceptedEnvOption, makeProxyFetch, matchAllowlist, matchesDiagnosticFlag, matchesHostnameAllowlist, matchesNoProxy, mergeExecApprovalsSocketDefaults, mergeSsrFPolicies, migrateLegacyFlatAllowPrivateNetworkAlias, movePathToTrash, nonNegativeSecondsToSafeMilliseconds, normalizeEnv, normalizeExecApprovalUnavailableDecisions, normalizeExecApprovals, normalizeExecAsk, normalizeExecHost, normalizeExecMode, normalizeExecSecurity, normalizeExecTarget, normalizeHostname, normalizeHostnameAllowlist, normalizeHostnameSuffixAllowlist, normalizeOutboundIdentity, normalizeSafeBins, normalizeScpRemoteHost, normalizeScpRemotePath, normalizeZaiEnv, onDiagnosticEvent, onHeartbeatEvent, openLocalFileSafely, parseExecApprovalCommandText, parseExecArgvToken, parseFiniteNumber, parseStrictFiniteNumber, parseStrictInteger, parseStrictNonNegativeInteger, parseStrictPositiveInteger, pathExists, pathExistsSync, peekSystemEventEntriesFromSdk as peekSystemEventEntries, peekSystemEventsFromSdk as peekSystemEvents, persistAllowAlwaysDecision, persistAllowAlwaysPatterns, positiveSecondsToSafeMilliseconds, prefixSystemMessage, pruneMapToMaxSize, readDurableJsonFile, readErrorName, readExecApprovalsSnapshot, readFileWithinRoot, readJson, readJsonBodyWithLimit, readJsonFile, readJsonFileStrict, readJsonFileSync, readJsonIfExists, readJsonSync, readLocalFileFromRoots, readLocalFileSafely, readRegularFile, readRegularFileSync, readRequestBodyWithLimit, readRootJsonObjectSync, readRootJsonSync, readRootStructuredFileSync, readSecretFileSync, readSecureFile, recordAllowlistMatchesUse, recordAllowlistUse, recordChannelActivity, requestBodyErrorToText, requestExecApprovalViaSocket, requireValidExecTarget, requiresExecApproval, resetFileLockStateForTest, resetGlobalUndiciStreamTimeoutsForTests, resetHeartbeatEventsForTest, resetSystemEventsForTest, resetWSLStateForTests, resolveAbsolutePathForRead, resolveAbsolutePathForWrite, resolveAgentOutboundIdentity, resolveAllowAlwaysPatternCoverage, resolveAllowAlwaysPatternEntries, resolveAllowAlwaysPatterns, resolveAllowAlwaysPersistenceDecision, resolveAllowlistCandidatePath, resolveApprovalAuditCandidatePath, resolveApprovalAuditTrustPath, resolveApprovalRequestOriginTarget, resolveApprovalRequestSessionConversation, resolveApprovalRequestSessionTarget, resolveChannelNativeApprovalDeliveryPlan, resolveCommandResolution, resolveCommandResolutionFromArgv, resolveNonNegativeIntegerOption as resolveDedupeNonNegativeInteger, resolveDiagnosticFlags, resolveEffectiveHomeDir, resolveEnvHttpProxyAgentOptions, resolveEnvHttpProxyUrl, resolveEnvNormalizationKeys, resolveExecApprovalAllowedDecisions, resolveExecApprovalCommandDisplay, resolveExecApprovalRequestAllowedDecisions, resolveExecApprovalSessionTarget, resolveExecApprovalUnavailableDecisions, resolveExecApprovals, resolveExecApprovalsDisplayPath, resolveExecApprovalsFromFile, resolveExecApprovalsPath, resolveExecApprovalsSocketPath, resolveExecApprovalsTranscriptPath, resolveExecutableTrustPath, resolveExecutionTargetCandidatePath, resolveExecutionTargetResolution, resolveExecutionTargetTrustPath, resolveExpiresAtMsFromDurationOrEpoch, resolveExpiresAtMsFromDurationSeconds, resolveExpiresAtMsFromEpochSeconds, resolveFetch, resolveGlobalDedupeCache, resolveHeartbeatIntervalMs, resolveHeartbeatSummaryForAgent, resolveHeartbeatVisibility, resolveHomeRelativePath, resolveIndicatorType, resolveLegacyOutboundSendDepKeys, resolveLocalPathFromRootsSync, resolveOpenedFileRealPathForHandle, resolveOsHomeDir, resolveOsHomeRelativePath, resolveOutboundSendDep, resolvePinnedHostname, resolvePinnedHostnameWithPolicy, resolvePlannedSegmentArgv, resolvePluginApprovalRequestAllowedDecisions, resolvePluginApprovalTimeoutMs, resolvePolicyAllowlistCandidatePath, resolvePolicyTargetCandidatePath, resolvePolicyTargetResolution, resolvePolicyTargetTrustPath, resolvePreferredOpenClawTmpDir, resolveProxyFetchFromEnv, resolveRegularFileAppendFlags, resolveRequiredHomeDir, resolveRequiredOsHomeDir, resolveRetryConfig, resolveSafeBins, resolveSsrFPolicyForUrl, resolveSystemEventDeliveryContext, resolveUserPath, restoreExecApprovalsSnapshot, retainSafeHeadersForCrossOriginRedirectHeaders, retryAsync, root, runTasksWithConcurrency, safeFileURLToPath, sanitizeForPlainText, sanitizeUntrustedFileName, saveExecApprovals, shouldUseEnvHttpProxyForUrl, sleepWithAbort, ssrfPolicyFromAllowPrivateNetwork, ssrfPolicyFromDangerouslyAllowPrivateNetwork, ssrfPolicyFromHttpBaseUrlAllowedHostname, ssrfPolicyFromHttpBaseUrlAllowedOrigin, ssrfPolicyFromHttpBaseUrlFakeIpHostnameAllowlist, ssrfPolicyFromPrivateNetworkOptIn, statRegularFile, statRegularFileSync, stringifyNonErrorCause, stripInternalRuntimeScaffolding, toErrorObject, tokenizeWindowsSegment, truncatePluginApprovalDetail, tryReadJson, tryReadJsonSync, tryReadSecretFileSync, trySafeFileURLToPath, waitForTransportReady, walkDirectory, walkDirectorySync, windowsEscapeArg, withFileLock, withStrictGuardedFetchMode, withTimeout, withTrustedEnvProxyGuardedFetchMode, withTrustedExplicitProxyGuardedFetchMode, wrapFetchWithAbortSignal, writeExternalFileWithinRoot, writeFileWithinRoot, writeJson, writeJsonAtomic, writeJsonSync, writePrivateSecretFileAtomic, writeTextAtomic };