docs: document config io helpers

This commit is contained in:
Peter Steinberger
2026-06-04 03:49:54 -04:00
parent 43190f5248
commit 6989d6283a
24 changed files with 24 additions and 0 deletions

View File

@@ -1,3 +1,4 @@
// Resolves and classifies config paths for reads, writes, and metadata.
import { isPlainObject } from "../utils.js";
import { isBlockedObjectKey } from "./prototype-keys.js";

View File

@@ -1,3 +1,4 @@
// Covers identity avatar config normalization and file-path handling.
import path from "node:path";
import { describe, expect, it } from "vitest";
import { withTempHome } from "./test-helpers.js";

View File

@@ -1,3 +1,4 @@
// Regresses rejection of legacy routing allowFrom config.
import { describe, expect, it } from "vitest";
import { validateConfigObject } from "./validation.js";

View File

@@ -1,3 +1,4 @@
// Verifies config metadata timestamp coercion behavior.
import { describe, expect, it } from "vitest";
import { validateConfigObject } from "./validation.js";

View File

@@ -1,3 +1,4 @@
// Covers config IO clobber snapshot handling during writes.
import fs from "node:fs";
import fsp from "node:fs/promises";
import os from "node:os";

View File

@@ -1,3 +1,4 @@
// Verifies config IO compatibility loading and migration behavior.
import fs from "node:fs/promises";
import os from "node:os";
import path from "node:path";

View File

@@ -1,3 +1,4 @@
// Covers config IO recovery observation after corrupt or missing files.
import fs from "node:fs";
import fsp from "node:fs/promises";
import os from "node:os";

View File

@@ -1,3 +1,4 @@
// Verifies owner display secrets stay redacted in config IO paths.
import { describe, expect, it } from "vitest";
import {
type OwnerDisplaySecretRuntimeState,

View File

@@ -1,3 +1,4 @@
// Prepares config writes by diffing current state and preserving metadata.
import { isDeepStrictEqual } from "node:util";
import { normalizeConfiguredProviderCatalogModelId } from "@openclaw/model-catalog-core/provider-model-id-normalization";
import { parseConfigPathArrayIndex } from "../shared/path-array-index.js";

View File

@@ -1,3 +1,4 @@
// Defines shared legacy config rule contracts for detection and migration.
export type LegacyConfigRule = {
path: string[];
message: string;

View File

@@ -1,3 +1,4 @@
// Verifies plugin auto-enable prefer-over precedence rules.
import fs from "node:fs";
import path from "node:path";
import { afterEach, describe, expect, it, vi } from "vitest";

View File

@@ -1,3 +1,4 @@
// Builds base config schema metadata shared across generated config surfaces.
import { isSensitiveUrlConfigPath } from "@openclaw/net-policy/redact-sensitive-url";
import { VERSION } from "../version.js";
import { FIELD_HELP } from "./schema.help.js";

View File

@@ -1,3 +1,4 @@
// Verifies generated base config schema snapshots and sensitive redaction.
import { SENSITIVE_URL_HINT_TAG } from "@openclaw/net-policy/redact-sensitive-url";
import { describe, expect, it } from "vitest";
import { computeBaseConfigSchemaResponse } from "./schema-base.js";

View File

@@ -1,3 +1,4 @@
// Defines user-facing config field labels used by schema metadata.
import { MEDIA_AUDIO_FIELD_LABELS } from "./media-audio-field-metadata.js";
export const FIELD_LABELS: Record<string, string> = {

View File

@@ -1,3 +1,4 @@
// Covers shared config schema fragments and defaults.
import { describe, expect, it } from "vitest";
import { findWildcardHintMatch, schemaHasChildren } from "./schema.shared.js";

View File

@@ -1,3 +1,4 @@
// Covers state-directory dotenv discovery, parsing, and merge behavior.
import fs from "node:fs/promises";
import os from "node:os";
import path from "node:path";

View File

@@ -1,3 +1,4 @@
// Loads state-directory dotenv entries used by config and runtime startup.
import fs from "node:fs";
import path from "node:path";
import dotenv from "dotenv";

View File

@@ -1,3 +1,4 @@
// Defines common channel messaging configuration types.
import type {
BlockStreamingCoalesceConfig,
ContextVisibilityMode,

View File

@@ -1,3 +1,4 @@
// Defines message queue and delivery configuration types.
import type { QueueDropPolicy, QueueMode, QueueModeByProvider } from "./types.queue.js";
import type { TtsConfig } from "./types.tts.js";

View File

@@ -1,3 +1,4 @@
// Defines Microsoft Teams channel configuration types.
import type {
BlockStreamingCoalesceConfig,
ChannelPreviewStreamingConfig,

View File

@@ -1,3 +1,4 @@
// Defines Slack channel configuration types.
import type {
ChannelStreamingBlockConfig,
ChannelStreamingProgressConfig,

View File

@@ -1,3 +1,4 @@
// Verifies config validation rejects unsupported enumerated values.
import { describe, expect, it } from "vitest";
import { z } from "zod";
import { testing, validateConfigObjectRaw } from "./validation.js";

View File

@@ -1,3 +1,4 @@
// Verifies legacy-rule validation uses the fast path for known config shapes.
import { beforeEach, describe, expect, it, vi } from "vitest";
import type { LegacyConfigRule } from "./legacy.shared.js";

View File

@@ -1,3 +1,4 @@
// Guards post-compaction config schema behavior against regressions.
import { describe, expect, it } from "vitest";
import { ToolsSchema } from "./zod-schema.agent-runtime.js";
import { OpenClawSchema } from "./zod-schema.js";