docs: document infra event helpers

This commit is contained in:
Peter Steinberger
2026-06-04 03:22:42 -04:00
parent 79dc565825
commit 25eb63885d
24 changed files with 24 additions and 0 deletions

View File

@@ -1,3 +1,4 @@
// Tracks last inbound/outbound activity for channel accounts.
import type { ChannelId } from "../channels/plugins/channel-id.types.js";
/** Direction of the last observed activity for a channel/account pair. */

View File

@@ -1,3 +1,4 @@
// Resolves event-triggered work to the correct session key and target.
import { isRecord } from "@openclaw/normalization-core/record-coerce";
import { normalizeLowercaseStringOrEmpty } from "@openclaw/normalization-core/string-coerce";
import type { SessionScope } from "../config/types.base.js";

View File

@@ -1,3 +1,4 @@
// Defines channel-native approval runtime contracts.
import type { OpenClawConfig } from "../config/types.openclaw.js";
import type { ExecApprovalRequest, ExecApprovalResolved } from "./exec-approvals.js";
import type { PluginApprovalRequest, PluginApprovalResolved } from "./plugin-approvals.js";

View File

@@ -1,3 +1,4 @@
// Resolves approval delivery targets from sessions and turn sources.
import { normalizeOptionalString } from "@openclaw/normalization-core/string-coerce";
import { resolveSessionConversationRef } from "../channels/plugins/session-conversation.js";
import type { OpenClawConfig } from "../config/types.openclaw.js";

View File

@@ -1,3 +1,4 @@
// Resolves trusted directories for safe-bin allowlist policy.
import fs from "node:fs";
import path from "node:path";
import {

View File

@@ -1,3 +1,4 @@
// Covers fatal error hook registration and output collection.
import { beforeEach, describe, expect, it } from "vitest";
import {
registerFatalErrorHook,

View File

@@ -1,3 +1,4 @@
// Covers git commit helper behavior in fake repositories.
import fs from "node:fs/promises";
import path from "node:path";
import process from "node:process";

View File

@@ -1,3 +1,4 @@
// Discovers git repository roots by walking ancestor directories.
import fs from "node:fs";
import path from "node:path";

View File

@@ -1,3 +1,4 @@
// Covers heartbeat commitment checks and runner scheduling behavior.
import fs from "node:fs/promises";
import path from "node:path";
import { afterEach, describe, expect, it, vi } from "vitest";

View File

@@ -1,3 +1,4 @@
// Covers heartbeat system-event isolation by stable session keys.
import fs from "node:fs/promises";
import { afterEach, describe, expect, it, vi } from "vitest";
import * as replyModule from "../auto-reply/reply.js";

View File

@@ -1,3 +1,4 @@
// Covers heartbeat model override routing.
import { afterEach, describe, expect, it, vi } from "vitest";
import type { OpenClawConfig } from "../config/config.js";
import { resolveAgentMainSessionKey, resolveMainSessionKey } from "../config/sessions.js";

View File

@@ -1,3 +1,4 @@
// Covers heartbeat typing callback cadence and gating.
import { describe, expect, it, vi } from "vitest";
import type { ChannelPlugin } from "../channels/plugins/types.public.js";
import type { OpenClawConfig } from "../config/config.js";

View File

@@ -1,3 +1,4 @@
// Tracks heartbeat wake requests, busy skips, and retry timing.
import { normalizeOptionalString } from "@openclaw/normalization-core/string-coerce";
import { resolveTimerTimeoutMs } from "../shared/number-coercion.js";
import { normalizeHeartbeatWakeReason } from "./heartbeat-reason.js";

View File

@@ -1,3 +1,4 @@
// Covers inline CLI option token parsing.
import { describe, expect, it } from "vitest";
import { parseInlineOptionToken } from "./inline-option-token.js";

View File

@@ -1,3 +1,4 @@
// Covers machine name resolution fallback behavior.
import os from "node:os";
import { importFreshModule } from "openclaw/plugin-sdk/test-fixtures";
import { afterEach, describe, expect, it, vi } from "vitest";

View File

@@ -1,3 +1,4 @@
// Loads node:sqlite with OpenClaw warning handling.
import { createRequire } from "node:module";
import { formatErrorMessage } from "./errors.js";
import { installProcessWarningFilter } from "./warning-filter.js";

View File

@@ -1,3 +1,4 @@
// Normalizes package tag inputs for install/update flows.
import { normalizeOptionalString } from "@openclaw/normalization-core/string-coerce";
/** Normalizes a package tag input, stripping known package-name prefixes when present. */

View File

@@ -1,3 +1,4 @@
// Covers gateway port availability and diagnostics behavior.
import net from "node:net";
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import { stripAnsi } from "../../packages/terminal-core/src/ansi.js";

View File

@@ -1,3 +1,4 @@
// Checks gateway port usage and reports listener diagnostics.
import { danger, info, shouldLogVerbose, warn } from "../globals.js";
import { logDebug } from "../logger.js";
import type { RuntimeEnv } from "../runtime.js";

View File

@@ -1,3 +1,4 @@
// Creates private fs-safe file stores.
import "./fs-safe-defaults.js";
import {
fileStore,

View File

@@ -1,3 +1,4 @@
// Covers provider usage auth profile key normalization.
import nodeFs from "node:fs";
import fs from "node:fs/promises";
import path from "node:path";

View File

@@ -1,3 +1,4 @@
// Detects remote/container environments where local desktop UX is unavailable.
import { isWSLEnv } from "./wsl.js";
// Remote environment detection gates local UX that depends on a desktop session

View File

@@ -1,3 +1,4 @@
// Exposes sibling temp file writes with fs-safe defaults.
import "./fs-safe-defaults.js";
// Atomic sibling temp writes preserve target-directory permissions and avoid

View File

@@ -1,3 +1,4 @@
// Covers system event queue routing, draining, and formatting.
import { beforeEach, describe, expect, it } from "vitest";
import { drainFormattedSystemEvents } from "../auto-reply/reply/session-system-events.js";
import type { OpenClawConfig } from "../config/config.js";