refactor: narrow internal agent exports

This commit is contained in:
Peter Steinberger
2026-05-01 08:46:50 +01:00
parent 9d21df251e
commit 8ce44b057f
5 changed files with 8 additions and 8 deletions

View File

@@ -1,4 +1,4 @@
export type CompiledGlobPattern =
type CompiledGlobPattern =
| { kind: "all" }
| { kind: "exact"; value: string }
| { kind: "regex"; value: RegExp };
@@ -8,7 +8,7 @@ function escapeRegex(value: string) {
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
}
export function compileGlobPattern(params: {
function compileGlobPattern(params: {
raw: string;
normalize: (value: string) => string;
}): CompiledGlobPattern {

View File

@@ -2,14 +2,14 @@ import type { OpenClawConfig } from "../config/types.openclaw.js";
import { resolveOwningPluginIdsForProvider } from "../plugins/providers.js";
import { normalizeProviderId } from "./provider-id.js";
export type LiveProviderOwnerContext = {
type LiveProviderOwnerContext = {
config?: OpenClawConfig;
workspaceDir?: string;
env?: NodeJS.ProcessEnv;
ownerCache: Map<string, readonly string[]>;
};
export function resolveCachedOwningPluginIdsForProvider(
function resolveCachedOwningPluginIdsForProvider(
provider: string,
context: LiveProviderOwnerContext,
): readonly string[] {

View File

@@ -2,7 +2,7 @@ import { normalizeProviderModelIdWithManifest } from "../plugins/manifest-model-
import { normalizeLowercaseStringOrEmpty } from "../shared/string-coerce.js";
import { normalizeProviderId } from "./provider-id.js";
export type StaticModelRef = {
type StaticModelRef = {
provider: string;
model: string;
};
@@ -42,7 +42,7 @@ export function normalizeStaticProviderModelId(
);
}
export function parseStaticModelRef(raw: string, defaultProvider: string): StaticModelRef | null {
function parseStaticModelRef(raw: string, defaultProvider: string): StaticModelRef | null {
const trimmed = raw.trim();
if (!trimmed) {
return null;

View File

@@ -1,4 +1,4 @@
export function flattenStringOnlyCompletionContent(content: unknown): unknown {
function flattenStringOnlyCompletionContent(content: unknown): unknown {
if (!Array.isArray(content)) {
return content;
}

View File

@@ -232,7 +232,7 @@ function buildScopedGroupIdCandidates(groupId?: string | null): string[] {
return [raw];
}
export function resolveGroupContextFromSessionKey(sessionKey?: string | null): {
function resolveGroupContextFromSessionKey(sessionKey?: string | null): {
channel?: string;
groupIds?: string[];
} {