mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 05:30:42 +00:00
refactor: narrow internal agent exports
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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[] {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export function flattenStringOnlyCompletionContent(content: unknown): unknown {
|
||||
function flattenStringOnlyCompletionContent(content: unknown): unknown {
|
||||
if (!Array.isArray(content)) {
|
||||
return content;
|
||||
}
|
||||
|
||||
@@ -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[];
|
||||
} {
|
||||
|
||||
Reference in New Issue
Block a user