mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-13 18:36:04 +00:00
docs: document plugin auth helpers
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Applies plugin middleware to agent tool results at runtime boundaries.
|
||||
import type {
|
||||
AgentToolResultMiddleware,
|
||||
AgentToolResultMiddlewareOptions,
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Covers manifest contract eligibility decisions.
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
const mocks = vi.hoisted(() => ({
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Covers plugin-backed memory state registration and reset behavior.
|
||||
import { afterEach, describe, expect, it } from "vitest";
|
||||
import {
|
||||
resetMemoryPluginState,
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Verifies plugin scope parsing and boundary checks.
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { normalizePluginIdScope } from "./plugin-scope.js";
|
||||
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Runtime bridge for provider API-key auth configured by plugins.
|
||||
import { applyAuthProfileConfig, buildApiKeyCredential } from "./provider-auth-helpers.js";
|
||||
import {
|
||||
ensureApiKeyFromOptionEnvOrPrompt,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Runtime boundary for resolving provider auth choices from plugins.
|
||||
import {
|
||||
resolveProviderPluginChoice as resolveProviderPluginChoiceImpl,
|
||||
runProviderModelSelectedHook as runProviderModelSelectedHookImpl,
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Provides shared assertions for provider plugin runtime tests.
|
||||
import { expect } from "vitest";
|
||||
|
||||
const openaiCodexCatalogEntries = [
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Verifies runtime setup registry loading and lazy boundaries.
|
||||
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||
import {
|
||||
clearCurrentPluginMetadataSnapshot,
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user