docs: document plugin auth helpers

This commit is contained in:
Peter Steinberger
2026-06-04 04:19:03 -04:00
parent 6d6aba2be5
commit ee282c6de5
24 changed files with 24 additions and 0 deletions

View File

@@ -1,3 +1,4 @@
// Builds plugin activation context from config, discovery, and manifests.
import { applyPluginAutoEnable } from "../config/plugin-auto-enable.js";
import type { OpenClawConfig } from "../config/types.openclaw.js";
import {

View File

@@ -1,3 +1,4 @@
// Applies plugin middleware to agent tool results at runtime boundaries.
import type {
AgentToolResultMiddleware,
AgentToolResultMiddlewareOptions,

View File

@@ -1,3 +1,4 @@
// Loads bundled plugin metadata without activating plugin runtime code.
import fs from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";

View File

@@ -1,3 +1,4 @@
// Verifies plugin dependency denylist enforcement.
import fs from "node:fs";
import path from "node:path";
import { describe, expect, it } from "vitest";

View File

@@ -1,3 +1,4 @@
// Resolves plugin enablement state from config and channel context.
import { normalizeChatChannelId } from "../channels/ids.js";
import type { OpenClawConfig } from "../config/types.openclaw.js";
import { setPluginEnabledInConfig } from "./toggle-config.js";

View File

@@ -1,3 +1,4 @@
// Covers installed plugin index record parsing and normalization.
import fs from "node:fs";
import os from "node:os";
import path from "node:path";

View File

@@ -1,3 +1,4 @@
// Shares interactive plugin metadata normalization across registries.
import { normalizeOptionalLowercaseString } from "@openclaw/normalization-core/string-coerce";
export function toPluginInteractiveRegistryKey(channel: string, namespace: string): string {

View File

@@ -1,3 +1,4 @@
// Verifies plugin loader prefer-over selection behavior.
import fs from "node:fs";
import os from "node:os";
import path from "node:path";

View File

@@ -1,3 +1,4 @@
// Covers manifest contract eligibility decisions.
import { beforeEach, describe, expect, it, vi } from "vitest";
const mocks = vi.hoisted(() => ({

View File

@@ -1,3 +1,4 @@
// Covers plugin-backed memory state registration and reset behavior.
import { afterEach, describe, expect, it } from "vitest";
import {
resetMemoryPluginState,

View File

@@ -1,3 +1,4 @@
// Covers migration provider runtime hooks supplied by plugins.
import { beforeEach, describe, expect, it, vi } from "vitest";
import type { OpenClawConfig } from "../config/types.openclaw.js";
import type { PluginRegistry } from "./registry-types.js";

View File

@@ -1,3 +1,4 @@
// Verifies plugin scope parsing and boundary checks.
import { describe, expect, it } from "vitest";
import { normalizePluginIdScope } from "./plugin-scope.js";

View File

@@ -1,3 +1,4 @@
// Detects plugin version drift between config, manifests, and installs.
import type { OpenClawConfig } from "../config/types.js";
import type { PluginInstallRecord } from "../config/types.plugins.js";
import { parseClawHubPluginSpec } from "../infra/clawhub-spec.js";

View File

@@ -1,3 +1,4 @@
// Runtime bridge for provider API-key auth configured by plugins.
import { applyAuthProfileConfig, buildApiKeyCredential } from "./provider-auth-helpers.js";
import {
ensureApiKeyFromOptionEnvOrPrompt,

View File

@@ -1,3 +1,4 @@
// Runtime boundary for resolving provider auth choices from plugins.
import {
resolveProviderPluginChoice as resolveProviderPluginChoiceImpl,
runProviderModelSelectedHook as runProviderModelSelectedHookImpl,

View File

@@ -1,3 +1,4 @@
// Covers provider auth input collection and credential handling.
import { afterEach, describe, expect, it, vi } from "vitest";
import type { WizardPrompter } from "../wizard/prompts.js";
import {

View File

@@ -1,3 +1,4 @@
// Provides shared assertions for provider plugin runtime tests.
import { expect } from "vitest";
const openaiCodexCatalogEntries = [

View File

@@ -1,3 +1,4 @@
// Resolves provider thinking-level policy from plugin metadata.
import { normalizeProviderId } from "@openclaw/model-catalog-core/provider-id";
import { resolveBundledProviderPolicySurface } from "./provider-public-artifacts.js";
import type {

View File

@@ -1,3 +1,4 @@
// Verifies runtime setup registry loading and lazy boundaries.
import { afterEach, describe, expect, it, vi } from "vitest";
import {
clearCurrentPluginMetadataSnapshot,

View File

@@ -1,3 +1,4 @@
// Covers plugin status snapshots built from registry state.
import fs from "node:fs";
import path from "node:path";
import { afterEach, describe, expect, it } from "vitest";

View File

@@ -1,3 +1,4 @@
// Verifies optional plugin tool registration and absence handling.
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import { DEFAULT_PLUGIN_TOOLS_ALLOWLIST_ENTRY } from "../agents/tool-policy.js";
import { resetLogger, setLoggerOverride } from "../logging/logger.js";

View File

@@ -1,3 +1,4 @@
// Shares web fetch provider loading helpers across provider plugins.
import type { PluginLoadOptions } from "./loader.js";
import type { PluginWebFetchProviderEntry } from "./types.js";
import {

View File

@@ -1,3 +1,4 @@
// Verifies web-search credential presence checks for plugins.
import fs from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";

View File

@@ -1,3 +1,4 @@
// Covers wired hook inbound-claim dispatch behavior.
import { describe, expect, it, vi } from "vitest";
import { createHookRunnerWithRegistry } from "./hooks.test-helpers.js";